Browse Source

feat: 代码优化;

pull/1/head
Fox-33 1 month ago
parent
commit
078934e7de
1 changed files with 33 additions and 2 deletions
  1. +33
    -2
      pages_order/record/personalSharing.vue

+ 33
- 2
pages_order/record/personalSharing.vue View File

@ -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;


Loading…
Cancel
Save