@jetthai/cuora 1.0.205 → 1.0.302-dev-1
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 +4 -0
- package/.prettierignore +1 -0
- package/CHANGELOG.md +846 -0
- package/README.md +6 -0
- package/package.json +6 -9
- package/src/api/activity.js +43 -2
- package/src/api/auth.js +22 -7
- package/src/api/common.js +3 -1
- package/src/api/game.js +20 -7
- package/src/api/mailbox.js +9 -5
- package/src/api/payment.js +167 -19
- package/src/api/user.js +7 -0
- package/src/lib/fingerprint.js +9779 -0
- package/src/machine/activity/activity.js +111 -26
- package/src/machine/activity/activity_cash.js +159 -0
- package/src/machine/activity/cash_rain_activity.js +153 -0
- package/src/machine/activity/continue_deposit_activity.js +11 -2
- package/src/machine/activity/deposit_activity.js +13 -4
- package/src/machine/activity/diamond_shop_activity_cash.js +179 -0
- package/src/machine/activity/diamond_shop_activity_vn.js +54 -89
- package/src/machine/activity/fafafa_activity.js +34 -19
- package/src/machine/activity/{affiliate_invite_friends_activity.js → friend_invite_friends_activity.js} +70 -41
- package/src/machine/activity/index.js +22 -4
- package/src/machine/activity/instant_rebate_activity.js +217 -0
- package/src/machine/activity/invite_friends_activity.js +14 -14
- package/src/machine/activity/jackpot.js +74 -0
- package/src/machine/activity/otp_verified_activity.js +74 -0
- package/src/machine/activity/ranking_activity.js +11 -2
- package/src/machine/activity/roulette_activity_v2.js +90 -0
- package/src/machine/activity/sign_in_activity.js +21 -14
- package/src/machine/activity/sign_in_monthly_activity.js +65 -0
- package/src/machine/activity/specify_bets_activity.js +25 -3
- package/src/machine/activity/specify_turnover_activity.js +25 -3
- package/src/machine/activity/time_bomb_activity.js +11 -2
- package/src/machine/activity/vip_card_activity.js +140 -0
- package/src/machine/auth.js +141 -27
- package/src/machine/auth_otp_v2.js +10 -4
- package/src/machine/auth_otp_v3.js +11 -3
- package/src/machine/bank_binding.js +112 -12
- package/src/machine/bank_binding_amb.js +145 -0
- package/src/machine/common.js +113 -25
- package/src/machine/deposit/amb.js +92 -0
- package/src/machine/deposit/crypto.js +50 -29
- package/src/machine/deposit/crypto_bank.js +317 -0
- package/src/machine/deposit/crypto_bank_cash.js +287 -0
- package/src/machine/deposit/crypto_button.js +174 -39
- package/src/machine/deposit/crypto_cash.js +255 -0
- package/src/machine/deposit/crypto_qrcode.js +148 -0
- package/src/machine/deposit/crypto_qrcode_cash.js +131 -0
- package/src/machine/deposit/crypto_way.js +239 -0
- package/src/machine/deposit/crypto_way_cash.js +256 -0
- package/src/machine/deposit/deposit_fc.js +8 -5
- package/src/machine/deposit/direct.js +111 -16
- package/src/machine/deposit/direct_cash.js +217 -0
- package/src/machine/deposit/float.js +366 -0
- package/src/machine/deposit/index.js +43 -2
- package/src/machine/deposit/krway.js +151 -0
- package/src/machine/deposit/loadcard_cash.js +207 -0
- package/src/machine/deposit/loadcard_vn.js +191 -43
- package/src/machine/deposit/manual_cash.js +356 -0
- package/src/machine/deposit/manual_vn.js +182 -60
- package/src/machine/deposit/qrcode_cash.js +217 -0
- package/src/machine/deposit/qrcode_v2.js +285 -52
- package/src/machine/deposit/usdt.js +144 -0
- package/src/machine/deposit/usdt_cash.js +138 -0
- package/src/machine/deposit/vpay.js +359 -0
- package/src/machine/game_favorite_v2.js +70 -28
- package/src/machine/game_info.js +57 -0
- package/src/machine/game_search_cash.js +390 -0
- package/src/machine/game_search_v2.js +64 -24
- package/src/machine/game_v2_1.js +662 -0
- package/src/machine/honor_board_cash.js +63 -0
- package/src/machine/inbox.js +259 -34
- package/src/machine/index.js +24 -17
- package/src/machine/leaderboard.js +31 -8
- package/src/machine/navbar.js +57 -0
- package/src/machine/promotions.js +171 -0
- package/src/machine/reward.js +74 -7
- package/src/machine/reward_cash.js +219 -0
- package/src/machine/roulette_v2.js +276 -0
- package/src/machine/setting.js +5 -2
- package/src/machine/side_cash.js +110 -0
- package/src/machine/side_v2.js +33 -28
- package/src/machine/user_photo.js +65 -0
- package/src/machine/user_sign_up.js +117 -17
- package/src/machine/withdraw/index.js +23 -0
- package/src/machine/{withdraw_vn.js → withdraw/withdraw_amb.js} +146 -78
- package/src/machine/{withdraw_crypto.js → withdraw/withdraw_crypto.js} +220 -69
- package/src/machine/withdraw/withdraw_crypto2.js +540 -0
- package/src/machine/withdraw/withdraw_crypto_cash.js +319 -0
- package/src/machine/{withdraw_fc.js → withdraw/withdraw_fc.js} +2 -2
- package/src/machine/withdraw/withdraw_krway.js +207 -0
- package/src/machine/withdraw/withdraw_manual.js +595 -0
- package/src/machine/withdraw/withdraw_manual_cash.js +303 -0
- package/src/machine/withdraw/withdraw_vn.js +533 -0
- package/src/machine/withdraw/withdraw_vn2.js +548 -0
- package/src/request/request.js +10 -5
- package/src/util/constant.js +19 -1
- package/src/util/deviceToken.js +18 -8
- package/src/util/index.js +2 -1
- package/src/util/math.js +4 -0
- package/src/util/storage.js +22 -22
- package/dist/bundle.mjs +0 -18462
- package/rollup.config.js +0 -16
- package/src/machine/auth_otp.js +0 -201
- package/src/machine/deposit/qrcode_vn.js +0 -206
- package/src/machine/game.js +0 -285
- package/src/machine/game_favorite.js +0 -123
- package/src/machine/game_search.js +0 -244
- package/src/machine/game_v2.js +0 -356
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createMachine, assign } from 'xstate'
|
|
2
|
+
import activity from '../api/activity.js'
|
|
3
|
+
|
|
4
|
+
export default function (request) {
|
|
5
|
+
const { appSecret } = request.config
|
|
6
|
+
return createMachine(
|
|
7
|
+
{
|
|
8
|
+
id: 'honor_board',
|
|
9
|
+
initial: 'fetching',
|
|
10
|
+
context: {
|
|
11
|
+
tick: 6000,
|
|
12
|
+
bigWinList: [],
|
|
13
|
+
maxBetList: [],
|
|
14
|
+
withdrawList: [],
|
|
15
|
+
},
|
|
16
|
+
states: {
|
|
17
|
+
fetching: {
|
|
18
|
+
invoke: {
|
|
19
|
+
src: 'fetchHonorBoardList',
|
|
20
|
+
onDone: {
|
|
21
|
+
target: 'pending',
|
|
22
|
+
actions: 'setHonorBoardList',
|
|
23
|
+
},
|
|
24
|
+
onError: {
|
|
25
|
+
target: 'pending',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
pending: {
|
|
30
|
+
after: {
|
|
31
|
+
TIMEOUT: {
|
|
32
|
+
target: 'fetching',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
actions: {
|
|
40
|
+
setHonorBoardList: assign((context, event) => {
|
|
41
|
+
const { bigWinList = [], maxBetList = [], withdrawList = [] } = event.data
|
|
42
|
+
return {
|
|
43
|
+
bigWinList,
|
|
44
|
+
maxBetList,
|
|
45
|
+
withdrawList,
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
},
|
|
49
|
+
delays: {
|
|
50
|
+
TIMEOUT: (context, event) => {
|
|
51
|
+
const { tick } = context
|
|
52
|
+
return tick * 10
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
services: {
|
|
56
|
+
fetchHonorBoardList: async (context, event) => {
|
|
57
|
+
const { data } = await request.send(activity.getHonorBoard(appSecret))
|
|
58
|
+
return data
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
package/src/machine/inbox.js
CHANGED
|
@@ -3,13 +3,27 @@ import mailbox from '../api/mailbox.js'
|
|
|
3
3
|
import activity from '../api/activity.js'
|
|
4
4
|
|
|
5
5
|
const messageState = {
|
|
6
|
-
// always: [{ actions: 'showUnread', cond: 'isShowUnread' }],
|
|
7
6
|
initial: 'idle',
|
|
8
7
|
states: {
|
|
9
8
|
idle: {
|
|
10
9
|
initial: 'hidden',
|
|
11
10
|
states: {
|
|
12
11
|
hidden: {},
|
|
12
|
+
deleting: {
|
|
13
|
+
invoke: {
|
|
14
|
+
src: 'deleteMessages',
|
|
15
|
+
onDone: {
|
|
16
|
+
target: 'deleted',
|
|
17
|
+
actions: 'removeMessage',
|
|
18
|
+
},
|
|
19
|
+
onError: {
|
|
20
|
+
target: 'hidden',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
deleted: {
|
|
25
|
+
entry: ['cancelSelectMessages', 'hideMessage'],
|
|
26
|
+
},
|
|
13
27
|
shown: {
|
|
14
28
|
on: {
|
|
15
29
|
HIDE_MESSAGE: {
|
|
@@ -21,6 +35,15 @@ const messageState = {
|
|
|
21
35
|
},
|
|
22
36
|
on: {
|
|
23
37
|
SHOW_MESSAGE: [
|
|
38
|
+
{
|
|
39
|
+
target: 'fetchingCustomerMessage',
|
|
40
|
+
actions: 'showMessage',
|
|
41
|
+
cond: (context, event) => {
|
|
42
|
+
const { currentTab } = context
|
|
43
|
+
const { isRead } = event.data
|
|
44
|
+
return currentTab === 'CUSTOMER' && isRead
|
|
45
|
+
},
|
|
46
|
+
},
|
|
24
47
|
{
|
|
25
48
|
target: '.shown',
|
|
26
49
|
actions: 'showMessage',
|
|
@@ -31,19 +54,43 @@ const messageState = {
|
|
|
31
54
|
actions: ['showMessage', 'setMessageIsRead'],
|
|
32
55
|
},
|
|
33
56
|
],
|
|
57
|
+
SELECT_MESSAGES: {
|
|
58
|
+
actions: ['selectMessages', 'setDelectMessages'],
|
|
59
|
+
},
|
|
60
|
+
DELETE_MESSAGES: {
|
|
61
|
+
target: '.deleting',
|
|
62
|
+
},
|
|
34
63
|
},
|
|
35
64
|
},
|
|
36
|
-
|
|
65
|
+
fetchingCustomerMessage: {
|
|
37
66
|
invoke: {
|
|
38
|
-
src: '
|
|
67
|
+
src: 'getMessage',
|
|
39
68
|
onDone: {
|
|
40
69
|
target: 'idle.shown',
|
|
70
|
+
actions: 'setCustomerMessage',
|
|
41
71
|
},
|
|
42
72
|
onError: {
|
|
43
73
|
target: 'idle.shown',
|
|
44
74
|
},
|
|
45
75
|
},
|
|
46
76
|
},
|
|
77
|
+
updating: {
|
|
78
|
+
invoke: {
|
|
79
|
+
src: 'updateMessageIsRead',
|
|
80
|
+
onDone: [
|
|
81
|
+
{
|
|
82
|
+
target: 'fetchingCustomerMessage',
|
|
83
|
+
cond: 'isCustomer',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
target: 'idle.shown',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
onError: {
|
|
90
|
+
target: 'idle.shown',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
47
94
|
},
|
|
48
95
|
}
|
|
49
96
|
|
|
@@ -58,8 +105,12 @@ export default function (request) {
|
|
|
58
105
|
tabs: [],
|
|
59
106
|
currentTab: null,
|
|
60
107
|
inbox: {},
|
|
108
|
+
currentMessage: null,
|
|
61
109
|
messageDetail: null,
|
|
62
|
-
|
|
110
|
+
hasCustomer: false,
|
|
111
|
+
selectedDeleteMessages: null,
|
|
112
|
+
messageTitle: '',
|
|
113
|
+
messageContent: '',
|
|
63
114
|
},
|
|
64
115
|
states: {
|
|
65
116
|
loading: {
|
|
@@ -105,15 +156,62 @@ export default function (request) {
|
|
|
105
156
|
},
|
|
106
157
|
},
|
|
107
158
|
},
|
|
159
|
+
inquiring: {
|
|
160
|
+
invoke: {
|
|
161
|
+
src: 'accountInquiry',
|
|
162
|
+
onDone: {
|
|
163
|
+
target: 'inquired',
|
|
164
|
+
},
|
|
165
|
+
onError: {
|
|
166
|
+
target: 'failed',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
inquired: {
|
|
171
|
+
after: {
|
|
172
|
+
0: {
|
|
173
|
+
target: 'reloadMessages',
|
|
174
|
+
actions: 'cancelSelectMessages',
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
reloadMessages: {
|
|
179
|
+
invoke: {
|
|
180
|
+
src: 'reFetchMessages',
|
|
181
|
+
onDone: {
|
|
182
|
+
target: 'more',
|
|
183
|
+
actions: 'setInbox',
|
|
184
|
+
},
|
|
185
|
+
onError: {
|
|
186
|
+
target: 'end',
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
108
190
|
end: {
|
|
109
191
|
...messageState,
|
|
110
192
|
},
|
|
193
|
+
sending: {
|
|
194
|
+
invoke: {
|
|
195
|
+
src: 'sendMessage',
|
|
196
|
+
onDone: {
|
|
197
|
+
target: 'sended',
|
|
198
|
+
},
|
|
199
|
+
onError: {
|
|
200
|
+
target: 'end',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
sended: {
|
|
205
|
+
after: {
|
|
206
|
+
0: {
|
|
207
|
+
target: 'reloadMessages',
|
|
208
|
+
actions: ['cancelSelectMessages', 'hideMessage'],
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
111
212
|
failed: {},
|
|
112
213
|
},
|
|
113
214
|
on: {
|
|
114
|
-
// SHOW_SYSTEM_MESSAGE: {
|
|
115
|
-
// actions: 'showSystemMessage',
|
|
116
|
-
// },
|
|
117
215
|
SET_TAB: {
|
|
118
216
|
target: '.checking',
|
|
119
217
|
actions: ['setCurrentTab', 'hideMessage'],
|
|
@@ -126,6 +224,26 @@ export default function (request) {
|
|
|
126
224
|
target: '.loading',
|
|
127
225
|
actions: 'reset',
|
|
128
226
|
},
|
|
227
|
+
INQUIRY_ACCOUNT: {
|
|
228
|
+
target: '.inquiring',
|
|
229
|
+
actions: 'resetPage',
|
|
230
|
+
},
|
|
231
|
+
SET_TITLE: {
|
|
232
|
+
actions: 'setMessageTitle',
|
|
233
|
+
},
|
|
234
|
+
SET_CONTENT: {
|
|
235
|
+
actions: 'setMessageContent',
|
|
236
|
+
},
|
|
237
|
+
SEND_MESSAGE: {
|
|
238
|
+
target: '.sending',
|
|
239
|
+
cond: 'isSendable',
|
|
240
|
+
},
|
|
241
|
+
CANCEL_SELECT: {
|
|
242
|
+
actions: 'cancelSelectMessages',
|
|
243
|
+
},
|
|
244
|
+
CLEAR: {
|
|
245
|
+
actions: 'hideMessage',
|
|
246
|
+
},
|
|
129
247
|
},
|
|
130
248
|
},
|
|
131
249
|
{
|
|
@@ -145,23 +263,42 @@ export default function (request) {
|
|
|
145
263
|
isRead: (context, event) => {
|
|
146
264
|
return event.data.isRead
|
|
147
265
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
266
|
+
isCustomer: (context, event) => {
|
|
267
|
+
const { currentTab } = context
|
|
268
|
+
return currentTab === 'CUSTOMER'
|
|
269
|
+
},
|
|
270
|
+
isSendable: (context, event) => {
|
|
271
|
+
const { messageTitle, messageContent } = context
|
|
272
|
+
return !!messageTitle && !!messageContent
|
|
273
|
+
},
|
|
151
274
|
},
|
|
152
275
|
actions: {
|
|
153
276
|
reset: assign((context, event) => {
|
|
154
277
|
return {
|
|
155
|
-
tabs: [],
|
|
156
278
|
currentTab: null,
|
|
157
279
|
inbox: {},
|
|
158
280
|
messageDetail: null,
|
|
281
|
+
currentMessage: null,
|
|
282
|
+
}
|
|
283
|
+
}),
|
|
284
|
+
resetPage: assign((context, event) => {
|
|
285
|
+
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
286
|
+
inbox[currentTab].page = -1
|
|
287
|
+
return {
|
|
288
|
+
inbox,
|
|
289
|
+
messageDetail: null,
|
|
290
|
+
currentMessage: null,
|
|
159
291
|
}
|
|
160
292
|
}),
|
|
161
293
|
setTabs: assign((context, event) => {
|
|
162
|
-
let { currentTab } = context
|
|
294
|
+
let { currentTab, hasCustomer } = context
|
|
163
295
|
if (!currentTab) {
|
|
164
|
-
|
|
296
|
+
const customerTab = event.data?.find((tab) => tab === 'CUSTOMER')
|
|
297
|
+
if (!!customerTab && hasCustomer) {
|
|
298
|
+
currentTab = 'CUSTOMER'
|
|
299
|
+
} else {
|
|
300
|
+
currentTab = event.data?.[0]
|
|
301
|
+
}
|
|
165
302
|
}
|
|
166
303
|
return {
|
|
167
304
|
tabs: event.data,
|
|
@@ -173,29 +310,78 @@ export default function (request) {
|
|
|
173
310
|
currentTab: event.data,
|
|
174
311
|
}
|
|
175
312
|
}),
|
|
313
|
+
selectMessages: assign((context, event) => {
|
|
314
|
+
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
315
|
+
const data = inbox[currentTab].data.map((item) => {
|
|
316
|
+
if (item.groupId === event.data.groupId) {
|
|
317
|
+
item.isSelected = !item.isSelected
|
|
318
|
+
}
|
|
319
|
+
return item
|
|
320
|
+
})
|
|
321
|
+
inbox[currentTab].data = data
|
|
322
|
+
return { inbox }
|
|
323
|
+
}),
|
|
324
|
+
cancelSelectMessages: assign((context, event) => {
|
|
325
|
+
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
326
|
+
const data = inbox[currentTab].data.map((item) => {
|
|
327
|
+
item.isSelected = false
|
|
328
|
+
return item
|
|
329
|
+
})
|
|
330
|
+
inbox[currentTab].data = data
|
|
331
|
+
return { inbox, selectedDeleteMessages: null }
|
|
332
|
+
}),
|
|
333
|
+
setDelectMessages: assign((context, event) => {
|
|
334
|
+
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
335
|
+
const selectedMessages = inbox[currentTab].data?.filter((item) => item.isSelected)
|
|
336
|
+
const groupIdsArray = selectedMessages?.map((item) => item.groupId)
|
|
337
|
+
const groupIds = groupIdsArray?.join(',')
|
|
338
|
+
return {
|
|
339
|
+
selectedDeleteMessages: groupIds,
|
|
340
|
+
}
|
|
341
|
+
}),
|
|
342
|
+
setCustomerMessage: assign((context, event) => {
|
|
343
|
+
const { data = [] } = event.data
|
|
344
|
+
const isCustomerReply = data[0]?.from === 'SYSTEM'
|
|
345
|
+
let combindedContent = ''
|
|
346
|
+
if (isCustomerReply) {
|
|
347
|
+
combindedContent = '-\n-------------------------\n' + data[0]?.content || '' + '\n-------------------------\n' + data[1]?.content || ''
|
|
348
|
+
} else {
|
|
349
|
+
combindedContent = `-\n-------------------------\n${data[0]?.content || ''}`
|
|
350
|
+
}
|
|
351
|
+
return {
|
|
352
|
+
messageDetail: data,
|
|
353
|
+
messageTitle: data[data.length - 1]?.title,
|
|
354
|
+
messageContent: combindedContent,
|
|
355
|
+
}
|
|
356
|
+
}),
|
|
176
357
|
showMessage: assign((context, event) => {
|
|
177
358
|
return {
|
|
359
|
+
currentMessage: event.data,
|
|
178
360
|
messageDetail: event.data,
|
|
361
|
+
messageTitle: null,
|
|
362
|
+
messageContent: null,
|
|
179
363
|
}
|
|
180
364
|
}),
|
|
181
365
|
hideMessage: assign((context, event) => {
|
|
182
366
|
return {
|
|
367
|
+
messageTitle: null,
|
|
368
|
+
messageContent: null,
|
|
183
369
|
messageDetail: null,
|
|
370
|
+
currentMessage: null,
|
|
184
371
|
}
|
|
185
372
|
}),
|
|
373
|
+
removeMessage: assign((context, event) => {
|
|
374
|
+
const groupIds = event.data
|
|
375
|
+
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
376
|
+
const data = inbox[currentTab].data.filter((item) => !groupIds.find((groupId) => groupId === item.groupId))
|
|
377
|
+
inbox[currentTab].data = data
|
|
378
|
+
return { inbox }
|
|
379
|
+
}),
|
|
186
380
|
setInbox: assign((context, event) => {
|
|
187
381
|
return {
|
|
188
382
|
inbox: event.data,
|
|
189
383
|
}
|
|
190
384
|
}),
|
|
191
|
-
// showUnread: assign((context, event) => {
|
|
192
|
-
// const { currentTab, inbox } = context
|
|
193
|
-
// const messageDetail = inbox[currentTab]?.data.find((item) => !item.isRead)
|
|
194
|
-
// return {
|
|
195
|
-
// messageDetail,
|
|
196
|
-
// isShowUnread: false,
|
|
197
|
-
// }
|
|
198
|
-
// }),
|
|
199
385
|
setMessageIsRead: assign((context, event) => {
|
|
200
386
|
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
201
387
|
const data = inbox[currentTab].data.map((item) => {
|
|
@@ -207,12 +393,16 @@ export default function (request) {
|
|
|
207
393
|
inbox[currentTab].data = data
|
|
208
394
|
return { inbox }
|
|
209
395
|
}),
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
396
|
+
setMessageTitle: assign((context, event) => {
|
|
397
|
+
return {
|
|
398
|
+
messageTitle: event.data,
|
|
399
|
+
}
|
|
400
|
+
}),
|
|
401
|
+
setMessageContent: assign((context, event) => {
|
|
402
|
+
return {
|
|
403
|
+
messageContent: event.data,
|
|
404
|
+
}
|
|
405
|
+
}),
|
|
216
406
|
},
|
|
217
407
|
services: {
|
|
218
408
|
fetchTabs: async (context, event) => {
|
|
@@ -227,18 +417,53 @@ export default function (request) {
|
|
|
227
417
|
inbox[currentTab] = { data, page: 0, totalPage: 1 }
|
|
228
418
|
} else {
|
|
229
419
|
const { page = -1 } = inbox[currentTab] || {}
|
|
230
|
-
const
|
|
231
|
-
const
|
|
420
|
+
const { data, ...rest } = await request.send(mailbox.getMessageList({ type: currentTab, page: page + 1 }))
|
|
421
|
+
const formattedData = data?.map((item) => ({ ...item, isSelected: false }))
|
|
232
422
|
const currentData = inbox[currentTab]?.data || []
|
|
233
|
-
inbox[currentTab] = { data: currentData.concat(
|
|
423
|
+
inbox[currentTab] = { data: currentData.concat(formattedData), ...rest }
|
|
234
424
|
}
|
|
235
425
|
return inbox
|
|
236
426
|
},
|
|
427
|
+
reFetchMessages: async (context, event) => {
|
|
428
|
+
const { currentTab, inbox } = JSON.parse(JSON.stringify(context))
|
|
429
|
+
const { data, ...rest } = await request.send(mailbox.getMessageList({ type: currentTab, page: 0 }))
|
|
430
|
+
let formattedData = []
|
|
431
|
+
formattedData = data?.map((item) => ({ ...item, isSelected: false }))
|
|
432
|
+
inbox[currentTab] = { data: formattedData, ...rest }
|
|
433
|
+
return inbox
|
|
434
|
+
},
|
|
237
435
|
updateMessageIsRead: async (context, event) => {
|
|
238
|
-
const {
|
|
239
|
-
request.send(mailbox.updateMessage({ groupId:
|
|
240
|
-
|
|
241
|
-
|
|
436
|
+
const { currentMessage } = context
|
|
437
|
+
request.send(mailbox.updateMessage({ groupId: currentMessage.groupId, isRead: true }))
|
|
438
|
+
return true
|
|
439
|
+
},
|
|
440
|
+
deleteMessages: async (context, event) => {
|
|
441
|
+
const { selectedDeleteMessages } = context
|
|
442
|
+
const { groupId = '' } = await request.send(mailbox.updateMessage({ groupId: selectedDeleteMessages, isDelete: true }))
|
|
443
|
+
return groupId.split(',')
|
|
444
|
+
},
|
|
445
|
+
accountInquiry: async (context, event) => {
|
|
446
|
+
const { from, title, content } = event.data
|
|
447
|
+
return await request.send(mailbox.sendMessage({ type: 'CUSTOMER', category: 'DEPOSIT', from, to: 'SYSTEM', title, content }))
|
|
448
|
+
},
|
|
449
|
+
getMessage: async (context, event) => {
|
|
450
|
+
const { currentMessage } = context
|
|
451
|
+
return await request.send(mailbox.getMessage({ groupId: currentMessage.groupId }))
|
|
452
|
+
},
|
|
453
|
+
sendMessage: async (context, event) => {
|
|
454
|
+
const { currentMessage, messageTitle, messageContent } = context
|
|
455
|
+
const { from } = event.data
|
|
456
|
+
return await request.send(
|
|
457
|
+
mailbox.sendMessage({
|
|
458
|
+
// groupId: currentMessage?.groupId,
|
|
459
|
+
type: 'CUSTOMER',
|
|
460
|
+
category: 'MAIL',
|
|
461
|
+
from,
|
|
462
|
+
to: 'SYSTEM',
|
|
463
|
+
title: messageTitle,
|
|
464
|
+
content: messageContent,
|
|
465
|
+
})
|
|
466
|
+
)
|
|
242
467
|
},
|
|
243
468
|
},
|
|
244
469
|
}
|
package/src/machine/index.js
CHANGED
|
@@ -1,72 +1,79 @@
|
|
|
1
1
|
import activity from './activity/index.js'
|
|
2
2
|
import auth from './auth.js'
|
|
3
|
-
import auth_otp from './auth_otp.js'
|
|
4
3
|
import welcome from './welcome.js'
|
|
5
4
|
import common from './common.js'
|
|
6
5
|
import error from './error.js'
|
|
7
|
-
import
|
|
8
|
-
import game_v2 from './game_v2.js'
|
|
9
|
-
import game_favorite from './game_favorite.js'
|
|
6
|
+
import game_v2_1 from './game_v2_1.js'
|
|
10
7
|
import game_favorite_v2 from './game_favorite_v2.js'
|
|
11
|
-
import
|
|
8
|
+
import game_search_cash from './game_search_cash.js'
|
|
12
9
|
import game_search_v2 from './game_search_v2.js'
|
|
13
10
|
import game_hot_new from './game_hot_new.js'
|
|
11
|
+
import game_info from './game_info.js'
|
|
14
12
|
import inbox from './inbox.js'
|
|
15
13
|
import merge from './merge.js'
|
|
16
14
|
import payment_data from './payment_data.js'
|
|
17
15
|
import reward_fc from './reward_fc.js'
|
|
18
16
|
import reward from './reward.js'
|
|
17
|
+
import reward_cash from './reward_cash.js'
|
|
19
18
|
import setting from './setting.js'
|
|
20
19
|
import side from './side.js'
|
|
21
20
|
import side_v2 from './side_v2.js'
|
|
21
|
+
import side_cash from './side_cash.js'
|
|
22
22
|
import user_info from './user_info.js'
|
|
23
23
|
import user_sign_up from './user_sign_up.js'
|
|
24
24
|
import user_reset_password from './user_reset_password.js'
|
|
25
25
|
import bank_binding from './bank_binding.js'
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import withdraw_crypto from './withdraw_crypto.js'
|
|
26
|
+
import bank_binding_amb from './bank_binding_amb.js'
|
|
27
|
+
import withdraw from './withdraw/index.js'
|
|
29
28
|
import deposit from './deposit/index.js'
|
|
30
29
|
import bonus from './bonus.js'
|
|
31
30
|
import leaderboard from './leaderboard.js'
|
|
32
31
|
import auth_otp_v2 from './auth_otp_v2.js'
|
|
33
32
|
import auth_otp_v3 from './auth_otp_v3.js'
|
|
34
33
|
import vip_table from './vip_table.js'
|
|
34
|
+
import promotions from './promotions.js'
|
|
35
|
+
import roulette_v2 from './roulette_v2.js'
|
|
36
|
+
import honor_board_cash from './honor_board_cash.js'
|
|
37
|
+
import user_photo from './user_photo.js'
|
|
38
|
+
import navbar from './navbar.js'
|
|
35
39
|
|
|
36
40
|
export default {
|
|
37
41
|
...activity,
|
|
38
42
|
auth,
|
|
39
|
-
auth_otp,
|
|
40
43
|
welcome,
|
|
41
44
|
common,
|
|
42
|
-
deposit,
|
|
43
45
|
error,
|
|
44
|
-
game,
|
|
45
|
-
game_v2,
|
|
46
|
-
game_favorite,
|
|
47
46
|
game_favorite_v2,
|
|
48
|
-
|
|
47
|
+
game_search_cash,
|
|
49
48
|
game_search_v2,
|
|
50
49
|
game_hot_new,
|
|
50
|
+
game_info,
|
|
51
51
|
inbox,
|
|
52
52
|
merge,
|
|
53
53
|
payment_data,
|
|
54
54
|
reward,
|
|
55
|
+
reward_cash,
|
|
55
56
|
reward_fc,
|
|
56
57
|
setting,
|
|
57
58
|
side,
|
|
58
59
|
side_v2,
|
|
60
|
+
side_cash,
|
|
61
|
+
game_v2_1,
|
|
59
62
|
user_info,
|
|
60
63
|
user_sign_up,
|
|
61
64
|
user_reset_password,
|
|
62
65
|
bank_binding,
|
|
63
|
-
|
|
64
|
-
withdraw_vn,
|
|
65
|
-
withdraw_crypto,
|
|
66
|
+
bank_binding_amb,
|
|
66
67
|
...deposit,
|
|
67
68
|
bonus,
|
|
68
69
|
leaderboard,
|
|
69
70
|
auth_otp_v2,
|
|
70
71
|
auth_otp_v3,
|
|
71
72
|
vip_table,
|
|
73
|
+
promotions,
|
|
74
|
+
roulette_v2,
|
|
75
|
+
honor_board_cash,
|
|
76
|
+
user_photo,
|
|
77
|
+
navbar,
|
|
78
|
+
...withdraw,
|
|
72
79
|
}
|
|
@@ -18,7 +18,7 @@ export default function (request) {
|
|
|
18
18
|
invoke: {
|
|
19
19
|
src: 'fetchActivityList',
|
|
20
20
|
onDone: {
|
|
21
|
-
target: '
|
|
21
|
+
target: 'idle',
|
|
22
22
|
actions: 'setRankActivities',
|
|
23
23
|
},
|
|
24
24
|
onError: {
|
|
@@ -42,7 +42,7 @@ export default function (request) {
|
|
|
42
42
|
},
|
|
43
43
|
loading: {
|
|
44
44
|
invoke: {
|
|
45
|
-
src: '
|
|
45
|
+
src: 'fetchPublicActivityDetail',
|
|
46
46
|
onDone: {
|
|
47
47
|
target: 'idle',
|
|
48
48
|
actions: ['setActivityMap', 'setActivityDetail'],
|
|
@@ -62,7 +62,6 @@ export default function (request) {
|
|
|
62
62
|
// 200: cl_activity
|
|
63
63
|
return {
|
|
64
64
|
rankActivities,
|
|
65
|
-
activityNo: rankActivities?.[0]?.activityNo,
|
|
66
65
|
}
|
|
67
66
|
}),
|
|
68
67
|
setActivityNo: assign((context, event) => {
|
|
@@ -72,8 +71,21 @@ export default function (request) {
|
|
|
72
71
|
}),
|
|
73
72
|
setActivityMap: assign((context, event) => {
|
|
74
73
|
const { activityMap, activityNo } = context
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
if (event.data.rankingList) {
|
|
75
|
+
return {
|
|
76
|
+
activityMap: {
|
|
77
|
+
...activityMap,
|
|
78
|
+
[activityNo]: {
|
|
79
|
+
topRanking: event.data.rankingList,
|
|
80
|
+
awards: event.data.awards,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
return {
|
|
86
|
+
activityMap: { ...activityMap, [activityNo]: event.data },
|
|
87
|
+
awards: event.data?.awards,
|
|
88
|
+
}
|
|
77
89
|
}
|
|
78
90
|
}),
|
|
79
91
|
setActivityDetail: assign((context, event) => {
|
|
@@ -94,13 +106,24 @@ export default function (request) {
|
|
|
94
106
|
},
|
|
95
107
|
services: {
|
|
96
108
|
fetchActivityList: async (context, event) => {
|
|
109
|
+
// delay 1s for backend request throttle
|
|
110
|
+
await new Promise((resolve) => {
|
|
111
|
+
setTimeout(resolve, 1000)
|
|
112
|
+
})
|
|
113
|
+
|
|
97
114
|
const { data } = await request.send(api.getActivityList({ appSecret }))
|
|
98
115
|
return data
|
|
99
116
|
},
|
|
100
|
-
|
|
117
|
+
fetchPublicActivityDetail: async (context, event) => {
|
|
118
|
+
const hasToken = request.getToken()
|
|
101
119
|
const { activityNo } = context
|
|
102
|
-
|
|
103
|
-
|
|
120
|
+
let result = {}
|
|
121
|
+
if (hasToken) {
|
|
122
|
+
result = await request.send(api.getActivityDetail({ activityNo, appSecret }))
|
|
123
|
+
} else {
|
|
124
|
+
result = await request.send(api.getTournamentDetail({ activityNo, appSecret }))
|
|
125
|
+
}
|
|
126
|
+
return result.data
|
|
104
127
|
},
|
|
105
128
|
},
|
|
106
129
|
}
|