|
- let ifStoreApp = 0;
- Component({
- data: {
- selected: 0,
- "color": "#abb1be",
- "selectedColor": "#FD782D",
- "list": [
- {
- "pagePath": "/index/index",
- "iconPath": "../assets/images/home.png",
- "selectedIconPath": "../assets/images/home-a.png",
- "text": "首页"
- },
- {
- "pagePath": "/index/user",
- "iconPath": "../assets/images/user.png",
- "selectedIconPath": "../assets/images/user-a.png",
- "text": "我的"
- }
- ]
- },
- attached() {
- if (ifStoreApp==1){
- this.setData({
- list: [
- {
- "pagePath": "/index/index",
- "iconPath": "../assets/images/home.png",
- "selectedIconPath": "../assets/images/home-a.png",
- "text": "首页"
- },
- {
- "pagePath": "/index/user",
- "iconPath": "../assets/images/user.png",
- "selectedIconPath": "../assets/images/user-a.png",
- "text": "我的"
- }
- ]
- })
- } else if (ifStoreApp == 2) {
- this.setData({
- list: [
- {
- "pagePath": "/index/index",
- "iconPath": "../assets/images/home.png",
- "selectedIconPath": "../assets/images/home-a.png",
- "text": "首页"
- },
- {
- "pagePath": "/index/searchbar",
- "iconPath": "../assets/images/mendian.png",
- "selectedIconPath": "../assets/images/mendian-a.png",
- "text": "门店"
- },
- {
- "pagePath": "/index/user",
- "iconPath": "../assets/images/user.png",
- "selectedIconPath": "../assets/images/user-a.png",
- "text": "我的"
- }
- ]
- })
- }
- },
- methods: {
- switchTab(e) {
- const data = e.currentTarget.dataset;
- const url = data.path;
- wx.switchTab({url});
- this.setData({
- selected: data.index
- })
- }
- }
- })
|