@jetthai/cuora 1.1.74-ac → 1.1.74-cash
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/pre-commit +1 -1
- package/CHANGELOG.md +3 -7
- package/dist/bundle.mjs +589 -1400
- package/package.json +1 -1
- package/src/api/activity.js +0 -1
- package/src/api/auth.js +2 -2
- package/src/api/user.js +0 -5
- package/src/machine/activity/{friend_invite_friends_activity.js → affiliate_invite_friends_activity.js} +23 -23
- package/src/machine/activity/deposit_activity.js +2 -2
- package/src/machine/activity/fafafa_activity.js +12 -0
- package/src/machine/activity/index.js +2 -2
- package/src/machine/activity/invite_friends_activity.js +6 -6
- package/src/machine/activity/specify_turnover_activity.js +14 -1
- package/src/machine/auth.js +9 -9
- package/src/machine/common.js +4 -4
- package/src/machine/deposit/loadcard_vn.js +9 -34
- package/src/machine/game_favorite_v2.js +6 -2
- package/src/machine/game_v2_1.js +37 -12
- package/src/machine/index.js +0 -6
- package/src/machine/user_sign_up.js +10 -10
- package/src/request/request.js +9 -5
- package/src/machine/game.js +0 -285
- package/src/machine/game_favorite.js +0 -123
- package/src/machine/game_v2.js +0 -381
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -50,5 +50,4 @@ export default {
|
|
|
50
50
|
exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
|
|
51
51
|
collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
|
|
52
52
|
getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
|
|
53
|
-
getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
|
|
54
53
|
}
|
package/src/api/auth.js
CHANGED
|
@@ -31,8 +31,8 @@ export default {
|
|
|
31
31
|
},
|
|
32
32
|
isPublic: true,
|
|
33
33
|
}),
|
|
34
|
-
register: ({ channel, subchannel,
|
|
35
|
-
const params = pickBy({ channel, subchannel,
|
|
34
|
+
register: ({ channel, subchannel, referralCode, affiliate = null, reCaptchaToken, dt, ...rest }) => {
|
|
35
|
+
const params = pickBy({ channel, subchannel, referralCode, affiliate }, (value) => {
|
|
36
36
|
return value !== undefined && value !== null
|
|
37
37
|
})
|
|
38
38
|
const qs = Object.keys(params)
|
package/src/api/user.js
CHANGED
|
@@ -14,11 +14,6 @@ export default {
|
|
|
14
14
|
getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
|
|
15
15
|
getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
|
|
16
16
|
postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
|
|
17
|
-
getFriends: () => ({ url: 'friends', method: 'get' }),
|
|
18
|
-
getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
|
|
19
|
-
getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
|
|
20
|
-
getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
|
|
21
|
-
postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
|
|
22
17
|
passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
|
|
23
18
|
passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
|
|
24
19
|
passwordAcknowledge: (acknowledgeData) => ({ url: 'recovery/acknowledge', method: 'post', params: acknowledgeData, isPublic: true }),
|
|
@@ -6,14 +6,14 @@ export default function (request) {
|
|
|
6
6
|
const { appSecret } = request.config
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
9
|
-
id: '
|
|
9
|
+
id: 'affiliate_invite_friends_activity',
|
|
10
10
|
context: {
|
|
11
|
-
|
|
11
|
+
affiliateEnable: false,
|
|
12
12
|
activityNo: null,
|
|
13
13
|
bindingCode: null,
|
|
14
14
|
uidSite: null,
|
|
15
15
|
receiveNo: null,
|
|
16
|
-
|
|
16
|
+
affiliateCode: '',
|
|
17
17
|
commission: 0,
|
|
18
18
|
downLine: 0,
|
|
19
19
|
activeDownLine: 0,
|
|
@@ -27,10 +27,10 @@ export default function (request) {
|
|
|
27
27
|
states: {
|
|
28
28
|
fetching1: {
|
|
29
29
|
invoke: {
|
|
30
|
-
src: '
|
|
30
|
+
src: 'fetchAffiliateCode',
|
|
31
31
|
onDone: {
|
|
32
32
|
target: 'checking',
|
|
33
|
-
actions: '
|
|
33
|
+
actions: 'setAffiliateCode',
|
|
34
34
|
},
|
|
35
35
|
onError: {
|
|
36
36
|
target: 'fetching2',
|
|
@@ -38,11 +38,11 @@ export default function (request) {
|
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
checking: {
|
|
41
|
-
always: [{ target: 'fetching2', cond: '
|
|
41
|
+
always: [{ target: 'fetching2', cond: 'isAffiliateEnable' }, { target: 'idle' }],
|
|
42
42
|
},
|
|
43
43
|
fetching2: {
|
|
44
44
|
invoke: {
|
|
45
|
-
src: '
|
|
45
|
+
src: 'fetchAffiliateData',
|
|
46
46
|
onDone: {
|
|
47
47
|
target: 'idle',
|
|
48
48
|
actions: 'setInitialData',
|
|
@@ -54,7 +54,7 @@ export default function (request) {
|
|
|
54
54
|
},
|
|
55
55
|
idle: {
|
|
56
56
|
on: {
|
|
57
|
-
|
|
57
|
+
BIND_AFFILIATE_CODE: {
|
|
58
58
|
target: 'binding',
|
|
59
59
|
actions: ['setBindingCode', 'setUidSite', 'setActivityNo'],
|
|
60
60
|
},
|
|
@@ -71,7 +71,7 @@ export default function (request) {
|
|
|
71
71
|
},
|
|
72
72
|
binding: {
|
|
73
73
|
invoke: {
|
|
74
|
-
src: '
|
|
74
|
+
src: 'postAffiliate',
|
|
75
75
|
onDone: {
|
|
76
76
|
target: 'awarding',
|
|
77
77
|
},
|
|
@@ -115,10 +115,10 @@ export default function (request) {
|
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
actions: {
|
|
118
|
-
|
|
119
|
-
const {
|
|
118
|
+
setAffiliateCode: assign((context, event) => {
|
|
119
|
+
const { affiliateCode = '' } = event.data || {}
|
|
120
120
|
return {
|
|
121
|
-
|
|
121
|
+
affiliateCode,
|
|
122
122
|
}
|
|
123
123
|
}),
|
|
124
124
|
setInitialData: assign((context, event) => {
|
|
@@ -175,20 +175,20 @@ export default function (request) {
|
|
|
175
175
|
const { page } = context.levelDownLine
|
|
176
176
|
return page.current < page.total
|
|
177
177
|
},
|
|
178
|
-
|
|
178
|
+
isAffiliateEnable: (context, event) => context.affiliateEnable,
|
|
179
179
|
},
|
|
180
180
|
services: {
|
|
181
|
-
|
|
182
|
-
return await request.send(user.
|
|
181
|
+
fetchAffiliateCode: async () => {
|
|
182
|
+
return await request.send(user.getAffiliate())
|
|
183
183
|
},
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
const [
|
|
188
|
-
return [
|
|
184
|
+
fetchAffiliateData: async (context, event) => {
|
|
185
|
+
const affiliateHomeAPI = request.send(user.getAffiliateHome())
|
|
186
|
+
const affiliateDashboard = request.send(user.getAffiliateDashboard())
|
|
187
|
+
const [affiliateHomeData, affiliateDashboardData] = await Promise.all([affiliateHomeAPI, affiliateDashboard])
|
|
188
|
+
return [affiliateHomeData, affiliateDashboardData]
|
|
189
189
|
},
|
|
190
|
-
|
|
191
|
-
return await request.send(user.
|
|
190
|
+
postAffiliate: async (context, event) => {
|
|
191
|
+
return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
|
|
192
192
|
},
|
|
193
193
|
awardPrize: async (context, event) => {
|
|
194
194
|
const { activityNo, uidSite, bindingCode } = context
|
|
@@ -199,7 +199,7 @@ export default function (request) {
|
|
|
199
199
|
const { currentLevel, page, levelDownLine } = context
|
|
200
200
|
const copiedObj = JSON.parse(JSON.stringify(levelDownLine))
|
|
201
201
|
const copiedList = copiedObj.data
|
|
202
|
-
const resopnseData = await request.send(user.
|
|
202
|
+
const resopnseData = await request.send(user.getAffiliateDashboardList({ level: currentLevel, page, row: 10 }))
|
|
203
203
|
if (!!copiedList && !!resopnseData?.data) {
|
|
204
204
|
const combindData = {
|
|
205
205
|
...resopnseData,
|
|
@@ -9,7 +9,7 @@ export default function (request) {
|
|
|
9
9
|
context: {
|
|
10
10
|
activityNo: null,
|
|
11
11
|
activityDetail: null,
|
|
12
|
-
duration:
|
|
12
|
+
duration: 0,
|
|
13
13
|
},
|
|
14
14
|
initial: 'idle',
|
|
15
15
|
states: {
|
|
@@ -62,7 +62,7 @@ export default function (request) {
|
|
|
62
62
|
}),
|
|
63
63
|
setDuration: assign((context, event) => {
|
|
64
64
|
return {
|
|
65
|
-
duration: context?.activityDetail?.deadline - new Date().getTime() / 1000,
|
|
65
|
+
duration: Math.max(context?.activityDetail?.deadline - new Date().getTime() / 1000, 0),
|
|
66
66
|
}
|
|
67
67
|
}),
|
|
68
68
|
},
|
|
@@ -13,6 +13,7 @@ export default function (request) {
|
|
|
13
13
|
isAutoReceiving: true,
|
|
14
14
|
activityNo: null,
|
|
15
15
|
activityDetail: null,
|
|
16
|
+
duration: 0,
|
|
16
17
|
|
|
17
18
|
// 領獎後得到的資訊
|
|
18
19
|
awards: [],
|
|
@@ -44,12 +45,18 @@ export default function (request) {
|
|
|
44
45
|
always: [{ target: 'awardable', cond: 'isAwardable' }, { target: 'awarded' }],
|
|
45
46
|
},
|
|
46
47
|
awardable: {
|
|
48
|
+
entry: 'setDuration',
|
|
47
49
|
on: {
|
|
48
50
|
AWARD_PRIZE: {
|
|
49
51
|
target: 'awarding',
|
|
50
52
|
actions: 'setCallback',
|
|
51
53
|
},
|
|
52
54
|
},
|
|
55
|
+
after: {
|
|
56
|
+
1000: {
|
|
57
|
+
target: 'awardable',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
53
60
|
},
|
|
54
61
|
awarded: {
|
|
55
62
|
on: {
|
|
@@ -122,6 +129,11 @@ export default function (request) {
|
|
|
122
129
|
doCallback: (context, event) => {
|
|
123
130
|
context.callback()
|
|
124
131
|
},
|
|
132
|
+
setDuration: assign((context, event) => {
|
|
133
|
+
return {
|
|
134
|
+
duration: Math.max(context?.activityDetail?.periodEndTime - new Date().getTime() / 1000, 0),
|
|
135
|
+
}
|
|
136
|
+
}),
|
|
125
137
|
},
|
|
126
138
|
guards: {
|
|
127
139
|
isActivityChanged: (context, event) => {
|
|
@@ -4,7 +4,7 @@ import diamond_shop_activity_fc from './diamond_shop_activity_fc.js'
|
|
|
4
4
|
import diamond_shop_activity_vn from './diamond_shop_activity_vn.js'
|
|
5
5
|
import fafafa_activity from './fafafa_activity.js'
|
|
6
6
|
import invite_friends_activity from './invite_friends_activity.js'
|
|
7
|
-
import
|
|
7
|
+
import affiliate_invite_friends_activity from './affiliate_invite_friends_activity.js'
|
|
8
8
|
import ranking_activity from './ranking_activity.js'
|
|
9
9
|
import return_bonus_activity from './return_bonus_activity.js'
|
|
10
10
|
import specify_bets_activity from './specify_bets_activity.js'
|
|
@@ -22,7 +22,7 @@ export default {
|
|
|
22
22
|
diamond_shop_activity_vn,
|
|
23
23
|
fafafa_activity,
|
|
24
24
|
invite_friends_activity,
|
|
25
|
-
|
|
25
|
+
affiliate_invite_friends_activity,
|
|
26
26
|
ranking_activity,
|
|
27
27
|
return_bonus_activity,
|
|
28
28
|
specify_bets_activity,
|
|
@@ -12,17 +12,17 @@ export default function (request) {
|
|
|
12
12
|
bindingCode: null,
|
|
13
13
|
uidSite: null,
|
|
14
14
|
receiveNo: null,
|
|
15
|
-
|
|
15
|
+
affiliateCode: null,
|
|
16
16
|
downlineCount: 0,
|
|
17
17
|
},
|
|
18
18
|
initial: 'idle',
|
|
19
19
|
states: {
|
|
20
20
|
idle: {
|
|
21
21
|
on: {
|
|
22
|
-
|
|
22
|
+
FETCH_AFFILIATE_CODE: {
|
|
23
23
|
target: 'fetching',
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
BIND_AFFILIATE_CODE: {
|
|
26
26
|
target: 'binding',
|
|
27
27
|
actions: ['setActivityNo', 'setBindingCode', 'setUidSite'],
|
|
28
28
|
},
|
|
@@ -74,9 +74,9 @@ export default function (request) {
|
|
|
74
74
|
{
|
|
75
75
|
actions: {
|
|
76
76
|
setAffiliateCode: assign((context, event) => {
|
|
77
|
-
const {
|
|
77
|
+
const { affiliateCode, downlineCount } = event.data
|
|
78
78
|
return {
|
|
79
|
-
|
|
79
|
+
affiliateCode,
|
|
80
80
|
downlineCount,
|
|
81
81
|
}
|
|
82
82
|
}),
|
|
@@ -98,7 +98,7 @@ export default function (request) {
|
|
|
98
98
|
},
|
|
99
99
|
services: {
|
|
100
100
|
postAffiliate: async (context, event) => {
|
|
101
|
-
return await request.send(user.postAffiliate({
|
|
101
|
+
return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
|
|
102
102
|
},
|
|
103
103
|
fetchAffiliate: async (context, event) => {
|
|
104
104
|
return await request.send(user.getAffiliate())
|
|
@@ -10,6 +10,7 @@ export default function (request) {
|
|
|
10
10
|
activityNo: null,
|
|
11
11
|
activityDetail: null,
|
|
12
12
|
callback: () => {},
|
|
13
|
+
duration: 0,
|
|
13
14
|
},
|
|
14
15
|
initial: 'idle',
|
|
15
16
|
states: {
|
|
@@ -40,7 +41,14 @@ export default function (request) {
|
|
|
40
41
|
{ target: 'receivable', cond: 'isReceivable' },
|
|
41
42
|
],
|
|
42
43
|
},
|
|
43
|
-
ongoing: {
|
|
44
|
+
ongoing: {
|
|
45
|
+
entry: 'setDuration',
|
|
46
|
+
after: {
|
|
47
|
+
1000: {
|
|
48
|
+
target: 'ongoing',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
44
52
|
received: {},
|
|
45
53
|
receivable: {
|
|
46
54
|
on: {
|
|
@@ -84,6 +92,11 @@ export default function (request) {
|
|
|
84
92
|
doCallback: (context, event) => {
|
|
85
93
|
context.callback(event.data.type)
|
|
86
94
|
},
|
|
95
|
+
setDuration: assign((context, event) => {
|
|
96
|
+
return {
|
|
97
|
+
duration: Math.max(context?.activityDetail?.activityEndTime - new Date().getTime() / 1000, 0),
|
|
98
|
+
}
|
|
99
|
+
}),
|
|
87
100
|
},
|
|
88
101
|
guards: {
|
|
89
102
|
isReceivable: (context, event) => {
|
package/src/machine/auth.js
CHANGED
|
@@ -36,7 +36,7 @@ export default function (request) {
|
|
|
36
36
|
userInfo: {},
|
|
37
37
|
redirectURL: null,
|
|
38
38
|
reCaptchaToken: null,
|
|
39
|
-
|
|
39
|
+
affiliate: null,
|
|
40
40
|
},
|
|
41
41
|
states: {
|
|
42
42
|
idle: {
|
|
@@ -321,7 +321,7 @@ export default function (request) {
|
|
|
321
321
|
return { token }
|
|
322
322
|
}),
|
|
323
323
|
redirectTo3Party: async (context, event) => {
|
|
324
|
-
const { provider, channel, subchannel,
|
|
324
|
+
const { provider, channel, subchannel, affiliate } = event.data
|
|
325
325
|
|
|
326
326
|
const dt = await getDeviceToken({
|
|
327
327
|
fpToken,
|
|
@@ -330,7 +330,7 @@ export default function (request) {
|
|
|
330
330
|
})
|
|
331
331
|
sentry.setTag('dt', dt)
|
|
332
332
|
|
|
333
|
-
const
|
|
333
|
+
const referralCode = storage.get('referralCode')
|
|
334
334
|
const messages = {
|
|
335
335
|
url: window.location.href,
|
|
336
336
|
channelOrders: [
|
|
@@ -338,18 +338,18 @@ export default function (request) {
|
|
|
338
338
|
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
339
339
|
{ channel: channel, subchannel: subchannel },
|
|
340
340
|
],
|
|
341
|
-
|
|
341
|
+
referralCode,
|
|
342
342
|
}
|
|
343
343
|
sentry.captureMessage(JSON.stringify(messages))
|
|
344
344
|
|
|
345
345
|
const referralObj = {}
|
|
346
346
|
if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
|
|
347
|
-
referralObj.
|
|
347
|
+
referralObj.referralCode = referralCode
|
|
348
|
+
} else {
|
|
349
|
+
;(referralObj.channel = storage.get('channel') || defaultChannel || channel),
|
|
350
|
+
(referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel)
|
|
348
351
|
}
|
|
349
352
|
|
|
350
|
-
referralObj.channel = storage.get('channel') || defaultChannel || channel
|
|
351
|
-
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
|
|
352
|
-
|
|
353
353
|
const redirectURL = urljoin(
|
|
354
354
|
request.config.fullURL,
|
|
355
355
|
'login?' +
|
|
@@ -359,7 +359,7 @@ export default function (request) {
|
|
|
359
359
|
...referralObj,
|
|
360
360
|
// dt,
|
|
361
361
|
platform: 'pwa',
|
|
362
|
-
|
|
362
|
+
affiliate,
|
|
363
363
|
}).toString()
|
|
364
364
|
)
|
|
365
365
|
|
package/src/machine/common.js
CHANGED
|
@@ -41,7 +41,7 @@ export default function (request) {
|
|
|
41
41
|
sentNormalBroadcastList: [],
|
|
42
42
|
channel: null,
|
|
43
43
|
subchannel: null,
|
|
44
|
-
|
|
44
|
+
referralCode: null,
|
|
45
45
|
},
|
|
46
46
|
states: {
|
|
47
47
|
config: {
|
|
@@ -157,7 +157,7 @@ export default function (request) {
|
|
|
157
157
|
let urlParams = new URLSearchParams(window.location.search)
|
|
158
158
|
const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
|
|
159
159
|
const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
|
|
160
|
-
const
|
|
160
|
+
const referralCode = urlParams.get('referralCode') || storage.get('referralCode')
|
|
161
161
|
|
|
162
162
|
storage.set('channel', channel, {
|
|
163
163
|
path: '/',
|
|
@@ -167,7 +167,7 @@ export default function (request) {
|
|
|
167
167
|
path: '/',
|
|
168
168
|
maxAge: 60 * 60 * 24 * 7,
|
|
169
169
|
})
|
|
170
|
-
storage.set('
|
|
170
|
+
storage.set('referralCode', referralCode, {
|
|
171
171
|
path: '/',
|
|
172
172
|
maxAge: 60 * 60 * 24 * 7,
|
|
173
173
|
})
|
|
@@ -175,7 +175,7 @@ export default function (request) {
|
|
|
175
175
|
return {
|
|
176
176
|
channel,
|
|
177
177
|
subchannel,
|
|
178
|
-
|
|
178
|
+
referralCode,
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
}),
|
|
@@ -105,7 +105,7 @@ export default function (request) {
|
|
|
105
105
|
actions: 'setAmount',
|
|
106
106
|
},
|
|
107
107
|
CONFIRM: {
|
|
108
|
-
target: '
|
|
108
|
+
target: 'calculating',
|
|
109
109
|
},
|
|
110
110
|
BACK: {
|
|
111
111
|
target: 'loaded',
|
|
@@ -131,25 +131,10 @@ export default function (request) {
|
|
|
131
131
|
calculating: {
|
|
132
132
|
invoke: {
|
|
133
133
|
src: 'fetchCalculation',
|
|
134
|
-
onDone:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
cond: (context, event) => {
|
|
139
|
-
const { siteConfig = {}, selectedCard = {} } = context
|
|
140
|
-
return siteConfig.walletMode === '2' && selectedCard.jumpLinkEnable === 1
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
target: 'cardInfo',
|
|
145
|
-
actions: 'setCalculation',
|
|
146
|
-
cond: 'isFreeWalletMode',
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
target: 'calculated',
|
|
150
|
-
actions: 'setCalculation',
|
|
151
|
-
},
|
|
152
|
-
],
|
|
134
|
+
onDone: {
|
|
135
|
+
target: 'calculated',
|
|
136
|
+
actions: 'setCalculation',
|
|
137
|
+
},
|
|
153
138
|
onError: {
|
|
154
139
|
target: 'calculable',
|
|
155
140
|
},
|
|
@@ -158,17 +143,10 @@ export default function (request) {
|
|
|
158
143
|
calculable: {
|
|
159
144
|
entry: 'clearCalculation',
|
|
160
145
|
on: {
|
|
161
|
-
SELECT_AMOUNT:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
cond: 'isFreeWalletMode',
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
target: 'debouncing',
|
|
169
|
-
actions: 'setAmount',
|
|
170
|
-
},
|
|
171
|
-
],
|
|
146
|
+
SELECT_AMOUNT: {
|
|
147
|
+
target: 'debouncing',
|
|
148
|
+
actions: 'setAmount',
|
|
149
|
+
},
|
|
172
150
|
BACK: {
|
|
173
151
|
target: 'loaded',
|
|
174
152
|
},
|
|
@@ -333,9 +311,6 @@ export default function (request) {
|
|
|
333
311
|
isFreeWalletMode: (context, event) => {
|
|
334
312
|
return context.siteConfig?.walletMode === '2'
|
|
335
313
|
},
|
|
336
|
-
isDoubleWalletMode: (context, event) => {
|
|
337
|
-
return context.siteConfig?.walletMode === '4'
|
|
338
|
-
},
|
|
339
314
|
isSubmittable: (context, event) => {
|
|
340
315
|
const { cardNumber, serialNumber } = context
|
|
341
316
|
return cardNumber && serialNumber
|
|
@@ -110,8 +110,12 @@ export default function (request) {
|
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
fetchList: async (context, event) => {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
if (request.getToken()) {
|
|
114
|
+
const { data } = await request.send(api.getListMyFavorite())
|
|
115
|
+
return data
|
|
116
|
+
} else {
|
|
117
|
+
return []
|
|
118
|
+
}
|
|
115
119
|
},
|
|
116
120
|
},
|
|
117
121
|
}
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -10,7 +10,6 @@ export default function (request) {
|
|
|
10
10
|
id: 'game',
|
|
11
11
|
type: 'parallel',
|
|
12
12
|
context: {
|
|
13
|
-
base: '',
|
|
14
13
|
loadable: false,
|
|
15
14
|
isLastPage: false,
|
|
16
15
|
room: null,
|
|
@@ -27,6 +26,7 @@ export default function (request) {
|
|
|
27
26
|
timestamp: null,
|
|
28
27
|
totalPage: 0,
|
|
29
28
|
},
|
|
29
|
+
staticData: [],
|
|
30
30
|
// play params
|
|
31
31
|
game: {
|
|
32
32
|
providerId: null,
|
|
@@ -47,6 +47,9 @@ export default function (request) {
|
|
|
47
47
|
idle: {
|
|
48
48
|
enter: 'clearGameInfo',
|
|
49
49
|
on: {
|
|
50
|
+
SET_STATIC_DATA: {
|
|
51
|
+
actions: 'setStaticData',
|
|
52
|
+
},
|
|
50
53
|
SET_ADDITION_ENABLE: {
|
|
51
54
|
actions: 'setAdditionEnable',
|
|
52
55
|
},
|
|
@@ -206,6 +209,11 @@ export default function (request) {
|
|
|
206
209
|
},
|
|
207
210
|
{
|
|
208
211
|
actions: {
|
|
212
|
+
setStaticData: assign((context, event) => {
|
|
213
|
+
return {
|
|
214
|
+
staticData: event.data,
|
|
215
|
+
}
|
|
216
|
+
}),
|
|
209
217
|
setAdditionEnable: assign((context, event) => {
|
|
210
218
|
return {
|
|
211
219
|
additionEnable: event.data,
|
|
@@ -223,17 +231,13 @@ export default function (request) {
|
|
|
223
231
|
isLastPage: index >= content?.totalPage - 1,
|
|
224
232
|
}
|
|
225
233
|
}),
|
|
226
|
-
setFavoriteList: assign((context, event) => {
|
|
227
|
-
return {
|
|
228
|
-
favoriteList: event.data.data || [],
|
|
229
|
-
}
|
|
230
|
-
}),
|
|
231
234
|
setRoom: assign((context, event) => {
|
|
232
235
|
return {
|
|
233
236
|
room: event.data,
|
|
234
237
|
}
|
|
235
238
|
}),
|
|
236
239
|
resetContent: assign((context, event) => {
|
|
240
|
+
console.log('resetContent')
|
|
237
241
|
return {
|
|
238
242
|
loadable: false,
|
|
239
243
|
isLastPage: false,
|
|
@@ -325,9 +329,19 @@ export default function (request) {
|
|
|
325
329
|
},
|
|
326
330
|
services: {
|
|
327
331
|
getPageContent: async (context, event) => {
|
|
328
|
-
const { room, index, additionEnable } = context
|
|
332
|
+
const { room, index, additionEnable, staticData } = context
|
|
329
333
|
if (room.categoryId === GAME_SEARCH) {
|
|
330
334
|
return
|
|
335
|
+
} else if (!request.getToken()) {
|
|
336
|
+
const list = staticData.find((data) => data.category == room.categoryId)?.info || []
|
|
337
|
+
|
|
338
|
+
return [
|
|
339
|
+
{
|
|
340
|
+
data: list.slice(index * 20, (index + 1) * 20),
|
|
341
|
+
totalPage: Math.ceil(list.length / 20),
|
|
342
|
+
timestamp: Math.floor(Date.now() / 1000),
|
|
343
|
+
},
|
|
344
|
+
]
|
|
331
345
|
} else if (additionEnable) {
|
|
332
346
|
const param = { categoryId: room.categoryId, index }
|
|
333
347
|
return await Promise.all([request.send(api.getListCategory(param)), request.send(api.getListAddition(param))])
|
|
@@ -340,6 +354,8 @@ export default function (request) {
|
|
|
340
354
|
const { room, content, index, additionEnable } = context
|
|
341
355
|
if (room.categoryId === GAME_SEARCH) {
|
|
342
356
|
return
|
|
357
|
+
} else if (!request.getToken()) {
|
|
358
|
+
return []
|
|
343
359
|
} else if (additionEnable) {
|
|
344
360
|
return await Promise.all([
|
|
345
361
|
request.send(
|
|
@@ -370,7 +386,6 @@ export default function (request) {
|
|
|
370
386
|
}
|
|
371
387
|
},
|
|
372
388
|
connectGame: async (context, event) => {
|
|
373
|
-
const returnProviders = ['RSG', 'KP', 'EPICWIN', 'KA', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
|
|
374
389
|
const { lang, isMobile } = context
|
|
375
390
|
const { providerId, gameId, gameTypeId, mappingId } = context.game
|
|
376
391
|
const params = {
|
|
@@ -381,7 +396,7 @@ export default function (request) {
|
|
|
381
396
|
is_demo: false,
|
|
382
397
|
is_mobile: isMobile,
|
|
383
398
|
lang,
|
|
384
|
-
return_url:
|
|
399
|
+
return_url: window.location.href,
|
|
385
400
|
}
|
|
386
401
|
const { redirect_url } = await request.send(api.playGame(params))
|
|
387
402
|
return { gameURL: redirect_url }
|
|
@@ -434,12 +449,22 @@ const oldGuards = {
|
|
|
434
449
|
|
|
435
450
|
const oldServices = (request) => ({
|
|
436
451
|
fetchOption: async (context, event) => {
|
|
437
|
-
|
|
452
|
+
if (request.getToken()) {
|
|
453
|
+
return await request.send(api.getOptionMap())
|
|
454
|
+
}
|
|
438
455
|
},
|
|
439
456
|
fetchGameSHA: async (context, event) => {
|
|
440
|
-
|
|
457
|
+
if (request.getToken()) {
|
|
458
|
+
return await request.send(api.getGameSHA())
|
|
459
|
+
} else {
|
|
460
|
+
return {
|
|
461
|
+
status: null,
|
|
462
|
+
}
|
|
463
|
+
}
|
|
441
464
|
},
|
|
442
465
|
fetchStatus: async (context, event) => {
|
|
443
|
-
|
|
466
|
+
if (request.getToken()) {
|
|
467
|
+
return await request.send(api.getGameStatus())
|
|
468
|
+
}
|
|
444
469
|
},
|
|
445
470
|
})
|
package/src/machine/index.js
CHANGED
|
@@ -3,10 +3,7 @@ import auth from './auth.js'
|
|
|
3
3
|
import welcome from './welcome.js'
|
|
4
4
|
import common from './common.js'
|
|
5
5
|
import error from './error.js'
|
|
6
|
-
import game from './game.js'
|
|
7
|
-
import game_v2 from './game_v2.js'
|
|
8
6
|
import game_v2_1 from './game_v2_1.js'
|
|
9
|
-
import game_favorite from './game_favorite.js'
|
|
10
7
|
import game_favorite_v2 from './game_favorite_v2.js'
|
|
11
8
|
import game_search from './game_search.js'
|
|
12
9
|
import game_search_v2 from './game_search_v2.js'
|
|
@@ -44,9 +41,6 @@ export default {
|
|
|
44
41
|
common,
|
|
45
42
|
deposit,
|
|
46
43
|
error,
|
|
47
|
-
game,
|
|
48
|
-
game_v2,
|
|
49
|
-
game_favorite,
|
|
50
44
|
game_favorite_v2,
|
|
51
45
|
game_search,
|
|
52
46
|
game_search_v2,
|