Jelajahi Sumber

通告改ID

zhaoxiaohai 3 tahun lalu
induk
melakukan
a26eace3c9
2 mengubah file dengan 9 tambahan dan 10 penghapusan
  1. 7 7
      pages/annunciate/details.js
  2. 2 3
      pages/annunciate/index.js

+ 7 - 7
pages/annunciate/details.js

@@ -19,13 +19,13 @@ Page({
         let auth = [],
         let auth = [],
             dataAuth = '';
             dataAuth = '';
         (options.auth) ? auth = options.auth.split(","): getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['通告'])[0].apps[0].meta.auth.forEach(v => auth.push(v.optionname));
         (options.auth) ? auth = options.auth.split(","): getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['通告'])[0].apps[0].meta.auth.forEach(v => auth.push(v.optionname));
-        if (auth.includes('团队内部数据分析') && auth.includes('经销商数据分析')) {
+        if (auth.some(v => v == '团队内部数据分析') && auth.some(v => v == '经销商数据分析')) {
             dataAuth = 'all';
             dataAuth = 'all';
         } else {
         } else {
-            dataAuth = options.auth.includes('团队内部数据分析') ? '内部' : '经销商'
+            dataAuth = auth.some(v => v == '团队内部数据分析') ? '内部' : '经销商'
         };
         };
         this.setData({
         this.setData({
-            viewData: auth.includes('团队内部数据分析') || auth.includes('经销商数据分析'),
+            viewData: auth.some(v => v == '团队内部数据分析') || auth.some(v => v == '经销商数据分析'),
             dataAuth,
             dataAuth,
             auth,
             auth,
             sat_noticeid: options.id
             sat_noticeid: options.id
@@ -55,9 +55,9 @@ Page({
                 detailsData: res.data,
                 detailsData: res.data,
                 videoList
                 videoList
             });
             });
-            const pages = getCurrentPages(),
-                page = pages[pages.length - 2].route == 'pages/tabbar/home/index' ? pages[pages.length - 2] : pages[pages.length - 3];
-            page.queryNoticeList(); //通知首页,更新已读数据
+            getCurrentPages().forEach(v => {
+                if (v.__route__ == 'pages/tabbar/home/index') v.queryNoticeList()
+            })
         });
         });
     },
     },
     /* 查询数据 */
     /* 查询数据 */
@@ -188,5 +188,5 @@ Page({
             }
             }
         })
         })
     },
     },
-    onShareAppMessage(res) { }
+    onShareAppMessage(res) {}
 })
 })

+ 2 - 3
pages/annunciate/index.js

@@ -41,8 +41,7 @@ Page({
         })
         })
         if (this.data.content.pageNumber > this.data.content.pageTotal) return;
         if (this.data.content.pageNumber > this.data.content.pageTotal) return;
         _Http.basic({
         _Http.basic({
-            "classname": "saletool.notice.notice",
-            "method": "queryNoticeList",
+            id: 20221111090904,
             content: this.data.content
             content: this.data.content
         }).then(res => {
         }).then(res => {
             console.log("通告列表", res)
             console.log("通告列表", res)
@@ -80,5 +79,5 @@ Page({
             })
             })
         })
         })
     },
     },
-    onShareAppMessage(res) { }
+    onShareAppMessage(res) {}
 })
 })