@jetthai/cuora 1.1.127 → 1.1.128
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,8 @@
|
|
|
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.128](https://github.com/jetthai/cuora-module/compare/v1.1.127...v1.1.128) (2023-06-28)
|
|
6
|
+
|
|
5
7
|
### [1.1.127](https://github.com/jetthai/cuora-module/compare/v1.1.126...v1.1.127) (2023-06-28)
|
|
6
8
|
|
|
7
9
|
### [1.1.126](https://github.com/jetthai/cuora-module/compare/v1.1.125...v1.1.126) (2023-06-20)
|
package/package.json
CHANGED
|
@@ -265,12 +265,18 @@ export default function (request) {
|
|
|
265
265
|
}),
|
|
266
266
|
setInitData: assign((context, event) => {
|
|
267
267
|
const { siteConfig, paymentDetail } = event.data
|
|
268
|
+
const { promotion = {} } = context
|
|
269
|
+
const { activityNo, promotionsNo } = promotion
|
|
268
270
|
const cards = paymentDetail.filter((element) => element.category === context.currentCategory)
|
|
269
271
|
let selectedCard = null
|
|
270
272
|
if (siteConfig.walletMode === '4') {
|
|
271
|
-
|
|
273
|
+
if ((!!activityNo && activityNo !== 'none') || (!!promotionsNo && promotionsNo !== 'none')) {
|
|
274
|
+
selectedCard = cards.find((card) => parseFloat(`${card.charge || 0}`) === 0)
|
|
275
|
+
} else {
|
|
276
|
+
selectedCard = cards[0]
|
|
277
|
+
}
|
|
272
278
|
} else {
|
|
273
|
-
|
|
279
|
+
selectedQrcode = qrcodes[0]
|
|
274
280
|
}
|
|
275
281
|
|
|
276
282
|
return {
|
|
@@ -333,9 +339,6 @@ export default function (request) {
|
|
|
333
339
|
isFreeWalletMode: (context, event) => {
|
|
334
340
|
return context.siteConfig?.walletMode === '2'
|
|
335
341
|
},
|
|
336
|
-
isDoubleWalletMode: (context, event) => {
|
|
337
|
-
return context.siteConfig?.walletMode === '4'
|
|
338
|
-
},
|
|
339
342
|
isSubmittable: (context, event) => {
|
|
340
343
|
const { cardNumber, serialNumber } = context
|
|
341
344
|
return cardNumber && serialNumber
|
|
@@ -133,7 +133,17 @@ export default function (request) {
|
|
|
133
133
|
always: [
|
|
134
134
|
{
|
|
135
135
|
target: 'pending',
|
|
136
|
-
cond: (context, event) =>
|
|
136
|
+
cond: (context, event) => {
|
|
137
|
+
const { siteConfig = {}, calculation, promotion } = context
|
|
138
|
+
const { walletMode, depositDefaultBonusPageEnable } = siteConfig
|
|
139
|
+
const { promotionsNo, activityNo } = promotion
|
|
140
|
+
const isNoBonus = promotionsNo === 'none' || activityNo === 'none'
|
|
141
|
+
if (depositDefaultBonusPageEnable === '0') {
|
|
142
|
+
return walletMode === '4' && !!calculation && !isNoBonus
|
|
143
|
+
} else {
|
|
144
|
+
return walletMode === '4' && !!calculation
|
|
145
|
+
}
|
|
146
|
+
},
|
|
137
147
|
},
|
|
138
148
|
{
|
|
139
149
|
target: '#manual.step2',
|
|
@@ -342,10 +342,16 @@ export default function (request) {
|
|
|
342
342
|
}),
|
|
343
343
|
setInitData: assign((context, event) => {
|
|
344
344
|
const { siteConfig, paymentDetail } = event.data
|
|
345
|
+
const { promotion = {} } = context
|
|
346
|
+
const { activityNo, promotionsNo } = promotion
|
|
345
347
|
const qrcodes = paymentDetail.filter((element) => element.category === context.currentCategory)
|
|
346
348
|
let selectedQrcode = null
|
|
347
349
|
if (siteConfig.walletMode === '4') {
|
|
348
|
-
|
|
350
|
+
if ((!!activityNo && activityNo !== 'none') || (!!promotionsNo && promotionsNo !== 'none')) {
|
|
351
|
+
selectedQrcode = qrcodes.find((qrcode) => parseFloat(`${qrcode.charge || 0}`) === 0)
|
|
352
|
+
} else {
|
|
353
|
+
selectedQrcode = qrcodes[0]
|
|
354
|
+
}
|
|
349
355
|
} else {
|
|
350
356
|
selectedQrcode = qrcodes[0]
|
|
351
357
|
}
|