优化页面显示逻辑

v1.4.0
于肖磊 2025-08-04 16:51:45 +08:00
parent 9120676301
commit a646b06e1f
3 changed files with 40 additions and 4 deletions

View File

@ -271,7 +271,7 @@ watch(() => new_style.value.common_style, () => {
}, {deep: true});
const swiper_bg_style = computed(() => {
if (props.isNest) {
if (!props.isCommonStyle) {
return '';
}
const style = form.value?.carousel_list?.[actived_index.value]?.style;
@ -292,7 +292,7 @@ const swiper_bg_style = computed(() => {
});
const swiper_bg_img_style = computed(() => {
if (props.isNest) {
if (!props.isCommonStyle) {
return '';
}
const { carousel_img, style = {} } = form.value?.carousel_list[actived_index.value] || {};
@ -321,7 +321,7 @@ const slideChange = (swiper: { realIndex: number }) => {
} else {
actived_index.value = swiper.realIndex;
}
if (props.isNest) {
if (!props.isCommonStyle) {
emit('slideChange', actived_index.value);
}
}

View File

@ -11,6 +11,8 @@
<el-radio value="customer_service">客服入口</el-radio>
<el-radio value="quick_nav">快捷导航</el-radio>
<el-radio value="lang">多语言</el-radio>
<el-radio value="share">分享</el-radio>
<el-radio value="gotop">回到顶部</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="上传图片">

View File

@ -270,6 +270,40 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
const new_array_5 = ['custom', 'goods-magic'];
//
const new_array_6 = ['nav-group'];
//
clone_form.tabs_data = clone_form.tabs_data.map((item: any) => {
if (['tabs-magic'].includes(item.key)) {
//
const all_type = ['hot_zone', 'custom', 'img_magic', 'goods_magic', 'goods_list', 'article_list', 'nav_group', 'video', 'carousel'];
//
const new_data_list = [item.com_data.content.home_data, ...item.com_data.content.tabs_list];
//
new_data_list.forEach((item1: any) => {
if (['goods-list', 'article-list'].includes(item1.magic_type)) {
//
goods_or_article_data_processing(item1[item1.magic_type], item1.magic_type == new_array_1[0], item1.magic_type);
} else if (new_array_5.includes(item1.magic_type)) {
//
custom_data_processing(item1[item1.magic_type].content);
}
item = Object.keys(item1)
.filter(key => !all_type.filter((item2: string) => item2 !== item1.magic_type).includes(key))
.reduce((acc: Record<string, any>, key: string) => {
acc[key] = item1[key];
return acc;
}, {});
console.log(item);
});
//
item.home_data = new_data_list.length > 0 ? new_data_list[0] : null;
item.tabs_list = new_data_list.slice(1, new_data_list.length);
}
return {
...item,
show_tabs: '0',
}
});
//
clone_form.diy_data = clone_form.diy_data.map((item: any) => {
if (new_array_1.includes(item.key)) {
//
@ -627,4 +661,4 @@ const get_id = () => {
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
}
</style>
</style>