index.js
1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const App = getApp();
Component({
data: {
isIphoneX:App.globalData.isIphoneX,
show:true,
curClick: 1,
color: "#7A7E83",
selectedColor: "#3cc51f",
list: [{
"pagePath": "/index/index",
"iconPath": "../images/home.png",
"selectedIconPath": "../images/home-b.png",
"text": "集团首页",
"curr": 1
}, {
"pagePath": "/index/index2",
"iconPath": "../images/cong.png",
"selectedIconPath": "../images/cong-b.png",
"text": "店铺首页",
"curr": 2
}, {
"pagePath": "/index/me",
"iconPath": "../images/me.png",
"selectedIconPath": "../images/me-b.png",
"text": "我的",
"curr": 3
}]
},
attached() {
let userType = wx.getStorageSync('userrole_type');
if(userType==3){
this.setData({
curClick:2,
list:[
{
"pagePath": "/index/index2",
"iconPath": "../images/cong.png",
"selectedIconPath": "../images/cong-b.png",
"text": "店铺首页",
"curr": 2
},
{
"pagePath": "/index/me",
"iconPath": "../images/me.png",
"selectedIconPath": "../images/me-b.png",
"text": "我的",
"curr": 3
}]
})
}
},
methods: {
switchTab(e) {
const data = e.currentTarget.dataset
const url = data.path
wx.switchTab({
url
})
// this.setData({
// curClick: data.index
// })
}
}
})