tplus-member 3.31.2 → 3.31.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -109,11 +109,11 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
109
109
  function MemberTag(props) {
110
110
  (0, _classCallCheck3.default)(this, MemberTag);
111
111
 
112
- var _this2 = (0, _possibleConstructorReturn3.default)(this, (MemberTag.__proto__ || (0, _getPrototypeOf2.default)(MemberTag)).call(this, props));
112
+ var _this = (0, _possibleConstructorReturn3.default)(this, (MemberTag.__proto__ || (0, _getPrototypeOf2.default)(MemberTag)).call(this, props));
113
113
 
114
- _initialiseProps.call(_this2);
114
+ _initialiseProps.call(_this);
115
115
 
116
- _this2.hasElectron = hasElectron;
116
+ _this.hasElectron = hasElectron;
117
117
 
118
118
  var _ref = _mutantsMicrofx.stores.user.options.get('loginInfo') || {},
119
119
  isMemberInputType = _ref.isMemberInputType,
@@ -122,41 +122,44 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
122
122
  ICCardServer = _ref.ICCardServer,
123
123
  ICCardPassword = _ref.ICCardPassword;
124
124
 
125
- _this2.isMemberInputType = parseInt(isMemberInputType); // '0'为不禁用 '1'为禁用
126
- _this2.isStorageCardInputType = MemberMeStorageCardInputByKeyBoard; // 仅储值卡是否禁用键盘输入,'0'为不禁用 '1'为禁用
127
- _this2.openFaceRecognition = parseInt(OpenFaceRecognition); // 启用人脸识别:0禁用 1为启用
128
- _this2.iCCardServer = parseInt(ICCardServer); // 启用IC卡:0为禁用 1为启用
129
- _this2.iCCardPassword = ICCardPassword; //IC卡密码
130
- _this2.ms = _api2.default;
125
+ _this.isMemberInputType = parseInt(isMemberInputType); // '0'为不禁用 '1'为禁用
126
+ _this.isStorageCardInputType = MemberMeStorageCardInputByKeyBoard; // 仅储值卡是否禁用键盘输入,'0'为不禁用 '1'为禁用
127
+ _this.openFaceRecognition = parseInt(OpenFaceRecognition); // 启用人脸识别:0禁用 1为启用
128
+ _this.iCCardServer = parseInt(ICCardServer); // 启用IC卡:0为禁用 1为启用
129
+ _this.iCCardPassword = ICCardPassword; //IC卡密码
130
+ _this.ms = _api2.default;
131
131
  //移动端环境下,没有读取IC卡的方式。
132
132
 
133
133
  var _ref2 = _mutantsUtil.platform || {},
134
134
  isHorizontalPad = _ref2.isHorizontalPad,
135
135
  isHorizontalSunMi = _ref2.isHorizontalSunMi;
136
136
 
137
- _this2.isHorizontalPad = !!isHorizontalPad;
138
- _this2.isHorizontalSunMi = !!isHorizontalSunMi;
139
- _this2.isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi;
140
- _this2.handleReadICard = _this2.handleReadICard.bind(_this2);
137
+ _this.isHorizontalPad = !!isHorizontalPad;
138
+ _this.isHorizontalSunMi = !!isHorizontalSunMi;
139
+ _this.isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi;
140
+ _this.handleReadICard = _this.handleReadICard.bind(_this);
141
141
 
142
142
  //记录键盘录入信息的开始时间
143
- _this2.keypressStime = null;
144
- _this2.iseyboardKEnter = false; //是否为键盘输入
143
+ _this.keypressStime = null;
144
+ _this.iseyboardKEnter = false; //是否为键盘输入
145
145
 
146
146
  var _ref3 = _mutantsUtil.platform || {},
147
147
  isNewRetailBCPos = _ref3.isNewRetailBCPos;
148
148
 
149
- _this2.state = {
149
+ _this.state = {
150
150
  isCC: !!isNewRetailBCPos,
151
151
  isShowBirthdayTip: false
152
152
  };
153
- return _this2;
153
+
154
+ //是否单据模式
155
+ _this.isVoucherMode = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('voucherDefaultPosMode') == 'voucher';
156
+ return _this;
154
157
  }
155
158
 
156
159
  (0, _createClass3.default)(MemberTag, [{
157
160
  key: 'componentWillReact',
158
161
  value: function componentWillReact() {
159
- var _this3 = this;
162
+ var _this2 = this;
160
163
 
161
164
  var _ref4 = this.context.viewModel || {},
162
165
  _ref4$data = _ref4.data;
@@ -173,8 +176,8 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
173
176
  var memberChangeData = (0, _keys2.default)(selectMemberInfo).length ? selectMemberInfo : undefined;
174
177
 
175
178
  var memberChange = function memberChange(data) {
176
- _this3.setState({ newAvatar: '' });
177
- _this3.props.memberChange(data);
179
+ _this2.setState({ newAvatar: '' });
180
+ _this2.props.memberChange(data);
178
181
  };
179
182
  if ((typeof memberChangeData === 'undefined' ? 'undefined' : (0, _typeof3.default)(memberChangeData)) === 'object') {
180
183
  var deepCloneMember = JSON.parse((0, _stringify2.default)(memberChangeData));
@@ -224,7 +227,7 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
224
227
 
225
228
  //IC卡连接
226
229
  value: function connectRfCard() {
227
- var _this4 = this;
230
+ var _this3 = this;
228
231
 
229
232
  //客户端环境下,并开启了启用IC卡。
230
233
  if (this.hasElectron === true && this.iCCardServer === 1) {
@@ -235,7 +238,7 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
235
238
  } else {
236
239
  result = { connectCardStatus: true, connectCardError: '' };
237
240
  }
238
- _this4.setState(result);
241
+ _this3.setState(result);
239
242
  });
240
243
  }
241
244
  }
@@ -245,7 +248,7 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
245
248
  }, {
246
249
  key: 'readRfCard',
247
250
  value: function readRfCard() {
248
- var _this5 = this;
251
+ var _this4 = this;
249
252
 
250
253
  //客户端环境下,并开启了启用IC卡。
251
254
  if (this.hasElectron === true && this.iCCardServer === 1) {
@@ -262,10 +265,10 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
262
265
  _mutantsMicrofx.nativeMs.setIpcRendererMethod('ReadRfCard', (0, _extends3.default)({}, params), function (ret) {
263
266
  if (ret.status === 0) {
264
267
  _tplusComponentsTouch.Message.error(ret.value);
265
- _this5.connectRfCard(); //读取失败后,重新连接一下。
268
+ _this4.connectRfCard(); //读取失败后,重新连接一下。
266
269
  return;
267
270
  } else if (ret.status === 1) {
268
- _this5.searchMember(ret.value);
271
+ _this4.searchMember(ret.value);
269
272
  }
270
273
  });
271
274
  }
@@ -295,7 +298,7 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
295
298
  }, {
296
299
  key: 'render',
297
300
  value: function render() {
298
- var _this6 = this;
301
+ var _this5 = this;
299
302
 
300
303
  var _state2 = this.state,
301
304
  memberPhoto = _state2.memberPhoto,
@@ -369,10 +372,10 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
369
372
  placeholder: '\u626B\u63CF/\u8F93\u5165\u4F1A\u5458\u53F7',
370
373
  value: searchValue,
371
374
  ref: function ref(el) {
372
- return _this6.inputSearch = el && el.input;
375
+ return _this5.inputSearch = el && el.input;
373
376
  },
374
377
  onChange: function onChange(e) {
375
- return _this6.handleSearch(e.target.value);
378
+ return _this5.handleSearch(e.target.value);
376
379
  },
377
380
  onFocus: this.handleFocus,
378
381
  onBlur: this.handleBlur,
@@ -393,7 +396,7 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
393
396
  'div',
394
397
  { className: 'openFaceRecognition-box' },
395
398
  _react2.default.createElement(_tplusComponentsTouch.Ticon, { className: 'icon', onClick: function onClick() {
396
- return _this6.loadFaceRecognition(2);
399
+ return _this5.loadFaceRecognition(2);
397
400
  }, type: 'renlianshibie' }),
398
401
  _react2.default.createElement(_tplusComponentsTouch.Spin, {
399
402
  className: 'face-spin',
@@ -405,7 +408,7 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
405
408
 
406
409
  /* 扫描组件 */
407
410
  this.isHorizontalPad && _react2.default.createElement(_tplusComponentsTouch.Scan, { ref: function ref(scan) {
408
- return _this6.scanObj = scan;
411
+ return _this5.scanObj = scan;
409
412
  }, onChange: this.onScanResult })
410
413
  )
411
414
  ),
@@ -434,13 +437,13 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
434
437
  _react2.default.createElement(_tplusComponentsTouch.Ticon, { type: 'cuowuda', className: 'cuowudaIcon' })
435
438
  ),
436
439
  memberCareInfo && memberCareInfo.isTicket && _react2.default.createElement(_tplusComponentsTouch.Ticon, { type: 'cuowuda', onClick: function onClick() {
437
- _this6.setIsShowBirthdayTip();
440
+ _this5.setIsShowBirthdayTip();
438
441
  }, className: 'cuowudaIcon' })
439
442
  ),
440
443
  _react2.default.createElement(
441
444
  'div',
442
445
  { className: 'second member-hotkey-info', onClick: function onClick() {
443
- return _this6.openShowModal(0);
446
+ return _this5.openShowModal(0);
444
447
  } },
445
448
  _react2.default.createElement(
446
449
  'div',
@@ -512,7 +515,7 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
512
515
  _react2.default.createElement(
513
516
  _button2.default,
514
517
  { type: 'primary', onClick: function onClick() {
515
- return _this6.loadFaceRecognition(1);
518
+ return _this5.loadFaceRecognition(1);
516
519
  }, className: 'btn', disabled: inShopLoading },
517
520
  !inShopLoading && '到店会员',
518
521
  _react2.default.createElement(_tplusComponentsTouch.Spin, {
@@ -668,7 +671,7 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
668
671
  }, _class2.defaultProps = {
669
672
  memberChange: function memberChange() {}
670
673
  }, _initialiseProps = function _initialiseProps() {
671
- var _this7 = this;
674
+ var _this6 = this;
672
675
 
673
676
  this.state = {
674
677
  searchValue: '',
@@ -686,15 +689,15 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
686
689
  };
687
690
 
688
691
  this.controllerEvent = function (methodName, methodArgs) {
689
- _this7.context.onEvent({ 'controllerEvent': _mutantsAppfx.Action.fromJS(_this7.context.viewModel, methodName) }, 'controllerEvent', methodArgs);
692
+ _this6.context.onEvent({ 'controllerEvent': _mutantsAppfx.Action.fromJS(_this6.context.viewModel, methodName) }, 'controllerEvent', methodArgs);
690
693
  };
691
694
 
692
695
  this.resetInShopMemberTimer = function (count) {
693
- _this7.timer && clearTimeout(_this7.timer);
696
+ _this6.timer && clearTimeout(_this6.timer);
694
697
  if (!count) return;
695
698
  var time = 5 * 60 * 1000;
696
- _this7.timer = setTimeout(function () {
697
- _this7.getInStoreMemberCount();
699
+ _this6.timer = setTimeout(function () {
700
+ _this6.getInStoreMemberCount();
698
701
  }, time);
699
702
  };
700
703
 
@@ -703,11 +706,11 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
703
706
  isNewRetailBCPos = _ref7.isNewRetailBCPos;
704
707
 
705
708
  if (!isNewRetailBCPos) {
706
- if (!_this7.openFaceRecognition) {
709
+ if (!_this6.openFaceRecognition) {
707
710
  _tplusComponentsTouch.Message.warn('未启用人脸识别,需要先开启人脸识别功能');
708
711
  return;
709
712
  }
710
- _this7.setState({
713
+ _this6.setState({
711
714
  memberPhoto: true,
712
715
  titleModal: '选择头像'
713
716
  });
@@ -717,31 +720,31 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
717
720
  this.openShowModal = function (status, res) {
718
721
  var title = '';
719
722
 
720
- var _ref8 = _this7.context.viewModel || {},
723
+ var _ref8 = _this6.context.viewModel || {},
721
724
  _ref8$data = _ref8.data;
722
725
 
723
726
  _ref8$data = _ref8$data === undefined ? {} : _ref8$data;
724
727
  var _ref8$data$Member = _ref8$data.Member,
725
728
  Member = _ref8$data$Member === undefined ? {} : _ref8$data$Member;
726
- var newAvatar = _this7.state.newAvatar;
729
+ var newAvatar = _this6.state.newAvatar;
727
730
 
728
731
  var jsMember = (0, _mobx.toJS)(Member);
729
732
  var updateMember = newAvatar ? (0, _extends3.default)({}, jsMember, { ImageFile: newAvatar }) : jsMember;
730
733
  switch (status) {
731
734
  case 0:
732
735
  title = '会员详情';
733
- _this7.setState({ viewMemberInfo: updateMember });
736
+ _this6.setState({ viewMemberInfo: updateMember });
734
737
  break;
735
738
  case 1:
736
739
  title = '到店会员';
737
- _this7.setState({ viewMemberInfo: res });
740
+ _this6.setState({ viewMemberInfo: res });
738
741
  break;
739
742
  case 2:
740
743
  title = '人脸识别';
741
- _this7.setState({ viewMemberInfo: res });
744
+ _this6.setState({ viewMemberInfo: res });
742
745
  break;
743
746
  }
744
- _this7.setState({
747
+ _this6.setState({
745
748
  status: status,
746
749
  memberShow: true,
747
750
  titleModal: title
@@ -749,9 +752,9 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
749
752
  };
750
753
 
751
754
  this.openCloseModal = function () {
752
- var setMemberFocus = _this7.props.setMemberFocus;
755
+ var setMemberFocus = _this6.props.setMemberFocus;
753
756
 
754
- var memberStore = _this7.context.viewModel && _this7.context.viewModel.items.find(function (el) {
757
+ var memberStore = _this6.context.viewModel && _this6.context.viewModel.items.find(function (el) {
755
758
  return el.name == 'MemberStore';
756
759
  });
757
760
  var uiState = memberStore.uiState;
@@ -765,7 +768,7 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
765
768
  title: '关闭会员',
766
769
  content: '' + (IsIntegralExchange ? "关闭会员将会清空商品信息!" : "确定要关闭该会员吗?"),
767
770
  onOk: function onOk() {
768
- _this7.ms.clearSeletMember();
771
+ _this6.ms.clearSeletMember();
769
772
  _mutantsMicrofx.stores.selectMemberStore.clearMemberCare();
770
773
  typeof setMemberFocus == 'function' && setMemberFocus();
771
774
  }
@@ -773,87 +776,98 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
773
776
  };
774
777
 
775
778
  this.handleCloseBirthdayModal = function () {
776
- _this7.ms.changeBirthdayShow(false);
779
+ _this6.ms.changeBirthdayShow(false);
777
780
  };
778
781
 
779
782
  this.handleMemberCareModal = function () {
780
- _this7.setState({ isMemberCareModal: true });
783
+ _this6.setState({ isMemberCareModal: true });
781
784
  };
782
785
 
783
786
  this.handleMemberCareModalCancel = function () {
784
- _this7.setState({ isMemberCareModal: false });
787
+ _this6.setState({ isMemberCareModal: false });
785
788
  };
786
789
 
787
790
  this.handleSearch = function (val) {
788
- _this7.setState({ searchValue: val });
791
+ _this6.setState({ searchValue: val });
789
792
  };
790
793
 
791
794
  this.handleFocus = function (el) {
792
- if (_this7.isMemberInputType) return;
793
- var _this = _this7;
794
- function cb() {
795
- _this.searchMember(undefined, 'ok');
795
+ if (_this6.isMemberInputType) return;
796
+ if (_this6.isVoucherMode) {
797
+ _tplusComponentsTouch.Keyboard.open(function (v) {
798
+ var value = _tplusComponentsTouch.Keyboard.getNewValue(_this6.inputSearch, _this6.inputSearch.value, v);
799
+ _this6.handleSearch(value);
800
+ }, function () {
801
+ _this6.searchMember(undefined, 'ok');
802
+ }, _this6.keyboardClose, 'ByMember', _mutantsMicrofx.localStore.get('ByMember'))();
803
+ } else {
804
+ _tplusComponentsTouch.Keyboard.open2(function (v) {
805
+ var value = _tplusComponentsTouch.Keyboard.getNewValue(_this6.inputSearch, _this6.inputSearch.value, v);
806
+ _this6.handleSearch(value);
807
+ }, function () {
808
+ _this6.searchMember(undefined, 'ok');
809
+ }, _this6.keyboardClose, 'ByMember', _mutantsMicrofx.localStore.get('ByMember'));
796
810
  }
797
- _tplusComponentsTouch.Keyboard.open2(function (v) {
798
- var value = _tplusComponentsTouch.Keyboard.getNewValue(_this7.inputSearch, _this7.inputSearch.value, v);
799
- _this7.handleSearch(value);
800
- }, cb, _this7.keyboardClose, 'ByMember', _mutantsMicrofx.localStore.get('ByMember'));
801
811
  };
802
812
 
803
813
  this.keyboardClose = function () {
804
- _this7.inputSearch.blur();
814
+ _this6.inputSearch.blur();
805
815
  };
806
816
 
807
817
  this.handleBlur = function () {
808
- _tplusComponentsTouch.Keyboard.close2();
818
+ if (_this6.isVoucherMode) {
819
+ _tplusComponentsTouch.Keyboard.close();
820
+ } else {
821
+ _tplusComponentsTouch.Keyboard.close2();
822
+ }
809
823
  };
810
824
 
811
825
  this.handleReadICard = function () {
812
- _this7.readRfCard();
826
+ _this6.readRfCard();
813
827
  };
814
828
 
815
829
  this.handleShowModal = function (type, params) {
816
830
  if (params) {
817
- _this7.setState({ dtMember: params, memberShow: type });
831
+ _this6.setState({ dtMember: params, memberShow: type });
818
832
  } else {
819
- _this7.setState({ memberShow: type });
833
+ _this6.setState({ memberShow: type });
820
834
  }
821
835
  };
822
836
 
823
837
  this.handlePhotoModal = function (type, newAvatar) {
824
838
  if (newAvatar) {
825
- _this7.setState({
839
+ _this6.setState({
826
840
  newAvatar: newAvatar,
827
841
  memberPhoto: type
828
842
  });
829
843
  } else {
830
- _this7.setState({ memberPhoto: type });
844
+ _this6.setState({ memberPhoto: type });
831
845
  }
832
846
  };
833
847
 
834
848
  this.searchMember = function (val, type) {
835
849
  if (!_mutantsMicrofx.stores.offlineSys.shouldInOffline()) return;
836
- if (!_this7.ms || _this7.searchLoading) return;
837
- var searchValue = _this7.state.searchValue;
850
+ if (!_this6.ms || _this6.searchLoading) return;
851
+ var searchValue = _this6.state.searchValue;
838
852
 
839
853
  val = val || (searchValue || '').trim();
840
854
  if (!val) return;
841
- var _props2 = _this7.props,
855
+ var _props2 = _this6.props,
842
856
  memberSearched = _props2.memberSearched,
843
857
  selectMemberSuccess = _props2.selectMemberSuccess,
844
858
  setMemberFocus = _props2.setMemberFocus,
845
859
  getMemberBirthday = _props2.getMemberBirthday,
846
860
  getMeStorageCard = _props2.getMeStorageCard;
847
861
 
848
- _this7.searchLoading = true;
849
- _this7.setState({ searchVisible: true });
850
- _this7.ms.getSearchMember({
862
+ _this6.searchLoading = true;
863
+ _this6.setState({ searchVisible: true });
864
+ _this6.ms.getSearchMember({
851
865
  currentPage: 1,
852
866
  pageSize: 10,
853
867
  key: val,
854
868
  isSingleMember: false
855
869
  }).then(function (ret) {
856
- _this7.searchLoading = false;
870
+ _this6.searchLoading = false;
857
871
 
858
872
  var _ref9 = ret || {},
859
873
  columnInfo = _ref9.ColumnInfo,
@@ -861,11 +875,11 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
861
875
 
862
876
  var data = JSON.parse(Data) || [];
863
877
  var info = data[0];
864
- _this7.setState({ searchVisible: false, columnInfo: columnInfo });
865
- if (info && info.MemberType && info.MemberType.IsStorage && _this7.isStorageCardInputType && _this7.iseyboardKEnter) {
878
+ _this6.setState({ searchVisible: false, columnInfo: columnInfo });
879
+ if (info && info.MemberType && info.MemberType.IsStorage && _this6.isStorageCardInputType && _this6.iseyboardKEnter) {
866
880
  getMeStorageCard && getMeStorageCard(true);
867
- _this7.handleSearch('');
868
- _this7.keypressStime = null;
881
+ _this6.handleSearch('');
882
+ _this6.keypressStime = null;
869
883
  } else {
870
884
  getMeStorageCard && getMeStorageCard(false);
871
885
  }
@@ -879,18 +893,18 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
879
893
  subKey: 'memberManager',
880
894
  listArr: data
881
895
  });
882
- _this7.setState({
896
+ _this6.setState({
883
897
  searchValue: null
884
898
  });
885
899
  } else {
886
900
  memberSearched && memberSearched(info, 'searched');
887
901
  (0, _utils.userInfoFormat)(info);
888
902
  if ((0, _utils.errMessageTip)(info)) return;
889
- _this7.ms.seletMember(info, true);
903
+ _this6.ms.seletMember(info, true);
890
904
  setTimeout(function () {
891
- return _this7.setState({ searchValue: '' });
905
+ return _this6.setState({ searchValue: '' });
892
906
  }, 0);
893
- _this7.handleBlur();
907
+ _this6.handleBlur();
894
908
  selectMemberSuccess && selectMemberSuccess();
895
909
  getMemberBirthday && getMemberBirthday(info.ID, function (result) {
896
910
  _mutantsMicrofx.stores.selectMemberStore.changeMemberCare(result);
@@ -899,58 +913,58 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
899
913
  } else {
900
914
  if (type === 'ok') {
901
915
  _tplusComponentsTouch.Message.warn('会员不存在');
902
- if (_this7.isMobileEnvironment) {
916
+ if (_this6.isMobileEnvironment) {
903
917
  setTimeout(function () {
904
- return _this7.setState({ searchValue: '' });
918
+ return _this6.setState({ searchValue: '' });
905
919
  }, 0);
906
920
  }
907
921
  typeof setMemberFocus == 'function' && setMemberFocus();
908
922
  }
909
923
  }
910
924
  }).catch(function (err) {
911
- _this7.setState({ searchVisible: false });
912
- _this7.searchLoading = false;
925
+ _this6.setState({ searchVisible: false });
926
+ _this6.searchLoading = false;
913
927
  memberSearched && memberSearched(undefined, 'err');
914
928
  });
915
929
  };
916
930
 
917
931
  this.getInStoreMemberCount = function () {
918
- if (!_this7.ms) return;
919
- _this7.ms.getInStoreMemberCount().then(function (res) {
932
+ if (!_this6.ms) return;
933
+ _this6.ms.getInStoreMemberCount().then(function (res) {
920
934
  var _ref10 = res || {},
921
935
  _ref10$data = _ref10.data;
922
936
 
923
937
  _ref10$data = _ref10$data === undefined ? {} : _ref10$data;
924
938
  var shopPerson = _ref10$data.data;
925
939
 
926
- _this7.setState({ shopPerson: shopPerson });
927
- _this7.resetInShopMemberTimer(shopPerson);
940
+ _this6.setState({ shopPerson: shopPerson });
941
+ _this6.resetInShopMemberTimer(shopPerson);
928
942
  });
929
943
  };
930
944
 
931
945
  this.onKeyPressed = function (e) {
932
946
  var keyCode = e && e.keyCode;
933
947
  if (keyCode === 13) {
934
- if (_this7.isMemberInputType) {
935
- var stime = _this7.keypressStime;
948
+ if (_this6.isMemberInputType) {
949
+ var stime = _this6.keypressStime;
936
950
  var etime = Date.parse(new Date());
937
951
  if (etime - stime > 300) {
938
- _this7.handleSearch('');
939
- _this7.keypressStime = null;
952
+ _this6.handleSearch('');
953
+ _this6.keypressStime = null;
940
954
  return _tplusComponentsTouch.Message.warn('未启用键盘录入功能');
941
955
  }
942
- _this7.keypressStime = null;
956
+ _this6.keypressStime = null;
943
957
  }
944
- _this7.iseyboardKEnter = Date.parse(new Date()) - _this7.keypressStime > 300;
945
- if (_this7.isStorageCardInputType) {
946
- _this7.keypressStime = null;
958
+ _this6.iseyboardKEnter = Date.parse(new Date()) - _this6.keypressStime > 300;
959
+ if (_this6.isStorageCardInputType) {
960
+ _this6.keypressStime = null;
947
961
  }
948
- if (_this7.searchLoading) return;
949
- _this7.searchMember(undefined, 'ok');
950
- } else if (_this7.isMemberInputType && !_this7.keypressStime && !(keyCode == 8)) {
951
- _this7.keypressStime = Date.parse(new Date());
952
- } else if (_this7.isStorageCardInputType && !_this7.keypressStime && !(keyCode == 8) && !_this7.isMemberInputType) {
953
- _this7.keypressStime = Date.parse(new Date());
962
+ if (_this6.searchLoading) return;
963
+ _this6.searchMember(undefined, 'ok');
964
+ } else if (_this6.isMemberInputType && !_this6.keypressStime && !(keyCode == 8)) {
965
+ _this6.keypressStime = Date.parse(new Date());
966
+ } else if (_this6.isStorageCardInputType && !_this6.keypressStime && !(keyCode == 8) && !_this6.isMemberInputType) {
967
+ _this6.keypressStime = Date.parse(new Date());
954
968
  }
955
969
  };
956
970
 
@@ -978,35 +992,35 @@ var MemberTag = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_
978
992
 
979
993
  this.loadFaceRecognition = function (type) {
980
994
  // type = 1:到店会员 type = 2:POS机人脸识别
981
- _this7.setState({ faceLoading: type === 2, inShopLoading: type === 1 });
982
- _this7.ms.loadInStoreMember(String(type)).then(function (res) {
983
- _this7.setState({ faceLoading: false, inShopLoading: false });
995
+ _this6.setState({ faceLoading: type === 2, inShopLoading: type === 1 });
996
+ _this6.ms.loadInStoreMember(String(type)).then(function (res) {
997
+ _this6.setState({ faceLoading: false, inShopLoading: false });
984
998
 
985
999
  var _ref12 = res || {},
986
1000
  Data = _ref12.Data;
987
1001
 
988
1002
  if (!JSON.parse(Data).length) {
989
1003
  var tipMessage = ['当前没有到店会员', '未识别到人脸信息'];
990
- type === 1 && _this7.setState({ shopPerson: 0 });
1004
+ type === 1 && _this6.setState({ shopPerson: 0 });
991
1005
  return _tplusComponentsTouch.Message.info(tipMessage[type - 1]);
992
1006
  }
993
- type === 1 && _this7.getInStoreMemberCount();
994
- _this7.openShowModal(type, res);
1007
+ type === 1 && _this6.getInStoreMemberCount();
1008
+ _this6.openShowModal(type, res);
995
1009
  }).catch(function (err) {
996
- _this7.setState({ faceLoading: false, inShopLoading: false });
1010
+ _this6.setState({ faceLoading: false, inShopLoading: false });
997
1011
  console.log(err);
998
1012
  });
999
1013
  };
1000
1014
 
1001
1015
  this.changeScanProduct = function () {
1002
- if (_this7.scanObj) _this7.scanObj.startScan();
1016
+ if (_this6.scanObj) _this6.scanObj.startScan();
1003
1017
  };
1004
1018
 
1005
1019
  this.onScanResult = function (res) {
1006
- _this7.setState({
1020
+ _this6.setState({
1007
1021
  searchValue: res
1008
1022
  }, function () {
1009
- _this7.onKeyPressed({ keyCode: 13 });
1023
+ _this6.onKeyPressed({ keyCode: 13 });
1010
1024
  });
1011
1025
  };
1012
1026