@pisell/private-materials 3.3.85 → 3.3.87

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 (261) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +11 -11
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/businessModel/SalesModel/Sales/index.js +37 -4
  12. package/es/components/Sales/Cart/index.js +5 -1
  13. package/es/components/Sales/Cart/utils.d.ts +40 -0
  14. package/es/components/Sales/Cart/utils.js +167 -0
  15. package/es/components/Sales/Checkout/index.d.ts +4 -0
  16. package/es/components/Sales/Checkout/index.js +52 -8
  17. package/es/components/Sales/Checkout/serve.d.ts +13 -0
  18. package/es/components/Sales/Checkout/serve.js +16 -2
  19. package/es/components/Sales/Checkout/utils.js +7 -1
  20. package/es/components/Sales/Resource/index.js +2 -2
  21. package/es/components/Sales/Resource/serve.d.ts +7 -0
  22. package/es/components/Sales/Resource/serve.js +10 -0
  23. package/es/components/Sales/Summary/index.d.ts +10 -0
  24. package/es/components/Sales/Summary/index.js +17 -2
  25. package/es/components/Sales/Summary/serve.d.ts +1 -0
  26. package/es/components/Sales/Summary/serve.js +6 -0
  27. package/es/components/Sales/Summary/utils.d.ts +15 -0
  28. package/es/components/Sales/Summary/utils.js +43 -1
  29. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  30. package/es/components/appointmentBooking/components/Content/index.less +1 -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/components/Header/index.d.ts +3 -0
  34. package/es/components/appointmentBooking/components/Services/index.js +23 -27
  35. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +25 -20
  36. package/es/components/appointmentBooking/deposit/index.js +4 -2
  37. package/es/components/appointmentBooking/index.js +14 -0
  38. package/es/components/appointmentBooking/index.less +1 -1
  39. package/es/components/booking/components/footer/utils.d.ts +1 -0
  40. package/es/components/booking/components/footer/utils.js +5 -6
  41. package/es/components/booking/components/voucher/index.js +2 -2
  42. package/es/components/booking/editBookingModal/index.d.ts +5 -0
  43. package/es/components/booking/editBookingModal/index.js +386 -0
  44. package/es/components/booking/editBookingModal/index.less +8 -0
  45. package/es/components/booking/editBookingModal/locales.d.ts +21 -0
  46. package/es/components/booking/editBookingModal/locales.js +20 -0
  47. package/es/components/booking/editBookingModal/mock.d.ts +807 -0
  48. package/es/components/booking/editBookingModal/mock.js +2993 -0
  49. package/es/components/booking/editBookingModal/serve.d.ts +51 -0
  50. package/es/components/booking/editBookingModal/serve.js +288 -0
  51. package/es/components/booking/editBookingModal/type.d.ts +12 -0
  52. package/es/components/booking/editBookingModal/type.js +1 -0
  53. package/es/components/booking/editBookingModal/utils.d.ts +12 -0
  54. package/es/components/booking/editBookingModal/utils.js +157 -0
  55. package/es/components/booking/info/service/addService/index.js +3 -3
  56. package/es/components/booking/info/service2/utils.d.ts +1 -1
  57. package/es/components/booking/info/service2/utils.js +3 -2
  58. package/es/components/booking/info2/service/addService/utils.d.ts +10 -0
  59. package/es/components/booking/info2/service/addService/utils.js +44 -13
  60. package/es/components/booking/info2/service/editService/Resources/index.js +22 -8
  61. package/es/components/booking/info2/service/editService/Resources/index.less +6 -0
  62. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
  63. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +26 -0
  64. package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
  65. package/es/components/booking/info2/service/editService/ResourcesV2/index.js +308 -0
  66. package/es/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
  67. package/es/components/booking/info2/utilsByBooking.js +9 -0
  68. package/es/components/booking/locales.d.ts +3 -0
  69. package/es/components/booking/locales.js +3 -0
  70. package/es/components/booking/utils.d.ts +2 -2
  71. package/es/components/eftposPay/const.d.ts +4 -1
  72. package/es/components/eftposPay/const.js +3 -1
  73. package/es/components/eftposPay/hooks.d.ts +1 -1
  74. package/es/components/eftposPay/hooks.js +3 -1
  75. package/es/components/eftposPay/index.js +1 -1
  76. package/es/components/eftposPay/linkly/const.d.ts +23 -0
  77. package/es/components/eftposPay/linkly/const.js +82 -0
  78. package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  79. package/es/components/eftposPay/linkly/hooks/index.js +2 -0
  80. package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  81. package/es/components/eftposPay/linkly/hooks/normal.js +318 -0
  82. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  83. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +273 -0
  84. package/es/components/eftposPay/linkly/index.d.ts +2 -0
  85. package/es/components/eftposPay/linkly/index.js +197 -0
  86. package/es/components/eftposPay/linkly/service.d.ts +32 -0
  87. package/es/components/eftposPay/linkly/service.js +73 -0
  88. package/es/components/eftposPay/manufacturer.d.ts +1 -0
  89. package/es/components/eftposPay/manufacturer.js +4 -0
  90. package/es/components/eftposPay/pay.d.ts +1 -1
  91. package/es/components/eftposPay/pay.js +6 -2
  92. package/es/components/eftposPay/store/index.d.ts +1 -1
  93. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +29 -17
  94. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  95. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +17 -0
  96. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +10 -6
  97. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  98. package/es/components/eventBooking/components/Provider/Event/index.js +13 -4
  99. package/es/components/eventBooking/components/bookingDetailModal/index.js +22 -4
  100. package/es/components/eventBooking/index.js +21 -7
  101. package/es/components/eventBooking/locales.d.ts +24 -0
  102. package/es/components/eventBooking/locales.js +30 -6
  103. package/es/components/index.d.ts +3 -1
  104. package/es/components/index.js +3 -1
  105. package/es/components/pay/toC/PaymentMethods/index.js +5 -4
  106. package/es/components/stepController/components/Content/index.d.ts +7 -0
  107. package/es/components/stepController/components/Content/index.js +9 -0
  108. package/es/components/stepController/components/Content/index.less +8 -0
  109. package/es/components/stepController/components/Footer/index.d.ts +8 -0
  110. package/es/components/stepController/components/Footer/index.js +15 -0
  111. package/es/components/stepController/components/Footer/index.less +39 -0
  112. package/es/components/stepController/components/Header/index.d.ts +20 -0
  113. package/es/components/stepController/components/Header/index.js +97 -0
  114. package/es/components/stepController/components/Header/index.less +21 -0
  115. package/es/components/stepController/index.d.ts +5 -0
  116. package/es/components/stepController/index.js +64 -0
  117. package/es/components/stepController/index.less +11 -0
  118. package/es/components/stepController/locales.d.ts +27 -0
  119. package/es/components/stepController/locales.js +32 -0
  120. package/es/components/stepController/types.d.ts +23 -0
  121. package/es/components/stepController/types.js +1 -0
  122. package/es/components/ticketBooking/components/addServiceVariant/addService.js +4 -5
  123. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  124. package/es/components/ticketBooking/components/ticketBooking/index.js +257 -138
  125. package/es/components/ticketBooking/locales.d.ts +164 -146
  126. package/es/components/ticketBooking/locales.js +195 -147
  127. package/es/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  128. package/es/components/ticketBooking/utils/formatProductMessage.js +62 -0
  129. package/es/components/ticketBooking/utils/formatTime.d.ts +31 -0
  130. package/es/components/ticketBooking/utils/formatTime.js +144 -0
  131. package/es/hooks/useWindowSize.d.ts +5 -0
  132. package/es/hooks/useWindowSize.js +26 -0
  133. package/es/index.d.ts +2 -0
  134. package/es/index.js +3 -1
  135. package/lib/businessModel/SalesModel/Sales/index.js +22 -8
  136. package/lib/components/Sales/Cart/index.js +1 -0
  137. package/lib/components/Sales/Cart/utils.d.ts +40 -0
  138. package/lib/components/Sales/Cart/utils.js +117 -0
  139. package/lib/components/Sales/Checkout/index.d.ts +4 -0
  140. package/lib/components/Sales/Checkout/index.js +39 -7
  141. package/lib/components/Sales/Checkout/serve.d.ts +13 -0
  142. package/lib/components/Sales/Checkout/serve.js +7 -2
  143. package/lib/components/Sales/Checkout/utils.js +2 -0
  144. package/lib/components/Sales/Resource/index.js +1 -1
  145. package/lib/components/Sales/Resource/serve.d.ts +7 -0
  146. package/lib/components/Sales/Resource/serve.js +9 -2
  147. package/lib/components/Sales/Summary/index.d.ts +10 -0
  148. package/lib/components/Sales/Summary/index.js +7 -1
  149. package/lib/components/Sales/Summary/serve.d.ts +1 -0
  150. package/lib/components/Sales/Summary/serve.js +32 -0
  151. package/lib/components/Sales/Summary/utils.d.ts +15 -0
  152. package/lib/components/Sales/Summary/utils.js +30 -1
  153. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  154. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  155. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
  156. package/lib/components/appointmentBooking/components/Deposit/index.js +36 -4
  157. package/lib/components/appointmentBooking/components/Header/index.d.ts +3 -0
  158. package/lib/components/appointmentBooking/components/Services/index.js +6 -11
  159. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +8 -4
  160. package/lib/components/appointmentBooking/deposit/index.js +4 -2
  161. package/lib/components/appointmentBooking/index.js +11 -0
  162. package/lib/components/appointmentBooking/index.less +1 -1
  163. package/lib/components/booking/components/footer/utils.d.ts +1 -0
  164. package/lib/components/booking/components/footer/utils.js +4 -5
  165. package/lib/components/booking/components/voucher/index.js +2 -2
  166. package/lib/components/booking/editBookingModal/index.d.ts +5 -0
  167. package/lib/components/booking/editBookingModal/index.js +363 -0
  168. package/lib/components/booking/editBookingModal/index.less +8 -0
  169. package/lib/components/booking/editBookingModal/locales.d.ts +21 -0
  170. package/lib/components/booking/editBookingModal/locales.js +44 -0
  171. package/lib/components/booking/editBookingModal/mock.d.ts +807 -0
  172. package/lib/components/booking/editBookingModal/mock.js +3314 -0
  173. package/lib/components/booking/editBookingModal/serve.d.ts +51 -0
  174. package/lib/components/booking/editBookingModal/serve.js +178 -0
  175. package/lib/components/booking/editBookingModal/type.d.ts +12 -0
  176. package/lib/components/booking/editBookingModal/type.js +17 -0
  177. package/lib/components/booking/editBookingModal/utils.d.ts +12 -0
  178. package/lib/components/booking/editBookingModal/utils.js +158 -0
  179. package/lib/components/booking/info/service/addService/index.js +1 -1
  180. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  181. package/lib/components/booking/info/service2/utils.js +2 -2
  182. package/lib/components/booking/info2/service/addService/utils.d.ts +10 -0
  183. package/lib/components/booking/info2/service/addService/utils.js +27 -4
  184. package/lib/components/booking/info2/service/editService/Resources/index.js +54 -10
  185. package/lib/components/booking/info2/service/editService/Resources/index.less +6 -0
  186. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
  187. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +53 -0
  188. package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
  189. package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +311 -0
  190. package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
  191. package/lib/components/booking/info2/utilsByBooking.js +6 -0
  192. package/lib/components/booking/locales.d.ts +3 -0
  193. package/lib/components/booking/locales.js +3 -0
  194. package/lib/components/booking/utils.d.ts +2 -2
  195. package/lib/components/eftposPay/const.d.ts +4 -1
  196. package/lib/components/eftposPay/const.js +2 -0
  197. package/lib/components/eftposPay/hooks.d.ts +1 -1
  198. package/lib/components/eftposPay/hooks.js +11 -4
  199. package/lib/components/eftposPay/index.js +1 -1
  200. package/lib/components/eftposPay/linkly/const.d.ts +23 -0
  201. package/lib/components/eftposPay/linkly/const.js +102 -0
  202. package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  203. package/lib/components/eftposPay/linkly/hooks/index.js +25 -0
  204. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  205. package/lib/components/eftposPay/linkly/hooks/normal.js +239 -0
  206. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  207. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +222 -0
  208. package/lib/components/eftposPay/linkly/index.d.ts +2 -0
  209. package/lib/components/eftposPay/linkly/index.js +208 -0
  210. package/lib/components/eftposPay/linkly/service.d.ts +32 -0
  211. package/lib/components/eftposPay/linkly/service.js +55 -0
  212. package/lib/components/eftposPay/manufacturer.d.ts +1 -0
  213. package/lib/components/eftposPay/manufacturer.js +6 -0
  214. package/lib/components/eftposPay/pay.d.ts +1 -1
  215. package/lib/components/eftposPay/pay.js +13 -2
  216. package/lib/components/eftposPay/store/index.d.ts +1 -1
  217. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +16 -3
  218. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  219. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +55 -0
  220. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +8 -5
  221. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  222. package/lib/components/eventBooking/components/Provider/Event/index.js +10 -3
  223. package/lib/components/eventBooking/components/bookingDetailModal/index.js +10 -4
  224. package/lib/components/eventBooking/index.js +11 -7
  225. package/lib/components/eventBooking/locales.d.ts +24 -0
  226. package/lib/components/eventBooking/locales.js +30 -6
  227. package/lib/components/index.d.ts +3 -1
  228. package/lib/components/index.js +6 -0
  229. package/lib/components/pay/toC/PaymentMethods/index.js +10 -9
  230. package/lib/components/stepController/components/Content/index.d.ts +7 -0
  231. package/lib/components/stepController/components/Content/index.js +40 -0
  232. package/lib/components/stepController/components/Content/index.less +8 -0
  233. package/lib/components/stepController/components/Footer/index.d.ts +8 -0
  234. package/lib/components/stepController/components/Footer/index.js +49 -0
  235. package/lib/components/stepController/components/Footer/index.less +39 -0
  236. package/lib/components/stepController/components/Header/index.d.ts +20 -0
  237. package/lib/components/stepController/components/Header/index.js +104 -0
  238. package/lib/components/stepController/components/Header/index.less +21 -0
  239. package/lib/components/stepController/index.d.ts +5 -0
  240. package/lib/components/stepController/index.js +89 -0
  241. package/lib/components/stepController/index.less +11 -0
  242. package/lib/components/stepController/locales.d.ts +27 -0
  243. package/lib/components/stepController/locales.js +50 -0
  244. package/lib/components/stepController/types.d.ts +23 -0
  245. package/lib/components/stepController/types.js +17 -0
  246. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +6 -4
  247. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  248. package/lib/components/ticketBooking/components/ticketBooking/index.js +263 -139
  249. package/lib/components/ticketBooking/locales.d.ts +164 -146
  250. package/lib/components/ticketBooking/locales.js +22 -4
  251. package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  252. package/lib/components/ticketBooking/utils/formatProductMessage.js +84 -0
  253. package/lib/components/ticketBooking/utils/formatTime.d.ts +31 -0
  254. package/lib/components/ticketBooking/utils/formatTime.js +139 -0
  255. package/lib/hooks/useWindowSize.d.ts +5 -0
  256. package/lib/hooks/useWindowSize.js +51 -0
  257. package/lib/index.d.ts +2 -0
  258. package/lib/index.js +6 -0
  259. package/lowcode/edit-booking-modal/meta.ts +53 -0
  260. package/lowcode/step-controller/meta.ts +88 -0
  261. package/package.json +4 -4
@@ -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
  * 计算商品小计(不含其他费用)
@@ -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
  };
@@ -1,5 +1,5 @@
1
1
  .appointment-cart-item-wrap {
2
- height: calc(100vh - 100px);
2
+ height: calc(var(--vh, 1vh) * 100 - 100px);
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
 
@@ -39,7 +39,7 @@
39
39
  flex-direction: column;
40
40
  align-items: start;
41
41
 
42
- >div {
42
+ > div {
43
43
  display: flex;
44
44
  align-items: center;
45
45
  justify-content: space-between;
@@ -105,4 +105,4 @@
105
105
  flex: none;
106
106
  z-index: 10;
107
107
  }
108
- }
108
+ }
@@ -107,7 +107,7 @@
107
107
  margin-top: 0;
108
108
 
109
109
  .appointment-cart-item-wrap {
110
- height: calc(100vh - 16px) !important;
110
+ height: calc(var(--vh, 1vh) * 100 - 16px) !important;
111
111
  }
112
112
  }
113
113
  }
@@ -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;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Header: () => JSX.Element;
3
+ export default Header;
@@ -85,9 +85,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
85
85
  return checkProductType(item === null || item === void 0 ? void 0 : item.id);
86
86
  case 4:
87
87
  type = _context2.sent;
88
- if (type === 'session') {
89
- appointmentBooking.openProductDetail(item.id);
90
- }
88
+ appointmentBooking.openProductDetail(item.id);
91
89
  case 6:
92
90
  utils === null || utils === void 0 || utils.action({
93
91
  type: 'pisell1.productDetail',
@@ -105,6 +103,13 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
105
103
  return _regeneratorRuntime().wrap(function _callee$(_context) {
106
104
  while (1) switch (_context.prev = _context.next) {
107
105
  case 0:
106
+ if (!data.isCancel) {
107
+ _context.next = 3;
108
+ break;
109
+ }
110
+ appointmentBooking.closeProductDetail();
111
+ return _context.abrupt("return");
112
+ case 3:
108
113
  product = _objectSpread(_objectSpread({}, data), {}, {
109
114
  options: (data === null || data === void 0 ? void 0 : data.option) || []
110
115
  });
@@ -112,31 +117,21 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
112
117
 
113
118
  // 零售模版,直接加入购物车
114
119
  if (!isRetailTemplate) {
115
- _context.next = 7;
120
+ _context.next = 10;
116
121
  break;
117
122
  }
118
123
  if (!(data !== null && data !== void 0 && data.isCancel)) {
119
- _context.next = 5;
124
+ _context.next = 8;
120
125
  break;
121
126
  }
122
127
  return _context.abrupt("return");
123
- case 5:
128
+ case 8:
124
129
  appointmentBooking.storeProduct(product);
125
130
  return _context.abrupt("return");
126
- case 7:
127
- if (!(data !== null && data !== void 0 && data.isCancel)) {
128
- _context.next = 10;
129
- break;
130
- }
131
- if (type === 'session') {
132
- appointmentBooking.closeProductDetail();
133
- appointmentBooking.getAvailableDate();
134
- }
135
- return _context.abrupt("return");
136
131
  case 10:
137
132
  session = data === null || data === void 0 ? void 0 : data.session;
138
133
  if (!session) {
139
- _context.next = 20;
134
+ _context.next = 19;
140
135
  break;
141
136
  }
142
137
  startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
@@ -148,35 +143,36 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
148
143
  endTime: "".concat(endDate, " ").concat(session === null || session === void 0 ? void 0 : session.end_time)
149
144
  }
150
145
  });
151
- appointmentBooking.closeProductDetail();
152
- _context.next = 18;
146
+ _context.next = 17;
153
147
  return appointmentBooking.getAvailableDate({
154
148
  startDate: startDate,
155
149
  endDate: endDate
156
150
  });
157
- case 18:
158
- _context.next = 28;
151
+ case 17:
152
+ _context.next = 27;
159
153
  break;
160
- case 20:
154
+ case 19:
161
155
  resources = (data === null || data === void 0 || (_data$origin = data.origin) === null || _data$origin === void 0 || (_data$origin = _data$origin.product_resource) === null || _data$origin === void 0 ? void 0 : _data$origin.resources) || [];
162
156
  activeStatus = resources.find(function (item) {
163
157
  return item.status === 1;
164
158
  });
165
159
  if (!(!activeStatus && !appointmentBooking.isTargetNormalProduct(data === null || data === void 0 ? void 0 : data.origin))) {
166
- _context.next = 24;
160
+ _context.next = 23;
167
161
  break;
168
162
  }
169
163
  return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
170
- case 24:
164
+ case 23:
171
165
  appointmentBooking.storeProduct(product);
172
166
  // duration 类型的商品,要获取一下资源,在先选日期的 duration 步骤里目前只能通过这个动作拉取
173
167
  if (!(type === 'duration')) {
174
- _context.next = 28;
168
+ _context.next = 27;
175
169
  break;
176
170
  }
177
- _context.next = 28;
171
+ _context.next = 27;
178
172
  return appointmentBooking.getAvailableDate();
179
- case 28:
173
+ case 27:
174
+ appointmentBooking.closeProductDetail();
175
+
180
176
  // 先选择日期流程
181
177
  if (isDateSelectedFirst) {
182
178
  index = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2; //先选择日期流程:如果商品类型是duration的商品,则需要增加选择时间步骤
@@ -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;
@@ -27,6 +27,20 @@ var AppointmentBooking = function AppointmentBooking() {
27
27
  }
28
28
  });
29
29
  }, []);
30
+ useEffect(function () {
31
+ var setRealVH = function setRealVH() {
32
+ // window.innerHeight 会返回视口真实的高度(不包括工具栏)
33
+ var vh = window.innerHeight * 0.01;
34
+ document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
35
+ };
36
+
37
+ // 页面加载和窗口大小变化时都重新计算
38
+ setRealVH();
39
+ window.addEventListener('resize', setRealVH);
40
+ return function () {
41
+ window.removeEventListener('resize', setRealVH);
42
+ };
43
+ }, []);
30
44
  return /*#__PURE__*/React.createElement("div", {
31
45
  className: "parallel-booking-wrap ".concat(isMobile() ? 'parallel-booking-mobile-wrap' : '')
32
46
  }, /*#__PURE__*/React.createElement(AppointmentBookingProvider, null, /*#__PURE__*/React.createElement(Content, null)));
@@ -3,7 +3,7 @@
3
3
  flex-direction: column;
4
4
  align-items: center;
5
5
  background: #ffffff;
6
- height: 100vh;
6
+ height: calc(var(--vh, 1vh) * 100);
7
7
  overflow-y: auto;
8
8
 
9
9
  .pisell-section-headers {
@@ -27,6 +27,7 @@ export interface ResourceItem {
27
27
  * @Author: jinglin.tan
28
28
  */
29
29
  export declare const checkSubResourcesCapacity: (resource: ResourceItem) => void;
30
+ export declare const checkResourcesFormat: (resources: any[], service: any, isChild?: boolean) => any[];
30
31
  /**
31
32
  * @title: 格式化商品单价
32
33
  * @description:
@@ -152,7 +152,7 @@ export var checkSubResourcesCapacity = function checkSubResourcesCapacity(resour
152
152
  });
153
153
  }
154
154
  };
155
- var checkResourcesFormat = function checkResourcesFormat(resources, service, isChild) {
155
+ export var checkResourcesFormat = function checkResourcesFormat(resources, service, isChild) {
156
156
  return resources.map(function (resource) {
157
157
  var _resource$children;
158
158
  if (!isChild) {
@@ -359,7 +359,7 @@ var formatAppointmentProductLists = function formatAppointmentProductLists(data)
359
359
  // 找出预约商品
360
360
  list = list.filter(function (item) {
361
361
  var _item$_extend18;
362
- return ((_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.holder_id) && appointmentTypes.includes(item.extension_type);
362
+ return ((_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.holder_id) && !isNormalProductByDurationSchedule(item);
363
363
  });
364
364
 
365
365
  // 对预约商品列表根据holder_id进行分组
@@ -515,8 +515,7 @@ var formatRelationProducts = function formatRelationProducts(data) {
515
515
  var list = ((_data$service = data.service) === null || _data$service === void 0 ? void 0 : _data$service.value) || [];
516
516
  // open items 下的商品
517
517
  list = list.filter(function (item) {
518
- var _item$_extend24;
519
- return !((_item$_extend24 = item._extend) !== null && _item$_extend24 !== void 0 && _item$_extend24.holder_id);
518
+ return isNormalProductByDurationSchedule(item);
520
519
  });
521
520
  var relationProducts = [];
522
521
  relationProducts = list.map(function (item) {
@@ -645,7 +644,7 @@ export var formatValues = function formatValues(state) {
645
644
  export var checkHolderIsError = function checkHolderIsError(state) {
646
645
  var _state$client;
647
646
  var holderError = state.service.value.some(function (item) {
648
- var _item$_extend25;
647
+ var _item$_extend24;
649
648
  // 普通商品不需要检测holder
650
649
  if (isNormalProductByDurationSchedule(item)) {
651
650
  return false;
@@ -653,7 +652,7 @@ export var checkHolderIsError = function checkHolderIsError(state) {
653
652
  if (item._extend.quantity === 1 && !item._extend.holder_id) {
654
653
  return true;
655
654
  }
656
- if (item._extend.quantity > 1 && ((_item$_extend25 = item._extend) === null || _item$_extend25 === void 0 || (_item$_extend25 = _item$_extend25.holder_id) === null || _item$_extend25 === void 0 ? void 0 : _item$_extend25.length) !== item._extend.quantity) {
655
+ if (item._extend.quantity > 1 && ((_item$_extend24 = item._extend) === null || _item$_extend24 === void 0 || (_item$_extend24 = _item$_extend24.holder_id) === null || _item$_extend24 === void 0 ? void 0 : _item$_extend24.length) !== item._extend.quantity) {
657
656
  return true;
658
657
  }
659
658
  return false;
@@ -26,8 +26,8 @@ import useEngineContext from "../../../../hooks/useEngineContext";
26
26
  import { PisellInput, PisellGoodPassCard, PisellToast } from '@pisell/materials';
27
27
  import { useIsBooking4Shop } from "../../hooks/useIsBooking4Shop";
28
28
  import "./index.less";
29
- import { getServiceAddons } from "./utils";
30
29
  import { useMemoizedFn, useDebounceFn, useDebounceEffect } from 'ahooks';
30
+ import { getServiceAddons } from "./utils";
31
31
  var ShopDiscountHooks = {
32
32
  onInited: 'shopDiscount:onInited',
33
33
  onDestroy: 'shopDiscount:onDestroy',
@@ -275,8 +275,8 @@ var VoucherCard = function VoucherCard(props) {
275
275
  style: {
276
276
  width: '100%'
277
277
  },
278
- mixedSort: mixedSort,
279
278
  dataSource: (_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length ? availableData : [],
279
+ mixedSort: mixedSort,
280
280
  onChange: function onChange(val) {
281
281
  var shopDiscount = pisellos.getModule('shopDiscount');
282
282
  var detail = shopDiscount.setDiscountSelected({
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { EditBookingModalProps } from './type';
3
+ import './index.less';
4
+ declare const _default: React.ForwardRefExoticComponent<EditBookingModalProps & React.RefAttributes<unknown>>;
5
+ export default _default;