@pisell/private-materials 6.6.61 → 6.6.63

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 (203) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/booking/components/footer/amount.js +4 -3
  12. package/es/components/booking/components/footer/utils.js +10 -3
  13. package/es/components/booking/components/voucher/index.js +1 -1
  14. package/es/components/booking/info2/service/editService/index.js +76 -8
  15. package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
  16. package/es/components/booking/info2/service/editService/utils.js +16 -0
  17. package/es/components/booking/payments/index.js +1 -1
  18. package/es/components/eftpos/PairModal/hooks.d.ts +27 -0
  19. package/es/components/eftpos/PairModal/hooks.js +67 -0
  20. package/es/components/eftpos/PairModal/index.d.ts +11 -0
  21. package/es/components/eftpos/PairModal/index.js +246 -0
  22. package/es/components/eftpos/PairModal/index.less +70 -0
  23. package/es/components/eftpos/SettlementModal/Action.d.ts +7 -0
  24. package/es/components/eftpos/SettlementModal/Action.js +141 -0
  25. package/es/components/eftpos/SettlementModal/index.d.ts +7 -0
  26. package/es/components/eftpos/SettlementModal/index.js +135 -0
  27. package/es/components/eftpos/SettlementModal/index.less +33 -0
  28. package/es/components/eftpos/SettlementModal/serve.d.ts +8 -0
  29. package/es/components/eftpos/SettlementModal/serve.js +171 -0
  30. package/es/components/eftpos/SettlementModal/types.d.ts +138 -0
  31. package/es/components/eftpos/SettlementModal/types.js +35 -0
  32. package/es/components/eftpos/SettlementModal/utils.d.ts +18 -0
  33. package/es/components/eftpos/SettlementModal/utils.js +351 -0
  34. package/es/components/eftpos/assets/mx51SCI.svg +15 -0
  35. package/es/components/eftpos/const.d.ts +3 -1
  36. package/es/components/eftpos/const.js +2 -0
  37. package/es/components/eftpos/device.d.ts +3 -1
  38. package/es/components/eftpos/device.js +14 -3
  39. package/es/components/eftpos/hooks.d.ts +13 -0
  40. package/es/components/eftpos/hooks.js +35 -0
  41. package/es/components/eftpos/index.js +198 -24
  42. package/es/components/eftpos/index.less +32 -1
  43. package/es/components/eftpos/locales.d.ts +80 -0
  44. package/es/components/eftpos/locales.js +205 -25
  45. package/es/components/eftpos/table.js +47 -3
  46. package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
  47. package/es/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
  48. package/es/components/eftposPay/aggregatePayment/hooks/usePayment.js +145 -0
  49. package/es/components/eftposPay/aggregatePayment/index.d.ts +2 -1
  50. package/es/components/eftposPay/aggregatePayment/index.js +2 -1
  51. package/es/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
  52. package/es/components/eftposPay/aggregatePayment/mock.js +567 -0
  53. package/es/components/eftposPay/aggregatePayment/service.js +1 -0
  54. package/es/components/eftposPay/aggregatePayment/types.d.ts +12 -12
  55. package/es/components/eftposPay/aggregatePayment/types.js +4 -8
  56. package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
  57. package/es/components/eftposPay/aggregatePayment/utils/payment.js +231 -168
  58. package/es/components/eftposPay/amount.js +15 -1
  59. package/es/components/eftposPay/app.js +2 -3
  60. package/es/components/eftposPay/component/fail/failCustom.js +13 -4
  61. package/es/components/eftposPay/component/fail/index.js +12 -5
  62. package/es/components/eftposPay/component/fail/network.js +3 -0
  63. package/es/components/eftposPay/component/fail/unknow.js +8 -0
  64. package/es/components/eftposPay/component/manual/index.js +17 -3
  65. package/es/components/eftposPay/component/signature/index.js +3 -0
  66. package/es/components/eftposPay/const.d.ts +8 -3
  67. package/es/components/eftposPay/const.js +2 -0
  68. package/es/components/eftposPay/device.js +225 -38
  69. package/es/components/eftposPay/helper.d.ts +3 -0
  70. package/es/components/eftposPay/helper.js +2 -1
  71. package/es/components/eftposPay/hooks.d.ts +1 -1
  72. package/es/components/eftposPay/index.js +50 -13
  73. package/es/components/eftposPay/linkly/const.js +1 -1
  74. package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
  75. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
  76. package/es/components/eftposPay/linkly/index.js +11 -23
  77. package/es/components/eftposPay/locales.d.ts +15 -0
  78. package/es/components/eftposPay/locales.js +30 -15
  79. package/es/components/eftposPay/manufacturer.d.ts +1 -0
  80. package/es/components/eftposPay/manufacturer.js +4 -0
  81. package/es/components/eftposPay/mx51/Action.d.ts +6 -0
  82. package/es/components/eftposPay/mx51/Action.js +144 -0
  83. package/es/components/eftposPay/mx51/const.d.ts +5 -0
  84. package/es/components/eftposPay/mx51/const.js +69 -0
  85. package/es/components/eftposPay/mx51/index.d.ts +6 -0
  86. package/es/components/eftposPay/mx51/index.js +498 -0
  87. package/es/components/eftposPay/mx51/types.d.ts +142 -0
  88. package/es/components/eftposPay/mx51/types.js +35 -0
  89. package/es/components/eftposPay/mx51/utils.d.ts +10 -0
  90. package/es/components/eftposPay/mx51/utils.js +121 -0
  91. package/es/components/eftposPay/pay.js +21 -9
  92. package/es/components/eftposPay/payo/config.js +39 -5
  93. package/es/components/eftposPay/payo/const.js +1 -1
  94. package/es/components/eftposPay/payo/hooks.js +3 -12
  95. package/es/components/eftposPay/payo/payment.js +69 -136
  96. package/es/components/eftposPay/store/index.d.ts +5 -9
  97. package/es/components/eftposPay/tip.js +5 -0
  98. package/es/components/eftposPay/tyro/const.js +1 -1
  99. package/es/components/eftposPay/tyro/index.js +44 -11
  100. package/es/components/eftposPay/utils/payLog.d.ts +81 -0
  101. package/es/components/eftposPay/utils/payLog.js +458 -0
  102. package/es/components/eftposPay/windcave/const.js +1 -1
  103. package/es/components/eftposPay/windcave/receiptAction.js +5 -0
  104. package/es/components/eftposPay/windcave/windcave.js +37 -38
  105. package/es/components/ticketBooking/utils/formatProductMessage.js +47 -2
  106. package/lib/components/booking/components/footer/amount.js +3 -3
  107. package/lib/components/booking/components/footer/utils.js +12 -5
  108. package/lib/components/booking/components/voucher/index.js +1 -1
  109. package/lib/components/booking/info2/service/editService/index.js +56 -5
  110. package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
  111. package/lib/components/booking/info2/service/editService/utils.js +16 -0
  112. package/lib/components/booking/payments/index.js +1 -1
  113. package/lib/components/eftpos/PairModal/hooks.d.ts +27 -0
  114. package/lib/components/eftpos/PairModal/hooks.js +70 -0
  115. package/lib/components/eftpos/PairModal/index.d.ts +11 -0
  116. package/lib/components/eftpos/PairModal/index.js +197 -0
  117. package/lib/components/eftpos/PairModal/index.less +70 -0
  118. package/lib/components/eftpos/SettlementModal/Action.d.ts +7 -0
  119. package/lib/components/eftpos/SettlementModal/Action.js +153 -0
  120. package/lib/components/eftpos/SettlementModal/index.d.ts +7 -0
  121. package/lib/components/eftpos/SettlementModal/index.js +170 -0
  122. package/lib/components/eftpos/SettlementModal/index.less +33 -0
  123. package/lib/components/eftpos/SettlementModal/serve.d.ts +8 -0
  124. package/lib/components/eftpos/SettlementModal/serve.js +45 -0
  125. package/lib/components/eftpos/SettlementModal/types.d.ts +138 -0
  126. package/lib/components/eftpos/SettlementModal/types.js +43 -0
  127. package/lib/components/eftpos/SettlementModal/utils.d.ts +18 -0
  128. package/lib/components/eftpos/SettlementModal/utils.js +248 -0
  129. package/lib/components/eftpos/assets/mx51SCI.svg +15 -0
  130. package/lib/components/eftpos/const.d.ts +3 -1
  131. package/lib/components/eftpos/const.js +2 -0
  132. package/lib/components/eftpos/device.d.ts +3 -1
  133. package/lib/components/eftpos/device.js +13 -3
  134. package/lib/components/eftpos/hooks.d.ts +13 -0
  135. package/lib/components/eftpos/hooks.js +30 -0
  136. package/lib/components/eftpos/index.js +121 -8
  137. package/lib/components/eftpos/index.less +32 -1
  138. package/lib/components/eftpos/locales.d.ts +80 -0
  139. package/lib/components/eftpos/locales.js +231 -21
  140. package/lib/components/eftpos/table.js +30 -2
  141. package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
  142. package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
  143. package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.js +171 -0
  144. package/lib/components/eftposPay/aggregatePayment/index.d.ts +2 -1
  145. package/lib/components/eftposPay/aggregatePayment/index.js +5 -2
  146. package/lib/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
  147. package/lib/components/eftposPay/aggregatePayment/mock.js +679 -0
  148. package/lib/components/eftposPay/aggregatePayment/types.d.ts +12 -12
  149. package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
  150. package/lib/components/eftposPay/aggregatePayment/utils/payment.js +173 -123
  151. package/lib/components/eftposPay/amount.js +13 -1
  152. package/lib/components/eftposPay/app.js +4 -5
  153. package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
  154. package/lib/components/eftposPay/component/fail/index.js +10 -2
  155. package/lib/components/eftposPay/component/fail/network.js +3 -0
  156. package/lib/components/eftposPay/component/fail/unknow.js +8 -0
  157. package/lib/components/eftposPay/component/manual/index.js +16 -2
  158. package/lib/components/eftposPay/component/signature/index.js +3 -0
  159. package/lib/components/eftposPay/const.d.ts +8 -3
  160. package/lib/components/eftposPay/const.js +2 -0
  161. package/lib/components/eftposPay/device.js +114 -25
  162. package/lib/components/eftposPay/helper.d.ts +3 -0
  163. package/lib/components/eftposPay/helper.js +2 -1
  164. package/lib/components/eftposPay/hooks.d.ts +1 -1
  165. package/lib/components/eftposPay/index.js +38 -13
  166. package/lib/components/eftposPay/linkly/const.js +1 -1
  167. package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
  168. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
  169. package/lib/components/eftposPay/linkly/index.js +8 -10
  170. package/lib/components/eftposPay/locales.d.ts +15 -0
  171. package/lib/components/eftposPay/locales.js +30 -15
  172. package/lib/components/eftposPay/manufacturer.d.ts +1 -0
  173. package/lib/components/eftposPay/manufacturer.js +6 -0
  174. package/lib/components/eftposPay/mx51/Action.d.ts +6 -0
  175. package/lib/components/eftposPay/mx51/Action.js +154 -0
  176. package/lib/components/eftposPay/mx51/const.d.ts +5 -0
  177. package/lib/components/eftposPay/mx51/const.js +85 -0
  178. package/lib/components/eftposPay/mx51/index.d.ts +6 -0
  179. package/lib/components/eftposPay/mx51/index.js +433 -0
  180. package/lib/components/eftposPay/mx51/types.d.ts +142 -0
  181. package/lib/components/eftposPay/mx51/types.js +43 -0
  182. package/lib/components/eftposPay/mx51/utils.d.ts +10 -0
  183. package/lib/components/eftposPay/mx51/utils.js +115 -0
  184. package/lib/components/eftposPay/pay.js +13 -3
  185. package/lib/components/eftposPay/payo/config.js +16 -8
  186. package/lib/components/eftposPay/payo/const.js +1 -1
  187. package/lib/components/eftposPay/payo/hooks.js +12 -10
  188. package/lib/components/eftposPay/payo/payment.js +31 -65
  189. package/lib/components/eftposPay/store/index.d.ts +5 -9
  190. package/lib/components/eftposPay/tip.js +5 -0
  191. package/lib/components/eftposPay/tyro/const.js +1 -1
  192. package/lib/components/eftposPay/tyro/index.js +21 -17
  193. package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
  194. package/lib/components/eftposPay/utils/payLog.js +321 -0
  195. package/lib/components/eftposPay/windcave/const.js +1 -1
  196. package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
  197. package/lib/components/eftposPay/windcave/windcave.js +27 -29
  198. package/lib/components/ticketBooking/utils/formatProductMessage.js +44 -2
  199. package/package.json +4 -4
  200. package/es/components/eftposPay/utils/log/index.d.ts +0 -110
  201. package/es/components/eftposPay/utils/log/index.js +0 -371
  202. package/lib/components/eftposPay/utils/log/index.d.ts +0 -110
  203. package/lib/components/eftposPay/utils/log/index.js +0 -294
@@ -41,6 +41,7 @@ var import_hooks = require("../hooks");
41
41
  var import_store = require("../store");
42
42
  var import_const2 = require("./const");
43
43
  var import_helper2 = require("./helper");
44
+ var import_payLog = __toESM(require("../utils/payLog"));
44
45
  var import_receiptAction = __toESM(require("./receiptAction"));
45
46
  var Minute = 1e3 * 60;
46
47
  var windcave_default = ({
@@ -69,7 +70,7 @@ var windcave_default = ({
69
70
  const stepRef = (0, import_react.useRef)(custom == null ? void 0 : custom.step);
70
71
  const listRef = (0, import_react.useRef)(custom == null ? void 0 : custom.list);
71
72
  const initRef = (0, import_react.useRef)(false);
72
- const clearRef = (0, import_react.useRef)();
73
+ const clearRef = (0, import_react.useRef)(null);
73
74
  const isReceiptPage = (0, import_react.useMemo)(
74
75
  () => (custom == null ? void 0 : custom.step) === import_const2.StepStatusEnum.Receipt,
75
76
  [custom == null ? void 0 : custom.step]
@@ -144,8 +145,10 @@ var windcave_default = ({
144
145
  initRef.current = true;
145
146
  if (stepRef.current === import_const2.StepStatusEnum.Receipt) {
146
147
  if (import_const.StatusEnum.Loading === statusRef.current) {
148
+ import_payLog.default.log("Windcave:签名页面处于运行中(已发送签名,或取消签名接口),进行计时查询");
147
149
  run();
148
150
  } else {
151
+ import_payLog.default.log("Windcave:签名页面处于未加载中,进行无限查询");
149
152
  run(-1);
150
153
  }
151
154
  return;
@@ -155,7 +158,6 @@ var windcave_default = ({
155
158
  run();
156
159
  return;
157
160
  }
158
- console.log("modeRef.current = ", modeRef.current);
159
161
  numRef.current = (0, import_helper.getUuid)();
160
162
  dispatch(
161
163
  (0, import_store.updateState)({
@@ -167,16 +169,16 @@ var windcave_default = ({
167
169
  if (isPay) {
168
170
  _params = {
169
171
  ...(custom == null ? void 0 : custom.platform) ? {
170
- "operator_id": custom.operator_id,
171
- "operator_type": custom.operator_type,
172
- "platform": custom.platform,
173
- "custom_payment_id": custom.custom_payment_id,
174
- "service_charge": {
175
- "amount": payRef.current.surMoney,
176
- "percentage": payRef.current.surPercentRate
177
- },
178
- "original_amount": payRef.current.amount
172
+ operator_id: custom.operator_id,
173
+ operator_type: custom.operator_type,
174
+ platform: custom.platform,
175
+ custom_payment_id: custom.custom_payment_id
179
176
  } : {},
177
+ service_charge: {
178
+ amount: payRef.current.surMoney,
179
+ percentage: payRef.current.surPercentRate
180
+ },
181
+ original_amount: payRef.current.amount,
180
182
  order_id: orderIdRef.current,
181
183
  amount: payRef.current.total,
182
184
  card_reader_type: eftposRef.current,
@@ -212,24 +214,25 @@ var windcave_default = ({
212
214
  )
213
215
  };
214
216
  }
217
+ import_payLog.default.setContext({ transactionNumber: numRef.current });
218
+ if (isPay) {
219
+ import_payLog.default.log("Windcave:发起支付", { number: numRef.current });
220
+ } else {
221
+ import_payLog.default.log("Windcave:发起退款", { number: numRef.current });
222
+ }
215
223
  const resultPromise = isPay ? api.pay(_params, { signal: controllerRef.current.signal }) : api.refund(_params, { signal: controllerRef.current.signal });
216
224
  resultPromise.then((res) => {
217
- var _a2, _b2;
225
+ var _a2, _b2, _c;
218
226
  if (unloadRef.current || !netRef.current) {
219
227
  return;
220
228
  }
221
229
  if (res && `${res.code}` === "200" && res.data && res.data.txn_status_id) {
222
- (_a2 = validateRef.current) == null ? void 0 : _a2.call(validateRef, res, true);
230
+ import_payLog.default.log("Windcave:接口成功,进入轮询", { txn_status_id: (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.txn_status_id });
231
+ (_b2 = validateRef.current) == null ? void 0 : _b2.call(validateRef, res, true);
223
232
  return;
224
233
  }
225
- (0, import_utils.sendWarningLog)({
226
- title: "windcave支付失败",
227
- content: [
228
- { key: "res", value: JSON.stringify(res) },
229
- { key: "params", value: JSON.stringify(_params) }
230
- ]
231
- });
232
- (_b2 = failRef.current) == null ? void 0 : _b2.call(
234
+ import_payLog.default.log("Windcave:支付接口返回失败", { code: res == null ? void 0 : res.code });
235
+ (_c = failRef.current) == null ? void 0 : _c.call(
233
236
  failRef,
234
237
  res,
235
238
  stepRef.current >= import_const2.StepStatusEnum.Account
@@ -237,14 +240,7 @@ var windcave_default = ({
237
240
  }).catch((res) => {
238
241
  var _a2;
239
242
  let isNoNet = unloadRef.current || !netRef.current;
240
- (0, import_utils.sendWarningLog)({
241
- title: "windcave支付失败",
242
- content: [
243
- { key: "error", value: JSON.stringify(res) },
244
- { key: "params", value: JSON.stringify(_params) },
245
- { key: "isNoNet", value: isNoNet ? "1" : "0" }
246
- ]
247
- });
243
+ import_payLog.default.log("Windcave:支付接口异常", { error: res == null ? void 0 : res.message, isNoNet });
248
244
  if (isNoNet) {
249
245
  return;
250
246
  }
@@ -257,6 +253,7 @@ var windcave_default = ({
257
253
  return;
258
254
  }, [api, run, dispatch]);
259
255
  const onCancel = () => {
256
+ import_payLog.default.log("Windcave:点击取消支付");
260
257
  setDisabled(true);
261
258
  api.update({
262
259
  type: "CANCEL",
@@ -276,6 +273,7 @@ var windcave_default = ({
276
273
  );
277
274
  const onChangeReceipt = (status2) => {
278
275
  if (status2) {
276
+ import_payLog.default.log("Windcave:签名状态");
279
277
  run();
280
278
  }
281
279
  };
@@ -24,7 +24,21 @@ __export(formatProductMessage_exports, {
24
24
  module.exports = __toCommonJS(formatProductMessage_exports);
25
25
  var import_utils = require("@pisell/utils");
26
26
  var import_formatTime = require("./formatTime");
27
+ var import_utils2 = require("@pisell/utils");
28
+ var UNIT_LABEL = {
29
+ KILOGRAMS: "kg",
30
+ GRAMS: "g",
31
+ POUNDS: "lb",
32
+ OUNCES: "oz"
33
+ };
34
+ var DEFAULT_WEIGHT_PRECISION = 3;
35
+ var formatWeightValue = (value) => {
36
+ const parsedValue = Number(value);
37
+ const displayValue = Number.isFinite(parsedValue) ? parsedValue : 0;
38
+ return displayValue.toFixed(DEFAULT_WEIGHT_PRECISION);
39
+ };
27
40
  var formatProductMessage = (product, utils) => {
41
+ var _a, _b;
28
42
  const {
29
43
  product_option_string,
30
44
  options,
@@ -64,6 +78,28 @@ var formatProductMessage = (product, utils) => {
64
78
  }
65
79
  });
66
80
  }
81
+ const weighing = (_b = (_a = product == null ? void 0 : product._origin) == null ? void 0 : _a._extend) == null ? void 0 : _b.weighing;
82
+ if (weighing) {
83
+ const { mode, unit_price, unit, weight, tare, net_weight } = weighing;
84
+ const unitLabel = UNIT_LABEL[unit] || unit;
85
+ const weightText = formatWeightValue(weight);
86
+ const tareText = formatWeightValue(tare == null ? void 0 : tare.value);
87
+ const netWeightText = formatWeightValue(net_weight);
88
+ const tareValue = Number((tare == null ? void 0 : tare.value) || 0);
89
+ const isManualWeight = mode === "manual";
90
+ const unitPriceText = `${currency_symbol || ""}${unit_price ?? "0.00"}`;
91
+ const manualPrefix = isManualWeight ? "(M) " : "";
92
+ if (tareValue > 0) {
93
+ str += `${manualPrefix}${import_utils2.locales.getText("pisell2.cart.sku-card.weighing.gross")}: ${weightText} ${unitLabel}
94
+ `;
95
+ }
96
+ if (tareValue > 0) {
97
+ str += `${import_utils2.locales.getText("pisell2.cart.sku-card.weighing.tare")}: ${tareText} ${UNIT_LABEL[tare == null ? void 0 : tare.unit] || (tare == null ? void 0 : tare.unit) || unitLabel}
98
+ `;
99
+ }
100
+ str += `${tareValue > 0 ? "" : manualPrefix}${netWeightText} ${unitLabel} ${import_utils2.locales.getText("pisell2.cart.sku-card.weighing.net")} @ ${unitPriceText}/${unitLabel}
101
+ `;
102
+ }
67
103
  if (product_option_string) str += `${product_option_string}
68
104
  `;
69
105
  if (Array.isArray(options) && options.length) {
@@ -74,9 +110,15 @@ var formatProductMessage = (product, utils) => {
74
110
  }
75
111
  if (Array.isArray(bundle) && bundle.length) {
76
112
  bundle.forEach((item) => {
77
- str += `${item.title}
113
+ str += `${item.title} ${(0, import_utils.formatAmount)(item.price, 2, currency_symbol)} x ${item.num}
114
+ `;
115
+ const bundleOptions = item == null ? void 0 : item.options;
116
+ if (Array.isArray(bundleOptions) && bundleOptions.length) {
117
+ bundleOptions.forEach((opt) => {
118
+ str += ` ${opt == null ? void 0 : opt.name} ${(0, import_utils.formatAmount)(opt == null ? void 0 : opt.price, 2, currency_symbol)} x ${opt == null ? void 0 : opt.num}
78
119
  `;
79
- str += `${(0, import_utils.formatAmount)(item.price, 2, currency_symbol)} x ${item.num}`;
120
+ });
121
+ }
80
122
  });
81
123
  }
82
124
  return str;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.6.61",
3
+ "version": "6.6.63",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -61,10 +61,10 @@
61
61
  "styled-components": "^6.0.0-rc.3",
62
62
  "@react-spring/web": "^9.6.1",
63
63
  "@use-gesture/react": "^10.3.1",
64
- "@pisell/icon": "0.0.11",
65
- "@pisell/materials": "6.6.16",
64
+ "@pisell/materials": "6.6.17",
65
+ "@pisell/utils": "3.0.2",
66
66
  "@pisell/date-picker": "3.0.7",
67
- "@pisell/utils": "3.0.2"
67
+ "@pisell/icon": "0.0.11"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "^18.0.0",
@@ -1,110 +0,0 @@
1
- export interface LogEntry {
2
- /** 日志标题 */
3
- title: string;
4
- /** 日志内容 */
5
- content?: any;
6
- /** 支付时间(精确到毫秒) */
7
- time: string;
8
- }
9
- interface PaymentLogRecord {
10
- /** 交易记录号 */
11
- number: string;
12
- /** 订单ID */
13
- orderId?: string | number;
14
- /** 设备ID */
15
- deviceId?: string | number;
16
- /** 支付类型 */
17
- paymentType?: string;
18
- /** 创建时间 */
19
- createdAt: string;
20
- /** 日志条目列表 */
21
- logs: LogEntry[];
22
- }
23
- declare class PaymentLogInstance {
24
- private static instance;
25
- /** 当前交易记录号 */
26
- private currentNumber;
27
- /** 当前日志记录 */
28
- private currentRecord;
29
- private constructor();
30
- /**
31
- * 获取单例实例
32
- */
33
- static getInstance(): PaymentLogInstance;
34
- /**
35
- * 初始化支付日志
36
- * @param number 交易记录号
37
- * @param options 初始化选项
38
- */
39
- init(number: string, options?: {
40
- orderId?: string | number;
41
- deviceId?: string | number;
42
- paymentType?: string;
43
- [key: string]: any;
44
- }): void;
45
- /**
46
- * 添加日志条目
47
- * @param title 日志标题
48
- * @param content 日志内容
49
- */
50
- addLog(params: {
51
- title: string;
52
- content?: any;
53
- }): void;
54
- /**
55
- * 构建日志内容
56
- * @param record 日志记录
57
- * @returns 格式化的日志内容数组
58
- */
59
- private buildLogContent;
60
- /**
61
- * 发送单条日志记录到飞书
62
- * @param record 日志记录
63
- * @param isRestore 是否是恢复上传
64
- */
65
- private sendLogRecord;
66
- /**
67
- * 发送日志到飞书
68
- * @param title 日志标题(可选,仅在需要自定义标题时使用)
69
- */
70
- sendLogs(title?: string): void;
71
- /**
72
- * 清除当前日志
73
- * @param shouldSend 清除前是否发送到飞书,默认为 true
74
- */
75
- clearLogs(shouldSend?: boolean): void;
76
- /**
77
- * 检查并上传旧日志
78
- */
79
- private checkAndUploadOldLogs;
80
- /**
81
- * 获取所有支付日志对象
82
- */
83
- private getAllLogsObject;
84
- /**
85
- * 保存所有支付日志对象
86
- */
87
- private saveAllLogsObject;
88
- /**
89
- * 保存到 localStorage
90
- */
91
- private saveToLocalStorage;
92
- /**
93
- * 从 localStorage 中删除
94
- */
95
- private removeFromLocalStorage;
96
- /**
97
- * 获取所有旧日志
98
- */
99
- private getOldLogsFromLocalStorage;
100
- /**
101
- * 获取当前日志记录(用于调试)
102
- */
103
- getCurrentRecord(): PaymentLogRecord | null;
104
- /**
105
- * 获取当前交易号(用于调试)
106
- */
107
- getCurrentNumber(): string | null;
108
- }
109
- declare const paymentLog: PaymentLogInstance;
110
- export default paymentLog;