@jetthai/cuora 1.1.302-dev-6 → 1.1.302-sl-2
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
CHANGED
|
@@ -2,31 +2,15 @@
|
|
|
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.302-
|
|
5
|
+
### [1.1.302-sl-2](https://github.com/jetthai/cuora-module/compare/v1.0.302-sl-2...v1.1.302-sl-2) (2024-09-09)
|
|
6
6
|
|
|
7
|
-
### [1.
|
|
8
|
-
|
|
9
|
-
### [1.1.302-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.304...v1.1.302-dev-4) (2024-09-09)
|
|
10
|
-
|
|
11
|
-
### [1.1.302-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-2...v1.1.302-dev-3) (2024-09-06)
|
|
12
|
-
|
|
13
|
-
### [1.1.302-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-1...v1.1.302-dev-2) (2024-09-04)
|
|
14
|
-
|
|
15
|
-
### [1.1.302-dev-1](https://github.com/jetthai/cuora-module/compare/v1.0.302-dev-1...v1.1.302-dev-1) (2024-09-04)
|
|
16
|
-
|
|
17
|
-
### [1.0.302-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.0.302-dev-1) (2024-09-04)
|
|
18
|
-
|
|
19
|
-
### [1.1.302-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-2...v1.1.302-dev-3) (2024-09-06)
|
|
20
|
-
|
|
21
|
-
### [1.1.302-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-1...v1.1.302-dev-2) (2024-09-04)
|
|
7
|
+
### [1.0.302-sl-2](https://github.com/jetthai/cuora-module/compare/v1.0.302-sl-1...v1.0.302-sl-2) (2024-09-09)
|
|
22
8
|
|
|
23
9
|
### [1.1.302-dev-1](https://github.com/jetthai/cuora-module/compare/v1.0.302-dev-1...v1.1.302-dev-1) (2024-09-04)
|
|
24
10
|
|
|
25
11
|
### [1.0.302-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.0.302-dev-1) (2024-09-04)
|
|
26
12
|
|
|
27
|
-
### [1.1
|
|
28
|
-
|
|
29
|
-
### [1.1.303](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.1.303) (2024-09-09)
|
|
13
|
+
### [1.0.302-sl-1](https://github.com/jetthai/cuora-module/compare/v1.1.302...v1.0.302-sl-1) (2024-09-09)
|
|
30
14
|
|
|
31
15
|
### [1.1.302](https://github.com/jetthai/cuora-module/compare/v1.1.301...v1.1.302) (2024-09-02)
|
|
32
16
|
|
package/package.json
CHANGED
|
@@ -7,20 +7,17 @@ export default function (request) {
|
|
|
7
7
|
id: 'instant_rebate_activity',
|
|
8
8
|
context: {
|
|
9
9
|
enableCollectButton: false,
|
|
10
|
-
estimateStartTime: null,
|
|
11
|
-
estimateEndTime: null,
|
|
12
10
|
lastCollectTime: null,
|
|
13
11
|
lastEstimateTime: null,
|
|
14
12
|
collectAvailable: false,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
settlementTime: null,
|
|
14
|
+
validTurnover: null,
|
|
15
|
+
rebateAmount: null,
|
|
18
16
|
rewardType: null,
|
|
19
|
-
alreadyCalculatedAfterFiveMinutes: false,
|
|
20
17
|
singleMinimumAmountReceive: null,
|
|
21
18
|
remainingCount: 0,
|
|
22
19
|
dailyRedemptionLimit: 0,
|
|
23
|
-
|
|
20
|
+
collectAmount: 0,
|
|
24
21
|
activityNo: null,
|
|
25
22
|
},
|
|
26
23
|
initial: 'idle',
|
|
@@ -77,14 +74,12 @@ export default function (request) {
|
|
|
77
74
|
},
|
|
78
75
|
checking: {
|
|
79
76
|
always: [
|
|
80
|
-
{ target: 'claimAmountLimitReached', cond: 'isClaimAmountLimitReached' },
|
|
81
77
|
{ target: 'claimExhausted', cond: 'isClaimExhausted' },
|
|
82
78
|
{ target: 'insufficientAmount', cond: 'isInsufficientAmount' },
|
|
83
79
|
{ target: 'claimEnable', cond: 'isClaimEnable' },
|
|
84
80
|
{ target: 'cantEstimate' },
|
|
85
81
|
],
|
|
86
82
|
},
|
|
87
|
-
claimAmountLimitReached: {},
|
|
88
83
|
claimExhausted: {},
|
|
89
84
|
insufficientAmount: {},
|
|
90
85
|
claimEnable: {
|
|
@@ -125,99 +120,75 @@ export default function (request) {
|
|
|
125
120
|
}
|
|
126
121
|
}),
|
|
127
122
|
setInitData: assign((context, event) => {
|
|
128
|
-
const {
|
|
129
|
-
|
|
130
|
-
lastCollectTime = 0,
|
|
131
|
-
lastEstimateTime = 0,
|
|
132
|
-
estimateStartTime = 0,
|
|
133
|
-
estimateEndTime = 0,
|
|
134
|
-
rewardType,
|
|
135
|
-
alreadyCalculatedAfterFiveMinutes = false,
|
|
136
|
-
} = event.data
|
|
137
|
-
return {
|
|
138
|
-
enableCollectButton,
|
|
139
|
-
lastCollectTime,
|
|
140
|
-
lastEstimateTime,
|
|
141
|
-
estimateStartTime,
|
|
142
|
-
estimateEndTime,
|
|
143
|
-
rewardType,
|
|
144
|
-
alreadyCalculatedAfterFiveMinutes,
|
|
145
|
-
}
|
|
123
|
+
const { enableCollectButton = false, lastCollectTime = 0, lastEstimateTime = 0, rewardType } = event.data
|
|
124
|
+
return { enableCollectButton, lastCollectTime, lastEstimateTime, rewardType }
|
|
146
125
|
}),
|
|
147
126
|
setEstimateResult: assign((context, event) => {
|
|
148
127
|
const {
|
|
149
|
-
estimateStartTime = 0,
|
|
150
|
-
estimateEndTime = 0,
|
|
151
128
|
lastCollectTime = 0,
|
|
152
129
|
collectAvailable = false,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
130
|
+
settlementTime = 0,
|
|
131
|
+
validTurnover = '0',
|
|
132
|
+
rebateAmount = '0',
|
|
156
133
|
rewardType = null,
|
|
157
134
|
singleMinimumAmountReceive = 0,
|
|
158
135
|
remainingCount = 0,
|
|
159
136
|
dailyRedemptionLimit = 0,
|
|
160
|
-
reachedAmountLimit = false,
|
|
161
137
|
} = event.data
|
|
162
138
|
|
|
163
139
|
return {
|
|
164
|
-
estimateStartTime,
|
|
165
|
-
estimateEndTime,
|
|
166
140
|
lastCollectTime,
|
|
167
141
|
collectAvailable,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
142
|
+
settlementTime,
|
|
143
|
+
validTurnover,
|
|
144
|
+
rebateAmount,
|
|
171
145
|
rewardType,
|
|
172
146
|
singleMinimumAmountReceive,
|
|
173
147
|
remainingCount,
|
|
174
148
|
dailyRedemptionLimit,
|
|
175
|
-
reachedAmountLimit,
|
|
176
149
|
}
|
|
177
150
|
}),
|
|
178
151
|
},
|
|
179
152
|
guards: {
|
|
180
153
|
isEstimatable: (context, event) => {
|
|
181
|
-
const {
|
|
182
|
-
|
|
183
|
-
if (alreadyCalculatedAfterFiveMinutes) {
|
|
184
|
-
return Math.floor(`${currentTime}`) - Math.floor(`${lastEstimateTime}`) > fiveMinutes
|
|
185
|
-
} else {
|
|
154
|
+
const { lastCollectTime, lastEstimateTime } = context
|
|
155
|
+
if (lastCollectTime === lastEstimateTime) {
|
|
186
156
|
return true
|
|
157
|
+
} else {
|
|
158
|
+
const fiveMinutes = 60 * 5
|
|
159
|
+
const currentTime = new Date().getTime() / 1000
|
|
160
|
+
|
|
161
|
+
return parseInt(`${currentTime}`) - parseInt(`${lastEstimateTime}`) > fiveMinutes
|
|
187
162
|
}
|
|
188
163
|
},
|
|
189
|
-
isClaimAmountLimitReached: (context, event) => {
|
|
190
|
-
const { reachedAmountLimit } = context
|
|
191
|
-
return reachedAmountLimit
|
|
192
|
-
},
|
|
193
164
|
isClaimExhausted: (context, event) => {
|
|
194
165
|
const { collectAvailable, remainingCount, dailyRedemptionLimit } = context
|
|
195
166
|
return !collectAvailable && parseInt(`${remainingCount}`) === parseInt(`${dailyRedemptionLimit}`)
|
|
196
167
|
},
|
|
197
168
|
isInsufficientAmount: (context, event) => {
|
|
198
|
-
const { collectAvailable, singleMinimumAmountReceive,
|
|
199
|
-
let splitArray =
|
|
169
|
+
const { collectAvailable, singleMinimumAmountReceive, rebateAmount } = context
|
|
170
|
+
let splitArray = rebateAmount?.split(',')
|
|
200
171
|
let combindString = '0'
|
|
201
172
|
if (splitArray?.length > 0) {
|
|
202
173
|
splitArray.forEach((item) => {
|
|
203
174
|
combindString += item
|
|
204
175
|
})
|
|
205
176
|
} else {
|
|
206
|
-
combindString =
|
|
177
|
+
combindString = rebateAmount
|
|
207
178
|
}
|
|
208
179
|
const deformatRebateAmount = parseFloat(`${combindString}`)
|
|
209
180
|
return !collectAvailable && deformatRebateAmount < parseFloat(`${singleMinimumAmountReceive}`)
|
|
210
181
|
},
|
|
211
182
|
isClaimEnable: (context, event) => {
|
|
212
|
-
const { collectAvailable, remainingCount, dailyRedemptionLimit,
|
|
213
|
-
let splitArray =
|
|
183
|
+
const { collectAvailable, remainingCount, dailyRedemptionLimit, rebateAmount, singleMinimumAmountReceive } = context
|
|
184
|
+
let splitArray = rebateAmount?.split(',')
|
|
214
185
|
let combindString = '0'
|
|
215
186
|
if (splitArray?.length > 0) {
|
|
216
187
|
splitArray.forEach((item) => {
|
|
217
188
|
combindString += item
|
|
218
189
|
})
|
|
219
190
|
} else {
|
|
220
|
-
combindString =
|
|
191
|
+
combindString = rebateAmount
|
|
221
192
|
}
|
|
222
193
|
const deformatRebateAmount = parseFloat(combindString)
|
|
223
194
|
return (
|
package/src/machine/auth.js
CHANGED
|
@@ -166,22 +166,10 @@ export default function (request) {
|
|
|
166
166
|
invoke: {
|
|
167
167
|
src: 'checkDeviceToken',
|
|
168
168
|
onDone: {
|
|
169
|
-
target: 'checkDeviceTokenDone',
|
|
170
|
-
},
|
|
171
|
-
onError: {
|
|
172
169
|
target: 'fetching',
|
|
173
170
|
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
checkDeviceTokenDone: {
|
|
177
|
-
invoke: {
|
|
178
|
-
src: 'fetchUserInfo',
|
|
179
|
-
onDone: {
|
|
180
|
-
target: 'pending',
|
|
181
|
-
actions: ['setUserInfo', 'extendToken'],
|
|
182
|
-
},
|
|
183
171
|
onError: {
|
|
184
|
-
target: '
|
|
172
|
+
target: 'fetching',
|
|
185
173
|
},
|
|
186
174
|
},
|
|
187
175
|
},
|
|
@@ -45,7 +45,9 @@ export default function (request) {
|
|
|
45
45
|
enable: {
|
|
46
46
|
invoke: {
|
|
47
47
|
src: 'add',
|
|
48
|
-
onDone: {
|
|
48
|
+
onDone: {
|
|
49
|
+
target: 'disable',
|
|
50
|
+
},
|
|
49
51
|
onError: {
|
|
50
52
|
actions: 'removeFromList',
|
|
51
53
|
},
|
|
@@ -60,7 +62,9 @@ export default function (request) {
|
|
|
60
62
|
enable: {
|
|
61
63
|
invoke: {
|
|
62
64
|
src: 'remove',
|
|
63
|
-
onDone: {
|
|
65
|
+
onDone: {
|
|
66
|
+
target: 'disable',
|
|
67
|
+
},
|
|
64
68
|
onError: {
|
|
65
69
|
actions: 'addToList',
|
|
66
70
|
},
|