@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,173 @@
|
|
|
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
|
+
var _excluded = ["action", "api", "device_number", "terminal", "tyroUrl", "tyroVersion", "onChangeParams", "isMobile", "channel", "formatAmount"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
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."); }
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
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; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
+
/* eslint-disable react/destructuring-assignment */
|
|
17
|
+
import React, { useEffect, useState, useMemo, useRef, useCallback } from 'react';
|
|
18
|
+
import { useNetwork } from 'ahooks';
|
|
19
|
+
import Amount from "./amount";
|
|
20
|
+
import { RouteEnum, ClientEnum, RestoreEumn } from "./const";
|
|
21
|
+
import Device from "./device";
|
|
22
|
+
import Pay from "./pay";
|
|
23
|
+
import { useContextData, useDispatch, updateState, updateClient } from "./store";
|
|
24
|
+
var App = function App(_ref) {
|
|
25
|
+
var action = _ref.action,
|
|
26
|
+
api = _ref.api,
|
|
27
|
+
device_number = _ref.device_number,
|
|
28
|
+
terminal = _ref.terminal,
|
|
29
|
+
tyroUrl = _ref.tyroUrl,
|
|
30
|
+
tyroVersion = _ref.tyroVersion,
|
|
31
|
+
onChangeParams = _ref.onChangeParams,
|
|
32
|
+
isMobile = _ref.isMobile,
|
|
33
|
+
channel = _ref.channel,
|
|
34
|
+
_ref$formatAmount = _ref.formatAmount,
|
|
35
|
+
formatAmount = _ref$formatAmount === void 0 ? function (number, precision, symbol) {
|
|
36
|
+
return "".concat(symbol).concat(number);
|
|
37
|
+
} : _ref$formatAmount,
|
|
38
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
39
|
+
var data = useContextData();
|
|
40
|
+
var dispatch = useDispatch();
|
|
41
|
+
var _useState = useState(action),
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
current = _useState2[0],
|
|
44
|
+
setCurrent = _useState2[1];
|
|
45
|
+
var statusRef = useRef(data.status);
|
|
46
|
+
|
|
47
|
+
// 外部网络数据
|
|
48
|
+
var network = useMemo(function () {
|
|
49
|
+
return typeof terminal.network === 'boolean' ? terminal.network : true;
|
|
50
|
+
}, [terminal === null || terminal === void 0 ? void 0 : terminal.network]);
|
|
51
|
+
// 内部网络数据
|
|
52
|
+
var _useNetwork = useNetwork(),
|
|
53
|
+
online = _useNetwork.online;
|
|
54
|
+
var netRef = useRef([network, online]);
|
|
55
|
+
|
|
56
|
+
// 网络数据
|
|
57
|
+
var net = useMemo(function () {
|
|
58
|
+
var networkChange = false,
|
|
59
|
+
onlineChange = false;
|
|
60
|
+
if (netRef.current[0] !== network) {
|
|
61
|
+
netRef.current[0] = network;
|
|
62
|
+
networkChange = true;
|
|
63
|
+
}
|
|
64
|
+
if (netRef.current[1] !== online) {
|
|
65
|
+
netRef.current[1] = online;
|
|
66
|
+
onlineChange = true;
|
|
67
|
+
}
|
|
68
|
+
if (networkChange) {
|
|
69
|
+
return network;
|
|
70
|
+
}
|
|
71
|
+
return online;
|
|
72
|
+
}, [network, online]);
|
|
73
|
+
useEffect(function () {
|
|
74
|
+
statusRef.current = data.status;
|
|
75
|
+
}, [data.status]);
|
|
76
|
+
var client = useMemo(function () {
|
|
77
|
+
if (channel === 'kiosk') {
|
|
78
|
+
return ClientEnum.User;
|
|
79
|
+
}
|
|
80
|
+
return ClientEnum.Merchant;
|
|
81
|
+
}, [channel]);
|
|
82
|
+
useEffect(function () {
|
|
83
|
+
dispatch(updateClient(client));
|
|
84
|
+
}, [client]);
|
|
85
|
+
|
|
86
|
+
// 内嵌在 terminal 或者 kiosk 的移动端 做特定移动端(大屏)适配
|
|
87
|
+
// const isMobile = useMemo(() => Boolean(channel), [channel]);
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @title: 缓存状态数据 可以用于闪退,成功or失败时清除缓存
|
|
91
|
+
* @Author: hongbing.wang
|
|
92
|
+
* @Date: 2024-08-20 10:27
|
|
93
|
+
*/
|
|
94
|
+
useEffect(function () {
|
|
95
|
+
onChangeParams && onChangeParams(_objectSpread(_objectSpread(_objectSpread({}, data), data.eftpos === 'tyro' ? {
|
|
96
|
+
custom: _objectSpread(_objectSpread({}, data.custom), {}, {
|
|
97
|
+
btnList: [],
|
|
98
|
+
list: []
|
|
99
|
+
})
|
|
100
|
+
} : {}), {}, {
|
|
101
|
+
form: RestoreEumn.Restore
|
|
102
|
+
}));
|
|
103
|
+
}, [data, onChangeParams]);
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @title: 支付状态切换页
|
|
107
|
+
* @Author: hongbing.wang
|
|
108
|
+
* @Date: 2024-08-20 13:10
|
|
109
|
+
*/
|
|
110
|
+
var onChange = useCallback(function (status, params, other) {
|
|
111
|
+
if (status === 'page' && typeof params === 'string') {
|
|
112
|
+
if (['amount', 'deviceList', 'pay'].includes(params)) {
|
|
113
|
+
setCurrent(params);
|
|
114
|
+
dispatch(updateState({
|
|
115
|
+
action: params
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
console.log('状态切换 = ', status, params, other);
|
|
120
|
+
props.onChangeStatus(status, params, other);
|
|
121
|
+
}, []);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @title: 支付失败
|
|
125
|
+
* @Author: hongbing.wang
|
|
126
|
+
* @Date: 2024-08-20 13:09
|
|
127
|
+
*/
|
|
128
|
+
var onClose = function onClose() {
|
|
129
|
+
onChange('fail', {
|
|
130
|
+
number: data.number,
|
|
131
|
+
uniquePaymentNumber: data.number,
|
|
132
|
+
device: data.device,
|
|
133
|
+
order_id: data.order_id
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
if (current === RouteEnum.DeviceList) {
|
|
137
|
+
return /*#__PURE__*/React.createElement(Device, {
|
|
138
|
+
api: api,
|
|
139
|
+
onChange: onChange,
|
|
140
|
+
onClose: onClose,
|
|
141
|
+
isMobile: isMobile,
|
|
142
|
+
className: isMobile ? 'pisell-lowcode__eft-pay-terminal' : '',
|
|
143
|
+
net: net,
|
|
144
|
+
device_number: device_number,
|
|
145
|
+
formatAmount: formatAmount,
|
|
146
|
+
client: client
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (current === RouteEnum.Amount) {
|
|
150
|
+
return /*#__PURE__*/React.createElement(Amount, {
|
|
151
|
+
onChange: onChange,
|
|
152
|
+
onClose: onClose,
|
|
153
|
+
formatAmount: formatAmount,
|
|
154
|
+
isMobile: isMobile,
|
|
155
|
+
className: isMobile ? 'pisell-lowcode__eft-pay-terminal' : '',
|
|
156
|
+
net: net,
|
|
157
|
+
client: client
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return /*#__PURE__*/React.createElement(Pay, {
|
|
161
|
+
api: api,
|
|
162
|
+
tyroUrl: tyroUrl,
|
|
163
|
+
tyroVersion: tyroVersion,
|
|
164
|
+
onChange: onChange,
|
|
165
|
+
className: isMobile ? 'pisell-lowcode__eft-pay-terminal' : '',
|
|
166
|
+
terminal: terminal,
|
|
167
|
+
isMobile: isMobile,
|
|
168
|
+
net: net,
|
|
169
|
+
formatAmount: formatAmount,
|
|
170
|
+
client: client
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
export default App;
|
|
@@ -89,6 +89,7 @@ export default (function (_ref) {
|
|
|
89
89
|
amount: amount,
|
|
90
90
|
total: amount,
|
|
91
91
|
number: number,
|
|
92
|
+
uniquePaymentNumber: number,
|
|
92
93
|
device: device,
|
|
93
94
|
order_id: order_id
|
|
94
95
|
});
|
|
@@ -114,6 +115,7 @@ export default (function (_ref) {
|
|
|
114
115
|
setDisabled(true);
|
|
115
116
|
onChange('fail', {
|
|
116
117
|
number: number,
|
|
118
|
+
uniquePaymentNumber: number,
|
|
117
119
|
device: device,
|
|
118
120
|
order_id: order_id
|
|
119
121
|
});
|
|
@@ -151,6 +153,7 @@ export default (function (_ref) {
|
|
|
151
153
|
total: moneyDeci.toFixed(2, Decimal.ROUND_HALF_UP),
|
|
152
154
|
totalUnit: formatAmount(moneyDeci.toFixed(2, Decimal.ROUND_HALF_UP), 2, symbol),
|
|
153
155
|
number: number,
|
|
156
|
+
uniquePaymentNumber: number,
|
|
154
157
|
device: device,
|
|
155
158
|
order_id: order_id
|
|
156
159
|
}));
|
|
@@ -174,7 +177,7 @@ export default (function (_ref) {
|
|
|
174
177
|
className: "pisell-lowcode__eft-pay-manual-edit-body"
|
|
175
178
|
}, /*#__PURE__*/React.createElement("div", {
|
|
176
179
|
className: "pisell-lowcode__eft-pay-manual-edit-text"
|
|
177
|
-
}, locales.getText('page.eftpos-pay.text.manual.subtitle')(formatAmount(pay === null || pay === void 0 ? void 0 : pay.total, 2, symbol)),
|
|
180
|
+
}, locales.getText('page.eftpos-pay.text.manual.subtitle')(formatAmount(pay === null || pay === void 0 ? void 0 : pay.total, 2, symbol)), ' ', /*#__PURE__*/React.createElement("br", null), locales.getText('page.eftpos-pay.text.manual.confirm'), /*#__PURE__*/React.createElement("br", null), locales.getText('page.eftpos-pay.text.manual.diff')), /*#__PURE__*/React.createElement("div", {
|
|
178
181
|
className: "pisell-lowcode__eft-pay-manual-edit-act"
|
|
179
182
|
}, /*#__PURE__*/React.createElement("div", {
|
|
180
183
|
className: "pisell-lowcode__eft-pay-manual-edit-text"
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { StatusType } from '../../const';
|
|
3
3
|
declare const _default: (props: {
|
|
4
4
|
status: StatusType;
|
|
5
|
-
warn?: string;
|
|
6
|
-
text?: string;
|
|
7
|
-
tip?: string;
|
|
8
|
-
loading?: string;
|
|
9
|
-
success?: string;
|
|
10
|
-
fail?: string;
|
|
5
|
+
warn?: string | undefined;
|
|
6
|
+
text?: string | undefined;
|
|
7
|
+
tip?: string | undefined;
|
|
8
|
+
loading?: string | undefined;
|
|
9
|
+
success?: string | undefined;
|
|
10
|
+
fail?: string | undefined;
|
|
11
11
|
}) => React.JSX.Element;
|
|
12
12
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const _default: (props: {
|
|
3
3
|
status: string;
|
|
4
|
-
pedding?: string;
|
|
5
|
-
resolve?: string;
|
|
6
|
-
reject?: string;
|
|
7
|
-
className?: string;
|
|
4
|
+
pedding?: string | undefined;
|
|
5
|
+
resolve?: string | undefined;
|
|
6
|
+
reject?: string | undefined;
|
|
7
|
+
className?: string | undefined;
|
|
8
8
|
}) => React.JSX.Element;
|
|
9
9
|
export default _default;
|
|
@@ -27,6 +27,32 @@ export declare enum ModeEnum {
|
|
|
27
27
|
/** 查询 */
|
|
28
28
|
Query = "query"
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* 崩溃恢复
|
|
32
|
+
*/
|
|
33
|
+
export declare enum RestoreEumn {
|
|
34
|
+
/** 常规 */
|
|
35
|
+
Normal = "normal",
|
|
36
|
+
/** 恢复 */
|
|
37
|
+
Restore = "restore"
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 订单状态
|
|
41
|
+
*/
|
|
42
|
+
export declare enum OrderEumn {
|
|
43
|
+
/** 恢复 */
|
|
44
|
+
Restore = "restore",
|
|
45
|
+
/** 常规 */
|
|
46
|
+
Normal = "normal",
|
|
47
|
+
/** 成功 */
|
|
48
|
+
Succeed = "succeed",
|
|
49
|
+
/** 失败 */
|
|
50
|
+
Failed = "failed",
|
|
51
|
+
/** 等待 */
|
|
52
|
+
Pending = "pending",
|
|
53
|
+
/** 没有订单状态 */
|
|
54
|
+
Null = "null"
|
|
55
|
+
}
|
|
30
56
|
export declare enum ClientEnum {
|
|
31
57
|
/** 用户端 */
|
|
32
58
|
User = "user",
|
|
@@ -60,7 +86,7 @@ export interface PosProps {
|
|
|
60
86
|
[key: string]: unknown;
|
|
61
87
|
};
|
|
62
88
|
/** 回调 */
|
|
63
|
-
onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
|
|
89
|
+
onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page' | 'print' | 'mark_tx_processed', params?: {
|
|
64
90
|
[keys: string]: unknown;
|
|
65
91
|
} | string, other?: any) => void;
|
|
66
92
|
onChangeParams(...agrn: unknown[]): void;
|
|
@@ -17,12 +17,34 @@ export var StatusEnum;
|
|
|
17
17
|
StatusEnum["Question"] = "question";
|
|
18
18
|
})(StatusEnum || (StatusEnum = {}));
|
|
19
19
|
export var ModeEnum;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 崩溃恢复
|
|
23
|
+
*/
|
|
20
24
|
(function (ModeEnum) {
|
|
21
25
|
ModeEnum["Pay"] = "pay";
|
|
22
26
|
ModeEnum["FullPay"] = "fullPay";
|
|
23
27
|
ModeEnum["Refund"] = "refund";
|
|
24
28
|
ModeEnum["Query"] = "query";
|
|
25
29
|
})(ModeEnum || (ModeEnum = {}));
|
|
30
|
+
export var RestoreEumn;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 订单状态
|
|
34
|
+
*/
|
|
35
|
+
(function (RestoreEumn) {
|
|
36
|
+
RestoreEumn["Normal"] = "normal";
|
|
37
|
+
RestoreEumn["Restore"] = "restore";
|
|
38
|
+
})(RestoreEumn || (RestoreEumn = {}));
|
|
39
|
+
export var OrderEumn;
|
|
40
|
+
(function (OrderEumn) {
|
|
41
|
+
OrderEumn["Restore"] = "restore";
|
|
42
|
+
OrderEumn["Normal"] = "normal";
|
|
43
|
+
OrderEumn["Succeed"] = "succeed";
|
|
44
|
+
OrderEumn["Failed"] = "failed";
|
|
45
|
+
OrderEumn["Pending"] = "pending";
|
|
46
|
+
OrderEumn["Null"] = "null";
|
|
47
|
+
})(OrderEumn || (OrderEumn = {}));
|
|
26
48
|
export var ClientEnum;
|
|
27
49
|
(function (ClientEnum) {
|
|
28
50
|
ClientEnum["User"] = "user";
|
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
12
12
|
api: PayProps['api'];
|
|
13
13
|
className?: string | undefined;
|
|
14
|
-
onChange?: ((status: "page" | "success" | "fail", params?: string | {
|
|
14
|
+
onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
|
15
15
|
[keys: string]: unknown;
|
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
|
17
17
|
onClose: () => void;
|
|
@@ -203,11 +203,11 @@ export default (function (_ref) {
|
|
|
203
203
|
className: "pisell-lowcode__eft-pay-device-content"
|
|
204
204
|
}, /*#__PURE__*/React.createElement("div", {
|
|
205
205
|
className: "pisell-lowcode__eft-pay-device-name"
|
|
206
|
-
}, name), /*#__PURE__*/React.createElement("div", {
|
|
206
|
+
}, name), mode === ModeEnum.Refund ? null : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
207
207
|
className: "pisell-lowcode__eft-pay-device-money"
|
|
208
208
|
}, pay.totalUnit), /*#__PURE__*/React.createElement("div", {
|
|
209
209
|
className: "pisell-lowcode__eft-pay-device-sucharge"
|
|
210
|
-
}, locales.getText('page.eftpos-pay.text.surcharge.edit.inc.surcharge'), ": ", formatAmount("".concat(pay.surcharge), 2, symbol), " (", locales.getText('page.eftpos-pay.text.surcharge.edit.rate'), ":", pay.surRate, "% +", ' ', formatAmount("".concat(pay.surMoney), 2, symbol), ")")), /*#__PURE__*/React.createElement("div", {
|
|
210
|
+
}, locales.getText('page.eftpos-pay.text.surcharge.edit.inc.surcharge'), ": ", formatAmount("".concat(pay.surcharge), 2, symbol), " (", locales.getText('page.eftpos-pay.text.surcharge.edit.rate'), ":", pay.surRate, "% +", ' ', formatAmount("".concat(pay.surMoney), 2, symbol), ")"))), /*#__PURE__*/React.createElement("div", {
|
|
211
211
|
style: {
|
|
212
212
|
flexShrink: 0
|
|
213
213
|
}
|
|
@@ -28,16 +28,19 @@ export declare const getPayParams: (data: Partial<Omit<State, key>> & Pick<State
|
|
|
28
28
|
order_id: string | number;
|
|
29
29
|
amount?: undefined;
|
|
30
30
|
total?: undefined;
|
|
31
|
+
receipt?: undefined;
|
|
31
32
|
} | {
|
|
32
33
|
cardReaderSurcharge: {};
|
|
33
34
|
surMoney: string;
|
|
34
35
|
surcharge: string;
|
|
35
36
|
total: string;
|
|
36
37
|
number: string | number | undefined;
|
|
38
|
+
uniquePaymentNumber: string | number | undefined;
|
|
37
39
|
device: {
|
|
38
40
|
[key: string]: unknown;
|
|
39
41
|
} | undefined;
|
|
40
42
|
order_id: string | number;
|
|
43
|
+
receipt: {};
|
|
41
44
|
amount?: undefined;
|
|
42
45
|
} | {
|
|
43
46
|
amount: string | number;
|
|
@@ -47,12 +50,14 @@ export declare const getPayParams: (data: Partial<Omit<State, key>> & Pick<State
|
|
|
47
50
|
[key: string]: unknown;
|
|
48
51
|
} | undefined;
|
|
49
52
|
order_id: string | number;
|
|
53
|
+
receipt: {};
|
|
50
54
|
} | {
|
|
51
55
|
amount: string | number;
|
|
52
56
|
total: string | number;
|
|
53
57
|
number: string | number | undefined;
|
|
54
58
|
order_id: string | number;
|
|
55
59
|
device?: undefined;
|
|
60
|
+
receipt?: undefined;
|
|
56
61
|
};
|
|
57
62
|
export declare const limitDecimals: (value: any) => any;
|
|
58
63
|
/**
|
|
@@ -74,4 +79,5 @@ export declare function getPayAmonunt({ money, amount, surRate, surMoney }: Amou
|
|
|
74
79
|
surRateMoney: string;
|
|
75
80
|
totalUnit: string;
|
|
76
81
|
};
|
|
82
|
+
export declare function getBrowserVersion(): string;
|
|
77
83
|
export {};
|
|
@@ -58,6 +58,7 @@ export function cloneDeep(source) {
|
|
|
58
58
|
* @Date: 2024-08-20 20:26
|
|
59
59
|
*/
|
|
60
60
|
export var getPayParams = function getPayParams(data, statue) {
|
|
61
|
+
var _data$custom;
|
|
61
62
|
if (statue === 'fail') {
|
|
62
63
|
return {
|
|
63
64
|
number: data.number,
|
|
@@ -65,10 +66,11 @@ export var getPayParams = function getPayParams(data, statue) {
|
|
|
65
66
|
order_id: data.order_id
|
|
66
67
|
};
|
|
67
68
|
}
|
|
69
|
+
var receipt = (data === null || data === void 0 ? void 0 : (_data$custom = data.custom) === null || _data$custom === void 0 ? void 0 : _data$custom.receipt) || [];
|
|
68
70
|
if (data.mode === ModeEnum.Pay || data.mode === ModeEnum.FullPay) {
|
|
69
|
-
var _data$
|
|
71
|
+
var _data$custom2, _data$device, _data$device$setting;
|
|
70
72
|
var pay = data.pay;
|
|
71
|
-
var card_reader_surcharge = ((_data$
|
|
73
|
+
var card_reader_surcharge = ((_data$custom2 = data.custom) === null || _data$custom2 === void 0 ? void 0 : _data$custom2.card_reader_surcharge) || 0;
|
|
72
74
|
var obj = pay || {};
|
|
73
75
|
var cardReaderSurcharge = card_reader_surcharge;
|
|
74
76
|
// 卡手续费
|
|
@@ -93,17 +95,21 @@ export var getPayParams = function getPayParams(data, statue) {
|
|
|
93
95
|
surcharge: surchargeDeci.toFixed(2, Decimal.ROUND_HALF_UP),
|
|
94
96
|
total: total.toFixed(2, Decimal.ROUND_HALF_UP),
|
|
95
97
|
number: data.number,
|
|
98
|
+
uniquePaymentNumber: data.number,
|
|
96
99
|
device: data.device,
|
|
97
|
-
order_id: data.order_id
|
|
100
|
+
order_id: data.order_id,
|
|
101
|
+
receipt: (_data$device = data.device) !== null && _data$device !== void 0 && (_data$device$setting = _data$device.setting) !== null && _data$device$setting !== void 0 && _data$device$setting.receipts ? [] : receipt
|
|
98
102
|
});
|
|
99
103
|
}
|
|
100
104
|
if (data.mode === ModeEnum.Refund) {
|
|
105
|
+
var _data$device2, _data$device2$setting;
|
|
101
106
|
return {
|
|
102
107
|
amount: data.amount,
|
|
103
108
|
total: data.amount,
|
|
104
109
|
number: data.number,
|
|
105
110
|
device: data.device,
|
|
106
|
-
order_id: data.order_id
|
|
111
|
+
order_id: data.order_id,
|
|
112
|
+
receipt: (_data$device2 = data.device) !== null && _data$device2 !== void 0 && (_data$device2$setting = _data$device2.setting) !== null && _data$device2$setting !== void 0 && _data$device2$setting.receipts ? [] : receipt
|
|
107
113
|
};
|
|
108
114
|
}
|
|
109
115
|
return {
|
|
@@ -216,4 +222,18 @@ export function getPayAmonunt(_ref, formatAmount) {
|
|
|
216
222
|
surRateMoney: "".concat(surRateMoney),
|
|
217
223
|
totalUnit: formatAmount(total)
|
|
218
224
|
};
|
|
225
|
+
}
|
|
226
|
+
export function getBrowserVersion() {
|
|
227
|
+
var Sys = {};
|
|
228
|
+
var ua = navigator.userAgent.toLowerCase();
|
|
229
|
+
var s;
|
|
230
|
+
(s = ua.match(/rv:([\d.]+)\) like gecko/)) ? Sys.ie = s[1] : (s = ua.match(/msie ([\d\.]+)/)) ? Sys.ie = s[1] : (s = ua.match(/edge\/([\d\.]+)/)) ? Sys.edge = s[1] : (s = ua.match(/firefox\/([\d\.]+)/)) ? Sys.firefox = s[1] : (s = ua.match(/(?:opera|opr).([\d\.]+)/)) ? Sys.opera = s[1] : (s = ua.match(/chrome\/([\d\.]+)/)) ? Sys.chrome = s[1] : (s = ua.match(/version\/([\d\.]+).*safari/)) ? Sys.safari = s[1] : 0;
|
|
231
|
+
// 根据关系进行判断
|
|
232
|
+
if (Sys.ie) return 'IE: ' + Sys.ie;
|
|
233
|
+
if (Sys.edge) return 'EDGE: ' + Sys.edge;
|
|
234
|
+
if (Sys.firefox) return 'Firefox: ' + Sys.firefox;
|
|
235
|
+
if (Sys.chrome) return 'Chrome: ' + Sys.chrome;
|
|
236
|
+
if (Sys.opera) return 'Opera: ' + Sys.opera;
|
|
237
|
+
if (Sys.safari) return 'Safari: ' + Sys.safari;
|
|
238
|
+
return 'Unkonwn';
|
|
219
239
|
}
|
|
@@ -21,6 +21,7 @@ export declare const useStoreRef: <T extends {
|
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
22
|
readonly eftposRef: React.MutableRefObject<"windcave" | "tyro" | "payo" | "stripe">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
|
+
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
24
25
|
};
|
|
25
26
|
/**
|
|
26
27
|
* @title: 通用失败处理
|
|
@@ -30,5 +31,5 @@ export declare const useStoreRef: <T extends {
|
|
|
30
31
|
* @Date: 2024-08-12 11:54
|
|
31
32
|
*/
|
|
32
33
|
export declare const useFail: (index: number) => (res: {
|
|
33
|
-
code?:
|
|
34
|
+
code?: "200" | "4004" | "701000" | "701001" | "701003" | "701004" | "701005" | "701006" | "701007" | "701008" | "701009" | "701010" | undefined;
|
|
34
35
|
}, isMark?: boolean) => void;
|
|
@@ -13,18 +13,20 @@ var Max4004 = 1;
|
|
|
13
13
|
|
|
14
14
|
// 穿越 react deep
|
|
15
15
|
export var useStoreRef = function useStoreRef() {
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
device =
|
|
19
|
-
pay =
|
|
20
|
-
number =
|
|
21
|
-
mode =
|
|
22
|
-
net =
|
|
23
|
-
status =
|
|
24
|
-
symbol =
|
|
25
|
-
amount =
|
|
26
|
-
eftpos =
|
|
27
|
-
client =
|
|
16
|
+
var data = useContextData();
|
|
17
|
+
var order_id = data.order_id,
|
|
18
|
+
device = data.device,
|
|
19
|
+
pay = data.pay,
|
|
20
|
+
number = data.number,
|
|
21
|
+
mode = data.mode,
|
|
22
|
+
net = data.net,
|
|
23
|
+
status = data.status,
|
|
24
|
+
symbol = data.symbol,
|
|
25
|
+
amount = data.amount,
|
|
26
|
+
eftpos = data.eftpos,
|
|
27
|
+
client = data.client;
|
|
28
|
+
var dataRef = useRef(data);
|
|
29
|
+
|
|
28
30
|
// 设备信息
|
|
29
31
|
var deviceRef = useRef(device);
|
|
30
32
|
|
|
@@ -55,6 +57,9 @@ export var useStoreRef = function useStoreRef() {
|
|
|
55
57
|
// 设备类型
|
|
56
58
|
var eftposRef = useRef(eftpos);
|
|
57
59
|
var clientRef = useRef(client);
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
dataRef.current = data;
|
|
62
|
+
}, [data]);
|
|
58
63
|
useEffect(function () {
|
|
59
64
|
deviceRef.current = device;
|
|
60
65
|
}, [device]);
|
|
@@ -99,7 +104,8 @@ export var useStoreRef = function useStoreRef() {
|
|
|
99
104
|
symbolRef: symbolRef,
|
|
100
105
|
amountRef: amountRef,
|
|
101
106
|
eftposRef: eftposRef,
|
|
102
|
-
clientRef: clientRef
|
|
107
|
+
clientRef: clientRef,
|
|
108
|
+
dataRef: dataRef
|
|
103
109
|
};
|
|
104
110
|
};
|
|
105
111
|
|
|
@@ -111,9 +117,9 @@ export var useStoreRef = function useStoreRef() {
|
|
|
111
117
|
* @Date: 2024-08-12 11:54
|
|
112
118
|
*/
|
|
113
119
|
export var useFail = function useFail(index) {
|
|
114
|
-
var
|
|
115
|
-
steps =
|
|
116
|
-
custom =
|
|
120
|
+
var _useContextData = useContextData(),
|
|
121
|
+
steps = _useContextData.steps,
|
|
122
|
+
custom = _useContextData.custom;
|
|
117
123
|
var _useStoreRef = useStoreRef(),
|
|
118
124
|
modeRef = _useStoreRef.modeRef,
|
|
119
125
|
clientRef = _useStoreRef.clientRef;
|