@pisell/private-materials 6.2.35 → 6.2.37
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 +13 -29
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/components/Content/index.js +1 -1
- package/es/components/appointmentBooking/components/Content/index.less +3 -3
- package/es/components/appointmentBooking/components/Services/index.js +2 -2
- package/es/components/appointmentBooking/index.js +8 -2
- package/es/components/booking/components/voucher/index.js +5 -0
- package/es/components/booking/deposit/ClientItem/index.js +1 -1
- package/es/components/booking/deposit/DepositItem/index.js +1 -1
- package/es/components/booking/forms/single/RenderValueById.d.ts +1 -0
- package/es/components/booking/forms/single/RenderValueById.js +68 -17
- package/es/components/booking/forms/single/index.less +67 -1
- package/es/components/booking/hooks/useQuotation.js +1 -1
- package/es/components/booking/info/clientVariant/utils.d.ts +2 -0
- package/es/components/booking/info/clientVariant/utils.js +7 -0
- package/es/components/booking/info/clientVariant/vertical/index.js +3 -2
- package/es/components/booking/info2/service/addService/utils.js +2 -1
- package/es/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/es/components/booking/info2/service/editService/index.js +37 -29
- package/es/components/booking/info2/utilsByBooking.js +4 -4
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +6 -3
- package/es/components/booking/materiels/duration/index.js +1 -1
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/utils.js +3 -3
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eventBooking/index.js +8 -1
- package/es/components/productSelect/components/TabProduct/index.js +7 -2
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/shoppingCart/components/Cart/Product.js +2 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +172 -91
- package/es/components/ticketBooking/components/timeBar/index.js +3 -3
- package/es/components/ticketBooking/utils/index.d.ts +3 -1
- package/es/components/ticketBooking/utils/index.js +18 -2
- package/es/hooks/useWindowSize.js +8 -1
- package/es/plus/productSelect/CategoryTabs/CategorySkeleton.d.ts +10 -0
- package/es/plus/productSelect/CategoryTabs/CategorySkeleton.js +29 -0
- package/es/plus/productSelect/CategoryTabs/CategorySkeleton.less +30 -0
- package/es/plus/productSelect/CategoryTabs/index.d.ts +18 -0
- package/es/plus/productSelect/CategoryTabs/index.js +171 -0
- package/es/plus/productSelect/ProductCard/ProductCardSkeleton.d.ts +10 -0
- package/es/plus/productSelect/ProductCard/ProductCardSkeleton.js +37 -0
- package/es/plus/productSelect/ProductCard/ProductCardSkeleton.less +81 -0
- package/es/plus/productSelect/ProductCard/index.d.ts +45 -0
- package/es/plus/productSelect/ProductCard/index.js +170 -0
- package/es/plus/productSelect/ProductCard/index.less +270 -0
- package/es/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
- package/es/plus/productSelect/ProductList/gridComponents.js +149 -0
- package/es/plus/productSelect/ProductList/index.d.ts +22 -0
- package/es/plus/productSelect/ProductList/index.js +72 -0
- package/es/plus/productSelect/ProductList/index.less +0 -0
- package/es/plus/productSelect/components/IntersectionObserver.d.ts +42 -0
- package/es/plus/productSelect/components/IntersectionObserver.js +276 -0
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.js +357 -0
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.less +224 -0
- package/es/plus/productSelect/components/TabsStructure/hooks.d.ts +22 -0
- package/es/plus/productSelect/components/TabsStructure/hooks.js +243 -0
- package/es/plus/productSelect/components/TabsStructure/index.d.ts +5 -0
- package/es/plus/productSelect/components/TabsStructure/index.js +13 -0
- package/es/plus/productSelect/components/TabsStructure/styles.d.ts +47 -0
- package/es/plus/productSelect/components/TabsStructure/styles.js +87 -0
- package/es/plus/productSelect/components/TabsStructure/types.d.ts +105 -0
- package/es/plus/productSelect/components/TabsStructure/types.js +1 -0
- package/es/plus/productSelect/components/TabsStructure/utils.d.ts +12 -0
- package/es/plus/productSelect/components/TabsStructure/utils.js +56 -0
- package/es/plus/productSelect/components/pisellPriceText/index.d.ts +11 -0
- package/es/plus/productSelect/components/pisellPriceText/index.js +43 -0
- package/es/plus/productSelect/hooks/useToken.d.ts +18 -0
- package/es/plus/productSelect/hooks/useToken.js +34 -0
- package/es/plus/productSelect/index.d.ts +31 -0
- package/es/plus/productSelect/index.js +270 -0
- package/es/plus/productSelect/index.less +56 -0
- package/es/plus/productSelect/locales.d.ts +18 -0
- package/es/plus/productSelect/locales.js +17 -0
- package/es/plus/productSelect/theme/token.d.ts +17 -0
- package/es/plus/productSelect/theme/token.js +19 -0
- package/es/plus/productSelect/utils.d.ts +39 -0
- package/es/plus/productSelect/utils.js +162 -0
- package/es/pro/pisellNumberSelector/index.js +3 -3
- package/es/pro/pisellPhoneKeyboard/index.js +1 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Content/index.js +1 -1
- package/lib/components/appointmentBooking/components/Content/index.less +3 -3
- package/lib/components/appointmentBooking/components/Services/index.js +2 -2
- package/lib/components/appointmentBooking/index.js +6 -1
- package/lib/components/booking/components/voucher/index.js +5 -0
- package/lib/components/booking/deposit/ClientItem/index.js +1 -1
- package/lib/components/booking/deposit/DepositItem/index.js +1 -1
- package/lib/components/booking/forms/single/RenderValueById.d.ts +1 -0
- package/lib/components/booking/forms/single/RenderValueById.js +37 -9
- package/lib/components/booking/forms/single/index.less +67 -1
- package/lib/components/booking/hooks/useQuotation.js +1 -1
- package/lib/components/booking/info/clientVariant/utils.d.ts +2 -0
- package/lib/components/booking/info/clientVariant/utils.js +13 -2
- package/lib/components/booking/info/clientVariant/vertical/index.js +7 -6
- package/lib/components/booking/info2/service/addService/utils.js +3 -3
- package/lib/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/lib/components/booking/info2/service/editService/index.js +22 -12
- package/lib/components/booking/info2/utilsByBooking.js +7 -8
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +6 -3
- package/lib/components/booking/materiels/duration/index.js +1 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.js +1 -1
- package/lib/components/booking/utils.js +3 -3
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eventBooking/index.js +6 -1
- package/lib/components/productSelect/components/TabProduct/index.js +7 -1
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +7 -4
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +87 -14
- package/lib/components/ticketBooking/components/timeBar/index.js +89 -70
- package/lib/components/ticketBooking/utils/index.d.ts +3 -1
- package/lib/components/ticketBooking/utils/index.js +21 -0
- package/lib/hooks/useWindowSize.js +6 -1
- package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.d.ts +10 -0
- package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.js +62 -0
- package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.less +30 -0
- package/lib/plus/productSelect/CategoryTabs/index.d.ts +18 -0
- package/lib/plus/productSelect/CategoryTabs/index.js +183 -0
- package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.d.ts +10 -0
- package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.js +58 -0
- package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.less +81 -0
- package/lib/plus/productSelect/ProductCard/index.d.ts +45 -0
- package/lib/plus/productSelect/ProductCard/index.js +184 -0
- package/lib/plus/productSelect/ProductCard/index.less +270 -0
- package/lib/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
- package/lib/plus/productSelect/ProductList/gridComponents.js +148 -0
- package/lib/plus/productSelect/ProductList/index.d.ts +22 -0
- package/lib/plus/productSelect/ProductList/index.js +86 -0
- package/lib/plus/productSelect/ProductList/index.less +0 -0
- package/lib/plus/productSelect/components/IntersectionObserver.d.ts +42 -0
- package/lib/plus/productSelect/components/IntersectionObserver.js +269 -0
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.js +393 -0
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.less +224 -0
- package/lib/plus/productSelect/components/TabsStructure/hooks.d.ts +22 -0
- package/lib/plus/productSelect/components/TabsStructure/hooks.js +209 -0
- package/lib/plus/productSelect/components/TabsStructure/index.d.ts +5 -0
- package/lib/plus/productSelect/components/TabsStructure/index.js +92 -0
- package/lib/plus/productSelect/components/TabsStructure/styles.d.ts +47 -0
- package/lib/plus/productSelect/components/TabsStructure/styles.js +122 -0
- package/lib/plus/productSelect/components/TabsStructure/types.d.ts +105 -0
- package/lib/plus/productSelect/components/TabsStructure/types.js +17 -0
- package/lib/plus/productSelect/components/TabsStructure/utils.d.ts +12 -0
- package/lib/plus/productSelect/components/TabsStructure/utils.js +72 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.d.ts +11 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.js +72 -0
- package/lib/plus/productSelect/hooks/useToken.d.ts +18 -0
- package/lib/plus/productSelect/hooks/useToken.js +50 -0
- package/lib/plus/productSelect/index.d.ts +31 -0
- package/lib/plus/productSelect/index.js +299 -0
- package/lib/plus/productSelect/index.less +56 -0
- package/lib/plus/productSelect/locales.d.ts +18 -0
- package/lib/plus/productSelect/locales.js +41 -0
- package/lib/plus/productSelect/theme/token.d.ts +17 -0
- package/lib/plus/productSelect/theme/token.js +47 -0
- package/lib/plus/productSelect/utils.d.ts +39 -0
- package/lib/plus/productSelect/utils.js +138 -0
- package/lib/pro/pisellNumberSelector/index.js +3 -3
- package/lib/pro/pisellPhoneKeyboard/index.js +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/package.json +4 -4
@@ -54,7 +54,7 @@ var import_useAddHolder = __toESM(require("../../hooks/useAddHolder"));
|
|
54
54
|
var import_utils5 = require("../utils");
|
55
55
|
var import_useGetHolderList = __toESM(require("../../hooks/useGetHolderList"));
|
56
56
|
var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
57
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O;
|
57
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P;
|
58
58
|
const { globalState, setGlobalState } = props;
|
59
59
|
const modalRef = (0, import_react.useRef)();
|
60
60
|
const state = globalState;
|
@@ -377,6 +377,7 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
377
377
|
setSearch: (_b2 = modalRef.current) == null ? void 0 : _b2.setSearch
|
378
378
|
};
|
379
379
|
});
|
380
|
+
(0, import_utils5.setClientVariantClose)((_z = modalRef.current) == null ? void 0 : _z.close);
|
380
381
|
const isOpenDeleteProduct = (0, import_react.useMemo)(() => {
|
381
382
|
if (!(0, import_utils3.isDayBooking)(state)) return false;
|
382
383
|
const pets = (0, import_utils3.getPets)(state);
|
@@ -444,11 +445,11 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
444
445
|
import_antd.Avatar,
|
445
446
|
{
|
446
447
|
className: "pisell-lowcode__booking-client-avatar",
|
447
|
-
src: import_utils.image.ali((
|
448
|
+
src: import_utils.image.ali((_A = state.client.value) == null ? void 0 : _A.cover, 100),
|
448
449
|
size: 64,
|
449
450
|
icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-client-list-item-avatar-icon" })
|
450
451
|
}
|
451
|
-
), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, import_utils.locales.getText("pisell2.text.add-client")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in"))) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, getNickname(state.client.value)), ((
|
452
|
+
), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, import_utils.locales.getText("pisell2.text.add-client")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in"))) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, getNickname(state.client.value)), ((_B = state.client.value) == null ? void 0 : _B.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_C = state.client.value) == null ? void 0 : _C.email) : null, ((_D = state.client.value) == null ? void 0 : _D.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_E = state.client.value) == null ? void 0 : _E.phone) : null, !!((_G = (_F = state.client.value) == null ? void 0 : _F.waiver_form) == null ? void 0 : _G.length) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-waiver", title: (0, import_utils5.getWaiverTitle)((_H = state.client.value) == null ? void 0 : _H.waiver_form) }, (_K = (_J = (_I = state.client.value) == null ? void 0 : _I.waiver_form) == null ? void 0 : _J.map) == null ? void 0 : _K.call(_J, (item) => {
|
452
453
|
return /* @__PURE__ */ import_react.default.createElement("span", null, item.form_title, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-client-waiver-colon" }, ":"), item.is_filled ? /* @__PURE__ */ import_react.default.createElement(
|
453
454
|
"span",
|
454
455
|
{
|
@@ -513,7 +514,7 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
513
514
|
showHeader: !state.isBookingCreatePage,
|
514
515
|
modalOpen: state.modalOpen,
|
515
516
|
loading,
|
516
|
-
autoFocus: !((
|
517
|
+
autoFocus: !((_N = (_M = (_L = context == null ? void 0 : context.appHelper) == null ? void 0 : _L.utils) == null ? void 0 : _M.isTerminal) == null ? void 0 : _N.call(_M)),
|
517
518
|
ref: modalRef,
|
518
519
|
onClose: handleClose,
|
519
520
|
handleSelectClient: _handleSelectClient,
|
@@ -523,8 +524,8 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
523
524
|
formData: state.pet.formData,
|
524
525
|
searchChange,
|
525
526
|
options: renderList,
|
526
|
-
holder: (
|
527
|
-
client: (
|
527
|
+
holder: (_O = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _O.holder,
|
528
|
+
client: (_P = state == null ? void 0 : state.client) == null ? void 0 : _P.value,
|
528
529
|
loadMore,
|
529
530
|
showPet: (boardConfig == null ? void 0 : boardConfig.type) === "form",
|
530
531
|
handleAddPet,
|
@@ -384,7 +384,7 @@ var getIsAutoClose = (cacheItem) => {
|
|
384
384
|
);
|
385
385
|
};
|
386
386
|
var getProductExtend = ({ cacheItem, state, isDisabledTime }) => {
|
387
|
-
var _a, _b, _c, _d;
|
387
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
388
388
|
const isNew = cacheItem.new || !cacheItem._extend.endDate;
|
389
389
|
let _cacheItem = { ...cacheItem };
|
390
390
|
const resourcesOriginMap = state.service.resourcesOriginMap || {};
|
@@ -432,7 +432,7 @@ var getProductExtend = ({ cacheItem, state, isDisabledTime }) => {
|
|
432
432
|
state
|
433
433
|
});
|
434
434
|
if ((0, import_utils.getDuration)(_cacheItem == null ? void 0 : _cacheItem.duration) === "flexible") {
|
435
|
-
_cacheItem._extend.duration = _cacheItem._data.timeObj.durationSlicesBasedOnTime[0].value;
|
435
|
+
_cacheItem._extend.duration = (_e = (_d = (_c = _cacheItem._data.timeObj) == null ? void 0 : _c.durationSlicesBasedOnTime) == null ? void 0 : _d[0]) == null ? void 0 : _e.value;
|
436
436
|
const { startDate, endDate } = (0, import_utils.getServiceTimes)({
|
437
437
|
_extend: _cacheItem._extend
|
438
438
|
});
|
@@ -466,7 +466,7 @@ var getProductExtend = ({ cacheItem, state, isDisabledTime }) => {
|
|
466
466
|
{
|
467
467
|
extraResources,
|
468
468
|
// 此数据用来控制 该商品所展示的资源是自身关联的, 还是全部的
|
469
|
-
resourceTab: (
|
469
|
+
resourceTab: (_g = (_f = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _f.config) == null ? void 0 : _g.resource_tab,
|
470
470
|
resourcesOrigin: state.service.resourcesOrigin
|
471
471
|
}
|
472
472
|
);
|
@@ -208,7 +208,6 @@ var AddTimeModal = () => {
|
|
208
208
|
setLoading("list");
|
209
209
|
const newList = await _getAddTimeProducts();
|
210
210
|
let list = newList.map((d) => {
|
211
|
-
debugger;
|
212
211
|
let isUsable = (0, import_utils2.isUsableProduct)(d.add_time, state.service.cacheItem);
|
213
212
|
return {
|
214
213
|
...d,
|
@@ -174,7 +174,7 @@ var Info = (_, ref) => {
|
|
174
174
|
form.setFieldsValue({ discount });
|
175
175
|
};
|
176
176
|
const onFinish = (values) => {
|
177
|
-
var _a2, _b2;
|
177
|
+
var _a2, _b2, _c2;
|
178
178
|
let isSuccess = (_a2 = resourcesRef.current) == null ? void 0 : _a2.check();
|
179
179
|
if (isShowTimeAndResource && !isSuccess) {
|
180
180
|
return;
|
@@ -221,6 +221,15 @@ var Info = (_, ref) => {
|
|
221
221
|
(0, import_utils3.deleteCacheParams)();
|
222
222
|
console.log("_onFinish", _list);
|
223
223
|
form.resetFields();
|
224
|
+
if (!!((_c2 = state.service.cacheItem) == null ? void 0 : _c2.new)) {
|
225
|
+
window.dispatchEvent(
|
226
|
+
new CustomEvent("onAddNewService", {
|
227
|
+
detail: {
|
228
|
+
cacheItem: { ...state.service.cacheItem }
|
229
|
+
}
|
230
|
+
})
|
231
|
+
);
|
232
|
+
}
|
224
233
|
dispatch({
|
225
234
|
type: "setService",
|
226
235
|
payload: {
|
@@ -457,6 +466,18 @@ var Info = (_, ref) => {
|
|
457
466
|
}, [state.renderType, isNormalProduct]);
|
458
467
|
const SelectTime = (_p = window.BaseMaterials) == null ? void 0 : _p.SelectTime;
|
459
468
|
const isNoSpecAndPackage = (0, import_utilsByBooking.getIsNoSpecAndPackage)(state.service.cacheItem);
|
469
|
+
const handleNoteConfirm = (noteValue) => {
|
470
|
+
form.setFieldsValue({ note: noteValue });
|
471
|
+
setNoteModalOpen(false);
|
472
|
+
};
|
473
|
+
const handleNoteDelete = () => {
|
474
|
+
form.setFieldsValue({ note: "" });
|
475
|
+
setNoteModalOpen(false);
|
476
|
+
};
|
477
|
+
const handleNoteCancel = () => {
|
478
|
+
setNoteModalOpen(false);
|
479
|
+
};
|
480
|
+
console.log(isShowTimeAndResource, "isShowTimeAndResource");
|
460
481
|
const productName = (0, import_react.useMemo)(() => {
|
461
482
|
var _a2, _b2, _c2;
|
462
483
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "product_name" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.product_name) || "-"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleEdit }, import_utils.locales.getText("pisell2.text.edit")), !state.isBookingCreatePage && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleChange }, import_utils.locales.getText("pisell2.text.change"))), /* @__PURE__ */ import_react.default.createElement(
|
@@ -673,17 +694,6 @@ var Info = (_, ref) => {
|
|
673
694
|
setVal(false);
|
674
695
|
}
|
675
696
|
}, [isShowTimeAndResource]);
|
676
|
-
const handleNoteConfirm = (noteValue) => {
|
677
|
-
form.setFieldsValue({ note: noteValue });
|
678
|
-
setNoteModalOpen(false);
|
679
|
-
};
|
680
|
-
const handleNoteDelete = () => {
|
681
|
-
form.setFieldsValue({ note: "" });
|
682
|
-
setNoteModalOpen(false);
|
683
|
-
};
|
684
|
-
const handleNoteCancel = () => {
|
685
|
-
setNoteModalOpen(false);
|
686
|
-
};
|
687
697
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
688
698
|
import_drawer.default,
|
689
699
|
{
|
@@ -42,8 +42,7 @@ module.exports = __toCommonJS(utilsByBooking_exports);
|
|
42
42
|
var import_dayjs = __toESM(require("dayjs"));
|
43
43
|
var import_utils = require("@pisell/utils");
|
44
44
|
var import_utils2 = require("../utils");
|
45
|
-
var import_utils3 = require("
|
46
|
-
var import_utils4 = require("../../ticketBooking/components/addServiceVariant/utils");
|
45
|
+
var import_utils3 = require("../../ticketBooking/components/addServiceVariant/utils");
|
47
46
|
var getUseableEventCount = (eventList, current) => {
|
48
47
|
return (eventList || []).reduce((pre, event) => {
|
49
48
|
return pre - event.pax;
|
@@ -211,7 +210,7 @@ var getAppointmentTimingPreference = (state) => {
|
|
211
210
|
return ((_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.information_tab) == null ? void 0 : _c.appointment_timing_preference) || "sequential";
|
212
211
|
};
|
213
212
|
var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
|
214
|
-
var _a, _b, _c, _d;
|
213
|
+
var _a, _b, _c, _d, _e;
|
215
214
|
if (cacheItem == null ? void 0 : cacheItem.isCustomItem) {
|
216
215
|
return {
|
217
216
|
duration: null
|
@@ -224,7 +223,7 @@ var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
|
|
224
223
|
// 时长: 当前商品时长 > 第一个时长
|
225
224
|
duration: (0, import_utils2.findNextDuration)(
|
226
225
|
cacheItem.duration,
|
227
|
-
timeObj.durationSlicesBasedOnTime,
|
226
|
+
timeObj == null ? void 0 : timeObj.durationSlicesBasedOnTime,
|
228
227
|
(_b = cacheItem == null ? void 0 : cacheItem.duration) == null ? void 0 : _b.value
|
229
228
|
)
|
230
229
|
};
|
@@ -235,7 +234,7 @@ var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
|
|
235
234
|
_extend.start_time = lastServerStartDate.format("HH:mm");
|
236
235
|
} else {
|
237
236
|
if ((0, import_dayjs.default)(lastServerEndDate).isAfter(lastServerStartDate, "day")) {
|
238
|
-
_extend.start_time = timeObj.timeSlices[timeObj.timeSlices.length - 1].value;
|
237
|
+
_extend.start_time = timeObj == null ? void 0 : timeObj.timeSlices[((_c = timeObj == null ? void 0 : timeObj.timeSlices) == null ? void 0 : _c.length) - 1].value;
|
239
238
|
} else {
|
240
239
|
_extend.start_time = lastServerEndDate.format("HH:mm");
|
241
240
|
}
|
@@ -268,7 +267,7 @@ var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
|
|
268
267
|
const { startDate, endDate } = (0, import_utils2.getServiceTimes)({ _extend });
|
269
268
|
_extend.startDate = startDate;
|
270
269
|
_extend.endDate = endDate;
|
271
|
-
const session = (
|
270
|
+
const session = (_e = (_d = cacheItem == null ? void 0 : cacheItem._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.session;
|
272
271
|
if ((0, import_utils2.isSessionProduct)(cacheItem) && session) {
|
273
272
|
_extend.start_date = session.start_at;
|
274
273
|
_extend.startDate = session.start_at;
|
@@ -281,13 +280,13 @@ var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
|
|
281
280
|
};
|
282
281
|
var getIsNoSpecAndPackage = (product) => {
|
283
282
|
var _a, _b, _c, _d;
|
284
|
-
if (
|
283
|
+
if ((product == null ? void 0 : product.extension_type) !== "normal") {
|
285
284
|
return false;
|
286
285
|
}
|
287
286
|
if (product == null ? void 0 : product.isEditBooking) {
|
288
287
|
return ((_a = product == null ? void 0 : product.product_bundle) == null ? void 0 : _a.length) === 0 && (product == null ? void 0 : product.product_variant_id) === 0 && (((_c = (_b = product == null ? void 0 : product.product_sku) == null ? void 0 : _b.option) == null ? void 0 : _c.length) || 0) === 0;
|
289
288
|
}
|
290
|
-
return (product == null ? void 0 : product.is_bundle) === 0 && (((_d = product == null ? void 0 : product.variant) == null ? void 0 : _d.length) || 0) === 0 && !(0,
|
289
|
+
return (product == null ? void 0 : product.is_bundle) === 0 && (((_d = product == null ? void 0 : product.variant) == null ? void 0 : _d.length) || 0) === 0 && !(0, import_utils3.isOption)(product);
|
291
290
|
};
|
292
291
|
// Annotate the CommonJS export names for ESM import in node:
|
293
292
|
0 && (module.exports = {
|
@@ -299,6 +299,7 @@ declare const _default: {
|
|
299
299
|
'pisell2.text.quotation.product.change.title': string;
|
300
300
|
'pisell2.text.quotation.product.change.describe': string;
|
301
301
|
'pisell2.booking.notes.placeholder': string;
|
302
|
+
'pisell2.text.form.link.to.another.record.more': string;
|
302
303
|
};
|
303
304
|
'zh-CN': {
|
304
305
|
'pisell2.text.refunded-amount': string;
|
@@ -600,6 +601,7 @@ declare const _default: {
|
|
600
601
|
'pisell2.text.quotation.product.change.title': string;
|
601
602
|
'pisell2.text.quotation.product.change.describe': string;
|
602
603
|
'pisell2.booking.notes.placeholder': string;
|
604
|
+
'pisell2.text.form.link.to.another.record.more': string;
|
603
605
|
};
|
604
606
|
'zh-HK': {
|
605
607
|
'pisell2.text.refunded-amount': string;
|
@@ -901,6 +903,7 @@ declare const _default: {
|
|
901
903
|
'pisell2.text.quotation.product.change.title': string;
|
902
904
|
'pisell2.text.quotation.product.change.describe': string;
|
903
905
|
'pisell2.booking.notes.placeholder': string;
|
906
|
+
'pisell2.text.form.link.to.another.record.more': string;
|
904
907
|
};
|
905
908
|
};
|
906
909
|
export default _default;
|
@@ -366,7 +366,8 @@ var locales_default = {
|
|
366
366
|
"pisell2.text.quotation.product.change.title": "Notification",
|
367
367
|
"pisell2.text.quotation.product.change.describe": "Product updates available: Please refresh the following items to load the latest data.",
|
368
368
|
// Notes
|
369
|
-
"pisell2.booking.notes.placeholder": "Enter a note..."
|
369
|
+
"pisell2.booking.notes.placeholder": "Enter a note...",
|
370
|
+
"pisell2.text.form.link.to.another.record.more": "View More"
|
370
371
|
},
|
371
372
|
"zh-CN": {
|
372
373
|
"pisell2.text.refunded-amount": "已退金额",
|
@@ -705,7 +706,8 @@ var locales_default = {
|
|
705
706
|
"pisell2.text.quotation.product.change.title": "提示",
|
706
707
|
"pisell2.text.quotation.product.change.describe": "以下商品信息已更新,请重新编辑相关商品以同步最新数据。",
|
707
708
|
// Notes
|
708
|
-
"pisell2.booking.notes.placeholder": "输入备注..."
|
709
|
+
"pisell2.booking.notes.placeholder": "输入备注...",
|
710
|
+
"pisell2.text.form.link.to.another.record.more": "查看更多"
|
709
711
|
},
|
710
712
|
"zh-HK": {
|
711
713
|
"pisell2.text.refunded-amount": "已退金額",
|
@@ -1044,6 +1046,7 @@ var locales_default = {
|
|
1044
1046
|
"pisell2.text.quotation.product.change.title": "提示",
|
1045
1047
|
"pisell2.text.quotation.product.change.describe": "以下商品信息已更新,请重新编辑相关商品以同步最新数据。",
|
1046
1048
|
// Notes
|
1047
|
-
"pisell2.booking.notes.placeholder": "輸入備註..."
|
1049
|
+
"pisell2.booking.notes.placeholder": "輸入備註...",
|
1050
|
+
"pisell2.text.form.link.to.another.record.more": "查看更多"
|
1048
1051
|
}
|
1049
1052
|
};
|
@@ -77,7 +77,7 @@ var Duration = (props) => {
|
|
77
77
|
});
|
78
78
|
}
|
79
79
|
return durationSlicesBasedOnTime;
|
80
|
-
}, [timeObj.durationSlicesBasedOnTime, slice, locale, duration, startDateStr, usableTime == null ? void 0 : usableTime.end_at]);
|
80
|
+
}, [timeObj == null ? void 0 : timeObj.durationSlicesBasedOnTime, slice, locale, duration, startDateStr, usableTime == null ? void 0 : usableTime.end_at]);
|
81
81
|
(0, import_react.useEffect)(() => {
|
82
82
|
timeObjChange == null ? void 0 : timeObjChange(times);
|
83
83
|
}, [times]);
|
@@ -52,6 +52,6 @@ var StartTime = (props) => {
|
|
52
52
|
},
|
53
53
|
[]
|
54
54
|
);
|
55
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Select, { ...selectProps, ...resetProps }, renderOptions(timeObj.timeSlices));
|
55
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Select, { ...selectProps, ...resetProps }, renderOptions(timeObj == null ? void 0 : timeObj.timeSlices));
|
56
56
|
};
|
57
57
|
var startTime_default = StartTime;
|
@@ -550,7 +550,7 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
|
|
550
550
|
}
|
551
551
|
return findNextDuration(
|
552
552
|
cacheItem.duration,
|
553
|
-
timeObj.durationSlicesBasedOnTime,
|
553
|
+
timeObj == null ? void 0 : timeObj.durationSlicesBasedOnTime,
|
554
554
|
(_a = cacheItem == null ? void 0 : cacheItem.duration) == null ? void 0 : _a.value
|
555
555
|
);
|
556
556
|
};
|
@@ -566,14 +566,14 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
|
|
566
566
|
_extend.start_time = lastServerStartDate.format("HH:mm");
|
567
567
|
} else {
|
568
568
|
if ((0, import_dayjs.default)(lastServerEndDate).isAfter(lastServerStartDate, "day")) {
|
569
|
-
_extend.start_time = timeObj.timeSlices[timeObj.timeSlices.length - 1].value;
|
569
|
+
_extend.start_time = timeObj == null ? void 0 : timeObj.timeSlices[(timeObj == null ? void 0 : timeObj.timeSlices.length) - 1].value;
|
570
570
|
} else {
|
571
571
|
_extend.start_time = lastServerEndDate.format("HH:mm");
|
572
572
|
}
|
573
573
|
}
|
574
574
|
} else {
|
575
575
|
let findNextSliceProps = {
|
576
|
-
timeSlices: timeObj.timeSlices,
|
576
|
+
timeSlices: timeObj == null ? void 0 : timeObj.timeSlices,
|
577
577
|
index: 0,
|
578
578
|
date: ""
|
579
579
|
};
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
8
8
|
*/
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
10
10
|
className?: string | undefined;
|
11
|
-
onChange?: ((status: "success" | "page" | "
|
11
|
+
onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
12
12
|
[keys: string]: unknown;
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
14
14
|
onClose: () => void;
|
@@ -10,7 +10,7 @@ import './device.less';
|
|
10
10
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
11
11
|
api: PayProps['api'];
|
12
12
|
className?: string | undefined;
|
13
|
-
onChange?: ((status: "success" | "page" | "
|
13
|
+
onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
14
14
|
[keys: string]: unknown;
|
15
15
|
} | undefined, other?: any) => void) | undefined;
|
16
16
|
onClose: () => void;
|
@@ -295,15 +295,15 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
295
295
|
name?: string | undefined;
|
296
296
|
symbol?: string | undefined;
|
297
297
|
amount?: string | number | undefined;
|
298
|
-
mode?: "
|
298
|
+
mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
|
299
299
|
order_id?: string | number | undefined;
|
300
300
|
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
|
301
|
-
action?: "amount" | "
|
301
|
+
action?: "amount" | "deviceList" | "pay" | undefined;
|
302
302
|
key?: number | undefined;
|
303
303
|
step?: number | undefined;
|
304
304
|
title?: string | undefined;
|
305
305
|
subTitle?: string | undefined;
|
306
|
-
type?: "
|
306
|
+
type?: "step" | "unset" | undefined;
|
307
307
|
render?: boolean | undefined;
|
308
308
|
net?: boolean | undefined;
|
309
309
|
component?: string | undefined;
|
@@ -68,7 +68,12 @@ var Content = () => {
|
|
68
68
|
}, []);
|
69
69
|
(0, import_react.useEffect)(() => {
|
70
70
|
const setRealVH = () => {
|
71
|
-
|
71
|
+
let height = window.innerHeight;
|
72
|
+
const urlParams = new URLSearchParams(window.location.search);
|
73
|
+
if (urlParams.has("formTabbar")) {
|
74
|
+
height = height - 54;
|
75
|
+
}
|
76
|
+
const vh = height * 0.01;
|
72
77
|
document.documentElement.style.setProperty("--vh", `${vh}px`);
|
73
78
|
};
|
74
79
|
setRealVH();
|
@@ -44,9 +44,15 @@ var getOffsetTopRelativeToScrollContainer = (targetElement, scrollContainer) =>
|
|
44
44
|
if (targetElement === scrollContainer) {
|
45
45
|
return 0;
|
46
46
|
}
|
47
|
+
const bodyTransform = getComputedStyle(document.body).transform;
|
48
|
+
let scaleY = 1;
|
49
|
+
if (bodyTransform !== "none") {
|
50
|
+
const matrix = new DOMMatrix(bodyTransform);
|
51
|
+
scaleY = matrix.d;
|
52
|
+
}
|
47
53
|
const targetRect = targetElement.getBoundingClientRect();
|
48
54
|
const containerRect = scrollContainer.getBoundingClientRect();
|
49
|
-
return targetRect.top - containerRect.top + scrollContainer.scrollTop;
|
55
|
+
return targetRect.top / scaleY - containerRect.top / scaleY + scrollContainer.scrollTop;
|
50
56
|
};
|
51
57
|
var TabProduct = (props) => {
|
52
58
|
const {
|
@@ -17,6 +17,6 @@ declare let modal: Omit<ModalStaticFunctions, "warn">;
|
|
17
17
|
export declare const setModal: (m: Omit<ModalStaticFunctions, "warn">) => void;
|
18
18
|
export declare const saveConfirm: () => Promise<{
|
19
19
|
destroy: () => void;
|
20
|
-
update: (configUpdate: import("antd
|
20
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
21
21
|
}>;
|
22
22
|
export { modal };
|
@@ -58,10 +58,12 @@ var Product = (props) => {
|
|
58
58
|
productCardStyleConfig = {}
|
59
59
|
} = state;
|
60
60
|
const clearCart = (0, import_useClearCart.default)(id);
|
61
|
-
const handleChange = (0, import_ahooks.useMemoizedFn)(
|
62
|
-
|
63
|
-
|
64
|
-
|
61
|
+
const handleChange = (0, import_ahooks.useMemoizedFn)(
|
62
|
+
(item, type, other) => {
|
63
|
+
if (disabledEdit && !(other == null ? void 0 : other.disabled)) return;
|
64
|
+
onChange(item, type, other);
|
65
|
+
}
|
66
|
+
);
|
65
67
|
const productParams = (0, import_react.useMemo)(() => {
|
66
68
|
return {
|
67
69
|
isShowNote,
|
@@ -87,6 +89,7 @@ var Product = (props) => {
|
|
87
89
|
]);
|
88
90
|
const getProductCardStyleProps = (0, import_ahooks.useMemoizedFn)((type) => {
|
89
91
|
const conf = productCardStyleConfig[`${type}_product_card_style`];
|
92
|
+
if (state.scenario !== "booking2") return {};
|
90
93
|
return {
|
91
94
|
isShowImage: conf == null ? void 0 : conf.show_product_image,
|
92
95
|
isShowDelete: conf == null ? void 0 : conf.show_remove_button,
|
@@ -41,7 +41,7 @@ var import_utils3 = require("../../../booking/info2/service/addService/utils");
|
|
41
41
|
var import_utils4 = require("../../../booking/info/service2/utils");
|
42
42
|
var import_utils5 = require("../../../booking/info/utils");
|
43
43
|
var import_serviceManager = require("../../../booking/info/service/serviceManager");
|
44
|
-
var import_productSelect = __toESM(require("
|
44
|
+
var import_productSelect = __toESM(require("../../../../plus/productSelect"));
|
45
45
|
var import_index = require("./index.less");
|
46
46
|
var import_utils6 = require("../../utils");
|
47
47
|
var import_notAvailable = __toESM(require("../notAvailable"));
|
@@ -71,6 +71,30 @@ var AddSerivce = (props) => {
|
|
71
71
|
const stateRef = (0, import_react.useRef)(state);
|
72
72
|
stateRef.current = state;
|
73
73
|
const { getProducts, products, loading } = (0, import_pisellos.useProducts)();
|
74
|
+
(0, import_react.useEffect)(() => {
|
75
|
+
return () => {
|
76
|
+
Object.values(debounceTimersRef.current).forEach((timer) => {
|
77
|
+
if (timer) clearTimeout(timer);
|
78
|
+
});
|
79
|
+
debounceTimersRef.current = {};
|
80
|
+
};
|
81
|
+
}, []);
|
82
|
+
(0, import_react.useEffect)(() => {
|
83
|
+
const handler = (event) => {
|
84
|
+
var _a2;
|
85
|
+
const cacheItem = (_a2 = event == null ? void 0 : event.detail) == null ? void 0 : _a2.cacheItem;
|
86
|
+
console.log("Modal closed with result:", event.detail.cacheItem);
|
87
|
+
if (!(cacheItem == null ? void 0 : cacheItem.id)) return;
|
88
|
+
(0, import_utils6.addServiceScroll)(String(cacheItem.id), cacheItem);
|
89
|
+
};
|
90
|
+
window.addEventListener("onAddNewService", handler);
|
91
|
+
return () => {
|
92
|
+
window.removeEventListener("onAddNewService", handler);
|
93
|
+
};
|
94
|
+
}, []);
|
95
|
+
const pendingCacheValuesRef = (0, import_react.useRef)({});
|
96
|
+
const clickCountRef = (0, import_react.useRef)({});
|
97
|
+
const debounceTimersRef = (0, import_react.useRef)({});
|
74
98
|
const menuList = (0, import_react.useMemo)(() => {
|
75
99
|
var _a2, _b2, _c2;
|
76
100
|
return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.menu_list_tab) == null ? void 0 : _c2.menu_list) || [];
|
@@ -113,14 +137,35 @@ var AddSerivce = (props) => {
|
|
113
137
|
var _a2;
|
114
138
|
(_a2 = Toast == null ? void 0 : Toast.success) == null ? void 0 : _a2.call(
|
115
139
|
Toast,
|
116
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-title" }, title), /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-quantity" }, import_utils.locales.getText("pisell2.ticket-booking.in-cart")(
|
117
|
-
quantity || 1
|
118
|
-
)))
|
140
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-title" }, title), /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-quantity" }, import_utils.locales.getText("pisell2.ticket-booking.in-cart")(quantity || 1)))
|
119
141
|
);
|
120
142
|
};
|
143
|
+
const executeCacheValues = (0, import_ahooks.useMemoizedFn)(
|
144
|
+
(productId, originalCacheValues, item, originalCallback) => {
|
145
|
+
const clickCount = clickCountRef.current[productId] || 1;
|
146
|
+
const finalCacheValues = {
|
147
|
+
...originalCacheValues,
|
148
|
+
quantity: clickCount
|
149
|
+
};
|
150
|
+
delete pendingCacheValuesRef.current[productId];
|
151
|
+
delete clickCountRef.current[productId];
|
152
|
+
delete debounceTimersRef.current[productId];
|
153
|
+
originalCallback(finalCacheValues, "", item, true);
|
154
|
+
}
|
155
|
+
);
|
156
|
+
const debouncedExecuteCacheValues = (0, import_ahooks.useMemoizedFn)(
|
157
|
+
(productId, cacheValues, item, callback) => {
|
158
|
+
if (debounceTimersRef.current[productId]) {
|
159
|
+
clearTimeout(debounceTimersRef.current[productId]);
|
160
|
+
}
|
161
|
+
debounceTimersRef.current[productId] = setTimeout(() => {
|
162
|
+
executeCacheValues(productId, cacheValues, item, callback);
|
163
|
+
}, 0);
|
164
|
+
}
|
165
|
+
);
|
121
166
|
const handleSelectProduct = (0, import_ahooks.useMemoizedFn)(
|
122
167
|
(item, type = "select") => {
|
123
|
-
var _a2;
|
168
|
+
var _a2, _b2, _c2, _d2;
|
124
169
|
if (!(0, import_utils4.isNormalProductByDurationSchedule)(item)) {
|
125
170
|
if (!Array.isArray((_a2 = state.service) == null ? void 0 : _a2.resourcesOrigin) || !state.service.resourcesOrigin.length) {
|
126
171
|
dispatch({
|
@@ -142,7 +187,7 @@ var AddSerivce = (props) => {
|
|
142
187
|
setCurrentProduct(item);
|
143
188
|
} else {
|
144
189
|
setCurrentProduct(null);
|
145
|
-
if (
|
190
|
+
if ((item == null ? void 0 : item.extension_type) === "normal") {
|
146
191
|
cacheValues = {
|
147
192
|
bundle: [],
|
148
193
|
key: item.id,
|
@@ -152,12 +197,14 @@ var AddSerivce = (props) => {
|
|
152
197
|
quantity: 1,
|
153
198
|
rowKey: item.id,
|
154
199
|
session: null,
|
155
|
-
unique: "08974625397"
|
200
|
+
unique: "08974625397",
|
201
|
+
_originalItem: item
|
202
|
+
// 保存原始商品信息
|
156
203
|
};
|
157
204
|
}
|
158
205
|
}
|
159
|
-
const callback = async (e, extension_type, detail) => {
|
160
|
-
var _a3,
|
206
|
+
const callback = async (e, extension_type, detail, notShowToast) => {
|
207
|
+
var _a3, _b3, _c3, _d3, _e2, _f2;
|
161
208
|
setCurrentProduct(null);
|
162
209
|
if (lock) {
|
163
210
|
return;
|
@@ -217,10 +264,18 @@ var AddSerivce = (props) => {
|
|
217
264
|
cacheItem,
|
218
265
|
state
|
219
266
|
);
|
220
|
-
|
221
|
-
|
267
|
+
if (!notShowToast) {
|
268
|
+
handleAddToast(cacheItem.title, quantity || 1);
|
269
|
+
}
|
270
|
+
window.dispatchEvent(
|
271
|
+
new CustomEvent("onAddNewService", {
|
272
|
+
detail: {
|
273
|
+
cacheItem
|
274
|
+
}
|
275
|
+
})
|
276
|
+
);
|
222
277
|
try {
|
223
|
-
if (((_f2 = (_e2 = (
|
278
|
+
if (((_f2 = (_e2 = (_d3 = (_c3 = (_b3 = context.appHelper.utils.store) == null ? void 0 : _b3.getState) == null ? void 0 : _c3.call(_b3)) == null ? void 0 : _d3.global) == null ? void 0 : _e2.globalConfig) == null ? void 0 : _f2.id) === 2155) {
|
224
279
|
const val = _list == null ? void 0 : _list.map((s) => {
|
225
280
|
return {
|
226
281
|
product_id: s == null ? void 0 : s.product_id,
|
@@ -277,7 +332,25 @@ var AddSerivce = (props) => {
|
|
277
332
|
}
|
278
333
|
};
|
279
334
|
if (cacheValues) {
|
280
|
-
|
335
|
+
const productId = item.id.toString();
|
336
|
+
if (pendingCacheValuesRef.current[productId]) {
|
337
|
+
clickCountRef.current[productId] = (clickCountRef.current[productId] || 1) + 1;
|
338
|
+
} else {
|
339
|
+
pendingCacheValuesRef.current[productId] = cacheValues;
|
340
|
+
clickCountRef.current[productId] = 1;
|
341
|
+
}
|
342
|
+
const cacheItem = (0, import_utils6.createSimpleCacheItem)(item, cacheValues, state);
|
343
|
+
const detail = (_b2 = state.service.value) == null ? void 0 : _b2.find(
|
344
|
+
(val) => (0, import_utils6.isSameProduct)(val, cacheItem)
|
345
|
+
);
|
346
|
+
const originalQuantity = ((_c2 = detail == null ? void 0 : detail._extend) == null ? void 0 : _c2.quantity) || 0;
|
347
|
+
(_d2 = Toast == null ? void 0 : Toast.success) == null ? void 0 : _d2.call(
|
348
|
+
Toast,
|
349
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-title" }, item.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-quantity" }, import_utils.locales.getText("pisell2.ticket-booking.in-cart")(
|
350
|
+
(clickCountRef.current[productId] || 1) + originalQuantity
|
351
|
+
)))
|
352
|
+
);
|
353
|
+
debouncedExecuteCacheValues(productId, cacheValues, item, callback);
|
281
354
|
return;
|
282
355
|
}
|
283
356
|
state.action({
|
@@ -350,7 +423,7 @@ var AddSerivce = (props) => {
|
|
350
423
|
isSubtitle: 1,
|
351
424
|
isPrice: 1,
|
352
425
|
isOriginPrice: 0,
|
353
|
-
isStock:
|
426
|
+
isStock: 0
|
354
427
|
}
|
355
428
|
}
|
356
429
|
), /* @__PURE__ */ import_react.default.createElement(import_notAvailable.default, { ref: notAvailableRef }));
|