Parcourir la source

通告修改权限来源

xiaohaizhao il y a 2 ans
Parent
commit
e39d9788c1
3 fichiers modifiés avec 3 ajouts et 33 suppressions
  1. 1 2
      pages/annunciate/details.js
  2. 1 30
      pages/annunciate/index.js
  3. 1 1
      pages/annunciate/index.wxml

+ 1 - 2
pages/annunciate/details.js

@@ -16,9 +16,8 @@ Page({
         isEvaluate: false
     },
     onLoad(options) {
-        let auth = [],
+        let auth = wx.getStorageSync('authList').wnotice.optionnames,
             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));
         if (auth.some(v => v == '团队内部数据分析') && auth.some(v => v == '经销商数据分析')) {
             dataAuth = 'all';
         } else {

+ 1 - 30
pages/annunciate/index.js

@@ -2,10 +2,6 @@ const getHeight = require("../../utils/getRheRemainingHeight");
 const _Http = getApp().globalData.http;
 
 Page({
-
-    /**
-     * 页面的初始数据
-     */
     data: {
         scrollHeight: 0,
         list: [],
@@ -20,20 +16,9 @@ Page({
         },
         unreadNum: 0
     },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
     onLoad(options) {
-        const auth = options.auth ? JSON.parse(options.auth) : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['通告'])[0].apps;
-        let authList = [];
-        auth[0].meta.auth.forEach(v => authList.push(v.optionname));
-        this.setData({
-            authList
-        })
         this.getList();
     },
-
     getList(init = false) {
         if (init.detail != undefined) init = init.detail;
         if (init) this.setData({
@@ -60,25 +45,11 @@ Page({
             })
         })
     },
-    /* 查看详情 */
-    toDetails(e) {
-        const {
-            item
-        } = e.currentTarget.dataset, authList = this.data.authList;
-        wx.navigateTo({
-            url: `./details?id=${item.sat_noticeid}&auth=${authList}`
-        })
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
     onReady() {
         getHeight.getHeight('.top', this).then(res => {
             this.setData({
                 scrollHeight: res
             })
         })
-    },
-
+    }
 })

+ 1 - 1
pages/annunciate/index.wxml

@@ -1,7 +1,7 @@
 <view class="top" />
 <My_listBox id='ListBox' height='{{scrollHeight}}' bind:getlist='getList'>
     <view class="unread">总共{{total}}条,未读{{unreadNum}}条</view>
-    <navigator class="list-box" url="#" wx:for="{{list}}" data-item="{{item}}" bindtap="toDetails">
+    <navigator class="list-box" url="/pages/annunciate/details?id={{item.sat_noticeid}}" wx:for="{{list}}" wx:key="sat_noticeid">
         <Item item="{{item}}" />
     </navigator>
     <My_empty wx:if="{{!list.length}}" />