20240517
This commit is contained in:
@@ -8,40 +8,105 @@
|
||||
<image
|
||||
:src="userData.avatar"
|
||||
class="per_mes_img"
|
||||
@click="handleClickRightContent({ type: 'avatar' })"
|
||||
@click="
|
||||
handleClickRightContent(
|
||||
{ type: 'avatar' },
|
||||
userData.avatar ? '' : 'bind'
|
||||
)
|
||||
"
|
||||
></image>
|
||||
<text
|
||||
class="avatar_text"
|
||||
@click="handleClickRightContent({ type: 'avatar' })"
|
||||
>更换头像</text
|
||||
@click="
|
||||
handleClickRightContent(
|
||||
{ type: 'avatar' },
|
||||
userData.avatar ? '' : 'bind'
|
||||
)
|
||||
"
|
||||
>{{ userData.avatar ? "更换头像" : "设置头像" }}</text
|
||||
>
|
||||
</view>
|
||||
<view class="set_box">
|
||||
<common-list
|
||||
:dataList="dataList"
|
||||
@hancleClick="handleClickRightContent"
|
||||
label="title"
|
||||
>
|
||||
<common-list :dataList="dataList" isNoIcon="true" label="title">
|
||||
<template slot="rightSlot" slot-scope="slotProps">
|
||||
<view class="right_content">
|
||||
<view v-if="slotProps.row.type == 'sex'">
|
||||
{{ userData[slotProps.row.indexValue] == 0 ? "女" : userData[slotProps.row.indexValue] == 1 ? "男" : "" }}
|
||||
<text
|
||||
v-if="
|
||||
userData[slotProps.row.indexValue]
|
||||
|
||||
"
|
||||
>
|
||||
{{
|
||||
userData[slotProps.row.indexValue] == 2 ? "女" : "男"
|
||||
}}</text
|
||||
>
|
||||
<view
|
||||
v-else
|
||||
@click="handleClickRightContent(slotProps.row, 'bind')"
|
||||
>未设置</view
|
||||
>
|
||||
</view>
|
||||
<view v-if="slotProps.row.type == 'nickname'">
|
||||
{{userData[slotProps.row.indexValue] ? userData[slotProps.row.indexValue] : "" }}
|
||||
<text v-if="userData[slotProps.row.indexValue]">
|
||||
{{ userData[slotProps.row.indexValue] }}</text
|
||||
>
|
||||
<view
|
||||
v-else
|
||||
@click="handleClickRightContent(slotProps.row, 'bind')"
|
||||
>未设置</view
|
||||
>
|
||||
</view>
|
||||
<view v-if="slotProps.row.type == 'tel'">
|
||||
{{ userData[slotProps.row.indexValue] ? userData[slotProps.row.indexValue] : "点击绑定" }}
|
||||
<text v-if="userData[slotProps.row.indexValue]">
|
||||
{{ userData[slotProps.row.indexValue] }}</text
|
||||
>
|
||||
<view
|
||||
v-else
|
||||
@click="handleClickRightContent(slotProps.row, 'bind')"
|
||||
>点击绑定</view
|
||||
>
|
||||
</view>
|
||||
<view v-if="slotProps.row.type == 'password'">
|
||||
{{ userData[slotProps.row.indexValue] ? "更改密码" : "设置密码" }}
|
||||
{{
|
||||
userData[slotProps.row.indexValue] ? "更改密码" : "设置密码"
|
||||
}}
|
||||
</view>
|
||||
<view v-if="slotProps.row.type == 'email'">
|
||||
{{ userData[slotProps.row.indexValue] ? userData[slotProps.row.indexValue] : "点击绑定" }}
|
||||
<text v-if="userData[slotProps.row.indexValue]">
|
||||
{{ userData[slotProps.row.indexValue] }}</text
|
||||
>
|
||||
<view
|
||||
v-else
|
||||
@click="handleClickRightContent(slotProps.row, 'bind')"
|
||||
>点击绑定</view
|
||||
>
|
||||
</view>
|
||||
<view v-if="slotProps.row.type == 'age'">
|
||||
{{userData[slotProps.row.indexValue] ? userData[slotProps.row.indexValue] : "" }}
|
||||
<text v-if="userData[slotProps.row.indexValue]">
|
||||
{{ userData[slotProps.row.indexValue] }}</text
|
||||
>
|
||||
<view
|
||||
v-else
|
||||
@click="handleClickRightContent(slotProps.row, 'bind')"
|
||||
>未设置</view
|
||||
>
|
||||
</view>
|
||||
|
||||
|
||||
<u-icon
|
||||
v-if="
|
||||
userData[slotProps.row.indexValue]&&userData[slotProps.row.indexValue]!=''
|
||||
|
||||
"
|
||||
class="editIcon"
|
||||
name="edit-pen-fill"
|
||||
color="#3ab3ae"
|
||||
size="22"
|
||||
@click.native.stop="handleClickRightContent(slotProps.row)"
|
||||
></u-icon>
|
||||
|
||||
|
||||
</view>
|
||||
<text class="fdButtonBox aui-text-success">{{
|
||||
slotProps.row.content
|
||||
@@ -286,12 +351,14 @@
|
||||
>
|
||||
</u--input>
|
||||
</template>
|
||||
<!-- @click="choseSex(item.id)" -->
|
||||
<!-- @change="choseSex(item.id)" -->
|
||||
<template v-if="currentEditType == 'sex'">
|
||||
<u-radio-group v-model="editForm.sex">
|
||||
<view style="width: 100%">
|
||||
<view
|
||||
v-for="(item, index) in sexList"
|
||||
@click="choseSex(item.id)"
|
||||
|
||||
class="dp_sex"
|
||||
>
|
||||
{{ item.title }}
|
||||
@@ -300,7 +367,7 @@
|
||||
activeColor="#3AB3AE"
|
||||
:name="item.id"
|
||||
style="float: right; margin-top: 5rpx"
|
||||
@change="choseSex(item.id)"
|
||||
|
||||
></u-radio>
|
||||
</view>
|
||||
</view>
|
||||
@@ -446,12 +513,13 @@ export default {
|
||||
},
|
||||
{
|
||||
title: "女",
|
||||
id: 0,
|
||||
id: 2,
|
||||
},
|
||||
],
|
||||
PhoneEmailNote: "获取验证码",
|
||||
passNote: "",
|
||||
passStr: "",
|
||||
editModalTitle: "",
|
||||
passwordOk: false, // 密码是否满足规则
|
||||
|
||||
urlList: {
|
||||
@@ -495,7 +563,7 @@ export default {
|
||||
this.editForm = {};
|
||||
this.editModalShow = false;
|
||||
},
|
||||
handleClickRightContent(row) {
|
||||
handleClickRightContent(row, type) {
|
||||
this.OpenClear();
|
||||
// this.currentEditType=null;
|
||||
var title = "";
|
||||
@@ -503,33 +571,39 @@ export default {
|
||||
console.log("row.type at line 122:", row);
|
||||
switch (row.type) {
|
||||
case "tel":
|
||||
title = "请输入手机号";
|
||||
title = `${type == "bind" ? "绑定" : "修改"}手机号`;
|
||||
this.editForm.quCode = this.quCodeList[0].value;
|
||||
|
||||
break;
|
||||
case "email":
|
||||
title = "请输入邮箱";
|
||||
title = `${type == "bind" ? "绑定" : "修改"}邮箱`;
|
||||
break;
|
||||
|
||||
case "password":
|
||||
title = "请修改密码";
|
||||
title = "修改密码";
|
||||
this.isPassWordPhone = true;
|
||||
// this.editForm.quCode = this.quCodeList[0].value;
|
||||
break;
|
||||
|
||||
case "nickname":
|
||||
title = "请输入昵称";
|
||||
title = `${type == "bind" ? "设置" : "更改"}昵称`;
|
||||
|
||||
break;
|
||||
case "age":
|
||||
title = "请输入年龄";
|
||||
title = `${type == "bind" ? "设置" : "更改"}年龄`;
|
||||
break;
|
||||
|
||||
case "sex":
|
||||
title = "请选择性别";
|
||||
title = `${type == "bind" ? "设置" : "更改"}性别`;
|
||||
console.log("this.userData at line 602:", this.userData);
|
||||
if ( this.userData.sex) {
|
||||
this.editForm.sex = this.userData.sex;
|
||||
console.log("this.editForm.sex at line 603:", this.editForm.sex);
|
||||
}
|
||||
|
||||
break;
|
||||
case "avatar":
|
||||
title = "请更换头像";
|
||||
title = `${type == "bind" ? "设置" : "更改"}头像`;
|
||||
break;
|
||||
|
||||
//
|
||||
@@ -571,6 +645,9 @@ export default {
|
||||
}
|
||||
this.editForm.avatar = this.fileAvatar[0].url;
|
||||
} else if (this.currentEditType == "sex") {
|
||||
if(this.editForm.sex==2){
|
||||
this.editForm.sex=0
|
||||
}
|
||||
} else if (this.currentEditType == "age") {
|
||||
if (this.editForm.age <= 0) {
|
||||
this.$commonJS.showToast("年龄不能小于0");
|
||||
@@ -626,22 +703,12 @@ export default {
|
||||
.post(this.urlList.userInfo + that.userInfo.id)
|
||||
.then((res) => {
|
||||
that.userData = res.user;
|
||||
// that.userMes.id = res.user.id
|
||||
// that.userMes.age = res.user.age
|
||||
// that.userMes.sex = res.user.sex
|
||||
// that.userMes.nickname = res.user.nickname
|
||||
// that.userMes.tel = res.user.tel
|
||||
// that.userMes.avatar = res.user.avatar
|
||||
// that.userMes.oldName = that.userMes.nickname
|
||||
// that.userMes.id = res.user.id
|
||||
// that.userMsage.age = res.user.age
|
||||
// that.userMsage.email = res.user.email
|
||||
// that.userMsage.sex = res.user.sex
|
||||
// that.userMsage.nickname = res.user.nickname
|
||||
// that.userMsage.tel = res.user.tel
|
||||
// that.userMsage.avatar = res.user.avatar
|
||||
// that.userMsage.YNpass = res.user.password
|
||||
// that.userMiMa.id = res.user.id
|
||||
if(that.userData.sex==0){
|
||||
that.userData.sex=2
|
||||
}
|
||||
console.log('that.userData at line 698:', that.userData)
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -747,7 +814,7 @@ export default {
|
||||
});
|
||||
},
|
||||
sendEmailCode(email) {
|
||||
if (email) {
|
||||
if (email == "") {
|
||||
uni.showToast({
|
||||
title: "请输入邮箱",
|
||||
icon: "none",
|
||||
@@ -780,7 +847,7 @@ export default {
|
||||
if (this.readonly) {
|
||||
return;
|
||||
}
|
||||
console.log("this.currentEditType at line 719:", this.currentEditType);
|
||||
console.log("this.currentEditType at line 719:", this.editForm);
|
||||
if (e == "phone" || e == "phone") {
|
||||
this.sendTelCode(this.editForm.phone, this.editForm.quCode);
|
||||
}
|
||||
@@ -824,11 +891,11 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.PhoneEmailNote == "获取验证码") {
|
||||
this.$commonJS.showToast("请发送验证码");
|
||||
// if (this.PhoneEmailNote == "获取验证码") {
|
||||
// this.$commonJS.showToast("请发送验证码");
|
||||
|
||||
return;
|
||||
}
|
||||
// return;
|
||||
// }
|
||||
let that = this;
|
||||
$http
|
||||
.request({
|
||||
@@ -879,14 +946,21 @@ export default {
|
||||
|
||||
return;
|
||||
}
|
||||
if (this.PhoneEmailNote == "获取验证码") {
|
||||
this.$commonJS.showToast("请发送验证码");
|
||||
// if (this.PhoneEmailNote == "获取验证码") {
|
||||
// this.$commonJS.showToast("请发送验证码");
|
||||
|
||||
return;
|
||||
}
|
||||
// return;
|
||||
// }
|
||||
let that = this;
|
||||
this.$http
|
||||
.post(this.urlList.updateUserEmail, data)
|
||||
$http
|
||||
.request({
|
||||
url: this.urlList.updateUserEmail,
|
||||
method: "POST",
|
||||
data: data,
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
|
||||
.then(async (res) => {
|
||||
if (res.code == 0) {
|
||||
@@ -1200,7 +1274,7 @@ export default {
|
||||
.per_mes_img {
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
background-color: #f0f0f0;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 120rpx;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
@@ -1287,8 +1361,10 @@ export default {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
float: right;
|
||||
padding-right: 20rpx;
|
||||
//padding-right: 20rpx;
|
||||
color: #909090;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.fdButtonBox {
|
||||
@@ -1308,7 +1384,7 @@ export default {
|
||||
}
|
||||
|
||||
.commonPageBox {
|
||||
background-color: #f0f0f0;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.set_box {
|
||||
|
||||
Reference in New Issue
Block a user