From 325e2e4ff20b23d8b1a64902bb19bb24c4f0190f Mon Sep 17 00:00:00 2001 From: owen Date: Wed, 8 Nov 2023 21:10:05 +0800 Subject: [PATCH 1/5] =?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=E5=88=97=E8=A1=A8=E5=AF=BC=E8=88=AA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/MenuList/config.ts | 39 ++++++++++ .../components/mobile/MenuList/index.vue | 31 ++++++++ .../components/mobile/MenuList/property.vue | 74 +++++++++++++++++++ src/components/DiyEditor/util.ts | 5 +- src/components/InputWithColor/index.vue | 58 +++++++++++++++ 5 files changed, 205 insertions(+), 2 deletions(-) create mode 100644 src/components/DiyEditor/components/mobile/MenuList/config.ts create mode 100644 src/components/DiyEditor/components/mobile/MenuList/index.vue create mode 100644 src/components/DiyEditor/components/mobile/MenuList/property.vue create mode 100644 src/components/InputWithColor/index.vue diff --git a/src/components/DiyEditor/components/mobile/MenuList/config.ts b/src/components/DiyEditor/components/mobile/MenuList/config.ts new file mode 100644 index 00000000..f06adfae --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuList/config.ts @@ -0,0 +1,39 @@ +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' + +/** 列表导航属性 */ +export interface MenuListProperty { + // 导航菜单列表 + list: MenuListItemProperty[] + // 组件样式 + style: ComponentStyle +} +/** 列表导航项目属性 */ +export interface MenuListItemProperty { + // 图标链接 + iconUrl: string + // 标题 + title: string + // 标题颜色 + titleColor: string + // 副标题 + subtitle: string + // 副标题颜色 + subtitleColor: string + // 链接 + url: string +} + +// 定义组件 +export const component = { + id: 'MenuList', + name: '列表导航', + icon: 'fa-solid:list', + property: { + list: [], + style: { + bgType: 'color', + bgColor: '#fff', + marginBottom: 8 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/MenuList/index.vue b/src/components/DiyEditor/components/mobile/MenuList/index.vue new file mode 100644 index 00000000..9a56fd94 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuList/index.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/components/DiyEditor/components/mobile/MenuList/property.vue b/src/components/DiyEditor/components/mobile/MenuList/property.vue new file mode 100644 index 00000000..51652b6e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuList/property.vue @@ -0,0 +1,74 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 29b44cf6..96dd4dbb 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -103,8 +103,9 @@ export const PAGE_LIBS = [ components: [ 'SearchBar', 'NoticeBar', - 'GridNavigation', - 'ListNavigation', + 'MenuSwiper', + 'MenuGrid', + 'MenuList', 'Divider', 'TitleBar' ] diff --git a/src/components/InputWithColor/index.vue b/src/components/InputWithColor/index.vue new file mode 100644 index 00000000..1932fd58 --- /dev/null +++ b/src/components/InputWithColor/index.vue @@ -0,0 +1,58 @@ + + + + From ac42493659cd79b4ae7b451386b229dc293221fa Mon Sep 17 00:00:00 2001 From: owen Date: Wed, 8 Nov 2023 22:22:35 +0800 Subject: [PATCH 2/5] =?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=E5=AE=AB=E6=A0=BC=E5=AF=BC=E8=88=AA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/MenuGrid/config.ts | 78 +++++++++++++++ .../components/mobile/MenuGrid/index.vue | 35 +++++++ .../components/mobile/MenuGrid/property.vue | 96 +++++++++++++++++++ .../components/mobile/MenuList/config.ts | 10 +- .../components/mobile/MenuList/property.vue | 11 ++- 5 files changed, 224 insertions(+), 6 deletions(-) create mode 100644 src/components/DiyEditor/components/mobile/MenuGrid/config.ts create mode 100644 src/components/DiyEditor/components/mobile/MenuGrid/index.vue create mode 100644 src/components/DiyEditor/components/mobile/MenuGrid/property.vue diff --git a/src/components/DiyEditor/components/mobile/MenuGrid/config.ts b/src/components/DiyEditor/components/mobile/MenuGrid/config.ts new file mode 100644 index 00000000..ccf09b2e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuGrid/config.ts @@ -0,0 +1,78 @@ +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' +import { cloneDeep } from 'lodash-es' + +/** 宫格导航属性 */ +export interface MenuGridProperty { + // 列数 + column: number + // 导航菜单列表 + list: MenuGridItemProperty[] + // 组件样式 + style: ComponentStyle +} +/** 宫格导航项目属性 */ +export interface MenuGridItemProperty { + // 图标链接 + iconUrl: string + // 标题 + title: string + // 标题颜色 + titleColor: string + // 副标题 + subtitle: string + // 副标题颜色 + subtitleColor: string + // 链接 + url: string + // 角标 + badge: { + // 是否显示 + show: boolean + // 角标文字 + text: string + // 角标文字颜色 + textColor: string + // 角标背景颜色 + bgColor: string + } +} + +export const EMPTY_MENU_GRID_ITEM_PROPERTY = { + title: '标题', + titleColor: '#333', + subtitle: '副标题', + subtitleColor: '#bbb', + badge: { + show: false, + textColor: '#fff', + bgColor: '#FF6000' + } +} as MenuGridItemProperty + +// 定义组件 +export const component = { + id: 'MenuGrid', + name: '宫格导航', + icon: 'fa-solid:list', + property: { + column: 3, + list: [cloneDeep(EMPTY_MENU_GRID_ITEM_PROPERTY)], + style: { + bgType: 'color', + bgColor: '#fff', + marginBottom: 8, + marginLeft: 8, + marginRight: 8, + padding: 8, + paddingTop: 8, + paddingRight: 8, + paddingBottom: 8, + paddingLeft: 8, + borderRadius: 8, + borderTopLeftRadius: 8, + borderTopRightRadius: 8, + borderBottomRightRadius: 8, + borderBottomLeftRadius: 8 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/MenuGrid/index.vue b/src/components/DiyEditor/components/mobile/MenuGrid/index.vue new file mode 100644 index 00000000..1c5ef1dc --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuGrid/index.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/components/DiyEditor/components/mobile/MenuGrid/property.vue b/src/components/DiyEditor/components/mobile/MenuGrid/property.vue new file mode 100644 index 00000000..e09dd318 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuGrid/property.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/components/DiyEditor/components/mobile/MenuList/config.ts b/src/components/DiyEditor/components/mobile/MenuList/config.ts index f06adfae..c42674f3 100644 --- a/src/components/DiyEditor/components/mobile/MenuList/config.ts +++ b/src/components/DiyEditor/components/mobile/MenuList/config.ts @@ -1,4 +1,5 @@ import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' +import { cloneDeep } from 'lodash-es' /** 列表导航属性 */ export interface MenuListProperty { @@ -23,13 +24,20 @@ export interface MenuListItemProperty { url: string } +export const EMPTY_MENU_LIST_ITEM_PROPERTY = { + title: '标题', + titleColor: '#333', + subtitle: '副标题', + subtitleColor: '#bbb' +} + // 定义组件 export const component = { id: 'MenuList', name: '列表导航', icon: 'fa-solid:list', property: { - list: [], + list: [cloneDeep(EMPTY_MENU_LIST_ITEM_PROPERTY)], style: { bgType: 'color', bgColor: '#fff', diff --git a/src/components/DiyEditor/components/mobile/MenuList/property.vue b/src/components/DiyEditor/components/mobile/MenuList/property.vue index 51652b6e..270ca261 100644 --- a/src/components/DiyEditor/components/mobile/MenuList/property.vue +++ b/src/components/DiyEditor/components/mobile/MenuList/property.vue @@ -49,7 +49,11 @@ + + diff --git a/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue b/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue new file mode 100644 index 00000000..2175d57e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 96dd4dbb..5ae0a93f 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -100,17 +100,13 @@ export const PAGE_LIBS = [ { name: '基础组件', extended: true, - components: [ - 'SearchBar', - 'NoticeBar', - 'MenuSwiper', - 'MenuGrid', - 'MenuList', - 'Divider', - 'TitleBar' - ] + components: ['SearchBar', 'NoticeBar', 'MenuSwiper', 'MenuGrid', 'MenuList'] + }, + { + name: '图文组件', + extended: true, + components: ['ImageBar', 'Carousel', 'TitleBar', 'VideoPlayer', 'Divider'] }, - { name: '图文组件', extended: true, components: ['ImageBar', 'Carousel', 'VideoPlayer'] }, { name: '商品组件', extended: true, components: ['ProductCard'] }, { name: '会员组件', diff --git a/src/components/InputWithColor/index.vue b/src/components/InputWithColor/index.vue index 1932fd58..2bc53172 100644 --- a/src/components/InputWithColor/index.vue +++ b/src/components/InputWithColor/index.vue @@ -1,13 +1,14 @@