@pisell/private-materials 3.0.211 → 3.0.213

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.
Files changed (101) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +5 -5
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +6 -6
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/Sales/Cart/index.js +3 -1
  12. package/es/components/Sales/Checkout/index.js +6 -0
  13. package/es/components/Sales/Event/Detail.js +1 -1
  14. package/es/components/Sales/Init/index.d.ts +4 -0
  15. package/es/components/Sales/Init/index.js +6 -2
  16. package/es/components/Sales/Resource/serve.d.ts +1 -0
  17. package/es/components/Sales/Summary/index.d.ts +3 -0
  18. package/es/components/Sales/Summary/index.js +9 -3
  19. package/es/components/Sales/Summary/serve.d.ts +0 -2
  20. package/es/components/Sales/Summary/serve.js +0 -11
  21. package/es/components/Sales/Summary/utils.d.ts +15 -1
  22. package/es/components/Sales/Summary/utils.js +32 -3
  23. package/es/components/eftposPay/hooks.d.ts +2 -2
  24. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +6 -2
  25. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
  26. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +46 -0
  27. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -8
  28. package/es/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
  29. package/es/components/eventBooking/components/Provider/Cart/index.js +1 -5
  30. package/es/components/eventBooking/components/Provider/Cart/index.less +0 -2
  31. package/es/components/eventBooking/components/Provider/Content/index.js +24 -0
  32. package/es/components/eventBooking/components/Provider/Content/index.less +3 -2
  33. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.js +1 -2
  34. package/es/components/eventBooking/components/Provider/Event/index.less +1 -1
  35. package/es/components/eventBooking/components/Provider/Footer/index.js +18 -11
  36. package/es/components/eventBooking/components/Provider/Footer/index.less +29 -5
  37. package/es/components/eventBooking/components/Provider/Header/index.js +4 -2
  38. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.js +1 -1
  39. package/es/components/eventBooking/components/Provider/OrderProductModal/index.js +0 -1
  40. package/es/components/eventBooking/components/Provider/Resource/index.js +4 -21
  41. package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
  42. package/es/components/eventBooking/components/Provider/SelectProduct/index.js +77 -0
  43. package/es/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
  44. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.js +1 -0
  45. package/es/components/eventBooking/components/bookingDetailModal/index.js +142 -41
  46. package/es/components/eventBooking/components/bookingDetailModal/index.less +2 -2
  47. package/es/components/eventBooking/components/resourceDisplay/index.less +14 -0
  48. package/es/components/eventBooking/components/selectHolder/index.js +2 -6
  49. package/es/components/eventBooking/index.js +2 -1
  50. package/es/components/eventBooking/index.less +2 -0
  51. package/es/components/eventBooking/locales.d.ts +6 -3
  52. package/es/components/eventBooking/locales.js +22 -7
  53. package/es/components/eventBooking/utils.d.ts +9 -0
  54. package/es/components/eventBooking/utils.js +17 -0
  55. package/es/components/tabProduct/tabs/index.less +13 -3
  56. package/lib/components/Sales/Cart/index.js +6 -4
  57. package/lib/components/Sales/Checkout/index.js +3 -0
  58. package/lib/components/Sales/Event/Detail.js +1 -1
  59. package/lib/components/Sales/Init/index.d.ts +4 -0
  60. package/lib/components/Sales/Init/index.js +5 -2
  61. package/lib/components/Sales/Resource/serve.d.ts +1 -0
  62. package/lib/components/Sales/Summary/index.d.ts +3 -0
  63. package/lib/components/Sales/Summary/index.js +11 -3
  64. package/lib/components/Sales/Summary/serve.d.ts +0 -2
  65. package/lib/components/Sales/Summary/serve.js +0 -37
  66. package/lib/components/Sales/Summary/utils.d.ts +15 -1
  67. package/lib/components/Sales/Summary/utils.js +25 -5
  68. package/lib/components/eftposPay/hooks.d.ts +2 -2
  69. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +5 -0
  70. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
  71. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +82 -0
  72. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -9
  73. package/lib/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
  74. package/lib/components/eventBooking/components/Provider/Cart/index.js +1 -5
  75. package/lib/components/eventBooking/components/Provider/Cart/index.less +0 -2
  76. package/lib/components/eventBooking/components/Provider/Content/index.js +16 -0
  77. package/lib/components/eventBooking/components/Provider/Content/index.less +3 -2
  78. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.js +1 -2
  79. package/lib/components/eventBooking/components/Provider/Event/index.less +1 -1
  80. package/lib/components/eventBooking/components/Provider/Footer/index.js +14 -12
  81. package/lib/components/eventBooking/components/Provider/Footer/index.less +29 -5
  82. package/lib/components/eventBooking/components/Provider/Header/index.js +5 -2
  83. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.js +1 -1
  84. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.js +0 -1
  85. package/lib/components/eventBooking/components/Provider/Resource/index.js +4 -12
  86. package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
  87. package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +69 -0
  88. package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
  89. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.js +1 -0
  90. package/lib/components/eventBooking/components/bookingDetailModal/index.js +101 -22
  91. package/lib/components/eventBooking/components/bookingDetailModal/index.less +2 -2
  92. package/lib/components/eventBooking/components/resourceDisplay/index.less +14 -0
  93. package/lib/components/eventBooking/components/selectHolder/index.js +1 -1
  94. package/lib/components/eventBooking/index.js +2 -1
  95. package/lib/components/eventBooking/index.less +2 -0
  96. package/lib/components/eventBooking/locales.d.ts +6 -3
  97. package/lib/components/eventBooking/locales.js +10 -7
  98. package/lib/components/eventBooking/utils.d.ts +9 -0
  99. package/lib/components/eventBooking/utils.js +12 -2
  100. package/lib/components/tabProduct/tabs/index.less +13 -3
  101. package/package.json +2 -2
@@ -253,7 +253,7 @@ export var CartProvider = function CartProvider(_ref) {
253
253
  var createCartItemData = function createCartItemData() {
254
254
  var _cartData = getCurrentData().cartData;
255
255
  if (_cartData.currentCartItem) {
256
- var _eventItem$eventDetai, _eventItem$eventDetai2, _eventItem$eventDetai3, _eventItem$eventDetai4, _startDateInfo$times, _startDateInfo$times$, _eventItem$eventDetai5, _eventItem$eventDetai6, _endDateInfo$times, _endDateInfo$times$sl, _endDateInfo$times$sl2;
256
+ var _eventItem$eventDetai, _eventItem$eventDetai2, _eventItem$eventDetai3, _eventItem$eventDetai4, _startDateInfo$times, _startDateInfo$times$, _eventItem$eventDetai5, _eventItem$eventDetai6, _endDateInfo$times, _endDateInfo$times$sl, _endDateInfo$times$sl2, _eventItem$eventDetai7, _eventItem$eventDetai8, _eventItem$eventDetai9;
257
257
  var _ref2 = _cartData.currentCartItem || {},
258
258
  _id = _ref2._id,
259
259
  _ref2$eventItem = _ref2.eventItem,
@@ -290,6 +290,8 @@ export var CartProvider = function CartProvider(_ref) {
290
290
  // 是否显示时间
291
291
  show_time: true,
292
292
  end_time: endTime ? dayjs(endTime || '').format('HH:mm') : '',
293
+ custom_day_count: (_eventItem === null || _eventItem === void 0 ? void 0 : (_eventItem$eventDetai7 = _eventItem.eventDetail) === null || _eventItem$eventDetai7 === void 0 ? void 0 : (_eventItem$eventDetai8 = _eventItem$eventDetai7.selectDate) === null || _eventItem$eventDetai8 === void 0 ? void 0 : (_eventItem$eventDetai9 = _eventItem$eventDetai8.dates) === null || _eventItem$eventDetai9 === void 0 ? void 0 : _eventItem$eventDetai9.length) || 0,
294
+ is_charge_tax: bookingOptionData === null || bookingOptionData === void 0 ? void 0 : bookingOptionData.is_charge_tax,
293
295
  _originData: _objectSpread(_objectSpread({}, _cartData.currentCartItem._originData), {}, {
294
296
  product: {
295
297
  num: 1,
@@ -50,6 +50,12 @@ export var CheckoutProvider = function CheckoutProvider(_ref) {
50
50
  checkoutCallback.current({
51
51
  success: true
52
52
  });
53
+ },
54
+ onError: function onError(err) {
55
+ checkoutCallback.current({
56
+ success: false,
57
+ err: err
58
+ });
53
59
  }
54
60
  });
55
61
 
@@ -55,7 +55,7 @@ export var EventDetailProvider = function EventDetailProvider(_ref) {
55
55
  var introduction = {
56
56
  title: eventItem.title,
57
57
  price: eventItem.price,
58
- images: [eventItem.image]
58
+ images: eventItem.image ? [eventItem.image] : []
59
59
  };
60
60
  eventRef.current = eventItem;
61
61
  _setDetail({
@@ -1,5 +1,9 @@
1
1
  import React from 'react';
2
2
  interface InitData {
3
+ boardSetting?: any;
4
+ form_id?: number;
5
+ shop_id?: number;
6
+ shop?: any;
3
7
  }
4
8
  interface InitContextType {
5
9
  getBoardSetting: any;
@@ -15,6 +15,7 @@ import holder from "../Holder";
15
15
  import event from "../Event";
16
16
  import resource from "../Resource";
17
17
  import summary from "../Summary";
18
+ import { useCustomer } from "../Customer";
18
19
  // 默认步骤状态
19
20
  var defaultState = {};
20
21
 
@@ -28,6 +29,8 @@ export var InitProvider = function InitProvider(_ref) {
28
29
  hooks = _useSales.hooks,
29
30
  getCurrentData = _useSales.getCurrentData,
30
31
  getSessionStorage = _useSales.getSessionStorage;
32
+ var _useCustomer = useCustomer(),
33
+ appUtils = _useCustomer.appUtils;
31
34
  var useCustomInit = hooks.useCustomInit;
32
35
  var customInit = useCustomInit();
33
36
  var initData = useMemo(function () {
@@ -78,11 +81,12 @@ export var InitProvider = function InitProvider(_ref) {
78
81
  var getBoardSetting = useRequest(getBoardSettingApi, {
79
82
  manual: true,
80
83
  onSuccess: function onSuccess(res) {
81
- var _res$data, _res$data$config, _res$data$config$reso, _res$data$config$reso2, _res$data2;
84
+ var _res$data, _res$data$config, _res$data$config$reso, _res$data$config$reso2, _res$data2, _appUtils$getStore, _appUtils$getStore$ge, _appUtils$getStore$ge2, _appUtils$getStore$ge3;
82
85
  setInitData({
83
86
  boardSetting: res === null || res === void 0 ? void 0 : res.data,
84
87
  form_id: res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$config = _res$data.config) === null || _res$data$config === void 0 ? void 0 : (_res$data$config$reso = _res$data$config.resource) === null || _res$data$config$reso === void 0 ? void 0 : (_res$data$config$reso2 = _res$data$config$reso.booking_event_v2_resource) === null || _res$data$config$reso2 === void 0 ? void 0 : _res$data$config$reso2.form_id,
85
- shop_id: res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.shop_id
88
+ shop_id: res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.shop_id,
89
+ shop: (_appUtils$getStore = appUtils.getStore()) === null || _appUtils$getStore === void 0 ? void 0 : (_appUtils$getStore$ge = _appUtils$getStore.getState()) === null || _appUtils$getStore$ge === void 0 ? void 0 : (_appUtils$getStore$ge2 = _appUtils$getStore$ge.core) === null || _appUtils$getStore$ge2 === void 0 ? void 0 : (_appUtils$getStore$ge3 = _appUtils$getStore$ge2.core) === null || _appUtils$getStore$ge3 === void 0 ? void 0 : _appUtils$getStore$ge3.shop
86
90
  });
87
91
  }
88
92
  });
@@ -1,4 +1,5 @@
1
1
  export declare const getResourceListApi: (params: {
2
2
  form_id: string;
3
3
  shop_id: string;
4
+ form_data_status: string;
4
5
  }) => Promise<any>;
@@ -4,6 +4,9 @@ interface SummaryData {
4
4
  interface SummaryContextType {
5
5
  subtotal: number | string;
6
6
  total: number | string;
7
+ taxTitle?: string;
8
+ totalTaxFee?: string;
9
+ isPriceIncludeTax?: 0 | 1;
7
10
  }
8
11
  interface SummaryProviderProps {
9
12
  children: React.ReactNode;
@@ -1,6 +1,7 @@
1
1
  import React, { createContext, useMemo } from 'react';
2
2
  import { useCart } from "../Cart";
3
3
  import { calculatePriceDetails } from "./utils";
4
+ import { useInit } from "../Init";
4
5
  // 默认步骤状态
5
6
  var defaultState = {};
6
7
 
@@ -10,14 +11,19 @@ export var SummaryProvider = function SummaryProvider(_ref) {
10
11
  var children = _ref.children;
11
12
  var _useCart = useCart(),
12
13
  cartData = _useCart.cartData;
14
+ var _useInit = useInit(),
15
+ initData = _useInit.initData;
13
16
  var summaryData = useMemo(function () {
14
- return calculatePriceDetails(cartData.cartItems);
15
- }, [cartData.cartItems]);
17
+ return calculatePriceDetails((initData === null || initData === void 0 ? void 0 : initData.shop) || {}, cartData.cartItems);
18
+ }, [cartData.cartItems, initData === null || initData === void 0 ? void 0 : initData.shop]);
16
19
  var contextValue = {
17
20
  // 商品总价
18
21
  subtotal: summaryData.subtotal,
19
22
  // 总金额
20
- total: summaryData.total
23
+ total: summaryData.total,
24
+ taxTitle: summaryData.taxTitle,
25
+ totalTaxFee: summaryData.totalTaxFee,
26
+ isPriceIncludeTax: summaryData.isPriceIncludeTax
21
27
  };
22
28
  return /*#__PURE__*/React.createElement(SummaryContext.Provider, {
23
29
  value: contextValue
@@ -1,2 +0,0 @@
1
- export declare const getHolderListApi: () => any;
2
- export declare const createHolderApi: (data: any) => any;
@@ -1,11 +0,0 @@
1
- import { get, post } from "../../../utils/request";
2
-
3
- // 获取holder列表
4
- export var getHolderListApi = function getHolderListApi() {
5
- return get('/api/holder/list');
6
- };
7
-
8
- // 创建holder
9
- export var createHolderApi = function createHolderApi(data) {
10
- return post('/api/holder/create', data);
11
- };
@@ -1,10 +1,15 @@
1
+ import Decimal from 'decimal.js';
1
2
  interface CartItem {
2
3
  price: number | string;
3
4
  quantity?: number;
5
+ [k: string]: any;
4
6
  }
5
7
  interface PriceDetail {
6
8
  subtotal: string;
7
9
  total: string;
10
+ taxTitle?: string;
11
+ totalTaxFee?: string;
12
+ isPriceIncludeTax?: 0 | 1;
8
13
  }
9
14
  /**
10
15
  * 计算商品小计(不含其他费用)
@@ -12,11 +17,20 @@ interface PriceDetail {
12
17
  * @returns 商品总价字符串,保留2位小数
13
18
  */
14
19
  export declare const calculateSubtotal: (items: CartItem[]) => string;
20
+ /**
21
+ * @title: 单个商品的税费
22
+ * @description:
23
+ * 单个商品的税费 = 商品销售单价(折扣后) * 税率 * is_charge_tax /( 1+ 税率 * is_price_include_tax)
24
+ * $taxFee = $price * $taxRate * $isChargeTax / (1 + $taxRate * $isPriceIncludeTax);
25
+ * @return {*}
26
+ * @Author: xiangfeng.xue
27
+ */
28
+ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
15
29
  /**
16
30
  * 计算所有价格明细
17
31
  * @param items - 购物车商品数组
18
32
  * @param options - 其他费用配置
19
33
  * @returns 价格明细对象
20
34
  */
21
- export declare const calculatePriceDetails: (items: CartItem[]) => PriceDetail;
35
+ export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[]) => PriceDetail;
22
36
  export {};
@@ -16,19 +16,48 @@ export var calculateSubtotal = function calculateSubtotal(items) {
16
16
  return subtotal.toFixed(2);
17
17
  };
18
18
 
19
+ /**
20
+ * @title: 单个商品的税费
21
+ * @description:
22
+ * 单个商品的税费 = 商品销售单价(折扣后) * 税率 * is_charge_tax /( 1+ 税率 * is_price_include_tax)
23
+ * $taxFee = $price * $taxRate * $isChargeTax / (1 + $taxRate * $isPriceIncludeTax);
24
+ * @return {*}
25
+ * @Author: xiangfeng.xue
26
+ */
27
+ export var calculateTaxFee = function calculateTaxFee(shopInfo, items) {
28
+ if (!(items !== null && items !== void 0 && items.length)) {
29
+ return '0.00';
30
+ }
31
+ var _ref = shopInfo || {},
32
+ is_price_include_tax = _ref.is_price_include_tax,
33
+ tax_rate = _ref.tax_rate;
34
+ var totalTaxFee = items.reduce(function (sum, item) {
35
+ var price = new Decimal(item.price || 0);
36
+ var taxRate = new Decimal(tax_rate || 0).div(100);
37
+ var productTaxRate = price.times(taxRate).times((item === null || item === void 0 ? void 0 : item.is_charge_tax) || 0).div(taxRate.times(is_price_include_tax || 0).plus(1));
38
+ return sum.plus(productTaxRate);
39
+ }, new Decimal(0));
40
+ return totalTaxFee;
41
+ };
42
+
19
43
  /**
20
44
  * 计算所有价格明细
21
45
  * @param items - 购物车商品数组
22
46
  * @param options - 其他费用配置
23
47
  * @returns 价格明细对象
24
48
  */
25
- export var calculatePriceDetails = function calculatePriceDetails(items) {
49
+ export var calculatePriceDetails = function calculatePriceDetails(shopInfo, items) {
26
50
  var subtotal = new Decimal(calculateSubtotal(items));
51
+ var totalTaxFee = new Decimal(calculateTaxFee(shopInfo, items));
52
+ console.log('totalTaxFee', totalTaxFee.toFixed(2));
27
53
 
28
54
  // 计算总价
29
- var total = subtotal;
55
+ var total = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subtotal : subtotal.plus(totalTaxFee);
30
56
  return {
31
57
  subtotal: subtotal.toFixed(2),
32
- total: total.toFixed(2)
58
+ total: total.toFixed(2),
59
+ taxTitle: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_title,
60
+ totalTaxFee: totalTaxFee.toFixed(2),
61
+ isPriceIncludeTax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax
33
62
  };
34
63
  };
@@ -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<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"success" | "warn" | "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<"payo" | "tyro" | "windcave" | "stripe">;
22
+ readonly eftposRef: React.MutableRefObject<"windcave" | "tyro" | "payo" | "stripe">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import React, { useMemo, useState } from 'react';
12
12
  import { locales } from '@pisell/utils';
13
- import { Button } from '@pisell/materials';
13
+ import { Button, PisellToast } from '@pisell/materials';
14
14
  import { useCart, useHolder, useStep, useCheckout, useSales, useCustomer } from "../../../../../Sales";
15
15
  import { formatValues } from "../../../../../Sales/Checkout/utils";
16
16
  import OrderProductModal from "../../OrderProductModal/index";
@@ -66,7 +66,7 @@ var ContinueButton = function ContinueButton() {
66
66
  */
67
67
  var handleCheckout = /*#__PURE__*/function () {
68
68
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
69
- var value, result;
69
+ var value, result, _result$err;
70
70
  return _regeneratorRuntime().wrap(function _callee$(_context) {
71
71
  while (1) switch (_context.prev = _context.next) {
72
72
  case 0:
@@ -78,6 +78,10 @@ var ContinueButton = function ContinueButton() {
78
78
  // 清空数据
79
79
  if (result !== null && result !== void 0 && result.success) {
80
80
  removeSessionStorage();
81
+ } else {
82
+ PisellToast({
83
+ content: (result === null || result === void 0 ? void 0 : (_result$err = result.err) === null || _result$err === void 0 ? void 0 : _result$err.message) || ''
84
+ });
81
85
  }
82
86
  case 5:
83
87
  case "end":
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const Total: ({ className, isFooter }: any) => React.JSX.Element;
4
+ export default Total;
@@ -0,0 +1,46 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import React from 'react';
6
+ import { locales } from '@pisell/utils';
7
+ import { PisellText } from '@pisell/materials';
8
+ import { useSummary } from "../../../../../Sales";
9
+ import useEngineContext from "../../../../../../hooks/useEngineContext";
10
+ import "./index.less";
11
+ import classNames from 'classnames';
12
+ var Total = function Total(_ref) {
13
+ var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper2, _context$appHelper2$u, _context$appHelper2$u2;
14
+ var className = _ref.className,
15
+ isFooter = _ref.isFooter;
16
+ var _useSummary = useSummary(),
17
+ taxTitle = _useSummary.taxTitle,
18
+ totalTaxFee = _useSummary.totalTaxFee,
19
+ isPriceIncludeTax = _useSummary.isPriceIncludeTax,
20
+ total = _useSummary.total;
21
+ var context = useEngineContext();
22
+ console.log(taxTitle, isPriceIncludeTax, totalTaxFee, total, context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getSymbolic) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.call(_context$appHelper$ut), 'wh97978');
23
+ return /*#__PURE__*/React.createElement("div", {
24
+ className: "event-total-wrap ".concat(className)
25
+ }, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /*#__PURE__*/React.createElement("div", {
26
+ className: "gst-wrap"
27
+ }, /*#__PURE__*/React.createElement("span", null, taxTitle, isFooter ? ': ' : ''), /*#__PURE__*/React.createElement(PisellText.Amount, {
28
+ value: totalTaxFee,
29
+ showCurrencySymbol: true
30
+ })) : null, /*#__PURE__*/React.createElement("div", {
31
+ className: classNames('event-total', _defineProperty({}, ['total-gst-wrap'], !isPriceIncludeTax && Number(totalTaxFee) > 0))
32
+ }, /*#__PURE__*/React.createElement("div", {
33
+ className: "left"
34
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.event.total'), isFooter ? ': ' : ''), isFooter ? /*#__PURE__*/React.createElement(PisellText.Amount, {
35
+ value: total,
36
+ showCurrencySymbol: true,
37
+ className: "event-amount"
38
+ }) : null), isPriceIncludeTax && Number(totalTaxFee) > 0 ? /*#__PURE__*/React.createElement("span", {
39
+ className: "gst"
40
+ }, locales.getText('pisell2.event.total.gst')("".concat(isFooter ? "".concat(taxTitle, ": ") : taxTitle), "".concat(context === null || context === void 0 ? void 0 : (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : (_context$appHelper2$u = _context$appHelper2.utils) === null || _context$appHelper2$u === void 0 ? void 0 : (_context$appHelper2$u2 = _context$appHelper2$u.getSymbolic) === null || _context$appHelper2$u2 === void 0 ? void 0 : _context$appHelper2$u2.call(_context$appHelper2$u)).concat(totalTaxFee))) : null), !isFooter ? /*#__PURE__*/React.createElement(PisellText.Amount, {
41
+ value: total,
42
+ showCurrencySymbol: true,
43
+ className: "event-amount"
44
+ }) : null));
45
+ };
46
+ export default Total;
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { isMobile, locales } from '@pisell/utils';
3
- import { PisellText } from '@pisell/materials';
4
3
  import ShoppingCart from "../../../../../shoppingCart";
5
4
  import { useCart, useHolder, useSummary, useStep } from "../../../../../Sales";
6
5
  import SelectHolderModal from "../../SelectHolderModal";
7
6
  import ContinueButton from "../ContinueButton";
7
+ import Total from "./Total";
8
8
  import "./index.less";
9
9
  var CartItem = function CartItem() {
10
10
  var _useHolder = useHolder(),
@@ -56,13 +56,7 @@ var CartItem = function CartItem() {
56
56
  }
57
57
  })), /*#__PURE__*/React.createElement("div", {
58
58
  className: "event-footer"
59
- }, /*#__PURE__*/React.createElement("div", {
60
- className: "event-total-wrap"
61
- }, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.event.total')), /*#__PURE__*/React.createElement(PisellText.Amount, {
62
- value: subtotal,
63
- showCurrencySymbol: true,
64
- className: "event-amount"
65
- })), /*#__PURE__*/React.createElement(ContinueButton, null))), /*#__PURE__*/React.createElement(SelectHolderModal, {
59
+ }, /*#__PURE__*/React.createElement(Total, null), /*#__PURE__*/React.createElement(ContinueButton, null))), /*#__PURE__*/React.createElement(SelectHolderModal, {
66
60
  open: open
67
61
  }));
68
62
  };
@@ -17,19 +17,51 @@
17
17
  flex-direction: column;
18
18
  gap: 14px;
19
19
  margin-top: 6px;
20
- .event-total-wrap {
21
- color: var(--Text-Text_1, #1b1b1b);
22
- font-size: 20px;
23
- font-weight: 600;
24
- line-height: 28px;
20
+ }
21
+ }
22
+
23
+ .event-total-wrap {
24
+ color: var(--Text-Text_1, #1b1b1b);
25
+ font-size: 20px;
26
+ font-weight: 600;
27
+ line-height: 28px;
28
+ display: flex;
29
+ flex-direction: column;
30
+ align-items: start;
31
+
32
+ > div {
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: space-between;
36
+ width: 100%;
37
+ }
38
+
39
+ .gst-wrap {
40
+ font-size: 16px;
41
+ font-weight: 500;
42
+ line-height: 24px;
43
+ }
44
+
45
+ .event-total {
46
+ .left {
25
47
  display: flex;
26
- align-items: center;
27
- justify-content: space-between;
28
- .event-amount {
29
- color: var(--Blue-600, #1570ef);
48
+ flex-direction: column;
49
+ .gst {
50
+ color: var(--Gray-500, #667085);
51
+ font-size: 14px;
52
+ font-weight: 400;
53
+ line-height: 20px;
30
54
  }
31
55
  }
32
56
  }
57
+
58
+ .total-gst-wrap {
59
+ padding: 14px 0 0;
60
+ }
61
+
62
+ .event-amount {
63
+ color: var(--Blue-600, #1570ef);
64
+ }
33
65
  }
34
66
 
35
67
  .cart-mobile-item-wrap {
@@ -40,7 +72,7 @@
40
72
  .content {
41
73
  flex: 1;
42
74
  overflow-y: auto;
43
- padding: 0 0 120px;
75
+ padding: 0 0 140px;
44
76
  }
45
77
  .event-footer {
46
78
  z-index: 10;
@@ -15,12 +15,8 @@ var Cart = function Cart(_ref) {
15
15
  return _onCancel();
16
16
  },
17
17
  bodyStyle: {
18
- padding: '20px',
19
- display: 'flex',
20
- flexDirection: 'column',
21
- height: '100%'
18
+ padding: '20px'
22
19
  },
23
- mobileModalHeight: '90%',
24
20
  destroyOnClose: true,
25
21
  className: "event-cart-modal",
26
22
  footer: null
@@ -1,4 +1,2 @@
1
1
  .event-cart-modal {
2
2
  }
3
- .event-cart-modal {
4
- }
@@ -30,6 +30,30 @@ var Layout = function Layout() {
30
30
  var Com = components[key];
31
31
  return /*#__PURE__*/React.createElement(Com, null);
32
32
  }, [currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key]);
33
+
34
+ /**
35
+ * @title: 动态计算中间内容区域的高度
36
+ * @description:
37
+ * @return {*}
38
+ * @Author: WangHan
39
+ * @Date: 2025-02-18 15:36
40
+ */
41
+ useEffect(function () {
42
+ if (isMobile()) {
43
+ var _header$getBoundingCl, _footer$getBoundingCl;
44
+ var header = document.querySelector('.event-progress-bar');
45
+ var footer = document.querySelector('.pisell-section-footers-wrapper');
46
+ var content = document.querySelector('.event-content-mobile-wrap');
47
+ var headerHeight = (header === null || header === void 0 ? void 0 : (_header$getBoundingCl = header.getBoundingClientRect()) === null || _header$getBoundingCl === void 0 ? void 0 : _header$getBoundingCl.height) || 0;
48
+ var footerHeight = (footer === null || footer === void 0 ? void 0 : (_footer$getBoundingCl = footer.getBoundingClientRect()) === null || _footer$getBoundingCl === void 0 ? void 0 : _footer$getBoundingCl.height) || 0;
49
+ var windowHeight = window.innerHeight;
50
+ var contentHeight = windowHeight - headerHeight - footerHeight;
51
+ if (content && content !== null && content !== void 0 && content.style) {
52
+ content.style.height = "".concat(contentHeight, "px");
53
+ content.style.overflowY = 'auto';
54
+ }
55
+ }
56
+ }, [currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key]);
33
57
  return /*#__PURE__*/React.createElement("div", {
34
58
  className: "event-content-wrap ".concat(isMobile() ? 'event-content-mobile-wrap' : '')
35
59
  }, /*#__PURE__*/React.createElement("div", {
@@ -3,6 +3,7 @@
3
3
  display: flex;
4
4
  gap: 6px;
5
5
  // align-items: center;
6
+ flex: 1;
6
7
 
7
8
  .event-content-left {
8
9
  flex: 1;
@@ -19,10 +20,10 @@
19
20
 
20
21
  .event-content-mobile-wrap {
21
22
  width: 100%;
23
+ flex: none;
22
24
  .event-content-left {
23
- background: #fff;
24
25
  width: 100%;
25
- min-height: 100vh;
26
+ flex: none;
26
27
  .provider-information-wrap {
27
28
  width: 100%;
28
29
  }
@@ -28,8 +28,7 @@ var EmptyHolderModal = function EmptyHolderModal(props) {
28
28
  },
29
29
  onOk: function onOk() {
30
30
  return _onOk();
31
- },
32
- mobileModalHeight: '80vh'
31
+ }
33
32
  });
34
33
  };
35
34
  export default EmptyHolderModal;
@@ -6,7 +6,7 @@
6
6
  .event-booking-service-list {
7
7
  flex: 1;
8
8
  background: #ffffff;
9
- min-height: calc(100vh - 93px);
9
+ // min-height: calc(100vh - 93px);
10
10
  }
11
11
  }
12
12
 
@@ -5,14 +5,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
5
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React from 'react';
8
- import { SectionFooters, PisellText, Button, Badge, Image } from '@pisell/materials';
9
- import { locales } from '@pisell/utils';
8
+ import { SectionFooters, Button, Badge, Image } from '@pisell/materials';
10
9
  import { useState } from 'react';
11
10
  import { useCart, useHolder, useSummary } from "../../../../Sales";
12
11
  import SelectHolderModal from "../SelectHolderModal";
13
12
  import ContinueButton from "../Cart/ContinueButton";
14
13
  import shoppingCartSvg from "../../../assets/shopping-cart.svg";
15
14
  import Cart from "../Cart";
15
+ import Total from "../Cart/Item/Total";
16
16
  import "./index.less";
17
17
  var Footer = function Footer() {
18
18
  var _cartData$cartItems;
@@ -24,7 +24,7 @@ var Footer = function Footer() {
24
24
  onCloseCart = _useCart.onCloseCart,
25
25
  cartData = _useCart.cartData;
26
26
  var _useSummary = useSummary(),
27
- subtotal = _useSummary.subtotal;
27
+ total = _useSummary.total;
28
28
  // 当前本地选中的holder
29
29
  var _useState = useState(null),
30
30
  _useState2 = _slicedToArray(_useState, 2),
@@ -32,13 +32,20 @@ var Footer = function Footer() {
32
32
  setSelectedItem = _useState2[1];
33
33
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionFooters, {
34
34
  className: "section-footer-wrap",
35
- left: /*#__PURE__*/React.createElement("div", {
36
- className: "section-footer-left"
37
- }, /*#__PURE__*/React.createElement(PisellText, null, locales.getText('pisell2.event.total')), /*#__PURE__*/React.createElement(PisellText.Amount, {
38
- value: subtotal,
39
- showCurrencySymbol: true,
40
- className: "amount"
41
- })),
35
+ left:
36
+ /*#__PURE__*/
37
+ // <div className="section-footer-left">
38
+ // {/* <PisellText>{locales.getText('pisell2.event.total')}: </PisellText>
39
+ // <PisellText.Amount
40
+ // value={total}
41
+ // showCurrencySymbol={true}
42
+ // className="amount"
43
+ // /> */}
44
+ // </div>
45
+ React.createElement(Total, {
46
+ className: "section-footer-left",
47
+ isFooter: true
48
+ }),
42
49
  right: /*#__PURE__*/React.createElement("div", {
43
50
  className: "section-footer-right"
44
51
  }, /*#__PURE__*/React.createElement(Badge, {
@@ -52,7 +59,7 @@ var Footer = function Footer() {
52
59
  }, /*#__PURE__*/React.createElement(Image, {
53
60
  src: shoppingCartSvg,
54
61
  preview: false
55
- }), locales.getText('pisell2.event.cart'))), /*#__PURE__*/React.createElement(ContinueButton, null))
62
+ }))), /*#__PURE__*/React.createElement(ContinueButton, null))
56
63
  }), /*#__PURE__*/React.createElement(SelectHolderModal, {
57
64
  open: open,
58
65
  selectedItem: selectedItem,