@pisell/private-materials 6.8.29 → 6.8.31
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/utils.js +2 -2
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/kioskSkuDetail/index.d.ts +7 -4
- package/es/components/kioskSkuDetail/index.js +182 -35
- package/es/components/kioskSkuDetail/locales.d.ts +21 -0
- package/es/components/kioskSkuDetail/locales.js +20 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.js +2 -2
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/kioskSkuDetail/index.d.ts +7 -4
- package/lib/components/kioskSkuDetail/index.js +178 -65
- package/lib/components/kioskSkuDetail/locales.d.ts +21 -0
- package/lib/components/kioskSkuDetail/locales.js +44 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/package.json +4 -4
- package/es/components/appointmentBooking/components/Services/index.d.ts +0 -4
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -4
- package/es/components/booking/components/actionButtons/index.d.ts +0 -31
- package/es/components/booking/components/footer/utils.d.ts +0 -67
- package/es/components/booking/components/voucher/index.d.ts +0 -3
- package/es/components/booking/info/service/Lists.d.ts +0 -3
- package/es/components/booking/info/service/serve.d.ts +0 -34
- package/es/components/booking/info/service2/utils.d.ts +0 -219
- package/es/components/booking/info2/service/addService/utils.d.ts +0 -106
- package/es/components/booking/info2/service/editService/index.d.ts +0 -8
- package/es/components/booking/info2/utilsByBooking.d.ts +0 -36
- package/es/components/booking/utils.d.ts +0 -182
- package/es/components/checkout/PaymentModal.d.ts +0 -39
- package/es/components/checkout/components/AdditionalModule/index.d.ts +0 -15
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +0 -26
- package/es/components/checkout/components/PaymentDetailModal/index.d.ts +0 -38
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +0 -85
- package/es/components/checkout/components/SearchAndClientModule/index.d.ts +0 -14
- package/es/components/checkout/hooks/useWalletPass.d.ts +0 -40
- package/es/components/checkout/plugin.d.ts +0 -2
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -32
- package/es/components/list/List.d.ts +0 -5
- package/es/components/list/hooks/useListState.d.ts +0 -45
- package/es/components/pay/toB/components/MX51/index.d.ts +0 -3
- package/es/components/pay/toB/types/index.d.ts +0 -72
- package/es/components/pisellSelectCustomerModal/RightPanel/serve.d.ts +0 -3
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.d.ts +0 -27
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -31
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -10
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -14
- package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -16
- package/es/components/ticketBooking/index.d.ts +0 -15
- package/es/components/ticketBooking/serve.d.ts +0 -288
- package/es/components/ticketBooking/utils/index.d.ts +0 -101
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +0 -4
- package/es/plus/productSelect/ProductCard/index.d.ts +0 -47
- package/es/plus/webPosLogin/WebPosLogin.d.ts +0 -11
- package/es/plus/webPosLogin/WebPosLoginCpt.d.ts +0 -9
- package/es/plus/webPosLogin/components/BrandPanel/index.d.ts +0 -9
- package/es/plus/webPosLogin/components/LoginPanel/index.d.ts +0 -21
- package/es/plus/webPosLogin/components/MediaDisplay/index.d.ts +0 -12
- package/es/plus/webPosLogin/components/MediaDisplay/type.d.ts +0 -54
- package/es/plus/webPosLogin/components/SelectDevice/index.d.ts +0 -28
- package/es/plus/webPosLogin/components/SelectStore/index.d.ts +0 -24
- package/es/plus/webPosLogin/components/UserFooter/index.d.ts +0 -28
- package/es/plus/webPosLogin/index.d.ts +0 -12
- package/es/plus/webPosLogin/locales.d.ts +0 -49
- package/es/plus/webPosLogin/service.d.ts +0 -44
- package/es/plus/webPosLogin/types.d.ts +0 -286
- package/es/pro/Login2.0/Login2.d.ts +0 -61
- package/lib/components/appointmentBooking/components/Services/index.d.ts +0 -4
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -4
- package/lib/components/booking/components/actionButtons/index.d.ts +0 -31
- package/lib/components/booking/components/footer/utils.d.ts +0 -67
- package/lib/components/booking/components/voucher/index.d.ts +0 -3
- package/lib/components/booking/info/service/Lists.d.ts +0 -3
- package/lib/components/booking/info/service/serve.d.ts +0 -34
- package/lib/components/booking/info/service2/utils.d.ts +0 -219
- package/lib/components/booking/info2/service/addService/utils.d.ts +0 -106
- package/lib/components/booking/info2/service/editService/index.d.ts +0 -8
- package/lib/components/booking/info2/utilsByBooking.d.ts +0 -36
- package/lib/components/booking/utils.d.ts +0 -182
- package/lib/components/checkout/PaymentModal.d.ts +0 -39
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +0 -15
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +0 -26
- package/lib/components/checkout/components/PaymentDetailModal/index.d.ts +0 -38
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +0 -85
- package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +0 -14
- package/lib/components/checkout/hooks/useWalletPass.d.ts +0 -40
- package/lib/components/checkout/plugin.d.ts +0 -2
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -32
- package/lib/components/list/List.d.ts +0 -5
- package/lib/components/list/hooks/useListState.d.ts +0 -45
- package/lib/components/pay/toB/components/MX51/index.d.ts +0 -3
- package/lib/components/pay/toB/types/index.d.ts +0 -72
- package/lib/components/pisellSelectCustomerModal/RightPanel/serve.d.ts +0 -3
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.d.ts +0 -27
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -31
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -10
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -14
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -16
- package/lib/components/ticketBooking/index.d.ts +0 -15
- package/lib/components/ticketBooking/serve.d.ts +0 -288
- package/lib/components/ticketBooking/utils/index.d.ts +0 -101
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +0 -4
- package/lib/plus/productSelect/ProductCard/index.d.ts +0 -47
- package/lib/plus/webPosLogin/WebPosLogin.d.ts +0 -11
- package/lib/plus/webPosLogin/WebPosLoginCpt.d.ts +0 -9
- package/lib/plus/webPosLogin/components/BrandPanel/index.d.ts +0 -9
- package/lib/plus/webPosLogin/components/LoginPanel/index.d.ts +0 -21
- package/lib/plus/webPosLogin/components/MediaDisplay/index.d.ts +0 -12
- package/lib/plus/webPosLogin/components/MediaDisplay/type.d.ts +0 -54
- package/lib/plus/webPosLogin/components/SelectDevice/index.d.ts +0 -28
- package/lib/plus/webPosLogin/components/SelectStore/index.d.ts +0 -24
- package/lib/plus/webPosLogin/components/UserFooter/index.d.ts +0 -28
- package/lib/plus/webPosLogin/index.d.ts +0 -12
- package/lib/plus/webPosLogin/locales.d.ts +0 -49
- package/lib/plus/webPosLogin/service.d.ts +0 -44
- package/lib/plus/webPosLogin/types.d.ts +0 -286
- package/lib/pro/Login2.0/Login2.d.ts +0 -61
|
@@ -36,18 +36,51 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_decimal = __toESM(require("decimal.js"));
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
38
|
var import_materials = require("@pisell/materials");
|
|
39
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
40
|
+
var import_utils = require("@pisell/utils");
|
|
39
41
|
var import_skuOptionsSelection = __toESM(require("../../plus/skuOptionsSelection"));
|
|
40
42
|
var import_pisellNumberSelector = __toESM(require("../../pro/pisellNumberSelector"));
|
|
41
43
|
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
42
44
|
var import_serve = require("../booking/info/service/serve");
|
|
45
|
+
var import_locales = __toESM(require("./locales"));
|
|
43
46
|
var import_index = require("./index.less");
|
|
47
|
+
var import_utils2 = require("../booking/utils");
|
|
44
48
|
function KioskSkuDetail(props) {
|
|
45
|
-
var _a, _b, _c, _d, _e;
|
|
46
|
-
const {
|
|
49
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
50
|
+
const { className, style, onBack, onAddToCart } = props;
|
|
51
|
+
const productIdFromUrl = (0, import_react.useMemo)(() => {
|
|
52
|
+
return getQueryFirstMatch({ keys: ["productId", "product_id", "id"] });
|
|
53
|
+
}, []);
|
|
54
|
+
const resolvedProductId = productIdFromUrl ?? props.productId;
|
|
55
|
+
const scheduleDate = (0, import_react.useMemo)(() => (0, import_dayjs.default)().format("YYYY-MM-DD"), []);
|
|
47
56
|
const context = (0, import_useEngineContext.default)();
|
|
48
|
-
const {
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
const { interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
58
|
+
import_utils.locales.init(import_locales.default, ((_c = (_b = context == null ? void 0 : context.engine) == null ? void 0 : _b.props) == null ? void 0 : _c.locale) || "en");
|
|
59
|
+
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
60
|
+
const { store, getData } = ((_d = context.appHelper) == null ? void 0 : _d.utils) || {};
|
|
61
|
+
const state = (_e = store == null ? void 0 : store.getState) == null ? void 0 : _e.call(store);
|
|
62
|
+
const symbol = ((_h = (_g = (_f = store == null ? void 0 : store.getState) == null ? void 0 : _f.call(store)) == null ? void 0 : _g.global) == null ? void 0 : _h.symbol) || "$";
|
|
63
|
+
(0, import_react.useEffect)(() => {
|
|
64
|
+
var _a2, _b2;
|
|
65
|
+
(_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
|
|
66
|
+
module: "tickets",
|
|
67
|
+
key: "page_load"
|
|
68
|
+
});
|
|
69
|
+
interaction.utils.mountFunction(
|
|
70
|
+
"tickets",
|
|
71
|
+
"restore_buy_wallet_pass",
|
|
72
|
+
(data) => {
|
|
73
|
+
console.log("重置状态", data);
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
interaction.utils.mountFunction(
|
|
77
|
+
"tickets",
|
|
78
|
+
"edit_buy_wallet_pass",
|
|
79
|
+
(data) => {
|
|
80
|
+
console.log("编辑状态", data);
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}, []);
|
|
51
84
|
const [isLoading, setIsLoading] = (0, import_react.useState)(false);
|
|
52
85
|
const [errorText, setErrorText] = (0, import_react.useState)(null);
|
|
53
86
|
const [productData, setProductData] = (0, import_react.useState)(null);
|
|
@@ -67,18 +100,20 @@ function KioskSkuDetail(props) {
|
|
|
67
100
|
(0, import_react.useEffect)(() => {
|
|
68
101
|
let isCancelled = false;
|
|
69
102
|
async function load() {
|
|
70
|
-
if (!
|
|
103
|
+
if (!resolvedProductId) return;
|
|
71
104
|
setIsLoading(true);
|
|
72
105
|
setErrorText(null);
|
|
73
106
|
try {
|
|
74
107
|
const open_deposit = (getData == null ? void 0 : getData("bookingv2_deposit")) || 0;
|
|
75
108
|
const params = { open_deposit };
|
|
76
|
-
|
|
77
|
-
const res = await (0, import_serve.getProductDetail)(String(
|
|
109
|
+
params.schedule_date = scheduleDate;
|
|
110
|
+
const res = await (0, import_serve.getProductDetail)(String(resolvedProductId), params);
|
|
78
111
|
const apiData = (res == null ? void 0 : res.data) || {};
|
|
79
112
|
if (isCancelled) return;
|
|
80
113
|
setProductData(apiData);
|
|
81
|
-
const normalizedProductId = Number(
|
|
114
|
+
const normalizedProductId = Number(
|
|
115
|
+
(apiData == null ? void 0 : apiData.product_id) || (apiData == null ? void 0 : apiData.id) || resolvedProductId || 0
|
|
116
|
+
);
|
|
82
117
|
const minNumUnit = Number((apiData == null ? void 0 : apiData.min_num_unit) || 1);
|
|
83
118
|
setQuantity(minNumUnit > 0 ? minNumUnit : 1);
|
|
84
119
|
const initialSkuValue = {
|
|
@@ -90,6 +125,7 @@ function KioskSkuDetail(props) {
|
|
|
90
125
|
setSkuValue(initialSkuValue);
|
|
91
126
|
setSkuDefaultValue(initialSkuValue);
|
|
92
127
|
} catch (error) {
|
|
128
|
+
console.error(error);
|
|
93
129
|
if (isCancelled) return;
|
|
94
130
|
setErrorText("Failed to load product detail");
|
|
95
131
|
} finally {
|
|
@@ -101,7 +137,7 @@ function KioskSkuDetail(props) {
|
|
|
101
137
|
return () => {
|
|
102
138
|
isCancelled = true;
|
|
103
139
|
};
|
|
104
|
-
}, [getData,
|
|
140
|
+
}, [getData, resolvedProductId, scheduleDate]);
|
|
105
141
|
const coverUrl = (0, import_react.useMemo)(() => {
|
|
106
142
|
return (productData == null ? void 0 : productData.cover) || (productData == null ? void 0 : productData.image) || "";
|
|
107
143
|
}, [productData]);
|
|
@@ -139,68 +175,145 @@ function KioskSkuDetail(props) {
|
|
|
139
175
|
const deQty = new import_decimal.default(quantity || 0);
|
|
140
176
|
return deUnit.mul(deQty).toNumber();
|
|
141
177
|
}, [quantity, unitPrice]);
|
|
178
|
+
const itemTotalText = (0, import_react.useMemo)(() => {
|
|
179
|
+
const deTotal = new import_decimal.default(itemTotal || 0);
|
|
180
|
+
const priceSign = deTotal.toNumber() < 0 ? "-" : "";
|
|
181
|
+
return `${priceSign}${symbol}${deTotal.abs().toNumber().toFixed(2)}`;
|
|
182
|
+
}, [itemTotal, symbol]);
|
|
142
183
|
const handleAddToCart = () => {
|
|
143
184
|
if (!productData) return;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
185
|
+
const productBundle = [];
|
|
186
|
+
skuValue.bundle.forEach((item) => {
|
|
187
|
+
if (!item.num || item.num < 1) return;
|
|
188
|
+
let targetBundleData;
|
|
189
|
+
let bundle_group_id;
|
|
190
|
+
for (let i = 0; i < productData.bundle_group.length; i++) {
|
|
191
|
+
const { id, bundle_item = [] } = productData.bundle_group[i];
|
|
192
|
+
for (let j = 0; j < bundle_item.length; j++) {
|
|
193
|
+
if (item.id === bundle_item[j].bundle_product_id) {
|
|
194
|
+
bundle_group_id = id;
|
|
195
|
+
targetBundleData = bundle_item[j];
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
productBundle.push({
|
|
201
|
+
bundle_group_id,
|
|
202
|
+
bundle_id: targetBundleData.id,
|
|
203
|
+
bundle_product_id: item.id,
|
|
204
|
+
bundle_variant_id: targetBundleData.bundle_variant_id,
|
|
205
|
+
num: item.num,
|
|
206
|
+
extension_id: targetBundleData.extension_id,
|
|
207
|
+
extension_type: targetBundleData.extension_type
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
productData.option_group = [];
|
|
211
|
+
productData.variant_group = [];
|
|
212
|
+
const obj = {
|
|
213
|
+
productDetail: productData,
|
|
147
214
|
quantity,
|
|
148
|
-
unitPrice,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
215
|
+
pricePerUnit: unitPrice,
|
|
216
|
+
bundlePrice: productData.price,
|
|
217
|
+
productBundle
|
|
218
|
+
};
|
|
219
|
+
interaction.utils.postMessageToApp({
|
|
220
|
+
module: "tickets",
|
|
221
|
+
key: "buy_wallet_pass",
|
|
222
|
+
data: {
|
|
223
|
+
// 把洗好的数据放这里
|
|
224
|
+
productData: [obj]
|
|
225
|
+
}
|
|
152
226
|
});
|
|
153
227
|
};
|
|
154
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
155
|
-
"
|
|
156
|
-
{
|
|
157
|
-
className: "pisell-kiosk-sku-detail__hero-img",
|
|
158
|
-
src: coverUrl,
|
|
159
|
-
alt: titleText || "product"
|
|
160
|
-
}
|
|
161
|
-
) : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__hero-placeholder" })), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__header" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__title" }, titleText || (isLoading ? "Loading…" : "")), !!descriptionText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__desc" }, descriptionText), !!priceRangeText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__price-range" }, priceRangeText), !!errorText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__error" }, errorText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__options-card" }, productData ? /* @__PURE__ */ import_react.default.createElement(
|
|
162
|
-
import_skuOptionsSelection.default,
|
|
163
|
-
{
|
|
164
|
-
dataSource: productData,
|
|
165
|
-
value: skuDefaultValue,
|
|
166
|
-
onChange: (v) => {
|
|
167
|
-
setSkuValue(v);
|
|
168
|
-
},
|
|
169
|
-
customScrollParent: ".pisell-kiosk-sku-detail"
|
|
170
|
-
}
|
|
171
|
-
) : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__options-loading" }, isLoading ? "Loading options…" : ""))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__footer" }, /* @__PURE__ */ import_react.default.createElement(
|
|
172
|
-
import_materials.Button,
|
|
228
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
229
|
+
"div",
|
|
173
230
|
{
|
|
174
|
-
className: "pisell-kiosk-sku-
|
|
175
|
-
|
|
176
|
-
onClick: onBack
|
|
231
|
+
className: (0, import_classnames.default)("pisell-kiosk-sku-detail", className),
|
|
232
|
+
style
|
|
177
233
|
},
|
|
178
|
-
"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
234
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__hero" }, coverUrl ? /* @__PURE__ */ import_react.default.createElement(
|
|
235
|
+
"img",
|
|
236
|
+
{
|
|
237
|
+
className: "pisell-kiosk-sku-detail__hero-img",
|
|
238
|
+
src: coverUrl,
|
|
239
|
+
alt: titleText || "product"
|
|
240
|
+
}
|
|
241
|
+
) : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__hero-placeholder" })), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__header" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__title" }, titleText || (isLoading ? "Loading…" : "")), !!descriptionText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__desc" }, /* @__PURE__ */ import_react.default.createElement(
|
|
242
|
+
"div",
|
|
243
|
+
{
|
|
244
|
+
dangerouslySetInnerHTML: {
|
|
245
|
+
__html: descriptionText
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
)), !!priceRangeText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__price-range" }, priceRangeText), !!errorText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__error" }, errorText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__options-card" }, productData ? /* @__PURE__ */ import_react.default.createElement(
|
|
249
|
+
import_skuOptionsSelection.default,
|
|
250
|
+
{
|
|
251
|
+
dataSource: productData,
|
|
252
|
+
value: skuDefaultValue,
|
|
253
|
+
onChange: (v) => {
|
|
254
|
+
setSkuValue(v);
|
|
255
|
+
},
|
|
256
|
+
customScrollParent: ".pisell-kiosk-sku-detail"
|
|
257
|
+
}
|
|
258
|
+
) : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__options-loading" }, isLoading ? import_utils.locales.getText(
|
|
259
|
+
"pisell2.text.kiosk.sku.detail.loading.options"
|
|
260
|
+
) : ""))),
|
|
261
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__footer" }, /* @__PURE__ */ import_react.default.createElement(
|
|
262
|
+
import_materials.Button,
|
|
263
|
+
{
|
|
264
|
+
className: "pisell-kiosk-sku-detail__back-btn",
|
|
265
|
+
size: "large",
|
|
266
|
+
onClick: onBack
|
|
187
267
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
268
|
+
import_utils.locales.getText("pisell2.text.kiosk.sku.detail.btn.back")
|
|
269
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__footer-center" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__item-total" }, import_utils.locales.getText("pisell2.text.kiosk.sku.detail.item.total"), ":", " ", itemTotalText), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__qty" }, /* @__PURE__ */ import_react.default.createElement(
|
|
270
|
+
import_pisellNumberSelector.default,
|
|
271
|
+
{
|
|
272
|
+
value: quantity,
|
|
273
|
+
width: "140px",
|
|
274
|
+
onChange: (v) => {
|
|
275
|
+
if (!v) return;
|
|
276
|
+
setQuantity(v);
|
|
277
|
+
},
|
|
278
|
+
min: 1,
|
|
279
|
+
max: 99999,
|
|
280
|
+
step: 1,
|
|
281
|
+
size: "large",
|
|
282
|
+
enablePriceAdjust: false
|
|
283
|
+
}
|
|
284
|
+
))), /* @__PURE__ */ import_react.default.createElement(
|
|
285
|
+
import_materials.Button,
|
|
286
|
+
{
|
|
287
|
+
type: "primary",
|
|
288
|
+
className: "pisell-kiosk-sku-detail__add-btn",
|
|
289
|
+
size: "large",
|
|
290
|
+
onClick: handleAddToCart,
|
|
291
|
+
disabled: !productData || isLoading
|
|
292
|
+
},
|
|
293
|
+
import_utils.locales.getText("pisell2.text.kiosk.sku.detail.btn.add.to.cart")
|
|
294
|
+
))
|
|
295
|
+
);
|
|
205
296
|
}
|
|
206
297
|
var kioskSkuDetail_default = KioskSkuDetail;
|
|
298
|
+
function getQueryFirstMatch(params) {
|
|
299
|
+
var _a;
|
|
300
|
+
if (typeof window === "undefined") return null;
|
|
301
|
+
if (!((_a = params == null ? void 0 : params.keys) == null ? void 0 : _a.length)) return null;
|
|
302
|
+
const keys = params.keys;
|
|
303
|
+
const tryRead = (raw) => {
|
|
304
|
+
if (!raw) return null;
|
|
305
|
+
const normalized = raw.startsWith("?") ? raw.slice(1) : raw;
|
|
306
|
+
const searchParams = new URLSearchParams(normalized);
|
|
307
|
+
for (const key of keys) {
|
|
308
|
+
const value = searchParams.get(key);
|
|
309
|
+
if (value) return value;
|
|
310
|
+
}
|
|
311
|
+
return null;
|
|
312
|
+
};
|
|
313
|
+
const fromSearch = tryRead(window.location.search || "");
|
|
314
|
+
if (fromSearch) return fromSearch;
|
|
315
|
+
const hash = window.location.hash || "";
|
|
316
|
+
const queryIndex = hash.indexOf("?");
|
|
317
|
+
if (queryIndex === -1) return null;
|
|
318
|
+
return tryRead(hash.slice(queryIndex + 1));
|
|
319
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell2.text.kiosk.sku.detail.btn.back': string;
|
|
4
|
+
'pisell2.text.kiosk.sku.detail.item.total': string;
|
|
5
|
+
'pisell2.text.kiosk.sku.detail.btn.add.to.cart': string;
|
|
6
|
+
'pisell2.text.kiosk.sku.detail.loading.options': string;
|
|
7
|
+
};
|
|
8
|
+
'zh-CN': {
|
|
9
|
+
'pisell2.text.kiosk.sku.detail.btn.back': string;
|
|
10
|
+
'pisell2.text.kiosk.sku.detail.item.total': string;
|
|
11
|
+
'pisell2.text.kiosk.sku.detail.btn.add.to.cart': string;
|
|
12
|
+
'pisell2.text.kiosk.sku.detail.loading.options': string;
|
|
13
|
+
};
|
|
14
|
+
'zh-TW': {
|
|
15
|
+
'pisell2.text.kiosk.sku.detail.btn.back': string;
|
|
16
|
+
'pisell2.text.kiosk.sku.detail.item.total': string;
|
|
17
|
+
'pisell2.text.kiosk.sku.detail.btn.add.to.cart': string;
|
|
18
|
+
'pisell2.text.kiosk.sku.detail.loading.options': string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/kioskSkuDetail/locales.ts
|
|
20
|
+
var locales_exports = {};
|
|
21
|
+
__export(locales_exports, {
|
|
22
|
+
default: () => locales_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(locales_exports);
|
|
25
|
+
var locales_default = {
|
|
26
|
+
en: {
|
|
27
|
+
"pisell2.text.kiosk.sku.detail.btn.back": "Back",
|
|
28
|
+
"pisell2.text.kiosk.sku.detail.item.total": "Item total",
|
|
29
|
+
"pisell2.text.kiosk.sku.detail.btn.add.to.cart": "Add to cart",
|
|
30
|
+
"pisell2.text.kiosk.sku.detail.loading.options": "Loading options…"
|
|
31
|
+
},
|
|
32
|
+
"zh-CN": {
|
|
33
|
+
"pisell2.text.kiosk.sku.detail.btn.back": "返回",
|
|
34
|
+
"pisell2.text.kiosk.sku.detail.item.total": "小计",
|
|
35
|
+
"pisell2.text.kiosk.sku.detail.btn.add.to.cart": "加入购物车",
|
|
36
|
+
"pisell2.text.kiosk.sku.detail.loading.options": "正在加载选项…"
|
|
37
|
+
},
|
|
38
|
+
"zh-TW": {
|
|
39
|
+
"pisell2.text.kiosk.sku.detail.btn.back": "返回",
|
|
40
|
+
"pisell2.text.kiosk.sku.detail.item.total": "小計",
|
|
41
|
+
"pisell2.text.kiosk.sku.detail.btn.add.to.cart": "加入購物車",
|
|
42
|
+
"pisell2.text.kiosk.sku.detail.loading.options": "正在載入選項…"
|
|
43
|
+
}
|
|
44
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.31",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"react-infinite-scroll-component": "^6.1.0",
|
|
77
77
|
"react-resizable": "^3.0.5",
|
|
78
78
|
"styled-components": "^6.0.0-rc.3",
|
|
79
|
-
"@pisell/
|
|
80
|
-
"@pisell/materials": "6.8.6",
|
|
79
|
+
"@pisell/date-picker": "3.0.7",
|
|
81
80
|
"@pisell/utils": "3.0.2",
|
|
82
|
-
"@pisell/
|
|
81
|
+
"@pisell/icon": "0.0.11",
|
|
82
|
+
"@pisell/materials": "6.8.7"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"react": "^18.0.0",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
interface ActionButtonsProps {
|
|
4
|
-
/** booking 状态对象,包含 service、addons 等数据 */
|
|
5
|
-
state: {
|
|
6
|
-
service?: {
|
|
7
|
-
value?: any[];
|
|
8
|
-
};
|
|
9
|
-
addons?: {
|
|
10
|
-
value?: any[];
|
|
11
|
-
};
|
|
12
|
-
disabledEdit?: boolean;
|
|
13
|
-
channelDisabledEdit?: boolean;
|
|
14
|
-
shop_discount?: string;
|
|
15
|
-
bookingDetail?: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
};
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
};
|
|
20
|
-
/** dispatch 函数,用于触发状态更新 */
|
|
21
|
-
dispatch: (action: {
|
|
22
|
-
type: string;
|
|
23
|
-
payload?: any;
|
|
24
|
-
}) => void;
|
|
25
|
-
/** 是否禁用所有按钮 */
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/** 数据源,传递给 VoucherCard */
|
|
28
|
-
source?: any;
|
|
29
|
-
}
|
|
30
|
-
declare const ActionButtons: React.FC<ActionButtonsProps>;
|
|
31
|
-
export default ActionButtons;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @title: 套餐单规格信息
|
|
3
|
-
* @description:
|
|
4
|
-
* @param {any} option
|
|
5
|
-
* @return {*}
|
|
6
|
-
* @Author: zhiwei.Wang
|
|
7
|
-
* @Date: 2024-02-19 09:26
|
|
8
|
-
*/
|
|
9
|
-
export declare const formatProductOption: (option: any) => any;
|
|
10
|
-
/**
|
|
11
|
-
* @title: 套餐信息
|
|
12
|
-
* @description:
|
|
13
|
-
* @param {any} bundle
|
|
14
|
-
* @return {*}
|
|
15
|
-
* @Author: zhiwei.Wang
|
|
16
|
-
* @Date: 2024-02-19 09:26
|
|
17
|
-
*/
|
|
18
|
-
export declare const formatProductBundle: (bundle: any) => any;
|
|
19
|
-
/**
|
|
20
|
-
* 获取子商品折扣信息
|
|
21
|
-
* @param item
|
|
22
|
-
*/
|
|
23
|
-
export declare const getBundleDiscountList: (bundle: any[]) => any[];
|
|
24
|
-
export interface ResourceItem {
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @title: 传入资源,如果有子资源,会根据组合资源的 capacity 计算修改子资源的 capacity
|
|
29
|
-
* @description:
|
|
30
|
-
* @param {object} resource
|
|
31
|
-
* @return {*}
|
|
32
|
-
* @Author: jinglin.tan
|
|
33
|
-
*/
|
|
34
|
-
export declare const checkSubResourcesCapacity: (resource: ResourceItem) => void;
|
|
35
|
-
export declare const checkResourcesFormat: (resources: any[], service: any, isChild?: boolean) => any[];
|
|
36
|
-
/**
|
|
37
|
-
* @title: 格式化商品单价
|
|
38
|
-
* @description:
|
|
39
|
-
* @param {any} item
|
|
40
|
-
* @return {*}
|
|
41
|
-
* @Author: WangHan
|
|
42
|
-
* @Date: 2024-12-23 12:05
|
|
43
|
-
*/
|
|
44
|
-
export declare const formatProductPrice: (item: any) => number;
|
|
45
|
-
/**
|
|
46
|
-
* checkout2.0: 单个数量商品总价(原价),包含所有套餐子商品金额、报价单等等
|
|
47
|
-
* @param item
|
|
48
|
-
* @returns
|
|
49
|
-
*/
|
|
50
|
-
export declare const formatOriginalPrice: (item: any) => number;
|
|
51
|
-
/**
|
|
52
|
-
* checkout2.0: 商品维度折扣后价格, original_price - 商品折扣金额(商品手动折扣等等)
|
|
53
|
-
* @param item
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
export declare const formatSellingPrice: (item: any) => number;
|
|
57
|
-
export declare const getSourceProductPrice: (item: any) => number;
|
|
58
|
-
export declare const getMainProductSellingPrice: (item: any) => number | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* @title: 是否包含跨日预约商品
|
|
61
|
-
* @description:
|
|
62
|
-
* @param {any} data
|
|
63
|
-
* @return {*}
|
|
64
|
-
*/
|
|
65
|
-
export declare const getHasMultiDayProduct: (data: any) => any;
|
|
66
|
-
export declare const formatValues: (state: any) => any;
|
|
67
|
-
export declare const checkHolderIsError: (state: any) => any;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare const getProductDetail: (id: string, params: any) => Promise<any>;
|
|
2
|
-
/**
|
|
3
|
-
* @title: 跨日预约获取预约商品报价单
|
|
4
|
-
* @description:
|
|
5
|
-
* @param {string} id
|
|
6
|
-
* @param {any} params
|
|
7
|
-
* @return {*}
|
|
8
|
-
* @Author: WangHan
|
|
9
|
-
* @Date: 2024-12-23 17:06
|
|
10
|
-
*/
|
|
11
|
-
export declare const postMultiDay: (id: string, params: any) => Promise<any>;
|
|
12
|
-
/**
|
|
13
|
-
* 批量查询指定商品的最新价格
|
|
14
|
-
* @param params
|
|
15
|
-
*/
|
|
16
|
-
export declare const getProductPrice: (params: {
|
|
17
|
-
ids: number[];
|
|
18
|
-
customer_id: number;
|
|
19
|
-
schedule_date: string;
|
|
20
|
-
}) => Promise<any>;
|
|
21
|
-
declare type MultiDayProductPriceParams = {
|
|
22
|
-
customer_id: number;
|
|
23
|
-
data: {
|
|
24
|
-
product_id: number;
|
|
25
|
-
schedule_date: string;
|
|
26
|
-
}[];
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* 获取普通商品和跨日预约的价格
|
|
30
|
-
* @param params
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
export declare const getNormalAndMultiDayProductPrice: (params: MultiDayProductPriceParams) => Promise<any>;
|
|
34
|
-
export {};
|