@jetthai/cuora 1.1.364-dev-5 → 1.1.364-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/CHANGELOG.md +25 -15
- package/package.json +1 -1
- package/resetGitBranch.sh +49 -0
- package/src/api/activity.js +2 -2
- package/src/api/game.js +14 -1
- package/src/api/payment.js +5 -0
- package/src/api/ranking.js +4 -3
- package/src/machine/activity/activity.js +7 -6
- package/src/machine/activity/vip_card_activity.js +17 -9
- package/src/machine/bank_binding.js +44 -10
- package/src/machine/common.js +3 -1
- package/src/machine/deposit/direct.js +2 -6
- package/src/machine/deposit/float.js +2 -2
- package/src/machine/deposit/loadcard_vn.js +10 -51
- package/src/machine/deposit/manual_vn.js +3 -23
- package/src/machine/deposit/qrcode_v2.js +6 -132
- package/src/machine/deposit/virtual_bank_vn.js +3 -31
- package/src/machine/deposit/vpay.js +2 -2
- package/src/machine/game_betslip.js +46 -0
- package/src/machine/game_search_cash.js +10 -2
- package/src/machine/game_search_v2.js +10 -2
- package/src/machine/game_v2_1.js +81 -12
- package/src/machine/inbox.js +13 -1
- package/src/machine/index.js +2 -0
- package/src/machine/promotions.js +4 -5
- package/src/machine/ranking.js +38 -22
- package/src/machine/reward.js +57 -5
- package/src/machine/reward_cash.js +56 -15
- package/src/machine/setting.js +7 -0
- package/src/machine/withdraw/index.js +0 -12
- package/src/machine/withdraw/withdraw_manual.js +3 -97
- package/src/machine/withdraw/withdraw_manual_cash.js +1 -1
- package/src/machine/withdraw/withdraw_amb.js +0 -373
- package/src/machine/withdraw/withdraw_crypto.js +0 -495
- package/src/machine/withdraw/withdraw_crypto2.js +0 -540
- package/src/machine/withdraw/withdraw_fc.js +0 -251
- package/src/machine/withdraw/withdraw_vn.js +0 -548
- package/src/machine/withdraw/withdraw_vn2.js +0 -563
package/src/machine/ranking.js
CHANGED
|
@@ -3,11 +3,13 @@ import ranking from '../api/ranking.js'
|
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const cycleMapping = ['DAILY', 'WEEKLY', 'MONTHLY']
|
|
6
|
+
const limit = { DAILY: 56, WEEKLY: 8, MONTHLY: 2, ALL: 2 }
|
|
6
7
|
|
|
7
|
-
function roundProcess(rounds) {
|
|
8
|
+
function roundProcess(rounds, cycles) {
|
|
8
9
|
const roundArrays = rounds.map((round) => Array.from({ length: round }, (_, i) => i + 1))
|
|
9
10
|
return roundArrays.reduce((acc, roundArray, index) => {
|
|
10
|
-
|
|
11
|
+
const max = limit[cycles[index]] || rounds[index] // 若沒限制則取全部
|
|
12
|
+
acc[cycles[index]] = roundArray.reverse().slice(0, max)
|
|
11
13
|
return acc
|
|
12
14
|
}, {})
|
|
13
15
|
}
|
|
@@ -24,6 +26,7 @@ export default function (request) {
|
|
|
24
26
|
initial: 'idle',
|
|
25
27
|
context: {
|
|
26
28
|
auth: false,
|
|
29
|
+
site: '',
|
|
27
30
|
activityNo: '',
|
|
28
31
|
// api options 回傳的資料
|
|
29
32
|
currentRound: [],
|
|
@@ -54,32 +57,43 @@ export default function (request) {
|
|
|
54
57
|
},
|
|
55
58
|
loading: {
|
|
56
59
|
entry: 'setActivity',
|
|
57
|
-
always: [{ target: 'getRankingOptions'
|
|
60
|
+
always: [{ target: 'getRankingOptions' }],
|
|
58
61
|
},
|
|
59
62
|
setting: {
|
|
60
63
|
entry: 'setOptions',
|
|
61
|
-
always: [{ target: 'getRankingDetail' }],
|
|
64
|
+
always: [{ target: 'getRankingDetail', cond: 'hasAuth' }, { target: 'getTournament' }],
|
|
62
65
|
},
|
|
63
|
-
//
|
|
64
|
-
|
|
66
|
+
// 取得排名選單資料
|
|
67
|
+
getRankingOptions: {
|
|
65
68
|
invoke: {
|
|
66
|
-
src: '
|
|
69
|
+
src: 'fetchRankingOptions',
|
|
67
70
|
onDone: {
|
|
68
|
-
target: '
|
|
69
|
-
actions: '
|
|
71
|
+
target: 'decideNextAfterOptions',
|
|
72
|
+
actions: 'setRankingOptions',
|
|
70
73
|
},
|
|
71
74
|
onError: {
|
|
72
75
|
target: 'idle',
|
|
73
76
|
},
|
|
74
77
|
},
|
|
75
78
|
},
|
|
76
|
-
//
|
|
77
|
-
|
|
79
|
+
// 取得排名選單資料後的跳轉
|
|
80
|
+
decideNextAfterOptions: {
|
|
81
|
+
always: [
|
|
82
|
+
// 有登入且為冠軍: 先拿遊戲排行榜再拿排行榜資料
|
|
83
|
+
{ target: 'getRankingGames', cond: 'canGetGameRanking' },
|
|
84
|
+
// 有登入但不為冠軍活動: 直接拿排行榜資料
|
|
85
|
+
{ target: 'getRankingDetail', cond: 'hasAuth' },
|
|
86
|
+
// 未登入; 拿未登入的排行榜資料
|
|
87
|
+
{ target: 'getTournament' },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
// 未登入時取得排名資料
|
|
91
|
+
getTournament: {
|
|
78
92
|
invoke: {
|
|
79
|
-
src: '
|
|
93
|
+
src: 'fetchTournament',
|
|
80
94
|
onDone: {
|
|
81
|
-
target: '
|
|
82
|
-
actions: '
|
|
95
|
+
target: 'idle',
|
|
96
|
+
actions: 'setRanking',
|
|
83
97
|
},
|
|
84
98
|
onError: {
|
|
85
99
|
target: 'idle',
|
|
@@ -117,6 +131,7 @@ export default function (request) {
|
|
|
117
131
|
actions: {
|
|
118
132
|
setActivity: assign((context, event) => {
|
|
119
133
|
return {
|
|
134
|
+
site: event.data?.site,
|
|
120
135
|
auth: !!request.getToken(),
|
|
121
136
|
activityNo: event.data?.activityNo,
|
|
122
137
|
}
|
|
@@ -138,14 +153,14 @@ export default function (request) {
|
|
|
138
153
|
}
|
|
139
154
|
}),
|
|
140
155
|
setRankingOptions: assign((context, event) => {
|
|
156
|
+
const isChampion = event.data?.rule === 'CHAMPION'
|
|
141
157
|
const cycle = event.data?.cycle
|
|
142
158
|
const currentRound = event.data?.currentRound || []
|
|
143
159
|
// 取得結算週期選單列表
|
|
144
|
-
const cycleOptions = cycleMapping.slice(0, currentRound.length)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (cycle === 'MONTHLY') {
|
|
160
|
+
const cycleOptions = isChampion ? cycleMapping.slice(0, currentRound.length) : [cycle]
|
|
161
|
+
const roundOptions = roundProcess(currentRound, cycleOptions)
|
|
162
|
+
// 如果是冠軍龍虎月結算,則加入全部選項
|
|
163
|
+
if (cycle === 'MONTHLY' && isChampion) {
|
|
149
164
|
cycleOptions.push('ALL')
|
|
150
165
|
roundOptions.ALL = roundOptions.MONTHLY
|
|
151
166
|
}
|
|
@@ -153,7 +168,7 @@ export default function (request) {
|
|
|
153
168
|
...event.data,
|
|
154
169
|
options: { cycle: cycleOptions, round: roundOptions },
|
|
155
170
|
// 初始固定顯示 DAILY
|
|
156
|
-
cycle:
|
|
171
|
+
cycle: isChampion ? 'DAILY' : cycle,
|
|
157
172
|
round: currentRound[0],
|
|
158
173
|
}
|
|
159
174
|
}),
|
|
@@ -174,11 +189,12 @@ export default function (request) {
|
|
|
174
189
|
},
|
|
175
190
|
guards: {
|
|
176
191
|
hasAuth: (context) => context.auth,
|
|
192
|
+
canGetGameRanking: (context) => context.auth && context.rule === 'CHAMPION',
|
|
177
193
|
},
|
|
178
194
|
services: {
|
|
179
195
|
fetchTournament: async (context) => {
|
|
180
|
-
const { activityNo } = context
|
|
181
|
-
const { data } = await request.send(ranking.getTournament({ activityNo }))
|
|
196
|
+
const { activityNo, cycle, round, site } = context
|
|
197
|
+
const { data } = await request.send(ranking.getTournament({ activityNo, cycle, round, site }))
|
|
182
198
|
return data
|
|
183
199
|
},
|
|
184
200
|
fetchRankingOptions: async (context) => {
|
package/src/machine/reward.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createMachine, assign, send } from 'xstate'
|
|
|
2
2
|
import activity from '../api/activity.js'
|
|
3
3
|
import payment from '../api/payment.js'
|
|
4
4
|
|
|
5
|
-
export default function (request) {
|
|
5
|
+
export default function (request, context) {
|
|
6
6
|
const { appSecret } = request.config
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
@@ -18,6 +18,8 @@ export default function (request) {
|
|
|
18
18
|
rewardType: null,
|
|
19
19
|
isPlaying: false,
|
|
20
20
|
callback: () => {},
|
|
21
|
+
orderColumn: 'createTime',
|
|
22
|
+
lang: context?.locale,
|
|
21
23
|
},
|
|
22
24
|
states: {
|
|
23
25
|
timer: {
|
|
@@ -37,7 +39,7 @@ export default function (request) {
|
|
|
37
39
|
},
|
|
38
40
|
pending: {
|
|
39
41
|
after: {
|
|
40
|
-
20000: { target: 'loading', cond: 'isNotInGame' },
|
|
42
|
+
20000: [{ target: 'loading', cond: 'isNotInGame' }, { target: 'pending' }],
|
|
41
43
|
},
|
|
42
44
|
},
|
|
43
45
|
},
|
|
@@ -56,6 +58,10 @@ export default function (request) {
|
|
|
56
58
|
target: 'fetching',
|
|
57
59
|
actions: 'setRewardData',
|
|
58
60
|
},
|
|
61
|
+
FETCH_OTHER_REWARD: {
|
|
62
|
+
target: 'fetchingOtherReward',
|
|
63
|
+
actions: 'setOrderColumn',
|
|
64
|
+
},
|
|
59
65
|
RECEIVE_REWARD: {
|
|
60
66
|
target: 'receiving',
|
|
61
67
|
actions: ['setCallback', 'setRewardType'],
|
|
@@ -67,6 +73,9 @@ export default function (request) {
|
|
|
67
73
|
SET_IS_PLAYING: {
|
|
68
74
|
actions: 'setIsPlaying',
|
|
69
75
|
},
|
|
76
|
+
SET_LANG: {
|
|
77
|
+
actions: 'setLang',
|
|
78
|
+
},
|
|
70
79
|
},
|
|
71
80
|
},
|
|
72
81
|
fetching: {
|
|
@@ -81,6 +90,18 @@ export default function (request) {
|
|
|
81
90
|
},
|
|
82
91
|
},
|
|
83
92
|
},
|
|
93
|
+
fetchingOtherReward: {
|
|
94
|
+
invoke: {
|
|
95
|
+
src: 'fetchOtherRewardList',
|
|
96
|
+
onDone: {
|
|
97
|
+
target: 'idle',
|
|
98
|
+
actions: 'setOtherRewardList',
|
|
99
|
+
},
|
|
100
|
+
onError: {
|
|
101
|
+
target: 'idle',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
84
105
|
pending: {
|
|
85
106
|
on: {
|
|
86
107
|
RECEIVE_REWARD: {
|
|
@@ -136,6 +157,11 @@ export default function (request) {
|
|
|
136
157
|
rewardList: event.data[2]?.data || [],
|
|
137
158
|
}
|
|
138
159
|
}),
|
|
160
|
+
setOtherRewardList: assign((context, event) => {
|
|
161
|
+
return {
|
|
162
|
+
otherRewardList: event.data[0]?.data,
|
|
163
|
+
}
|
|
164
|
+
}),
|
|
139
165
|
setRewardData: assign((context, event) => {
|
|
140
166
|
const { activityNo, receiveNo } = event.data
|
|
141
167
|
return {
|
|
@@ -148,6 +174,11 @@ export default function (request) {
|
|
|
148
174
|
callback: event.data?.callback || (() => {}),
|
|
149
175
|
}
|
|
150
176
|
}),
|
|
177
|
+
setOrderColumn: assign((context, event) => {
|
|
178
|
+
return {
|
|
179
|
+
orderColumn: event.data?.orderColumn || 'createTime',
|
|
180
|
+
}
|
|
181
|
+
}),
|
|
151
182
|
setRewardType: assign((context, event) => {
|
|
152
183
|
return {
|
|
153
184
|
rewardType: event.data?.rewardType,
|
|
@@ -166,6 +197,10 @@ export default function (request) {
|
|
|
166
197
|
isPlaying: event.data,
|
|
167
198
|
}
|
|
168
199
|
}),
|
|
200
|
+
setLang: assign((context, event) => {
|
|
201
|
+
const lang = event.data.locale || context.lang || 'en-US'
|
|
202
|
+
return { lang }
|
|
203
|
+
}),
|
|
169
204
|
},
|
|
170
205
|
guards: {
|
|
171
206
|
isPrize: (context, event) => {
|
|
@@ -178,12 +213,29 @@ export default function (request) {
|
|
|
178
213
|
},
|
|
179
214
|
services: {
|
|
180
215
|
fetchRewardList: async (context, event) => {
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
const
|
|
216
|
+
const lang = context.lang
|
|
217
|
+
const orderColumn = context.orderColumn
|
|
218
|
+
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret, lang }))
|
|
219
|
+
const getPointsRewardAPI = request.send(activity.getRewardList({ rewardType: 'POINTS', count: 30, appSecret, lang }))
|
|
220
|
+
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret, orderColumn, lang }))
|
|
184
221
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
185
222
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
186
223
|
},
|
|
224
|
+
fetchOtherRewardList: async (context, event) => {
|
|
225
|
+
const orderColumn = context.orderColumn
|
|
226
|
+
const lang = context.lang
|
|
227
|
+
const getOtherRewardAPI = request.send(
|
|
228
|
+
activity.getRewardList({
|
|
229
|
+
rewardType: 'CASH,FREE,PRIZE',
|
|
230
|
+
count: 30,
|
|
231
|
+
appSecret,
|
|
232
|
+
orderColumn,
|
|
233
|
+
lang,
|
|
234
|
+
})
|
|
235
|
+
)
|
|
236
|
+
const [otherRewardList] = await Promise.all([getOtherRewardAPI])
|
|
237
|
+
return [otherRewardList]
|
|
238
|
+
},
|
|
187
239
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
188
240
|
const { receiveNo } = context
|
|
189
241
|
const data = await request.send(payment.getWithdrawRulePreview({ applyType: 'activity', applyNo: receiveNo, amount: null }))
|
|
@@ -2,7 +2,7 @@ import { createMachine, assign, send } from 'xstate'
|
|
|
2
2
|
import activity from '../api/activity.js'
|
|
3
3
|
import payment from '../api/payment.js'
|
|
4
4
|
|
|
5
|
-
export default function (request) {
|
|
5
|
+
export default function (request, context) {
|
|
6
6
|
const { appSecret } = request.config
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
@@ -16,8 +16,9 @@ export default function (request) {
|
|
|
16
16
|
activityNo: null,
|
|
17
17
|
receiveNo: null,
|
|
18
18
|
withdrawRule: {},
|
|
19
|
-
isPlaying: false,
|
|
20
19
|
callback: () => {},
|
|
20
|
+
orderColumn: 'createTime',
|
|
21
|
+
lang: context?.locale || 'en-US',
|
|
21
22
|
},
|
|
22
23
|
states: {
|
|
23
24
|
timer: {
|
|
@@ -47,7 +48,7 @@ export default function (request) {
|
|
|
47
48
|
},
|
|
48
49
|
pending: {
|
|
49
50
|
after: {
|
|
50
|
-
20000:
|
|
51
|
+
20000: { target: 'loading' },
|
|
51
52
|
},
|
|
52
53
|
},
|
|
53
54
|
},
|
|
@@ -66,6 +67,10 @@ export default function (request) {
|
|
|
66
67
|
target: 'fetching',
|
|
67
68
|
actions: 'setRewardData',
|
|
68
69
|
},
|
|
70
|
+
FETCH_OTHER_REWARD: {
|
|
71
|
+
target: 'fetchingOtherReward',
|
|
72
|
+
actions: 'setOrderColumn',
|
|
73
|
+
},
|
|
69
74
|
RECEIVE_REWARD: {
|
|
70
75
|
target: 'receiving',
|
|
71
76
|
actions: 'setCallback',
|
|
@@ -74,8 +79,8 @@ export default function (request) {
|
|
|
74
79
|
target: 'allPointsReceiving',
|
|
75
80
|
actions: 'setCallback',
|
|
76
81
|
},
|
|
77
|
-
|
|
78
|
-
actions: '
|
|
82
|
+
SET_LANG: {
|
|
83
|
+
actions: 'setLang',
|
|
79
84
|
},
|
|
80
85
|
},
|
|
81
86
|
},
|
|
@@ -91,6 +96,18 @@ export default function (request) {
|
|
|
91
96
|
},
|
|
92
97
|
},
|
|
93
98
|
},
|
|
99
|
+
fetchingOtherReward: {
|
|
100
|
+
invoke: {
|
|
101
|
+
src: 'fetchOtherRewardList',
|
|
102
|
+
onDone: {
|
|
103
|
+
target: 'idle',
|
|
104
|
+
actions: 'setOtherRewardList',
|
|
105
|
+
},
|
|
106
|
+
onError: {
|
|
107
|
+
target: 'idle',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
94
111
|
pending: {
|
|
95
112
|
on: {
|
|
96
113
|
RECEIVE_REWARD: {
|
|
@@ -147,11 +164,6 @@ export default function (request) {
|
|
|
147
164
|
},
|
|
148
165
|
},
|
|
149
166
|
{
|
|
150
|
-
guards: {
|
|
151
|
-
isNotInGame: (context, event) => {
|
|
152
|
-
return !context.isPlaying
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
167
|
actions: {
|
|
156
168
|
setAuth: assign((context, event) => {
|
|
157
169
|
return { auth: !!event.data }
|
|
@@ -163,6 +175,11 @@ export default function (request) {
|
|
|
163
175
|
rewardList: event.data[2]?.data || [],
|
|
164
176
|
}
|
|
165
177
|
}),
|
|
178
|
+
setOtherRewardList: assign((context, event) => {
|
|
179
|
+
return {
|
|
180
|
+
otherRewardList: event.data[0]?.data,
|
|
181
|
+
}
|
|
182
|
+
}),
|
|
166
183
|
setRewardData: assign((context, event) => {
|
|
167
184
|
const { activityNo, receiveNo } = event.data
|
|
168
185
|
return {
|
|
@@ -175,6 +192,11 @@ export default function (request) {
|
|
|
175
192
|
callback: event.data?.callback || (() => {}),
|
|
176
193
|
}
|
|
177
194
|
}),
|
|
195
|
+
setOrderColumn: assign((context, event) => {
|
|
196
|
+
return {
|
|
197
|
+
orderColumn: event.data?.orderColumn || 'createTime',
|
|
198
|
+
}
|
|
199
|
+
}),
|
|
178
200
|
doCallback: (context, event) => {
|
|
179
201
|
context.callback()
|
|
180
202
|
},
|
|
@@ -183,20 +205,22 @@ export default function (request) {
|
|
|
183
205
|
withdrawRule: event.data,
|
|
184
206
|
}
|
|
185
207
|
}),
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
208
|
+
setLang: assign((context, event) => {
|
|
209
|
+
const lang = event.data.locale || context.lang || 'en-US'
|
|
210
|
+
return { lang }
|
|
190
211
|
}),
|
|
191
212
|
},
|
|
192
213
|
services: {
|
|
193
214
|
fetchRewardList: async (context, event) => {
|
|
194
|
-
const
|
|
215
|
+
const lang = context.lang
|
|
216
|
+
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret, lang }))
|
|
217
|
+
const orderColumn = context.orderColumn
|
|
195
218
|
const getPointsRewardAPI = request.send(
|
|
196
219
|
activity.getRewardList({
|
|
197
220
|
rewardType: 'POINTS',
|
|
198
221
|
count: 30,
|
|
199
222
|
appSecret,
|
|
223
|
+
lang,
|
|
200
224
|
})
|
|
201
225
|
)
|
|
202
226
|
const getOtherRewardAPI = request.send(
|
|
@@ -204,11 +228,28 @@ export default function (request) {
|
|
|
204
228
|
rewardType: 'CASH,FREE,PRIZE',
|
|
205
229
|
count: 30,
|
|
206
230
|
appSecret,
|
|
231
|
+
orderColumn,
|
|
232
|
+
lang,
|
|
207
233
|
})
|
|
208
234
|
)
|
|
209
235
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
210
236
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
211
237
|
},
|
|
238
|
+
fetchOtherRewardList: async (context, event) => {
|
|
239
|
+
const orderColumn = context.orderColumn
|
|
240
|
+
|
|
241
|
+
const getOtherRewardAPI = request.send(
|
|
242
|
+
activity.getRewardList({
|
|
243
|
+
rewardType: 'CASH,FREE,PRIZE',
|
|
244
|
+
count: 30,
|
|
245
|
+
appSecret,
|
|
246
|
+
orderColumn,
|
|
247
|
+
lang,
|
|
248
|
+
})
|
|
249
|
+
)
|
|
250
|
+
const [otherRewardList] = await Promise.all([getOtherRewardAPI])
|
|
251
|
+
return [otherRewardList]
|
|
252
|
+
},
|
|
212
253
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
213
254
|
const { receiveNo } = context
|
|
214
255
|
const data = await request.send(
|
package/src/machine/setting.js
CHANGED
|
@@ -17,6 +17,9 @@ export default function () {
|
|
|
17
17
|
idle: {},
|
|
18
18
|
},
|
|
19
19
|
on: {
|
|
20
|
+
DEFAULT_SETTING: {
|
|
21
|
+
actions: 'setSetting',
|
|
22
|
+
},
|
|
20
23
|
MODIFY_SETTING: {
|
|
21
24
|
actions: 'saveSetting',
|
|
22
25
|
},
|
|
@@ -29,6 +32,10 @@ export default function () {
|
|
|
29
32
|
const setting = JSON.parse(localStorage.getItem('setting')) || { sound: soundPlay, music: musicPlay }
|
|
30
33
|
return { ...setting }
|
|
31
34
|
}),
|
|
35
|
+
setSetting: assign((context, event) => {
|
|
36
|
+
const { sound, music, locale } = event.data
|
|
37
|
+
return { sound, music, locale }
|
|
38
|
+
}),
|
|
32
39
|
saveSetting: assign((context, event) => {
|
|
33
40
|
const { sound, music, locale } = event.data
|
|
34
41
|
localStorage.setItem('setting', JSON.stringify({ sound, music, locale }))
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import withdraw_fc from './withdraw_fc.js'
|
|
2
|
-
import withdraw_vn from './withdraw_vn.js'
|
|
3
|
-
import withdraw_vn2 from './withdraw_vn2.js'
|
|
4
1
|
import withdraw_manual from './withdraw_manual.js'
|
|
5
|
-
import withdraw_crypto from './withdraw_crypto.js'
|
|
6
|
-
import withdraw_crypto2 from './withdraw_crypto2.js'
|
|
7
|
-
import withdraw_amb from './withdraw_amb.js'
|
|
8
2
|
import withdraw_krway from './withdraw_krway.js'
|
|
9
3
|
import withdraw_crypto_cash from './withdraw_crypto_cash.js'
|
|
10
4
|
import withdraw_manual_cash from './withdraw_manual_cash.js'
|
|
11
5
|
|
|
12
6
|
export default {
|
|
13
|
-
withdraw_fc,
|
|
14
|
-
withdraw_vn,
|
|
15
|
-
withdraw_vn2,
|
|
16
7
|
withdraw_manual,
|
|
17
|
-
withdraw_crypto,
|
|
18
|
-
withdraw_crypto2,
|
|
19
|
-
withdraw_amb,
|
|
20
8
|
withdraw_krway,
|
|
21
9
|
withdraw_crypto_cash,
|
|
22
10
|
withdraw_manual_cash,
|
|
@@ -65,7 +65,7 @@ export default function (request) {
|
|
|
65
65
|
invoke: {
|
|
66
66
|
src: 'fetchWithdrawRules',
|
|
67
67
|
onDone: {
|
|
68
|
-
target: '
|
|
68
|
+
target: 'cash',
|
|
69
69
|
actions: 'updateWithdrawCondition',
|
|
70
70
|
},
|
|
71
71
|
onError: {
|
|
@@ -73,88 +73,6 @@ export default function (request) {
|
|
|
73
73
|
},
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
|
-
mode: {
|
|
77
|
-
always: [{ target: 'activity', cond: 'isActivity' }, { target: 'cash' }],
|
|
78
|
-
},
|
|
79
|
-
activity: {
|
|
80
|
-
initial: 'checking',
|
|
81
|
-
states: {
|
|
82
|
-
checking: {
|
|
83
|
-
always: [{ target: 'convertible', cond: 'isConvertible' }, { target: 'notConvertible' }],
|
|
84
|
-
},
|
|
85
|
-
notConvertible: {
|
|
86
|
-
on: {
|
|
87
|
-
GIVE_UP: {
|
|
88
|
-
target: 'fetchWithdrawRule',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
fetchWithdrawRule: {
|
|
93
|
-
invoke: {
|
|
94
|
-
src: 'fetchWithdrawRulePreview',
|
|
95
|
-
onDone: {
|
|
96
|
-
target: 'giveUp',
|
|
97
|
-
actions: 'setWithdrawRulePreview',
|
|
98
|
-
},
|
|
99
|
-
onError: {
|
|
100
|
-
target: 'notConvertible',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
giveUp: {
|
|
105
|
-
on: {
|
|
106
|
-
CONFIRM: {
|
|
107
|
-
target: 'givingUp',
|
|
108
|
-
},
|
|
109
|
-
BACK: {
|
|
110
|
-
target: 'notConvertible',
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
givingUp: {
|
|
115
|
-
invoke: {
|
|
116
|
-
src: 'giveUp',
|
|
117
|
-
onDone: {
|
|
118
|
-
target: 'gaveUp',
|
|
119
|
-
},
|
|
120
|
-
onError: {
|
|
121
|
-
target: 'convertible',
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
gaveUp: {},
|
|
126
|
-
convertible: {
|
|
127
|
-
on: {
|
|
128
|
-
SUBMIT: {
|
|
129
|
-
target: 'converting',
|
|
130
|
-
actions: 'setAttachmentType',
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
converting: {
|
|
135
|
-
invoke: {
|
|
136
|
-
src: 'convertFreeCredit',
|
|
137
|
-
onDone: [
|
|
138
|
-
// {
|
|
139
|
-
// target: '#withdraw_manual.otp',
|
|
140
|
-
// actions: 'setOtp',
|
|
141
|
-
// cond: 'isOtpRequired',
|
|
142
|
-
// },
|
|
143
|
-
{ target: 'converted' },
|
|
144
|
-
],
|
|
145
|
-
onError: {
|
|
146
|
-
target: 'convertible',
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
converted: {
|
|
151
|
-
// always: [
|
|
152
|
-
// { target: '#withdraw_manual.cash.unbound', cond: 'isBankNotBound' },
|
|
153
|
-
// { target: '#withdraw_manual.cash.withdrawable', cond: 'hasAttachmentType' },
|
|
154
|
-
// ],
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
76
|
cash: {
|
|
159
77
|
initial: 'checking',
|
|
160
78
|
states: {
|
|
@@ -333,10 +251,6 @@ export default function (request) {
|
|
|
333
251
|
target: 'reset',
|
|
334
252
|
},
|
|
335
253
|
BACK: [
|
|
336
|
-
{
|
|
337
|
-
target: '#withdraw_manual.activity.convertible',
|
|
338
|
-
cond: 'isActivity',
|
|
339
|
-
},
|
|
340
254
|
{
|
|
341
255
|
target: '#withdraw_manual.cash.withdrawable',
|
|
342
256
|
},
|
|
@@ -347,10 +261,6 @@ export default function (request) {
|
|
|
347
261
|
invoke: {
|
|
348
262
|
src: 'acknowledge',
|
|
349
263
|
onDone: [
|
|
350
|
-
{
|
|
351
|
-
target: '#withdraw_manual.activity.converted',
|
|
352
|
-
cond: 'isActivity',
|
|
353
|
-
},
|
|
354
264
|
{
|
|
355
265
|
target: '#withdraw_manual.cash.submitted',
|
|
356
266
|
},
|
|
@@ -397,9 +307,8 @@ export default function (request) {
|
|
|
397
307
|
return { bindingPaymentList, bindingPaymentInfo, boundBanks: combinedData, currentBank: combinedData[0] }
|
|
398
308
|
}),
|
|
399
309
|
preset: assign((context, event) => {
|
|
400
|
-
const { siteConfig } = context
|
|
401
310
|
return {
|
|
402
|
-
attachmentType:
|
|
311
|
+
attachmentType: 'withdraw',
|
|
403
312
|
}
|
|
404
313
|
}),
|
|
405
314
|
setMode: assign((context, event) => {
|
|
@@ -498,9 +407,6 @@ export default function (request) {
|
|
|
498
407
|
const lastMax = Math.min(parseFloat(balance), maximum)
|
|
499
408
|
return !!currentBank && amount > 0 && minimum <= amount && amount <= lastMax
|
|
500
409
|
},
|
|
501
|
-
isActivity: (context, event) => {
|
|
502
|
-
return context.mode === 'ACTIVITY'
|
|
503
|
-
},
|
|
504
410
|
hasAttachmentType: (context, event) => {
|
|
505
411
|
return ['withdraw', 'pool'].includes(context.attachmentType)
|
|
506
412
|
},
|
|
@@ -580,7 +486,7 @@ export default function (request) {
|
|
|
580
486
|
payment.submitWithdrawTransactionManual({
|
|
581
487
|
method,
|
|
582
488
|
amount,
|
|
583
|
-
applyerBankCode: currentBank.bankCode,
|
|
489
|
+
applyerBankCode: currentBank.bankCode || currentBank.walletCode,
|
|
584
490
|
applyerAccountNumber: currentBank.accountNumber,
|
|
585
491
|
applyerIfscCode: currentBank.ifscCode,
|
|
586
492
|
branch: branchTemp,
|
|
@@ -266,7 +266,7 @@ export default function (request, context) {
|
|
|
266
266
|
payment.submitWithdrawTransactionVN({
|
|
267
267
|
method: currentPayment.method,
|
|
268
268
|
amount: selectedAmount,
|
|
269
|
-
applyerBankCode: selectedUserBank.bankCode,
|
|
269
|
+
applyerBankCode: selectedUserBank.bankCode || selectedUserBank.walletCode,
|
|
270
270
|
applyerAccountNumber: selectedUserBank.accountNumber,
|
|
271
271
|
applyerIfscCode: selectedUserBank.ifscCode,
|
|
272
272
|
branch: branchTemp,
|