@pisell/private-materials 3.2.33 → 3.2.35

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 (191) 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 +5 -5
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/Sales/Event/index.js +7 -7
  12. package/es/components/Sales/Summary/utils.d.ts +1 -1
  13. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +86 -41
  14. package/es/components/appointmentBooking/components/Cart/Item/Total.js +3 -2
  15. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  16. package/es/components/appointmentBooking/components/Cart/Item/index.js +34 -16
  17. package/es/components/appointmentBooking/components/Cart/Item/index.less +15 -9
  18. package/es/components/appointmentBooking/components/Cart/index.js +2 -7
  19. package/es/components/appointmentBooking/components/ConfirmInformation/index.d.ts +3 -0
  20. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +16 -0
  21. package/es/components/appointmentBooking/components/ConfirmInformation/index.less +24 -0
  22. package/es/components/appointmentBooking/components/Content/index.js +42 -6
  23. package/es/components/appointmentBooking/components/Date/index.js +86 -24
  24. package/es/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
  25. package/es/components/appointmentBooking/components/Deposit/index.js +30 -0
  26. package/es/components/appointmentBooking/components/Deposit/index.less +16 -0
  27. package/es/components/appointmentBooking/components/Form/index.d.ts +3 -0
  28. package/es/components/appointmentBooking/components/Form/index.js +110 -0
  29. package/es/components/appointmentBooking/components/Form/index.less +3 -0
  30. package/es/components/appointmentBooking/components/Header/index.js +3 -2
  31. package/es/components/appointmentBooking/components/Resource/index.js +4 -1
  32. package/es/components/appointmentBooking/components/Services/index.js +103 -9
  33. package/es/components/appointmentBooking/context.d.ts +3 -0
  34. package/es/components/appointmentBooking/context.js +19 -3
  35. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  36. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +108 -0
  37. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
  38. package/es/components/appointmentBooking/deposit/index.d.ts +3 -0
  39. package/es/components/appointmentBooking/deposit/index.js +101 -0
  40. package/es/components/appointmentBooking/deposit/index.less +53 -0
  41. package/es/components/appointmentBooking/hooks.d.ts +16 -0
  42. package/es/components/appointmentBooking/hooks.js +138 -53
  43. package/es/components/appointmentBooking/index.js +8 -0
  44. package/es/components/appointmentBooking/locales.d.ts +36 -3
  45. package/es/components/appointmentBooking/locales.js +42 -3
  46. package/es/components/appointmentBooking/utils.d.ts +23 -1
  47. package/es/components/appointmentBooking/utils.js +112 -27
  48. package/es/components/booking/addons/model.js +5 -5
  49. package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
  50. package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
  51. package/es/components/booking/components/browserSelect/index.js +1 -1
  52. package/es/components/booking/components/footer/index.js +6 -4
  53. package/es/components/booking/components/voucher/index.js +13 -15
  54. package/es/components/booking/forms/model.js +5 -5
  55. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  56. package/es/components/booking/info/index.js +2 -8
  57. package/es/components/booking/info/service/like/index.js +1 -1
  58. package/es/components/booking/info/service2/utils.d.ts +1 -1
  59. package/es/components/booking/info2/service/addTimeModal/index.js +3 -2
  60. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +4 -2
  61. package/es/components/booking/info2/service/editService/index.js +4 -11
  62. package/es/components/booking/materiels/startTime/index.js +1 -1
  63. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  64. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  65. package/es/components/booking/notes/addNote/index.js +1 -1
  66. package/es/components/booking/notes/model.js +5 -5
  67. package/es/components/booking/payments/model.js +5 -5
  68. package/es/components/booking/utils.d.ts +2 -2
  69. package/es/components/eftposPay/amount.d.ts +1 -1
  70. package/es/components/eftposPay/device.d.ts +1 -1
  71. package/es/components/eftposPay/hooks.d.ts +2 -2
  72. package/es/components/eftposPay/store/index.d.ts +4 -4
  73. package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
  74. package/es/components/eventBooking/components/Provider/SelectProduct/index.js +77 -0
  75. package/es/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
  76. package/es/components/listComponent/index.js +5 -5
  77. package/es/components/productExtension/card/index.js +3 -3
  78. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  79. package/es/components/productExtension/fields/Forms/index.js +12 -12
  80. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  81. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  82. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  83. package/es/components/productExtension/server.js +2 -2
  84. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  85. package/es/components/schedules/calendar/index.js +4 -4
  86. package/es/components/schedules/calendar/serve.js +2 -2
  87. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  88. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  89. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  90. package/es/components/schedules/components/ResourceList/index.js +1 -1
  91. package/es/components/schedules/components/Search/index.js +5 -5
  92. package/es/components/schedules/model.js +5 -5
  93. package/es/components/schedules/openHours/index.js +1 -1
  94. package/es/components/schedules/openHours/serve.js +2 -2
  95. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  96. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  97. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  98. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  99. package/es/components/schedules/products/serve.js +2 -2
  100. package/es/components/schedules/products/utils.js +5 -5
  101. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  102. package/es/components/schedules/resources/detail/index.js +10 -10
  103. package/es/components/schedules/resources/list/index.js +2 -2
  104. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  105. package/es/components/schedules/resources/serve.js +2 -2
  106. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  107. package/es/components/schedules/utils.d.ts +1 -1
  108. package/es/components/schedules/utils.js +4 -4
  109. package/es/components/selectModal/index.js +2 -2
  110. package/es/components/shoppingCart/components/Cart/Product.js +16 -3
  111. package/es/components/shoppingCart/status.js +4 -1
  112. package/es/components/shoppingCart/type.d.ts +3 -0
  113. package/es/components/wallet/Detail/index.js +1 -1
  114. package/es/components/wallet/components/WalletCard.js +1 -1
  115. package/es/hooks/useComponents.js +1 -1
  116. package/es/index.d.ts +1 -0
  117. package/es/index.js +2 -1
  118. package/es/utils/index.d.ts +1 -1
  119. package/lib/components/Sales/Event/index.js +5 -1
  120. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  121. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +56 -20
  122. package/lib/components/appointmentBooking/components/Cart/Item/Total.js +31 -24
  123. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  124. package/lib/components/appointmentBooking/components/Cart/Item/index.js +31 -11
  125. package/lib/components/appointmentBooking/components/Cart/Item/index.less +15 -9
  126. package/lib/components/appointmentBooking/components/Cart/index.js +2 -2
  127. package/lib/components/appointmentBooking/components/ConfirmInformation/index.d.ts +3 -0
  128. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +42 -0
  129. package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +24 -0
  130. package/lib/components/appointmentBooking/components/Content/index.js +31 -3
  131. package/lib/components/appointmentBooking/components/Date/index.js +27 -8
  132. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
  133. package/lib/components/appointmentBooking/components/Deposit/index.js +61 -0
  134. package/lib/components/appointmentBooking/components/Deposit/index.less +16 -0
  135. package/lib/components/appointmentBooking/components/Form/index.d.ts +3 -0
  136. package/lib/components/appointmentBooking/components/Form/index.js +108 -0
  137. package/lib/components/appointmentBooking/components/Form/index.less +3 -0
  138. package/lib/components/appointmentBooking/components/Header/index.js +9 -6
  139. package/lib/components/appointmentBooking/components/Resource/index.js +2 -0
  140. package/lib/components/appointmentBooking/components/Services/index.js +48 -7
  141. package/lib/components/appointmentBooking/context.d.ts +3 -0
  142. package/lib/components/appointmentBooking/context.js +12 -4
  143. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  144. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +95 -0
  145. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
  146. package/lib/components/appointmentBooking/deposit/index.d.ts +3 -0
  147. package/lib/components/appointmentBooking/deposit/index.js +109 -0
  148. package/lib/components/appointmentBooking/deposit/index.less +53 -0
  149. package/lib/components/appointmentBooking/hooks.d.ts +16 -0
  150. package/lib/components/appointmentBooking/hooks.js +49 -6
  151. package/lib/components/appointmentBooking/index.js +5 -0
  152. package/lib/components/appointmentBooking/locales.d.ts +36 -3
  153. package/lib/components/appointmentBooking/locales.js +36 -3
  154. package/lib/components/appointmentBooking/utils.d.ts +23 -1
  155. package/lib/components/appointmentBooking/utils.js +84 -26
  156. package/lib/components/booking/components/footer/index.js +8 -6
  157. package/lib/components/booking/components/voucher/index.js +11 -15
  158. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  159. package/lib/components/booking/info/index.js +4 -6
  160. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  161. package/lib/components/booking/info2/service/addTimeModal/index.js +4 -3
  162. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +2 -1
  163. package/lib/components/booking/info2/service/editService/index.js +4 -11
  164. package/lib/components/booking/utils.d.ts +2 -2
  165. package/lib/components/eftposPay/amount.d.ts +1 -1
  166. package/lib/components/eftposPay/device.d.ts +1 -1
  167. package/lib/components/eftposPay/hooks.d.ts +2 -2
  168. package/lib/components/eftposPay/store/index.d.ts +4 -4
  169. package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
  170. package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +69 -0
  171. package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
  172. package/lib/components/schedules/utils.d.ts +1 -1
  173. package/lib/components/schedules/utils.js +1 -1
  174. package/lib/components/shoppingCart/components/Cart/Product.js +14 -3
  175. package/lib/components/shoppingCart/status.js +4 -1
  176. package/lib/components/shoppingCart/type.d.ts +3 -0
  177. package/lib/components/wallet/Detail/index.js +1 -1
  178. package/lib/components/wallet/components/WalletCard.js +1 -1
  179. package/lib/index.d.ts +1 -0
  180. package/lib/index.js +3 -0
  181. package/lib/utils/index.d.ts +1 -1
  182. package/lowcode/appointment-deposit/meta.ts +58 -0
  183. package/package.json +4 -4
  184. package/es/components/ticketBooking/data.d.ts +0 -0
  185. package/es/components/ticketBooking/data.js +0 -82
  186. package/es/components/ticketBooking/index.d.ts +0 -2
  187. package/es/components/ticketBooking/index.js +0 -6
  188. package/lib/components/ticketBooking/data.d.ts +0 -0
  189. package/lib/components/ticketBooking/data.js +0 -0
  190. package/lib/components/ticketBooking/index.d.ts +0 -2
  191. package/lib/components/ticketBooking/index.js +0 -28
@@ -87,13 +87,13 @@ export var EventProvider = function EventProvider(_ref) {
87
87
  setEventData({
88
88
  currentEventItem: eventItem
89
89
  });
90
- // if (currentCartItem) {
91
- // updateCurrentCartItem({ eventItem: eventItem });
92
- // } else {
93
- // createCartItemFromEvent(eventItem);
94
- // }
95
- // 每次添加商品时都需要直接创建购物车,防止第一步创建的购物车数据和缓存数据冲突
96
- createCartItemFromEvent(eventItem);
90
+ if (currentCartItem) {
91
+ updateCurrentCartItem({
92
+ eventItem: eventItem
93
+ });
94
+ } else {
95
+ createCartItemFromEvent(eventItem);
96
+ }
97
97
  };
98
98
  var contextValue = {
99
99
  eventData: eventData,
@@ -25,7 +25,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
25
25
  * @return {*}
26
26
  * @Author: xiangfeng.xue
27
27
  */
28
- export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
28
+ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
29
29
  /**
30
30
  * 计算所有价格明细
31
31
  * @param items - 购物车商品数组
@@ -14,7 +14,7 @@ import { Button, PisellToast } from '@pisell/materials';
14
14
  import useEngineContext from "../../../../../hooks/useEngineContext";
15
15
  import { useAppointmentBookingLogin, useAppointmentBookingResource, useAppointmentBookingAccount, useShopDiscount, useIsSkipResourceStep, useAppointmentBookingStep } from "../../../hooks";
16
16
  import { useAppointmentBookingContext } from "../../../context";
17
- import { formatCustomer, isEmptyCartsResourceId } from "../../../utils";
17
+ import { formatCustomer, isEmptyCartsResourceId, formatCarts, hasResourceFormId } from "../../../utils";
18
18
  import "./index.less";
19
19
  var ContinueButton = function ContinueButton() {
20
20
  var _currentStep$step;
@@ -36,7 +36,12 @@ var ContinueButton = function ContinueButton() {
36
36
  carts = _useAppointmentBookin3.carts,
37
37
  appointmentBooking = _useAppointmentBookin3.appointmentBooking,
38
38
  resourceOtherParams = _useAppointmentBookin3.resourceOtherParams,
39
- summary = _useAppointmentBookin3.summary;
39
+ summary = _useAppointmentBookin3.summary,
40
+ isAgreeDepositPolicy = _useAppointmentBookin3.isAgreeDepositPolicy,
41
+ setIsAgreeDepositPolicy = _useAppointmentBookin3.setIsAgreeDepositPolicy,
42
+ resources = _useAppointmentBookin3.resources,
43
+ currentResource = _useAppointmentBookin3.currentResource,
44
+ setCurrentResource = _useAppointmentBookin3.setCurrentResource;
40
45
  var _useAppointmentBookin4 = useAppointmentBookingResource(),
41
46
  getResourceTimeSlot = _useAppointmentBookin4.getResourceTimeSlot,
42
47
  getResourceList = _useAppointmentBookin4.getResourceList,
@@ -44,11 +49,13 @@ var ContinueButton = function ContinueButton() {
44
49
  var _useIsSkipResourceSte = useIsSkipResourceStep(),
45
50
  checkSkipResourceStep = _useIsSkipResourceSte.checkSkipResourceStep;
46
51
  var _useAppointmentBookin5 = useAppointmentBookingStep(),
47
- getStepIndex = _useAppointmentBookin5.getStepIndex;
52
+ getStepIndex = _useAppointmentBookin5.getStepIndex,
53
+ stepList = _useAppointmentBookin5.stepList;
48
54
  var disabled = useMemo(function () {
49
55
  if (!carts.length) return true;
50
56
  return false;
51
57
  }, [currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key, carts, accountLists, resourceOtherParams === null || resourceOtherParams === void 0 ? void 0 : resourceOtherParams.errorList]);
58
+ console.log(formatCarts(carts, resources), 'wh98987');
52
59
 
53
60
  /**
54
61
  * @title: 清空数据
@@ -61,6 +68,12 @@ var ContinueButton = function ContinueButton() {
61
68
  var _shopDiscount$destroy;
62
69
  appointmentBooking.destroy();
63
70
  shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$destroy = shopDiscount.destroy) === null || _shopDiscount$destroy === void 0 || _shopDiscount$destroy.call(shopDiscount);
71
+ setIsAgreeDepositPolicy(false);
72
+ };
73
+ var goPaymentFinish = function goPaymentFinish(order_id, amount) {
74
+ var _utils$history;
75
+ var url = "/payment-finish/success?order_id=".concat(order_id, "&amount=").concat(Number(amount));
76
+ utils === null || utils === void 0 || (_utils$history = utils.history) === null || _utils$history === void 0 || _utils$history.replace(url);
64
77
  };
65
78
 
66
79
  /**
@@ -73,68 +86,75 @@ var ContinueButton = function ContinueButton() {
73
86
  var handleNextStep = /*#__PURE__*/function () {
74
87
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
75
88
  var _currentStep$step2;
76
- var res, _ref2, order_id, total_amount, freeResult, _utils$history, url;
89
+ var deposit, _yield$appointmentBoo, data, _ref2, is_deposit, deposit_amount, total_amount, order_id, _total, freeResult;
77
90
  return _regeneratorRuntime().wrap(function _callee$(_context) {
78
91
  while (1) switch (_context.prev = _context.next) {
79
92
  case 0:
80
93
  if (!isLastStep) {
81
- _context.next = 24;
94
+ _context.next = 29;
82
95
  break;
83
96
  }
97
+ deposit = summary.deposit;
84
98
  setLoading(true);
85
- _context.prev = 2;
86
- _context.next = 5;
99
+ _context.prev = 3;
100
+ _context.next = 6;
87
101
  return appointmentBooking.submitOrder();
88
- case 5:
89
- res = _context.sent;
90
- if (!((summary === null || summary === void 0 ? void 0 : summary.total) > 0)) {
91
- _context.next = 10;
102
+ case 6:
103
+ _yield$appointmentBoo = _context.sent;
104
+ data = _yield$appointmentBoo.data;
105
+ _ref2 = data || {}, is_deposit = _ref2.is_deposit, deposit_amount = _ref2.deposit_amount, total_amount = _ref2.total_amount, order_id = _ref2.order_id; // 如果有定金,则支付定金金额,否则订单金额
106
+ _total = is_deposit ? deposit_amount : total_amount;
107
+ if (!(_total > 0)) {
108
+ _context.next = 14;
92
109
  break;
93
110
  }
94
111
  // 拉起支付弹窗
95
112
  utils.action({
96
113
  type: 'pisell1.payment',
97
- data: res === null || res === void 0 ? void 0 : res.data
114
+ data: data
98
115
  });
99
- _context.next = 16;
116
+ _context.next = 21;
100
117
  break;
101
- case 10:
102
- // 免费领取
103
- _ref2 = (res === null || res === void 0 ? void 0 : res.data) || {}, order_id = _ref2.order_id, total_amount = _ref2.total_amount;
104
- _context.next = 13;
118
+ case 14:
119
+ if (!(deposit !== null && deposit !== void 0 && deposit.hasDeposit)) {
120
+ _context.next = 16;
121
+ break;
122
+ }
123
+ return _context.abrupt("return", goPaymentFinish(order_id, _total));
124
+ case 16:
125
+ _context.next = 18;
105
126
  return appointmentBooking.getFreeProduct(order_id);
106
- case 13:
127
+ case 18:
107
128
  freeResult = _context.sent;
108
129
  console.log(freeResult, 'freeResult');
109
130
  if (freeResult !== null && freeResult !== void 0 && freeResult.status) {
110
- url = "/payment-finish/success?order_id=".concat(order_id, "&amount=").concat(Number(total_amount));
111
- utils === null || utils === void 0 || (_utils$history = utils.history) === null || _utils$history === void 0 || _utils$history.replace(url);
131
+ goPaymentFinish(order_id, total_amount);
112
132
  } else {
113
133
  PisellToast({
114
134
  content: freeResult === null || freeResult === void 0 ? void 0 : freeResult.message
115
135
  });
116
136
  }
117
- case 16:
137
+ case 21:
118
138
  clearData();
119
139
  setLoading(false);
120
- _context.next = 23;
140
+ _context.next = 28;
121
141
  break;
122
- case 20:
123
- _context.prev = 20;
124
- _context.t0 = _context["catch"](2);
142
+ case 25:
143
+ _context.prev = 25;
144
+ _context.t0 = _context["catch"](3);
125
145
  setLoading(false);
126
- case 23:
146
+ case 28:
127
147
  return _context.abrupt("return");
128
- case 24:
148
+ case 29:
129
149
  if ((currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key) === 'select-resource') {
130
150
  getResourceTimeSlot();
131
151
  }
132
152
  return _context.abrupt("return", appointmentBooking.next());
133
- case 26:
153
+ case 31:
134
154
  case "end":
135
155
  return _context.stop();
136
156
  }
137
- }, _callee, null, [[2, 20]]);
157
+ }, _callee, null, [[3, 25]]);
138
158
  }));
139
159
  return function handleNextStep() {
140
160
  return _ref.apply(this, arguments);
@@ -151,7 +171,7 @@ var ContinueButton = function ContinueButton() {
151
171
  var handleContinue = /*#__PURE__*/function () {
152
172
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
153
173
  var _currentStep$step3;
154
- var key, skipResourceStep, index;
174
+ var key, _summary$deposit, skipResourceStep, index;
155
175
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
156
176
  while (1) switch (_context2.prev = _context2.next) {
157
177
  case 0:
@@ -159,11 +179,19 @@ var ContinueButton = function ContinueButton() {
159
179
  console.log(currentStep, isLastStep, isLogin, accountLists, 'wh9896788222');
160
180
  // 如果当前是确认信息页面,则到结算页面
161
181
  if (!isLastStep) {
182
+ _context2.next = 7;
183
+ break;
184
+ }
185
+ if (!(summary !== null && summary !== void 0 && (_summary$deposit = summary.deposit) !== null && _summary$deposit !== void 0 && _summary$deposit.hasDeposit && !isAgreeDepositPolicy)) {
162
186
  _context2.next = 5;
163
187
  break;
164
188
  }
189
+ return _context2.abrupt("return", PisellToast({
190
+ content: locales.getText('pisell2.appointment.deposit.agree.policy')
191
+ }));
192
+ case 5:
165
193
  if (isLogin) {
166
- _context2.next = 5;
194
+ _context2.next = 7;
167
195
  break;
168
196
  }
169
197
  return _context2.abrupt("return", openLoginModal({
@@ -180,17 +208,17 @@ var ContinueButton = function ContinueButton() {
180
208
  }
181
209
  }
182
210
  }));
183
- case 5:
211
+ case 7:
184
212
  if (!(key === 'select-date')) {
185
- _context2.next = 15;
213
+ _context2.next = 17;
186
214
  break;
187
215
  }
188
- _context2.next = 8;
216
+ _context2.next = 10;
189
217
  return checkSkipResourceStep();
190
- case 8:
218
+ case 10:
191
219
  skipResourceStep = _context2.sent;
192
220
  if (!skipResourceStep) {
193
- _context2.next = 15;
221
+ _context2.next = 17;
194
222
  break;
195
223
  }
196
224
  index = getStepIndex('next', 2);
@@ -198,18 +226,35 @@ var ContinueButton = function ContinueButton() {
198
226
  autoSelectAllProductResources();
199
227
  appointmentBooking.gotoStep(index);
200
228
  return _context2.abrupt("return");
201
- case 15:
202
- if (!(key === 'select-resource' && isEmptyCartsResourceId(carts))) {
203
- _context2.next = 18;
229
+ case 17:
230
+ if (!(key === 'select-resource')) {
231
+ _context2.next = 23;
232
+ break;
233
+ }
234
+ if (!isEmptyCartsResourceId(carts)) {
235
+ _context2.next = 21;
204
236
  break;
205
237
  }
206
238
  PisellToast({
207
239
  content: locales.getText('pisell2.appointment.no.available.time')
208
240
  });
209
241
  return _context2.abrupt("return");
210
- case 18:
242
+ case 21:
243
+ console.log(23423232344, hasResourceFormId(formatCarts(carts, resources)));
244
+
245
+ // 验证资源是否挂接了表单
246
+ if (hasResourceFormId(formatCarts(carts, resources))) {
247
+ appointmentBooking.addStep({
248
+ // index: stepList - 2,
249
+ key: 'fill-form',
250
+ description: locales.getText('pisell2.appointment.fill-form')
251
+ });
252
+ } else {
253
+ appointmentBooking.removeStep('fill-form');
254
+ }
255
+ case 23:
211
256
  handleNextStep();
212
- case 19:
257
+ case 24:
213
258
  case "end":
214
259
  return _context2.stop();
215
260
  }
@@ -17,10 +17,11 @@ var Total = function Total(_ref) {
17
17
  var taxTitle = summary.taxTitle,
18
18
  totalTaxFee = summary.totalTaxFee,
19
19
  isPriceIncludeTax = summary.isPriceIncludeTax,
20
- total = summary.total;
20
+ total = summary.total,
21
+ deposit = summary.deposit;
21
22
  console.log(summary, 'summarysummary');
22
23
  return /*#__PURE__*/React.createElement("div", {
23
- className: "appointment-total-wrap ".concat(className)
24
+ className: "appointment-total-wrap ".concat(className, " ").concat(deposit !== null && deposit !== void 0 && deposit.hasDeposit ? 'appointment-total-deposit-wrap' : '')
24
25
  }, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /*#__PURE__*/React.createElement("div", {
25
26
  className: "gst-wrap"
26
27
  }, /*#__PURE__*/React.createElement("span", null, taxTitle, isFooter ? ': ' : ''), /*#__PURE__*/React.createElement(PisellText.Amount, {
@@ -1,3 +1,3 @@
1
1
  import './index.less';
2
- declare const CartItem: ({ onConfirm }: any) => JSX.Element;
2
+ declare const CartItem: () => JSX.Element;
3
3
  export default CartItem;
@@ -10,15 +10,15 @@ import ShoppingCart from "../../../../shoppingCart";
10
10
  import ContinueButton from "../ContinueButton";
11
11
  import { useAppointmentBooking } from "../../../hooks";
12
12
  import { useAppointmentBookingContext } from "../../../context";
13
- import { useAppointmentBookingAccount, useAppointmentBookingResource } from "../../../hooks";
13
+ import { useAppointmentBookingAccount, useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingLogin } from "../../../hooks";
14
14
  import { formatHolder, formatCarts, formatCurrentUser } from "../../../utils";
15
15
  import VoucherCard from "../../Voucher";
16
16
  import Total from "./Total";
17
+ import Deposit from "../../Deposit";
17
18
  import useEngineContext from "../../../../../hooks/useEngineContext";
18
19
  import "./index.less";
19
- var CartItem = function CartItem(_ref) {
20
- var _context$appHelper, _businessUtils$getApp, _currentStep$step, _currentStep$step2;
21
- var onConfirm = _ref.onConfirm;
20
+ var CartItem = function CartItem() {
21
+ var _context$appHelper, _currentStep$step, _currentStep$step2, _currentStep$step3;
22
22
  var appointmentBooking = useAppointmentBooking();
23
23
  var _useAppointmentBookin = useAppointmentBookingContext(),
24
24
  carts = _useAppointmentBookin.carts,
@@ -26,27 +26,39 @@ var CartItem = function CartItem(_ref) {
26
26
  currentStep = _useAppointmentBookin.currentStep,
27
27
  resources = _useAppointmentBookin.resources,
28
28
  setResourceOtherParams = _useAppointmentBookin.setResourceOtherParams,
29
- resourceOtherParams = _useAppointmentBookin.resourceOtherParams;
29
+ resourceOtherParams = _useAppointmentBookin.resourceOtherParams,
30
+ summary = _useAppointmentBookin.summary;
30
31
  var _useAppointmentBookin2 = useAppointmentBookingAccount(),
31
- accountLists = _useAppointmentBookin2.accountLists;
32
+ accountLists = _useAppointmentBookin2.accountLists,
33
+ getHolders = _useAppointmentBookin2.getHolders;
32
34
  var _useAppointmentBookin3 = useAppointmentBookingResource(),
33
35
  getResourceList = _useAppointmentBookin3.getResourceList;
36
+ var _useAppointmentBookin4 = useAppointmentBookingSetting(),
37
+ isFormSubject = _useAppointmentBookin4.isFormSubject;
38
+ var _useAppointmentBookin5 = useAppointmentBookingLogin(),
39
+ isLogin = _useAppointmentBookin5.isLogin;
34
40
  var context = useEngineContext();
35
41
  var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
36
42
  businessUtils = _context$appHelper$ut.businessUtils;
37
43
  var currentUser = formatCurrentUser();
44
+ var deposit = summary.deposit;
45
+ console.log(deposit, accountLists, 'deposit');
38
46
  var holderIds = useMemo(function () {
47
+ if (isFormSubject) return [];
39
48
  return accountLists.map(function (item) {
40
49
  return item.id;
41
50
  });
42
- }, [accountLists]);
51
+ }, [accountLists, isFormSubject]);
43
52
  var holders = useMemo(function () {
53
+ if (isFormSubject) return [];
44
54
  return formatHolder(accountLists);
45
- }, [accountLists]);
55
+ }, [accountLists, isFormSubject]);
46
56
 
47
57
  // 是否安装商品券应用
48
- var hasGoodPassApp = !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp = businessUtils.getAppByModal) !== null && _businessUtils$getApp !== void 0 && _businessUtils$getApp.call(businessUtils, 'goodpass'));
49
- console.log('has goodpass app:', hasGoodPassApp);
58
+ var hasGoodPassApp = useMemo(function () {
59
+ var _businessUtils$getApp;
60
+ return !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp = businessUtils.getAppByModal) !== null && _businessUtils$getApp !== void 0 && _businessUtils$getApp.call(businessUtils, 'goodpass'));
61
+ }, []);
50
62
  var handleClickCard = function handleClickCard(e, type, val) {
51
63
  // 更改备注
52
64
  if (type === 'note') {
@@ -71,25 +83,31 @@ var CartItem = function CartItem(_ref) {
71
83
  setResourceOtherParams(_objectSpread(_objectSpread({}, resourceOtherParams), {}, {
72
84
  errorList: null
73
85
  }));
74
- return appointmentBooking.updateCart({
86
+ appointmentBooking.updateCart({
75
87
  _id: e === null || e === void 0 ? void 0 : e._id,
76
88
  resources: [val]
77
89
  });
90
+ getResourceList();
91
+ return;
78
92
  }
79
93
  };
94
+ console.log((currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key) === 'select-resource', holders, 'select-resource');
80
95
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
81
96
  className: "appointment-cart-item-wrap ".concat(isMobile() ? 'appointment-cart-mobile-item-wrap' : '')
82
97
  }, /*#__PURE__*/React.createElement("div", {
83
98
  className: "content"
84
99
  }, /*#__PURE__*/React.createElement(ShoppingCart, {
85
100
  productParams: {
86
- products: formatCarts(carts, resources),
101
+ products: formatCarts(carts, resources, accountLists),
87
102
  hideAddBtn: false,
88
103
  holders: holders,
89
104
  disabledEdit: isLastStep,
90
- isShowChangeResource: (currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key) === 'select-resource',
91
- isShowDelete: (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key) === 'select-service',
92
- isShowPackageNote: false
105
+ isShowChangeResource: (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key) === 'select-resource',
106
+ isShowDelete: (currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key) === 'select-service',
107
+ isShowPackageNote: false,
108
+ isShowChangeHolder: isFormSubject && isLogin,
109
+ isShowHolder: isFormSubject,
110
+ isShowAddHolderButton: true
93
111
  },
94
112
  collapseParams: {
95
113
  activeKey: holderIds,
@@ -107,6 +125,6 @@ var CartItem = function CartItem(_ref) {
107
125
  }, hasGoodPassApp ? /*#__PURE__*/React.createElement(VoucherCard, {
108
126
  currentUser: currentUser,
109
127
  products: carts
110
- }) : null, /*#__PURE__*/React.createElement(Total, null), /*#__PURE__*/React.createElement(ContinueButton, null))));
128
+ }) : null, /*#__PURE__*/React.createElement(Total, null), (carts === null || carts === void 0 ? void 0 : carts.length) > 0 && deposit !== null && deposit !== void 0 && deposit.hasDeposit ? /*#__PURE__*/React.createElement(Deposit, null) : null, /*#__PURE__*/React.createElement(ContinueButton, null))));
111
129
  };
112
130
  export default CartItem;
@@ -74,26 +74,32 @@
74
74
  }
75
75
  }
76
76
 
77
+ .appointment-total-deposit-wrap {
78
+ color: var(--Text-Text_1, #1b1b1b);
79
+ font-size: 20px;
80
+ font-weight: 600;
81
+ line-height: 28px;
82
+ }
83
+
77
84
  .appointment-cart-mobile-item-wrap {
85
+ height: 100%;
78
86
  display: flex;
79
87
  flex-direction: column;
80
- position: relative;
81
- height: 100%;
88
+ overflow: hidden;
82
89
 
83
90
  .content {
84
91
  flex: 1;
85
92
  overflow-y: auto;
86
- padding: 0 0 210px;
87
- max-height: 100%;
93
+ padding: 16px 16px 0;
88
94
  }
95
+
89
96
  .appointment-footer {
90
- z-index: 10;
91
- position: fixed;
92
- bottom: 0;
93
- left: 0;
94
- right: 0;
97
+ background: #fff;
95
98
  border-top: 1px solid #eaecf0;
96
99
  padding: 14px 24px 24px;
97
100
  margin-top: 0;
101
+ position: relative;
102
+ flex: none;
103
+ z-index: 10;
98
104
  }
99
105
  }
@@ -15,17 +15,12 @@ var Cart = function Cart(_ref) {
15
15
  return _onCancel();
16
16
  },
17
17
  bodyStyle: {
18
- padding: '20px'
18
+ padding: 0
19
19
  },
20
20
  destroyOnClose: true,
21
21
  className: "appointment-cart-modal",
22
22
  footer: null,
23
23
  forceRender: true
24
- }, /*#__PURE__*/React.createElement("div", {
25
- style: {
26
- flex: 1,
27
- overflowY: 'auto'
28
- }
29
- }, /*#__PURE__*/React.createElement(CartItem, null)));
24
+ }, /*#__PURE__*/React.createElement(CartItem, null));
30
25
  };
31
26
  export default Cart;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const ConfirmInformation: () => JSX.Element;
3
+ export default ConfirmInformation;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { locales, isMobile } from '@pisell/utils';
3
+ import CartItem from "../Cart/Item";
4
+ import "./index.less";
5
+ var ConfirmInformation = function ConfirmInformation() {
6
+ return /*#__PURE__*/React.createElement("div", {
7
+ className: "appointment-confirm-information-wrap"
8
+ }, isMobile() ? /*#__PURE__*/React.createElement(CartItem, null) : /*#__PURE__*/React.createElement("div", {
9
+ className: "appointment-confirm-information-content"
10
+ }, /*#__PURE__*/React.createElement("span", {
11
+ className: "tips"
12
+ }, locales.getText('pisell2.appointment.tips')), /*#__PURE__*/React.createElement("span", {
13
+ className: "tips-content"
14
+ }, locales.getText('pisell2.appointment.tips.content')('确认'))));
15
+ };
16
+ export default ConfirmInformation;
@@ -0,0 +1,24 @@
1
+ .appointment-confirm-information-wrap {
2
+ padding-top: 20px;
3
+
4
+ .appointment-confirm-information-content {
5
+ display: flex;
6
+ flex-direction: column;
7
+
8
+ .tips {
9
+ margin-top: 24px;
10
+ color: var(--Gray-900, #101828);
11
+ font-size: 18px;
12
+ font-style: normal;
13
+ font-weight: 600;
14
+ }
15
+
16
+ .tips-content {
17
+ margin-top: 4px;
18
+ color: var(--Gray-900, #101828);
19
+ font-size: 16px;
20
+ font-style: normal;
21
+ font-weight: 400;
22
+ }
23
+ }
24
+ }
@@ -20,15 +20,25 @@ import Date from "../Date";
20
20
  import Resource from "../Resource";
21
21
  import TimeSlicing from "../TimeSlicing";
22
22
  import Guest from "../Guest";
23
+ import Form from "../Form";
24
+ import ConfirmInformation from "../ConfirmInformation";
23
25
  import { useAppointmentBookingContext } from "../../context";
24
- import { useAppointmentBookingCart, useAppointmentBookingStep } from "../../hooks";
26
+ import { useAppointmentBookingCart, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBookingLogin, useAppointmentBookingAccount } from "../../hooks";
25
27
  import "./index.less";
26
28
  var Layout = function Layout() {
27
- var _currentStep$step, _currentStep$step3, _currentStep$step4;
29
+ var _currentStep$step, _currentStep$step3, _currentStep$step4, _currentStep$step6;
28
30
  var _useAppointmentBookin = useAppointmentBookingContext(),
29
31
  currentStep = _useAppointmentBookin.currentStep,
30
32
  setResourceOtherParams = _useAppointmentBookin.setResourceOtherParams,
31
33
  resourceOtherParams = _useAppointmentBookin.resourceOtherParams;
34
+ var _useAppointmentBookin2 = useAppointmentBookingSetting(),
35
+ getLoadAllSchedule = _useAppointmentBookin2.getLoadAllSchedule,
36
+ isDateSelectedFirst = _useAppointmentBookin2.isDateSelectedFirst,
37
+ isFormSubject = _useAppointmentBookin2.isFormSubject;
38
+ var _useAppointmentBookin3 = useAppointmentBookingLogin(),
39
+ isLogin = _useAppointmentBookin3.isLogin;
40
+ var _useAppointmentBookin4 = useAppointmentBookingAccount(),
41
+ getHolders = _useAppointmentBookin4.getHolders;
32
42
 
33
43
  // 不要删除
34
44
  useAppointmentBookingCart();
@@ -37,6 +47,17 @@ var Layout = function Layout() {
37
47
  _useState2 = _slicedToArray(_useState, 2),
38
48
  params = _useState2[0],
39
49
  setParams = _useState2[1];
50
+ useEffect(function () {
51
+ if (isFormSubject && isLogin) {
52
+ getHolders();
53
+ }
54
+ }, [isFormSubject, isLogin]);
55
+ useEffect(function () {
56
+ // 如果先选择日期,则先调用日历接口
57
+ if (isDateSelectedFirst) {
58
+ getLoadAllSchedule();
59
+ }
60
+ }, [isDateSelectedFirst]);
40
61
  useEffect(function () {
41
62
  // 清空资源分配失败数据
42
63
  setResourceOtherParams(_objectSpread(_objectSpread({}, resourceOtherParams), {}, {
@@ -61,7 +82,11 @@ var Layout = function Layout() {
61
82
  // 选择资源
62
83
  'select-resource': Resource,
63
84
  // 时间切片
64
- 'select-time': TimeSlicing
85
+ 'select-time': TimeSlicing,
86
+ // 填写表单
87
+ 'fill-form': Form,
88
+ // 确认信息
89
+ 'confirm-information': ConfirmInformation
65
90
  };
66
91
  var Com = components[key];
67
92
  return /*#__PURE__*/React.createElement(Com, {
@@ -93,12 +118,23 @@ var Layout = function Layout() {
93
118
  }
94
119
  }
95
120
  }, [currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key]);
121
+ var isShowCartCom = useMemo(function () {
122
+ var _currentStep$step5;
123
+ var key = currentStep === null || currentStep === void 0 || (_currentStep$step5 = currentStep.step) === null || _currentStep$step5 === void 0 ? void 0 : _currentStep$step5.key;
124
+ if (isMobile()) return null;
125
+
126
+ // 先选择日期,并且当前步骤是选择日期,则不显示购物车
127
+ if (isDateSelectedFirst && key === 'select-date') {
128
+ return null;
129
+ }
130
+ return /*#__PURE__*/React.createElement("div", {
131
+ className: "parallel-content-right"
132
+ }, /*#__PURE__*/React.createElement(CartItem, null));
133
+ }, [isDateSelectedFirst, currentStep === null || currentStep === void 0 || (_currentStep$step6 = currentStep.step) === null || _currentStep$step6 === void 0 ? void 0 : _currentStep$step6.key]);
96
134
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement("div", {
97
135
  className: "parallel-content-wrap ".concat(isMobile() ? 'parallel-content-mobile-wrap' : '')
98
136
  }, /*#__PURE__*/React.createElement("div", {
99
137
  className: "parallel-content-left"
100
- }, Com), !isMobile() ? /*#__PURE__*/React.createElement("div", {
101
- className: "parallel-content-right"
102
- }, /*#__PURE__*/React.createElement(CartItem, null)) : null), isMobile() ? /*#__PURE__*/React.createElement(Footer, null) : null);
138
+ }, Com), isShowCartCom), isMobile() ? /*#__PURE__*/React.createElement(Footer, null) : null);
103
139
  };
104
140
  export default Layout;