@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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/components/footer/amount.js +4 -3
- package/es/components/booking/components/footer/utils.js +10 -3
- package/es/components/booking/components/voucher/index.js +1 -1
- package/es/components/booking/info2/service/editService/index.js +76 -8
- package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/es/components/booking/info2/service/editService/utils.js +16 -0
- package/es/components/booking/payments/index.js +1 -1
- package/es/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/es/components/eftpos/PairModal/hooks.js +67 -0
- package/es/components/eftpos/PairModal/index.d.ts +11 -0
- package/es/components/eftpos/PairModal/index.js +246 -0
- package/es/components/eftpos/PairModal/index.less +70 -0
- package/es/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/Action.js +141 -0
- package/es/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/index.js +135 -0
- package/es/components/eftpos/SettlementModal/index.less +33 -0
- package/es/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/es/components/eftpos/SettlementModal/serve.js +171 -0
- package/es/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/es/components/eftpos/SettlementModal/types.js +35 -0
- package/es/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/es/components/eftpos/SettlementModal/utils.js +351 -0
- package/es/components/eftpos/assets/mx51SCI.svg +15 -0
- package/es/components/eftpos/const.d.ts +3 -1
- package/es/components/eftpos/const.js +2 -0
- package/es/components/eftpos/device.d.ts +3 -1
- package/es/components/eftpos/device.js +14 -3
- package/es/components/eftpos/hooks.d.ts +13 -0
- package/es/components/eftpos/hooks.js +35 -0
- package/es/components/eftpos/index.js +198 -24
- package/es/components/eftpos/index.less +32 -1
- package/es/components/eftpos/locales.d.ts +80 -0
- package/es/components/eftpos/locales.js +205 -25
- package/es/components/eftpos/table.js +47 -3
- package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.js +145 -0
- package/es/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/es/components/eftposPay/aggregatePayment/index.js +2 -1
- package/es/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/es/components/eftposPay/aggregatePayment/mock.js +567 -0
- package/es/components/eftposPay/aggregatePayment/service.js +1 -0
- package/es/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/es/components/eftposPay/aggregatePayment/types.js +4 -8
- package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +231 -168
- package/es/components/eftposPay/amount.js +15 -1
- package/es/components/eftposPay/app.js +2 -3
- package/es/components/eftposPay/component/fail/failCustom.js +13 -4
- package/es/components/eftposPay/component/fail/index.js +12 -5
- package/es/components/eftposPay/component/fail/network.js +3 -0
- package/es/components/eftposPay/component/fail/unknow.js +8 -0
- package/es/components/eftposPay/component/manual/index.js +17 -3
- package/es/components/eftposPay/component/signature/index.js +3 -0
- package/es/components/eftposPay/const.d.ts +8 -3
- package/es/components/eftposPay/const.js +2 -0
- package/es/components/eftposPay/device.js +225 -38
- package/es/components/eftposPay/helper.d.ts +3 -0
- package/es/components/eftposPay/helper.js +2 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.js +50 -13
- package/es/components/eftposPay/linkly/const.js +1 -1
- package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
- package/es/components/eftposPay/linkly/index.js +11 -23
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +30 -15
- package/es/components/eftposPay/manufacturer.d.ts +1 -0
- package/es/components/eftposPay/manufacturer.js +4 -0
- package/es/components/eftposPay/mx51/Action.d.ts +6 -0
- package/es/components/eftposPay/mx51/Action.js +144 -0
- package/es/components/eftposPay/mx51/const.d.ts +5 -0
- package/es/components/eftposPay/mx51/const.js +69 -0
- package/es/components/eftposPay/mx51/index.d.ts +6 -0
- package/es/components/eftposPay/mx51/index.js +498 -0
- package/es/components/eftposPay/mx51/types.d.ts +142 -0
- package/es/components/eftposPay/mx51/types.js +35 -0
- package/es/components/eftposPay/mx51/utils.d.ts +10 -0
- package/es/components/eftposPay/mx51/utils.js +121 -0
- package/es/components/eftposPay/pay.js +21 -9
- package/es/components/eftposPay/payo/config.js +39 -5
- package/es/components/eftposPay/payo/const.js +1 -1
- package/es/components/eftposPay/payo/hooks.js +3 -12
- package/es/components/eftposPay/payo/payment.js +69 -136
- package/es/components/eftposPay/store/index.d.ts +5 -9
- package/es/components/eftposPay/tip.js +5 -0
- package/es/components/eftposPay/tyro/const.js +1 -1
- package/es/components/eftposPay/tyro/index.js +44 -11
- package/es/components/eftposPay/utils/payLog.d.ts +81 -0
- package/es/components/eftposPay/utils/payLog.js +458 -0
- package/es/components/eftposPay/windcave/const.js +1 -1
- package/es/components/eftposPay/windcave/receiptAction.js +5 -0
- package/es/components/eftposPay/windcave/windcave.js +37 -38
- package/es/components/ticketBooking/utils/formatProductMessage.js +47 -2
- package/lib/components/booking/components/footer/amount.js +3 -3
- package/lib/components/booking/components/footer/utils.js +12 -5
- package/lib/components/booking/components/voucher/index.js +1 -1
- package/lib/components/booking/info2/service/editService/index.js +56 -5
- package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/utils.js +16 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/lib/components/eftpos/PairModal/hooks.js +70 -0
- package/lib/components/eftpos/PairModal/index.d.ts +11 -0
- package/lib/components/eftpos/PairModal/index.js +197 -0
- package/lib/components/eftpos/PairModal/index.less +70 -0
- package/lib/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/Action.js +153 -0
- package/lib/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/index.js +170 -0
- package/lib/components/eftpos/SettlementModal/index.less +33 -0
- package/lib/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/lib/components/eftpos/SettlementModal/serve.js +45 -0
- package/lib/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/lib/components/eftpos/SettlementModal/types.js +43 -0
- package/lib/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/lib/components/eftpos/SettlementModal/utils.js +248 -0
- package/lib/components/eftpos/assets/mx51SCI.svg +15 -0
- package/lib/components/eftpos/const.d.ts +3 -1
- package/lib/components/eftpos/const.js +2 -0
- package/lib/components/eftpos/device.d.ts +3 -1
- package/lib/components/eftpos/device.js +13 -3
- package/lib/components/eftpos/hooks.d.ts +13 -0
- package/lib/components/eftpos/hooks.js +30 -0
- package/lib/components/eftpos/index.js +121 -8
- package/lib/components/eftpos/index.less +32 -1
- package/lib/components/eftpos/locales.d.ts +80 -0
- package/lib/components/eftpos/locales.js +231 -21
- package/lib/components/eftpos/table.js +30 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.js +171 -0
- package/lib/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/lib/components/eftposPay/aggregatePayment/index.js +5 -2
- package/lib/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/lib/components/eftposPay/aggregatePayment/mock.js +679 -0
- package/lib/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +173 -123
- package/lib/components/eftposPay/amount.js +13 -1
- package/lib/components/eftposPay/app.js +4 -5
- package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
- package/lib/components/eftposPay/component/fail/index.js +10 -2
- package/lib/components/eftposPay/component/fail/network.js +3 -0
- package/lib/components/eftposPay/component/fail/unknow.js +8 -0
- package/lib/components/eftposPay/component/manual/index.js +16 -2
- package/lib/components/eftposPay/component/signature/index.js +3 -0
- package/lib/components/eftposPay/const.d.ts +8 -3
- package/lib/components/eftposPay/const.js +2 -0
- package/lib/components/eftposPay/device.js +114 -25
- package/lib/components/eftposPay/helper.d.ts +3 -0
- package/lib/components/eftposPay/helper.js +2 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.js +38 -13
- package/lib/components/eftposPay/linkly/const.js +1 -1
- package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
- package/lib/components/eftposPay/linkly/index.js +8 -10
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +30 -15
- package/lib/components/eftposPay/manufacturer.d.ts +1 -0
- package/lib/components/eftposPay/manufacturer.js +6 -0
- package/lib/components/eftposPay/mx51/Action.d.ts +6 -0
- package/lib/components/eftposPay/mx51/Action.js +154 -0
- package/lib/components/eftposPay/mx51/const.d.ts +5 -0
- package/lib/components/eftposPay/mx51/const.js +85 -0
- package/lib/components/eftposPay/mx51/index.d.ts +6 -0
- package/lib/components/eftposPay/mx51/index.js +433 -0
- package/lib/components/eftposPay/mx51/types.d.ts +142 -0
- package/lib/components/eftposPay/mx51/types.js +43 -0
- package/lib/components/eftposPay/mx51/utils.d.ts +10 -0
- package/lib/components/eftposPay/mx51/utils.js +115 -0
- package/lib/components/eftposPay/pay.js +13 -3
- package/lib/components/eftposPay/payo/config.js +16 -8
- package/lib/components/eftposPay/payo/const.js +1 -1
- package/lib/components/eftposPay/payo/hooks.js +12 -10
- package/lib/components/eftposPay/payo/payment.js +31 -65
- package/lib/components/eftposPay/store/index.d.ts +5 -9
- package/lib/components/eftposPay/tip.js +5 -0
- package/lib/components/eftposPay/tyro/const.js +1 -1
- package/lib/components/eftposPay/tyro/index.js +21 -17
- package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
- package/lib/components/eftposPay/utils/payLog.js +321 -0
- package/lib/components/eftposPay/windcave/const.js +1 -1
- package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
- package/lib/components/eftposPay/windcave/windcave.js +27 -29
- package/lib/components/ticketBooking/utils/formatProductMessage.js +44 -2
- package/package.json +4 -4
- package/es/components/eftposPay/utils/log/index.d.ts +0 -110
- package/es/components/eftposPay/utils/log/index.js +0 -371
- package/lib/components/eftposPay/utils/log/index.d.ts +0 -110
- 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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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 =
|
|
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
|
-
(
|
|
226
|
-
|
|
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,
|
|
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
|
-
|
|
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.
|
|
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/
|
|
65
|
-
"@pisell/
|
|
64
|
+
"@pisell/materials": "6.6.17",
|
|
65
|
+
"@pisell/utils": "3.0.2",
|
|
66
66
|
"@pisell/date-picker": "3.0.7",
|
|
67
|
-
"@pisell/
|
|
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;
|