MenuBox.js
2.01 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Component({
data: {},
properties: {
menuList: {
type: Array,
value: []
},
boxType: Number,//0 省心出行 1养车服务
},
methods: {
toJump(e) {
const { item } = e.currentTarget.dataset
console.log(item);
const { boxType } = this.data
if (boxType == 1) {
this.jump(e)
} else if (boxType == 0) {
this.toNewPage(e)
}
},
// 养车服务跳转
jump(e) {
let {
url,
item
} = e.currentTarget.dataset
if (item.tabBar) {
wx.p.router.getPageInstance().changeTabBar({
detail: 2
})
return
}
if (url) wx.p.router.go(`${url}`)
if (item) {
if (item.h5) wx.p.router.jumpH5(item.h5)
else {
if (item.url == 'navigation') wx.p.router.go(item.url)
else {
if (item.url) wx.p.router.go(item.url, item)
else wx.showModal({
content: '即将上线,敬请期待',
confirmText: '知道了',
showCancel: false,
confirmColor: '#F13C3D'
})
}
}
}
},
// 省心出行
toNewPage(e) {
const { item } = e.currentTarget.dataset
let url = '',para={}
if (item.supplier == 'GL_ROAD_RESCUE') {
url = '/packageEquity/pages/road/index/index'
} else if (item.appearance == 1) {
para = {
supplier: item.supplier,
brandName: item.brandName,
location: true
}
const temp = JSON.stringify(para)
url = '/packageSaveMoney/pages/detail/detail'
} else if (item.appearance == 2) {
para = {
supplier: item.supplier,
brandName: item.brandName,
icon: item.equityIcon
}
const temp = JSON.stringify(para)
url = '/packageSaveMoney/pages/chargeDetail/chargeDetail'
}
wx.p.router.go(url, {param:para,notIntercept:true})
// wx.navigateTo({
// url
// })
}
}
})