123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- Component({
- data: {
- selected: 0,
- color: "#666",
- selectedColor: "#1fe4dc",
- backgroundColor: "#fafafa",
- borderStyle: "white",
- list: [{
- "pagePath": "/pages/index/index",
- iconPath: "../static/images/ic_menu_choice_nor.png",
- selectedIconPath: "../static/images/ic_menu_choice_pressed.png",
- "text": "首页"
- },
- {
- "pagePath": "/pages/catalog/catalog",
- iconPath: "../static/images/ic_menu_sort_nor.png",
- selectedIconPath: "../static/images/ic_menu_sort_pressed.png",
- "text": "分类"
- },
- {
- "pagePath": "/pages/cart/cart",
- iconPath: "../static/images/ic_menu_shoping_nor.png",
- selectedIconPath: "../static/images/ic_menu_shoping_pressed.png",
- "text": "购物车"
- },
- {
- "pagePath": "/pages/ucenter/index/index",
- iconPath: "../static/images/ic_menu_me_nor.png",
- selectedIconPath: "../static/images/ic_menu_me_pressed.png",
- "text": "我的"
- }]
- },
- attached() {
- },
- onShow(){
- },
- methods: {
- switchTab(e) {
- const data = e.currentTarget.dataset
- const url = data.path
- wx.switchTab({url})
- setTimeout(()=>{
- this.setData({
- selected: data.index
- })
- })
- }
- }
- })
|