Browse Source

逻辑完善

xiaohaizhao 8 months ago
parent
commit
b2b0dd4f5e
4 changed files with 8 additions and 17 deletions
  1. 3 0
      app.js
  2. 1 2
      pages/tabbar/home/index.js
  3. 1 14
      pages/tabbar/home/index.wxml
  4. 3 1
      utils/work/work.js

+ 3 - 0
app.js

@@ -11,10 +11,13 @@ App({
             wx.removeStorageSync('auth');
             wx.removeStorageSync('userauth');
             wx.removeStorageSync('userrole');
+            wx.removeStorageSync('templetList');
             wx.setStorageSync('userMsg', userMsg);
             wx.setStorageSync('userrole', userMsg.usertype == 1 ? '业务员' : '经销商');
             wx.setStorageSync('auth', JSON.parse(options.query.auth));
             wx.setStorageSync('siteP', JSON.parse(options.query.site));
+            wx.setStorageSync('templetList', JSON.parse(options.query.templetList));
+            console.log("options.query.templetList", options.query.templetList)
             //获取用户权限 
             this.globalData.http.basic({
                 "classname": "sysmanage.develop.userauth.userauth",

+ 1 - 2
pages/tabbar/home/index.js

@@ -18,8 +18,7 @@ Page({
   },
   onLoad(options) {
     this.setData({ //获取胶囊位置信息
-      capsule: wx.getMenuButtonBoundingClientRect(),
-      templetList: JSON.stringify(wx.getStorageSync('templetList'))
+      capsule: wx.getMenuButtonBoundingClientRect()
     })
     this.refreshData() //更新权限等信息
     this.getTabBar().unReadMessageCount(); //更新信息数量

+ 1 - 14
pages/tabbar/home/index.wxml

@@ -25,20 +25,7 @@
         <view class="group" wx:if="{{item.list.length}}">
             <view class="label"><text class="work {{item.icon}}" />{{item.label}}</view>
             <view class="main">
-                <navigator version='trial'
-                class="item"
-                wx:for="{{item.list}}"
-                wx:for-item="it"
-                wx:for-index="i"
-                target='{{item.appid!=appid?"miniProgram":"self"}}'
-                app-id='{{item.appid}}'
-                path="{{it.path+'?auth='+auth+'&userMsg='+userMsg+'&site='+site+'&site='+site}}"
-                url="{{it.path}}"
-                open-type="{{it.openType||'navigate'}}"
-                wx:key="name"
-                data-it="{{it}}"
-                data-item="{{item}}"
-                bindtap="openRecord">
+                <navigator version='develop' class="item" wx:for="{{item.list}}" wx:for-item="it" wx:for-index="i" target='{{item.appid!=appid?"miniProgram":"self"}}' app-id='{{item.appid}}' path="{{it.path+'?auth='+auth+'&userMsg='+userMsg+'&site='+site+'&templetList='+templetList}}" url="{{it.path}}" open-type="{{it.openType||'navigate'}}" wx:key="name" data-it="{{it}}" data-item="{{item}}" bindtap="openRecord">
                     <view class="icon-box" style="background-color: {{it.bColor}};">
                         <text class="work {{it.icon}}" style="color: {{it.color}};" />
                     </view>

+ 3 - 1
utils/work/work.js

@@ -27,12 +27,14 @@ function initWorkbench(that) {
         icon: "work-CRM",
         list: apps.getcrm()
     }];
+    wx.removeStorageSync('auth')
     wx.setStorageSync('auth', apps.authList)
     that.setData({
         entrance,
         auth: JSON.stringify(apps.authList),
         userMsg: JSON.stringify(wx.getStorageSync('userMsg')),
-        site: JSON.stringify(wx.getStorageSync('siteP'))
+        site: JSON.stringify(wx.getStorageSync('siteP')),
+        templetList: JSON.stringify(wx.getStorageSync('templetList'))
     })
     /* 获取首页banner */
     let banner = wx.getStorageSync('banner_list').find(v => v.location == "index_top");