From 67b24d61b621b768cf3a9a025acea52fa0009cdb Mon Sep 17 00:00:00 2001 From: owen Date: Thu, 14 Dec 2023 20:22:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6=E3=80=90?= =?UTF-8?q?=E7=83=AD=E5=8C=BA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 41a404a52c64e2a1d47ab7fc4269e1fb56181a4a) --- .../AppLinkInput/AppLinkSelectDialog.vue | 40 +-- src/components/AppLinkInput/data.ts | 19 +- .../HotZoneEditDialog/controller.ts | 143 +++++++++++ .../components/HotZoneEditDialog/index.vue | 236 ++++++++++++++++++ .../components/mobile/HotZone/config.ts | 42 ++++ .../components/mobile/HotZone/index.vue | 42 ++++ .../components/mobile/HotZone/property.vue | 63 +++++ src/components/DiyEditor/util.ts | 10 +- 8 files changed, 577 insertions(+), 18 deletions(-) create mode 100644 src/components/DiyEditor/components/mobile/HotZone/components/HotZoneEditDialog/controller.ts create mode 100644 src/components/DiyEditor/components/mobile/HotZone/components/HotZoneEditDialog/index.vue create mode 100644 src/components/DiyEditor/components/mobile/HotZone/config.ts create mode 100644 src/components/DiyEditor/components/mobile/HotZone/index.vue create mode 100644 src/components/DiyEditor/components/mobile/HotZone/property.vue diff --git a/src/components/AppLinkInput/AppLinkSelectDialog.vue b/src/components/AppLinkInput/AppLinkSelectDialog.vue index a536ac13..41a43590 100644 --- a/src/components/AppLinkInput/AppLinkSelectDialog.vue +++ b/src/components/AppLinkInput/AppLinkSelectDialog.vue @@ -32,7 +32,7 @@ > {{ appLink.name }} @@ -63,7 +63,7 @@ + + diff --git a/src/components/DiyEditor/components/mobile/HotZone/config.ts b/src/components/DiyEditor/components/mobile/HotZone/config.ts new file mode 100644 index 00000000..9dcebcc2 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/HotZone/config.ts @@ -0,0 +1,42 @@ +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' + +/** 热区属性 */ +export interface HotZoneProperty { + // 图片地址 + imgUrl: string + // 导航菜单列表 + list: HotZoneItemProperty[] + // 组件样式 + style: ComponentStyle +} +/** 热区项目属性 */ +export interface HotZoneItemProperty { + // 链接的名称 + name: string + // 链接 + url: string + // 宽 + width: number + // 高 + height: number + // 上 + top: number + // 左 + left: number +} + +// 定义组件 +export const component = { + id: 'HotZone', + name: '热区', + icon: 'tabler:hand-click', + property: { + imgUrl: '', + list: [] as HotZoneItemProperty[], + style: { + bgType: 'color', + bgColor: '#fff', + marginBottom: 8 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/HotZone/index.vue b/src/components/DiyEditor/components/mobile/HotZone/index.vue new file mode 100644 index 00000000..3a9b842e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/HotZone/index.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/DiyEditor/components/mobile/HotZone/property.vue b/src/components/DiyEditor/components/mobile/HotZone/property.vue new file mode 100644 index 00000000..495cbdce --- /dev/null +++ b/src/components/DiyEditor/components/mobile/HotZone/property.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 940ece4a..8bca9726 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -124,7 +124,15 @@ export const PAGE_LIBS = [ { name: '图文组件', extended: true, - components: ['ImageBar', 'Carousel', 'TitleBar', 'VideoPlayer', 'Divider', 'MagicCube'] + components: [ + 'ImageBar', + 'Carousel', + 'TitleBar', + 'VideoPlayer', + 'Divider', + 'MagicCube', + 'HotZone' + ] }, { name: '商品组件', extended: true, components: ['ProductCard', 'ProductList'] }, {