tplus-portaltouch 3.22.9 → 3.22.14

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.
@@ -102,6 +102,8 @@ var _horizontalPadPortal2 = _interopRequireDefault(_horizontalPadPortal);
102
102
 
103
103
  require('./index.less');
104
104
 
105
+ var _rxjs = require('rxjs');
106
+
105
107
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
106
108
 
107
109
  var hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
@@ -175,24 +177,12 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
175
177
 
176
178
  _this.getOperation = function () {
177
179
  return new _promise2.default(function (resolve, reject) {
178
- var _this$context = _this.context,
179
- _this$context$stores = _this$context.stores;
180
- _this$context$stores = _this$context$stores === undefined ? {} : _this$context$stores;
181
- var portalStore = _this$context$stores.portalStore,
182
- _this$context$headHoo = _this$context.headHook;
183
- _this$context$headHoo = _this$context$headHoo === undefined ? {} : _this$context$headHoo;
184
- var addClass = _this$context$headHoo.addClass;
185
180
  var homeOperation = _ModifyPassApi.Request.homeOperation,
186
181
  functionData = _ModifyPassApi.Request.functionData;
187
182
 
188
- _tplusComponentsTouch.Loading.show({
189
- text: '首页权限加载中...',
190
- delay: 2500
191
- });
192
183
  homeOperation().then(function (operations) {
193
184
  _mutantsMicrofx.localStore.set('operationsAuth', (0, _stringify2.default)(operations));
194
185
  _this.setState({ operations: operations || [] });
195
- _tplusComponentsTouch.Loading.hide();
196
186
  resolve();
197
187
  }).catch(function (err) {
198
188
  console.log('homeOperation.error======', err);
@@ -200,26 +190,74 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
200
190
  resolve();
201
191
  });
202
192
  functionData().then(function (data) {
203
- // 加载权限数据 DR-29735 by majian
204
193
  (0, _tplusPoslogin.PosSetData)(data);
205
194
  });
206
- // portalStore && portalStore.getPortalMenu();
207
- addClass && addClass(_this.state.id, 'portalHead');
208
- // 初始化参数设置。
209
- _mutantsMicrofx.stores.setStore.initSetParams().then(function (ret) {
210
- // 在客户端中,如果开启了副屏设置,尝试这打开副屏。
211
- if (_this.getScreenType() === true) {
212
- if (_this.isHorizontalSunMi) {
213
- _this.sunMiPresentationInit(ret);
214
- return;
215
- }
216
- window.open('vicescreen?ts=' + new Date().getTime(), 'screen');
217
- }
218
- });
219
- _this.hsyBasicInfoInit();
220
195
  });
221
196
  };
222
197
 
198
+ _this.initPageData = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
199
+ var _this$context, _this$context$stores, stores, _this$context$headHoo, addClass, hasUseOffline;
200
+
201
+ return _regenerator2.default.wrap(function _callee2$(_context2) {
202
+ while (1) {
203
+ switch (_context2.prev = _context2.next) {
204
+ case 0:
205
+ _this$context = _this.context, _this$context$stores = _this$context.stores, stores = _this$context$stores === undefined ? {} : _this$context$stores, _this$context$headHoo = _this$context.headHook;
206
+ _this$context$headHoo = _this$context$headHoo === undefined ? {} : _this$context$headHoo;
207
+ addClass = _this$context$headHoo.addClass;
208
+ hasUseOffline = (0, _tplusPoslogin.PosInitData)('IsOfflineCash') === "1" && !(_this.isVerticalTouch || _this.isMobileEnvironment); //是否允许离线
209
+
210
+ if (!(hasUseOffline == true)) {
211
+ _context2.next = 7;
212
+ break;
213
+ }
214
+
215
+ _context2.next = 7;
216
+ return _this.catchOfflineData();
217
+
218
+ case 7:
219
+ _tplusComponentsTouch.Loading.show({
220
+ text: '权限加载中...',
221
+ delay: 2500
222
+ });
223
+ //权限加载
224
+ _context2.prev = 8;
225
+ _context2.next = 11;
226
+ return _this.getOperation();
227
+
228
+ case 11:
229
+ _context2.next = 16;
230
+ break;
231
+
232
+ case 13:
233
+ _context2.prev = 13;
234
+ _context2.t0 = _context2['catch'](8);
235
+ _tplusComponentsTouch.Loading.hide();
236
+
237
+ case 16:
238
+ _tplusComponentsTouch.Loading.hide();
239
+ addClass && addClass(_this.state.id, 'portalHead');
240
+ // 初始化参数设置。
241
+ stores.setStore.initSetParams().then(function (ret) {
242
+ // 在客户端中,如果开启了副屏设置,尝试这打开副屏。
243
+ if (_this.getScreenType() === true) {
244
+ if (_this.isHorizontalSunMi) {
245
+ _this.sunMiPresentationInit(ret);
246
+ return;
247
+ }
248
+ window.open('vicescreen?ts=' + new Date().getTime(), 'screen');
249
+ }
250
+ });
251
+ _this.hsyBasicInfoInit();
252
+
253
+ case 20:
254
+ case 'end':
255
+ return _context2.stop();
256
+ }
257
+ }
258
+ }, _callee2, _this2, [[8, 13]]);
259
+ }));
260
+
223
261
  _this.initHsyPage = function () {
224
262
  var external_frame = document.getElementById('external-frame-cc');
225
263
  var win = external_frame && external_frame.contentWindow;
@@ -237,12 +275,12 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
237
275
  //SunMi初始化参数设置。
238
276
  //副屏幕交互。硬件改动20200428 需要在商米页面加载成功后才能发送 初始化命令
239
277
  // 进行主副屏数据交互 初始化
240
- var _ref2 = _mutantsMicrofx.localStore.get('user') || {},
241
- _ref2$store = _ref2.store;
278
+ var _ref3 = _mutantsMicrofx.localStore.get('user') || {},
279
+ _ref3$store = _ref3.store;
242
280
 
243
- _ref2$store = _ref2$store === undefined ? {} : _ref2$store;
244
- var _ref2$store$storeName = _ref2$store.storeName,
245
- storeName = _ref2$store$storeName === undefined ? '' : _ref2$store$storeName;
281
+ _ref3$store = _ref3$store === undefined ? {} : _ref3$store;
282
+ var _ref3$store$storeName = _ref3$store.storeName,
283
+ storeName = _ref3$store$storeName === undefined ? '' : _ref3$store$storeName;
246
284
 
247
285
  console.log(result);
248
286
 
@@ -286,11 +324,11 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
286
324
 
287
325
  var loginInfo = user.options.get('loginInfo');
288
326
 
289
- var _ref3 = loginInfo || {},
290
- UserCode = _ref3.UserCode,
291
- AccountNum = _ref3.AccountNum,
292
- posCode = _ref3.posCode,
293
- TplusStoreId = _ref3.TplusStoreId;
327
+ var _ref4 = loginInfo || {},
328
+ UserCode = _ref4.UserCode,
329
+ AccountNum = _ref4.AccountNum,
330
+ posCode = _ref4.posCode,
331
+ TplusStoreId = _ref4.TplusStoreId;
294
332
 
295
333
  var uid = _this.tplusEncode(UserCode);
296
334
  var pwd = _this.tplusEncode(user.options.get("password"));
@@ -342,11 +380,11 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
342
380
  return vv.Name === Name;
343
381
  });
344
382
 
345
- var _ref4 = controllable || {},
346
- Visibility = _ref4.Visibility,
347
- HoldFunctionAuth = _ref4.HoldFunctionAuth,
348
- Title = _ref4.Title,
349
- MenuCode = _ref4.MenuCode;
383
+ var _ref5 = controllable || {},
384
+ Visibility = _ref5.Visibility,
385
+ HoldFunctionAuth = _ref5.HoldFunctionAuth,
386
+ Title = _ref5.Title,
387
+ MenuCode = _ref5.MenuCode;
350
388
 
351
389
  var errorTip = void 0;
352
390
  if (type == 'more') {
@@ -427,14 +465,14 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
427
465
  };
428
466
 
429
467
  _this.toFramePage = function (params) {
430
- var _ref5 = params || {},
431
- app = _ref5.app,
432
- title = _ref5.title,
433
- style = _ref5.style,
434
- search = _ref5.search,
435
- tmenuCode = _ref5.tmenuCode,
436
- MenuCode = _ref5.MenuCode,
437
- isHsyLoadFinish = _ref5.isHsyLoadFinish;
468
+ var _ref6 = params || {},
469
+ app = _ref6.app,
470
+ title = _ref6.title,
471
+ style = _ref6.style,
472
+ search = _ref6.search,
473
+ tmenuCode = _ref6.tmenuCode,
474
+ MenuCode = _ref6.MenuCode,
475
+ isHsyLoadFinish = _ref6.isHsyLoadFinish;
438
476
 
439
477
  switch (app) {
440
478
  case 'cc':
@@ -497,37 +535,37 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
497
535
  };
498
536
 
499
537
  _this.toTplusPage = function () {
500
- var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(tmenuCode, search) {
501
- var ret, _ref7, ossjumpUrl, postMessageUrl, dsearchPlanID, portalStore, menu, external_frame_tc, win, loadTcURL;
538
+ var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(tmenuCode, search) {
539
+ var ret, _ref8, ossjumpUrl, postMessageUrl, dsearchPlanID, portalStore, menu, external_frame_tc, win, loadTcURL;
502
540
 
503
- return _regenerator2.default.wrap(function _callee2$(_context2) {
541
+ return _regenerator2.default.wrap(function _callee3$(_context3) {
504
542
  while (1) {
505
- switch (_context2.prev = _context2.next) {
543
+ switch (_context3.prev = _context3.next) {
506
544
  case 0:
507
545
  ret = _this.getTcBasicInfoInit();
508
546
 
509
547
  if (!(ret === false)) {
510
- _context2.next = 3;
548
+ _context3.next = 3;
511
549
  break;
512
550
  }
513
551
 
514
- return _context2.abrupt('return');
552
+ return _context3.abrupt('return');
515
553
 
516
554
  case 3:
517
- _ref7 = ret || {}, ossjumpUrl = _ref7.ossjumpUrl, postMessageUrl = _ref7.postMessageUrl;
555
+ _ref8 = ret || {}, ossjumpUrl = _ref8.ossjumpUrl, postMessageUrl = _ref8.postMessageUrl;
518
556
  dsearchPlanID = '';
519
557
 
520
558
  if (!(search && search.id)) {
521
- _context2.next = 10;
559
+ _context3.next = 10;
522
560
  break;
523
561
  }
524
562
 
525
563
  portalStore = _this.context.stores.portalStore;
526
- _context2.next = 9;
564
+ _context3.next = 9;
527
565
  return portalStore.getSearchPlanId(search);
528
566
 
529
567
  case 9:
530
- dsearchPlanID = _context2.sent;
568
+ dsearchPlanID = _context3.sent;
531
569
 
532
570
  case 10:
533
571
  menu = _this.tplusEncode(tmenuCode);
@@ -538,22 +576,22 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
538
576
  }
539
577
 
540
578
  if (!_this.isHorizontalSunMi) {
541
- _context2.next = 17;
579
+ _context3.next = 17;
542
580
  break;
543
581
  }
544
582
 
545
583
  window.android_CommonFun.openWebUrlByOutBrowser(ossjumpUrl);
546
- _context2.next = 25;
584
+ _context3.next = 25;
547
585
  break;
548
586
 
549
587
  case 17:
550
588
  if (!(_this.new_retail_app == 'tc' || _this.new_retail_app == 'tczsy' || _this.new_retail_app == 'tcyzj')) {
551
- _context2.next = 20;
589
+ _context3.next = 20;
552
590
  break;
553
591
  }
554
592
 
555
593
  _mutantsMicrofx.nativeMs.useDefaultBrowser(ossjumpUrl);
556
- return _context2.abrupt('return');
594
+ return _context3.abrupt('return');
557
595
 
558
596
  case 20:
559
597
  external_frame_tc = document.getElementById('external-frame-tc');
@@ -576,24 +614,24 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
576
614
 
577
615
  case 25:
578
616
  case 'end':
579
- return _context2.stop();
617
+ return _context3.stop();
580
618
  }
581
619
  }
582
- }, _callee2, _this2);
620
+ }, _callee3, _this2);
583
621
  }));
584
622
 
585
623
  return function (_x2, _x3) {
586
- return _ref6.apply(this, arguments);
624
+ return _ref7.apply(this, arguments);
587
625
  };
588
626
  }();
589
627
 
590
628
  _this.toHsyPage = function () {
591
- var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(params) {
592
- var content_only, bar_bg, bar_active_bg, menu, secondRouter, activePrompt, closePrompt, closeable, leavePrompt, lock, pageId, pageParams, path, tabId, tabLabel, pageType, _k, filter, IdWarehouse, WarehouseName, IsPerformanceDistribution, _ref9, _ref9$loginInfo, _ref9$loginInfo$IdSto, IdStore, _ref9$loginInfo$PosId, PosId, _ref9$store, _ref9$store$storeName, storeName, commonArgs, actionUrl, cc_url, CC_WEB_URL, external_frame, win;
629
+ var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(params) {
630
+ var content_only, bar_bg, bar_active_bg, menu, secondRouter, activePrompt, closePrompt, closeable, leavePrompt, lock, pageId, pageParams, path, tabId, tabLabel, pageType, _k, filter, IdWarehouse, WarehouseName, IsPerformanceDistribution, _ref10, _ref10$loginInfo, _ref10$loginInfo$IdSt, IdStore, _ref10$loginInfo$PosI, PosId, _ref10$store, _ref10$store$storeNam, storeName, commonArgs, actionUrl, cc_url, CC_WEB_URL, external_frame, win;
593
631
 
594
- return _regenerator2.default.wrap(function _callee3$(_context3) {
632
+ return _regenerator2.default.wrap(function _callee4$(_context4) {
595
633
  while (1) {
596
- switch (_context3.prev = _context3.next) {
634
+ switch (_context4.prev = _context4.next) {
597
635
  case 0:
598
636
  content_only = params.content_only, bar_bg = params.bar_bg, bar_active_bg = params.bar_active_bg, menu = params.menu, secondRouter = params.secondRouter, activePrompt = params.activePrompt, closePrompt = params.closePrompt, closeable = params.closeable, leavePrompt = params.leavePrompt, lock = params.lock, pageId = params.pageId, pageParams = params.pageParams, path = params.path, tabId = params.tabId, tabLabel = params.tabLabel, pageType = params.pageType, _k = params._k;
599
637
  filter = {};
@@ -602,11 +640,11 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
602
640
  IdWarehouse = (0, _tplusPoslogin.PosInitData)('IdWarehouse') || '';
603
641
  WarehouseName = (0, _tplusPoslogin.PosInitData)('WarehouseName') || '';
604
642
  IsPerformanceDistribution = (0, _tplusPoslogin.PosInitData)('PerformanceDistribution') === 'SHIPPER_STORE' || false;
605
- _ref9 = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('user') || {}, _ref9$loginInfo = _ref9.loginInfo, _ref9$loginInfo$IdSto = _ref9$loginInfo.IdStore, IdStore = _ref9$loginInfo$IdSto === undefined ? '' : _ref9$loginInfo$IdSto, _ref9$loginInfo$PosId = _ref9$loginInfo.PosId, PosId = _ref9$loginInfo$PosId === undefined ? '' : _ref9$loginInfo$PosId, _ref9$store = _ref9.store;
606
- _ref9$store = _ref9$store === undefined ? {} : _ref9$store;
607
- _ref9$store$storeName = _ref9$store.storeName, storeName = _ref9$store$storeName === undefined ? '' : _ref9$store$storeName;
608
- _context3.t0 = pageType;
609
- _context3.next = _context3.t0 === 'voucher' ? 11 : _context3.t0 === 'report' ? 14 : 18;
643
+ _ref10 = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('user') || {}, _ref10$loginInfo = _ref10.loginInfo, _ref10$loginInfo$IdSt = _ref10$loginInfo.IdStore, IdStore = _ref10$loginInfo$IdSt === undefined ? '' : _ref10$loginInfo$IdSt, _ref10$loginInfo$PosI = _ref10$loginInfo.PosId, PosId = _ref10$loginInfo$PosI === undefined ? '' : _ref10$loginInfo$PosI, _ref10$store = _ref10.store;
644
+ _ref10$store = _ref10$store === undefined ? {} : _ref10$store;
645
+ _ref10$store$storeNam = _ref10$store.storeName, storeName = _ref10$store$storeNam === undefined ? '' : _ref10$store$storeNam;
646
+ _context4.t0 = pageType;
647
+ _context4.next = _context4.t0 === 'voucher' ? 11 : _context4.t0 === 'report' ? 14 : 18;
610
648
  break;
611
649
 
612
650
  case 11:
@@ -636,7 +674,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
636
674
  }
637
675
  };
638
676
  }
639
- return _context3.abrupt('break', 18);
677
+ return _context4.abrupt('break', 18);
640
678
 
641
679
  case 14:
642
680
  filter = {
@@ -692,7 +730,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
692
730
  }
693
731
  };
694
732
  }
695
- return _context3.abrupt('break', 18);
733
+ return _context4.abrupt('break', 18);
696
734
 
697
735
  case 18:
698
736
  bar_bg = encodeURIComponent(bar_bg);
@@ -710,19 +748,19 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
710
748
  console.log('web_hsy_url:', cc_url);
711
749
 
712
750
  if (!_this.isHorizontalSunMi) {
713
- _context3.next = 37;
751
+ _context4.next = 37;
714
752
  break;
715
753
  }
716
754
 
717
- _context3.next = 32;
755
+ _context4.next = 32;
718
756
  return _tplusApi.User.getLoginCCMidWebUrl(cc_url);
719
757
 
720
758
  case 32:
721
- CC_WEB_URL = _context3.sent;
759
+ CC_WEB_URL = _context4.sent;
722
760
 
723
761
  console.log('CC_WEB_URL:', CC_WEB_URL);
724
762
  window.android_CommonFun.openWebUrlByOutBrowser(CC_WEB_URL);
725
- _context3.next = 42;
763
+ _context4.next = 42;
726
764
  break;
727
765
 
728
766
  case 37:
@@ -744,14 +782,14 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
744
782
 
745
783
  case 42:
746
784
  case 'end':
747
- return _context3.stop();
785
+ return _context4.stop();
748
786
  }
749
787
  }
750
- }, _callee3, _this2);
788
+ }, _callee4, _this2);
751
789
  }));
752
790
 
753
791
  return function (_x4) {
754
- return _ref8.apply(this, arguments);
792
+ return _ref9.apply(this, arguments);
755
793
  };
756
794
  }();
757
795
 
@@ -845,10 +883,10 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
845
883
  return vv.Name === v.Name;
846
884
  });
847
885
 
848
- var _ref10 = controllable || {},
849
- Visibility = _ref10.Visibility,
850
- HoldFunctionAuth = _ref10.HoldFunctionAuth,
851
- Title = _ref10.Title;
886
+ var _ref11 = controllable || {},
887
+ Visibility = _ref11.Visibility,
888
+ HoldFunctionAuth = _ref11.HoldFunctionAuth,
889
+ Title = _ref11.Title;
852
890
 
853
891
  var errorTip = void 0;
854
892
  if (!Visibility) {
@@ -1091,12 +1129,12 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
1091
1129
  modalURL: ''
1092
1130
  };
1093
1131
 
1094
- var _ref11 = _mutantsUtil.platform || {},
1095
- isVerticalTouch = _ref11.isVerticalTouch,
1096
- isHorizontalPad = _ref11.isHorizontalPad,
1097
- isHorizontalSunMi = _ref11.isHorizontalSunMi,
1098
- isNewRetailBCPos = _ref11.isNewRetailBCPos,
1099
- isNewRetailBCPosTC = _ref11.isNewRetailBCPosTC;
1132
+ var _ref12 = _mutantsUtil.platform || {},
1133
+ isVerticalTouch = _ref12.isVerticalTouch,
1134
+ isHorizontalPad = _ref12.isHorizontalPad,
1135
+ isHorizontalSunMi = _ref12.isHorizontalSunMi,
1136
+ isNewRetailBCPos = _ref12.isNewRetailBCPos,
1137
+ isNewRetailBCPosTC = _ref12.isNewRetailBCPosTC;
1100
1138
 
1101
1139
  _this.isVerticalTouch = !!isVerticalTouch;
1102
1140
  _this.isHorizontalPad = !!isHorizontalPad;
@@ -1128,37 +1166,9 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
1128
1166
  }
1129
1167
 
1130
1168
  (0, _createClass3.default)(_default, [{
1131
- key: 'componentWillMount',
1132
- value: function () {
1133
- var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
1134
- return _regenerator2.default.wrap(function _callee4$(_context4) {
1135
- while (1) {
1136
- switch (_context4.prev = _context4.next) {
1137
- case 0:
1138
- _context4.next = 2;
1139
- return this.catchOfflineData();
1140
-
1141
- case 2:
1142
- _context4.next = 4;
1143
- return this.getOperation();
1144
-
1145
- case 4:
1146
- case 'end':
1147
- return _context4.stop();
1148
- }
1149
- }
1150
- }, _callee4, this);
1151
- }));
1152
-
1153
- function componentWillMount() {
1154
- return _ref12.apply(this, arguments);
1155
- }
1156
-
1157
- return componentWillMount;
1158
- }()
1159
- }, {
1160
1169
  key: 'componentDidMount',
1161
1170
  value: function componentDidMount() {
1171
+ this.initPageData();
1162
1172
  if (this.isNewRetailBCPos && !this.isVerticalTouch && !this.isMobileEnvironment) {
1163
1173
  this.initHsyPage();
1164
1174
  }