feat: 优化为先选择图片再裁剪
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<s-pages title="裁剪头像" :purple_bg="true">
|
||||
<view class="avatar-crop-page">
|
||||
<avatarCropper @confirm="onConfirm" @error="onError" />
|
||||
<avatarCropper :src="src" @confirm="onConfirm" @error="onError" />
|
||||
<view v-if="uploading" class="loading-mask">
|
||||
<view class="loading-box">上传中...</view>
|
||||
</view>
|
||||
@@ -16,10 +16,12 @@
|
||||
import avatarCropper from '@/components/avatar_uploader/avatar_cropper.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const src = ref('');
|
||||
const uploading = ref(false);
|
||||
const eventChannel = ref(null);
|
||||
|
||||
onLoad(() => {
|
||||
onLoad((options) => {
|
||||
src.value = decodeURIComponent(String(options?.src || '').trim());
|
||||
eventChannel.value = proxy.getOpenerEventChannel ? proxy.getOpenerEventChannel() : null;
|
||||
});
|
||||
|
||||
@@ -102,4 +104,3 @@
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user