From c2d3ca7a6ae4d6dd756d189951b27ded065c8940 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 10 Oct 2024 20:32:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B6=E9=83=A8=E5=AF=BC=E8=88=AA=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 30 ++++++++++++++++++++++++++---- components/diy/diy.vue | 9 +++++---- pages.json | 2 -- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/App.vue b/App.vue index c0ae5a28..63ae44b1 100644 --- a/App.vue +++ b/App.vue @@ -7,12 +7,12 @@ data: { // 基础配置 // 数据接口请求地址 - request_url: 'http://shopxo.com/', - // request_url:'https://new.shopxo.vip/', + //request_url: 'http://shopxo.com/', + request_url:'https://new.shopxo.vip/', // 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/) - static_url: 'http://shopxo.com/', - // static_url:'https://new.shopxo.vip/', + //static_url: 'http://shopxo.com/', + static_url:'https://new.shopxo.vip/', // 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立) system_type: 'default', @@ -2857,6 +2857,25 @@ }); }, + // 设置导航背景色和颜色 + set_navigation_bar_color(is_white = null) { + var color = '#000'; + var bg_color = '#fff'; + var arr = [ + 'pages/index/index', + 'pages/diy/diy', + ]; + var page = this.current_page(false); + if(is_white === true || (is_white === null && arr.indexOf(page) != -1)) { + color = '#ffffff'; + bg_color = '#000000'; + } + uni.setNavigationBarColor({ + frontColor: color, + backgroundColor: bg_color, + }); + }, + // 底部浮动按钮样式处理 bottom_fixed_style_handle() { var obj = this.get_page_object(); @@ -2885,6 +2904,9 @@ // 页面顶部导航标题设置 this.set_pages_navigation_bar_title(); + + // 设置导航背景色和颜色 + this.set_navigation_bar_color(); }, }, diff --git a/components/diy/diy.vue b/components/diy/diy.vue index 06c8b8d0..3634c2ee 100644 --- a/components/diy/diy.vue +++ b/components/diy/diy.vue @@ -283,11 +283,12 @@ temp_sticky_top: this.sticky_top, temp_header_top: this.header_top, }); + // 设置顶部导航的默认颜色 - uni.setNavigationBarColor({ - frontColor: parseInt(this.propValue.header.com_data.style.function_buttons_type) == 0 ? '#000000' : '#ffffff', - backgroundColor: 'transparent', - }); + this.propValue.header.com_data.style.function_buttons_type = 1; + app.globalData.set_navigation_bar_color(parseInt(this.propValue.header.com_data.style.function_buttons_type || 0) == 1); + + // 缓存数据 uni.setStorageSync(this.cache_key + this.tabs_home_id, this.propValue.diy_data); }, // 顶部导航沉浸模式回调 diff --git a/pages.json b/pages.json index 36951971..b5672453 100644 --- a/pages.json +++ b/pages.json @@ -11,7 +11,6 @@ "titlePenetrate": "YES", // #endif "enablePullDownRefresh": true, - "navigationBarTextStyle": "white", "navigationBarTitleText": "" } }, @@ -76,7 +75,6 @@ "titlePenetrate": "YES", // #endif "enablePullDownRefresh": true, - "navigationBarTextStyle": "white", "navigationBarTitleText": "" } }