修改选项卡逻辑处理

v1.0.0
于肖磊 2024-10-11 17:15:23 +08:00
parent 9a7803366d
commit f6643c044b
3 changed files with 26 additions and 20 deletions

View File

@ -177,14 +177,17 @@ const data_list_computer = computed(() => {
});
watch(
() => data_list_computer.value,
(new_value) => {
if (new_value.data_type == '1') {
get_auto_data_list();
} else {
if (!isEmpty(new_content.value.data_list)) {
data_list.value = cloneDeep(new_content.value.data_list);
(new_value, old_value) => {
// 使JSON.stringify()
if (JSON.stringify(new_value) !== JSON.stringify(old_value)) {
if (new_value.data_type == '1') {
get_auto_data_list();
} else {
data_list.value = Array(4).fill(default_data_list);
if (!isEmpty(new_content.value.data_list)) {
data_list.value = cloneDeep(new_content.value.data_list);
} else {
data_list.value = Array(4).fill(default_data_list);
}
}
}
},

View File

@ -269,19 +269,22 @@ const watch_data = computed(() => {
return { category_ids: category_ids, brand: brand, number: number, order_by_type: order_by_type, order_by_rule: order_by_rule, data_type: data_type, data_list: data_list };
})
// ,
watch(() => watch_data.value, (val) => {
if (val.data_type == '0') {
if (!isEmpty(val.data_list)) {
list.value = cloneDeep(val.data_list).map((item: any) => ({
...item.data,
title: !isEmpty(item.new_title) ? item.new_title : item.data.title,
new_cover: item.new_cover,
}));
watch(() => watch_data.value, (val, oldVal) => {
// 使JSON.stringify()
if (JSON.stringify(val) !== JSON.stringify(oldVal)) {
if (val.data_type == '0') {
if (!isEmpty(val.data_list)) {
list.value = cloneDeep(val.data_list).map((item: any) => ({
...item.data,
title: !isEmpty(item.new_title) ? item.new_title : item.data.title,
new_cover: item.new_cover,
}));
} else {
list.value = Array(4).fill(default_list);
}
} else {
list.value = Array(4).fill(default_list);
get_products();
}
} else {
get_products();
}
}, { deep: true });
//#endregion

View File

@ -18,7 +18,7 @@ interface DefaultFooterNav {
is_arrows_show: string;
is_center: string;
is_icon_show: string;
icon_src: string;
icon_src: object;
icon_img: uploadList[];
icon_class: string;
search_botton_img: uploadList[];
@ -76,7 +76,7 @@ const defaultFooterNav: DefaultFooterNav = {
is_arrows_show: '1',
is_center: '0',
is_icon_show: '1',
icon_src: '',
icon_src: {},
icon_img: [],
icon_class: '',
search_botton_img: [],