@pisell/private-materials 6.3.181 → 6.3.182
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/eftposPay/mx51/index.js +31 -12
- package/lib/components/eftposPay/mx51/index.js +28 -8
- package/package.json +1 -1
|
@@ -31,6 +31,25 @@ import { useDispatch, updateStatus, updateCustom, updateState } from "../store";
|
|
|
31
31
|
import { useFail } from "../hooks";
|
|
32
32
|
import { getInitState } from "../manufacturer";
|
|
33
33
|
import { getPayParams } from "../helper";
|
|
34
|
+
/**
|
|
35
|
+
* @title 是否需要使用 POS 打印收据
|
|
36
|
+
* @param setting 设置
|
|
37
|
+
*/
|
|
38
|
+
var shouldPrintReceiptOnPos = function shouldPrintReceiptOnPos(setting) {
|
|
39
|
+
// 兼容老数据,明确为false才表示使用POS打印
|
|
40
|
+
if (typeof setting === 'boolean') {
|
|
41
|
+
return setting === false;
|
|
42
|
+
}
|
|
43
|
+
// 数字0表示使用POS打印
|
|
44
|
+
if (typeof setting === 'number') {
|
|
45
|
+
return setting === 0;
|
|
46
|
+
}
|
|
47
|
+
// 兼容:字符串0表示使用POS打印
|
|
48
|
+
if (typeof setting === 'string') {
|
|
49
|
+
return setting === '0';
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
};
|
|
34
53
|
var AggregatePayment = function AggregatePayment(_ref) {
|
|
35
54
|
var onChange = _ref.onChange;
|
|
36
55
|
// 设置request
|
|
@@ -244,14 +263,14 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
244
263
|
// 刷卡机的手续费
|
|
245
264
|
var card_reader_surcharge = external_service_fee || 0;
|
|
246
265
|
var deviceSetting = (_deviceRef$current = deviceRef.current) === null || _deviceRef$current === void 0 ? void 0 : _deviceRef$current.setting;
|
|
247
|
-
//
|
|
248
|
-
var
|
|
249
|
-
//
|
|
250
|
-
var
|
|
251
|
-
if (
|
|
266
|
+
// 商家小票是否需要使用 POS 打印
|
|
267
|
+
var shouldPrintMerchantReceiptOnPos = shouldPrintReceiptOnPos(deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.print_merchant_receipt);
|
|
268
|
+
// 客户小票是否需要使用 POS 打印
|
|
269
|
+
var shouldPrintCustomerReceiptOnPos = shouldPrintReceiptOnPos(deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.prompt_customer_receipt);
|
|
270
|
+
if (shouldPrintMerchantReceiptOnPos && merchant_receipt) {
|
|
252
271
|
receipt.push(merchant_receipt);
|
|
253
272
|
}
|
|
254
|
-
if (
|
|
273
|
+
if (shouldPrintCustomerReceiptOnPos && customer_receipt) {
|
|
255
274
|
receipt.push(customer_receipt);
|
|
256
275
|
}
|
|
257
276
|
dispatch(updateNextStep());
|
|
@@ -362,14 +381,14 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
362
381
|
// 刷卡机的手续费
|
|
363
382
|
var card_reader_surcharge = (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.external_unified_response) === null || _response$data === void 0 ? void 0 : _response$data.external_service_fee) || 0;
|
|
364
383
|
var deviceSetting = (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.setting;
|
|
365
|
-
//
|
|
366
|
-
var
|
|
367
|
-
//
|
|
368
|
-
var
|
|
369
|
-
if (
|
|
384
|
+
// 商家小票是否需要使用 POS 打印
|
|
385
|
+
var shouldPrintMerchantReceiptOnPos = shouldPrintReceiptOnPos(deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.print_merchant_receipt);
|
|
386
|
+
// 客户小票是否需要使用 POS 打印
|
|
387
|
+
var shouldPrintCustomerReceiptOnPos = shouldPrintReceiptOnPos(deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.prompt_customer_receipt);
|
|
388
|
+
if (shouldPrintMerchantReceiptOnPos && merchantReceipt) {
|
|
370
389
|
receipt.push(merchantReceipt);
|
|
371
390
|
}
|
|
372
|
-
if (
|
|
391
|
+
if (shouldPrintCustomerReceiptOnPos && customerReceipt) {
|
|
373
392
|
receipt.push(customerReceipt);
|
|
374
393
|
}
|
|
375
394
|
var _params2 = getPayParams({
|
|
@@ -50,6 +50,18 @@ var import_store2 = require("../store");
|
|
|
50
50
|
var import_hooks2 = require("../hooks");
|
|
51
51
|
var import_manufacturer = require("../manufacturer");
|
|
52
52
|
var import_helper = require("../helper");
|
|
53
|
+
var shouldPrintReceiptOnPos = (setting) => {
|
|
54
|
+
if (typeof setting === "boolean") {
|
|
55
|
+
return setting === false;
|
|
56
|
+
}
|
|
57
|
+
if (typeof setting === "number") {
|
|
58
|
+
return setting === 0;
|
|
59
|
+
}
|
|
60
|
+
if (typeof setting === "string") {
|
|
61
|
+
return setting === "0";
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
};
|
|
53
65
|
var AggregatePayment = ({ onChange }) => {
|
|
54
66
|
const context = (0, import_useEngineContext.default)();
|
|
55
67
|
const utils = context.appHelper.utils || {};
|
|
@@ -200,12 +212,16 @@ var AggregatePayment = ({ onChange }) => {
|
|
|
200
212
|
const { merchant_receipt, customer_receipt } = transaction || {};
|
|
201
213
|
const card_reader_surcharge = external_service_fee || 0;
|
|
202
214
|
const deviceSetting = (_b = deviceRef.current) == null ? void 0 : _b.setting;
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
215
|
+
const shouldPrintMerchantReceiptOnPos = shouldPrintReceiptOnPos(
|
|
216
|
+
deviceSetting == null ? void 0 : deviceSetting.print_merchant_receipt
|
|
217
|
+
);
|
|
218
|
+
const shouldPrintCustomerReceiptOnPos = shouldPrintReceiptOnPos(
|
|
219
|
+
deviceSetting == null ? void 0 : deviceSetting.prompt_customer_receipt
|
|
220
|
+
);
|
|
221
|
+
if (shouldPrintMerchantReceiptOnPos && merchant_receipt) {
|
|
206
222
|
receipt.push(merchant_receipt);
|
|
207
223
|
}
|
|
208
|
-
if (
|
|
224
|
+
if (shouldPrintCustomerReceiptOnPos && customer_receipt) {
|
|
209
225
|
receipt.push(customer_receipt);
|
|
210
226
|
}
|
|
211
227
|
dispatch((0, import_store.updateNextStep)());
|
|
@@ -291,12 +307,16 @@ var AggregatePayment = ({ onChange }) => {
|
|
|
291
307
|
const receipt = [];
|
|
292
308
|
const card_reader_surcharge = ((_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.external_unified_response) == null ? void 0 : _b.external_service_fee) || 0;
|
|
293
309
|
const deviceSetting = (_c = deviceRef.current) == null ? void 0 : _c.setting;
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
310
|
+
const shouldPrintMerchantReceiptOnPos = shouldPrintReceiptOnPos(
|
|
311
|
+
deviceSetting == null ? void 0 : deviceSetting.print_merchant_receipt
|
|
312
|
+
);
|
|
313
|
+
const shouldPrintCustomerReceiptOnPos = shouldPrintReceiptOnPos(
|
|
314
|
+
deviceSetting == null ? void 0 : deviceSetting.prompt_customer_receipt
|
|
315
|
+
);
|
|
316
|
+
if (shouldPrintMerchantReceiptOnPos && merchantReceipt) {
|
|
297
317
|
receipt.push(merchantReceipt);
|
|
298
318
|
}
|
|
299
|
-
if (
|
|
319
|
+
if (shouldPrintCustomerReceiptOnPos && customerReceipt) {
|
|
300
320
|
receipt.push(customerReceipt);
|
|
301
321
|
}
|
|
302
322
|
const params = (0, import_helper.getPayParams)(
|