index.js
1.82 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
80
81
82
83
84
85
86
87
88
import { IMG_URL } from '~/config';
Page({
data: {
list: [{
id: 1,
}, {
id: 2,
}, {
id: 3,
}, {
id: 4,
}, {
id: 5,
},],
showModal: false,
IMG_URL: IMG_URL
},
onShow() {
this.toCheckMember()
},
async toJump(e) {
const flag = await this.checkLogin()
if (flag) return
const { id } = e.currentTarget.dataset
let url = ''
const shareCode = '5759S2m7h'
switch (id) {
case 1:
url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}&extra=wuye`
break;
case 2:
url = `plugin://collectionPlugin/mdlHome?shareCode=${shareCode}&extra=wuye`
break;
case 3:
url = `plugin://collectionPlugin/naixueHome?shareCode=${shareCode}&extra=wuye`
break;
case 4:
url = `plugin://ticketPlugin/home?shareCode=${shareCode}&reLocation=true&extra=wuye`
break;
case 5:
url = `plugin://express-plugin/home?shareCode=${shareCode}&extra=wuye`
break;
default:
break;
}
wx.navigateTo({
url,
})
},
// 检查是否已登录/会员
async checkLogin() {
const authStatus = await wx.p.router.intercept()
if (authStatus) return authStatus
if (!this.open) {
this.setData({
showModal: true
})
return true
}
return false
},
async toCheckMember() {
const authStatus = await wx.p.router.intercept(false)
if (authStatus) return
wx.p.api.equityApi.checkOpenMember().then(res => {
let flag = false
if (res.code == 0 && res.data) {
flag = true
}
this.open = flag
})
},
closeModal() {
this.setData({
showModal: false,
});
},
toOpenPage() {
wx.p.router.go('/packageSaveMoney/pages/open/open', {
notIntercept: true
})
},
})