|
@ -33,7 +33,20 @@ |
|
|
<view class="form-item"> |
|
|
<view class="form-item"> |
|
|
<uv-form-item label="选择头像" prop="imageUrl"> |
|
|
<uv-form-item label="选择头像" prop="imageUrl"> |
|
|
<view class="form-item-content"> |
|
|
<view class="form-item-content"> |
|
|
<formUpload v-model="form.avatarUrl"> |
|
|
|
|
|
|
|
|
<button |
|
|
|
|
|
class="btn-avatar" |
|
|
|
|
|
:plain="true" |
|
|
|
|
|
:hairline="false" |
|
|
|
|
|
open-type="chooseAvatar" |
|
|
|
|
|
@chooseavatar="onChooseAvatar" |
|
|
|
|
|
> |
|
|
|
|
|
<image |
|
|
|
|
|
:src="form.avatarUrl || '../static/auth/avatar.png'" |
|
|
|
|
|
style="width: 68rpx; height: 68rpx;" |
|
|
|
|
|
mode="" |
|
|
|
|
|
></image> |
|
|
|
|
|
</button> |
|
|
|
|
|
<!-- <formUpload v-model="form.avatarUrl"> |
|
|
<template v-slot="{ value }"> |
|
|
<template v-slot="{ value }"> |
|
|
<view class="flex" style="min-width: 116rpx; height: 45rpx;"> |
|
|
<view class="flex" style="min-width: 116rpx; height: 45rpx;"> |
|
|
<image |
|
|
<image |
|
@ -45,7 +58,7 @@ |
|
|
<uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon> |
|
|
<uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
</formUpload> |
|
|
|
|
|
|
|
|
</formUpload> --> |
|
|
</view> |
|
|
</view> |
|
|
</uv-form-item> |
|
|
</uv-form-item> |
|
|
</view> |
|
|
</view> |
|
@ -161,6 +174,12 @@ |
|
|
// todo: init data by id |
|
|
// todo: init data by id |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
onChooseAvatar(res) { |
|
|
|
|
|
this.$Oss.ossUpload(res.target.avatarUrl) |
|
|
|
|
|
.then(url => { |
|
|
|
|
|
this.form.avatarUrl = url |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
onSubmit() { |
|
|
onSubmit() { |
|
|
// todo |
|
|
// todo |
|
|
|
|
|
|
|
@ -179,6 +198,18 @@ |
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
|
@import '../styles/pageForm.scss'; |
|
|
@import '../styles/pageForm.scss'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.btn-avatar { |
|
|
|
|
|
background: transparent; |
|
|
|
|
|
border: none; |
|
|
|
|
|
border-radius: none; |
|
|
|
|
|
box-shadow: none; |
|
|
|
|
|
padding: 0; |
|
|
|
|
|
margin: 0; |
|
|
|
|
|
font-size: 0; |
|
|
|
|
|
text-align: right; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.button-submit { |
|
|
.button-submit { |
|
|
margin: 0; |
|
|
margin: 0; |
|
|
position: fixed; |
|
|
position: fixed; |
|
|