|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
- <image v-show="isBind" src="https://cos.his.cdwjyyh.com/fs/20250414/3da41caccf8346b188809fac656ba834.jpg" mode="widthFix"></image>
|
|
|
- <view v-show="!isBind" class="bindbox">{{msg}}</view>
|
|
|
+ <image v-if="isBind" src="https://cos.his.cdwjyyh.com/fs/20250414/3da41caccf8346b188809fac656ba834.jpg" mode="widthFix"></image>
|
|
|
+ <view v-if="!isBind" class="bindbox">{{msg}}</view>
|
|
|
<!-- <view class="bindbox">
|
|
|
<image :src="baseUrl + '/images/bindComUser.png'" mode="aspectFill"></image>
|
|
|
<view>立即绑定,享受更多权益</view>
|
|
@@ -24,16 +24,24 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- let q = {}
|
|
|
+ let obj = {}
|
|
|
if(option.q) {
|
|
|
- q = decodeURIComponent(option.q) // 获取到二维码原始链接内容
|
|
|
+ let url = decodeURIComponent(option.q) // 获取到二维码原始链接内容
|
|
|
+ // // 对url中携带的参数提取处理
|
|
|
+ obj = this.$urlToObj(url)
|
|
|
}
|
|
|
- this.companyUserId = q.companyUserId || option.companyUserId
|
|
|
- const historyApp = uni.getStorageSync('historyApp') || '';
|
|
|
- if(historyApp) {
|
|
|
- this.handleBind()
|
|
|
+ this.companyUserId = obj.companyUserId || option.companyUserId
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ if(!this.isBind) {
|
|
|
+ const historyApp = uni.getStorageSync('historyApp') || '';
|
|
|
+ if(historyApp) {
|
|
|
+ this.handleBind()
|
|
|
+ } else {
|
|
|
+ this.getUser()
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.getUser()
|
|
|
+ this.msg = '已绑定或已经存在绑定关系'
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -111,12 +119,21 @@
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}else {
|
|
|
- this.msg = res.msg
|
|
|
- this.isBind = false
|
|
|
- uni.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
+ if(res.msg=="已存在绑定关系") {
|
|
|
+ this.isBind = true
|
|
|
+ this.msg = '绑定成功'
|
|
|
+ uni.showToast({
|
|
|
+ title: '绑定成功',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.msg = res.msg
|
|
|
+ this.isBind = false
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}).catch(()=>{
|
|
|
this.msg = '绑定失败'
|
|
@@ -151,7 +168,6 @@
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
- padding-bottom: calc(var(--window-bottom) + 150rpx);
|
|
|
|
|
|
}
|
|
|
.bind-btn {
|