@pisell/private-materials 6.6.59 → 6.6.60
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.js +9 -9
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/components/footer/amount.js +4 -3
- package/es/components/booking/components/footer/utils.js +10 -3
- package/es/components/booking/components/voucher/index.js +1 -1
- package/es/components/booking/dashboard/index.d.ts +0 -5
- package/es/components/booking/dashboard/index.js +6 -9
- package/es/components/booking/info/service2/Group/utils.js +1 -30
- package/es/components/booking/info2/service/editService/index.js +49 -6
- package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/es/components/booking/info2/service/editService/utils.js +16 -0
- package/es/components/booking/payments/index.js +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +15 -23
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
- package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -2
- package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +2 -5
- package/es/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -2
- package/es/components/ticketBooking/components/bookingDataPanel/index.js +2 -5
- package/es/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +1 -2
- package/es/components/ticketBooking/components/ticketBooking/index.js +37 -156
- package/es/components/ticketBooking/index.js +1 -7
- package/es/pro/Login2.0/components/phoneValidation.js +58 -65
- package/lib/components/booking/components/footer/amount.js +3 -3
- package/lib/components/booking/components/footer/utils.js +12 -5
- package/lib/components/booking/components/voucher/index.js +1 -1
- package/lib/components/booking/dashboard/index.d.ts +0 -5
- package/lib/components/booking/dashboard/index.js +5 -6
- package/lib/components/booking/info/service2/Group/utils.js +3 -42
- package/lib/components/booking/info2/service/editService/index.js +39 -5
- package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/utils.js +16 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +16 -23
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -2
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +2 -3
- package/lib/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -2
- package/lib/components/ticketBooking/components/bookingDataPanel/index.js +3 -10
- package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +1 -10
- package/lib/components/ticketBooking/components/ticketBooking/index.js +14 -114
- package/lib/components/ticketBooking/index.js +1 -11
- package/lib/pro/Login2.0/components/phoneValidation.js +2 -4
- package/package.json +4 -4
|
@@ -111,13 +111,14 @@ var formatProductBundle = (bundle) => {
|
|
|
111
111
|
} catch (error) {
|
|
112
112
|
}
|
|
113
113
|
return bundle.map((d) => {
|
|
114
|
+
var _a;
|
|
114
115
|
const option = formatProductOption(d.option);
|
|
115
116
|
const option_price = option.reduce((temp, item) => {
|
|
116
117
|
return temp + Number(item.num) * item.custom_add_price;
|
|
117
118
|
}, 0);
|
|
118
119
|
const product_discount_difference = ((d == null ? void 0 : d.discount_list) || []).reduce((pre, cur) => {
|
|
119
|
-
var
|
|
120
|
-
return pre + (((
|
|
120
|
+
var _a2;
|
|
121
|
+
return pre + (((_a2 = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a2.product_discount_difference) || 0);
|
|
121
122
|
}, 0);
|
|
122
123
|
return {
|
|
123
124
|
"is_charge_tax": d.is_charge_tax,
|
|
@@ -138,7 +139,7 @@ var formatProductBundle = (bundle) => {
|
|
|
138
139
|
"bundle_selling_price": Math.abs(d == null ? void 0 : d.price),
|
|
139
140
|
// "bundle_sum_price": d?.original_price || d?.original_total,
|
|
140
141
|
"metadata": {
|
|
141
|
-
custom_product_bundle_map_id: d._id,
|
|
142
|
+
custom_product_bundle_map_id: ((_a = d == null ? void 0 : d.metadata) == null ? void 0 : _a.custom_product_bundle_map_id) || d._id,
|
|
142
143
|
// 子商品单数量附加费
|
|
143
144
|
"surcharge_fee": d.surcharge_fee,
|
|
144
145
|
// 可选,附加费均摊舍入金额
|
|
@@ -370,7 +371,7 @@ var getMainProductSellingPrice = (item) => {
|
|
|
370
371
|
}
|
|
371
372
|
return new import_decimal.default((_f = item._extend) == null ? void 0 : _f.main_product_selling_price).add(optionPrice).toNumber();
|
|
372
373
|
};
|
|
373
|
-
var formatProducts = (item, quantity) => {
|
|
374
|
+
var formatProducts = (item, quantity, options) => {
|
|
374
375
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
375
376
|
const total = Number(item._extend.total);
|
|
376
377
|
const origin_total = Number(item._extend.origin_total);
|
|
@@ -384,6 +385,9 @@ var formatProducts = (item, quantity) => {
|
|
|
384
385
|
...d.metadata,
|
|
385
386
|
unique_identification_number: `${item._extend.unique_identification_number}_${d.discount.resource_id}`
|
|
386
387
|
};
|
|
388
|
+
if ((options == null ? void 0 : options.isServiceEdit) && (options == null ? void 0 : options.isMultiDay)) {
|
|
389
|
+
delete d.id;
|
|
390
|
+
}
|
|
387
391
|
});
|
|
388
392
|
const notManualDiscount = discount_list.filter(
|
|
389
393
|
(item2) => item2.type !== "product"
|
|
@@ -524,7 +528,10 @@ var formatBookings = (data, values) => {
|
|
|
524
528
|
item._extend.unique_identification_number = unique_identification_number;
|
|
525
529
|
}
|
|
526
530
|
const booking = {
|
|
527
|
-
product: formatProducts(item
|
|
531
|
+
product: formatProducts(item, void 0, {
|
|
532
|
+
isServiceEdit: data.service.edit,
|
|
533
|
+
isMultiDay
|
|
534
|
+
}),
|
|
528
535
|
relation_products: formatRelationDetails(item._extend.relation_details),
|
|
529
536
|
id: item.booking_id || 0,
|
|
530
537
|
relation_id: item._extend.relation_id || 0,
|
|
@@ -111,7 +111,7 @@ var VoucherCard = (props) => {
|
|
|
111
111
|
const val = (_a2 = state.service.value || []) == null ? void 0 : _a2.map((value) => {
|
|
112
112
|
var _a3, _b2, _c2;
|
|
113
113
|
return {
|
|
114
|
-
booking_id: value.booking_id,
|
|
114
|
+
// booking_id: value.booking_id,
|
|
115
115
|
id: value.id,
|
|
116
116
|
price: value.price,
|
|
117
117
|
total: (_a3 = value == null ? void 0 : value._extend) == null ? void 0 : _a3.total,
|
|
@@ -5,11 +5,6 @@ export interface BookingDashboardProps extends React.HTMLAttributes<HTMLDivEleme
|
|
|
5
5
|
valueColor?: string;
|
|
6
6
|
otherParams?: Record<string, any>;
|
|
7
7
|
refreshKey?: string;
|
|
8
|
-
/**
|
|
9
|
-
* 组件是否可见。为 false 时会暂停内部的定时刷新 interval,避免后台无意义地拉数据。
|
|
10
|
-
* 默认 true,保持原有行为向后兼容。
|
|
11
|
-
*/
|
|
12
|
-
isVisible?: boolean;
|
|
13
8
|
onDataChange?: (data: {
|
|
14
9
|
groupsOnSiteNow: string | number;
|
|
15
10
|
peopleOnSiteNow: string | number;
|
|
@@ -65,7 +65,6 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
|
|
|
65
65
|
labelColor,
|
|
66
66
|
valueColor,
|
|
67
67
|
refreshKey,
|
|
68
|
-
isVisible = true,
|
|
69
68
|
onDataChange,
|
|
70
69
|
...others
|
|
71
70
|
} = props;
|
|
@@ -145,7 +144,7 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
|
|
|
145
144
|
calcBookingDataCount();
|
|
146
145
|
};
|
|
147
146
|
const calcBookingDataCount = () => {
|
|
148
|
-
var _a2, _b2, _c, _d, _e, _f
|
|
147
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
149
148
|
let groupsOnSiteNow = statisticData.groups_today_num || 0;
|
|
150
149
|
let peopleOnSiteNow = statisticData.people_on_site_now_num || (hasTurnstileApp ? 0 : "-");
|
|
151
150
|
let totalVisitorsToday = ((_a2 = statisticData.total_visitors_today) == null ? void 0 : _a2.num) || 0;
|
|
@@ -155,8 +154,8 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
|
|
|
155
154
|
let upcoming = ((_e = statisticData.upcoming_visitors) == null ? void 0 : _e.num) || 0;
|
|
156
155
|
let upcomingChildren = ((_f = statisticData.upcoming_visitors) == null ? void 0 : _f.statistics) || [];
|
|
157
156
|
let overdue = statisticData.overdue_visitors_num || (hasTurnstileApp ? 0 : "-");
|
|
158
|
-
let completed =
|
|
159
|
-
let completedChildren =
|
|
157
|
+
let completed = statisticData.completed_visitors.num || 0;
|
|
158
|
+
let completedChildren = statisticData.completed_visitors.statistics || [];
|
|
160
159
|
let departed = statisticData.departed_visitors_num || (hasTurnstileApp ? 0 : "-");
|
|
161
160
|
onDataChange == null ? void 0 : onDataChange(
|
|
162
161
|
{
|
|
@@ -237,7 +236,6 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
|
|
|
237
236
|
]);
|
|
238
237
|
};
|
|
239
238
|
(0, import_react.useEffect)(() => {
|
|
240
|
-
if (!isVisible) return;
|
|
241
239
|
getData();
|
|
242
240
|
const timer = setInterval(() => {
|
|
243
241
|
getData();
|
|
@@ -245,9 +243,10 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
|
|
|
245
243
|
return () => {
|
|
246
244
|
clearInterval(timer);
|
|
247
245
|
};
|
|
248
|
-
}, [JSON.stringify(otherParams), refreshKey
|
|
246
|
+
}, [JSON.stringify(otherParams), refreshKey]);
|
|
249
247
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
250
248
|
refresh: () => {
|
|
249
|
+
debugger;
|
|
251
250
|
getData();
|
|
252
251
|
}
|
|
253
252
|
}));
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
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
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// src/components/booking/info/service2/Group/utils.ts
|
|
@@ -41,9 +31,7 @@ module.exports = __toCommonJS(utils_exports);
|
|
|
41
31
|
var import_utils = require("@pisell/utils");
|
|
42
32
|
var import_utils2 = require("../../../utils");
|
|
43
33
|
var import_distributeDiscount = require("../../service/serviceManager/distributeDiscount");
|
|
44
|
-
var import_utils3 = require("
|
|
45
|
-
var import_utils4 = require("../../../../ticketBooking/utils");
|
|
46
|
-
var import_decimal = __toESM(require("decimal.js"));
|
|
34
|
+
var import_utils3 = require("../../../../ticketBooking/utils");
|
|
47
35
|
var getGroupTotalPrice = (items) => {
|
|
48
36
|
return items.reduce((prev, next) => {
|
|
49
37
|
prev.duration += next._extend.duration;
|
|
@@ -112,7 +100,7 @@ var createBookingItemsByGroup = (item, isBatchEdit) => {
|
|
|
112
100
|
cacheItem._extend.total = totalPrice;
|
|
113
101
|
cacheItem._extend.origin_total = origin_total ?? totalPrice;
|
|
114
102
|
cacheItem._extend.items = void 0;
|
|
115
|
-
cacheItem._serviceKey = (0,
|
|
103
|
+
cacheItem._serviceKey = (0, import_utils3.genServiceKey)(cacheItem);
|
|
116
104
|
bookings.push(cacheItem);
|
|
117
105
|
}
|
|
118
106
|
if (isBatchEdit) {
|
|
@@ -120,34 +108,7 @@ var createBookingItemsByGroup = (item, isBatchEdit) => {
|
|
|
120
108
|
const groupOriginTotalPrice = item._extend.origin_total;
|
|
121
109
|
const discountAmount = (groupOriginTotalPrice - groupTotalPrice) * -1;
|
|
122
110
|
if (discountAmount !== 0) {
|
|
123
|
-
|
|
124
|
-
bookings = (0, import_distributeDiscount.distributeDiscountOrIncrease)(bookings, discountAmount, groupOriginTotalPrice);
|
|
125
|
-
bookings = bookings.map((booking) => {
|
|
126
|
-
var _a2, _b2;
|
|
127
|
-
return (0, import_utils3.setProductPrice)(booking, {
|
|
128
|
-
newTotal: (_a2 = booking == null ? void 0 : booking._extend) == null ? void 0 : _a2.total,
|
|
129
|
-
origin_total: (_b2 = booking == null ? void 0 : booking._extend) == null ? void 0 : _b2.origin_total
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
} else {
|
|
133
|
-
const count = bookings.length;
|
|
134
|
-
const avgTotal = new import_decimal.default(groupTotalPrice).div(count).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
|
|
135
|
-
let assignedSum = new import_decimal.default(0);
|
|
136
|
-
bookings = bookings.map((booking, i) => {
|
|
137
|
-
const newTotal = i === count - 1 ? new import_decimal.default(groupTotalPrice).sub(assignedSum).toNumber() : avgTotal.toNumber();
|
|
138
|
-
if (i !== count - 1) {
|
|
139
|
-
assignedSum = assignedSum.add(avgTotal);
|
|
140
|
-
}
|
|
141
|
-
return {
|
|
142
|
-
...booking,
|
|
143
|
-
_extend: {
|
|
144
|
-
...booking._extend,
|
|
145
|
-
total: newTotal,
|
|
146
|
-
price: newTotal
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
});
|
|
150
|
-
}
|
|
111
|
+
bookings = (0, import_distributeDiscount.distributeDiscountOrIncrease)(bookings, discountAmount, groupOriginTotalPrice);
|
|
151
112
|
}
|
|
152
113
|
}
|
|
153
114
|
console.log("bookings", bookings);
|
|
@@ -64,6 +64,7 @@ var import_utils9 = require("../../../info/service2/Group/utils");
|
|
|
64
64
|
var import_useShopDiscountModule = require("../../../../ticketBooking/hooks/pisellos/useShopDiscountModule");
|
|
65
65
|
var import_DiscountChangeModal = __toESM(require("./DiscountChangeModal"));
|
|
66
66
|
var import_decimal = __toESM(require("decimal.js"));
|
|
67
|
+
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
67
68
|
var submitLock = false;
|
|
68
69
|
var Info = (_, ref) => {
|
|
69
70
|
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;
|
|
@@ -79,6 +80,7 @@ var Info = (_, ref) => {
|
|
|
79
80
|
const useEndDate = import_antd.Form.useWatch("end_date", form);
|
|
80
81
|
const shopDiscount = (0, import_useShopDiscountModule.useShopDiscountModule)();
|
|
81
82
|
const [discountChangeModalOpen, setDiscountChangeModalOpen] = (0, import_react.useState)(false);
|
|
83
|
+
const context = (0, import_useEngineContext.default)();
|
|
82
84
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
83
85
|
const resourcesRef = (0, import_react.useRef)(null);
|
|
84
86
|
const isChangeTotal = (0, import_react.useRef)(false);
|
|
@@ -500,17 +502,23 @@ var Info = (_, ref) => {
|
|
|
500
502
|
return ((_d2 = (_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.other) == null ? void 0 : _d2.bundle) || [];
|
|
501
503
|
}, [(_o = (_n = (_m = (_l = state.service) == null ? void 0 : _l.cacheItem) == null ? void 0 : _m._extend) == null ? void 0 : _n.other) == null ? void 0 : _o.bundle]);
|
|
502
504
|
const handleEdit = (0, import_ahooks.useMemoizedFn)((e) => {
|
|
503
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
505
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
504
506
|
const item = state.service.cacheItem;
|
|
505
507
|
let values = form.getFieldsValue();
|
|
506
508
|
const isSession = (0, import_utils6.isSessionProduct)(item);
|
|
507
509
|
const sessionValue = {};
|
|
510
|
+
let oldSession = {};
|
|
508
511
|
if (isSession) {
|
|
509
512
|
sessionValue.startEndTime = {
|
|
510
513
|
startDate: (_a2 = item == null ? void 0 : item._extend) == null ? void 0 : _a2.start_date,
|
|
511
514
|
endDate: (_b2 = item == null ? void 0 : item._extend) == null ? void 0 : _b2.end_date,
|
|
512
515
|
duration: (_c2 = item == null ? void 0 : item._extend) == null ? void 0 : _c2.duration
|
|
513
516
|
};
|
|
517
|
+
oldSession = {
|
|
518
|
+
start_date: (0, import_dayjs.default)((_d2 = item == null ? void 0 : item._extend) == null ? void 0 : _d2.start_date).format("YYYY-MM-DD"),
|
|
519
|
+
end_date: (0, import_dayjs.default)((_e2 = item == null ? void 0 : item._extend) == null ? void 0 : _e2.end_date).format("YYYY-MM-DD"),
|
|
520
|
+
duration: (_f2 = item == null ? void 0 : item._extend) == null ? void 0 : _f2.duration
|
|
521
|
+
};
|
|
514
522
|
}
|
|
515
523
|
state.action({
|
|
516
524
|
type: "pisell1.handleOpenProductModal",
|
|
@@ -525,15 +533,16 @@ var Info = (_, ref) => {
|
|
|
525
533
|
number: (0, import_utils3.getIsShowNumber)(item, state)
|
|
526
534
|
},
|
|
527
535
|
isOS: isSession,
|
|
528
|
-
customer_id: (
|
|
536
|
+
customer_id: (_h2 = (_g2 = state.client) == null ? void 0 : _g2.value) == null ? void 0 : _h2.id,
|
|
529
537
|
value: {
|
|
530
538
|
...item._extend.other,
|
|
539
|
+
bundle: (0, import_utils8.mergeBundles)(item._extend.other),
|
|
531
540
|
...sessionValue,
|
|
532
541
|
quantity: values.quantity || item._extend.quantity
|
|
533
542
|
}
|
|
534
543
|
},
|
|
535
544
|
callback: (e2, extension_type, detail) => {
|
|
536
|
-
var _a3, _b3, _c3, _d3, _e3;
|
|
545
|
+
var _a3, _b3, _c3, _d3, _e3, _f3, _g3, _h3, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
|
|
537
546
|
isEditedRef.current = true;
|
|
538
547
|
const _detail = detail || item;
|
|
539
548
|
let other = JSON.parse(JSON.stringify(e2));
|
|
@@ -570,6 +579,29 @@ var Info = (_, ref) => {
|
|
|
570
579
|
} catch (err) {
|
|
571
580
|
}
|
|
572
581
|
const sessionDetail = (0, import_utils5.editSessionProduct)(cacheItem, e2.session);
|
|
582
|
+
try {
|
|
583
|
+
(0, import_utils.sendWarningLog)({
|
|
584
|
+
title: "修改商品数据",
|
|
585
|
+
content: [
|
|
586
|
+
{ key: "productId", value: item.id },
|
|
587
|
+
{ key: "isSession", value: isSession },
|
|
588
|
+
{ key: "oldSession", value: JSON.stringify(oldSession) },
|
|
589
|
+
{ key: "sessionValue", value: JSON.stringify({
|
|
590
|
+
startTime: (_d3 = e2.session) == null ? void 0 : _d3.start_time,
|
|
591
|
+
endTime: (_e3 = e2.session) == null ? void 0 : _e3.end_time,
|
|
592
|
+
startDate: (0, import_dayjs.default)((_f3 = e2.session) == null ? void 0 : _f3.start_at).format("YYYY-MM-DD"),
|
|
593
|
+
endDate: (0, import_dayjs.default)((_g3 = e2.session) == null ? void 0 : _g3.end_at).format("YYYY-MM-DD"),
|
|
594
|
+
duration: (_h3 = e2.session) == null ? void 0 : _h3.duration
|
|
595
|
+
}) },
|
|
596
|
+
{ key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") },
|
|
597
|
+
{
|
|
598
|
+
key: "店铺id",
|
|
599
|
+
value: (_o2 = (_n2 = (_m2 = (_l2 = (_k2 = (_j2 = (_i2 = context.appHelper) == null ? void 0 : _i2.utils) == null ? void 0 : _j2.store) == null ? void 0 : _k2.getState) == null ? void 0 : _l2.call(_k2)) == null ? void 0 : _m2.global) == null ? void 0 : _n2.globalConfig) == null ? void 0 : _o2.id
|
|
600
|
+
}
|
|
601
|
+
]
|
|
602
|
+
});
|
|
603
|
+
} catch (err) {
|
|
604
|
+
}
|
|
573
605
|
if (sessionDetail) {
|
|
574
606
|
setTimeout(() => {
|
|
575
607
|
form.setFieldsValue({
|
|
@@ -583,7 +615,7 @@ var Info = (_, ref) => {
|
|
|
583
615
|
origin_total = (0, import_utils6.getProductOriginTotalPrice)(cacheItem);
|
|
584
616
|
}
|
|
585
617
|
cacheItem._extend.origin_total = origin_total;
|
|
586
|
-
(((
|
|
618
|
+
(((_p2 = cacheItem._extend) == null ? void 0 : _p2.items) || []).forEach((item2) => item2._extend.origin_total = origin_total);
|
|
587
619
|
dispatch({
|
|
588
620
|
type: "setService",
|
|
589
621
|
payload: {
|
|
@@ -592,7 +624,7 @@ var Info = (_, ref) => {
|
|
|
592
624
|
});
|
|
593
625
|
form.setFieldsValue({
|
|
594
626
|
total: _total,
|
|
595
|
-
capacity: (
|
|
627
|
+
capacity: (_q2 = cacheItem._extend) == null ? void 0 : _q2.capacity,
|
|
596
628
|
quantity: (e2 == null ? void 0 : e2.quantity) || (values == null ? void 0 : values.quantity) || 1
|
|
597
629
|
});
|
|
598
630
|
}
|
|
@@ -1023,6 +1055,8 @@ var Info = (_, ref) => {
|
|
|
1023
1055
|
var _a2, _b2, _c2;
|
|
1024
1056
|
delete cacheItem.discount_list;
|
|
1025
1057
|
(_c2 = (_b2 = (_a2 = cacheItem._extend.other) == null ? void 0 : _a2.bundle) == null ? void 0 : _b2.forEach) == null ? void 0 : _c2.call(_b2, (bundle) => {
|
|
1058
|
+
var _a3;
|
|
1059
|
+
(_a3 = bundle == null ? void 0 : bundle.metadata) == null ? true : delete _a3.custom_product_bundle_map_id;
|
|
1026
1060
|
bundle == null ? true : delete bundle.discount_list;
|
|
1027
1061
|
bundle == null ? true : delete bundle.booking_id;
|
|
1028
1062
|
bundle == null ? true : delete bundle.bundle_selling_price;
|
|
@@ -32,6 +32,7 @@ export declare const setProductPrice: (cacheItem: any, { newTotal, origin_total
|
|
|
32
32
|
* @returns 折扣列表
|
|
33
33
|
*/
|
|
34
34
|
export declare const getProductAllDiscountList: (cacheItem: any) => any;
|
|
35
|
+
export declare const mergeBundles: (other: any) => any[];
|
|
35
36
|
/**
|
|
36
37
|
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
37
38
|
* @param other - callback 返回的新数据
|
|
@@ -32,6 +32,7 @@ __export(utils_exports, {
|
|
|
32
32
|
getAutoAllocationStorage: () => getAutoAllocationStorage,
|
|
33
33
|
getProductAllDiscountList: () => getProductAllDiscountList,
|
|
34
34
|
mergeBundleWithOriginalPrice: () => mergeBundleWithOriginalPrice,
|
|
35
|
+
mergeBundles: () => mergeBundles,
|
|
35
36
|
setAutoAllocationStorage: () => setAutoAllocationStorage,
|
|
36
37
|
setProductPrice: () => setProductPrice
|
|
37
38
|
});
|
|
@@ -96,6 +97,20 @@ var getProductAllDiscountList = (cacheItem) => {
|
|
|
96
97
|
discountList.push(...bundleDiscountList);
|
|
97
98
|
return discountList;
|
|
98
99
|
};
|
|
100
|
+
var mergeBundles = (other) => {
|
|
101
|
+
const bundle = (other == null ? void 0 : other.bundle) || [];
|
|
102
|
+
const newBundle = [];
|
|
103
|
+
bundle.forEach((item) => {
|
|
104
|
+
const newItem = newBundle.find((newItem2) => newItem2.id === item.id);
|
|
105
|
+
if (newItem) {
|
|
106
|
+
newItem.num += item.num || 1;
|
|
107
|
+
newItem.quantity += item.quantity || 1;
|
|
108
|
+
} else {
|
|
109
|
+
newBundle.push({ ...item });
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return newBundle;
|
|
113
|
+
};
|
|
99
114
|
var mergeBundleWithOriginalPrice = (other, originalOther) => {
|
|
100
115
|
var _a, _b;
|
|
101
116
|
if (!((_a = other == null ? void 0 : other.bundle) == null ? void 0 : _a.length) || !((_b = originalOther == null ? void 0 : originalOther.bundle) == null ? void 0 : _b.length)) return other;
|
|
@@ -115,6 +130,7 @@ var mergeBundleWithOriginalPrice = (other, originalOther) => {
|
|
|
115
130
|
getAutoAllocationStorage,
|
|
116
131
|
getProductAllDiscountList,
|
|
117
132
|
mergeBundleWithOriginalPrice,
|
|
133
|
+
mergeBundles,
|
|
118
134
|
setAutoAllocationStorage,
|
|
119
135
|
setProductPrice
|
|
120
136
|
});
|
|
@@ -134,7 +134,7 @@ var Payments = (0, import_model.Provider)((props) => {
|
|
|
134
134
|
item.service_fee,
|
|
135
135
|
2,
|
|
136
136
|
(state == null ? void 0 : state.amountSymbol) || "$"
|
|
137
|
-
), ")") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-list-item-date" }, (0, import_dayjs.default)(item.payment_time).format(
|
|
137
|
+
), ")") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-list-item-date" }, (0, import_dayjs.default)(item.payment_time || item.created_at).format(
|
|
138
138
|
"HH:mm YYYY/MM/DD"
|
|
139
139
|
), /* @__PURE__ */ import_react.default.createElement("span", { className: "payment-list-item-platform-type" }, item.platform && import_utils.locales.getText("pisell2.text.platform.type")(
|
|
140
140
|
item.platform
|
|
@@ -43,14 +43,10 @@ var import_usePaymentLogger = __toESM(require("./usePaymentLogger"));
|
|
|
43
43
|
var import_utils3 = require("../../booking/utils");
|
|
44
44
|
var import_pisellos = require("../../ticketBooking/hooks/pisellos");
|
|
45
45
|
var import_useShopDiscountModule = require("../../ticketBooking/hooks/pisellos/useShopDiscountModule");
|
|
46
|
-
var import_context = require("../../ticketBooking/context");
|
|
47
|
-
var import_utils4 = require("../../ticketBooking/utils");
|
|
48
46
|
var useWalletPass = (props) => {
|
|
49
47
|
const { onSelectChange, customAmount, clientId } = props;
|
|
50
48
|
const logger = (0, import_usePaymentLogger.default)();
|
|
51
49
|
const { executeIfActive } = (0, import_pisellos.useActiveExecute)();
|
|
52
|
-
const osKey = (0, import_context.useOsKey)();
|
|
53
|
-
const moduleKey = (0, import_utils4.getShopDiscountKey)(osKey || "ticket");
|
|
54
50
|
const [walletRecommendList, setWalletRecommendList] = (0, import_react.useState)([]);
|
|
55
51
|
const [userIdentificationCodes, setUserIdentificationCodes] = (0, import_react.useState)(
|
|
56
52
|
[]
|
|
@@ -510,7 +506,7 @@ var useWalletPass = (props) => {
|
|
|
510
506
|
);
|
|
511
507
|
setDiscountList(sortedDiscountList);
|
|
512
508
|
(_a = pisellos == null ? void 0 : pisellos.effects) == null ? void 0 : _a.emit(
|
|
513
|
-
|
|
509
|
+
"shopDiscount:onSelectedDiscountListChange",
|
|
514
510
|
detail
|
|
515
511
|
);
|
|
516
512
|
return;
|
|
@@ -607,27 +603,24 @@ var useWalletPass = (props) => {
|
|
|
607
603
|
}
|
|
608
604
|
});
|
|
609
605
|
const handleSelectDiscount = (0, import_ahooks.useMemoizedFn)((value, option) => {
|
|
610
|
-
var _a;
|
|
606
|
+
var _a, _b, _c;
|
|
611
607
|
setLoading(true);
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
const sortedDiscountList = sortDiscountListWithInitialOrder(
|
|
619
|
-
detail.discountList
|
|
620
|
-
);
|
|
621
|
-
setDiscountList(sortedDiscountList);
|
|
622
|
-
(_a = pisellos == null ? void 0 : pisellos.effects) == null ? void 0 : _a.emit(
|
|
623
|
-
`${moduleKey}:onSelectedDiscountListChange`,
|
|
624
|
-
detail
|
|
625
|
-
);
|
|
626
|
-
} catch (err) {
|
|
627
|
-
console.log(err, "1234err");
|
|
628
|
-
} finally {
|
|
608
|
+
const isSelected = value.includes(option.id);
|
|
609
|
+
const detail = shopDiscount.setDiscountSelected({
|
|
610
|
+
discountId: option.id,
|
|
611
|
+
isSelected
|
|
612
|
+
});
|
|
613
|
+
if (!((_b = (_a = detail == null ? void 0 : detail.discountList) == null ? void 0 : _a.find((item) => item.id === option.id)) == null ? void 0 : _b.isSelected)) {
|
|
629
614
|
setLoading(false);
|
|
630
615
|
}
|
|
616
|
+
const sortedDiscountList = sortDiscountListWithInitialOrder(
|
|
617
|
+
detail.discountList
|
|
618
|
+
);
|
|
619
|
+
setDiscountList(sortedDiscountList);
|
|
620
|
+
(_c = pisellos == null ? void 0 : pisellos.effects) == null ? void 0 : _c.emit(
|
|
621
|
+
"shopDiscount:onSelectedDiscountListChange",
|
|
622
|
+
detail
|
|
623
|
+
);
|
|
631
624
|
});
|
|
632
625
|
const clearDisabledWalletData = (0, import_ahooks.useMemoizedFn)(() => {
|
|
633
626
|
setDisabledWalletData([]);
|
|
@@ -118,6 +118,7 @@ var AddSerivce = (props) => {
|
|
|
118
118
|
const handler = (event) => {
|
|
119
119
|
var _a2;
|
|
120
120
|
const cacheItem = (_a2 = event == null ? void 0 : event.detail) == null ? void 0 : _a2.cacheItem;
|
|
121
|
+
console.log("Modal closed with result:", event.detail.cacheItem);
|
|
121
122
|
if (!(cacheItem == null ? void 0 : cacheItem.id)) return;
|
|
122
123
|
(0, import_utils6.addServiceScroll)(String(cacheItem.id), cacheItem);
|
|
123
124
|
};
|
package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import './index.less';
|
|
3
3
|
interface BookingDashboardProps {
|
|
4
4
|
bookingTimeStartBetween: string[];
|
|
5
|
-
/** 组件是否可见,不可见时内部会暂停 interval,默认 true */
|
|
6
|
-
isVisible?: boolean;
|
|
7
5
|
}
|
|
8
6
|
declare const BookingDashboard: React.ForwardRefExoticComponent<BookingDashboardProps & React.RefAttributes<unknown>>;
|
|
9
7
|
export default BookingDashboard;
|
|
@@ -37,7 +37,7 @@ var import_react2 = require("react");
|
|
|
37
37
|
var import_dashboard = __toESM(require("../../../../booking/dashboard"));
|
|
38
38
|
var import_index = require("./index.less");
|
|
39
39
|
var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
|
|
40
|
-
const { bookingTimeStartBetween
|
|
40
|
+
const { bookingTimeStartBetween } = props;
|
|
41
41
|
const bookingDashboardRef = (0, import_react.useRef)(null);
|
|
42
42
|
const cptProps = (0, import_react.useMemo)(() => {
|
|
43
43
|
return {
|
|
@@ -45,7 +45,6 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
|
|
|
45
45
|
padding: "16px"
|
|
46
46
|
},
|
|
47
47
|
otherParams: { booking_time_start_between: bookingTimeStartBetween },
|
|
48
|
-
isVisible,
|
|
49
48
|
backgroundColors: [
|
|
50
49
|
"rgba(224, 79, 22, 0.20)",
|
|
51
50
|
"rgba(217, 45, 32, 0.14)",
|
|
@@ -57,7 +56,7 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
|
|
|
57
56
|
"var(--Gray-true-800, #292929)"
|
|
58
57
|
]
|
|
59
58
|
};
|
|
60
|
-
}, [bookingTimeStartBetween
|
|
59
|
+
}, [bookingTimeStartBetween]);
|
|
61
60
|
(0, import_react2.useImperativeHandle)(ref, () => ({
|
|
62
61
|
refresh: () => {
|
|
63
62
|
var _a;
|
|
@@ -4,8 +4,6 @@ interface BookingDataPanelProps {
|
|
|
4
4
|
currentDate: string;
|
|
5
5
|
onBookingClick: (booking: any) => void;
|
|
6
6
|
bookingId?: number;
|
|
7
|
-
/** 面板是否可见,透传给内部 Dashboard 控制 interval 是否启动 */
|
|
8
|
-
isVisible?: boolean;
|
|
9
7
|
}
|
|
10
8
|
declare const BookingDataPanel: React.ForwardRefExoticComponent<BookingDataPanelProps & React.RefAttributes<unknown>>;
|
|
11
9
|
export default BookingDataPanel;
|
|
@@ -41,7 +41,7 @@ var import_bookingList = __toESM(require("./bookingList"));
|
|
|
41
41
|
var import_materials2 = require("@pisell/materials");
|
|
42
42
|
var import_index = require("./index.less");
|
|
43
43
|
var BookingDataPanel = (0, import_react.forwardRef)((props, ref) => {
|
|
44
|
-
const { currentDate, onBookingClick, bookingId
|
|
44
|
+
const { currentDate, onBookingClick, bookingId } = props;
|
|
45
45
|
const Toast = (0, import_materials2.useToast)();
|
|
46
46
|
const bookingListRef = (0, import_react.useRef)(null);
|
|
47
47
|
const bookingDashboardRef = (0, import_react.useRef)(null);
|
|
@@ -53,14 +53,7 @@ var BookingDataPanel = (0, import_react.forwardRef)((props, ref) => {
|
|
|
53
53
|
{
|
|
54
54
|
label: import_utils.locales.getText("pisell2.ticket-booking.dashboard"),
|
|
55
55
|
key: "data-board",
|
|
56
|
-
children: /* @__PURE__ */ import_react.default.createElement(
|
|
57
|
-
import_bookingDashboard.default,
|
|
58
|
-
{
|
|
59
|
-
bookingTimeStartBetween,
|
|
60
|
-
isVisible,
|
|
61
|
-
ref: bookingDashboardRef
|
|
62
|
-
}
|
|
63
|
-
)
|
|
56
|
+
children: /* @__PURE__ */ import_react.default.createElement(import_bookingDashboard.default, { bookingTimeStartBetween, ref: bookingDashboardRef })
|
|
64
57
|
},
|
|
65
58
|
{
|
|
66
59
|
label: import_utils.locales.getText("pisell2.ticket-booking.booking-list"),
|
|
@@ -76,7 +69,7 @@ var BookingDataPanel = (0, import_react.forwardRef)((props, ref) => {
|
|
|
76
69
|
)
|
|
77
70
|
}
|
|
78
71
|
];
|
|
79
|
-
}, [currentDate, bookingId
|
|
72
|
+
}, [currentDate, bookingId]);
|
|
80
73
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
81
74
|
refresh: () => {
|
|
82
75
|
var _a, _b;
|
package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js
CHANGED
|
@@ -79,15 +79,6 @@ var PisellFloatingPanel = (0, import_react.forwardRef)((props, ref) => {
|
|
|
79
79
|
return isOpen;
|
|
80
80
|
}
|
|
81
81
|
}));
|
|
82
|
-
return /* @__PURE__ */ import_react.default.createElement(import_materials.PisellFloatingPanel, { ...floationgPanelProps, open: isOpen },
|
|
83
|
-
import__.default,
|
|
84
|
-
{
|
|
85
|
-
currentDate,
|
|
86
|
-
bookingId,
|
|
87
|
-
onBookingClick,
|
|
88
|
-
isVisible: isOpen,
|
|
89
|
-
ref: bookingDataPanelRef
|
|
90
|
-
}
|
|
91
|
-
));
|
|
82
|
+
return /* @__PURE__ */ import_react.default.createElement(import_materials.PisellFloatingPanel, { ...floationgPanelProps, open: isOpen }, /* @__PURE__ */ import_react.default.createElement(import__.default, { currentDate, bookingId, onBookingClick, ref: bookingDataPanelRef }));
|
|
92
83
|
});
|
|
93
84
|
var pisellFloatingPanel_default = (0, import_react.memo)(PisellFloatingPanel);
|