@jetthai/cuora 1.1.355-dev-4 → 1.1.355-dev-6
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 +6 -0
- package/package.json +1 -1
- package/src/api/activity.js +2 -2
- package/src/machine/ranking.js +6 -7
- package/src/machine/reward_cash.js +43 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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-6](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-5...v1.1.355-dev-6) (2025-04-29)
|
|
6
|
+
|
|
7
|
+
### [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)
|
|
8
|
+
|
|
9
|
+
### [1.1.356](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-2...v1.1.356) (2025-04-29)
|
|
10
|
+
|
|
5
11
|
### [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)
|
|
6
12
|
|
|
7
13
|
### [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)
|
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, orderColumn }) => ({
|
|
73
73
|
url: 'activities/rewards',
|
|
74
74
|
method: 'get',
|
|
75
|
-
params: { rewardType, count, appSecret },
|
|
75
|
+
params: { rewardType, count, appSecret, orderColumn },
|
|
76
76
|
}),
|
|
77
77
|
getCashRainReward: ({ activityNo, appSecret }) => ({
|
|
78
78
|
url: `activities/cashRain`,
|
package/src/machine/ranking.js
CHANGED
|
@@ -151,15 +151,14 @@ export default function (request) {
|
|
|
151
151
|
}
|
|
152
152
|
}),
|
|
153
153
|
setRankingOptions: assign((context, event) => {
|
|
154
|
+
const isChampion = event.data?.rule === 'CHAMPION'
|
|
154
155
|
const cycle = event.data?.cycle
|
|
155
156
|
const currentRound = event.data?.currentRound || []
|
|
156
157
|
// 取得結算週期選單列表
|
|
157
|
-
const cycleOptions = cycleMapping.slice(0, currentRound.length)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
// 如果是月結算,則加入全部選項
|
|
162
|
-
if (cycle === 'MONTHLY') {
|
|
158
|
+
const cycleOptions = isChampion ? cycleMapping.slice(0, currentRound.length) : [cycle]
|
|
159
|
+
const roundOptions = roundProcess(currentRound, cycleOptions)
|
|
160
|
+
// 如果是冠軍龍虎月結算,則加入全部選項
|
|
161
|
+
if (cycle === 'MONTHLY' && isChampion) {
|
|
163
162
|
cycleOptions.push('ALL')
|
|
164
163
|
roundOptions.ALL = roundOptions.MONTHLY
|
|
165
164
|
}
|
|
@@ -167,7 +166,7 @@ export default function (request) {
|
|
|
167
166
|
...event.data,
|
|
168
167
|
options: { cycle: cycleOptions, round: roundOptions },
|
|
169
168
|
// 初始固定顯示 DAILY
|
|
170
|
-
cycle:
|
|
169
|
+
cycle: isChampion ? 'DAILY' : cycle,
|
|
171
170
|
round: currentRound[0],
|
|
172
171
|
}
|
|
173
172
|
}),
|
|
@@ -17,6 +17,7 @@ export default function (request) {
|
|
|
17
17
|
receiveNo: null,
|
|
18
18
|
withdrawRule: {},
|
|
19
19
|
callback: () => {},
|
|
20
|
+
orderColumn: 'createTime',
|
|
20
21
|
},
|
|
21
22
|
states: {
|
|
22
23
|
timer: {
|
|
@@ -65,6 +66,10 @@ export default function (request) {
|
|
|
65
66
|
target: 'fetching',
|
|
66
67
|
actions: 'setRewardData',
|
|
67
68
|
},
|
|
69
|
+
FETCH_OTHER_REWARD: {
|
|
70
|
+
target: 'fetchingOtherReward',
|
|
71
|
+
actions: 'setOrderColumn',
|
|
72
|
+
},
|
|
68
73
|
RECEIVE_REWARD: {
|
|
69
74
|
target: 'receiving',
|
|
70
75
|
actions: 'setCallback',
|
|
@@ -87,6 +92,18 @@ export default function (request) {
|
|
|
87
92
|
},
|
|
88
93
|
},
|
|
89
94
|
},
|
|
95
|
+
fetchingOtherReward: {
|
|
96
|
+
invoke: {
|
|
97
|
+
src: 'fetchOtherRewardList',
|
|
98
|
+
onDone: {
|
|
99
|
+
target: 'idle',
|
|
100
|
+
actions: 'setOtherRewardList',
|
|
101
|
+
},
|
|
102
|
+
onError: {
|
|
103
|
+
target: 'idle',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
90
107
|
pending: {
|
|
91
108
|
on: {
|
|
92
109
|
RECEIVE_REWARD: {
|
|
@@ -154,6 +171,11 @@ export default function (request) {
|
|
|
154
171
|
rewardList: event.data[2]?.data || [],
|
|
155
172
|
}
|
|
156
173
|
}),
|
|
174
|
+
setOtherRewardList: assign((context, event) => {
|
|
175
|
+
return {
|
|
176
|
+
otherRewardList: event.data[0]?.data,
|
|
177
|
+
}
|
|
178
|
+
}),
|
|
157
179
|
setRewardData: assign((context, event) => {
|
|
158
180
|
const { activityNo, receiveNo } = event.data
|
|
159
181
|
return {
|
|
@@ -166,6 +188,11 @@ export default function (request) {
|
|
|
166
188
|
callback: event.data?.callback || (() => {}),
|
|
167
189
|
}
|
|
168
190
|
}),
|
|
191
|
+
setOrderColumn: assign((context, event) => {
|
|
192
|
+
return {
|
|
193
|
+
orderColumn: event.data?.orderColumn || 'createTime',
|
|
194
|
+
}
|
|
195
|
+
}),
|
|
169
196
|
doCallback: (context, event) => {
|
|
170
197
|
context.callback()
|
|
171
198
|
},
|
|
@@ -178,6 +205,7 @@ export default function (request) {
|
|
|
178
205
|
services: {
|
|
179
206
|
fetchRewardList: async (context, event) => {
|
|
180
207
|
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
208
|
+
const orderColumn = context.orderColumn
|
|
181
209
|
const getPointsRewardAPI = request.send(
|
|
182
210
|
activity.getRewardList({
|
|
183
211
|
rewardType: 'POINTS',
|
|
@@ -190,11 +218,26 @@ export default function (request) {
|
|
|
190
218
|
rewardType: 'CASH,FREE,PRIZE',
|
|
191
219
|
count: 30,
|
|
192
220
|
appSecret,
|
|
221
|
+
orderColumn,
|
|
193
222
|
})
|
|
194
223
|
)
|
|
195
224
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
196
225
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
197
226
|
},
|
|
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
|
+
},
|
|
198
241
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
199
242
|
const { receiveNo } = context
|
|
200
243
|
const data = await request.send(
|