ソースを参照

feature: 兼容处理目标设备

Damon 7 ヶ月 前
コミット
d8b719f441
1 ファイル変更14 行追加1 行削除
  1. 14 1
      utils/lexin/message.js

+ 14 - 1
utils/lexin/message.js

@@ -34,6 +34,7 @@ function getDeviceInfo(payloads) {
   const app = getApp();
   const strings = require('../strings');
   const lexin_util = require('../lexin/util');
+  const lexin_devices = require('../lexin/devices');
   var pages = getCurrentPages();
   var deviceList = pages[0].getDeviceList();
   if (!strings.isEmpty(deviceList)) {
@@ -81,14 +82,26 @@ function getDeviceInfo(payloads) {
 
     /// 去更新选中目标
     if (!strings.isEmpty(currentDeviceId)) {
+      var targetDevice = null;
       for (var i = 0; i < deviceList.length; i++) {
         var device = deviceList[i];
         var deviceId = device.deviceId;
         if (deviceId == currentDeviceId) {
-          pages[0].refreshCurrentDevice(device);
+          targetDevice = device;
           break;
         }
       }
+
+      ///处理目标设备
+      if (targetDevice != null) {
+        var clientTypes = lexin_devices.clientTypes;
+        for (var i = 0; i < clientTypes.length; i++) {
+          if (clientTypes[i] == targetDevice.ProdModel) {
+            pages[0].refreshCurrentDevice(device);
+            break;
+          }
+        }
+      }
     }
   }
 };