解绑openId

This commit is contained in:
nisen
2023-10-17 15:43:13 +08:00
parent 6f4ef2e32a
commit eb9e3f6b91
4 changed files with 81 additions and 10 deletions

View File

@@ -50,7 +50,12 @@
<!-- <u-cell title="语言设置" v-model="userInfoObj.name"></u-cell>
<u-cell title="位置" v-model="userInfoObj.name"></u-cell> -->
<u-cell @click="toRouter('next')" title="修改密码" :isLink="true" arrow-direction="left" v-model="userInfoObj.account.passValue"></u-cell>
</u-cell-group>
<u-cell title="解除绑定">
<view slot="value" class="relieveLogin" :class="!relieveStatus ? 'noRelieveLogin' : 'activeRelieveLogin'" @click="relieveLogin(relieveStatus)">
<text>解除</text>
</view>
</u-cell>
</u-cell-group>
</view>
</view>
</view>
@@ -69,6 +74,7 @@
import cropper from "@/components/x-cropper/x-cropper.vue"
import { mapGetters } from 'vuex';
import {getToken} from '@/utils/token.js'
import userBasic from '@/api/boe/userbasic.js'
export default {
components: {cropper},
data() {
@@ -80,6 +86,7 @@
},
clearShow:false,
imgurl:"",
relieveStatus:false
}
},
computed: {
@@ -90,12 +97,43 @@
this.aid=rs.aid;
this.imgurl = rs.avatar;
this.load();
this.getRelieveStatus();
})
},
onLoad(){
//this.load()
},
methods: {
relieveLogin(relieveStatus){
if(relieveStatus){
userBasic.UnOpenId().then(res=>{
if(res.status==200){
uni.showToast({
title: "解绑成功",
icon:'none'
});
}else{
uni.showToast({
title: "解绑失败",
icon:'none'
});
}
})
}
},
// 解绑状态
getRelieveStatus(){
userBasic.hasOpenId().then(res=>{
if(res.status==200){
this.relieveStatus = res.result
}else{
uni.showToast({
title: "获取数据失败",
icon:'none'
});
}
})
},
logout() {
this.clearShow=true;
},
@@ -218,6 +256,29 @@
</script>
<style lang="scss" scoped>
.relieveLogin{
width: 40px;
text-align: center;
border-radius: 3px;
text {
font-size: 14px;
line-height: 22px;
}
}
.activeRelieveLogin{
color: red;
border: 1px solid red;
text{
color: red !important;
}
}
.noRelieveLogin{
border: 1px solid #ccc;
color: #ccc;
text{
color: #ccc !important;
}
}
/deep/ .u-modal{
width: 288px !important;
border-radius: 28upx;