From 2e505269220c1e9b3085f83b2e52e3e655e18fe1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 1 Nov 2025 12:09:10 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90mall=E3=80=91diy=20editor?= =?UTF-8?q?=20=E7=9A=84=20promotion-article=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/promotion-article/config.ts | 8 +++---- .../mobile/promotion-article/index.vue | 10 ++++----- .../mobile/promotion-article/property.vue | 21 +++++++++---------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/config.ts b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/config.ts index 9a1fc4194..ac47bf4b5 100644 --- a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/config.ts +++ b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/config.ts @@ -2,13 +2,11 @@ import type { ComponentStyle, DiyComponent } from '../../../util'; /** 营销文章属性 */ export interface PromotionArticleProperty { - // 文章编号 - id: number; - // 组件样式 - style: ComponentStyle; + id: number; // 文章编号 + style: ComponentStyle; // 组件样式 } -// 定义组件 +/** 定义组件 */ export const component = { id: 'PromotionArticle', name: '营销文章', diff --git a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/index.vue b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/index.vue index 10e9f5aa3..09f1ff673 100644 --- a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/index.vue +++ b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/index.vue @@ -9,10 +9,10 @@ import * as ArticleApi from '#/api/mall/promotion/article/index'; /** 营销文章 */ defineOptions({ name: 'PromotionArticle' }); -// 定义属性 -const props = defineProps<{ property: PromotionArticleProperty }>(); -// 商品列表 -const article = ref(); + +const props = defineProps<{ property: PromotionArticleProperty }>(); // 定义属性 + +const article = ref(); // 商品列表 watch( () => props.property.id, @@ -29,5 +29,3 @@ watch( - - diff --git a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/property.vue b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/property.vue index 7a701c54f..d70503b17 100644 --- a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/property.vue +++ b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-article/property.vue @@ -12,18 +12,19 @@ import * as ArticleApi from '#/api/mall/promotion/article/index'; import ComponentContainerProperty from '../../component-container-property.vue'; -// 营销文章属性面板 +/** 营销文章属性面板 */ defineOptions({ name: 'PromotionArticleProperty' }); const props = defineProps<{ modelValue: PromotionArticleProperty }>(); -const emit = defineEmits(['update:modelValue']); -const formData = useVModel(props, 'modelValue', emit); -// 文章列表 -const articles = ref([]); -// 加载中 -const loading = ref(false); -// 查询文章列表 +const emit = defineEmits(['update:modelValue']); + +const formData = useVModel(props, 'modelValue', emit); + +const articles = ref([]); // 文章列表 +const loading = ref(false); // 加载中 + +/** 查询文章列表 */ const queryArticleList = async (title?: string) => { loading.value = true; const { list } = await ArticleApi.getArticlePage({ @@ -35,7 +36,7 @@ const queryArticleList = async (title?: string) => { loading.value = false; }; -// 初始化 +/** 初始化 */ onMounted(() => { queryArticleList(); }); @@ -65,5 +66,3 @@ onMounted(() => { - -