From 045ccca2a6d930f56baf1da9808fd93fede7ab3e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 12 Nov 2025 08:54:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E3=80=90antd=E3=80=91=E3=80=90mall?= =?UTF-8?q?=E3=80=91diy-editor=20=E7=9A=84=20hot-zone-edit-dialog=20?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hot-zone-edit-dialog/controller.ts | 27 +++++----- .../components/hot-zone-edit-dialog/index.vue | 7 ++- .../components/mobile/hot-zone/index.vue | 12 +++-- .../components/mobile/hot-zone/property.vue | 49 +++++-------------- .../views/mall/promotion/components/index.ts | 1 + .../components/mobile/hot-zone/property.vue | 4 +- 6 files changed, 40 insertions(+), 60 deletions(-) diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/controller.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/controller.ts index 2bac4c39e..b4000eccc 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/controller.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/controller.ts @@ -2,10 +2,9 @@ import type { StyleValue } from 'vue'; import type { HotZoneItemProperty } from '../../config'; -// 热区的最小宽高 -export const HOT_ZONE_MIN_SIZE = 100; +export const HOT_ZONE_MIN_SIZE = 100; // 热区的最小宽高 -// 控制的类型 +/** 控制的类型 */ export enum CONTROL_TYPE_ENUM { LEFT, TOP, @@ -13,14 +12,14 @@ export enum CONTROL_TYPE_ENUM { HEIGHT, } -// 定义热区的控制点 +/** 定义热区的控制点 */ export interface ControlDot { position: string; types: CONTROL_TYPE_ENUM[]; style: StyleValue; } -// 热区的8个控制点 +/** 热区的 8 个控制点 */ export const CONTROL_DOT_LIST = [ { position: '左上角', @@ -98,10 +97,10 @@ export const CONTROL_DOT_LIST = [ ] as ControlDot[]; // region 热区的缩放 -// 热区的缩放比例 -export const HOT_ZONE_SCALE_RATE = 2; -// 缩小:缩回适合手机屏幕的大小 -export const zoomOut = (list?: HotZoneItemProperty[]) => { +export const HOT_ZONE_SCALE_RATE = 2; // 热区的缩放比例 + +/** 缩小:缩回适合手机屏幕的大小 */ +export function zoomOut(list?: HotZoneItemProperty[]) { return ( list?.map((hotZone) => ({ ...hotZone, @@ -111,9 +110,10 @@ export const zoomOut = (list?: HotZoneItemProperty[]) => { height: (hotZone.height /= HOT_ZONE_SCALE_RATE), })) || [] ); -}; -// 放大:作用是为了方便在电脑屏幕上编辑 -export const zoomIn = (list?: HotZoneItemProperty[]) => { +} + +/** 放大:作用是为了方便在电脑屏幕上编辑 */ +export function zoomIn(list?: HotZoneItemProperty[]) { return ( list?.map((hotZone) => ({ ...hotZone, @@ -123,7 +123,8 @@ export const zoomIn = (list?: HotZoneItemProperty[]) => { height: (hotZone.height *= HOT_ZONE_SCALE_RATE), })) || [] ); -}; +} + // endregion /** diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/index.vue index dbb17e6ea..2f7136ffd 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/index.vue @@ -213,8 +213,9 @@ const handleAppLinkChange = (appLink: AppLink) => {