From 9120676301f10395e44042ea759ecb85f7cfb04c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Mon, 4 Aug 2025 15:21:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/base/drag/index.vue | 4 +- .../tabs-magic-config/tabs-magic-content.vue | 2 +- src/components/model-carousel/index.vue | 8 +- .../model-custom/model-custom-content.vue | 2 +- src/components/model-goods-magic/index.vue | 2 +- src/components/model-hot-zone/index.vue | 13 +- src/components/model-img-magic/index.vue | 16 +- .../model-img-magic-content.vue | 26 +++- .../model-img-magic-styles.vue | 2 +- src/components/model-nav-group/index.vue | 20 ++- .../model-nav-group-content.vue | 4 +- .../model-nav-group-styles.vue | 12 +- src/components/model-tabs-carousel/index.vue | 2 +- src/components/model-tabs-magic/index.vue | 141 ++++++++++++++---- .../model-tabs-magic-content.vue | 28 ++++ .../model-tabs-magic-styles.vue | 68 +++++---- src/components/model-video/index.vue | 13 +- src/config/const/tabs-magic.ts | 64 +++++++- 18 files changed, 314 insertions(+), 113 deletions(-) diff --git a/src/components/base/drag/index.vue b/src/components/base/drag/index.vue index b4ba87ff..a0b3e0a1 100644 --- a/src/components/base/drag/index.vue +++ b/src/components/base/drag/index.vue @@ -1,8 +1,8 @@ diff --git a/src/components/model-video/index.vue b/src/components/model-video/index.vue index b841e903..807cef41 100644 --- a/src/components/model-video/index.vue +++ b/src/components/model-video/index.vue @@ -34,6 +34,10 @@ const props = defineProps({ type: Object, default: () => ({}), }, + isCommonStyle: { + type: Boolean, + default: true, + } }); const video_src = ref(common_store.common.config.attachment_host + `/static/diy/images/components/model-video/video.png`); const style = ref(''); @@ -41,8 +45,7 @@ const style_container = ref(''); const style_img_container = ref(''); const video_img = ref(''); const video = ref(''); -watch( - props.value, +watch(() => props.value, (newVal, oldValue) => { const new_content = newVal?.content || {}; const new_style = newVal?.style || {}; @@ -60,8 +63,10 @@ watch( video_ratio = `height: 220px;`; } style.value = video_ratio; - style_container.value = common_styles_computer(new_style.common_style); - style_img_container.value = common_img_computer(new_style.common_style); + if (props.isCommonStyle) { + style_container.value = common_styles_computer(new_style.common_style); + style_img_container.value = common_img_computer(new_style.common_style); + } }, { immediate: true, deep: true } ); diff --git a/src/config/const/tabs-magic.ts b/src/config/const/tabs-magic.ts index d365b6b0..5e3fb5b7 100644 --- a/src/config/const/tabs-magic.ts +++ b/src/config/const/tabs-magic.ts @@ -94,6 +94,14 @@ interface defaultTabs { more_icon_color: string; more_icon_size: number; data_spacing: number; + magic_content_direction: string; + magic_content_color_list: color_list[]; + magic_content_background_img_style: string; + magic_content_background_img: string[]; + magic_content_radius: radiusStyle; + magic_content_margin: marginStyle; + magic_content_padding: paddingStyle; + magic_content: object; common_style: object; }; } @@ -157,7 +165,16 @@ export const magic_config = { goods_magic: cloneDeep(defaultGoodsMagic), img_magic: cloneDeep(defaultImgMagic), hot_zone: cloneDeep(defaultHotZone), - custom: cloneDeep(defaultCustom), + custom:{ + ...cloneDeep(defaultCustom), + style: { + ...cloneDeep(defaultCustom.style), + data_content_style: { + ...cloneDeep(defaultCustom.style.data_content_style), + color_list: [{ color: 'rgb(244, 252, 255)', color_percentage: undefined }], + } + } + }, } const defaultTabs: defaultTabs = { @@ -337,6 +354,51 @@ const defaultTabs: defaultTabs = { more_icon_size: 14, // 选项卡与轮播之间的间距 data_spacing: 0, + // 魔方内容设置 + magic_content_direction: '90deg', + magic_content_color_list: [{ color: '', color_percentage: undefined }], + magic_content_background_img_style: '2', + magic_content_background_img: [], + magic_content_radius: { + radius: 0, + radius_top_left: 0, + radius_top_right: 0, + radius_bottom_left: 0, + radius_bottom_right: 0, + }, + magic_content_margin: { + margin: 0, + margin_top: 0, + margin_bottom: 0, + margin_left: 0, + margin_right: 0, + }, + magic_content_padding: { + padding: 0, + padding_top: 0, + padding_bottom: 10, + padding_left: 10, + padding_right: 10, + }, + magic_content: { + // 边框样式 + border_is_show: '0', + border_color: '#FF3F3F', + border_style: 'solid', + border_size: { + padding: 1, + padding_top: 1, + padding_right: 1, + padding_bottom: 1, + padding_left: 1, + }, + // 阴影 + box_shadow_color: '', + box_shadow_x: 0, + box_shadow_y: 0, + box_shadow_blur: 0, + box_shadow_spread: 0, + }, // 公共样式 common_style: defaultCommon, },