@pisell/private-materials 6.6.11 → 6.6.12

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 (71) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +1 -1
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +1 -1
  9. package/es/components/appointmentBooking/components/Voucher/index.js +22 -7
  10. package/es/components/booking/addons/index.js +3 -2
  11. package/es/components/booking/components/footer/amount.js +2 -2
  12. package/es/components/booking/components/footer/index.js +7 -0
  13. package/es/components/booking/components/footer/utils.d.ts +1 -1
  14. package/es/components/booking/components/footer/utils.js +5 -3
  15. package/es/components/booking/components/voucher/index.js +6 -0
  16. package/es/components/booking/components/voucher/index.less +4 -1
  17. package/es/components/booking/components/voucherModal/index.less +1 -0
  18. package/es/components/booking/info2/service/editService/index.js +33 -2
  19. package/es/components/checkout/components/WalletPassModule/index.js +1 -0
  20. package/es/components/checkout/components/WalletPassModule/utils.js +14 -3
  21. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  22. package/es/components/checkout/hooks/useWalletPass.js +310 -189
  23. package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  24. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +166 -145
  25. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  26. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
  27. package/es/components/pay/toC/WalletPassBlock/index.js +3 -1
  28. package/es/components/pay/toC/index.js +66 -27
  29. package/es/components/pay/toC/model.d.ts +1 -0
  30. package/es/components/pay/toC/serve.d.ts +18 -0
  31. package/es/components/pay/toC/serve.js +29 -1
  32. package/es/components/pay/toC/utils.d.ts +2 -2
  33. package/es/components/pay/toC/utils.js +4 -0
  34. package/es/components/systemSettings/registry/components/SectionList.js +5 -1
  35. package/es/components/ticketBooking/components/addServiceVariant/addService.js +7 -4
  36. package/es/plus/walletPassGallery/serve.js +2 -0
  37. package/es/pro/Login2.0/AuthModal.js +12 -4
  38. package/es/pro/Login2.0/index.less +7 -7
  39. package/lib/components/appointmentBooking/components/Voucher/index.js +10 -2
  40. package/lib/components/booking/addons/index.js +3 -2
  41. package/lib/components/booking/components/footer/amount.js +1 -1
  42. package/lib/components/booking/components/footer/index.js +9 -0
  43. package/lib/components/booking/components/footer/utils.d.ts +1 -1
  44. package/lib/components/booking/components/footer/utils.js +5 -3
  45. package/lib/components/booking/components/voucher/index.js +6 -0
  46. package/lib/components/booking/components/voucher/index.less +4 -1
  47. package/lib/components/booking/components/voucherModal/index.less +1 -0
  48. package/lib/components/booking/info2/service/editService/index.js +48 -24
  49. package/lib/components/checkout/components/WalletPassModule/index.js +1 -0
  50. package/lib/components/checkout/components/WalletPassModule/utils.js +13 -2
  51. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  52. package/lib/components/checkout/hooks/useWalletPass.js +151 -104
  53. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  54. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +90 -103
  55. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  56. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
  57. package/lib/components/pay/toC/WalletPassBlock/index.js +3 -1
  58. package/lib/components/pay/toC/index.js +52 -11
  59. package/lib/components/pay/toC/model.d.ts +1 -0
  60. package/lib/components/pay/toC/serve.d.ts +18 -0
  61. package/lib/components/pay/toC/serve.js +6 -0
  62. package/lib/components/pay/toC/utils.d.ts +2 -2
  63. package/lib/components/pay/toC/utils.js +4 -0
  64. package/lib/components/systemSettings/registry/components/SectionList.js +4 -1
  65. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +11 -7
  66. package/lib/plus/walletPassGallery/serve.js +2 -0
  67. package/lib/pro/Login2.0/AuthModal.js +15 -7
  68. package/lib/pro/Login2.0/index.less +7 -7
  69. package/package.json +2 -2
  70. package/es/components/checkout/PaymentModal.d.ts +0 -31
  71. package/lib/components/checkout/PaymentModal.d.ts +0 -31
@@ -28,6 +28,8 @@ import { PisellInput, PisellGoodPassCard, PisellText, PisellToast } from '@pisel
28
28
  import { useAppointmentBooking, useShopDiscount, useAppointmentBookingLogin, useAppointmentBookingAccount } from "../../hooks";
29
29
  import "../../../booking/components/voucher/index.less";
30
30
  import "./index.less";
31
+ import { useAppointmentBookingContext } from "../../context";
32
+ import { useDebounceFn } from 'ahooks';
31
33
  var ShopDiscountHooks = {
32
34
  onInited: 'shopDiscount:onInited',
33
35
  onDestroy: 'shopDiscount:onDestroy',
@@ -69,11 +71,19 @@ var VoucherCard = function VoucherCard(props) {
69
71
  openLoginModal = _useAppointmentBookin.openLoginModal;
70
72
  var _useAppointmentBookin2 = useAppointmentBookingAccount(),
71
73
  accountLists = _useAppointmentBookin2.accountLists;
74
+ var _useAppointmentBookin3 = useAppointmentBookingContext(),
75
+ summary = _useAppointmentBookin3.summary;
76
+ var originTotal = summary.originTotal,
77
+ total = summary.total;
72
78
  var cart = appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.cart;
73
79
  var isUserLoggedIn = useMemo(function () {
74
80
  var _utils$token, _utils$token$get;
75
81
  return !!(utils !== null && utils !== void 0 && (_utils$token = utils.token) !== null && _utils$token !== void 0 && (_utils$token$get = _utils$token.get) !== null && _utils$token$get !== void 0 && _utils$token$get.call(_utils$token)) || false;
76
82
  }, [store]);
83
+ useEffect(function () {
84
+ var shopDiscount = pisellos.getModule('shopDiscount');
85
+ shopDiscount.setOriginTotalAmount(originTotal);
86
+ }, [originTotal]);
77
87
  var availableData = useMemo(function () {
78
88
  return discountList.filter(function (item) {
79
89
  return !!item.isAvailable;
@@ -110,13 +120,18 @@ var VoucherCard = function VoucherCard(props) {
110
120
  });
111
121
  appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$b = appointmentBooking.batchUpdateCart) === null || _appointmentBooking$b === void 0 || _appointmentBooking$b.call(appointmentBooking, items);
112
122
  };
113
- var onCartChange = function onCartChange() {
114
- var _shopDiscount$setBook, _appointmentBooking$o;
115
- var products = cart === null || cart === void 0 ? void 0 : cart.getItems();
116
- shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$setBook = shopDiscount.setBookingSubject) === null || _shopDiscount$setBook === void 0 || _shopDiscount$setBook.call(shopDiscount, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 || (_appointmentBooking$o = _appointmentBooking$o.bookingSetting) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.bookingSubject);
117
- var val = shopDiscount.calcDiscount(products);
118
- batchUpdateCart(val.productList);
119
- };
123
+
124
+ // 防抖处理
125
+ var _useDebounceFn = useDebounceFn(function () {
126
+ var _shopDiscount$setBook, _appointmentBooking$o;
127
+ var products = cart === null || cart === void 0 ? void 0 : cart.getItems();
128
+ shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$setBook = shopDiscount.setBookingSubject) === null || _shopDiscount$setBook === void 0 || _shopDiscount$setBook.call(shopDiscount, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 || (_appointmentBooking$o = _appointmentBooking$o.bookingSetting) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.bookingSubject);
129
+ var val = shopDiscount.calcDiscount(products);
130
+ batchUpdateCart(val.productList);
131
+ }, {
132
+ wait: 200
133
+ }),
134
+ onCartChange = _useDebounceFn.run;
120
135
  var stringifiedHolders = useMemo(function () {
121
136
  var _ret;
122
137
  try {
@@ -60,14 +60,15 @@ export var formatProducts = function formatProducts(values) {
60
60
  discountway: 'num',
61
61
  discount_type: 'discount',
62
62
  bundle_edit: (_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.bundle_edit,
63
- product_bundle: formatProductBundle((_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 || (_item$_extend3 = _item$_extend3.other) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.bundle),
63
+ product_bundle: formatProductBundle((_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 || (_item$_extend3 = _item$_extend3.other) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.bundle, item.is_price_include_tax),
64
64
  "product_option_item": formatProductOption((_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 || (_item$_extend4 = _item$_extend4.other) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.option),
65
65
  "product_variant_id": ((_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 || (_item$_extend5 = _item$_extend5.other) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.product_variant_id) || 0,
66
66
  "source_product_price": getSourceProductPrice(item),
67
67
  "main_product_selling_price": (_getMainProductSellin = getMainProductSellingPrice(item)) !== null && _getMainProductSellin !== void 0 ? _getMainProductSellin : formatProductPrice(item),
68
68
  "calculated_original_price": formatOriginalPrice(item),
69
69
  "calculated_selling_price": formatSellingPrice(item),
70
- "tax_fee": item._extend.tax_fee
70
+ "tax_fee": item._extend.tax_fee,
71
+ is_price_include_tax: item.is_price_include_tax
71
72
  };
72
73
  });
73
74
  return arr;
@@ -625,7 +625,7 @@ var getMainProductTotal = function getMainProductTotal(item) {
625
625
  var _ref3, _ref4, _item$_extend$main_pr, _item$_extend3, _item$metadata, _item$_extend$other2, _item$_extend$other3, _item$_extend$other5;
626
626
  var total = new Decimal((_ref3 = (_ref4 = (_item$_extend$main_pr = (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.main_product_selling_price) !== null && _item$_extend$main_pr !== void 0 ? _item$_extend$main_pr : item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.main_product_selling_price) !== null && _ref4 !== void 0 ? _ref4 : item._extend.price) !== null && _ref3 !== void 0 ? _ref3 : 0);
627
627
 
628
- // 单规格
628
+ // 单规格
629
629
  if ((_item$_extend$other2 = item._extend.other) !== null && _item$_extend$other2 !== void 0 && _item$_extend$other2.option && Array.isArray((_item$_extend$other3 = item._extend.other) === null || _item$_extend$other3 === void 0 ? void 0 : _item$_extend$other3.option)) {
630
630
  var _item$_extend$other4;
631
631
  total = total.add((_item$_extend$other4 = item._extend.other) === null || _item$_extend$other4 === void 0 ? void 0 : _item$_extend$other4.option.reduce(function (t, option) {
@@ -644,7 +644,7 @@ var getMainProductTotal = function getMainProductTotal(item) {
644
644
  // 子商品价格
645
645
  var bundleItemPrice = new Decimal((_ref5 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref5 !== void 0 ? _ref5 : 0);
646
646
  // todo: 套餐子商品后不需要处理 子商品价格 - 子商品折扣金额
647
- var bundleItemTotal = bundleItemPrice.minus(discountAmount);
647
+ var bundleItemTotal = bundleItemPrice;
648
648
  total = total.add(bundleItemTotal);
649
649
  }
650
650
  }
@@ -339,6 +339,13 @@ var Footer = function Footer(props) {
339
339
  ScheduleModule: ScheduleModule
340
340
  }, getDataFromHost()));
341
341
  }, [state, isEdit]);
342
+ useEffect(function () {
343
+ window.dispatchEvent(new CustomEvent('onOriginExpectAmountWithoutDiscountChange', {
344
+ detail: {
345
+ originExpectAmountWithoutDiscount: total === null || total === void 0 ? void 0 : total.originExpectAmountWithoutDiscount
346
+ }
347
+ }));
348
+ }, [total === null || total === void 0 ? void 0 : total.originExpectAmountWithoutDiscount]);
342
349
  var orderTotalList = useMemo(function () {
343
350
  return [
344
351
  // 订单已付金额
@@ -15,7 +15,7 @@ export declare const formatProductOption: (option: any) => any;
15
15
  * @Author: zhiwei.Wang
16
16
  * @Date: 2024-02-19 09:26
17
17
  */
18
- export declare const formatProductBundle: (bundle: any) => any;
18
+ export declare const formatProductBundle: (bundle: any, is_price_include_tax: number) => any;
19
19
  /**
20
20
  * 获取子商品折扣信息
21
21
  * @param item
@@ -92,7 +92,7 @@ var log = function log(data) {
92
92
  * @Author: zhiwei.Wang
93
93
  * @Date: 2024-02-19 09:26
94
94
  */
95
- export var formatProductBundle = function formatProductBundle(bundle) {
95
+ export var formatProductBundle = function formatProductBundle(bundle, is_price_include_tax) {
96
96
  if (!bundle) {
97
97
  return;
98
98
  }
@@ -129,6 +129,7 @@ export var formatProductBundle = function formatProductBundle(bundle) {
129
129
  "option": option,
130
130
  "bundle_selling_price": Math.abs(d === null || d === void 0 ? void 0 : d.price),
131
131
  // "bundle_sum_price": d?.original_price || d?.original_total,
132
+ is_price_include_tax: is_price_include_tax,
132
133
  "metadata": {
133
134
  custom_product_bundle_map_id: d._id,
134
135
  // 子商品单数量附加费
@@ -468,7 +469,7 @@ var formatProducts = function formatProducts(item, quantity) {
468
469
  "discount_per": item._extend.discount_per,
469
470
  "discount_type": item._extend.discount_type || discount_type,
470
471
  "order_detail_id": item._extend.order_detail_id || 0,
471
- "product_bundle": formatProductBundle((_item$_extend32 = item._extend) === null || _item$_extend32 === void 0 || (_item$_extend32 = _item$_extend32.other) === null || _item$_extend32 === void 0 ? void 0 : _item$_extend32.bundle),
472
+ "product_bundle": formatProductBundle((_item$_extend32 = item._extend) === null || _item$_extend32 === void 0 || (_item$_extend32 = _item$_extend32.other) === null || _item$_extend32 === void 0 ? void 0 : _item$_extend32.bundle, item.is_price_include_tax),
472
473
  "bundle_edit": item._extend.bundle_edit || bundleDiscountList.length ? 1 : 0,
473
474
  "product_option_item": formatProductOption((_item$_extend33 = item._extend) === null || _item$_extend33 === void 0 || (_item$_extend33 = _item$_extend33.other) === null || _item$_extend33 === void 0 ? void 0 : _item$_extend33.option),
474
475
  "product_variant_id": ((_item$_extend34 = item._extend) === null || _item$_extend34 === void 0 || (_item$_extend34 = _item$_extend34.other) === null || _item$_extend34 === void 0 ? void 0 : _item$_extend34.product_variant_id) || 0,
@@ -478,7 +479,8 @@ var formatProducts = function formatProducts(item, quantity) {
478
479
  "calculated_original_price": formatOriginalPrice(item),
479
480
  "calculated_selling_price": formatSellingPrice(item),
480
481
  "tax_fee": item._extend.tax_fee,
481
- "custom_deposit_data": item.custom_deposit_data
482
+ "custom_deposit_data": item.custom_deposit_data,
483
+ is_price_include_tax: item.is_price_include_tax
482
484
  };
483
485
  };
484
486
 
@@ -152,11 +152,17 @@ var VoucherCard = function VoucherCard(props) {
152
152
  }
153
153
  onScanCode(e.detail.code);
154
154
  });
155
+ var onOriginExpectAmountWithoutDiscountChange = useMemoizedFn(function (e) {
156
+ var _shopDiscount$setOrig;
157
+ shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$setOrig = shopDiscount.setOriginTotalAmount) === null || _shopDiscount$setOrig === void 0 || _shopDiscount$setOrig.call(shopDiscount, e.detail.originExpectAmountWithoutDiscount);
158
+ });
155
159
  useEffect(function () {
156
160
  var wrappedOnScanWallPassCode = executeIfActive(onScanWallPassCode);
157
161
  window.addEventListener('onScanWallPassCode', wrappedOnScanWallPassCode);
162
+ window.addEventListener('onOriginExpectAmountWithoutDiscountChange', onOriginExpectAmountWithoutDiscountChange);
158
163
  return function () {
159
164
  window.removeEventListener('onScanWallPassCode', wrappedOnScanWallPassCode);
165
+ window.removeEventListener('onOriginExpectAmountWithoutDiscountChange', onOriginExpectAmountWithoutDiscountChange);
160
166
  };
161
167
  }, []);
162
168
  var addonsMemo = useMemo(function () {
@@ -1,5 +1,8 @@
1
1
  .pisell-lowcode__booking-footer-voucher-container {
2
2
  margin-bottom: 8px;
3
+ width: 100%;
4
+ display: flex;
5
+ flex-direction: column;
3
6
  .voucher-title {
4
7
  display: flex;
5
8
  align-items: center;
@@ -47,9 +50,9 @@
47
50
  width: 100%;
48
51
  transition: 0.2s;
49
52
  max-height: 0;
50
- overflow: hidden;
51
53
  display: flex;
52
54
  flex-direction: column;
55
+ overflow: auto;
53
56
 
54
57
  &.show {
55
58
  max-height: unset;
@@ -6,6 +6,7 @@
6
6
  .pisell-voucher-modal-content {
7
7
  max-height: 70vh;
8
8
  overflow-y: auto;
9
+ display: flex;
9
10
  }
10
11
 
11
12
  // 隐藏状态下的样式优化
@@ -48,9 +48,11 @@ import EditTabs from "../../../info/service/editService/EditTabs";
48
48
  import BookingList from "../../../info/service/editService/BookingList";
49
49
  import dayjs from "dayjs";
50
50
  import { createBookingItemsByGroup, getGroupTotalPrice } from "../../../info/service2/Group/utils";
51
+ import Decimal from 'decimal.js';
52
+ import useEngineContext from "../../../../../hooks/useEngineContext";
51
53
  var submitLock = false;
52
54
  var Info = function Info(_, ref) {
53
- 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;
55
+ var _context$appHelper, _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;
54
56
  var _Form$useForm = Form.useForm(),
55
57
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
56
58
  form = _Form$useForm2[0];
@@ -81,6 +83,9 @@ var Info = function Info(_, ref) {
81
83
  _useState6 = _slicedToArray(_useState5, 2),
82
84
  currentTab = _useState6[0],
83
85
  setCurrentTab = _useState6[1];
86
+ var context = useEngineContext();
87
+ var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
88
+ getData = _context$appHelper$ut.getData;
84
89
  useEffect(function () {
85
90
  window.openBookingEditModal = function () {
86
91
  setOpen(true);
@@ -275,7 +280,9 @@ var Info = function Info(_, ref) {
275
280
  submitLock = false;
276
281
  }, 1500);
277
282
  var _list = _toConsumableArray(state.service.value);
278
- var _item = _objectSpread(_objectSpread({}, state.service.cacheItem), {}, {
283
+ var _item = _objectSpread(_objectSpread({
284
+ is_price_include_tax: getData('is_price_include_tax')
285
+ }, state.service.cacheItem), {}, {
279
286
  autoClose: false
280
287
  });
281
288
  var _extend = _objectSpread(_objectSpread({}, _item._extend), {}, {
@@ -299,6 +306,30 @@ var Info = function Info(_, ref) {
299
306
  _extend.startDate = startDate;
300
307
  _extend.endDate = endDate;
301
308
  }
309
+ if (isChangeTotal.current) {
310
+ var _extend$other, _extend$other2;
311
+ // 计算折扣比例
312
+ var discountRatio = new Decimal(values.total).div(_item._extend.origin_total);
313
+
314
+ // 处理子商品
315
+ var _bundles = (_extend === null || _extend === void 0 || (_extend$other = _extend.other) === null || _extend$other === void 0 ? void 0 : _extend$other.bundle) || [];
316
+ var childProductsTotal = new Decimal(0);
317
+ if (_bundles.length > 0) {
318
+ _bundles.forEach(function (bundle) {
319
+ // 计算子商品折扣后的单价(保留两位小数)
320
+ var discountedPrice = new Decimal(bundle.original_price).mul(discountRatio).toDecimalPlaces(2, Decimal.ROUND_HALF_UP);
321
+ bundle.bundle_selling_price = discountedPrice.toNumber();
322
+
323
+ // 累计子商品折扣后总价
324
+ childProductsTotal = childProductsTotal.add(discountedPrice.mul(bundle.quantity));
325
+ });
326
+ }
327
+
328
+ // 计算主商品折扣后的单价
329
+ var mainProductTotal = new Decimal(values.total).sub(childProductsTotal);
330
+ var mainProductQuantity = ((_extend$other2 = _extend.other) === null || _extend$other2 === void 0 ? void 0 : _extend$other2.quantity) || _extend.quantity || 1;
331
+ _extend.main_product_selling_price = mainProductTotal.div(mainProductQuantity).toNumber();
332
+ }
302
333
  if (_extend.bundle_edit !== undefined) {
303
334
  _extend.bundle_edit = 1;
304
335
  }
@@ -25,6 +25,7 @@ var WalletPassModule = /*#__PURE__*/forwardRef(function (props, ref) {
25
25
  var _useWalletPass = useWalletPass({
26
26
  onSelectChange: onSelectChange,
27
27
  customAmount: customAmount,
28
+ totalAmount: Number(orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.totalAmount) || 0,
28
29
  clientId: clientId
29
30
  }),
30
31
  handleSelectWallet = _useWalletPass.handleSelectWallet,
@@ -11,12 +11,15 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
11
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
12
  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); }
13
13
  import React from 'react';
14
- import { formatDate, locales } from '@pisell/utils';
14
+ import { formatDate, isNumber, locales } from '@pisell/utils';
15
15
  import { globalConfig, PisellText } from "@pisell/materials";
16
16
  import Decimal from 'decimal.js';
17
17
  var Amount = PisellText.Amount;
18
18
  // 获取walletPass可用最大金额
19
19
  export var getAvailableMaxAmount = function getAvailableMaxAmount(data) {
20
+ if (isNumber(data._available_max_amount)) {
21
+ return data._available_max_amount;
22
+ }
20
23
  return data.tag !== 'point_card' ? data.available_max_amount : data === null || data === void 0 ? void 0 : data.recommended_usage_amount;
21
24
  };
22
25
  export var voucherTime = function voucherTime(data) {
@@ -32,6 +35,14 @@ export var formatMachineCodeServer2CardList = function formatMachineCodeServer2C
32
35
  var otherProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
33
36
  return (data || []).map(function (item) {
34
37
  var _item$unified_message, _item$product;
38
+ var disabled = false;
39
+ if (item.unified_available_status === 0) {
40
+ disabled = true;
41
+ } else {
42
+ if (isNumber(item._unified_available_status)) {
43
+ disabled = !item._unified_available_status;
44
+ }
45
+ }
35
46
  return _objectSpread({
36
47
  id: item.id,
37
48
  name: item.product_name,
@@ -48,8 +59,8 @@ export var formatMachineCodeServer2CardList = function formatMachineCodeServer2C
48
59
  showQrCode: false,
49
60
  showStatus: true,
50
61
  code: item.code,
51
- disabled: !item.unified_available_status,
52
- disabledReason: (_item$unified_message = item.unified_messages) === null || _item$unified_message === void 0 ? void 0 : _item$unified_message.title,
62
+ disabled: disabled,
63
+ disabledReason: isNumber(item._unified_available_status) && item._unified_available_status !== 1 ? item.reason : (_item$unified_message = item.unified_messages) === null || _item$unified_message === void 0 ? void 0 : _item$unified_message.title,
53
64
  cover: (_item$product = item.product) === null || _item$product === void 0 ? void 0 : _item$product.cover,
54
65
  qrCode: item.code,
55
66
  validDate: voucherTime(item),
@@ -9,6 +9,7 @@ export declare const useWalletPass: (props: {
9
9
  }[]) => void) | undefined;
10
10
  customAmount?: string | undefined;
11
11
  clientId?: number | undefined;
12
+ totalAmount?: number | undefined;
12
13
  }) => {
13
14
  walletRecommendList: any[];
14
15
  userIdentificationCodes: any[];
@@ -29,7 +30,6 @@ export declare const useWalletPass: (props: {
29
30
  selectedDiscountList: any;
30
31
  handleSelectDiscount: (this: unknown, value: number[], option: any) => void;
31
32
  customerName: any;
32
- fetchWalletRecommendList: (this: unknown, params: any) => Promise<any>;
33
33
  fetchUserIdentificationCodes: (this: unknown, params: any) => Promise<any>;
34
34
  getCachedWalletRecommendList: (this: unknown) => any;
35
35
  getCachedUserIdentificationCodes: (this: unknown) => any;