提交修改

This commit is contained in:
daihh
2022-05-30 23:03:25 +08:00
parent faa7afb65f
commit ab382aca7b
18 changed files with 539 additions and 401 deletions

View File

@@ -1,11 +1,14 @@
<template>
<view>
<page-title :showBack="true">更换头像</page-title>
<view style="text-align: center;padding: 20upx;color: #6b6b6b; ">点击选择图片</view>
<view style="margin-top: 50upx;text-align: center;width: 360upx;height: 360upx;margin: 0upx auto;background-color: #FFFFFF;">
<cropper selWidth="660rpx" selHeight="660rpx" @upload="uploadImg" :avatarSrc="imgurl" avatarStyle="width:50vw;height:50vw;">
<view style="text-align: center;padding: 20upx;color: #6b6b6b; ">点击选择修改头像图片</view>
<view style="margin-top: 50upx;text-align: center;width: 360upx;height: 360upx;margin: 0upx auto;background-color: #FFFFFF;position: relative;">
<cropper selWidth="660rpx" selHeight="660rpx" @upload="uploadImg" :avatarSrc="imgurl" avatarStyle="width:50vw;height:50vw;">
</cropper>
</view>
<!-- <view style="padding: 10px;color: #e20000;" v-if="!loading && imgurl==''">
您还没有设置头像请上传头像图片
</view> -->
<view v-if="isNew">
<view style="margin-top: 100upx;"><button style="width: 50%;" @click="submitUpdate" type="primary">提交修改</button> </view>
</view>
@@ -23,6 +26,7 @@
computed: mapGetters(['userInfo']),
data() {
return {
loading:true,
isNew:false,
imgurl:"",
filePath:"",
@@ -31,12 +35,10 @@
},
onShow() {
this.$store.dispatch('GetUserInfo').then(rs=>{
//this.userInfoObj=rs;
this.imgurl = rs.avatar;
this.aid = rs.aid;
this.loading=false;
})
// this.imgurl = this.userInfo.avatar;
// this.aid = this.userInfo.aid;
},
methods: {
//上传返回图片