海南旅游项目 前端仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

69 lines
1.9 KiB

<template>
<view class="lf-p-40 lf-w-100 lf-h-100 lf-row-center" style="height: 1200rpx;">
<!-- <view class="lf-row-center lf-font-28">确认核销权限...</view> -->
<button class="cu-btn lf-m-t-30" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
<text class="lf-font-32">确认核销</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 == '') {
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('核销成功!');
});
}
},
}
}
</script>
<style scoped>
.cu-btn {
width: 260rpx;
height: 260rpx;
border-radius: 50%;
background-color: #1998FE;
color: white;
}
</style>