From c5b1ad480fe69c0081cc60be4d3e094663cf7620 Mon Sep 17 00:00:00 2001 From: owen Date: Thu, 14 Mar 2024 00:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E9=A1=B6=E9=83=A8=E5=AF=BC?= =?UTF-8?q?=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/imgs/diy/app-nav-bar-mp.png | Bin 0 -> 3595 bytes .../NavigationBar/components/CellProperty.vue | 90 ++++++++++++++++++ .../components/mobile/NavigationBar/config.ts | 84 ++++++++++++---- .../components/mobile/NavigationBar/index.vue | 80 +++++++++++----- .../mobile/NavigationBar/property.vue | 85 +++++++++++------ src/components/MagicCubeEditor/index.vue | 2 +- 6 files changed, 263 insertions(+), 78 deletions(-) create mode 100644 src/assets/imgs/diy/app-nav-bar-mp.png create mode 100644 src/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue diff --git a/src/assets/imgs/diy/app-nav-bar-mp.png b/src/assets/imgs/diy/app-nav-bar-mp.png new file mode 100644 index 0000000000000000000000000000000000000000..c982804c7287c904468dad6252fd393c6cbd271f GIT binary patch literal 3595 zcmV+m4)pPfP)Px?#Ysd#RCr$PUENaD*c#2=X%(*MKd`K_5R^`HH3#$oM(_a~=l+}#?~jTPFp3W_ z$P0|<12{VOBlrMEdoD?Hq~XTWCY|O=JCN+tE49N(r;|?7ouomMD#|K*XYcGUD__?4 z8zRJXsH&RPb^Rt|Y>rZTg%C0)2tt-IHWky7>9j+T03oC%2m=0^x~~5%2*PG2ld0r# zxn>-fL!z7%AQc4R0b>k6y&2`)>0GBv0)&vwwvu`+2*R6OE(btIazp~ydcA&A6vf95 zkTw}(6+sa2)Kv__sOY-hymaYOWEUTa1kyG|GK4W{P}R|3EaY#BnxV?hus`(>R{y3!9-2n|?O zRUa6J@dO4Gh;|Cp;R50`tzNI!pHNDnaRFRtTY&aOm^}mrEH|hg8;0=^3xH4)LY7j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`UrJ#-NmYv;+!+s6XkAPdfW07H=g7)m$H9vmE?9X%>s(C!m;Xlt2FW+ez%dm3F{o8VtbghSe- z2<@cr7ujrfCDpb`-S*SB4hJfXc=%YYgc?=X^%bNHhS^al4QovdilFN{@@LVr33C9r z0PVZ6u`zu9F{KJ&?!tFE)&r;r^KOcwc+Zcox{0MPz*-aWdN5SQ+QWbAjIlp6nat+c z*qF&lQUHIah;(cV0L6bD92{g14-e-=QA9UNd_oBU3KOX9F-WX(EyD>SrGWrzm zA-~!R;>>wb*k~BW-|dDP@9+^bUDs +
+ + +
+ + + + + + diff --git a/src/components/DiyEditor/components/mobile/NavigationBar/config.ts b/src/components/DiyEditor/components/mobile/NavigationBar/config.ts index f722d525..36612a3f 100644 --- a/src/components/DiyEditor/components/mobile/NavigationBar/config.ts +++ b/src/components/DiyEditor/components/mobile/NavigationBar/config.ts @@ -2,22 +2,53 @@ import { DiyComponent } from '@/components/DiyEditor/util' /** 顶部导航栏属性 */ export interface NavigationBarProperty { - // 页面标题 - title: string - // 页面描述 - description: string - // 顶部导航高度 - navBarHeight: number - // 页面背景颜色 - backgroundColor: string - // 页面背景图片 - backgroundImage: string + // 背景类型 + bgType: 'color' | 'img' + // 背景颜色 + bgColor: string + // 图片链接 + bgImg: string // 样式类型:默认 | 沉浸式 - styleType: 'default' | 'immersion' + styleType: 'normal' | 'inner' // 常驻显示 alwaysShow: boolean - // 是否显示返回按钮 - showGoBack: boolean + // 小程序单元格列表 + mpCells: NavigationBarCellProperty[] + // 其它平台单元格列表 + otherCells: NavigationBarCellProperty[] + // 本地变量 + _local: { + // 预览顶部导航(小程序) + previewMp: boolean + // 预览顶部导航(非小程序) + previewOther: boolean + } +} + +/** 顶部导航栏 - 单元格 属性 */ +export interface NavigationBarCellProperty { + // 类型:文字 | 图片 | 搜索框 + type: 'text' | 'image' | 'search' + // 宽度 + width: number + // 高度 + height: number + // 顶部位置 + top: number + // 左侧位置 + left: number + // 文字内容 + text: string + // 文字颜色 + textColor: string + // 图片地址 + imgUrl: string + // 图片链接 + url: string + // 搜索框:提示文字 + placeholder: string + // 搜索框:边框圆角半径 + borderRadius: number } // 定义组件 @@ -26,13 +57,26 @@ export const component = { name: '顶部导航栏', icon: 'tabler:layout-navbar', property: { - title: '页面标题', - description: '', - navBarHeight: 35, - backgroundColor: '#fff', - backgroundImage: '', - styleType: 'default', + bgType: 'color', + bgColor: '#fff', + bgImg: '', + styleType: 'normal', alwaysShow: true, - showGoBack: true + mpCells: [ + { + type: 'text', + textColor: '#111111' + } + ], + otherCells: [ + { + type: 'text', + textColor: '#111111' + } + ], + _local: { + previewMp: true, + previewOther: false + } } } as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/NavigationBar/index.vue b/src/components/DiyEditor/components/mobile/NavigationBar/index.vue index f5cfff8c..c684aee7 100644 --- a/src/components/DiyEditor/components/mobile/NavigationBar/index.vue +++ b/src/components/DiyEditor/components/mobile/NavigationBar/index.vue @@ -1,45 +1,73 @@ diff --git a/src/components/MagicCubeEditor/index.vue b/src/components/MagicCubeEditor/index.vue index 26ea179d..9b9a43cc 100644 --- a/src/components/MagicCubeEditor/index.vue +++ b/src/components/MagicCubeEditor/index.vue @@ -189,7 +189,7 @@ const emit = defineEmits(['update:modelValue', 'hotAreaSelected']) const emitUpdateModelValue = () => emit('update:modelValue', hotAreas) // 热区选中 -const selectedHotAreaIndex = ref(-1) +const selectedHotAreaIndex = ref(0) const handleHotAreaSelected = (hotArea: Rect, index: number) => { selectedHotAreaIndex.value = index emit('hotAreaSelected', hotArea, index)