添加:个人信息编辑 - 微信绑定

This commit is contained in:
wuhui_zzw 2023-12-06 16:03:34 +08:00
parent a62ca5cdd4
commit 46fdbae8d3
2 changed files with 58 additions and 6 deletions

View File

@ -45,6 +45,20 @@
</van-cell-group> </van-cell-group>
</div> </div>
</div> </div>
<div class="content">
<div style="margin-top: 0.625rem;">
<van-cell-group>
<van-cell title="微信绑定" style="height: 3rem;">
<van-field :value="form.isBindingWechat ? '已绑定' : '未绑定'" :readonly="true" input-align="right" placeholder="请输入昵称">
<template #button>
<van-icon v-if="form.isBindingWechat" class="wechat-icon" name="wechat" color="#1AAD19" size="25"/>
<van-icon v-else class="wechat-icon" name="wechat" color="#888888" size="25" @click="weChatBinding"/>
</template>
</van-field>
</van-cell>
</van-cell-group>
</div>
</div>
</div> </div>
<div class="contentOne"> <div class="contentOne">
<van-cell-group class="model" :border="false"> <van-cell-group class="model" :border="false">
@ -438,4 +452,13 @@
::v-deep .van-cell::after { ::v-deep .van-cell::after {
border-bottom: none; border-bottom: none;
} }
.wechat-icon {
height: 3rem;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
}
</style> </style>

View File

@ -26,7 +26,8 @@ export default {
fathername: '', //父亲姓名 fathername: '', //父亲姓名
mothername: '', //母亲姓名 mothername: '', //母亲姓名
idcard:'', idcard:'',
idcard_addr:'' idcard_addr:'',
isBindingWechat: false,
}, },
fileList: [], fileList: [],
pageType: "register", pageType: "register",
@ -90,6 +91,18 @@ export default {
this.fun.setWXTitle('基本信息') this.fun.setWXTitle('基本信息')
this.essentialInformation() this.essentialInformation()
} }
// 微信绑定结果处理
let pageParams = Object.assign(this.$route.params, this.$route.query);
let wechatBindRes = pageParams.wechat_binding_res || 'success';
if(wechatBindRes === 'error'){
let msg = pageParams.wechat_binding_msg || '绑定失败!';
this.$dialog.alert({ message: msg });
}
}, },
async mounted() { async mounted() {
if (JSON.parse(window.localStorage.getItem("globalParameter")).register_locate == true) { if (JSON.parse(window.localStorage.getItem("globalParameter")).register_locate == true) {
@ -268,6 +281,7 @@ export default {
this.diyField = response.data?.diy_field this.diyField = response.data?.diy_field
this.fixedDiyField = response.data?.fixed_diy_field this.fixedDiyField = response.data?.fixed_diy_field
this.changePicture = response.data?.can_update_avatar this.changePicture = response.data?.can_update_avatar
this.form.isBindingWechat = response.data?.has_one_fans
response.data.basic_info.forEach((item, index) => { response.data.basic_info.forEach((item, index) => {
this.registerBasicInfo[item.field] = item this.registerBasicInfo[item.field] = item
}); });
@ -376,13 +390,13 @@ export default {
Toast("请填写手机号"); Toast("请填写手机号");
return; return;
} }
if (this.$refs.input_list.form.country == "86" && this.fun.isMoblie(this.$refs.input_list.form.mobile) && !this.inputShowList.logPlugIn) { if (this.$refs.input_list.form.country == "86" && this.fun.isMoblie(this.$refs.input_list.form.mobile) && !this.inputShowList.logPlugIn) {
Toast("请填写正确的手机号"); Toast("请填写正确的手机号");
return; return;
} }
if (this.fun.isTextEmpty(this.$refs.input_list.form.code) && !this.inputShowList.logPlugIn) { if (this.fun.isTextEmpty(this.$refs.input_list.form.code) && !this.inputShowList.logPlugIn) {
Toast("请填写验证码"); Toast("请填写验证码");
return return
@ -723,7 +737,6 @@ export default {
addressJson['address'] = value.detailedAddress addressJson['address'] = value.detailedAddress
return addressJson return addressJson
}, },
postDiy(e, member_id = this.member_id) { postDiy(e, member_id = this.member_id) {
var that = this; var that = this;
var formData = e; var formData = e;
@ -748,7 +761,23 @@ export default {
}); });
} }
); );
} },
// 微信公众号网页 - 微信绑定
weChatBinding(){
$http.get("member.register.wechat-binding").then(response => {
if (response.result == 1) {
console.log(response.data);
if(response.data.url) window.location.href = response.data.url;
return;
}
});
},
}, },
components: { components: {
cTitle, cTitle,