Merge branch 'dev' of gitee.com:zongzhige/shopxo-uniapp into dev-sws

master
sws 2023-09-26 14:58:23 +08:00
commit dc205becef
2 changed files with 66 additions and 35 deletions

91
App.vue
View File

@ -92,7 +92,7 @@
// blue #1677ff
// brown #8B4513
// purple #623cec
default_theme: 'purple',
default_theme: 'brown',
},
/**
* 启动参数处理
@ -1749,6 +1749,37 @@
}, 100);
}
},
//
// is_light false, true
get_theme_color(is_light = false) {
let color_obj = {
//
yellow: '#f6c133', //
red: '#ff0036', //
black: '#333333', //
blue: '#1677ff', //
green: '#20a53a', // 绿
orange: '#fe6f04', //
brown: '#8B4513', //
purple: '#623cec', //
//
yellow_light: '#ffebd2', //
red_light: '#ffdbe2', //
black_light: '#dcdcdc', //
blue_light: '#d1e4ff', //
green_light: '#cce8d2', // 绿
orange_light: '#fde4d1', //
brown_light: '#eadcd2', //
purple_light: '#d6cbfb', //
};
var theme = this.get_theme_value();
if (is_light) {
theme += '_light';
}
return color_obj[theme];
},
//
get_theme_value() {
@ -1778,35 +1809,33 @@
require(`@/common/css/theme/${theme}.css`);
},
//
// is_light false, true
get_theme_color(is_light = false) {
let color_obj = {
//
yellow: '#f6c133', //
red: '#ff0036', //
black: '#333333', //
blue: '#1677ff', //
green: '#20a53a', // 绿
orange: '#fe6f04', //
brown: '#8B4513', //
purple: '#623cec', //
//
yellow_light: '#ffebd2', //
red_light: '#ffdbe2', //
black_light: '#dcdcdc', //
blue_light: '#d1e4ff', //
green_light: '#cce8d2', // 绿
orange_light: '#fde4d1', //
brown_light: '#eadcd2', //
purple_light: '#d6cbfb', //
};
//
set_tabbar() {
//
var theme = this.get_theme_value();
if (is_light) {
theme += '_light';
}
return color_obj[theme];
//
uni.setTabBarStyle({
selectedColor: this.get_theme_color(),
});
//
uni.setTabBarItem({
index: 0,
selectedIconPath: 'static/images/'+theme+'/tabbar/home.png',
});
uni.setTabBarItem({
index: 1,
selectedIconPath: 'static/images/'+theme+'/tabbar/category.png',
});
uni.setTabBarItem({
index: 2,
selectedIconPath: 'static/images/'+theme+'/tabbar/cart.png',
});
uni.setTabBarItem({
index: 3,
selectedIconPath: 'static/images/'+theme+'/tabbar/user.png',
});
},
//
@ -1860,7 +1889,7 @@
} else {
return uri + separator + key + '=' + value;
}
},
}
},
//
onLaunch(params) {},
@ -1880,6 +1909,8 @@
// #endif
//
this.globalData.require_theme();
//
this.globalData.set_tabbar();
},
//
onHide() {

View File

@ -973,30 +973,30 @@
},
"tabBar": {
"color": "#8a8a8a",
"selectedColor": "#f6c133",
"selectedColor": "#8a8a8a",
"backgroundColor": "#fff",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/images/common/tabbar/home.png",
"selectedIconPath": "static/images/yellow/tabbar/home.png",
"selectedIconPath": "static/images/common/tabbar/home.png",
"text": "首页"
},
{
"pagePath": "pages/goods-category/goods-category",
"iconPath": "static/images/common/tabbar/category.png",
"selectedIconPath": "static/images/yellow/tabbar/category.png",
"selectedIconPath": "static/images/common/tabbar/category.png",
"text": "分类"
},
{
"pagePath": "pages/cart/cart",
"iconPath": "static/images/common/tabbar/cart.png",
"selectedIconPath": "static/images/yellow/tabbar/cart.png",
"selectedIconPath": "static/images/common/tabbar/cart.png",
"text": "购物车"
},
{
"pagePath": "pages/user/user",
"iconPath": "static/images/common/tabbar/user.png",
"selectedIconPath": "static/images/yellow/tabbar/user.png",
"selectedIconPath": "static/images/common/tabbar/user.png",
"text": "我的"
}
]