@pisell/private-materials 3.0.197 → 3.0.199
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- 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 -45
- package/es/components/booking/components/footer/index.js +40 -84
- package/es/components/booking/components/footer/utils.js +32 -218
- 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 +4 -33
- package/es/components/booking/info/main.js +8 -20
- 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 +20 -127
- package/es/components/booking/info/service/addService/index.less +3 -13
- package/es/components/booking/info/service/addService/utils.d.ts +2 -11
- package/es/components/booking/info/service/addService/utils.js +24 -49
- package/es/components/booking/info/service/editService/index.js +41 -232
- package/es/components/booking/info/service/editService/index.less +13 -18
- package/es/components/booking/info/utils.d.ts +0 -9
- package/es/components/booking/info/utils.js +0 -13
- package/es/components/booking/locales.d.ts +0 -60
- package/es/components/booking/locales.js +3 -75
- package/es/components/booking/model.d.ts +1 -4
- package/es/components/booking/model.js +2 -4
- package/es/components/booking/utils.d.ts +3 -12
- package/es/components/booking/utils.js +22 -126
- 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/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/helper.d.ts +1 -0
- package/es/components/eftposPay/helper.js +14 -0
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/tyro/index.js +51 -20
- 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 -26
- package/lib/components/booking/components/footer/index.js +4 -25
- package/lib/components/booking/components/footer/utils.js +31 -144
- 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 +10 -36
- package/lib/components/booking/info/main.js +4 -11
- 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 +28 -95
- package/lib/components/booking/info/service/addService/index.less +3 -13
- package/lib/components/booking/info/service/addService/utils.d.ts +2 -11
- package/lib/components/booking/info/service/addService/utils.js +10 -31
- package/lib/components/booking/info/service/editService/index.js +122 -271
- package/lib/components/booking/info/service/editService/index.less +13 -18
- package/lib/components/booking/info/utils.d.ts +0 -9
- package/lib/components/booking/info/utils.js +0 -6
- package/lib/components/booking/locales.d.ts +0 -60
- package/lib/components/booking/locales.js +3 -63
- package/lib/components/booking/model.d.ts +1 -4
- package/lib/components/booking/model.js +2 -4
- package/lib/components/booking/utils.d.ts +3 -12
- package/lib/components/booking/utils.js +15 -79
- 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/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/helper.d.ts +1 -0
- package/lib/components/eftposPay/helper.js +21 -0
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/tyro/index.js +36 -7
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/package.json +3 -3
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -37
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- 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 -118
- package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/es/components/booking/info/service2/Lists.d.ts +0 -3
- package/es/components/booking/info/service2/Lists.js +0 -158
- 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 -3
- package/es/components/booking/info/service2/index.js +0 -58
- 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 -145
- package/es/components/booking/info/service2/utils.js +0 -436
- 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 -96
- 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 -68
- 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 -124
- 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 -54
- 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 -119
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -59
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +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 -110
- package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/lib/components/booking/info/service2/Lists.d.ts +0 -3
- package/lib/components/booking/info/service2/Lists.js +0 -113
- 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 -3
- 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 -145
- package/lib/components/booking/info/service2/utils.js +0 -320
- 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 -89
- 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 -79
- 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 -116
- 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 -71
- 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 -92
- package/lowcode/shopping-cart/meta.ts +0 -98
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @title: 自定义组件设置
|
|
4
|
+
* @description: 自定义组件设置
|
|
5
|
+
* @param {any} commConfig 当前组件配置
|
|
6
|
+
* @param {string} name 上游name(用于嵌套 xxx:{yyy:''})
|
|
7
|
+
* @return {*}
|
|
8
|
+
* @Author: hongbing.wang
|
|
9
|
+
* @Date: 2024-08-20 11:10
|
|
10
|
+
*/
|
|
11
|
+
export declare const getCommName: (commConfig: any, name: string[]) => any;
|
|
12
|
+
/**
|
|
13
|
+
* @title: 自定义组件结果设置
|
|
14
|
+
* @description: 自定义组件结果设置
|
|
15
|
+
* @param {any} commConfig 当前组件配置
|
|
16
|
+
* @return {*}
|
|
17
|
+
* @Author: hongbing.wang
|
|
18
|
+
* @Date: 2024-08-20 11:11
|
|
19
|
+
*/
|
|
20
|
+
export declare const getCommDefaultVal: (commConfig: any) => {
|
|
21
|
+
[x: number]: any;
|
|
22
|
+
};
|
|
23
|
+
declare const _default: (props: any) => React.JSX.Element;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eftpos/receipt/index.tsx
|
|
30
|
+
var receipt_exports = {};
|
|
31
|
+
__export(receipt_exports, {
|
|
32
|
+
default: () => receipt_default,
|
|
33
|
+
getCommDefaultVal: () => getCommDefaultVal,
|
|
34
|
+
getCommName: () => getCommName
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(receipt_exports);
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_antd = require("antd");
|
|
39
|
+
var import_group = require("../group");
|
|
40
|
+
var getCommName = (commConfig, name) => {
|
|
41
|
+
commConfig.receipts.__sourceName = commConfig.receipts.name;
|
|
42
|
+
commConfig.receiptList.__sourceName = commConfig.receiptList.name;
|
|
43
|
+
commConfig.receipts.name = name.length > 0 ? [...name, commConfig.receipts.name] : commConfig.receipts.name;
|
|
44
|
+
commConfig.receiptList.name = name.length > 0 ? [...name, commConfig.receiptList.name] : commConfig.receiptList.name;
|
|
45
|
+
return commConfig;
|
|
46
|
+
};
|
|
47
|
+
var getCommDefaultVal = (commConfig) => {
|
|
48
|
+
const receipts = commConfig.receipts.input.defaultValue;
|
|
49
|
+
const receiptList = commConfig.receiptList.input.defaultValue;
|
|
50
|
+
console.log("receipts = ", receipts);
|
|
51
|
+
return {
|
|
52
|
+
[commConfig.receipts.__sourceName]: typeof receipts === "undefined" ? true : receipts,
|
|
53
|
+
[commConfig.receiptList.__sourceName]: typeof receiptList === "undefined" ? ["merchant", "customer"] : receiptList
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
var receipt_default = (props) => {
|
|
57
|
+
const { receipts, receiptList } = props;
|
|
58
|
+
const [receiptsInput, receiptsOther] = (0, import_react.useMemo)(() => {
|
|
59
|
+
const { input, ...other } = receipts;
|
|
60
|
+
return [input, other];
|
|
61
|
+
}, [receipts]);
|
|
62
|
+
const [receiptListInput, receiptListOther] = (0, import_react.useMemo)(() => {
|
|
63
|
+
const { input, ...other } = receiptList;
|
|
64
|
+
return [input, other];
|
|
65
|
+
}, [receipts]);
|
|
66
|
+
const [type, setType] = (0, import_react.useState)(receiptsInput.defaultValue);
|
|
67
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { style: { marginBottom: "12px" }, ...receiptsOther }, /* @__PURE__ */ import_react.default.createElement(
|
|
68
|
+
import_group.RadioGroup,
|
|
69
|
+
{
|
|
70
|
+
...receiptsInput,
|
|
71
|
+
onChange: (event) => {
|
|
72
|
+
setType(event.target.value);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
76
|
+
import_antd.Form.Item,
|
|
77
|
+
{
|
|
78
|
+
...receiptListOther,
|
|
79
|
+
style: type ? { marginLeft: "24px", display: "none" } : { marginLeft: "24px" }
|
|
80
|
+
},
|
|
81
|
+
/* @__PURE__ */ import_react.default.createElement(import_group.CheckboxGroup, { ...receiptListInput })
|
|
82
|
+
));
|
|
83
|
+
};
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
getCommDefaultVal,
|
|
87
|
+
getCommName
|
|
88
|
+
});
|
|
@@ -21,6 +21,7 @@ var helper_exports = {};
|
|
|
21
21
|
__export(helper_exports, {
|
|
22
22
|
cloneDeep: () => cloneDeep,
|
|
23
23
|
getAmonunt: () => getAmonunt,
|
|
24
|
+
getBrowserVersion: () => getBrowserVersion,
|
|
24
25
|
getPayAmonunt: () => getPayAmonunt,
|
|
25
26
|
getPayParams: () => getPayParams,
|
|
26
27
|
getUuid: () => getUuid,
|
|
@@ -185,10 +186,30 @@ function getPayAmonunt({ money, amount, surRate, surMoney }, formatAmount) {
|
|
|
185
186
|
totalUnit: formatAmount(total)
|
|
186
187
|
};
|
|
187
188
|
}
|
|
189
|
+
function getBrowserVersion() {
|
|
190
|
+
const Sys = {};
|
|
191
|
+
const ua = navigator.userAgent.toLowerCase();
|
|
192
|
+
let s;
|
|
193
|
+
(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;
|
|
194
|
+
if (Sys.ie)
|
|
195
|
+
return "IE: " + Sys.ie;
|
|
196
|
+
if (Sys.edge)
|
|
197
|
+
return "EDGE: " + Sys.edge;
|
|
198
|
+
if (Sys.firefox)
|
|
199
|
+
return "Firefox: " + Sys.firefox;
|
|
200
|
+
if (Sys.chrome)
|
|
201
|
+
return "Chrome: " + Sys.chrome;
|
|
202
|
+
if (Sys.opera)
|
|
203
|
+
return "Opera: " + Sys.opera;
|
|
204
|
+
if (Sys.safari)
|
|
205
|
+
return "Safari: " + Sys.safari;
|
|
206
|
+
return "Unkonwn";
|
|
207
|
+
}
|
|
188
208
|
// Annotate the CommonJS export names for ESM import in node:
|
|
189
209
|
0 && (module.exports = {
|
|
190
210
|
cloneDeep,
|
|
191
211
|
getAmonunt,
|
|
212
|
+
getBrowserVersion,
|
|
192
213
|
getPayAmonunt,
|
|
193
214
|
getPayParams,
|
|
194
215
|
getUuid,
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"windcave" | "tyro" | "payo" | "stripe">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
@@ -64,6 +64,20 @@ var tyro_default = ({
|
|
|
64
64
|
const requestIdRef = (0, import_react.useRef)((custom == null ? void 0 : custom.requestId) || "");
|
|
65
65
|
const unloadRef = (0, import_react.useRef)(false);
|
|
66
66
|
const clearRef = (0, import_react.useRef)();
|
|
67
|
+
const isPrint = (key) => {
|
|
68
|
+
var _a, _b, _c, _d;
|
|
69
|
+
if ((_b = (_a = deviceRef.current) == null ? void 0 : _a.setting) == null ? void 0 : _b.receipts) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const receiptList = (_d = (_c = deviceRef.current) == null ? void 0 : _c.setting) == null ? void 0 : _d.receiptList;
|
|
73
|
+
if (!Array.isArray(receiptList)) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
if (Array.isArray(receiptList) && receiptList.some((item) => item === key)) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
};
|
|
67
81
|
(0, import_react.useEffect)(() => {
|
|
68
82
|
listRef.current = (custom == null ? void 0 : custom.list) || [];
|
|
69
83
|
}, [custom == null ? void 0 : custom.list]);
|
|
@@ -114,12 +128,16 @@ var tyro_default = ({
|
|
|
114
128
|
);
|
|
115
129
|
requestParams.current = {
|
|
116
130
|
amount: new import_decimal.Decimal(amountRef.current || 0).mul(100).toFixed(0, import_decimal.Decimal.ROUND_HALF_UP),
|
|
117
|
-
// 打印小票 true
|
|
131
|
+
// 打印小票 true 打印到Pisell系统上 false 打印到pos机上
|
|
118
132
|
integratedReceipt: !((_b = (_a = deviceRef.current) == null ? void 0 : _a.setting) == null ? void 0 : _b.receipts),
|
|
119
133
|
integrationKey,
|
|
120
134
|
transactionId: numRef.current,
|
|
121
135
|
mid,
|
|
122
|
-
tid
|
|
136
|
+
tid,
|
|
137
|
+
device: JSON.stringify(deviceRef.current),
|
|
138
|
+
isPrintMerchant: isPrint("merchant"),
|
|
139
|
+
isPrintCustomer: isPrint("customer"),
|
|
140
|
+
browserVersion: (0, import_helper.getBrowserVersion)()
|
|
123
141
|
};
|
|
124
142
|
dispatch(
|
|
125
143
|
(0, import_store.updateCustom)({
|
|
@@ -186,7 +204,11 @@ var tyro_default = ({
|
|
|
186
204
|
integrationKey,
|
|
187
205
|
transactionId: numRef.current,
|
|
188
206
|
mid,
|
|
189
|
-
tid
|
|
207
|
+
tid,
|
|
208
|
+
device: JSON.stringify(deviceRef.current),
|
|
209
|
+
isPrintMerchant: isPrint("merchant"),
|
|
210
|
+
isPrintCustomer: isPrint("customer"),
|
|
211
|
+
browserVersion: (0, import_helper.getBrowserVersion)()
|
|
190
212
|
};
|
|
191
213
|
dispatch(
|
|
192
214
|
(0, import_store.updateCustom)({
|
|
@@ -244,8 +266,14 @@ var tyro_default = ({
|
|
|
244
266
|
console.log("商家小票 客户端是否打印小票 = ", signatureRequired);
|
|
245
267
|
console.log("商家小票 小票内容 = \n", merchantReceipt);
|
|
246
268
|
const receipt = [merchantReceipt].filter((item) => typeof item === "string").filter(Boolean);
|
|
247
|
-
onChange("print", receipt);
|
|
248
269
|
merchantReceiptRef.current = { signatureRequired, merchantReceipt };
|
|
270
|
+
if (signatureRequired) {
|
|
271
|
+
onChange("print", receipt);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (isPrint("merchant")) {
|
|
275
|
+
onChange("print", receipt);
|
|
276
|
+
}
|
|
249
277
|
};
|
|
250
278
|
const statusMessageCallbackImpl = (message) => {
|
|
251
279
|
var _a;
|
|
@@ -381,7 +409,6 @@ var tyro_default = ({
|
|
|
381
409
|
})
|
|
382
410
|
);
|
|
383
411
|
clearRef.current = setTimeout(() => {
|
|
384
|
-
var _a2;
|
|
385
412
|
const params = (0, import_helper.getPayParams)(
|
|
386
413
|
{
|
|
387
414
|
mode: modeRef.current,
|
|
@@ -398,14 +425,16 @@ var tyro_default = ({
|
|
|
398
425
|
);
|
|
399
426
|
onChange("success", {
|
|
400
427
|
...params,
|
|
401
|
-
receipt: (
|
|
428
|
+
receipt: isPrint("customer") ? receipt : []
|
|
402
429
|
});
|
|
403
430
|
}, 1e3);
|
|
404
431
|
return;
|
|
405
432
|
} else {
|
|
406
433
|
const current = ((_b = deviceRef.current) == null ? void 0 : _b.setting.receipts) ? [] : receipt;
|
|
407
434
|
if (current.length > 0) {
|
|
408
|
-
|
|
435
|
+
if (isPrint("customer")) {
|
|
436
|
+
onChange("print", receipt);
|
|
437
|
+
}
|
|
409
438
|
}
|
|
410
439
|
}
|
|
411
440
|
if (response.result === "UNKNOWN") {
|
package/lib/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/lib/index.js
CHANGED
|
@@ -48,7 +48,6 @@ __export(src_exports, {
|
|
|
48
48
|
ProductExtension: () => import_productExtension.default,
|
|
49
49
|
RuleSetting: () => import_ruleSetting.default,
|
|
50
50
|
Schedules: () => import_schedules.default,
|
|
51
|
-
ShoppingCart: () => import_shoppingCart.default,
|
|
52
51
|
TaxSelect: () => import_taxSelect.default,
|
|
53
52
|
ToCPay: () => import_toC.default,
|
|
54
53
|
VerticalAddService: () => import_addServiceVariant.default,
|
|
@@ -81,7 +80,6 @@ var import_eftpos = __toESM(require("./components/eftpos"));
|
|
|
81
80
|
var import_eftposPay = __toESM(require("./components/eftposPay"));
|
|
82
81
|
var import_dashboard = __toESM(require("./components/booking/dashboard"));
|
|
83
82
|
var import_pisellSelectCustomerModal = __toESM(require("./components/pisellSelectCustomerModal"));
|
|
84
|
-
var import_shoppingCart = __toESM(require("./components/shoppingCart"));
|
|
85
83
|
import_dayjs.default.extend(import_weekday.default);
|
|
86
84
|
import_dayjs.default.extend(import_localeData.default);
|
|
87
85
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -105,7 +103,6 @@ import_dayjs.default.extend(import_localeData.default);
|
|
|
105
103
|
ProductExtension,
|
|
106
104
|
RuleSetting,
|
|
107
105
|
Schedules,
|
|
108
|
-
ShoppingCart,
|
|
109
106
|
TaxSelect,
|
|
110
107
|
ToCPay,
|
|
111
108
|
VerticalAddService,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.199",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
62
|
"@pisell/utils": "1.0.42",
|
|
63
|
-
"@pisell/materials": "3.0.
|
|
64
|
-
"@pisell/date-picker": "
|
|
63
|
+
"@pisell/materials": "3.0.59",
|
|
64
|
+
"@pisell/date-picker": "1.0.100",
|
|
65
65
|
"@pisell/icon": "0.0.11"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
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."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useState, forwardRef, useImperativeHandle } from 'react';
|
|
8
|
-
import { locales } from '@pisell/utils';
|
|
9
|
-
import { PisellModal } from '@pisell/materials';
|
|
10
|
-
var AppointmentProductModal = function AppointmentProductModal(props, ref) {
|
|
11
|
-
var _useState = useState(false),
|
|
12
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
-
open = _useState2[0],
|
|
14
|
-
setOpen = _useState2[1];
|
|
15
|
-
useImperativeHandle(ref, function () {
|
|
16
|
-
return {
|
|
17
|
-
open: function open() {
|
|
18
|
-
setOpen(true);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
return /*#__PURE__*/React.createElement(PisellModal.Information, {
|
|
23
|
-
open: open,
|
|
24
|
-
title: locales.getText('pisell2.text.missing.reservation.title'),
|
|
25
|
-
describe: locales.getText('pisell2.text.missing.reservation.content'),
|
|
26
|
-
cancelText: locales.getText('pisell2.text.cancel'),
|
|
27
|
-
okText: locales.getText('pisell2.text.confirm'),
|
|
28
|
-
closable: true,
|
|
29
|
-
onOk: function onOk() {
|
|
30
|
-
return setOpen(false);
|
|
31
|
-
},
|
|
32
|
-
onCancel: function onCancel() {
|
|
33
|
-
return setOpen(false);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
export default /*#__PURE__*/forwardRef(AppointmentProductModal);
|
|
File without changes
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
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."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
8
|
-
import { CalendarOutlined } from '@ant-design/icons';
|
|
9
|
-
import classNames from 'classnames';
|
|
10
|
-
import dayjs from 'dayjs';
|
|
11
|
-
import { DatePicker, Page } from '@pisell/materials';
|
|
12
|
-
import "./index.less";
|
|
13
|
-
|
|
14
|
-
// 禁用之前的日期
|
|
15
|
-
export var disabledDate = function disabledDate(current, position, currentDate) {
|
|
16
|
-
if (position === 'start') {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
if (position === 'end' && current.endOf('day') && currentDate !== null && currentDate !== void 0 && currentDate[0]) {
|
|
20
|
-
// 结束日期最大 = 开始日期 + 8个月
|
|
21
|
-
var endDisabled = currentDate === null || currentDate === void 0 ? void 0 : currentDate[0].add(8, 'months').format('YYYY-MM-DD');
|
|
22
|
-
return dayjs(endDisabled) < current.startOf('day') || current.startOf('day') <= (currentDate === null || currentDate === void 0 ? void 0 : currentDate[0]);
|
|
23
|
-
}
|
|
24
|
-
return current && current <= (currentDate === null || currentDate === void 0 ? void 0 : currentDate[0]);
|
|
25
|
-
};
|
|
26
|
-
var DateRange = function DateRange(_ref) {
|
|
27
|
-
var state = _ref.state,
|
|
28
|
-
dispatch = _ref.dispatch,
|
|
29
|
-
key = _ref.key;
|
|
30
|
-
var _useState = useState([]),
|
|
31
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
-
value = _useState2[0],
|
|
33
|
-
setValue = _useState2[1];
|
|
34
|
-
useEffect(function () {
|
|
35
|
-
var _state$date, _state$date2;
|
|
36
|
-
var lists = [(_state$date = state.date) === null || _state$date === void 0 ? void 0 : _state$date.value, (_state$date2 = state.date) === null || _state$date2 === void 0 ? void 0 : _state$date2.end_date];
|
|
37
|
-
setValue(lists);
|
|
38
|
-
console.log('lists', lists);
|
|
39
|
-
}, [state.date]);
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @title: 点击确定
|
|
43
|
-
* @description:
|
|
44
|
-
* @param {any} e
|
|
45
|
-
* @return {*}
|
|
46
|
-
* @Author: WangHan
|
|
47
|
-
* @Date: 2024-12-12 15:39
|
|
48
|
-
*/
|
|
49
|
-
var dateChange = function dateChange(e) {
|
|
50
|
-
dispatch({
|
|
51
|
-
type: 'setDate',
|
|
52
|
-
payload: {
|
|
53
|
-
value: e[0],
|
|
54
|
-
end_date: e[1],
|
|
55
|
-
edit: true
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @title: 格式化语言
|
|
62
|
-
* @description:
|
|
63
|
-
* @param {*} useMemo
|
|
64
|
-
* @return {*}
|
|
65
|
-
* @Author: WangHan
|
|
66
|
-
* @Date: 2024-12-09 17:47
|
|
67
|
-
*/
|
|
68
|
-
var formatLocale = useMemo(function () {
|
|
69
|
-
var locale = state === null || state === void 0 ? void 0 : state.locale;
|
|
70
|
-
var isEn = locale === 'en' || locale === 'en-US';
|
|
71
|
-
var _format = isEn ? 'DD/MM/YYYY' : 'YYYY-MM-DD';
|
|
72
|
-
return _format;
|
|
73
|
-
}, [state === null || state === void 0 ? void 0 : state.locale, state.date]);
|
|
74
|
-
return useMemo(function () {
|
|
75
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: classNames('pisell-lowcode__booking-service-header-date-range', {
|
|
77
|
-
'pisell-lowcode__booking-service-header-date-range-terminal': state.isTerminalDayBookingPage
|
|
78
|
-
})
|
|
79
|
-
}, /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(DatePicker.RangePicker, {
|
|
80
|
-
key: key,
|
|
81
|
-
inputReadOnly: true,
|
|
82
|
-
allowClear: false,
|
|
83
|
-
size: "large",
|
|
84
|
-
style: {
|
|
85
|
-
width: '100%',
|
|
86
|
-
padding: 0
|
|
87
|
-
},
|
|
88
|
-
suffixIcon: !state.disabledEdit ? /*#__PURE__*/React.createElement(CalendarOutlined, null) : null,
|
|
89
|
-
disabledDate: disabledDate,
|
|
90
|
-
value: [value[0], value[1]],
|
|
91
|
-
onChange: dateChange,
|
|
92
|
-
format: formatLocale,
|
|
93
|
-
isHideCustomSelect: true,
|
|
94
|
-
endDateDays: 1
|
|
95
|
-
}))));
|
|
96
|
-
}, [value, state.disabledEdit, state === null || state === void 0 ? void 0 : state.locale]);
|
|
97
|
-
};
|
|
98
|
-
export default DateRange;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.pisell-lowcode__booking-service-header-date-range {
|
|
2
|
-
flex: 1.1;
|
|
3
|
-
margin-top: 16px;
|
|
4
|
-
|
|
5
|
-
.pisell-date-range-picker > div > div {
|
|
6
|
-
height: 44px !important;
|
|
7
|
-
cursor: pointer !important;
|
|
8
|
-
input {
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.anticon-calendar {
|
|
14
|
-
font-size: 20px;
|
|
15
|
-
color: #667085;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.pisell-lowcode__booking-service-header-date-range-terminal {
|
|
20
|
-
margin-top: 0;
|
|
21
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
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."); }
|
|
13
|
-
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); }
|
|
14
|
-
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; }
|
|
15
|
-
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; } }
|
|
16
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
import React, { useState, forwardRef, useImperativeHandle } from 'react';
|
|
18
|
-
import { locales } from '@pisell/utils';
|
|
19
|
-
import { PisellModal } from '@pisell/materials';
|
|
20
|
-
import { appointmentTypes } from "../../service2/status";
|
|
21
|
-
import "./index.less";
|
|
22
|
-
var ChangePetModal = function ChangePetModal(props, ref) {
|
|
23
|
-
var _useState = useState(false),
|
|
24
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
-
open = _useState2[0],
|
|
26
|
-
setOpen = _useState2[1];
|
|
27
|
-
var _useState3 = useState({}),
|
|
28
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
-
params = _useState4[0],
|
|
30
|
-
setParams = _useState4[1];
|
|
31
|
-
useImperativeHandle(ref, function () {
|
|
32
|
-
return {
|
|
33
|
-
open: function open(e) {
|
|
34
|
-
setParams(e);
|
|
35
|
-
setOpen(true);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @title: 确认之后的操作
|
|
42
|
-
* @description:
|
|
43
|
-
* @param {string} type
|
|
44
|
-
* @return {*}
|
|
45
|
-
* @Author: WangHan
|
|
46
|
-
* @Date: 2024-12-12 22:56
|
|
47
|
-
*/
|
|
48
|
-
var handleProduct = function handleProduct(type) {
|
|
49
|
-
var ids = params.ids,
|
|
50
|
-
service = params.service,
|
|
51
|
-
dispatch = params.dispatch,
|
|
52
|
-
setGlobalState = params.setGlobalState,
|
|
53
|
-
state = params.state;
|
|
54
|
-
var _service = _toConsumableArray(service || []);
|
|
55
|
-
if (type === 'ok') {
|
|
56
|
-
var _service2;
|
|
57
|
-
// 将商品放在open items中
|
|
58
|
-
_service = (_service2 = _service) === null || _service2 === void 0 ? void 0 : _service2.map(function (item) {
|
|
59
|
-
if (ids !== null && ids !== void 0 && ids.includes(item._extend.holder_id)) {
|
|
60
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
61
|
-
_extend: _objectSpread(_objectSpread({}, item._extend || {}), {}, {
|
|
62
|
-
holder_id: 0
|
|
63
|
-
})
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return item;
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
// 预约商品不能放在open items中, 所以过滤掉 holder_id为0 并且是预约商品的数据
|
|
70
|
-
_service = _service.filter(function (item) {
|
|
71
|
-
var _item$_extend;
|
|
72
|
-
return !((item === null || item === void 0 ? void 0 : (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.holder_id) === 0 && appointmentTypes.includes(item.extension_type));
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
// 将商品数据清空
|
|
76
|
-
_service = _service.filter(function (item) {
|
|
77
|
-
return !ids.includes(item._extend.holder_id);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// 更新服务商品列表
|
|
82
|
-
if (dispatch) {
|
|
83
|
-
dispatch({
|
|
84
|
-
type: 'setService',
|
|
85
|
-
payload: {
|
|
86
|
-
value: _toConsumableArray(_service),
|
|
87
|
-
edit: true
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
} else {
|
|
91
|
-
setGlobalState({
|
|
92
|
-
service: _objectSpread(_objectSpread({}, state.service), {}, {
|
|
93
|
-
edit: true,
|
|
94
|
-
value: _toConsumableArray(_service)
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
setOpen(false);
|
|
99
|
-
};
|
|
100
|
-
return /*#__PURE__*/React.createElement(PisellModal.Information, {
|
|
101
|
-
open: open,
|
|
102
|
-
width: 432,
|
|
103
|
-
title: locales.getText('pisell2.text.change.pet.title'),
|
|
104
|
-
describe: /*#__PURE__*/React.createElement("div", {
|
|
105
|
-
className: "pisell2-change-pet-modal-content"
|
|
106
|
-
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.change.pet.content')), /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.change.pet.content1'))),
|
|
107
|
-
cancelText: locales.getText('pisell2.text.change.pet.cancel'),
|
|
108
|
-
okText: locales.getText('pisell2.text.change.pet.confirm'),
|
|
109
|
-
closable: true,
|
|
110
|
-
onOk: function onOk() {
|
|
111
|
-
return handleProduct('ok');
|
|
112
|
-
},
|
|
113
|
-
onCancel: function onCancel() {
|
|
114
|
-
return handleProduct('cancel');
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
export default /*#__PURE__*/forwardRef(ChangePetModal);
|