From 41bd8b2b50dc308ea3a5784efccd856c073b3f37 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 21 八月 2024 15:04:55 +0800
Subject: [PATCH] ll

---
 wechat_staff/pages/work/index.js |   61 ++++++++++++++++++++++--------
 1 files changed, 45 insertions(+), 16 deletions(-)

diff --git a/wechat_staff/pages/work/index.js b/wechat_staff/pages/work/index.js
index ef2a209..390702e 100644
--- a/wechat_staff/pages/work/index.js
+++ b/wechat_staff/pages/work/index.js
@@ -1,38 +1,66 @@
-import { getDictData, getMemberInfo } from '../../api/index'
+import {
+  getDictData,
+  getMemberInfo
+} from '../../api/index'
 Page({
 
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
-    topimg:'',
+    topimg: '',
     clientHeight: 0,
-    clientTop: 0, 
+    clientTop: 0,
     showCard: false,
-    userInfo: {name:''}
+    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 })
+    this.setData({
+      showCard: true
+    })
   },
   onClose() {
-    this.setData({ showCard: false })
+    this.setData({
+      showCard: false
+    })
   },
   changePath(e) {
-    const {userInfo} = this.data
+    const {
+      userInfo
+    } = this.data
     // 椤甸潰璺宠浆
     let temp = [
       '/pages/userinfo/index',
       '/pages/store/staff?userType=1',
       '/pages/userinfo/collect',
-      '/pages/store/index?shopId='+userInfo.departmentId,
+      '/pages/store/index?shopId=' + userInfo.departmentId,
       '/pages/sets/index'
     ]
     const index = e.currentTarget.dataset.index
@@ -44,18 +72,19 @@
     getMemberInfo().then(res => {
       this.setData({
         userInfo: res.data
-      }) 
-      wx.setStorageSync('member',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 })
+      this.setData({
+        topimg: res.data.code
+      })
     })
   },
-  onReady() { 
-  },
+  onReady() {},
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌

--
Gitblit v1.9.3