@pisell/private-materials 6.4.52 → 6.4.53

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 (27) 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 +158 -145
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +1 -1
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/booking/components/footer/amount.js +3 -1
  12. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  13. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  14. package/es/components/checkout/components/CashPaymentModule/index.js +9 -9
  15. package/es/components/checkout/components/PaymentOptionsModule/index.js +4 -1
  16. package/es/components/checkout/hooks/useWalletPass.js +4 -1
  17. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +20 -10
  18. package/es/pro/priceKeyboard/components/cashKeyboard/index.less +1 -2
  19. package/lib/components/booking/components/footer/amount.js +1 -1
  20. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  21. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  22. package/lib/components/checkout/components/CashPaymentModule/index.js +0 -1
  23. package/lib/components/checkout/components/PaymentOptionsModule/index.js +3 -1
  24. package/lib/components/checkout/hooks/useWalletPass.js +4 -1
  25. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +61 -27
  26. package/lib/pro/priceKeyboard/components/cashKeyboard/index.less +1 -2
  27. package/package.json +2 -2
@@ -450,7 +450,9 @@ var getSurcharge = function getSurcharge(state, options) {
450
450
  if (!isEdit && bookingId) {
451
451
  if (Array.isArray(bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.surcharge)) {
452
452
  var _state$bookingDetail3;
453
- return (((_state$bookingDetail3 = state.bookingDetail) === null || _state$bookingDetail3 === void 0 ? void 0 : _state$bookingDetail3.surcharge) || []).map(function (d, index) {
453
+ return (((_state$bookingDetail3 = state.bookingDetail) === null || _state$bookingDetail3 === void 0 ? void 0 : _state$bookingDetail3.surcharge) || []).filter(function (d) {
454
+ return Number(d.amount) > 0;
455
+ }).map(function (d, index) {
454
456
  return {
455
457
  key: "custom_surcharge_".concat(index),
456
458
  label: d.name[state.locale || 'en'] || d.name['en'] || d.name['original'],
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
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: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -121,35 +121,35 @@ export function CashPaymentModule(_ref) {
121
121
  break;
122
122
  }
123
123
  setAmount('');
124
- _context.next = 33;
124
+ _context.next = 32;
125
125
  break;
126
126
  case 13:
127
127
  // 移除可能的货币符号和多余空格
128
128
  cleanValue = finalValue.replace(/[$\s]/g, '');
129
129
  numValue = parseFloat(cleanValue); // 检查当前金额是否等于剩余支付金额
130
- debugger;
130
+ // debugger
131
131
  // 需要确认当前是否是定金模式,如果是定金模式则 balanceDue 应该为完整订单剩余待付金额
132
132
  balanceDue = parseFloat(orderInfo !== null && orderInfo !== void 0 && orderInfo.isDeposit ? balanceDueTotalAmount || '0' : balanceDueAmount);
133
133
  shouldApplyRounding = Math.abs(numValue - balanceDue) < 0.01; // 使用小数精度比较
134
134
  finalAmount = numValue;
135
135
  roundingDiff = 0;
136
136
  if (!(shouldApplyRounding && roundingFunction)) {
137
- _context.next = 30;
137
+ _context.next = 29;
138
138
  break;
139
139
  }
140
- _context.next = 23;
140
+ _context.next = 22;
141
141
  return roundingFunction(numValue);
142
- case 23:
142
+ case 22:
143
143
  _result = _context.sent;
144
144
  _ref3 = _result || {}, _ref3$roundedAmount = _ref3.roundedAmount, roundedAmount = _ref3$roundedAmount === void 0 ? numValue : _ref3$roundedAmount, _ref3$roundingDiffere = _ref3.roundingDifference, roundingDifference = _ref3$roundingDiffere === void 0 ? 0 : _ref3$roundingDiffere;
145
145
  finalAmount = roundedAmount;
146
146
  roundingDiff = roundingDifference;
147
147
  console.log('应用抹零:', numValue, '->', roundedAmount, '差额:', roundingDifference);
148
- _context.next = 31;
148
+ _context.next = 30;
149
149
  break;
150
- case 30:
150
+ case 29:
151
151
  console.log('不应用抹零,用户输入金额:', numValue, '剩余支付金额:', balanceDue);
152
- case 31:
152
+ case 30:
153
153
  setRoundingAmount(roundingDiff);
154
154
  if (isNaN(numValue)) {
155
155
  setAmount('');
@@ -157,7 +157,7 @@ export function CashPaymentModule(_ref) {
157
157
  setAmount(finalAmount.toString());
158
158
  console.log('设置金额为:', finalAmount);
159
159
  }
160
- case 33:
160
+ case 32:
161
161
  case "end":
162
162
  return _context.stop();
163
163
  }
@@ -57,7 +57,10 @@ function PaymentOptionsModule(_ref) {
57
57
  onClick(method);
58
58
  }
59
59
  }, {
60
- wait: 500 // 500ms 防抖延迟
60
+ wait: 1000,
61
+ // 500ms 防抖延迟
62
+ leading: true,
63
+ trailing: false
61
64
  }),
62
65
  handlePaymentClick = _useDebounceFn.run;
63
66
  return /*#__PURE__*/React.createElement("div", {
@@ -393,7 +393,10 @@ export var useWalletPass = function useWalletPass(props) {
393
393
 
394
394
  // 更新不可用钱包数据
395
395
  setDisabledWalletData(isDisabledData);
396
- var newValues = [].concat(_toConsumableArray(selectedWalletRef.current), isAvailableData);
396
+ var newValues = _toConsumableArray(selectedWalletRef.current);
397
+ if (isAvailableData.length === 1) {
398
+ newValues = [].concat(_toConsumableArray(selectedWalletRef.current), isAvailableData);
399
+ }
397
400
  setSearchIdentificationCodeList(cachedSearchResults);
398
401
  setWalletSelect(newValues);
399
402
  handleFetchUserIdentificationCodes(newValues.map(function (item) {
@@ -16,6 +16,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
16
16
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  import React, { useEffect, useMemo, useState } from 'react';
19
+ import { Tooltip } from 'antd';
19
20
  import { useControllableValue } from 'ahooks';
20
21
  //@ts-ignore
21
22
  import { merge, omit } from 'lodash';
@@ -232,15 +233,21 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
232
233
  className: "pisell-cash-keyboard-intact-container-top-label"
233
234
  }, mergedDisplayField.balanceDue.label), /*#__PURE__*/React.createElement("div", {
234
235
  className: "pisell-cash-keyboard-intact-container-top-value"
236
+ }, /*#__PURE__*/React.createElement(Tooltip, {
237
+ title: formatAmountWithOptions(originalValue || '', amountSymbol, {
238
+ precision: 2,
239
+ hideDecimalForWholeNumbers: false,
240
+ showCurrencySymbol: true
241
+ })
235
242
  }, /*#__PURE__*/React.createElement(AutoResizeText, {
236
243
  minFontSizePx: 10,
237
- maxFontSizePx: 14,
244
+ maxFontSizePx: 18,
238
245
  fontSizePrecisionPx: 0.5
239
246
  }, formatAmountWithOptions(originalValue || '', amountSymbol, {
240
247
  precision: 2,
241
248
  hideDecimalForWholeNumbers: false,
242
249
  showCurrencySymbol: true
243
- })))), ((_mergedDisplayField$c = mergedDisplayField.cashReceived) === null || _mergedDisplayField$c === void 0 ? void 0 : _mergedDisplayField$c.visible) && /*#__PURE__*/React.createElement("div", {
250
+ }))))), ((_mergedDisplayField$c = mergedDisplayField.cashReceived) === null || _mergedDisplayField$c === void 0 ? void 0 : _mergedDisplayField$c.visible) && /*#__PURE__*/React.createElement("div", {
244
251
  style: _objectSpread(_objectSpread({}, getGridStyle(1)), {}, {
245
252
  padding: '6px 16px',
246
253
  borderRadius: '8px',
@@ -265,16 +272,12 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
265
272
  color: '#667085'
266
273
  }
267
274
  }, mergedDisplayField.cashReceived.label),
268
- value: internalValue ? /*#__PURE__*/React.createElement(AutoResizeText, {
269
- minFontSizePx: 10,
270
- maxFontSizePx: 14,
271
- fontSizePrecisionPx: 0.5
272
- }, formatAmountWithOptions(internalValue || '', amountSymbol, {
275
+ value: internalValue ? formatAmountWithOptions(internalValue || '', amountSymbol, {
273
276
  value: internalValue,
274
277
  hideDecimalForWholeNumbers: false,
275
278
  precision: 2,
276
279
  showCurrencySymbol: true
277
- })) : '',
280
+ }) : '',
278
281
  height: 30,
279
282
  fontSize: 20,
280
283
  placeholder: placeholder,
@@ -294,16 +297,23 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
294
297
  className: "pisell-cash-keyboard-intact-container-top-label"
295
298
  }, mergedDisplayField.changeDue.label), /*#__PURE__*/React.createElement("div", {
296
299
  className: "pisell-cash-keyboard-intact-container-top-value"
300
+ }, /*#__PURE__*/React.createElement(Tooltip, {
301
+ title: formatAmountWithOptions(hiddenChangeDue ? 0 : changeDue, amountSymbol, {
302
+ value: hiddenChangeDue ? 0 : changeDue,
303
+ showCurrencySymbol: true,
304
+ hideDecimalForWholeNumbers: false,
305
+ precision: 2
306
+ })
297
307
  }, /*#__PURE__*/React.createElement(AutoResizeText, {
298
308
  minFontSizePx: 10,
299
- maxFontSizePx: 14,
309
+ maxFontSizePx: 18,
300
310
  fontSizePrecisionPx: 0.5
301
311
  }, formatAmountWithOptions(hiddenChangeDue ? 0 : changeDue, amountSymbol, {
302
312
  value: hiddenChangeDue ? 0 : changeDue,
303
313
  showCurrencySymbol: true,
304
314
  hideDecimalForWholeNumbers: false,
305
315
  precision: 2
306
- }))))), /*#__PURE__*/React.createElement(Shortcuts, {
316
+ })))))), /*#__PURE__*/React.createElement(Shortcuts, {
307
317
  presets: getDefaultPresets(),
308
318
  onChange: setInternalValue,
309
319
  disabled: disabled
@@ -49,8 +49,7 @@
49
49
  display: flex;
50
50
  flex-direction: column;
51
51
  justify-content: center;
52
- gap: 4px;
53
- padding-top: 4px;
52
+ padding: 6px 0;
54
53
 
55
54
  .pisell-cash-keyboard-intact-container-top-label {
56
55
  font-size: 14px;
@@ -313,7 +313,7 @@ var getSurcharge = (state, options) => {
313
313
  const { bookingDetail, bookingId } = state;
314
314
  if (!isEdit && bookingId) {
315
315
  if (Array.isArray(bookingDetail == null ? void 0 : bookingDetail.surcharge)) {
316
- return (((_a = state.bookingDetail) == null ? void 0 : _a.surcharge) || []).map(
316
+ return (((_a = state.bookingDetail) == null ? void 0 : _a.surcharge) || []).filter((d) => Number(d.amount) > 0).map(
317
317
  (d, index) => {
318
318
  return {
319
319
  key: `custom_surcharge_${index}`,
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
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: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -122,7 +122,6 @@ function CashPaymentModule({
122
122
  } else {
123
123
  const cleanValue = finalValue.replace(/[$\s]/g, "");
124
124
  const numValue = parseFloat(cleanValue);
125
- debugger;
126
125
  const balanceDue = parseFloat((orderInfo == null ? void 0 : orderInfo.isDeposit) ? balanceDueTotalAmount || "0" : balanceDueAmount);
127
126
  const shouldApplyRounding = Math.abs(numValue - balanceDue) < 0.01;
128
127
  let finalAmount = numValue;
@@ -87,8 +87,10 @@ function PaymentOptionsModule({
87
87
  }
88
88
  },
89
89
  {
90
- wait: 500
90
+ wait: 1e3,
91
91
  // 500ms 防抖延迟
92
+ leading: true,
93
+ trailing: false
92
94
  }
93
95
  );
94
96
  return /* @__PURE__ */ import_react.default.createElement(
@@ -242,7 +242,10 @@ var useWalletPass = (props) => {
242
242
  });
243
243
  }
244
244
  setDisabledWalletData(isDisabledData);
245
- const newValues = [...selectedWalletRef.current, ...isAvailableData];
245
+ let newValues = [...selectedWalletRef.current];
246
+ if (isAvailableData.length === 1) {
247
+ newValues = [...selectedWalletRef.current, ...isAvailableData];
248
+ }
246
249
  setSearchIdentificationCodeList(cachedSearchResults);
247
250
  setWalletSelect(newValues);
248
251
  handleFetchUserIdentificationCodes(newValues.map((item) => item.id));
@@ -33,6 +33,7 @@ __export(CashKeyboardIntact_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(CashKeyboardIntact_exports);
35
35
  var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
36
37
  var import_ahooks = require("ahooks");
37
38
  var import_lodash = require("lodash");
38
39
  var import_utils = require("@pisell/utils");
@@ -234,17 +235,35 @@ var CashKeyboardIntact = (props) => {
234
235
  },
235
236
  /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-label" }, mergedDisplayField.balanceDue.label),
236
237
  /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-value" }, /* @__PURE__ */ import_react.default.createElement(
237
- import_materials2.AutoResizeText,
238
+ import_antd.Tooltip,
238
239
  {
239
- minFontSizePx: 10,
240
- maxFontSizePx: 14,
241
- fontSizePrecisionPx: 0.5
240
+ title: (0, import_utils3.formatAmountWithOptions)(
241
+ originalValue || "",
242
+ amountSymbol,
243
+ {
244
+ precision: 2,
245
+ hideDecimalForWholeNumbers: false,
246
+ showCurrencySymbol: true
247
+ }
248
+ )
242
249
  },
243
- (0, import_utils3.formatAmountWithOptions)(originalValue || "", amountSymbol, {
244
- precision: 2,
245
- hideDecimalForWholeNumbers: false,
246
- showCurrencySymbol: true
247
- })
250
+ /* @__PURE__ */ import_react.default.createElement(
251
+ import_materials2.AutoResizeText,
252
+ {
253
+ minFontSizePx: 10,
254
+ maxFontSizePx: 18,
255
+ fontSizePrecisionPx: 0.5
256
+ },
257
+ (0, import_utils3.formatAmountWithOptions)(
258
+ originalValue || "",
259
+ amountSymbol,
260
+ {
261
+ precision: 2,
262
+ hideDecimalForWholeNumbers: false,
263
+ showCurrencySymbol: true
264
+ }
265
+ )
266
+ )
248
267
  ))
249
268
  ), ((_b = mergedDisplayField.cashReceived) == null ? void 0 : _b.visible) && /* @__PURE__ */ import_react.default.createElement(
250
269
  "div",
@@ -281,19 +300,15 @@ var CashKeyboardIntact = (props) => {
281
300
  },
282
301
  mergedDisplayField.cashReceived.label
283
302
  ),
284
- value: internalValue ? /* @__PURE__ */ import_react.default.createElement(
285
- import_materials2.AutoResizeText,
303
+ value: internalValue ? (0, import_utils3.formatAmountWithOptions)(
304
+ internalValue || "",
305
+ amountSymbol,
286
306
  {
287
- minFontSizePx: 10,
288
- maxFontSizePx: 14,
289
- fontSizePrecisionPx: 0.5
290
- },
291
- (0, import_utils3.formatAmountWithOptions)(internalValue || "", amountSymbol, {
292
307
  value: internalValue,
293
308
  hideDecimalForWholeNumbers: false,
294
309
  precision: 2,
295
310
  showCurrencySymbol: true
296
- })
311
+ }
297
312
  ) : "",
298
313
  height: 30,
299
314
  fontSize: 20,
@@ -315,18 +330,37 @@ var CashKeyboardIntact = (props) => {
315
330
  },
316
331
  /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-label" }, mergedDisplayField.changeDue.label),
317
332
  /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-value" }, /* @__PURE__ */ import_react.default.createElement(
318
- import_materials2.AutoResizeText,
333
+ import_antd.Tooltip,
319
334
  {
320
- minFontSizePx: 10,
321
- maxFontSizePx: 14,
322
- fontSizePrecisionPx: 0.5
335
+ title: (0, import_utils3.formatAmountWithOptions)(
336
+ hiddenChangeDue ? 0 : changeDue,
337
+ amountSymbol,
338
+ {
339
+ value: hiddenChangeDue ? 0 : changeDue,
340
+ showCurrencySymbol: true,
341
+ hideDecimalForWholeNumbers: false,
342
+ precision: 2
343
+ }
344
+ )
323
345
  },
324
- (0, import_utils3.formatAmountWithOptions)(hiddenChangeDue ? 0 : changeDue, amountSymbol, {
325
- value: hiddenChangeDue ? 0 : changeDue,
326
- showCurrencySymbol: true,
327
- hideDecimalForWholeNumbers: false,
328
- precision: 2
329
- })
346
+ /* @__PURE__ */ import_react.default.createElement(
347
+ import_materials2.AutoResizeText,
348
+ {
349
+ minFontSizePx: 10,
350
+ maxFontSizePx: 18,
351
+ fontSizePrecisionPx: 0.5
352
+ },
353
+ (0, import_utils3.formatAmountWithOptions)(
354
+ hiddenChangeDue ? 0 : changeDue,
355
+ amountSymbol,
356
+ {
357
+ value: hiddenChangeDue ? 0 : changeDue,
358
+ showCurrencySymbol: true,
359
+ hideDecimalForWholeNumbers: false,
360
+ precision: 2
361
+ }
362
+ )
363
+ )
330
364
  ))
331
365
  )), /* @__PURE__ */ import_react.default.createElement(
332
366
  import_shortcuts.default,
@@ -49,8 +49,7 @@
49
49
  display: flex;
50
50
  flex-direction: column;
51
51
  justify-content: center;
52
- gap: 4px;
53
- padding-top: 4px;
52
+ padding: 6px 0;
54
53
 
55
54
  .pisell-cash-keyboard-intact-container-top-label {
56
55
  font-size: 14px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.4.52",
3
+ "version": "6.4.53",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -60,8 +60,8 @@
60
60
  "react-resizable": "^3.0.5",
61
61
  "styled-components": "^6.0.0-rc.3",
62
62
  "@pisell/materials": "6.4.12",
63
- "@pisell/date-picker": "3.0.7",
64
63
  "@pisell/utils": "3.0.2",
64
+ "@pisell/date-picker": "3.0.7",
65
65
  "@pisell/icon": "0.0.11"
66
66
  },
67
67
  "peerDependencies": {