@pisell/private-materials 6.6.54 → 6.6.55

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 (67) hide show
  1. package/build/lowcode/render/default/view.css +1 -1
  2. package/build/lowcode/render/default/view.js +1 -1
  3. package/build/lowcode/view.css +1 -1
  4. package/build/lowcode/view.js +1 -1
  5. package/es/components/appointmentBooking/components/Voucher/index.js +22 -7
  6. package/es/components/booking/addons/index.js +3 -2
  7. package/es/components/booking/components/footer/amount.js +4 -5
  8. package/es/components/booking/components/footer/index.js +7 -0
  9. package/es/components/booking/components/footer/utils.d.ts +1 -1
  10. package/es/components/booking/components/footer/utils.js +10 -15
  11. package/es/components/booking/components/voucher/index.js +7 -1
  12. package/es/components/booking/components/voucher/index.less +4 -1
  13. package/es/components/booking/components/voucherModal/index.less +1 -0
  14. package/es/components/booking/info2/service/editService/index.js +10 -8
  15. package/es/components/booking/info2/service/editService/utils.d.ts +0 -1
  16. package/es/components/booking/info2/service/editService/utils.js +0 -16
  17. package/es/components/booking/payments/index.js +1 -1
  18. package/es/components/checkout/components/WalletPassModule/index.js +1 -0
  19. package/es/components/checkout/components/WalletPassModule/utils.d.ts +1 -0
  20. package/es/components/checkout/components/WalletPassModule/utils.js +17 -3
  21. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  22. package/es/components/checkout/hooks/useWalletPass.js +316 -192
  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/ticketBooking/components/addServiceVariant/addService.js +7 -4
  35. package/lib/components/appointmentBooking/components/Voucher/index.js +10 -2
  36. package/lib/components/booking/addons/index.js +3 -2
  37. package/lib/components/booking/components/footer/amount.js +4 -4
  38. package/lib/components/booking/components/footer/index.js +9 -0
  39. package/lib/components/booking/components/footer/utils.d.ts +1 -1
  40. package/lib/components/booking/components/footer/utils.js +10 -15
  41. package/lib/components/booking/components/voucher/index.js +7 -1
  42. package/lib/components/booking/components/voucher/index.less +4 -1
  43. package/lib/components/booking/components/voucherModal/index.less +1 -0
  44. package/lib/components/booking/info2/service/editService/index.js +24 -21
  45. package/lib/components/booking/info2/service/editService/utils.d.ts +0 -1
  46. package/lib/components/booking/info2/service/editService/utils.js +0 -16
  47. package/lib/components/booking/payments/index.js +1 -1
  48. package/lib/components/checkout/components/WalletPassModule/index.js +1 -0
  49. package/lib/components/checkout/components/WalletPassModule/utils.d.ts +1 -0
  50. package/lib/components/checkout/components/WalletPassModule/utils.js +18 -2
  51. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  52. package/lib/components/checkout/hooks/useWalletPass.js +157 -108
  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/ticketBooking/components/addServiceVariant/addService.js +11 -7
  65. package/package.json +3 -3
  66. package/es/components/booking/info/service2/utils.d.ts +0 -219
  67. package/lib/components/booking/info/service2/utils.d.ts +0 -219
@@ -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
  // 隐藏状态下的样式优化
@@ -61,12 +61,13 @@ var import_EditTabs = __toESM(require("../../../info/service/editService/EditTab
61
61
  var import_BookingList = __toESM(require("../../../info/service/editService/BookingList"));
62
62
  var import_dayjs = __toESM(require("dayjs"));
63
63
  var import_utils9 = require("../../../info/service2/Group/utils");
64
+ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
64
65
  var import_useShopDiscountModule = require("../../../../ticketBooking/hooks/pisellos/useShopDiscountModule");
65
66
  var import_DiscountChangeModal = __toESM(require("./DiscountChangeModal"));
66
67
  var import_decimal = __toESM(require("decimal.js"));
67
68
  var submitLock = false;
68
69
  var Info = (_, ref) => {
69
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K;
70
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L;
70
71
  const [form] = import_antd.Form.useForm();
71
72
  const useTotal = import_antd.Form.useWatch("total", form);
72
73
  const useResource = import_antd.Form.useWatch("resource", form);
@@ -85,6 +86,10 @@ var Info = (_, ref) => {
85
86
  const [noteModalOpen, setNoteModalOpen] = (0, import_react.useState)(false);
86
87
  const [open, setOpen] = (0, import_react.useState)(false);
87
88
  const [currentTab, setCurrentTab] = (0, import_react.useState)("batch_edit");
89
+ const context = (0, import_useEngineContext.default)();
90
+ const {
91
+ getData
92
+ } = (_a = context.appHelper) == null ? void 0 : _a.utils;
88
93
  const valuesRef = (0, import_react.useRef)({});
89
94
  const noInOriginalDiscountIdsRef = (0, import_react.useRef)([]);
90
95
  const isEditedRef = (0, import_react.useRef)(false);
@@ -102,7 +107,7 @@ var Info = (_, ref) => {
102
107
  return true;
103
108
  }
104
109
  return ((_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.cacheItem) && (0, import_utils4.isNormalProductByDurationSchedule)((_c2 = state == null ? void 0 : state.service) == null ? void 0 : _c2.cacheItem);
105
- }, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.cacheItem]);
110
+ }, [(_b = state == null ? void 0 : state.service) == null ? void 0 : _b.cacheItem]);
106
111
  const getCurrentCacheItem = (0, import_ahooks.useMemoizedFn)((_cacheItem) => {
107
112
  let values = form.getFieldsValue();
108
113
  let _item = _cacheItem || state.service.cacheItem;
@@ -132,7 +137,7 @@ var Info = (_, ref) => {
132
137
  state.service.cacheItem,
133
138
  useStartTime,
134
139
  useResource,
135
- (_d = (_c = (_b = state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.service_time
140
+ (_e = (_d = (_c = state.bookingConfig) == null ? void 0 : _c.config) == null ? void 0 : _d.basic) == null ? void 0 : _e.service_time
136
141
  ]);
137
142
  const flexibleOption = (0, import_react.useMemo)(() => {
138
143
  const op = (0, import_utils7.getFlexibleOption)({
@@ -154,7 +159,7 @@ var Info = (_, ref) => {
154
159
  durationProps,
155
160
  useStartTime,
156
161
  currentResource,
157
- (_g = (_f = (_e = state.bookingConfig) == null ? void 0 : _e.config) == null ? void 0 : _f.basic) == null ? void 0 : _g.service_time,
162
+ (_h = (_g = (_f = state.bookingConfig) == null ? void 0 : _f.config) == null ? void 0 : _g.basic) == null ? void 0 : _h.service_time,
158
163
  useDuration
159
164
  ]);
160
165
  (0, import_react.useEffect)(() => {
@@ -251,6 +256,7 @@ var Info = (_, ref) => {
251
256
  }, 1500);
252
257
  let _list = [...state.service.value];
253
258
  let _item = {
259
+ is_price_include_tax: getData("is_price_include_tax"),
254
260
  ...cacheItem ?? state.service.cacheItem,
255
261
  autoClose: false
256
262
  };
@@ -430,7 +436,7 @@ var Info = (_, ref) => {
430
436
  let oPrice = Number(((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend.origin_total) || 0);
431
437
  let cPrice = Number(useTotal || 0);
432
438
  return cPrice !== oPrice;
433
- }, [useTotal, (_i = (_h = state.service.cacheItem) == null ? void 0 : _h._extend) == null ? void 0 : _i.origin_total]);
439
+ }, [useTotal, (_j = (_i = state.service.cacheItem) == null ? void 0 : _i._extend) == null ? void 0 : _j.origin_total]);
434
440
  const getResources = () => {
435
441
  var _a2, _b2;
436
442
  let res = (0, import_utils7.formatResources)({
@@ -494,11 +500,11 @@ var Info = (_, ref) => {
494
500
  }, [state.service.editModal, state.isBookingCreatePage]);
495
501
  (0, import_react.useEffect)(() => {
496
502
  getDiscount();
497
- }, [useTotal, (_k = (_j = state.service.cacheItem) == null ? void 0 : _j._extend) == null ? void 0 : _k.origin_total]);
503
+ }, [useTotal, (_l = (_k = state.service.cacheItem) == null ? void 0 : _k._extend) == null ? void 0 : _l.origin_total]);
498
504
  const bundles = (0, import_react.useMemo)(() => {
499
505
  var _a2, _b2, _c2, _d2;
500
506
  return ((_d2 = (_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.other) == null ? void 0 : _d2.bundle) || [];
501
- }, [(_o = (_n = (_m = (_l = state.service) == null ? void 0 : _l.cacheItem) == null ? void 0 : _m._extend) == null ? void 0 : _n.other) == null ? void 0 : _o.bundle]);
507
+ }, [(_p = (_o = (_n = (_m = state.service) == null ? void 0 : _m.cacheItem) == null ? void 0 : _n._extend) == null ? void 0 : _o.other) == null ? void 0 : _p.bundle]);
502
508
  const handleEdit = (0, import_ahooks.useMemoizedFn)((e) => {
503
509
  var _a2, _b2, _c2, _d2, _e2;
504
510
  const item = state.service.cacheItem;
@@ -528,7 +534,6 @@ var Info = (_, ref) => {
528
534
  customer_id: (_e2 = (_d2 = state.client) == null ? void 0 : _d2.value) == null ? void 0 : _e2.id,
529
535
  value: {
530
536
  ...item._extend.other,
531
- bundle: (0, import_utils8.mergeBundles)(item._extend.other),
532
537
  ...sessionValue,
533
538
  quantity: values.quantity || item._extend.quantity
534
539
  }
@@ -630,7 +635,7 @@ var Info = (_, ref) => {
630
635
  }
631
636
  return false;
632
637
  }, [state.renderType, isNormalProduct]);
633
- const SelectTime = (_p = window.BaseMaterials) == null ? void 0 : _p.SelectTime;
638
+ const SelectTime = (_q = window.BaseMaterials) == null ? void 0 : _q.SelectTime;
634
639
  const isNoSpecAndPackage = (0, import_utilsByBooking.getIsNoSpecAndPackage)(state.service.cacheItem);
635
640
  const items = (0, import_react.useMemo)(() => {
636
641
  var _a2, _b2;
@@ -667,7 +672,7 @@ var Info = (_, ref) => {
667
672
  }
668
673
  ))));
669
674
  }, [
670
- (_s = (_r = (_q = state.service) == null ? void 0 : _q.cacheItem) == null ? void 0 : _r._extend) == null ? void 0 : _s.product_name,
675
+ (_t = (_s = (_r = state.service) == null ? void 0 : _r.cacheItem) == null ? void 0 : _s._extend) == null ? void 0 : _t.product_name,
671
676
  bundles,
672
677
  state.amountSymbol,
673
678
  state.isBookingCreatePage
@@ -712,7 +717,7 @@ var Info = (_, ref) => {
712
717
  ));
713
718
  }, [
714
719
  useTotal,
715
- (_u = (_t = state.service.cacheItem) == null ? void 0 : _t._extend) == null ? void 0 : _u.origin_total,
720
+ (_v = (_u = state.service.cacheItem) == null ? void 0 : _u._extend) == null ? void 0 : _v.origin_total,
716
721
  state.amountSymbol,
717
722
  state.channelDisabledEdit
718
723
  ]);
@@ -760,7 +765,7 @@ var Info = (_, ref) => {
760
765
  }
761
766
  ) : null
762
767
  ));
763
- }, [SelectTime, (_y = (_x = (_w = (_v = state.bookingConfig) == null ? void 0 : _v.config) == null ? void 0 : _w.basic) == null ? void 0 : _x.service_time) == null ? void 0 : _y.value, isEditGroup]);
768
+ }, [SelectTime, (_z = (_y = (_x = (_w = state.bookingConfig) == null ? void 0 : _w.config) == null ? void 0 : _x.basic) == null ? void 0 : _y.service_time) == null ? void 0 : _z.value, isEditGroup]);
764
769
  const endTime = (0, import_react.useMemo)(() => {
765
770
  if (!isEditGroup) {
766
771
  return null;
@@ -799,8 +804,8 @@ var Info = (_, ref) => {
799
804
  ));
800
805
  }, [
801
806
  state.renderType,
802
- (_A = (_z = state.service.cacheItem) == null ? void 0 : _z._data) == null ? void 0 : _A.resources,
803
- (_C = (_B = state.service.cacheItem) == null ? void 0 : _B._data) == null ? void 0 : _C.resourceMaps
807
+ (_B = (_A = state.service.cacheItem) == null ? void 0 : _A._data) == null ? void 0 : _B.resources,
808
+ (_D = (_C = state.service.cacheItem) == null ? void 0 : _C._data) == null ? void 0 : _D.resourceMaps
804
809
  ]);
805
810
  const holder = (0, import_react.useMemo)(() => {
806
811
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
@@ -838,7 +843,7 @@ var Info = (_, ref) => {
838
843
  }, [
839
844
  state.locale,
840
845
  state.isTerminal,
841
- (_F = (_E = (_D = state.service) == null ? void 0 : _D.cacheItem) == null ? void 0 : _E._data) == null ? void 0 : _F.capacitys
846
+ (_G = (_F = (_E = state.service) == null ? void 0 : _E.cacheItem) == null ? void 0 : _F._data) == null ? void 0 : _G.capacitys
842
847
  ]);
843
848
  const hiddenQuantity = (0, import_react.useMemo)(() => {
844
849
  return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null));
@@ -918,10 +923,10 @@ var Info = (_, ref) => {
918
923
  import_utils.locales.getText("pisell2.text.apply")
919
924
  )
920
925
  );
921
- }, [(_G = state.service.resourcesOrigin) == null ? void 0 : _G.length, isNormalProduct]);
926
+ }, [(_H = state.service.resourcesOrigin) == null ? void 0 : _H.length, isNormalProduct]);
922
927
  console.log("render edit");
923
928
  console.log(
924
- state.service.editModal && !((_H = state.service.cacheItem) == null ? void 0 : _H.autoClose),
929
+ state.service.editModal && !((_I = state.service.cacheItem) == null ? void 0 : _I.autoClose),
925
930
  performance.now() - window.pp1,
926
931
  "打开商品1"
927
932
  );
@@ -1024,8 +1029,6 @@ var Info = (_, ref) => {
1024
1029
  var _a2, _b2, _c2;
1025
1030
  delete cacheItem.discount_list;
1026
1031
  (_c2 = (_b2 = (_a2 = cacheItem._extend.other) == null ? void 0 : _a2.bundle) == null ? void 0 : _b2.forEach) == null ? void 0 : _c2.call(_b2, (bundle) => {
1027
- var _a3;
1028
- (_a3 = bundle == null ? void 0 : bundle.metadata) == null ? true : delete _a3.custom_product_bundle_map_id;
1029
1032
  bundle == null ? true : delete bundle.discount_list;
1030
1033
  bundle == null ? true : delete bundle.booking_id;
1031
1034
  bundle == null ? true : delete bundle.bundle_selling_price;
@@ -1058,7 +1061,7 @@ var Info = (_, ref) => {
1058
1061
  zIndex: state.service.changeService ? 999 : 1e3,
1059
1062
  forceRender: true,
1060
1063
  mask: state.drawerMask,
1061
- open: !isNoSpecAndPackage && state.service.editModal && !((_I = state.service.cacheItem) == null ? void 0 : _I.autoClose),
1064
+ open: !isNoSpecAndPackage && state.service.editModal && !((_J = state.service.cacheItem) == null ? void 0 : _J.autoClose),
1062
1065
  title: import_utils.locales.getText("pisell2.text.edit-service"),
1063
1066
  onClose: () => {
1064
1067
  var _a2;
@@ -1084,7 +1087,7 @@ var Info = (_, ref) => {
1084
1087
  display: currentTab === "batch_edit" ? "block" : "none"
1085
1088
  }
1086
1089
  },
1087
- /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, productName, price, reason, val && isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, startTime, endTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity, !(0, import_utils4.isNormalProductByDurationSchedule)(state.service.cacheItem) && !(0, import_utils6.isWalkIn)((_K = (_J = state.client) == null ? void 0 : _J.value) == null ? void 0 : _K.id) && holder),
1090
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, productName, price, reason, val && isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, startTime, endTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity, !(0, import_utils4.isNormalProductByDurationSchedule)(state.service.cacheItem) && !(0, import_utils6.isWalkIn)((_L = (_K = state.client) == null ? void 0 : _K.value) == null ? void 0 : _L.id) && holder),
1088
1091
  /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { noStyle: true, name: "note" }, noteModalOpen && /* @__PURE__ */ import_react.default.createElement(
1089
1092
  import_noteModal.default,
1090
1093
  {
@@ -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 返回的新数据
@@ -32,7 +32,6 @@ __export(utils_exports, {
32
32
  getAutoAllocationStorage: () => getAutoAllocationStorage,
33
33
  getProductAllDiscountList: () => getProductAllDiscountList,
34
34
  mergeBundleWithOriginalPrice: () => mergeBundleWithOriginalPrice,
35
- mergeBundles: () => mergeBundles,
36
35
  setAutoAllocationStorage: () => setAutoAllocationStorage,
37
36
  setProductPrice: () => setProductPrice
38
37
  });
@@ -97,20 +96,6 @@ var getProductAllDiscountList = (cacheItem) => {
97
96
  discountList.push(...bundleDiscountList);
98
97
  return discountList;
99
98
  };
100
- var mergeBundles = (other) => {
101
- const bundle = (other == null ? void 0 : other.bundle) || [];
102
- const newBundle = [];
103
- bundle.forEach((item) => {
104
- const newItem = newBundle.find((newItem2) => newItem2.id === item.id);
105
- if (newItem) {
106
- newItem.num += item.num || 1;
107
- newItem.quantity += item.quantity || 1;
108
- } else {
109
- newBundle.push({ ...item });
110
- }
111
- });
112
- return newBundle;
113
- };
114
99
  var mergeBundleWithOriginalPrice = (other, originalOther) => {
115
100
  var _a, _b;
116
101
  if (!((_a = other == null ? void 0 : other.bundle) == null ? void 0 : _a.length) || !((_b = originalOther == null ? void 0 : originalOther.bundle) == null ? void 0 : _b.length)) return other;
@@ -130,7 +115,6 @@ var mergeBundleWithOriginalPrice = (other, originalOther) => {
130
115
  getAutoAllocationStorage,
131
116
  getProductAllDiscountList,
132
117
  mergeBundleWithOriginalPrice,
133
- mergeBundles,
134
118
  setAutoAllocationStorage,
135
119
  setProductPrice
136
120
  });
@@ -134,7 +134,7 @@ var Payments = (0, import_model.Provider)((props) => {
134
134
  item.service_fee,
135
135
  2,
136
136
  (state == null ? void 0 : state.amountSymbol) || "$"
137
- ), ")") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-list-item-date" }, (0, import_dayjs.default)(item.payment_time || item.created_at).format(
137
+ ), ")") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-list-item-date" }, (0, import_dayjs.default)(item.payment_time).format(
138
138
  "HH:mm YYYY/MM/DD"
139
139
  ), /* @__PURE__ */ import_react.default.createElement("span", { className: "payment-list-item-platform-type" }, item.platform && import_utils.locales.getText("pisell2.text.platform.type")(
140
140
  item.platform
@@ -68,6 +68,7 @@ var WalletPassModule = (0, import_react.forwardRef)(
68
68
  } = (0, import_useWalletPass.useWalletPass)({
69
69
  onSelectChange,
70
70
  customAmount,
71
+ totalAmount: Number(orderInfo == null ? void 0 : orderInfo.totalAmount) || 0,
71
72
  clientId
72
73
  });
73
74
  const [expiredModalVisible, setExpiredModalVisible] = (0, import_react.useState)(false);
@@ -1,6 +1,7 @@
1
1
  declare type WalletPassDataType = Record<string, any>;
2
2
  export declare const getAvailableMaxAmount: (data: WalletPassDataType) => any;
3
3
  export declare const voucherTime: (data: WalletPassDataType, key?: string) => any;
4
+ export declare const getVoucherAvailableStatus: (item: any) => boolean;
4
5
  export declare const formatMachineCodeServer2CardList: (data: WalletPassDataType[], selectId?: number[], otherProps?: Record<string, any>) => any;
5
6
  export declare const formatDiscountWalletData: (data: any, selectId?: number[]) => any;
6
7
  export interface WalletPassUsageUnit {
@@ -33,6 +33,7 @@ __export(utils_exports, {
33
33
  formatMachineCodeServer2CardList: () => formatMachineCodeServer2CardList,
34
34
  getAvailableMaxAmount: () => getAvailableMaxAmount,
35
35
  getPointCardAmount: () => getPointCardAmount,
36
+ getVoucherAvailableStatus: () => getVoucherAvailableStatus,
36
37
  isSameContent: () => isSameContent,
37
38
  voucherTime: () => voucherTime
38
39
  });
@@ -43,6 +44,9 @@ var import_materials = require("@pisell/materials");
43
44
  var import_decimal = __toESM(require("decimal.js"));
44
45
  var Amount = import_materials.PisellText.Amount;
45
46
  var getAvailableMaxAmount = (data) => {
47
+ if ((0, import_utils.isNumber)(data._available_max_amount)) {
48
+ return data._available_max_amount;
49
+ }
46
50
  return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
47
51
  };
48
52
  var voucherTime = (data, key = "expire_date") => {
@@ -55,9 +59,20 @@ var voucherTime = (data, key = "expire_date") => {
55
59
  }
56
60
  return import_utils.locales.getText("pisell2.text.walletPassPermanent");
57
61
  };
62
+ var getVoucherAvailableStatus = (item) => {
63
+ return item.unified_available_status === 1 && ((0, import_utils.isNumber)(item._unified_available_status) ? !!item._unified_available_status : true);
64
+ };
58
65
  var formatMachineCodeServer2CardList = (data, selectId = [], otherProps = {}) => {
59
66
  return (data || []).map((item) => {
60
67
  var _a, _b;
68
+ let disabled = false;
69
+ if (item.unified_available_status === 0) {
70
+ disabled = true;
71
+ } else {
72
+ if ((0, import_utils.isNumber)(item._unified_available_status)) {
73
+ disabled = !item._unified_available_status;
74
+ }
75
+ }
61
76
  return {
62
77
  id: item.id,
63
78
  name: item.product_name,
@@ -74,8 +89,8 @@ var formatMachineCodeServer2CardList = (data, selectId = [], otherProps = {}) =>
74
89
  showQrCode: false,
75
90
  showStatus: true,
76
91
  code: item.code,
77
- disabled: !item.unified_available_status,
78
- disabledReason: (_a = item.unified_messages) == null ? void 0 : _a.title,
92
+ disabled,
93
+ disabledReason: (0, import_utils.isNumber)(item._unified_available_status) && item._unified_available_status !== 1 ? item.reason : (_a = item.unified_messages) == null ? void 0 : _a.title,
79
94
  cover: (_b = item.product) == null ? void 0 : _b.cover,
80
95
  qrCode: item.code,
81
96
  validDate: voucherTime(item),
@@ -153,6 +168,7 @@ var isSameContent = (arr1, arr2) => {
153
168
  formatMachineCodeServer2CardList,
154
169
  getAvailableMaxAmount,
155
170
  getPointCardAmount,
171
+ getVoucherAvailableStatus,
156
172
  isSameContent,
157
173
  voucherTime
158
174
  });
@@ -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;