@jetthai/cuora 1.1.328 → 1.1.330-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
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.330-1](https://github.com/jetthai/cuora-module/compare/v1.1.330...v1.1.330-1) (2024-12-18)
|
|
6
|
+
|
|
7
|
+
### [1.1.330](https://github.com/jetthai/cuora-module/compare/v1.1.329...v1.1.330) (2024-12-11)
|
|
8
|
+
|
|
9
|
+
### [1.1.329](https://github.com/jetthai/cuora-module/compare/v1.1.328...v1.1.329) (2024-12-10)
|
|
10
|
+
|
|
5
11
|
### [1.1.328](https://github.com/jetthai/cuora-module/compare/v1.1.327...v1.1.328) (2024-12-09)
|
|
6
12
|
|
|
7
13
|
### [1.1.327](https://github.com/jetthai/cuora-module/compare/v1.1.326...v1.1.327) (2024-12-04)
|
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -102,4 +102,9 @@ export default {
|
|
|
102
102
|
getInstantRebateCollectTime: () => ({ url: 'activities/rebate/collectTime', method: 'get' }),
|
|
103
103
|
instantRebateEstimate: () => ({ url: 'activities/rebate/estimate', method: 'get' }),
|
|
104
104
|
instantRebateCollect: () => ({ url: 'activities/rebate/collect', method: 'get' }),
|
|
105
|
+
instantRebateHistory: ({ startDate, endDate, appSecret }) => ({
|
|
106
|
+
url: 'activities/rebate/history',
|
|
107
|
+
method: 'post',
|
|
108
|
+
params: { startDate, endDate, appSecret },
|
|
109
|
+
}),
|
|
105
110
|
}
|
|
@@ -6,6 +6,7 @@ export default function (request) {
|
|
|
6
6
|
{
|
|
7
7
|
id: 'instant_rebate_activity',
|
|
8
8
|
context: {
|
|
9
|
+
rebateCycle: null,
|
|
9
10
|
showColletButton: false,
|
|
10
11
|
estimateStartTime: null,
|
|
11
12
|
estimateEndTime: null,
|
|
@@ -13,7 +14,9 @@ export default function (request) {
|
|
|
13
14
|
lastEstimateTime: null,
|
|
14
15
|
collectAvailable: false,
|
|
15
16
|
cumulativeValidTurnover: null,
|
|
17
|
+
weekCumulativeValidTurnover: null,
|
|
16
18
|
cumulativeRebateAmount: null,
|
|
19
|
+
weekCumulativeRebateAmount: null,
|
|
17
20
|
actualRebateAmount: null,
|
|
18
21
|
rewardType: null,
|
|
19
22
|
singleMinimumAmountReceive: null,
|
|
@@ -111,32 +114,40 @@ export default function (request) {
|
|
|
111
114
|
}),
|
|
112
115
|
setEstimateResult: assign((context, event) => {
|
|
113
116
|
const {
|
|
117
|
+
rebateCycle = null,
|
|
114
118
|
showColletButton = false,
|
|
115
119
|
estimateStartTime = 0,
|
|
116
120
|
estimateEndTime = 0,
|
|
117
121
|
lastCollectTime = 0,
|
|
118
122
|
collectAvailable = false,
|
|
119
123
|
cumulativeValidTurnover = '0',
|
|
124
|
+
weekCumulativeValidTurnover = '0',
|
|
120
125
|
cumulativeRebateAmount = '0',
|
|
126
|
+
weekCumulativeRebateAmount = '0',
|
|
121
127
|
actualRebateAmount = '0',
|
|
122
128
|
rewardType = null,
|
|
123
129
|
singleMinimumAmountReceive = 0,
|
|
130
|
+
dailyMaximumAmountReceive = 0,
|
|
124
131
|
remainingCount = 0,
|
|
125
132
|
dailyRedemptionLimit = 0,
|
|
126
133
|
reachedAmountLimit = false,
|
|
127
134
|
} = event.data
|
|
128
135
|
|
|
129
136
|
return {
|
|
137
|
+
rebateCycle,
|
|
130
138
|
showColletButton,
|
|
131
139
|
estimateStartTime,
|
|
132
140
|
estimateEndTime,
|
|
133
141
|
lastCollectTime,
|
|
134
142
|
collectAvailable,
|
|
135
143
|
cumulativeValidTurnover,
|
|
144
|
+
weekCumulativeValidTurnover,
|
|
136
145
|
cumulativeRebateAmount,
|
|
146
|
+
weekCumulativeRebateAmount,
|
|
137
147
|
actualRebateAmount,
|
|
138
148
|
rewardType,
|
|
139
149
|
singleMinimumAmountReceive,
|
|
150
|
+
dailyMaximumAmountReceive,
|
|
140
151
|
remainingCount,
|
|
141
152
|
dailyRedemptionLimit,
|
|
142
153
|
reachedAmountLimit,
|
|
@@ -102,8 +102,11 @@ export default function (request, context) {
|
|
|
102
102
|
context.callback(event.data.type)
|
|
103
103
|
},
|
|
104
104
|
setDuration: assign((context, event) => {
|
|
105
|
+
const taskTimer = context?.activityDetail?.taskTimer * 60 * 60 * 1000
|
|
106
|
+
const registerTime = context?.activityDetail?.registerTime
|
|
107
|
+
const endTime = (taskTimer + registerTime) / 1000
|
|
105
108
|
return {
|
|
106
|
-
duration: Math.max(
|
|
109
|
+
duration: Math.max(endTime - new Date().getTime() / 1000, 0),
|
|
107
110
|
}
|
|
108
111
|
}),
|
|
109
112
|
},
|
|
@@ -111,7 +111,9 @@ export default function (request) {
|
|
|
111
111
|
setTimeout(resolve, 1000)
|
|
112
112
|
})
|
|
113
113
|
|
|
114
|
-
const
|
|
114
|
+
const hasToken = request.getToken()
|
|
115
|
+
|
|
116
|
+
const { data } = await request.send(hasToken ? api.getActivityList({ appSecret }) : api.getAllActivityList({ appSecret }))
|
|
115
117
|
return data
|
|
116
118
|
},
|
|
117
119
|
fetchPublicActivityDetail: async (context, event) => {
|