From ec68191c2bde5d903193cfe85cd90c188b4abdaa Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 27 八月 2024 14:51:27 +0800
Subject: [PATCH] ll
---
wechat_staff/pages/work/index.js | 89 +++++++++++++++++++++++++++++++++-----------
1 files changed, 66 insertions(+), 23 deletions(-)
diff --git a/wechat_staff/pages/work/index.js b/wechat_staff/pages/work/index.js
index 1f5c4c0..ef07618 100644
--- a/wechat_staff/pages/work/index.js
+++ b/wechat_staff/pages/work/index.js
@@ -1,33 +1,76 @@
-import { getMemberInfo } from '../../api/index'
+import {
+ getDictData,
+ getMemberInfo
+} from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
+ topimg: '',
clientHeight: 0,
clientTop: 0,
-
- uesrInfo: {}
+ 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()
},
+ subscribe: function () {
+ // 鏄剧ず鍔犺浇鎻愮ず
+ let that = this
+ wx.requestSubscribeMessage({
+ tmplIds: ['A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc'],
+ success: (res) => {
+ if (res['A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc'] === 'accept') {
+ that.submitClock();
+ } else if (res['A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc'] === 'reject') {
+ // 鐢ㄦ埛鍘嗗彶鎿嶄綔鏈夎缃簡鎷掔粷 or 鍏抽棴浜嗚闃呮秷鎭殑涓伙紙鎬伙級寮�鍏筹紝瀵艰嚧鏃犳硶鎺ㄩ��
+ // console.log(res, '0 鎷掔粷 or 鍏抽棴浜嗚闃呮秷鎭殑涓伙紙鎬伙級寮�鍏�---');
+ } else {
+ wx.showToast({
+ title: '鎺堟潈璁㈤槄娑堟伅鏈夎',
+ icon: 'none'
+ });
+ }
+ },
+ 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
@@ -38,20 +81,20 @@
initData() {
getMemberInfo().then(res => {
this.setData({
- uesrInfo: res.data
+ 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
})
})
},
- onReady() {
-
- },
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
- */
- onShow() {
-
- },
+ onReady() {},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
--
Gitblit v1.9.3