@pisell/private-materials 3.3.45 → 3.3.47

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 (143) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +3 -3
  6. package/build/lowcode/view.js +3 -3
  7. package/es/businessModel/SalesModel/index.d.ts +1 -0
  8. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  9. package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -0
  10. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  11. package/es/components/appointmentBooking/components/Content/index.js +7 -1
  12. package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
  13. package/es/components/appointmentBooking/components/Header/index.js +2 -2
  14. package/es/components/appointmentBooking/components/Resource/index.js +30 -12
  15. package/es/components/appointmentBooking/components/Services/index.js +5 -2
  16. package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -4
  17. package/es/components/appointmentBooking/components/Voucher/index.js +1 -0
  18. package/es/components/appointmentBooking/context.js +7 -3
  19. package/es/components/appointmentBooking/hooks.js +129 -68
  20. package/es/components/appointmentBooking/index.d.ts +1 -0
  21. package/es/components/appointmentBooking/utils.js +6 -1
  22. package/es/components/booking/addons/index.js +31 -26
  23. package/es/components/booking/components/footer/amount.js +2 -2
  24. package/es/components/booking/components/footer/index.d.ts +1 -0
  25. package/es/components/booking/components/footer/utils.d.ts +9 -0
  26. package/es/components/booking/components/footer/utils.js +32 -10
  27. package/es/components/booking/info/service/Lists.d.ts +1 -0
  28. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  29. package/es/components/booking/info/service/addService/index.js +2 -2
  30. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  31. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  32. package/es/components/booking/info/service2/utils.d.ts +4 -1
  33. package/es/components/booking/info/service2/utils.js +21 -2
  34. package/es/components/booking/info/utils.js +1 -1
  35. package/es/components/booking/info2/service/addService/index.js +9 -6
  36. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  37. package/es/components/booking/info2/service/editService/index.js +56 -18
  38. package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
  39. package/es/components/booking/utils.d.ts +3 -2
  40. package/es/components/booking/utils.js +5 -0
  41. package/es/components/eftposPay/amount.d.ts +1 -1
  42. package/es/components/eftposPay/device.d.ts +1 -1
  43. package/es/components/eftposPay/hooks.d.ts +1 -1
  44. package/es/components/eftposPay/store/index.d.ts +2 -2
  45. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  46. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  47. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  48. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  49. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  50. package/es/components/eventBooking/index.d.ts +1 -0
  51. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  52. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  53. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  54. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  55. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  56. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  57. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  58. package/es/components/productExtension/index.d.ts +1 -0
  59. package/es/components/ruleSetting/index.d.ts +1 -0
  60. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  61. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  62. package/es/components/shoppingCart/index.d.ts +1 -0
  63. package/es/components/ticketBooking/components/addServiceVariant/addService.js +75 -26
  64. package/es/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
  65. package/es/components/ticketBooking/components/notAvailable/index.js +39 -0
  66. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  67. package/es/components/ticketBooking/index.d.ts +1 -0
  68. package/es/components/ticketBooking/index.js +1 -1
  69. package/es/components/ticketBooking/locales.d.ts +6 -0
  70. package/es/components/ticketBooking/locales.js +9 -3
  71. package/es/components/ticketBooking/serve.js +98 -92
  72. package/es/components/ticketBooking/utils/index.d.ts +1 -0
  73. package/es/components/ticketBooking/utils/index.js +33 -0
  74. package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
  75. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  76. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  77. package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -0
  78. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  79. package/lib/components/appointmentBooking/components/Content/index.js +3 -1
  80. package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
  81. package/lib/components/appointmentBooking/components/Header/index.js +1 -1
  82. package/lib/components/appointmentBooking/components/Resource/index.js +15 -9
  83. package/lib/components/appointmentBooking/components/Services/index.js +3 -2
  84. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +4 -3
  85. package/lib/components/appointmentBooking/components/Voucher/index.js +1 -0
  86. package/lib/components/appointmentBooking/context.js +7 -3
  87. package/lib/components/appointmentBooking/hooks.js +73 -12
  88. package/lib/components/appointmentBooking/index.d.ts +1 -0
  89. package/lib/components/appointmentBooking/utils.js +2 -0
  90. package/lib/components/booking/addons/index.js +27 -21
  91. package/lib/components/booking/components/footer/amount.js +1 -1
  92. package/lib/components/booking/components/footer/index.d.ts +1 -0
  93. package/lib/components/booking/components/footer/utils.d.ts +9 -0
  94. package/lib/components/booking/components/footer/utils.js +24 -7
  95. package/lib/components/booking/info/service/Lists.d.ts +1 -0
  96. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  97. package/lib/components/booking/info/service/addService/index.js +1 -1
  98. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  99. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  100. package/lib/components/booking/info/service2/utils.d.ts +4 -1
  101. package/lib/components/booking/info/service2/utils.js +21 -2
  102. package/lib/components/booking/info/utils.js +1 -1
  103. package/lib/components/booking/info2/service/addService/index.js +8 -5
  104. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  105. package/lib/components/booking/info2/service/editService/index.js +59 -23
  106. package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
  107. package/lib/components/booking/utils.d.ts +3 -2
  108. package/lib/components/booking/utils.js +6 -0
  109. package/lib/components/eftposPay/amount.d.ts +1 -1
  110. package/lib/components/eftposPay/device.d.ts +1 -1
  111. package/lib/components/eftposPay/hooks.d.ts +1 -1
  112. package/lib/components/eftposPay/store/index.d.ts +2 -2
  113. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  114. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  115. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  116. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  117. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  118. package/lib/components/eventBooking/index.d.ts +1 -0
  119. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  120. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  121. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  122. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  123. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  124. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  125. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  126. package/lib/components/productExtension/index.d.ts +1 -0
  127. package/lib/components/ruleSetting/index.d.ts +1 -0
  128. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  129. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  130. package/lib/components/shoppingCart/index.d.ts +1 -0
  131. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +74 -20
  132. package/lib/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
  133. package/lib/components/ticketBooking/components/notAvailable/index.js +61 -0
  134. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  135. package/lib/components/ticketBooking/index.d.ts +1 -0
  136. package/lib/components/ticketBooking/index.js +1 -1
  137. package/lib/components/ticketBooking/locales.d.ts +6 -0
  138. package/lib/components/ticketBooking/locales.js +9 -3
  139. package/lib/components/ticketBooking/serve.js +6 -2
  140. package/lib/components/ticketBooking/utils/index.d.ts +1 -0
  141. package/lib/components/ticketBooking/utils/index.js +33 -0
  142. package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
  143. package/package.json +4 -4
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const SalesModel: ({ children, hooks, config }: any) => JSX.Element;
2
3
  export * from './Sales';
3
4
  export default SalesModel;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const CartItem: ({ onNext }: any) => JSX.Element;
3
4
  export default CartItem;
@@ -197,6 +197,9 @@ var CartItem = function CartItem(_ref) {
197
197
  };
198
198
  var products = useMemo(function () {
199
199
  if (!(carts !== null && carts !== void 0 && carts.length)) return [];
200
+ carts.forEach(function (item) {
201
+ item.isShowChangeHolder = !appointmentBooking.isTargetCartIdNormalProduct(item === null || item === void 0 ? void 0 : item._id);
202
+ });
200
203
  if ((currentSelectedResources === null || currentSelectedResources === void 0 ? void 0 : currentSelectedResources.length) > 0) {
201
204
  var newCarts = carts.map(function (item) {
202
205
  var currentResourceData = currentSelectedResources.find(function (resource) {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Layout: () => JSX.Element;
3
4
  export default Layout;
@@ -83,8 +83,14 @@ var Layout = function Layout() {
83
83
  }, [currentStepParams]);
84
84
  useEffect(function () {
85
85
  try {
86
+ var _appointmentBooking$o;
86
87
  if (!(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.otherParams) || isRetailTemplate) return;
87
- if (isFormSubject) {
88
+
89
+ // 显示预约添加人
90
+ var showAddGuest = appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 || (_appointmentBooking$o = _appointmentBooking$o.productModuleParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.showAddGuest;
91
+
92
+ // 如果是表单主体或者是预约添加人不显示,则删除添加人步骤
93
+ if (isFormSubject || !showAddGuest) {
88
94
  removeStep('select-guest');
89
95
  } else {
90
96
  appointmentBooking.addStep({
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Header: () => JSX.Element;
3
4
  export default Header;
@@ -145,8 +145,8 @@ var Header = function Header() {
145
145
  });
146
146
  }
147
147
 
148
- // 如果当前步骤是选择资源,则清空表单步骤,不然表单步骤会累加
149
- if ((currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key) === 'select-resource') {
148
+ // 如果前一步是选择资源,则清空表单步骤,不然表单步骤会累加
149
+ if ((prevStepData === null || prevStepData === void 0 ? void 0 : prevStepData.key) === 'select-resource') {
150
150
  stepList.forEach(function (item) {
151
151
  if (item.key.startsWith('fill-form_')) {
152
152
  removeStep(item.key);
@@ -125,8 +125,11 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
125
125
  return currentAppointmentBoard(currentStepParams.key, resources, appointmentBooking);
126
126
  }, [currentStepParams.key, resources]);
127
127
  var renderLists = useMemo(function () {
128
- // 如果购物车有多个,则不显示左侧内容
129
- if (carts.length > 1 || !(carts !== null && carts !== void 0 && carts.length)) {
128
+ // 如果购物车有多个预约类商品,则不显示左侧内容
129
+ var appointmentCarts = carts.filter(function (n) {
130
+ return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
131
+ });
132
+ if (appointmentCarts.length > 1 || !(appointmentCarts !== null && appointmentCarts !== void 0 && appointmentCarts.length)) {
130
133
  return [];
131
134
  }
132
135
  return currentRenderLists(resources, appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_code);
@@ -142,7 +145,7 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
142
145
  useEffect(function () {
143
146
  var autoSelectResources = /*#__PURE__*/function () {
144
147
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
145
- var res, cartItem;
148
+ var res, carts, cartItem;
146
149
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
147
150
  while (1) switch (_context3.prev = _context3.next) {
148
151
  case 0:
@@ -160,11 +163,17 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
160
163
 
161
164
  // 自动分派之后获取重新获取资源列表数据;
162
165
  getResourceList();
163
- cartItem = carts === null || carts === void 0 ? void 0 : carts[0];
164
- appointmentBooking.updateCart(_objectSpread({
165
- _id: cartItem === null || cartItem === void 0 ? void 0 : cartItem._id
166
- }, cartItem));
166
+ _context3.next = 9;
167
+ return appointmentBooking.getCart();
167
168
  case 9:
169
+ carts = _context3.sent;
170
+ cartItem = carts === null || carts === void 0 ? void 0 : carts[0];
171
+ if (cartItem !== null && cartItem !== void 0 && cartItem._id) {
172
+ appointmentBooking.updateCart(_objectSpread({
173
+ _id: cartItem === null || cartItem === void 0 ? void 0 : cartItem._id
174
+ }, cartItem));
175
+ }
176
+ case 12:
168
177
  case "end":
169
178
  return _context3.stop();
170
179
  }
@@ -184,16 +193,25 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
184
193
  var _onClick = function onClick(e) {
185
194
  setSelectedResource(e.id);
186
195
  if (e.id) {
187
- var _carts$;
196
+ var _carts$index;
197
+ // 能够被点击的情况
198
+ // 1. 购物车里只有一个预约类商品
199
+ // 2. 购物车里有多个商品,但只有一个预约类商品
200
+ var index = carts.findIndex(function (n) {
201
+ return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
202
+ });
188
203
  return appointmentBooking.updateCart({
189
- _id: carts === null || carts === void 0 || (_carts$ = carts[0]) === null || _carts$ === void 0 ? void 0 : _carts$._id,
190
- resources: updateCartResources(carts === null || carts === void 0 ? void 0 : carts[0], e)
204
+ _id: carts === null || carts === void 0 || (_carts$index = carts[index]) === null || _carts$index === void 0 ? void 0 : _carts$index._id,
205
+ resources: updateCartResources(carts === null || carts === void 0 ? void 0 : carts[index], e)
191
206
  });
192
207
  }
193
208
  };
194
209
  useEffect(function () {
195
- var _carts$2;
196
- var selectedResource = carts === null || carts === void 0 || (_carts$2 = carts[0]) === null || _carts$2 === void 0 || (_carts$2 = _carts$2._origin) === null || _carts$2 === void 0 || (_carts$2 = _carts$2.resources) === null || _carts$2 === void 0 ? void 0 : _carts$2.find(function (item) {
210
+ var _carts$index2;
211
+ var index = carts.findIndex(function (n) {
212
+ return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
213
+ });
214
+ var selectedResource = carts === null || carts === void 0 || (_carts$index2 = carts[index]) === null || _carts$index2 === void 0 || (_carts$index2 = _carts$index2._origin) === null || _carts$index2 === void 0 || (_carts$index2 = _carts$index2.resources) === null || _carts$index2 === void 0 ? void 0 : _carts$index2.find(function (item) {
197
215
  return (item === null || item === void 0 ? void 0 : item.form_id) === (appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_id);
198
216
  });
199
217
  setSelectedResource((selectedResource === null || selectedResource === void 0 ? void 0 : selectedResource.id) || 0);
@@ -94,7 +94,10 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
94
94
  data: {
95
95
  detail: _objectSpread(_objectSpread({}, item), {}, {
96
96
  open_deposit: 1
97
- })
97
+ }),
98
+ setting: {
99
+ can_input: true
100
+ }
98
101
  },
99
102
  callback: function () {
100
103
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
@@ -159,7 +162,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
159
162
  activeStatus = resources.find(function (item) {
160
163
  return item.status === 1;
161
164
  });
162
- if (activeStatus) {
165
+ if (!(!activeStatus && !appointmentBooking.isTargetNormalProduct(data === null || data === void 0 ? void 0 : data.origin))) {
163
166
  _context.next = 24;
164
167
  break;
165
168
  }
@@ -68,11 +68,14 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
68
68
  };
69
69
  }();
70
70
  useEffect(function () {
71
- if ((times === null || times === void 0 ? void 0 : times.length) > 0 && (carts === null || carts === void 0 ? void 0 : carts.length) > 0) {
72
- var _carts$, _times$, _carts$2;
73
- var startTime = (carts === null || carts === void 0 || (_carts$ = carts[0]) === null || _carts$ === void 0 ? void 0 : _carts$.start_time) || (times === null || times === void 0 || (_times$ = times[0]) === null || _times$ === void 0 ? void 0 : _times$.start_time);
71
+ var appoimentBookingProductCart = carts.filter(function (item) {
72
+ return !appointmentBooking.isTargetCartIdNormalProduct(item === null || item === void 0 ? void 0 : item._id);
73
+ });
74
+ if ((times === null || times === void 0 ? void 0 : times.length) > 0 && (appoimentBookingProductCart === null || appoimentBookingProductCart === void 0 ? void 0 : appoimentBookingProductCart.length) > 0) {
75
+ var _appoimentBookingProd, _times$, _appoimentBookingProd2;
76
+ var startTime = (appoimentBookingProductCart === null || appoimentBookingProductCart === void 0 || (_appoimentBookingProd = appoimentBookingProductCart[0]) === null || _appoimentBookingProd === void 0 ? void 0 : _appoimentBookingProd.start_time) || (times === null || times === void 0 || (_times$ = times[0]) === null || _times$ === void 0 ? void 0 : _times$.start_time);
74
77
  setSelectedResource(startTime);
75
- if (carts !== null && carts !== void 0 && (_carts$2 = carts[0]) !== null && _carts$2 !== void 0 && _carts$2.start_time) return;
78
+ if (appoimentBookingProductCart !== null && appoimentBookingProductCart !== void 0 && (_appoimentBookingProd2 = appoimentBookingProductCart[0]) !== null && _appoimentBookingProd2 !== void 0 && _appoimentBookingProd2.start_time) return;
76
79
 
77
80
  // 如果没有选择时间,则默认选中第一个时间
78
81
  getAutoSelect(times === null || times === void 0 ? void 0 : times[0]);
@@ -97,6 +97,7 @@ var VoucherCard = function VoucherCard(props) {
97
97
  var _item$_origin;
98
98
  return {
99
99
  _id: item._id,
100
+ quantity: item.num,
100
101
  bundle: item._bundleOrigin,
101
102
  options: item._optionsOrigin,
102
103
  product: _objectSpread({}, item._productOrigin),
@@ -166,11 +166,15 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
166
166
  if (!(carts !== null && carts !== void 0 && carts.length) || !(resources !== null && resources !== void 0 && resources.length)) {
167
167
  return setCurrentSelectedResources(null);
168
168
  }
169
- var _currentSelectedResources = carts.map(function (item) {
170
- return {
169
+ var _currentSelectedResources = [];
170
+ carts.forEach(function (item) {
171
+ if (appointmentBooking.isTargetCartIdNormalProduct(item === null || item === void 0 ? void 0 : item._id)) {
172
+ return;
173
+ }
174
+ _currentSelectedResources.push({
171
175
  _id: item === null || item === void 0 ? void 0 : item._id,
172
176
  currentSelectedResource: getCartCurrentResourceData(item, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources)
173
- };
177
+ });
174
178
  });
175
179
  setCurrentSelectedResources(_currentSelectedResources);
176
180