Selaa lähdekoodia

feature: 首页界面命名选中问题

Damon 8 kuukautta sitten
vanhempi
commit
8d8baf0d3b
2 muutettua tiedostoa jossa 12 lisäystä ja 9 poistoa
  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'
               });