@pisell/private-materials 6.3.131 → 6.3.133
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 +6 -6
- package/build/lowcode/view.js +6 -6
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/ecocup/components/CupStatusModal/hooks.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/venueBooking/components/Cart/index.js +7 -7
- package/es/components/venueBooking/components/Checkout/index.js +2 -12
- package/es/components/venueBooking/components/Content/index.js +10 -9
- package/es/components/venueBooking/components/Footer/index.js +2 -8
- package/es/components/venueBooking/components/Header/index.js +38 -17
- package/es/components/venueBooking/components/VenueSelection/components/CourtFilter.js +1 -17
- package/es/components/venueBooking/components/VenueSelection/components/TimeGrid.js +63 -26
- package/es/components/venueBooking/components/VenueSelection/index.js +2 -6
- package/es/components/venueBooking/context.js +95 -44
- package/es/components/venueBooking/hooks.d.ts +1 -0
- package/es/components/venueBooking/hooks.js +8 -2
- package/es/components/venueBooking/index.js +30 -2
- package/es/components/venueBooking/locales.d.ts +20 -0
- package/es/components/venueBooking/locales.js +25 -5
- package/es/components/venueBooking/utils.d.ts +8 -0
- package/es/components/venueBooking/utils.js +12 -2
- package/es/hooks/usePaymentLogger.d.ts +1 -0
- package/es/plus/pisellSalesManagement/config/booking.d.ts +6 -6
- package/es/plus/pisellSalesManagement/hooks/useSalesGridData.d.ts +1 -0
- package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/ecocup/components/CupStatusModal/hooks.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/venueBooking/components/Cart/index.js +3 -8
- package/lib/components/venueBooking/components/Checkout/index.js +1 -5
- package/lib/components/venueBooking/components/Content/index.js +20 -15
- package/lib/components/venueBooking/components/Footer/index.js +1 -9
- package/lib/components/venueBooking/components/Header/index.js +12 -6
- package/lib/components/venueBooking/components/VenueSelection/components/CourtFilter.js +1 -10
- package/lib/components/venueBooking/components/VenueSelection/components/TimeGrid.js +29 -10
- package/lib/components/venueBooking/components/VenueSelection/index.js +2 -3
- package/lib/components/venueBooking/context.js +52 -25
- package/lib/components/venueBooking/hooks.d.ts +1 -0
- package/lib/components/venueBooking/hooks.js +6 -1
- package/lib/components/venueBooking/index.js +19 -1
- package/lib/components/venueBooking/locales.d.ts +20 -0
- package/lib/components/venueBooking/locales.js +25 -5
- package/lib/components/venueBooking/utils.d.ts +8 -0
- package/lib/components/venueBooking/utils.js +3 -2
- package/lib/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/plus/pisellSalesManagement/config/booking.d.ts +6 -6
- package/lib/plus/pisellSalesManagement/hooks/useSalesGridData.d.ts +1 -0
- package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/package.json +18 -18
- package/es/components/appointmentBooking/components/Form/index.d.ts +0 -4
- package/es/components/appointmentBooking/components/Services/index.d.ts +0 -4
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -4
- package/es/components/appointmentBooking/hooks.d.ts +0 -107
- package/es/components/appointmentBooking/utils.d.ts +0 -227
- package/es/components/booking/components/footer/utils.d.ts +0 -47
- package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -9
- package/es/components/booking/components/voucher/index.d.ts +0 -4
- package/es/components/booking/info/service/editService/constants.d.ts +0 -1
- package/es/components/booking/info/service/editService/index.d.ts +0 -7
- package/es/components/booking/info/service2/utils.d.ts +0 -248
- package/es/components/booking/info2/index.d.ts +0 -12
- package/es/components/booking/info2/service/addService/index.d.ts +0 -12
- package/es/components/booking/locales.d.ts +0 -1489
- package/es/components/booking/model.d.ts +0 -120
- package/es/components/eftposPay/amount.d.ts +0 -21
- package/es/components/eftposPay/app.d.ts +0 -11
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -4
- package/es/components/eftposPay/component/fail/index.d.ts +0 -4
- package/es/components/eftposPay/component/fail/network.d.ts +0 -9
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -10
- package/es/components/eftposPay/component/manual/index.d.ts +0 -10
- package/es/components/eftposPay/component/signature/index.d.ts +0 -9
- package/es/components/eftposPay/device.d.ts +0 -24
- package/es/components/eftposPay/index.d.ts +0 -5
- package/es/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/es/components/eftposPay/linkly/index.d.ts +0 -3
- package/es/components/eftposPay/pay.d.ts +0 -21
- package/es/components/eftposPay/payo/config.d.ts +0 -13
- package/es/components/eftposPay/payo/hooks.d.ts +0 -10
- package/es/components/eftposPay/payo/payment.d.ts +0 -66
- package/es/components/eftposPay/tip.d.ts +0 -10
- package/es/components/eftposPay/tyro/index.d.ts +0 -9
- package/es/components/eftposPay/utils/payLog.d.ts +0 -81
- package/es/components/eftposPay/windcave/receiptAction.d.ts +0 -23
- package/es/components/eftposPay/windcave/windcave.d.ts +0 -7
- package/es/components/kioskSkuDetail/index.d.ts +0 -39
- package/es/components/kioskSkuDetail/locales.d.ts +0 -48
- package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.d.ts +0 -16
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/index.d.ts +0 -15
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +0 -83
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +0 -22
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -25
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +0 -16
- package/es/components/pay/toC/PaymentMethods/index.d.ts +0 -9
- package/es/components/pay/toC/index.d.ts +0 -3
- package/es/components/pay/toC/locales.d.ts +0 -631
- package/es/components/pay/toC/payGroup.d.ts +0 -59
- package/es/components/pay/toC/serve.d.ts +0 -87
- package/es/components/pay/toC/utils.d.ts +0 -65
- package/es/components/ruleSetting/locales.d.ts +0 -78
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -10
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -5
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -13
- package/es/components/ticketBooking/index.d.ts +0 -8
- package/es/components/venueBooking/components/Cart/index.d.ts +0 -28
- package/es/components/venueBooking/components/Footer/index.d.ts +0 -8
- package/es/index.d.ts +0 -87
- package/es/plus/skuOptionsSelection/components/NormalCard/index.d.ts +0 -6
- package/es/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +0 -4
- package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +0 -16
- package/es/plus/skuOptionsSelection/index.d.ts +0 -5
- package/es/plus/skuOptionsSelection/locales.d.ts +0 -58
- package/es/plus/skuOptionsSelection/types.d.ts +0 -458
- package/es/plus/skuOptionsSelection/utils/transformBundleGroup.d.ts +0 -19
- package/es/plus/skuOptionsSelection/utils/transformOptionGroup.d.ts +0 -1
- package/es/plus/skuOptionsSelection/utils/transformSelectorValueToValue.d.ts +0 -4
- package/es/plus/skuOptionsSelection/utils/transformValueToSelectorValue.d.ts +0 -4
- package/es/plus/skuOptionsSelection/utils/transformVariantGroup.d.ts +0 -1
- package/es/pro/Cards/components/SKUCard/index.d.ts +0 -5
- package/es/pro/Login2.0/components/phoneValidation.d.ts +0 -17
- package/lib/components/appointmentBooking/components/Form/index.d.ts +0 -4
- package/lib/components/appointmentBooking/components/Services/index.d.ts +0 -4
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -4
- package/lib/components/appointmentBooking/hooks.d.ts +0 -107
- package/lib/components/appointmentBooking/utils.d.ts +0 -227
- package/lib/components/booking/components/footer/utils.d.ts +0 -47
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -9
- package/lib/components/booking/components/voucher/index.d.ts +0 -4
- package/lib/components/booking/info/service/editService/constants.d.ts +0 -1
- package/lib/components/booking/info/service/editService/index.d.ts +0 -7
- package/lib/components/booking/info/service2/utils.d.ts +0 -248
- package/lib/components/booking/info2/index.d.ts +0 -12
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -12
- package/lib/components/booking/locales.d.ts +0 -1489
- package/lib/components/booking/model.d.ts +0 -120
- package/lib/components/eftposPay/amount.d.ts +0 -21
- package/lib/components/eftposPay/app.d.ts +0 -11
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -4
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -4
- package/lib/components/eftposPay/component/fail/network.d.ts +0 -9
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -10
- package/lib/components/eftposPay/component/manual/index.d.ts +0 -10
- package/lib/components/eftposPay/component/signature/index.d.ts +0 -9
- package/lib/components/eftposPay/device.d.ts +0 -24
- package/lib/components/eftposPay/index.d.ts +0 -5
- package/lib/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/lib/components/eftposPay/linkly/index.d.ts +0 -3
- package/lib/components/eftposPay/pay.d.ts +0 -21
- package/lib/components/eftposPay/payo/config.d.ts +0 -13
- package/lib/components/eftposPay/payo/hooks.d.ts +0 -10
- package/lib/components/eftposPay/payo/payment.d.ts +0 -66
- package/lib/components/eftposPay/tip.d.ts +0 -10
- package/lib/components/eftposPay/tyro/index.d.ts +0 -9
- package/lib/components/eftposPay/utils/payLog.d.ts +0 -81
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +0 -23
- package/lib/components/eftposPay/windcave/windcave.d.ts +0 -7
- package/lib/components/kioskSkuDetail/index.d.ts +0 -39
- package/lib/components/kioskSkuDetail/locales.d.ts +0 -48
- package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.d.ts +0 -16
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/index.d.ts +0 -15
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +0 -83
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +0 -22
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -25
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +0 -16
- package/lib/components/pay/toC/PaymentMethods/index.d.ts +0 -9
- package/lib/components/pay/toC/index.d.ts +0 -3
- package/lib/components/pay/toC/locales.d.ts +0 -631
- package/lib/components/pay/toC/payGroup.d.ts +0 -59
- package/lib/components/pay/toC/serve.d.ts +0 -87
- package/lib/components/pay/toC/utils.d.ts +0 -65
- package/lib/components/ruleSetting/locales.d.ts +0 -78
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -10
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -5
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -13
- package/lib/components/ticketBooking/index.d.ts +0 -8
- package/lib/components/venueBooking/components/Cart/index.d.ts +0 -28
- package/lib/components/venueBooking/components/Footer/index.d.ts +0 -8
- package/lib/index.d.ts +0 -87
- package/lib/plus/skuOptionsSelection/components/NormalCard/index.d.ts +0 -6
- package/lib/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +0 -4
- package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +0 -16
- package/lib/plus/skuOptionsSelection/index.d.ts +0 -5
- package/lib/plus/skuOptionsSelection/locales.d.ts +0 -58
- package/lib/plus/skuOptionsSelection/types.d.ts +0 -458
- package/lib/plus/skuOptionsSelection/utils/transformBundleGroup.d.ts +0 -19
- package/lib/plus/skuOptionsSelection/utils/transformOptionGroup.d.ts +0 -1
- package/lib/plus/skuOptionsSelection/utils/transformSelectorValueToValue.d.ts +0 -4
- package/lib/plus/skuOptionsSelection/utils/transformValueToSelectorValue.d.ts +0 -4
- package/lib/plus/skuOptionsSelection/utils/transformVariantGroup.d.ts +0 -1
- package/lib/pro/Cards/components/SKUCard/index.d.ts +0 -5
- package/lib/pro/Login2.0/components/phoneValidation.d.ts +0 -17
|
@@ -166,10 +166,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
166
166
|
export declare const getDuration: (duration: number | {
|
|
167
167
|
type: string;
|
|
168
168
|
value: number;
|
|
169
|
-
}) => number | {
|
|
169
|
+
}) => number | "flexible" | {
|
|
170
170
|
type: string;
|
|
171
171
|
value: number;
|
|
172
|
-
}
|
|
172
|
+
};
|
|
173
173
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
174
174
|
export declare const getIsEdit: (state: any) => boolean;
|
|
175
175
|
export {};
|
|
@@ -8,7 +8,7 @@ export declare const useCupAction: () => {
|
|
|
8
8
|
* @return {*}
|
|
9
9
|
*/
|
|
10
10
|
export declare const useBatchCupAction: () => {
|
|
11
|
-
run: (this: unknown, eco_cup_ids:
|
|
11
|
+
run: (this: unknown, eco_cup_ids: number[] | string[]) => Promise<boolean>;
|
|
12
12
|
loading: boolean;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
|
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
-
readonly statusRef: React.MutableRefObject<"
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"warn" | "success" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -176,7 +176,7 @@ export declare const updateCustom: (payload: {
|
|
|
176
176
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
|
177
177
|
type: EActionTypes;
|
|
178
178
|
payload: {
|
|
179
|
-
status: "
|
|
179
|
+
status: "warn" | "success" | "loading" | "fail" | "question";
|
|
180
180
|
};
|
|
181
181
|
};
|
|
182
182
|
/**
|
|
@@ -197,7 +197,7 @@ export declare const updateComponent: (component: string, render?: boolean) => {
|
|
|
197
197
|
} | {
|
|
198
198
|
readonly type: "step";
|
|
199
199
|
readonly render: boolean;
|
|
200
|
-
|
|
200
|
+
component?: undefined;
|
|
201
201
|
};
|
|
202
202
|
};
|
|
203
203
|
/**
|
|
@@ -297,9 +297,9 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
297
297
|
name?: string | undefined;
|
|
298
298
|
symbol?: string | undefined;
|
|
299
299
|
amount?: string | number | undefined;
|
|
300
|
-
mode?: "
|
|
300
|
+
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
|
301
301
|
order_id?: string | number | undefined;
|
|
302
|
-
eftpos?: "
|
|
302
|
+
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
|
|
303
303
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
304
304
|
key?: number | undefined;
|
|
305
305
|
step?: number | undefined;
|
|
@@ -310,7 +310,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
310
310
|
net?: boolean | undefined;
|
|
311
311
|
component?: string | undefined;
|
|
312
312
|
form?: string | undefined;
|
|
313
|
-
status?: "
|
|
313
|
+
status?: "warn" | "success" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
314
314
|
warn?: string | undefined;
|
|
315
315
|
steps?: {
|
|
316
316
|
/** 用于重置当前步骤 */
|
|
@@ -67,20 +67,20 @@ export default function Cart(props) {
|
|
|
67
67
|
|
|
68
68
|
// 从 summary 中提取总金额(兼容多种字段名)
|
|
69
69
|
var totalAmount = (_ref = (_ref2 = (_ref3 = (_summary$total_amount = summary === null || summary === void 0 ? void 0 : summary.total_amount) !== null && _summary$total_amount !== void 0 ? _summary$total_amount : summary === null || summary === void 0 ? void 0 : summary.expect_amount) !== null && _ref3 !== void 0 ? _ref3 : summary === null || summary === void 0 ? void 0 : summary.amount) !== null && _ref2 !== void 0 ? _ref2 : summary === null || summary === void 0 ? void 0 : summary.total) !== null && _ref !== void 0 ? _ref : '0.00';
|
|
70
|
+
|
|
71
|
+
// VenueBooking 场景下不展示 ProductCard 的 like(心形)图标,
|
|
72
|
+
// 通过在 item 层注入 is_hide_like 覆盖 Time 组件的渲染条件
|
|
70
73
|
var cartProducts = useMemo(function () {
|
|
71
74
|
return (items || []).map(function (item) {
|
|
72
75
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
73
|
-
symbol: (item === null || item === void 0 ? void 0 : item.symbol) || symbol
|
|
76
|
+
symbol: (item === null || item === void 0 ? void 0 : item.symbol) || symbol,
|
|
77
|
+
is_hide_like: true
|
|
74
78
|
});
|
|
75
79
|
});
|
|
76
80
|
}, [items, symbol]);
|
|
77
81
|
|
|
78
|
-
//
|
|
79
|
-
var confirmOrderText =
|
|
80
|
-
if (currentStep === 'select-venue') return String(locales.getText('pisell2.venue.action.next.addons') || '下一步:附加项');
|
|
81
|
-
if (currentStep === 'addons') return String(locales.getText('pisell2.venue.action.review.pay') || '确认 & 支付');
|
|
82
|
-
return String(locales.getText('pisell2.venue.action.pay.now') || '立即支付');
|
|
83
|
-
}();
|
|
82
|
+
// 按钮文案:最后一步显示"立即支付",其余步骤统一显示"下一步"
|
|
83
|
+
var confirmOrderText = currentStep === 'checkout' ? String(locales.getText('pisell2.venue.action.pay.now') || '立即支付') : String(locales.getText('pisell2.venue.action.next') || '下一步');
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* SubTotal 金额明细列表
|
|
@@ -43,10 +43,6 @@ export default function Checkout() {
|
|
|
43
43
|
var _ref, _viewModel$summary$to, _viewModel$summary2, _viewModel$summary3;
|
|
44
44
|
return Number((_ref = (_viewModel$summary$to = (_viewModel$summary2 = viewModel.summary) === null || _viewModel$summary2 === void 0 ? void 0 : _viewModel$summary2.total_amount) !== null && _viewModel$summary$to !== void 0 ? _viewModel$summary$to : (_viewModel$summary3 = viewModel.summary) === null || _viewModel$summary3 === void 0 ? void 0 : _viewModel$summary3.expect_amount) !== null && _ref !== void 0 ? _ref : 0);
|
|
45
45
|
}, [viewModel.summary]);
|
|
46
|
-
var taxFee = useMemo(function () {
|
|
47
|
-
var _viewModel$summary$ta, _viewModel$summary4;
|
|
48
|
-
return Number((_viewModel$summary$ta = (_viewModel$summary4 = viewModel.summary) === null || _viewModel$summary4 === void 0 ? void 0 : _viewModel$summary4.tax_fee) !== null && _viewModel$summary$ta !== void 0 ? _viewModel$summary$ta : 0);
|
|
49
|
-
}, [viewModel.summary]);
|
|
50
46
|
|
|
51
47
|
// 场地预订商品:带有时段信息(start_date / end_date)
|
|
52
48
|
var venueCartItems = useMemo(function () {
|
|
@@ -186,18 +182,12 @@ export default function Checkout() {
|
|
|
186
182
|
})), /*#__PURE__*/React.createElement("div", {
|
|
187
183
|
className: "mt-2 text-[15px] text-zinc-500"
|
|
188
184
|
}, locales.getText('pisell2.venue.checkout.addons.total') || '附加项合计', ": ", symbol, addonTotal.toFixed(2))) : null, /*#__PURE__*/React.createElement("div", {
|
|
189
|
-
className: "rounded-[22px] bg-[#faf7f4] p-4 ring-1 ring-black/6"
|
|
185
|
+
className: "rounded-[22px] bg-[#faf7f4] p-4 ring-1 ring-black/6 md:col-span-2"
|
|
190
186
|
}, /*#__PURE__*/React.createElement("div", {
|
|
191
187
|
className: "text-sm font-semibold text-[#a69183]"
|
|
192
188
|
}, locales.getText('pisell2.venue.checkout.subtotal') || '预订小计'), /*#__PURE__*/React.createElement("div", {
|
|
193
189
|
className: "mt-3 text-[30px] font-extrabold text-zinc-900"
|
|
194
|
-
}, symbol, Number.isNaN(bookingSubtotal) ? '0.00' : bookingSubtotal.toFixed(2))),
|
|
195
|
-
className: "rounded-[22px] bg-[#faf7f4] p-4 ring-1 ring-black/6"
|
|
196
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
197
|
-
className: "text-sm font-semibold text-[#a69183]"
|
|
198
|
-
}, locales.getText('pisell2.venue.checkout.tax') || '税费'), /*#__PURE__*/React.createElement("div", {
|
|
199
|
-
className: "mt-3 text-[15px] font-semibold text-zinc-900"
|
|
200
|
-
}, symbol, Number.isNaN(taxFee) ? '0.00' : taxFee.toFixed(2))) : null)), /*#__PURE__*/React.createElement("div", {
|
|
190
|
+
}, symbol, Number.isNaN(bookingSubtotal) ? '0.00' : bookingSubtotal.toFixed(2))))), /*#__PURE__*/React.createElement("div", {
|
|
201
191
|
className: "space-y-4"
|
|
202
192
|
}, /*#__PURE__*/React.createElement("div", {
|
|
203
193
|
className: "rounded-[28px] bg-white p-5 shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6 md:p-6"
|
|
@@ -27,8 +27,8 @@ export default function Content() {
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* 动态测量 Step Header 高度并写入 --vb-grid-sticky-top。
|
|
30
|
-
* 供 TimeGrid
|
|
31
|
-
*
|
|
30
|
+
* 供 TimeGrid sticky 表头作为 top 偏移,以及 Cart 侧栏 sticky top 计算使用,
|
|
31
|
+
* 保证三者不互相覆盖。
|
|
32
32
|
*/
|
|
33
33
|
useEffect(function () {
|
|
34
34
|
var wrap = stepHeaderRef.current;
|
|
@@ -37,9 +37,7 @@ export default function Content() {
|
|
|
37
37
|
if (!scope) return undefined;
|
|
38
38
|
function update() {
|
|
39
39
|
if (!wrap) return;
|
|
40
|
-
|
|
41
|
-
var value = isSticky ? "".concat(wrap.offsetHeight, "px") : '0px';
|
|
42
|
-
scope === null || scope === void 0 || scope.style.setProperty('--vb-grid-sticky-top', value);
|
|
40
|
+
scope === null || scope === void 0 || scope.style.setProperty('--vb-grid-sticky-top', "".concat(wrap.offsetHeight, "px"));
|
|
43
41
|
}
|
|
44
42
|
update();
|
|
45
43
|
var ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(update) : null;
|
|
@@ -51,7 +49,7 @@ export default function Content() {
|
|
|
51
49
|
};
|
|
52
50
|
}, []);
|
|
53
51
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, "\n @keyframes slideLeft { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: translateX(0); } }\n @keyframes slideRight { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: translateX(0); } }\n @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }\n /* \u9AA8\u67B6\u5C4F\u5149\u6761\uFF1A\u4ECE\u5DE6\u5230\u53F3\u626B\u8FC7\u8425\u9020\u6570\u636E\u52A0\u8F7D\u611F */\n @keyframes vbShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }\n .vb-skeleton-shimmer {\n position: absolute;\n inset: 0;\n background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);\n animation: vbShimmer 1.4s ease-in-out infinite;\n pointer-events: none;\n }\n\n /* \u4F5C\u7528\u57DF reset\uFF1A\u4FEE\u590D\u5BBF\u4E3B\u73AF\u5883 preflight: false \u5BFC\u81F4\u6D4F\u89C8\u5668\u9ED8\u8BA4\u6837\u5F0F\u6CC4\u5165 */\n .venue-booking-scope *,\n .venue-booking-scope *::before,\n .venue-booking-scope *::after {\n box-sizing: border-box;\n }\n .venue-booking-scope {\n --vb-primary: var(--theme-color, #ea1018);\n --vb-primary-light: color-mix(in srgb, var(--vb-primary) 12%, #fff);\n --vb-grid-sticky-top: 0px;\n font-size: 16px;\n line-height: 1.5;\n }\n .venue-booking-scope .vb-primary-text { color: var(--vb-primary); }\n .venue-booking-scope button {\n border: none;\n outline: none;\n background: transparent;\n font: inherit;\n color: inherit;\n padding: 0;\n cursor: pointer;\n }\n /* \u4EC5\u91CD\u7F6E\u65E0 class \u7684\u539F\u751F\u8F93\u5165\u6846\uFF0C\u907F\u514D\u8986\u76D6 Tailwind \u7EC4\u4EF6\u663E\u5F0F\u8FB9\u6846 */\n .venue-booking-scope input:not([class]),\n .venue-booking-scope textarea:not([class]) {\n border: none;\n outline: none;\n font: inherit;\n color: inherit;\n }\n\n /* \u8D2D\u7269\u8F66\u5185 Promotion \u533A\u5757\uFF1A\u7F29\u5C0F\u6807\u9898\u5B57\u53F7\uFF0C\u4E0E SubTotal \u7EDF\u4E00\u4E3A 16px */\n .venue-booking-scope .pisell-lowcode__appointment-booking-voucher-container .voucher-title .voucher-title-left {\n font-size: 16px;\n font-weight: 600;\n line-height: 24px;\n }\n .venue-booking-scope .pisell-lowcode__appointment-booking-voucher-container .voucher-title .voucher-title-right {\n font-size: 14px;\n font-weight: 500;\n }\n\n /* \u684C\u9762\u7AEF embedded-footer \u7C98\u5728\u4FA7\u8FB9\u680F\u5E95\u90E8 */\n .venue-booking-scope .pisell-venue-booking-cart-embedded-footer {\n position: sticky;\n bottom: 0;\n z-index: 5;\n background: #fff;\n border-radius: 0 0 28px 28px;\n }\n "), /*#__PURE__*/React.createElement("main", {
|
|
54
|
-
className: "mx-auto max-w-[1500px]
|
|
52
|
+
className: "mx-auto max-w-[1500px] md:px-6 md:pt-6 lg:pb-12 h-full overscroll-none"
|
|
55
53
|
}, /*#__PURE__*/React.createElement("div", {
|
|
56
54
|
className: "space-y-2 md:space-y-4",
|
|
57
55
|
style: {
|
|
@@ -59,13 +57,16 @@ export default function Content() {
|
|
|
59
57
|
}
|
|
60
58
|
}, /*#__PURE__*/React.createElement("div", {
|
|
61
59
|
ref: stepHeaderRef,
|
|
62
|
-
className: "sticky top-0 z-
|
|
60
|
+
className: "sticky top-0 z-40"
|
|
63
61
|
}, /*#__PURE__*/React.createElement(Header, null)), /*#__PURE__*/React.createElement("div", {
|
|
64
62
|
className: "grid max-w-full gap-2 md:gap-4 lg:grid-cols-[minmax(0,1fr)_390px] xl:grid-cols-[minmax(0,1fr)_420px]"
|
|
65
63
|
}, /*#__PURE__*/React.createElement("section", {
|
|
66
64
|
className: "min-w-0 space-y-3 overscroll-none md:space-y-5"
|
|
67
65
|
}, stepRegistry[currentStep]), /*#__PURE__*/React.createElement("aside", {
|
|
68
|
-
className: "hidden lg:block sticky
|
|
66
|
+
className: "hidden lg:block sticky self-start z-10 rounded-[28px] bg-white shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6",
|
|
67
|
+
style: {
|
|
68
|
+
top: 'calc(var(--vb-grid-sticky-top, 0px) + 1.5rem)'
|
|
69
|
+
}
|
|
69
70
|
}, /*#__PURE__*/React.createElement(Cart, {
|
|
70
71
|
embedded: true,
|
|
71
72
|
open: true,
|
|
@@ -75,6 +76,6 @@ export default function Content() {
|
|
|
75
76
|
onNext: handlePrimaryAction,
|
|
76
77
|
confirmLoading: isSubmittingOrder
|
|
77
78
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
className: "sticky bottom-0 z-
|
|
79
|
+
className: "sticky bottom-0 z-41 block lg:hidden"
|
|
79
80
|
}, /*#__PURE__*/React.createElement(Footer, null))));
|
|
80
81
|
}
|
|
@@ -41,15 +41,9 @@ export default function Footer() {
|
|
|
41
41
|
return parsedAmount.toFixed(2);
|
|
42
42
|
}, [viewModel.summary]);
|
|
43
43
|
|
|
44
|
-
/**
|
|
44
|
+
/** 操作按钮文案:最后一步显示"立即支付",其余步骤统一显示"下一步" */
|
|
45
45
|
var actionText = useMemo(function () {
|
|
46
|
-
|
|
47
|
-
return String(locales.getText('pisell2.venue.action.next.addons') || '下一步:附加项');
|
|
48
|
-
}
|
|
49
|
-
if (currentStep === 'addons') {
|
|
50
|
-
return String(locales.getText('pisell2.venue.action.review.pay') || '确认 & 支付');
|
|
51
|
-
}
|
|
52
|
-
return String(locales.getText('pisell2.venue.action.pay.now') || '立即支付');
|
|
46
|
+
return currentStep === 'checkout' ? String(locales.getText('pisell2.venue.action.pay.now') || '立即支付') : String(locales.getText('pisell2.venue.action.next') || '下一步');
|
|
53
47
|
}, [currentStep]);
|
|
54
48
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
55
49
|
className: "pisell-venue-booking-footer"
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
1
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
12
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
13
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -8,27 +18,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
8
18
|
* venueBooking 步骤导航头部
|
|
9
19
|
* 展示三步流程进度条(选场地 → 附加商品 → 结账),支持点击跳转已完成步骤
|
|
10
20
|
*/
|
|
11
|
-
import React, { useRef, useState } from 'react';
|
|
21
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
12
22
|
import { Modal } from 'antd';
|
|
13
23
|
import { locales } from '@pisell/utils';
|
|
14
24
|
import { Iconfont } from '@pisell/materials';
|
|
15
25
|
import { useVenueBookingContext } from "../../context";
|
|
16
|
-
|
|
17
|
-
/** 步骤配置:序号、路由 key、国际化标题 key */
|
|
18
|
-
var STEP_ITEMS = [{
|
|
19
|
-
n: 1,
|
|
20
|
-
key: 'select-venue',
|
|
21
|
-
titleKey: 'pisell2.venue.step.select'
|
|
22
|
-
}, {
|
|
23
|
-
n: 2,
|
|
24
|
-
key: 'addons',
|
|
25
|
-
titleKey: 'pisell2.venue.step.addons'
|
|
26
|
-
}, {
|
|
27
|
-
n: 3,
|
|
28
|
-
key: 'checkout',
|
|
29
|
-
titleKey: 'pisell2.venue.step.checkout'
|
|
30
|
-
}];
|
|
31
26
|
export default function Header() {
|
|
27
|
+
var _viewModel$addonProdu2;
|
|
32
28
|
var _useVenueBookingConte = useVenueBookingContext(),
|
|
33
29
|
currentStep = _useVenueBookingConte.currentStep,
|
|
34
30
|
canNext = _useVenueBookingConte.canNext,
|
|
@@ -44,6 +40,31 @@ export default function Header() {
|
|
|
44
40
|
confirmOpen = _useState4[0],
|
|
45
41
|
setConfirmOpen = _useState4[1];
|
|
46
42
|
var cardRef = useRef(null);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 步骤配置:当 addonProductList 为空时跳过 addons 步骤,自动重排序号。
|
|
46
|
+
* - 有附加商品:select-venue → addons → checkout(3 步)
|
|
47
|
+
* - 无附加商品:select-venue → checkout(2 步)
|
|
48
|
+
*/
|
|
49
|
+
var STEP_ITEMS = useMemo(function () {
|
|
50
|
+
var _viewModel$addonProdu;
|
|
51
|
+
var hasAddons = (((_viewModel$addonProdu = viewModel.addonProductList) === null || _viewModel$addonProdu === void 0 ? void 0 : _viewModel$addonProdu.length) || 0) > 0;
|
|
52
|
+
var base = [{
|
|
53
|
+
key: 'select-venue',
|
|
54
|
+
titleKey: 'pisell2.venue.step.select'
|
|
55
|
+
}].concat(_toConsumableArray(hasAddons ? [{
|
|
56
|
+
key: 'addons',
|
|
57
|
+
titleKey: 'pisell2.venue.step.addons'
|
|
58
|
+
}] : []), [{
|
|
59
|
+
key: 'checkout',
|
|
60
|
+
titleKey: 'pisell2.venue.step.checkout'
|
|
61
|
+
}]);
|
|
62
|
+
return base.map(function (item, idx) {
|
|
63
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
64
|
+
n: idx + 1
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}, [(_viewModel$addonProdu2 = viewModel.addonProductList) === null || _viewModel$addonProdu2 === void 0 ? void 0 : _viewModel$addonProdu2.length]);
|
|
47
68
|
var currentStepIndex = STEP_ITEMS.findIndex(function (item) {
|
|
48
69
|
return item.key === currentStep;
|
|
49
70
|
});
|
|
@@ -125,7 +146,7 @@ export default function Header() {
|
|
|
125
146
|
});
|
|
126
147
|
return /*#__PURE__*/React.createElement("div", {
|
|
127
148
|
ref: cardRef,
|
|
128
|
-
className: "relative
|
|
149
|
+
className: "relative bg-white p-3 md:rounded-[24px] md:p-4 ring-1 ring-black/6 shadow-[0_10px_30px_rgba(20,20,20,0.04)]"
|
|
129
150
|
}, /*#__PURE__*/React.createElement(Modal, {
|
|
130
151
|
open: confirmOpen,
|
|
131
152
|
onCancel: function onCancel() {
|
|
@@ -11,7 +11,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
11
|
*/
|
|
12
12
|
import React, { useMemo } from 'react';
|
|
13
13
|
import { locales } from '@pisell/utils';
|
|
14
|
-
import { Iconfont } from '@pisell/materials';
|
|
15
14
|
import { useVenueBookingContext } from "../../../context";
|
|
16
15
|
export default function CourtFilter() {
|
|
17
16
|
var _useVenueBookingConte = useVenueBookingContext(),
|
|
@@ -40,22 +39,7 @@ export default function CourtFilter() {
|
|
|
40
39
|
})));
|
|
41
40
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
41
|
className: "mt-4 grid gap-3 md:mt-5 xl:grid-cols-[1fr_auto] xl:items-center"
|
|
43
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className: "flex items-center gap-3 rounded-[18px] border border-black/8 bg-[#fafafa] px-4 py-3"
|
|
45
|
-
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
46
|
-
type: "pisell2-search-lg",
|
|
47
|
-
style: {
|
|
48
|
-
fontSize: 16,
|
|
49
|
-
color: '#a1a1aa'
|
|
50
|
-
}
|
|
51
|
-
}), /*#__PURE__*/React.createElement("input", {
|
|
52
|
-
value: search,
|
|
53
|
-
onChange: function onChange(e) {
|
|
54
|
-
return setSearch(e.target.value);
|
|
55
|
-
},
|
|
56
|
-
placeholder: String(locales.getText('pisell2.venue.search.placeholder') || '搜索场地'),
|
|
57
|
-
className: "w-full border-0 bg-transparent text-sm outline-none placeholder:text-zinc-400"
|
|
58
|
-
})), courtTypes.length > 1 ? /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
}, courtTypes.length > 1 ? /*#__PURE__*/React.createElement("div", {
|
|
59
43
|
className: "flex flex-wrap gap-2"
|
|
60
44
|
}, filterOptions.map(function (opt) {
|
|
61
45
|
return /*#__PURE__*/React.createElement("button", {
|
|
@@ -18,7 +18,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
18
18
|
*/
|
|
19
19
|
import React, { useEffect, useMemo, useRef, useCallback } from 'react';
|
|
20
20
|
import { Iconfont, PisellText } from '@pisell/materials';
|
|
21
|
-
import { locales } from '@pisell/utils';
|
|
21
|
+
import { locales, isIos } from '@pisell/utils';
|
|
22
22
|
import { useVenueBookingContext } from "../../../context";
|
|
23
23
|
import { isSlotSelected as checkSlotSelected, useVenueBookingSymbol } from "../../../hooks";
|
|
24
24
|
import { formatHourHeader, isHourBoundary, buildHourGroups, buildSlotPriceInfo, getPriceColor, getSlotTag, getColumnTag, getTimeMetaFromGrid, getResourceCourtMeta, getTableGridStyle, getFirstAvailableSlotIndex, FIRST_COLUMN_WIDTH } from "../../../utils";
|
|
@@ -40,6 +40,23 @@ export default function TimeGrid() {
|
|
|
40
40
|
var tableGridStyle = useMemo(function () {
|
|
41
41
|
return getTableGridStyle(timeLabels.length);
|
|
42
42
|
}, [timeLabels.length]);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* iOS 需要 overscroll-behavior: none 阻止 body 橡皮筋回弹导致的异常;
|
|
46
|
+
* 桌面端保留 Y 方向的 scroll chaining,使鼠标悬停在此区域时仍能上下滚页面。
|
|
47
|
+
*/
|
|
48
|
+
var isIosDevice = useMemo(function () {
|
|
49
|
+
if (typeof navigator === 'undefined') return false;
|
|
50
|
+
return isIos();
|
|
51
|
+
}, []);
|
|
52
|
+
var scrollerOverscrollStyle = useMemo(function () {
|
|
53
|
+
return isIosDevice ? {
|
|
54
|
+
overscrollBehavior: 'none'
|
|
55
|
+
} : {
|
|
56
|
+
overscrollBehaviorX: 'none',
|
|
57
|
+
overscrollBehaviorY: 'auto'
|
|
58
|
+
};
|
|
59
|
+
}, [isIosDevice]);
|
|
43
60
|
var visibleResources = useMemo(function () {
|
|
44
61
|
return resources.filter(function (resource) {
|
|
45
62
|
var hitType = filter === 'ALL' || resource.productTitle === filter;
|
|
@@ -80,8 +97,11 @@ export default function TimeGrid() {
|
|
|
80
97
|
applyHeaderTransform(e.currentTarget.scrollLeft);
|
|
81
98
|
}
|
|
82
99
|
|
|
83
|
-
//
|
|
100
|
+
// 切换日期/首次加载完成时自动滚动到第一个可用时段(留 1 格前置空间便于用户感知上下文)。
|
|
101
|
+
// 依赖 isGridLoading:骨架屏阶段真实 table DOM 卸载,ref 为 null;
|
|
102
|
+
// 骨架屏结束时重新触发,此时新 DOM 已挂载且布局完成,scrollWidth 可靠。
|
|
84
103
|
useEffect(function () {
|
|
104
|
+
if (isGridLoading) return;
|
|
85
105
|
var scroller = scrollTableRef.current;
|
|
86
106
|
if (!scroller || !timeLabels.length || !grid) return;
|
|
87
107
|
var firstAvailableIndex = getFirstAvailableSlotIndex(grid);
|
|
@@ -100,7 +120,7 @@ export default function TimeGrid() {
|
|
|
100
120
|
});
|
|
101
121
|
// smooth 滚动不会立即触发 onScroll 到目标值,先手动同步一次避免首帧错位
|
|
102
122
|
applyHeaderTransform(targetLeft);
|
|
103
|
-
}, [grid === null || grid === void 0 ? void 0 : grid.date, timeLabels.length, applyHeaderTransform]);
|
|
123
|
+
}, [grid === null || grid === void 0 ? void 0 : grid.date, timeLabels.length, isGridLoading, applyHeaderTransform]);
|
|
104
124
|
|
|
105
125
|
// 横向拖拽滚动
|
|
106
126
|
useEffect(function () {
|
|
@@ -161,6 +181,31 @@ export default function TimeGrid() {
|
|
|
161
181
|
scroller.removeEventListener('pointercancel', endDrag);
|
|
162
182
|
};
|
|
163
183
|
}, [applyHeaderTransform]);
|
|
184
|
+
|
|
185
|
+
// overflow-x: auto 会使该容器成为滚动容器,浏览器默认将 wheel 事件优先交给它处理,
|
|
186
|
+
// 导致纵向滚动被静默吞掉、页面无法上下滚动。
|
|
187
|
+
// 此处拦截纵向主导的 wheel 事件,转发给 window,还原正常的页面滚动体验。
|
|
188
|
+
useEffect(function () {
|
|
189
|
+
var scroller = scrollTableRef.current;
|
|
190
|
+
if (!scroller) return undefined;
|
|
191
|
+
function onWheel(e) {
|
|
192
|
+
// 仅纵向滚动意图(deltaY 占主导)才转发给页面;
|
|
193
|
+
// 横向滚动(含 shift+scroll)不干预,由 overflow-x: auto 正常处理。
|
|
194
|
+
if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) {
|
|
195
|
+
e.preventDefault();
|
|
196
|
+
window.scrollBy({
|
|
197
|
+
top: e.deltaY,
|
|
198
|
+
behavior: 'instant'
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
scroller.addEventListener('wheel', onWheel, {
|
|
203
|
+
passive: false
|
|
204
|
+
});
|
|
205
|
+
return function () {
|
|
206
|
+
return scroller.removeEventListener('wheel', onWheel);
|
|
207
|
+
};
|
|
208
|
+
}, []);
|
|
164
209
|
function handleSlotClick(resourceId, slot) {
|
|
165
210
|
if (dragStateRef.current.moved) {
|
|
166
211
|
dragStateRef.current.moved = false;
|
|
@@ -232,15 +277,16 @@ export default function TimeGrid() {
|
|
|
232
277
|
style: {
|
|
233
278
|
color: 'var(--vb-primary)'
|
|
234
279
|
}
|
|
235
|
-
}, locales.getText('pisell2.venue.label.few.left') || '即将满') : null
|
|
280
|
+
}, locales.getText('pisell2.venue.label.few.left') || '即将满') : null, !timeMeta.soldOut && !timeMeta.fewLeft && !headerTag ? /*#__PURE__*/React.createElement("div", {
|
|
281
|
+
className: "mt-1 text-[10px] font-bold text-zinc-500"
|
|
282
|
+
}, locales.getText('pisell2.venue.label.bookable') || '充足') : null);
|
|
236
283
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
237
284
|
ref: scrollTableRef,
|
|
238
285
|
onScroll: syncHeader,
|
|
239
|
-
className: "max-w-full overflow-x-auto cursor-grab select-none touch-pan-y
|
|
240
|
-
style: {
|
|
241
|
-
WebkitOverflowScrolling: 'touch'
|
|
242
|
-
|
|
243
|
-
}
|
|
286
|
+
className: "max-w-full overflow-x-auto cursor-grab select-none touch-pan-y active:cursor-grabbing",
|
|
287
|
+
style: _objectSpread({
|
|
288
|
+
WebkitOverflowScrolling: 'touch'
|
|
289
|
+
}, scrollerOverscrollStyle)
|
|
244
290
|
}, /*#__PURE__*/React.createElement("div", {
|
|
245
291
|
className: "w-full",
|
|
246
292
|
key: grid.date
|
|
@@ -251,21 +297,12 @@ export default function TimeGrid() {
|
|
|
251
297
|
className: "grid border-b border-black/6",
|
|
252
298
|
style: tableGridStyle
|
|
253
299
|
}, /*#__PURE__*/React.createElement("div", {
|
|
254
|
-
className: "sticky left-0 z-10 border-r border-black/6 px-2 py-
|
|
300
|
+
className: "sticky left-0 z-10 border-r border-black/6 px-2 py-2 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4 ".concat(courtMeta.soldOut ? 'bg-zinc-50' : 'bg-white')
|
|
255
301
|
}, /*#__PURE__*/React.createElement("div", {
|
|
256
302
|
className: "flex items-start justify-between gap-2"
|
|
257
303
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
258
304
|
className: "text-[13px] font-extrabold leading-5 md:text-[15px] ".concat(courtMeta.soldOut ? 'text-zinc-400' : 'text-zinc-900')
|
|
259
|
-
}, resource.resourceName),
|
|
260
|
-
className: "mt-1 text-[11px] md:text-xs ".concat(courtMeta.soldOut ? 'text-zinc-400' : 'text-zinc-500')
|
|
261
|
-
}, resource.productTitle), courtMeta.soldOut ? /*#__PURE__*/React.createElement("div", {
|
|
262
|
-
className: "mt-1 text-[11px] font-semibold text-zinc-500"
|
|
263
|
-
}, locales.getText('pisell2.venue.label.sold.out') || '已满') : null, !courtMeta.soldOut && courtMeta.fewLeft ? /*#__PURE__*/React.createElement("div", {
|
|
264
|
-
className: "mt-1 text-[12px] font-bold",
|
|
265
|
-
style: {
|
|
266
|
-
color: 'var(--vb-primary)'
|
|
267
|
-
}
|
|
268
|
-
}, locales.getText('pisell2.venue.label.few.left') || '即将满') : null))), resource.slots.map(function (slot, slotIndex) {
|
|
305
|
+
}, resource.resourceName)))), resource.slots.map(function (slot, slotIndex) {
|
|
269
306
|
var isAvailable = slot.status === 'available';
|
|
270
307
|
// unavailable:该时段不提供服务(如非营业时段);occupied/past 同样不可选
|
|
271
308
|
var isUnavailable = slot.status === 'occupied' || slot.status === 'past' || slot.status === 'unavailable';
|
|
@@ -284,7 +321,7 @@ export default function TimeGrid() {
|
|
|
284
321
|
return handleSlotClick(resource.resourceId, slot);
|
|
285
322
|
},
|
|
286
323
|
disabled: isUnavailable,
|
|
287
|
-
className: "px-1 py-
|
|
324
|
+
className: "px-1 py-2 text-center transition md:px-2 ".concat(isUnavailable ? 'cursor-not-allowed bg-zinc-100 text-zinc-400' : selected ? 'text-white' : 'bg-white hover:bg-[#fff6f6]'),
|
|
288
325
|
style: _objectSpread({
|
|
289
326
|
borderLeft: isHourBoundary(timeLabel) ? '1px solid rgba(0,0,0,0.08)' : '1px solid rgba(0,0,0,0.03)',
|
|
290
327
|
borderBottom: '1px solid rgba(0,0,0,0.04)'
|
|
@@ -296,9 +333,9 @@ export default function TimeGrid() {
|
|
|
296
333
|
}, /*#__PURE__*/React.createElement("div", {
|
|
297
334
|
className: "text-lg font-bold leading-none"
|
|
298
335
|
}, "\xD7")) : selected ? /*#__PURE__*/React.createElement("div", {
|
|
299
|
-
className: "space-y-
|
|
336
|
+
className: "space-y-0.5"
|
|
300
337
|
}, /*#__PURE__*/React.createElement("div", {
|
|
301
|
-
className: "text-[11px] font-bold uppercase tracking-wide text-white/90"
|
|
338
|
+
className: "text-[11px] font-bold uppercase tracking-wide leading-4 text-white/90"
|
|
302
339
|
}, locales.getText('pisell2.venue.label.selected') || '已选'), /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
303
340
|
value: Number(slot.price || 0),
|
|
304
341
|
symbol: symbol,
|
|
@@ -306,16 +343,16 @@ export default function TimeGrid() {
|
|
|
306
343
|
showCurrencySymbol: true,
|
|
307
344
|
className: "text-sm font-extrabold text-white"
|
|
308
345
|
})) : /*#__PURE__*/React.createElement("div", {
|
|
309
|
-
className: "space-y-
|
|
346
|
+
className: "space-y-0.5"
|
|
310
347
|
}, /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
311
348
|
value: Number(slot.price || 0),
|
|
312
349
|
symbol: symbol,
|
|
313
350
|
precision: 2,
|
|
314
351
|
showCurrencySymbol: true,
|
|
315
352
|
hideDecimalForWholeNumbers: false,
|
|
316
|
-
className: "text-[13px] font-normal ".concat(priceClass, " md:text-sm")
|
|
353
|
+
className: "text-[13px] font-normal leading-4 ".concat(priceClass, " md:text-sm")
|
|
317
354
|
}), tag ? /*#__PURE__*/React.createElement("div", {
|
|
318
|
-
className: "inline-flex rounded-full px-1.5 py-0
|
|
355
|
+
className: "inline-flex rounded-full px-1.5 py-0 text-[8px] font-semibold leading-4 ring-1 md:text-[9px] ".concat(tag.className)
|
|
319
356
|
}, tagText) : null));
|
|
320
357
|
}));
|
|
321
358
|
}))));
|
|
@@ -52,7 +52,7 @@ export default function VenueSelection() {
|
|
|
52
52
|
navigateWeek(7);
|
|
53
53
|
}
|
|
54
54
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
className: "rounded-[24px] bg-white p-3 shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6 md:rounded-[28px] md:p-6"
|
|
55
|
+
className: "rounded-b-[24px] bg-white p-3 shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6 md:rounded-[28px] md:p-6"
|
|
56
56
|
}, /*#__PURE__*/React.createElement("div", {
|
|
57
57
|
className: "flex flex-col gap-2 xl:flex-row xl:items-center xl:justify-between"
|
|
58
58
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", {
|
|
@@ -69,10 +69,6 @@ export default function VenueSelection() {
|
|
|
69
69
|
onNextWeek: goNextWeek
|
|
70
70
|
})), /*#__PURE__*/React.createElement(CourtFilter, null)), /*#__PURE__*/React.createElement("div", {
|
|
71
71
|
ref: tableSectionRef,
|
|
72
|
-
className: "w-full max-w-full isolate rounded-[28px] bg-white shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6"
|
|
73
|
-
style: {
|
|
74
|
-
overflowX: 'clip',
|
|
75
|
-
overflowY: 'visible'
|
|
76
|
-
}
|
|
72
|
+
className: "w-full max-w-full isolate rounded-[28px] bg-white shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6"
|
|
77
73
|
}, /*#__PURE__*/React.createElement(TimeGrid, null)));
|
|
78
74
|
}
|