From 73fbae1fd4c06ead6ab203e02070d417426b2e4a Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Fri, 24 Nov 2023 09:42:01 +0800 Subject: [PATCH] =?UTF-8?q?app=E9=80=82=E9=85=8D=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 2 +- pages/index/index.vue | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/pages.json b/pages.json index 4ff29455..457ee481 100644 --- a/pages.json +++ b/pages.json @@ -946,7 +946,7 @@ { "path": "detail/detail", "style": { - // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU + // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || APP "navigationStyle": "custom", // #endif // #ifdef MP-ALIPAY diff --git a/pages/index/index.vue b/pages/index/index.vue index 75e154b2..be21bf37 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -490,13 +490,8 @@ // 轮播数据处理 if (this.load_status == 0) { - if (data.banner_list && data.banner_list.length > 0 && (data.banner_list[0]['bg_color'] || null) != null) { - upd_data['top_content_bg_color'] = 'background: linear-gradient(180deg, ' + data.banner_list[0].bg_color + ' 0%, #f5f5f5 80%);'; - upd_data['top_content_search_bg_color'] = 'background: linear-gradient(180deg, ' + data.banner_list[0].bg_color + ' 0%, #f5f5f5 460%);'; - } else { - upd_data['top_content_bg_color'] = 'background: linear-gradient(180deg, ' + theme_color + ' 0%, #f5f5f5 80%);'; - upd_data['top_content_search_bg_color'] = 'background: linear-gradient(180deg, ' + theme_color + ' 0%, #f5f5f5 460%);'; - } + var color = (data.banner_list && data.banner_list.length > 0 && (data.banner_list[0]['bg_color'] || null) != null) ? data.banner_list[0].bg_color : theme_color; + this.change_banner(color); } // 搜索框宽度处理 @@ -617,13 +612,13 @@ // 轮播改变、背景色处理 change_banner(color) { - if ((color || null) != null) { - this.top_content_bg_color = 'background: linear-gradient(180deg, ' + color + ' 0%, #f5f5f5 80%);'; - this.top_content_search_bg_color = 'background: linear-gradient(180deg, ' + color + ' 0%, #f5f5f5 460%);'; - } else { - this.top_content_bg_color = 'background: linear-gradient(180deg, ' + this.theme_color + ' 0%, #f5f5f5 80%);'; - this.top_content_search_bg_color = 'background: linear-gradient(180deg, ' + this.theme_color + ' 0%, #f5f5f5 460%);'; + if ((color || null) == null) { + color = this.theme_color; } + this.setData({ + top_content_bg_color: 'background: linear-gradient(180deg, ' + color + ' 0%, #f5f5f5 80%);', + top_content_search_bg_color: 'background: linear-gradient(180deg, ' + color + ' 0%, #f5f5f5 460%);', + }); }, // 搜索icon扫码事件