@pisell/private-materials 3.4.61 → 3.4.62
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Voucher/index.js +16 -1
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/footer/utils.js +36 -37
- package/es/components/booking/components/voucher/index.js +39 -14
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +2 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/pay/toC/PaymentList/index.d.ts +1 -1
- package/es/components/pay/toC/PaymentList/index.js +54 -5
- package/es/components/pay/toC/PaymentList/index.less +58 -1
- package/es/components/pay/toC/PaymentList/payment/credit_card.png +0 -0
- package/es/components/pay/toC/PaymentList/payment/visa.png +0 -0
- package/es/components/pay/toC/PaymentList/serve.d.ts +1 -1
- package/es/components/pay/toC/PaymentList/serve.js +8 -0
- package/es/components/pay/toC/PaymentList/utils.d.ts +26 -0
- package/es/components/pay/toC/PaymentList/utils.js +187 -6
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +127 -36
- package/es/components/pay/toC/index.js +2 -1
- package/es/components/pay/toC/locales.d.ts +6 -0
- package/es/components/pay/toC/locales.js +9 -3
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -1
- package/es/components/walletList/index.js +180 -41
- package/es/components/walletList/locales.d.ts +9 -0
- package/es/components/walletList/locales.js +12 -3
- package/es/components/walletList/serve.d.ts +19 -0
- package/es/components/walletList/serve.js +94 -5
- package/es/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/es/components/walletList/tempHolderSelector/index.js +196 -0
- package/es/components/walletList/tempHolderSelector/index.less +63 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/plus/productSelect/index.js +5 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
- package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
- package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/es/plus/selectHolder/components/HolderList/index.js +43 -0
- package/es/plus/selectHolder/index.d.ts +7 -0
- package/es/plus/selectHolder/index.js +236 -0
- package/es/plus/selectHolder/index.less +117 -0
- package/es/plus/selectHolder/locales.d.ts +21 -0
- package/es/plus/selectHolder/locales.js +20 -0
- package/es/plus/selectHolder/types.d.ts +104 -0
- package/es/plus/selectHolder/types.js +1 -0
- package/es/plus/selectHolder/utils.d.ts +9 -0
- package/es/plus/selectHolder/utils.js +16 -0
- package/es/plus/walletEditor/WalletEditor.js +60 -2
- package/es/plus/walletEditor/locales.d.ts +9 -0
- package/es/plus/walletEditor/locales.js +12 -3
- package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passList/index.js +17 -5
- package/es/plus/walletPassGallery/index.js +223 -41
- package/es/plus/walletPassGallery/index.less +1 -1
- package/es/plus/walletPassGallery/locales.d.ts +15 -0
- package/es/plus/walletPassGallery/locales.js +29 -5
- package/es/plus/walletPassGallery/serve.d.ts +15 -1
- package/es/plus/walletPassGallery/serve.js +59 -2
- package/es/plus/walletPassGallery/utils.d.ts +48 -0
- package/es/plus/walletPassGallery/utils.js +342 -0
- package/es/pro/Selector/Selector.d.ts +1 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Voucher/index.js +21 -1
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/footer/utils.js +6 -8
- package/lib/components/booking/components/voucher/index.js +37 -7
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +2 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/pay/toC/PaymentList/index.d.ts +1 -1
- package/lib/components/pay/toC/PaymentList/index.js +36 -5
- package/lib/components/pay/toC/PaymentList/index.less +58 -1
- package/lib/components/pay/toC/PaymentList/payment/credit_card.png +0 -0
- package/lib/components/pay/toC/PaymentList/payment/visa.png +0 -0
- package/lib/components/pay/toC/PaymentList/serve.d.ts +1 -1
- package/lib/components/pay/toC/PaymentList/serve.js +6 -1
- package/lib/components/pay/toC/PaymentList/utils.d.ts +26 -0
- package/lib/components/pay/toC/PaymentList/utils.js +155 -7
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +85 -1
- package/lib/components/pay/toC/index.js +2 -1
- package/lib/components/pay/toC/locales.d.ts +6 -0
- package/lib/components/pay/toC/locales.js +9 -3
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +2 -1
- package/lib/components/walletList/index.js +105 -5
- package/lib/components/walletList/locales.d.ts +9 -0
- package/lib/components/walletList/locales.js +12 -3
- package/lib/components/walletList/serve.d.ts +19 -0
- package/lib/components/walletList/serve.js +26 -3
- package/lib/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/lib/components/walletList/tempHolderSelector/index.js +166 -0
- package/lib/components/walletList/tempHolderSelector/index.less +63 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -3
- package/lib/plus/productSelect/index.js +4 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/lib/{components/wallet/PointCard/model.js → plus/selectHolder/components/ErrorTip/index.js} +10 -23
- package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
- package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/lib/{components/wallet/components/WalletBar → plus/selectHolder/components/HolderList}/index.js +29 -15
- package/lib/plus/selectHolder/index.d.ts +7 -0
- package/lib/plus/selectHolder/index.js +202 -0
- package/lib/plus/selectHolder/index.less +117 -0
- package/lib/plus/selectHolder/locales.d.ts +21 -0
- package/lib/{components/wallet/Voucher → plus/selectHolder}/locales.js +15 -15
- package/lib/plus/selectHolder/types.d.ts +104 -0
- package/lib/plus/selectHolder/types.js +17 -0
- package/lib/plus/selectHolder/utils.d.ts +9 -0
- package/lib/{components/wallet/RechargeableCard/serve.js → plus/selectHolder/utils.js} +11 -10
- package/lib/plus/walletEditor/WalletEditor.js +53 -0
- package/lib/plus/walletEditor/locales.d.ts +9 -0
- package/lib/plus/walletEditor/locales.js +12 -3
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passList/index.js +16 -4
- package/lib/plus/walletPassGallery/index.js +154 -27
- package/lib/plus/walletPassGallery/index.less +1 -1
- package/lib/plus/walletPassGallery/locales.d.ts +15 -0
- package/lib/plus/walletPassGallery/locales.js +32 -5
- package/lib/plus/walletPassGallery/serve.d.ts +15 -1
- package/lib/plus/walletPassGallery/serve.js +17 -5
- package/lib/plus/walletPassGallery/utils.d.ts +48 -0
- package/lib/plus/walletPassGallery/utils.js +287 -0
- package/lib/pro/Selector/Selector.d.ts +1 -1
- package/lowcode/event-select-holder/meta.ts +2 -2
- package/lowcode/select-holder/meta.ts +220 -0
- package/lowcode/select-holder/snippets.ts +41 -0
- package/package.json +4 -4
- package/es/components/wallet/Detail/index.d.ts +0 -42
- package/es/components/wallet/Detail/index.js +0 -1182
- package/es/components/wallet/Detail/index.less +0 -386
- package/es/components/wallet/Detail/locales.d.ts +0 -153
- package/es/components/wallet/Detail/locales.js +0 -170
- package/es/components/wallet/Detail/model.d.ts +0 -13
- package/es/components/wallet/Detail/model.js +0 -22
- package/es/components/wallet/Detail/serve.d.ts +0 -39
- package/es/components/wallet/Detail/serve.js +0 -64
- package/es/components/wallet/DetailContext.d.ts +0 -25
- package/es/components/wallet/DetailContext.js +0 -162
- package/es/components/wallet/DiscountCard/index.d.ts +0 -3
- package/es/components/wallet/DiscountCard/index.js +0 -218
- package/es/components/wallet/DiscountCard/index.less +0 -9
- package/es/components/wallet/DiscountCard/model.d.ts +0 -14
- package/es/components/wallet/DiscountCard/model.js +0 -22
- package/es/components/wallet/PointCard/index.d.ts +0 -3
- package/es/components/wallet/PointCard/index.js +0 -169
- package/es/components/wallet/PointCard/index.less +0 -9
- package/es/components/wallet/PointCard/model.d.ts +0 -13
- package/es/components/wallet/PointCard/model.js +0 -22
- package/es/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/es/components/wallet/RechargeableCard/index.js +0 -463
- package/es/components/wallet/RechargeableCard/index.less +0 -108
- package/es/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/es/components/wallet/RechargeableCard/model.js +0 -28
- package/es/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/es/components/wallet/RechargeableCard/serve.js +0 -32
- package/es/components/wallet/Voucher/index.d.ts +0 -12
- package/es/components/wallet/Voucher/index.js +0 -131
- package/es/components/wallet/Voucher/index.less +0 -9
- package/es/components/wallet/Voucher/locales.d.ts +0 -21
- package/es/components/wallet/Voucher/locales.js +0 -20
- package/es/components/wallet/Voucher/model.d.ts +0 -13
- package/es/components/wallet/Voucher/model.js +0 -22
- package/es/components/wallet/carouselArrow.png +0 -0
- package/es/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/es/components/wallet/components/FooterButtons/index.js +0 -81
- package/es/components/wallet/components/FooterButtons/index.less +0 -91
- package/es/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/es/components/wallet/components/UsageRules/index.js +0 -147
- package/es/components/wallet/components/UsageRules/index.less +0 -157
- package/es/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/es/components/wallet/components/WalletBar/index.js +0 -19
- package/es/components/wallet/components/WalletBar/index.less +0 -36
- package/es/components/wallet/components/WalletCard.d.ts +0 -11
- package/es/components/wallet/components/WalletCard.js +0 -91
- package/es/components/wallet/components/index.d.ts +0 -3
- package/es/components/wallet/components/index.js +0 -4
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -33
- package/es/components/wallet/hooks/useWalletCard.js +0 -147
- package/es/components/wallet/index.d.ts +0 -10
- package/es/components/wallet/index.js +0 -807
- package/es/components/wallet/index.less +0 -151
- package/es/components/wallet/locales.d.ts +0 -132
- package/es/components/wallet/locales.js +0 -139
- package/es/components/wallet/model.d.ts +0 -37
- package/es/components/wallet/model.js +0 -86
- package/es/components/wallet/serve.d.ts +0 -150
- package/es/components/wallet/serve.js +0 -205
- package/es/components/wallet/utils/formatUtils.d.ts +0 -36
- package/es/components/wallet/utils/formatUtils.js +0 -73
- package/lib/components/wallet/Detail/index.d.ts +0 -42
- package/lib/components/wallet/Detail/index.js +0 -874
- package/lib/components/wallet/Detail/index.less +0 -386
- package/lib/components/wallet/Detail/locales.d.ts +0 -153
- package/lib/components/wallet/Detail/locales.js +0 -194
- package/lib/components/wallet/Detail/model.d.ts +0 -13
- package/lib/components/wallet/Detail/model.js +0 -43
- package/lib/components/wallet/Detail/serve.d.ts +0 -39
- package/lib/components/wallet/Detail/serve.js +0 -44
- package/lib/components/wallet/DetailContext.d.ts +0 -25
- package/lib/components/wallet/DetailContext.js +0 -118
- package/lib/components/wallet/DiscountCard/index.d.ts +0 -3
- package/lib/components/wallet/DiscountCard/index.js +0 -209
- package/lib/components/wallet/DiscountCard/index.less +0 -9
- package/lib/components/wallet/DiscountCard/model.d.ts +0 -14
- package/lib/components/wallet/DiscountCard/model.js +0 -43
- package/lib/components/wallet/PointCard/index.d.ts +0 -3
- package/lib/components/wallet/PointCard/index.js +0 -190
- package/lib/components/wallet/PointCard/index.less +0 -9
- package/lib/components/wallet/PointCard/model.d.ts +0 -13
- package/lib/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/lib/components/wallet/RechargeableCard/index.js +0 -380
- package/lib/components/wallet/RechargeableCard/index.less +0 -108
- package/lib/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/lib/components/wallet/RechargeableCard/model.js +0 -49
- package/lib/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/lib/components/wallet/Voucher/index.d.ts +0 -12
- package/lib/components/wallet/Voucher/index.js +0 -146
- package/lib/components/wallet/Voucher/index.less +0 -9
- package/lib/components/wallet/Voucher/locales.d.ts +0 -21
- package/lib/components/wallet/Voucher/model.d.ts +0 -13
- package/lib/components/wallet/Voucher/model.js +0 -43
- package/lib/components/wallet/carouselArrow.png +0 -0
- package/lib/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/lib/components/wallet/components/FooterButtons/index.js +0 -109
- package/lib/components/wallet/components/FooterButtons/index.less +0 -91
- package/lib/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/lib/components/wallet/components/UsageRules/index.js +0 -113
- package/lib/components/wallet/components/UsageRules/index.less +0 -157
- package/lib/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/lib/components/wallet/components/WalletBar/index.less +0 -36
- package/lib/components/wallet/components/WalletCard.d.ts +0 -11
- package/lib/components/wallet/components/WalletCard.js +0 -97
- package/lib/components/wallet/components/index.d.ts +0 -3
- package/lib/components/wallet/components/index.js +0 -45
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -33
- package/lib/components/wallet/hooks/useWalletCard.js +0 -111
- package/lib/components/wallet/index.d.ts +0 -10
- package/lib/components/wallet/index.js +0 -580
- package/lib/components/wallet/index.less +0 -151
- package/lib/components/wallet/locales.d.ts +0 -132
- package/lib/components/wallet/locales.js +0 -163
- package/lib/components/wallet/model.d.ts +0 -37
- package/lib/components/wallet/model.js +0 -91
- package/lib/components/wallet/serve.d.ts +0 -150
- package/lib/components/wallet/serve.js +0 -85
- package/lib/components/wallet/utils/formatUtils.d.ts +0 -36
- package/lib/components/wallet/utils/formatUtils.js +0 -73
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,14 +16,147 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/components/pay/toC/PaymentList/utils.ts
|
|
20
30
|
var utils_exports = {};
|
|
21
31
|
__export(utils_exports, {
|
|
22
|
-
calculateSurcharge: () => calculateSurcharge
|
|
32
|
+
calculateSurcharge: () => calculateSurcharge,
|
|
33
|
+
formatCreditCardSurcharge: () => formatCreditCardSurcharge,
|
|
34
|
+
formatCreditCardSurchargeList: () => formatCreditCardSurchargeList,
|
|
35
|
+
formatCreditCardSurchargeText: () => formatCreditCardSurchargeText,
|
|
36
|
+
isCreditCardSurchargeSame: () => isCreditCardSurchargeSame
|
|
23
37
|
});
|
|
24
38
|
module.exports = __toCommonJS(utils_exports);
|
|
39
|
+
var import_visa = __toESM(require("./payment/visa.png"));
|
|
40
|
+
var import_credit_card = __toESM(require("./payment/credit_card.png"));
|
|
41
|
+
var isCreditCardSurchargeSame = (creditCardConfig) => {
|
|
42
|
+
try {
|
|
43
|
+
const configMap = {};
|
|
44
|
+
creditCardConfig.forEach((config) => {
|
|
45
|
+
const key = `${(config == null ? void 0 : config.credit_card_type) || "-"}_${(config == null ? void 0 : config.area) || "-"}`;
|
|
46
|
+
configMap[key] = config;
|
|
47
|
+
});
|
|
48
|
+
const visaDomestic = configMap["visa_domestic"];
|
|
49
|
+
const visaWorld = configMap["visa_world"];
|
|
50
|
+
const masterDomestic = configMap["master_domestic"];
|
|
51
|
+
const masterWorld = configMap["master_world"];
|
|
52
|
+
const formatFee = (config) => {
|
|
53
|
+
if (!config) return null;
|
|
54
|
+
const percent = parseFloat(config.percent ?? config.percentage ?? "0");
|
|
55
|
+
const amount = parseFloat(config.amount ?? "0");
|
|
56
|
+
return {
|
|
57
|
+
percentStr: percent,
|
|
58
|
+
amountStr: amount
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
const visaDomesticFee = formatFee(visaDomestic);
|
|
62
|
+
const visaWorldFee = formatFee(visaWorld);
|
|
63
|
+
const masterDomesticFee = formatFee(masterDomestic);
|
|
64
|
+
const masterWorldFee = formatFee(masterWorld);
|
|
65
|
+
const isFeeSame = (fee1, fee2) => {
|
|
66
|
+
if (!fee1 || !fee2) return false;
|
|
67
|
+
return fee1.percentStr === fee2.percentStr && fee1.amountStr === fee2.amountStr;
|
|
68
|
+
};
|
|
69
|
+
const isDomesticSame = isFeeSame(visaDomesticFee, masterDomesticFee);
|
|
70
|
+
const isWorldSame = isFeeSame(visaWorldFee, masterWorldFee);
|
|
71
|
+
const isAllSame = isDomesticSame && isWorldSame;
|
|
72
|
+
return isAllSame;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var totalFee = (config, amount) => {
|
|
78
|
+
const percentageFee = parseFloat(config.percent ?? config.percentage) * Number(amount);
|
|
79
|
+
const totalFee2 = percentageFee + parseFloat(config.amount);
|
|
80
|
+
return totalFee2;
|
|
81
|
+
};
|
|
82
|
+
var formatCreditCardSurcharge = (item, amount, isSame) => {
|
|
83
|
+
try {
|
|
84
|
+
const { surcharge_config, currency_symbol } = item;
|
|
85
|
+
const formatSurchargeList = (list) => {
|
|
86
|
+
return list == null ? void 0 : list.map((config) => {
|
|
87
|
+
const percentageFee = parseFloat(
|
|
88
|
+
(config == null ? void 0 : config.percent) ?? (config == null ? void 0 : config.percentage) ?? 0
|
|
89
|
+
);
|
|
90
|
+
const percent = (percentageFee * 100).toFixed(2);
|
|
91
|
+
const amountFee = parseFloat(config == null ? void 0 : config.amount).toFixed(2);
|
|
92
|
+
const _totalFee = totalFee(config, amount).toFixed(2);
|
|
93
|
+
const areaText = (config == null ? void 0 : config.area) === "world" ? "tocPay.text.rest-of-world" : "tocPay.text.domestic";
|
|
94
|
+
return {
|
|
95
|
+
...config,
|
|
96
|
+
area_text: areaText,
|
|
97
|
+
surcharge_text: `${percent}% + ${currency_symbol}${amountFee}`,
|
|
98
|
+
surcharge_fee: `${currency_symbol}${_totalFee}`
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
if (isSame) {
|
|
103
|
+
const visaResult = surcharge_config.filter((config) => {
|
|
104
|
+
return config.credit_card_type === "visa";
|
|
105
|
+
});
|
|
106
|
+
return [
|
|
107
|
+
{
|
|
108
|
+
icons: [import_visa.default, import_credit_card.default],
|
|
109
|
+
name: "Visa / Mastercard",
|
|
110
|
+
lists: formatSurchargeList(visaResult)
|
|
111
|
+
}
|
|
112
|
+
];
|
|
113
|
+
} else {
|
|
114
|
+
const visaResult = surcharge_config.filter((config) => {
|
|
115
|
+
return config.credit_card_type === "visa";
|
|
116
|
+
});
|
|
117
|
+
const masterResult = surcharge_config.filter((config) => {
|
|
118
|
+
return config.credit_card_type === "master";
|
|
119
|
+
});
|
|
120
|
+
return [
|
|
121
|
+
{
|
|
122
|
+
icons: [import_visa.default],
|
|
123
|
+
name: "Visa",
|
|
124
|
+
lists: formatSurchargeList(visaResult)
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
icons: [import_credit_card.default],
|
|
128
|
+
name: "Mastercard",
|
|
129
|
+
lists: formatSurchargeList(masterResult)
|
|
130
|
+
}
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
} catch (error) {
|
|
134
|
+
console.error(error);
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
var formatCreditCardSurchargeList = (item, amount) => {
|
|
139
|
+
const isSame = isCreditCardSurchargeSame((item == null ? void 0 : item.surcharge_config) || []);
|
|
140
|
+
return formatCreditCardSurcharge(item || {}, amount, isSame);
|
|
141
|
+
};
|
|
142
|
+
var formatCreditCardSurchargeText = (surcharge_config, surcharge_text) => {
|
|
143
|
+
try {
|
|
144
|
+
if (!Array.isArray(surcharge_config) || surcharge_config.length === 0) {
|
|
145
|
+
return surcharge_text;
|
|
146
|
+
}
|
|
147
|
+
const percentList = surcharge_config.map((config) => {
|
|
148
|
+
return parseFloat(config.percent ?? config.percentage ?? "0") * 100;
|
|
149
|
+
});
|
|
150
|
+
const minPercent = Math.min(...percentList);
|
|
151
|
+
const maxPercent = Math.max(...percentList);
|
|
152
|
+
if (minPercent === maxPercent) {
|
|
153
|
+
return `${surcharge_text}${minPercent}%`;
|
|
154
|
+
}
|
|
155
|
+
return `${surcharge_text}${minPercent}% ~ ${maxPercent}%`;
|
|
156
|
+
} catch (error) {
|
|
157
|
+
return surcharge_text;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
25
160
|
var calculateSurcharge = (paymentList, amount) => {
|
|
26
161
|
return paymentList.map((payment) => {
|
|
27
162
|
const { surcharge_config, currency_symbol, surcharge_text } = payment;
|
|
@@ -30,23 +165,36 @@ var calculateSurcharge = (paymentList, amount) => {
|
|
|
30
165
|
return payment;
|
|
31
166
|
}
|
|
32
167
|
const fees = surcharge_config.map((config) => {
|
|
33
|
-
|
|
34
|
-
const totalFee = percentageFee + parseFloat(config.amount);
|
|
35
|
-
return totalFee;
|
|
168
|
+
return totalFee(config, amount);
|
|
36
169
|
});
|
|
37
170
|
const minFee = Math.min(...fees);
|
|
38
171
|
const maxFee = Math.max(...fees);
|
|
39
172
|
if (minFee === 0 && maxFee === 0) {
|
|
40
173
|
payment.surcharge = "";
|
|
41
174
|
} else if (minFee === maxFee) {
|
|
42
|
-
payment.surcharge = `${surcharge_text}${currency_symbol}${minFee.toFixed(
|
|
175
|
+
payment.surcharge = `${surcharge_text}${currency_symbol}${minFee.toFixed(
|
|
176
|
+
2
|
|
177
|
+
)}`;
|
|
43
178
|
} else {
|
|
44
|
-
payment.surcharge = `${surcharge_text}${currency_symbol}${minFee.toFixed(
|
|
179
|
+
payment.surcharge = `${surcharge_text}${currency_symbol}${minFee.toFixed(
|
|
180
|
+
2
|
|
181
|
+
)} ~ ${currency_symbol}${maxFee.toFixed(2)}`;
|
|
182
|
+
}
|
|
183
|
+
if (payment.service === "mw.credit_card") {
|
|
184
|
+
payment.surcharge = formatCreditCardSurchargeText(surcharge_config, surcharge_text);
|
|
185
|
+
payment.surcharge_config_result = formatCreditCardSurchargeList(
|
|
186
|
+
payment,
|
|
187
|
+
amount
|
|
188
|
+
);
|
|
45
189
|
}
|
|
46
190
|
return payment;
|
|
47
191
|
});
|
|
48
192
|
};
|
|
49
193
|
// Annotate the CommonJS export names for ESM import in node:
|
|
50
194
|
0 && (module.exports = {
|
|
51
|
-
calculateSurcharge
|
|
195
|
+
calculateSurcharge,
|
|
196
|
+
formatCreditCardSurcharge,
|
|
197
|
+
formatCreditCardSurchargeList,
|
|
198
|
+
formatCreditCardSurchargeText,
|
|
199
|
+
isCreditCardSurchargeSame
|
|
52
200
|
});
|
|
@@ -75,14 +75,38 @@ var log = (data) => {
|
|
|
75
75
|
content: [{ key: "res", value: JSON.stringify(_template) }]
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
|
+
var setHistoryLog = (log2) => {
|
|
79
|
+
if (!paymentData.logList) {
|
|
80
|
+
paymentData.logList = [];
|
|
81
|
+
}
|
|
82
|
+
paymentData.logList.push(log2);
|
|
83
|
+
};
|
|
84
|
+
var getCurrentTime = () => {
|
|
85
|
+
return (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss");
|
|
86
|
+
};
|
|
78
87
|
var startPayment = async ({ orderId, cardInfo, payData }, callback) => {
|
|
79
88
|
let paymentInfo2 = {
|
|
80
89
|
amount: 0,
|
|
81
90
|
order_id: 0
|
|
82
91
|
};
|
|
83
92
|
try {
|
|
84
|
-
paymentData = {
|
|
93
|
+
paymentData = {
|
|
94
|
+
orderId,
|
|
95
|
+
logList: []
|
|
96
|
+
};
|
|
97
|
+
setHistoryLog({
|
|
98
|
+
msg: "startPayment 开始",
|
|
99
|
+
time: getCurrentTime(),
|
|
100
|
+
hasPayData: !!payData,
|
|
101
|
+
payDataOrderId: payData == null ? void 0 : payData.order_id,
|
|
102
|
+
payDataPayNumber: payData == null ? void 0 : payData.pay_number
|
|
103
|
+
});
|
|
85
104
|
const step2 = payData ? payData : await checkEnrollment(orderId, cardInfo, callback);
|
|
105
|
+
setHistoryLog({
|
|
106
|
+
msg: "步骤2完成: 提交卡信息到后端",
|
|
107
|
+
time: getCurrentTime(),
|
|
108
|
+
hasStep2: !!step2
|
|
109
|
+
});
|
|
86
110
|
if (step2 === 0) {
|
|
87
111
|
return;
|
|
88
112
|
}
|
|
@@ -90,22 +114,62 @@ var startPayment = async ({ orderId, cardInfo, payData }, callback) => {
|
|
|
90
114
|
paymentInfo2.amount = step2.amount;
|
|
91
115
|
paymentInfo2.order_id = step2.order_id;
|
|
92
116
|
console.log("第三步");
|
|
117
|
+
setHistoryLog({
|
|
118
|
+
msg: "步骤3开始: 创建iframe监听postMessage",
|
|
119
|
+
time: getCurrentTime()
|
|
120
|
+
});
|
|
93
121
|
let step3 = await createThreeDSMethodIframe(step2, callback);
|
|
94
122
|
paymentData.step3 = step3;
|
|
123
|
+
setHistoryLog({
|
|
124
|
+
msg: "步骤3完成: iframe监听结束",
|
|
125
|
+
time: getCurrentTime(),
|
|
126
|
+
step3Result: step3
|
|
127
|
+
});
|
|
95
128
|
if (step3 === "N") {
|
|
96
129
|
return;
|
|
97
130
|
}
|
|
131
|
+
setHistoryLog({
|
|
132
|
+
msg: "步骤4开始: 调用checkTDSAuth",
|
|
133
|
+
time: getCurrentTime(),
|
|
134
|
+
order_id: step2 == null ? void 0 : step2.order_id,
|
|
135
|
+
pay_number: step2 == null ? void 0 : step2.pay_number
|
|
136
|
+
});
|
|
98
137
|
const step4 = await checkTDSAuth(step2, step3, callback);
|
|
138
|
+
setHistoryLog({
|
|
139
|
+
msg: "步骤4完成: checkTDSAuth 返回",
|
|
140
|
+
time: getCurrentTime(),
|
|
141
|
+
hasStep4: !!step4
|
|
142
|
+
});
|
|
99
143
|
if (step4 === 0) {
|
|
100
144
|
return;
|
|
101
145
|
}
|
|
102
146
|
paymentData.step4 = step4;
|
|
103
147
|
if (step4) {
|
|
148
|
+
setHistoryLog({
|
|
149
|
+
msg: "步骤5开始: 创建challenge iframe",
|
|
150
|
+
time: getCurrentTime()
|
|
151
|
+
});
|
|
104
152
|
const step5 = await createChallengeIframe(step4, callback);
|
|
105
153
|
paymentData.step5 = step5;
|
|
154
|
+
setHistoryLog({
|
|
155
|
+
msg: "步骤5完成: challenge iframe结束",
|
|
156
|
+
time: getCurrentTime()
|
|
157
|
+
});
|
|
158
|
+
setHistoryLog({
|
|
159
|
+
msg: "步骤6开始: 调用check_pares接口",
|
|
160
|
+
time: getCurrentTime()
|
|
161
|
+
});
|
|
106
162
|
await checkPARes(step2, step4, step5);
|
|
163
|
+
setHistoryLog({
|
|
164
|
+
msg: "步骤6完成: check_pares接口返回",
|
|
165
|
+
time: getCurrentTime()
|
|
166
|
+
});
|
|
107
167
|
}
|
|
108
168
|
callback({ key: "hideModal" });
|
|
169
|
+
setHistoryLog({
|
|
170
|
+
msg: "支付成功",
|
|
171
|
+
time: getCurrentTime()
|
|
172
|
+
});
|
|
109
173
|
paymentEnd(
|
|
110
174
|
{
|
|
111
175
|
status: "success",
|
|
@@ -116,6 +180,11 @@ var startPayment = async ({ orderId, cardInfo, payData }, callback) => {
|
|
|
116
180
|
return true;
|
|
117
181
|
} catch (err) {
|
|
118
182
|
console.log("error", err);
|
|
183
|
+
setHistoryLog({
|
|
184
|
+
msg: "支付异常",
|
|
185
|
+
time: getCurrentTime(),
|
|
186
|
+
error: err
|
|
187
|
+
});
|
|
119
188
|
callback({ key: "hideModal" });
|
|
120
189
|
closeIframe();
|
|
121
190
|
if (err === 0) return;
|
|
@@ -229,6 +298,12 @@ var checkTDSAuth = async (step2, step3, callback) => {
|
|
|
229
298
|
if (REACT_APP_API_ENV === "pre" && pay_info.check_tds_auth.card_name === "aa bb") {
|
|
230
299
|
isPre = true;
|
|
231
300
|
}
|
|
301
|
+
setHistoryLog({
|
|
302
|
+
msg: "步骤4开始: 调用tds_auth_pay接口",
|
|
303
|
+
time: getCurrentTime(),
|
|
304
|
+
order_id,
|
|
305
|
+
pay_number
|
|
306
|
+
});
|
|
232
307
|
let { data } = await import_utils.request.getRequest().post("/h5/pay/order/mw-3ds-pay/v2/tds_auth_pay", {
|
|
233
308
|
order_id,
|
|
234
309
|
pay_number,
|
|
@@ -266,11 +341,20 @@ var checkTDSAuth = async (step2, step3, callback) => {
|
|
|
266
341
|
notifyURL
|
|
267
342
|
}
|
|
268
343
|
});
|
|
344
|
+
setHistoryLog({
|
|
345
|
+
msg: "步骤4完成: tds_auth_pay接口返回",
|
|
346
|
+
time: getCurrentTime(),
|
|
347
|
+
hasStep4: !!data
|
|
348
|
+
});
|
|
269
349
|
if (!data) {
|
|
270
350
|
return null;
|
|
271
351
|
}
|
|
272
352
|
return data;
|
|
273
353
|
} catch (err) {
|
|
354
|
+
setHistoryLog({
|
|
355
|
+
msg: "步骤4异常",
|
|
356
|
+
time: getCurrentTime()
|
|
357
|
+
});
|
|
274
358
|
log({
|
|
275
359
|
msg: err,
|
|
276
360
|
data: paymentData
|
|
@@ -206,7 +206,7 @@ var ToCPay = (props, ref) => {
|
|
|
206
206
|
wait_amount: remain_amount
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
|
-
await ((_b2 = paymentListRef.current) == null ? void 0 : _b2.init(payment_list));
|
|
209
|
+
await ((_b2 = paymentListRef.current) == null ? void 0 : _b2.init(payment_list, remain_amount || 0));
|
|
210
210
|
setTimeout(() => {
|
|
211
211
|
setLoading(false);
|
|
212
212
|
}, 100);
|
|
@@ -515,6 +515,7 @@ var ToCPay = (props, ref) => {
|
|
|
515
515
|
open,
|
|
516
516
|
cancelVisible: false,
|
|
517
517
|
okText,
|
|
518
|
+
wrapClassName: "toc-pay-modal-content",
|
|
518
519
|
bodyStyle: {
|
|
519
520
|
padding: 24
|
|
520
521
|
},
|
|
@@ -98,6 +98,8 @@ declare const _default: {
|
|
|
98
98
|
'tocPay.text.paymentCompletedAndViewOrder': string;
|
|
99
99
|
'tocPay.text.paymentFailed': string;
|
|
100
100
|
'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': string;
|
|
101
|
+
'tocPay.text.domestic': string;
|
|
102
|
+
'tocPay.text.rest-of-world': string;
|
|
101
103
|
};
|
|
102
104
|
'zh-CN': {
|
|
103
105
|
'tocPay.text.checkout': string;
|
|
@@ -197,6 +199,8 @@ declare const _default: {
|
|
|
197
199
|
'tocPay.text.paymentCompletedAndViewOrder': string;
|
|
198
200
|
'tocPay.text.paymentFailed': string;
|
|
199
201
|
'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': string;
|
|
202
|
+
'tocPay.text.domestic': string;
|
|
203
|
+
'tocPay.text.rest-of-world': string;
|
|
200
204
|
};
|
|
201
205
|
'zh-HK': {
|
|
202
206
|
'tocPay.text.checkout': string;
|
|
@@ -296,6 +300,8 @@ declare const _default: {
|
|
|
296
300
|
'tocPay.text.paymentCompletedAndViewOrder': string;
|
|
297
301
|
'tocPay.text.paymentFailed': string;
|
|
298
302
|
'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': string;
|
|
303
|
+
'tocPay.text.domestic': string;
|
|
304
|
+
'tocPay.text.rest-of-world': string;
|
|
299
305
|
};
|
|
300
306
|
};
|
|
301
307
|
export default _default;
|
|
@@ -121,7 +121,9 @@ var locales_default = {
|
|
|
121
121
|
"tocPay.text.returnAndSelectOtherPaymentMethod": "Go Back / Choose Another Payment",
|
|
122
122
|
"tocPay.text.paymentCompletedAndViewOrder": "Payment Completed / View Order",
|
|
123
123
|
"tocPay.text.paymentFailed": "Not paid yet, please check if the payment is successful",
|
|
124
|
-
"tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater": "We are verifying your payment. Please check your order status later."
|
|
124
|
+
"tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater": "We are verifying your payment. Please check your order status later.",
|
|
125
|
+
"tocPay.text.domestic": "Domestic",
|
|
126
|
+
"tocPay.text.rest-of-world": "Rest of world"
|
|
125
127
|
},
|
|
126
128
|
"zh-CN": {
|
|
127
129
|
"tocPay.text.checkout": "结账",
|
|
@@ -220,7 +222,9 @@ var locales_default = {
|
|
|
220
222
|
"tocPay.text.returnAndSelectOtherPaymentMethod": "返回 / 选择其他支付方式",
|
|
221
223
|
"tocPay.text.paymentCompletedAndViewOrder": "支付完成 / 查看订单",
|
|
222
224
|
"tocPay.text.paymentFailed": "未支付完成,请检查是否支付成功",
|
|
223
|
-
"tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater": "我们正在确认您的支付状态,请稍后查看订单状态。"
|
|
225
|
+
"tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater": "我们正在确认您的支付状态,请稍后查看订单状态。",
|
|
226
|
+
"tocPay.text.domestic": "本国",
|
|
227
|
+
"tocPay.text.rest-of-world": "国外"
|
|
224
228
|
},
|
|
225
229
|
"zh-HK": {
|
|
226
230
|
"tocPay.text.checkout": "結帳",
|
|
@@ -319,6 +323,8 @@ var locales_default = {
|
|
|
319
323
|
"tocPay.text.returnAndSelectOtherPaymentMethod": "返回 / 選擇其他支付方式",
|
|
320
324
|
"tocPay.text.paymentCompletedAndViewOrder": "支付完成 / 查看訂單",
|
|
321
325
|
"tocPay.text.paymentFailed": "未支付完成,请检查是否支付成功",
|
|
322
|
-
"tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater": "我們正在確認您的支付狀態,請稍後查看訂單狀態。"
|
|
326
|
+
"tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater": "我們正在確認您的支付狀態,請稍後查看訂單狀態。",
|
|
327
|
+
"tocPay.text.domestic": "本國",
|
|
328
|
+
"tocPay.text.rest-of-world": "國外"
|
|
323
329
|
}
|
|
324
330
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
4
3
|
order: any;
|
|
@@ -30,11 +29,4 @@ export interface PayGroup {
|
|
|
30
29
|
_order: any;
|
|
31
30
|
front_order_uuid?: string;
|
|
32
31
|
}
|
|
33
|
-
export declare const Provider:
|
|
34
|
-
state: FormState;
|
|
35
|
-
} & {
|
|
36
|
-
dispatch: (params: {
|
|
37
|
-
type: string;
|
|
38
|
-
payload: any;
|
|
39
|
-
}) => void;
|
|
40
|
-
}>;
|
|
32
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,11 +68,4 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider:
|
|
73
|
-
state: FormState;
|
|
74
|
-
} & {
|
|
75
|
-
dispatch: (params: {
|
|
76
|
-
type: string;
|
|
77
|
-
payload: any;
|
|
78
|
-
}) => void;
|
|
79
|
-
}>;
|
|
71
|
+
export declare const Provider: any, Context: any;
|
|
@@ -289,7 +289,8 @@ var AddSerivce = (props) => {
|
|
|
289
289
|
start_date: state.date.value,
|
|
290
290
|
quantity: (e == null ? void 0 : e.quantity) || 1,
|
|
291
291
|
product_name: item.title,
|
|
292
|
-
other
|
|
292
|
+
other,
|
|
293
|
+
isNormalProduct: (0, import_utils4.isNormalProductByDurationSchedule)(item)
|
|
293
294
|
},
|
|
294
295
|
new: 1
|
|
295
296
|
};
|
|
@@ -44,6 +44,7 @@ var import_status = require("./status");
|
|
|
44
44
|
var import_locales = __toESM(require("./locales"));
|
|
45
45
|
var import_index = require("./index.less");
|
|
46
46
|
var import_classnames = __toESM(require("classnames"));
|
|
47
|
+
var import_tempHolderSelector = __toESM(require("./tempHolderSelector"));
|
|
47
48
|
var import_types = require("./types");
|
|
48
49
|
var import_pinModal = __toESM(require("../pinModal"));
|
|
49
50
|
var STORAGE_KEY = "pisell_wallet_list_data";
|
|
@@ -155,7 +156,8 @@ var DEFAULT_BALANCE = {
|
|
|
155
156
|
gift_card_balance: 0,
|
|
156
157
|
point_card_balance: 0,
|
|
157
158
|
voucher_count: 0,
|
|
158
|
-
discount_card_count: 0
|
|
159
|
+
discount_card_count: 0,
|
|
160
|
+
good_pass_count: 0
|
|
159
161
|
};
|
|
160
162
|
var WalletList = (0, import_model.Provider)((props) => {
|
|
161
163
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -173,6 +175,9 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
173
175
|
const nextButtonRef = (0, import_react.useRef)(null);
|
|
174
176
|
const [currentIndex, setCurrentIndex] = (0, import_react.useState)(0);
|
|
175
177
|
const [walletShopList, setWalletShopList] = (0, import_react.useState)([]);
|
|
178
|
+
const [editHolderVisible, setEditHolderVisible] = (0, import_react.useState)(false);
|
|
179
|
+
const [editHolderData, setEditHolderData] = (0, import_react.useState)(null);
|
|
180
|
+
const [updateHolderLoading, setUpdateHolderLoading] = (0, import_react.useState)(false);
|
|
176
181
|
const requestIdRef = (0, import_react.useRef)("");
|
|
177
182
|
const pubsub = utils == null ? void 0 : utils.pubsub;
|
|
178
183
|
const pinModalRef = (0, import_react.useRef)(null);
|
|
@@ -303,7 +308,7 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
303
308
|
}
|
|
304
309
|
};
|
|
305
310
|
const initData = async (requestId) => {
|
|
306
|
-
var _a2, _b2;
|
|
311
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h;
|
|
307
312
|
if (!isMountedRef.current) return;
|
|
308
313
|
if (requestIdRef.current !== requestId) return;
|
|
309
314
|
if (!isUserLoggedIn) {
|
|
@@ -339,6 +344,7 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
339
344
|
hasAttempted: false
|
|
340
345
|
});
|
|
341
346
|
}
|
|
347
|
+
let tempList = [];
|
|
342
348
|
try {
|
|
343
349
|
if (!isMountedRef.current) return;
|
|
344
350
|
const walletListData = await (0, import_serve.getWalletList)();
|
|
@@ -397,12 +403,14 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
397
403
|
balance: retryBalanceData,
|
|
398
404
|
hasAttempted: true
|
|
399
405
|
});
|
|
406
|
+
tempList = retryListData || [];
|
|
400
407
|
} catch (retryErr) {
|
|
401
408
|
setState({
|
|
402
409
|
list: walletListData || [],
|
|
403
410
|
balance: walletBalanceData,
|
|
404
411
|
hasAttempted: true
|
|
405
412
|
});
|
|
413
|
+
tempList = walletListData || [];
|
|
406
414
|
}
|
|
407
415
|
}, 2e3);
|
|
408
416
|
} else {
|
|
@@ -411,6 +419,7 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
411
419
|
balance: walletBalanceData,
|
|
412
420
|
hasAttempted: true
|
|
413
421
|
});
|
|
422
|
+
tempList = walletListData || [];
|
|
414
423
|
}
|
|
415
424
|
} catch (err) {
|
|
416
425
|
if (!isMountedRef.current || requestIdRef.current !== requestId) return;
|
|
@@ -421,6 +430,70 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
421
430
|
hasAttempted: true
|
|
422
431
|
});
|
|
423
432
|
}
|
|
433
|
+
const walletDetailId = new URLSearchParams(window.location.search).get(
|
|
434
|
+
"wallet_detail_id"
|
|
435
|
+
);
|
|
436
|
+
if (walletDetailId) {
|
|
437
|
+
const found = tempList.find((item) => String(item.id) === walletDetailId);
|
|
438
|
+
if (found) {
|
|
439
|
+
setCurrentIndex(tempList.indexOf(found));
|
|
440
|
+
(_c2 = carouselRef.current) == null ? void 0 : _c2.goTo(tempList.indexOf(found), true);
|
|
441
|
+
if (((_d2 = found.holder) == null ? void 0 : _d2.holder_type) === "form" && !((_e2 = found.holder) == null ? void 0 : _e2.holder_id)) {
|
|
442
|
+
setEditHolderData({
|
|
443
|
+
wallet_record_id: found.id,
|
|
444
|
+
customer_id: (_f2 = found.holder) == null ? void 0 : _f2.customer_id,
|
|
445
|
+
form_id: ((_h = (_g2 = found.holder) == null ? void 0 : _g2.metadata) == null ? void 0 : _h.custom_id) || ""
|
|
446
|
+
});
|
|
447
|
+
setEditHolderVisible(true);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
const onBindHolder = async (holderId) => {
|
|
453
|
+
if (!(editHolderData == null ? void 0 : editHolderData.wallet_record_id)) {
|
|
454
|
+
console.error("wallet_record_id is required");
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
setUpdateHolderLoading(true);
|
|
458
|
+
try {
|
|
459
|
+
const res = await (0, import_serve.updateWalletHolder)(editHolderData == null ? void 0 : editHolderData.wallet_record_id, {
|
|
460
|
+
holder_id: holderId,
|
|
461
|
+
holder_type: "form"
|
|
462
|
+
});
|
|
463
|
+
setEditHolderVisible(false);
|
|
464
|
+
setEditHolderData(null);
|
|
465
|
+
let newList = list;
|
|
466
|
+
if (holderId) {
|
|
467
|
+
if (res) {
|
|
468
|
+
newList = newList.map((item) => {
|
|
469
|
+
if (item.id === (editHolderData == null ? void 0 : editHolderData.wallet_record_id)) {
|
|
470
|
+
return {
|
|
471
|
+
...item,
|
|
472
|
+
holder: res
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
return item;
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
} else {
|
|
479
|
+
newList = newList.map((item) => {
|
|
480
|
+
if (item.id === (editHolderData == null ? void 0 : editHolderData.wallet_record_id)) {
|
|
481
|
+
return {
|
|
482
|
+
...item,
|
|
483
|
+
holder: null
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
return item;
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
setState({
|
|
490
|
+
list: newList
|
|
491
|
+
});
|
|
492
|
+
} catch (error2) {
|
|
493
|
+
console.error("Error updating wallet holder:", error2);
|
|
494
|
+
} finally {
|
|
495
|
+
setUpdateHolderLoading(false);
|
|
496
|
+
}
|
|
424
497
|
};
|
|
425
498
|
const onViewPinClick = (card) => {
|
|
426
499
|
var _a2;
|
|
@@ -432,7 +505,7 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
432
505
|
};
|
|
433
506
|
const renderWalletCard = (item) => {
|
|
434
507
|
var _a2;
|
|
435
|
-
const { code, shop, wallet, id } = item;
|
|
508
|
+
const { code, shop, wallet, id, customer_id, holder } = item;
|
|
436
509
|
const { metadata, name } = wallet || {};
|
|
437
510
|
const {
|
|
438
511
|
showcaseWalletPassNew = [],
|
|
@@ -451,6 +524,9 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
451
524
|
const cardItems = showcaseWalletPassNew.map((showCaseItem) => {
|
|
452
525
|
const balanceKey = _balanceKeyMap[showCaseItem.type];
|
|
453
526
|
let value = balanceKey ? balanceItem[balanceKey] || 0 : 0;
|
|
527
|
+
if (showCaseItem.type === "voucher") {
|
|
528
|
+
value += balanceItem.good_pass_count || 0;
|
|
529
|
+
}
|
|
454
530
|
return {
|
|
455
531
|
...showCaseItem,
|
|
456
532
|
value
|
|
@@ -471,8 +547,18 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
471
547
|
// codeType: barcodetype,
|
|
472
548
|
items: cardItems.slice(0, 4),
|
|
473
549
|
customBackgroundImage: coverImage,
|
|
474
|
-
isLogin: isUserLoggedIn
|
|
550
|
+
isLogin: isUserLoggedIn,
|
|
475
551
|
// 添加登录状态
|
|
552
|
+
holder,
|
|
553
|
+
onSetHolder: () => {
|
|
554
|
+
var _a3;
|
|
555
|
+
setEditHolderData({
|
|
556
|
+
wallet_record_id: id,
|
|
557
|
+
customer_id: holder == null ? void 0 : holder.customer_id,
|
|
558
|
+
form_id: (_a3 = holder == null ? void 0 : holder.metadata) == null ? void 0 : _a3.custom_id
|
|
559
|
+
});
|
|
560
|
+
setEditHolderVisible(true);
|
|
561
|
+
}
|
|
476
562
|
};
|
|
477
563
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
478
564
|
import_materials.WalletCard,
|
|
@@ -605,6 +691,20 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
605
691
|
)
|
|
606
692
|
)), /* @__PURE__ */ import_react.default.createElement(import_pinModal.default, { ref: pinModalRef }));
|
|
607
693
|
};
|
|
608
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-list-wrapper" }, renderContent())
|
|
694
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-list-wrapper" }, renderContent()), editHolderVisible && /* @__PURE__ */ import_react.default.createElement(
|
|
695
|
+
import_tempHolderSelector.default,
|
|
696
|
+
{
|
|
697
|
+
visible: true,
|
|
698
|
+
value: editHolderData == null ? void 0 : editHolderData.holder_id,
|
|
699
|
+
formId: editHolderData == null ? void 0 : editHolderData.form_id,
|
|
700
|
+
customerId: editHolderData == null ? void 0 : editHolderData.customer_id,
|
|
701
|
+
onConfirm: onBindHolder,
|
|
702
|
+
onCancel: () => {
|
|
703
|
+
setEditHolderVisible(false);
|
|
704
|
+
setEditHolderData(null);
|
|
705
|
+
},
|
|
706
|
+
confirmLoading: updateHolderLoading
|
|
707
|
+
}
|
|
708
|
+
));
|
|
609
709
|
});
|
|
610
710
|
var walletList_default = WalletList;
|