微信小程序重写tabbar底部导航,供大家参考,具体内容如下

1.app.js代码如下:
editTabBar: function() {
var e = this.globalData.tabbar, a = getCurrentPages(), t = a[a.length - 1], s = t.__route__;
0 != s.indexOf("/") && (s = "/" + s);
for (var n in e.list) e.list[n].selected = !1, e.list[n].pagePath == s && (e.list[n].selected = !0);
t.setData({
tabbar: e
});
},
tabBar: {
color: "#123",
selectedColor: "#1ba9ba",
borderStyle: "#1ba9ba",
backgroundColor: "#fff",
list: [ {
pagePath: "/we7/pages/index/index",
iconPath: "/we7/resource/icon/home.png",
selectedIconPath: "/we7/resource/icon/homeselect.png",
text: "首页"
}, {
pagePath: "/we7/pages/user/index/index",
iconPath: "/we7/resource/icon/user.png",
selectedIconPath: "/we7/resource/icon/userselect.png",
text: "我的"
} ]
},
globalData: {
userInfo: null,
tabbar: {
color: "#333",
selectedColor: "#d0501f",
backgroundColor: "#ffffff",
borderStyle: "#d5d5d5",
list: [ {
pagePath: "/pages/seller/gzt",
text: "工作台",
iconPath: "/pages/images/gzt@3x.png",
selectedIconPath: "/pages/images/gztxz@3x.png",
selected: !0
}, {
pagePath: "/pages/seller/cp/cplb",
text: "商品",
iconPath: "/pages/images/dbdc.png",
selectedIconPath: "/pages/images/dbdcxz.png",
selected: !1
},
position: "bottom"
}
},
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。