|
@@ -4,7 +4,13 @@
|
|
|
<view class="list_title flex_r flex_ac flex_jb"
|
|
<view class="list_title flex_r flex_ac flex_jb"
|
|
|
><text>头</text><text>像:</text></view
|
|
><text>头</text><text>像:</text></view
|
|
|
>
|
|
>
|
|
|
- <img @click="upheadimg" :src="formDa.head_pic" alt="" srcset="" class="head_pic" />
|
|
|
|
|
|
|
+ <img
|
|
|
|
|
+ @click="upheadimg"
|
|
|
|
|
+ :src="formDa.head_pic"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ srcset=""
|
|
|
|
|
+ class="head_pic"
|
|
|
|
|
+ />
|
|
|
</view>
|
|
</view>
|
|
|
<view class="list flex_r flex_ac">
|
|
<view class="list flex_r flex_ac">
|
|
|
<view class="list_title flex_r flex_ac flex_jb"
|
|
<view class="list_title flex_r flex_ac flex_jb"
|
|
@@ -28,17 +34,20 @@ import { get, post } from "@/request/api.js";
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- formDa: {},
|
|
|
|
|
|
|
+ formDa: {
|
|
|
|
|
+ nickname:undefined,
|
|
|
|
|
+ head_pic:undefined
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
this.loadData();
|
|
this.loadData();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- loadData(){
|
|
|
|
|
- let da = uni.getStorageSync("userinfo");
|
|
|
|
|
- this.formDa.nickname = da.nickname;
|
|
|
|
|
- this.formDa.head_pic = da.head_pic;
|
|
|
|
|
|
|
+ loadData() {
|
|
|
|
|
+ let da = uni.getStorageSync("userinfo");
|
|
|
|
|
+ this.formDa.nickname = da.nickname;
|
|
|
|
|
+ this.formDa.head_pic = da.head_pic;
|
|
|
},
|
|
},
|
|
|
upheadimg() {
|
|
upheadimg() {
|
|
|
// 上传图片uploadImg
|
|
// 上传图片uploadImg
|
|
@@ -49,7 +58,7 @@ export default {
|
|
|
sourceType: ["album", "camera"], // album 从相册选图,camera 使用相机,默认二者都有
|
|
sourceType: ["album", "camera"], // album 从相册选图,camera 使用相机,默认二者都有
|
|
|
success: function (res) {
|
|
success: function (res) {
|
|
|
var arr = res.tempFiles;
|
|
var arr = res.tempFiles;
|
|
|
- that.$up(arr[0].path).then(res => {
|
|
|
|
|
|
|
+ that.$up(arr[0].path).then((res) => {
|
|
|
that.$set(that.formDa, "head_pic", res);
|
|
that.$set(that.formDa, "head_pic", res);
|
|
|
// that.formDa.head_pic = res;
|
|
// that.formDa.head_pic = res;
|
|
|
});
|
|
});
|
|
@@ -61,6 +70,9 @@ export default {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
appEv.errTips(res.msg);
|
|
appEv.errTips(res.msg);
|
|
|
this.getuserInfo();
|
|
this.getuserInfo();
|
|
|
|
|
+ uni.navigateBack({
|
|
|
|
|
+ delta: 1, //返回层数,2则上上页
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|