From ce3107cc3857f1dbc0a1d9f8bf513d8f05466dbe 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:55:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/activity.vue | 29 ++++++++++++++++++++++++++--- components/diy/diy.vue | 2 +- components/diy/goods-list.vue | 5 +++++ components/diy/search.vue | 13 +++---------- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/components/diy/activity.vue b/components/diy/activity.vue index 46522952..5510cf8f 100644 --- a/components/diy/activity.vue +++ b/components/diy/activity.vue @@ -2,7 +2,7 @@ - + @@ -27,7 +27,7 @@ {{ activity_item.describe }} - + {{ item }} @@ -36,7 +36,7 @@ - + @@ -68,6 +68,10 @@ type: [String, Number], default: '', }, + propDiyIndex: { + type: Number, + default: 0, + }, // 组件渲染的下标 propIndex: { type: Number, @@ -84,6 +88,7 @@ form: {}, new_style: {}, list: [], + activity_index: 0, content_img_radius: '', // 图片圆角设置 main_theme: '', // 选择的风格 content_outer_spacing: '', // 商品间距 @@ -178,6 +183,7 @@ new_style: new_style, list: new_list, new_scale: scale, + activity_index: 0, // 每次更新的时候重置筛选的index content_img_radius: radius_computer(new_style.activity_main.img_radius), // 图片圆角设置 main_theme: new_form.main_theme, // 选择的风格 title_style: this.trends_config('title', new_style) + 'word-break: break-all;', @@ -218,6 +224,23 @@ get_content_style(new_style) { return padding_computer(new_style.activity_main.activity_main_right_content); }, + goods_buy_event(index, goods = {}, params = {}, back_data = null) { + this.setData({ + activity_index: back_data.activity_index || 0 + }) + this.$emit('goods_buy_event', index, goods, params, back_data); + }, + goods_cart_back_event(e) { + if ((this.$refs[`diy_goods_list${this.activity_index}`][0] || null) != null) { + this.$refs[`diy_goods_list${this.activity_index}`][0].goods_cart_back_event(e); + } + }, + serch_button_event(e) { + const keywords = e.currentTarget.dataset.value || ''; + if (!isEmpty(keywords)) { + app.globalData.url_open('/pages/goods-search/goods-search?keywords=' + keywords); + } + }, url_event(e) { app.globalData.url_event(e); }, diff --git a/components/diy/diy.vue b/components/diy/diy.vue index 05f270bd..06cdd7e0 100644 --- a/components/diy/diy.vue +++ b/components/diy/diy.vue @@ -44,7 +44,7 @@ - + diff --git a/components/diy/goods-list.vue b/components/diy/goods-list.vue index b116b6c8..31436d89 100644 --- a/components/diy/goods-list.vue +++ b/components/diy/goods-list.vue @@ -222,6 +222,10 @@ propIsUseAuto: { type: Boolean, default: true, + }, + propActivityIndex: { + type: Number, + default: 0 } }, data() { @@ -554,6 +558,7 @@ { index: index, split_index: split_index, + activity_index: this.propActivityIndex, pos: e, } ); diff --git a/components/diy/search.vue b/components/diy/search.vue index 3d18f337..ba465b71 100644 --- a/components/diy/search.vue +++ b/components/diy/search.vue @@ -178,6 +178,7 @@ export default { box_style: this.get_box_style(new_style, new_form), // 搜索框设置 search_box_style: `border: 2rpx solid ${new_style.search_border == '#fff' ? '#eee' : new_style.search_border};`, search_button_style: this.get_search_button_style(new_form, new_style), // 搜索按钮显示 + keywords: new_form.hot_word_list.length > 0 ? (new_form.hot_word_list[0].value || '') : '', right_icon_style: `border-radius: 0px ${ new_style.search_border_radius?.radius_top_right * 2 || 0 }rpx ${ new_style.search_border_radius?.radius_bottom_right * 2 || 0 }rpx 0px;`, }); }, @@ -214,15 +215,6 @@ export default { } return background_computer(data) + padding_computer(new_style?.search_botton_padding || this.button_padding) + 'box-sizing: border-box;'; }, - // get_style(new_style) { - // let common_styles = ''; - // if (new_style.text_style == 'italic') { - // common_styles += `font-style: italic`; - // } else if (new_style.text_style == '500') { - // common_styles += `font-weight: 500`; - // } - // return common_styles; - // }, get_box_style(new_style, form) { let style = `background: ${ new_style?.search_bg_color || '' };border: 2rpx solid ${new_style.search_border}; ${radius_computer(new_style.search_border_radius)};box-sizing: border-box;`; if (form.positioning_name_float == '1' && this.propSearchType == 'header') { @@ -240,7 +232,8 @@ export default { }, serch_button_event() { if (!isEmpty(this.keywords)) { - app.globalData.url_open('pages/goods-search/goods-search?keywords=' + this.keywords); + app.globalData.url_open('/pages/goods-search/goods-search?keywords=' + this.keywords); + return; } app.globalData.url_open('/pages/goods-search-start/goods-search-start?keywords=' + this.keywords); },