@pisell/private-materials 6.3.55 → 6.3.57
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 +2 -2
- package/build/lowcode/preview.js +8 -8
- 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/appointmentBooking/components/Services/index.js +27 -24
- package/es/components/appointmentBooking/components/Voucher/index.js +14 -0
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +29 -9
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +165 -145
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
- package/es/components/pay/toC/WalletPassBlock/index.js +3 -1
- package/es/components/pay/toC/index.js +65 -31
- package/es/components/pay/toC/model.d.ts +1 -0
- package/es/components/pay/toC/serve.d.ts +18 -0
- package/es/components/pay/toC/serve.js +29 -1
- package/es/components/pay/toC/utils.d.ts +2 -2
- package/es/components/pay/toC/utils.js +4 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.js +9 -12
- package/es/components/walletList/index.js +173 -39
- 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 +3 -2
- 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.js +1 -0
- package/es/plus/selectHolder/utils.js +16 -0
- package/es/plus/walletEditor/WalletEditor.js +60 -2
- 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/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.js +342 -0
- package/lib/components/appointmentBooking/components/Services/index.js +5 -2
- package/lib/components/appointmentBooking/components/Voucher/index.js +12 -0
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +29 -6
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +90 -103
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
- package/lib/components/pay/toC/WalletPassBlock/index.js +3 -1
- package/lib/components/pay/toC/index.js +52 -19
- package/lib/components/pay/toC/model.d.ts +1 -0
- package/lib/components/pay/toC/serve.d.ts +18 -0
- package/lib/components/pay/toC/serve.js +6 -0
- package/lib/components/pay/toC/utils.d.ts +2 -2
- package/lib/components/pay/toC/utils.js +4 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +2 -5
- package/lib/components/walletList/index.js +100 -4
- 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/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.js +17 -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.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/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.js +287 -0
- 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 +2 -2
- package/es/components/booking/info/service/editService/constants.d.ts +0 -1
- package/es/components/pay/toC/locales.d.ts +0 -301
- package/es/components/pay/toC/status.d.ts +0 -13
- package/es/components/systemSettings/registry/locales.d.ts +0 -272
- package/es/components/systemSettings/registry/services.d.ts +0 -77
- package/es/components/systemSettings/registry/types.d.ts +0 -126
- package/es/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/es/components/systemSettings/registry/utils/validators.d.ts +0 -8
- 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/es/components/wallet/utils.d.ts +0 -48
- package/es/components/walletList/locales.d.ts +0 -18
- package/es/components/walletList/types/index.d.ts +0 -194
- package/es/plus/walletEditor/components/JsonEditor/index.d.ts +0 -11
- package/es/plus/walletEditor/locales.d.ts +0 -126
- package/es/plus/walletEditor/types.d.ts +0 -52
- package/es/plus/walletPassGallery/locales.d.ts +0 -270
- package/es/pro/Login2.0/hooks/index.d.ts +0 -2
- package/es/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +0 -24
- package/es/pro/Login2.0/hooks/useRegisterFlow.d.ts +0 -39
- package/es/pro/Login2.0/hooks/useRegistrationMethods.d.ts +0 -9
- package/es/pro/Login2.0/locales.d.ts +0 -543
- package/es/pro/Login2.0/shared/Header.d.ts +0 -11
- package/es/pro/Login2.0/shared/registerFlow.d.ts +0 -116
- package/es/pro/Login2.0/shared/types.d.ts +0 -232
- package/es/pro/Login2.0/types.d.ts +0 -167
- package/lib/components/booking/info/service/editService/constants.d.ts +0 -1
- package/lib/components/pay/toC/locales.d.ts +0 -301
- package/lib/components/pay/toC/status.d.ts +0 -13
- package/lib/components/systemSettings/registry/locales.d.ts +0 -272
- package/lib/components/systemSettings/registry/services.d.ts +0 -77
- package/lib/components/systemSettings/registry/types.d.ts +0 -126
- package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/lib/components/systemSettings/registry/utils/validators.d.ts +0 -8
- 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
- package/lib/components/wallet/utils.d.ts +0 -48
- package/lib/components/walletList/locales.d.ts +0 -18
- package/lib/components/walletList/types/index.d.ts +0 -194
- package/lib/plus/walletEditor/components/JsonEditor/index.d.ts +0 -11
- package/lib/plus/walletEditor/locales.d.ts +0 -126
- package/lib/plus/walletEditor/types.d.ts +0 -52
- package/lib/plus/walletPassGallery/locales.d.ts +0 -270
- package/lib/pro/Login2.0/hooks/index.d.ts +0 -2
- package/lib/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +0 -24
- package/lib/pro/Login2.0/hooks/useRegisterFlow.d.ts +0 -39
- package/lib/pro/Login2.0/hooks/useRegistrationMethods.d.ts +0 -9
- package/lib/pro/Login2.0/locales.d.ts +0 -543
- package/lib/pro/Login2.0/shared/Header.d.ts +0 -11
- package/lib/pro/Login2.0/shared/registerFlow.d.ts +0 -116
- package/lib/pro/Login2.0/shared/types.d.ts +0 -232
- package/lib/pro/Login2.0/types.d.ts +0 -167
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
2
7
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
9
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -6,11 +11,6 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
|
6
11
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
12
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
13
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
15
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
16
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -27,149 +27,168 @@ import MultiModeSearch from "./MultiModeSearch";
|
|
|
27
27
|
import List from "./List";
|
|
28
28
|
import { searchMachineCodeList, searchWalletCode } from "./serve";
|
|
29
29
|
import { formatMachineCodeServer2CardList, getIsWalletCode } from "./utils";
|
|
30
|
-
import {
|
|
30
|
+
import { formatWalletPassList2PreparePayments } from "../../utils";
|
|
31
31
|
import "./index.less";
|
|
32
32
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
33
33
|
var Amount = PisellText.Amount;
|
|
34
34
|
var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
35
|
-
var _context$appHelper, _context$
|
|
35
|
+
var _context$appHelper, _context$appHelper2, _context$appHelper2$g, _searchSelectData$ids;
|
|
36
36
|
var onWalletPassChange = props.onWalletPassChange,
|
|
37
37
|
walletPass = props.walletPass,
|
|
38
|
-
walletSetting = props.walletSetting
|
|
38
|
+
walletSetting = props.walletSetting,
|
|
39
|
+
orderDetail = props.orderDetail,
|
|
40
|
+
total_amount = props.total_amount;
|
|
39
41
|
var context = useEngineContext();
|
|
40
|
-
var
|
|
42
|
+
var _ref = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
43
|
+
walletPassEvaluator = _ref.walletPassEvaluator;
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
var
|
|
45
|
+
// detail是product的列表
|
|
46
|
+
var detail = orderDetail.detail;
|
|
47
|
+
var isWalletCode = context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.utils) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.businessUtils) === null || _context$appHelper2 === void 0 || (_context$appHelper2$g = _context$appHelper2.getAppByModal) === null || _context$appHelper2$g === void 0 ? void 0 : _context$appHelper2$g.call(_context$appHelper2, 'wallet');
|
|
48
|
+
var recommended = walletPass.cards,
|
|
49
|
+
transformList = walletPass.transformList,
|
|
50
|
+
noApplicableVoucher = walletPass.noApplicableVoucher;
|
|
51
|
+
|
|
52
|
+
/** 当前选中的券ID列表(按选中顺序) */
|
|
53
|
+
var _useState = useState([]),
|
|
44
54
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
selectedVoucherIds = _useState2[0],
|
|
56
|
+
setSelectedVoucherIds = _useState2[1];
|
|
57
|
+
|
|
58
|
+
/** 当前 walletPass信息 弹窗操作时都在内部进行,点击 redeem时同步到外层 */
|
|
59
|
+
var _useState3 = useState(walletPass),
|
|
48
60
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
currentWalletPass = _useState4[0],
|
|
62
|
+
setCurrentWalletPass = _useState4[1];
|
|
51
63
|
var _useState5 = useState(false),
|
|
52
64
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/** 搜索 modal */
|
|
65
|
+
loading = _useState6[0],
|
|
66
|
+
setLoading = _useState6[1];
|
|
57
67
|
var _useState7 = useState(false),
|
|
58
68
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
open = _useState8[0],
|
|
70
|
+
setOpen = _useState8[1];
|
|
61
71
|
|
|
62
|
-
/**
|
|
63
|
-
var _useState9 = useState(
|
|
72
|
+
/** 搜索 modal */
|
|
73
|
+
var _useState9 = useState(false),
|
|
64
74
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
searchOpen = _useState10[0],
|
|
76
|
+
setSearchOpen = _useState10[1];
|
|
67
77
|
|
|
68
|
-
/**
|
|
69
|
-
var _useState11 = useState(
|
|
78
|
+
/** 搜索后添加的walletPass */
|
|
79
|
+
var _useState11 = useState([]),
|
|
70
80
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
addList = _useState12[0],
|
|
82
|
+
setAddList = _useState12[1];
|
|
73
83
|
|
|
74
|
-
/**
|
|
75
|
-
var _useState13 = useState(
|
|
84
|
+
/** 当前order信息 */
|
|
85
|
+
var _useState13 = useState(null),
|
|
76
86
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
order = _useState14[0],
|
|
88
|
+
setOrder = _useState14[1];
|
|
89
|
+
|
|
90
|
+
/** 当前搜索modal内list数据 */
|
|
91
|
+
var _useState15 = useState([]),
|
|
92
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
93
|
+
searchData = _useState16[0],
|
|
94
|
+
setSearchData = _useState16[1];
|
|
79
95
|
|
|
80
96
|
/** 当前搜索modal内选中数据 */
|
|
81
|
-
var
|
|
97
|
+
var _useState17 = useState({
|
|
82
98
|
ids: [],
|
|
83
99
|
details: []
|
|
84
100
|
}),
|
|
85
|
-
|
|
86
|
-
searchSelectData =
|
|
87
|
-
setSearchSelectData =
|
|
101
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
102
|
+
searchSelectData = _useState18[0],
|
|
103
|
+
setSearchSelectData = _useState18[1];
|
|
88
104
|
|
|
89
105
|
/** 是否默认选中 搜索时默认选中 列表select变更更新列表时不默认选中 */
|
|
90
106
|
var isAutoSelect = useRef(false);
|
|
91
|
-
var listRef = useRef(null);
|
|
92
107
|
|
|
93
108
|
/** 当前搜索框搜索值 */
|
|
94
109
|
var searchValRef = useRef(null);
|
|
95
110
|
var pinVerifyModalRef = useRef(null);
|
|
96
|
-
var _ref = currentWalletPass || {},
|
|
97
|
-
walletPassSelectCards = _ref.cards,
|
|
98
|
-
amount = _ref.amount;
|
|
99
111
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
// 合并计算数据源:transformList + addList
|
|
113
|
+
var allVouchersForCalculation = useMemo(function () {
|
|
114
|
+
return [].concat(_toConsumableArray(transformList || []), _toConsumableArray(addList || []));
|
|
115
|
+
}, [transformList, addList]);
|
|
116
|
+
|
|
117
|
+
// 根据选中的券ID获取选中的券对象列表(保持选中顺序)
|
|
118
|
+
var selectedVouchers = useMemo(function () {
|
|
119
|
+
return selectedVoucherIds.map(function (id) {
|
|
120
|
+
return allVouchersForCalculation.find(function (v) {
|
|
121
|
+
return v.id === id;
|
|
122
|
+
});
|
|
123
|
+
}).filter(Boolean);
|
|
124
|
+
}, [selectedVoucherIds, allVouchersForCalculation]);
|
|
125
|
+
|
|
126
|
+
// 计算展示列表和当前券的详细信息
|
|
104
127
|
var _useMemo = useMemo(function () {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
128
|
+
if (!walletPassEvaluator || !allVouchersForCalculation.length || !(order !== null && order !== void 0 && order.total_amount)) {
|
|
129
|
+
return {
|
|
130
|
+
displayVouchers: [].concat(_toConsumableArray(transformList || []), _toConsumableArray(noApplicableVoucher || [])),
|
|
131
|
+
displayOtherVouchers: addList || [],
|
|
132
|
+
selectedWithDetails: [],
|
|
133
|
+
totalDeduction: 0
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// 如果没有选中任何券,返回初始状态
|
|
138
|
+
if (selectedVouchers.length === 0) {
|
|
139
|
+
return {
|
|
140
|
+
displayVouchers: [].concat(_toConsumableArray(transformList || []), _toConsumableArray(noApplicableVoucher || [])),
|
|
141
|
+
displayOtherVouchers: addList || [],
|
|
142
|
+
selectedWithDetails: [],
|
|
143
|
+
totalDeduction: 0
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// 有选中的券,重新计算(基于 transformList + addList)
|
|
148
|
+
var result = walletPassEvaluator.recalculateVouchers(allVouchersForCalculation, selectedVouchers, order.total_amount, detail || []);
|
|
149
|
+
|
|
150
|
+
// 分离当前客户的券和其他客户的券
|
|
151
|
+
var currentCustomerVouchers = [];
|
|
152
|
+
var otherCustomerVouchers = [];
|
|
153
|
+
result.allWithUpdatedStatus.forEach(function (voucher) {
|
|
154
|
+
if (voucher.customer_id === (order === null || order === void 0 ? void 0 : order.customer_id)) {
|
|
155
|
+
currentCustomerVouchers.push(voucher);
|
|
110
156
|
} else {
|
|
111
|
-
|
|
157
|
+
otherCustomerVouchers.push(voucher);
|
|
112
158
|
}
|
|
113
159
|
});
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
160
|
+
return {
|
|
161
|
+
displayVouchers: [].concat(currentCustomerVouchers, _toConsumableArray(noApplicableVoucher || [])),
|
|
162
|
+
displayOtherVouchers: otherCustomerVouchers,
|
|
163
|
+
selectedWithDetails: result.selectedWithDetails,
|
|
164
|
+
totalDeduction: result.selectedWithDetails.reduce(function (sum, v) {
|
|
165
|
+
return sum + (v.actualDeduction || 0);
|
|
166
|
+
}, 0)
|
|
167
|
+
};
|
|
168
|
+
}, [selectedVouchers, allVouchersForCalculation, transformList, addList, noApplicableVoucher, order === null || order === void 0 ? void 0 : order.total_amount, order === null || order === void 0 ? void 0 : order.customer_id, detail, walletPassEvaluator]),
|
|
169
|
+
displayVouchers = _useMemo.displayVouchers,
|
|
170
|
+
displayOtherVouchers = _useMemo.displayOtherVouchers,
|
|
171
|
+
selectedWithDetails = _useMemo.selectedWithDetails,
|
|
172
|
+
totalDeduction = _useMemo.totalDeduction;
|
|
119
173
|
|
|
120
174
|
// 基于选择的 walletPassCard转换接口所需prepare_payments参数
|
|
121
175
|
var prepare_payments = useMemo(function () {
|
|
122
|
-
return formatWalletPassList2PreparePayments(uniqueByKey((
|
|
123
|
-
}, [
|
|
176
|
+
return formatWalletPassList2PreparePayments(uniqueByKey((selectedWithDetails || []).concat(searchSelectData.details), 'id'));
|
|
177
|
+
}, [selectedWithDetails, searchSelectData]);
|
|
124
178
|
|
|
125
179
|
// 当前列表选中id
|
|
126
180
|
var selectValue = useMemo(function () {
|
|
127
|
-
return
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
addList.forEach(function (item) {
|
|
137
|
-
if (!selectValue.includes(item.id)) {
|
|
138
|
-
codes.push(item.code);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
return codes;
|
|
142
|
-
}, [addList, selectValue]);
|
|
143
|
-
var refreshList = useMemoizedFn(function () {
|
|
144
|
-
if (order !== null && order !== void 0 && order.order_id && order !== null && order !== void 0 && order.customer_id) {
|
|
145
|
-
var _listRef$current, _order$_order;
|
|
146
|
-
(_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.init({
|
|
147
|
-
order_id: order.order_id,
|
|
148
|
-
available: 2,
|
|
149
|
-
prepare_payments: prepare_payments,
|
|
150
|
-
filter_prepare_wallet_pass: 1,
|
|
151
|
-
sale_channel: ((_order$_order = order._order) === null || _order$_order === void 0 ? void 0 : _order$_order.sale_channel) || 'online-store',
|
|
152
|
-
other_exact_codes: other_exact_codes
|
|
153
|
-
},
|
|
154
|
-
// 已选择的卡片接口中不会返回,所以追加进入列表
|
|
155
|
-
function (val) {
|
|
156
|
-
var idMap = val.reduce(function (pre, cur) {
|
|
157
|
-
return _objectSpread(_objectSpread({}, pre), {}, _defineProperty({}, cur.id, cur));
|
|
158
|
-
}, {});
|
|
159
|
-
setAddList(function (prevState) {
|
|
160
|
-
return prevState.map(function (item) {
|
|
161
|
-
if (idMap[item.id]) {
|
|
162
|
-
return idMap[item.id];
|
|
163
|
-
}
|
|
164
|
-
return item;
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
return [].concat(_toConsumableArray(currentCustomerWalletPass || []), _toConsumableArray(val)).filter(function (item) {
|
|
168
|
-
return !(order !== null && order !== void 0 && order.customer_id) || item.customer_id === (order === null || order === void 0 ? void 0 : order.customer_id);
|
|
169
|
-
});
|
|
170
|
-
});
|
|
181
|
+
return selectedVoucherIds;
|
|
182
|
+
}, [selectedVoucherIds]);
|
|
183
|
+
|
|
184
|
+
// 初始化时设置默认选中的券
|
|
185
|
+
useEffect(function () {
|
|
186
|
+
if (recommended && recommended.length > 0) {
|
|
187
|
+
setSelectedVoucherIds(recommended.map(function (v) {
|
|
188
|
+
return v.id;
|
|
189
|
+
}));
|
|
171
190
|
}
|
|
172
|
-
});
|
|
191
|
+
}, [recommended]);
|
|
173
192
|
|
|
174
193
|
/**
|
|
175
194
|
* 搜索结果list弹窗列表选中发生变更时 重新获取接口
|
|
@@ -193,9 +212,12 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
193
212
|
setOrder(res);
|
|
194
213
|
setOpen(true);
|
|
195
214
|
setCurrentWalletPass(walletPass);
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
215
|
+
// 设置初始选中的推荐券
|
|
216
|
+
if (recommended && recommended.length > 0) {
|
|
217
|
+
setSelectedVoucherIds(recommended.map(function (v) {
|
|
218
|
+
return v.id;
|
|
219
|
+
}));
|
|
220
|
+
}
|
|
199
221
|
case 6:
|
|
200
222
|
case "end":
|
|
201
223
|
return _context.stop();
|
|
@@ -213,7 +235,7 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
213
235
|
*/
|
|
214
236
|
var searchList = /*#__PURE__*/function () {
|
|
215
237
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3, isSelectChange) {
|
|
216
|
-
var code, customer_pin_key, _order$
|
|
238
|
+
var code, customer_pin_key, _order$_order, baseResult, result;
|
|
217
239
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
218
240
|
while (1) switch (_context2.prev = _context2.next) {
|
|
219
241
|
case 0:
|
|
@@ -232,12 +254,12 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
232
254
|
code: code,
|
|
233
255
|
prepare_payments: prepare_payments,
|
|
234
256
|
// filter_prepare_wallet_pass: 1,
|
|
235
|
-
sale_channel: ((_order$
|
|
257
|
+
sale_channel: ((_order$_order = order._order) === null || _order$_order === void 0 ? void 0 : _order$_order.sale_channel) || 'online-store',
|
|
236
258
|
customer_pin_key: customer_pin_key
|
|
237
259
|
});
|
|
238
260
|
case 7:
|
|
239
|
-
|
|
240
|
-
if (
|
|
261
|
+
baseResult = _context2.sent;
|
|
262
|
+
if (baseResult) {
|
|
241
263
|
_context2.next = 11;
|
|
242
264
|
break;
|
|
243
265
|
}
|
|
@@ -254,6 +276,11 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
254
276
|
}
|
|
255
277
|
return _context2.abrupt("return");
|
|
256
278
|
case 13:
|
|
279
|
+
result = walletPassEvaluator.searchVoucherFormat({
|
|
280
|
+
vouchers: baseResult,
|
|
281
|
+
orderTotalAmount: order.total_amount,
|
|
282
|
+
products: detail
|
|
283
|
+
});
|
|
257
284
|
setSearchData(formatMachineCodeServer2CardList([].concat(_toConsumableArray(searchSelectData.details), _toConsumableArray(result)), searchSelectData.ids));
|
|
258
285
|
if (result.length) {
|
|
259
286
|
// 如果搜索结果只有一个并且可用,则直接选中
|
|
@@ -269,15 +296,15 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
269
296
|
customer_pin_key: customer_pin_key
|
|
270
297
|
};
|
|
271
298
|
}
|
|
272
|
-
case
|
|
273
|
-
_context2.prev =
|
|
299
|
+
case 16:
|
|
300
|
+
_context2.prev = 16;
|
|
274
301
|
setLoading(false);
|
|
275
|
-
return _context2.finish(
|
|
276
|
-
case
|
|
302
|
+
return _context2.finish(16);
|
|
303
|
+
case 19:
|
|
277
304
|
case "end":
|
|
278
305
|
return _context2.stop();
|
|
279
306
|
}
|
|
280
|
-
}, _callee2, null, [[4,,
|
|
307
|
+
}, _callee2, null, [[4,, 16, 19]]);
|
|
281
308
|
}));
|
|
282
309
|
return function searchList(_x2, _x3) {
|
|
283
310
|
return _ref4.apply(this, arguments);
|
|
@@ -361,12 +388,19 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
361
388
|
});
|
|
362
389
|
};
|
|
363
390
|
var handleSelectOk = function handleSelectOk() {
|
|
364
|
-
|
|
391
|
+
// 将搜索选中的券添加到 addList(只添加非当前客户的券)
|
|
392
|
+
var otherCustomerSearchVouchers = searchSelectData.details.filter(function (item) {
|
|
393
|
+
return item.customer_id !== (order === null || order === void 0 ? void 0 : order.customer_id);
|
|
394
|
+
});
|
|
365
395
|
setAddList(function (prevState) {
|
|
366
|
-
return uniqueByKey([].concat(_toConsumableArray(prevState), _toConsumableArray(
|
|
367
|
-
|
|
368
|
-
|
|
396
|
+
return uniqueByKey([].concat(_toConsumableArray(prevState), _toConsumableArray(otherCustomerSearchVouchers)), 'id');
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
// 更新选中的券ID列表(包括所有搜索选中的券)
|
|
400
|
+
var newSelectedIds = uniqueByKey([].concat(_toConsumableArray(selectedWithDetails || []), _toConsumableArray(searchSelectData.details)), 'id').map(function (v) {
|
|
401
|
+
return v.id;
|
|
369
402
|
});
|
|
403
|
+
setSelectedVoucherIds(newSelectedIds);
|
|
370
404
|
handleSearchModalClose();
|
|
371
405
|
};
|
|
372
406
|
var handleAddChange = useMemoizedFn(function (val, details) {
|
|
@@ -378,29 +412,15 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
378
412
|
})
|
|
379
413
|
});
|
|
380
414
|
});
|
|
381
|
-
var changeWalletPass = function changeWalletPass(cards) {
|
|
382
|
-
setCurrentWalletPass === null || setCurrentWalletPass === void 0 || setCurrentWalletPass({
|
|
383
|
-
cards: cards,
|
|
384
|
-
amount: calcWalletPassListAmount(cards)
|
|
385
|
-
});
|
|
386
|
-
setTimeout(function () {
|
|
387
|
-
refreshList();
|
|
388
|
-
});
|
|
389
|
-
};
|
|
390
415
|
var handleSelectChange = function handleSelectChange(val, details, type) {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
});
|
|
394
|
-
// 更新时 把当前客户value和其他客户value合并
|
|
395
|
-
if (type === 'other') {
|
|
396
|
-
cards = currentCustomerWalletPass.concat(cards);
|
|
397
|
-
} else if (type === 'current') {
|
|
398
|
-
cards = otherCustomerWalletPass.concat(cards);
|
|
399
|
-
}
|
|
400
|
-
changeWalletPass(cards);
|
|
416
|
+
// 更新选中的券ID列表
|
|
417
|
+
setSelectedVoucherIds(val);
|
|
401
418
|
};
|
|
402
419
|
var handleRedeem = function handleRedeem() {
|
|
403
|
-
onWalletPassChange === null || onWalletPassChange === void 0 || onWalletPassChange(currentWalletPass)
|
|
420
|
+
onWalletPassChange === null || onWalletPassChange === void 0 || onWalletPassChange(_objectSpread(_objectSpread({}, currentWalletPass), {}, {
|
|
421
|
+
cards: selectedWithDetails,
|
|
422
|
+
amount: totalDeduction
|
|
423
|
+
}));
|
|
404
424
|
setOpen(false);
|
|
405
425
|
};
|
|
406
426
|
var handleWalletClose = function handleWalletClose() {
|
|
@@ -422,7 +442,7 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
422
442
|
cancelVisible: false,
|
|
423
443
|
destroyOnClose: true,
|
|
424
444
|
okText: /*#__PURE__*/React.createElement("div", null, locales.getText('tocPay.text.redeem'), " ", /*#__PURE__*/React.createElement(Amount, {
|
|
425
|
-
value:
|
|
445
|
+
value: totalDeduction
|
|
426
446
|
})),
|
|
427
447
|
onOk: handleRedeem
|
|
428
448
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -440,9 +460,9 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
440
460
|
className: "wallet-pass-modal-multi-selection-available-title-icon"
|
|
441
461
|
}), locales.getText('tocPay.text.multipleSelectionAvailable')), /*#__PURE__*/React.createElement("div", {
|
|
442
462
|
className: "wallet-pass-modal-multi-selection-available-desc"
|
|
443
|
-
}, locales.getText('tocPay.text.youCanSelectMultipleWalletPassesToCombineForPayment')(walletSetting.name))),
|
|
463
|
+
}, locales.getText('tocPay.text.youCanSelectMultipleWalletPassesToCombineForPayment')(walletSetting.name))), displayOtherVouchers.length > 0 && /*#__PURE__*/React.createElement(List, {
|
|
444
464
|
walletSetting: walletSetting,
|
|
445
|
-
data:
|
|
465
|
+
data: formatMachineCodeServer2CardList(displayOtherVouchers, selectValue),
|
|
446
466
|
title: locales.getText('tocPay.text.couponCodesAdded'),
|
|
447
467
|
onChange: handleOtherChange,
|
|
448
468
|
value: selectValue,
|
|
@@ -452,9 +472,9 @@ var WalletPass = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
452
472
|
walletSetting: walletSetting,
|
|
453
473
|
title: walletSetting.name,
|
|
454
474
|
onChange: handleCurrentChange,
|
|
455
|
-
|
|
475
|
+
data: formatMachineCodeServer2CardList(displayVouchers, selectValue),
|
|
456
476
|
value: selectValue,
|
|
457
|
-
|
|
477
|
+
loading: loading
|
|
458
478
|
}))), /*#__PURE__*/React.createElement(PisellModal, {
|
|
459
479
|
title: /*#__PURE__*/React.createElement("div", null, locales.getText('tocPay.text.searchResult')),
|
|
460
480
|
mobileModalHeight: '90%',
|
|
@@ -56,6 +56,12 @@ export declare type WalletPassDataType = {
|
|
|
56
56
|
metadata?: {
|
|
57
57
|
validity_type: string;
|
|
58
58
|
};
|
|
59
|
+
/** 前端计算 可用最大金额 */
|
|
60
|
+
_available_max_amount?: number;
|
|
61
|
+
/** 前端计算 统一可用状态 */
|
|
62
|
+
_unified_available_status?: 0 | 1;
|
|
63
|
+
/** 前端计算 禁用原因 */
|
|
64
|
+
reason?: string;
|
|
59
65
|
};
|
|
60
66
|
declare type Shop = {
|
|
61
67
|
id: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatDate, locales } from '@pisell/utils';
|
|
1
|
+
import { formatDate, isNumber, locales } from '@pisell/utils';
|
|
2
2
|
import { globalConfig } from '@pisell/materials';
|
|
3
3
|
import { getAvailableMaxAmount } from "../../utils";
|
|
4
4
|
var voucherTime = function voucherTime(data) {
|
|
@@ -25,8 +25,8 @@ export var formatMachineCodeServer2CardList = function formatMachineCodeServer2C
|
|
|
25
25
|
showDetail: false,
|
|
26
26
|
showQrCode: false,
|
|
27
27
|
code: item.code,
|
|
28
|
-
disabled: !item.unified_available_status,
|
|
29
|
-
disabledReason: (_item$unified_message = item.unified_messages) === null || _item$unified_message === void 0 ? void 0 : _item$unified_message.title,
|
|
28
|
+
disabled: isNumber(item._unified_available_status) ? !item._unified_available_status : !item.unified_available_status,
|
|
29
|
+
disabledReason: isNumber(item._unified_available_status) ? item.reason : (_item$unified_message = item.unified_messages) === null || _item$unified_message === void 0 ? void 0 : _item$unified_message.title,
|
|
30
30
|
cover: (_item$product = item.product) === null || _item$product === void 0 ? void 0 : _item$product.cover,
|
|
31
31
|
qrCode: item.code,
|
|
32
32
|
validDate: voucherTime(item),
|
|
@@ -163,7 +163,9 @@ var WalletPassBlock = function WalletPassBlock(props, ref) {
|
|
|
163
163
|
ref: walletPassRef,
|
|
164
164
|
walletSetting: walletSetting,
|
|
165
165
|
onWalletPassChange: onWalletPassChange,
|
|
166
|
-
walletPass: payGroup === null || payGroup === void 0 ? void 0 : payGroup.walletPass
|
|
166
|
+
walletPass: payGroup === null || payGroup === void 0 ? void 0 : payGroup.walletPass,
|
|
167
|
+
orderDetail: payGroup === null || payGroup === void 0 ? void 0 : payGroup.orderDetail,
|
|
168
|
+
total_amount: payGroup === null || payGroup === void 0 ? void 0 : payGroup.total_amount
|
|
167
169
|
}), /*#__PURE__*/React.createElement(WalletAvailable, {
|
|
168
170
|
ref: walletAvailableRef,
|
|
169
171
|
walletSetting: walletSetting,
|