@jetthai/cuora 1.1.344-vipCardPro-2 → 1.1.344
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,10 +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.344-vipCardPro-2](https://github.com/jetthai/cuora-module/compare/v1.1.344-vipCardPro-1...v1.1.344-vipCardPro-2) (2025-03-24)
|
|
6
|
-
|
|
7
|
-
### [1.1.344-vipCardPro-1](https://github.com/jetthai/cuora-module/compare/v1.1.344...v1.1.344-vipCardPro-1) (2025-03-21)
|
|
8
|
-
|
|
9
5
|
### [1.1.344](https://github.com/jetthai/cuora-module/compare/v1.1.343-depositEvent-1...v1.1.344) (2025-03-18)
|
|
10
6
|
|
|
11
7
|
### [1.1.343-depositEvent-1](https://github.com/jetthai/cuora-module/compare/v1.1.343...v1.1.343-depositEvent-1) (2025-03-14)
|
package/package.json
CHANGED
|
@@ -11,19 +11,17 @@ export default function (request) {
|
|
|
11
11
|
activityDetail: null,
|
|
12
12
|
conditions: null,
|
|
13
13
|
rebateType: null,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
currentReachLevel: null,
|
|
15
|
+
nextReachLevel: null,
|
|
16
|
+
lastPeriod: null,
|
|
17
17
|
nextDepositLimit: null,
|
|
18
18
|
nextTurnoverLimit: null,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
currentTotalDeposit: null,
|
|
20
|
+
currentTotalTurnover: null,
|
|
21
21
|
retainAmount: '0',
|
|
22
|
-
|
|
22
|
+
yesterdayReward: '0',
|
|
23
23
|
calculateWalletMode: '1',
|
|
24
24
|
duration: 0,
|
|
25
|
-
isAccumulationPeriod: false, // 當前是否為累積期
|
|
26
|
-
isAwardPeriod: false, // 當前是否為領獎期
|
|
27
25
|
},
|
|
28
26
|
initial: 'idle',
|
|
29
27
|
states: {
|
|
@@ -47,17 +45,6 @@ export default function (request) {
|
|
|
47
45
|
},
|
|
48
46
|
},
|
|
49
47
|
},
|
|
50
|
-
sentAward: {
|
|
51
|
-
invoke: {
|
|
52
|
-
src: 'sentAward',
|
|
53
|
-
onDone: {
|
|
54
|
-
target: 'loading',
|
|
55
|
-
},
|
|
56
|
-
onError: {
|
|
57
|
-
target: 'loaded',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
48
|
loaded: {
|
|
62
49
|
entry: 'setDuration',
|
|
63
50
|
after: {
|
|
@@ -74,9 +61,6 @@ export default function (request) {
|
|
|
74
61
|
STOP: {
|
|
75
62
|
target: '.idle',
|
|
76
63
|
},
|
|
77
|
-
SENT_AWARD: {
|
|
78
|
-
target: '.sentAward',
|
|
79
|
-
},
|
|
80
64
|
},
|
|
81
65
|
},
|
|
82
66
|
{
|
|
@@ -95,68 +79,50 @@ export default function (request) {
|
|
|
95
79
|
const {
|
|
96
80
|
rebateType,
|
|
97
81
|
conditions = [],
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
82
|
+
currentReachLevel = {},
|
|
83
|
+
nextReachLevel = {},
|
|
84
|
+
lastPeriod = {},
|
|
85
|
+
currentTotalDeposit = '0',
|
|
86
|
+
currentTotalTurnover = '0',
|
|
103
87
|
retainAmount = '0',
|
|
104
|
-
|
|
88
|
+
yesterdayReward = '0',
|
|
105
89
|
calculateWalletMode = '0',
|
|
106
|
-
accumulateStartTime,
|
|
107
|
-
accumulateEndTime,
|
|
108
|
-
lastCycleCardStartTime,
|
|
109
|
-
lastCycleCardEndTime,
|
|
110
90
|
} = context.activityDetail || {}
|
|
111
91
|
|
|
112
92
|
let nextDepositLimit = '0'
|
|
113
93
|
let nextTurnoverLimit = '0'
|
|
114
94
|
let currentTurnover = '0'
|
|
115
95
|
let currentDeposit = '0'
|
|
116
|
-
const maxReachLevel = conditions?.[conditions?.length - 1]
|
|
117
96
|
// 若已達到最高等級,所有數值皆以最高等級顯示
|
|
118
|
-
if (
|
|
119
|
-
currentDeposit =
|
|
120
|
-
currentTurnover =
|
|
121
|
-
nextDepositLimit =
|
|
122
|
-
nextTurnoverLimit =
|
|
97
|
+
if (currentReachLevel?.title === conditions?.[conditions?.length - 1]?.title) {
|
|
98
|
+
currentDeposit = conditions[conditions.length - 1].depositLimit
|
|
99
|
+
currentTurnover = conditions[conditions.length - 1].turnoverLimit
|
|
100
|
+
nextDepositLimit = conditions[conditions.length - 1].depositLimit
|
|
101
|
+
nextTurnoverLimit = conditions[conditions.length - 1].turnoverLimit
|
|
123
102
|
} else {
|
|
124
|
-
currentDeposit =
|
|
125
|
-
currentTurnover =
|
|
126
|
-
nextDepositLimit =
|
|
127
|
-
nextTurnoverLimit =
|
|
103
|
+
currentDeposit = currentTotalDeposit
|
|
104
|
+
currentTurnover = currentTotalTurnover
|
|
105
|
+
nextDepositLimit = nextReachLevel?.depositLimit
|
|
106
|
+
nextTurnoverLimit = nextReachLevel?.turnoverLimit
|
|
128
107
|
}
|
|
129
|
-
// 計算當前是否為累積期及領獎期
|
|
130
|
-
const currentTime = new Date().getTime() / 1000
|
|
131
|
-
const isAccumulationPeriod = currentTime >= accumulateStartTime && currentTime <= accumulateEndTime
|
|
132
|
-
const isAwardPeriod = currentTime >= lastCycleCardStartTime && currentTime <= lastCycleCardEndTime
|
|
133
108
|
|
|
134
109
|
return {
|
|
135
110
|
rebateType,
|
|
136
111
|
conditions,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
112
|
+
currentReachLevel,
|
|
113
|
+
nextReachLevel,
|
|
114
|
+
lastPeriod,
|
|
140
115
|
nextDepositLimit,
|
|
141
116
|
nextTurnoverLimit,
|
|
142
|
-
|
|
143
|
-
|
|
117
|
+
currentTotalDeposit: currentDeposit,
|
|
118
|
+
currentTotalTurnover: currentTurnover,
|
|
144
119
|
retainAmount,
|
|
145
|
-
|
|
120
|
+
yesterdayReward,
|
|
146
121
|
calculateWalletMode,
|
|
147
|
-
isAccumulationPeriod,
|
|
148
|
-
isAwardPeriod,
|
|
149
122
|
}
|
|
150
123
|
}),
|
|
151
124
|
setDuration: assign((context, event) => {
|
|
152
|
-
const {
|
|
153
|
-
const { isAwardPeriod } = context.isAwardPeriod
|
|
154
|
-
// 若為累積期,則倒數時間以累積期結束時間計算
|
|
155
|
-
let currentEndTime = accumulateEndTime
|
|
156
|
-
// 若為領獎期,則倒數時間以領獎期結束時間計算
|
|
157
|
-
if (!rewardPeriodSameAsAccumulationPeriod && isAwardPeriod) {
|
|
158
|
-
currentEndTime = lastCycleCardEndTime
|
|
159
|
-
}
|
|
125
|
+
const { currentEndTime } = context?.activityDetail
|
|
160
126
|
return {
|
|
161
127
|
duration: Math.max(parseInt(currentEndTime) - new Date().getTime() / 1000, 0),
|
|
162
128
|
}
|
|
@@ -168,11 +134,6 @@ export default function (request) {
|
|
|
168
134
|
const { data } = await request.send(api.getActivityDetail({ activityNo, appSecret }))
|
|
169
135
|
return data
|
|
170
136
|
},
|
|
171
|
-
sentAward: async (context, event) => {
|
|
172
|
-
const { activityNo } = context
|
|
173
|
-
const { data } = await request.send(api.sentAward({ activityNo, appSecret }))
|
|
174
|
-
return data
|
|
175
|
-
},
|
|
176
137
|
},
|
|
177
138
|
}
|
|
178
139
|
)
|