feat: 裁剪添加放大缩小

This commit is contained in:
2026-06-15 11:02:13 +08:00
parent 8ec0ad482b
commit 104d63a73d
2 changed files with 256 additions and 40 deletions
+18
View File
@@ -1,5 +1,8 @@
<template>
<s-pages title="裁剪头像" :purple_bg="true">
<template #navRight>
<view class="nav-cancel" @click="cancel">取消</view>
</template>
<view class="avatar-crop-page">
<avatarCropper :src="src" @confirm="onConfirm" @error="onError" />
<view v-if="uploading" class="loading-mask">
@@ -78,6 +81,11 @@
const onError = () => {
uni.showToast({ title: '处理失败,请重试', icon: 'none' });
};
const cancel = () => {
if (uploading.value) return;
uni.navigateBack();
};
</script>
<style lang="scss" scoped>
@@ -86,6 +94,16 @@
height: 100%;
}
.nav-cancel {
padding: 0 24rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: rgba(51, 51, 51, 0.9);
}
.loading-mask {
position: absolute;
inset: 0;