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) => {