@pisell/private-materials 3.3.34 → 3.3.35
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.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/Sales/Cart/index.js +26 -13
- package/es/components/Sales/Cart/types.d.ts +12 -0
- package/es/components/Sales/Cart/utils.d.ts +23 -0
- package/es/components/Sales/Cart/utils.js +161 -0
- package/es/components/Sales/Checkout/utils.d.ts +9 -1
- package/es/components/Sales/Checkout/utils.js +25 -3
- package/es/components/Sales/Event/Detail.d.ts +2 -0
- package/es/components/Sales/Event/Detail.js +56 -13
- package/es/components/Sales/Event/serve.d.ts +10 -0
- package/es/components/Sales/Event/serve.js +26 -1
- package/es/components/Sales/Summary/utils.js +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +18 -17
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +21 -20
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +156 -53
- package/es/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
- package/es/components/appointmentBooking/components/ConfirmInformation/utils.js +17 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +26 -25
- package/es/components/appointmentBooking/components/Content/index.less +23 -1
- package/es/components/appointmentBooking/components/Footer/index.js +5 -5
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +7 -7
- package/es/components/appointmentBooking/components/Services/index.js +50 -25
- package/es/components/appointmentBooking/hooks.d.ts +2 -1
- package/es/components/appointmentBooking/hooks.js +52 -47
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info2/service/actions/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/materiels/duration/index.d.ts +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/booking/utils.js +19 -11
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +218 -73
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -4
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/index.js +70 -13
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.js +4 -2
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/Sales/Cart/index.js +30 -18
- package/lib/components/Sales/Cart/types.d.ts +12 -0
- package/lib/components/Sales/Cart/utils.d.ts +23 -0
- package/lib/components/Sales/Cart/utils.js +149 -0
- package/lib/components/Sales/Checkout/utils.d.ts +9 -1
- package/lib/components/Sales/Checkout/utils.js +18 -4
- package/lib/components/Sales/Event/Detail.d.ts +2 -0
- package/lib/components/Sales/Event/Detail.js +34 -10
- package/lib/components/Sales/Event/serve.d.ts +10 -0
- package/lib/components/Sales/Event/serve.js +5 -2
- package/lib/components/Sales/Summary/utils.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +3 -3
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +1 -1
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +43 -6
- package/lib/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
- package/lib/components/appointmentBooking/components/ConfirmInformation/utils.js +37 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +7 -7
- package/lib/components/appointmentBooking/components/Content/index.less +23 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +5 -3
- package/lib/components/appointmentBooking/components/Services/index.js +18 -10
- package/lib/components/appointmentBooking/hooks.d.ts +2 -1
- package/lib/components/appointmentBooking/hooks.js +9 -3
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/materiels/duration/index.d.ts +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/booking/utils.js +5 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +128 -42
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -2
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +79 -24
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.js +6 -2
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/package.json +4 -4
|
@@ -163,10 +163,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
163
163
|
export declare const getDuration: (duration: number | {
|
|
164
164
|
type: string;
|
|
165
165
|
value: number;
|
|
166
|
-
}) => number | {
|
|
166
|
+
}) => number | "flexible" | {
|
|
167
167
|
type: string;
|
|
168
168
|
value: number;
|
|
169
|
-
}
|
|
169
|
+
};
|
|
170
170
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
171
171
|
export declare const getIsEdit: (state: any) => boolean;
|
|
172
172
|
export {};
|
|
@@ -230,6 +230,9 @@ var formatProductListByCategory = (list, filterItem) => {
|
|
|
230
230
|
return Object.values(categoryObject).sort((a, b) => b.sort - a.sort);
|
|
231
231
|
};
|
|
232
232
|
var getResourceTimeIsUsable = (item, cacheItem) => {
|
|
233
|
+
var _a;
|
|
234
|
+
const isEdit = !!cacheItem.booking_id;
|
|
235
|
+
const isCurrentRelation = item.item_id === ((_a = cacheItem == null ? void 0 : cacheItem._extend) == null ? void 0 : _a.relation_id);
|
|
233
236
|
const startDate = (0, import_dayjs.default)(
|
|
234
237
|
cacheItem._extend.start_date.format("YYYY-MM-DD") + " " + getServeStartTime(cacheItem._extend.start_time)
|
|
235
238
|
);
|
|
@@ -240,7 +243,8 @@ var getResourceTimeIsUsable = (item, cacheItem) => {
|
|
|
240
243
|
if (time.max_participants_limit == 0) {
|
|
241
244
|
isMaxLimitRange = true;
|
|
242
245
|
} else {
|
|
243
|
-
|
|
246
|
+
const orderEventCount = isEdit && isCurrentRelation ? time.order_event_count - 1 : time.order_event_count;
|
|
247
|
+
isMaxLimitRange = orderEventCount < time.max_participants_limit;
|
|
244
248
|
}
|
|
245
249
|
const timeStartDate = (0, import_dayjs.default)(time.start_date + " " + time.start_time).subtract(
|
|
246
250
|
1,
|
|
@@ -61,59 +61,145 @@ var ContinueButton = () => {
|
|
|
61
61
|
const [openEmptyHolder, setOpenEmptyHolder] = (0, import_react.useState)(false);
|
|
62
62
|
const { setData, removeSessionStorage } = (0, import_Sales.useSales)();
|
|
63
63
|
const context = (0, import_useEngineContext.default)();
|
|
64
|
-
const { store } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
64
|
+
const { store, action, getStore } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
65
65
|
const handleCheckout = async () => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
const params = (0, import_utils2.getFormParams)(data);
|
|
67
|
+
action == null ? void 0 : action({
|
|
68
|
+
type: "pisell1.goProductForm",
|
|
69
|
+
data: params,
|
|
70
|
+
callback: async (e) => {
|
|
71
|
+
var _a2;
|
|
72
|
+
const value = (0, import_utils2.formatValues)(data, false, {
|
|
73
|
+
relation_forms: e
|
|
74
|
+
});
|
|
75
|
+
const result = await onCheckout(value);
|
|
76
|
+
if (result == null ? void 0 : result.success) {
|
|
77
|
+
removeSessionStorage();
|
|
78
|
+
} else {
|
|
79
|
+
(0, import_materials.PisellToast)({
|
|
80
|
+
content: ((_a2 = result == null ? void 0 : result.err) == null ? void 0 : _a2.message) || ""
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
76
85
|
};
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
const _getProductPrice = (0, import_ahooks.useRequest)(import_serve.getProductPrice, {
|
|
87
|
+
manual: true,
|
|
88
|
+
onSuccess: (res) => {
|
|
89
|
+
const list = res.data || [];
|
|
90
|
+
const productById = list.reduce((pre, cur) => {
|
|
91
|
+
pre[cur.id] = cur;
|
|
92
|
+
return pre;
|
|
93
|
+
}, {});
|
|
94
|
+
console.log("start update price");
|
|
95
|
+
const newCartItems = cartData.cartItems.map((item) => {
|
|
82
96
|
var _a2;
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const { product } = item._originData || {};
|
|
90
|
-
let newProduct = productById[product.product_id];
|
|
91
|
-
item.price = newProduct.price;
|
|
92
|
-
item.total = newProduct.price;
|
|
97
|
+
const { product } = item._originData || {};
|
|
98
|
+
let newProduct = productById[product.product_id];
|
|
99
|
+
let _totalPrice = Number(newProduct.price);
|
|
100
|
+
if (!(item == null ? void 0 : item._productDetail)) {
|
|
101
|
+
item.price = _totalPrice;
|
|
102
|
+
item.total = _totalPrice;
|
|
93
103
|
return item;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
}
|
|
105
|
+
const { bundle = [], options } = item._productDetail;
|
|
106
|
+
if (product == null ? void 0 : product.product_variant_id) {
|
|
107
|
+
const { variant = [] } = newProduct;
|
|
108
|
+
const _variant = variant.find(
|
|
109
|
+
(v) => v.id === product.product_variant_id
|
|
110
|
+
);
|
|
111
|
+
if (_variant) {
|
|
112
|
+
_totalPrice = Number(_variant.price);
|
|
99
113
|
}
|
|
100
|
-
}
|
|
101
|
-
|
|
114
|
+
} else if (
|
|
115
|
+
// 2. 套餐商品
|
|
116
|
+
Array.isArray(product == null ? void 0 : product.product_bundle) && product.product_bundle.length > 0
|
|
117
|
+
) {
|
|
118
|
+
const { bundle_group = [] } = newProduct;
|
|
119
|
+
for (let i = 0; i < product.product_bundle.length; i++) {
|
|
120
|
+
const pbItem = product.product_bundle[i];
|
|
121
|
+
const { bundle_group_id, bundle_id, option } = pbItem;
|
|
122
|
+
const _originBundleItemInfo = bundle.find(
|
|
123
|
+
(bi) => bi.id === bundle_id
|
|
124
|
+
);
|
|
125
|
+
const _targetBundleGroup = bundle_group.find(
|
|
126
|
+
(bg) => bg.id === bundle_group_id
|
|
127
|
+
);
|
|
128
|
+
if ((_a2 = _targetBundleGroup == null ? void 0 : _targetBundleGroup.bundle_item) == null ? void 0 : _a2.length) {
|
|
129
|
+
let _newBundleItemInfo = _targetBundleGroup.bundle_item.find(
|
|
130
|
+
(bi) => bi.id === bundle_id
|
|
131
|
+
);
|
|
132
|
+
if ((_originBundleItemInfo == null ? void 0 : _originBundleItemInfo._bundle_product_id) === (_newBundleItemInfo == null ? void 0 : _newBundleItemInfo.bundle_product_id)) {
|
|
133
|
+
const {
|
|
134
|
+
price_type,
|
|
135
|
+
num = 0,
|
|
136
|
+
option: _originBundleItemOptions
|
|
137
|
+
} = _originBundleItemInfo;
|
|
138
|
+
const _bundleItemPrice = Number(_newBundleItemInfo.price);
|
|
139
|
+
if (price_type === "markup") {
|
|
140
|
+
_totalPrice += _bundleItemPrice * num;
|
|
141
|
+
} else if (price_type === "markdown") {
|
|
142
|
+
_totalPrice -= _bundleItemPrice * num;
|
|
143
|
+
} else {
|
|
144
|
+
_totalPrice += _bundleItemPrice * num;
|
|
145
|
+
}
|
|
146
|
+
if (Array.isArray(option) && (option == null ? void 0 : option.length) > 0) {
|
|
147
|
+
for (let j = 0; j < option.length; j++) {
|
|
148
|
+
const { option_group_item_id } = option[j];
|
|
149
|
+
const _originOptionItem = _originBundleItemOptions.find(
|
|
150
|
+
(op) => op.product_option_item_id === option_group_item_id
|
|
151
|
+
);
|
|
152
|
+
if (_originOptionItem) {
|
|
153
|
+
const { price, num: _optionNum = 0 } = _originOptionItem;
|
|
154
|
+
_totalPrice += Number(price) * _optionNum;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
} else if (
|
|
162
|
+
// 3. 单规格商品
|
|
163
|
+
Array.isArray(product == null ? void 0 : product.product_option_item) && product.product_option_item.length > 0
|
|
164
|
+
) {
|
|
165
|
+
for (let i = 0; i < product.product_option_item.length; i++) {
|
|
166
|
+
const { option_group_item_id } = product.product_option_item[i];
|
|
167
|
+
const _originOptionItem = options.find(
|
|
168
|
+
(op) => op.product_option_item_id === option_group_item_id
|
|
169
|
+
);
|
|
170
|
+
if (_originOptionItem) {
|
|
171
|
+
const { price, num = 0 } = _originOptionItem;
|
|
172
|
+
_totalPrice += Number(price) * num;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
item.price = _totalPrice;
|
|
177
|
+
item.total = _totalPrice;
|
|
178
|
+
return item;
|
|
179
|
+
});
|
|
180
|
+
console.log("new cart data", newCartItems);
|
|
181
|
+
setData({
|
|
182
|
+
cartData: {
|
|
183
|
+
...cartData,
|
|
184
|
+
cartItems: newCartItems
|
|
185
|
+
}
|
|
186
|
+
});
|
|
102
187
|
}
|
|
103
|
-
);
|
|
188
|
+
});
|
|
104
189
|
const getCartItemProductsWithQuotation = async () => {
|
|
105
190
|
var _a2, _b2;
|
|
106
191
|
const ids = cartData.cartItems.map((item) => {
|
|
107
|
-
const { product } = item._originData || {};
|
|
108
|
-
|
|
192
|
+
const { product = {} } = item._originData || {};
|
|
193
|
+
const { product_id } = product;
|
|
194
|
+
return product_id;
|
|
109
195
|
}).filter((id) => !!id);
|
|
110
|
-
const
|
|
111
|
-
|
|
196
|
+
const store2 = getStore();
|
|
197
|
+
const customer = (_b2 = (_a2 = store2 == null ? void 0 : store2.getState()) == null ? void 0 : _a2.global) == null ? void 0 : _b2.userInfo;
|
|
198
|
+
if (!(ids == null ? void 0 : ids.length)) return;
|
|
199
|
+
_getProductPrice.run({
|
|
112
200
|
ids,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
customer_id: customer == null ? void 0 : customer.id,
|
|
116
|
-
open_quotation: 1
|
|
201
|
+
customer_id: customer == null ? void 0 : customer.id
|
|
202
|
+
// open_quotation: 1,
|
|
117
203
|
});
|
|
118
204
|
};
|
|
119
205
|
const handleNextStep = async () => {
|
package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js
CHANGED
|
@@ -37,9 +37,14 @@ var import_OpenCard = __toESM(require("../../OpenCard"));
|
|
|
37
37
|
var import_materials = require("@pisell/materials");
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
39
|
var import_Sales = require("../../../../Sales");
|
|
40
|
-
var BookingOptions = () => {
|
|
40
|
+
var BookingOptions = (props) => {
|
|
41
41
|
var _a, _b;
|
|
42
42
|
const { detail, currentBookingOption, selectEventDetailBookingOptions } = (0, import_Sales.useEventDetail)();
|
|
43
|
+
const onChange = (value, item) => {
|
|
44
|
+
var _a2;
|
|
45
|
+
selectEventDetailBookingOptions(value);
|
|
46
|
+
(_a2 = props == null ? void 0 : props.onChangeBookingOption) == null ? void 0 : _a2.call(props, item);
|
|
47
|
+
};
|
|
43
48
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
44
49
|
import_OpenCard.default,
|
|
45
50
|
{
|
|
@@ -67,7 +72,7 @@ var BookingOptions = () => {
|
|
|
67
72
|
}
|
|
68
73
|
));
|
|
69
74
|
},
|
|
70
|
-
onChange
|
|
75
|
+
onChange
|
|
71
76
|
}
|
|
72
77
|
)
|
|
73
78
|
);
|
|
@@ -42,12 +42,21 @@ var import_Resource = __toESM(require("./components/Resource"));
|
|
|
42
42
|
var import_BookingOptions = __toESM(require("./components/BookingOptions"));
|
|
43
43
|
var import_OrderProductModal = __toESM(require("../Provider/OrderProductModal/index"));
|
|
44
44
|
var import_index = require("./index.less");
|
|
45
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
45
46
|
var BookingDetailModal = (props) => {
|
|
46
47
|
var _a;
|
|
47
48
|
const modalContentRef = (0, import_react.useRef)(null);
|
|
49
|
+
const context = (0, import_useEngineContext.default)();
|
|
50
|
+
const { utils } = context.appHelper || {};
|
|
48
51
|
const tabsRef = (0, import_react.useRef)();
|
|
49
52
|
const { open = false } = props;
|
|
50
|
-
const {
|
|
53
|
+
const {
|
|
54
|
+
detail,
|
|
55
|
+
onCloseEventDetail,
|
|
56
|
+
onSelectEventDetail,
|
|
57
|
+
selectEventDetailProductDetail,
|
|
58
|
+
checkBeforeSelectEventDetail
|
|
59
|
+
} = (0, import_Sales.useEventDetail)();
|
|
51
60
|
const { addToCart, checkBeforeAddToCart, checkBeforeAddToCartResquest } = (0, import_Sales.useCart)();
|
|
52
61
|
const [activeTab, setActiveTab] = (0, import_react.useState)("introduction");
|
|
53
62
|
const [isScrolling, setIsScrolling] = (0, import_react.useState)(false);
|
|
@@ -175,34 +184,80 @@ var BookingDetailModal = (props) => {
|
|
|
175
184
|
}
|
|
176
185
|
};
|
|
177
186
|
const content = () => {
|
|
178
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
179
|
-
|
|
187
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
188
|
+
"div",
|
|
180
189
|
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
className: "booking-detail-modal-content",
|
|
191
|
+
style: { height: (0, import_utils.isMobile)() ? "100%" : "calc(80vh - 146px)" }
|
|
192
|
+
},
|
|
193
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "anchor-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
|
|
194
|
+
import_materials.PisellAnchor,
|
|
195
|
+
{
|
|
196
|
+
ref: tabsRef,
|
|
197
|
+
options: anchorOptions,
|
|
198
|
+
containerRef: modalContentRef,
|
|
199
|
+
tab: activeTab,
|
|
200
|
+
onChange: (key) => {
|
|
201
|
+
handleTabChange(key);
|
|
202
|
+
},
|
|
203
|
+
onTabClick: () => {
|
|
204
|
+
isUserClickRef.current = true;
|
|
205
|
+
}
|
|
190
206
|
}
|
|
207
|
+
)),
|
|
208
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "content-wrapper", ref: modalContentRef }, /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "introduction", className: "content-section" }, (images == null ? void 0 : images.length) > 0 ? /* @__PURE__ */ import_react.default.createElement(
|
|
209
|
+
import_materials.PisellImageCarousels,
|
|
210
|
+
{
|
|
211
|
+
dataSource: images,
|
|
212
|
+
width: "100%",
|
|
213
|
+
height: (0, import_utils.isMobile)() ? 300 : 400,
|
|
214
|
+
showArrows: !(0, import_utils.isMobile)(),
|
|
215
|
+
showDots: (images == null ? void 0 : images.length) > 1,
|
|
216
|
+
autoplay: (images == null ? void 0 : images.length) > 1,
|
|
217
|
+
loop: false
|
|
218
|
+
}
|
|
219
|
+
) : null, /* @__PURE__ */ import_react.default.createElement(import_eventCard.default, { data: detail == null ? void 0 : detail.introduction })), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "schedule", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Schedule.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "resource", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Resource.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "booking_options", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(
|
|
220
|
+
import_BookingOptions.default,
|
|
221
|
+
{
|
|
222
|
+
onChangeBookingOption: checkToOpenProductDetailModal
|
|
223
|
+
}
|
|
224
|
+
)))
|
|
225
|
+
);
|
|
226
|
+
};
|
|
227
|
+
const checkToOpenProductDetailModal = (bookingOption) => {
|
|
228
|
+
var _a2;
|
|
229
|
+
console.log(">>>>>>>", bookingOption);
|
|
230
|
+
if (((_a2 = bookingOption == null ? void 0 : bookingOption._originData) == null ? void 0 : _a2.is_eject) !== 1) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
utils == null ? void 0 : utils.action({
|
|
234
|
+
type: "pisell1.productDetail",
|
|
235
|
+
data: {
|
|
236
|
+
detail: { ...(bookingOption == null ? void 0 : bookingOption._originData) || {} },
|
|
237
|
+
isOS: false
|
|
238
|
+
},
|
|
239
|
+
callback: (data) => {
|
|
240
|
+
if (data == null ? void 0 : data.isCancel) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
console.log("data>>>>>>", data);
|
|
244
|
+
const product = {
|
|
245
|
+
...data,
|
|
246
|
+
options: (data == null ? void 0 : data.option) || []
|
|
247
|
+
};
|
|
248
|
+
delete product.option;
|
|
249
|
+
selectEventDetailProductDetail(product);
|
|
250
|
+
handleOk();
|
|
191
251
|
}
|
|
192
|
-
|
|
193
|
-
import_materials.PisellImageCarousels,
|
|
194
|
-
{
|
|
195
|
-
dataSource: images,
|
|
196
|
-
width: "100%",
|
|
197
|
-
height: (0, import_utils.isMobile)() ? 300 : 400,
|
|
198
|
-
showArrows: !(0, import_utils.isMobile)(),
|
|
199
|
-
showDots: (images == null ? void 0 : images.length) > 1,
|
|
200
|
-
autoplay: (images == null ? void 0 : images.length) > 1,
|
|
201
|
-
loop: false
|
|
202
|
-
}
|
|
203
|
-
) : null, /* @__PURE__ */ import_react.default.createElement(import_eventCard.default, { data: detail == null ? void 0 : detail.introduction })), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "schedule", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Schedule.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "resource", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Resource.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "booking_options", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_BookingOptions.default, null))));
|
|
252
|
+
});
|
|
204
253
|
};
|
|
205
254
|
const handleOk = async () => {
|
|
255
|
+
console.log(">>>>>>>", detail);
|
|
256
|
+
const result = checkBeforeSelectEventDetail();
|
|
257
|
+
if (!result) {
|
|
258
|
+
checkToOpenProductDetailModal(detail == null ? void 0 : detail.selectedProduct);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
206
261
|
onSelectEventDetail();
|
|
207
262
|
const checkRes = await checkBeforeAddToCart();
|
|
208
263
|
if ((checkRes == null ? void 0 : checkRes.result) === false) {
|
|
@@ -58,7 +58,9 @@ var TabProduct = (props) => {
|
|
|
58
58
|
(0, import_react.useEffect)(() => {
|
|
59
59
|
if (list == null ? void 0 : list.length) {
|
|
60
60
|
setCurrentGroupId(list[0].id);
|
|
61
|
-
|
|
61
|
+
requestAnimationFrame(() => {
|
|
62
|
+
handleObserver();
|
|
63
|
+
});
|
|
62
64
|
}
|
|
63
65
|
}, [list]);
|
|
64
66
|
const handleObserver = (0, import_ahooks.useMemoizedFn)(() => {
|
|
@@ -142,7 +144,9 @@ var TabProduct = (props) => {
|
|
|
142
144
|
tab: currentGroupId,
|
|
143
145
|
onChange: (e) => {
|
|
144
146
|
var _a;
|
|
145
|
-
let comWrapper = document.querySelector(
|
|
147
|
+
let comWrapper = document.querySelector(
|
|
148
|
+
".pisell-product-select-wrapper"
|
|
149
|
+
);
|
|
146
150
|
let categoryDom = document.querySelector(
|
|
147
151
|
".pisell-product-select-tabs-wrapper"
|
|
148
152
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.35",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
62
|
"@pisell/utils": "1.0.42",
|
|
63
|
-
"@pisell/materials": "3.3.
|
|
64
|
-
"@pisell/
|
|
65
|
-
"@pisell/
|
|
63
|
+
"@pisell/materials": "3.3.12",
|
|
64
|
+
"@pisell/icon": "0.0.11",
|
|
65
|
+
"@pisell/date-picker": "3.0.2"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|