From 41a404a52c64e2a1d47ab7fc4269e1fb56181a4a Mon Sep 17 00:00:00 2001 From: owen Date: Thu, 14 Dec 2023 20:22:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E3=80=90=E7=83=AD=E5=8C=BA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../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'] }, { From 33162a12c0569056730bd7d06d3c5ea2b1bcb650 Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 15 Dec 2023 13:26:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E3=80=90=E6=A0=87=E9=A2=98=E6=A0=8F=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/TitleBar/config.ts | 26 ++- .../components/mobile/TitleBar/index.vue | 21 +- .../components/mobile/TitleBar/property.vue | 190 +++++++++--------- 3 files changed, 120 insertions(+), 117 deletions(-) diff --git a/src/components/DiyEditor/components/mobile/TitleBar/config.ts b/src/components/DiyEditor/components/mobile/TitleBar/config.ts index 3d486cc3..d9f0672c 100644 --- a/src/components/DiyEditor/components/mobile/TitleBar/config.ts +++ b/src/components/DiyEditor/components/mobile/TitleBar/config.ts @@ -1,7 +1,13 @@ -import { DiyComponent } from '@/components/DiyEditor/util' +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' /** 标题栏属性 */ export interface TitleBarProperty { + // 背景图 + bgImgUrl: string + // 偏移 + marginLeft: number + // 显示位置 + textAlign: 'left' | 'center' // 主标题 title: string // 副标题 @@ -12,18 +18,12 @@ export interface TitleBarProperty { descriptionSize: number // 标题粗细 titleWeight: number - // 显示位置 - position: 'left' | 'center' // 描述粗细 descriptionWeight: number // 标题颜色 titleColor: string // 描述颜色 descriptionColor: string - // 背景颜色 - backgroundColor: string - // 底部分割线 - showBottomBorder: false // 查看更多 more: { // 是否显示查看更多 @@ -35,6 +35,8 @@ export interface TitleBarProperty { // 链接 url: string } + // 组件样式 + style: ComponentStyle } // 定义组件 @@ -48,18 +50,20 @@ export const component = { titleSize: 16, descriptionSize: 12, titleWeight: 400, - position: 'left', + textAlign: 'left', descriptionWeight: 200, titleColor: 'rgba(50, 50, 51, 10)', descriptionColor: 'rgba(150, 151, 153, 10)', - backgroundColor: 'rgba(255, 255, 255, 10)', - showBottomBorder: false, more: { //查看更多 show: false, type: 'icon', text: '查看更多', url: '' - } + }, + style: { + bgType: 'color', + bgColor: '#fff' + } as ComponentStyle } } as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/TitleBar/index.vue b/src/components/DiyEditor/components/mobile/TitleBar/index.vue index 047a6c06..5bf52f49 100644 --- a/src/components/DiyEditor/components/mobile/TitleBar/index.vue +++ b/src/components/DiyEditor/components/mobile/TitleBar/index.vue @@ -1,19 +1,14 @@