소스 검색

销售线索权限

zhaoxiaohai 2 년 전
부모
커밋
da7b4af0f3
2개의 변경된 파일10개의 추가작업 그리고 12개의 파일을 삭제
  1. 1 2
      pages/threadedTree/details/index.js
  2. 9 10
      pages/threadedTree/index.js

+ 1 - 2
pages/threadedTree/details/index.js

@@ -31,8 +31,7 @@ Page({
      */
     onLoad(options) {
         let auth = [];
-        if (options.auth) auth = options.auth.split(",");
-
+        options.auth ? auth = options.auth.split(",") : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['销售线索'])[0].apps[0].meta.auth.forEach(v => auth.push(v.optionname));
         this.setData({
             sat_orderclueid: options.id,
             tagColor: options.color,

+ 9 - 10
pages/threadedTree/index.js

@@ -1,9 +1,9 @@
-const getHeight = require("../../utils/getRheRemainingHeight");
-const _Http = getApp().globalData.http;
+const getHeight = require("../../utils/getRheRemainingHeight"),
+    _Http = getApp().globalData.http;
 Page({
     data: {
         content: {
-            "nochace":true,
+            "nochace": true,
             "isAll": false,
             "pageNumber": 1,
             "pageSize": 20,
@@ -21,13 +21,12 @@ Page({
         isReverse: false,
     },
     onLoad(options) {
-        if (options.auth) {
-            let auth = [];
-            JSON.parse(options.auth)[0].meta.auth.forEach(v => auth.push(v.optionname))
-            this.setData({
-                auth
-            })
-        };
+        let auth = [],
+            apps = options.auth ? JSON.parse(options.auth) : getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['销售线索'])[0].apps;
+        apps[0].meta.auth.forEach(v => auth.push(v.optionname))
+        this.setData({
+            auth
+        })
         this.getList()
     },
     /* 打开弹窗 */