From 532d1286a13a10e78283cf8e4f5af6f6f6226a39 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期二, 27 八月 2024 15:52:02 +0800
Subject: [PATCH] 代码提交

---
 wechat_staff/pages/work/index.js |   83 +++++++++++++++++++++++++++++++----------
 1 files changed, 62 insertions(+), 21 deletions(-)

diff --git a/wechat_staff/pages/work/index.js b/wechat_staff/pages/work/index.js
index c1c84c5..390702e 100644
--- a/wechat_staff/pages/work/index.js
+++ b/wechat_staff/pages/work/index.js
@@ -1,29 +1,66 @@
-// pages/mine/mine.js
+import {
+  getDictData,
+  getMemberInfo
+} from '../../api/index'
 Page({
 
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
+    topimg: '',
     clientHeight: 0,
     clientTop: 0,
+    showCard: false,
+    userInfo: {
+      name: ''
+    }
   },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
-   */
   onLoad(options) {
     const res = wx.getMenuButtonBoundingClientRect()
-    this.setData({clientHeight: res.height})
-    this.setData({clientTop: res.top})
+    this.setData({
+      clientHeight: res.height
+    })
+    this.setData({
+      clientTop: res.top
+    })
+  },
+  onShow() {
+    this.initData()
+  },
+  subscribeMessage: function () {
+    // 鏄剧ず鍔犺浇鎻愮ず
+    // 璋冪敤璁㈤槄娑堟伅鐨凙PI
+    wx.requestSubscribeMessage({
+      tmplIds: ['A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc'],
+      success: (res) => {
+        console.log('res', res);
+      },
+      fail: () => {
+        reject();
+      }
+    })
+  },
+  showQrcode() {
+    this.setData({
+      showCard: true
+    })
+  },
+  onClose() {
+    this.setData({
+      showCard: false
+    })
   },
   changePath(e) {
+    const {
+      userInfo
+    } = this.data
     // 椤甸潰璺宠浆
     let temp = [
       '/pages/userinfo/index',
-      '/pages/store/staff',
+      '/pages/store/staff?userType=1',
       '/pages/userinfo/collect',
-      '/pages/store/index',
+      '/pages/store/index?shopId=' + userInfo.departmentId,
       '/pages/sets/index'
     ]
     const index = e.currentTarget.dataset.index
@@ -31,19 +68,23 @@
       url: `${temp[index]}`,
     })
   },
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
-   */
-  onReady() {
-
+  initData() {
+    getMemberInfo().then(res => {
+      this.setData({
+        userInfo: res.data
+      })
+      wx.setStorageSync('member', res.data)
+    })
+    getDictData({
+      code: 'WEIXIN_DEFAULT_IMGS',
+      label: 'STAFF_WORK_TOP_IMG'
+    }).then(res => {
+      this.setData({
+        topimg: res.data.code
+      })
+    })
   },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
-  onShow() {
-
-  },
+  onReady() {},
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌

--
Gitblit v1.9.3