@pisell/private-materials 6.4.50 → 6.4.51

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 (147) 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 +2 -2
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +3 -3
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +3 -3
  11. package/es/components/appointmentBooking/components/Services/index.js +36 -18
  12. package/es/components/appointmentBooking/hooks.js +6 -0
  13. package/es/components/booking/addons/model.d.ts +1 -10
  14. package/es/components/booking/components/footer/index.js +12 -1
  15. package/es/components/booking/editBookingModal/index.js +8 -2
  16. package/es/components/booking/forms/model.d.ts +1 -10
  17. package/es/components/booking/info/model.d.ts +1 -10
  18. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  19. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  20. package/es/components/booking/locales.d.ts +6 -0
  21. package/es/components/booking/locales.js +12 -0
  22. package/es/components/booking/model.d.ts +1 -9
  23. package/es/components/booking/notes/model.d.ts +1 -10
  24. package/es/components/booking/payments/model.d.ts +1 -10
  25. package/es/components/checkout/PaymentModal.js +70 -62
  26. package/es/components/checkout/components/AmountSummary/index.js +4 -4
  27. package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  28. package/es/components/checkout/components/CashPaymentModule/index.js +14 -10
  29. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  30. package/es/components/eftposPay/hooks.d.ts +1 -1
  31. package/es/components/eftposPay/linkly/hooks/normal.js +3 -3
  32. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +25 -4
  33. package/es/components/eftposPay/serve.js +1 -1
  34. package/es/components/eftposPay/store/index.d.ts +2 -2
  35. package/es/components/index.d.ts +3 -1
  36. package/es/components/index.js +3 -1
  37. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
  38. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  39. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  40. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  41. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  42. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  43. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  44. package/es/components/pay/toC/model.d.ts +1 -9
  45. package/es/components/pay/toC/utils.js +1 -1
  46. package/es/components/pinModal/hooks.d.ts +7 -0
  47. package/es/components/pinModal/hooks.js +65 -0
  48. package/es/components/pinModal/index.d.ts +4 -0
  49. package/es/components/pinModal/index.js +98 -0
  50. package/es/components/pinModal/index.less +44 -0
  51. package/es/components/pinModal/locales.d.ts +27 -0
  52. package/es/components/pinModal/locales.js +26 -0
  53. package/es/components/pinModal/serve.d.ts +6 -0
  54. package/es/components/pinModal/serve.js +11 -0
  55. package/es/components/pinModal/types.d.ts +0 -0
  56. package/es/components/pinModal/types.js +0 -0
  57. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  58. package/es/components/pinVerifyModal/hooks.js +80 -0
  59. package/es/components/pinVerifyModal/index.d.ts +5 -0
  60. package/es/components/pinVerifyModal/index.js +218 -0
  61. package/es/components/pinVerifyModal/index.less +92 -0
  62. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  63. package/es/components/pinVerifyModal/locales.js +23 -0
  64. package/es/components/pinVerifyModal/types.d.ts +33 -0
  65. package/es/components/pinVerifyModal/types.js +1 -0
  66. package/es/components/schedules/model.d.ts +1 -9
  67. package/es/components/ticketBooking/components/ticketBooking/index.js +56 -10
  68. package/es/components/ticketBooking/components/timeBar/index.js +2 -1
  69. package/es/components/wallet/Detail/model.d.ts +1 -13
  70. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  71. package/es/components/wallet/PointCard/model.d.ts +1 -13
  72. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  73. package/es/components/wallet/Voucher/model.d.ts +1 -13
  74. package/es/components/wallet/model.d.ts +1 -9
  75. package/es/components/walletList/index.js +20 -2
  76. package/es/index.d.ts +2 -0
  77. package/es/index.js +3 -1
  78. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  79. package/lib/components/appointmentBooking/hooks.js +6 -0
  80. package/lib/components/booking/addons/model.d.ts +1 -10
  81. package/lib/components/booking/components/footer/index.js +15 -2
  82. package/lib/components/booking/editBookingModal/index.js +6 -1
  83. package/lib/components/booking/forms/model.d.ts +1 -10
  84. package/lib/components/booking/info/model.d.ts +1 -10
  85. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  86. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  87. package/lib/components/booking/locales.d.ts +6 -0
  88. package/lib/components/booking/locales.js +6 -0
  89. package/lib/components/booking/model.d.ts +1 -9
  90. package/lib/components/booking/notes/model.d.ts +1 -10
  91. package/lib/components/booking/payments/model.d.ts +1 -10
  92. package/lib/components/checkout/PaymentModal.js +5 -4
  93. package/lib/components/checkout/components/AmountSummary/index.js +4 -4
  94. package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  95. package/lib/components/checkout/components/CashPaymentModule/index.js +6 -3
  96. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  97. package/lib/components/eftposPay/hooks.d.ts +1 -1
  98. package/lib/components/eftposPay/linkly/hooks/normal.js +3 -3
  99. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +16 -4
  100. package/lib/components/eftposPay/serve.js +1 -1
  101. package/lib/components/eftposPay/store/index.d.ts +2 -2
  102. package/lib/components/index.d.ts +3 -1
  103. package/lib/components/index.js +6 -0
  104. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
  105. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  106. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  107. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  108. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  109. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  110. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  111. package/lib/components/pay/toC/model.d.ts +1 -9
  112. package/lib/components/pay/toC/utils.js +1 -1
  113. package/lib/components/pinModal/hooks.d.ts +7 -0
  114. package/lib/components/pinModal/hooks.js +85 -0
  115. package/lib/components/pinModal/index.d.ts +4 -0
  116. package/lib/components/pinModal/index.js +88 -0
  117. package/lib/components/pinModal/index.less +44 -0
  118. package/lib/components/pinModal/locales.d.ts +27 -0
  119. package/lib/components/pinModal/locales.js +50 -0
  120. package/lib/components/pinModal/serve.d.ts +6 -0
  121. package/lib/components/pinModal/serve.js +37 -0
  122. package/lib/components/pinModal/types.d.ts +0 -0
  123. package/lib/components/pinModal/types.js +0 -0
  124. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  125. package/lib/components/pinVerifyModal/hooks.js +93 -0
  126. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  127. package/lib/components/pinVerifyModal/index.js +230 -0
  128. package/lib/components/pinVerifyModal/index.less +92 -0
  129. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  130. package/lib/components/pinVerifyModal/locales.js +47 -0
  131. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  132. package/lib/components/pinVerifyModal/types.js +17 -0
  133. package/lib/components/schedules/model.d.ts +1 -9
  134. package/lib/components/ticketBooking/components/ticketBooking/index.js +52 -5
  135. package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
  136. package/lib/components/wallet/Detail/model.d.ts +1 -13
  137. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  138. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  139. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  140. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  141. package/lib/components/wallet/model.d.ts +1 -9
  142. package/lib/components/walletList/index.js +19 -2
  143. package/lib/index.d.ts +2 -0
  144. package/lib/index.js +6 -0
  145. package/lowcode/pin-modal/meta.ts +37 -0
  146. package/lowcode/pin-verify-modal/meta.ts +80 -0
  147. package/package.json +12 -12
@@ -99,7 +99,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
99
99
  },
100
100
  callback: function () {
101
101
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
102
- var product, session, startDate, endDate, _data$origin, resources, activeStatus, index, stepList, hasResourceStep, description;
102
+ var product, res, session, startDate, endDate, _res, _data$origin, resources, activeStatus, _res2, index, stepList, hasResourceStep, description;
103
103
  return _regeneratorRuntime().wrap(function _callee$(_context) {
104
104
  while (1) switch (_context.prev = _context.next) {
105
105
  case 0:
@@ -117,7 +117,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
117
117
 
118
118
  // 零售模版,直接加入购物车
119
119
  if (!isRetailTemplate) {
120
- _context.next = 10;
120
+ _context.next = 12;
121
121
  break;
122
122
  }
123
123
  if (!(data !== null && data !== void 0 && data.isCancel)) {
@@ -126,51 +126,69 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
126
126
  }
127
127
  return _context.abrupt("return");
128
128
  case 8:
129
- appointmentBooking.storeProduct(product);
129
+ res = appointmentBooking.storeProduct(product);
130
+ if (!(!res.success && res.errorCode === 'not_enough_stock')) {
131
+ _context.next = 11;
132
+ break;
133
+ }
134
+ return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.unuse.stock')));
135
+ case 11:
130
136
  return _context.abrupt("return");
131
- case 10:
137
+ case 12:
132
138
  session = data === null || data === void 0 ? void 0 : data.session;
133
139
  if (!session) {
134
- _context.next = 19;
140
+ _context.next = 24;
135
141
  break;
136
142
  }
137
143
  startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
138
144
  endDate = dayjs(session === null || session === void 0 ? void 0 : session.end_at).format('YYYY-MM-DD');
139
- appointmentBooking.addProductToCart({
145
+ _res = appointmentBooking.addProductToCart({
140
146
  product: _objectSpread({}, product),
141
147
  date: {
142
148
  startTime: "".concat(startDate, " ").concat(session === null || session === void 0 ? void 0 : session.start_time),
143
149
  endTime: "".concat(endDate, " ").concat(session === null || session === void 0 ? void 0 : session.end_time)
144
150
  }
145
151
  });
146
- _context.next = 17;
152
+ if (!(!_res.success && _res.errorCode === 'not_enough_stock')) {
153
+ _context.next = 19;
154
+ break;
155
+ }
156
+ return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.unuse.stock')));
157
+ case 19:
158
+ appointmentBooking.closeProductDetail();
159
+ _context.next = 22;
147
160
  return appointmentBooking.getAvailableDate({
148
161
  startDate: startDate,
149
162
  endDate: endDate
150
163
  });
151
- case 17:
152
- _context.next = 27;
164
+ case 22:
165
+ _context.next = 34;
153
166
  break;
154
- case 19:
167
+ case 24:
155
168
  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) || [];
156
169
  activeStatus = resources.find(function (item) {
157
170
  return item.status === 1;
158
171
  });
159
172
  if (!(!activeStatus && !appointmentBooking.isTargetNormalProduct(data === null || data === void 0 ? void 0 : data.origin))) {
160
- _context.next = 23;
173
+ _context.next = 28;
161
174
  break;
162
175
  }
163
176
  return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
164
- case 23:
165
- appointmentBooking.storeProduct(product);
166
- // duration 类型的商品,要获取一下资源,在先选日期的 duration 步骤里目前只能通过这个动作拉取
177
+ case 28:
178
+ _res2 = appointmentBooking.storeProduct(product);
179
+ if (!(!_res2.success && _res2.errorCode === 'not_enough_stock')) {
180
+ _context.next = 31;
181
+ break;
182
+ }
183
+ return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.unuse.stock')));
184
+ case 31:
167
185
  if (!(type === 'duration')) {
168
- _context.next = 27;
186
+ _context.next = 34;
169
187
  break;
170
188
  }
171
- _context.next = 27;
189
+ _context.next = 34;
172
190
  return appointmentBooking.getAvailableDate();
173
- case 27:
191
+ case 34:
174
192
  appointmentBooking.closeProductDetail();
175
193
 
176
194
  // 先选择日期流程
@@ -199,7 +217,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
199
217
  removeStep('select-time');
200
218
  }
201
219
  }
202
- case 29:
220
+ case 36:
203
221
  case "end":
204
222
  return _context.stop();
205
223
  }
@@ -206,6 +206,12 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
206
206
  if (!result) {
207
207
  return Toast(locales.getText('pisell2.appointment.unuse.date'));
208
208
  }
209
+ var capacityResult = appointmentBooking.checkMaxDurationCapacity();
210
+ if (!capacityResult.success) {
211
+ var getMessage = locales.getText('pisell2.appointment.unuse.capacity');
212
+ var message = typeof getMessage === 'function' ? getMessage(capacityResult.minAvailableCount) : getMessage;
213
+ return Toast(message);
214
+ }
209
215
  }
210
216
  if (!isRetailTemplate && currentKey !== null && currentKey !== void 0 && currentKey.startsWith('select-resource')) {
211
217
  var _currentSelectedResou;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -845,7 +845,7 @@ var Footer = function Footer(props) {
845
845
  */
846
846
  var handleSave = /*#__PURE__*/function () {
847
847
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref6) {
848
- var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, isHasDayProducts, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, checkout, subtotal_info, res, isNeedDeposit, api;
848
+ var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, isHasDayProducts, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, _store$getState, _window7, callbackData, values, checkout, subtotal_info, res, isNeedDeposit, api;
849
849
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
850
850
  while (1) switch (_context6.prev = _context6.next) {
851
851
  case 0:
@@ -953,6 +953,17 @@ var Footer = function Footer(props) {
953
953
  }, {
954
954
  key: '日期',
955
955
  value: dayjs().format('YYYY-MM-DD HH:mm')
956
+ }, {
957
+ key: '店铺id',
958
+ value: store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.globalConfig) === null || _store$getState === void 0 ? void 0 : _store$getState.id
959
+ }, {
960
+ key: 'shopApi',
961
+ value: JSON.stringify((_window7 = window) === null || _window7 === void 0 ? void 0 : _window7.shopApi, function (key, value) {
962
+ if (typeof value === 'function') {
963
+ return 'function';
964
+ }
965
+ return value;
966
+ })
956
967
  }]
957
968
  });
958
969
 
@@ -71,7 +71,7 @@ var EditBookingModal = function EditBookingModal(props, ref) {
71
71
  var getInitData = /*#__PURE__*/function () {
72
72
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
73
73
  var _data$fromResource, _data$toResource;
74
- var mockProps, _data, _initResourceVal, fromResourceFormId, toResourceFormId, _form_id, _data$toResource2, _formatResources, list, maps, currentForm, relation_id, _currentForm$renderLi, _currentForm$renderLi2, _currentForm$renderLi3, _currentForm$renderLi4, _targetResource, _cloned, _idx, _sameResource;
74
+ var mockProps, _data, _initResourceVal, fromResourceFormId, toResourceFormId, _form_id, _data$toResource2, _formatResources, list, maps, currentForm, relation_id, _currentForm$renderLi, _currentForm$renderLi2, _currentForm$renderLi3, _currentForm$renderLi4, _targetResource, _cloned, _idx, _sameResource, _targetIdx;
75
75
  return _regeneratorRuntime().wrap(function _callee$(_context) {
76
76
  while (1) switch (_context.prev = _context.next) {
77
77
  case 0:
@@ -129,7 +129,13 @@ var EditBookingModal = function EditBookingModal(props, ref) {
129
129
  _cloned[_idx] = _targetResource; // 替换现有对象
130
130
  }
131
131
  } else {
132
- _cloned.push(_targetResource); // 添加新对象
132
+ // 未发现原资源位置(短时间内通过其它渠道修改过资源)
133
+ _targetIdx = _cloned.findIndex(function (rs) {
134
+ return rs.relation_id == (_targetResource === null || _targetResource === void 0 ? void 0 : _targetResource.relation_id);
135
+ }); // 判断是否已经包含了目标资源,不包含则加入进来
136
+ if (_targetIdx === -1) {
137
+ _cloned.push(_targetResource); // 添加新对象
138
+ }
133
139
  }
134
140
  _initResourceVal = _objectSpread(_objectSpread({}, _initResourceVal), {}, _defineProperty({}, _form_id, _cloned));
135
141
  } else {
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,14 +1,5 @@
1
- /// <reference types="react" />
2
- import { FormState } from '../model';
3
1
  export declare const walkInData: {
4
2
  id: number;
5
3
  nickname: string;
6
4
  };
7
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
- state: FormState;
9
- } & {
10
- dispatch: (params: {
11
- type: string;
12
- payload: any;
13
- }) => void;
14
- }>;
5
+ export declare const Provider: any, Context: any;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: string;
9
+ locale: any;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: string;
10
+ locale: any;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -156,6 +156,8 @@ declare const _default: {
156
156
  'pisell2.text.deposit-delete-message': string;
157
157
  'pisell2.text.deposit-paid': string;
158
158
  "pisell2.text.stock": string;
159
+ 'pisell2.appointment.unuse.stock': string;
160
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
159
161
  'pisell2.text.payment-link': string;
160
162
  'pisell2.text.send-mail': string;
161
163
  'pisell2.text.copy-to-clipboard': string;
@@ -458,6 +460,8 @@ declare const _default: {
458
460
  'pisell2.text.deposit-delete-message': string;
459
461
  'pisell2.text.deposit-paid': string;
460
462
  "pisell2.text.stock": string;
463
+ 'pisell2.appointment.unuse.stock': string;
464
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
461
465
  'pisell2.text.payment-link': string;
462
466
  'pisell2.text.send-mail': string;
463
467
  'pisell2.text.copy-to-clipboard': string;
@@ -760,6 +764,8 @@ declare const _default: {
760
764
  'pisell2.text.deposit-delete-message': string;
761
765
  'pisell2.text.deposit-paid': string;
762
766
  "pisell2.text.stock": string;
767
+ 'pisell2.appointment.unuse.stock': string;
768
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
763
769
  'pisell2.text.payment-link': string;
764
770
  'pisell2.text.send-mail': string;
765
771
  'pisell2.text.copy-to-clipboard': string;
@@ -174,6 +174,10 @@ export default {
174
174
  'pisell2.text.deposit-delete-message': "It cannot be restored after deletion. Please confirm the operation.",
175
175
  'pisell2.text.deposit-paid': "Deposit paid",
176
176
  "pisell2.text.stock": "Stock",
177
+ 'pisell2.appointment.unuse.stock': "Not enough stock",
178
+ 'pisell2.appointment.unuse.capacity': function pisell2AppointmentUnuseCapacity(count) {
179
+ return "Only ".concat(count, " spots available. Please reduce quantity.");
180
+ },
177
181
  'pisell2.text.payment-link': "Payment link",
178
182
  'pisell2.text.send-mail': "Send email",
179
183
  'pisell2.text.copy-to-clipboard': "Copy to clipboard",
@@ -531,6 +535,10 @@ export default {
531
535
  'pisell2.text.deposit-delete-message': "删除后不可恢复,请确认操作",
532
536
  'pisell2.text.deposit-paid': "已付定金",
533
537
  "pisell2.text.stock": "库存",
538
+ 'pisell2.appointment.unuse.stock': "库存不足",
539
+ 'pisell2.appointment.unuse.capacity': function pisell2AppointmentUnuseCapacity(count) {
540
+ return "\u4EC5\u53EF\u9884\u7EA6 ".concat(count, " \u4E2A\uFF0C\u8BF7\u51CF\u5C11\u6570\u91CF");
541
+ },
534
542
  'pisell2.text.payment-link': "付款链接",
535
543
  'pisell2.text.send-mail': "发送邮件",
536
544
  'pisell2.text.copy-to-clipboard': "复制到剪切板",
@@ -888,6 +896,10 @@ export default {
888
896
  'pisell2.text.deposit-delete-message': "刪除後不可恢復,請確認操作",
889
897
  'pisell2.text.deposit-paid': "已付定金",
890
898
  "pisell2.text.stock": "庫存",
899
+ 'pisell2.appointment.unuse.stock': "庫存不足",
900
+ 'pisell2.appointment.unuse.capacity': function pisell2AppointmentUnuseCapacity(count) {
901
+ return "\u50C5\u53EF\u9810\u7D04 ".concat(count, " \u500B\uFF0C\u8ACB\u6E1B\u5C11\u6578\u91CF");
902
+ },
891
903
  'pisell2.text.payment-link': "付款鏈接",
892
904
  'pisell2.text.send-mail': "發送郵件",
893
905
  'pisell2.text.copy-to-clipboard': "複製到剪切板",
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -106,11 +105,4 @@ export declare const walkInData: {
106
105
  id: number;
107
106
  nickname: string;
108
107
  };
109
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
110
- state: FormState;
111
- } & {
112
- dispatch: (params: {
113
- type: string;
114
- payload: any;
115
- }) => void;
116
- }>;
108
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -112,39 +112,44 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
112
112
  _useState4 = _slicedToArray(_useState3, 2),
113
113
  balanceDueAmount = _useState4[0],
114
114
  setBalanceDueAmount = _useState4[1];
115
- var _useState5 = useState([]),
115
+ // 剩余待付金额-跟定金无关的一个订单总体待付金额,上面这个 balanceDueAmount 是会收到订单影响的,下面这个不会
116
+ var _useState5 = useState(''),
116
117
  _useState6 = _slicedToArray(_useState5, 2),
117
- recommendAmounts = _useState6[0],
118
- setRecommendAmounts = _useState6[1];
119
- var paymentMethodsRef = useRef(null);
118
+ balanceDueTotalAmount = _useState6[0],
119
+ setBalanceDueTotalAmount = _useState6[1];
120
120
  var _useState7 = useState([]),
121
121
  _useState8 = _slicedToArray(_useState7, 2),
122
- paymentMethods = _useState8[0],
123
- setPaymentMethods = _useState8[1];
124
- var _useState9 = useState(false),
122
+ recommendAmounts = _useState8[0],
123
+ setRecommendAmounts = _useState8[1];
124
+ var paymentMethodsRef = useRef(null);
125
+ var _useState9 = useState([]),
125
126
  _useState10 = _slicedToArray(_useState9, 2),
126
- showCashPayment = _useState10[0],
127
- setShowCashPayment = _useState10[1];
128
- var _useState11 = useState(locales.getText('cards.and.digitals') || 'Cards & Digitals'),
127
+ paymentMethods = _useState10[0],
128
+ setPaymentMethods = _useState10[1];
129
+ var _useState11 = useState(false),
129
130
  _useState12 = _slicedToArray(_useState11, 2),
130
- paymentOptionsTitle = _useState12[0],
131
- setPaymentOptionsTitle = _useState12[1];
131
+ showCashPayment = _useState12[0],
132
+ setShowCashPayment = _useState12[1];
133
+ var _useState13 = useState(locales.getText('cards.and.digitals') || 'Cards & Digitals'),
134
+ _useState14 = _slicedToArray(_useState13, 2),
135
+ paymentOptionsTitle = _useState14[0],
136
+ setPaymentOptionsTitle = _useState14[1];
132
137
  var clientChangedRef = useRef(false);
133
138
  var walletPassRef = useRef(null);
134
139
  // 已保存的支付项数据
135
- var _useState13 = useState([]),
136
- _useState14 = _slicedToArray(_useState13, 2),
137
- paymentItems = _useState14[0],
138
- setPaymentItems = _useState14[1];
139
- // 钱包卡券数据
140
- var _useState15 = useState({}),
140
+ var _useState15 = useState([]),
141
141
  _useState16 = _slicedToArray(_useState15, 2),
142
- walletPassData = _useState16[0],
143
- setWalletPassData = _useState16[1];
144
- var _useState17 = useState(false),
142
+ paymentItems = _useState16[0],
143
+ setPaymentItems = _useState16[1];
144
+ // 钱包卡券数据
145
+ var _useState17 = useState({}),
145
146
  _useState18 = _slicedToArray(_useState17, 2),
146
- syncingLock = _useState18[0],
147
- setSyncingLock = _useState18[1];
147
+ walletPassData = _useState18[0],
148
+ setWalletPassData = _useState18[1];
149
+ var _useState19 = useState(false),
150
+ _useState20 = _slicedToArray(_useState19, 2),
151
+ syncingLock = _useState20[0],
152
+ setSyncingLock = _useState20[1];
148
153
  var isOrderFree = useMemo(function () {
149
154
  if (!customAmount) return false;
150
155
  var amount = parseFloat(customAmount);
@@ -152,14 +157,14 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
152
157
  }, [customAmount]);
153
158
 
154
159
  // 新增状态:订单备注和手动折扣
155
- var _useState19 = useState(false),
156
- _useState20 = _slicedToArray(_useState19, 2),
157
- paymentLinkModalOpen = _useState20[0],
158
- setPaymentLinkModalOpen = _useState20[1];
159
160
  var _useState21 = useState(false),
160
161
  _useState22 = _slicedToArray(_useState21, 2),
161
- showPriceAdjustModal = _useState22[0],
162
- setShowPriceAdjustModal = _useState22[1];
162
+ paymentLinkModalOpen = _useState22[0],
163
+ setPaymentLinkModalOpen = _useState22[1];
164
+ var _useState23 = useState(false),
165
+ _useState24 = _slicedToArray(_useState23, 2),
166
+ showPriceAdjustModal = _useState24[0],
167
+ setShowPriceAdjustModal = _useState24[1];
163
168
  var logger = usePaymentLogger();
164
169
  var currency = getData('shop_currency_code') || 'USD';
165
170
 
@@ -415,6 +420,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
415
420
  var _cartData$order_info;
416
421
  setCustomAmount(currentAmount);
417
422
  setBalanceDueAmount(currentAmount);
423
+ setBalanceDueTotalAmount(orderInfo.totalAmount || '0');
418
424
  // 设置订单备注默认值 - 优先从 checkoutModule 获取,如果没有则从购物车数据获取
419
425
  var currentNote = checkoutModule.getOrderNote();
420
426
  if (currentNote) {
@@ -517,6 +523,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
517
523
  }());
518
524
  var amountChangedUnsubscribe = core.effects.on(CheckoutHooks.OnBalanceDueAmountChanged, function (data) {
519
525
  setBalanceDueAmount(data.newAmount);
526
+ setBalanceDueTotalAmount(data.totalAmount || '0');
520
527
  });
521
528
  var orderSubmitStartUnsubscribe = core.effects.on(CheckoutHooks.OnOrderSubmitStart, function () {
522
529
  var _Toast$loading;
@@ -581,9 +588,9 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
581
588
  var itemAmount = new Decimal(item.amount || 0);
582
589
  var itemServiceCharge = chargeAmount.add(chargePercentage.mul(itemAmount));
583
590
  // 如果支付项的 rounding_amount 是正数,需要减掉rounding_amount
584
- if (Number(item.rounding_amount) > 0) {
585
- itemServiceCharge = itemServiceCharge.sub(new Decimal(item.rounding_amount));
586
- }
591
+ // if (Number(item.rounding_amount) > 0) {
592
+ // itemServiceCharge = itemServiceCharge.sub(new Decimal(item.rounding_amount));
593
+ // }
587
594
  console.log(itemServiceCharge);
588
595
  return acc.add(itemServiceCharge);
589
596
  }, new Decimal(0));
@@ -1290,7 +1297,8 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
1290
1297
  amountButtons: recommendAmounts,
1291
1298
  customAmount: customAmount,
1292
1299
  roundingFunction: roundingFunction,
1293
- balanceDueAmount: balanceDueAmount
1300
+ balanceDueAmount: balanceDueAmount,
1301
+ balanceDueTotalAmount: balanceDueTotalAmount
1294
1302
  })), moduleConfig.showPaymentOptions && /*#__PURE__*/React.createElement("div", {
1295
1303
  className: showCashPayment ? '' : 'payment-options-module-container',
1296
1304
  style: showCashPayment ? {
@@ -1372,30 +1380,30 @@ var PaymentModal = function PaymentModal(_ref18) {
1372
1380
  getData = _ref19.getData,
1373
1381
  interaction = _ref19.interaction,
1374
1382
  isWebPos = _ref19.isWebPos;
1375
- var _useState23 = useState(null),
1376
- _useState24 = _slicedToArray(_useState23, 2),
1377
- orderInfo = _useState24[0],
1378
- setOrderInfo = _useState24[1];
1379
- var _useState25 = useState(0),
1383
+ var _useState25 = useState(null),
1380
1384
  _useState26 = _slicedToArray(_useState25, 2),
1381
- totalAmount = _useState26[0],
1382
- setTotalAmount = _useState26[1];
1383
- var _useState27 = useState(true),
1385
+ orderInfo = _useState26[0],
1386
+ setOrderInfo = _useState26[1];
1387
+ var _useState27 = useState(0),
1384
1388
  _useState28 = _slicedToArray(_useState27, 2),
1385
- actualShowCashPayment = _useState28[0],
1386
- setActualShowCashPayment = _useState28[1];
1387
- var _useState29 = useState(0),
1389
+ totalAmount = _useState28[0],
1390
+ setTotalAmount = _useState28[1];
1391
+ var _useState29 = useState(true),
1388
1392
  _useState30 = _slicedToArray(_useState29, 2),
1389
- windowHeight = _useState30[0],
1390
- setWindowHeight = _useState30[1];
1391
- var _useState31 = useState(false),
1393
+ actualShowCashPayment = _useState30[0],
1394
+ setActualShowCashPayment = _useState30[1];
1395
+ var _useState31 = useState(0),
1392
1396
  _useState32 = _slicedToArray(_useState31, 2),
1393
- showRetryModal = _useState32[0],
1394
- setShowRetryModal = _useState32[1];
1395
- var _useState33 = useState(editOrderId || 0),
1397
+ windowHeight = _useState32[0],
1398
+ setWindowHeight = _useState32[1];
1399
+ var _useState33 = useState(false),
1396
1400
  _useState34 = _slicedToArray(_useState33, 2),
1397
- currentEditOrderId = _useState34[0],
1398
- _setCurrentEditOrderId = _useState34[1];
1401
+ showRetryModal = _useState34[0],
1402
+ setShowRetryModal = _useState34[1];
1403
+ var _useState35 = useState(editOrderId || 0),
1404
+ _useState36 = _slicedToArray(_useState35, 2),
1405
+ currentEditOrderId = _useState36[0],
1406
+ _setCurrentEditOrderId = _useState36[1];
1399
1407
  var Toast = useToast();
1400
1408
 
1401
1409
  // 重试处理函数(逻辑由用户自己实现)
@@ -1528,18 +1536,18 @@ var PaymentModal = function PaymentModal(_ref18) {
1528
1536
  }, []);
1529
1537
 
1530
1538
  // 订单备注相关状态
1531
- var _useState35 = useState(false),
1532
- _useState36 = _slicedToArray(_useState35, 2),
1533
- noteModalOpen = _useState36[0],
1534
- setNoteModalOpen = _useState36[1];
1535
- var _useState37 = useState(''),
1539
+ var _useState37 = useState(false),
1536
1540
  _useState38 = _slicedToArray(_useState37, 2),
1537
- orderNote = _useState38[0],
1538
- setOrderNote = _useState38[1];
1539
- var _useState39 = useState('payment-content'),
1541
+ noteModalOpen = _useState38[0],
1542
+ setNoteModalOpen = _useState38[1];
1543
+ var _useState39 = useState(''),
1540
1544
  _useState40 = _slicedToArray(_useState39, 2),
1541
- noteModalSource = _useState40[0],
1542
- setNoteModalSource = _useState40[1];
1545
+ orderNote = _useState40[0],
1546
+ setOrderNote = _useState40[1];
1547
+ var _useState41 = useState('payment-content'),
1548
+ _useState42 = _slicedToArray(_useState41, 2),
1549
+ noteModalSource = _useState42[0],
1550
+ setNoteModalSource = _useState42[1];
1543
1551
 
1544
1552
  // 订单备注相关处理函数
1545
1553
  var handleNoteConfirm = /*#__PURE__*/function () {
@@ -503,8 +503,8 @@ function AmountSummary(_ref2) {
503
503
  var syncedVoucherAmount = paymentItems === null || paymentItems === void 0 ? void 0 : paymentItems.reduce(function (acc, item) {
504
504
  // 如果当前是普通支付,则减去order_payment_type不为 deposit的支付项
505
505
  // 如果当前是定金支付,则减去order_payment_type为 deposit的支付项
506
- if (item.voucher_id && item.isSynced && (paymentType === 'regular' && item.order_payment_type !== 'deposit' || paymentType === 'deposit' && item.order_payment_type === 'deposit')) {
507
- return acc.plus(item.amount).plus(item.rounding_amount);
506
+ if (item.isSynced && (paymentType === 'regular' && item.order_payment_type !== 'deposit' || paymentType === 'deposit' && item.order_payment_type === 'deposit')) {
507
+ return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
508
508
  }
509
509
  return acc;
510
510
  }, new Decimal(0)).toNumber();
@@ -615,7 +615,7 @@ function AmountSummary(_ref2) {
615
615
  if (paymentType === 'regular') {
616
616
  var depositPaidAmount = paymentItems === null || paymentItems === void 0 ? void 0 : paymentItems.reduce(function (acc, item) {
617
617
  if (item.order_payment_type === 'deposit') {
618
- return acc.plus(item.amount).plus(Math.abs(item.rounding_amount));
618
+ return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
619
619
  }
620
620
  return acc;
621
621
  }, new Decimal(0)).toNumber();
@@ -627,7 +627,7 @@ function AmountSummary(_ref2) {
627
627
  // 如果是定金支付,且定金已付款金额大于等于订单总金额,则不可以再切换到普通支付
628
628
  var _depositPaidAmount = paymentItems === null || paymentItems === void 0 ? void 0 : paymentItems.reduce(function (acc, item) {
629
629
  if (item.order_payment_type === 'deposit') {
630
- return acc.plus(item.amount);
630
+ return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
631
631
  }
632
632
  return acc;
633
633
  }, new Decimal(0)).toNumber();
@@ -13,10 +13,12 @@ export interface CashPaymentModuleProps {
13
13
  roundingDifference: number;
14
14
  }>;
15
15
  balanceDueAmount?: string;
16
+ balanceDueTotalAmount?: string;
16
17
  syncingLock?: boolean;
17
18
  }
18
19
  export declare function CashPaymentModule({ amountSymbol, orderInfo, onPaymentComplete, customAmount, amountButtons, // 按钮列表,默认5个推荐金额
19
20
  disabled, // 禁用状态
20
- roundingFunction, balanceDueAmount, // 剩余支付金额
21
+ roundingFunction, balanceDueAmount, // 当前阶段剩余支付金额(定金或普通支付)
22
+ balanceDueTotalAmount, // 完整订单剩余待付金额
21
23
  syncingLock, }: CashPaymentModuleProps): JSX.Element;
22
24
  export default CashPaymentModule;