@jetthai/cuora 1.1.355-dev-9 → 1.1.355
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 +0 -20
- package/package.json +1 -1
- package/src/api/activity.js +2 -7
- package/src/api/game.js +0 -1
- package/src/machine/activity/activity.js +6 -1
- package/src/machine/activity/activity_cash.js +4 -0
- package/src/machine/deposit/direct.js +6 -2
- package/src/machine/deposit/float.js +2 -2
- package/src/machine/deposit/loadcard_vn.js +51 -10
- package/src/machine/deposit/manual_vn.js +23 -3
- package/src/machine/deposit/qrcode_v2.js +132 -6
- package/src/machine/deposit/virtual_bank_vn.js +31 -3
- package/src/machine/deposit/vpay.js +2 -2
- package/src/machine/game_v2_1.js +6 -69
- package/src/machine/inbox.js +0 -4
- package/src/machine/promotions.js +5 -4
- package/src/machine/ranking.js +8 -8
- package/src/machine/reward.js +1 -43
- package/src/machine/reward_cash.js +0 -43
- package/src/machine/websocket.js +0 -12
- package/src/machine/withdraw/withdraw_crypto.js +3 -1
- package/src/machine/withdraw/withdraw_crypto2.js +1 -1
- package/src/machine/withdraw/withdraw_manual.js +2 -1
- package/src/machine/withdraw/withdraw_vn.js +3 -1
- package/src/machine/withdraw/withdraw_vn2.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,26 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.1.355-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-8...v1.1.355-dev-9) (2025-05-06)
|
|
6
|
-
|
|
7
|
-
### [1.1.355-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-7...v1.1.355-dev-8) (2025-05-05)
|
|
8
|
-
|
|
9
|
-
### [1.1.355-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-6...v1.1.355-dev-7) (2025-05-02)
|
|
10
|
-
|
|
11
|
-
### [1.1.355-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-5...v1.1.355-dev-6) (2025-04-29)
|
|
12
|
-
|
|
13
|
-
### [1.1.355-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-4...v1.1.355-dev-5) (2025-04-29)
|
|
14
|
-
|
|
15
|
-
### [1.1.356](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-2...v1.1.356) (2025-04-29)
|
|
16
|
-
|
|
17
|
-
### [1.1.355-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-2...v1.1.355-dev-4) (2025-04-29)
|
|
18
|
-
|
|
19
|
-
### [1.1.355-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-2...v1.1.355-dev-3) (2025-04-29)
|
|
20
|
-
|
|
21
|
-
### [1.1.355-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.355-dev-2) (2025-04-25)
|
|
22
|
-
|
|
23
|
-
### [1.1.355-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.355-dev-1) (2025-04-25)
|
|
24
|
-
|
|
25
5
|
### [1.1.355](https://github.com/jetthai/cuora-module/compare/v1.1.353-data-1...v1.1.355) (2025-04-22)
|
|
26
6
|
|
|
27
7
|
### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.354) (2025-04-14)
|
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -69,10 +69,10 @@ export default {
|
|
|
69
69
|
method: 'get',
|
|
70
70
|
params: { rewardType },
|
|
71
71
|
}),
|
|
72
|
-
getRewardList: ({ rewardType, count, appSecret
|
|
72
|
+
getRewardList: ({ rewardType, count, appSecret }) => ({
|
|
73
73
|
url: 'activities/rewards',
|
|
74
74
|
method: 'get',
|
|
75
|
-
params: { rewardType, count, appSecret
|
|
75
|
+
params: { rewardType, count, appSecret },
|
|
76
76
|
}),
|
|
77
77
|
getCashRainReward: ({ activityNo, appSecret }) => ({
|
|
78
78
|
url: `activities/cashRain`,
|
|
@@ -107,9 +107,4 @@ export default {
|
|
|
107
107
|
method: 'post',
|
|
108
108
|
params: { startDate, endDate, appSecret },
|
|
109
109
|
}),
|
|
110
|
-
loseRebateHistory: ({ startDate, endDate, appSecret }) => ({
|
|
111
|
-
url: 'activities/lose-rebate/history',
|
|
112
|
-
method: 'post',
|
|
113
|
-
params: { startDate, endDate, appSecret },
|
|
114
|
-
}),
|
|
115
110
|
}
|
package/src/api/game.js
CHANGED
|
@@ -4,7 +4,6 @@ export default {
|
|
|
4
4
|
removeFavoriteGame: (code) => ({ method: 'post', url: 'game/myfavorite/remove', params: { games: [code] } }),
|
|
5
5
|
getStatements: () => ({ url: 'game/statements', method: 'get' }),
|
|
6
6
|
playGame: (params) => ({ url: 'game/play', method: 'get', params }),
|
|
7
|
-
demoGame: (params) => ({ url: 'game/demo', method: 'get', params, isPublic: true }),
|
|
8
7
|
logoutGame: ({ uid_site, provider_id }) => ({ url: 'game/logout', method: 'get', params: { uid_site, provider_id } }),
|
|
9
8
|
|
|
10
9
|
getGameTags: ({ q, lang }) => ({ url: 'game/search', method: 'get', params: { q, lang } }),
|
|
@@ -152,8 +152,12 @@ export default function (request) {
|
|
|
152
152
|
}
|
|
153
153
|
}),
|
|
154
154
|
resetActivities: assign((context, event) => {
|
|
155
|
+
const { activityList = [], specifyActivities = [] } = context
|
|
156
|
+
const keepActivities = activityList.filter((activity) => specifyActivities.includes(activity.activityType))
|
|
155
157
|
return {
|
|
156
158
|
isPlaying: true,
|
|
159
|
+
activityList: keepActivities,
|
|
160
|
+
promotionList: [],
|
|
157
161
|
}
|
|
158
162
|
}),
|
|
159
163
|
leaveGame: assign((context, event) => {
|
|
@@ -184,7 +188,8 @@ export default function (request) {
|
|
|
184
188
|
services: {
|
|
185
189
|
fetchList: async (context, event) => {
|
|
186
190
|
const hasToken = request.getToken()
|
|
187
|
-
const
|
|
191
|
+
const isDoubleWallet = context.siteConfig?.walletMode === '4'
|
|
192
|
+
const apiCallable = hasToken && isDoubleWallet
|
|
188
193
|
const [{ data }, promotionList] = await Promise.all([
|
|
189
194
|
hasToken ? request.send(activity.getActivityList({ appSecret })) : request.send(activity.getAllActivityList({ appSecret })),
|
|
190
195
|
apiCallable && !context.isPlaying ? request.send(payment.getPromotionsList()) : [],
|
|
@@ -123,8 +123,12 @@ export default function (request) {
|
|
|
123
123
|
}
|
|
124
124
|
}),
|
|
125
125
|
resetActivities: assign((context, event) => {
|
|
126
|
+
const { activityList = [], detailNeededActivityTypes = [] } = context
|
|
127
|
+
const keepActivities = activityList.filter((activity) => detailNeededActivityTypes.includes(activity.activityType))
|
|
126
128
|
return {
|
|
127
129
|
isPlaying: true,
|
|
130
|
+
activityList: keepActivities,
|
|
131
|
+
promotionList: [],
|
|
128
132
|
}
|
|
129
133
|
}),
|
|
130
134
|
leaveGame: assign((context, event) => {
|
|
@@ -58,6 +58,7 @@ export default function (request) {
|
|
|
58
58
|
always: [
|
|
59
59
|
{
|
|
60
60
|
target: 'loaded',
|
|
61
|
+
cond: 'isDoubleWalletMode',
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
target: 'calculating',
|
|
@@ -90,7 +91,7 @@ export default function (request) {
|
|
|
90
91
|
SUBMIT: [
|
|
91
92
|
{
|
|
92
93
|
target: 'pending',
|
|
93
|
-
cond: (context, event) => !!context.calculation,
|
|
94
|
+
cond: (context, event) => context.siteConfig?.walletMode === '4' && !!context.calculation,
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
97
|
target: 'submitting',
|
|
@@ -128,7 +129,7 @@ export default function (request) {
|
|
|
128
129
|
SUBMIT: [
|
|
129
130
|
{
|
|
130
131
|
target: 'pending',
|
|
131
|
-
cond: (context, event) => !!context.calculation,
|
|
132
|
+
cond: (context, event) => context.siteConfig?.walletMode === '4' && !!context.calculation,
|
|
132
133
|
},
|
|
133
134
|
{
|
|
134
135
|
target: 'submitting',
|
|
@@ -246,6 +247,9 @@ export default function (request) {
|
|
|
246
247
|
}),
|
|
247
248
|
},
|
|
248
249
|
guards: {
|
|
250
|
+
isDoubleWalletMode: (context, event) => {
|
|
251
|
+
return context.siteConfig?.walletMode === '4'
|
|
252
|
+
},
|
|
249
253
|
isCalculable: (context, event) => {
|
|
250
254
|
const {
|
|
251
255
|
amount,
|
|
@@ -72,8 +72,8 @@ export default function (request) {
|
|
|
72
72
|
target: 'fetching',
|
|
73
73
|
cond: (context, event) => {
|
|
74
74
|
const { siteConfig = {}, promotion = {} } = context
|
|
75
|
-
const { bonusPreviewEnable } = siteConfig
|
|
76
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
75
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
76
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
77
77
|
},
|
|
78
78
|
},
|
|
79
79
|
{ target: 'loaded' },
|
|
@@ -49,8 +49,8 @@ export default function (request) {
|
|
|
49
49
|
target: 'fetching',
|
|
50
50
|
cond: (context, event) => {
|
|
51
51
|
const { siteConfig = {}, promotion = {}, selectedCard } = context
|
|
52
|
-
const { bonusPreviewEnable } = siteConfig
|
|
53
|
-
return !!selectedCard && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
52
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
53
|
+
return !!selectedCard && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
56
|
{ target: 'loaded' },
|
|
@@ -78,8 +78,8 @@ export default function (request) {
|
|
|
78
78
|
actions: 'setCard',
|
|
79
79
|
cond: (context, event) => {
|
|
80
80
|
const { siteConfig = {}, promotion = {} } = context
|
|
81
|
-
const { bonusPreviewEnable } = siteConfig
|
|
82
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
81
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
82
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
83
83
|
},
|
|
84
84
|
},
|
|
85
85
|
{
|
|
@@ -87,6 +87,11 @@ export default function (request) {
|
|
|
87
87
|
},
|
|
88
88
|
],
|
|
89
89
|
SELECT_AMOUNT: [
|
|
90
|
+
{
|
|
91
|
+
target: 'pending',
|
|
92
|
+
actions: 'setAmount',
|
|
93
|
+
cond: 'isFreeWalletMode',
|
|
94
|
+
},
|
|
90
95
|
{
|
|
91
96
|
target: 'debouncing',
|
|
92
97
|
actions: 'setAmount',
|
|
@@ -94,6 +99,19 @@ export default function (request) {
|
|
|
94
99
|
],
|
|
95
100
|
},
|
|
96
101
|
},
|
|
102
|
+
pending: {
|
|
103
|
+
on: {
|
|
104
|
+
SELECT_AMOUNT: {
|
|
105
|
+
actions: 'setAmount',
|
|
106
|
+
},
|
|
107
|
+
CONFIRM: {
|
|
108
|
+
target: 'debouncing',
|
|
109
|
+
},
|
|
110
|
+
BACK: {
|
|
111
|
+
target: 'loaded',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
97
115
|
debouncing: {
|
|
98
116
|
on: {
|
|
99
117
|
SELECT_AMOUNT: {
|
|
@@ -114,6 +132,19 @@ export default function (request) {
|
|
|
114
132
|
invoke: {
|
|
115
133
|
src: 'fetchCalculation',
|
|
116
134
|
onDone: [
|
|
135
|
+
{
|
|
136
|
+
target: 'submitting',
|
|
137
|
+
actions: 'setCalculation',
|
|
138
|
+
cond: (context, event) => {
|
|
139
|
+
const { siteConfig = {}, selectedCard = {} } = context
|
|
140
|
+
return siteConfig.walletMode === '2' && selectedCard.jumpLinkEnable === 1
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
target: 'cardInfo',
|
|
145
|
+
actions: 'setCalculation',
|
|
146
|
+
cond: 'isFreeWalletMode',
|
|
147
|
+
},
|
|
117
148
|
{
|
|
118
149
|
target: 'calculated',
|
|
119
150
|
actions: 'setCalculation',
|
|
@@ -127,10 +158,17 @@ export default function (request) {
|
|
|
127
158
|
calculable: {
|
|
128
159
|
entry: 'clearCalculation',
|
|
129
160
|
on: {
|
|
130
|
-
SELECT_AMOUNT:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
161
|
+
SELECT_AMOUNT: [
|
|
162
|
+
{
|
|
163
|
+
target: 'pending',
|
|
164
|
+
actions: 'setAmount',
|
|
165
|
+
cond: 'isFreeWalletMode',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
target: 'debouncing',
|
|
169
|
+
actions: 'setAmount',
|
|
170
|
+
},
|
|
171
|
+
],
|
|
134
172
|
BACK: {
|
|
135
173
|
target: 'loaded',
|
|
136
174
|
},
|
|
@@ -178,8 +216,8 @@ export default function (request) {
|
|
|
178
216
|
actions: 'setCard',
|
|
179
217
|
cond: (context, event) => {
|
|
180
218
|
const { siteConfig = {}, promotion = {} } = context
|
|
181
|
-
const { bonusPreviewEnable } = siteConfig
|
|
182
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
219
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
220
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
183
221
|
},
|
|
184
222
|
},
|
|
185
223
|
{
|
|
@@ -287,6 +325,9 @@ export default function (request) {
|
|
|
287
325
|
}),
|
|
288
326
|
},
|
|
289
327
|
guards: {
|
|
328
|
+
isFreeWalletMode: (context, event) => {
|
|
329
|
+
return context.siteConfig?.walletMode === '2'
|
|
330
|
+
},
|
|
290
331
|
isSubmittable: (context, event) => {
|
|
291
332
|
const { cardNumber, serialNumber } = context
|
|
292
333
|
return cardNumber && serialNumber
|
|
@@ -75,8 +75,24 @@ export default function (request) {
|
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
77
|
step1: {
|
|
78
|
-
initial: '
|
|
78
|
+
initial: 'promotion',
|
|
79
79
|
states: {
|
|
80
|
+
promotion: {
|
|
81
|
+
always: [
|
|
82
|
+
{
|
|
83
|
+
target: 'idle',
|
|
84
|
+
cond: 'isDoubleWalletMode',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
target: 'calculating',
|
|
88
|
+
actions: 'setPromotionDefaultAmount',
|
|
89
|
+
cond: 'hasMinPromotionDeposit',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
target: 'idle',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
80
96
|
idle: {},
|
|
81
97
|
calculating: {
|
|
82
98
|
invoke: {
|
|
@@ -121,10 +137,11 @@ export default function (request) {
|
|
|
121
137
|
{
|
|
122
138
|
target: 'pending',
|
|
123
139
|
cond: (context, event) => {
|
|
124
|
-
const { calculation, promotion } = context
|
|
140
|
+
const { siteConfig = {}, calculation, promotion } = context
|
|
141
|
+
const { walletMode } = siteConfig
|
|
125
142
|
const { promotionsNo, activityNo } = promotion
|
|
126
143
|
const isNoBonus = promotionsNo === 'none' || activityNo === 'none'
|
|
127
|
-
return !!calculation && !isNoBonus
|
|
144
|
+
return walletMode === '4' && !!calculation && !isNoBonus
|
|
128
145
|
},
|
|
129
146
|
},
|
|
130
147
|
{
|
|
@@ -368,6 +385,9 @@ export default function (request) {
|
|
|
368
385
|
}),
|
|
369
386
|
},
|
|
370
387
|
guards: {
|
|
388
|
+
isDoubleWalletMode: (context, event) => {
|
|
389
|
+
return context.siteConfig?.walletMode === '4'
|
|
390
|
+
},
|
|
371
391
|
isCalculable: (context, event) => {
|
|
372
392
|
const {
|
|
373
393
|
amount,
|
|
@@ -49,8 +49,16 @@ export default function (request) {
|
|
|
49
49
|
target: 'fetching',
|
|
50
50
|
cond: (context, event) => {
|
|
51
51
|
const { siteConfig = {}, promotion = {}, selectedQrcode } = context
|
|
52
|
-
const { bonusPreviewEnable } = siteConfig
|
|
53
|
-
return !!selectedQrcode && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
52
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
53
|
+
return !!selectedQrcode && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
target: 'debouncing',
|
|
58
|
+
actions: 'setPromotionDefaultAmount',
|
|
59
|
+
cond: (context, event) => {
|
|
60
|
+
const { siteConfig = {}, promotion = {} } = context
|
|
61
|
+
return siteConfig.walletMode === '3' && !!promotion?.minimumAmount
|
|
54
62
|
},
|
|
55
63
|
},
|
|
56
64
|
{ target: 'loaded' },
|
|
@@ -78,21 +86,51 @@ export default function (request) {
|
|
|
78
86
|
actions: 'setQrcode',
|
|
79
87
|
cond: (context, event) => {
|
|
80
88
|
const { siteConfig = {}, promotion = {} } = context
|
|
81
|
-
const { bonusPreviewEnable } = siteConfig
|
|
82
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
89
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
90
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
83
91
|
},
|
|
84
92
|
},
|
|
93
|
+
{
|
|
94
|
+
target: 'debouncing',
|
|
95
|
+
actions: ['setQrcode', 'setPromotionDefaultAmount'],
|
|
96
|
+
cond: (context, event) => context.siteConfig?.walletMode === '3' && context.promotion?.minimumAmount,
|
|
97
|
+
},
|
|
85
98
|
{
|
|
86
99
|
actions: 'setQrcode',
|
|
87
100
|
},
|
|
88
101
|
],
|
|
89
102
|
SELECT_AMOUNT: [
|
|
103
|
+
{
|
|
104
|
+
target: 'debouncing',
|
|
105
|
+
actions: 'setAmount',
|
|
106
|
+
cond: 'isDoubleWalletMode',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
target: 'pending',
|
|
110
|
+
actions: 'addAmount',
|
|
111
|
+
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
target: 'pending',
|
|
115
|
+
actions: 'setAmount',
|
|
116
|
+
cond: 'isFreeWalletMode',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
target: 'debouncing',
|
|
120
|
+
actions: 'addAmount',
|
|
121
|
+
cond: 'isGrandTotalEnable',
|
|
122
|
+
},
|
|
90
123
|
{
|
|
91
124
|
target: 'debouncing',
|
|
92
125
|
actions: 'setAmount',
|
|
93
126
|
},
|
|
94
127
|
],
|
|
95
128
|
KEY_IN: [
|
|
129
|
+
{
|
|
130
|
+
target: 'pending',
|
|
131
|
+
actions: 'setAmount',
|
|
132
|
+
cond: 'isFreeWalletMode',
|
|
133
|
+
},
|
|
96
134
|
{
|
|
97
135
|
target: 'calculating',
|
|
98
136
|
actions: 'setAmount',
|
|
@@ -100,9 +138,51 @@ export default function (request) {
|
|
|
100
138
|
],
|
|
101
139
|
},
|
|
102
140
|
},
|
|
141
|
+
pending: {
|
|
142
|
+
on: {
|
|
143
|
+
SELECT_AMOUNT: [
|
|
144
|
+
{
|
|
145
|
+
actions: 'addAmount',
|
|
146
|
+
cond: 'isGrandTotalEnable',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
actions: 'setAmount',
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
KEY_IN: {
|
|
153
|
+
actions: 'setAmount',
|
|
154
|
+
},
|
|
155
|
+
CONFIRM: {
|
|
156
|
+
target: 'calculating',
|
|
157
|
+
},
|
|
158
|
+
BACK: {
|
|
159
|
+
target: 'loaded',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
103
163
|
debouncing: {
|
|
104
164
|
on: {
|
|
105
165
|
SELECT_AMOUNT: [
|
|
166
|
+
{
|
|
167
|
+
target: 'debouncing',
|
|
168
|
+
actions: 'setAmount',
|
|
169
|
+
cond: 'isDoubleWalletMode',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
target: 'debouncing',
|
|
173
|
+
actions: 'addAmount',
|
|
174
|
+
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
target: 'debouncing',
|
|
178
|
+
actions: 'setAmount',
|
|
179
|
+
cond: 'isFreeWalletMode',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
target: 'debouncing',
|
|
183
|
+
actions: 'addAmount',
|
|
184
|
+
cond: 'isGrandTotalEnable',
|
|
185
|
+
},
|
|
106
186
|
{
|
|
107
187
|
target: 'debouncing',
|
|
108
188
|
actions: 'setAmount',
|
|
@@ -122,6 +202,26 @@ export default function (request) {
|
|
|
122
202
|
entry: 'clearCalculation',
|
|
123
203
|
on: {
|
|
124
204
|
SELECT_AMOUNT: [
|
|
205
|
+
{
|
|
206
|
+
target: 'debouncing',
|
|
207
|
+
actions: 'setAmount',
|
|
208
|
+
cond: 'isDoubleWalletMode',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
target: 'pending',
|
|
212
|
+
actions: 'addAmount',
|
|
213
|
+
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
target: 'pending',
|
|
217
|
+
actions: 'setAmount',
|
|
218
|
+
cond: 'isFreeWalletMode',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
target: 'debouncing',
|
|
222
|
+
actions: 'addAmount',
|
|
223
|
+
cond: 'isGrandTotalEnable',
|
|
224
|
+
},
|
|
125
225
|
{
|
|
126
226
|
target: 'debouncing',
|
|
127
227
|
actions: 'setAmount',
|
|
@@ -140,6 +240,11 @@ export default function (request) {
|
|
|
140
240
|
invoke: {
|
|
141
241
|
src: 'fetchCalculation',
|
|
142
242
|
onDone: [
|
|
243
|
+
{
|
|
244
|
+
target: 'submitting',
|
|
245
|
+
actions: 'setCalculation',
|
|
246
|
+
cond: 'isFreeWalletMode',
|
|
247
|
+
},
|
|
143
248
|
{
|
|
144
249
|
target: 'calculated',
|
|
145
250
|
actions: 'setCalculation',
|
|
@@ -153,6 +258,16 @@ export default function (request) {
|
|
|
153
258
|
calculated: {
|
|
154
259
|
on: {
|
|
155
260
|
SELECT_AMOUNT: [
|
|
261
|
+
{
|
|
262
|
+
target: 'pending',
|
|
263
|
+
actions: 'addAmount',
|
|
264
|
+
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
target: 'pending',
|
|
268
|
+
actions: 'setAmount',
|
|
269
|
+
cond: 'isFreeWalletMode',
|
|
270
|
+
},
|
|
156
271
|
{
|
|
157
272
|
target: 'debouncing',
|
|
158
273
|
actions: 'addAmount',
|
|
@@ -199,8 +314,8 @@ export default function (request) {
|
|
|
199
314
|
actions: 'setQrcode',
|
|
200
315
|
cond: (context, event) => {
|
|
201
316
|
const { siteConfig = {}, promotion = {} } = context
|
|
202
|
-
const { bonusPreviewEnable } = siteConfig
|
|
203
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
317
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
318
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
204
319
|
},
|
|
205
320
|
},
|
|
206
321
|
{
|
|
@@ -280,8 +395,19 @@ export default function (request) {
|
|
|
280
395
|
promotion,
|
|
281
396
|
}
|
|
282
397
|
}),
|
|
398
|
+
setPromotionDefaultAmount: assign((context, event) => {
|
|
399
|
+
return {
|
|
400
|
+
selectedAmount: context.promotion.minimumAmount,
|
|
401
|
+
}
|
|
402
|
+
}),
|
|
283
403
|
},
|
|
284
404
|
guards: {
|
|
405
|
+
isDoubleWalletMode: (context, event) => {
|
|
406
|
+
return context.siteConfig?.walletMode === '4'
|
|
407
|
+
},
|
|
408
|
+
isFreeWalletMode: (context, event) => {
|
|
409
|
+
return context.siteConfig?.walletMode === '2'
|
|
410
|
+
},
|
|
285
411
|
isGrandTotalEnable: (context, event) => {
|
|
286
412
|
return context.grandTotalEnable === 1
|
|
287
413
|
},
|
|
@@ -45,8 +45,24 @@ export default function (request) {
|
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
47
|
step1: {
|
|
48
|
-
initial: '
|
|
48
|
+
initial: 'promotion',
|
|
49
49
|
states: {
|
|
50
|
+
promotion: {
|
|
51
|
+
always: [
|
|
52
|
+
{
|
|
53
|
+
target: 'idle',
|
|
54
|
+
cond: 'isDoubleWalletMode',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
target: 'calculating',
|
|
58
|
+
actions: 'setPromotionDefaultAmount',
|
|
59
|
+
cond: 'hasMinPromotionDeposit',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
target: 'idle',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
50
66
|
idle: {},
|
|
51
67
|
calculating: {
|
|
52
68
|
invoke: {
|
|
@@ -88,10 +104,11 @@ export default function (request) {
|
|
|
88
104
|
{
|
|
89
105
|
target: 'pending',
|
|
90
106
|
cond: (context, event) => {
|
|
91
|
-
const { calculation, promotion } = context
|
|
107
|
+
const { siteConfig = {}, calculation, promotion } = context
|
|
108
|
+
const { walletMode } = siteConfig
|
|
92
109
|
const { promotionsNo, activityNo } = promotion
|
|
93
110
|
const isNoBonus = promotionsNo === 'none' || activityNo === 'none'
|
|
94
|
-
return !!calculation && !isNoBonus
|
|
111
|
+
return walletMode === '4' && !!calculation && !isNoBonus
|
|
95
112
|
},
|
|
96
113
|
},
|
|
97
114
|
{
|
|
@@ -214,8 +231,16 @@ export default function (request) {
|
|
|
214
231
|
promotion: event.data,
|
|
215
232
|
}
|
|
216
233
|
}),
|
|
234
|
+
setPromotionDefaultAmount: assign((context, event) => {
|
|
235
|
+
return {
|
|
236
|
+
amount: context.promotion.minimumAmount,
|
|
237
|
+
}
|
|
238
|
+
}),
|
|
217
239
|
},
|
|
218
240
|
guards: {
|
|
241
|
+
isDoubleWalletMode: (context, event) => {
|
|
242
|
+
return context.siteConfig?.walletMode === '4'
|
|
243
|
+
},
|
|
219
244
|
isCalculable: (context, event) => {
|
|
220
245
|
const {
|
|
221
246
|
amount,
|
|
@@ -229,6 +254,9 @@ export default function (request) {
|
|
|
229
254
|
isProcessing: (context, event) => {
|
|
230
255
|
return context.processing
|
|
231
256
|
},
|
|
257
|
+
hasMinPromotionDeposit: (context, event) => {
|
|
258
|
+
return context.promotion?.minimumAmount
|
|
259
|
+
},
|
|
232
260
|
},
|
|
233
261
|
services: {
|
|
234
262
|
fetchPaymentDetail: async (context, event) => {
|
|
@@ -74,8 +74,8 @@ export default function (request) {
|
|
|
74
74
|
target: 'fetching',
|
|
75
75
|
cond: (context, event) => {
|
|
76
76
|
const { siteConfig = {}, promotion = {} } = context
|
|
77
|
-
const { bonusPreviewEnable } = siteConfig
|
|
78
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
77
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
78
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
81
|
{ target: 'loaded' },
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -39,11 +39,9 @@ export default function (request) {
|
|
|
39
39
|
portrait: null,
|
|
40
40
|
gameCode: null,
|
|
41
41
|
name: null,
|
|
42
|
-
isDemo: false,
|
|
43
42
|
},
|
|
44
|
-
|
|
43
|
+
walletMode: null,
|
|
45
44
|
lang: 'en_US',
|
|
46
|
-
site: '',
|
|
47
45
|
isMobile: new UAParser().getResult().device.type,
|
|
48
46
|
gameURL: null,
|
|
49
47
|
gameToken: null,
|
|
@@ -83,15 +81,7 @@ export default function (request) {
|
|
|
83
81
|
},
|
|
84
82
|
ENTER_GAME: {
|
|
85
83
|
target: 'connecting',
|
|
86
|
-
actions: ['setGameInfo', 'setLang', '
|
|
87
|
-
},
|
|
88
|
-
DEMO_GAME: {
|
|
89
|
-
target: 'demoGame',
|
|
90
|
-
actions: ['setGameInfo', 'setLang', 'setSite'],
|
|
91
|
-
},
|
|
92
|
-
DEMO_GAME: {
|
|
93
|
-
target: 'demoGame',
|
|
94
|
-
actions: ['setGameInfo', 'setLang', 'setSite'],
|
|
84
|
+
actions: ['setGameInfo', 'setLang', 'setWalletMode'],
|
|
95
85
|
},
|
|
96
86
|
MENU_ENTER_GAME: {
|
|
97
87
|
target: 'connecting',
|
|
@@ -182,24 +172,6 @@ export default function (request) {
|
|
|
182
172
|
},
|
|
183
173
|
},
|
|
184
174
|
},
|
|
185
|
-
demoGame: {
|
|
186
|
-
invoke: {
|
|
187
|
-
src: 'demoGame',
|
|
188
|
-
onDone: {
|
|
189
|
-
target: 'playingDemo',
|
|
190
|
-
actions: 'setGameURL',
|
|
191
|
-
},
|
|
192
|
-
onError: {
|
|
193
|
-
target: 'idle',
|
|
194
|
-
actions: 'setGameURL',
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
on: {
|
|
198
|
-
EXIT_GAME: {
|
|
199
|
-
target: 'disconnect',
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
175
|
connectSwitching: {
|
|
204
176
|
invoke: {
|
|
205
177
|
src: 'disconnectGame',
|
|
@@ -235,20 +207,6 @@ export default function (request) {
|
|
|
235
207
|
},
|
|
236
208
|
},
|
|
237
209
|
},
|
|
238
|
-
playingDemo: {
|
|
239
|
-
on: {
|
|
240
|
-
EXIT_GAME: {
|
|
241
|
-
target: 'disconnect',
|
|
242
|
-
},
|
|
243
|
-
EXIT_DEMO_GAME: {
|
|
244
|
-
target: 'idle',
|
|
245
|
-
},
|
|
246
|
-
ENTER_GAME: {
|
|
247
|
-
target: 'connecting',
|
|
248
|
-
actions: ['setGameInfo', 'setLang', 'setwalletType'],
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
210
|
refreshing: {
|
|
253
211
|
invoke: {
|
|
254
212
|
src: 'disconnectGame',
|
|
@@ -459,17 +417,13 @@ export default function (request) {
|
|
|
459
417
|
const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = context.switchGame
|
|
460
418
|
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }
|
|
461
419
|
}),
|
|
462
|
-
|
|
463
|
-
return {
|
|
420
|
+
setWalletMode: assign((context, event) => {
|
|
421
|
+
return { walletMode: event.data.walletMode }
|
|
464
422
|
}),
|
|
465
423
|
setLang: assign((context, event) => {
|
|
466
424
|
const lang = event.data.locale.replace('-', '_')
|
|
467
425
|
return { lang }
|
|
468
426
|
}),
|
|
469
|
-
setSite: assign((context, event) => {
|
|
470
|
-
const site = event.data.site
|
|
471
|
-
return { site }
|
|
472
|
-
}),
|
|
473
427
|
setPageLoadingDone: assign((context, event) => {
|
|
474
428
|
return {
|
|
475
429
|
pageLoading: true,
|
|
@@ -602,7 +556,7 @@ export default function (request) {
|
|
|
602
556
|
},
|
|
603
557
|
connectGame: async (context, event) => {
|
|
604
558
|
const returnProviders = ['RSG', 'KP', 'EPICWIN', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
|
|
605
|
-
const { lang, isMobile,
|
|
559
|
+
const { lang, isMobile, walletMode } = context
|
|
606
560
|
const { providerId, gameId, gameTypeId, mappingId } = context.game
|
|
607
561
|
const params = {
|
|
608
562
|
provider_id: providerId,
|
|
@@ -612,29 +566,12 @@ export default function (request) {
|
|
|
612
566
|
is_demo: false,
|
|
613
567
|
is_mobile: isMobile === 'mobile' ? 'y' : null,
|
|
614
568
|
lang,
|
|
615
|
-
selected_wallet_type:
|
|
569
|
+
selected_wallet_type: walletMode,
|
|
616
570
|
return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
|
|
617
571
|
}
|
|
618
572
|
const { type, redirect_url, gameToken, gameHtml, wallet_type } = await request.send(api.playGame(params))
|
|
619
573
|
return { type, gameToken, gameHtml, gameURL: redirect_url, gameWalletType: wallet_type }
|
|
620
574
|
},
|
|
621
|
-
demoGame: async (context, event) => {
|
|
622
|
-
const { lang, site, isMobile, game } = context
|
|
623
|
-
const { providerId, gameId, gameTypeId, mappingId } = context.game
|
|
624
|
-
const params = {
|
|
625
|
-
site,
|
|
626
|
-
provider_id: providerId,
|
|
627
|
-
game_id: gameId,
|
|
628
|
-
gametype_id: gameTypeId,
|
|
629
|
-
mapping_id: mappingId,
|
|
630
|
-
is_mobile: isMobile === 'mobile' ? 'y' : null,
|
|
631
|
-
lang,
|
|
632
|
-
}
|
|
633
|
-
const { type, redirect_url, gameToken, gameHtml, is_demo } = await request.send(api.demoGame(params))
|
|
634
|
-
// 將 is_demo 設置到 context.game.isDemo
|
|
635
|
-
game.isDemo = is_demo
|
|
636
|
-
return { type, gameToken, gameHtml, gameURL: redirect_url, game }
|
|
637
|
-
},
|
|
638
575
|
disconnectGame: async (context, event) => {
|
|
639
576
|
const uid_site = event.data
|
|
640
577
|
const provider_id = context.game.providerId
|
package/src/machine/inbox.js
CHANGED
|
@@ -154,9 +154,6 @@ export default function (request) {
|
|
|
154
154
|
LOAD_MESSAGES: {
|
|
155
155
|
target: 'checking',
|
|
156
156
|
},
|
|
157
|
-
RESET_MESSAGES: {
|
|
158
|
-
target: 'reloadMessages',
|
|
159
|
-
},
|
|
160
157
|
},
|
|
161
158
|
},
|
|
162
159
|
inquiring: {
|
|
@@ -285,7 +282,6 @@ export default function (request) {
|
|
|
285
282
|
}
|
|
286
283
|
}),
|
|
287
284
|
resetPage: assign((context, event) => {
|
|
288
|
-
console.log('updateMessage resetPage')
|
|
289
285
|
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
290
286
|
inbox[currentTab].page = -1
|
|
291
287
|
return {
|
|
@@ -7,6 +7,7 @@ export default function (request) {
|
|
|
7
7
|
id: 'promotions',
|
|
8
8
|
initial: 'loading',
|
|
9
9
|
context: {
|
|
10
|
+
noBonus: {},
|
|
10
11
|
userInfo: {},
|
|
11
12
|
siteConfig: {},
|
|
12
13
|
withdrawRule: {},
|
|
@@ -86,10 +87,10 @@ export default function (request) {
|
|
|
86
87
|
actions: {
|
|
87
88
|
setPromotionsList: assign((context, event) => {
|
|
88
89
|
const promotionsList = JSON.parse(JSON.stringify(event.data))
|
|
89
|
-
const { userInfo, siteConfig } = context
|
|
90
|
+
const { noBonus, userInfo, siteConfig } = context
|
|
90
91
|
const { withdraw_rule, balance, bank_amount } = userInfo
|
|
91
|
-
const { currencyConversionLimit } = siteConfig
|
|
92
|
-
const balanceAvailable = parseFloat(bank_amount) < parseFloat(`${currencyConversionLimit}`)
|
|
92
|
+
const { currencyConversionLimit, walletMode } = siteConfig
|
|
93
|
+
const balanceAvailable = parseFloat(`${walletMode === '4' ? bank_amount : balance}`) < parseFloat(`${currencyConversionLimit}`)
|
|
93
94
|
const isFreeLimitRule = withdraw_rule.includes('FREE_LIMIT')
|
|
94
95
|
const includesDefaultRule = withdraw_rule === 'DEFAULT' || withdraw_rule.includes('FREE_DEFAULT')
|
|
95
96
|
|
|
@@ -111,7 +112,7 @@ export default function (request) {
|
|
|
111
112
|
}
|
|
112
113
|
return {
|
|
113
114
|
promotionsList,
|
|
114
|
-
selectedPromo: promotionsList[0],
|
|
115
|
+
selectedPromo: siteConfig?.walletMode === '4' ? promotionsList[0] : noBonus,
|
|
115
116
|
}
|
|
116
117
|
}),
|
|
117
118
|
setSelectedPromo: assign((context, event) => {
|
package/src/machine/ranking.js
CHANGED
|
@@ -4,10 +4,10 @@ import ranking from '../api/ranking.js'
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const cycleMapping = ['DAILY', 'WEEKLY', 'MONTHLY']
|
|
6
6
|
|
|
7
|
-
function roundProcess(rounds
|
|
7
|
+
function roundProcess(rounds) {
|
|
8
8
|
const roundArrays = rounds.map((round) => Array.from({ length: round }, (_, i) => i + 1))
|
|
9
9
|
return roundArrays.reduce((acc, roundArray, index) => {
|
|
10
|
-
acc[
|
|
10
|
+
acc[cycleMapping[index]] = roundArray.reverse()
|
|
11
11
|
return acc
|
|
12
12
|
}, {})
|
|
13
13
|
}
|
|
@@ -151,14 +151,14 @@ export default function (request) {
|
|
|
151
151
|
}
|
|
152
152
|
}),
|
|
153
153
|
setRankingOptions: assign((context, event) => {
|
|
154
|
-
const isChampion = event.data?.rule === 'CHAMPION'
|
|
155
154
|
const cycle = event.data?.cycle
|
|
156
155
|
const currentRound = event.data?.currentRound || []
|
|
157
156
|
// 取得結算週期選單列表
|
|
158
|
-
const cycleOptions =
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
const cycleOptions = cycleMapping.slice(0, currentRound.length)
|
|
158
|
+
// 取得每週期的歷史期數選單列表
|
|
159
|
+
const roundOptions = roundProcess(currentRound)
|
|
160
|
+
// 如果是月結算,則加入全部選項
|
|
161
|
+
if (cycle === 'MONTHLY') {
|
|
162
162
|
cycleOptions.push('ALL')
|
|
163
163
|
roundOptions.ALL = roundOptions.MONTHLY
|
|
164
164
|
}
|
|
@@ -166,7 +166,7 @@ export default function (request) {
|
|
|
166
166
|
...event.data,
|
|
167
167
|
options: { cycle: cycleOptions, round: roundOptions },
|
|
168
168
|
// 初始固定顯示 DAILY
|
|
169
|
-
cycle:
|
|
169
|
+
cycle: event.data?.rule !== 'NORMAL' ? 'DAILY' : cycle,
|
|
170
170
|
round: currentRound[0],
|
|
171
171
|
}
|
|
172
172
|
}),
|
package/src/machine/reward.js
CHANGED
|
@@ -18,7 +18,6 @@ export default function (request) {
|
|
|
18
18
|
rewardType: null,
|
|
19
19
|
isPlaying: false,
|
|
20
20
|
callback: () => {},
|
|
21
|
-
orderColumn: 'createTime',
|
|
22
21
|
},
|
|
23
22
|
states: {
|
|
24
23
|
timer: {
|
|
@@ -57,10 +56,6 @@ export default function (request) {
|
|
|
57
56
|
target: 'fetching',
|
|
58
57
|
actions: 'setRewardData',
|
|
59
58
|
},
|
|
60
|
-
FETCH_OTHER_REWARD: {
|
|
61
|
-
target: 'fetchingOtherReward',
|
|
62
|
-
actions: 'setOrderColumn',
|
|
63
|
-
},
|
|
64
59
|
RECEIVE_REWARD: {
|
|
65
60
|
target: 'receiving',
|
|
66
61
|
actions: ['setCallback', 'setRewardType'],
|
|
@@ -86,18 +81,6 @@ export default function (request) {
|
|
|
86
81
|
},
|
|
87
82
|
},
|
|
88
83
|
},
|
|
89
|
-
fetchingOtherReward: {
|
|
90
|
-
invoke: {
|
|
91
|
-
src: 'fetchOtherRewardList',
|
|
92
|
-
onDone: {
|
|
93
|
-
target: 'idle',
|
|
94
|
-
actions: 'setOtherRewardList',
|
|
95
|
-
},
|
|
96
|
-
onError: {
|
|
97
|
-
target: 'idle',
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
84
|
pending: {
|
|
102
85
|
on: {
|
|
103
86
|
RECEIVE_REWARD: {
|
|
@@ -153,11 +136,6 @@ export default function (request) {
|
|
|
153
136
|
rewardList: event.data[2]?.data || [],
|
|
154
137
|
}
|
|
155
138
|
}),
|
|
156
|
-
setOtherRewardList: assign((context, event) => {
|
|
157
|
-
return {
|
|
158
|
-
otherRewardList: event.data[0]?.data,
|
|
159
|
-
}
|
|
160
|
-
}),
|
|
161
139
|
setRewardData: assign((context, event) => {
|
|
162
140
|
const { activityNo, receiveNo } = event.data
|
|
163
141
|
return {
|
|
@@ -170,11 +148,6 @@ export default function (request) {
|
|
|
170
148
|
callback: event.data?.callback || (() => {}),
|
|
171
149
|
}
|
|
172
150
|
}),
|
|
173
|
-
setOrderColumn: assign((context, event) => {
|
|
174
|
-
return {
|
|
175
|
-
orderColumn: event.data?.orderColumn || 'createTime',
|
|
176
|
-
}
|
|
177
|
-
}),
|
|
178
151
|
setRewardType: assign((context, event) => {
|
|
179
152
|
return {
|
|
180
153
|
rewardType: event.data?.rewardType,
|
|
@@ -205,27 +178,12 @@ export default function (request) {
|
|
|
205
178
|
},
|
|
206
179
|
services: {
|
|
207
180
|
fetchRewardList: async (context, event) => {
|
|
208
|
-
const orderColumn = context.orderColumn
|
|
209
181
|
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
210
182
|
const getPointsRewardAPI = request.send(activity.getRewardList({ rewardType: 'POINTS', count: 30, appSecret }))
|
|
211
|
-
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret
|
|
183
|
+
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret }))
|
|
212
184
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
213
185
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
214
186
|
},
|
|
215
|
-
fetchOtherRewardList: async (context, event) => {
|
|
216
|
-
const orderColumn = context.orderColumn
|
|
217
|
-
|
|
218
|
-
const getOtherRewardAPI = request.send(
|
|
219
|
-
activity.getRewardList({
|
|
220
|
-
rewardType: 'CASH,FREE,PRIZE',
|
|
221
|
-
count: 30,
|
|
222
|
-
appSecret,
|
|
223
|
-
orderColumn,
|
|
224
|
-
})
|
|
225
|
-
)
|
|
226
|
-
const [otherRewardList] = await Promise.all([getOtherRewardAPI])
|
|
227
|
-
return [otherRewardList]
|
|
228
|
-
},
|
|
229
187
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
230
188
|
const { receiveNo } = context
|
|
231
189
|
const data = await request.send(payment.getWithdrawRulePreview({ applyType: 'activity', applyNo: receiveNo, amount: null }))
|
|
@@ -17,7 +17,6 @@ export default function (request) {
|
|
|
17
17
|
receiveNo: null,
|
|
18
18
|
withdrawRule: {},
|
|
19
19
|
callback: () => {},
|
|
20
|
-
orderColumn: 'createTime',
|
|
21
20
|
},
|
|
22
21
|
states: {
|
|
23
22
|
timer: {
|
|
@@ -66,10 +65,6 @@ export default function (request) {
|
|
|
66
65
|
target: 'fetching',
|
|
67
66
|
actions: 'setRewardData',
|
|
68
67
|
},
|
|
69
|
-
FETCH_OTHER_REWARD: {
|
|
70
|
-
target: 'fetchingOtherReward',
|
|
71
|
-
actions: 'setOrderColumn',
|
|
72
|
-
},
|
|
73
68
|
RECEIVE_REWARD: {
|
|
74
69
|
target: 'receiving',
|
|
75
70
|
actions: 'setCallback',
|
|
@@ -92,18 +87,6 @@ export default function (request) {
|
|
|
92
87
|
},
|
|
93
88
|
},
|
|
94
89
|
},
|
|
95
|
-
fetchingOtherReward: {
|
|
96
|
-
invoke: {
|
|
97
|
-
src: 'fetchOtherRewardList',
|
|
98
|
-
onDone: {
|
|
99
|
-
target: 'idle',
|
|
100
|
-
actions: 'setOtherRewardList',
|
|
101
|
-
},
|
|
102
|
-
onError: {
|
|
103
|
-
target: 'idle',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
90
|
pending: {
|
|
108
91
|
on: {
|
|
109
92
|
RECEIVE_REWARD: {
|
|
@@ -171,11 +154,6 @@ export default function (request) {
|
|
|
171
154
|
rewardList: event.data[2]?.data || [],
|
|
172
155
|
}
|
|
173
156
|
}),
|
|
174
|
-
setOtherRewardList: assign((context, event) => {
|
|
175
|
-
return {
|
|
176
|
-
otherRewardList: event.data[0]?.data,
|
|
177
|
-
}
|
|
178
|
-
}),
|
|
179
157
|
setRewardData: assign((context, event) => {
|
|
180
158
|
const { activityNo, receiveNo } = event.data
|
|
181
159
|
return {
|
|
@@ -188,11 +166,6 @@ export default function (request) {
|
|
|
188
166
|
callback: event.data?.callback || (() => {}),
|
|
189
167
|
}
|
|
190
168
|
}),
|
|
191
|
-
setOrderColumn: assign((context, event) => {
|
|
192
|
-
return {
|
|
193
|
-
orderColumn: event.data?.orderColumn || 'createTime',
|
|
194
|
-
}
|
|
195
|
-
}),
|
|
196
169
|
doCallback: (context, event) => {
|
|
197
170
|
context.callback()
|
|
198
171
|
},
|
|
@@ -205,7 +178,6 @@ export default function (request) {
|
|
|
205
178
|
services: {
|
|
206
179
|
fetchRewardList: async (context, event) => {
|
|
207
180
|
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
208
|
-
const orderColumn = context.orderColumn
|
|
209
181
|
const getPointsRewardAPI = request.send(
|
|
210
182
|
activity.getRewardList({
|
|
211
183
|
rewardType: 'POINTS',
|
|
@@ -218,26 +190,11 @@ export default function (request) {
|
|
|
218
190
|
rewardType: 'CASH,FREE,PRIZE',
|
|
219
191
|
count: 30,
|
|
220
192
|
appSecret,
|
|
221
|
-
orderColumn,
|
|
222
193
|
})
|
|
223
194
|
)
|
|
224
195
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
225
196
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
226
197
|
},
|
|
227
|
-
fetchOtherRewardList: async (context, event) => {
|
|
228
|
-
const orderColumn = context.orderColumn
|
|
229
|
-
|
|
230
|
-
const getOtherRewardAPI = request.send(
|
|
231
|
-
activity.getRewardList({
|
|
232
|
-
rewardType: 'CASH,FREE,PRIZE',
|
|
233
|
-
count: 30,
|
|
234
|
-
appSecret,
|
|
235
|
-
orderColumn,
|
|
236
|
-
})
|
|
237
|
-
)
|
|
238
|
-
const [otherRewardList] = await Promise.all([getOtherRewardAPI])
|
|
239
|
-
return [otherRewardList]
|
|
240
|
-
},
|
|
241
198
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
242
199
|
const { receiveNo } = context
|
|
243
200
|
const data = await request.send(
|
package/src/machine/websocket.js
CHANGED
|
@@ -278,18 +278,6 @@ export default function (request) {
|
|
|
278
278
|
callback({ type: 'PUSH_ANALYTICS', data })
|
|
279
279
|
})
|
|
280
280
|
|
|
281
|
-
// 監聽 activity-reward-info 事件
|
|
282
|
-
clientSocket.on('activity-reward-info', (data) => {
|
|
283
|
-
console.log('[socket][activity-reward-info]:', data)
|
|
284
|
-
callback({ type: 'ACTIVITY_INFO', data })
|
|
285
|
-
})
|
|
286
|
-
|
|
287
|
-
// 監聽 message-notice-info 事件
|
|
288
|
-
clientSocket.on('message-notice-info', (data) => {
|
|
289
|
-
console.log('[socket][message-notice-info]:', data)
|
|
290
|
-
callback({ type: 'ACTIVITY_INFO', data })
|
|
291
|
-
})
|
|
292
|
-
|
|
293
281
|
// 監聽 payment-info 事件
|
|
294
282
|
clientSocket.on('payment-info', (data) => {
|
|
295
283
|
console.log('[socket][payment-info]:', data)
|
|
@@ -147,6 +147,7 @@ export default function (request) {
|
|
|
147
147
|
},
|
|
148
148
|
SET_ATTACHMENT_TYPE: {
|
|
149
149
|
actions: 'setAttachmentType',
|
|
150
|
+
cond: 'isNewWalletMode',
|
|
150
151
|
},
|
|
151
152
|
POOL: {
|
|
152
153
|
target: 'pooling',
|
|
@@ -322,7 +323,7 @@ export default function (request) {
|
|
|
322
323
|
balance,
|
|
323
324
|
siteConfig,
|
|
324
325
|
userInfo,
|
|
325
|
-
attachmentType: 'withdraw',
|
|
326
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
326
327
|
}
|
|
327
328
|
}),
|
|
328
329
|
updateWithdrawCondition: assign((context, event) => {
|
|
@@ -433,6 +434,7 @@ export default function (request) {
|
|
|
433
434
|
isOtpRequired: (context, event) => {
|
|
434
435
|
return event.data?.status === 'otp-verifying'
|
|
435
436
|
},
|
|
437
|
+
isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
|
|
436
438
|
},
|
|
437
439
|
services: {
|
|
438
440
|
fetchInitData: async (context, event) => {
|
|
@@ -355,7 +355,7 @@ export default function (request) {
|
|
|
355
355
|
const methods = siteConfig?.paymentMethods?.withdraw || []
|
|
356
356
|
return {
|
|
357
357
|
methods,
|
|
358
|
-
attachmentType: 'withdraw',
|
|
358
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
359
359
|
}
|
|
360
360
|
}),
|
|
361
361
|
setMode: assign((context, event) => {
|
|
@@ -397,8 +397,9 @@ export default function (request) {
|
|
|
397
397
|
return { bindingPaymentList, bindingPaymentInfo, boundBanks: combinedData, currentBank: combinedData[0] }
|
|
398
398
|
}),
|
|
399
399
|
preset: assign((context, event) => {
|
|
400
|
+
const { siteConfig } = context
|
|
400
401
|
return {
|
|
401
|
-
attachmentType: 'withdraw',
|
|
402
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
402
403
|
}
|
|
403
404
|
}),
|
|
404
405
|
setMode: assign((context, event) => {
|
|
@@ -193,6 +193,7 @@ export default function (request) {
|
|
|
193
193
|
},
|
|
194
194
|
SET_ATTACHMENT_TYPE: {
|
|
195
195
|
actions: 'setAttachmentType',
|
|
196
|
+
cond: 'isNewWalletMode',
|
|
196
197
|
},
|
|
197
198
|
SUBMIT: [
|
|
198
199
|
{
|
|
@@ -358,7 +359,7 @@ export default function (request) {
|
|
|
358
359
|
balance,
|
|
359
360
|
siteConfig,
|
|
360
361
|
userInfo,
|
|
361
|
-
attachmentType: 'withdraw',
|
|
362
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
362
363
|
}
|
|
363
364
|
}),
|
|
364
365
|
updateWithdrawCondition: assign((context, event) => {
|
|
@@ -452,6 +453,7 @@ export default function (request) {
|
|
|
452
453
|
isOtpRequired: (context, event) => {
|
|
453
454
|
return event.data?.status === 'otp-verifying'
|
|
454
455
|
},
|
|
456
|
+
isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
|
|
455
457
|
isNotWithdrawMinDepositAmount: (context, event) => {
|
|
456
458
|
const { withdrawCheck } = context
|
|
457
459
|
return !withdrawCheck?.passDepositeLimit
|
|
@@ -373,7 +373,7 @@ export default function (request) {
|
|
|
373
373
|
const methods = siteConfig?.paymentMethods?.withdraw || []
|
|
374
374
|
return {
|
|
375
375
|
methods,
|
|
376
|
-
attachmentType: 'withdraw',
|
|
376
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
377
377
|
}
|
|
378
378
|
}),
|
|
379
379
|
setMode: assign((context, event) => {
|