@jetthai/cuora 1.1.395-payment-1 → 1.1.396
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/CHANGELOG.md +93 -1
- package/package.json +1 -1
- package/resetGitBranch.sh +0 -10
- package/src/api/activity.js +6 -4
- package/src/api/auth.js +2 -2
- package/src/api/common.js +1 -1
- package/src/api/game.js +25 -13
- package/src/api/payment.js +9 -5
- package/src/api/ranking.js +6 -6
- package/src/api/user.js +15 -10
- package/src/lib/{fingerprint_v3_11_5.js → fingerprint_v3_11_12.js} +3749 -4212
- package/src/machine/activity/continue_deposit_activity.js +2 -1
- package/src/machine/activity/fafafa_activity.js +2 -1
- package/src/machine/activity/return_bonus_activity.js +2 -1
- package/src/machine/activity/sign_in_activity.js +2 -1
- package/src/machine/activity/specify_bets_activity.js +2 -1
- package/src/machine/activity/specify_turnover_activity.js +2 -1
- package/src/machine/auth.js +15 -7
- package/src/machine/bank_binding.js +68 -10
- package/src/machine/common.js +34 -8
- package/src/machine/deposit/amb.js +1 -1
- package/src/machine/deposit/crypto_bank.js +10 -2
- package/src/machine/deposit/crypto_bank_cash.js +10 -2
- package/src/machine/deposit/crypto_way.js +10 -2
- package/src/machine/deposit/crypto_way_cash.js +10 -2
- package/src/machine/deposit/deposit_fc.js +11 -3
- package/src/machine/deposit/direct.js +12 -4
- package/src/machine/deposit/direct_cash.js +12 -4
- package/src/machine/deposit/float.js +12 -4
- package/src/machine/deposit/loadcard_cash.js +11 -3
- package/src/machine/deposit/loadcard_vn.js +11 -3
- package/src/machine/deposit/manual_cash.js +12 -4
- package/src/machine/deposit/manual_vn.js +11 -3
- package/src/machine/deposit/qrcode_cash.js +11 -3
- package/src/machine/deposit/qrcode_v2.js +11 -3
- package/src/machine/deposit/virtual_bank_cash.js +11 -3
- package/src/machine/deposit/virtual_bank_vn.js +11 -3
- package/src/machine/deposit/vpay.js +12 -4
- package/src/machine/game_betslip.js +46 -0
- package/src/machine/game_replay.js +2 -2
- package/src/machine/game_search_cash.js +10 -7
- package/src/machine/game_search_v2.js +10 -10
- package/src/machine/game_v2_1.js +22 -9
- package/src/machine/honor_board_cash.js +1 -1
- package/src/machine/inbox.js +22 -8
- package/src/machine/index.js +2 -0
- package/src/machine/ranking.js +14 -11
- package/src/machine/reward.js +58 -5
- package/src/machine/reward_cash.js +60 -3
- package/src/machine/reward_fc.js +2 -1
- package/src/machine/side_cash.js +3 -2
- package/src/machine/side_v2.js +5 -4
- package/src/machine/user_reset_password.js +5 -4
- package/src/machine/user_sign_up.js +6 -2
- package/src/machine/vip_table.js +11 -4
- package/src/machine/withdraw/withdraw_crypto_cash.js +10 -2
- package/src/machine/withdraw/withdraw_manual.js +11 -96
- package/src/machine/withdraw/withdraw_manual_cash.js +1 -1
- package/src/request/request.js +245 -7
- package/src/util/deviceToken.js +26 -2
- package/src/util/index.js +2 -2
- package/src/util/storage.js +18 -4
|
@@ -150,7 +150,7 @@ export default function (request, context) {
|
|
|
150
150
|
setInitData: assign((context, event) => {
|
|
151
151
|
const { currentPayment, bankList, bindingPaymentInfo, processing } = event.data
|
|
152
152
|
const userBankLsit = bindingPaymentInfo.bankList || []
|
|
153
|
-
const allBankList = bankList
|
|
153
|
+
const allBankList = bankList?.data ? bankList.data : bankList
|
|
154
154
|
|
|
155
155
|
const houseBanks = currentPayment.banks.map((bank) => {
|
|
156
156
|
const foundBank = allBankList.find((item) => item.bankCode === bank.bankName)
|
|
@@ -200,8 +200,16 @@ export default function (request, context) {
|
|
|
200
200
|
return { selectedAmount: event.data }
|
|
201
201
|
}),
|
|
202
202
|
setCalculation: assign((context, event) => {
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
// V2接口轉換中回傳的資料結構不同
|
|
204
|
+
const { data } = event.data
|
|
205
|
+
if (data) {
|
|
206
|
+
return {
|
|
207
|
+
calculation: data,
|
|
208
|
+
}
|
|
209
|
+
} else {
|
|
210
|
+
return {
|
|
211
|
+
calculation: event.data,
|
|
212
|
+
}
|
|
205
213
|
}
|
|
206
214
|
}),
|
|
207
215
|
setProcessing: assign((context, event) => {
|
|
@@ -308,7 +316,7 @@ export default function (request, context) {
|
|
|
308
316
|
return await request.send(
|
|
309
317
|
payment.getDepositExpectedResult({
|
|
310
318
|
method,
|
|
311
|
-
amount: selectedAmount,
|
|
319
|
+
amount: Number(selectedAmount),
|
|
312
320
|
promotionsNo: promotion?.promotionsNo,
|
|
313
321
|
})
|
|
314
322
|
)
|
|
@@ -291,8 +291,16 @@ export default function (request) {
|
|
|
291
291
|
}
|
|
292
292
|
}),
|
|
293
293
|
setCalculation: assign((context, event) => {
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
// V2接口轉換中回傳的資料結構不同
|
|
295
|
+
const { data } = event.data
|
|
296
|
+
if (data) {
|
|
297
|
+
return {
|
|
298
|
+
calculation: data,
|
|
299
|
+
}
|
|
300
|
+
} else {
|
|
301
|
+
return {
|
|
302
|
+
calculation: event.data,
|
|
303
|
+
}
|
|
296
304
|
}
|
|
297
305
|
}),
|
|
298
306
|
setProcessing: assign((context, event) => {
|
|
@@ -402,7 +410,7 @@ export default function (request) {
|
|
|
402
410
|
return await request.send(
|
|
403
411
|
payment.getDepositExpectedResult({
|
|
404
412
|
method,
|
|
405
|
-
amount,
|
|
413
|
+
amount: Number(amount),
|
|
406
414
|
promotionsNo: promotion?.activityNo,
|
|
407
415
|
})
|
|
408
416
|
)
|
|
@@ -170,8 +170,16 @@ export default function (request, context) {
|
|
|
170
170
|
return { selectedAmount: event.data }
|
|
171
171
|
}),
|
|
172
172
|
setCalculation: assign((context, event) => {
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
// V2接口轉換中回傳的資料結構不同
|
|
174
|
+
const { data } = event.data
|
|
175
|
+
if (data) {
|
|
176
|
+
return {
|
|
177
|
+
calculation: data,
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
return {
|
|
181
|
+
calculation: event.data,
|
|
182
|
+
}
|
|
175
183
|
}
|
|
176
184
|
}),
|
|
177
185
|
clearCalculation: assign((context, event) => {
|
|
@@ -196,7 +204,7 @@ export default function (request, context) {
|
|
|
196
204
|
return await request.send(
|
|
197
205
|
payment.getDepositExpectedResult({
|
|
198
206
|
method: selectedQrcode.method,
|
|
199
|
-
amount: selectedAmount,
|
|
207
|
+
amount: Number(selectedAmount),
|
|
200
208
|
promotionsNo: promotion?.promotionsNo,
|
|
201
209
|
})
|
|
202
210
|
)
|
|
@@ -260,8 +260,16 @@ export default function (request) {
|
|
|
260
260
|
return { selectedAmount: event.data }
|
|
261
261
|
}),
|
|
262
262
|
setCalculation: assign((context, event) => {
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
// V2接口轉換中回傳的資料結構不同
|
|
264
|
+
const { data } = event.data
|
|
265
|
+
if (data) {
|
|
266
|
+
return {
|
|
267
|
+
calculation: data,
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
return {
|
|
271
|
+
calculation: event.data,
|
|
272
|
+
}
|
|
265
273
|
}
|
|
266
274
|
}),
|
|
267
275
|
clearCalculation: assign((context, event) => {
|
|
@@ -309,7 +317,7 @@ export default function (request) {
|
|
|
309
317
|
return await request.send(
|
|
310
318
|
payment.getDepositExpectedResult({
|
|
311
319
|
method: currentMethod,
|
|
312
|
-
amount: selectedAmount,
|
|
320
|
+
amount: Number(selectedAmount),
|
|
313
321
|
promotionsNo: promotion?.activityNo,
|
|
314
322
|
})
|
|
315
323
|
)
|
|
@@ -128,8 +128,16 @@ export default function (request, context) {
|
|
|
128
128
|
return { selectedAmount: event.data }
|
|
129
129
|
}),
|
|
130
130
|
setCalculation: assign((context, event) => {
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
// V2接口轉換中回傳的資料結構不同
|
|
132
|
+
const { data } = event.data
|
|
133
|
+
if (data) {
|
|
134
|
+
return {
|
|
135
|
+
calculation: data,
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
return {
|
|
139
|
+
calculation: event.data,
|
|
140
|
+
}
|
|
133
141
|
}
|
|
134
142
|
}),
|
|
135
143
|
setProcessing: assign((context, event) => {
|
|
@@ -179,7 +187,7 @@ export default function (request, context) {
|
|
|
179
187
|
return await request.send(
|
|
180
188
|
payment.getDepositExpectedResult({
|
|
181
189
|
method,
|
|
182
|
-
amount: selectedAmount,
|
|
190
|
+
amount: Number(selectedAmount),
|
|
183
191
|
promotionsNo: promotion?.promotionsNo,
|
|
184
192
|
})
|
|
185
193
|
)
|
|
@@ -190,8 +190,16 @@ export default function (request) {
|
|
|
190
190
|
}
|
|
191
191
|
}),
|
|
192
192
|
setCalculation: assign((context, event) => {
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
// V2接口轉換中回傳的資料結構不同
|
|
194
|
+
const { data } = event.data
|
|
195
|
+
if (data) {
|
|
196
|
+
return {
|
|
197
|
+
calculation: data,
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
return {
|
|
201
|
+
calculation: event.data,
|
|
202
|
+
}
|
|
195
203
|
}
|
|
196
204
|
}),
|
|
197
205
|
setProcessing: assign((context, event) => {
|
|
@@ -239,7 +247,7 @@ export default function (request) {
|
|
|
239
247
|
return await request.send(
|
|
240
248
|
payment.getDepositExpectedResult({
|
|
241
249
|
method,
|
|
242
|
-
amount,
|
|
250
|
+
amount: Number(amount),
|
|
243
251
|
promotionsNo: promotion?.activityNo,
|
|
244
252
|
})
|
|
245
253
|
)
|
|
@@ -267,7 +267,7 @@ export default function (request) {
|
|
|
267
267
|
options: optional,
|
|
268
268
|
minimum,
|
|
269
269
|
maximum,
|
|
270
|
-
bankList,
|
|
270
|
+
bankList: bankList?.data ? bankList.data : bankList,
|
|
271
271
|
grandTotalEnable,
|
|
272
272
|
}
|
|
273
273
|
}),
|
|
@@ -287,8 +287,16 @@ export default function (request) {
|
|
|
287
287
|
return { amount: event.data }
|
|
288
288
|
}),
|
|
289
289
|
setCalculation: assign((context, event) => {
|
|
290
|
-
|
|
291
|
-
|
|
290
|
+
// V2接口轉換中回傳的資料結構不同
|
|
291
|
+
const { data } = event.data
|
|
292
|
+
if (data) {
|
|
293
|
+
return {
|
|
294
|
+
calculation: data,
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
297
|
+
return {
|
|
298
|
+
calculation: event.data,
|
|
299
|
+
}
|
|
292
300
|
}
|
|
293
301
|
}),
|
|
294
302
|
clearCalculation: assign((context, event) => {
|
|
@@ -348,7 +356,7 @@ export default function (request) {
|
|
|
348
356
|
return await request.send(
|
|
349
357
|
payment.getDepositExpectedResult({
|
|
350
358
|
method,
|
|
351
|
-
amount,
|
|
359
|
+
amount: Number(amount),
|
|
352
360
|
promotionsNo: promotion?.activityNo,
|
|
353
361
|
})
|
|
354
362
|
)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import game from '../api/game.js'
|
|
3
|
+
|
|
4
|
+
export default function (request, context) {
|
|
5
|
+
const { appSecret } = request.config
|
|
6
|
+
const { providerId, seqNo, lang } = context
|
|
7
|
+
return createMachine(
|
|
8
|
+
{
|
|
9
|
+
id: 'game_betslip',
|
|
10
|
+
initial: 'fetching',
|
|
11
|
+
context: {
|
|
12
|
+
gameBetSlip: {},
|
|
13
|
+
},
|
|
14
|
+
states: {
|
|
15
|
+
fetching: {
|
|
16
|
+
invoke: {
|
|
17
|
+
src: 'fetchBetslip',
|
|
18
|
+
onDone: {
|
|
19
|
+
target: 'idle',
|
|
20
|
+
actions: 'setBetslip',
|
|
21
|
+
},
|
|
22
|
+
onError: {
|
|
23
|
+
target: 'idle',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
idle: {},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
actions: {
|
|
32
|
+
setBetslip: assign((context, event) => {
|
|
33
|
+
return {
|
|
34
|
+
gameBetSlip: event.data,
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
services: {
|
|
39
|
+
// 取得遊戲注單
|
|
40
|
+
fetchBetslip: async (context, event) => {
|
|
41
|
+
return await request.send(game.getBetslip({ providerId, seqNo, lang, appSecret }))
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
}
|
|
@@ -2,7 +2,7 @@ import { assign, createMachine } from 'xstate'
|
|
|
2
2
|
import game from '../api/game.js'
|
|
3
3
|
|
|
4
4
|
export default function (request, context) {
|
|
5
|
-
|
|
5
|
+
const { appSecret } = request.config
|
|
6
6
|
const { providerId, seqNo, lang } = context
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
@@ -38,7 +38,7 @@ export default function (request, context) {
|
|
|
38
38
|
services: {
|
|
39
39
|
// 取得遊戲重播資訊
|
|
40
40
|
fetchGameReplayInfo: async (context, event) => {
|
|
41
|
-
return await request.send(game.getGameReplayInfo({ providerId, seqNo, lang }))
|
|
41
|
+
return await request.send(game.getGameReplayInfo({ providerId, seqNo, lang, appSecret }))
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
}
|
|
@@ -27,9 +27,9 @@ export default function (request) {
|
|
|
27
27
|
recentlyGame: [],
|
|
28
28
|
youMayLike: [],
|
|
29
29
|
selectedType: null,
|
|
30
|
-
isYouMayLike:
|
|
31
|
-
isRecentlyGame:
|
|
32
|
-
isRecentlySearch:
|
|
30
|
+
isYouMayLike: false,
|
|
31
|
+
isRecentlyGame: false,
|
|
32
|
+
isRecentlySearch: false,
|
|
33
33
|
},
|
|
34
34
|
states: {
|
|
35
35
|
init: {
|
|
@@ -66,6 +66,9 @@ export default function (request) {
|
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
|
+
resetDebounce: {
|
|
70
|
+
always: 'debouncing',
|
|
71
|
+
},
|
|
69
72
|
debouncing: {
|
|
70
73
|
after: {
|
|
71
74
|
500: {
|
|
@@ -135,12 +138,12 @@ export default function (request) {
|
|
|
135
138
|
},
|
|
136
139
|
on: {
|
|
137
140
|
SET_KEYWORD: {
|
|
138
|
-
target: '.
|
|
141
|
+
target: '.resetDebounce',
|
|
139
142
|
actions: ['setKeyword', 'setLang'],
|
|
140
143
|
cond: 'isInitialized',
|
|
141
144
|
},
|
|
142
145
|
CLEAR_KEYWORD: {
|
|
143
|
-
target: '.
|
|
146
|
+
target: '.resetDebounce',
|
|
144
147
|
actions: 'clearKeyword',
|
|
145
148
|
},
|
|
146
149
|
SET_TAG_ID: [
|
|
@@ -264,7 +267,7 @@ export default function (request) {
|
|
|
264
267
|
setGameCode: assign((context, event) => {
|
|
265
268
|
const { gameList } = context
|
|
266
269
|
const gameCode = event.data
|
|
267
|
-
const gameCodeIndex = gameList.findIndex((game) => game === gameCode)
|
|
270
|
+
const gameCodeIndex = gameList.findIndex((game) => game?.gameCode === gameCode)
|
|
268
271
|
return {
|
|
269
272
|
gameCode,
|
|
270
273
|
gameCodeIndex,
|
|
@@ -388,7 +391,7 @@ export default function (request) {
|
|
|
388
391
|
sendMayLikeTrace: async (context, event) => {
|
|
389
392
|
return await request.send(
|
|
390
393
|
game.setGameSearchTrace({
|
|
391
|
-
isYouMayLike:
|
|
394
|
+
isYouMayLike: true,
|
|
392
395
|
})
|
|
393
396
|
)
|
|
394
397
|
},
|
|
@@ -21,9 +21,9 @@ export default function (request) {
|
|
|
21
21
|
click: null,
|
|
22
22
|
clickDefault: null,
|
|
23
23
|
traceId: null,
|
|
24
|
-
isYouMayLike:
|
|
25
|
-
isRecentlyGame:
|
|
26
|
-
isRecentlySearch:
|
|
24
|
+
isYouMayLike: false,
|
|
25
|
+
isRecentlyGame: false,
|
|
26
|
+
isRecentlySearch: false,
|
|
27
27
|
gameCode: null,
|
|
28
28
|
lang: 'en-US',
|
|
29
29
|
},
|
|
@@ -119,9 +119,9 @@ export default function (request) {
|
|
|
119
119
|
data: {
|
|
120
120
|
tagId: context.tagList[0]?.id,
|
|
121
121
|
traceData: {
|
|
122
|
-
isYouMayLike:
|
|
123
|
-
isRecentlyGame:
|
|
124
|
-
isRecentlySearch:
|
|
122
|
+
isYouMayLike: false,
|
|
123
|
+
isRecentlyGame: false,
|
|
124
|
+
isRecentlySearch: false,
|
|
125
125
|
},
|
|
126
126
|
},
|
|
127
127
|
})),
|
|
@@ -305,7 +305,7 @@ export default function (request) {
|
|
|
305
305
|
setGameCode: assign((context, event) => {
|
|
306
306
|
const { gameList } = context
|
|
307
307
|
const gameCode = event.data
|
|
308
|
-
const gameCodeIndex = gameList.findIndex((game) => game === gameCode)
|
|
308
|
+
const gameCodeIndex = gameList.findIndex((game) => game?.gameCode === gameCode)
|
|
309
309
|
return {
|
|
310
310
|
gameCode,
|
|
311
311
|
gameCodeIndex,
|
|
@@ -319,9 +319,9 @@ export default function (request) {
|
|
|
319
319
|
tagIndex: null,
|
|
320
320
|
gameCode: null,
|
|
321
321
|
gameCodeIndex: null,
|
|
322
|
-
isYouMayLike:
|
|
323
|
-
isRecentlyGame:
|
|
324
|
-
isRecentlySearch:
|
|
322
|
+
isYouMayLike: false,
|
|
323
|
+
isRecentlyGame: false,
|
|
324
|
+
isRecentlySearch: false,
|
|
325
325
|
query: context.keyword,
|
|
326
326
|
click: null,
|
|
327
327
|
clickDefault: null,
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -5,6 +5,7 @@ import { GAME_SEARCH } from '../util/constant.js'
|
|
|
5
5
|
|
|
6
6
|
// 對應 intersectionObserver 版本
|
|
7
7
|
export default function (request) {
|
|
8
|
+
const { appSecret } = request.config
|
|
8
9
|
return createMachine(
|
|
9
10
|
{
|
|
10
11
|
id: 'game',
|
|
@@ -83,7 +84,7 @@ export default function (request) {
|
|
|
83
84
|
},
|
|
84
85
|
ENTER_GAME: {
|
|
85
86
|
target: 'connecting',
|
|
86
|
-
actions: ['setGameInfo', 'setLang', '
|
|
87
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
87
88
|
},
|
|
88
89
|
DEMO_GAME: {
|
|
89
90
|
target: 'demoGame',
|
|
@@ -91,7 +92,7 @@ export default function (request) {
|
|
|
91
92
|
},
|
|
92
93
|
MENU_ENTER_GAME: {
|
|
93
94
|
target: 'connecting',
|
|
94
|
-
actions: ['setGameInfo', 'setLang', '
|
|
95
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
95
96
|
},
|
|
96
97
|
UPDATE: {
|
|
97
98
|
target: 'updating',
|
|
@@ -224,11 +225,15 @@ export default function (request) {
|
|
|
224
225
|
},
|
|
225
226
|
MENU_ENTER_GAME: {
|
|
226
227
|
target: 'connectSwitching',
|
|
227
|
-
actions: ['setSwitch', 'setLang'],
|
|
228
|
+
actions: ['setSwitch', 'setLang', 'setWalletType'],
|
|
228
229
|
},
|
|
229
230
|
ENTER_GAME_PAUSE: {
|
|
230
231
|
actions: ['setIsPlaying', 'resetContent', 'resetSHA'],
|
|
231
232
|
},
|
|
233
|
+
ENTER_GAME: {
|
|
234
|
+
target: 'connecting',
|
|
235
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
236
|
+
},
|
|
232
237
|
},
|
|
233
238
|
},
|
|
234
239
|
playingDemo: {
|
|
@@ -241,7 +246,7 @@ export default function (request) {
|
|
|
241
246
|
},
|
|
242
247
|
ENTER_GAME: {
|
|
243
248
|
target: 'connecting',
|
|
244
|
-
actions: ['setGameInfo', 'setLang', '
|
|
249
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
245
250
|
},
|
|
246
251
|
},
|
|
247
252
|
},
|
|
@@ -455,7 +460,7 @@ export default function (request) {
|
|
|
455
460
|
const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = context.switchGame
|
|
456
461
|
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }
|
|
457
462
|
}),
|
|
458
|
-
|
|
463
|
+
setWalletType: assign((context, event) => {
|
|
459
464
|
return { walletType: event.data.walletType }
|
|
460
465
|
}),
|
|
461
466
|
setLang: assign((context, event) => {
|
|
@@ -511,13 +516,14 @@ export default function (request) {
|
|
|
511
516
|
})
|
|
512
517
|
return list.filter((item) => item.downLine.length > 0).slice(0, 6)
|
|
513
518
|
} else if (additionEnable) {
|
|
514
|
-
const param = { categoryId: room.categoryId, index }
|
|
519
|
+
const param = { categoryId: room.categoryId, index, appSecret }
|
|
515
520
|
requestChain = event.data.list.map((category, b) => {
|
|
516
521
|
return request
|
|
517
522
|
.send(
|
|
518
523
|
api.getListCategory({
|
|
519
524
|
categoryId: category.id,
|
|
520
525
|
index: 0,
|
|
526
|
+
appSecret,
|
|
521
527
|
})
|
|
522
528
|
)
|
|
523
529
|
.then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
|
|
@@ -531,6 +537,7 @@ export default function (request) {
|
|
|
531
537
|
api.getListCategory({
|
|
532
538
|
categoryId: category.id,
|
|
533
539
|
index: 0,
|
|
540
|
+
appSecret,
|
|
534
541
|
})
|
|
535
542
|
)
|
|
536
543
|
.then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
|
|
@@ -554,10 +561,10 @@ export default function (request) {
|
|
|
554
561
|
},
|
|
555
562
|
]
|
|
556
563
|
} else if (additionEnable) {
|
|
557
|
-
const param = { categoryId: room.categoryId, index }
|
|
564
|
+
const param = { categoryId: room.categoryId, index, appSecret }
|
|
558
565
|
return await Promise.all([request.send(api.getListCategory(param)), request.send(api.getListAddition(param))])
|
|
559
566
|
} else {
|
|
560
|
-
const param = { categoryId: room.categoryId, index }
|
|
567
|
+
const param = { categoryId: room.categoryId, index, appSecret }
|
|
561
568
|
return await Promise.all([request.send(api.getListCategory(param))])
|
|
562
569
|
}
|
|
563
570
|
},
|
|
@@ -574,6 +581,7 @@ export default function (request) {
|
|
|
574
581
|
categoryId: room.categoryId,
|
|
575
582
|
end: index,
|
|
576
583
|
timestamp: content.timestamp,
|
|
584
|
+
appSecret,
|
|
577
585
|
})
|
|
578
586
|
),
|
|
579
587
|
request.send(
|
|
@@ -581,6 +589,7 @@ export default function (request) {
|
|
|
581
589
|
categoryId: room.categoryId,
|
|
582
590
|
end: index,
|
|
583
591
|
timestamp: content.timestamp,
|
|
592
|
+
appSecret,
|
|
584
593
|
})
|
|
585
594
|
),
|
|
586
595
|
])
|
|
@@ -591,6 +600,7 @@ export default function (request) {
|
|
|
591
600
|
categoryId: room.categoryId,
|
|
592
601
|
end: index,
|
|
593
602
|
timestamp: content.timestamp,
|
|
603
|
+
appSecret,
|
|
594
604
|
})
|
|
595
605
|
),
|
|
596
606
|
])
|
|
@@ -609,7 +619,9 @@ export default function (request) {
|
|
|
609
619
|
is_mobile: isMobile === 'mobile' ? 'y' : null,
|
|
610
620
|
lang,
|
|
611
621
|
selected_wallet_type: walletType,
|
|
612
|
-
return_url: returnProviders.includes(providerId)
|
|
622
|
+
return_url: returnProviders.includes(providerId)
|
|
623
|
+
? `${window.location.origin}${context.base}return`
|
|
624
|
+
: window.location.href?.split('?')?.[0], // For providers to return.
|
|
613
625
|
}
|
|
614
626
|
const { type, redirect_url, gameToken, gameHtml, wallet_type } = await request.send(api.playGame(params))
|
|
615
627
|
return { type, gameToken, gameHtml, gameURL: redirect_url, gameWalletType: wallet_type }
|
|
@@ -625,6 +637,7 @@ export default function (request) {
|
|
|
625
637
|
mapping_id: mappingId,
|
|
626
638
|
is_mobile: isMobile === 'mobile' ? 'y' : null,
|
|
627
639
|
lang,
|
|
640
|
+
appSecret,
|
|
628
641
|
}
|
|
629
642
|
const { type, redirect_url, gameToken, gameHtml, is_demo } = await request.send(api.demoGame(params))
|
|
630
643
|
// 將 is_demo 設置到 context.game.isDemo
|
|
@@ -80,7 +80,7 @@ export default function (request) {
|
|
|
80
80
|
},
|
|
81
81
|
services: {
|
|
82
82
|
fetchHonorBoardList: async (context, event) => {
|
|
83
|
-
const { data } = await request.send(activity.getHonorBroadcast(appSecret))
|
|
83
|
+
const { data } = await request.send(activity.getHonorBroadcast({ appSecret }))
|
|
84
84
|
return data
|
|
85
85
|
},
|
|
86
86
|
},
|
package/src/machine/inbox.js
CHANGED
|
@@ -247,6 +247,9 @@ export default function (request) {
|
|
|
247
247
|
CLEAR: {
|
|
248
248
|
actions: 'hideMessage',
|
|
249
249
|
},
|
|
250
|
+
SET_LANG: {
|
|
251
|
+
actions: 'setLang',
|
|
252
|
+
},
|
|
250
253
|
},
|
|
251
254
|
},
|
|
252
255
|
{
|
|
@@ -276,6 +279,10 @@ export default function (request) {
|
|
|
276
279
|
},
|
|
277
280
|
},
|
|
278
281
|
actions: {
|
|
282
|
+
setLang: assign((context, event) => {
|
|
283
|
+
const lang = event.data.locale || context.lang || 'en-US'
|
|
284
|
+
return { lang }
|
|
285
|
+
}),
|
|
279
286
|
reset: assign((context, event) => {
|
|
280
287
|
return {
|
|
281
288
|
currentTab: null,
|
|
@@ -285,7 +292,6 @@ export default function (request) {
|
|
|
285
292
|
}
|
|
286
293
|
}),
|
|
287
294
|
resetPage: assign((context, event) => {
|
|
288
|
-
console.log('updateMessage resetPage')
|
|
289
295
|
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
290
296
|
inbox[currentTab].page = -1
|
|
291
297
|
return {
|
|
@@ -415,9 +421,10 @@ export default function (request) {
|
|
|
415
421
|
return tabs
|
|
416
422
|
},
|
|
417
423
|
fetchMessages: async (context, event) => {
|
|
424
|
+
const lang = context.lang
|
|
418
425
|
const { isRewardListEnable, currentTab, inbox } = JSON.parse(JSON.stringify(context))
|
|
419
|
-
if (isRewardListEnable && (currentTab === 'REWARD' || currentTab === 'DIAMOND')) {
|
|
420
|
-
const { data } = await request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
426
|
+
if (isRewardListEnable && (currentTab === 'REWARD' || currentTab === 'DIAMOND' || currentTab === 'FREE_GAME')) {
|
|
427
|
+
const { data } = await request.send(activity.getRewardList({ count: 30, appSecret, lang }))
|
|
421
428
|
inbox[currentTab] = { data, page: 0, totalPage: 1 }
|
|
422
429
|
} else {
|
|
423
430
|
const { page = -1 } = inbox[currentTab] || {}
|
|
@@ -429,11 +436,18 @@ export default function (request) {
|
|
|
429
436
|
return inbox
|
|
430
437
|
},
|
|
431
438
|
reFetchMessages: async (context, event) => {
|
|
432
|
-
const
|
|
433
|
-
const {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
439
|
+
const lang = context.lang
|
|
440
|
+
const { isRewardListEnable, currentTab, inbox } = JSON.parse(JSON.stringify(context))
|
|
441
|
+
|
|
442
|
+
if (isRewardListEnable && (currentTab === 'REWARD' || currentTab === 'DIAMOND' || currentTab === 'FREE_GAME')) {
|
|
443
|
+
const { data } = await request.send(activity.getRewardList({ count: 30, appSecret, lang }))
|
|
444
|
+
inbox[currentTab] = { data, page: 0, totalPage: 1 }
|
|
445
|
+
} else {
|
|
446
|
+
const { data, ...rest } = await request.send(mailbox.getMessageList({ type: currentTab, page: 0 }))
|
|
447
|
+
let formattedData = []
|
|
448
|
+
formattedData = data?.map((item) => ({ ...item, isSelected: false }))
|
|
449
|
+
inbox[currentTab] = { data: formattedData, ...rest }
|
|
450
|
+
}
|
|
437
451
|
return inbox
|
|
438
452
|
},
|
|
439
453
|
updateMessageIsRead: async (context, event) => {
|
package/src/machine/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import game_search_v2 from './game_search_v2.js'
|
|
|
10
10
|
import game_hot_new from './game_hot_new.js'
|
|
11
11
|
import game_info from './game_info.js'
|
|
12
12
|
import game_replay from './game_replay.js'
|
|
13
|
+
import game_betslip from './game_betslip.js'
|
|
13
14
|
import inbox from './inbox.js'
|
|
14
15
|
import merge from './merge.js'
|
|
15
16
|
import payment_data from './payment_data.js'
|
|
@@ -53,6 +54,7 @@ export default {
|
|
|
53
54
|
game_hot_new,
|
|
54
55
|
game_info,
|
|
55
56
|
game_replay,
|
|
57
|
+
game_betslip,
|
|
56
58
|
inbox,
|
|
57
59
|
merge,
|
|
58
60
|
payment_data,
|