zhaoxiaohai 3 роки тому
батько
коміт
c1e0948527
1 змінених файлів з 14 додано та 3 видалено
  1. 14 3
      pages/tabbar/home/index.js

+ 14 - 3
pages/tabbar/home/index.js

@@ -114,8 +114,15 @@ Page({
                 apps: {}
             })
             /* 首页小组件查询 */
-            let home = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['首页'])[0].apps[0].meta.wedgits;
-            if (home.some(v => v.wedgit == 'homedatadisplay')) subassembly.push('homedatadisplay');
+            try {
+                let home = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['首页'])[0].apps[0].meta.wedgits;
+                if (home.some(v => v.wedgit == 'homedatadisplay')) subassembly.push('homedatadisplay');
+            } catch (e) {
+                this.setData({
+                    gridList,
+                    subassembly: []
+                })
+            }
             this.setData({
                 gridList,
                 subassembly
@@ -145,7 +152,11 @@ Page({
         }, false).then(res => {
             if (res.data.count == 0) return;
             if (res.data.count > 99) res.data.count = '99+';
-            this.data.gridList[index].count = res.data.count;
+            try{
+                this.data.gridList[index].count = res.data.count;
+            }catch(e){
+                
+            }
             this.setData({
                 gridList: this.data.gridList
             })