From 094242538b477772d8fbf74331cdeaecb2359768 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com>
Date: Fri, 28 Mar 2025 16:11:57 +0800
Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=B4=BB=E5=8A=A8=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/diy/activity.vue | 367 +++++++++-------------------------
components/diy/ask.vue | 48 +----
components/diy/binding.vue | 26 +--
components/diy/diy.vue | 4 +-
components/diy/goods-list.vue | 46 +++--
components/diy/realstore.vue | 15 +-
components/diy/shop.vue | 34 +---
7 files changed, 151 insertions(+), 389 deletions(-)
diff --git a/components/diy/activity.vue b/components/diy/activity.vue
index eded95d5..46522952 100644
--- a/components/diy/activity.vue
+++ b/components/diy/activity.vue
@@ -1,72 +1,47 @@
-
-
-
-
-
-
- {{ index + 1 }}
- {{ item.title }}
-
-
-
-
-
- {{ item.is_reply == 0 ? '未回' : '已回'}}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ activity_item.title }}
+
-
- {{ item.add_time_date }}
- 共有{{ item.access_count }}浏览
-
-
-
-
-
-
- {{ item.title }}
-
-
- {{ item.add_time_date }}
-
-
-
- {{ item.is_reply == 0 ? '未回' : '已回'}}
+
+
+
+ {{ activity_item.title }}
+ {{ activity_item.describe }}
+
+
+
+ {{ item }}
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- {{ item.title }}
-
-
- {{ item.add_time_date }}
-
-
-
- {{ item.is_reply == 0 ? '未回' : '已回'}}
-
-
-
-
-
-
-
-
-
-
+
@@ -74,17 +49,15 @@
diff --git a/components/diy/ask.vue b/components/diy/ask.vue
index eded95d5..9d3d9bc2 100644
--- a/components/diy/ask.vue
+++ b/components/diy/ask.vue
@@ -1,9 +1,9 @@
-
+
-
+
@@ -45,7 +45,7 @@
-
+
@@ -110,35 +110,26 @@
return {
form: {},
new_style: {},
- propIsCartParaCurve: false,
list: [],
- content_radius: '', // 圆角设置
- content_img_radius: '', // 图片圆角设置
- content_padding: '', // 内边距设置
theme: '', // 选择的风格
content_outer_spacing: '', // 商品间距
content_outer_spacing_magin: '', // 商品间距
// 最外层不同风格下的显示
outer_class: '',
- onter_style: '',
+ outer_style: '',
// 不同风格下的样式
layout_style: '',
layout_img_style: '',
- content_style: '', // 内容区域的样式
- show_content: false, // 显示除标题外的其他区域
- text_line: '', // 超过多少行隐藏
style_container: '', // 公共样式
style_img_container: '',
ask_content_list: [],
slides_per_group: 1,
- border_style: '',
// 内容样式
title_style: '',
time_style: '',
page_view_style: '',
// 图片大小
img_size: '',
- shop_label_style: '',
new_scale: 1,
// 已回未回信息
not_replied_yet_style: '',
@@ -222,13 +213,10 @@
form: new_form,
new_style: new_style,
outer_class: flex + wrap + 'oh',
- onter_style: ['0', '2'].includes(new_form.theme) ? `gap: ${new_style.content_outer_spacing * 2 + 'rpx'};` : `column-gap: ${ new_style.content_outer_spacing * 2 + 'rpx' }`,
+ outer_style: ['0', '2'].includes(new_form.theme) ? `gap: ${new_style.content_outer_spacing * 2 + 'rpx'};` : `column-gap: ${ new_style.content_outer_spacing * 2 + 'rpx' }`,
content_outer_spacing_magin: new_style.content_outer_spacing * 2 + 'rpx',
list: new_list,
new_scale: scale,
- content_radius: radius_computer(new_style.ask_radius), // 圆角设置
- content_img_radius: radius_computer(new_style.ask_img_radius), // 图片圆角设置
- content_padding: padding_computer(new_style.ask_padding) + 'box-sizing: border-box;', // 内边距设置
theme: new_form.theme, // 选择的风格
title_style: this.trends_config('title', new_style) + 'word-break: break-all;',
time_style: this.trends_config('time', new_style),
@@ -239,11 +227,8 @@
returned_style: this.button_style(new_style.returned_style),
returned_img_style: this.button_img_style(new_style.returned_style),
img_size: img_style,
- shop_label_style: this.get_shop_label_style(new_style),
- border_style: this.get_border_style(new_style),
layout_style: this.get_layout_style(new_form, new_style),
layout_img_style: this.get_layout_img_style(new_form, new_style),
- content_style: this.get_content_style(new_form, new_style),
slides_per_group: new_style.rolling_fashion == 'translation' ? new_form.carousel_col : 1,
style_container: this.propIsCommonStyle ? common_styles_computer(new_style.common_style) : '', // 公共样式
style_img_container: this.propIsCommonStyle ? common_img_computer(new_style.common_style, this.propIndex) : '', // 图片样式
@@ -256,11 +241,6 @@
button_img_style(style){
return `${ padding_computer(style.font_padding) } ${ background_computer(style) }font-weight:${style.font_typeface}; font-size: ${style.font_size}px;color: ${style.font_color};`;
},
- // 标签显示
- get_shop_label_style(new_style) {
- const { shop_lable_color, shop_lable_size, shop_lable_padding, shop_lable_radius, shop_lable_color_list, shop_lable_direction, shop_lable_border_color, shop_lable_border_size } = new_style;
- return `color: ${ shop_lable_color };font-size: ${ shop_lable_size }px;${ padding_computer(shop_lable_padding) };${ radius_computer(shop_lable_radius) };${ gradient_handle(shop_lable_color_list, shop_lable_direction) };border: ${ shop_lable_border_size }px solid ${ shop_lable_border_color };`
- },
// 根据传递的参数,从对象中取值
trends_config(key, new_style) {
return this.style_config(new_style[`ask_${key}_typeface`], new_style[`ask_${key}_size`], new_style[`ask_${key}_color`]);
@@ -306,14 +286,6 @@
return nav_list;
}
},
- get_border_style(new_style) {
- const { content_border_margin, content_border_size, content_border_is_show, content_border_color, content_border_style } = new_style;
- let border = ``;
- if (content_border_is_show == '1') {
- border += `${ margin_computer(content_border_margin) };border-width: ${content_border_size}px 0px 0px 0px;border-style: ${ content_border_style };border-color: ${content_border_color};`
- }
- return border;
- },
// 容器样式
get_layout_style(form, new_style) {
const { ask_margin, ask_radius, ask_color_list, ask_direction } = new_style;
@@ -358,16 +330,6 @@
}
return padding + background_computer(data);
},
- get_content_style(form, new_style) {
- const spacing_value = new_style.content_spacing;
- let spacing = '';
- if (['0'].includes(form.theme)) {
- spacing = `margin-left: ${spacing_value}px;`;
- } else {
- spacing = padding_computer(new_style.ask_padding);
- }
- return `${spacing}`;
- },
url_event(e) {
app.globalData.url_event(e);
},
diff --git a/components/diy/binding.vue b/components/diy/binding.vue
index a725be0a..70b668b5 100644
--- a/components/diy/binding.vue
+++ b/components/diy/binding.vue
@@ -28,7 +28,7 @@
{{ match_item.estimate_price }}
-
+
¥
{{ match_item.estimate_discount_price || 0 }}
@@ -38,7 +38,7 @@
-
+
@@ -53,7 +53,7 @@
{{ match_item.estimate_price }}
-
+
¥
{{ match_item.estimate_discount_price || 0 }}
@@ -61,14 +61,14 @@
-
+
-
+
@@ -88,7 +88,7 @@
{{ item.show_price_unit }}
-
+
{{ item.show_price_symbol }}
{{ item.discount_price || 0 }}
@@ -102,7 +102,7 @@
-
+
@@ -121,7 +121,7 @@
{{ item.show_price_unit }}
-
+
{{ item.show_price_symbol }}
{{ item.discount_price || 0 }}
@@ -187,23 +187,18 @@
return {
form: {},
new_style: {},
- propIsCartParaCurve: false,
list: [],
- content_radius: '', // 圆角设置
- content_img_radius: '', // 图片圆角设置
- content_padding: '', // 内边距设置
host_graph_theme: '',//主图风格
theme: '', // 选择的风格
content_outer_spacing: '', // 商品间距
content_outer_spacing_magin: '', // 商品间距
// 最外层不同风格下的显示
outer_class: '',
- onter_style: '',
+ outer_style: '',
// 不同主图风格下的内容
match_layout_style: '',
match_layout_img_style: '',
data_content_img_radius: '',
- data_content_padding: '',
data_content_style: '',
// 不同风格下的样式
layout_style: '',
@@ -310,7 +305,7 @@
form: new_form,
new_style: new_style,
outer_class: flex + wrap + 'oh',
- onter_style: `gap: ${new_style.goods_content_outer_spacing * 2 + 'rpx'};`,
+ outer_style: `gap: ${new_style.goods_content_outer_spacing * 2 + 'rpx'};`,
content_outer_spacing_magin: new_style.goods_content_outer_spacing * 2 + 'rpx',
list: data_handle_list,
new_scale: scale,
@@ -319,7 +314,6 @@
match_layout_style: this.get_match_layout_style(new_style),
match_layout_img_style: this.get_match_layout_img_style(new_form, new_style),
data_content_img_radius: radius_computer(new_style.data_img_radius),
- data_content_padding: padding_computer(new_style.data_padding),
data_content_style: this.get_data_content_style(new_form, new_style),
data_img_style: data_img_style,
data_title_style: this.trends_config('title', 'data', new_style),
diff --git a/components/diy/diy.vue b/components/diy/diy.vue
index 56f4dc8b..05f270bd 100644
--- a/components/diy/diy.vue
+++ b/components/diy/diy.vue
@@ -44,7 +44,7 @@
-
+
@@ -136,6 +136,7 @@
import componentDiyBinding from '@/components/diy/binding';
import componentDiyAsk from '@/components/diy/ask';
import componentDiyAskTabs from '@/components/diy/ask-tabs';
+ import componentDiyActivity from '@/components/diy/activity';
import componentDiyTabsCarousel from '@/components/diy/tabs-carousel';
import componentDataTabs from '@/components/diy/data-tabs';
import componentGoodsList from '@/components/goods-list/goods-list';
@@ -200,6 +201,7 @@
componentDiyBinding,
componentDiyAsk,
componentDiyAskTabs,
+ componentDiyActivity,
componentDiyTabsCarousel,
componentDataTabs,
componentGoodsList,
diff --git a/components/diy/goods-list.vue b/components/diy/goods-list.vue
index 4da750ec..b116b6c8 100644
--- a/components/diy/goods-list.vue
+++ b/components/diy/goods-list.vue
@@ -1,7 +1,7 @@
-
+
@@ -113,7 +113,7 @@
-
+
@@ -215,22 +215,27 @@
type: Number,
default: 0,
},
+ propNewList: {
+ type: Array,
+ default: []
+ },
+ propIsUseAuto: {
+ type: Boolean,
+ default: true,
+ }
},
data() {
return {
form: {},
new_style: {},
- propIsCartParaCurve: false,
list: [],
- content_radius: '', // 圆角设置
content_img_radius: '', // 图片圆角设置
- content_padding: '', // 内边距设置
theme: '', // 选择的风格
content_outer_spacing: '', // 商品间距
content_outer_spacing_magin: '', // 商品间距
// 最外层不同风格下的显示
outer_class: '',
- onter_style: '',
+ outer_style: '',
// 不同风格下的样式
layout_type: '',
layout_style: '',
@@ -277,16 +282,21 @@
const new_style = this.propValue.style || null;
if (new_form != null && new_style != null) {
let new_list = [];
- // 指定商品并且指定商品数组不为空
- if (!isEmpty(new_form.data_list) && new_form.data_type == '0') {
- new_list = new_form.data_list.map((item) => ({
- ...item.data,
- title: !isEmpty(item.new_title) ? item.new_title : item.data.title,
- new_cover: item.new_cover,
- }));
- } else if (!isEmpty(new_form.data_auto_list) && new_form.data_type == '1') {
- // 筛选商品并且筛选商品数组不为空
- new_list = new_form.data_auto_list;
+ // 判断是否是活动传递过来的,是使用自动数据,还是使用传递过来的数据
+ if (this.propIsUseAuto) {
+ // 指定商品并且指定商品数组不为空
+ if (!isEmpty(new_form.data_list) && new_form.data_type == '0') {
+ new_list = new_form.data_list.map((item) => ({
+ ...item.data,
+ title: !isEmpty(item.new_title) ? item.new_title : item.data.title,
+ new_cover: item.new_cover,
+ }));
+ } else if (!isEmpty(new_form.data_auto_list) && new_form.data_type == '1') {
+ // 筛选商品并且筛选商品数组不为空
+ new_list = new_form.data_auto_list;
+ }
+ } else {
+ new_list = this.propNewList;
}
// 最外层不同风格下的显示
const flex = ['0', '2', '6'].includes(new_form.theme) ? 'flex-col ' : 'flex-row ';
@@ -337,13 +347,11 @@
outer_class: flex + wrap + background + 'oh',
list: new_list,
new_scale: scale,
- content_radius: radius_computer(new_style.shop_radius), // 圆角设置
content_img_radius: radius_computer(new_style.shop_img_radius), // 图片圆角设置
- content_padding: padding_computer(new_style.shop_padding) + 'box-sizing: border-box;', // 内边距设置
theme: new_form.theme, // 选择的风格
content_outer_spacing: new_style.content_outer_spacing, // 商品间距
content_outer_spacing_magin: new_style.content_outer_spacing * 2 + 'rpx',
- onter_style: new_form.theme == '6' ? radius_computer(new_style.shop_radius) : `gap: ${new_style.content_outer_spacing * 2 + 'rpx'};`,
+ outer_style: new_form.theme == '6' ? radius_computer(new_style.shop_radius) : `gap: ${new_style.content_outer_spacing * 2 + 'rpx'};`,
// 不同风格下的样式
layout_type: ['0', '4'].includes(new_form.theme) ? 'flex-row wh-auto ht-auto oh' : 'flex-col wh-auto ht-auto oh',
layout_style: this.get_layout_style(new_style, new_form),
diff --git a/components/diy/realstore.vue b/components/diy/realstore.vue
index 3327a2fd..91fa682b 100644
--- a/components/diy/realstore.vue
+++ b/components/diy/realstore.vue
@@ -1,7 +1,7 @@
-
+
@@ -74,7 +74,7 @@
-
+
@@ -146,23 +146,18 @@
return {
form: {},
new_style: {},
- propIsCartParaCurve: false,
list: [],
- content_radius: '', // 圆角设置
content_img_radius: '', // 图片圆角设置
- content_padding: '', // 内边距设置
theme: '', // 选择的风格
content_outer_spacing: '', // 商品间距
content_outer_spacing_magin: '', // 商品间距
// 最外层不同风格下的显示
outer_class: '',
- onter_style: '',
+ outer_style: '',
// 不同风格下的样式
layout_style: '',
layout_img_style: '',
content_style: '', // 内容区域的样式
- show_content: false, // 显示除标题外的其他区域
- text_line: '', // 超过多少行隐藏
style_container: '', // 公共样式
style_img_container: '',
realstore_content_list: [],
@@ -251,13 +246,11 @@
form: new_form,
new_style: new_style,
outer_class: flex + wrap + 'oh',
- onter_style: `gap: ${new_style.content_outer_spacing * 2 + 'rpx'};`,
+ outer_style: `gap: ${new_style.content_outer_spacing * 2 + 'rpx'};`,
content_outer_spacing_magin: new_style.content_outer_spacing * 2 + 'rpx',
list: new_list,
new_scale: scale,
- content_radius: radius_computer(new_style.realstore_radius), // 圆角设置
content_img_radius: radius_computer(new_style.realstore_img_radius), // 图片圆角设置
- content_padding: padding_computer(new_style.realstore_padding) + 'box-sizing: border-box;', // 内边距设置
theme: new_form.theme, // 选择的风格
title_style: this.trends_config('title', new_style),
state_style: this.trends_config('state', new_style),
diff --git a/components/diy/shop.vue b/components/diy/shop.vue
index 03bb1690..ca3cbecf 100644
--- a/components/diy/shop.vue
+++ b/components/diy/shop.vue
@@ -1,7 +1,7 @@
-
+
@@ -29,7 +29,7 @@
{{ item.describe }}
-
+
@@ -38,7 +38,7 @@
-
+
@@ -107,35 +107,28 @@
return {
form: {},
new_style: {},
- propIsCartParaCurve: false,
list: [],
- content_radius: '', // 圆角设置
content_img_radius: '', // 图片圆角设置
- content_padding: '', // 内边距设置
theme: '', // 选择的风格
content_outer_spacing: '', // 商品间距
content_outer_spacing_magin: '', // 商品间距
// 最外层不同风格下的显示
outer_class: '',
- onter_style: '',
+ outer_style: '',
// 不同风格下的样式
layout_style: '',
layout_img_style: '',
content_style: '', // 内容区域的样式
- show_content: false, // 显示除标题外的其他区域
- text_line: '', // 超过多少行隐藏
style_container: '', // 公共样式
style_img_container: '',
shop_content_list: [],
slides_per_group: 1,
- border_style: '',
// 内容样式
title_style: '',
desc_style: '',
title_img_style: '',
// 图片大小
img_size: '',
- shop_label_style: '',
new_scale: 1,
};
},
@@ -210,21 +203,17 @@
form: new_form,
new_style: new_style,
outer_class: flex + wrap + 'oh',
- onter_style: `gap: ${new_style.content_outer_spacing * 2 + 'rpx'};`,
+ outer_style: `gap: ${new_style.content_outer_spacing * 2 + 'rpx'};`,
content_outer_spacing_magin: new_style.content_outer_spacing * 2 + 'rpx',
list: new_list,
new_scale: scale,
- content_radius: radius_computer(new_style.shop_radius), // 圆角设置
content_img_radius: radius_computer(new_style.shop_img_radius), // 图片圆角设置
- content_padding: padding_computer(new_style.shop_padding) + 'box-sizing: border-box;', // 内边距设置
theme: new_form.theme, // 选择的风格
title_style: this.trends_config('title', new_style),
desc_style: this.trends_config('desc', new_style),
shop_content_list: this.get_shop_content_list(new_list, new_form, new_style),
title_img_style: this.get_title_img_style(new_style),
img_size: img_style,
- shop_label_style: this.get_shop_label_style(new_style),
- border_style: this.get_border_style(new_style),
layout_style: this.get_layout_style(new_form, new_style),
layout_img_style: this.get_layout_img_style(new_form, new_style),
content_style: this.get_content_style(new_form, new_style),
@@ -234,11 +223,6 @@
});
}
},
- // 标签显示
- get_shop_label_style(new_style) {
- const { shop_lable_color, shop_lable_size, shop_lable_padding, shop_lable_radius, shop_lable_color_list, shop_lable_direction, shop_lable_border_color, shop_lable_border_size } = new_style;
- return `color: ${ shop_lable_color };font-size: ${ shop_lable_size }px;${ padding_computer(shop_lable_padding) };${ radius_computer(shop_lable_radius) };${ gradient_handle(shop_lable_color_list, shop_lable_direction) };border: ${ shop_lable_border_size }px solid ${ shop_lable_border_color };`
- },
// 根据传递的参数,从对象中取值
trends_config(key, new_style) {
return this.style_config(new_style[`shop_${key}_typeface`], new_style[`shop_${key}_size`], new_style[`shop_${key}_color`]);
@@ -288,14 +272,6 @@
return nav_list;
}
},
- get_border_style(new_style) {
- const { content_border_margin, content_border_size, content_border_is_show, content_border_color, content_border_style } = new_style;
- let border = ``;
- if (content_border_is_show == '1') {
- border += `${ margin_computer(content_border_margin) };border-width: ${content_border_size}px 0px 0px 0px;border-style: ${ content_border_style };border-color: ${content_border_color};`
- }
- return border;
- },
// 容器样式
get_layout_style(form, new_style) {
const { shop_margin, shop_radius, shop_color_list, shop_direction } = new_style;