|
|
|
@ -3,20 +3,20 @@ |
|
|
|
|
<view class="edit-navbar"> |
|
|
|
|
<u-navbar title="编辑资料" back-icon-color="#333333" title-color="#333333" :background="background"> |
|
|
|
|
<view class="slot-wrap" slot="right"> |
|
|
|
|
<view class="btn" @click="toReg()">保存</view> |
|
|
|
|
<view class="btn" @click="toSave()">保存</view> |
|
|
|
|
</view> |
|
|
|
|
</u-navbar> |
|
|
|
|
</view> |
|
|
|
|
<view class="edit-user"> |
|
|
|
|
<view class="user"> |
|
|
|
|
<view class="pic" @click="toNext(1)"> |
|
|
|
|
<view class="pic" @click="toNext(userInfo.faceImage?1:3)"> |
|
|
|
|
<image class="avatar" v-if="userInfo.faceImage" :src="userInfo.faceImage"></image> |
|
|
|
|
<image class="avatar" v-else :src="baseUrl+userInfo.img"></image> |
|
|
|
|
<image class="xiangji" src="@/static/xiangji.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="tips"> |
|
|
|
|
尊敬的用户,个人资料内容必须遵守相关法规和平台规则,上传过于暴露的照片、违规昵称宣言将会被封禁。您的头像会用于进行实名认证图片比对,若比对不通过,则修改失败。 |
|
|
|
|
<text>尊敬的用户,个人资料内容必须遵守相关法规和平台规则,上传过于暴露的照片、违规昵称宣言将会被封禁。\n\n您的头像会用于进行实名认证图片比对,若比对不通过,则修改失败。</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="edit-hd"> |
|
|
|
@ -60,26 +60,26 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="a">身高</view> |
|
|
|
|
<view class="b"><picker :range="pickerList1" :value="userInfo.height" @change="pickerDate2"> |
|
|
|
|
<view class="b"><picker :range="pickerList1" :value="pickerIndex1" @change="pickerDate2"> |
|
|
|
|
<view class="txt" :class="userInfo.height?'txt-on':''">{{userInfo.height?userInfo.height:'请选择'}}</view> |
|
|
|
|
</picker><image src="@/static/icon-arrow.png"></image></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="a">体重</view> |
|
|
|
|
<view class="b"><picker :range="pickerList2" :value="userInfo.weight" @change="pickerDate3"> |
|
|
|
|
<view class="a">体重{{pickerIndex2}}</view> |
|
|
|
|
<view class="b"><picker :range="pickerList2" :value="pickerIndex2" @change="pickerDate3"> |
|
|
|
|
<view class="txt" :class="userInfo.weight?'txt-on':''">{{userInfo.weight?userInfo.weight:'请选择'}}</view> |
|
|
|
|
</picker><image src="@/static/icon-arrow.png"></image></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="a">年收入</view> |
|
|
|
|
<view class="b"><picker :range="pickerList3" range-key="dictLabel" :value="userInfo.annualIncome" @change="pickerDate4"> |
|
|
|
|
<view class="b"><picker :range="pickerList3" range-key="dictLabel" :value="pickerIndex3" @change="pickerDate4"> |
|
|
|
|
<view class="txt" :class="userInfo.annualIncome?'txt-on':''">{{userInfo.annualIncome?userInfo.annualIncome:'请选择'}}</view> |
|
|
|
|
</picker><image src="@/static/icon-arrow.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="a">学历</view> |
|
|
|
|
<view class="b"><picker :range="pickerList4" range-key="dictLabel" :value="userInfo.xueli" @change="pickerDate5"> |
|
|
|
|
<view class="b"><picker :range="pickerList4" range-key="dictLabel" :value="pickerIndex4" @change="pickerDate5"> |
|
|
|
|
<view class="txt" :class="userInfo.xueli?'txt-on':''">{{userInfo.xueli?userInfo.xueli:'请选择'}}</view> |
|
|
|
|
</picker><image src="@/static/icon-arrow.png"></image> |
|
|
|
|
</view> |
|
|
|
@ -99,7 +99,7 @@ |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="a">星座</view> |
|
|
|
|
<view class="b"> |
|
|
|
|
<picker :range="pickerList5" range-key="dictLabel" :value="userInfo.constellation" @change="pickerDate6"> |
|
|
|
|
<picker :range="pickerList5" range-key="dictLabel" :value="pickerIndex5" @change="pickerDate6"> |
|
|
|
|
<view class="txt" :class="userInfo.constellation?'txt-on':''">{{userInfo.constellation?userInfo.constellation:'请选择'}}</view> |
|
|
|
|
</picker><image src="@/static/icon-arrow.png"></image> |
|
|
|
|
</view> |
|
|
|
@ -111,7 +111,7 @@ |
|
|
|
|
<view class="content"> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="a">情感状态</view> |
|
|
|
|
<view class="b"><picker :range="pickerList6" range-key="dictLabel" :value="userInfo.emotion" @change="pickerDate7"> |
|
|
|
|
<view class="b"><picker :range="pickerList6" range-key="dictLabel" :value="pickerIndex6" @change="pickerDate7"> |
|
|
|
|
<view class="txt" :class="userInfo.emotion?'txt-on':''">{{userInfo.emotion?userInfo.emotion:'请选择'}}</view> |
|
|
|
|
</picker><image src="@/static/icon-arrow.png"></image></view> |
|
|
|
|
</view> |
|
|
|
@ -132,7 +132,7 @@ |
|
|
|
|
<view class="content"> |
|
|
|
|
<view class="items" v-for="(a,i) in userInfo.xiangce" :key="i"> |
|
|
|
|
<image class="del" @click.stop="toDel(i)" src="@/static/icon-del.png"></image> |
|
|
|
|
<image class="pic" :src="baseUrl+a"></image> |
|
|
|
|
<image class="pic" :src="a"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="upload" @click="toNext(2)"> |
|
|
|
|
<image src="@/static/jia.png"></image> |
|
|
|
@ -172,6 +172,12 @@ |
|
|
|
|
pickerList6: [], |
|
|
|
|
pickerList7: [], |
|
|
|
|
pickerList8: [], |
|
|
|
|
pickerIndex1: 0, |
|
|
|
|
pickerIndex2: 0, |
|
|
|
|
pickerIndex3: 0, |
|
|
|
|
pickerIndex4: 0, |
|
|
|
|
pickerIndex5: 0, |
|
|
|
|
pickerIndex6: 0, |
|
|
|
|
cityType: 1, |
|
|
|
|
defaultRegion: [], |
|
|
|
|
uploadType: 1 |
|
|
|
@ -188,20 +194,13 @@ |
|
|
|
|
onReady() { |
|
|
|
|
const that = this; |
|
|
|
|
that.baseUrl = that.$baseUrl; |
|
|
|
|
for(let i = 150;i<=210;i++){ |
|
|
|
|
that.pickerList1.push(i+"cm") |
|
|
|
|
} |
|
|
|
|
for(let i = 40;i<=120;i++){ |
|
|
|
|
that.pickerList2.push(i+"kg") |
|
|
|
|
} |
|
|
|
|
that.getUserInfo(); |
|
|
|
|
that.getDictDataByType(); |
|
|
|
|
uni.$on("yuyin",res=>{ |
|
|
|
|
|
|
|
|
|
uni.$on("changVioce",res=>{ |
|
|
|
|
that.getUserInfo(); |
|
|
|
|
}) |
|
|
|
|
// 监听从裁剪页发布的事件,获得裁剪结果 |
|
|
|
|
uni.$on('uAvatarCropper', path => { |
|
|
|
|
if(that.uploadType == 2){ |
|
|
|
|
if(that.uploadType == 2 || that.uploadType == 3){ |
|
|
|
|
// 可以在此上传到服务端 |
|
|
|
|
uni.uploadFile({ |
|
|
|
|
url: that.$baseUrl+'/prod-api/common/upload', |
|
|
|
@ -214,7 +213,11 @@ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "上传成功" |
|
|
|
|
}) |
|
|
|
|
that.userInfo.xiangce.push(fileName); |
|
|
|
|
if(that.uploadType == 2){ |
|
|
|
|
that.userInfo.xiangce.push(url); |
|
|
|
|
}else{ |
|
|
|
|
that.userInfo.img = url; |
|
|
|
|
} |
|
|
|
|
that.$forceUpdate(); |
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
@ -232,41 +235,38 @@ |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else{ |
|
|
|
|
// 监听从裁剪页发布的事件,获得裁剪结果 |
|
|
|
|
uni.$on('uAvatarCropper', path => { |
|
|
|
|
const that = this; |
|
|
|
|
// 可以在此上传到服务端 |
|
|
|
|
uni.uploadFile({ |
|
|
|
|
url: that.$baseUrl+'/prod-api/api/user/uploadOSSFile', |
|
|
|
|
filePath: path, |
|
|
|
|
name: 'file', |
|
|
|
|
formData: { |
|
|
|
|
"userId": uni.getStorageSync("userInfo").id |
|
|
|
|
}, |
|
|
|
|
complete: (res) => { |
|
|
|
|
if(res.statusCode == 200){ |
|
|
|
|
const {code, data, msg} = JSON.parse(res.data); |
|
|
|
|
if(code == 200){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "上传成功" |
|
|
|
|
}) |
|
|
|
|
that.toReg(data) |
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "error", |
|
|
|
|
title: "上传失败" |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// 可以在此上传到服务端 |
|
|
|
|
uni.uploadFile({ |
|
|
|
|
url: that.$baseUrl+'/prod-api/api/user/uploadOSSFile', |
|
|
|
|
filePath: path, |
|
|
|
|
name: 'file', |
|
|
|
|
formData: { |
|
|
|
|
"userId": uni.getStorageSync("userInfo").id |
|
|
|
|
}, |
|
|
|
|
complete: (res) => { |
|
|
|
|
if(res.statusCode == 200){ |
|
|
|
|
const {code, data, msg} = JSON.parse(res.data); |
|
|
|
|
if(code == 200){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "上传成功" |
|
|
|
|
}) |
|
|
|
|
that.toReg(data) |
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "error", |
|
|
|
|
title: "上传失败" |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "error", |
|
|
|
|
title: "上传失败" |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
@ -331,6 +331,8 @@ |
|
|
|
|
this.userInfo.city = this.defaultRegion[1]; |
|
|
|
|
this.userInfo.district = this.defaultRegion[2]; |
|
|
|
|
console.log(this.defaultRegion) |
|
|
|
|
|
|
|
|
|
this.getDictDataByType(); |
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: mgs, |
|
|
|
@ -341,40 +343,103 @@ |
|
|
|
|
}, |
|
|
|
|
//字典查询 |
|
|
|
|
async getDictDataByType() { |
|
|
|
|
const res1 = await this.$api.getDictDataByType({dictType: 'salary_type'}); |
|
|
|
|
const res2 = await this.$api.getDictDataByType({dictType: 'education_type'}); |
|
|
|
|
const res3 = await this.$api.getDictDataByType({dictType: 'constellation_type'}); |
|
|
|
|
const res5 = await this.$api.getDictDataByType({dictType: this.userInfo.sex == 1?'sex_type_2':'sex_type_1'}); |
|
|
|
|
const res4 = await this.$api.getDictDataByType({dictType: 'marriage_type'}); |
|
|
|
|
const res6 = await this.$api.getDictDataByType({dictType: 'live_type'}); |
|
|
|
|
const that = this; |
|
|
|
|
for(let i = 150;i<=210;i++){ |
|
|
|
|
if((i+"cm") == that.userInfo.height){ |
|
|
|
|
that.pickerIndex1 = (i-150) |
|
|
|
|
} |
|
|
|
|
that.pickerList1.push(i+"cm") |
|
|
|
|
} |
|
|
|
|
for(let i = 40;i<=120;i++){ |
|
|
|
|
if((i+"kg") == that.userInfo.weight){ |
|
|
|
|
that.pickerIndex2 = (i-40) |
|
|
|
|
} |
|
|
|
|
that.pickerList2.push(i+"kg") |
|
|
|
|
} |
|
|
|
|
let res1 = await that.$api.getDictDataByType({dictType: 'salary_type'}); |
|
|
|
|
let res2 = await that.$api.getDictDataByType({dictType: 'education_type'}); |
|
|
|
|
let res3 = await that.$api.getDictDataByType({dictType: 'constellation_type'}); |
|
|
|
|
let res4 = await that.$api.getDictDataByType({dictType: 'marriage_type'}); |
|
|
|
|
let res5 = await that.$api.getDictDataByType({dictType: that.userInfo.sex == 1?'sex_type_2':'sex_type_1'}); |
|
|
|
|
if(res1.data && res1.data.length > 0){ |
|
|
|
|
res1.data.map((a,index)=>{ |
|
|
|
|
if(that.userInfo.annualIncome == a.dictValue){ |
|
|
|
|
that.userInfo.annualIncome = a.dictLabel |
|
|
|
|
that.userInfo.annualIncomeId = a.dictValue |
|
|
|
|
that.pickerIndex3 = index; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if(res2.data && res2.data.length > 0){ |
|
|
|
|
res2.data.map((a,index)=>{ |
|
|
|
|
if(that.userInfo.xueli == a.dictValue){ |
|
|
|
|
that.userInfo.xueli = a.dictLabel |
|
|
|
|
that.userInfo.xueliId = a.dictValue |
|
|
|
|
that.pickerIndex4 = index |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if(res3.data && res3.data.length > 0){ |
|
|
|
|
res3.data.map((a,index)=>{ |
|
|
|
|
if(that.userInfo.constellation == a.dictValue){ |
|
|
|
|
that.userInfo.constellation = a.dictLabel; |
|
|
|
|
that.userInfo.constellationId = a.dictValue; |
|
|
|
|
that.pickerIndex5 = index |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if(res4.data && res4.data.length > 0){ |
|
|
|
|
res4.data.map((a,index)=>{ |
|
|
|
|
if(that.userInfo.emotion == a.dictValue){ |
|
|
|
|
that.userInfo.emotion = a.dictLabel; |
|
|
|
|
that.userInfo.emotionId = a.dictValue; |
|
|
|
|
that.pickerIndex6 = index |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.pickerList3 = res1.data; |
|
|
|
|
this.pickerList4 = res2.data; |
|
|
|
|
this.pickerList5 = res3.data; |
|
|
|
|
this.pickerList6 = res4.data; |
|
|
|
|
let arr = res5.data; |
|
|
|
|
if(arr && arr.length > 0){ |
|
|
|
|
arr.map(a=>{ |
|
|
|
|
a.isSelect = false |
|
|
|
|
let sexFlag = "",arr=[],arr1=[]; |
|
|
|
|
if(res5.data && res5.data.length > 0){ |
|
|
|
|
res5.data.map(a=>{ |
|
|
|
|
a.isSelect = false; |
|
|
|
|
if(that.userInfo.sexFlag ){ |
|
|
|
|
sexFlag = that.userInfo.sexFlag.split(",") |
|
|
|
|
sexFlag.map(b=>{ |
|
|
|
|
if(b== a.dictValue){ |
|
|
|
|
arr.push(a.dictLabel) |
|
|
|
|
arr1.push(a.dictValue) |
|
|
|
|
a.isSelect = true |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.pickerList7 = arr; |
|
|
|
|
this.pickerList8 = res6.data; |
|
|
|
|
if(that.userInfo.sexFlag ){ |
|
|
|
|
that.userInfo.sexFlag = arr; |
|
|
|
|
that.userInfo.sexFlagIds = arr1; |
|
|
|
|
} |
|
|
|
|
this.pickerList7 = res5.data; |
|
|
|
|
}, |
|
|
|
|
tabItem(index){ |
|
|
|
|
this.pickerList7[index].isSelect = !this.pickerList7[index].isSelect; |
|
|
|
|
}, |
|
|
|
|
toClick(){ |
|
|
|
|
this.show = false |
|
|
|
|
let arr = []; |
|
|
|
|
let arr = [],arr1=[]; |
|
|
|
|
if(this.pickerList7 && this.pickerList7.length > 0){ |
|
|
|
|
this.pickerList7.map(a=>{ |
|
|
|
|
if(a.isSelect){ |
|
|
|
|
arr.push(a.dictLabel) |
|
|
|
|
arr1.push(a.dictValue) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.userInfo.sexFlag = arr.length>=1?arr:"" |
|
|
|
|
this.userInfo.sexFlagIds = arr1.length>=1?arr1:"" |
|
|
|
|
}, |
|
|
|
|
pickerDate1(e){ |
|
|
|
|
this.userInfo.birthday = e.detail.value |
|
|
|
@ -387,15 +452,23 @@ |
|
|
|
|
}, |
|
|
|
|
pickerDate4(e){ |
|
|
|
|
this.userInfo.annualIncome = this.pickerList3[e.detail.value].dictLabel |
|
|
|
|
this.userInfo.annualIncomeId = this.pickerList3[e.detail.value].dictValue; |
|
|
|
|
this.pickerIndex3 = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
pickerDate5(e){ |
|
|
|
|
this.userInfo.xueli = this.pickerList4[e.detail.value].dictLabel |
|
|
|
|
this.userInfo.xueliId = this.pickerList4[e.detail.value].dictValue |
|
|
|
|
this.pickerIndex4 = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
pickerDate6(e){ |
|
|
|
|
this.userInfo.constellation = this.pickerList5[e.detail.value].dictLabel |
|
|
|
|
this.userInfo.constellationId = this.pickerList5[e.detail.value].dictValue |
|
|
|
|
this.pickerIndex5 = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
pickerDate7(e){ |
|
|
|
|
this.userInfo.emotion = this.pickerList6[e.detail.value].dictLabel |
|
|
|
|
this.userInfo.emotionId = this.pickerList6[e.detail.value].dictValue |
|
|
|
|
this.pickerIndex6 = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
toDel(i){ |
|
|
|
|
this.userInfo.xiangce.splice(i,1); |
|
|
|
@ -403,6 +476,7 @@ |
|
|
|
|
}, |
|
|
|
|
toNext(index) { |
|
|
|
|
this.uploadType=index; |
|
|
|
|
console.log(222,this.uploadType) |
|
|
|
|
this.$u.route({ |
|
|
|
|
// 关于此路径,请见下方"注意事项" |
|
|
|
|
url: '/uni_modules/vk-uview-ui/components/u-avatar-cropper/u-avatar-cropper', |
|
|
|
@ -438,12 +512,160 @@ |
|
|
|
|
toPage() { |
|
|
|
|
uni.setStorageSync("yuyinInfo",{ |
|
|
|
|
voice: this.userInfo.voice, |
|
|
|
|
voiceTime: Math.floor(this.userInfo.voiceTime/60)+":"+(this.userInfo.voiceTime-Math.floor(this.userInfo.voiceTime/60)*60), |
|
|
|
|
voiceTime: this.userInfo.voiceTime, |
|
|
|
|
}) |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: "/pages/users/yuyin/index" |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
async toSave() { |
|
|
|
|
if(!this.userInfo.declaration){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "交友宣言不能为空!" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.nickname){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "昵称不能为空!" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.birthday){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "出生日期不能为空!" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.height){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "请选择身高" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.weight){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "请选择体重" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.annualIncome){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "请选择年收入" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.xueli){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "请选择学历" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.post){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "职业不能为空!" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.city){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "请选择现居城市" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.home){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "请选择家乡" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.emotion){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "请选择情感状态" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(!this.userInfo.sexFlag){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "请选择喜欢什么异性" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
if(this.userInfo.xiangce.length == 0){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: "请上传照片" |
|
|
|
|
}) |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
const {code, data, msg} = await this.$api.editUser({ |
|
|
|
|
id: uni.getStorageSync("userInfo").id, |
|
|
|
|
nickname: this.userInfo.nickname, |
|
|
|
|
faceImage: this.userInfo.faceImage, |
|
|
|
|
xueli: this.userInfo.xueliId, |
|
|
|
|
img: this.userInfo.img, |
|
|
|
|
birthday: this.userInfo.birthday, |
|
|
|
|
declaration: this.userInfo.declaration, |
|
|
|
|
voice: this.userInfo.voice, |
|
|
|
|
voiceTime: this.userInfo.voiceTime, |
|
|
|
|
height: this.userInfo.height, |
|
|
|
|
weight: this.userInfo.weight, |
|
|
|
|
post: this.userInfo.post, |
|
|
|
|
emotion: this.userInfo.emotionId, |
|
|
|
|
annualIncome: this.userInfo.annualIncomeId, |
|
|
|
|
home: this.userInfo.home, |
|
|
|
|
constellation: this.userInfo.constellationId, |
|
|
|
|
sexFlag: this.userInfo.sexFlagIds.join(","), |
|
|
|
|
province: this.userInfo.province, |
|
|
|
|
district: this.userInfo.district, |
|
|
|
|
city: this.userInfo.city, |
|
|
|
|
address: this.userInfo.address, |
|
|
|
|
reserved1: this.userInfo.xiangce.join(","), |
|
|
|
|
}) |
|
|
|
|
if(code == 200){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "保存成功" |
|
|
|
|
}) |
|
|
|
|
// this.getUserInfo(); |
|
|
|
|
// this.$forceUpdate(); |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
},2000) |
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: "none", |
|
|
|
|
position: "bottom", |
|
|
|
|
title: msg |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|