@pisell/private-materials 6.2.48 → 6.2.50

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 (170) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +27 -3
  12. package/es/components/appointmentBooking/components/Content/index.js +3 -3
  13. package/es/components/appointmentBooking/components/Services/index.js +36 -18
  14. package/es/components/appointmentBooking/components/Voucher/index.js +6 -5
  15. package/es/components/appointmentBooking/hooks.js +10 -2
  16. package/es/components/appointmentBooking/index.js +10 -0
  17. package/es/components/booking/addons/model.d.ts +1 -10
  18. package/es/components/booking/components/footer/index.js +12 -1
  19. package/es/components/booking/editBookingModal/index.js +8 -2
  20. package/es/components/booking/forms/model.d.ts +1 -10
  21. package/es/components/booking/info/model.d.ts +1 -10
  22. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  23. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  24. package/es/components/booking/locales.d.ts +6 -0
  25. package/es/components/booking/locales.js +21 -9
  26. package/es/components/booking/model.d.ts +1 -9
  27. package/es/components/booking/notes/model.d.ts +1 -10
  28. package/es/components/booking/payments/model.d.ts +1 -10
  29. package/es/components/eftposPay/hooks.d.ts +1 -1
  30. package/es/components/eftposPay/linkly/hooks/normal.js +3 -3
  31. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +25 -4
  32. package/es/components/eftposPay/store/index.d.ts +2 -2
  33. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +34 -8
  34. package/es/components/index.d.ts +3 -1
  35. package/es/components/index.js +3 -1
  36. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
  37. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  38. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  39. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  40. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  41. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  42. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  43. package/es/components/pay/toC/model.d.ts +1 -9
  44. package/es/components/pay/toC/utils.js +1 -1
  45. package/es/components/pinModal/hooks.d.ts +7 -0
  46. package/es/components/pinModal/hooks.js +65 -0
  47. package/es/components/pinModal/index.d.ts +4 -0
  48. package/es/components/pinModal/index.js +98 -0
  49. package/es/components/pinModal/index.less +44 -0
  50. package/es/components/pinModal/locales.d.ts +27 -0
  51. package/es/components/pinModal/locales.js +26 -0
  52. package/es/components/pinModal/serve.d.ts +6 -0
  53. package/es/components/pinModal/serve.js +11 -0
  54. package/es/components/pinModal/types.d.ts +0 -0
  55. package/es/components/pinModal/types.js +0 -0
  56. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  57. package/es/components/pinVerifyModal/hooks.js +80 -0
  58. package/es/components/pinVerifyModal/index.d.ts +5 -0
  59. package/es/components/pinVerifyModal/index.js +218 -0
  60. package/es/components/pinVerifyModal/index.less +92 -0
  61. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  62. package/es/components/pinVerifyModal/locales.js +23 -0
  63. package/es/components/pinVerifyModal/types.d.ts +33 -0
  64. package/es/components/pinVerifyModal/types.js +1 -0
  65. package/es/components/ruleSetting/locales.js +3 -3
  66. package/es/components/schedules/model.d.ts +1 -9
  67. package/es/components/ticketBooking/components/ticketBooking/index.js +58 -10
  68. package/es/components/ticketBooking/components/timeBar/index.js +2 -1
  69. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  70. package/es/components/wallet/Detail/index.js +251 -63
  71. package/es/components/wallet/Detail/locales.d.ts +51 -0
  72. package/es/components/wallet/Detail/locales.js +57 -3
  73. package/es/components/wallet/Detail/model.d.ts +1 -13
  74. package/es/components/wallet/Detail/serve.js +5 -1
  75. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  76. package/es/components/wallet/PointCard/model.d.ts +1 -13
  77. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  78. package/es/components/wallet/Voucher/model.d.ts +1 -13
  79. package/es/components/wallet/components/UsageRules/index.d.ts +23 -0
  80. package/es/components/wallet/components/UsageRules/index.js +147 -0
  81. package/es/components/wallet/components/UsageRules/index.less +157 -0
  82. package/es/components/wallet/components/WalletCard.js +8 -3
  83. package/es/components/wallet/components/index.d.ts +1 -0
  84. package/es/components/wallet/components/index.js +2 -1
  85. package/es/components/wallet/model.d.ts +1 -9
  86. package/es/components/walletList/index.js +20 -2
  87. package/es/index.d.ts +2 -0
  88. package/es/index.js +3 -1
  89. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +22 -2
  90. package/lib/components/appointmentBooking/components/Content/index.js +2 -2
  91. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  92. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  93. package/lib/components/appointmentBooking/hooks.js +10 -2
  94. package/lib/components/appointmentBooking/index.js +6 -0
  95. package/lib/components/booking/addons/model.d.ts +1 -10
  96. package/lib/components/booking/components/footer/index.js +15 -2
  97. package/lib/components/booking/components/voucher/index.js +1 -3
  98. package/lib/components/booking/editBookingModal/index.js +6 -1
  99. package/lib/components/booking/forms/model.d.ts +1 -10
  100. package/lib/components/booking/info/model.d.ts +1 -10
  101. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  102. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  103. package/lib/components/booking/locales.d.ts +6 -0
  104. package/lib/components/booking/locales.js +15 -9
  105. package/lib/components/booking/model.d.ts +1 -9
  106. package/lib/components/booking/notes/model.d.ts +1 -10
  107. package/lib/components/booking/payments/model.d.ts +1 -10
  108. package/lib/components/eftposPay/hooks.d.ts +1 -1
  109. package/lib/components/eftposPay/linkly/hooks/normal.js +3 -3
  110. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +16 -4
  111. package/lib/components/eftposPay/store/index.d.ts +2 -2
  112. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +30 -8
  113. package/lib/components/index.d.ts +3 -1
  114. package/lib/components/index.js +6 -0
  115. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
  116. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  117. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  118. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  119. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  120. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  121. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  122. package/lib/components/pay/toC/model.d.ts +1 -9
  123. package/lib/components/pay/toC/utils.js +1 -1
  124. package/lib/components/pinModal/hooks.d.ts +7 -0
  125. package/lib/components/pinModal/hooks.js +85 -0
  126. package/lib/components/pinModal/index.d.ts +4 -0
  127. package/lib/components/pinModal/index.js +88 -0
  128. package/lib/components/pinModal/index.less +44 -0
  129. package/lib/components/pinModal/locales.d.ts +27 -0
  130. package/lib/components/pinModal/locales.js +50 -0
  131. package/lib/components/pinModal/serve.d.ts +6 -0
  132. package/lib/components/pinModal/serve.js +37 -0
  133. package/lib/components/pinModal/types.d.ts +0 -0
  134. package/lib/components/pinModal/types.js +0 -0
  135. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  136. package/lib/components/pinVerifyModal/hooks.js +93 -0
  137. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  138. package/lib/components/pinVerifyModal/index.js +230 -0
  139. package/lib/components/pinVerifyModal/index.less +92 -0
  140. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  141. package/lib/components/pinVerifyModal/locales.js +47 -0
  142. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  143. package/lib/components/pinVerifyModal/types.js +17 -0
  144. package/lib/components/ruleSetting/locales.js +3 -3
  145. package/lib/components/schedules/model.d.ts +1 -9
  146. package/lib/components/ticketBooking/components/ticketBooking/index.js +50 -6
  147. package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
  148. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  149. package/lib/components/wallet/Detail/index.js +140 -8
  150. package/lib/components/wallet/Detail/locales.d.ts +51 -0
  151. package/lib/components/wallet/Detail/locales.js +57 -3
  152. package/lib/components/wallet/Detail/model.d.ts +1 -13
  153. package/lib/components/wallet/Detail/serve.js +6 -1
  154. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  155. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  156. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  157. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  158. package/lib/components/wallet/components/UsageRules/index.d.ts +23 -0
  159. package/lib/components/wallet/components/UsageRules/index.js +113 -0
  160. package/lib/components/wallet/components/UsageRules/index.less +157 -0
  161. package/lib/components/wallet/components/WalletCard.js +3 -1
  162. package/lib/components/wallet/components/index.d.ts +1 -0
  163. package/lib/components/wallet/components/index.js +3 -0
  164. package/lib/components/wallet/model.d.ts +1 -9
  165. package/lib/components/walletList/index.js +19 -2
  166. package/lib/index.d.ts +2 -0
  167. package/lib/index.js +6 -0
  168. package/lowcode/pin-modal/meta.ts +37 -0
  169. package/lowcode/pin-verify-modal/meta.ts +80 -0
  170. package/package.json +3 -3
@@ -59,6 +59,7 @@ var import_utils4 = require("../bookingDataPanel/bookingList/utils");
59
59
  var import_pisellos = require("../../hooks/pisellos");
60
60
  var import_useScanManager = __toESM(require("../../hooks/pisellos/useScanManager"));
61
61
  var import_hooks = require("../../../appointmentBooking/hooks");
62
+ var import_ahooks = require("ahooks");
62
63
  var _formatBookingDetail = (data, modalState) => {
63
64
  var _a, _b, _c, _d;
64
65
  let {
@@ -277,8 +278,50 @@ var TicketBooking = () => {
277
278
  closeScan();
278
279
  };
279
280
  }, []);
281
+ const { run: clearAllCart } = (0, import_ahooks.useDebounceFn)(
282
+ (type, orderId) => {
283
+ var _a2, _b2, _c2, _d2, _e2, _f, _g, _h;
284
+ try {
285
+ _initFn(() => {
286
+ });
287
+ setState({
288
+ createCount: state.createCount + 1
289
+ });
290
+ (0, import_utils.sendWarningLog)({
291
+ title: "清空购物车",
292
+ content: [
293
+ {
294
+ key: "店铺id",
295
+ value: (_d2 = (_c2 = (_b2 = (_a2 = store == null ? void 0 : store.getState) == null ? void 0 : _a2.call(store)) == null ? void 0 : _b2.global) == null ? void 0 : _c2.globalConfig) == null ? void 0 : _d2.id
296
+ },
297
+ { key: "订单id", value: orderId },
298
+ { key: "类型", value: type }
299
+ ]
300
+ });
301
+ } catch (err) {
302
+ (0, import_utils.sendWarningLog)({
303
+ title: "清空购物车失败",
304
+ content: [
305
+ {
306
+ key: "店铺id",
307
+ value: (_h = (_g = (_f = (_e2 = store == null ? void 0 : store.getState) == null ? void 0 : _e2.call(store)) == null ? void 0 : _f.global) == null ? void 0 : _g.globalConfig) == null ? void 0 : _h.id
308
+ },
309
+ { key: "订单id", value: orderId },
310
+ { key: "类型", value: type },
311
+ { key: "error", value: err == null ? void 0 : err.message }
312
+ ]
313
+ });
314
+ }
315
+ },
316
+ {
317
+ wait: 500,
318
+ leading: true,
319
+ trailing: false
320
+ }
321
+ );
280
322
  (0, import_react.useEffect)(() => {
281
323
  var _a2, _b2, _c2, _d2, _e2;
324
+ localStorage.removeItem("bookingResourceList");
282
325
  _persistentRef.current = storage.get(`drawer-booking`) === "true" ? true : isTerminal();
283
326
  if (lowcodeRef) {
284
327
  lowcodeRef.onReady(void 0);
@@ -315,6 +358,7 @@ var TicketBooking = () => {
315
358
  console.log("bookingTicket.clearAllCart");
316
359
  _initFn(() => {
317
360
  });
361
+ _setIntervalTime(true);
318
362
  selectCustomer(null);
319
363
  enableAllScanListeners();
320
364
  (_a3 = shopDiscount == null ? void 0 : shopDiscount.clear) == null ? void 0 : _a3.call(shopDiscount);
@@ -533,7 +577,6 @@ var TicketBooking = () => {
533
577
  num: 500,
534
578
  extension_type: ["product_add_time"]
535
579
  });
536
- console.log("wwww", data);
537
580
  setState({
538
581
  addTimeProducts: (data == null ? void 0 : data.list) || []
539
582
  });
@@ -831,7 +874,6 @@ var TicketBooking = () => {
831
874
  isShowDeposit: state.isShowDeposit,
832
875
  disableEventBookingEdit: state.disableEventBookingEdit,
833
876
  list: state.list,
834
- intervalSetTime: state.intervalSetTime,
835
877
  createCount: state.createCount,
836
878
  bookingFunctions: state.bookingFunctions,
837
879
  isParallelResourcesBooking: state.isParallelResourcesBooking
@@ -937,10 +979,12 @@ var TicketBooking = () => {
937
979
  bookings: {
938
980
  booking_id: booking == null ? void 0 : booking.booking_id,
939
981
  appointment_status: booking == null ? void 0 : booking.appointment_status,
940
- list: [{
941
- start_date: booking == null ? void 0 : booking.start_date,
942
- start_time: booking == null ? void 0 : booking.start_time
943
- }]
982
+ list: [
983
+ {
984
+ start_date: booking == null ? void 0 : booking.start_date,
985
+ start_time: booking == null ? void 0 : booking.start_time
986
+ }
987
+ ]
944
988
  }
945
989
  }
946
990
  },
@@ -37,6 +37,7 @@ var import_icons = require("@ant-design/icons");
37
37
  var import_materials = require("@pisell/materials");
38
38
  var import_ahooks = require("ahooks");
39
39
  var import_antd = require("antd");
40
+ var import_dayjs = __toESM(require("dayjs"));
40
41
  var import_classnames = __toESM(require("classnames"));
41
42
  var import_utils = require("@pisell/utils");
42
43
  var import_index = require("./index.less");
@@ -74,7 +75,7 @@ var TimeBar = (props) => {
74
75
  setGlobalState({
75
76
  isTimeChange: true
76
77
  });
77
- (_d = props.setIntervalTime) == null ? void 0 : _d.call(props, false);
78
+ (_d = props.setIntervalTime) == null ? void 0 : _d.call(props, timeString === (0, import_dayjs.default)().format("HH:mm"));
78
79
  });
79
80
  return (0, import_react.useMemo)(() => {
80
81
  var _a2, _b2, _c, _d;
@@ -41,7 +41,7 @@ declare type ScanData = {
41
41
  };
42
42
  };
43
43
  export declare const formatScanCustomer: (data: ScanData) => {
44
- searchType: "customer" | "product" | "wallet" | "walletPass" | "local_product";
44
+ searchType: "wallet" | "walletPass" | "product" | "local_product" | "customer";
45
45
  data: any;
46
46
  scanCode: string;
47
47
  } | null;
@@ -67,8 +67,101 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
67
67
  expire_date = "",
68
68
  product = {}
69
69
  } = detail;
70
- const { description = "" } = product || {};
70
+ const {
71
+ description = "",
72
+ extension_data = [],
73
+ customer_order_behavior_count = 0
74
+ } = product || {};
71
75
  const context = (0, import_useEngineContext.default)();
76
+ const [extensionData, setExtensionData] = (0, import_react.useState)([]);
77
+ const [customerOrderBehaviorCount, setCustomerOrderBehaviorCount] = (0, import_react.useState)(0);
78
+ const [totalOrderBehaviorCount, setTotalOrderBehaviorCount] = (0, import_react.useState)(0);
79
+ const [todayOrderBehaviorCount, setTodayOrderBehaviorCount] = (0, import_react.useState)(0);
80
+ const [weekOrderBehaviorCount, setWeekOrderBehaviorCount] = (0, import_react.useState)(0);
81
+ const [monthOrderBehaviorCount, setMonthOrderBehaviorCount] = (0, import_react.useState)(0);
82
+ const [usageCreditsData, setUsageCreditsData] = (0, import_react.useState)(null);
83
+ const [shouldShowUsageRules, setShouldShowUsageRules] = (0, import_react.useState)(false);
84
+ const generateUsageRules = (creditsData) => {
85
+ if (!creditsData) return [];
86
+ const rules = [];
87
+ if (creditsData.max_per_day > 0) {
88
+ rules.push({
89
+ type: "daily",
90
+ limit: creditsData.max_per_day,
91
+ description: "",
92
+ // Will be filled by localized text
93
+ resetTime: ""
94
+ // Will be filled by localized text
95
+ });
96
+ }
97
+ if (creditsData.max_per_week > 0) {
98
+ rules.push({
99
+ type: "weekly",
100
+ limit: creditsData.max_per_week,
101
+ description: "",
102
+ // Will be filled by localized text
103
+ resetTime: ""
104
+ // Will be filled by localized text
105
+ });
106
+ }
107
+ if (creditsData.max_per_month > 0) {
108
+ rules.push({
109
+ type: "monthly",
110
+ limit: creditsData.max_per_month,
111
+ description: "",
112
+ // Will be filled by localized text
113
+ resetTime: ""
114
+ // Will be filled by localized text
115
+ });
116
+ }
117
+ return rules;
118
+ };
119
+ const generatePersonalLimit = (creditsData, usedCount = { totalOrderBehaviorCount: 0, customerOrderBehaviorCount: 0 }) => {
120
+ if (!creditsData) return void 0;
121
+ const totalCredits = creditsData.total_credits || 0;
122
+ const perUserLimit = creditsData.per_user_limit || 0;
123
+ let total = 0;
124
+ if (totalCredits > 0 && perUserLimit > 0) {
125
+ total = Math.min(totalCredits, perUserLimit);
126
+ } else {
127
+ total = Math.max(totalCredits, perUserLimit);
128
+ }
129
+ let total_remaining = 0;
130
+ if (totalCredits > 0) {
131
+ total_remaining = totalCredits - usedCount.totalOrderBehaviorCount;
132
+ }
133
+ let perUser_remaining = 0;
134
+ if (perUserLimit > 0) {
135
+ perUser_remaining = perUserLimit - usedCount.customerOrderBehaviorCount;
136
+ }
137
+ let remaining = 0;
138
+ if (total_remaining > 0 && perUser_remaining > 0) {
139
+ remaining = Math.min(total_remaining, perUser_remaining);
140
+ } else {
141
+ if (total_remaining === 0) {
142
+ if (totalCredits === 0) {
143
+ remaining = perUser_remaining;
144
+ } else {
145
+ remaining = 0;
146
+ }
147
+ } else {
148
+ if (perUser_remaining === 0) {
149
+ remaining = 0;
150
+ }
151
+ }
152
+ }
153
+ return {
154
+ total,
155
+ remaining,
156
+ note: ""
157
+ // Will be filled by localized text
158
+ };
159
+ };
160
+ const usageRules = generateUsageRules(usageCreditsData);
161
+ const personalLimit = generatePersonalLimit(usageCreditsData, {
162
+ totalOrderBehaviorCount,
163
+ customerOrderBehaviorCount
164
+ });
72
165
  const utils = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
73
166
  const dvaStore = (_c = (_b = utils == null ? void 0 : utils.getStore) == null ? void 0 : _b.call(utils)) == null ? void 0 : _c.getState();
74
167
  const [TimeLineData, setTimeLineData] = (0, import_react.useState)([]);
@@ -120,6 +213,7 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
120
213
  }
121
214
  };
122
215
  (0, import_react.useEffect)(() => {
216
+ var _a2;
123
217
  let data = [
124
218
  {
125
219
  label: import_utils.locales.getText("page.wallet.cardName"),
@@ -136,9 +230,10 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
136
230
  }
137
231
  ];
138
232
  if (tag === "product_discount_card") {
233
+ const isFixedAmount = ((_a2 = detail.metadata) == null ? void 0 : _a2.discount_card_type) === "fixed_amount";
139
234
  data.splice(2, 0, {
140
235
  label: import_utils.locales.getText("page.wallet.discount"),
141
- value: balance ? `${Number(balance)}%` : ""
236
+ value: balance ? isFixedAmount ? `${symbol}${Number(balance)}` : `${Number(balance)}%` : ""
142
237
  });
143
238
  } else if (tag === "point_card") {
144
239
  data.splice(2, 0, {
@@ -182,9 +277,39 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
182
277
  return isNegative ? `-${!["point_card", "good_pass"].includes(tag) ? symbol : ""}${absAmount}` : `${!["point_card", "good_pass"].includes(tag) ? symbol : ""}${amount}`;
183
278
  };
184
279
  const getDetail = async () => {
185
- const { apple_wallet_url: apple_wallet_url2 = "", google_wallet_url: google_wallet_url2 = "" } = await (0, import_serve.getDetailApi)({ id: detail.id || "" });
280
+ const {
281
+ apple_wallet_url: apple_wallet_url2 = "",
282
+ google_wallet_url: google_wallet_url2 = "",
283
+ extension_data: extension_data2 = [],
284
+ customer_order_behavior_count: customer_order_behavior_count2 = 0,
285
+ total_order_behavior_count = 0,
286
+ today_order_behavior_count = 0,
287
+ week_order_behavior_count = 0,
288
+ month_order_behavior_count = 0
289
+ } = await (0, import_serve.getDetailApi)({ id: detail.id || "" });
186
290
  setAppleWalletUrl(apple_wallet_url2);
187
291
  setGoogleWalletUrl(google_wallet_url2);
292
+ setExtensionData(extension_data2);
293
+ setCustomerOrderBehaviorCount(customer_order_behavior_count2);
294
+ setTotalOrderBehaviorCount(total_order_behavior_count);
295
+ setTodayOrderBehaviorCount(today_order_behavior_count);
296
+ setWeekOrderBehaviorCount(week_order_behavior_count);
297
+ setMonthOrderBehaviorCount(month_order_behavior_count);
298
+ if (Array.isArray(extension_data2) && extension_data2.length > 0) {
299
+ const usageCreditsItem = extension_data2.find(
300
+ (item) => item.field_key === "usage_credits"
301
+ );
302
+ if (usageCreditsItem == null ? void 0 : usageCreditsItem.value) {
303
+ setUsageCreditsData(usageCreditsItem.value);
304
+ setShouldShowUsageRules(true);
305
+ } else {
306
+ setUsageCreditsData(null);
307
+ setShouldShowUsageRules(false);
308
+ }
309
+ } else {
310
+ setUsageCreditsData(null);
311
+ setShouldShowUsageRules(false);
312
+ }
188
313
  };
189
314
  (0, import_react.useEffect)(() => {
190
315
  if (detail.id) {
@@ -274,7 +399,9 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
274
399
  throw new Error(`HTTP error! status: ${response.status}`);
275
400
  }
276
401
  const passData = await response.arrayBuffer();
277
- const blob = new Blob([passData], { type: "application/vnd.apple.pkpass" });
402
+ const blob = new Blob([passData], {
403
+ type: "application/vnd.apple.pkpass"
404
+ });
278
405
  const downloadUrl = URL.createObjectURL(blob);
279
406
  const a = document.createElement("a");
280
407
  a.href = downloadUrl;
@@ -604,10 +731,15 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
604
731
  isHasBorder: false
605
732
  }
606
733
  ),
607
- /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-card-content-tip" }, description ? (
608
- // @ts-ignore 忽略TypeScript错误,React类型定义问题
609
- /* @__PURE__ */ import_react.default.createElement("div", { dangerouslySetInnerHTML: { __html: description } })
610
- ) : null)
734
+ description && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-card-content-tip" }, /* @__PURE__ */ import_react.default.createElement("div", { dangerouslySetInnerHTML: { __html: description } })),
735
+ shouldShowUsageRules && /* @__PURE__ */ import_react.default.createElement(
736
+ import_components.UsageRules,
737
+ {
738
+ locales: import_utils.locales,
739
+ rules: usageRules,
740
+ personalLimit
741
+ }
742
+ )
611
743
  ),
612
744
  /* @__PURE__ */ import_react.default.createElement(
613
745
  "section",
@@ -29,6 +29,23 @@ declare const _default: {
29
29
  'page.wallet.openedInBrowser': string;
30
30
  'page.wallet.openFailed': string;
31
31
  'page.wallet.loading': string;
32
+ 'page.wallet.usageRules': string;
33
+ 'page.wallet.usageRulesSubtitle': string;
34
+ 'page.wallet.timeUsageLimits': string;
35
+ 'page.wallet.totalQuantityControl': string;
36
+ 'page.wallet.dailyLimit': string;
37
+ 'page.wallet.weeklyLimit': string;
38
+ 'page.wallet.monthlyLimit': string;
39
+ 'page.wallet.personalLimit': string;
40
+ 'page.wallet.dailyLimitDesc': string;
41
+ 'page.wallet.weeklyLimitDesc': string;
42
+ 'page.wallet.monthlyLimitDesc': string;
43
+ 'page.wallet.monthlyLimitUnlimited': string;
44
+ 'page.wallet.personalLimitDesc': string;
45
+ 'page.wallet.dailyReset': string;
46
+ 'page.wallet.weeklyReset': string;
47
+ 'page.wallet.monthlyReset': string;
48
+ 'page.wallet.voucherExpireNote': string;
32
49
  };
33
50
  'zh-CN': {
34
51
  'page.wallet.copyTitle': string;
@@ -60,6 +77,23 @@ declare const _default: {
60
77
  'page.wallet.openedInBrowser': string;
61
78
  'page.wallet.openFailed': string;
62
79
  'page.wallet.loading': string;
80
+ 'page.wallet.usageRules': string;
81
+ 'page.wallet.usageRulesSubtitle': string;
82
+ 'page.wallet.timeUsageLimits': string;
83
+ 'page.wallet.totalQuantityControl': string;
84
+ 'page.wallet.dailyLimit': string;
85
+ 'page.wallet.weeklyLimit': string;
86
+ 'page.wallet.monthlyLimit': string;
87
+ 'page.wallet.personalLimit': string;
88
+ 'page.wallet.dailyLimitDesc': string;
89
+ 'page.wallet.weeklyLimitDesc': string;
90
+ 'page.wallet.monthlyLimitDesc': string;
91
+ 'page.wallet.monthlyLimitUnlimited': string;
92
+ 'page.wallet.personalLimitDesc': string;
93
+ 'page.wallet.dailyReset': string;
94
+ 'page.wallet.weeklyReset': string;
95
+ 'page.wallet.monthlyReset': string;
96
+ 'page.wallet.voucherExpireNote': string;
63
97
  };
64
98
  'zh-HK': {
65
99
  'page.wallet.copyTitle': string;
@@ -91,6 +125,23 @@ declare const _default: {
91
125
  'page.wallet.openedInBrowser': string;
92
126
  'page.wallet.openFailed': string;
93
127
  'page.wallet.loading': string;
128
+ 'page.wallet.usageRules': string;
129
+ 'page.wallet.usageRulesSubtitle': string;
130
+ 'page.wallet.timeUsageLimits': string;
131
+ 'page.wallet.totalQuantityControl': string;
132
+ 'page.wallet.dailyLimit': string;
133
+ 'page.wallet.weeklyLimit': string;
134
+ 'page.wallet.monthlyLimit': string;
135
+ 'page.wallet.personalLimit': string;
136
+ 'page.wallet.dailyLimitDesc': string;
137
+ 'page.wallet.weeklyLimitDesc': string;
138
+ 'page.wallet.monthlyLimitDesc': string;
139
+ 'page.wallet.monthlyLimitUnlimited': string;
140
+ 'page.wallet.personalLimitDesc': string;
141
+ 'page.wallet.dailyReset': string;
142
+ 'page.wallet.weeklyReset': string;
143
+ 'page.wallet.monthlyReset': string;
144
+ 'page.wallet.voucherExpireNote': string;
94
145
  };
95
146
  };
96
147
  export default _default;
@@ -55,7 +55,25 @@ var locales_default = {
55
55
  "page.wallet.useAppleInstead": "You are using an iOS device, would you like to use Apple Wallet instead of Google Wallet?",
56
56
  "page.wallet.openedInBrowser": "Opened in browser",
57
57
  "page.wallet.openFailed": "Failed to open wallet link",
58
- "page.wallet.loading": "Loading wallet..."
58
+ "page.wallet.loading": "Loading wallet...",
59
+ // Usage Rules
60
+ "page.wallet.usageRules": "Terms & Conditions",
61
+ "page.wallet.usageRulesSubtitle": "Please read the following usage conditions carefully",
62
+ "page.wallet.timeUsageLimits": "Time Window Restrictions",
63
+ "page.wallet.totalQuantityControl": "Total Usage Control",
64
+ "page.wallet.dailyLimit": "Daily Limit:",
65
+ "page.wallet.weeklyLimit": "Weekly Limit:",
66
+ "page.wallet.monthlyLimit": "Monthly Limit:",
67
+ "page.wallet.personalLimit": "Personal Limit:",
68
+ "page.wallet.dailyLimitDesc": "Maximum {limit} uses from 12:00 AM to 11:59 PM each day",
69
+ "page.wallet.weeklyLimitDesc": "Maximum {limit} uses from Monday 12:00 AM to Sunday 11:59 PM",
70
+ "page.wallet.monthlyLimitDesc": "Maximum {limit} uses from 1st 12:00 AM to end of month 11:59 PM",
71
+ "page.wallet.monthlyLimitUnlimited": "Unlimited",
72
+ "page.wallet.personalLimitDesc": "You can use this voucher maximum {total} times ({remaining} remaining)",
73
+ "page.wallet.dailyReset": "Counter resets automatically at midnight",
74
+ "page.wallet.weeklyReset": "Counter resets every Monday at midnight",
75
+ "page.wallet.monthlyReset": "Counter resets on 1st of each month at midnight",
76
+ "page.wallet.voucherExpireNote": "Voucher will automatically expire when limit is reached"
59
77
  },
60
78
  "zh-CN": {
61
79
  // 简体中文翻译
@@ -89,7 +107,25 @@ var locales_default = {
89
107
  "page.wallet.useAppleInstead": "您正在使用iOS设备,是否使用Apple Wallet代替Google Wallet?",
90
108
  "page.wallet.openedInBrowser": "已在浏览器中打开",
91
109
  "page.wallet.openFailed": "打开钱包链接失败",
92
- "page.wallet.loading": "正在加载钱包..."
110
+ "page.wallet.loading": "正在加载钱包...",
111
+ // Usage Rules
112
+ "page.wallet.usageRules": "使用规则",
113
+ "page.wallet.usageRulesSubtitle": "请仔细阅读以下使用条件",
114
+ "page.wallet.timeUsageLimits": "时间使用限制",
115
+ "page.wallet.totalQuantityControl": "总量控制",
116
+ "page.wallet.dailyLimit": "每日限制:",
117
+ "page.wallet.weeklyLimit": "每周限制:",
118
+ "page.wallet.monthlyLimit": "每月限制:",
119
+ "page.wallet.personalLimit": "个人限额:",
120
+ "page.wallet.dailyLimitDesc": "每天0点-24点最多使用{limit}次",
121
+ "page.wallet.weeklyLimitDesc": "每周一0点-周日24点最多使用{limit}次",
122
+ "page.wallet.monthlyLimitDesc": "每月1号0点-月末24点最多使用{limit}次",
123
+ "page.wallet.monthlyLimitUnlimited": "无限制",
124
+ "page.wallet.personalLimitDesc": "您最多可使用此券{total}次(剩余{remaining}次)",
125
+ "page.wallet.dailyReset": "每天0点自动重置计数",
126
+ "page.wallet.weeklyReset": "每周一0点自动重置计数",
127
+ "page.wallet.monthlyReset": "每月1号0点自动重置计数",
128
+ "page.wallet.voucherExpireNote": "用完后此券将自动失效"
93
129
  },
94
130
  "zh-HK": {
95
131
  // 繁体中文翻译
@@ -123,6 +159,24 @@ var locales_default = {
123
159
  "page.wallet.useAppleInstead": "您正在使用iOS設備,是否使用Apple Wallet代替Google Wallet?",
124
160
  "page.wallet.openedInBrowser": "已在瀏覽器中打開",
125
161
  "page.wallet.openFailed": "打開錢包連結失敗",
126
- "page.wallet.loading": "正在加載錢包..."
162
+ "page.wallet.loading": "正在加載錢包...",
163
+ // Usage Rules
164
+ "page.wallet.usageRules": "使用規則",
165
+ "page.wallet.usageRulesSubtitle": "請仔細閱讀以下使用條件",
166
+ "page.wallet.timeUsageLimits": "時間使用限制",
167
+ "page.wallet.totalQuantityControl": "總量控制",
168
+ "page.wallet.dailyLimit": "每日限制:",
169
+ "page.wallet.weeklyLimit": "每週限制:",
170
+ "page.wallet.monthlyLimit": "每月限制:",
171
+ "page.wallet.personalLimit": "個人限額:",
172
+ "page.wallet.dailyLimitDesc": "每天0點-24點最多使用{limit}次",
173
+ "page.wallet.weeklyLimitDesc": "每週一0點-週日24點最多使用{limit}次",
174
+ "page.wallet.monthlyLimitDesc": "每月1號0點-月末24點最多使用{limit}次",
175
+ "page.wallet.monthlyLimitUnlimited": "無限制",
176
+ "page.wallet.personalLimitDesc": "您最多可使用此券{total}次(剩餘{remaining}次)",
177
+ "page.wallet.dailyReset": "每天0點自動重置計數",
178
+ "page.wallet.weeklyReset": "每週一0點自動重置計數",
179
+ "page.wallet.monthlyReset": "每月1號0點自動重置計數",
180
+ "page.wallet.voucherExpireNote": "用完後此券將自動失效"
127
181
  }
128
182
  };
@@ -1,13 +1 @@
1
- /// <reference types="react" />
2
- interface RechargeState {
3
- addWalletCard: any;
4
- }
5
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
- walletDetailState: RechargeState;
7
- } & {
8
- dispatch: (params: {
9
- type: string;
10
- payload: any;
11
- }) => void;
12
- }>;
13
- export {};
1
+ export declare const Provider: any, Context: any;
@@ -29,7 +29,12 @@ var getAssetList = async (params) => {
29
29
  return data;
30
30
  };
31
31
  var getDetailApi = async (params) => {
32
- const { data } = await import_utils.request.getRequest().get(`/h5/machinecode/lowcode/detail/${params.id}`, {});
32
+ const { data } = await import_utils.request.getRequest().get(`/h5/machinecode/lowcode/detail/${params.id}`, {
33
+ order_behavior_count: 1,
34
+ // 订单行为次数
35
+ order_behavior_count_customer: 1
36
+ // 客户订单行为次数
37
+ });
33
38
  return data;
34
39
  };
35
40
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,14 +1 @@
1
- /// <reference types="react" />
2
- interface RechargeState {
3
- total: number;
4
- setup?: 'menu' | 'list' | 'detail' | string;
5
- }
6
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
7
- state: RechargeState;
8
- } & {
9
- dispatch: (params: {
10
- type: string;
11
- payload: any;
12
- }) => void;
13
- }>;
14
- export {};
1
+ export declare const Provider: any, Context: any;
@@ -1,13 +1 @@
1
- /// <reference types="react" />
2
- interface RechargeState {
3
- total: number;
4
- }
5
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
- state: RechargeState;
7
- } & {
8
- dispatch: (params: {
9
- type: string;
10
- payload: any;
11
- }) => void;
12
- }>;
13
- export {};
1
+ export declare const Provider: any, Context: any;
@@ -1,29 +1 @@
1
- /// <reference types="react" />
2
- interface RechargeState {
3
- selectedGiftOptionId: string | null;
4
- cardList: Array<{
5
- id: string;
6
- name: string;
7
- price: number;
8
- }>;
9
- selectedItem: {
10
- id?: string;
11
- gift_price?: number;
12
- price?: number;
13
- name?: string;
14
- variant_id?: string;
15
- };
16
- productId?: string;
17
- detailId?: string;
18
- total: string | number;
19
- rechargeModalOpen: boolean;
20
- }
21
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
22
- state: RechargeState;
23
- } & {
24
- dispatch: (params: {
25
- type: string;
26
- payload: any;
27
- }) => void;
28
- }>;
29
- export {};
1
+ export declare const Provider: any, Context: any;
@@ -1,13 +1 @@
1
- /// <reference types="react" />
2
- interface RechargeState {
3
- total: 0;
4
- }
5
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
- state: RechargeState;
7
- } & {
8
- dispatch: (params: {
9
- type: string;
10
- payload: any;
11
- }) => void;
12
- }>;
13
- export {};
1
+ export declare const Provider: any, Context: any;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface UsageRule {
4
+ type: 'daily' | 'weekly' | 'monthly';
5
+ limit: number;
6
+ description: string;
7
+ resetTime?: string;
8
+ }
9
+ interface UsageRulesProps {
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ rules?: UsageRule[];
13
+ personalLimit?: {
14
+ total: number;
15
+ remaining: number;
16
+ note?: string;
17
+ };
18
+ locales?: {
19
+ getText: (key: string) => string;
20
+ };
21
+ }
22
+ declare function UsageRules({ className, style, rules, personalLimit, locales }: UsageRulesProps): JSX.Element;
23
+ export default UsageRules;