|
@@ -141,14 +141,24 @@ Page({
|
|
|
// 账号绑定
|
|
|
scanCode2: function () {
|
|
|
const that = this;
|
|
|
+ const raceuser = that.data.raceuser;
|
|
|
wx.scanCode({
|
|
|
async success(res) {
|
|
|
let arr = res.result.split('&&');
|
|
|
let parent_id = arr[0];
|
|
|
let type = arr[1];
|
|
|
- console.log(user);
|
|
|
- // const aee = await app.$post(`/utbj`, { user_id: user_id, parent_id: parent_id }, 'race')
|
|
|
- // console.log(aee);
|
|
|
+ const aee = await app.$post(`/user/utbj`, { user_id: raceuser.user_id._id, parent_id: parent_id }, 'race');
|
|
|
+ if (aee.errcode == '0') {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '裁判账号绑定成功,请退出登录',
|
|
|
+ async success(res) {
|
|
|
+ if (res.confirm) { wx.clearStorage(); wx.redirectTo({ url: '/pages/index/index' }) }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showToast({ title: `${aee.errmsg}`, icon: 'error', duration: 2000 })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|