From c24757e5e88f1a8232f4d1abe3a335c8d3e01cca Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 26 Jun 2026 22:20:50 -0700 Subject: [PATCH] =?UTF-8?q?feat(mall):=20=E6=94=AF=E6=8C=81=E8=A3=85?= =?UTF-8?q?=E4=BF=AE=E9=A1=B6=E9=83=A8=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 同步 web-antd、web-antdv-next、web-ele 顶部导航栏配置 - 新增 showType 并兼容历史 alwaysShow - 更新属性面板为显示方式枚举 --- .../mobile/navigation-bar/config.ts | 25 +++++++++++- .../mobile/navigation-bar/property.vue | 34 ++++++++++++----- .../promotion/components/diy-editor/index.vue | 27 +++++++++++-- .../mobile/navigation-bar/config.ts | 25 +++++++++++- .../mobile/navigation-bar/property.vue | 34 ++++++++++++----- .../promotion/components/diy-editor/index.vue | 38 +++++++++++++++++-- .../mobile/navigation-bar/config.ts | 25 +++++++++++- .../mobile/navigation-bar/property.vue | 34 ++++++++++++----- .../promotion/components/diy-editor/index.vue | 27 +++++++++++-- 9 files changed, 229 insertions(+), 40 deletions(-) diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/config.ts index b549512ee..ef1deb016 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/config.ts @@ -1,13 +1,35 @@ import type { Rect } from '../../../../magic-cube-editor/util'; import type { DiyComponent } from '../../../util'; +export const NAVIGATION_BAR_SHOW_TYPES = ['always', 'scroll'] as const; +export type NavigationBarShowType = (typeof NAVIGATION_BAR_SHOW_TYPES)[number]; +export const isNavigationBarShowType = ( + showType: unknown, +): showType is NavigationBarShowType => + NAVIGATION_BAR_SHOW_TYPES.includes(showType as NavigationBarShowType); +const NAVIGATION_BAR_SCROLL_SHOW_VALUES = new Set([ + 0, + '0', + false, + 'false', +]); +export const isNavigationBarAlwaysShow = ( + property: Pick, +) => { + if (isNavigationBarShowType(property.showType)) { + return property.showType === 'always'; + } + return !NAVIGATION_BAR_SCROLL_SHOW_VALUES.has(property.alwaysShow); +}; + /** 顶部导航栏属性 */ export interface NavigationBarProperty { bgType: 'color' | 'img'; // 背景类型 bgColor: string; // 背景颜色 bgImg: string; // 图片链接 styleType: 'inner' | 'normal'; // 样式类型:默认 | 沉浸式 - alwaysShow: boolean; // 常驻显示 + showType: NavigationBarShowType; // 显示方式:常驻显示 | 滚动显示 + alwaysShow?: boolean | number | string; // 兼容旧版移动端:是否常驻显示 mpCells: NavigationBarCellProperty[]; // 小程序单元格列表 otherCells: NavigationBarCellProperty[]; // 其它平台单元格列表 _local: { @@ -40,6 +62,7 @@ export const component = { bgColor: '#fff', bgImg: '', styleType: 'normal', + showType: 'always', alwaysShow: true, mpCells: [ { diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/property.vue index 3603c46a0..0d7fc9c0a 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/property.vue @@ -1,6 +1,8 @@