@pisell/private-materials 3.4.2 → 3.4.4

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 (167) 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 +13 -13
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +4 -4
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/Sales/Cart/index.js +5 -1
  12. package/es/components/Sales/Cart/utils.d.ts +40 -0
  13. package/es/components/Sales/Cart/utils.js +187 -0
  14. package/es/components/Sales/Checkout/index.d.ts +4 -0
  15. package/es/components/Sales/Checkout/index.js +52 -8
  16. package/es/components/Sales/Checkout/serve.d.ts +13 -0
  17. package/es/components/Sales/Checkout/serve.js +16 -2
  18. package/es/components/Sales/Checkout/utils.d.ts +1 -0
  19. package/es/components/Sales/Checkout/utils.js +9 -2
  20. package/es/components/Sales/Event/Detail.d.ts +1 -0
  21. package/es/components/Sales/Event/Detail.js +45 -11
  22. package/es/components/Sales/Event/serve.d.ts +10 -0
  23. package/es/components/Sales/Event/serve.js +25 -0
  24. package/es/components/Sales/Summary/index.d.ts +10 -0
  25. package/es/components/Sales/Summary/index.js +17 -2
  26. package/es/components/Sales/Summary/serve.d.ts +1 -0
  27. package/es/components/Sales/Summary/serve.js +6 -0
  28. package/es/components/Sales/Summary/utils.d.ts +16 -1
  29. package/es/components/Sales/Summary/utils.js +43 -1
  30. package/es/components/appointmentBooking/components/Content/index.js +15 -1
  31. package/es/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
  32. package/es/components/appointmentBooking/components/Deposit/index.js +27 -7
  33. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +25 -20
  34. package/es/components/appointmentBooking/deposit/index.js +4 -2
  35. package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
  36. package/es/components/booking/components/browserSelect/index.js +1 -1
  37. package/es/components/booking/components/footer/index.js +32 -24
  38. package/es/components/booking/forms/model.js +5 -5
  39. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  40. package/es/components/booking/info/service/like/index.js +1 -1
  41. package/es/components/booking/info/utils.js +1 -1
  42. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  43. package/es/components/booking/info2/utilsByBooking.js +9 -3
  44. package/es/components/booking/materiels/startTime/index.js +1 -1
  45. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  46. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  47. package/es/components/booking/notes/model.js +5 -5
  48. package/es/components/booking/payments/model.js +5 -5
  49. package/es/components/booking/utils.d.ts +2 -2
  50. package/es/components/eftposPay/amount.d.ts +1 -1
  51. package/es/components/eftposPay/device.d.ts +1 -1
  52. package/es/components/eftposPay/hooks.d.ts +2 -2
  53. package/es/components/eftposPay/store/index.d.ts +5 -5
  54. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +29 -17
  55. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  56. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +17 -0
  57. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +10 -6
  58. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  59. package/es/components/eventBooking/components/bookingDetailModal/index.js +6 -3
  60. package/es/components/eventBooking/locales.d.ts +24 -0
  61. package/es/components/eventBooking/locales.js +27 -3
  62. package/es/components/listComponent/index.js +5 -5
  63. package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +18 -3
  64. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -1
  65. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.js +7 -2
  66. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.less +8 -0
  67. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +44 -18
  68. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +18 -3
  69. package/es/components/pay/toC/locales.d.ts +3 -0
  70. package/es/components/pay/toC/locales.js +3 -0
  71. package/es/components/productExtension/card/index.js +3 -3
  72. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  73. package/es/components/productExtension/fields/Forms/index.js +12 -12
  74. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  75. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  76. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  77. package/es/components/productExtension/server.js +2 -2
  78. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  79. package/es/components/schedules/calendar/index.js +4 -4
  80. package/es/components/schedules/calendar/serve.js +2 -2
  81. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  82. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  83. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  84. package/es/components/schedules/components/ResourceList/index.js +1 -1
  85. package/es/components/schedules/components/Search/index.js +5 -5
  86. package/es/components/schedules/model.js +5 -5
  87. package/es/components/schedules/openHours/index.js +1 -1
  88. package/es/components/schedules/openHours/serve.js +2 -2
  89. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  90. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  91. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  92. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  93. package/es/components/schedules/products/serve.js +2 -2
  94. package/es/components/schedules/products/utils.js +5 -5
  95. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  96. package/es/components/schedules/resources/detail/index.js +10 -10
  97. package/es/components/schedules/resources/list/index.js +2 -2
  98. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  99. package/es/components/schedules/resources/serve.js +2 -2
  100. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  101. package/es/components/schedules/utils.d.ts +1 -1
  102. package/es/components/schedules/utils.js +4 -4
  103. package/es/components/selectModal/index.js +2 -2
  104. package/es/components/ticketBooking/components/menuBar/index.js +38 -2
  105. package/es/components/ticketBooking/components/menuBar/index.less +8 -0
  106. package/es/components/ticketBooking/locales.d.ts +3 -0
  107. package/es/components/ticketBooking/locales.js +6 -3
  108. package/es/hooks/useComponents.js +1 -1
  109. package/es/utils/index.d.ts +1 -1
  110. package/lib/components/Sales/Cart/index.js +1 -0
  111. package/lib/components/Sales/Cart/utils.d.ts +40 -0
  112. package/lib/components/Sales/Cart/utils.js +129 -0
  113. package/lib/components/Sales/Checkout/index.d.ts +4 -0
  114. package/lib/components/Sales/Checkout/index.js +39 -7
  115. package/lib/components/Sales/Checkout/serve.d.ts +13 -0
  116. package/lib/components/Sales/Checkout/serve.js +7 -2
  117. package/lib/components/Sales/Checkout/utils.d.ts +1 -0
  118. package/lib/components/Sales/Checkout/utils.js +5 -2
  119. package/lib/components/Sales/Event/Detail.d.ts +1 -0
  120. package/lib/components/Sales/Event/Detail.js +37 -12
  121. package/lib/components/Sales/Event/serve.d.ts +10 -0
  122. package/lib/components/Sales/Event/serve.js +7 -0
  123. package/lib/components/Sales/Summary/index.d.ts +10 -0
  124. package/lib/components/Sales/Summary/index.js +7 -1
  125. package/lib/components/Sales/Summary/serve.d.ts +1 -0
  126. package/lib/components/Sales/Summary/serve.js +32 -0
  127. package/lib/components/Sales/Summary/utils.d.ts +16 -1
  128. package/lib/components/Sales/Summary/utils.js +30 -1
  129. package/lib/components/appointmentBooking/components/Content/index.js +6 -1
  130. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
  131. package/lib/components/appointmentBooking/components/Deposit/index.js +36 -4
  132. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +8 -4
  133. package/lib/components/appointmentBooking/deposit/index.js +4 -2
  134. package/lib/components/booking/components/footer/index.js +24 -11
  135. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  136. package/lib/components/booking/info/utils.js +3 -1
  137. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  138. package/lib/components/booking/info2/utilsByBooking.js +4 -1
  139. package/lib/components/booking/utils.d.ts +2 -2
  140. package/lib/components/eftposPay/amount.d.ts +1 -1
  141. package/lib/components/eftposPay/device.d.ts +1 -1
  142. package/lib/components/eftposPay/hooks.d.ts +2 -2
  143. package/lib/components/eftposPay/store/index.d.ts +5 -5
  144. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +16 -4
  145. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  146. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +55 -0
  147. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +8 -5
  148. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  149. package/lib/components/eventBooking/components/bookingDetailModal/index.js +4 -3
  150. package/lib/components/eventBooking/locales.d.ts +24 -0
  151. package/lib/components/eventBooking/locales.js +27 -3
  152. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +13 -1
  153. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -1
  154. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.js +2 -2
  155. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.less +8 -0
  156. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +66 -47
  157. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +13 -1
  158. package/lib/components/pay/toC/locales.d.ts +3 -0
  159. package/lib/components/pay/toC/locales.js +3 -0
  160. package/lib/components/schedules/utils.d.ts +1 -1
  161. package/lib/components/schedules/utils.js +1 -1
  162. package/lib/components/ticketBooking/components/menuBar/index.js +42 -2
  163. package/lib/components/ticketBooking/components/menuBar/index.less +8 -0
  164. package/lib/components/ticketBooking/locales.d.ts +3 -0
  165. package/lib/components/ticketBooking/locales.js +6 -3
  166. package/lib/utils/index.d.ts +1 -1
  167. package/package.json +3 -3
@@ -1,7 +1,14 @@
1
- import React, { createContext, useMemo } from 'react';
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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
+ 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); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { createContext, useMemo, useState } from 'react';
2
8
  import { useCart } from "../Cart";
3
9
  import { calculatePriceDetails } from "./utils";
4
10
  import { useInit } from "../Init";
11
+ import { getDepositProtocolApi } from "./serve";
5
12
 
6
13
  // 定义上下文接口
7
14
 
@@ -16,6 +23,10 @@ export var SummaryProvider = function SummaryProvider(_ref) {
16
23
  cartData = _useCart.cartData;
17
24
  var _useInit = useInit(),
18
25
  initData = _useInit.initData;
26
+ var _useState = useState(false),
27
+ _useState2 = _slicedToArray(_useState, 2),
28
+ isAgreeDepositPolicy = _useState2[0],
29
+ setIsAgreeDepositPolicy = _useState2[1];
19
30
  var summaryData = useMemo(function () {
20
31
  return calculatePriceDetails((initData === null || initData === void 0 ? void 0 : initData.shop) || {}, cartData.cartItems);
21
32
  }, [cartData.cartItems, initData === null || initData === void 0 ? void 0 : initData.shop]);
@@ -26,7 +37,11 @@ export var SummaryProvider = function SummaryProvider(_ref) {
26
37
  total: summaryData.total,
27
38
  taxTitle: summaryData.taxTitle,
28
39
  totalTaxFee: summaryData.totalTaxFee,
29
- isPriceIncludeTax: summaryData.isPriceIncludeTax
40
+ isPriceIncludeTax: summaryData.isPriceIncludeTax,
41
+ deposit: summaryData.deposit,
42
+ isAgreeDepositPolicy: isAgreeDepositPolicy,
43
+ setIsAgreeDepositPolicy: setIsAgreeDepositPolicy,
44
+ getDepositProtocol: getDepositProtocolApi
30
45
  };
31
46
  return /*#__PURE__*/React.createElement(SummaryContext.Provider, {
32
47
  value: contextValue
@@ -0,0 +1 @@
1
+ export declare const getDepositProtocolApi: (id: string) => Promise<any>;
@@ -0,0 +1,6 @@
1
+ import { request } from "../../../utils";
2
+
3
+ // 获取定金协议
4
+ export var getDepositProtocolApi = function getDepositProtocolApi(id) {
5
+ return request.getRequest().get("/h5/shop-policy/".concat(id), {});
6
+ };
@@ -10,6 +10,11 @@ interface PriceDetail {
10
10
  taxTitle?: string;
11
11
  totalTaxFee?: string;
12
12
  isPriceIncludeTax?: 0 | 1;
13
+ deposit?: {
14
+ total: string;
15
+ protocols: any[];
16
+ hasDeposit: boolean;
17
+ };
13
18
  }
14
19
  /**
15
20
  * 计算商品小计(不含其他费用)
@@ -25,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
25
30
  * @return {*}
26
31
  * @Author: xiangfeng.xue
27
32
  */
28
- export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
33
+ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
29
34
  /**
30
35
  * 计算所有价格明细
31
36
  * @param items - 购物车商品数组
@@ -33,4 +38,14 @@ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.0
33
38
  * @returns 价格明细对象
34
39
  */
35
40
  export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[]) => PriceDetail;
41
+ /**
42
+ * @title: 计算定金
43
+ * @param items - 购物车商品数组
44
+ * @returns 定金字符串,保留2位小数
45
+ */
46
+ export declare const calculateDeposit: (items: CartItem[]) => {
47
+ total: string;
48
+ protocols: any[];
49
+ hasDeposit: never;
50
+ } | undefined;
36
51
  export {};
@@ -54,11 +54,53 @@ export var calculatePriceDetails = function calculatePriceDetails(shopInfo, item
54
54
 
55
55
  // 计算总价
56
56
  var total = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subtotal : subtotal.plus(totalTaxFee);
57
+
58
+ // 计算定金
59
+ var deposit = calculateDeposit(items);
57
60
  return {
58
61
  subtotal: subtotal.toFixed(2),
59
62
  total: total.toFixed(2),
60
63
  taxTitle: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_title,
61
64
  totalTaxFee: totalTaxFee.toFixed(2),
62
- isPriceIncludeTax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax
65
+ isPriceIncludeTax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax,
66
+ deposit: deposit
63
67
  };
68
+ };
69
+
70
+ /**
71
+ * @title: 计算定金
72
+ * @param items - 购物车商品数组
73
+ * @returns 定金字符串,保留2位小数
74
+ */
75
+ export var calculateDeposit = function calculateDeposit(items) {
76
+ if (!(items !== null && items !== void 0 && items.length)) {
77
+ return undefined;
78
+ }
79
+ var protocols = [];
80
+ var hasDeposit = false;
81
+ var total = items.reduce(function (sum, item) {
82
+ if (item !== null && item !== void 0 && item.deposit) {
83
+ var _item$deposit, _item$deposit2;
84
+ hasDeposit = true;
85
+ var cartItemTotalPrice = new Decimal((item === null || item === void 0 || (_item$deposit = item.deposit) === null || _item$deposit === void 0 ? void 0 : _item$deposit.total) || 0);
86
+ // 将协议数据去重合并
87
+ item === null || item === void 0 || (_item$deposit2 = item.deposit) === null || _item$deposit2 === void 0 || (_item$deposit2 = _item$deposit2.protocols) === null || _item$deposit2 === void 0 || _item$deposit2.forEach(function (protocol) {
88
+ if (protocols.findIndex(function (p) {
89
+ return p.id === protocol.id;
90
+ }) === -1) {
91
+ protocols.push(protocol);
92
+ }
93
+ });
94
+ return sum.plus(cartItemTotalPrice);
95
+ }
96
+ return sum;
97
+ }, new Decimal(0));
98
+ if (hasDeposit) {
99
+ return {
100
+ total: total.toFixed(2),
101
+ protocols: protocols,
102
+ hasDeposit: hasDeposit
103
+ };
104
+ }
105
+ return undefined;
64
106
  };
@@ -213,6 +213,19 @@ var Layout = function Layout() {
213
213
  if (isDateSelectedFirst && key === 'select-date') return false;
214
214
  return key !== 'confirm-information';
215
215
  }, [isDateSelectedFirst, currentStep === null || currentStep === void 0 || (_currentStep$step8 = currentStep.step) === null || _currentStep$step8 === void 0 ? void 0 : _currentStep$step8.key]);
216
+
217
+ /**
218
+ * @title: 获取协议方法需要在组件中定义才能传递给子组件,子组件无法获取到context中的方法
219
+ * @description:
220
+ * @param {string} id
221
+ * @return {*}
222
+ * @Author: WangHan
223
+ * @Date: 2025-07-07 10:06
224
+ */
225
+ var depositProtocolRequest = function depositProtocolRequest(id) {
226
+ var _appointmentBooking$g;
227
+ return appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$g = appointmentBooking.getProtocol) === null || _appointmentBooking$g === void 0 ? void 0 : _appointmentBooking$g.call(appointmentBooking, id);
228
+ };
216
229
  return /*#__PURE__*/React.createElement(React.Fragment, null, !isRetailTemplate ? /*#__PURE__*/React.createElement(Header, null) : null, /*#__PURE__*/React.createElement("div", {
217
230
  className: "parallel-content-wrap ".concat(isMobile() ? 'parallel-content-mobile-wrap' : '', " ").concat(isRetailTemplate ? 'parallel-content-retail-wrap' : '')
218
231
  }, /*#__PURE__*/React.createElement("div", {
@@ -237,7 +250,8 @@ var Layout = function Layout() {
237
250
  onChange: function onChange() {
238
251
  return setLoading(false);
239
252
  },
240
- isHideCheckout: false
253
+ isHideCheckout: false,
254
+ depositProtocolRequest: depositProtocolRequest
241
255
  }) : null);
242
256
  };
243
257
  export default Layout;
@@ -1,3 +1,9 @@
1
1
  import './index.less';
2
+ export declare const DepositContent: (props: {
3
+ isAgreeDepositPolicy: boolean;
4
+ setIsAgreeDepositPolicy: (value: boolean) => void;
5
+ deposit: any;
6
+ depositProtocolRequest?: any;
7
+ }) => JSX.Element;
2
8
  declare const Deposit: () => JSX.Element;
3
9
  export default Deposit;
@@ -4,12 +4,11 @@ import AppointmentDeposit from "../../deposit";
4
4
  import { useAppointmentBookingContext } from "../../context";
5
5
  import { locales } from '@pisell/utils';
6
6
  import "./index.less";
7
- var Deposit = function Deposit() {
8
- var _useAppointmentBookin = useAppointmentBookingContext(),
9
- setIsAgreeDepositPolicy = _useAppointmentBookin.setIsAgreeDepositPolicy,
10
- isAgreeDepositPolicy = _useAppointmentBookin.isAgreeDepositPolicy,
11
- summary = _useAppointmentBookin.summary;
12
- var deposit = summary.deposit;
7
+ export var DepositContent = function DepositContent(props) {
8
+ var isAgreeDepositPolicy = props.isAgreeDepositPolicy,
9
+ setIsAgreeDepositPolicy = props.setIsAgreeDepositPolicy,
10
+ deposit = props.deposit,
11
+ depositProtocolRequest = props.depositProtocolRequest;
13
12
  return /*#__PURE__*/React.createElement("div", {
14
13
  className: "appointment-deposit-wrap"
15
14
  }, /*#__PURE__*/React.createElement("div", {
@@ -24,7 +23,28 @@ var Deposit = function Deposit() {
24
23
  isAgreePolicy: isAgreeDepositPolicy,
25
24
  onChange: function onChange(value) {
26
25
  return setIsAgreeDepositPolicy(value);
27
- }
26
+ },
27
+ depositProtocolRequest: depositProtocolRequest
28
28
  }));
29
29
  };
30
+ var Deposit = function Deposit() {
31
+ var _ref = useAppointmentBookingContext(),
32
+ setIsAgreeDepositPolicy = _ref.setIsAgreeDepositPolicy,
33
+ isAgreeDepositPolicy = _ref.isAgreeDepositPolicy,
34
+ summary = _ref.summary,
35
+ appointmentBooking = _ref.appointmentBooking;
36
+ var deposit = summary.deposit;
37
+
38
+ // 获取协议方法需要在组件中定义才能传递给子组件,子组件无法获取到context中的方法
39
+ var depositProtocolRequest = function depositProtocolRequest(id) {
40
+ var _appointmentBooking$g;
41
+ return appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$g = appointmentBooking.getProtocol) === null || _appointmentBooking$g === void 0 ? void 0 : _appointmentBooking$g.call(appointmentBooking, id);
42
+ };
43
+ return /*#__PURE__*/React.createElement(DepositContent, {
44
+ isAgreeDepositPolicy: !!isAgreeDepositPolicy,
45
+ setIsAgreeDepositPolicy: setIsAgreeDepositPolicy,
46
+ deposit: deposit,
47
+ depositProtocolRequest: depositProtocolRequest
48
+ });
49
+ };
30
50
  export default Deposit;
@@ -12,7 +12,6 @@ import React, { useState, useEffect } from 'react';
12
12
  import { Spin } from 'antd';
13
13
  import { PisellModal, PisellEmpty, Button, Checkbox } from '@pisell/materials';
14
14
  import { locales, isMobile } from '@pisell/utils';
15
- import { useAppointmentBookingContext } from "../../../context";
16
15
  import "./index.less";
17
16
  var DepositModal = function DepositModal(props) {
18
17
  var open = props.open,
@@ -21,9 +20,8 @@ var DepositModal = function DepositModal(props) {
21
20
  onChange = props.onChange,
22
21
  onConfirm = props.onConfirm,
23
22
  _props$isHideCheckout = props.isHideCheckout,
24
- isHideCheckout = _props$isHideCheckout === void 0 ? true : _props$isHideCheckout;
25
- var _useAppointmentBookin = useAppointmentBookingContext(),
26
- appointmentBooking = _useAppointmentBookin.appointmentBooking;
23
+ isHideCheckout = _props$isHideCheckout === void 0 ? true : _props$isHideCheckout,
24
+ depositProtocolRequest = props.depositProtocolRequest;
27
25
  var _useState = useState(null),
28
26
  _useState2 = _slicedToArray(_useState, 2),
29
27
  policy = _useState2[0],
@@ -50,35 +48,42 @@ var DepositModal = function DepositModal(props) {
50
48
  */
51
49
  var getPolicy = /*#__PURE__*/function () {
52
50
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
53
- var _yield$appointmentBoo, data;
51
+ var _yield$depositProtoco, data;
54
52
  return _regeneratorRuntime().wrap(function _callee$(_context) {
55
53
  while (1) switch (_context.prev = _context.next) {
56
54
  case 0:
55
+ if (depositProtocolRequest) {
56
+ _context.next = 3;
57
+ break;
58
+ }
59
+ console.error('depositProtocolRequest is not defined');
60
+ return _context.abrupt("return");
61
+ case 3:
57
62
  setLoading(true);
58
- _context.prev = 1;
59
- _context.next = 4;
60
- return appointmentBooking.getProtocol(id);
61
- case 4:
62
- _yield$appointmentBoo = _context.sent;
63
- data = _yield$appointmentBoo.data;
63
+ _context.prev = 4;
64
+ _context.next = 7;
65
+ return depositProtocolRequest === null || depositProtocolRequest === void 0 ? void 0 : depositProtocolRequest(id);
66
+ case 7:
67
+ _yield$depositProtoco = _context.sent;
68
+ data = _yield$depositProtoco.data;
64
69
  setPolicy(data);
65
70
  onChange && onChange(data);
66
- _context.next = 14;
71
+ _context.next = 17;
67
72
  break;
68
- case 10:
69
- _context.prev = 10;
70
- _context.t0 = _context["catch"](1);
73
+ case 13:
74
+ _context.prev = 13;
75
+ _context.t0 = _context["catch"](4);
71
76
  console.log(_context.t0);
72
77
  onChange && onChange(_context.t0);
73
- case 14:
74
- _context.prev = 14;
75
- setLoading(false);
76
- return _context.finish(14);
77
78
  case 17:
79
+ _context.prev = 17;
80
+ setLoading(false);
81
+ return _context.finish(17);
82
+ case 20:
78
83
  case "end":
79
84
  return _context.stop();
80
85
  }
81
- }, _callee, null, [[1, 10, 14, 17]]);
86
+ }, _callee, null, [[4, 13, 17, 20]]);
82
87
  }));
83
88
  return function getPolicy(_x) {
84
89
  return _ref.apply(this, arguments);
@@ -21,7 +21,8 @@ var Deposit = function Deposit(props) {
21
21
  isAgreePolicy = _props$isAgreePolicy === void 0 ? true : _props$isAgreePolicy,
22
22
  _props$isShowTitle = props.isShowTitle,
23
23
  isShowTitle = _props$isShowTitle === void 0 ? true : _props$isShowTitle,
24
- onChange = props.onChange;
24
+ onChange = props.onChange,
25
+ depositProtocolRequest = props.depositProtocolRequest;
25
26
  var context = useEngineContext();
26
27
  // 打开协议弹窗
27
28
  var _useState = useState(false),
@@ -95,7 +96,8 @@ var Deposit = function Deposit(props) {
95
96
  onCancel: function onCancel() {
96
97
  return setVisible(false);
97
98
  },
98
- item: policyItem
99
+ item: policyItem,
100
+ depositProtocolRequest: depositProtocolRequest
99
101
  }));
100
102
  };
101
103
  export default Deposit;
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  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
3
  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); }
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
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, { useMemo, useState, useEffect, forwardRef, useImperativeHandle } from "react";
8
8
  import classNames from "classnames";
@@ -13,10 +13,6 @@ import "./index.less";
13
13
 
14
14
  // tabs 子组件定义
15
15
 
16
- // 定义主键类型
17
-
18
- // Tabs 可传递的参数
19
-
20
16
  var Tabs = function Tabs(_ref, ref) {
21
17
  var renderTab = _ref.renderTab,
22
18
  rowKey = _ref.rowKey,
@@ -29,7 +29,7 @@ var BrowserSelect = function BrowserSelect(props) {
29
29
  onChange: function onChange(e) {
30
30
  var _resetProps$onChange;
31
31
  e.persist();
32
- (_resetProps$onChange = resetProps.onChange) === null || _resetProps$onChange === void 0 || _resetProps$onChange.call(resetProps, e);
32
+ (_resetProps$onChange = resetProps.onChange) === null || _resetProps$onChange === void 0 ? void 0 : _resetProps$onChange.call(resetProps, e);
33
33
  }
34
34
  }), _options);
35
35
  };
@@ -47,7 +47,7 @@ import dayjs from 'dayjs';
47
47
  * @Date: 2024-01-30 16:51
48
48
  */
49
49
  var Footer = function Footer(props) {
50
- var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _businessUtils$getApp, _businessUtils$getApp2, _state$addons4, _state$bookingDetail12, _state$bookingDetail13;
50
+ var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _businessUtils$getApp, _businessUtils$getApp2, _state$bookingDetail8, _state$addons4, _state$bookingDetail16, _state$bookingDetail17;
51
51
  var state = props.state,
52
52
  buttons = props.buttons,
53
53
  dispatch = props.dispatch,
@@ -628,6 +628,10 @@ var Footer = function Footer(props) {
628
628
  }
629
629
  });
630
630
  };
631
+ var paymentRefundedStatus = useMemo(function () {
632
+ var _state$bookingDetail;
633
+ return ['partially_refunded', 'refunded'].includes(state === null || state === void 0 || (_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : _state$bookingDetail.payment_status);
634
+ }, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
631
635
 
632
636
  /**
633
637
  * @title: checkout按钮
@@ -668,7 +672,7 @@ var Footer = function Footer(props) {
668
672
  }, [isEdit, checkoutLoading, isDisabled, state, source]);
669
673
  var handleMenuClick = /*#__PURE__*/function () {
670
674
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(e) {
671
- var id, customer, res, _state$bookingDetail, _state$bookingDetail2;
675
+ var id, customer, res, _state$bookingDetail2, _state$bookingDetail3;
672
676
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
673
677
  while (1) switch (_context6.prev = _context6.next) {
674
678
  case 0:
@@ -696,10 +700,10 @@ var Footer = function Footer(props) {
696
700
  type: 'pisell1.sendPayLinkEmail',
697
701
  data: {
698
702
  id: id,
699
- is_deposit: state.bookingDetail.is_deposit || Number((_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : _state$bookingDetail.deposit_amount),
703
+ is_deposit: state.bookingDetail.is_deposit || Number((_state$bookingDetail2 = state.bookingDetail) === null || _state$bookingDetail2 === void 0 ? void 0 : _state$bookingDetail2.deposit_amount),
700
704
  deposit_payment_time: state.bookingDetail.deposit_payment_time,
701
705
  customer: customer,
702
- contacts: (_state$bookingDetail2 = state.bookingDetail) === null || _state$bookingDetail2 === void 0 ? void 0 : _state$bookingDetail2.contacts
706
+ contacts: (_state$bookingDetail3 = state.bookingDetail) === null || _state$bookingDetail3 === void 0 ? void 0 : _state$bookingDetail3.contacts
703
707
  },
704
708
  callback: function callback() {}
705
709
  });
@@ -925,10 +929,10 @@ var Footer = function Footer(props) {
925
929
  * @Date: 2024-01-30 16:58
926
930
  */
927
931
  var isCheckout = useMemo(function () {
928
- var _state$bookingDetail3, _state$bookingDetail4;
932
+ var _state$bookingDetail4, _state$bookingDetail5;
929
933
  var list = ['unfulfilled', 'partially_paid', 'unpaid', 'payment_processing'];
930
934
  // (支付状态 = 已支付 || 部分付款 || 未付款 || 支付处理中) && 预约状态 !== 已取消
931
- if (!state.bookingId || ((_state$bookingDetail3 = state.bookingDetail) === null || _state$bookingDetail3 === void 0 || (_state$bookingDetail3 = _state$bookingDetail3.bookings) === null || _state$bookingDetail3 === void 0 ? void 0 : _state$bookingDetail3.appointment_status) !== 'cancelled' && list.includes(state === null || state === void 0 || (_state$bookingDetail4 = state.bookingDetail) === null || _state$bookingDetail4 === void 0 ? void 0 : _state$bookingDetail4.payment_status) && !state.disabledEdit) {
935
+ if (!state.bookingId || ((_state$bookingDetail4 = state.bookingDetail) === null || _state$bookingDetail4 === void 0 || (_state$bookingDetail4 = _state$bookingDetail4.bookings) === null || _state$bookingDetail4 === void 0 ? void 0 : _state$bookingDetail4.appointment_status) !== 'cancelled' && list.includes(state === null || state === void 0 || (_state$bookingDetail5 = state.bookingDetail) === null || _state$bookingDetail5 === void 0 ? void 0 : _state$bookingDetail5.payment_status) && !state.disabledEdit) {
932
936
  return true;
933
937
  } else {
934
938
  if (total.notPaidAmount > 0) {
@@ -939,7 +943,8 @@ var Footer = function Footer(props) {
939
943
  }, [state.bookingDetail, total.notPaidAmount]);
940
944
  var _buttons = useMemo(function () {
941
945
  // 如果预约是取消状态,则不展示任何按钮
942
- if (state.appointment_status === 'cancelled') {
946
+ // 如果订单已退款 | 部分退款,则展示再次预约按钮
947
+ if (state.appointment_status === 'cancelled' || paymentRefundedStatus) {
943
948
  return [buttonMap.rebook];
944
949
  }
945
950
 
@@ -1018,6 +1023,7 @@ var Footer = function Footer(props) {
1018
1023
  return [];
1019
1024
  }, [buttons, total, isEdit, checkoutLoading, isDisabled, source, buttonMap, loading, isCheckout, state, isTeam, isShowClearAll]);
1020
1025
  var moreButton = useMemo(function () {
1026
+ var _state$bookingDetail6;
1021
1027
  var arr = [];
1022
1028
  if (!state.bookingId) {
1023
1029
  return [];
@@ -1029,10 +1035,16 @@ var Footer = function Footer(props) {
1029
1035
  return [];
1030
1036
  }
1031
1037
 
1038
+ // 如果订单已退款, 则不展示任何按钮
1039
+ if ((state === null || state === void 0 || (_state$bookingDetail6 = state.bookingDetail) === null || _state$bookingDetail6 === void 0 ? void 0 : _state$bookingDetail6.payment_status) === 'refunded') {
1040
+ return [];
1041
+ }
1042
+
1032
1043
  // 如果外部没有按钮, 则rebook按钮放在外面
1033
1044
  if (_buttons.length !== 0) {
1034
- // 支付链接
1035
- if (state.bookingId && isShowPaymentLink) {
1045
+ var _state$bookingDetail7;
1046
+ // 支付链接, 部分退款时, 不展示支付链接
1047
+ if (state.bookingId && isShowPaymentLink && (state === null || state === void 0 || (_state$bookingDetail7 = state.bookingDetail) === null || _state$bookingDetail7 === void 0 ? void 0 : _state$bookingDetail7.payment_status) !== 'partially_refunded') {
1036
1048
  arr.push(actionMap.paymentLink);
1037
1049
  }
1038
1050
  }
@@ -1066,14 +1078,14 @@ var Footer = function Footer(props) {
1066
1078
  // 取消订单
1067
1079
  // arr.push(actionMap.cancelOrder);
1068
1080
  return arr;
1069
- }, [state, total, isShowPaymentLink, source, _buttons.length]);
1081
+ }, [state, total, isShowPaymentLink, source, _buttons.length, state === null || state === void 0 || (_state$bookingDetail8 = state.bookingDetail) === null || _state$bookingDetail8 === void 0 ? void 0 : _state$bookingDetail8.payment_status]);
1070
1082
 
1071
1083
  /**
1072
1084
  * 是否只有定金支付
1073
1085
  */
1074
1086
  var isOnlyDeposit = useMemo(function () {
1075
- var _state$bookingDetail5, _state$bookingDetail6, _state$bookingDetail7;
1076
- if (state !== null && state !== void 0 && (_state$bookingDetail5 = state.bookingDetail) !== null && _state$bookingDetail5 !== void 0 && _state$bookingDetail5.deposit_payment_time && state !== null && state !== void 0 && (_state$bookingDetail6 = state.bookingDetail) !== null && _state$bookingDetail6 !== void 0 && (_state$bookingDetail6 = _state$bookingDetail6.payment_types) !== null && _state$bookingDetail6 !== void 0 && (_state$bookingDetail7 = _state$bookingDetail6.every) !== null && _state$bookingDetail7 !== void 0 && _state$bookingDetail7.call(_state$bookingDetail6, function (item) {
1087
+ var _state$bookingDetail9, _state$bookingDetail10, _state$bookingDetail11;
1088
+ if (state !== null && state !== void 0 && (_state$bookingDetail9 = state.bookingDetail) !== null && _state$bookingDetail9 !== void 0 && _state$bookingDetail9.deposit_payment_time && state !== null && state !== void 0 && (_state$bookingDetail10 = state.bookingDetail) !== null && _state$bookingDetail10 !== void 0 && (_state$bookingDetail10 = _state$bookingDetail10.payment_types) !== null && _state$bookingDetail10 !== void 0 && (_state$bookingDetail11 = _state$bookingDetail10.every) !== null && _state$bookingDetail11 !== void 0 && _state$bookingDetail11.call(_state$bookingDetail10, function (item) {
1077
1089
  return item === 'deposit';
1078
1090
  })) {
1079
1091
  return true;
@@ -1094,8 +1106,8 @@ var Footer = function Footer(props) {
1094
1106
 
1095
1107
  // 只有定金支付时,直接展示
1096
1108
  if (isOnlyDeposit) {
1097
- var _state$bookingDetail8;
1098
- return "".concat(locales.getText('pisell2.text.deposit-paid'), " ").concat(formatAmount(state === null || state === void 0 || (_state$bookingDetail8 = state.bookingDetail) === null || _state$bookingDetail8 === void 0 ? void 0 : _state$bookingDetail8.deposit_paid_amount, 2, (state === null || state === void 0 ? void 0 : state.amountSymbol) || '$'), " ").concat(total.duration ? "(".concat(total.duration, ")") : '');
1109
+ var _state$bookingDetail12;
1110
+ return "".concat(locales.getText('pisell2.text.deposit-paid'), " ").concat(formatAmount(state === null || state === void 0 || (_state$bookingDetail12 = state.bookingDetail) === null || _state$bookingDetail12 === void 0 ? void 0 : _state$bookingDetail12.deposit_paid_amount, 2, (state === null || state === void 0 ? void 0 : state.amountSymbol) || '$'), " ").concat(total.duration ? "(".concat(total.duration, ")") : '');
1099
1111
  }
1100
1112
 
1101
1113
  // 有退款金额时, 直接展示 退款:$8.00
@@ -1217,8 +1229,8 @@ var Footer = function Footer(props) {
1217
1229
  }
1218
1230
  };
1219
1231
  var subTotalList = useMemo(function () {
1220
- var _state$bookingDetail9, _state$bookingDetail10, _state$bookingDetail11;
1221
- var surcharge = (((_state$bookingDetail9 = state.bookingDetail) === null || _state$bookingDetail9 === void 0 ? void 0 : _state$bookingDetail9.surcharge) || []).map(function (d, index) {
1232
+ var _state$bookingDetail13, _state$bookingDetail14, _state$bookingDetail15;
1233
+ var surcharge = (((_state$bookingDetail13 = state.bookingDetail) === null || _state$bookingDetail13 === void 0 ? void 0 : _state$bookingDetail13.surcharge) || []).map(function (d, index) {
1222
1234
  return {
1223
1235
  key: "custom_surcharge_".concat(index),
1224
1236
  label: d.name[state.locale],
@@ -1237,9 +1249,9 @@ var Footer = function Footer(props) {
1237
1249
  key: 'tax',
1238
1250
  value: total.tax,
1239
1251
  tax: {
1240
- rate: state === null || state === void 0 || (_state$bookingDetail10 = state.bookingDetail) === null || _state$bookingDetail10 === void 0 ? void 0 : _state$bookingDetail10.tax_rate,
1252
+ rate: state === null || state === void 0 || (_state$bookingDetail14 = state.bookingDetail) === null || _state$bookingDetail14 === void 0 ? void 0 : _state$bookingDetail14.tax_rate,
1241
1253
  is_price_include_tax: is_price_include_tax(state),
1242
- title: state === null || state === void 0 || (_state$bookingDetail11 = state.bookingDetail) === null || _state$bookingDetail11 === void 0 ? void 0 : _state$bookingDetail11.tax_title
1254
+ title: state === null || state === void 0 || (_state$bookingDetail15 = state.bookingDetail) === null || _state$bookingDetail15 === void 0 ? void 0 : _state$bookingDetail15.tax_title
1243
1255
  }
1244
1256
  },
1245
1257
  // 订单折扣
@@ -1260,7 +1272,7 @@ var Footer = function Footer(props) {
1260
1272
  value: total.roundingAmount,
1261
1273
  label: locales.getText('pisell1.text.rounding')
1262
1274
  }]);
1263
- }, [total, (_state$bookingDetail12 = state.bookingDetail) === null || _state$bookingDetail12 === void 0 ? void 0 : _state$bookingDetail12.surcharge, state, state.bookingId]);
1275
+ }, [total, (_state$bookingDetail16 = state.bookingDetail) === null || _state$bookingDetail16 === void 0 ? void 0 : _state$bookingDetail16.surcharge, state, state.bookingId]);
1264
1276
  var orderTotalList = useMemo(function () {
1265
1277
  return [
1266
1278
  // 订单已付金额
@@ -1291,11 +1303,7 @@ var Footer = function Footer(props) {
1291
1303
  value: total.totalRefundAmount,
1292
1304
  label: locales.getText('pisell2.text.refunded-amount')
1293
1305
  }];
1294
- }, [total, (_state$bookingDetail13 = state.bookingDetail) === null || _state$bookingDetail13 === void 0 ? void 0 : _state$bookingDetail13.surcharge, state, state.bookingId]);
1295
- var paymentRefundedStatus = useMemo(function () {
1296
- var _state$bookingDetail14;
1297
- return ['partially_refunded', 'refunded'].includes(state === null || state === void 0 || (_state$bookingDetail14 = state.bookingDetail) === null || _state$bookingDetail14 === void 0 ? void 0 : _state$bookingDetail14.payment_status);
1298
- }, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
1306
+ }, [total, (_state$bookingDetail17 = state.bookingDetail) === null || _state$bookingDetail17 === void 0 ? void 0 : _state$bookingDetail17.surcharge, state, state.bookingId]);
1299
1307
  return /*#__PURE__*/React.createElement(Skeleton, {
1300
1308
  title: false,
1301
1309
  round: true,
@@ -1,9 +1,9 @@
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; }
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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
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); }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
7
  import { miniRedux } from "@pisell/utils";
8
8
  var defaultState = {};
9
9
  var _miniRedux = miniRedux({
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: string;
9
+ locale: any;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -19,7 +19,7 @@ var Like = function Like(_ref) {
19
19
  }
20
20
  e.preventDefault();
21
21
  e.stopPropagation();
22
- onChange === null || onChange === void 0 || onChange(status === "like" ? "common" : "like");
22
+ onChange === null || onChange === void 0 ? void 0 : onChange(status === "like" ? "common" : "like");
23
23
  }
24
24
  });
25
25
  };
@@ -95,7 +95,7 @@ export var isBooking4Shop = function isBooking4Shop(shopId, renderType) {
95
95
  if (renderType === 'eventBooking') {
96
96
  return false;
97
97
  }
98
- var booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 8609, 8610, 8782, 1285, 6124, 8727, 5538, 6988, 8872, 6930, 8824, 8913];
98
+ var booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 8609, 8610, 8782, 1285, 6124, 8727, 5538, 6988, 8872, 6930, 8824, 8913, 8918, 6413];
99
99
  return booking4Shops.includes(shopId);
100
100
  };
101
101
  function generateDateRange(start, end) {
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: string;
10
+ locale: any;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -69,9 +69,15 @@ export var getResourceTimeIsUsable = function getResourceTimeIsUsable(item, cach
69
69
  });
70
70
 
71
71
  // 已预约的列表
72
- var eventList = (time.event_list || []).filter(function (event) {
73
- return event.id !== (cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.booking_id);
74
- });
72
+ var eventList = time.event_list || [];
73
+
74
+ // todo: event_list数据会进行合并 id不准确
75
+ // 编辑时过滤当前预约
76
+ if (cacheItem !== null && cacheItem !== void 0 && cacheItem.booking_id) {
77
+ eventList = eventList.filter(function (event) {
78
+ return event.id !== (cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.booking_id);
79
+ });
80
+ }
75
81
  var endDate = null;
76
82
  // 是否去计算数量
77
83
  var isCalcCount = true;
@@ -25,7 +25,7 @@ var StartTime = function StartTime(props) {
25
25
  return sliceDayIntoFiveMinutes(slice, locale);
26
26
  }, [slice, locale]);
27
27
  useEffect(function () {
28
- timeObjChange === null || timeObjChange === void 0 || timeObjChange(timeObj);
28
+ timeObjChange === null || timeObjChange === void 0 ? void 0 : timeObjChange(timeObj);
29
29
  }, [timeObj]);
30
30
  var renderOptions = useCallback(function (array) {
31
31
  var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "value";