修改页面tabbar

This commit is contained in:
wangxiaowei
2025-12-12 22:47:01 +08:00
parent 23cbc1625d
commit 63b6abc5f7
8 changed files with 14 additions and 26 deletions

20
main.js
View File

@ -461,31 +461,25 @@ Vue.prototype.setTabBarLinks = function(vars, theme) {
] ]
uni.setTabBarStyle({ uni.setTabBarStyle({
color: '#333333', color: '#333333',
selectedColor: color[theme], selectedColor: '#365A9A',
}) })
uni.setTabBarItem({ uni.setTabBarItem({
index: 0, index: 0,
text: '首页', text: '首页',
iconPath: 'static/tabbar/home.png', iconPath: 'static/tabbar/home_7.png',
selectedIconPath: 'static/tabbar/home_' + theme + '.png' selectedIconPath: 'static/tabbar/home_8.png'
}) })
uni.setTabBarItem({ uni.setTabBarItem({
index: 1, index: 1,
text: '分类', text: '分类',
iconPath: 'static/tabbar/category.png', iconPath: 'static/tabbar/category_7.png',
selectedIconPath: 'static/tabbar/category_' + theme + '.png' selectedIconPath: 'static/tabbar/category_8.png'
}) })
uni.setTabBarItem({ uni.setTabBarItem({
index: 2, index: 2,
text: '购物车',
iconPath: 'static/tabbar/cart.png',
selectedIconPath: 'static/tabbar/cart_' + theme + '.png'
})
uni.setTabBarItem({
index: 3,
text: '我的', text: '我的',
iconPath: 'static/tabbar/user.png', iconPath: 'static/tabbar/user_7.png',
selectedIconPath: 'static/tabbar/user_' + theme + '.png' selectedIconPath: 'static/tabbar/user_8.png'
}) })
} else { } else {
uni.hideTabBar(); uni.hideTabBar();

View File

@ -572,31 +572,25 @@ export default {
let color = ['#ff5704', '#19ad57', '#ffcc00', '#1774ff', '#e4e4e4', '#c8ba97', '#623ceb']; let color = ['#ff5704', '#19ad57', '#ffcc00', '#1774ff', '#e4e4e4', '#c8ba97', '#623ceb'];
uni.setTabBarStyle({ uni.setTabBarStyle({
color: '#333333', color: '#333333',
selectedColor: color[theme] selectedColor: '#365A9A'
}); });
uni.setTabBarItem({ uni.setTabBarItem({
index: 0, index: 0,
text: '首页', text: '首页',
iconPath: 'static/tabbar/home.png', iconPath: 'static/tabbar/home_7.png',
selectedIconPath: 'static/tabbar/home_' + theme + '.png' selectedIconPath: 'static/tabbar/home_8.png'
}); });
uni.setTabBarItem({ uni.setTabBarItem({
index: 1, index: 1,
text: '分类', text: '分类',
iconPath: 'static/tabbar/category.png', iconPath: 'static/tabbar/category_7.png',
selectedIconPath: 'static/tabbar/category_' + theme + '.png' selectedIconPath: 'static/tabbar/category_8.png'
}); });
uni.setTabBarItem({ uni.setTabBarItem({
index: 2, index: 2,
text: '购物车',
iconPath: 'static/tabbar/cart.png',
selectedIconPath: 'static/tabbar/cart_' + theme + '.png'
});
uni.setTabBarItem({
index: 3,
text: '我的', text: '我的',
iconPath: 'static/tabbar/user.png', iconPath: 'static/tabbar/user_7.png',
selectedIconPath: 'static/tabbar/user_' + theme + '.png' selectedIconPath: 'static/tabbar/user_8.png'
}); });
} else { } else {
setTimeout(function() { setTimeout(function() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/tabbar/home_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/tabbar/home_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/tabbar/user_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/tabbar/user_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB