@pisell/private-materials 3.0.203 → 3.0.205
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +27 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +33 -18
- package/es/components/booking/components/customSelect/index.d.ts +0 -1
- package/es/components/booking/components/customSelect/index.js +2 -6
- package/es/components/booking/components/footer/amount.js +22 -46
- package/es/components/booking/components/footer/index.js +40 -84
- package/es/components/booking/components/footer/utils.js +35 -266
- package/es/components/booking/forms/model.d.ts +1 -1
- package/es/components/booking/info/addServiceVariant/index.js +1 -8
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +13 -14
- package/es/components/booking/info/clientVariant/vertical/index.js +9 -124
- package/es/components/booking/info/main.js +15 -28
- package/es/components/booking/info/model.js +0 -3
- package/es/components/booking/info/pet/index.js +5 -54
- package/es/components/booking/info/service/addService/index.js +96 -187
- package/es/components/booking/info/service/addService/index.less +3 -13
- package/es/components/booking/info/service/addService/utils.d.ts +2 -12
- package/es/components/booking/info/service/addService/utils.js +26 -103
- package/es/components/booking/info/service/editService/index.js +132 -435
- package/es/components/booking/info/service/editService/index.less +13 -18
- package/es/components/booking/info/service/serve.d.ts +0 -10
- package/es/components/booking/info/service/serve.js +0 -28
- package/es/components/booking/info/utils.d.ts +0 -20
- package/es/components/booking/info/utils.js +0 -37
- package/es/components/booking/locales.d.ts +0 -66
- package/es/components/booking/locales.js +3 -81
- package/es/components/booking/model.d.ts +1 -5
- package/es/components/booking/model.js +2 -4
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -1
- package/es/components/booking/utils.d.ts +3 -12
- package/es/components/booking/utils.js +26 -143
- package/es/components/eftpos/form/index.js +12 -6
- package/es/components/eftpos/group/index.d.ts +1 -2
- package/es/components/eftpos/group/index.js +1 -2
- package/es/components/eftpos/hooks.d.ts +4 -4
- package/es/components/eftpos/index.js +2 -2
- package/es/components/eftpos/receipt/index.d.ts +24 -0
- package/es/components/eftpos/receipt/index.js +96 -0
- package/es/components/eftposPay/app.d.ts +11 -0
- package/es/components/eftposPay/app.js +173 -0
- package/es/components/eftposPay/component/fail/failCustom.js +1 -0
- package/es/components/eftposPay/component/fail/index.js +1 -0
- package/es/components/eftposPay/component/manual/index.js +4 -1
- package/es/components/eftposPay/component/step/index.d.ts +6 -6
- package/es/components/eftposPay/component/step/step.d.ts +4 -4
- package/es/components/eftposPay/const.d.ts +27 -1
- package/es/components/eftposPay/const.js +22 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/device.js +2 -2
- package/es/components/eftposPay/helper.d.ts +6 -0
- package/es/components/eftposPay/helper.js +24 -4
- package/es/components/eftposPay/hooks.d.ts +2 -1
- package/es/components/eftposPay/hooks.js +22 -16
- package/es/components/eftposPay/index.d.ts +1 -1
- package/es/components/eftposPay/index.js +130 -179
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +15 -0
- package/es/components/eftposPay/payo/config.js +20 -8
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tip.d.ts +10 -0
- package/es/components/eftposPay/tip.js +177 -0
- package/es/components/eftposPay/tip.less +9 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/es/components/eftposPay/tyro/index.js +55 -22
- package/es/components/eftposPay/windcave/helper.d.ts +1 -1
- package/es/components/eftposPay/windcave/windcave.js +17 -6
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -1
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -2
- package/lib/components/booking/components/customSelect/index.d.ts +0 -1
- package/lib/components/booking/components/customSelect/index.js +2 -6
- package/lib/components/booking/components/footer/amount.js +8 -27
- package/lib/components/booking/components/footer/index.js +4 -25
- package/lib/components/booking/components/footer/utils.js +35 -161
- package/lib/components/booking/forms/model.d.ts +1 -1
- package/lib/components/booking/info/addServiceVariant/index.js +0 -5
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +7 -8
- package/lib/components/booking/info/clientVariant/vertical/index.js +11 -87
- package/lib/components/booking/info/main.js +9 -17
- package/lib/components/booking/info/model.js +0 -3
- package/lib/components/booking/info/pet/index.js +25 -61
- package/lib/components/booking/info/service/addService/index.js +84 -115
- package/lib/components/booking/info/service/addService/index.less +3 -13
- package/lib/components/booking/info/service/addService/utils.d.ts +2 -12
- package/lib/components/booking/info/service/addService/utils.js +10 -58
- package/lib/components/booking/info/service/editService/index.js +182 -425
- package/lib/components/booking/info/service/editService/index.less +13 -18
- package/lib/components/booking/info/service/serve.d.ts +0 -10
- package/lib/components/booking/info/service/serve.js +2 -7
- package/lib/components/booking/info/utils.d.ts +0 -20
- package/lib/components/booking/info/utils.js +0 -41
- package/lib/components/booking/locales.d.ts +0 -66
- package/lib/components/booking/locales.js +3 -69
- package/lib/components/booking/model.d.ts +1 -5
- package/lib/components/booking/model.js +2 -4
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +3 -12
- package/lib/components/booking/utils.js +18 -89
- package/lib/components/eftpos/form/index.js +12 -6
- package/lib/components/eftpos/group/index.d.ts +1 -2
- package/lib/components/eftpos/group/index.js +0 -1
- package/lib/components/eftpos/hooks.d.ts +4 -4
- package/lib/components/eftpos/index.js +2 -2
- package/lib/components/eftpos/receipt/index.d.ts +24 -0
- package/lib/components/eftpos/receipt/index.js +88 -0
- package/lib/components/eftposPay/app.d.ts +11 -0
- package/lib/components/eftposPay/app.js +166 -0
- package/lib/components/eftposPay/component/fail/failCustom.js +1 -1
- package/lib/components/eftposPay/component/fail/index.js +1 -1
- package/lib/components/eftposPay/component/manual/index.js +19 -5
- package/lib/components/eftposPay/component/step/index.d.ts +6 -6
- package/lib/components/eftposPay/component/step/step.d.ts +4 -4
- package/lib/components/eftposPay/const.d.ts +27 -1
- package/lib/components/eftposPay/const.js +18 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/device.js +2 -2
- package/lib/components/eftposPay/helper.d.ts +6 -0
- package/lib/components/eftposPay/helper.js +29 -4
- package/lib/components/eftposPay/hooks.d.ts +2 -1
- package/lib/components/eftposPay/hooks.js +8 -2
- package/lib/components/eftposPay/index.d.ts +1 -1
- package/lib/components/eftposPay/index.js +106 -144
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +15 -0
- package/lib/components/eftposPay/payo/config.js +33 -9
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tip.d.ts +10 -0
- package/lib/components/eftposPay/tip.js +159 -0
- package/lib/components/eftposPay/tip.less +9 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/lib/components/eftposPay/tyro/index.js +40 -9
- package/lib/components/eftposPay/windcave/helper.d.ts +1 -1
- package/lib/components/eftposPay/windcave/windcave.js +29 -6
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/package.json +5 -5
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -38
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/info/Provider.d.ts +0 -0
- package/es/components/booking/info/Provider.js +0 -54
- package/es/components/booking/info/dateRange/index.d.ts +0 -5
- package/es/components/booking/info/dateRange/index.js +0 -98
- package/es/components/booking/info/dateRange/index.less +0 -21
- package/es/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
- package/es/components/booking/info/pet/ChangePetModal/index.js +0 -134
- package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/es/components/booking/info/service/editService/BookingList/index.js +0 -39
- package/es/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/es/components/booking/info/service/editService/EditTabs/index.js +0 -35
- package/es/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/es/components/booking/info/service/serviceManager/distributeDiscount.js +0 -55
- package/es/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/es/components/booking/info/service/serviceManager/index.js +0 -277
- package/es/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/es/components/booking/info/service/serviceManager/utils.js +0 -0
- package/es/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/es/components/booking/info/service2/Group/utils.js +0 -146
- package/es/components/booking/info/service2/Lists.d.ts +0 -3
- package/es/components/booking/info/service2/Lists.js +0 -152
- package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
- package/es/components/booking/info/service2/hooks/useSelectPet.js +0 -54
- package/es/components/booking/info/service2/index.d.ts +0 -6
- package/es/components/booking/info/service2/index.js +0 -57
- package/es/components/booking/info/service2/status.d.ts +0 -31
- package/es/components/booking/info/service2/status.js +0 -78
- package/es/components/booking/info/service2/utils.d.ts +0 -237
- package/es/components/booking/info/service2/utils.js +0 -1064
- package/es/components/booking/materiels/holder/index.d.ts +0 -7
- package/es/components/booking/materiels/holder/index.js +0 -51
- package/es/components/shoppingCart/Provider.d.ts +0 -3
- package/es/components/shoppingCart/Provider.js +0 -86
- package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -4
- package/es/components/shoppingCart/components/Cart/Product.js +0 -68
- package/es/components/shoppingCart/components/Cart/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Cart/index.js +0 -72
- package/es/components/shoppingCart/components/Cart/index.less +0 -68
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Empty/index.js +0 -14
- package/es/components/shoppingCart/components/Empty/index.less +0 -19
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Render/index.js +0 -69
- package/es/components/shoppingCart/components/Render/index.less +0 -2
- package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
- package/es/components/shoppingCart/components/SelectHolderModal/index.js +0 -132
- package/es/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -3
- package/es/components/shoppingCart/hooks/useAddService.js +0 -23
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
- package/es/components/shoppingCart/hooks/useClearCart.js +0 -59
- package/es/components/shoppingCart/hooks/useContext.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useContext.js +0 -5
- package/es/components/shoppingCart/index.d.ts +0 -4
- package/es/components/shoppingCart/index.js +0 -24
- package/es/components/shoppingCart/locales.d.ts +0 -33
- package/es/components/shoppingCart/locales.js +0 -38
- package/es/components/shoppingCart/mock.d.ts +0 -40
- package/es/components/shoppingCart/mock.js +0 -40
- package/es/components/shoppingCart/status.d.ts +0 -2
- package/es/components/shoppingCart/status.js +0 -22
- package/es/components/shoppingCart/type.d.ts +0 -39
- package/es/components/shoppingCart/type.js +0 -1
- package/es/components/shoppingCart/utils.d.ts +0 -63
- package/es/components/shoppingCart/utils.js +0 -116
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -60
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/info/Provider.d.ts +0 -0
- package/lib/components/booking/info/Provider.js +0 -0
- package/lib/components/booking/info/dateRange/index.d.ts +0 -5
- package/lib/components/booking/info/dateRange/index.js +0 -111
- package/lib/components/booking/info/dateRange/index.less +0 -21
- package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
- package/lib/components/booking/info/pet/ChangePetModal/index.js +0 -121
- package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/lib/components/booking/info/service/editService/BookingList/index.js +0 -55
- package/lib/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/lib/components/booking/info/service/editService/EditTabs/index.js +0 -75
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.js +0 -70
- package/lib/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/lib/components/booking/info/service/serviceManager/index.js +0 -207
- package/lib/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/lib/components/booking/info/service/serviceManager/utils.js +0 -0
- package/lib/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/lib/components/booking/info/service2/Group/utils.js +0 -142
- package/lib/components/booking/info/service2/Lists.d.ts +0 -3
- package/lib/components/booking/info/service2/Lists.js +0 -115
- package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
- package/lib/components/booking/info/service2/hooks/useSelectPet.js +0 -50
- package/lib/components/booking/info/service2/index.d.ts +0 -6
- package/lib/components/booking/info/service2/index.js +0 -75
- package/lib/components/booking/info/service2/status.d.ts +0 -31
- package/lib/components/booking/info/service2/status.js +0 -81
- package/lib/components/booking/info/service2/utils.d.ts +0 -237
- package/lib/components/booking/info/service2/utils.js +0 -678
- package/lib/components/booking/materiels/holder/index.d.ts +0 -7
- package/lib/components/booking/materiels/holder/index.js +0 -65
- package/lib/components/shoppingCart/Provider.d.ts +0 -3
- package/lib/components/shoppingCart/Provider.js +0 -110
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -4
- package/lib/components/shoppingCart/components/Cart/Product.js +0 -73
- package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Cart/index.js +0 -77
- package/lib/components/shoppingCart/components/Cart/index.less +0 -68
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Empty/index.js +0 -43
- package/lib/components/shoppingCart/components/Empty/index.less +0 -19
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Render/index.js +0 -75
- package/lib/components/shoppingCart/components/Render/index.less +0 -2
- package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/SelectHolderModal/index.js +0 -124
- package/lib/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -3
- package/lib/components/shoppingCart/hooks/useAddService.js +0 -55
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
- package/lib/components/shoppingCart/hooks/useClearCart.js +0 -66
- package/lib/components/shoppingCart/hooks/useContext.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useContext.js +0 -31
- package/lib/components/shoppingCart/index.d.ts +0 -4
- package/lib/components/shoppingCart/index.js +0 -60
- package/lib/components/shoppingCart/locales.d.ts +0 -33
- package/lib/components/shoppingCart/locales.js +0 -56
- package/lib/components/shoppingCart/mock.d.ts +0 -40
- package/lib/components/shoppingCart/mock.js +0 -76
- package/lib/components/shoppingCart/status.d.ts +0 -2
- package/lib/components/shoppingCart/status.js +0 -60
- package/lib/components/shoppingCart/type.d.ts +0 -39
- package/lib/components/shoppingCart/type.js +0 -17
- package/lib/components/shoppingCart/utils.d.ts +0 -63
- package/lib/components/shoppingCart/utils.js +0 -86
- package/lowcode/shopping-cart/meta.ts +0 -98
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
/* eslint-disable no-nested-ternary */
|
|
14
|
+
import { locales } from '@pisell/utils';
|
|
15
|
+
import { Button } from 'antd';
|
|
16
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
17
|
+
import { getPayParams } from "./helper";
|
|
18
|
+
import { RestoreEumn, EftposEnum } from "./const";
|
|
19
|
+
import dayjs from 'dayjs';
|
|
20
|
+
import { useDispatch, useContextData, updateState, updateCustom, updateNextStep } from "./store";
|
|
21
|
+
import { useStoreRef } from "./hooks";
|
|
22
|
+
import "./tip.less";
|
|
23
|
+
function formatDateUtils(date, format) {
|
|
24
|
+
if (!date) {
|
|
25
|
+
return date;
|
|
26
|
+
}
|
|
27
|
+
if (date.includes('undefined')) {
|
|
28
|
+
return '';
|
|
29
|
+
}
|
|
30
|
+
var lang = localStorage.getItem('umi_locale') || 'en-US';
|
|
31
|
+
var _format = format || ['HH:mm:ss DD/MM/YYYY', 'YYYY年MM月DD日 HH:mm:ss'];
|
|
32
|
+
var type = lang === 'en-US' || lang === 'en' ? _format[0] : _format[1];
|
|
33
|
+
return dayjs(date).locale(lang).format(type);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @title: 支付状态未知页面
|
|
38
|
+
* @description:
|
|
39
|
+
* @Author: hongbing.wang
|
|
40
|
+
* @Date: 2024-08-20 11:42
|
|
41
|
+
*/
|
|
42
|
+
export default (function (_ref) {
|
|
43
|
+
var onChangeStatus = _ref.onChangeStatus,
|
|
44
|
+
_ref$className = _ref.className,
|
|
45
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
46
|
+
formatAmount = _ref.formatAmount,
|
|
47
|
+
cardSurcharge = _ref.cardSurcharge,
|
|
48
|
+
receipts = _ref.receipts,
|
|
49
|
+
successTime = _ref.successTime,
|
|
50
|
+
onChangeParams = _ref.onChangeParams;
|
|
51
|
+
var _useState = useState(true),
|
|
52
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
+
disabled = _useState2[0],
|
|
54
|
+
setDisabled = _useState2[1];
|
|
55
|
+
var _useState3 = useState(''),
|
|
56
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
|
+
amount = _useState4[0],
|
|
58
|
+
setAmount = _useState4[1];
|
|
59
|
+
var _useState5 = useState(''),
|
|
60
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
61
|
+
surcharge = _useState6[0],
|
|
62
|
+
setSurcharge = _useState6[1];
|
|
63
|
+
var _useState7 = useState(''),
|
|
64
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
65
|
+
surMoney = _useState8[0],
|
|
66
|
+
setSurMoney = _useState8[1];
|
|
67
|
+
var _useState9 = useState(''),
|
|
68
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
69
|
+
rate = _useState10[0],
|
|
70
|
+
setRate = _useState10[1];
|
|
71
|
+
var _useState11 = useState(''),
|
|
72
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
73
|
+
total = _useState12[0],
|
|
74
|
+
setTotal = _useState12[1];
|
|
75
|
+
var _useState13 = useState(''),
|
|
76
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
77
|
+
time = _useState14[0],
|
|
78
|
+
setTime = _useState14[1];
|
|
79
|
+
var data = useContextData();
|
|
80
|
+
var symbol = data.symbol,
|
|
81
|
+
custom = data.custom;
|
|
82
|
+
var ref = useRef();
|
|
83
|
+
var dispatch = useDispatch();
|
|
84
|
+
var listRef = useRef(custom === null || custom === void 0 ? void 0 : custom.list);
|
|
85
|
+
var _useStoreRef = useStoreRef(),
|
|
86
|
+
deviceRef = _useStoreRef.deviceRef,
|
|
87
|
+
payRef = _useStoreRef.payRef,
|
|
88
|
+
numRef = _useStoreRef.numRef,
|
|
89
|
+
orderIdRef = _useStoreRef.orderIdRef,
|
|
90
|
+
modeRef = _useStoreRef.modeRef,
|
|
91
|
+
amountRef = _useStoreRef.amountRef,
|
|
92
|
+
eftposRef = _useStoreRef.eftposRef;
|
|
93
|
+
var onConfirm = function onConfirm() {
|
|
94
|
+
onChangeStatus('success', _objectSpread({}, ref.current || {}));
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @title: 手动标记
|
|
99
|
+
* @description: 前往手动标记
|
|
100
|
+
* @Author: hongbing.wang
|
|
101
|
+
* @Date: 2024-08-20 11:31
|
|
102
|
+
*/
|
|
103
|
+
useEffect(function () {
|
|
104
|
+
// 将所有步骤状态设为完成 resolve
|
|
105
|
+
if (eftposRef.current === EftposEnum.Payo) {
|
|
106
|
+
dispatch(updateNextStep());
|
|
107
|
+
dispatch(updateCustom({
|
|
108
|
+
card_reader_surcharge: cardSurcharge || 0,
|
|
109
|
+
receipt: receipts
|
|
110
|
+
}));
|
|
111
|
+
} else if (eftposRef.current === EftposEnum.Windcave) {
|
|
112
|
+
dispatch(updateCustom({
|
|
113
|
+
list: listRef.current.map(function (item) {
|
|
114
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
115
|
+
status: 'resolve'
|
|
116
|
+
});
|
|
117
|
+
}),
|
|
118
|
+
card_reader_surcharge: cardSurcharge || 0,
|
|
119
|
+
receipt: receipts
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
var params = getPayParams({
|
|
123
|
+
mode: modeRef.current,
|
|
124
|
+
amount: amountRef.current,
|
|
125
|
+
order_id: orderIdRef.current,
|
|
126
|
+
number: numRef.current,
|
|
127
|
+
device: deviceRef.current,
|
|
128
|
+
pay: payRef.current,
|
|
129
|
+
custom: {
|
|
130
|
+
card_reader_surcharge: cardSurcharge,
|
|
131
|
+
receipt: receipts
|
|
132
|
+
}
|
|
133
|
+
}, 'success');
|
|
134
|
+
ref.current = params;
|
|
135
|
+
setAmount("".concat((params === null || params === void 0 ? void 0 : params.amount) || ''));
|
|
136
|
+
setSurcharge("".concat((params === null || params === void 0 ? void 0 : params.surcharge) || ''));
|
|
137
|
+
setSurMoney("".concat((params === null || params === void 0 ? void 0 : params.surMoney) || ''));
|
|
138
|
+
setRate("".concat((params === null || params === void 0 ? void 0 : params.surRate) || ''));
|
|
139
|
+
setTotal("".concat((params === null || params === void 0 ? void 0 : params.total) || ''));
|
|
140
|
+
setTime(formatDateUtils(successTime));
|
|
141
|
+
setDisabled(false);
|
|
142
|
+
|
|
143
|
+
// 更新支付状态与文案
|
|
144
|
+
dispatch(updateState({
|
|
145
|
+
status: 'success',
|
|
146
|
+
title: locales.getText('page.eftpos-pay.text.successful')(modeRef.current)
|
|
147
|
+
}));
|
|
148
|
+
}, []);
|
|
149
|
+
useEffect(function () {
|
|
150
|
+
onChangeParams && onChangeParams(_objectSpread(_objectSpread({}, data), {}, {
|
|
151
|
+
form: RestoreEumn.Restore
|
|
152
|
+
}));
|
|
153
|
+
}, [data, onChangeParams]);
|
|
154
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
155
|
+
className: "pisell-lowcode__eft-pay-box ".concat(className)
|
|
156
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
className: "pisell-lowcode__eft-pay-fail-title"
|
|
158
|
+
}, locales.getText('page.eftpos-pay.text.latest.success')), /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
className: "pisell-lowcode__eft-pay-body pisell-lowcode__eft-pay-tip-body"
|
|
160
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
className: "pisell-lowcode__eft-pay-tip-text"
|
|
162
|
+
}, locales.getText('page.eftpos-pay.text.latest.amount'), ":", ' ', formatAmount("".concat(amount), 2, symbol)), /*#__PURE__*/React.createElement("div", {
|
|
163
|
+
className: "pisell-lowcode__eft-pay-tip-text"
|
|
164
|
+
}, locales.getText('page.eftpos-pay.text.latest.surcharge'), ":", ' ', formatAmount("".concat(surcharge), 2, symbol), " (", rate, "% +", ' ', formatAmount("".concat(surMoney), 2, symbol), ")"), /*#__PURE__*/React.createElement("div", {
|
|
165
|
+
className: "pisell-lowcode__eft-pay-tip-text"
|
|
166
|
+
}, locales.getText('page.eftpos-pay.text.surcharge.edit.actual.pay'), ":", ' ', formatAmount("".concat(total), 2, symbol)), /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
className: "pisell-lowcode__eft-pay-tip-text"
|
|
168
|
+
}, locales.getText('page.eftpos-pay.text.latest.time'), ": ", time)), /*#__PURE__*/React.createElement("div", {
|
|
169
|
+
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
170
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
171
|
+
disabled: disabled,
|
|
172
|
+
block: true,
|
|
173
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
174
|
+
type: "primary",
|
|
175
|
+
onClick: onConfirm
|
|
176
|
+
}, locales.getText('page.eftpos-pay.text.latest.confirm'))));
|
|
177
|
+
});
|
|
@@ -21,7 +21,7 @@ import { Button } from 'antd';
|
|
|
21
21
|
import { useDispatch, useContextData, updateState, updateCustom, updateComponent } from "../store";
|
|
22
22
|
import { ModeEnum, ClientEnum } from "../const";
|
|
23
23
|
import { Decimal } from 'decimal.js';
|
|
24
|
-
import { getUuid, getPayParams } from "../helper";
|
|
24
|
+
import { getUuid, getPayParams, getBrowserVersion } from "../helper";
|
|
25
25
|
import Step from "../component/step/step";
|
|
26
26
|
import { useStoreRef } from "../hooks";
|
|
27
27
|
var Minute = 1000 * 60;
|
|
@@ -68,6 +68,22 @@ export default (function (_ref) {
|
|
|
68
68
|
var requestIdRef = useRef((custom === null || custom === void 0 ? void 0 : custom.requestId) || '');
|
|
69
69
|
var unloadRef = useRef(false);
|
|
70
70
|
var clearRef = useRef();
|
|
71
|
+
var isPrint = function isPrint(key) {
|
|
72
|
+
var _deviceRef$current, _deviceRef$current$se, _deviceRef$current2, _deviceRef$current2$s;
|
|
73
|
+
if ((_deviceRef$current = deviceRef.current) !== null && _deviceRef$current !== void 0 && (_deviceRef$current$se = _deviceRef$current.setting) !== null && _deviceRef$current$se !== void 0 && _deviceRef$current$se.receipts) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
var receiptList = (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : (_deviceRef$current2$s = _deviceRef$current2.setting) === null || _deviceRef$current2$s === void 0 ? void 0 : _deviceRef$current2$s.receiptList;
|
|
77
|
+
if (!Array.isArray(receiptList)) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
if (Array.isArray(receiptList) && receiptList.some(function (item) {
|
|
81
|
+
return item === key;
|
|
82
|
+
})) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
};
|
|
71
87
|
useEffect(function () {
|
|
72
88
|
listRef.current = (custom === null || custom === void 0 ? void 0 : custom.list) || [];
|
|
73
89
|
}, [custom === null || custom === void 0 ? void 0 : custom.list]);
|
|
@@ -117,7 +133,7 @@ export default (function (_ref) {
|
|
|
117
133
|
* @Date: 2024-08-19 11:32
|
|
118
134
|
*/
|
|
119
135
|
var refundOrder = function refundOrder() {
|
|
120
|
-
var _deviceRef$
|
|
136
|
+
var _deviceRef$current3, _deviceRef$current3$s, _deviceRef$current4;
|
|
121
137
|
var iClient = iClientRef.current;
|
|
122
138
|
if (!iClient) {
|
|
123
139
|
return;
|
|
@@ -135,12 +151,16 @@ export default (function (_ref) {
|
|
|
135
151
|
}));
|
|
136
152
|
requestParams.current = {
|
|
137
153
|
amount: new Decimal(amountRef.current || 0).mul(100).toFixed(0, Decimal.ROUND_HALF_UP),
|
|
138
|
-
// 打印小票 true
|
|
139
|
-
integratedReceipt: !((_deviceRef$
|
|
154
|
+
// 打印小票 true 打印到Pisell系统上 false 打印到pos机上
|
|
155
|
+
integratedReceipt: !((_deviceRef$current3 = deviceRef.current) !== null && _deviceRef$current3 !== void 0 && (_deviceRef$current3$s = _deviceRef$current3.setting) !== null && _deviceRef$current3$s !== void 0 && _deviceRef$current3$s.receipts),
|
|
140
156
|
integrationKey: integrationKey,
|
|
141
157
|
transactionId: numRef.current,
|
|
142
158
|
mid: mid,
|
|
143
|
-
tid: tid
|
|
159
|
+
tid: tid,
|
|
160
|
+
device: JSON.stringify(deviceRef.current),
|
|
161
|
+
isPrintMerchant: isPrint('merchant'),
|
|
162
|
+
isPrintCustomer: isPrint('customer'),
|
|
163
|
+
browserVersion: getBrowserVersion()
|
|
144
164
|
};
|
|
145
165
|
dispatch(updateCustom({
|
|
146
166
|
requestParams: requestParams.current
|
|
@@ -151,7 +171,7 @@ export default (function (_ref) {
|
|
|
151
171
|
api.addTransaction({
|
|
152
172
|
order_id: orderIdRef.current,
|
|
153
173
|
number: numRef.current,
|
|
154
|
-
card_reader_id: (_deviceRef$
|
|
174
|
+
card_reader_id: (_deviceRef$current4 = deviceRef.current) === null || _deviceRef$current4 === void 0 ? void 0 : _deviceRef$current4.id,
|
|
155
175
|
card_reader_type: eftpos,
|
|
156
176
|
amount: requestParams.current.amount,
|
|
157
177
|
action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
|
|
@@ -183,7 +203,7 @@ export default (function (_ref) {
|
|
|
183
203
|
* @Date: 2024-08-19 11:33
|
|
184
204
|
*/
|
|
185
205
|
var payOrder = function payOrder() {
|
|
186
|
-
var _deviceRef$
|
|
206
|
+
var _deviceRef$current5, _deviceRef$current5$s, _payRef$current, _deviceRef$current6, _deviceRef$current6$s, _deviceRef$current7, _deviceRef$current7$s, _deviceRef$current8;
|
|
187
207
|
var iClient = iClientRef.current;
|
|
188
208
|
if (!iClient) {
|
|
189
209
|
return;
|
|
@@ -199,18 +219,22 @@ export default (function (_ref) {
|
|
|
199
219
|
dispatch(updateState({
|
|
200
220
|
number: numRef.current
|
|
201
221
|
}));
|
|
202
|
-
console.log('deviceRef.current?.settings?.useOriginSurcharge = ', (_deviceRef$
|
|
222
|
+
console.log('deviceRef.current?.settings?.useOriginSurcharge = ', (_deviceRef$current5 = deviceRef.current) === null || _deviceRef$current5 === void 0 ? void 0 : (_deviceRef$current5$s = _deviceRef$current5.setting) === null || _deviceRef$current5$s === void 0 ? void 0 : _deviceRef$current5$s.useOriginSurcharge);
|
|
203
223
|
// (deviceRef.current?.setting as { receipts?: boolean })
|
|
204
224
|
requestParams.current = {
|
|
205
225
|
amount: new Decimal((_payRef$current = payRef.current) === null || _payRef$current === void 0 ? void 0 : _payRef$current.total).mul(100).toFixed(0, Decimal.ROUND_HALF_UP),
|
|
206
226
|
// 手续费 true tyro 手续费, false 系统手续费
|
|
207
|
-
enableSurcharge: ((_deviceRef$
|
|
227
|
+
enableSurcharge: ((_deviceRef$current6 = deviceRef.current) === null || _deviceRef$current6 === void 0 ? void 0 : (_deviceRef$current6$s = _deviceRef$current6.setting) === null || _deviceRef$current6$s === void 0 ? void 0 : _deviceRef$current6$s.useOriginSurcharge) || false,
|
|
208
228
|
// 打印小票 true 打印到系统上 false 打印到pos机上
|
|
209
|
-
integratedReceipt: !((_deviceRef$
|
|
229
|
+
integratedReceipt: !((_deviceRef$current7 = deviceRef.current) !== null && _deviceRef$current7 !== void 0 && (_deviceRef$current7$s = _deviceRef$current7.setting) !== null && _deviceRef$current7$s !== void 0 && _deviceRef$current7$s.receipts),
|
|
210
230
|
integrationKey: integrationKey,
|
|
211
231
|
transactionId: numRef.current,
|
|
212
232
|
mid: mid,
|
|
213
|
-
tid: tid
|
|
233
|
+
tid: tid,
|
|
234
|
+
device: JSON.stringify(deviceRef.current),
|
|
235
|
+
isPrintMerchant: isPrint('merchant'),
|
|
236
|
+
isPrintCustomer: isPrint('customer'),
|
|
237
|
+
browserVersion: getBrowserVersion()
|
|
214
238
|
};
|
|
215
239
|
dispatch(updateCustom({
|
|
216
240
|
requestParams: requestParams.current
|
|
@@ -221,7 +245,7 @@ export default (function (_ref) {
|
|
|
221
245
|
api.addTransaction({
|
|
222
246
|
order_id: orderIdRef.current,
|
|
223
247
|
number: numRef.current,
|
|
224
|
-
card_reader_id: (_deviceRef$
|
|
248
|
+
card_reader_id: (_deviceRef$current8 = deviceRef.current) === null || _deviceRef$current8 === void 0 ? void 0 : _deviceRef$current8.id,
|
|
225
249
|
card_reader_type: eftpos,
|
|
226
250
|
amount: requestParams.current.amount,
|
|
227
251
|
action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
|
|
@@ -284,11 +308,17 @@ export default (function (_ref) {
|
|
|
284
308
|
var receipt = [merchantReceipt].filter(function (item) {
|
|
285
309
|
return typeof item === 'string';
|
|
286
310
|
}).filter(Boolean);
|
|
287
|
-
onChange('print', receipt);
|
|
288
311
|
merchantReceiptRef.current = {
|
|
289
312
|
signatureRequired: signatureRequired,
|
|
290
313
|
merchantReceipt: merchantReceipt
|
|
291
314
|
};
|
|
315
|
+
if (signatureRequired) {
|
|
316
|
+
onChange('print', receipt);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
if (isPrint('merchant')) {
|
|
320
|
+
onChange('print', receipt);
|
|
321
|
+
}
|
|
292
322
|
};
|
|
293
323
|
|
|
294
324
|
/**
|
|
@@ -373,7 +403,7 @@ export default (function (_ref) {
|
|
|
373
403
|
* @Date: 2024-08-19 11:35
|
|
374
404
|
*/
|
|
375
405
|
var transactionCompleteCallbackImpl = function transactionCompleteCallbackImpl(response) {
|
|
376
|
-
var _deviceRef$
|
|
406
|
+
var _deviceRef$current9;
|
|
377
407
|
setStatus(-1);
|
|
378
408
|
setManually(false);
|
|
379
409
|
console.log('Response = ' + JSON.stringify(response), ', Request = ', JSON.stringify(requestParams.current));
|
|
@@ -385,7 +415,7 @@ export default (function (_ref) {
|
|
|
385
415
|
api.editTransaction(requestIdRef.current, {
|
|
386
416
|
order_id: orderIdRef.current,
|
|
387
417
|
number: numRef.current,
|
|
388
|
-
card_reader_id: (_deviceRef$
|
|
418
|
+
card_reader_id: (_deviceRef$current9 = deviceRef.current) === null || _deviceRef$current9 === void 0 ? void 0 : _deviceRef$current9.id,
|
|
389
419
|
card_reader_type: eftpos,
|
|
390
420
|
amount: requestParams.current.amount,
|
|
391
421
|
action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
|
|
@@ -410,10 +440,10 @@ export default (function (_ref) {
|
|
|
410
440
|
subTitle: ''
|
|
411
441
|
}));
|
|
412
442
|
dispatch(updateCustom({
|
|
413
|
-
card_reader_surcharge: response.surchargeAmount || 0
|
|
443
|
+
card_reader_surcharge: response.surchargeAmount || 0,
|
|
444
|
+
receipt: receipt
|
|
414
445
|
}));
|
|
415
446
|
clearRef.current = setTimeout(function () {
|
|
416
|
-
var _deviceRef$current8;
|
|
417
447
|
var params = getPayParams({
|
|
418
448
|
mode: modeRef.current,
|
|
419
449
|
amount: amountRef.current,
|
|
@@ -422,19 +452,22 @@ export default (function (_ref) {
|
|
|
422
452
|
device: deviceRef.current,
|
|
423
453
|
pay: payRef.current,
|
|
424
454
|
custom: {
|
|
425
|
-
card_reader_surcharge: response.surchargeAmount || 0
|
|
455
|
+
card_reader_surcharge: response.surchargeAmount || 0,
|
|
456
|
+
receipt: receipt
|
|
426
457
|
}
|
|
427
458
|
}, 'success');
|
|
428
459
|
onChange('success', _objectSpread(_objectSpread({}, params), {}, {
|
|
429
|
-
receipt: (
|
|
460
|
+
receipt: isPrint('customer') ? receipt : []
|
|
430
461
|
}));
|
|
431
462
|
}, 1000);
|
|
432
463
|
return;
|
|
433
464
|
} else {
|
|
434
|
-
var _deviceRef$
|
|
435
|
-
var current = (_deviceRef$
|
|
465
|
+
var _deviceRef$current10;
|
|
466
|
+
var current = (_deviceRef$current10 = deviceRef.current) !== null && _deviceRef$current10 !== void 0 && _deviceRef$current10.setting.receipts ? [] : receipt;
|
|
436
467
|
if (current.length > 0) {
|
|
437
|
-
|
|
468
|
+
if (isPrint('customer')) {
|
|
469
|
+
onChange('print', receipt);
|
|
470
|
+
}
|
|
438
471
|
}
|
|
439
472
|
}
|
|
440
473
|
if (response.result === 'UNKNOWN') {
|
|
@@ -9,7 +9,7 @@ import XhrTimer from './timer';
|
|
|
9
9
|
* @Date: 2024-08-12 10:29
|
|
10
10
|
*/
|
|
11
11
|
export declare const useFail: () => (res: {
|
|
12
|
-
code?:
|
|
12
|
+
code?: "200" | "4004" | "701000" | "701001" | "701003" | "701004" | "701005" | "701006" | "701007" | "701008" | "701009" | "701010" | undefined;
|
|
13
13
|
}, isMark?: boolean) => void;
|
|
14
14
|
/**
|
|
15
15
|
* @title: 轮询 check 接口
|
|
@@ -51,7 +51,7 @@ export default (function (_ref) {
|
|
|
51
51
|
symbolRef = _useStoreRef.symbolRef,
|
|
52
52
|
amountRef = _useStoreRef.amountRef,
|
|
53
53
|
eftposRef = _useStoreRef.eftposRef,
|
|
54
|
-
|
|
54
|
+
dataRef = _useStoreRef.dataRef;
|
|
55
55
|
var dispatch = useDispatch();
|
|
56
56
|
var fail = useFail();
|
|
57
57
|
var failRef = useRef(fail);
|
|
@@ -92,6 +92,10 @@ export default (function (_ref) {
|
|
|
92
92
|
* @Date: 2024-08-12 11:02
|
|
93
93
|
*/
|
|
94
94
|
var _useValidate = useValidate(api.check, Minute, function (res) {
|
|
95
|
+
var receipt = Array.isArray(res === null || res === void 0 ? void 0 : res.receipt) ? res.receipt : [res.receipt];
|
|
96
|
+
receipt = receipt.filter(function (item) {
|
|
97
|
+
return typeof item === 'string';
|
|
98
|
+
}).filter(Boolean);
|
|
95
99
|
// 将所有步骤状态设为完成 resolve
|
|
96
100
|
dispatch(updateCustom({
|
|
97
101
|
list: listRef.current.map(function (item) {
|
|
@@ -99,7 +103,8 @@ export default (function (_ref) {
|
|
|
99
103
|
status: 'resolve'
|
|
100
104
|
});
|
|
101
105
|
}),
|
|
102
|
-
card_reader_surcharge: (res === null || res === void 0 ? void 0 : res.card_reader_surcharge) || 0
|
|
106
|
+
card_reader_surcharge: (res === null || res === void 0 ? void 0 : res.card_reader_surcharge) || 0,
|
|
107
|
+
receipt: receipt
|
|
103
108
|
}));
|
|
104
109
|
|
|
105
110
|
// 更新支付状态与文案
|
|
@@ -117,10 +122,10 @@ export default (function (_ref) {
|
|
|
117
122
|
device: deviceRef.current,
|
|
118
123
|
pay: payRef.current,
|
|
119
124
|
custom: {
|
|
120
|
-
card_reader_surcharge: (res === null || res === void 0 ? void 0 : res.card_reader_surcharge) || 0
|
|
125
|
+
card_reader_surcharge: (res === null || res === void 0 ? void 0 : res.card_reader_surcharge) || 0,
|
|
126
|
+
receipt: receipt
|
|
121
127
|
}
|
|
122
128
|
}, 'success');
|
|
123
|
-
var receipt = Array.isArray(res.receipt) ? res.receipt : [res.receipt];
|
|
124
129
|
onChange('success', _objectSpread(_objectSpread({}, params), {}, {
|
|
125
130
|
receipt: (_deviceRef$current = deviceRef.current) !== null && _deviceRef$current !== void 0 && (_deviceRef$current$se = _deviceRef$current.setting) !== null && _deviceRef$current$se !== void 0 && _deviceRef$current$se.receipts ? [] : receipt
|
|
126
131
|
}));
|
|
@@ -170,7 +175,10 @@ export default (function (_ref) {
|
|
|
170
175
|
amount: payRef.current.total,
|
|
171
176
|
card_reader_type: eftposRef.current,
|
|
172
177
|
card_reader_id: (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.id,
|
|
173
|
-
number: numRef.current
|
|
178
|
+
number: numRef.current,
|
|
179
|
+
pay_param_base64: encodeURIComponent(btoa(encodeURIComponent(JSON.stringify(_objectSpread(_objectSpread({}, dataRef.current), {}, {
|
|
180
|
+
number: numRef.current
|
|
181
|
+
})))))
|
|
174
182
|
}, {
|
|
175
183
|
signal: controllerRef.current.signal
|
|
176
184
|
}) : api.refund({
|
|
@@ -178,7 +186,10 @@ export default (function (_ref) {
|
|
|
178
186
|
amount: amountRef.current,
|
|
179
187
|
card_reader_type: eftposRef.current,
|
|
180
188
|
card_reader_id: (_deviceRef$current3 = deviceRef.current) === null || _deviceRef$current3 === void 0 ? void 0 : _deviceRef$current3.id,
|
|
181
|
-
number: numRef.current
|
|
189
|
+
number: numRef.current,
|
|
190
|
+
pay_param_base64: encodeURIComponent(btoa(encodeURIComponent(JSON.stringify(_objectSpread(_objectSpread({}, dataRef.current), {}, {
|
|
191
|
+
number: numRef.current
|
|
192
|
+
})))))
|
|
182
193
|
}, {
|
|
183
194
|
signal: controllerRef.current.signal
|
|
184
195
|
});
|
|
@@ -69,7 +69,7 @@ export interface FormState {
|
|
|
69
69
|
};
|
|
70
70
|
setGlobalState: Function | null;
|
|
71
71
|
}
|
|
72
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
73
73
|
state: FormState;
|
|
74
74
|
} & {
|
|
75
75
|
dispatch: (params: {
|
package/es/index.d.ts
CHANGED
|
@@ -22,4 +22,3 @@ export { default as Eftpos } from './components/eftpos';
|
|
|
22
22
|
export { default as EftposPay } from './components/eftposPay';
|
|
23
23
|
export { default as BookingDashboard } from './components/booking/dashboard';
|
|
24
24
|
export { default as PisellSelectCustomerModal } from './components/pisellSelectCustomerModal';
|
|
25
|
-
export { default as ShoppingCart } from './components/shoppingCart';
|
package/es/index.js
CHANGED
|
@@ -25,5 +25,4 @@ export { default as ToCPay } from "./components/pay/toC";
|
|
|
25
25
|
export { default as Eftpos } from "./components/eftpos";
|
|
26
26
|
export { default as EftposPay } from "./components/eftposPay";
|
|
27
27
|
export { default as BookingDashboard } from "./components/booking/dashboard";
|
|
28
|
-
export { default as PisellSelectCustomerModal } from "./components/pisellSelectCustomerModal";
|
|
29
|
-
export { default as ShoppingCart } from "./components/shoppingCart";
|
|
28
|
+
export { default as PisellSelectCustomerModal } from "./components/pisellSelectCustomerModal";
|
|
@@ -32,7 +32,6 @@ interface CustomSelectProps {
|
|
|
32
32
|
autoFocus?: boolean;
|
|
33
33
|
showDropDown?: boolean;
|
|
34
34
|
handleOpenModal?: () => void;
|
|
35
|
-
handleDayChange?: (value: any) => void;
|
|
36
35
|
}
|
|
37
36
|
declare const _default: React.ForwardRefExoticComponent<CustomSelectProps & React.RefAttributes<unknown>>;
|
|
38
37
|
export default _default;
|
|
@@ -75,8 +75,7 @@ var CustomSelect = (props, ref) => {
|
|
|
75
75
|
closeCallback,
|
|
76
76
|
autoFocus,
|
|
77
77
|
showDropDown = true,
|
|
78
|
-
handleOpenModal: propsHandleOpenModal
|
|
79
|
-
handleDayChange
|
|
78
|
+
handleOpenModal: propsHandleOpenModal
|
|
80
79
|
} = props;
|
|
81
80
|
const searchRef = (0, import_react.useRef)();
|
|
82
81
|
const [_value, set_value] = (0, import_react.useState)([]);
|
|
@@ -112,7 +111,7 @@ var CustomSelect = (props, ref) => {
|
|
|
112
111
|
}
|
|
113
112
|
closeCallback == null ? void 0 : closeCallback();
|
|
114
113
|
};
|
|
115
|
-
const handleOpenModal = (
|
|
114
|
+
const handleOpenModal = () => {
|
|
116
115
|
if (disabled) {
|
|
117
116
|
return;
|
|
118
117
|
}
|
|
@@ -146,9 +145,6 @@ var CustomSelect = (props, ref) => {
|
|
|
146
145
|
handleViewItem == null ? void 0 : handleViewItem(item);
|
|
147
146
|
};
|
|
148
147
|
const handleRemoveItem = (item) => {
|
|
149
|
-
if (handleDayChange) {
|
|
150
|
-
handleDayChange(item);
|
|
151
|
-
}
|
|
152
148
|
let _arr = (0, import_utils.changeArray)(_value, item, rowKey);
|
|
153
149
|
_onValueChange(_arr);
|
|
154
150
|
set_value(_arr);
|
|
@@ -25,7 +25,6 @@ __export(amount_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(amount_exports);
|
|
26
26
|
var import_utils = require("../../utils");
|
|
27
27
|
var import_utils2 = require("@pisell/utils");
|
|
28
|
-
var import_utils3 = require("../../info/service2/utils");
|
|
29
28
|
var getRelationDetailsTotal = (relation_details) => {
|
|
30
29
|
let total = 0;
|
|
31
30
|
for (let item of relation_details) {
|
|
@@ -39,45 +38,27 @@ var getProductAmount = (state, isEdit) => {
|
|
|
39
38
|
var _a, _b;
|
|
40
39
|
let price = 0;
|
|
41
40
|
let duration = 0;
|
|
42
|
-
const isDay = (0, import_utils3.isDayBooking)(state);
|
|
43
41
|
if (isEdit) {
|
|
44
42
|
if ((state == null ? void 0 : state.service) || (state == null ? void 0 : state.addons)) {
|
|
45
43
|
for (let item of state == null ? void 0 : state.service.value) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const _duration = (0, import_utils3.isDayBookingProduct)(item, state) ? item._extend.duration : 0;
|
|
50
|
-
duration += _duration;
|
|
51
|
-
} else {
|
|
52
|
-
price += Number(item._extend.total);
|
|
53
|
-
price += getRelationDetailsTotal(item._extend.relation_details || []);
|
|
54
|
-
duration += import_utils.flexibleObj.getValue(item._extend.duration);
|
|
55
|
-
}
|
|
44
|
+
price += Number(item._extend.total);
|
|
45
|
+
price += getRelationDetailsTotal(item._extend.relation_details || []);
|
|
46
|
+
duration += import_utils.flexibleObj.getValue(item._extend.duration);
|
|
56
47
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
price += Number(item._extend.total) * item._extend.quantity;
|
|
60
|
-
}
|
|
48
|
+
for (let item of state.addons.value) {
|
|
49
|
+
price += Number(item._extend.total) * item._extend.quantity;
|
|
61
50
|
}
|
|
62
51
|
}
|
|
63
52
|
} else {
|
|
64
53
|
price = Number((_a = state.bookingDetail) == null ? void 0 : _a.product_expect_amount);
|
|
65
|
-
|
|
66
|
-
duration = services.reduce((pre, cur) => {
|
|
54
|
+
duration = (((_b = state == null ? void 0 : state.service) == null ? void 0 : _b.value) || []).reduce((pre, cur) => {
|
|
67
55
|
var _a2;
|
|
68
|
-
|
|
69
|
-
if (isDay) {
|
|
70
|
-
const _duration = (0, import_utils3.isDayBookingProduct)(cur, state) ? cur._extend.duration : 0;
|
|
71
|
-
current = _duration || 0;
|
|
72
|
-
} else {
|
|
73
|
-
current = import_utils.flexibleObj.getValue(((_a2 = cur._extend) == null ? void 0 : _a2.duration) || 0);
|
|
74
|
-
}
|
|
75
|
-
return pre + current;
|
|
56
|
+
return pre + import_utils.flexibleObj.getValue(((_a2 = cur._extend) == null ? void 0 : _a2.duration) || 0);
|
|
76
57
|
}, 0);
|
|
77
58
|
}
|
|
78
59
|
return {
|
|
79
60
|
price: Number(price),
|
|
80
|
-
duration: (0, import_utils.getDiscountTime)(duration
|
|
61
|
+
duration: (0, import_utils.getDiscountTime)(duration)
|
|
81
62
|
};
|
|
82
63
|
};
|
|
83
64
|
var getProductItemTax = (item, bookingDetail) => {
|