From df1db8d71bf74190911ceb9ed5f9a74944adb141 Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Sat, 14 Sep 2024 18:34:35 +0800
Subject: [PATCH 1/5] =?UTF-8?q?1.=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../layout/components/main/default/article-tabs.ts | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/views/layout/components/main/default/article-tabs.ts b/src/views/layout/components/main/default/article-tabs.ts
index ae2ab15f..6e0b4666 100644
--- a/src/views/layout/components/main/default/article-tabs.ts
+++ b/src/views/layout/components/main/default/article-tabs.ts
@@ -15,6 +15,7 @@ interface articleTabsList {
order_by_type: string;
order_by_rule: string;
is_cover: string;
+ data_ids: string;
data_list: ArticleList[];
data_auto_list: ArticleList[];
}
@@ -64,12 +65,12 @@ const defaultArticleTabs: DefaultArticleTabs = {
article_theme: '0',
article_carousel_col: '2',
tabs_list: [
- { id: '1', title: '热门推荐', desc: '简介', data_type: '0', category_ids: [], number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
- { id: '2', title: '测试一', desc: '简介', data_type: '0', category_ids: [], number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
- { id: '3', title: '测试二', desc: '简介', data_type: '0', category_ids: [], number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
- { id: '4', title: '测试三', desc: '简介', data_type: '0', category_ids: [], number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
- { id: '5', title: '测试四', desc: '简介', data_type: '0', category_ids: [], number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
- { id: '6', title: '测试五', desc: '简介', data_type: '0', category_ids: [], number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
+ { id: '1', title: '热门推荐', desc: '简介', data_type: '0', category_ids: [], data_ids: '', number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
+ { id: '2', title: '测试一', desc: '简介', data_type: '0', category_ids: [], data_ids: '', number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
+ { id: '3', title: '测试二', desc: '简介', data_type: '0', category_ids: [], data_ids: '', number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
+ { id: '4', title: '测试三', desc: '简介', data_type: '0', category_ids: [], data_ids: '', number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
+ { id: '5', title: '测试四', desc: '简介', data_type: '0', category_ids: [], data_ids: '', number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
+ { id: '6', title: '测试五', desc: '简介', data_type: '0', category_ids: [], data_ids: '', number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
],
field_show: ['0', '1'],
},
From d906f4fd0c12136062c75babe94b5a009bdfa9c5 Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Sat, 14 Sep 2024 18:59:08 +0800
Subject: [PATCH 2/5] =?UTF-8?q?1.=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/layout/index.vue | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue
index 7e25d0fb..cd6212cd 100644
--- a/src/views/layout/index.vue
+++ b/src/views/layout/index.vue
@@ -187,16 +187,23 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
const clone_form = cloneDeep(data);
clone_form.header.show_tabs = '1';
clone_form.footer.show_tabs = '0';
- const new_array = ['goods-list', 'goods-tabs', 'article-list', 'article-tabs', 'coupon'];
+ const new_array_1 = ['goods-list', 'article-list', 'coupon'];
+ const new_array_2 = ['goods-tabs', 'article-tabs'];
clone_form.diy_data = clone_form.diy_data.map((item: any) => {
- if (new_array.includes(item.key)) {
+ if (new_array_1.includes(item.key)) {
item.com_data.content.data_ids = item.com_data.content.data_list.map((item: any) => item.data.id).join(',') || '';
- // item.com_data.content.data_list = [];
- // item.com_data.content.data_auto_list = [];
+ item.com_data.content.data_list = [];
+ item.com_data.content.data_auto_list = [];
+ } else if (new_array_2.includes(item.key)) {
+ item.com_data.content.tabs_list.map((item: any) => {
+ item.data_ids = item.data_list.map((item1: any) => item1.data.id).join(',') || '';
+ item.data_list = [];
+ item.data_auto_list = [];
+ });
} else if (item.key == 'data-magic') {
item.com_data.content.data_magic_list.map((item1: any) => {
item1.goods_ids = item.goods_list.map((item2: any) => item2.data.id).join(',') || '';
- // item1.goods_list = [];
+ item1.goods_list = [];
});
}
return {
From b2273c3cf11905bf0622295204589d6774a40134 Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Sat, 14 Sep 2024 19:16:34 +0800
Subject: [PATCH 3/5] =?UTF-8?q?1.=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/layout/index.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue
index cd6212cd..080e4822 100644
--- a/src/views/layout/index.vue
+++ b/src/views/layout/index.vue
@@ -202,8 +202,8 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
});
} else if (item.key == 'data-magic') {
item.com_data.content.data_magic_list.map((item1: any) => {
- item1.goods_ids = item.goods_list.map((item2: any) => item2.data.id).join(',') || '';
- item1.goods_list = [];
+ item1.data_content.goods_ids = item1.data_content.goods_list.map((item2: any) => item2.data.id).join(',') || '';
+ item1.data_content.goods_list = [];
});
}
return {
From ca409f551a1129cc542246c062118b44fa577ca5 Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Wed, 18 Sep 2024 11:03:06 +0800
Subject: [PATCH 4/5] =?UTF-8?q?1.=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/model-article-list/index.vue | 44 +++++++++++----------
src/components/model-article-tabs/index.vue | 1 +
src/views/layout/index.vue | 35 +++++++++++++---
3 files changed, 55 insertions(+), 25 deletions(-)
diff --git a/src/components/model-article-list/index.vue b/src/components/model-article-list/index.vue
index 3352c8ab..34c8e81b 100644
--- a/src/components/model-article-list/index.vue
+++ b/src/components/model-article-list/index.vue
@@ -2,28 +2,26 @@
-
-
-
-
-
-
-
+
+
+
+
-
-
{{ !isEmpty(item.new_title) ? item.new_title : item.data.title }}
-
-
{{ field_show.includes('0') ? (!is_obj_empty(item.data) ? item.data.add_time : '2020-06-05 15:20') : '' }}
-
-
-
- {{ item.data.access_count ? item.data.access_count : '16' }}
-
+
+
+
+
{{ !isEmpty(item.new_title) ? item.new_title : item.data.title }}
+
+
{{ field_show.includes('0') ? (!is_obj_empty(item.data) ? item.data.add_time : '2020-06-05 15:20') : '' }}
+
+
+
+ {{ item.data.access_count ? item.data.access_count : '16' }}
-
+
@@ -156,10 +154,16 @@ const get_auto_data_list = async () => {
const new_content = computed(() => props.value?.content || {});
const new_style = computed(() => props.value?.style || {});
onMounted(() => {
- if (!isEmpty(new_content.value.data_list) && new_content.value.data_type == '0') {
+ if (new_content.value.data_type == '0' && !isEmpty(new_content.value.data_list)) {
data_list.value = new_content.value.data_list;
- } else if (!isEmpty(new_content.value.data_auto_list) && new_content.value.data_type == '1') {
- data_list.value = new_content.value.data_auto_list;
+ } else if (new_content.value.data_type == '1' && !isEmpty(new_content.value.data_auto_list)) {
+ // data_list.value = new_content.value.data_auto_list;
+ data_list.value = new_content.value.data_auto_list.map((item: any) => ({
+ id: get_math(),
+ new_title: '',
+ new_cover: [],
+ data: item,
+ }));
} else {
data_list.value = Array(4).fill(default_data_list);
}
diff --git a/src/components/model-article-tabs/index.vue b/src/components/model-article-tabs/index.vue
index 774b778c..cdee5f34 100644
--- a/src/components/model-article-tabs/index.vue
+++ b/src/components/model-article-tabs/index.vue
@@ -27,6 +27,7 @@ watch(() => props.value, (val) => {
new_data.content.category_ids = new_data.content.tabs_list[0].category_ids;
new_data.content.carousel_col = new_data.content.article_carousel_col;
new_data.content.data_list = new_data.content.tabs_list[0].data_list;
+ new_data.content.data_auto_list = new_data.content.tabs_list[0].data_auto_list;
new_data.content.data_ids = new_data.content.tabs_list[0].data_ids;
new_data.content.number = new_data.content.tabs_list[0].number;
new_data.content.order_by_type = new_data.content.tabs_list[0].order_by_type;
diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue
index 080e4822..9dae554a 100644
--- a/src/views/layout/index.vue
+++ b/src/views/layout/index.vue
@@ -187,23 +187,48 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
const clone_form = cloneDeep(data);
clone_form.header.show_tabs = '1';
clone_form.footer.show_tabs = '0';
- const new_array_1 = ['goods-list', 'article-list', 'coupon'];
+ // 字段比coupon多
+ const new_array_1 = ['goods-list', 'article-list'];
+ // 数据比正常list多一级
const new_array_2 = ['goods-tabs', 'article-tabs'];
+ // 数据格式简单
+ const new_array_3 = ['coupon'];
+ // 层级更深
+ const new_array_4 = ['data-magic'];
clone_form.diy_data = clone_form.diy_data.map((item: any) => {
if (new_array_1.includes(item.key)) {
item.com_data.content.data_ids = item.com_data.content.data_list.map((item: any) => item.data.id).join(',') || '';
- item.com_data.content.data_list = [];
+ item.com_data.content.data_list = item.com_data.content.data_list.map((item1: any) => {
+ return {
+ ...item1,
+ data: [],
+ };
+ });
item.com_data.content.data_auto_list = [];
} else if (new_array_2.includes(item.key)) {
item.com_data.content.tabs_list.map((item: any) => {
item.data_ids = item.data_list.map((item1: any) => item1.data.id).join(',') || '';
- item.data_list = [];
+ item.data_list = item.data_list.map((item2: any) => {
+ return {
+ ...item2,
+ data: [],
+ };
+ });
item.data_auto_list = [];
});
- } else if (item.key == 'data-magic') {
+ } else if (new_array_3.includes(item.key)) {
+ item.com_data.content.data_ids = item.com_data.content.data_list.map((item: any) => item.data.id).join(',') || '';
+ item.com_data.content.data_list = [];
+ item.com_data.content.data_auto_list = [];
+ } else if (new_array_4.includes(item.key)) {
item.com_data.content.data_magic_list.map((item1: any) => {
item1.data_content.goods_ids = item1.data_content.goods_list.map((item2: any) => item2.data.id).join(',') || '';
- item1.data_content.goods_list = [];
+ item1.data_content.goods_list = item1.data_content.goods_list.map((item3: any) => {
+ return {
+ ...item3,
+ data: [],
+ };
+ });
});
}
return {
From b9cdd09fc40ac4fec6041e6375021088d4c33056 Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Wed, 18 Sep 2024 13:44:59 +0800
Subject: [PATCH 5/5] =?UTF-8?q?1.=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/common/tabs-view/index.vue | 36 ++++++++------
src/components/common/upload/index.vue | 6 +--
src/components/model-article-tabs/index.vue | 48 +++++++++++--------
.../model-article-tabs-content.vue | 5 +-
src/components/model-goods-tabs/index.vue | 46 ++++++++++--------
.../model-goods-tabs-content.vue | 6 +--
.../components/main/default/article-tabs.ts | 2 +
.../components/main/default/goods-tabs.ts | 2 +
8 files changed, 82 insertions(+), 69 deletions(-)
diff --git a/src/components/common/tabs-view/index.vue b/src/components/common/tabs-view/index.vue
index d5b076b5..b457b583 100644
--- a/src/components/common/tabs-view/index.vue
+++ b/src/components/common/tabs-view/index.vue
@@ -1,8 +1,8 @@
-
+
-
+
@@ -10,7 +10,7 @@
{{ item.title }}
-
{{ item.desc }}
+
{{ item.desc }}
@@ -23,6 +23,7 @@
diff --git a/src/components/model-article-tabs/model-article-tabs-content.vue b/src/components/model-article-tabs/model-article-tabs-content.vue
index 5cc4d900..9e05bf5d 100644
--- a/src/components/model-article-tabs/model-article-tabs-content.vue
+++ b/src/components/model-article-tabs/model-article-tabs-content.vue
@@ -32,7 +32,7 @@
-
+
@@ -188,9 +188,8 @@ const article_theme_change = (val: any) => {
// 开启关闭链接
const url_value_dialog_visible = ref(false);
-const active_index = ref(0);
const tabs_list_click = (item: any, index: number) => {
- active_index.value = index;
+ form.tabs_active_index = index;
};
// 选项卡设置
const tabs_list_remove = (index: number) => {
diff --git a/src/components/model-goods-tabs/index.vue b/src/components/model-goods-tabs/index.vue
index c1cf8d45..b59ee564 100644
--- a/src/components/model-goods-tabs/index.vue
+++ b/src/components/model-goods-tabs/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -21,25 +21,29 @@ const props = defineProps({
const style_container = ref('');
const tabs_list = ref({});
+const tabs_active_index = ref(0);
+watch(
+ () => props.value,
+ (val) => {
+ const new_val = cloneDeep(val);
+ const new_style = new_val?.style;
+ let new_data = new_val;
+ tabs_active_index.value = new_data.content.tabs_list.length - 1 >= new_data.content.tabs_active_index ? new_data.content.tabs_active_index : new_data.content.tabs_list.length - 1;
+ // 产品的值
+ new_data.content.data_type = new_data.content.tabs_list[tabs_active_index.value].data_type;
+ new_data.content.category_ids = new_data.content.tabs_list[tabs_active_index.value].category_ids;
+ new_data.content.brand_ids = new_data.content.tabs_list[tabs_active_index.value].brand_ids;
+ new_data.content.number = new_data.content.tabs_list[tabs_active_index.value].number;
+ new_data.content.order_by_type = new_data.content.tabs_list[tabs_active_index.value].order_by_type;
+ new_data.content.order_by_rule = new_data.content.tabs_list[tabs_active_index.value].order_by_rule;
+ new_data.content.data_list = new_data.content.tabs_list[tabs_active_index.value].data_list;
+ new_data.content.data_auto_list = new_data.content.tabs_list[tabs_active_index.value].data_auto_list;
-watch(() => props.value, (val) => {
- const new_val = cloneDeep(val);
- const new_style = new_val?.style;
- let new_data = new_val;
- // 产品的值
- new_data.content.data_type = new_data.content.tabs_list[0].data_type;
- new_data.content.category_ids = new_data.content.tabs_list[0].category_ids;
- new_data.content.brand_ids = new_data.content.tabs_list[0].brand_ids;
- new_data.content.number = new_data.content.tabs_list[0].number;
- new_data.content.order_by_type = new_data.content.tabs_list[0].order_by_type;
- new_data.content.order_by_rule = new_data.content.tabs_list[0].order_by_rule;
- new_data.content.data_list = new_data.content.tabs_list[0].data_list;
- new_data.content.data_auto_list = new_data.content.tabs_list[0].data_auto_list;
-
- tabs_list.value = new_data;
- // 公共样式
- style_container.value += common_styles_computer(new_style.common_style);
-},{ immediate: true, deep: true });
+ tabs_list.value = new_data;
+ // 公共样式
+ style_container.value += common_styles_computer(new_style.common_style);
+ },
+ { immediate: true, deep: true }
+);
-
+
diff --git a/src/components/model-goods-tabs/model-goods-tabs-content.vue b/src/components/model-goods-tabs/model-goods-tabs-content.vue
index 9007d07d..a9d98d16 100644
--- a/src/components/model-goods-tabs/model-goods-tabs-content.vue
+++ b/src/components/model-goods-tabs/model-goods-tabs-content.vue
@@ -35,7 +35,7 @@
-
+
@@ -174,10 +174,8 @@ onBeforeMount(() => {
}, 1000);
});
});
-
-const active_index = ref(0);
const tabs_list_click = (item: any, index: number) => {
- active_index.value = index;
+ form.value.tabs_active_index = index;
};
// 选项卡设置
const tabs_list_remove = (index: number) => {
diff --git a/src/views/layout/components/main/default/article-tabs.ts b/src/views/layout/components/main/default/article-tabs.ts
index 6e0b4666..6837c197 100644
--- a/src/views/layout/components/main/default/article-tabs.ts
+++ b/src/views/layout/components/main/default/article-tabs.ts
@@ -26,6 +26,7 @@ interface DefaultArticleTabs {
article_theme: string;
article_carousel_col: string;
tabs_list: articleTabsList[];
+ tabs_active_index: number;
field_show: string[];
};
style: {
@@ -72,6 +73,7 @@ const defaultArticleTabs: DefaultArticleTabs = {
{ id: '5', title: '测试四', desc: '简介', data_type: '0', category_ids: [], data_ids: '', number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
{ id: '6', title: '测试五', desc: '简介', data_type: '0', category_ids: [], data_ids: '', number: 4, order_by_type: '0', order_by_rule: '0', is_cover: '1', data_list: [], data_auto_list: [] },
],
+ tabs_active_index: 0,
field_show: ['0', '1'],
},
style: {
diff --git a/src/views/layout/components/main/default/goods-tabs.ts b/src/views/layout/components/main/default/goods-tabs.ts
index c3d0146f..daf68ad8 100644
--- a/src/views/layout/components/main/default/goods-tabs.ts
+++ b/src/views/layout/components/main/default/goods-tabs.ts
@@ -21,6 +21,7 @@ interface DefaultProductList {
theme: string;
carousel_col: number;
tabs_list: articleTabsList[];
+ tabs_active_index: number;
is_show: string[];
is_shop_show: string;
is_price_solo: string;
@@ -81,6 +82,7 @@ const defaultProductList: DefaultProductList = {
{ id: '3', title: '测试二', img: [], desc: '简介', data_type: '0', category_ids: [], brand_ids: [], data_ids: [], number: 4, order_by_type: '0', order_by_rule: '0', data_list: [], data_auto_list: [] },
{ id: '4', title: '测试三', img: [], desc: '简介', data_type: '0', category_ids: [], brand_ids: [], data_ids: [], number: 4, order_by_type: '0', order_by_rule: '0', data_list: [], data_auto_list: [] },
],
+ tabs_active_index: 0,
is_show: ['title', 'plugins_view_icon', 'price', 'sales_count', 'original_price'],
is_shop_show: '1',
is_price_solo: '1',