@jetthai/cuora 1.1.475 → 1.1.476-dev.0
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/.claude/commands/sync-ai-prompts.md +88 -1
- package/.claude/settings.local.json +3 -1
- package/.github/copilot-instructions.md +66 -61
- package/.husky/post-checkout +3 -3
- package/.husky/pre-push +1 -1
- package/.prettierignore +2 -1
- package/AGENTS.md +67 -62
- package/AI_PROMPT_SOURCE.md +67 -62
- package/CHANGELOG.md +260 -7
- package/CLAUDE.md +67 -62
- package/GEMINI.md +67 -62
- package/README.md +11 -12
- package/package.json +1 -1
- package/prepare-for-pr/JT-1776243420.md +85 -0
- package/scripts/auto-version.js +1 -0
- package/scripts/branch-auto-npm-publish.js +9 -2
- package/src/api/account.js +0 -1
- package/src/api/activity.js +0 -37
- package/src/api/auth.js +0 -31
- package/src/api/game.js +0 -10
- package/src/api/payment.js +1 -52
- package/src/api/user.js +0 -16
- package/src/index.js +2 -2
- package/src/machine/activity/activity_cash.js +14 -1
- package/src/machine/activity/diamond_shop_activity_cash.js +0 -1
- package/src/machine/activity/fafafa_activity.js +0 -10
- package/src/machine/activity/index.js +0 -12
- package/src/machine/auth.js +37 -59
- package/src/machine/auth_otp_v3.js +30 -19
- package/src/machine/common.js +0 -55
- package/src/machine/deposit/index.js +0 -28
- package/src/machine/deposit/manual_cash.js +0 -8
- package/src/machine/game_info.js +1 -12
- package/src/machine/game_v2_1.js +1 -89
- package/src/machine/honor_board_cash.js +15 -18
- package/src/machine/inbox.js +0 -12
- package/src/machine/index.js +0 -32
- package/src/machine/reward_cash.js +0 -39
- package/src/machine/roulette_v2.js +25 -16
- package/src/machine/user_reset_password.js +0 -13
- package/src/machine/user_sign_up.js +3 -0
- package/src/machine/websocket.js +0 -4
- package/src/machine/withdraw/index.js +0 -6
- package/src/request/request.js +0 -28
- package/src/util/constant.js +0 -1
- package/src/util/index.js +1 -4
- package/test/auth_otp_v3.test.js +192 -0
- package/src/machine/activity/activity.js +0 -209
- package/src/machine/activity/diamond_shop_activity_fc.js +0 -196
- package/src/machine/activity/diamond_shop_activity_vn.js +0 -178
- package/src/machine/activity/invite_friends_activity.js +0 -114
- package/src/machine/activity/mini_game_activity.js +0 -68
- package/src/machine/activity/return_bonus_activity.js +0 -153
- package/src/machine/auth_otp_v2.js +0 -177
- package/src/machine/bank_binding_amb.js +0 -146
- package/src/machine/bonus.js +0 -76
- package/src/machine/deposit/amb.js +0 -93
- package/src/machine/deposit/crypto_bank.js +0 -330
- package/src/machine/deposit/crypto_qrcode.js +0 -148
- package/src/machine/deposit/crypto_way.js +0 -252
- package/src/machine/deposit/deposit_fc.js +0 -272
- package/src/machine/deposit/direct.js +0 -310
- package/src/machine/deposit/float.js +0 -375
- package/src/machine/deposit/krway.js +0 -151
- package/src/machine/deposit/loadcard_vn.js +0 -351
- package/src/machine/deposit/manual_vn.js +0 -458
- package/src/machine/deposit/qrcode_v2.js +0 -338
- package/src/machine/deposit/usdt.js +0 -144
- package/src/machine/deposit/virtual_bank_vn.js +0 -269
- package/src/machine/deposit/vpay.js +0 -368
- package/src/machine/game_hot_new.js +0 -79
- package/src/machine/game_replay.js +0 -46
- package/src/machine/game_search_v2.js +0 -401
- package/src/machine/honor_board.js +0 -132
- package/src/machine/merge.js +0 -57
- package/src/machine/payment_data.js +0 -86
- package/src/machine/promotions.js +0 -170
- package/src/machine/reward.js +0 -255
- package/src/machine/reward_fc.js +0 -98
- package/src/machine/side.js +0 -154
- package/src/machine/side_v2.js +0 -211
- package/src/machine/vip_table.js +0 -57
- package/src/machine/welcome.js +0 -110
- package/src/machine/withdraw/withdraw_crypto_cash.js +0 -327
- package/src/machine/withdraw/withdraw_krway.js +0 -223
- package/src/machine/withdraw/withdraw_manual.js +0 -536
- package/src/util/math.js +0 -4
|
@@ -88,9 +88,6 @@ export default function (request, context) {
|
|
|
88
88
|
INPUT_USER_ACCOUNT_BRANCH_NAME: {
|
|
89
89
|
actions: 'setUserAccountBranchName',
|
|
90
90
|
},
|
|
91
|
-
INPUT_USER_ACCOUNT_BRANCH_CODE: {
|
|
92
|
-
actions: 'setUserAccountBranchCode',
|
|
93
|
-
},
|
|
94
91
|
INPUT_USER_ACCOUNT_NUMBER: {
|
|
95
92
|
actions: 'setUserAccountNumber',
|
|
96
93
|
},
|
|
@@ -240,11 +237,6 @@ export default function (request, context) {
|
|
|
240
237
|
userAccountBranchName: event.data,
|
|
241
238
|
}
|
|
242
239
|
}),
|
|
243
|
-
setUserAccountBranchCode: assign((context, event) => {
|
|
244
|
-
return {
|
|
245
|
-
userAccountBranchCode: event.data,
|
|
246
|
-
}
|
|
247
|
-
}),
|
|
248
240
|
setUserAccountNumber: assign((context, event) => {
|
|
249
241
|
return {
|
|
250
242
|
userAccountNumber: event.data,
|
package/src/machine/game_info.js
CHANGED
|
@@ -24,13 +24,7 @@ export default function (request, context) {
|
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
|
-
idle: {
|
|
28
|
-
// on: {
|
|
29
|
-
// SET_GAME_CODE: {
|
|
30
|
-
// actions: 'setGameCode',
|
|
31
|
-
// },
|
|
32
|
-
// },
|
|
33
|
-
},
|
|
27
|
+
idle: {},
|
|
34
28
|
},
|
|
35
29
|
},
|
|
36
30
|
{
|
|
@@ -40,11 +34,6 @@ export default function (request, context) {
|
|
|
40
34
|
gameInfo: event.data.data,
|
|
41
35
|
}
|
|
42
36
|
}),
|
|
43
|
-
// setGameCode: assign((context, event) => {
|
|
44
|
-
// return {
|
|
45
|
-
// gameCode: event.data.data,
|
|
46
|
-
// }
|
|
47
|
-
// }),
|
|
48
37
|
},
|
|
49
38
|
services: {
|
|
50
39
|
// 取得遊戲資訊
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -12,7 +12,6 @@ export default function (request) {
|
|
|
12
12
|
type: 'parallel',
|
|
13
13
|
context: {
|
|
14
14
|
base: '/',
|
|
15
|
-
batch: null,
|
|
16
15
|
loadable: false,
|
|
17
16
|
isLastPage: false,
|
|
18
17
|
pageLoading: true,
|
|
@@ -65,9 +64,6 @@ export default function (request) {
|
|
|
65
64
|
SET_STATIC_DATA: {
|
|
66
65
|
actions: 'setStaticData',
|
|
67
66
|
},
|
|
68
|
-
SET_ADDITION_ENABLE: {
|
|
69
|
-
actions: 'setAdditionEnable',
|
|
70
|
-
},
|
|
71
67
|
LOAD: {
|
|
72
68
|
target: 'routing',
|
|
73
69
|
actions: 'setLoadable',
|
|
@@ -81,9 +77,6 @@ export default function (request) {
|
|
|
81
77
|
cond: 'isDifferentRoom',
|
|
82
78
|
actions: ['setRoom', 'resetContent'],
|
|
83
79
|
},
|
|
84
|
-
BATCH: {
|
|
85
|
-
target: 'batchFetching',
|
|
86
|
-
},
|
|
87
80
|
ENTER_GAME: {
|
|
88
81
|
target: 'connecting',
|
|
89
82
|
actions: ['setGameInfo', 'setLang', 'setEntry', 'setWalletType'],
|
|
@@ -101,18 +94,6 @@ export default function (request) {
|
|
|
101
94
|
},
|
|
102
95
|
},
|
|
103
96
|
},
|
|
104
|
-
batchFetching: {
|
|
105
|
-
invoke: {
|
|
106
|
-
src: 'batchFetch',
|
|
107
|
-
onDone: {
|
|
108
|
-
target: 'idle',
|
|
109
|
-
actions: 'setBatch',
|
|
110
|
-
},
|
|
111
|
-
onError: {
|
|
112
|
-
target: 'idle',
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
97
|
loading: {
|
|
117
98
|
entry: 'increaseIndex',
|
|
118
99
|
invoke: {
|
|
@@ -230,7 +211,7 @@ export default function (request) {
|
|
|
230
211
|
actions: ['setSwitch', 'setLang', 'setEntry', 'setWalletType'],
|
|
231
212
|
},
|
|
232
213
|
ENTER_GAME_PAUSE: {
|
|
233
|
-
actions: ['setIsPlaying', 'resetContent'
|
|
214
|
+
actions: ['setIsPlaying', 'resetContent'],
|
|
234
215
|
},
|
|
235
216
|
ENTER_GAME: {
|
|
236
217
|
target: 'connecting',
|
|
@@ -344,11 +325,6 @@ export default function (request) {
|
|
|
344
325
|
staticData: event.data,
|
|
345
326
|
}
|
|
346
327
|
}),
|
|
347
|
-
setAdditionEnable: assign((context, event) => {
|
|
348
|
-
return {
|
|
349
|
-
additionEnable: event.data,
|
|
350
|
-
}
|
|
351
|
-
}),
|
|
352
328
|
setLoadable: assign((context, event) => {
|
|
353
329
|
return {
|
|
354
330
|
loadable: event.data,
|
|
@@ -366,11 +342,6 @@ export default function (request) {
|
|
|
366
342
|
room: event.data,
|
|
367
343
|
}
|
|
368
344
|
}),
|
|
369
|
-
setBatch: assign((context, event) => {
|
|
370
|
-
return {
|
|
371
|
-
batch: event.data,
|
|
372
|
-
}
|
|
373
|
-
}),
|
|
374
345
|
resetContent: assign((context, event) => {
|
|
375
346
|
return {
|
|
376
347
|
loadable: false,
|
|
@@ -510,65 +481,6 @@ export default function (request) {
|
|
|
510
481
|
},
|
|
511
482
|
},
|
|
512
483
|
services: {
|
|
513
|
-
batchFetch: async (context, event) => {
|
|
514
|
-
const { room, index, additionEnable, staticData } = context
|
|
515
|
-
let requestChain = null
|
|
516
|
-
if (!request.getToken()) {
|
|
517
|
-
// 如果沒 token ,id 列表去 static 找
|
|
518
|
-
const list = event.data.list.map((targetCategory, b) => {
|
|
519
|
-
return {
|
|
520
|
-
id: targetCategory.id,
|
|
521
|
-
i18n: targetCategory.i18n,
|
|
522
|
-
downLine: staticData
|
|
523
|
-
.find((item) => item.category === targetCategory.id)
|
|
524
|
-
.info.filter((item) => item.isGame)
|
|
525
|
-
.slice(0, 20),
|
|
526
|
-
}
|
|
527
|
-
})
|
|
528
|
-
return list.filter((item) => item.downLine.length > 0).slice(0, 6)
|
|
529
|
-
} else if (additionEnable) {
|
|
530
|
-
// [防呆] 確保有 categoryId
|
|
531
|
-
const hasCategoryId = !!room?.categoryId
|
|
532
|
-
const param = hasCategoryId ? { categoryId: room.categoryId, index, appSecret } : null
|
|
533
|
-
// [防呆] 確保有 categoryId
|
|
534
|
-
requestChain = event.data.list
|
|
535
|
-
.filter((category) => category?.id != null)
|
|
536
|
-
.map((category) =>
|
|
537
|
-
request
|
|
538
|
-
.send(
|
|
539
|
-
api.getListCategory({
|
|
540
|
-
categoryId: category.id,
|
|
541
|
-
index: 0,
|
|
542
|
-
appSecret,
|
|
543
|
-
})
|
|
544
|
-
)
|
|
545
|
-
.then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
|
|
546
|
-
)
|
|
547
|
-
const promises = [...requestChain]
|
|
548
|
-
if (hasCategoryId) {
|
|
549
|
-
promises.push(request.send(api.getListAddition(param)))
|
|
550
|
-
}
|
|
551
|
-
const result = await Promise.all(promises)
|
|
552
|
-
return result.filter((item) => item.downLine?.length > 0).slice(0, 6)
|
|
553
|
-
} else {
|
|
554
|
-
// [防呆] 確保有 categoryId
|
|
555
|
-
requestChain = event.data.list
|
|
556
|
-
.filter((category) => category?.id != null)
|
|
557
|
-
.map((category) =>
|
|
558
|
-
request
|
|
559
|
-
.send(
|
|
560
|
-
api.getListCategory({
|
|
561
|
-
categoryId: category.id,
|
|
562
|
-
index: 0,
|
|
563
|
-
appSecret,
|
|
564
|
-
})
|
|
565
|
-
)
|
|
566
|
-
.then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
|
|
567
|
-
)
|
|
568
|
-
const result = await Promise.all([...requestChain])
|
|
569
|
-
return result.filter((item) => item.downLine.length > 0).slice(0, 6)
|
|
570
|
-
}
|
|
571
|
-
},
|
|
572
484
|
getPageContent: async (context, event) => {
|
|
573
485
|
const { room, index, additionEnable, staticData } = context
|
|
574
486
|
// [防呆] 確保有 categoryId
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { createMachine, assign } from 'xstate'
|
|
2
2
|
import activity from '../api/activity.js'
|
|
3
3
|
|
|
4
|
+
const TAB_KEY_BY_TYPE = {
|
|
5
|
+
CASH_RAIN: 'cashRain',
|
|
6
|
+
DEPOSIT: 'deposit',
|
|
7
|
+
FREE_ROULETTE_SPIN: 'roulette',
|
|
8
|
+
JACKPOT: 'jackpot',
|
|
9
|
+
WIN_SCORE: 'bigWin',
|
|
10
|
+
WIN_MULTIPLIER: 'maxBet',
|
|
11
|
+
WITHDRAW: 'withdraw',
|
|
12
|
+
LATEST_BET: 'latestBet',
|
|
13
|
+
}
|
|
14
|
+
|
|
4
15
|
export default function (request) {
|
|
5
16
|
const { appSecret } = request.config
|
|
6
17
|
return createMachine(
|
|
@@ -17,6 +28,7 @@ export default function (request) {
|
|
|
17
28
|
bigWin: {},
|
|
18
29
|
maxBet: {},
|
|
19
30
|
withdraw: {},
|
|
31
|
+
latestBet: {},
|
|
20
32
|
},
|
|
21
33
|
states: {
|
|
22
34
|
fetching: {
|
|
@@ -44,24 +56,8 @@ export default function (request) {
|
|
|
44
56
|
actions: {
|
|
45
57
|
setHonorBoardList: assign((context, event) => {
|
|
46
58
|
return {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
case 'CASH_RAIN':
|
|
50
|
-
return 'cashRain'
|
|
51
|
-
case 'DEPOSIT':
|
|
52
|
-
return 'deposit'
|
|
53
|
-
case 'FREE_ROULETTE_SPIN':
|
|
54
|
-
return 'roulette'
|
|
55
|
-
case 'JACKPOT':
|
|
56
|
-
return 'jackpot'
|
|
57
|
-
case 'WIN_SCORE':
|
|
58
|
-
return 'bigWin'
|
|
59
|
-
case 'WIN_MULTIPLIER':
|
|
60
|
-
return 'maxBet'
|
|
61
|
-
case 'WITHDRAW':
|
|
62
|
-
return 'withdraw'
|
|
63
|
-
}
|
|
64
|
-
}),
|
|
59
|
+
// 後端新增的類型若尚未對應 tab key,略過以免產生 undefined tab
|
|
60
|
+
tabs: (event.data || []).map((list) => TAB_KEY_BY_TYPE[list.type]).filter(Boolean),
|
|
65
61
|
cashRain: (event.data || []).find((item) => item.type === 'CASH_RAIN') || {},
|
|
66
62
|
deposit: (event.data || []).find((item) => item.type === 'DEPOSIT') || {},
|
|
67
63
|
roulette: (event.data || []).find((item) => item.type === 'FREE_ROULETTE_SPIN') || {},
|
|
@@ -69,6 +65,7 @@ export default function (request) {
|
|
|
69
65
|
bigWin: (event.data || []).find((item) => item.type === 'WIN_SCORE') || {},
|
|
70
66
|
maxBet: (event.data || []).find((item) => item.type === 'WIN_MULTIPLIER') || {},
|
|
71
67
|
withdraw: (event.data || []).find((item) => item.type === 'WITHDRAW') || {},
|
|
68
|
+
latestBet: (event.data || []).find((item) => item.type === 'LATEST_BET') || {},
|
|
72
69
|
}
|
|
73
70
|
}),
|
|
74
71
|
},
|
package/src/machine/inbox.js
CHANGED
|
@@ -223,10 +223,6 @@ export default function (request) {
|
|
|
223
223
|
PRESET_TAB: {
|
|
224
224
|
actions: ['setCurrentTab', 'hideMessage'],
|
|
225
225
|
},
|
|
226
|
-
RESET: {
|
|
227
|
-
target: '.loading',
|
|
228
|
-
actions: 'reset',
|
|
229
|
-
},
|
|
230
226
|
INQUIRY_ACCOUNT: {
|
|
231
227
|
target: '.inquiring',
|
|
232
228
|
actions: 'resetPage',
|
|
@@ -283,14 +279,6 @@ export default function (request) {
|
|
|
283
279
|
const lang = event.data.locale || context.lang || 'en-US'
|
|
284
280
|
return { lang }
|
|
285
281
|
}),
|
|
286
|
-
reset: assign((context, event) => {
|
|
287
|
-
return {
|
|
288
|
-
currentTab: null,
|
|
289
|
-
inbox: {},
|
|
290
|
-
messageDetail: null,
|
|
291
|
-
currentMessage: null,
|
|
292
|
-
}
|
|
293
|
-
}),
|
|
294
282
|
resetPage: assign((context, event) => {
|
|
295
283
|
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
296
284
|
inbox[currentTab].page = -1
|
package/src/machine/index.js
CHANGED
|
@@ -1,42 +1,26 @@
|
|
|
1
1
|
import activity from './activity/index.js'
|
|
2
2
|
import auth from './auth.js'
|
|
3
|
-
import welcome from './welcome.js'
|
|
4
3
|
import common from './common.js'
|
|
5
4
|
import error from './error.js'
|
|
6
5
|
import game_v2_1 from './game_v2_1.js'
|
|
7
6
|
import game_favorite_v2 from './game_favorite_v2.js'
|
|
8
7
|
import game_search_cash from './game_search_cash.js'
|
|
9
|
-
import game_search_v2 from './game_search_v2.js'
|
|
10
|
-
import game_hot_new from './game_hot_new.js'
|
|
11
8
|
import game_info from './game_info.js'
|
|
12
|
-
import game_replay from './game_replay.js'
|
|
13
9
|
import game_betslip from './game_betslip.js'
|
|
14
10
|
import inbox from './inbox.js'
|
|
15
|
-
import merge from './merge.js'
|
|
16
|
-
import payment_data from './payment_data.js'
|
|
17
|
-
import reward_fc from './reward_fc.js'
|
|
18
|
-
import reward from './reward.js'
|
|
19
11
|
import reward_cash from './reward_cash.js'
|
|
20
12
|
import setting from './setting.js'
|
|
21
|
-
import side from './side.js'
|
|
22
|
-
import side_v2 from './side_v2.js'
|
|
23
13
|
import side_cash from './side_cash.js'
|
|
24
14
|
import user_info from './user_info.js'
|
|
25
15
|
import user_sign_up from './user_sign_up.js'
|
|
26
16
|
import user_reset_password from './user_reset_password.js'
|
|
27
17
|
import bank_binding from './bank_binding.js'
|
|
28
|
-
import bank_binding_amb from './bank_binding_amb.js'
|
|
29
18
|
import withdraw from './withdraw/index.js'
|
|
30
19
|
import deposit from './deposit/index.js'
|
|
31
|
-
import bonus from './bonus.js'
|
|
32
20
|
import leaderboard from './leaderboard.js'
|
|
33
|
-
import auth_otp_v2 from './auth_otp_v2.js'
|
|
34
21
|
import auth_otp_v3 from './auth_otp_v3.js'
|
|
35
|
-
import vip_table from './vip_table.js'
|
|
36
|
-
import promotions from './promotions.js'
|
|
37
22
|
import roulette_v2 from './roulette_v2.js'
|
|
38
23
|
import honor_board_cash from './honor_board_cash.js'
|
|
39
|
-
import honor_board from './honor_board.js'
|
|
40
24
|
import user_photo from './user_photo.js'
|
|
41
25
|
import navbar from './navbar.js'
|
|
42
26
|
import websocket from './websocket.js'
|
|
@@ -45,42 +29,26 @@ import ranking from './ranking.js'
|
|
|
45
29
|
export default {
|
|
46
30
|
...activity,
|
|
47
31
|
auth,
|
|
48
|
-
welcome,
|
|
49
32
|
common,
|
|
50
33
|
error,
|
|
51
34
|
game_favorite_v2,
|
|
52
35
|
game_search_cash,
|
|
53
|
-
game_search_v2,
|
|
54
|
-
game_hot_new,
|
|
55
36
|
game_info,
|
|
56
|
-
game_replay,
|
|
57
37
|
game_betslip,
|
|
58
38
|
inbox,
|
|
59
|
-
merge,
|
|
60
|
-
payment_data,
|
|
61
|
-
reward,
|
|
62
39
|
reward_cash,
|
|
63
|
-
reward_fc,
|
|
64
40
|
setting,
|
|
65
|
-
side,
|
|
66
|
-
side_v2,
|
|
67
41
|
side_cash,
|
|
68
42
|
game_v2_1,
|
|
69
43
|
user_info,
|
|
70
44
|
user_sign_up,
|
|
71
45
|
user_reset_password,
|
|
72
46
|
bank_binding,
|
|
73
|
-
bank_binding_amb,
|
|
74
47
|
...deposit,
|
|
75
|
-
bonus,
|
|
76
48
|
leaderboard,
|
|
77
|
-
auth_otp_v2,
|
|
78
49
|
auth_otp_v3,
|
|
79
|
-
vip_table,
|
|
80
|
-
promotions,
|
|
81
50
|
roulette_v2,
|
|
82
51
|
honor_board_cash,
|
|
83
|
-
honor_board,
|
|
84
52
|
user_photo,
|
|
85
53
|
navbar,
|
|
86
54
|
...withdraw,
|
|
@@ -63,10 +63,6 @@ export default function (request, context) {
|
|
|
63
63
|
states: {
|
|
64
64
|
idle: {
|
|
65
65
|
on: {
|
|
66
|
-
FETCH_WITHDRAW_RULE: {
|
|
67
|
-
target: 'fetching',
|
|
68
|
-
actions: 'setRewardData',
|
|
69
|
-
},
|
|
70
66
|
FETCH_OTHER_REWARD: {
|
|
71
67
|
target: 'fetchingOtherReward',
|
|
72
68
|
actions: 'setOrderColumn',
|
|
@@ -84,18 +80,6 @@ export default function (request, context) {
|
|
|
84
80
|
},
|
|
85
81
|
},
|
|
86
82
|
},
|
|
87
|
-
fetching: {
|
|
88
|
-
invoke: {
|
|
89
|
-
src: 'fetchWithdrawRulePreview',
|
|
90
|
-
onDone: {
|
|
91
|
-
target: 'pending',
|
|
92
|
-
actions: 'setWithdrawRulePreview',
|
|
93
|
-
},
|
|
94
|
-
onError: {
|
|
95
|
-
target: 'idle',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
83
|
fetchingOtherReward: {
|
|
100
84
|
invoke: {
|
|
101
85
|
src: 'fetchOtherRewardList',
|
|
@@ -180,13 +164,6 @@ export default function (request, context) {
|
|
|
180
164
|
otherRewardList: event.data[0]?.data,
|
|
181
165
|
}
|
|
182
166
|
}),
|
|
183
|
-
setRewardData: assign((context, event) => {
|
|
184
|
-
const { activityNo, receiveNo } = event.data
|
|
185
|
-
return {
|
|
186
|
-
activityNo,
|
|
187
|
-
receiveNo,
|
|
188
|
-
}
|
|
189
|
-
}),
|
|
190
167
|
setCallback: assign((context, event) => {
|
|
191
168
|
return {
|
|
192
169
|
callback: event.data?.callback || (() => {}),
|
|
@@ -200,11 +177,6 @@ export default function (request, context) {
|
|
|
200
177
|
doCallback: (context, event) => {
|
|
201
178
|
context.callback()
|
|
202
179
|
},
|
|
203
|
-
setWithdrawRulePreview: assign((context, event) => {
|
|
204
|
-
return {
|
|
205
|
-
withdrawRule: event.data,
|
|
206
|
-
}
|
|
207
|
-
}),
|
|
208
180
|
setLang: assign((context, event) => {
|
|
209
181
|
const lang = event.data.locale || context.lang || 'en-US'
|
|
210
182
|
return { lang }
|
|
@@ -250,17 +222,6 @@ export default function (request, context) {
|
|
|
250
222
|
const [otherRewardList] = await Promise.all([getOtherRewardAPI])
|
|
251
223
|
return [otherRewardList]
|
|
252
224
|
},
|
|
253
|
-
fetchWithdrawRulePreview: async (context, event) => {
|
|
254
|
-
const { receiveNo } = context
|
|
255
|
-
const data = await request.send(
|
|
256
|
-
payment.getWithdrawRulePreview({
|
|
257
|
-
applyType: 'activity',
|
|
258
|
-
applyNo: receiveNo,
|
|
259
|
-
amount: null,
|
|
260
|
-
})
|
|
261
|
-
)
|
|
262
|
-
return data
|
|
263
|
-
},
|
|
264
225
|
receiveReward: async (context, event) => {
|
|
265
226
|
const { activityNo, receiveNo, attended } = event.data
|
|
266
227
|
// Number("")-> 0 / Number(" ") -> 0 需要收到實際的數字才傳給後端
|
|
@@ -24,7 +24,6 @@ export default function (request) {
|
|
|
24
24
|
spinResult: {},
|
|
25
25
|
rouletteV2ExchangeAward: [],
|
|
26
26
|
calculatedNewSpinRewards: [],
|
|
27
|
-
isSpinOutOfStock: false,
|
|
28
27
|
awardedCashAmount: 0,
|
|
29
28
|
awardedFreeAmount: 0,
|
|
30
29
|
awardedPointsAmount: 0,
|
|
@@ -210,26 +209,36 @@ export default function (request) {
|
|
|
210
209
|
}),
|
|
211
210
|
setSpinResult: assign((context, event) => {
|
|
212
211
|
const { unCollectRewards = [], newSpinRewards = [], spinLeft = 0 } = JSON.parse(JSON.stringify(event.data || {}))
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
212
|
+
const calculatedNewSpinRewards = newSpinRewards
|
|
213
|
+
.map((item) => {
|
|
214
|
+
item.count = 1
|
|
215
|
+
return item
|
|
216
|
+
})
|
|
217
|
+
.reduce((arr, spin) => {
|
|
218
|
+
let newIndex = 0
|
|
219
|
+
let alreadyHave = false
|
|
220
|
+
if (arr.length > 0) {
|
|
221
|
+
alreadyHave = arr.find((item, index) => {
|
|
222
|
+
if (item.rewardType === spin.rewardType && item.reward === spin.reward) {
|
|
223
|
+
newIndex = index
|
|
224
|
+
return true
|
|
225
|
+
} else {
|
|
226
|
+
return false
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
}
|
|
230
|
+
if (alreadyHave) {
|
|
231
|
+
arr[newIndex].count++
|
|
232
|
+
} else {
|
|
233
|
+
arr.push(spin)
|
|
234
|
+
}
|
|
235
|
+
return arr
|
|
236
|
+
}, [])
|
|
226
237
|
|
|
227
238
|
return {
|
|
228
239
|
spinResult: event.data,
|
|
229
240
|
unCollectRewards,
|
|
230
241
|
calculatedNewSpinRewards,
|
|
231
|
-
// 本次抽獎含缺貨項目(單次 Spin 缺貨或 Spin All 部分/全部缺貨),前台以此決定是否改顯示通用缺貨提示
|
|
232
|
-
isSpinOutOfStock: newSpinRewards.some(isOutOfStock),
|
|
233
242
|
spinLeft,
|
|
234
243
|
}
|
|
235
244
|
}),
|
|
@@ -28,10 +28,6 @@ export default function (request) {
|
|
|
28
28
|
target: 'otpFetching',
|
|
29
29
|
actions: 'setOtpParamsEmail',
|
|
30
30
|
},
|
|
31
|
-
SEND_OTP_LOCAL: {
|
|
32
|
-
target: 'otpFetching',
|
|
33
|
-
actions: 'setOtpParamsLocal',
|
|
34
|
-
},
|
|
35
31
|
SEND_OTP_PHONE: {
|
|
36
32
|
target: 'otpFetching',
|
|
37
33
|
actions: 'setOtpParamsPhone',
|
|
@@ -157,15 +153,6 @@ export default function (request) {
|
|
|
157
153
|
},
|
|
158
154
|
}
|
|
159
155
|
}),
|
|
160
|
-
setOtpParamsLocal: assign((context, event) => {
|
|
161
|
-
const { username } = event.data
|
|
162
|
-
return {
|
|
163
|
-
otpParams: {
|
|
164
|
-
provider: 'local',
|
|
165
|
-
username,
|
|
166
|
-
},
|
|
167
|
-
}
|
|
168
|
-
}),
|
|
169
156
|
setOtpParamsEmail: assign((context, event) => {
|
|
170
157
|
const { email } = event.data
|
|
171
158
|
return {
|
|
@@ -107,6 +107,7 @@ export default function (request) {
|
|
|
107
107
|
return {
|
|
108
108
|
signUpData: {
|
|
109
109
|
provider: 'local',
|
|
110
|
+
birthday,
|
|
110
111
|
...pickBindData(event.data),
|
|
111
112
|
birthday,
|
|
112
113
|
email,
|
|
@@ -130,6 +131,7 @@ export default function (request) {
|
|
|
130
131
|
return {
|
|
131
132
|
signUpData: {
|
|
132
133
|
provider: 'phone',
|
|
134
|
+
birthday,
|
|
133
135
|
...pickBindData(event.data),
|
|
134
136
|
birthday,
|
|
135
137
|
email,
|
|
@@ -152,6 +154,7 @@ export default function (request) {
|
|
|
152
154
|
return {
|
|
153
155
|
signUpData: {
|
|
154
156
|
provider: 'email',
|
|
157
|
+
birthday,
|
|
155
158
|
...pickBindData(event.data),
|
|
156
159
|
birthday,
|
|
157
160
|
email,
|
package/src/machine/websocket.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import withdraw_manual from './withdraw_manual.js'
|
|
2
|
-
import withdraw_krway from './withdraw_krway.js'
|
|
3
|
-
import withdraw_crypto_cash from './withdraw_crypto_cash.js'
|
|
4
1
|
import withdraw_manual_cash from './withdraw_manual_cash.js'
|
|
5
2
|
|
|
6
3
|
export default {
|
|
7
|
-
withdraw_manual,
|
|
8
|
-
withdraw_krway,
|
|
9
|
-
withdraw_crypto_cash,
|
|
10
4
|
withdraw_manual_cash,
|
|
11
5
|
}
|