Procházet zdrojové kódy

Merge branch 'develop/3.2.4' of http://60.205.190.38:9000/zhaoheqing/wxmini into develop/3.2.4

zeng.chen před 8 měsíci
rodič
revize
7bc675a9f2
2 změnil soubory, kde provedl 12 přidání a 9 odebrání
  1. 11 8
      pages/index/index.js
  2. 1 1
      pages/login/login.js

+ 11 - 8
pages/index/index.js

@@ -103,7 +103,7 @@ Page({
       }
     });
     // 登录
-    this.homeLogin();
+    this.login();
   },
 
   onMeLoad() {
@@ -140,7 +140,7 @@ Page({
         success() {
           if (app.globalData.newDeviceId) {
             // 获取设备本地数据
-            _this.getHomeDeviceData();
+            _this.getDeviceData();
           } else if (_this.data.deviceListIndex !== null) {
             // 更新
             _this.actionDevice(_this.data.deviceListIndex);
@@ -154,7 +154,8 @@ Page({
     this.onLoad();
   },
 
-  homeLogin() {
+  ////开始是home的
+  login() {
     wx.login({
       success: res => {
         let phone = undefined;
@@ -185,7 +186,7 @@ Page({
             return;
           };
           // 获取设备本地数据
-          this.getHomeDeviceData();
+          this.getDeviceData();
 
           _this.setData({
             showLogin: false,
@@ -202,7 +203,8 @@ Page({
     })
   },
 
-  getHomeDeviceData() {
+  ///开始时home的
+  getDeviceData() {
     // 获取设备数据
     wx.getStorage({
       key: 'devicelist',
@@ -250,6 +252,7 @@ Page({
 
   // 回调
   mqttCallback(type, option) {
+    console.log("gadsfadsfqwerq===" + type + "===" + option);
     let payloads = null;
     if (option) {
       payloads = JSON.parse(option.payload);
@@ -417,6 +420,7 @@ Page({
     if (this.data.deviceList.length === 0 || this.data.deviceListIndex === null) {
       return
     };
+
     let topic = `/AIrSMArT_${this.data.deviceList[this.data.deviceListIndex].name.split("BLUFI_")[1]}/user/pub_response`;
     app.subscribe(topic);
     const obj = {
@@ -503,9 +507,8 @@ Page({
     });
   },
   goDeviceConnect() {
-    routeUtil.jump(route_constant.deviceList)
-
-    return;
+    // routeUtil.jump(route_constant.deviceList)
+    // return;
     wx.navigateTo({
       url: './../deviceConnect0/deviceConnect0',
     });

+ 1 - 1
pages/login/login.js

@@ -107,7 +107,7 @@ Page({
           success() {
             setTimeout(() => {
               // 重新登录
-              getCurrentPages()[0].homeLogin();
+              getCurrentPages()[0].login();
               wx.redirectTo({
                 url: './../deviceConnect0/deviceConnect0?isLognlink=0'
               });