瀏覽代碼

feature: 删除无效代码

Damon 8 月之前
父節點
當前提交
f3e69775f5
共有 1 個文件被更改,包括 16 次插入32 次删除
  1. 16 32
      pages/index/index.js

+ 16 - 32
pages/index/index.js

@@ -48,7 +48,6 @@ Page({
   onLoad(options) {
     var that = this;
     that.onUserInfoLoad();
-    that.onHomeLoad();
     that.onBannerLoad();
   },
 
@@ -58,39 +57,25 @@ Page({
     that.onBannerShow();
   },
 
-  onHomeLoad() {
-    var that = this;
-    const str = setTimeout(() => {
-      clearTimeout(str);
-      if (that.data.isOneLoading) {
-        that.setData({
-          isOneLoading: false,
-        });
-      }
-    }, 500);
-  },
-
   onHomeShow() {
     var that = this;
-    if ((!that.data.isOneLoading)) {
-      var userInfo = wx.getStorageSync("userInfo") || "";
-      if (!strings.isEmpty(userInfo)) {
-        // 获取设备本地数据
-        if (app.globalData.newDeviceId) {
-          that.getDeviceData();
-        }
-        // 更新
-        else if (that.data.deviceListIndex !== null) {
-          that.actionDevice(that.data.deviceListIndex);
-        }
+    var userInfo = wx.getStorageSync("userInfo") || "";
+    if (!strings.isEmpty(userInfo)) {
+      // 获取设备本地数据
+      if (app.globalData.newDeviceId) {
+        that.getDeviceData();
       }
-      // 取消订阅
-      else {
-        if (that.data.thisDeviceMac !== null) {
-          app.unsubscribe(`/${that.data.thisDeviceMac}/user/pub_response`);
-        };
+      // 更新
+      else if (that.data.deviceListIndex !== null) {
+        that.actionDevice(that.data.deviceListIndex);
       }
-    };
+    }
+    // 取消订阅
+    else {
+      if (that.data.thisDeviceMac !== null) {
+        app.unsubscribe(`/${that.data.thisDeviceMac}/user/pub_response`);
+      };
+    }
   },
 
   ///开始时home的
@@ -376,8 +361,7 @@ Page({
   },
 
   getchannelData(clientType) {
-    var that = this;
-    console.log("gadfadsfqwwerqewrqr==000=" + clientType);
+    var that = this;Ï
     if (that.data.deviceListIndex === null) {
       return;
     };