Browse Source

增加积分管理模块

release
ZhaoTongYao 4 years ago
parent
commit
f319aa35a5
  1. 11
      api/common.js
  2. 8
      app.json
  3. 60
      pages/index/index.js

11
api/common.js

@ -10,7 +10,8 @@ module.exports = {
logout, logout,
checkUpdateAvatar, checkUpdateAvatar,
updateAvatar, updateAvatar,
getCustomId getCustomId,
getUserinfobycode
} }
function getToken(wxCode) { function getToken(wxCode) {
@ -62,4 +63,12 @@ function updateAvatar(avatar) {
*/ */
function getCustomId () { function getCustomId () {
return fly.get("plugins/workLog/getCustomId") return fly.get("plugins/workLog/getCustomId")
}
/**
* 扫描兑换码获取用户信息接口 2022.03.07
* @param qrCodeId 二维码中的qrCodeId
*/
function getUserinfobycode(params) {
return fly.post('work/pointsverification/getuserinfobycode', params)
} }

8
app.json

@ -20,6 +20,14 @@
"pages/user_moudle/userManageList/userManageList" "pages/user_moudle/userManageList/userManageList"
], ],
"subpackages": [ "subpackages": [
{
"root": "subpages/pointManagement",
"name": "pointManagement",
"pages": [
"pages/pointClear/pointClear",
"pages/pointList/pointList"
]
},
{ {
"root": "subpages/clerkOnline", "root": "subpages/clerkOnline",
"name": "clerkOnline", "name": "clerkOnline",

60
pages/index/index.js

@ -18,7 +18,8 @@ Page({
userInfo: '', userInfo: '',
propagation: true, propagation: true,
joinFlag: true, joinFlag: true,
buttonName:'',//获取点击按钮的名字 buttonName:'', // 获取点击按钮的名字
qrCodeId: '',
}, },
onLoad: function() { onLoad: function() {
// this.checkUpdateAvatar() // this.checkUpdateAvatar()
@ -230,6 +231,13 @@ Page({
}) })
} }
break break
case 'tmp-8':
if (navCode == '10081') {
this.toPointClear()
} else if (navCode == '10082') {
this.toPointList()
}
break
default: default:
let c_childNav = []; let c_childNav = [];
for (let i = 0; i < this.data.panel.length; i++) { for (let i = 0; i < this.data.panel.length; i++) {
@ -496,5 +504,55 @@ Page({
console.log(err) console.log(err)
} }
}) })
},
// 前往 积分核销
toPointClear () {
wx.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
success: res => {
if (res.errMsg == 'scanCode:ok') {
this.setData({
qrCodeId: res.result
})
this.getUserinfobycode()
}
},
fail: res => {
// 接口调用失败
// wx.showToast({
// icon: 'none',
// title: '接口调用失败!'
// })
},
complete: res => {
// 接口调用结束
console.log(res)
}
});
},
getUserinfobycode() {
let para = {
qrCodeId: this.data.qrCodeId
}
api.getUserinfobycode(para).then(function (res) {
let {
faceImg,
points,
realName,
userId
} = res.data
wx.navigateTo({
url: `/subpages/pointManagement/pages/pointClear/pointClear?faceImg=${faceImg}&points=${points}&realName=${realName}&userId=${userId}`
})
}).catch(err => {
console.log(err)
})
},
// 前往 核销记录
toPointList () {
wx.navigateTo({
url: '/subpages/pointManagement/pages/pointList/pointList'
})
} }
}) })
Loading…
Cancel
Save