From 56ae9c02303aa0b9ab4a13d02d8bd2da8d15fbe1 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Wed, 5 Nov 2025 18:31:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=20diy=20editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app-link-input/app-link-select-dialog.vue | 33 ++-- .../components/app-link-input/index.vue | 16 +- .../component-container-property.vue | 6 +- .../components/component-container.vue | 8 +- .../components/component-library.vue | 6 +- .../components/mobile/Carousel/property.vue | 11 +- .../components/mobile/Divider/index.vue | 2 - .../components/mobile/Divider/property.vue | 15 +- .../components/mobile/Popover/index.vue | 2 +- .../components/mobile/coupon-card/index.vue | 2 +- .../mobile/coupon-card/property.vue | 13 +- .../mobile/floating-action-button/index.vue | 6 +- .../floating-action-button/property.vue | 19 +-- .../components/hot-zone-edit-dialog/index.vue | 15 +- .../components/mobile/hot-zone/index.vue | 22 +-- .../components/mobile/hot-zone/property.vue | 15 +- .../components/mobile/image-bar/config.ts | 2 +- .../components/mobile/image-bar/index.vue | 4 +- .../components/mobile/image-bar/property.vue | 8 +- .../components/mobile/magic-cube/index.vue | 4 +- .../components/mobile/magic-cube/property.vue | 9 +- .../components/mobile/menu-grid/property.vue | 14 +- .../components/mobile/menu-list/index.vue | 12 +- .../components/mobile/menu-list/property.vue | 14 +- .../components/cell-property.vue | 17 +- .../mobile/navigation-bar/index.vue | 2 +- .../mobile/navigation-bar/property.vue | 2 - .../components/mobile/notice-bar/config.ts | 2 +- .../components/mobile/notice-bar/index.vue | 2 +- .../components/mobile/page-config/config.ts | 2 +- .../components/mobile/product-card/config.ts | 2 +- .../components/mobile/product-card/index.vue | 34 ++-- .../components/mobile/search-bar/config.ts | 2 +- .../components/mobile/search-bar/index.vue | 13 +- .../components/mobile/tab-bar/index.vue | 2 +- .../components/mobile/title-bar/index.vue | 5 +- .../components/mobile/user-card/index.vue | 24 ++- .../components/mobile/user-coupon/config.ts | 2 +- .../components/mobile/user-order/config.ts | 2 +- .../components/mobile/user-wallet/config.ts | 2 +- .../components/mobile/video-player/config.ts | 2 +- .../promotion/components/diy-editor/index.vue | 10 +- .../promotion/components/draggable/index.vue | 9 +- .../components/magic-cube-editor/index.vue | 145 ++++++------------ .../promotion/diy/template/decorate/index.vue | 6 +- 45 files changed, 213 insertions(+), 332 deletions(-) diff --git a/apps/web-antd/src/views/mall/promotion/components/app-link-input/app-link-select-dialog.vue b/apps/web-antd/src/views/mall/promotion/components/app-link-input/app-link-select-dialog.vue index 4851fca8e..949087212 100644 --- a/apps/web-antd/src/views/mall/promotion/components/app-link-input/app-link-select-dialog.vue +++ b/apps/web-antd/src/views/mall/promotion/components/app-link-input/app-link-select-dialog.vue @@ -161,25 +161,22 @@ function handleProductCategorySelected(id: number) { @ok="handleSubmit" >
-
- -
+
+ -
+ {{ group.name }} +
- - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-container-property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-container-property.vue index bebc5a712..12b502539 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-container-property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-container-property.vue @@ -3,7 +3,6 @@ import type { ComponentStyle } from '../util'; import { useVModel } from '@vueuse/core'; import { - Card, Col, Form, FormItem, @@ -135,7 +134,8 @@ function handleSliderChange(prop: string) { - +

组件样式:

+
@@ -196,7 +196,7 @@ function handleSliderChange(prop: string) { - +
diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-container.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-container.vue index 5c4d30ece..40a1bc963 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-container.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-container.vue @@ -117,7 +117,7 @@ const handleDeleteComponent = () => { arrow: true, }" > - +
diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-library.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-library.vue index ed796c4f6..add6ecc4a 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-library.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-library.vue @@ -61,13 +61,11 @@ function handleCloneComponent(component: DiyComponent) { diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/index.vue index 1736db389..e07eda87e 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/index.vue @@ -25,5 +25,3 @@ defineProps<{ property: DividerProperty }>(); >
- - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/property.vue index 81515bec3..68243de31 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/property.vue @@ -61,7 +61,10 @@ const formData = useVModel(props, 'modelValue', emit); :title="item.text" > - + @@ -74,12 +77,18 @@ const formData = useVModel(props, 'modelValue', emit); - + - + diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/index.vue index b193e8366..709b62a6c 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/index.vue @@ -33,7 +33,7 @@ const handleActive = (index: number) => { diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/index.vue index 7be978088..fe8914ba1 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/index.vue @@ -62,7 +62,7 @@ onMounted(() => { }); - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/magic-cube/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/magic-cube/property.vue index a0d4c8bfd..2fc781939 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/magic-cube/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/magic-cube/property.vue @@ -4,7 +4,7 @@ import type { MagicCubeProperty } from './config'; import { ref } from 'vue'; import { useVModel } from '@vueuse/core'; -import { Form, FormItem, Slider, Typography } from 'ant-design-vue'; +import { Form, FormItem, Slider } from 'ant-design-vue'; import UploadImg from '#/components/upload/image-upload.vue'; import { @@ -21,8 +21,6 @@ const props = defineProps<{ modelValue: MagicCubeProperty }>(); const emit = defineEmits(['update:modelValue']); -const { Text: ATypographyText } = Typography; - const formData = useVModel(props, 'modelValue', emit); const selectedHotAreaIndex = ref(-1); // 选中的热区 @@ -36,10 +34,7 @@ const handleHotAreaSelected = (_: any, index: number) => { - + diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-list/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-list/index.vue index 1d5e22b0d..e7f67ee25 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-list/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-list/index.vue @@ -11,11 +11,11 @@ defineProps<{ property: MenuListProperty }>(); - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-list/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-list/property.vue index 4ff74decb..33bc46ac7 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-list/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-list/property.vue @@ -2,7 +2,7 @@ import type { MenuListProperty } from './config'; import { useVModel } from '@vueuse/core'; -import { Form, Typography } from 'ant-design-vue'; +import { Form, FormItem } from 'ant-design-vue'; import UploadImg from '#/components/upload/image-upload.vue'; import { @@ -21,17 +21,12 @@ const props = defineProps<{ modelValue: MenuListProperty }>(); const emit = defineEmits(['update:modelValue']); -const { Text: ATypographyText } = Typography; - const formData = useVModel(props, 'modelValue', emit); - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/index.vue index 9e3b17a07..15a40c9b6 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/navigation-bar/index.vue @@ -78,7 +78,7 @@ const getSearchProp = computed(() => (cell: NavigationBarCellProperty) => { v-if="property._local?.previewMp" :src="appNavbarMp" alt="" - style="width: 86px; height: 30px" + class="w-22 h-8" /> 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 9bca36269..860ba178b 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 @@ -130,5 +130,3 @@ if (!formData.value._local) { - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/config.ts index d9b68333e..b8fc2e910 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/config.ts @@ -19,7 +19,7 @@ export interface NoticeContentProperty { export const component = { id: 'NoticeBar', name: '公告栏', - icon: 'ep:bell', + icon: 'lucide:bell', property: { iconUrl: 'http://mall.yudao.iocoder.cn/static/images/xinjian.png', contents: [ diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/index.vue index d225751ed..a8fd24c02 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/index.vue @@ -33,7 +33,7 @@ setInterval(() => {
{{ property.contents?.[activeIndex]?.text }}
- + diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/page-config/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/page-config/config.ts index a00e6458b..79661b0f3 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/page-config/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/page-config/config.ts @@ -11,7 +11,7 @@ export interface PageConfigProperty { export const component = { id: 'PageConfig', name: '页面设置', - icon: 'ep:document', + icon: 'lucide:file-text', property: { description: '', backgroundColor: '#f5f5f5', diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/config.ts index a9e84977b..82009b6b7 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/config.ts @@ -39,7 +39,7 @@ export interface ProductCardFieldProperty { export const component = { id: 'ProductCard', name: '商品卡片', - icon: 'fluent:text-column-two-left-24-filled', + icon: 'lucide:grid-3x3', property: { layoutType: 'oneColBigImg', fields: { diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/index.vue index bf08a5a0f..950e8776f 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/index.vue @@ -61,7 +61,7 @@ function calculateWidth() { ref="containerRef" >
- +
{{ spu.introduction }} @@ -133,7 +129,7 @@ function calculateWidth() { ¥{{ fenToYuan(spu.price as any) }} @@ -141,12 +137,12 @@ function calculateWidth() { ¥{{ fenToYuan(spu.marketPrice) }}
-
+
-
+
@@ -186,5 +182,3 @@ function calculateWidth() {
- - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/config.ts index c471780e1..a3c39aab7 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/config.ts @@ -20,7 +20,7 @@ export type PlaceholderPosition = 'center' | 'left'; export const component = { id: 'SearchBar', name: '搜索框', - icon: 'ep:search', + icon: 'lucide:search', property: { height: 28, showScan: false, diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue index e7c770304..2a3ec9bce 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue @@ -30,19 +30,16 @@ defineProps<{ property: SearchProperty }>(); justifyContent: property.placeholderPosition, }" > - + {{ property.placeholder || '搜索商品' }}
- {{ - keyword - }} + + {{ keyword }} + - +
diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue index 827c7358d..90747a4ed 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue @@ -31,7 +31,7 @@ defineProps<{ property: TabBarProperty }>(); diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/title-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/title-bar/index.vue index 5bd0eb977..e7daeb927 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/title-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/title-bar/index.vue @@ -60,7 +60,10 @@ defineProps<{ property: TitleBarProperty }>(); {{ property.more.text }} - + diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-card/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-card/index.vue index 07e0e7304..55c02b7e1 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-card/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-card/index.vue @@ -3,6 +3,8 @@ import type { UserCardProperty } from './config'; import { IconifyIcon } from '@vben/icons'; +import { Avatar } from 'ant-design-vue'; + /** 用户卡片 */ defineOptions({ name: 'UserCard' }); // 定义属性 @@ -10,24 +12,20 @@ defineProps<{ property: UserCardProperty }>(); - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-coupon/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-coupon/config.ts index 7e5dcd1f9..c81926481 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-coupon/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-coupon/config.ts @@ -10,7 +10,7 @@ export interface UserCouponProperty { export const component = { id: 'UserCoupon', name: '用户卡券', - icon: 'ep:ticket', + icon: 'lucide:ticket', property: { style: { bgType: 'color', diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-order/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-order/config.ts index e149b22f1..fcc4a6b53 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-order/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-order/config.ts @@ -9,7 +9,7 @@ export interface UserOrderProperty { export const component = { id: 'UserOrder', name: '用户订单', - icon: 'ep:list', + icon: 'lucide:clipboard-list', property: { style: { bgType: 'color', diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-wallet/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-wallet/config.ts index 71d8d0245..ab48845d7 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-wallet/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-wallet/config.ts @@ -9,7 +9,7 @@ export interface UserWalletProperty { export const component = { id: 'UserWallet', name: '用户资产', - icon: 'ep:wallet-filled', + icon: 'lucide:wallet', property: { style: { bgType: 'color', diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/video-player/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/video-player/config.ts index ab7ccd311..db001525a 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/video-player/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/video-player/config.ts @@ -17,7 +17,7 @@ export interface VideoPlayerStyle extends ComponentStyle { export const component = { id: 'VideoPlayer', name: '视频播放', - icon: 'ep:video-play', + icon: 'lucide:video', property: { videoUrl: '', posterUrl: '', diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/index.vue index 128aa49e8..9c4c085b6 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/index.vue @@ -307,17 +307,17 @@ onMounted(() => { > @@ -473,7 +473,9 @@ onMounted(() => { {{ selectedComponent?.name }} -
+
@@ -93,7 +92,7 @@ const handleDelete = function (index: number) { @click="handleAdd" > 添加 diff --git a/apps/web-antd/src/views/mall/promotion/components/magic-cube-editor/index.vue b/apps/web-antd/src/views/mall/promotion/components/magic-cube-editor/index.vue index 26a6f3f42..7372ec5b4 100644 --- a/apps/web-antd/src/views/mall/promotion/components/magic-cube-editor/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/magic-cube-editor/index.vue @@ -198,103 +198,54 @@ function eachCube(callback: (x: number, y: number, cube: Cube) => void) { } - diff --git a/apps/web-antd/src/views/mall/promotion/diy/template/decorate/index.vue b/apps/web-antd/src/views/mall/promotion/diy/template/decorate/index.vue index 8cabab609..564eb93af 100644 --- a/apps/web-antd/src/views/mall/promotion/diy/template/decorate/index.vue +++ b/apps/web-antd/src/views/mall/promotion/diy/template/decorate/index.vue @@ -30,9 +30,9 @@ const DIY_PAGE_INDEX_KEY = 'diy_page_index'; // 特殊:存储 reset 重置时 const selectedTemplateItem = ref(0); const templateItems = reactive([ - { name: '基础设置', icon: 'ep:iphone' }, - { name: '首页', icon: 'ep:home-filled' }, - { name: '我的', icon: 'ep:user-filled' }, + { name: '基础设置', icon: 'lucide:settings' }, + { name: '首页', icon: 'lucide:home' }, + { name: '我的', icon: 'lucide:user' }, ]); // 左上角工具栏操作按钮 const formData = ref();