From 7421ec4c5431fc1183d06a57e878eb0b47eda59e Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Mon, 21 Oct 2024 01:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=B4=AD=E4=B9=B0=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=83=8C=E6=99=AF=E8=89=B2=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/goods-list.vue | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/components/diy/goods-list.vue b/components/diy/goods-list.vue index ace7290f..f60fe644 100644 --- a/components/diy/goods-list.vue +++ b/components/diy/goods-list.vue @@ -88,7 +88,7 @@ - + {{ form.shop_button_text }} @@ -143,7 +143,7 @@ - + {{ form.shop_button_text }} @@ -230,14 +230,10 @@ score_style: '', button_style: '', simple_desc: '', + // 按钮背景色 + button_gradient: '', }; }, - computed: { - // 按钮渐变色处理 - button_gradient() { - return gradient_handle(this.new_style.shop_button_color, '180deg'); - }, - }, watch: { propKey(val) { this.init(); @@ -267,6 +263,7 @@ const flex = ['0', '2', '6'].includes(new_form.theme) ? 'flex-col ' : 'flex-row '; const wrap = new_form.theme == '5' ? '' : 'flex-wrap '; const background = ['6'].includes(new_form.theme) ? 'bg-white ' : ''; + const button_gradient = gradient_handle(new_style.shop_button_color, '180deg'); this.setData({ form: new_form, @@ -288,11 +285,12 @@ 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) : '', // 图片样式 // 内容样式设置 + button_gradient: button_gradient, title_style: this.trends_config(new_style, 'title', 'title', new_form.theme), price_style: this.trends_config(new_style, 'price'), sold_number_style: this.trends_config(new_style, 'sold_number'), score_style: this.trends_config(new_style, 'score'), - button_style: this.trends_config(new_style, 'button', 'gradient'), + button_style: this.trends_config(new_style, 'button', 'gradient')+button_gradient, simple_desc: this.trends_config(new_style, 'simple_desc', 'desc'), shop_content_list: this.get_shop_content_list(new_list, new_form), }); @@ -399,9 +397,7 @@ // 根据传递的值,显示不同的内容 style_config(typeface, size, color, type, theme) { let style = `font-weight:${typeface}; font-size: ${size * 2}rpx;`; - if (type == 'gradient') { - style += this.button_gradient; - } else if (type == 'title') { + if (type == 'title') { if (['1', '6'].includes(theme)) { style += `line-height: ${size}px;height: ${size}px;color: ${color};`; } else if (['0', '2', '3', '4', '5'].includes(theme)) { @@ -556,6 +552,6 @@ } .badge-style { top: -20rpx; - right: 0; + right: 10rpx; }