5 changed files with 80 additions and 18 deletions
-
2common/api.js
-
6pages.json
-
11pages/index/index.vue
-
15pages/order/order_details.vue
-
64pages/verification/index.vue
@ -0,0 +1,64 @@ |
|||||
|
<template> |
||||
|
<view class="lf-p-40"> |
||||
|
<view class="lf-row-center lf-font-28">确认核销权限...</view> |
||||
|
<button class="cu-btn lf-bg-white lf-m-t-30" style="border: 1px solid #1998FE;" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"> |
||||
|
<text class="lf-font-32 lf-color-blue">确认核销</text> |
||||
|
</button> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
userInfo: '', |
||||
|
loadOptions: '' |
||||
|
} |
||||
|
}, |
||||
|
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('核销成功!'); |
||||
|
// }); |
||||
|
// } |
||||
|
}, |
||||
|
methods: { |
||||
|
// 微信快捷登录获取手机号 |
||||
|
getPhoneNumber(event){ |
||||
|
if(this.userInfo.mobile == '') { |
||||
|
console.log('需绑定手机号') |
||||
|
if(event.detail.errMsg == 'getPhoneNumber:ok'){ |
||||
|
let encryptedData = event.detail.encryptedData; |
||||
|
let iv = event.detail.iv; |
||||
|
// let userInfo = uni.getStorageSync('userinfo') || {}; |
||||
|
this.$http(this.API.API_WECHAT_SETPHONE, { |
||||
|
encryptedData, |
||||
|
iv, |
||||
|
// token: userInfo.token // 已在公共参数传 |
||||
|
}).then(res => { |
||||
|
this.$msg('更新成功', {icon: 'success'}); |
||||
|
uni.setStorageSync('userinfo', res.data); |
||||
|
let str = decodeURIComponent(this.loadOptions); |
||||
|
this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => { |
||||
|
this.$msg('核销成功!'); |
||||
|
}); |
||||
|
}) |
||||
|
} |
||||
|
}else { |
||||
|
let str = decodeURIComponent(this.loadOptions); |
||||
|
this.$http(this.API.API_CONFIRM_CODE, {verify_code: str}).then(res => { |
||||
|
this.$msg('核销成功!'); |
||||
|
}); |
||||
|
console.log('无需绑定手机号') |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue