mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-08 02:16:46 +08:00
提交修改
This commit is contained in:
@@ -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: {
|
||||
//上传返回图片
|
||||
|
||||
Reference in New Issue
Block a user