From 9f51e3c2d60c5ab6470d62301f9c9ac64c102c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Tue, 27 Aug 2024 16:06:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/base/icon/index.vue | 2 +- .../common/product-show-config/index.vue | 46 +++++------------- src/components/model-shop-list/index.vue | 48 +++---------------- .../model-shop-list-styles.vue | 13 +++-- .../model-shop-tabs-styles.vue | 13 +++-- .../components/main/default/shop-list.ts | 12 ++++- .../components/main/default/shop-tabs.ts | 12 ++++- 7 files changed, 62 insertions(+), 84 deletions(-) diff --git a/src/components/base/icon/index.vue b/src/components/base/icon/index.vue index 3392437e..9247ab8f 100644 --- a/src/components/base/icon/index.vue +++ b/src/components/base/icon/index.vue @@ -1,5 +1,5 @@ - + diff --git a/src/components/common/product-show-config/index.vue b/src/components/common/product-show-config/index.vue index 5ec9a386..901d0a39 100644 --- a/src/components/common/product-show-config/index.vue +++ b/src/components/common/product-show-config/index.vue @@ -15,32 +15,19 @@ - - - - - {{ item.name }} - - - {{ item.name }} - - - - - - - - - - - + + + + {{ item.name }} + + + + + + + - - - {{ item.name }} - - {{ item.name }} @@ -75,19 +62,12 @@ const base_list = { { name: '原价单位', value: 'original_price_unit' }, ], shopping_button_list: [ - { name: '购买', value: '0' }, - { name: '立即购买', value: '1' }, - { name: '添加', value: '2' }, - { name: '购物车', value: '3' }, + { name: '文字', value: 'text' }, + { name: 'icon', value: 'icon' }, ], shopping_cart_list: [ { name: '进入商品详情页', value: '0' }, { name: '商品加购', value: '1' } - ], - shopping_button_size: [ - { name: '大', value: '0' }, - { name: '中', value: '1' }, - { name: '小', value: '2' }, ] }; diff --git a/src/components/model-shop-list/index.vue b/src/components/model-shop-list/index.vue index 3877ff98..dee93848 100644 --- a/src/components/model-shop-list/index.vue +++ b/src/components/model-shop-list/index.vue @@ -52,17 +52,11 @@ - - 购买 - - - 立即购买 - - - + + {{ form.shop_button_text }} - + @@ -85,17 +79,11 @@ - - 购买 - - - 立即购买 - - - + + {{ form.shop_button_text }} - + @@ -311,26 +299,6 @@ const text_line = computed(() => { const is_show = (index: string) => { return form.value.is_show.includes(index); }; -// 按钮大小设置 -const button_size = computed(() => { - let button_size = '22px'; - if (form.value.shop_button_size == '0') { - button_size = '27px'; - } else if (form.value.shop_button_size == '2') { - button_size = '18px'; - } - return button_size; -}); -// 不同大小下的icon显示 -const shop_icon_size = computed(() => { - let size = '8'; - if (form.value.shop_button_size == '0') { - size = '15'; - } else if (form.value.shop_button_size == '1') { - size = '10'; - } - return size; -}); // 根据传递的参数,从对象中取值 const trends_config = (key: string, type?: string) => { return style_config(new_style.value[`shop_${key}_typeface`], new_style.value[`shop_${key}_size`], new_style.value[`shop_${key}_color`], type); @@ -393,10 +361,6 @@ const style_container = computed(() => { border-top-right-radius: 1rem; padding: 0 1rem 0 0; } -.shopping_button { - height: v-bind(button_size); - line-height: v-bind(button_size); -} .two-columns { width: calc((100% - v-bind(two_columns)) / 2); } diff --git a/src/components/model-shop-list/model-shop-list-styles.vue b/src/components/model-shop-list/model-shop-list-styles.vue index 3ed4d2f5..c2704878 100644 --- a/src/components/model-shop-list/model-shop-list-styles.vue +++ b/src/components/model-shop-list/model-shop-list-styles.vue @@ -51,9 +51,16 @@ - - - + + + + + + + + + + diff --git a/src/components/model-shop-tabs/model-shop-tabs-styles.vue b/src/components/model-shop-tabs/model-shop-tabs-styles.vue index 3743276a..e3be4d5d 100644 --- a/src/components/model-shop-tabs/model-shop-tabs-styles.vue +++ b/src/components/model-shop-tabs/model-shop-tabs-styles.vue @@ -63,9 +63,16 @@ - - - + + + + + + + + + + diff --git a/src/layout/components/main/default/shop-list.ts b/src/layout/components/main/default/shop-list.ts index 766d2217..a6c747fb 100644 --- a/src/layout/components/main/default/shop-list.ts +++ b/src/layout/components/main/default/shop-list.ts @@ -14,6 +14,8 @@ interface DefaultProductList { is_show: string[]; is_shop_show: boolean; shop_type: string; + shop_button_text: string; + shop_button_icon_class: string; shop_button_effect: string; shop_button_size: string; }; @@ -40,6 +42,9 @@ interface DefaultProductList { shop_button_typeface:string; shop_button_size: number; shop_button_color: color_list[]; + shop_button_text_color: string, + shop_icon_size: number; + shop_icon_color: string; common_style: object; }; } @@ -57,7 +62,9 @@ const defaultProductList: DefaultProductList = { sort_rules: '0', is_show: ['title', 'plugins_view_icon', 'price', 'sales_count', 'original_price'], is_shop_show: true, - shop_type: '0', + shop_type: 'text', + shop_button_text: '购买', + shop_button_icon_class: '', shop_button_effect: '0', shop_button_size: '1', }, @@ -111,6 +118,9 @@ const defaultProductList: DefaultProductList = { color_percentage: '' } ], + shop_button_text_color: '#fff', + shop_icon_size: 10, + shop_icon_color: "#fff", common_style: { ...defaultCommon, padding: 10, padding_top: 10, padding_bottom: 10, padding_left: 10, padding_right: 10 }, }, }; diff --git a/src/layout/components/main/default/shop-tabs.ts b/src/layout/components/main/default/shop-tabs.ts index 317659fe..997ac850 100644 --- a/src/layout/components/main/default/shop-tabs.ts +++ b/src/layout/components/main/default/shop-tabs.ts @@ -22,6 +22,8 @@ interface DefaultProductList { is_shop_show: boolean; is_price_solo: boolean; shop_type: string; + shop_button_text: string; + shop_button_icon_class: string; shop_button_effect: string; shop_button_size: string; }; @@ -56,6 +58,9 @@ interface DefaultProductList { shop_button_typeface:string; shop_button_size: number; shop_button_color: color_list[]; + shop_button_text_color: string, + shop_icon_size: number; + shop_icon_color: string; common_style: object; }; } @@ -73,7 +78,9 @@ const defaultProductList: DefaultProductList = { is_show: ['title', 'plugins_view_icon', 'price', 'sales_count', 'original_price'], is_shop_show: true, is_price_solo: true, - shop_type: '0', + shop_type: 'text', + shop_button_text: '购买', + shop_button_icon_class: '', shop_button_effect: '0', shop_button_size: '1', }, @@ -135,6 +142,9 @@ const defaultProductList: DefaultProductList = { color_percentage: '' } ], + shop_button_text_color: '#fff', + shop_icon_size: 10, + shop_icon_color: "#fff", common_style: { ...defaultCommon, padding: 10, padding_top: 10, padding_bottom: 10, padding_left: 10, padding_right: 10 }, }, };