tplus-components-touch 3.37.1 → 3.38.2

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.
@@ -5,10 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Member = exports.PayMode = exports.default = undefined;
7
7
 
8
- var _isInteger = require('babel-runtime/core-js/number/is-integer');
9
-
10
- var _isInteger2 = _interopRequireDefault(_isInteger);
11
-
12
8
  var _defineProperty = require('babel-runtime/core-js/object/define-property');
13
9
 
14
10
  var _defineProperty2 = _interopRequireDefault(_defineProperty);
@@ -172,6 +168,7 @@ var SettlementStore = (_class = function () {
172
168
  (0, _classCallCheck3.default)(this, SettlementStore);
173
169
  this.paymode = null;
174
170
  this.dto = null;
171
+ this.dtoParams = null;
175
172
  this.member = null;
176
173
  this.brefund = false;
177
174
  this.bquick = false;
@@ -237,8 +234,6 @@ var SettlementStore = (_class = function () {
237
234
  var promoVoucher = {};
238
235
  _this2.paymode.clearDjqs();
239
236
  _this2.paymode.reCalculationDjqs();
240
- // promoVoucher.bizDate = dto.VoucherDate;
241
- // promoVoucher.bizDate = new Date().getTime();
242
237
  promoVoucher.coupon_code = coupon_code || "";
243
238
  promoVoucher.boName = "Retail";
244
239
  promoVoucher.voucherId = dto.ID;
@@ -325,11 +320,7 @@ var SettlementStore = (_class = function () {
325
320
  _message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
326
321
  } else {
327
322
  var IsEnable = couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
328
-
329
- var _ref2 = _mutantsUtil.platform || {},
330
- isNewRetailBCPos = _ref2.isNewRetailBCPos;
331
-
332
- _this2.addDjq(couponCode, name, IsEnable, promoMethodEnum == "CASH_COUPON" ? nominalAmount : promoDiscount, condValue, null, false, !result.IsRepelWithPoints, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, true, 1);
323
+ _this2.addDjq(couponCode, name, IsEnable, promoMethodEnum == "CASH_COUPON" && nominalAmount, promoDiscount, condValue, null, false, !result.IsRepelWithPoints, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, true, 1);
333
324
  }
334
325
  });
335
326
  if (promoVoucher.coupon_code) {
@@ -352,14 +343,14 @@ var SettlementStore = (_class = function () {
352
343
  };
353
344
 
354
345
  this.checkCoupon = function () {
355
- var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
356
- var _ref4, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
346
+ var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
347
+ var _ref3, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
357
348
 
358
349
  return _regenerator2.default.wrap(function _callee$(_context) {
359
350
  while (1) {
360
351
  switch (_context.prev = _context.next) {
361
352
  case 0:
362
- _ref4 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref4.isNewRetailBCPos;
353
+ _ref3 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref3.isNewRetailBCPos;
363
354
 
364
355
  if (!isNewRetailBCPos) {
365
356
  _context.next = 7;
@@ -427,10 +418,56 @@ var SettlementStore = (_class = function () {
427
418
  }));
428
419
 
429
420
  return function (_x) {
430
- return _ref3.apply(this, arguments);
421
+ return _ref2.apply(this, arguments);
431
422
  };
432
423
  }();
433
424
 
425
+ this.repeatStorageModal = function (content) {
426
+ return new _promise2.default(function (resolve, reject) {
427
+ _tplusComponentsTouch.ModalWraper.confirm({
428
+ title: '',
429
+ okText: '继续储值',
430
+ className: 'repeat-modal',
431
+ zIndex: 1007,
432
+ content: content,
433
+ onOk: function () {
434
+ var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
435
+ var ret;
436
+ return _regenerator2.default.wrap(function _callee2$(_context2) {
437
+ while (1) {
438
+ switch (_context2.prev = _context2.next) {
439
+ case 0:
440
+ _context2.next = 2;
441
+ return _this2.saveMember();
442
+
443
+ case 2:
444
+ ret = _context2.sent;
445
+
446
+ if (ret === false) {
447
+ resolve(false);
448
+ } else {
449
+ resolve(true);
450
+ }
451
+
452
+ case 4:
453
+ case 'end':
454
+ return _context2.stop();
455
+ }
456
+ }
457
+ }, _callee2, _this2);
458
+ }));
459
+
460
+ return function onOk() {
461
+ return _ref4.apply(this, arguments);
462
+ };
463
+ }(),
464
+ onCancel: function onCancel() {
465
+ resolve(false);
466
+ }
467
+ });
468
+ });
469
+ };
470
+
434
471
  this.checkIntegralExchangeReturn = function (id) {
435
472
  return new _promise2.default(function (resolve, reject) {
436
473
  (0, _tplusApi.tApi)({ param: { refVoucherId: id } }, 'chanjet.RE.NewPos.GetNewIntegralExchange', false, false, { timeout_skip: true }).then(function (resp) {
@@ -566,7 +603,8 @@ var SettlementStore = (_class = function () {
566
603
  authCode: detail.PaymentCode,
567
604
  steadCashIntegral: detail.SteadCashIntegral,
568
605
  overchargesAmount: detail.OverchargesAmount,
569
- boriginReturn: true
606
+ boriginReturn: true,
607
+ thirdPaymentReturnInfo: detail.ThirdPaymentReturnInfo
570
608
  });
571
609
  _this5.paymode.currentMode = newmode;
572
610
  if (themode.paymentType == PayStyle.djq) {
@@ -581,10 +619,10 @@ var SettlementStore = (_class = function () {
581
619
  promoId = _ref6.promoId,
582
620
  id = _ref6.id;
583
621
 
584
- _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this5.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, null, id, true);
622
+ _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, null, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this5.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, null, id, true);
585
623
  return;
586
624
  }
587
- _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
625
+ _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, null, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
588
626
  });
589
627
  }
590
628
  _this5.paymode.thePaymodes.push(newmode);
@@ -655,10 +693,7 @@ var SettlementStore = (_class = function () {
655
693
  TotalTaxAmount: this.paymode.amount,
656
694
  BalanceTaxAmount: this.paymode.currentMode.value
657
695
  } }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
658
- // this.paymode.currentMode.steadCashIntegral=result.Integral;
659
- // this.paymode.currentMode.perIntegral=result.perIntegral;
660
- // this.paymode.currentMode.cashAmount=result.cashAmount;
661
- _this6.paymode.currentMode.integralCashOverOrderAmount = result.integralCashOverOrderAmount;
696
+ _this6.paymode.currentMode.steadCashIntegral = result.Integral;
662
697
  _this6.paymode.currentMode.overchargesAmount = result.Amount - _this6.paymode.currentMode.value;
663
698
  });
664
699
  } else {
@@ -698,36 +733,36 @@ var SettlementStore = (_class = function () {
698
733
  // address = '/member/memberProfile/FindByStorageCode/'+v;
699
734
  address = '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + v + '/' + true;
700
735
  return (0, _tplusApi.ccApi)({ code: v }, address, false, false, { method: 'get', timeout_skip: true }).then(function () {
701
- var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(result) {
736
+ var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(result) {
702
737
  var data, m;
703
- return _regenerator2.default.wrap(function _callee2$(_context2) {
738
+ return _regenerator2.default.wrap(function _callee3$(_context3) {
704
739
  while (1) {
705
- switch (_context2.prev = _context2.next) {
740
+ switch (_context3.prev = _context3.next) {
706
741
  case 0:
707
742
  data = result.data;
708
743
  m = data && data.length && data[0];
709
744
 
710
745
  if (!(result && result.data.length)) {
711
- _context2.next = 25;
746
+ _context3.next = 25;
712
747
  break;
713
748
  }
714
749
 
715
750
  if (!(result.data.length === 1)) {
716
- _context2.next = 14;
751
+ _context3.next = 14;
717
752
  break;
718
753
  }
719
754
 
720
755
  if (!(m.CardTypeEnum === 'BALANCE_CARD')) {
721
- _context2.next = 10;
756
+ _context3.next = 10;
722
757
  break;
723
758
  }
724
759
 
725
760
  _this7.paymode.updateCardInfo(m);
726
761
  _this7.handleCzkData(m);
727
- return _context2.abrupt('return', result.data);
762
+ return _context3.abrupt('return', result.data);
728
763
 
729
764
  case 10:
730
- _context2.next = 12;
765
+ _context3.next = 12;
731
766
  return (0, _tplusApi.ccApi)({ dto: _this7.dto, meStorageCardId: m.MeStorageCardId }, '/retail/RetailPos/validateRetailStorageCard', false, false).then(function (result1) {
732
767
  var data1 = result1.data ? JSON.parse(result1.data)[0] : {};
733
768
  if (data1.enable) {
@@ -740,36 +775,36 @@ var SettlementStore = (_class = function () {
740
775
  });
741
776
 
742
777
  case 12:
743
- _context2.next = 25;
778
+ _context3.next = 25;
744
779
  break;
745
780
 
746
781
  case 14:
747
782
  if (!(result.data && result.data.length === 1)) {
748
- _context2.next = 19;
783
+ _context3.next = 19;
749
784
  break;
750
785
  }
751
786
 
752
787
  _this7.paymode.updateCardInfo(result.data[0]);
753
- return _context2.abrupt('return', result.data);
788
+ return _context3.abrupt('return', result.data);
754
789
 
755
790
  case 19:
756
791
  if (!(result.data && result.data.length > 1)) {
757
- _context2.next = 23;
792
+ _context3.next = 23;
758
793
  break;
759
794
  }
760
795
 
761
- return _context2.abrupt('return', result.data);
796
+ return _context3.abrupt('return', result.data);
762
797
 
763
798
  case 23:
764
799
  _message2.default.warn('没有可用储值卡!');
765
- return _context2.abrupt('return', false);
800
+ return _context3.abrupt('return', false);
766
801
 
767
802
  case 25:
768
803
  case 'end':
769
- return _context2.stop();
804
+ return _context3.stop();
770
805
  }
771
806
  }
772
- }, _callee2, _this7);
807
+ }, _callee3, _this7);
773
808
  }));
774
809
 
775
810
  return function (_x2) {
@@ -820,12 +855,13 @@ var SettlementStore = (_class = function () {
820
855
  }
821
856
  }, {
822
857
  key: 'addDjq',
823
- value: function addDjq(promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
858
+ value: function addDjq(promoCouponCode, name, IsEnable, nominalAmount, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
824
859
  var djq = {
825
860
  code: promoCouponCode,
826
861
  promoCouponCode: promoCouponCode,
827
862
  name: name,
828
863
  IsEnable: IsEnable,
864
+ nominalAmount: nominalAmount,
829
865
  amount: amount,
830
866
  doorsill: doorsill, //:"无门槛"
831
867
  LastTS: LastTS,
@@ -888,9 +924,6 @@ var SettlementStore = (_class = function () {
888
924
  BalanceTaxAmount: this.paymode.amount
889
925
  } }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
890
926
  _this8.paymode.currentMode.member.setExchangable(result.MaxAmount);
891
- _this8.paymode.currentMode.perIntegral = result.perIntegral;
892
- _this8.paymode.currentMode.cashAmount = result.cashAmount;
893
- _this8.paymode.currentMode.integralCashOverOrderAmount = result.integralCashOverOrderAmount;
894
927
  _this8.updateEvent();
895
928
  if (_this8.checkReceived(_this8.paymode.currentMode, "exchangable")) {
896
929
  (0, _mobx.runInAction)(function () {
@@ -919,6 +952,7 @@ var SettlementStore = (_class = function () {
919
952
  name: themode.name,
920
953
  exchangeRate: themode.exchangeRate,
921
954
  calDirection: themode.calDirection,
955
+ thridPayment: themode.thridPayment,
922
956
  value: value,
923
957
  value2: (0, _utils.getFixedNumber)(themode.calDirection == "88" ? value / themode.exchangeRate : value * themode.exchangeRate),
924
958
  value3: value,
@@ -947,7 +981,7 @@ var SettlementStore = (_class = function () {
947
981
  if (type == PayStyle.hyczk || type == PayStyle.jfdx || type == PayStyle.djq) {
948
982
  this.setMaxAmount(type, mode);
949
983
  }
950
- console.log(mode);
984
+ console.log('\u5F53\u524D\u64CD\u4F5C\u7ED3\u7B97\u65B9\u5F0F\u4FE1\u606F:' + mode);
951
985
  return mode;
952
986
  }
953
987
  }, {
@@ -984,15 +1018,6 @@ var SettlementStore = (_class = function () {
984
1018
  key: 'changeFocusOnly',
985
1019
  value: function changeFocusOnly(type) {
986
1020
  this.paymode.currentFocus = type;
987
- // 获取焦点时带入剩余的值
988
- // let mode=_find(this.paymode.thePaymodes,{'paymentType':type});
989
- // if(mode && this.isIntegralExchange){
990
- // const shouldSetValue =getFixedNumber(parseFloat(this.paymode.receivable) + parseFloat(mode.value));
991
- // mode.value = shouldSetValue;
992
- // mode.value2 = getFixedNumber(mode.calDirection=="88"?shouldSetValue / mode.exchangeRate:(shouldSetValue * mode.exchangeRate));
993
- // mode.value3 = shouldSetValue;
994
- // this.paymode.calcReserved();
995
- // }
996
1021
  }
997
1022
  }, {
998
1023
  key: 'changeClickFocusOnly',
@@ -1061,8 +1086,6 @@ var SettlementStore = (_class = function () {
1061
1086
  });
1062
1087
  pos = index == -1 ? pos : index + 1;
1063
1088
  }
1064
- // this.paymode.thePaymodes.push(this.genNewMode(type) );
1065
-
1066
1089
  this.paymode.thePaymodes.splice(pos, 0, this.genNewMode(type, this.newStyle && type == PayStyle.hyczk, undefined, isQuick));
1067
1090
  this.paymode.calcReserved();
1068
1091
  }
@@ -1078,79 +1101,175 @@ var SettlementStore = (_class = function () {
1078
1101
  this.paymode.currentFocus = -1;
1079
1102
  this.paymode.calcReserved();
1080
1103
  }
1104
+
1105
+ // 获取储值是否重复, 在commit方法中使用
1106
+
1107
+ }, {
1108
+ key: 'findStorageBillValidate',
1109
+ value: function findStorageBillValidate() {
1110
+ var _this10 = this;
1111
+
1112
+ var _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(),
1113
+ PayStyle = _enumController$getEn14.PayStyle;
1114
+
1115
+ (0, _mobx.runInAction)(function () {
1116
+ _this10.dto.StorageMutiSettleDetails = [];
1117
+ var thePaymodes = _this10.newStyle ? (0, _filter3.default)(_this10.paymode.thePaymodes, function (mode) {
1118
+ return parseFloat(mode.value) != 0;
1119
+ }) : _this10.paymode.thePaymodes;
1120
+ (0, _each3.default)(thePaymodes, function (mode) {
1121
+ var themode = (0, _find3.default)(_this10.paymode.paymodes, { 'paymentType': mode.paymentType });
1122
+
1123
+ var value = parseFloat(mode.value);
1124
+ var giveChange = null;
1125
+ if (mode.paymentType == PayStyle.xianjin && _this10.paymode.receivable < 0 && value > Math.abs(_this10.paymode.receivable)) {
1126
+ value = Math.Add(value, _this10.paymode.receivable);
1127
+ giveChange = Math.abs(_this10.paymode.receivable);
1128
+ }
1129
+ _this10.dto.StorageMutiSettleDetails.push({
1130
+ Code: mode.paymethodId,
1131
+ StorageAmount: value,
1132
+ GiveChange: giveChange,
1133
+ IdsettleStyle: themode.idSettleStyle,
1134
+ IdbankAccount: themode.idBankAccount,
1135
+ PaymentCode: mode.authCode,
1136
+ DynamicPropertyKeys: [],
1137
+ DynamicPropertyValues: [],
1138
+ DataSource: { Id: _this10.dataSource }
1139
+ });
1140
+ });
1141
+ });
1142
+ return (0, _tplusApi.ccApi)((0, _extends3.default)({}, this.dto), '/marketingtool/Storage/findStorageBillValidate', false, false);
1143
+ }
1144
+
1145
+ //判断是否重复弹框
1146
+
1081
1147
  }, {
1082
1148
  key: 'commit',
1083
1149
  value: function () {
1084
- var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(bTest) {
1085
- var _ref10, isNewRetailBCPos;
1150
+ var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(bTest) {
1151
+ var status, paylist, ret, _ref10, _ref10$data, code, returnMsg, state, ret1, ret2;
1086
1152
 
1087
- return _regenerator2.default.wrap(function _callee3$(_context3) {
1153
+ return _regenerator2.default.wrap(function _callee4$(_context4) {
1088
1154
  while (1) {
1089
- switch (_context3.prev = _context3.next) {
1155
+ switch (_context4.prev = _context4.next) {
1090
1156
  case 0:
1091
1157
  console.log('settlementStore.commit开始,参数:' + bTest);
1092
1158
 
1093
1159
  if (!bTest) {
1094
- _context3.next = 3;
1160
+ _context4.next = 3;
1095
1161
  break;
1096
1162
  }
1097
1163
 
1098
- return _context3.abrupt('return', _promise2.default.resolve(true));
1164
+ return _context4.abrupt('return', _promise2.default.resolve(true));
1099
1165
 
1100
1166
  case 3:
1101
- _ref10 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref10.isNewRetailBCPos;
1102
- _context3.prev = 4;
1167
+ status = this.type;
1168
+ _context4.prev = 4;
1169
+ paylist = this.paymode.thePaymodes.filter(function (v) {
1170
+ return !!v.thridPayment && Math.abs(v.value) > 0;
1171
+ }) || [];
1172
+
1173
+ if (!(paylist && paylist.length > 1)) {
1174
+ _context4.next = 9;
1175
+ break;
1176
+ }
1177
+
1178
+ _message2.default.warn('二开支付目前仅支持单一结算方式。');
1179
+ return _context4.abrupt('return', _promise2.default.resolve(false));
1103
1180
 
1104
- if (!(this.type == 1)) {
1105
- _context3.next = 10;
1181
+ case 9:
1182
+ if (!(status == 1)) {
1183
+ _context4.next = 30;
1106
1184
  break;
1107
1185
  }
1108
1186
 
1109
- _context3.next = 8;
1110
- return this.saveMember();
1187
+ _context4.next = 12;
1188
+ return this.findStorageBillValidate();
1111
1189
 
1112
- case 8:
1113
- _context3.next = 18;
1114
- break;
1190
+ case 12:
1191
+ ret = _context4.sent;
1192
+ _ref10 = ret || {}, _ref10$data = _ref10.data;
1193
+ _ref10$data = _ref10$data === undefined ? {} : _ref10$data;
1194
+ code = _ref10$data.code, returnMsg = _ref10$data.returnMsg;
1115
1195
 
1116
- case 10:
1117
- if (!isNewRetailBCPos) {
1118
- _context3.next = 13;
1196
+ if (!(code && code == 10001)) {
1197
+ _context4.next = 24;
1198
+ break;
1199
+ }
1200
+
1201
+ _context4.next = 19;
1202
+ return this.repeatStorageModal(returnMsg);
1203
+
1204
+ case 19:
1205
+ state = _context4.sent;
1206
+
1207
+ if (!(state === false)) {
1208
+ _context4.next = 22;
1119
1209
  break;
1120
1210
  }
1121
1211
 
1122
- _context3.next = 13;
1212
+ return _context4.abrupt('return', _promise2.default.resolve(false));
1213
+
1214
+ case 22:
1215
+ _context4.next = 28;
1216
+ break;
1217
+
1218
+ case 24:
1219
+ _context4.next = 26;
1220
+ return this.saveMember();
1221
+
1222
+ case 26:
1223
+ ret1 = _context4.sent;
1224
+
1225
+ if (ret1 === false) {
1226
+ _promise2.default.resolve(false);
1227
+ }
1228
+
1229
+ case 28:
1230
+ _context4.next = 39;
1231
+ break;
1232
+
1233
+ case 30:
1234
+ _context4.next = 32;
1123
1235
  return _mutantsMicrofx.stores.offlineSys.generatorCode(this.dto);
1124
1236
 
1125
- case 13:
1126
- _context3.next = 15;
1237
+ case 32:
1238
+ _context4.next = 34;
1127
1239
  return this.save();
1128
1240
 
1129
- case 15:
1130
- if (!isNewRetailBCPos) {
1131
- _context3.next = 18;
1241
+ case 34:
1242
+ ret2 = _context4.sent;
1243
+
1244
+ if (!(ret2 === false)) {
1245
+ _context4.next = 37;
1132
1246
  break;
1133
1247
  }
1134
1248
 
1135
- _context3.next = 18;
1249
+ return _context4.abrupt('return', _promise2.default.resolve(false));
1250
+
1251
+ case 37:
1252
+ _context4.next = 39;
1136
1253
  return _mutantsMicrofx.stores.offlineSys.retailSequenceUpload();
1137
1254
 
1138
- case 18:
1139
- return _context3.abrupt('return', _promise2.default.resolve(true));
1255
+ case 39:
1256
+ return _context4.abrupt('return', _promise2.default.resolve(true));
1140
1257
 
1141
- case 21:
1142
- _context3.prev = 21;
1143
- _context3.t0 = _context3['catch'](4);
1258
+ case 42:
1259
+ _context4.prev = 42;
1260
+ _context4.t0 = _context4['catch'](4);
1144
1261
 
1145
- console.error('settlementStore.commit失败,错误信息:' + _context3.t0);
1146
- return _context3.abrupt('return', _promise2.default.resolve(_context3.t0));
1262
+ console.error('settlementStore.commit失败,错误信息:' + _context4.t0);
1263
+ //其他支付失败时,处理二开支付情况。
1264
+ this.thirdPayRefund(status == 1 ? 2 : 1);
1265
+ return _context4.abrupt('return', _promise2.default.resolve(_context4.t0));
1147
1266
 
1148
- case 25:
1267
+ case 47:
1149
1268
  case 'end':
1150
- return _context3.stop();
1269
+ return _context4.stop();
1151
1270
  }
1152
1271
  }
1153
- }, _callee3, this, [[4, 21]]);
1272
+ }, _callee4, this, [[4, 42]]);
1154
1273
  }));
1155
1274
 
1156
1275
  function commit(_x3) {
@@ -1167,76 +1286,136 @@ var SettlementStore = (_class = function () {
1167
1286
  }
1168
1287
  }, {
1169
1288
  key: 'saveMember',
1170
- value: function saveMember() {
1171
- var _this10 = this;
1289
+ value: function () {
1290
+ var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
1291
+ var _this11 = this;
1172
1292
 
1173
- var _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(),
1174
- PayStyle = _enumController$getEn14.PayStyle;
1293
+ var _enumController$getEn15, PayStyle, TradeType, IPMSG, dtoParams, payList, payment, tradeType, ret, _ref12, type, data, msg, code;
1175
1294
 
1176
- (0, _mobx.runInAction)(function () {
1177
- _this10.dto.StorageMutiSettleDetails = [];
1178
- var thePaymodes = _this10.newStyle ? (0, _filter3.default)(_this10.paymode.thePaymodes, function (mode) {
1179
- return parseFloat(mode.value) != 0;
1180
- }) : _this10.paymode.thePaymodes;
1181
- (0, _each3.default)(thePaymodes, function (mode) {
1182
- var themode = (0, _find3.default)(_this10.paymode.paymodes, { 'paymentType': mode.paymentType });
1295
+ return _regenerator2.default.wrap(function _callee5$(_context5) {
1296
+ while (1) {
1297
+ switch (_context5.prev = _context5.next) {
1298
+ case 0:
1299
+ _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn15.PayStyle, TradeType = _enumController$getEn15.TradeType;
1183
1300
 
1184
- var value = parseFloat(mode.value);
1185
- var giveChange = null;
1186
- if (mode.paymentType == PayStyle.xianjin && _this10.paymode.receivable < 0 && value > Math.abs(_this10.paymode.receivable)) {
1187
- value = Math.Add(value, _this10.paymode.receivable);
1188
- giveChange = Math.abs(_this10.paymode.receivable);
1301
+ (0, _mobx.runInAction)(function () {
1302
+ _this11.dto.StorageMutiSettleDetails = [];
1303
+ var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
1304
+ return parseFloat(mode.value) != 0;
1305
+ }) : _this11.paymode.thePaymodes;
1306
+ (0, _each3.default)(thePaymodes, function (mode) {
1307
+ var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
1308
+
1309
+ var value = parseFloat(mode.value);
1310
+ var giveChange = null;
1311
+ if (mode.paymentType == PayStyle.xianjin && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
1312
+ value = Math.Add(value, _this11.paymode.receivable);
1313
+ giveChange = Math.abs(_this11.paymode.receivable);
1314
+ }
1315
+ _this11.dto.StorageMutiSettleDetails.push({
1316
+ Code: mode.paymethodId,
1317
+ StorageAmount: value,
1318
+ GiveChange: giveChange,
1319
+ IdsettleStyle: themode.idSettleStyle,
1320
+ IdbankAccount: themode.idBankAccount,
1321
+ PaymentCode: mode.authCode,
1322
+ DynamicPropertyKeys: [],
1323
+ DynamicPropertyValues: [],
1324
+ DataSource: { Id: _this11.dataSource },
1325
+ ThirdPaymentInfo: themode.thridPayment || null,
1326
+ ThirdPaymentReturnInfo: mode.thirdPaymentReturnInfo || null
1327
+ });
1328
+ });
1329
+ });
1330
+ // cc结算调用
1331
+ IPMSG = {};
1332
+
1333
+ if (!!window.localStorage.IPMSG) {
1334
+ IPMSG = JSON.parse(window.localStorage.IPMSG);
1335
+ }
1336
+ dtoParams = this.dto;
1337
+ //处理存在二开支付情况
1338
+
1339
+ payList = dtoParams.StorageMutiSettleDetails.filter(function (v) {
1340
+ return v.ThirdPaymentInfo;
1341
+ });
1342
+
1343
+ if (!(payList && payList.length > 0)) {
1344
+ _context5.next = 19;
1345
+ break;
1346
+ }
1347
+
1348
+ payment = payList[0];
1349
+ tradeType = payment && payment.StorageAmount > 0 ? TradeType.PAY : TradeType.REFUND;
1350
+ _context5.next = 11;
1351
+ return this.thirdPay(2, payment, tradeType, dtoParams);
1352
+
1353
+ case 11:
1354
+ ret = _context5.sent;
1355
+ _ref12 = ret || {}, type = _ref12.type, data = _ref12.data, msg = _ref12.msg, code = _ref12.code;
1356
+
1357
+ if (!(type === true)) {
1358
+ _context5.next = 17;
1359
+ break;
1360
+ }
1361
+
1362
+ dtoParams = data;
1363
+ _context5.next = 19;
1364
+ break;
1365
+
1366
+ case 17:
1367
+ _message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
1368
+ return _context5.abrupt('return', false);
1369
+
1370
+ case 19:
1371
+ this.dtoParams = dtoParams;
1372
+ console.log('储值结算信息:', dtoParams);
1373
+ return _context5.abrupt('return', (0, _tplusApi.tApi)({ dto: dtoParams }, 'chanjet.ME.INewRetailMemberStorage.Save', false, false).then(function (resp) {
1374
+ _this11.handlePrint(resp);
1375
+ }));
1376
+
1377
+ case 22:
1378
+ case 'end':
1379
+ return _context5.stop();
1380
+ }
1189
1381
  }
1190
- _this10.dto.StorageMutiSettleDetails.push({
1191
- Code: mode.paymethodId,
1192
- StorageAmount: value,
1193
- GiveChange: giveChange,
1194
- IdsettleStyle: themode.idSettleStyle,
1195
- IdbankAccount: themode.idBankAccount,
1196
- PaymentCode: mode.authCode,
1197
- DynamicPropertyKeys: [],
1198
- DynamicPropertyValues: [],
1199
- DataSource: { Id: _this10.dataSource }
1200
- });
1201
- });
1202
- });
1203
- // cc结算调用
1204
- var IPMSG = {};
1205
- if (!!window.localStorage.IPMSG) {
1206
- IPMSG = JSON.parse(window.localStorage.IPMSG);
1382
+ }, _callee5, this);
1383
+ }));
1384
+
1385
+ function saveMember() {
1386
+ return _ref11.apply(this, arguments);
1207
1387
  }
1208
- return (0, _tplusApi.tApi)({ dto: this.dto }, 'chanjet.ME.INewRetailMemberStorage.Save', false, false).then(function (resp) {
1209
- _this10.handlePrint(resp);
1210
- });
1211
- }
1388
+
1389
+ return saveMember;
1390
+ }()
1212
1391
  }, {
1213
1392
  key: 'save',
1214
1393
  value: function () {
1215
- var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
1216
- var _this11 = this;
1394
+ var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6() {
1395
+ var _this12 = this;
1217
1396
 
1218
- var _enumController$getEn15, PayStyle, _ref13, isNewRetailBCPos, IPMSG, RetailTypeEnum;
1397
+ var _enumController$getEn16, PayStyle, TradeType, IPMSG, RetailTypeEnum, dtoParams, payList, payment, tradeType, ret, _ref14, type, data, msg, code;
1219
1398
 
1220
- return _regenerator2.default.wrap(function _callee4$(_context4) {
1399
+ return _regenerator2.default.wrap(function _callee6$(_context6) {
1221
1400
  while (1) {
1222
- switch (_context4.prev = _context4.next) {
1401
+ switch (_context6.prev = _context6.next) {
1223
1402
  case 0:
1224
- _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn15.PayStyle;
1403
+ _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn16.PayStyle, TradeType = _enumController$getEn16.TradeType;
1225
1404
 
1226
1405
  (0, _mobx.runInAction)(function () {
1227
- _this11.dto.RetailPaymentDetails = [];
1228
- _this11.dto.RetailStorageDetails = [];
1229
- _this11.dto.RetailCouponDetails = [];
1406
+ _this12.dto.RetailPaymentDetails = [];
1407
+ _this12.dto.RetailStorageDetails = [];
1408
+ _this12.dto.RetailCouponDetails = [];
1230
1409
  var czkSum = 0;
1231
1410
  var count = 0;
1232
- var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
1411
+ var thePaymodes = _this12.newStyle ? (0, _filter3.default)(_this12.paymode.thePaymodes, function (mode) {
1233
1412
  return parseFloat(mode.value) != 0;
1234
- }) : _this11.paymode.thePaymodes;
1413
+ }) : _this12.paymode.thePaymodes;
1235
1414
  (0, _each3.default)(thePaymodes, function (mode, index) {
1236
- var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
1415
+ var themode = (0, _find3.default)(_this12.paymode.paymodes, { 'paymentType': mode.paymentType });
1237
1416
  if (mode.paymentType == PayStyle.hyczk) {
1238
1417
  czkSum = Math.Add(czkSum, mode.value);
1239
- _this11.dto.RetailStorageDetails.push({
1418
+ _this12.dto.RetailStorageDetails.push({
1240
1419
  Code: mode.paymethodId,
1241
1420
  MeStorageCardId: mode.meStorageCardId,
1242
1421
  StoragePaymentAmount: mode.value,
@@ -1245,17 +1424,17 @@ var SettlementStore = (_class = function () {
1245
1424
  Idmember: mode.memberId,
1246
1425
  DynamicPropertyKeys: [],
1247
1426
  DynamicPropertyValues: [],
1248
- DataSource: { Id: _this11.dataSource },
1427
+ DataSource: { Id: _this12.dataSource },
1249
1428
  Password: mode.authCode
1250
1429
  });
1251
1430
  } else {
1252
1431
  var value = parseFloat(mode.value);
1253
1432
  var giveChange = null;
1254
- if (mode.paymentType == PayStyle.xianjin && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
1255
- value = Math.Add(value, _this11.paymode.receivable);
1256
- giveChange = Math.abs(_this11.paymode.receivable);
1433
+ if (mode.paymentType == PayStyle.xianjin && _this12.paymode.receivable < 0 && value > Math.abs(_this12.paymode.receivable)) {
1434
+ value = Math.Add(value, _this12.paymode.receivable);
1435
+ giveChange = Math.abs(_this12.paymode.receivable);
1257
1436
  }
1258
- _this11.dto.RetailPaymentDetails.push({
1437
+ _this12.dto.RetailPaymentDetails.push({
1259
1438
  Code: mode.paymethodId,
1260
1439
  OrigAmount: mode.exchangeRate != 1 ? mode.value2 : value,
1261
1440
  Amount: value,
@@ -1269,11 +1448,13 @@ var SettlementStore = (_class = function () {
1269
1448
  OverchargesAmount: mode.overchargesAmount,
1270
1449
  DynamicPropertyKeys: [],
1271
1450
  DynamicPropertyValues: [],
1272
- DataSource: { Id: _this11.dataSource }
1451
+ DataSource: { Id: _this12.dataSource },
1452
+ ThirdPaymentInfo: themode.thridPayment || null,
1453
+ ThirdPaymentReturnInfo: mode.thirdPaymentReturnInfo || null
1273
1454
  });
1274
1455
  if (mode.paymentType == PayStyle.djq) {
1275
- (0, _each3.default)(_this11.paymode.checkList && _this11.paymode.checkList.length ? _this11.paymode.checkList : mode.djqs, function (djq) {
1276
- _this11.dto.RetailCouponDetails.push({
1456
+ (0, _each3.default)(_this12.paymode.checkList && _this12.paymode.checkList.length ? _this12.paymode.checkList : mode.djqs, function (djq) {
1457
+ _this12.dto.RetailCouponDetails.push({
1277
1458
  CouponCode: djq.promoCouponCode,
1278
1459
  ReductionAmount: djq.amount,
1279
1460
  EnableAmount: djq.doorsill,
@@ -1283,53 +1464,28 @@ var SettlementStore = (_class = function () {
1283
1464
  PromotionId: djq.promoId,
1284
1465
  PromotionRuleId: djq.promoRuleId,
1285
1466
  PromoCouponAllocatedId: djq.id,
1286
- DataSource: { Id: _this11.dataSource }
1467
+ DataSource: { Id: _this12.dataSource }
1287
1468
  });
1288
1469
  });
1289
1470
  }
1290
1471
  }
1291
1472
  });
1292
-
1293
- var _ref12 = _mutantsUtil.platform || {},
1294
- isNewRetailBCPos = _ref12.isNewRetailBCPos;
1295
-
1296
- if (_this11.dto.RetailStorageDetails.length > 0) {
1297
- var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
1298
- if (isNewRetailBCPos) {
1299
- _this11.dto.RetailPaymentDetails.push({
1300
- Code: _this11.paymode.counter,
1301
- OrigAmount: czkSum,
1302
- Amount: czkSum,
1303
- IdsettleStyle: themode.idSettleStyle,
1304
- IdbankAccount: themode.idBankAccount,
1305
- DynamicPropertyKeys: [],
1306
- DynamicPropertyValues: [],
1307
- DataSource: { Id: _this11.dataSource },
1308
- RetailStorageDetails: _this11.dto.RetailStorageDetails
1309
- });
1310
- } else {
1311
- _this11.dto.RetailPaymentDetails.push({
1312
- Code: _this11.paymode.counter,
1313
- OrigAmount: czkSum,
1314
- Amount: czkSum,
1315
- IdsettleStyle: themode.idSettleStyle,
1316
- IdbankAccount: themode.idBankAccount,
1317
- DynamicPropertyKeys: [],
1318
- DynamicPropertyValues: [],
1319
- DataSource: { Id: _this11.dataSource }
1320
- });
1321
- }
1473
+ if (_this12.dto.RetailStorageDetails.length > 0) {
1474
+ var themode = (0, _find3.default)(_this12.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
1475
+ _this12.dto.RetailPaymentDetails.push({
1476
+ Code: _this12.paymode.counter,
1477
+ OrigAmount: czkSum,
1478
+ Amount: czkSum,
1479
+ IdsettleStyle: themode.idSettleStyle,
1480
+ IdbankAccount: themode.idBankAccount,
1481
+ DynamicPropertyKeys: [],
1482
+ DynamicPropertyValues: [],
1483
+ DataSource: { Id: _this12.dataSource },
1484
+ RetailStorageDetails: _this12.dto.RetailStorageDetails
1485
+ });
1322
1486
  }
1323
1487
  });
1324
- _ref13 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref13.isNewRetailBCPos;
1325
-
1326
- console.log('bc_pos\u73AF\u5883:' + isNewRetailBCPos + ',\u7ED3\u7B97\u6570\u636E\uFF1A', this.dto);
1327
-
1328
- if (!isNewRetailBCPos) {
1329
- _context4.next = 20;
1330
- break;
1331
- }
1332
-
1488
+ console.log('\u7ED3\u7B97\u6570\u636E\uFF1A', this.dto);
1333
1489
  // cc结算调用
1334
1490
  IPMSG = {};
1335
1491
 
@@ -1337,65 +1493,271 @@ var SettlementStore = (_class = function () {
1337
1493
  IPMSG = JSON.parse(window.localStorage.IPMSG);
1338
1494
  }
1339
1495
  RetailTypeEnum = this.dto.IdbusiType == 36 ? "INTEGRAL_EXCHANGE" : "NORMAL";
1340
- _context4.t1 = this.dto.IdbusiType == 37;
1496
+ _context6.t1 = this.dto.IdbusiType == 37;
1341
1497
 
1342
- if (!_context4.t1) {
1343
- _context4.next = 13;
1498
+ if (!_context6.t1) {
1499
+ _context6.next = 11;
1344
1500
  break;
1345
1501
  }
1346
1502
 
1347
- _context4.next = 12;
1503
+ _context6.next = 10;
1348
1504
  return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
1349
1505
 
1350
- case 12:
1351
- _context4.t1 = _context4.sent;
1506
+ case 10:
1507
+ _context6.t1 = _context6.sent;
1352
1508
 
1353
- case 13:
1354
- _context4.t0 = _context4.t1;
1509
+ case 11:
1510
+ _context6.t0 = _context6.t1;
1355
1511
 
1356
- if (_context4.t0) {
1357
- _context4.next = 16;
1512
+ if (_context6.t0) {
1513
+ _context6.next = 14;
1358
1514
  break;
1359
1515
  }
1360
1516
 
1361
- _context4.t0 = this.dto.IdbusiType != 37;
1517
+ _context6.t0 = this.dto.IdbusiType != 37;
1362
1518
 
1363
- case 16:
1364
- if (!_context4.t0) {
1365
- _context4.next = 18;
1519
+ case 14:
1520
+ if (!_context6.t0) {
1521
+ _context6.next = 33;
1366
1522
  break;
1367
1523
  }
1368
1524
 
1369
- return _context4.abrupt('return', (0, _tplusApi.ccApi)({ dto: (0, _extends3.default)({}, this.dto.cut(), { RetailOms: { RetailTypeEnum: RetailTypeEnum } }), cip: IPMSG.query || "" }, '/retail/RetailPos/settle', false, false, { method: 'post', timeout_skip: true }).then(function (resp) {
1370
- _this11.setDtoID(resp.ID);
1371
- _this11.paymode.checkList = [];
1372
- _this11.billID = resp.ID;
1373
- }));
1525
+ dtoParams = (0, _extends3.default)({}, this.dto.cut(), { RetailOms: { RetailTypeEnum: RetailTypeEnum } });
1526
+ //处理存在二开支付情况
1374
1527
 
1375
- case 18:
1376
- _context4.next = 21;
1528
+ payList = dtoParams.RetailPaymentDetails.filter(function (v) {
1529
+ return v.ThirdPaymentInfo;
1530
+ });
1531
+
1532
+ if (!(payList && payList.length > 0)) {
1533
+ _context6.next = 30;
1534
+ break;
1535
+ }
1536
+
1537
+ payment = payList[0];
1538
+ tradeType = payment && payment.Amount > 0 ? TradeType.PAY : TradeType.REFUND;
1539
+ _context6.next = 22;
1540
+ return this.thirdPay(1, payment, tradeType, dtoParams);
1541
+
1542
+ case 22:
1543
+ ret = _context6.sent;
1544
+ _ref14 = ret || {}, type = _ref14.type, data = _ref14.data, msg = _ref14.msg, code = _ref14.code;
1545
+
1546
+ if (!(type === true)) {
1547
+ _context6.next = 28;
1548
+ break;
1549
+ }
1550
+
1551
+ dtoParams = data;
1552
+ _context6.next = 30;
1377
1553
  break;
1378
1554
 
1379
- case 20:
1380
- return _context4.abrupt('return', (0, _tplusApi.tApi)({ dto: this.dto.cut() }, 'chanjet.RE.newRetail.Settle', false, false, { timeout_skip: true }).then(function (resp) {
1381
- _this11.setDtoID(resp.ID);
1382
- _this11.billID = resp.ID;
1555
+ case 28:
1556
+ _message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
1557
+ return _context6.abrupt('return', false);
1558
+
1559
+ case 30:
1560
+ this.dtoParams = dtoParams;
1561
+ console.log('结算信息:', dtoParams);
1562
+ return _context6.abrupt('return', (0, _tplusApi.ccApi)({ dto: dtoParams, cip: IPMSG.query || "" }, '/retail/RetailPos/settle', false, false, { method: 'post', timeout_skip: true }).then(function (resp) {
1563
+ var _ref15 = resp || {},
1564
+ ID = _ref15.ID;
1565
+
1566
+ _this12.setDtoID(ID);
1567
+ _this12.billID = ID;
1568
+ _this12.paymode.checkList = [];
1383
1569
  }));
1384
1570
 
1385
- case 21:
1571
+ case 33:
1386
1572
  case 'end':
1387
- return _context4.stop();
1573
+ return _context6.stop();
1388
1574
  }
1389
1575
  }
1390
- }, _callee4, this);
1576
+ }, _callee6, this);
1391
1577
  }));
1392
1578
 
1393
1579
  function save() {
1394
- return _ref11.apply(this, arguments);
1580
+ return _ref13.apply(this, arguments);
1395
1581
  }
1396
1582
 
1397
1583
  return save;
1398
1584
  }()
1585
+
1586
+ //裁剪二开支付数据
1587
+
1588
+ }, {
1589
+ key: 'removeThirdPayDto',
1590
+ value: function removeThirdPayDto(dto) {
1591
+ var data = (0, _extends3.default)({}, dto);
1592
+ delete data['DynamicPropertyKeys'];
1593
+ delete data['DynamicPropertyValues'];
1594
+ return data;
1595
+ }
1596
+
1597
+ /**
1598
+ * 二开支付
1599
+ * vType:1零售单、2储值单
1600
+ * payment:结算方式
1601
+ * trade:00表示结算、02表示退款
1602
+ * dto:结算数据集合
1603
+ */
1604
+
1605
+ }, {
1606
+ key: 'thirdPay',
1607
+ value: function () {
1608
+ var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(vType, payment, trade, dto) {
1609
+ var cto, params, ret, _ref17, Code, _Message, Result, _ref18, ThirdPaymentReturnInfo;
1610
+
1611
+ return _regenerator2.default.wrap(function _callee7$(_context7) {
1612
+ while (1) {
1613
+ switch (_context7.prev = _context7.next) {
1614
+ case 0:
1615
+ _context7.prev = 0;
1616
+ cto = this.removeThirdPayDto(dto);
1617
+ params = { VoucherType: vType, Payment: payment, TradeType: trade, dto: cto };
1618
+
1619
+ console.log('刷卡信息:', (0, _stringify2.default)(params));
1620
+ _context7.next = 6;
1621
+ return new _promise2.default(function (resolve, reject) {
1622
+ _mutantsMicrofx.nativeMs.setIpcRendererMethod('ThirdPayment', (0, _extends3.default)({}, params), function (res) {
1623
+ return resolve(res);
1624
+ });
1625
+ });
1626
+
1627
+ case 6:
1628
+ ret = _context7.sent;
1629
+
1630
+ console.log('刷卡返回信息:', ret);
1631
+ ret = JSON.parse(ret);
1632
+ _ref17 = ret || {}, Code = _ref17.Code, _Message = _ref17.Message, Result = _ref17.Result;
1633
+
1634
+ if (!(Code > 0)) {
1635
+ _context7.next = 14;
1636
+ break;
1637
+ }
1638
+
1639
+ return _context7.abrupt('return', { type: false, data: null, msg: _Message, code: Code });
1640
+
1641
+ case 14:
1642
+ if (!(trade == '00')) {
1643
+ _context7.next = 20;
1644
+ break;
1645
+ }
1646
+
1647
+ _ref18 = Result || {}, ThirdPaymentReturnInfo = _ref18.ThirdPaymentReturnInfo;
1648
+
1649
+ if (vType == 1) {
1650
+ dto.RetailPaymentDetails.forEach(function (v) {
1651
+ if (v.ThirdPaymentInfo != null && Math.abs(v.Amount) > 0) {
1652
+ v.ThirdPaymentReturnInfo = ThirdPaymentReturnInfo;
1653
+ }
1654
+ });
1655
+ } else if (vType == 2) {
1656
+ dto.StorageMutiSettleDetails.forEach(function (v) {
1657
+ if (v.ThirdPaymentInfo != null && Math.abs(v.StorageAmount) > 0) {
1658
+ v.ThirdPaymentReturnInfo = ThirdPaymentReturnInfo;
1659
+ }
1660
+ });
1661
+ }
1662
+ return _context7.abrupt('return', { type: true, data: dto, msg: _Message, code: Code });
1663
+
1664
+ case 20:
1665
+ if (!(trade == '02')) {
1666
+ _context7.next = 22;
1667
+ break;
1668
+ }
1669
+
1670
+ return _context7.abrupt('return', { type: true, data: dto, msg: _Message, code: Code });
1671
+
1672
+ case 22:
1673
+ _context7.next = 27;
1674
+ break;
1675
+
1676
+ case 24:
1677
+ _context7.prev = 24;
1678
+ _context7.t0 = _context7['catch'](0);
1679
+ return _context7.abrupt('return', { type: false, data: null, msg: _context7.t0, code: '9999' });
1680
+
1681
+ case 27:
1682
+ case 'end':
1683
+ return _context7.stop();
1684
+ }
1685
+ }
1686
+ }, _callee7, this, [[0, 24]]);
1687
+ }));
1688
+
1689
+ function thirdPay(_x4, _x5, _x6, _x7) {
1690
+ return _ref16.apply(this, arguments);
1691
+ }
1692
+
1693
+ return thirdPay;
1694
+ }()
1695
+
1696
+ //二开支付强制退款情况
1697
+
1698
+ }, {
1699
+ key: 'thirdPayRefund',
1700
+ value: function () {
1701
+ var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(type) {
1702
+ var _this13 = this;
1703
+
1704
+ var dto, pay, payment, _enumController$getEn17, TradeType;
1705
+
1706
+ return _regenerator2.default.wrap(function _callee9$(_context9) {
1707
+ while (1) {
1708
+ switch (_context9.prev = _context9.next) {
1709
+ case 0:
1710
+ dto = type == 1 ? this.dtoParams.RetailPaymentDetails : this.dtoParams.StorageMutiSettleDetails;
1711
+ pay = dto && dto.filter(function (v) {
1712
+ return v.ThirdPaymentInfo;
1713
+ });
1714
+
1715
+ if (pay && pay.length > 0) {
1716
+ setTimeout(function () {
1717
+ _message2.default.warn("支付出现异常,将发起刷卡退款。", { duration: 4.5 });
1718
+ }, 1000);
1719
+ payment = pay[0];
1720
+ _enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(), TradeType = _enumController$getEn17.TradeType;
1721
+
1722
+ setTimeout((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8() {
1723
+ var ret, _ref21, msg;
1724
+
1725
+ return _regenerator2.default.wrap(function _callee8$(_context8) {
1726
+ while (1) {
1727
+ switch (_context8.prev = _context8.next) {
1728
+ case 0:
1729
+ _context8.next = 2;
1730
+ return _this13.thirdPay(type, payment, TradeType.REFUND, dto);
1731
+
1732
+ case 2:
1733
+ ret = _context8.sent;
1734
+ _ref21 = ret || {}, msg = _ref21.msg;
1735
+
1736
+ console.log('\u5237\u5361\u652F\u4ED8\u9000\u6B3E:' + msg);
1737
+
1738
+ case 5:
1739
+ case 'end':
1740
+ return _context8.stop();
1741
+ }
1742
+ }
1743
+ }, _callee8, _this13);
1744
+ })), 4500);
1745
+ }
1746
+
1747
+ case 3:
1748
+ case 'end':
1749
+ return _context9.stop();
1750
+ }
1751
+ }
1752
+ }, _callee9, this);
1753
+ }));
1754
+
1755
+ function thirdPayRefund(_x8) {
1756
+ return _ref19.apply(this, arguments);
1757
+ }
1758
+
1759
+ return thirdPayRefund;
1760
+ }()
1399
1761
  }, {
1400
1762
  key: 'setDtoID',
1401
1763
  value: function setDtoID(id) {
@@ -1404,35 +1766,35 @@ var SettlementStore = (_class = function () {
1404
1766
  }, {
1405
1767
  key: 'querySettleResult',
1406
1768
  value: function () {
1407
- var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
1408
- return _regenerator2.default.wrap(function _callee5$(_context5) {
1769
+ var _ref22 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10() {
1770
+ return _regenerator2.default.wrap(function _callee10$(_context10) {
1409
1771
  while (1) {
1410
- switch (_context5.prev = _context5.next) {
1772
+ switch (_context10.prev = _context10.next) {
1411
1773
  case 0:
1412
- _context5.prev = 0;
1413
- _context5.t0 = _promise2.default;
1414
- _context5.next = 4;
1774
+ _context10.prev = 0;
1775
+ _context10.t0 = _promise2.default;
1776
+ _context10.next = 4;
1415
1777
  return (0, _tplusApi.tApi)({ RetailCode: this.dto.Code }, 'chanjet.RE.newRetail.QuerySettleResult', false, false, { timeout_skip: true });
1416
1778
 
1417
1779
  case 4:
1418
- _context5.t1 = _context5.sent;
1419
- return _context5.abrupt('return', _context5.t0.resolve.call(_context5.t0, _context5.t1));
1780
+ _context10.t1 = _context10.sent;
1781
+ return _context10.abrupt('return', _context10.t0.resolve.call(_context10.t0, _context10.t1));
1420
1782
 
1421
1783
  case 8:
1422
- _context5.prev = 8;
1423
- _context5.t2 = _context5['catch'](0);
1424
- return _context5.abrupt('return', _promise2.default.resolve({ Flag: "1" }));
1784
+ _context10.prev = 8;
1785
+ _context10.t2 = _context10['catch'](0);
1786
+ return _context10.abrupt('return', _promise2.default.resolve({ Flag: "1" }));
1425
1787
 
1426
1788
  case 11:
1427
1789
  case 'end':
1428
- return _context5.stop();
1790
+ return _context10.stop();
1429
1791
  }
1430
1792
  }
1431
- }, _callee5, this, [[0, 8]]);
1793
+ }, _callee10, this, [[0, 8]]);
1432
1794
  }));
1433
1795
 
1434
1796
  function querySettleResult() {
1435
- return _ref14.apply(this, arguments);
1797
+ return _ref22.apply(this, arguments);
1436
1798
  }
1437
1799
 
1438
1800
  return querySettleResult;
@@ -1458,18 +1820,18 @@ var SettlementStore = (_class = function () {
1458
1820
  }, {
1459
1821
  key: 'validePwd',
1460
1822
  value: function () {
1461
- var _ref15 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(value) {
1462
- var _ref16, isNewRetailBCPos, cook1, cook2, message, memberStorageId, _paymode$currentMode, cardTypeEnum, memberId, meStorageCardId, cardStatusEnum, result, count, _result;
1823
+ var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(value) {
1824
+ var _ref24, isNewRetailBCPos, cook1, cook2, message, memberStorageId, _paymode$currentMode, cardTypeEnum, memberId, meStorageCardId, cardStatusEnum, result, count, _result;
1463
1825
 
1464
- return _regenerator2.default.wrap(function _callee6$(_context6) {
1826
+ return _regenerator2.default.wrap(function _callee11$(_context11) {
1465
1827
  while (1) {
1466
- switch (_context6.prev = _context6.next) {
1828
+ switch (_context11.prev = _context11.next) {
1467
1829
  case 0:
1468
- _ref16 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref16.isNewRetailBCPos;
1469
- _context6.prev = 1;
1830
+ _ref24 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref24.isNewRetailBCPos;
1831
+ _context11.prev = 1;
1470
1832
 
1471
1833
  if (!isNewRetailBCPos) {
1472
- _context6.next = 33;
1834
+ _context11.next = 33;
1473
1835
  break;
1474
1836
  }
1475
1837
 
@@ -1479,60 +1841,60 @@ var SettlementStore = (_class = function () {
1479
1841
  memberStorageId = this.paymode.currentMode.meStorageCardId;
1480
1842
 
1481
1843
  if (!cook2) {
1482
- _context6.next = 12;
1844
+ _context11.next = 12;
1483
1845
  break;
1484
1846
  }
1485
1847
 
1486
1848
  if (!cook2.hasOwnProperty(memberStorageId + "")) {
1487
- _context6.next = 12;
1849
+ _context11.next = 12;
1488
1850
  break;
1489
1851
  }
1490
1852
 
1491
1853
  if (!(cook2[memberStorageId] > 3)) {
1492
- _context6.next = 12;
1854
+ _context11.next = 12;
1493
1855
  break;
1494
1856
  }
1495
1857
 
1496
1858
  message = '今日密码错误已达上限,不可使用储值消费,请明日再试,如忘记请重置密码或修改密码。';
1497
- return _context6.abrupt('return', _promise2.default.resolve(message));
1859
+ return _context11.abrupt('return', _promise2.default.resolve(message));
1498
1860
 
1499
1861
  case 12:
1500
1862
  _paymode$currentMode = this.paymode.currentMode, cardTypeEnum = _paymode$currentMode.cardTypeEnum, memberId = _paymode$currentMode.memberId, meStorageCardId = _paymode$currentMode.meStorageCardId, cardStatusEnum = _paymode$currentMode.cardStatusEnum;
1501
1863
  result = null;
1502
1864
 
1503
1865
  if (!(cardTypeEnum === 'BALANCE_CARD')) {
1504
- _context6.next = 20;
1866
+ _context11.next = 20;
1505
1867
  break;
1506
1868
  }
1507
1869
 
1508
- _context6.next = 17;
1870
+ _context11.next = 17;
1509
1871
  return (0, _tplusApi.ccApi)({ md5Password: _tplusApi.User.pwdEncrypt(value.pwd), cardType: cardTypeEnum }, '/member/MeMemberWallet/checkPaymentPassword/' + memberId, false, false);
1510
1872
 
1511
1873
  case 17:
1512
- result = _context6.sent;
1513
- _context6.next = 29;
1874
+ result = _context11.sent;
1875
+ _context11.next = 29;
1514
1876
  break;
1515
1877
 
1516
1878
  case 20:
1517
1879
  if (!(cardStatusEnum === 'BINDING' && this.member && this.member.ID === memberId)) {
1518
- _context6.next = 26;
1880
+ _context11.next = 26;
1519
1881
  break;
1520
1882
  }
1521
1883
 
1522
- _context6.next = 23;
1884
+ _context11.next = 23;
1523
1885
  return (0, _tplusApi.ccApi)({ md5Password: _tplusApi.User.pwdEncrypt(value.pwd), password: value.pwd, cardType: cardTypeEnum }, '/member/MeMemberWallet/checkPaymentPassword/' + meStorageCardId, false, false);
1524
1886
 
1525
1887
  case 23:
1526
- result = _context6.sent;
1527
- _context6.next = 29;
1888
+ result = _context11.sent;
1889
+ _context11.next = 29;
1528
1890
  break;
1529
1891
 
1530
1892
  case 26:
1531
- _context6.next = 28;
1893
+ _context11.next = 28;
1532
1894
  return (0, _tplusApi.ccApi)({ password: value.pwd, cardType: cardTypeEnum }, '/member/MeMemberWallet/checkPaymentPassword/' + meStorageCardId, false, false);
1533
1895
 
1534
1896
  case 28:
1535
- result = _context6.sent;
1897
+ result = _context11.sent;
1536
1898
 
1537
1899
  case 29:
1538
1900
  if (!result.data) {
@@ -1551,38 +1913,38 @@ var SettlementStore = (_class = function () {
1551
1913
  this.setCookie('errorPwd', '', -1);
1552
1914
  this.setCookie('errorPwd', (0, _stringify2.default)(cook2));
1553
1915
  }
1554
- return _context6.abrupt('return', _promise2.default.resolve(result.data ? "" : message));
1916
+ return _context11.abrupt('return', _promise2.default.resolve(result.data ? "" : message));
1555
1917
 
1556
1918
  case 33:
1557
- _context6.next = 35;
1919
+ _context11.next = 35;
1558
1920
  return (0, _tplusApi.tApi)({ "CheckoutParams": {
1559
1921
  "Idmember": value.id,
1560
1922
  "Password": value.pwd
1561
1923
  } }, 'AA.DR.newRetailMember.CheckoutMemberPassword', false, false);
1562
1924
 
1563
1925
  case 35:
1564
- _result = _context6.sent;
1565
- return _context6.abrupt('return', _promise2.default.resolve(_result.Success ? "" : _result.Message));
1926
+ _result = _context11.sent;
1927
+ return _context11.abrupt('return', _promise2.default.resolve(_result.Success ? "" : _result.Message));
1566
1928
 
1567
1929
  case 37:
1568
- _context6.next = 42;
1930
+ _context11.next = 42;
1569
1931
  break;
1570
1932
 
1571
1933
  case 39:
1572
- _context6.prev = 39;
1573
- _context6.t0 = _context6['catch'](1);
1574
- return _context6.abrupt('return', "failed");
1934
+ _context11.prev = 39;
1935
+ _context11.t0 = _context11['catch'](1);
1936
+ return _context11.abrupt('return', "failed");
1575
1937
 
1576
1938
  case 42:
1577
1939
  case 'end':
1578
- return _context6.stop();
1940
+ return _context11.stop();
1579
1941
  }
1580
1942
  }
1581
- }, _callee6, this, [[1, 39]]);
1943
+ }, _callee11, this, [[1, 39]]);
1582
1944
  }));
1583
1945
 
1584
- function validePwd(_x4) {
1585
- return _ref15.apply(this, arguments);
1946
+ function validePwd(_x9) {
1947
+ return _ref23.apply(this, arguments);
1586
1948
  }
1587
1949
 
1588
1950
  return validePwd;
@@ -1592,7 +1954,7 @@ var SettlementStore = (_class = function () {
1592
1954
  }(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'queryPwd', [_mobx.action], {
1593
1955
  enumerable: true,
1594
1956
  initializer: function initializer() {
1595
- var _this12 = this;
1957
+ var _this14 = this;
1596
1958
 
1597
1959
  return function (newPass, newPassConfirm) {
1598
1960
  if (!newPass || !newPassConfirm) {
@@ -1604,7 +1966,7 @@ var SettlementStore = (_class = function () {
1604
1966
  var idstore = (0, _tplusPoslogin.PosInitData)('storeID');
1605
1967
  return (0, _tplusApi.ccApi)({
1606
1968
  Idstore: idstore,
1607
- meMemberId: _this12.paymode.currentMode.memberId,
1969
+ meMemberId: _this14.paymode.currentMode.memberId,
1608
1970
  oldPassword: null,
1609
1971
  newPassword: _tplusApi.User.pwdEncrypt(newPassConfirm),
1610
1972
  dataSource: "POS"
@@ -1618,131 +1980,131 @@ var SettlementStore = (_class = function () {
1618
1980
  }), _applyDecoratedDescriptor(_class.prototype, 'initByOriginReturn', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'initByOriginReturn'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'quickSettle', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'quickSettle'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeFocusAndAddPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeFocusAndAddPay'), _class.prototype), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'updateMemberInfo', [_mobx.action], {
1619
1981
  enumerable: true,
1620
1982
  initializer: function initializer() {
1621
- var _this13 = this;
1983
+ var _this15 = this;
1622
1984
 
1623
1985
  return function () {
1624
- var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(_this) {
1986
+ var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(_this) {
1625
1987
  var _getLoginInfo, IdStore, StoreCode, resp;
1626
1988
 
1627
- return _regenerator2.default.wrap(function _callee7$(_context7) {
1989
+ return _regenerator2.default.wrap(function _callee12$(_context12) {
1628
1990
  while (1) {
1629
- switch (_context7.prev = _context7.next) {
1991
+ switch (_context12.prev = _context12.next) {
1630
1992
  case 0:
1631
- _getLoginInfo = _this13.getLoginInfo(), IdStore = _getLoginInfo.IdStore, StoreCode = _getLoginInfo.StoreCode;
1632
- _context7.next = 3;
1633
- return (0, _tplusApi.tApi)({ Idmember: _this13.member.ID, IdStore: IdStore, StoreCode: StoreCode }, 'chanjet.AA.DR.INewRetailMember.GetUmemberDTO', false, false);
1993
+ _getLoginInfo = _this15.getLoginInfo(), IdStore = _getLoginInfo.IdStore, StoreCode = _getLoginInfo.StoreCode;
1994
+ _context12.next = 3;
1995
+ return (0, _tplusApi.tApi)({ Idmember: _this15.member.ID, IdStore: IdStore, StoreCode: StoreCode }, 'chanjet.AA.DR.INewRetailMember.GetUmemberDTO', false, false);
1634
1996
 
1635
1997
  case 3:
1636
- resp = _context7.sent;
1998
+ resp = _context12.sent;
1637
1999
 
1638
2000
  _this.member = resp;
1639
2001
  _this.paymode.updateMemberStorageCardNo(resp.StorageCardNo, resp.WalletEnabled);
1640
- return _context7.abrupt('return', _promise2.default.resolve(resp));
2002
+ return _context12.abrupt('return', _promise2.default.resolve(resp));
1641
2003
 
1642
2004
  case 7:
1643
2005
  case 'end':
1644
- return _context7.stop();
2006
+ return _context12.stop();
1645
2007
  }
1646
2008
  }
1647
- }, _callee7, _this13);
2009
+ }, _callee12, _this15);
1648
2010
  }));
1649
2011
 
1650
- return function (_x5) {
1651
- return _ref17.apply(this, arguments);
2012
+ return function (_x10) {
2013
+ return _ref25.apply(this, arguments);
1652
2014
  };
1653
2015
  }();
1654
2016
  }
1655
2017
  }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, 'updateCurrentMode', [_mobx.action], {
1656
2018
  enumerable: true,
1657
2019
  initializer: function initializer() {
1658
- var _this14 = this;
2020
+ var _this16 = this;
1659
2021
 
1660
2022
  return function () {
1661
- var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(memberId) {
2023
+ var _ref26 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(memberId) {
1662
2024
  var result;
1663
- return _regenerator2.default.wrap(function _callee8$(_context8) {
2025
+ return _regenerator2.default.wrap(function _callee13$(_context13) {
1664
2026
  while (1) {
1665
- switch (_context8.prev = _context8.next) {
2027
+ switch (_context13.prev = _context13.next) {
1666
2028
  case 0:
1667
- _context8.next = 2;
2029
+ _context13.next = 2;
1668
2030
  return (0, _tplusApi.ccApi)({}, '/marketingtool/MeStorageCard/getCardInfoByMemberId/' + memberId + '/' + true, false, false, { method: 'get' });
1669
2031
 
1670
2032
  case 2:
1671
- result = _context8.sent;
2033
+ result = _context13.sent;
1672
2034
 
1673
2035
  if (!(result && result.data.length)) {
1674
- _context8.next = 20;
2036
+ _context13.next = 20;
1675
2037
  break;
1676
2038
  }
1677
2039
 
1678
2040
  if (!(result.data.length === 1)) {
1679
- _context8.next = 9;
2041
+ _context13.next = 9;
1680
2042
  break;
1681
2043
  }
1682
2044
 
1683
- _this14.paymode.updateCardInfo(result.data[0]);
1684
- return _context8.abrupt('return', result.data);
2045
+ _this16.paymode.updateCardInfo(result.data[0]);
2046
+ return _context13.abrupt('return', result.data);
1685
2047
 
1686
2048
  case 9:
1687
2049
  if (!(result.data && result.data.length === 1)) {
1688
- _context8.next = 14;
2050
+ _context13.next = 14;
1689
2051
  break;
1690
2052
  }
1691
2053
 
1692
- _this14.paymode.updateCardInfo(result.data[0]);
1693
- return _context8.abrupt('return', result.data);
2054
+ _this16.paymode.updateCardInfo(result.data[0]);
2055
+ return _context13.abrupt('return', result.data);
1694
2056
 
1695
2057
  case 14:
1696
2058
  if (!(result.data && result.data.length > 1)) {
1697
- _context8.next = 18;
2059
+ _context13.next = 18;
1698
2060
  break;
1699
2061
  }
1700
2062
 
1701
- return _context8.abrupt('return', result.data);
2063
+ return _context13.abrupt('return', result.data);
1702
2064
 
1703
2065
  case 18:
1704
2066
  _message2.default.warn('没有可用储值卡!');
1705
- return _context8.abrupt('return', false);
2067
+ return _context13.abrupt('return', false);
1706
2068
 
1707
2069
  case 20:
1708
2070
  case 'end':
1709
- return _context8.stop();
2071
+ return _context13.stop();
1710
2072
  }
1711
2073
  }
1712
- }, _callee8, _this14);
2074
+ }, _callee13, _this16);
1713
2075
  }));
1714
2076
 
1715
- return function (_x6) {
1716
- return _ref18.apply(this, arguments);
2077
+ return function (_x11) {
2078
+ return _ref26.apply(this, arguments);
1717
2079
  };
1718
2080
  }();
1719
2081
  }
1720
2082
  }), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, 'updateCardInfo', [_mobx.action], {
1721
2083
  enumerable: true,
1722
2084
  initializer: function initializer() {
1723
- var _this15 = this;
2085
+ var _this17 = this;
1724
2086
 
1725
- return (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9() {
2087
+ return (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14() {
1726
2088
  var address, result;
1727
- return _regenerator2.default.wrap(function _callee9$(_context9) {
2089
+ return _regenerator2.default.wrap(function _callee14$(_context14) {
1728
2090
  while (1) {
1729
- switch (_context9.prev = _context9.next) {
2091
+ switch (_context14.prev = _context14.next) {
1730
2092
  case 0:
1731
- address = '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + _this15.paymode.currentMode.storageCardNo;
1732
- _context9.next = 3;
2093
+ address = '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + _this17.paymode.currentMode.storageCardNo;
2094
+ _context14.next = 3;
1733
2095
  return (0, _tplusApi.ccApi)({}, address, false, false, { method: 'get', timeout_skip: true });
1734
2096
 
1735
2097
  case 3:
1736
- result = _context9.sent;
2098
+ result = _context14.sent;
1737
2099
 
1738
- _this15.paymode.updateCardInfo(result.data);
2100
+ _this17.paymode.updateCardInfo(result.data);
1739
2101
 
1740
2102
  case 5:
1741
2103
  case 'end':
1742
- return _context9.stop();
2104
+ return _context14.stop();
1743
2105
  }
1744
2106
  }
1745
- }, _callee9, _this15);
2107
+ }, _callee14, _this17);
1746
2108
  }));
1747
2109
  }
1748
2110
  }), _applyDecoratedDescriptor(_class.prototype, 'addDjq', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addDjq'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeFocusOnly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeFocusOnly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeClickFocusOnly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeClickFocusOnly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeValue'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'addPayDirectly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addPayDirectly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'addPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addPay'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'delPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'delPay'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'setDtoID', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'setDtoID'), _class.prototype)), _class);
@@ -1843,7 +2205,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
1843
2205
  }, {
1844
2206
  key: 'calcDjqCheckValue',
1845
2207
  value: function calcDjqCheckValue(q1, dto, params) {
1846
- var _this16 = this;
2208
+ var _this18 = this;
1847
2209
 
1848
2210
  var useLimitPerOrder = (0, _tplusPoslogin.PosInitData)('UseLimitPerOrder');
1849
2211
  var qList = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
@@ -1857,12 +2219,12 @@ var PayMode = exports.PayMode = (_class3 = function () {
1857
2219
  this.checkList = [];
1858
2220
  }
1859
2221
 
1860
- var _ref20 = _mutantsUtil.platform || {},
1861
- isNewRetailBCPos = _ref20.isNewRetailBCPos;
2222
+ var _ref28 = _mutantsUtil.platform || {},
2223
+ isNewRetailBCPos = _ref28.isNewRetailBCPos;
1862
2224
 
1863
- var _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(),
1864
- PayStyle = _enumController$getEn16.PayStyle,
1865
- Differentiate = _enumController$getEn16.Differentiate;
2225
+ var _enumController$getEn18 = _mutantsUtil.enumController.getEnumOj(),
2226
+ PayStyle = _enumController$getEn18.PayStyle,
2227
+ Differentiate = _enumController$getEn18.Differentiate;
1866
2228
 
1867
2229
  if (q1) {
1868
2230
  if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
@@ -1890,7 +2252,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
1890
2252
  if (!q1.checked) {
1891
2253
  this.checkList.forEach(function (ele, i) {
1892
2254
  if (ele.id === q1.id) {
1893
- _this16.checkList.splice(i, 1);
2255
+ _this18.checkList.splice(i, 1);
1894
2256
  }
1895
2257
  });
1896
2258
  } else {
@@ -1962,24 +2324,24 @@ var PayMode = exports.PayMode = (_class3 = function () {
1962
2324
  if (result && result.length != 0) {
1963
2325
  result.forEach(function (element, index) {
1964
2326
  var djq1 = false;
1965
- _this16.currentMode.djqs.forEach(function (djq) {
2327
+ _this18.currentMode.djqs.forEach(function (djq) {
1966
2328
  if (element.id === djq.id) {
1967
2329
  djq1 = true;
1968
2330
  }
1969
2331
  });
1970
2332
 
1971
- var _ref21 = element || {},
1972
- couponCode = _ref21.couponCode,
1973
- name = _ref21.name,
1974
- tieredAmountResult = _ref21.tieredAmountResult,
1975
- fromDate = _ref21.fromDate,
1976
- dateMount = _ref21.dateMount,
1977
- promoMethodEnum = _ref21.promoMethodEnum,
1978
- discountPct = _ref21.discountPct,
1979
- nominalAmount = _ref21.nominalAmount,
1980
- promoId = _ref21.promoId,
1981
- id = _ref21.id,
1982
- doorsill = _ref21.doorsill;
2333
+ var _ref29 = element || {},
2334
+ couponCode = _ref29.couponCode,
2335
+ name = _ref29.name,
2336
+ tieredAmountResult = _ref29.tieredAmountResult,
2337
+ fromDate = _ref29.fromDate,
2338
+ dateMount = _ref29.dateMount,
2339
+ promoMethodEnum = _ref29.promoMethodEnum,
2340
+ discountPct = _ref29.discountPct,
2341
+ nominalAmount = _ref29.nominalAmount,
2342
+ promoId = _ref29.promoId,
2343
+ id = _ref29.id,
2344
+ doorsill = _ref29.doorsill;
1983
2345
 
1984
2346
  var condValue = tieredAmountResult.condValue,
1985
2347
  promoDiscount = tieredAmountResult.promoDiscount,
@@ -2007,10 +2369,10 @@ var PayMode = exports.PayMode = (_class3 = function () {
2007
2369
  // couponCategoryEnum: tieredAmountResult.couponCategoryEnum,
2008
2370
  // id
2009
2371
  // })
2010
- _this16.addDjqs(couponCode, name, true, nominalAmount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
2372
+ _this18.addDjqs(couponCode, name, true, nominalAmount, promoDiscount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
2011
2373
  djq1 = false;
2012
2374
  } else {
2013
- _this16.setCouponNum(element.id, tieredAmountResult.couponCategoryEnum, promoMethodEnum, nominalAmount, promoDiscount);
2375
+ _this18.setCouponNum(element.id, couponCategoryEnum, promoMethodEnum, nominalAmount, promoDiscount);
2014
2376
  // this.currentMode.djqs[0].couponCategoryEnum = 'couponCategoryEnum';
2015
2377
  // djq1.couponCategoryEnum = element.tieredAmountResult.couponCategoryEnum
2016
2378
  }
@@ -2023,11 +2385,11 @@ var PayMode = exports.PayMode = (_class3 = function () {
2023
2385
  }, {
2024
2386
  key: 'calcDjqValue',
2025
2387
  value: function calcDjqValue(q1) {
2026
- var _ref22 = _mutantsUtil.platform || {},
2027
- isNewRetailBCPos = _ref22.isNewRetailBCPos;
2388
+ var _ref30 = _mutantsUtil.platform || {},
2389
+ isNewRetailBCPos = _ref30.isNewRetailBCPos;
2028
2390
 
2029
- var _enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(),
2030
- Differentiate = _enumController$getEn17.Differentiate;
2391
+ var _enumController$getEn19 = _mutantsUtil.enumController.getEnumOj(),
2392
+ Differentiate = _enumController$getEn19.Differentiate;
2031
2393
 
2032
2394
  if (q1) {
2033
2395
  if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
@@ -2089,8 +2451,8 @@ var PayMode = exports.PayMode = (_class3 = function () {
2089
2451
  this.currentMode.errinfo = '';
2090
2452
  var sum = this.amount;
2091
2453
 
2092
- var _enumController$getEn18 = _mutantsUtil.enumController.getEnumOj(),
2093
- PayStyle = _enumController$getEn18.PayStyle;
2454
+ var _enumController$getEn20 = _mutantsUtil.enumController.getEnumOj(),
2455
+ PayStyle = _enumController$getEn20.PayStyle;
2094
2456
 
2095
2457
  this.thePaymodes && this.thePaymodes.forEach(function (mode) {
2096
2458
  if (mode.paymentType === PayStyle.hyczk) {
@@ -2105,19 +2467,6 @@ var PayMode = exports.PayMode = (_class3 = function () {
2105
2467
  } else if (parseFloat(v) > 0 && parseFloat(v) > (max || 0)) {
2106
2468
  this.currentMode.errinfo = "余额不足";
2107
2469
  }
2108
- // 如果是积分抵现的一些判断
2109
- if (this.currentMode.paymentType === PayStyle.jfdx) {
2110
- if (this.currentMode.integralCashOverOrderAmount === true) {
2111
- this.currentMode.steadCashIntegral = Math.ceil(this.currentMode.value / this.currentMode.cashAmount) * this.currentMode.perIntegral;
2112
- } else if (this.currentMode.integralCashOverOrderAmount === false) {
2113
- var v1 = this.currentMode.value / this.currentMode.cashAmount;
2114
- if ((0, _isInteger2.default)(v1)) {
2115
- this.currentMode.steadCashIntegral = Math.floor(this.currentMode.value / this.currentMode.cashAmount) * this.currentMode.perIntegral;
2116
- } else {
2117
- this.currentMode.errinfo = '\u8BF7\u6309\u7167\u79EF\u5206\u62B5\u73B0\u89C4\u5219' + this.currentMode.perIntegral + '\u79EF\u5206\u62B5\u7528' + this.currentMode.cashAmount + '\u5143\u8F93\u5165\u91D1\u989D';
2118
- }
2119
- }
2120
- }
2121
2470
  }
2122
2471
  }, {
2123
2472
  key: 'calcMemberBalance',
@@ -2127,30 +2476,36 @@ var PayMode = exports.PayMode = (_class3 = function () {
2127
2476
  }, {
2128
2477
  key: 'setPaymodes',
2129
2478
  value: function () {
2130
- var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(type, isIntegralExchange) {
2131
- var _this17 = this;
2479
+ var _ref31 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(type, isIntegralExchange) {
2480
+ var _this19 = this;
2132
2481
 
2133
- var _enumController$getEn19, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
2482
+ var _ref32, isHorizontalPad, isHorizontalSunMi, isMobileEnvironment, _enumController$getEn21, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
2134
2483
 
2135
- return _regenerator2.default.wrap(function _callee10$(_context10) {
2484
+ return _regenerator2.default.wrap(function _callee15$(_context15) {
2136
2485
  while (1) {
2137
- switch (_context10.prev = _context10.next) {
2486
+ switch (_context15.prev = _context15.next) {
2138
2487
  case 0:
2139
- _enumController$getEn19 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn19.settleStyleType, PayStyle = _enumController$getEn19.PayStyle;
2488
+ // 是否移动端判断
2489
+ _ref32 = _mutantsUtil.platform || {}, isHorizontalPad = _ref32.isHorizontalPad, isHorizontalSunMi = _ref32.isHorizontalSunMi;
2490
+ isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi;
2491
+ _enumController$getEn21 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn21.settleStyleType, PayStyle = _enumController$getEn21.PayStyle;
2140
2492
  memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
2141
2493
  param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
2142
- _context10.next = 5;
2494
+ _context15.next = 7;
2143
2495
  return (0, _tplusApi.tApi)({ param: param }, 'chanjet.RE.NewPos.GetNewStoreSettleStyles', false, false);
2144
2496
 
2145
- case 5:
2146
- modes = _context10.sent;
2497
+ case 7:
2498
+ modes = _context15.sent;
2147
2499
 
2148
2500
  if (modes) {
2149
2501
  (0, _mobx.runInAction)(function () {
2150
2502
  var paymodes = [];
2151
- (0, _each3.default)(modes.SettleStyles, function (mode, index) {
2503
+ var settleLists = modes.SettleStyles;
2504
+ settleLists = isMobileEnvironment ? settleLists.filter(function (v) {
2505
+ return !v.ThirdPaymentInfo;
2506
+ }) : settleLists;
2507
+ (0, _each3.default)(settleLists, function (mode, index) {
2152
2508
  //产品需求确认会员储值卡结算方式前端展示统一调整为“储值卡" tuzha by 2020-07-08
2153
-
2154
2509
  if (mode.Code == PayStyle.hyczk) {
2155
2510
  mode.Name = '储值卡';
2156
2511
  }
@@ -2165,24 +2520,24 @@ var PayMode = exports.PayMode = (_class3 = function () {
2165
2520
  idBankAccount: mode.IdBankAccount,
2166
2521
  exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
2167
2522
  idCurrency: mode.Currency ? mode.Currency.ID : -1,
2168
- calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88"
2523
+ calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88",
2524
+ thridPayment: mode.ThirdPaymentInfo
2169
2525
  });
2170
2526
  });
2171
- _this17.paymodes = paymodes;
2172
- //modes.QuickSettleStyles
2527
+ _this19.paymodes = paymodes;
2173
2528
  });
2174
2529
  }
2175
2530
 
2176
- case 7:
2531
+ case 9:
2177
2532
  case 'end':
2178
- return _context10.stop();
2533
+ return _context15.stop();
2179
2534
  }
2180
2535
  }
2181
- }, _callee10, this);
2536
+ }, _callee15, this);
2182
2537
  }));
2183
2538
 
2184
- function setPaymodes(_x7, _x8) {
2185
- return _ref23.apply(this, arguments);
2539
+ function setPaymodes(_x12, _x13) {
2540
+ return _ref31.apply(this, arguments);
2186
2541
  }
2187
2542
 
2188
2543
  return setPaymodes;
@@ -2237,21 +2592,22 @@ var PayMode = exports.PayMode = (_class3 = function () {
2237
2592
  }), _applyDecoratedDescriptor(_class3.prototype, 'clean', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clean'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clear', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clear'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcReserved', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcReserved'), _class3.prototype), _descriptor12 = _applyDecoratedDescriptor(_class3.prototype, 'calcCheckList', [_mobx.action], {
2238
2593
  enumerable: true,
2239
2594
  initializer: function initializer() {
2240
- var _this18 = this;
2595
+ var _this20 = this;
2241
2596
 
2242
2597
  return function () {
2243
- _this18.checkList = [];
2598
+ _this20.checkList = [];
2244
2599
  };
2245
2600
  }
2246
2601
  }), _applyDecoratedDescriptor(_class3.prototype, 'updateMemberStorageCardNo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'updateMemberStorageCardNo'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'updateCardInfo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'updateCardInfo'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqCheckValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqCheckValue'), _class3.prototype), _descriptor13 = _applyDecoratedDescriptor(_class3.prototype, 'setCouponNum', [_mobx.action], {
2247
2602
  enumerable: true,
2248
2603
  initializer: function initializer() {
2249
- var _this19 = this;
2604
+ var _this21 = this;
2250
2605
 
2251
2606
  return function (id, couponNum, promoMethodEnum, nominalAmount, promoDiscount) {
2252
- _this19.currentMode.djqs.forEach(function (ele) {
2607
+ _this21.currentMode.djqs.forEach(function (ele) {
2253
2608
  if (ele.id === id) {
2254
- promoMethodEnum == "CASH_COUPON" ? ele.amount = nominalAmount : ele.amount = promoDiscount;
2609
+ ele.amount = promoDiscount;
2610
+ promoMethodEnum == "CASH_COUPON" && (ele.nominalAmount = nominalAmount);
2255
2611
  ele.couponCategoryEnum = couponNum;
2256
2612
  var IsEnable = ele.couponCategoryEnum === 'RIGUP' || ele.couponCategoryEnum === 'UN_MATCH' || ele.couponCategoryEnum === "PREPARING" || ele.couponCategoryEnum === 'PROMO_LIMITED' || ele.couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
2257
2613
  ele.IsEnable = IsEnable;
@@ -2262,13 +2618,14 @@ var PayMode = exports.PayMode = (_class3 = function () {
2262
2618
  }), _descriptor14 = _applyDecoratedDescriptor(_class3.prototype, 'addDjqs', [_mobx.action], {
2263
2619
  enumerable: true,
2264
2620
  initializer: function initializer() {
2265
- var _this20 = this;
2621
+ var _this22 = this;
2266
2622
 
2267
- return function (promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
2623
+ return function (promoCouponCode, name, IsEnable, nominalAmount, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
2268
2624
  var djq = {
2269
2625
  promoCouponCode: promoCouponCode,
2270
2626
  name: name,
2271
2627
  IsEnable: IsEnable,
2628
+ nominalAmount: nominalAmount,
2272
2629
  amount: amount,
2273
2630
  doorsill: doorsill,
2274
2631
  LastTS: LastTS,
@@ -2284,13 +2641,13 @@ var PayMode = exports.PayMode = (_class3 = function () {
2284
2641
  couponCategoryEnum: couponCategoryEnum,
2285
2642
  id: id
2286
2643
  };
2287
- _this20.currentMode.djqs.push(djq);
2644
+ _this22.currentMode.djqs.push(djq);
2288
2645
  };
2289
2646
  }
2290
2647
  }), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'reCalculationDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'reCalculationDjqs'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clearDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clearDjqs'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'setCurrentModeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'setCurrentModeValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcMemberBalance', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcMemberBalance'), _class3.prototype)), _class3);
2291
2648
  var Member = exports.Member = (_class5 = function () {
2292
2649
  function Member(m) {
2293
- var _this21 = this;
2650
+ var _this23 = this;
2294
2651
 
2295
2652
  (0, _classCallCheck3.default)(this, Member);
2296
2653
 
@@ -2313,15 +2670,15 @@ var Member = exports.Member = (_class5 = function () {
2313
2670
  return key == 'canusedbalancestorage';
2314
2671
  });
2315
2672
 
2316
- var _ref24 = _mutantsUtil.platform || {},
2317
- isNewRetailBCPos = _ref24.isNewRetailBCPos;
2673
+ var _ref33 = _mutantsUtil.platform || {},
2674
+ isNewRetailBCPos = _ref33.isNewRetailBCPos;
2318
2675
 
2319
2676
  (0, _mobx.runInAction)(function () {
2320
- _this21.cardNo = m.CardCode;
2677
+ _this23.cardNo = m.CardCode;
2321
2678
  if (index >= 0) {
2322
- _this21.balance = parseFloat(m.DynamicPropertyValues[index]);
2679
+ _this23.balance = parseFloat(m.DynamicPropertyValues[index]);
2323
2680
  } else {
2324
- _this21.balance = _this21.rawbalance;
2681
+ _this23.balance = _this23.rawbalance;
2325
2682
  }
2326
2683
  });
2327
2684
  this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;