修改bug
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
<view class="avatar-section">
|
||||
<view class="avatar-container">
|
||||
<image class="avatar-img" :src="userInfo.img" mode="aspectFill" @click="chooseImage"/>
|
||||
<image class="avatar-img" :src="imgUrl" mode="aspectFill" @click="chooseImage"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -79,12 +79,14 @@ export default {
|
||||
userName:'',
|
||||
phone:'',
|
||||
gender:'',
|
||||
sexLabel:''
|
||||
sexLabel:'',
|
||||
|
||||
},
|
||||
genderOptions: [
|
||||
{value: 1, label: '男'},
|
||||
{value: 2, label: '女'}
|
||||
]
|
||||
],
|
||||
imgUrl:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -102,6 +104,12 @@ export default {
|
||||
if (res.code == "200") {
|
||||
this.userInfo =res.data;
|
||||
this.userInfo.sexLabel = this.genderOptions[this.userInfo.gender-1].label;
|
||||
params.img = this.userInfo.img;
|
||||
this.$u.api.getImageUrl(params).then(res=>{
|
||||
if (res.code == 200) {
|
||||
this.imgUrl=res.data[0].url;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
this.$u.api.unit.queryUnitById(params).then(res => {
|
||||
@@ -138,8 +146,8 @@ export default {
|
||||
name: 'file',
|
||||
vm: this
|
||||
});
|
||||
this.userInfo.img = result[0].data.url;
|
||||
console.log(this.userInfo.img);
|
||||
this.userInfo.img = result[0].data.ossId;
|
||||
this.imgUrl = result[0].data.url;
|
||||
const allSuccess = result.every(item => item.code == 200);
|
||||
if (!allSuccess) {
|
||||
uni.showToast({
|
||||
|
Reference in New Issue
Block a user