feat: implement mobile number binding via WeChat and enforce phone verification for venue entry, booking, and card purchases

This commit is contained in:
2026-04-18 18:32:30 +08:00
parent 7552f9946b
commit 5236fabc83
11 changed files with 139 additions and 19 deletions

View File

@@ -93,6 +93,37 @@ Page({
});
},
// 绑定手机号
onBindPhone(e) {
if (e.detail.errMsg === 'getPhoneNumber:fail user deny') {
wx.showToast({ title: '已取消绑定', icon: 'none' });
return;
}
let that = this;
wx.login({
success: function (r) {
wx.showLoading({ title: '绑定中...', mask: true });
// 复用微信授权一键登录/绑定接口
app.$api.memberLoginWXPhone({
loginCode: r.code,
phoneCode: e.detail.code
}).then(res => {
wx.hideLoading();
if (res.authorization) {
wx.setStorageSync('accessToken', res.authorization.accessToken);
}
if (res.information) {
wx.setStorageSync('information', res.information);
}
wx.showToast({ title: '绑定成功', icon: 'success' });
that.getData(); // 重新加载信息刷新页面
}).catch(err => {
wx.hideLoading();
});
}
});
},
// 没有修改次数时点击头像
onAvatarNoCount() {
wx.showToast({