@pisell/private-materials 6.4.9 → 6.4.10

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.
@@ -185,13 +185,13 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
185
185
  // 从支付方式列表中查找现金支付方式
186
186
  cashPaymentMethod = paymentMethods.find(function (method) {
187
187
  var _method$name;
188
- return method.code === 'cash' || method.type === 'cash' || ((_method$name = method.name) === null || _method$name === void 0 ? void 0 : _method$name.toLowerCase().includes('cash'));
188
+ return method.code === 'CASHMANUAL' || method.type === 'CASHMANUAL' || ((_method$name = method.name) === null || _method$name === void 0 ? void 0 : _method$name.toLowerCase().includes('cash'));
189
189
  });
190
190
  _context.next = 3;
191
191
  return checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.addPaymentItemAsync({
192
192
  amount: result.amount,
193
193
  /** 支付类型,跟支付列表上对应的支付方式保持一致 */
194
- code: result.type,
194
+ code: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.code,
195
195
  /** 支付类型id,跟支付列表上对应的支付方式保持一致 */
196
196
  id: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.id,
197
197
  /** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
@@ -532,12 +532,16 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
532
532
  }
533
533
  // 判断是否为现金支付
534
534
  var paymentMethodName = data.paymentMethodName || data.name || '';
535
- var isCashPayment = data.paymentMethodCode === 'cash' || data.paymentMethodCode === 'CASH' || /现金|現金/i.test(paymentMethodName) || /cash/i.test(paymentMethodName);
535
+ var isCashPayment = data.paymentMethodCode === 'CASHMANUAL' || /现金|現金/i.test(paymentMethodName) || /cash/i.test(paymentMethodName);
536
536
  if (isCashPayment) {
537
- var _interaction$utils, _interaction$utils$as;
537
+ var _interaction$utils, _interaction$utils$po;
538
+ logger === null || logger === void 0 || logger.addLog({
539
+ type: 'info',
540
+ title: 'open_till',
541
+ metadata: {}
542
+ });
538
543
  // handleToastClose();
539
- // TODO: 等红阳的方法
540
- interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$as = _interaction$utils.asyncDataManager) === null || _interaction$utils$as === void 0 || _interaction$utils$as.call(_interaction$utils, {
544
+ interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 || _interaction$utils$po.call(_interaction$utils, {
541
545
  module: 'till',
542
546
  key: 'open_till'
543
547
  });
@@ -1668,6 +1672,7 @@ var PaymentModal = function PaymentModal(_ref17) {
1668
1672
  console.log('print_order_onOrderSynced>>>>', responseData);
1669
1673
  try {
1670
1674
  var _responseData$payment3;
1675
+ debugger;
1671
1676
  var params = {
1672
1677
  type: '99',
1673
1678
  // 打印订单全部信息
@@ -88,7 +88,7 @@ export function CashPaymentModule(_ref) {
88
88
  }
89
89
  var finalAmount = typeof amount === 'number' ? amount : Number(amount) || 0;
90
90
  onPaymentComplete({
91
- type: 'cash',
91
+ type: 'CASHMANUAL',
92
92
  amount: finalAmount,
93
93
  totalAmount: Number(customAmount) || 0,
94
94
  change: finalAmount - (Number(customAmount) || 0),
@@ -144,13 +144,13 @@ var PaymentContent = (0, import_react.forwardRef)(
144
144
  const cashPaymentMethod = paymentMethods.find(
145
145
  (method) => {
146
146
  var _a2;
147
- return method.code === "cash" || method.type === "cash" || ((_a2 = method.name) == null ? void 0 : _a2.toLowerCase().includes("cash"));
147
+ return method.code === "CASHMANUAL" || method.type === "CASHMANUAL" || ((_a2 = method.name) == null ? void 0 : _a2.toLowerCase().includes("cash"));
148
148
  }
149
149
  );
150
150
  await (checkoutModule == null ? void 0 : checkoutModule.addPaymentItemAsync({
151
151
  amount: result.amount,
152
152
  /** 支付类型,跟支付列表上对应的支付方式保持一致 */
153
- code: result.type,
153
+ code: cashPaymentMethod == null ? void 0 : cashPaymentMethod.code,
154
154
  /** 支付类型id,跟支付列表上对应的支付方式保持一致 */
155
155
  id: cashPaymentMethod == null ? void 0 : cashPaymentMethod.id,
156
156
  /** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
@@ -427,9 +427,14 @@ var PaymentContent = (0, import_react.forwardRef)(
427
427
  );
428
428
  }
429
429
  const paymentMethodName = data.paymentMethodName || data.name || "";
430
- const isCashPayment = data.paymentMethodCode === "cash" || data.paymentMethodCode === "CASH" || /现金|現金/i.test(paymentMethodName) || /cash/i.test(paymentMethodName);
430
+ const isCashPayment = data.paymentMethodCode === "CASHMANUAL" || /现金|現金/i.test(paymentMethodName) || /cash/i.test(paymentMethodName);
431
431
  if (isCashPayment) {
432
- (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.asyncDataManager) == null ? void 0 : _b2.call(_a2, {
432
+ logger == null ? void 0 : logger.addLog({
433
+ type: "info",
434
+ title: "open_till",
435
+ metadata: {}
436
+ });
437
+ (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
433
438
  module: "till",
434
439
  key: "open_till"
435
440
  });
@@ -1237,6 +1242,7 @@ var PaymentModal = ({
1237
1242
  if (paymentStatus) {
1238
1243
  console.log("print_order_onOrderSynced>>>>", responseData);
1239
1244
  try {
1245
+ debugger;
1240
1246
  const params = {
1241
1247
  type: "99",
1242
1248
  // 打印订单全部信息
@@ -92,7 +92,7 @@ function CashPaymentModule({
92
92
  }
93
93
  const finalAmount = typeof amount === "number" ? amount : Number(amount) || 0;
94
94
  onPaymentComplete({
95
- type: "cash",
95
+ type: "CASHMANUAL",
96
96
  amount: finalAmount,
97
97
  totalAmount: Number(customAmount) || 0,
98
98
  change: finalAmount - (Number(customAmount) || 0),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.4.9",
3
+ "version": "6.4.10",
4
4
  "scripts": {
5
5
  "dev": "father dev",
6
6
  "build": "father build",