|
@@ -1,14 +1,14 @@
|
|
<template>
|
|
<template>
|
|
<view class="content">
|
|
<view class="content">
|
|
<view @click="upload" class="picture">
|
|
<view @click="upload" class="picture">
|
|
- <image class="xj-image" v-if="!deptListurl.avatarUrl" src="@/static/images/common/tianjiazhaopian@2x.png"></image>
|
|
|
|
|
|
+ <image class="xj-image" v-if="!deptListurl.avatarUrl" src="@/static/images/common/tianjiazhaopian@2x.png">
|
|
|
|
+ </image>
|
|
<image class="xj-image" :src="deptListurl.avatarUrl" v-if="deptListurl.avatarUrl"></image>
|
|
<image class="xj-image" :src="deptListurl.avatarUrl" v-if="deptListurl.avatarUrl"></image>
|
|
-
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
- <view @click="submit" class="submit">提交</view>
|
|
|
|
|
|
+ <view @click="submit" class="submit">提交</view>
|
|
<u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
|
|
<u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
|
|
- @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true"
|
|
|
|
- @close="isShowimgType=false">
|
|
|
|
|
|
+ @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
|
|
</u-action-sheet>
|
|
</u-action-sheet>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -22,12 +22,12 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- isShowimgType:false,
|
|
|
|
- imgSrc:'',
|
|
|
|
- deptListurl:{
|
|
|
|
- avatarUrl:'',
|
|
|
|
- id:''
|
|
|
|
- }
|
|
|
|
|
|
+ isShowimgType: false,
|
|
|
|
+ imgSrc: '',
|
|
|
|
+ deptListurl: {
|
|
|
|
+ avatarUrl: '',
|
|
|
|
+ id: ''
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -39,7 +39,7 @@
|
|
methods: {
|
|
methods: {
|
|
upload() {
|
|
upload() {
|
|
this.isShowimgType = true
|
|
this.isShowimgType = true
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
imgTypeSelect(val) {
|
|
imgTypeSelect(val) {
|
|
console.log(val)
|
|
console.log(val)
|
|
@@ -57,33 +57,35 @@
|
|
apiKey: 'yNWLRW6unoUxo2KXiCZxOxGS',
|
|
apiKey: 'yNWLRW6unoUxo2KXiCZxOxGS',
|
|
secretKey: 'E8hqzKWdFdTGnFnpAwZ7ixtL89SN3deR'
|
|
secretKey: 'E8hqzKWdFdTGnFnpAwZ7ixtL89SN3deR'
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- that.$request.baseRequest('get', '/commonUser/getUserDefinedBean', {
|
|
|
|
|
|
+ console.log(res)
|
|
|
|
+ that.$request.baseRequest('post',
|
|
|
|
+ '/commonUser/getUserDefinedBean', {
|
|
accessToken: res.data,
|
|
accessToken: res.data,
|
|
- imagePath : result
|
|
|
|
|
|
+ imagePath: result
|
|
}).then(res1 => {
|
|
}).then(res1 => {
|
|
- that.deptListurl.avatarUrl = result
|
|
|
|
- })
|
|
|
|
- .catch(res => {
|
|
|
|
- uni.$u.toast( res.message);
|
|
|
|
- });
|
|
|
|
|
|
+ that.deptListurl.avatarUrl = result
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ uni.$u.toast(res.message);
|
|
|
|
+ });
|
|
})
|
|
})
|
|
.catch(res => {
|
|
.catch(res => {
|
|
- uni.$u.toast( res.message);
|
|
|
|
|
|
+ uni.$u.toast(res.message);
|
|
});
|
|
});
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
)
|
|
)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
- submit(){
|
|
|
|
|
|
+ submit() {
|
|
this.deptListurl.id = this.userInfo.id
|
|
this.deptListurl.id = this.userInfo.id
|
|
this.$request.baseRequest('post', '/commonUser/editUserInfo', this.deptListurl).then(res => {
|
|
this.$request.baseRequest('post', '/commonUser/editUserInfo', this.deptListurl).then(res => {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -91,7 +93,7 @@
|
|
icon: 'success',
|
|
icon: 'success',
|
|
duration: 2000,
|
|
duration: 2000,
|
|
success() {
|
|
success() {
|
|
- setTimeout(()=>{
|
|
|
|
|
|
+ setTimeout(() => {
|
|
that.userInfo.avatarUrl = that.deptListurl.avatarUrl
|
|
that.userInfo.avatarUrl = that.deptListurl.avatarUrl
|
|
var _student = uni.getStorageSync('userInfo');
|
|
var _student = uni.getStorageSync('userInfo');
|
|
_student.avatarUrl = that.deptListurl.avatarUrl;
|
|
_student.avatarUrl = that.deptListurl.avatarUrl;
|
|
@@ -107,15 +109,15 @@
|
|
message: "修改成功!",
|
|
message: "修改成功!",
|
|
})
|
|
})
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|
|
- delta:1
|
|
|
|
|
|
+ delta: 1
|
|
})
|
|
})
|
|
- },2000)
|
|
|
|
|
|
+ }, 2000)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
.catch(res => {
|
|
.catch(res => {
|
|
- uni.$u.toast( res.message);
|
|
|
|
|
|
+ uni.$u.toast(res.message);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -123,38 +125,42 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style>
|
|
<style>
|
|
- .content{
|
|
|
|
|
|
+ .content {
|
|
background: white;
|
|
background: white;
|
|
padding: 20rpx;
|
|
padding: 20rpx;
|
|
}
|
|
}
|
|
-.left-text {
|
|
|
|
- width: 290rpx;
|
|
|
|
- color: #333333;
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- }
|
|
|
|
- .picture {
|
|
|
|
- margin-top: 20rpx;
|
|
|
|
- background: #F5F6FA;
|
|
|
|
- width: 212rpx;
|
|
|
|
- height: 212rpx;
|
|
|
|
- border-radius: 10rpx;
|
|
|
|
- display: flex;
|
|
|
|
- flex-direction: column;
|
|
|
|
- justify-content: center;
|
|
|
|
- align-items: center;
|
|
|
|
- color: #6A7282;
|
|
|
|
- }
|
|
|
|
- .xj-image {
|
|
|
|
- width: 100rpx;
|
|
|
|
- height: 100rpx;
|
|
|
|
- }
|
|
|
|
- .submit{
|
|
|
|
- margin-top: 20rpx;
|
|
|
|
- background: #2772FB;
|
|
|
|
- border-radius: 50rpx;
|
|
|
|
- padding: 20rpx 0;
|
|
|
|
- color: white;
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ .left-text {
|
|
|
|
+ width: 290rpx;
|
|
|
|
+ color: #333333;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .picture {
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ background: #F5F6FA;
|
|
|
|
+ width: 212rpx;
|
|
|
|
+ height: 212rpx;
|
|
|
|
+ border-radius: 10rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ color: #6A7282;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .xj-image {
|
|
|
|
+ width: 100rpx;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .submit {
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ background: #2772FB;
|
|
|
|
+ border-radius: 50rpx;
|
|
|
|
+ padding: 20rpx 0;
|
|
|
|
+ color: white;
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|