feat: 裁剪添加放大缩小
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user