顶部导航颜色设置

master
gongfuxiang 2024-10-10 20:32:19 +08:00
parent 10dafc898c
commit c2d3ca7a6a
3 changed files with 31 additions and 10 deletions

30
App.vue
View File

@ -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/',
// publicpublichttps://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();
},
},

View File

@ -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);
},
//

View File

@ -11,7 +11,6 @@
"titlePenetrate": "YES",
// #endif
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarTitleText": ""
}
},
@ -76,7 +75,6 @@
"titlePenetrate": "YES",
// #endif
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarTitleText": ""
}
}