Bladeren bron

商学院权限修改

zhaoxiaohai 3 jaren geleden
bovenliggende
commit
8f44ec2d84
3 gewijzigde bestanden met toevoegingen van 7 en 11 verwijderingen
  1. 2 3
      pages/college/detail.js
  2. 4 2
      pages/college/detail.wxml
  3. 1 6
      pages/college/index.js

+ 2 - 3
pages/college/detail.js

@@ -15,9 +15,8 @@ Page({
         })
     },
     onLoad(options) {
-        let auth = [],
+        let auth = wx.getStorageSync('auth').warchives_sc.optionnames,
             dataAuth = '';
-        options.auth ? auth = options.auth : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['商学院'])[0].apps[0].meta.auth.forEach(v => auth.push(v.optionname));
         if (auth.includes('团队内部数据分析') && auth.includes('经销商数据分析')) {
             dataAuth = 'all';
         } else {
@@ -64,5 +63,5 @@ Page({
             }
         })
     },
-    onShareAppMessage(res) { }
+    onShareAppMessage(res) {}
 })

+ 4 - 2
pages/college/detail.wxml

@@ -21,6 +21,8 @@
     <van-tab title="课件" />
     <van-tab title="数据" />
 </van-tabs>
-
-<My_accessory wx:if="{{active==0}}" list="{{flieList}}" butType='商学院' bindcallBack='callBack' binddownLoadRecord='downLoadRecord' />
+<block wx:if="{{active==0}}">
+    <My_accessory list="{{flieList}}" butType='商学院' bindcallBack='callBack' binddownLoadRecord='downLoadRecord' />
+    <My_empty wx:if="{{flieList.length==0}}" />
+</block>
 <DispalyData ptype='学习' dataId="{{detailData.sat_coursewareid}}" dataAuth="{{dataAuth}}" wx:else />

+ 1 - 6
pages/college/index.js

@@ -6,7 +6,6 @@ Page({
      * 页面的初始数据
      */
     data: {
-        optionList: [],
         searchContent: "", //搜索内容
         mainActiveIndex: 0, //分类选择器打开分类的下标
         activeId: "", //分类选择器选择id
@@ -29,10 +28,6 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
-        let auth = options.auth ? JSON.parse(options.auth) : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['商学院'])[0].apps;
-        this.setData({
-            optionList: auth[0].meta.auth.map(v => v.optionname)
-        })
         this.selectMenu(0);
         this.selectList();
     },
@@ -59,7 +54,7 @@ Page({
             item
         } = e.currentTarget.dataset;
         wx.navigateTo({
-            url: `./detail?id=${item.sat_coursewareid}&auth=${this.data.optionList}`,
+            url: `./detail?id=${item.sat_coursewareid}`,
         })
     },
     /* 获取列表 */