Просмотр исходного кода

Merge branch '黄色' into 测试

xiaohaizhao 1 год назад
Родитель
Сommit
c8df2a5cca
4 измененных файлов с 60 добавлено и 8 удалено
  1. 10 1
      packageA/achievement/index.js
  2. 2 2
      packageA/achievement/index.wxml
  3. 38 5
      pages/login/selectSite.js
  4. 10 0
      utils/work/apps.js

+ 10 - 1
packageA/achievement/index.js

@@ -33,6 +33,7 @@ Page({
     active: {
       name: wx.getStorageSync('userMsg').name,
       userid: wx.getStorageSync('userMsg').userid,
+      isleave: 1
     }
   },
   onLoad(options) {
@@ -47,7 +48,12 @@ Page({
     detail
   }) {
     if (detail.name == 'reset') {
+      this.selectComponent("#organization").setData({
+        isleave: 1
+      })
       this.selectComponent("#organization").initDepAndUser().then(active => {
+        console.log("active", active)
+        active.isleave = 1;
         this.setData({
           active
         })
@@ -99,7 +105,7 @@ Page({
       let type = active.userid ? 0 : 1,
         dataid = type == 0 ? active.userid : active.departmentid,
         where = {
-          isleave: active.isleave || 0
+          isleave: active.isleave
         };
       return _Http.basic({
         "id": 20230616131404,
@@ -274,6 +280,9 @@ Page({
   },
   onReady() {
     this.selectComponent("#ListBox").setHeight(".head", this);
+    this.selectComponent("#organization").setData({
+      isleave: 1
+    })
     this.selectComponent("#organization").initDepAndUser().then(active => {
       this.setData({
         active

+ 2 - 2
packageA/achievement/index.wxml

@@ -15,7 +15,7 @@
           作业数据
         </view>
         <view class="tabs-box">
-          <view class="item {{zysj.tab.active==item.id?'active':''}}" wx:for="{{zysj.tab.list}}" wx:key="id" data-name="zysj" data-id="{{item.id}}" catchtap='changeId'>{{item.name}}</view>
+          <view class="item {{zysj.tab.active==item.id?'active':''}}" wx:for="{{zysj.tab.list}}" wx:key="id" data-name="zysj" data-id="{{item.id}}" catchtap='changeId'>{{item.name||'筛选'}}</view>
         </view>
       </view>
       <view class="spectaculars row-3">
@@ -170,5 +170,5 @@
 </view>
 
 <Yl_Filtrate1 show='{{showFiltrate}}' list="{{filtratelist}}" bindhandle="handleFilter">
-  <organization slot='head' dimissionF id='organization' />
+  <organization slot='head' defaultIsleave='1' dimissionF id='organization' />
 </Yl_Filtrate1>

+ 38 - 5
pages/login/selectSite.js

@@ -1,17 +1,50 @@
+let _Http = getApp().globalData.http
+
 Page({
     data: {
         account_list: ""
     },
+    onLoad(options) {
+        for (var key in options) {
+            if (key.length > 30 && key.includes("_")) {
+                let value = key.split("_")
+                wx.setNavigationBarTitle({
+                    title: '加载中...',
+                })
+                _Http.appName = value[1];
+                _Http.base({
+                    "id": 2024092514364201,
+                    accesstoken: value[0]
+                }).then(res => {
+                    console.log('通过token获取登录数据', res);
+                    if (res.code != 1) {
+                        wx.showToast({
+                            title: res.msg,
+                            icon: "none",
+                            mask: true
+                        })
+                        setTimeout(() => {
+                            wx.redirectTo({
+                                url: '/pages/login/phone',
+                            })
+                        }, 500);
+                        return
+                    }
+                    wx.setStorageSync('userMsg', res.data);
+                    wx.setStorageSync('account_list', [res.data])
+                    require('./modules/login').init();
+                })
+            }
+        }
+        this.setData({
+            account_list: wx.getStorageSync('account_list')
+        })
+    },
     toHome(e) {
         const {
             item
         } = e.currentTarget.dataset;
         wx.setStorageSync('userMsg', item);
         require('./modules/login').init();
-    },
-    onShow() {
-        this.setData({
-            account_list: wx.getStorageSync('account_list')
-        })
     }
 })

+ 10 - 0
utils/work/apps.js

@@ -43,6 +43,7 @@ function getapps() {
                 let i = paths.findIndex(k => k.name == s.meta.title);
                 if (i != -1) {
                     paths[i].index = i;
+                    paths[i].appName = s.name;
                     list.push(paths[i])
                 }
             }
@@ -188,6 +189,7 @@ function getcrm() {
                 let i = paths.findIndex(k => k.name == s.meta.title);
                 if (i != -1) {
                     paths[i].index = i;
+                    paths[i].appName = s.name;
                     list.push(paths[i])
                 }
             }
@@ -279,6 +281,7 @@ function getedd() {
                 let i = paths.findIndex(k => k.name == s.meta.title);
                 if (i != -1) {
                     paths[i].index = i;
+                    paths[i].appName = s.name;
                     list.push(paths[i])
                 }
             }
@@ -321,6 +324,7 @@ function geteservice() {
                 let i = paths.findIndex(k => k.name == s.meta.title);
                 if (i != -1) {
                     paths[i].index = i;
+                    paths[i].appName = s.name;
                     list.push(paths[i])
                 }
             }
@@ -377,6 +381,12 @@ function dye(list) {
         bColor: "#F4FAEF",
     }];
     return list.map((v, i) => {
+        if (getApp().globalData.http.appName && v.appName == getApp().globalData.http.appName) {
+            wx.navigateTo({
+                url: v.path
+            })
+            delete getApp().globalData.http.appName
+        }
         return {
             ...v,
             ...colorList[i > colorList.length - 1 ? i - colorList.length : i]