|
|
@ -16,22 +16,24 @@ |
|
|
return { |
|
|
return { |
|
|
userInfo: '', |
|
|
userInfo: '', |
|
|
loadOptions: '', |
|
|
loadOptions: '', |
|
|
haveVerfiy: false |
|
|
|
|
|
|
|
|
haveVerfiy: false, |
|
|
|
|
|
ifProduct: false, |
|
|
|
|
|
strVerfiy: '' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(options) { |
|
|
onLoad(options) { |
|
|
this.userInfo = uni.getStorageSync('userinfo') |
|
|
|
|
|
this.loadOptions = options.scene |
|
|
|
|
|
// if (options.scene) { |
|
|
|
|
|
// // 单个参数 |
|
|
|
|
|
// let str = decodeURIComponent(options.scene); |
|
|
|
|
|
// this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => { |
|
|
|
|
|
// this.$msg('核销成功!'); |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
this.userInfo = uni.getStorageSync('userinfo'); |
|
|
|
|
|
this.loadOptions = decodeURIComponent(options.scene); |
|
|
|
|
|
this.strVerfiy = this.loadOptions.slice(2,this.loadOptions.length); |
|
|
|
|
|
var search_0$ = this.loadOptions.slice(0,2); |
|
|
|
|
|
if(search_0$ == '0$') { |
|
|
|
|
|
this.ifProduct = false; |
|
|
|
|
|
}else { |
|
|
|
|
|
this.ifProduct = true |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 微信快捷登录获取手机号 |
|
|
|
|
|
|
|
|
// 普通产品核销 |
|
|
getPhoneNumber(event){ |
|
|
getPhoneNumber(event){ |
|
|
if(this.userInfo.mobile == '') { |
|
|
if(this.userInfo.mobile == '') { |
|
|
if(event.detail.errMsg == 'getPhoneNumber:ok'){ |
|
|
if(event.detail.errMsg == 'getPhoneNumber:ok'){ |
|
|
@ -44,19 +46,39 @@ |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
this.$msg('更新成功', {icon: 'success'}); |
|
|
this.$msg('更新成功', {icon: 'success'}); |
|
|
uni.setStorageSync('userinfo', res.data); |
|
|
uni.setStorageSync('userinfo', res.data); |
|
|
let str = decodeURIComponent(this.loadOptions); |
|
|
|
|
|
this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => { |
|
|
|
|
|
this.$msg('核销成功!'); |
|
|
|
|
|
this.haveVerfiy = true |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
if(this.ifProduct == true) { |
|
|
|
|
|
this.$http(this.API.API_CONFIRMPRODUCT_CODE, {verify_code: this.strVerfiy}).then(res => { |
|
|
|
|
|
this.$msg('核销成功!'); |
|
|
|
|
|
this.haveVerfiy = true |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.$msg(JSON.stringify(err.msg)) |
|
|
|
|
|
}); |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$http(this.API.API_CONFIRM_CODE, {verify_code: this.strVerfiy}).then(res => { |
|
|
|
|
|
this.$msg('核销成功!'); |
|
|
|
|
|
this.haveVerfiy = true |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.$msg(JSON.stringify(err.msg)) |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}else { |
|
|
}else { |
|
|
let str = decodeURIComponent(this.loadOptions); |
|
|
|
|
|
this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => { |
|
|
|
|
|
this.haveVerfiy = true |
|
|
|
|
|
this.$msg('核销成功!'); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
if(this.ifProduct == true) { |
|
|
|
|
|
this.$http(this.API.API_CONFIRMPRODUCT_CODE, {verify_code: this.strVerfiy}).then(res => { |
|
|
|
|
|
this.$msg('核销成功!'); |
|
|
|
|
|
this.haveVerfiy = true |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.$msg(JSON.stringify(err.msg)) |
|
|
|
|
|
}); |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$http(this.API.API_CONFIRM_CODE, {verify_code: this.strVerfiy}).then(res => { |
|
|
|
|
|
this.$msg('核销成功!'); |
|
|
|
|
|
this.haveVerfiy = true |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.$msg(JSON.stringify(err.msg)) |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
|