@pisell/private-materials 6.12.256 → 6.12.258
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 +2 -2
- package/build/lowcode/view.js +2 -2
- package/es/components/venueBooking/components/Checkout/index.js +1 -1
- package/es/components/venueBooking/components/Content/index.js +1 -1
- package/es/components/venueBooking/components/Header/index.js +5 -5
- package/es/components/venueBooking/components/VenueSelection/components/CourtFilter.js +1 -1
- package/es/components/venueBooking/components/VenueSelection/components/DateNavigator.js +3 -3
- package/es/components/venueBooking/components/VenueSelection/components/DayTabs.js +2 -2
- package/es/components/venueBooking/components/VenueSelection/components/MonthPicker.js +4 -4
- package/es/components/venueBooking/components/VenueSelection/components/TimeGrid.js +14 -14
- package/es/components/venueBooking/components/VenueSelection/index.js +2 -2
- package/es/components/venueBooking/context.js +6 -7
- package/es/components/venueBooking/hooks.js +22 -16
- package/lib/components/venueBooking/components/Checkout/index.js +1 -1
- package/lib/components/venueBooking/components/Content/index.js +1 -1
- package/lib/components/venueBooking/components/Header/index.js +5 -5
- package/lib/components/venueBooking/components/VenueSelection/components/CourtFilter.js +1 -1
- package/lib/components/venueBooking/components/VenueSelection/components/DateNavigator.js +3 -3
- package/lib/components/venueBooking/components/VenueSelection/components/DayTabs.js +2 -2
- package/lib/components/venueBooking/components/VenueSelection/components/MonthPicker.js +4 -4
- package/lib/components/venueBooking/components/VenueSelection/components/TimeGrid.js +14 -14
- package/lib/components/venueBooking/components/VenueSelection/index.js +2 -2
- package/lib/components/venueBooking/context.js +6 -7
- package/lib/components/venueBooking/hooks.js +22 -16
- package/package.json +3 -3
|
@@ -182,16 +182,16 @@ function TimeGrid() {
|
|
|
182
182
|
}
|
|
183
183
|
if (isGridLoading || !grid || !timeLabels.length) return /* @__PURE__ */ react.default.createElement(TimeGridSkeleton, null);
|
|
184
184
|
return /* @__PURE__ */ react.default.createElement("div", { className: "relative" }, /* @__PURE__ */ react.default.createElement("div", {
|
|
185
|
-
className: "sticky z-30 overflow-hidden bg-[#fff7f7]",
|
|
185
|
+
className: "sticky z-30 overflow-hidden rounded-t-[28px] bg-[#fff7f7]",
|
|
186
186
|
style: { top: "var(--vb-grid-sticky-top, 0px)" }
|
|
187
187
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
188
188
|
ref: headerInnerRef,
|
|
189
|
-
className: "grid border-b border-black/
|
|
189
|
+
className: "grid border-b border-black/[0.06]",
|
|
190
190
|
style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, tableGridStyle), {}, { willChange: "transform" }),
|
|
191
191
|
key: `${grid.date}-header`
|
|
192
192
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
193
193
|
ref: headerFixedColRef,
|
|
194
|
-
className: "relative z-20 row-span-2 flex items-center gap-2 border-r border-black/
|
|
194
|
+
className: "relative z-20 row-span-2 flex items-center gap-2 border-r border-black/[0.06] bg-[#fff7f7] px-2 py-4 font-bold text-zinc-900 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4",
|
|
195
195
|
style: { willChange: "transform" }
|
|
196
196
|
}, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
|
|
197
197
|
type: "pisell2-clock",
|
|
@@ -227,7 +227,7 @@ function TimeGrid() {
|
|
|
227
227
|
}))), /* @__PURE__ */ react.default.createElement("div", {
|
|
228
228
|
ref: scrollTableRef,
|
|
229
229
|
onScroll: syncHeader,
|
|
230
|
-
className: "max-w-full overflow-x-auto cursor-grab select-none touch-pan-y active:cursor-grabbing",
|
|
230
|
+
className: "max-w-full overflow-x-auto rounded-b-[28px] cursor-grab select-none touch-pan-y active:cursor-grabbing",
|
|
231
231
|
style: require_objectSpread2._objectSpread2({ WebkitOverflowScrolling: "touch" }, scrollerOverscrollStyle)
|
|
232
232
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
233
233
|
className: "w-full",
|
|
@@ -237,9 +237,9 @@ function TimeGrid() {
|
|
|
237
237
|
const isMultiProduct = !!resource.hasMultipleProducts && Array.isArray(resource.products);
|
|
238
238
|
const expanded = !!expandedResources[String(resource.resourceId)];
|
|
239
239
|
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, { key: `${resource.resourceId}-${grid.date}` }, /* @__PURE__ */ react.default.createElement("div", {
|
|
240
|
-
className: "grid border-b border-black/
|
|
240
|
+
className: "grid border-b border-black/[0.06]",
|
|
241
241
|
style: tableGridStyle
|
|
242
|
-
}, /* @__PURE__ */ react.default.createElement("div", { className: `sticky left-0 z-10 border-r border-black/
|
|
242
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: `sticky left-0 z-10 border-r border-black/[0.06] px-2 py-2 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4 ${courtMeta.soldOut ? "bg-zinc-50" : "bg-white"}` }, /* @__PURE__ */ react.default.createElement("div", { className: "flex items-start justify-between gap-2" }, /* @__PURE__ */ react.default.createElement("div", { className: "flex items-center gap-1.5" }, isMultiProduct ? /* @__PURE__ */ react.default.createElement("button", {
|
|
243
243
|
type: "button",
|
|
244
244
|
"data-cart-button": "true",
|
|
245
245
|
onClick: (e) => {
|
|
@@ -303,9 +303,9 @@ function TimeGrid() {
|
|
|
303
303
|
}), showPlusLabel ? /* @__PURE__ */ react.default.createElement("span", { className: `text-[13px] font-semibold leading-4 ${priceClass} md:text-sm` }, "+") : null), tag ? /* @__PURE__ */ react.default.createElement("div", { className: `inline-flex rounded-full px-1.5 py-0 text-[8px] font-semibold leading-4 ring-1 md:text-[9px] ${tag.className}` }, tagText) : null));
|
|
304
304
|
})), isMultiProduct && expanded && resource.products.map((subRow) => /* @__PURE__ */ react.default.createElement("div", {
|
|
305
305
|
key: `${resource.resourceId}-sub-${subRow.productId}`,
|
|
306
|
-
className: "grid border-b border-black/
|
|
306
|
+
className: "grid border-b border-black/[0.06] bg-zinc-50/60",
|
|
307
307
|
style: tableGridStyle
|
|
308
|
-
}, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/
|
|
308
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/[0.06] bg-zinc-50/60 px-2 py-2 pl-8 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4 md:pl-10" }, /* @__PURE__ */ react.default.createElement("div", { className: "text-[12px] font-semibold leading-5 text-zinc-700 md:text-[13px]" }, subRow.productTitle)), subRow.slots.map((slot, slotIndex) => {
|
|
309
309
|
const isAvailable = slot.status === "available";
|
|
310
310
|
const isUnavailable = slot.status === "occupied" || slot.status === "past" || slot.status === "unavailable";
|
|
311
311
|
const timeLabel = timeLabels[slotIndex] || "";
|
|
@@ -355,12 +355,12 @@ function TimeGridSkeleton() {
|
|
|
355
355
|
"aria-busy": "true",
|
|
356
356
|
"aria-live": "polite"
|
|
357
357
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
358
|
-
className: "sticky z-30 overflow-hidden bg-[#fff7f7]",
|
|
358
|
+
className: "sticky z-30 overflow-hidden rounded-t-[28px] bg-[#fff7f7]",
|
|
359
359
|
style: { top: "var(--vb-grid-sticky-top, 0px)" }
|
|
360
360
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
361
|
-
className: "grid border-b border-black/
|
|
361
|
+
className: "grid border-b border-black/[0.06]",
|
|
362
362
|
style: { gridTemplateColumns: `120px repeat(${SKELETON_COLS}, minmax(90px, 1fr))` }
|
|
363
|
-
}, /* @__PURE__ */ react.default.createElement("div", { className: "relative z-20 flex items-center gap-2 border-r border-black/
|
|
363
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: "relative z-20 flex items-center gap-2 border-r border-black/[0.06] bg-[#fff7f7] px-2 py-4 font-bold text-zinc-900 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4" }, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
|
|
364
364
|
type: "pisell2-clock",
|
|
365
365
|
style: {
|
|
366
366
|
fontSize: 16,
|
|
@@ -373,11 +373,11 @@ function TimeGridSkeleton() {
|
|
|
373
373
|
}, /* @__PURE__ */ react.default.createElement("div", { className: "h-3 w-10 rounded bg-zinc-200/80" }), /* @__PURE__ */ react.default.createElement("span", {
|
|
374
374
|
className: "vb-skeleton-shimmer",
|
|
375
375
|
"aria-hidden": "true"
|
|
376
|
-
}))))), /* @__PURE__ */ react.default.createElement("div", { className: "w-full" }, Array.from({ length: SKELETON_ROWS }).map((_, rowIdx) => /* @__PURE__ */ react.default.createElement("div", {
|
|
376
|
+
}))))), /* @__PURE__ */ react.default.createElement("div", { className: "w-full max-w-full overflow-hidden rounded-b-[28px]" }, Array.from({ length: SKELETON_ROWS }).map((_, rowIdx) => /* @__PURE__ */ react.default.createElement("div", {
|
|
377
377
|
key: `sk-row-${rowIdx}`,
|
|
378
|
-
className: "grid border-b border-black/
|
|
378
|
+
className: "grid border-b border-black/[0.06]",
|
|
379
379
|
style: { gridTemplateColumns: `120px repeat(${SKELETON_COLS}, minmax(90px, 1fr))` }
|
|
380
|
-
}, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/
|
|
380
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/[0.06] bg-white px-2 py-4 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4" }, /* @__PURE__ */ react.default.createElement("div", { className: "relative overflow-hidden" }, /* @__PURE__ */ react.default.createElement("div", { className: "h-4 w-20 rounded bg-zinc-200/80 md:w-24" }), /* @__PURE__ */ react.default.createElement("div", { className: "mt-2 h-2.5 w-14 rounded bg-zinc-200/60 md:w-16" }), /* @__PURE__ */ react.default.createElement("span", {
|
|
381
381
|
className: "vb-skeleton-shimmer",
|
|
382
382
|
"aria-hidden": "true"
|
|
383
383
|
}))), Array.from({ length: SKELETON_COLS }).map((_, colIdx) => /* @__PURE__ */ react.default.createElement("div", {
|
|
@@ -39,7 +39,7 @@ function VenueSelection() {
|
|
|
39
39
|
function goNextWeek() {
|
|
40
40
|
navigateWeek(7);
|
|
41
41
|
}
|
|
42
|
-
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-b-[24px] bg-white p-3
|
|
42
|
+
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-b-[24px] bg-white p-3 md:rounded-[28px] md:p-6" }, /* @__PURE__ */ react.default.createElement("div", { className: "flex flex-col gap-2 xl:flex-row xl:items-center xl:justify-between" }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("h2", { className: "text-2xl font-extrabold leading-tight text-zinc-900 md:text-[30px]" }, _pisell_utils.locales.getText("pisell2.venue.step1.title") || "选择场地"), /* @__PURE__ */ react.default.createElement("p", { className: "mt-1 text-xs leading-5 text-zinc-500 md:mt-2 md:text-sm md:leading-6" }, _pisell_utils.locales.getText("pisell2.venue.step1.subtitle") || "仅显示可用时段和价格。")), /* @__PURE__ */ react.default.createElement(require_DateNavigator.default, {
|
|
43
43
|
onPrevWeek: goPrevWeek,
|
|
44
44
|
onNextWeek: goNextWeek
|
|
45
45
|
})), /* @__PURE__ */ react.default.createElement("div", { className: "mt-3 md:mt-5" }, /* @__PURE__ */ react.default.createElement(require_DayTabs.default, {
|
|
@@ -47,7 +47,7 @@ function VenueSelection() {
|
|
|
47
47
|
onNextWeek: goNextWeek
|
|
48
48
|
})), /* @__PURE__ */ react.default.createElement(require_CourtFilter.default, null)), /* @__PURE__ */ react.default.createElement("div", {
|
|
49
49
|
ref: tableSectionRef,
|
|
50
|
-
className: "w-full max-w-full isolate rounded-[28px] bg-white
|
|
50
|
+
className: "w-full max-w-full isolate rounded-[28px] bg-white"
|
|
51
51
|
}, /* @__PURE__ */ react.default.createElement(require_TimeGrid.default, null)));
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
@@ -204,14 +204,13 @@ function VenueBookingProvider({ entryContext, children }) {
|
|
|
204
204
|
*/
|
|
205
205
|
const refreshViewModel = (0, react.useCallback)(function() {
|
|
206
206
|
var _ref = require_asyncToGenerator._asyncToGenerator(function* (extraFields) {
|
|
207
|
-
|
|
208
|
-
yield
|
|
207
|
+
try {
|
|
208
|
+
const moduleData = yield require_hooks.createVenueBookingViewModel(venueBookingModule);
|
|
209
|
+
setViewModel((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), moduleData), extraFields || {}));
|
|
210
|
+
if (venueBookingModule && typeof venueBookingModule.getDiscountList === "function") setDiscountList(venueBookingModule.getDiscountList() || []);
|
|
209
211
|
} catch (error) {
|
|
210
|
-
console.warn("[venueBooking]
|
|
212
|
+
console.warn("[venueBooking] refreshViewModel failed", error);
|
|
211
213
|
}
|
|
212
|
-
const moduleData = require_hooks.createVenueBookingViewModel(venueBookingModule);
|
|
213
|
-
setViewModel((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), moduleData), extraFields || {}));
|
|
214
|
-
if (venueBookingModule && typeof venueBookingModule.getDiscountList === "function") setDiscountList(venueBookingModule.getDiscountList() || []);
|
|
215
214
|
});
|
|
216
215
|
return function(_x) {
|
|
217
216
|
return _ref.apply(this, arguments);
|
|
@@ -623,7 +622,7 @@ function VenueBookingProvider({ entryContext, children }) {
|
|
|
623
622
|
yield require_hooks.loadVenueProducts(venueBookingModule, require_hooks.VENUE_PRODUCT_IDS);
|
|
624
623
|
const venueProducts = typeof (venueBookingModule === null || venueBookingModule === void 0 ? void 0 : venueBookingModule.getVenueProducts) === "function" ? venueBookingModule.getVenueProducts() : [];
|
|
625
624
|
yield goToNearestAvailableDateRef.current(anchorDateRef.current);
|
|
626
|
-
const moduleData = require_hooks.createVenueBookingViewModel(venueBookingModule);
|
|
625
|
+
const moduleData = yield require_hooks.createVenueBookingViewModel(venueBookingModule);
|
|
627
626
|
if (!unmounted) {
|
|
628
627
|
setViewModel((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), {}, {
|
|
629
628
|
cartItems: Array.isArray(moduleData.cartItems) ? moduleData.cartItems : [],
|
|
@@ -191,25 +191,31 @@ function getSelectedDateKeySet(module) {
|
|
|
191
191
|
return selectedDateKeySet;
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
|
-
*
|
|
194
|
+
* 等待 OS 金额汇总后,从模块快照构建 ViewModel(购物车部分)
|
|
195
195
|
* 购物车数据使用 toShoppingCartProducts 转换为 ShoppingCart 组件所需格式
|
|
196
196
|
*/
|
|
197
|
-
function createVenueBookingViewModel(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
197
|
+
function createVenueBookingViewModel(_x10) {
|
|
198
|
+
return _createVenueBookingViewModel.apply(this, arguments);
|
|
199
|
+
}
|
|
200
|
+
function _createVenueBookingViewModel() {
|
|
201
|
+
_createVenueBookingViewModel = require_asyncToGenerator._asyncToGenerator(function* (module) {
|
|
202
|
+
const summaryByGetter = typeof (module === null || module === void 0 ? void 0 : module.getSummary) === "function" ? yield module.getSummary() : null;
|
|
203
|
+
const orderProducts = callModuleGetter(module, "getOrderProducts", []);
|
|
204
|
+
const tempOrder = callModuleGetter(module, "getTempOrder", null);
|
|
205
|
+
const amountSymbol = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.currency_symbol) || "$";
|
|
206
|
+
const cartItems = require_toShoppingCartProducts.toShoppingCartProducts({
|
|
207
|
+
orderProducts: Array.isArray(orderProducts) ? orderProducts : [],
|
|
208
|
+
amountSymbol
|
|
209
|
+
});
|
|
210
|
+
const summary = (summaryByGetter && typeof summaryByGetter === "object" ? summaryByGetter : null) || (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.summary) || {};
|
|
211
|
+
return {
|
|
212
|
+
cartItems: Array.isArray(cartItems) ? cartItems : [],
|
|
213
|
+
summary: summary && typeof summary === "object" ? summary : {},
|
|
214
|
+
note: String((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.note) || ""),
|
|
215
|
+
contactsInfo: Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.contacts_info) ? tempOrder.contacts_info : []
|
|
216
|
+
};
|
|
205
217
|
});
|
|
206
|
-
|
|
207
|
-
return {
|
|
208
|
-
cartItems: Array.isArray(cartItems) ? cartItems : [],
|
|
209
|
-
summary: summary && typeof summary === "object" ? summary : {},
|
|
210
|
-
note: String((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.note) || ""),
|
|
211
|
-
contactsInfo: Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.contacts_info) ? tempOrder.contacts_info : []
|
|
212
|
-
};
|
|
218
|
+
return _createVenueBookingViewModel.apply(this, arguments);
|
|
213
219
|
}
|
|
214
220
|
/** 登录状态 hook(检查 token + 弹出登录弹窗) */
|
|
215
221
|
function useVenueBookingLogin() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.258",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
71
71
|
"styled-components": "^6.0.0-rc.3",
|
|
72
72
|
"use-sync-external-store": "^1.6.0",
|
|
73
|
-
"@pisell/
|
|
73
|
+
"@pisell/utils": "3.0.7",
|
|
74
74
|
"@pisell/pi-payment-sdk": "0.0.3",
|
|
75
|
+
"@pisell/materials": "6.12.74",
|
|
75
76
|
"@pisell/icon": "0.0.11",
|
|
76
|
-
"@pisell/utils": "3.0.7",
|
|
77
77
|
"@pisell/date-picker": "3.0.12"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|