From eacc8335f5e074876a4f02edac1cfe02428d9d2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com>
Date: Sun, 3 Nov 2024 16:09:35 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E5=92=8C?=
=?UTF-8?q?=E6=96=87=E7=AB=A0=E7=9A=84=E9=AB=98=E5=BA=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/model-article-list/index.vue | 19 ++++-------
.../model-article-list-content.vue | 23 ++++++++++---
.../model-article-list-setting.vue | 10 ++++--
.../model-article-list-styles.vue | 2 +-
.../model-article-tabs-content.vue | 22 ++++++++++---
.../model-article-tabs-setting.vue | 10 ++++--
.../model-article-tabs-styles.vue | 2 +-
src/components/model-goods-list/index.vue | 33 ++++++++++---------
.../model-goods-list-content.vue | 30 ++++++++++++-----
.../model-goods-list-setting.vue | 10 ++++--
.../model-goods-list-styles.vue | 3 +-
.../model-goods-tabs-content.vue | 27 ++++++++++-----
.../model-goods-tabs-setting.vue | 10 ++++--
.../model-goods-tabs-styles.vue | 2 +-
src/config/const/article-list.ts | 2 +-
src/config/const/article-tabs.ts | 2 +-
src/config/const/goods-list.ts | 2 +-
src/config/const/goods-tabs.ts | 2 +-
18 files changed, 140 insertions(+), 71 deletions(-)
diff --git a/src/components/model-article-list/index.vue b/src/components/model-article-list/index.vue
index 5a79945b..c3c15d53 100644
--- a/src/components/model-article-list/index.vue
+++ b/src/components/model-article-list/index.vue
@@ -118,7 +118,7 @@ const content_padding = ref('');
const content_spacing = ref('');
// 文章间距
const article_spacing = ref('');
-const article_item_height = ref('155');
+const article_item_height = ref('183');
const article_style = ref({});
const default_data_list: ArticleList = {
@@ -229,9 +229,7 @@ const article_name_line_height_computer = computed(() => {
return new_style.value.name_size * 1.2 + 'px';
});
// 轮播高度
-const carousel_height_computer = computed(() => {
- return new_style.value.name_size * 2 + new_style.value.article_height + 'px';
-});
+const carousel_height_computer = computed(() => new_style.value.article_height + 'px');
// 监听value数据变化
watch(
() => props.value,
@@ -327,8 +325,9 @@ const article_carousel_list = computed(() => {
.style1 {
.item {
width: 100%;
+ height: v-bind(carousel_height_computer);
.img {
- height: 8.3rem;
+ height: 100%;
width: 11rem;
}
}
@@ -336,18 +335,13 @@ const article_carousel_list = computed(() => {
.style2 {
.item {
width: calc(50% - 0.5rem);
- .img {
- height: 18rem;
- }
+ height: v-bind(carousel_height_computer);
}
}
.style3 {
.item {
width: 100%;
- .img {
- width: 100%;
- height: 18rem;
- }
+ height: v-bind(carousel_height_computer);
}
}
.style4 {
@@ -362,6 +356,7 @@ const article_carousel_list = computed(() => {
.item {
width: v-bind(multicolumn_columns_width);
min-width: v-bind(multicolumn_columns_width);
+ height: v-bind(carousel_height_computer);
.img {
width: 100%;
max-height: v-bind(article_item_height);
diff --git a/src/components/model-article-list/model-article-list-content.vue b/src/components/model-article-list/model-article-list-content.vue
index 92d7b762..e3be9326 100644
--- a/src/components/model-article-list/model-article-list-content.vue
+++ b/src/components/model-article-list/model-article-list-content.vue
@@ -102,11 +102,11 @@ const state = reactive({
const { form, data } = toRefs(state);
const base_list = reactive({
theme_list: [
- { name: '单列展示', value: '0' },
- { name: '两列展示(纵向)', value: '1' },
- { name: '大图展示', value: '2' },
- { name: '无图模式', value: '3' },
- { name: '左右滑动展示', value: '4' },
+ { name: '单列展示', value: '0', height: 103 },
+ { name: '两列展示(纵向)', value: '1', height: 245 },
+ { name: '大图展示', value: '2', height: 245 },
+ { name: '无图模式', value: '3', height: 0 },
+ { name: '左右滑动展示', value: '4', height: 183 },
],
carousel_col_list: [
{ name: '单列展示', value: '0' },
@@ -134,6 +134,8 @@ const base_list = reactive({
{ name: '描述', value: '2' },
],
});
+
+const emits = defineEmits(['theme_change']);
onMounted(() => {
nextTick(() => {
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
@@ -141,6 +143,13 @@ onMounted(() => {
base_list.article_category_list = common_store.common.article_category;
}
});
+ // 如果历史数据没有操作,则修改默认值
+ if (data.value.article_height == 155 && form.value.theme != '4') {
+ const list = base_list.theme_list.filter(item => item.value == form.value.theme);
+ if (list.length > 0) {
+ emits('theme_change', list[0].height);
+ }
+ }
});
// 主题改变
const theme_change = (val: any) => {
@@ -166,6 +175,10 @@ const theme_change = (val: any) => {
data.value.img_radius.radius_top_right = props.defaultConfig.img_radius_1;
}
}
+ const list = base_list.theme_list.filter(item => item.value == val);
+ if (list.length > 0) {
+ emits('theme_change', list[0].height);
+ }
};
// 移除
const data_list_remove = (index: number) => {
diff --git a/src/components/model-article-list/model-article-list-setting.vue b/src/components/model-article-list/model-article-list-setting.vue
index 29b6f8a6..dda1ff74 100644
--- a/src/components/model-article-list/model-article-list-setting.vue
+++ b/src/components/model-article-list/model-article-list-setting.vue
@@ -1,10 +1,10 @@
-
+
-
+
@@ -29,4 +29,10 @@ const data_config = reactive({
img_radius_0: 4,
img_radius_1: 0,
});
+const form = ref(props.value);
+const theme_change = (val: number) => {
+ if (val) {
+ form.value.style.article_height = val;
+ }
+};
diff --git a/src/components/model-article-list/model-article-list-styles.vue b/src/components/model-article-list/model-article-list-styles.vue
index 928cb10c..b22ba3fa 100644
--- a/src/components/model-article-list/model-article-list-styles.vue
+++ b/src/components/model-article-list/model-article-list-styles.vue
@@ -40,7 +40,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 9d2b51f4..1f863b77 100644
--- a/src/components/model-article-tabs/model-article-tabs-content.vue
+++ b/src/components/model-article-tabs/model-article-tabs-content.vue
@@ -132,11 +132,11 @@ const base_list = reactive({
{ name: '样式四', value: '3' },
],
article_theme_list: [
- { name: '单列展示', value: '0' },
- { name: '两列展示(纵向)', value: '1' },
- { name: '大图展示', value: '2' },
- { name: '无图模式', value: '3' },
- { name: '左右滑动展示', value: '4' },
+ { name: '单列展示', value: '0', height: 103 },
+ { name: '两列展示(纵向)', value: '1', height: 245 },
+ { name: '大图展示', value: '2', height: 245 },
+ { name: '无图模式', value: '3', height: 0 },
+ { name: '左右滑动展示', value: '4', height: 183 },
],
carousel_col_list: [
{ name: '单列展示', value: '0' },
@@ -164,6 +164,7 @@ const base_list = reactive({
{ name: '描述', value: '2' },
],
});
+const emits = defineEmits(['theme_change']);
onMounted(() => {
nextTick(() => {
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
@@ -171,6 +172,13 @@ onMounted(() => {
base_list.article_category_list = common_store.common.article_category;
}
});
+ // 如果历史数据没有操作,则修改默认值
+ if (styles.article_height == 155 && form.value.theme != '4') {
+ const list = base_list.article_theme_list.filter(item => item.value == form.value.theme);
+ if (list.length > 0) {
+ emits('theme_change', list[0].height);
+ }
+ }
});
// 监听tabs_theme_list的变化
const article_theme_change = (val: any) => {
@@ -196,6 +204,10 @@ const article_theme_change = (val: any) => {
styles.img_radius.radius_top_right = props.defaultConfig.img_radius_1;
}
}
+ const list = base_list.article_theme_list.filter(item => item.value == val);
+ if (list.length > 0) {
+ emits('theme_change', list[0].height);
+ }
};
// 开启关闭链接
diff --git a/src/components/model-article-tabs/model-article-tabs-setting.vue b/src/components/model-article-tabs/model-article-tabs-setting.vue
index 6708f36a..4232c3a7 100644
--- a/src/components/model-article-tabs/model-article-tabs-setting.vue
+++ b/src/components/model-article-tabs/model-article-tabs-setting.vue
@@ -1,10 +1,10 @@
-
+
-
+
@@ -29,4 +29,10 @@ const data_config = reactive({
img_radius_0: 4,
img_radius_1: 0,
});
+const form = ref(props.value);
+const theme_change = (val: number) => {
+ if (val) {
+ form.value.style.article_height = val;
+ }
+};
diff --git a/src/components/model-article-tabs/model-article-tabs-styles.vue b/src/components/model-article-tabs/model-article-tabs-styles.vue
index 789078b4..010135a8 100644
--- a/src/components/model-article-tabs/model-article-tabs-styles.vue
+++ b/src/components/model-article-tabs/model-article-tabs-styles.vue
@@ -60,7 +60,7 @@
-
+
diff --git a/src/components/model-goods-list/index.vue b/src/components/model-goods-list/index.vue
index daa99b9e..b9436e0d 100644
--- a/src/components/model-goods-list/index.vue
+++ b/src/components/model-goods-list/index.vue
@@ -329,19 +329,19 @@ const layout_type = computed(() => {
let class_type = '';
switch (theme.value) {
case '0':
- class_type = `flex-row bg-f oh`;
+ class_type = `flex-row goods-height bg-f oh`;
break;
case '1':
- class_type = `flex-col two-columns bg-f oh`;
+ class_type = `flex-col goods-height two-columns bg-f oh`;
break;
case '2':
- class_type = `flex-col bg-f oh`;
+ class_type = `flex-col goods-height bg-f oh`;
break;
case '3':
- class_type = `flex-col three-columns bg-f oh`;
+ class_type = `flex-col goods-height three-columns bg-f oh`;
break;
case '4':
- class_type = `flex-row two-columns bg-f oh`;
+ class_type = `flex-row goods-height two-columns bg-f oh`;
break;
case '5':
class_type = `flex-col multicolumn-columns bg-f oh`;
@@ -447,7 +447,7 @@ const multicolumn_columns_width = computed(() => {
let gap = (new_style.value.content_outer_spacing * (carousel_col.value - 1)) / carousel_col.value;
return `calc(${100 / carousel_col.value}% - ${gap}px)`;
});
-const multicolumn_columns_height = computed(() => new_style.value.content_outer_height + 'px');
+const content_outer_height = computed(() => new_style.value.content_outer_height + 'px');
interface nav_list {
split_list: data_list[];
}
@@ -537,29 +537,32 @@ watchEffect(() => {
.multicolumn-columns {
width: v-bind(multicolumn_columns_width);
min-width: v-bind(multicolumn_columns_width);
- height: v-bind(multicolumn_columns_height);
+ height: v-bind(content_outer_height);
+}
+.goods-height {
+ height: v-bind(content_outer_height);
}
.flex-img0 {
- height: auto;
- min-height: 11rem;
+ height: 100%;
+ // min-height: 11rem;
// max-height: 12rem;
width: 11rem;
}
.flex-img1 {
width: 100%;
- height: 18rem;
+ height: 100%;
}
.flex-img2 {
width: 100%;
- height: 16.6rem;
+ height: 100%;
}
.flex-img3 {
width: 100%;
- height: 11.4rem;
+ height: 100%;
}
.flex-img4 {
- min-width: 7rem;
- min-height: 7rem;
+ width: 7rem;
+ min-height: 100%;
}
.flex-img5 {
width: 100%;
@@ -569,7 +572,7 @@ watchEffect(() => {
:deep(.el-carousel) {
width: 100%;
.el-carousel__container {
- height: v-bind(multicolumn_columns_height);
+ height: v-bind(content_outer_height);
}
}
diff --git a/src/components/model-goods-list/model-goods-list-content.vue b/src/components/model-goods-list/model-goods-list-content.vue
index 0fdd1bcc..a271384c 100644
--- a/src/components/model-goods-list/model-goods-list-content.vue
+++ b/src/components/model-goods-list/model-goods-list-content.vue
@@ -96,13 +96,13 @@ const { form, data } = toRefs(state);
const base_list = reactive({
product_style_list: [
- { name: '单列展示', value: '0' },
- { name: '大图展示', value: '2' },
- { name: '无图模式', value: '6' },
- { name: '两列展示(纵向)', value: '1' },
- { name: '两列展示(横向)', value: '4' },
- { name: '三列展示', value: '3' },
- { name: '左右滑动展示', value: '5' },
+ { name: '单列展示', value: '0', height: 142 },
+ { name: '大图展示', value: '2', height: 308 },
+ { name: '无图模式', value: '6', height: 0 },
+ { name: '两列展示(纵向)', value: '1', height: 302 },
+ { name: '两列展示(横向)', value: '4', height: 94 },
+ { name: '三列展示', value: '3', height: 204 },
+ { name: '左右滑动展示', value: '5', height: 232 },
],
product_list: [
{ name: '指定商品', value: '0' },
@@ -122,7 +122,7 @@ const base_list = reactive({
{ name: '升序(asc)', value: '1' },
],
});
-
+const emits = defineEmits(['theme_change']);
onBeforeMount(() => {
nextTick(() => {
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
@@ -134,6 +134,13 @@ onBeforeMount(() => {
}
}, 1000);
});
+ // 如果历史数据没有操作,则修改默认值
+ if (data.value.content_outer_height == 232 && form.value.theme != '5') {
+ const list = base_list.product_style_list.filter(item => item.value == form.value.theme);
+ if (list.length > 0) {
+ emits('theme_change', list[0].height);
+ }
+ }
});
const goods_list_remove = (index: number) => {
@@ -177,7 +184,8 @@ const goods_list_sort = (new_list: any) => {
form.value.data_list = new_list;
};
// 选择某些风格时, 切换到对应的按钮
-const change_style = (val: any): void => {
+const change_style = (val: string | number | boolean | undefined): void => {
+ if (typeof val !== 'string') return;
form.value.theme = val;
if (!is_revise.value) {
if (['3', '4', '5'].includes(val) && form.value.shop_type == 'text') {
@@ -203,6 +211,10 @@ const change_style = (val: any): void => {
data.value.shop_img_radius.radius_top_right = props.defaultConfig.img_radius_1;
}
}
+ const list = base_list.product_style_list.filter(item => item.value == val);
+ if (list.length > 0) {
+ emits('theme_change', list[0].height);
+ }
};
const is_revise = ref(false);
const change_shop_type = () => {
diff --git a/src/components/model-goods-list/model-goods-list-setting.vue b/src/components/model-goods-list/model-goods-list-setting.vue
index 2e0c0315..9bcf2faa 100644
--- a/src/components/model-goods-list/model-goods-list-setting.vue
+++ b/src/components/model-goods-list/model-goods-list-setting.vue
@@ -1,10 +1,10 @@
-
+
-
+
@@ -24,6 +24,12 @@ const data_config = reactive({
img_radius_0: 4,
img_radius_1: 0,
});
+const form = ref(props.value);
+const theme_change = (val: number) => {
+ if (val) {
+ form.value.style.content_outer_height = val;
+ }
+};