zhaoxiaohai 2 anni fa
parent
commit
dfb205a3a1
1 ha cambiato i file con 2 aggiunte e 51 eliminazioni
  1. 2 51
      pages/teams/index.js

+ 2 - 51
pages/teams/index.js

@@ -2,10 +2,6 @@ const _Http = getApp().globalData.http;
 const getHeight = require("../../utils/getRheRemainingHeight");
 
 Page({
-
-    /**
-     * 页面的初始数据
-     */
     data: {
         tabShow: true,
         auth: {}, //权限
@@ -20,12 +16,9 @@ Page({
             }
         }
     },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
     onLoad(options) {
-        let authList = JSON.parse(options.auth).map(v => v.optionname);
+        let auth = options.auth ? JSON.parse(options.auth) : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心'])[0].apps[0].meta.auth,
+            authList = auth.map(v => v.optionname);
         let tabShow = false,
             butText = '账号';
         if (authList.includes('查看账号') && authList.includes('查看角色')) {
@@ -33,8 +26,6 @@ Page({
         } else {
             butText = authList.includes('查看角色') ? '角色' : '账号';
         }
-        console.log(butText)
-
         this.setData({
             tabShow,
             butText,
@@ -54,7 +45,6 @@ Page({
             "method": this.data.butText == '账号' ? "query_teamList" : "query_roleList",
             "content": this.data.content
         }).then(res => {
-            console.log("列表", res)
             this.selectComponent('#ListBox').RefreshToComplete();
             if (res.msg != '成功') return wx.showToast({
                 title: res.msg,
@@ -111,7 +101,6 @@ Page({
             url: `./addUsers?item=${JSON.stringify(item)}&update=${this.data.authList.includes("账号修改")}`
         })
     },
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
@@ -122,42 +111,4 @@ Page({
             })
         });
     },
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {},
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
-
-    }
 })