@jetthai/cuora 1.1.355-dev-6 → 1.1.355-dev-8
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 +4 -0
- package/package.json +1 -1
- package/src/machine/inbox.js +4 -0
- package/src/machine/reward.js +43 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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-8](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-7...v1.1.355-dev-8) (2025-05-05)
|
|
6
|
+
|
|
7
|
+
### [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)
|
|
8
|
+
|
|
5
9
|
### [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
10
|
|
|
7
11
|
### [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)
|
package/package.json
CHANGED
package/src/machine/inbox.js
CHANGED
|
@@ -154,6 +154,9 @@ export default function (request) {
|
|
|
154
154
|
LOAD_MESSAGES: {
|
|
155
155
|
target: 'checking',
|
|
156
156
|
},
|
|
157
|
+
RESET_MESSAGES: {
|
|
158
|
+
target: 'reloadMessages',
|
|
159
|
+
},
|
|
157
160
|
},
|
|
158
161
|
},
|
|
159
162
|
inquiring: {
|
|
@@ -282,6 +285,7 @@ export default function (request) {
|
|
|
282
285
|
}
|
|
283
286
|
}),
|
|
284
287
|
resetPage: assign((context, event) => {
|
|
288
|
+
console.log('updateMessage resetPage')
|
|
285
289
|
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
286
290
|
inbox[currentTab].page = -1
|
|
287
291
|
return {
|
package/src/machine/reward.js
CHANGED
|
@@ -18,6 +18,7 @@ export default function (request) {
|
|
|
18
18
|
rewardType: null,
|
|
19
19
|
isPlaying: false,
|
|
20
20
|
callback: () => {},
|
|
21
|
+
orderColumn: 'createTime',
|
|
21
22
|
},
|
|
22
23
|
states: {
|
|
23
24
|
timer: {
|
|
@@ -56,6 +57,10 @@ export default function (request) {
|
|
|
56
57
|
target: 'fetching',
|
|
57
58
|
actions: 'setRewardData',
|
|
58
59
|
},
|
|
60
|
+
FETCH_OTHER_REWARD: {
|
|
61
|
+
target: 'fetchingOtherReward',
|
|
62
|
+
actions: 'setOrderColumn',
|
|
63
|
+
},
|
|
59
64
|
RECEIVE_REWARD: {
|
|
60
65
|
target: 'receiving',
|
|
61
66
|
actions: ['setCallback', 'setRewardType'],
|
|
@@ -81,6 +86,18 @@ export default function (request) {
|
|
|
81
86
|
},
|
|
82
87
|
},
|
|
83
88
|
},
|
|
89
|
+
fetchingOtherReward: {
|
|
90
|
+
invoke: {
|
|
91
|
+
src: 'fetchOtherRewardList',
|
|
92
|
+
onDone: {
|
|
93
|
+
target: 'idle',
|
|
94
|
+
actions: 'setOtherRewardList',
|
|
95
|
+
},
|
|
96
|
+
onError: {
|
|
97
|
+
target: 'idle',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
84
101
|
pending: {
|
|
85
102
|
on: {
|
|
86
103
|
RECEIVE_REWARD: {
|
|
@@ -136,6 +153,11 @@ export default function (request) {
|
|
|
136
153
|
rewardList: event.data[2]?.data || [],
|
|
137
154
|
}
|
|
138
155
|
}),
|
|
156
|
+
setOtherRewardList: assign((context, event) => {
|
|
157
|
+
return {
|
|
158
|
+
otherRewardList: event.data[0]?.data,
|
|
159
|
+
}
|
|
160
|
+
}),
|
|
139
161
|
setRewardData: assign((context, event) => {
|
|
140
162
|
const { activityNo, receiveNo } = event.data
|
|
141
163
|
return {
|
|
@@ -148,6 +170,11 @@ export default function (request) {
|
|
|
148
170
|
callback: event.data?.callback || (() => {}),
|
|
149
171
|
}
|
|
150
172
|
}),
|
|
173
|
+
setOrderColumn: assign((context, event) => {
|
|
174
|
+
return {
|
|
175
|
+
orderColumn: event.data?.orderColumn || 'createTime',
|
|
176
|
+
}
|
|
177
|
+
}),
|
|
151
178
|
setRewardType: assign((context, event) => {
|
|
152
179
|
return {
|
|
153
180
|
rewardType: event.data?.rewardType,
|
|
@@ -178,12 +205,27 @@ export default function (request) {
|
|
|
178
205
|
},
|
|
179
206
|
services: {
|
|
180
207
|
fetchRewardList: async (context, event) => {
|
|
208
|
+
const orderColumn = context.orderColumn
|
|
181
209
|
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
182
210
|
const getPointsRewardAPI = request.send(activity.getRewardList({ rewardType: 'POINTS', count: 30, appSecret }))
|
|
183
|
-
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret }))
|
|
211
|
+
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret, orderColumn }))
|
|
184
212
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
185
213
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
186
214
|
},
|
|
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
|
+
},
|
|
187
229
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
188
230
|
const { receiveNo } = context
|
|
189
231
|
const data = await request.send(payment.getWithdrawRulePreview({ applyType: 'activity', applyNo: receiveNo, amount: null }))
|