@pisell/private-materials 6.6.60 → 6.6.62

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 (133) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +10 -10
  11. package/es/components/booking/components/footer/amount.js +3 -4
  12. package/es/components/booking/components/footer/utils.js +82 -85
  13. package/es/components/booking/components/voucher/index.js +1 -1
  14. package/es/components/booking/dashboard/index.d.ts +5 -0
  15. package/es/components/booking/dashboard/index.js +9 -6
  16. package/es/components/booking/info/service2/Group/utils.js +30 -1
  17. package/es/components/booking/info2/service/editService/index.js +6 -49
  18. package/es/components/booking/info2/service/editService/utils.d.ts +0 -1
  19. package/es/components/booking/info2/service/editService/utils.js +0 -16
  20. package/es/components/booking/payments/index.js +1 -1
  21. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  22. package/es/components/checkout/hooks/useWalletPass.js +23 -15
  23. package/es/components/index.d.ts +2 -1
  24. package/es/components/index.js +2 -1
  25. package/es/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
  26. package/es/components/pisellCashCounting/PisellCashCounting.js +121 -0
  27. package/es/components/pisellCashCounting/PisellCashCounting.less +263 -0
  28. package/es/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
  29. package/es/components/pisellCashCounting/components/CashCountingModal/index.js +250 -0
  30. package/es/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
  31. package/es/components/pisellCashCounting/hooks.d.ts +21 -0
  32. package/es/components/pisellCashCounting/hooks.js +193 -0
  33. package/es/components/pisellCashCounting/index.d.ts +2 -0
  34. package/es/components/pisellCashCounting/index.js +1 -0
  35. package/es/components/pisellCashCounting/locales.d.ts +118 -0
  36. package/es/components/pisellCashCounting/locales.js +117 -0
  37. package/es/components/pisellCashCounting/types.d.ts +85 -0
  38. package/es/components/pisellCashCounting/types.js +1 -0
  39. package/es/components/pisellCashCounting/utils.d.ts +10 -0
  40. package/es/components/pisellCashCounting/utils.js +40 -0
  41. package/es/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
  42. package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +2 -0
  43. package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +5 -2
  44. package/es/components/ticketBooking/components/bookingDataPanel/index.d.ts +2 -0
  45. package/es/components/ticketBooking/components/bookingDataPanel/index.js +5 -2
  46. package/es/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +2 -1
  47. package/es/components/ticketBooking/components/ticketBooking/index.js +156 -37
  48. package/es/components/ticketBooking/index.js +7 -1
  49. package/es/components/ticketBooking/utils/formatProductMessage.js +47 -2
  50. package/es/hooks/useResponsive.d.ts +8 -0
  51. package/es/hooks/useResponsive.js +43 -0
  52. package/es/hooks/useThemeTokens.d.ts +7 -0
  53. package/es/hooks/useThemeTokens.js +20 -0
  54. package/es/index.d.ts +1 -0
  55. package/es/index.js +2 -1
  56. package/es/pro/Login2.0/components/phoneValidation.js +65 -58
  57. package/es/pro/NumericStepper/index.d.ts +75 -0
  58. package/es/pro/NumericStepper/index.js +301 -0
  59. package/es/pro/NumericStepper/index.less +364 -0
  60. package/es/pro/keyboards/index.d.ts +2 -0
  61. package/es/pro/keyboards/index.js +1 -0
  62. package/es/pro/keyboards/locales.d.ts +38 -0
  63. package/es/pro/keyboards/locales.js +57 -0
  64. package/es/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  65. package/es/pro/keyboards/numberKeyboard/index.js +523 -0
  66. package/es/pro/keyboards/numberKeyboard/index.less +59 -0
  67. package/es/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  68. package/es/pro/keyboards/numberKeyboard/types.js +1 -0
  69. package/es/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
  70. package/es/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
  71. package/lib/components/booking/components/footer/amount.js +3 -3
  72. package/lib/components/booking/components/footer/utils.js +11 -15
  73. package/lib/components/booking/components/voucher/index.js +1 -1
  74. package/lib/components/booking/dashboard/index.d.ts +5 -0
  75. package/lib/components/booking/dashboard/index.js +6 -5
  76. package/lib/components/booking/info/service2/Group/utils.js +42 -3
  77. package/lib/components/booking/info2/service/editService/index.js +5 -39
  78. package/lib/components/booking/info2/service/editService/utils.d.ts +0 -1
  79. package/lib/components/booking/info2/service/editService/utils.js +0 -16
  80. package/lib/components/booking/payments/index.js +1 -1
  81. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  82. package/lib/components/checkout/hooks/useWalletPass.js +23 -16
  83. package/lib/components/index.d.ts +2 -1
  84. package/lib/components/index.js +3 -0
  85. package/lib/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
  86. package/lib/components/pisellCashCounting/PisellCashCounting.js +168 -0
  87. package/lib/components/pisellCashCounting/PisellCashCounting.less +263 -0
  88. package/lib/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
  89. package/lib/components/pisellCashCounting/components/CashCountingModal/index.js +171 -0
  90. package/lib/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
  91. package/lib/components/pisellCashCounting/hooks.d.ts +21 -0
  92. package/lib/components/pisellCashCounting/hooks.js +189 -0
  93. package/lib/components/pisellCashCounting/index.d.ts +2 -0
  94. package/lib/components/pisellCashCounting/index.js +35 -0
  95. package/lib/components/pisellCashCounting/locales.d.ts +118 -0
  96. package/lib/components/pisellCashCounting/locales.js +141 -0
  97. package/lib/components/pisellCashCounting/types.d.ts +85 -0
  98. package/lib/components/pisellCashCounting/types.js +17 -0
  99. package/lib/components/pisellCashCounting/utils.d.ts +10 -0
  100. package/lib/components/pisellCashCounting/utils.js +59 -0
  101. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
  102. package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +2 -0
  103. package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +3 -2
  104. package/lib/components/ticketBooking/components/bookingDataPanel/index.d.ts +2 -0
  105. package/lib/components/ticketBooking/components/bookingDataPanel/index.js +10 -3
  106. package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +10 -1
  107. package/lib/components/ticketBooking/components/ticketBooking/index.js +114 -14
  108. package/lib/components/ticketBooking/index.js +11 -1
  109. package/lib/components/ticketBooking/utils/formatProductMessage.js +44 -2
  110. package/lib/hooks/useResponsive.d.ts +8 -0
  111. package/lib/hooks/useResponsive.js +48 -0
  112. package/lib/hooks/useThemeTokens.d.ts +7 -0
  113. package/lib/hooks/useThemeTokens.js +40 -0
  114. package/lib/index.d.ts +1 -0
  115. package/lib/index.js +3 -0
  116. package/lib/pro/Login2.0/components/phoneValidation.js +4 -2
  117. package/lib/pro/NumericStepper/index.d.ts +75 -0
  118. package/lib/pro/NumericStepper/index.js +338 -0
  119. package/lib/pro/NumericStepper/index.less +364 -0
  120. package/lib/pro/keyboards/index.d.ts +2 -0
  121. package/lib/pro/keyboards/index.js +39 -0
  122. package/lib/pro/keyboards/locales.d.ts +38 -0
  123. package/lib/pro/keyboards/locales.js +61 -0
  124. package/lib/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  125. package/lib/pro/keyboards/numberKeyboard/index.js +400 -0
  126. package/lib/pro/keyboards/numberKeyboard/index.less +59 -0
  127. package/lib/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  128. package/lib/pro/keyboards/numberKeyboard/types.js +17 -0
  129. package/lib/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
  130. package/lib/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
  131. package/lowcode/pisell-cash-counting/meta.ts +167 -0
  132. package/lowcode/pisell-cash-counting/snippets.ts +13 -0
  133. package/package.json +4 -4
@@ -19,7 +19,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
19
19
  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; } }
20
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
21
  import Delete_wght300_24px from '@pisell/icon/es/Delete_wght300_24px';
22
- import { formatAmount, getUniqueId, locales, sendWarningLog } from '@pisell/utils';
22
+ import { formatAmount, getUniqueId, locales } from '@pisell/utils';
23
23
  import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
24
24
  import Drawer from "../../../components/drawer";
25
25
  import { Context } from "../../../info/model";
@@ -41,7 +41,7 @@ import { editSessionProduct } from "../../../info/utils";
41
41
  import { deleteCacheParams, getDays, getProductOriginTotalPrice, getProductTotalPrice, getServiceTimes, isSessionProduct, isWalkIn } from "../../../utils";
42
42
  import { getErrorList, getIsNoSpecAndPackage } from "../../utilsByBooking";
43
43
  import { formatResources, getDurationProps, getFlexibleOption, getMultiDay, getTimeObj, setDefaultCapacitys } from "../addService/utils";
44
- import { getProductAllDiscountList, mergeBundles, setProductPrice, mergeBundleWithOriginalPrice } from "./utils";
44
+ import { getProductAllDiscountList, mergeBundleWithOriginalPrice, setProductPrice } from "./utils";
45
45
  import NoteModal from "../../../../../plus/noteModal";
46
46
  import { DiscountKeyboard } from "../../../../../pro/priceKeyboard";
47
47
  import EditTabs from "../../../info/service/editService/EditTabs";
@@ -51,7 +51,6 @@ import { createBookingItemsByGroup, getGroupTotalPrice } from "../../../info/ser
51
51
  import { useShopDiscountModule } from "../../../../ticketBooking/hooks/pisellos/useShopDiscountModule";
52
52
  import DiscountChangeModal from "./DiscountChangeModal";
53
53
  import Decimal from "decimal.js";
54
- import useEngineContext from "../../../../../hooks/useEngineContext";
55
54
  var submitLock = false;
56
55
  var Info = function Info(_, ref) {
57
56
  var _state$service4, _state$bookingConfig2, _state$bookingConfig3, _state$service$cacheI5, _state$service$cacheI7, _state$service6, _window$BaseMaterials, _state$service8, _state$service$cacheI12, _state$bookingConfig5, _state$service$cacheI13, _state$service$cacheI14, _state$service9, _state$service$resour2, _state$service$cacheI16, _state$service$cacheI17, _state$client2;
@@ -72,7 +71,6 @@ var Info = function Info(_, ref) {
72
71
  _useState2 = _slicedToArray(_useState, 2),
73
72
  discountChangeModalOpen = _useState2[0],
74
73
  setDiscountChangeModalOpen = _useState2[1];
75
- var context = useEngineContext();
76
74
  var _useContext = useContext(Context),
77
75
  state = _useContext.state,
78
76
  dispatch = _useContext.dispatch;
@@ -665,19 +663,13 @@ var Info = function Info(_, ref) {
665
663
  var values = form.getFieldsValue();
666
664
  var isSession = isSessionProduct(item);
667
665
  var sessionValue = {};
668
- var oldSession = {};
669
666
  if (isSession) {
670
- var _item$_extend7, _item$_extend8, _item$_extend9, _item$_extend10, _item$_extend11, _item$_extend12;
667
+ var _item$_extend7, _item$_extend8, _item$_extend9;
671
668
  sessionValue.startEndTime = {
672
669
  startDate: item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.start_date,
673
670
  endDate: item === null || item === void 0 || (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.end_date,
674
671
  duration: item === null || item === void 0 || (_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 ? void 0 : _item$_extend9.duration
675
672
  };
676
- oldSession = {
677
- start_date: dayjs(item === null || item === void 0 || (_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.start_date).format('YYYY-MM-DD'),
678
- end_date: dayjs(item === null || item === void 0 || (_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 ? void 0 : _item$_extend11.end_date).format('YYYY-MM-DD'),
679
- duration: item === null || item === void 0 || (_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.duration
680
- };
681
673
  }
682
674
 
683
675
  // 打开商品详情弹窗
@@ -695,9 +687,7 @@ var Info = function Info(_, ref) {
695
687
  },
696
688
  isOS: isSession,
697
689
  customer_id: (_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id,
698
- value: _objectSpread(_objectSpread(_objectSpread({}, item._extend.other), {}, {
699
- bundle: mergeBundles(item._extend.other)
700
- }, sessionValue), {}, {
690
+ value: _objectSpread(_objectSpread(_objectSpread({}, item._extend.other), sessionValue), {}, {
701
691
  quantity: values.quantity || item._extend.quantity
702
692
  })
703
693
  },
@@ -710,8 +700,8 @@ var Info = function Info(_, ref) {
710
700
 
711
701
  // 手动折扣时 合并 bundle price,优先使用编辑前的价格
712
702
  if (item.discount_amount) {
713
- var _item$_extend13;
714
- other = mergeBundleWithOriginalPrice(other, ((_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.other) || {});
703
+ var _item$_extend10;
704
+ other = mergeBundleWithOriginalPrice(other, ((_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.other) || {});
715
705
  }
716
706
  other.session = e.session;
717
707
 
@@ -746,37 +736,6 @@ var Info = function Info(_, ref) {
746
736
  });
747
737
  } catch (err) {}
748
738
  var sessionDetail = editSessionProduct(cacheItem, e.session);
749
- try {
750
- var _e$session, _e$session2, _e$session3, _e$session4, _e$session5, _context$appHelper, _context$appHelper$ge;
751
- sendWarningLog({
752
- title: '修改商品数据',
753
- content: [{
754
- key: 'productId',
755
- value: item.id
756
- }, {
757
- key: "isSession",
758
- value: isSession
759
- }, {
760
- key: 'oldSession',
761
- value: JSON.stringify(oldSession)
762
- }, {
763
- key: 'sessionValue',
764
- value: JSON.stringify({
765
- startTime: (_e$session = e.session) === null || _e$session === void 0 ? void 0 : _e$session.start_time,
766
- endTime: (_e$session2 = e.session) === null || _e$session2 === void 0 ? void 0 : _e$session2.end_time,
767
- startDate: dayjs((_e$session3 = e.session) === null || _e$session3 === void 0 ? void 0 : _e$session3.start_at).format('YYYY-MM-DD'),
768
- endDate: dayjs((_e$session4 = e.session) === null || _e$session4 === void 0 ? void 0 : _e$session4.end_at).format('YYYY-MM-DD'),
769
- duration: (_e$session5 = e.session) === null || _e$session5 === void 0 ? void 0 : _e$session5.duration
770
- })
771
- }, {
772
- key: '日期',
773
- value: dayjs().format('YYYY-MM-DD HH:mm')
774
- }, {
775
- key: '店铺id',
776
- value: (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.store) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getState) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.call(_context$appHelper)) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.global) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.globalConfig) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.id
777
- }]
778
- });
779
- } catch (err) {}
780
739
  if (sessionDetail) {
781
740
  setTimeout(function () {
782
741
  form.setFieldsValue({
@@ -1264,8 +1223,6 @@ var Info = function Info(_, ref) {
1264
1223
  var _cacheItem$_extend$ot, _cacheItem$_extend$ot2;
1265
1224
  delete cacheItem.discount_list;
1266
1225
  (_cacheItem$_extend$ot = cacheItem._extend.other) === null || _cacheItem$_extend$ot === void 0 || (_cacheItem$_extend$ot = _cacheItem$_extend$ot.bundle) === null || _cacheItem$_extend$ot === void 0 || (_cacheItem$_extend$ot2 = _cacheItem$_extend$ot.forEach) === null || _cacheItem$_extend$ot2 === void 0 || _cacheItem$_extend$ot2.call(_cacheItem$_extend$ot, function (bundle) {
1267
- var _bundle$metadata;
1268
- bundle === null || bundle === void 0 || (_bundle$metadata = bundle.metadata) === null || _bundle$metadata === void 0 || delete _bundle$metadata.custom_product_bundle_map_id;
1269
1226
  bundle === null || bundle === void 0 || delete bundle.discount_list;
1270
1227
  bundle === null || bundle === void 0 || delete bundle.booking_id;
1271
1228
  bundle === null || bundle === void 0 || delete bundle.bundle_selling_price;
@@ -32,7 +32,6 @@ export declare const setProductPrice: (cacheItem: any, { newTotal, origin_total
32
32
  * @returns 折扣列表
33
33
  */
34
34
  export declare const getProductAllDiscountList: (cacheItem: any) => any;
35
- export declare const mergeBundles: (other: any) => any[];
36
35
  /**
37
36
  * 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
38
37
  * @param other - callback 返回的新数据
@@ -149,22 +149,6 @@ export var getProductAllDiscountList = function getProductAllDiscountList(cacheI
149
149
  (_discountList = discountList).push.apply(_discountList, _toConsumableArray(bundleDiscountList));
150
150
  return discountList;
151
151
  };
152
- export var mergeBundles = function mergeBundles(other) {
153
- var bundle = (other === null || other === void 0 ? void 0 : other.bundle) || [];
154
- var newBundle = [];
155
- bundle.forEach(function (item) {
156
- var newItem = newBundle.find(function (newItem) {
157
- return newItem.id === item.id;
158
- });
159
- if (newItem) {
160
- newItem.num += item.num || 1;
161
- newItem.quantity += item.quantity || 1;
162
- } else {
163
- newBundle.push(_objectSpread({}, item));
164
- }
165
- });
166
- return newBundle;
167
- };
168
152
 
169
153
  /**
170
154
  * 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
@@ -189,7 +189,7 @@ var Payments = Provider(function (props) {
189
189
  className: "payment-list-item-surcharge"
190
190
  }, "(", locales.getText("pisell2.text.surcharge"), " ", formatAmount(item.service_fee, 2, (state === null || state === void 0 ? void 0 : state.amountSymbol) || "$"), ")") : null, /*#__PURE__*/React.createElement("div", {
191
191
  className: "payment-list-item-date"
192
- }, dayjs(item.payment_time || item.created_at).format("HH:mm YYYY/MM/DD"), /*#__PURE__*/React.createElement("span", {
192
+ }, dayjs(item.payment_time).format("HH:mm YYYY/MM/DD"), /*#__PURE__*/React.createElement("span", {
193
193
  className: "payment-list-item-platform-type"
194
194
  }, item.platform && locales.getText("pisell2.text.platform.type")(item.platform))))))));
195
195
  }
@@ -17,7 +17,7 @@ export declare const useWalletPass: (props: {
17
17
  cardData: any;
18
18
  handleSelectWallet: (value: number[]) => void;
19
19
  selectedWalletIds: any[];
20
- expiredWalletIds: any[];
20
+ expiredWalletIds: any;
21
21
  expiredWalletData: any;
22
22
  disabledWalletData: any[];
23
23
  clearAllSelectedWallet: () => void;
@@ -29,6 +29,8 @@ import usePaymentLogger from "./usePaymentLogger";
29
29
  import { isWalkIn } from "../../booking/utils";
30
30
  import { useActiveExecute } from "../../ticketBooking/hooks/pisellos";
31
31
  import { useShopDiscountModule } from "../../ticketBooking/hooks/pisellos/useShopDiscountModule";
32
+ import { useOsKey } from "../../ticketBooking/context";
33
+ import { getShopDiscountKey } from "../../ticketBooking/utils";
32
34
 
33
35
  /**
34
36
  * 自定义Hook:使用WalletPass功能
@@ -40,6 +42,10 @@ export var useWalletPass = function useWalletPass(props) {
40
42
  var logger = usePaymentLogger();
41
43
  var _useActiveExecute = useActiveExecute(),
42
44
  executeIfActive = _useActiveExecute.executeIfActive;
45
+ var osKey = useOsKey();
46
+
47
+ // 根据 osKey 生成模块名称
48
+ var moduleKey = getShopDiscountKey(osKey || 'ticket');
43
49
 
44
50
  // 钱包推荐列表
45
51
  var _useState = useState([]),
@@ -673,7 +679,7 @@ export var useWalletPass = function useWalletPass(props) {
673
679
  // 保持初始顺序设置折扣列表
674
680
  var sortedDiscountList = sortDiscountListWithInitialOrder(detail.discountList);
675
681
  setDiscountList(sortedDiscountList);
676
- pisellos === null || pisellos === void 0 || (_pisellos$effects = pisellos.effects) === null || _pisellos$effects === void 0 || _pisellos$effects.emit('shopDiscount:onSelectedDiscountListChange', detail);
682
+ pisellos === null || pisellos === void 0 || (_pisellos$effects = pisellos.effects) === null || _pisellos$effects === void 0 || _pisellos$effects.emit("".concat(moduleKey, ":onSelectedDiscountListChange"), detail);
677
683
  return;
678
684
  }
679
685
  setWalletSelect([]);
@@ -773,23 +779,25 @@ export var useWalletPass = function useWalletPass(props) {
773
779
  }
774
780
  });
775
781
  var handleSelectDiscount = useMemoizedFn(function (value, option) {
776
- var _detail$discountList, _pisellos$effects2;
777
782
  setLoading(true);
778
- var isSelected = value.includes(option.id);
779
- var detail = shopDiscount.setDiscountSelected({
780
- discountId: option.id,
781
- isSelected: isSelected
782
- });
783
- if (!(detail !== null && detail !== void 0 && (_detail$discountList = detail.discountList) !== null && _detail$discountList !== void 0 && (_detail$discountList = _detail$discountList.find(function (item) {
784
- return item.id === option.id;
785
- })) !== null && _detail$discountList !== void 0 && _detail$discountList.isSelected)) {
783
+ try {
784
+ var _pisellos$effects2;
785
+ var isSelected = value.includes(option.id);
786
+ var detail = shopDiscount.setDiscountSelected({
787
+ discountId: option.id,
788
+ isSelected: isSelected
789
+ });
790
+
791
+ // 保持初始顺序设置折扣列表
792
+ var sortedDiscountList = sortDiscountListWithInitialOrder(detail.discountList);
793
+ setDiscountList(sortedDiscountList);
794
+ pisellos === null || pisellos === void 0 || (_pisellos$effects2 = pisellos.effects) === null || _pisellos$effects2 === void 0 || _pisellos$effects2.emit("".concat(moduleKey, ":onSelectedDiscountListChange"), detail);
795
+ } catch (err) {
796
+ console.log(err, '1234err');
797
+ } finally {
798
+ // 商品券选择流程结束后统一回收loading,避免出现转圈不停止
786
799
  setLoading(false);
787
800
  }
788
-
789
- // 保持初始顺序设置折扣列表
790
- var sortedDiscountList = sortDiscountListWithInitialOrder(detail.discountList);
791
- setDiscountList(sortedDiscountList);
792
- pisellos === null || pisellos === void 0 || (_pisellos$effects2 = pisellos.effects) === null || _pisellos$effects2 === void 0 || _pisellos$effects2.emit('shopDiscount:onSelectedDiscountListChange', detail);
793
801
  });
794
802
 
795
803
  // 清空不可用钱包数据
@@ -20,4 +20,5 @@ import PinModal from './pinModal';
20
20
  import PinVerifyModal from './pinVerifyModal';
21
21
  import { OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth } from './authentication/admin';
22
22
  import Registry from './systemSettings/registry';
23
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth, Registry, };
23
+ import PisellCashCounting from './pisellCashCounting';
24
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth, Registry, PisellCashCounting, };
@@ -20,4 +20,5 @@ import PinModal from "./pinModal";
20
20
  import PinVerifyModal from "./pinVerifyModal";
21
21
  import { OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth } from "./authentication/admin";
22
22
  import Registry from "./systemSettings/registry";
23
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth, Registry };
23
+ import PisellCashCounting from "./pisellCashCounting";
24
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth, Registry, PisellCashCounting };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { PisellCashCountingProps } from './types';
3
+ import './PisellCashCounting.less';
4
+ declare const PisellCashCounting: React.FC<PisellCashCountingProps>;
5
+ export default PisellCashCounting;
@@ -0,0 +1,121 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
5
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ import React from 'react';
7
+ import { Button, InputNumber } from 'antd';
8
+ import classNames from 'classnames';
9
+ import { locales } from '@pisell/utils';
10
+ import PisellPriceKeyboardModal from "../../pro/pisellPriceKeyboardModal";
11
+ import localeTexts from "./locales";
12
+ import { PisellModal } from '@pisell/materials';
13
+ import CashCountingModal from "./components/CashCountingModal/index";
14
+ import useEngineContext from "../../hooks/useEngineContext";
15
+ import { usePisellCashCounting } from "./hooks";
16
+ import "./PisellCashCounting.less";
17
+ var PREFIX = 'pisell-private-cash-counting';
18
+ var PisellCashCounting = function PisellCashCounting(props) {
19
+ var _context$engine;
20
+ var context = useEngineContext();
21
+ locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
22
+ var _props$disabled = props.disabled,
23
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
24
+ _props$countDisabled = props.countDisabled,
25
+ countDisabled = _props$countDisabled === void 0 ? false : _props$countDisabled,
26
+ placeholder = props.placeholder,
27
+ _props$layout = props.layout,
28
+ layout = _props$layout === void 0 ? 'vertical' : _props$layout,
29
+ countCashButtonText = props.countCashButtonText,
30
+ _props$showCurrencySy = props.showCurrencySymbol,
31
+ showCurrencySymbol = _props$showCurrencySy === void 0 ? true : _props$showCurrencySy,
32
+ _props$useThousandsSe = props.useThousandsSeparator,
33
+ useThousandsSeparator = _props$useThousandsSe === void 0 ? false : _props$useThousandsSe,
34
+ inputNumberProps = props.inputNumberProps,
35
+ buttonProps = props.buttonProps,
36
+ className = props.className,
37
+ style = props.style,
38
+ modalWidth = props.modalWidth;
39
+ var _usePisellCashCountin = usePisellCashCounting(props),
40
+ modalRef = _usePisellCashCountin.modalRef,
41
+ triggerRef = _usePisellCashCountin.triggerRef,
42
+ keyboardOpen = _usePisellCashCountin.keyboardOpen,
43
+ setKeyboardOpen = _usePisellCashCountin.setKeyboardOpen,
44
+ currencyDenominations = _usePisellCashCountin.currencyDenominations,
45
+ decimalPlaces = _usePisellCashCountin.decimalPlaces,
46
+ symbol = _usePisellCashCountin.symbol,
47
+ currencyCode = _usePisellCashCountin.currencyCode,
48
+ currentValue = _usePisellCashCountin.currentValue,
49
+ handleAmountChange = _usePisellCashCountin.handleAmountChange,
50
+ handleKeyboardClose = _usePisellCashCountin.handleKeyboardClose,
51
+ openCountModal = _usePisellCashCountin.openCountModal,
52
+ handleCountCancel = _usePisellCashCountin.handleCountCancel,
53
+ handleCountConfirm = _usePisellCashCountin.handleCountConfirm,
54
+ manualCountMismatchOpen = _usePisellCashCountin.manualCountMismatchOpen,
55
+ confirmUseCountedTotal = _usePisellCashCountin.confirmUseCountedTotal,
56
+ confirmKeepManualAmount = _usePisellCashCountin.confirmKeepManualAmount;
57
+ return /*#__PURE__*/React.createElement("div", {
58
+ className: classNames(PREFIX, className),
59
+ style: style
60
+ }, /*#__PURE__*/React.createElement("div", {
61
+ className: classNames("".concat(PREFIX, "__field"), _defineProperty({}, "".concat(PREFIX, "__field--horizontal"), layout === 'horizontal')),
62
+ ref: triggerRef
63
+ }, /*#__PURE__*/React.createElement(InputNumber, _extends({}, inputNumberProps, {
64
+ controls: false,
65
+ disabled: disabled,
66
+ precision: decimalPlaces,
67
+ value: currentValue,
68
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : locales.getText('pisell-cash-counting.placeholder'),
69
+ className: classNames("".concat(PREFIX, "__input"), inputNumberProps === null || inputNumberProps === void 0 ? void 0 : inputNumberProps.className),
70
+ readOnly: true,
71
+ addonBefore: symbol,
72
+ size: "large",
73
+ style: {
74
+ width: '100%'
75
+ },
76
+ onClick: function onClick() {
77
+ if (!disabled) {
78
+ setKeyboardOpen(true);
79
+ }
80
+ },
81
+ onChange: handleAmountChange
82
+ })), /*#__PURE__*/React.createElement(Button, _extends({}, buttonProps, {
83
+ type: "primary",
84
+ disabled: disabled || countDisabled || (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.disabled),
85
+ className: classNames("".concat(PREFIX, "__button"), buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.className),
86
+ onClick: function onClick(event) {
87
+ var _buttonProps$onClick;
88
+ buttonProps === null || buttonProps === void 0 || (_buttonProps$onClick = buttonProps.onClick) === null || _buttonProps$onClick === void 0 || _buttonProps$onClick.call(buttonProps, event);
89
+ openCountModal();
90
+ }
91
+ }), countCashButtonText !== null && countCashButtonText !== void 0 ? countCashButtonText : locales.getText('pisell-cash-counting.countCash'))), /*#__PURE__*/React.createElement(PisellPriceKeyboardModal, {
92
+ symbol: symbol,
93
+ visible: keyboardOpen,
94
+ value: currentValue,
95
+ triggerRef: triggerRef,
96
+ showCurrencySymbol: showCurrencySymbol,
97
+ useThousandsSeparator: useThousandsSeparator,
98
+ onChange: handleAmountChange,
99
+ onClose: handleKeyboardClose
100
+ }), /*#__PURE__*/React.createElement(PisellModal.Information, {
101
+ open: manualCountMismatchOpen,
102
+ closable: false,
103
+ maskClosable: false,
104
+ title: locales.getText('pisell-cash-counting.manual-vs-count-message-title'),
105
+ describe: locales.getText('pisell-cash-counting.manual-vs-count-message'),
106
+ okText: locales.getText('pisell-cash-counting.keep-manual-amount'),
107
+ cancelText: locales.getText('pisell-cash-counting.use-count-total'),
108
+ onOk: confirmKeepManualAmount,
109
+ onCancel: confirmUseCountedTotal
110
+ }), /*#__PURE__*/React.createElement(CashCountingModal, {
111
+ ref: modalRef,
112
+ modalWidth: modalWidth,
113
+ currencyCode: currencyCode,
114
+ currencyDenominations: currencyDenominations,
115
+ decimalPlaces: decimalPlaces,
116
+ symbol: symbol,
117
+ onCancel: handleCountCancel,
118
+ onConfirm: handleCountConfirm
119
+ }));
120
+ };
121
+ export default PisellCashCounting;
@@ -0,0 +1,263 @@
1
+ .pisell-private-cash-counting {
2
+ &__field {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 10px;
6
+
7
+ &--horizontal {
8
+ flex-direction: row;
9
+ align-items: center;
10
+ flex-wrap: nowrap;
11
+
12
+ .pisell-private-cash-counting__input {
13
+ flex: 1;
14
+ min-width: 0;
15
+ }
16
+
17
+ .pisell-private-cash-counting__button {
18
+ flex-shrink: 0;
19
+ }
20
+ }
21
+ }
22
+
23
+ .pisell-lowcode-input-number-wrapper{
24
+ width: auto;
25
+ }
26
+
27
+ &__input {
28
+ input {
29
+ width: 100%;
30
+ min-width: none;
31
+ max-width: none;
32
+ }
33
+ }
34
+
35
+ &__button {
36
+ width: max-content;
37
+ }
38
+
39
+ &__modal {
40
+ display: flex;
41
+ flex-direction: column;
42
+ height: min(720px, calc(90vh - 72px));
43
+ min-height: 520px;
44
+ overflow: hidden;
45
+ }
46
+
47
+ &__modal-intro {
48
+ flex-shrink: 0;
49
+ padding: 16px 24px 12px;
50
+ border-bottom: 1px solid #eaecf0;
51
+ }
52
+
53
+ &__subtitle {
54
+ color: #667085;
55
+ font-size: 14px;
56
+ line-height: 20px;
57
+ }
58
+
59
+ &__currency {
60
+ display: inline-flex;
61
+ align-items: center;
62
+ min-height: 28px;
63
+ margin-top: 12px;
64
+ padding: 4px 10px;
65
+ border-radius: 999px;
66
+ background: #f2f4f7;
67
+ color: #344054;
68
+ font-size: 13px;
69
+ font-weight: 600;
70
+ }
71
+
72
+ &__scroll {
73
+ flex: 1;
74
+ min-height: 0;
75
+ overflow-y: auto;
76
+ padding: 20px 24px 24px;
77
+ }
78
+
79
+ &__empty {
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ min-height: 220px;
84
+ color: #98a2b3;
85
+ font-size: 14px;
86
+ }
87
+
88
+ &__section+&__section {
89
+ margin-top: 24px;
90
+ padding-top: 24px;
91
+ border-top: 1px solid #f2f4f7;
92
+ }
93
+
94
+ &__section-header {
95
+ display: flex;
96
+ align-items: center;
97
+ justify-content: space-between;
98
+ gap: 16px;
99
+ margin-bottom: 12px;
100
+ }
101
+
102
+ &__section-title {
103
+ display: flex;
104
+ align-items: center;
105
+ gap: 8px;
106
+ color: #667085;
107
+ font-size: 14px;
108
+ font-weight: 700;
109
+ letter-spacing: 0.04em;
110
+ text-transform: uppercase;
111
+ }
112
+
113
+ &__dot {
114
+ width: 8px;
115
+ height: 8px;
116
+ border-radius: 50%;
117
+ background: #635bff;
118
+
119
+ &--coin {
120
+ background: #f59e0b;
121
+ }
122
+ }
123
+
124
+ &__section-subtotal {
125
+ display: flex;
126
+ align-items: center;
127
+ gap: 10px;
128
+ color: #667085;
129
+ font-size: 14px;
130
+
131
+ strong {
132
+ color: #101828;
133
+ font-size: 15px;
134
+ }
135
+ }
136
+
137
+ &__denomination-list {
138
+ display: flex;
139
+ flex-direction: column;
140
+ gap: 12px;
141
+ }
142
+
143
+ &__denomination-row {
144
+ display: grid;
145
+ grid-template-columns: 92px minmax(150px, 220px) minmax(92px, 1fr);
146
+ align-items: center;
147
+ gap: 16px;
148
+ }
149
+
150
+ &__denomination-label {
151
+ display: inline-flex;
152
+ align-items: center;
153
+ justify-content: center;
154
+ min-width: 78px;
155
+ height: 32px;
156
+ padding: 0 12px;
157
+ border-radius: 6px;
158
+ background: #dbeafe;
159
+ color: #175cd3;
160
+ font-size: 14px;
161
+ font-weight: 700;
162
+
163
+ &--coin {
164
+ background: #fef3c7;
165
+ color: #92400e;
166
+ }
167
+ }
168
+
169
+ &__stepper {
170
+ &.numeric-stepper {
171
+ gap: 8px;
172
+ grid-template-columns: auto auto auto;
173
+ justify-content: flex-start;
174
+ width: auto;
175
+ }
176
+
177
+ .numeric-stepper-button {
178
+ width: 32px;
179
+ height: 32px;
180
+ border-radius: 6px;
181
+ }
182
+
183
+ .numeric-stepper-display {
184
+ width: 60px;
185
+ height: 32px;
186
+ max-width: 70px;
187
+ }
188
+ }
189
+
190
+ &__row-amount {
191
+ justify-self: end;
192
+ color: #98a2b3;
193
+ font-size: 15px;
194
+ font-weight: 700;
195
+ }
196
+
197
+ &__footer {
198
+ flex-shrink: 0;
199
+ padding: 20px 24px 24px;
200
+ border-top: 1px solid #eaecf0;
201
+ background: #ffffff;
202
+ box-shadow: 0 -8px 20px rgba(16, 24, 40, 0.04);
203
+ }
204
+
205
+ &__summary {
206
+ padding-bottom: 16px;
207
+ border-bottom: 1px dashed #d0d5dd;
208
+ }
209
+
210
+ &__summary-row,
211
+ &__total-row {
212
+ display: flex;
213
+ align-items: center;
214
+ justify-content: space-between;
215
+ gap: 16px;
216
+ }
217
+
218
+ &__summary-row {
219
+ color: #667085;
220
+ font-size: 15px;
221
+
222
+ +.pisell-private-cash-counting__summary-row {
223
+ margin-top: 10px;
224
+ }
225
+
226
+ strong {
227
+ color: #101828;
228
+ font-size: 16px;
229
+ }
230
+ }
231
+
232
+ &__total-row {
233
+ margin-top: 16px;
234
+ color: #101828;
235
+ font-size: 18px;
236
+ font-weight: 700;
237
+
238
+ strong {
239
+ color: #5b4be8;
240
+ font-size: 34px;
241
+ line-height: 40px;
242
+ }
243
+ }
244
+
245
+ &__actions {
246
+ display: grid;
247
+ grid-template-columns: 1fr 1fr 1fr;
248
+ gap: 12px;
249
+ margin-top: 18px;
250
+
251
+ .pisell-lowcode-btn {
252
+ margin: 0;
253
+ }
254
+ }
255
+ }
256
+
257
+ .pisell-lowcode-modal-root {
258
+ .pisell-private-cash-counting__modal-wrap {
259
+ .pisell-lowcode-modal-body {
260
+ overflow: hidden;
261
+ }
262
+ }
263
+ }