tplus-portaltouch 3.27.1 → 3.28.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.
Files changed (99) hide show
  1. package/package.json +4 -4
  2. package/tsconfig.json +14 -14
  3. package/dist/api/ModifyPassApi.js +0 -165
  4. package/dist/api/ModifyPassApi.js.map +0 -1
  5. package/dist/components/dutyandsettle/dutysettlebill.js +0 -1058
  6. package/dist/components/dutyandsettle/dutysettlebill.js.map +0 -1
  7. package/dist/components/dutyandsettle/dutysettlehistory.js +0 -247
  8. package/dist/components/dutyandsettle/dutysettlehistory.js.map +0 -1
  9. package/dist/components/dutyandsettle/index.js +0 -25
  10. package/dist/components/dutyandsettle/index.js.map +0 -1
  11. package/dist/components/dutyandsettle/tipContent.js +0 -101
  12. package/dist/components/dutyandsettle/tipContent.js.map +0 -1
  13. package/dist/components/header/customUse.js +0 -79
  14. package/dist/components/header/customUse.js.map +0 -1
  15. package/dist/components/header/headContent.js +0 -888
  16. package/dist/components/header/headContent.js.map +0 -1
  17. package/dist/components/header/index.js +0 -102
  18. package/dist/components/header/index.js.map +0 -1
  19. package/dist/components/header/offlinePointDesc.js +0 -7
  20. package/dist/components/header/offlinePointDesc.js.map +0 -1
  21. package/dist/components/header/style.less +0 -457
  22. package/dist/components/header/themeModal.js +0 -135
  23. package/dist/components/header/themeModal.js.map +0 -1
  24. package/dist/components/header/uploadList.js +0 -271
  25. package/dist/components/header/uploadList.js.map +0 -1
  26. package/dist/components/header/vertical-touch.js +0 -285
  27. package/dist/components/header/vertical-touch.js.map +0 -1
  28. package/dist/components/header/vertical-touch.less +0 -229
  29. package/dist/containers/Main/index.js +0 -666
  30. package/dist/containers/Main/index.js.map +0 -1
  31. package/dist/dutyService/index.js +0 -276
  32. package/dist/dutyService/index.js.map +0 -1
  33. package/dist/index.js +0 -40
  34. package/dist/index.js.map +0 -1
  35. package/dist/middleWare/index.js +0 -75
  36. package/dist/middleWare/index.js.map +0 -1
  37. package/dist/modalRouter/StaticRouter.js +0 -134
  38. package/dist/modalRouter/StaticRouter.js.map +0 -1
  39. package/dist/modalRouter/index.js +0 -141
  40. package/dist/modalRouter/index.js.map +0 -1
  41. package/dist/pages/Modal/index.js +0 -71
  42. package/dist/pages/Modal/index.js.map +0 -1
  43. package/dist/pages/Modal/style.less +0 -5
  44. package/dist/pages/Portalbc/data.js +0 -724
  45. package/dist/pages/Portalbc/data.js.map +0 -1
  46. package/dist/pages/Portalbc/horizontalPadPortal.js +0 -129
  47. package/dist/pages/Portalbc/horizontalPadPortal.js.map +0 -1
  48. package/dist/pages/Portalbc/horizontalSunMiPortal.js +0 -130
  49. package/dist/pages/Portalbc/horizontalSunMiPortal.js.map +0 -1
  50. package/dist/pages/Portalbc/index.js +0 -1370
  51. package/dist/pages/Portalbc/index.js.map +0 -1
  52. package/dist/pages/Portalbc/index.less +0 -787
  53. package/dist/pages/Portalbc/onframe.js +0 -259
  54. package/dist/pages/Portalbc/onframe.js.map +0 -1
  55. package/dist/pages/Portalbc/verticalPortal.js +0 -134
  56. package/dist/pages/Portalbc/verticalPortal.js.map +0 -1
  57. package/dist/pages/dutyandsettle/AuthProcess.js +0 -42
  58. package/dist/pages/dutyandsettle/AuthProcess.js.map +0 -1
  59. package/dist/pages/dutyandsettle/index.js +0 -37
  60. package/dist/pages/dutyandsettle/index.js.map +0 -1
  61. package/dist/pages/dutyandsettle/index.less +0 -529
  62. package/dist/pages/dutyandsettle/offDuty.js +0 -571
  63. package/dist/pages/dutyandsettle/offDuty.js.map +0 -1
  64. package/dist/pages/dutyandsettle/onDialy.js +0 -182
  65. package/dist/pages/dutyandsettle/onDialy.js.map +0 -1
  66. package/dist/pages/dutyandsettle/onDuty.js +0 -242
  67. package/dist/pages/dutyandsettle/onDuty.js.map +0 -1
  68. package/dist/pages/dutyandsettle/onUnDaily.js +0 -138
  69. package/dist/pages/dutyandsettle/onUnDaily.js.map +0 -1
  70. package/dist/pages/dutyandsettle/settleDialy.js +0 -116
  71. package/dist/pages/dutyandsettle/settleDialy.js.map +0 -1
  72. package/dist/pages/index.js +0 -54
  73. package/dist/pages/index.js.map +0 -1
  74. package/dist/pages/modifyPass/index.js +0 -174
  75. package/dist/pages/modifyPass/index.js.map +0 -1
  76. package/dist/pages/modifyPass/style.less +0 -71
  77. package/dist/pages/notFound/index.js +0 -85
  78. package/dist/pages/notFound/index.js.map +0 -1
  79. package/dist/pages/notFound/style.less +0 -17
  80. package/dist/stores/ModalRouter.js +0 -182
  81. package/dist/stores/ModalRouter.js.map +0 -1
  82. package/dist/stores/ModifyPassStore.js +0 -207
  83. package/dist/stores/ModifyPassStore.js.map +0 -1
  84. package/dist/stores/PortalStore.js +0 -285
  85. package/dist/stores/PortalStore.js.map +0 -1
  86. package/dist/stores/PosLoginStore.js +0 -111
  87. package/dist/stores/PosLoginStore.js.map +0 -1
  88. package/dist/stores/billHistoryStore.js +0 -114
  89. package/dist/stores/billHistoryStore.js.map +0 -1
  90. package/dist/stores/dutySettleStore.js +0 -115
  91. package/dist/stores/dutySettleStore.js.map +0 -1
  92. package/dist/stores/index.js +0 -36
  93. package/dist/stores/index.js.map +0 -1
  94. package/dist/utils/PrintProcess.js +0 -112
  95. package/dist/utils/PrintProcess.js.map +0 -1
  96. package/dist/utils/index.js +0 -93
  97. package/dist/utils/index.js.map +0 -1
  98. package/dist/utils/networkCheck.js +0 -33
  99. package/dist/utils/networkCheck.js.map +0 -1
@@ -1,666 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _extends2 = require('babel-runtime/helpers/extends');
8
-
9
- var _extends3 = _interopRequireDefault(_extends2);
10
-
11
- var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
12
-
13
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
14
-
15
- var _getIterator2 = require('babel-runtime/core-js/get-iterator');
16
-
17
- var _getIterator3 = _interopRequireDefault(_getIterator2);
18
-
19
- var _keys = require('babel-runtime/core-js/object/keys');
20
-
21
- var _keys2 = _interopRequireDefault(_keys);
22
-
23
- var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');
24
-
25
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
26
-
27
- var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray');
28
-
29
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
30
-
31
- var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
32
-
33
- var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
34
-
35
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
36
-
37
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
38
-
39
- var _createClass2 = require('babel-runtime/helpers/createClass');
40
-
41
- var _createClass3 = _interopRequireDefault(_createClass2);
42
-
43
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
44
-
45
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
46
-
47
- var _inherits2 = require('babel-runtime/helpers/inherits');
48
-
49
- var _inherits3 = _interopRequireDefault(_inherits2);
50
-
51
- var _class, _class2, _temp;
52
-
53
- exports.default = Main;
54
-
55
- var _react = require('react');
56
-
57
- var _react2 = _interopRequireDefault(_react);
58
-
59
- var _propTypes = require('prop-types');
60
-
61
- var _propTypes2 = _interopRequireDefault(_propTypes);
62
-
63
- var _mobxReact = require('mobx-react');
64
-
65
- var _antd = require('antd');
66
-
67
- var _mutantsMicrofx = require('mutants-microfx');
68
-
69
- var _tplusComponentsTouch = require('tplus-components-touch');
70
-
71
- var _mutantsUtil = require('mutants-util');
72
-
73
- var _tplusApi = require('tplus-api');
74
-
75
- var _rxjs = require('rxjs');
76
-
77
- var _reactRouter = require('react-router');
78
-
79
- var _header = require('../../components/header');
80
-
81
- var _header2 = _interopRequireDefault(_header);
82
-
83
- var _Portalbc = require('../../pages/Portalbc');
84
-
85
- var _Portalbc2 = _interopRequireDefault(_Portalbc);
86
-
87
- var _stores = require('../../stores');
88
-
89
- var _stores2 = _interopRequireDefault(_stores);
90
-
91
- var _index = require('../../utils/index');
92
-
93
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94
-
95
- var hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
96
- window.rx$ = {};
97
-
98
- var MainContainer = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_Component) {
99
- (0, _inherits3.default)(MainContainer, _Component);
100
-
101
- function MainContainer(props) {
102
- (0, _classCallCheck3.default)(this, MainContainer);
103
-
104
- var _this = (0, _possibleConstructorReturn3.default)(this, (MainContainer.__proto__ || (0, _getPrototypeOf2.default)(MainContainer)).call(this, props));
105
-
106
- _this.currentFocus = null;
107
-
108
- _this.initWebFrameZoom = function () {
109
- var webFrame = _this.electron ? _this.electron.webFrame : null;
110
- var value = _mutantsMicrofx.localStore.get('webFrameZoomValue') || '0.7';
111
- if (webFrame) webFrame.setZoomFactor(parseFloat(value));
112
- };
113
-
114
- _this.doDeeplinkingUrl = function () {
115
- if (_this.hasElectron === false) return;
116
-
117
- var _ref = _this.electron || { ipcRenderer: null },
118
- ipcRenderer = _ref.ipcRenderer;
119
-
120
- ipcRenderer && ipcRenderer.on("asynchronous-deeplinkingUrl", function (event, ret, params) {
121
- if (ret) {
122
- console.log('deeplinkingUrl:' + ret);
123
-
124
- var _ref2 = _mutantsMicrofx.localStore.get('user') || {},
125
- orgId = _ref2.orgId,
126
- userId = _ref2.userId;
127
-
128
- if (!orgId || !userId) return;
129
- var param = ret.split('&').reduce(function (accumulator, current) {
130
- if (!current) return accumulator;
131
-
132
- var _ref3 = current.split('=') || [],
133
- _ref4 = (0, _slicedToArray3.default)(_ref3, 2),
134
- key = _ref4[0],
135
- value = _ref4[1];
136
-
137
- accumulator[key] = value;
138
- return accumulator;
139
- }, {});
140
- console.log(orgId, userId, param);
141
- if (param.orgId !== orgId || param.cloudUserId !== userId) {
142
- _tplusApi.User.logout();
143
- }
144
- }
145
- });
146
- };
147
-
148
- _this.changeLogoSubject = function () {
149
- var subject = new _rxjs.Subject();
150
- rx$.changeLogo = subject;
151
-
152
- subject.subscribe({
153
- next: function next(v) {
154
- return _this.setLogo(v);
155
- }
156
- });
157
- };
158
-
159
- _this.changeHsySubject = function () {
160
- var subject = new _rxjs.Subject();
161
- rx$.changeHsy = subject;
162
-
163
- subject.subscribe({
164
- next: function next(v) {
165
- return _this.setHsy(v);
166
- }
167
- });
168
- };
169
-
170
- _this.addHotKeyChangeLister = function () {
171
- document.addEventListener("RESET_USER_STORE", _this.registerHotKey);
172
- };
173
-
174
- _this.removeHotKeyChangeLister = function () {
175
- document.removeEventListener("RESET_USER_STORE", _this.registerHotKey);
176
- };
177
-
178
- _this.setHsy = function (v) {
179
- var _ref5 = v || {},
180
- back = _ref5.back,
181
- fn = _ref5.fn;
182
-
183
- if (back === true) {
184
- _this.setState({ hsy_s: true, hsy_f: fn });
185
- } else {
186
- _this.setState({ hsy_s: false, hsy_f: null });
187
- }
188
- };
189
-
190
- _this.setLogo = function (v) {
191
- var store = _mutantsMicrofx.localStore.get('StoreKey') || {};
192
- var logoUrl = store.logo;
193
-
194
- logoUrl && _this.setState({ logoUrl: logoUrl });
195
- };
196
-
197
- _this.logoNode = function (url, isPortal, isLogin) {
198
- var _this$state = _this.state,
199
- hsy_s = _this$state.hsy_s,
200
- hsy_f = _this$state.hsy_f;
201
-
202
- var _ref6 = _mutantsUtil.platform || {},
203
- isVerticalTouch = _ref6.isVerticalTouch,
204
- isNewRetailBCPos = _ref6.isNewRetailBCPos;
205
-
206
- var bcParams = isNewRetailBCPos ? '-bc' : '';
207
- var theme = _mutantsMicrofx.stores.portalStore.themeStore;
208
- var defualtImage = isVerticalTouch === true ? 'https://newretail.static.chanjet.com/tinified/logo' + bcParams + '.png' : 'https://newretail.static.chanjet.com/' + (!hsy_s && isPortal || theme === 'dark' && !isLogin ? 'protal-chanjet' : 'chanjet') + '-logo' + bcParams + '.png?v=1';
209
- if (hsy_s === true) {
210
- return _react2.default.createElement(
211
- 'div',
212
- { className: 'business-logo-container' },
213
- _react2.default.createElement(_tplusComponentsTouch.Ticon, { type: 'zhiPOS-fanhuishouye2', className: 'back_i', onClick: function onClick() {
214
- hsy_f && hsy_f();
215
- } }),
216
- _react2.default.createElement('img', { src: url || defualtImage, className: 'example-logo' })
217
- );
218
- }
219
- return _react2.default.createElement('img', { src: url || defualtImage, className: 'example-logo' });
220
- };
221
-
222
- _this.hotKeyInjectOrEject = function (type, hotKeyAction) {
223
- var registerKeys = ['esc', 'enter'];
224
- var allKeys = [].concat(registerKeys, (0, _toConsumableArray3.default)((0, _keys2.default)(_tplusComponentsTouch.hotKey.hotKeyConfig)));
225
- allKeys.forEach(function (keyboard, index) {
226
- _mutantsMicrofx.nativeMs.onIpcRendererGlobalShortcut({ type: type, keyboard: keyboard }, hotKeyActionHandle);
227
- });
228
- };
229
-
230
- _this.blurButton = function (_ref7) {
231
- var target = _ref7.target;
232
- // 焦点为 button 时 移除焦点,防止触发 bee 组件enter快捷键
233
- if (target && target.nodeName === 'BUTTON') {
234
- target.blur();
235
- }
236
- };
237
-
238
- _this.registerHotKey = function () {
239
- _this.isSetHotKey = true;
240
-
241
- _this.hotKeyCreate = (0, _tplusComponentsTouch.hotKey)({
242
- observerCallback: _this.observerDom,
243
- log: true,
244
- pressed: _this.hotKeyAction,
245
- clickBefore: function clickBefore() {
246
- var _document = document,
247
- activeElement = _document.activeElement;
248
-
249
- activeElement && activeElement.blur();
250
- },
251
- filter: function filter(event) {
252
- var _ref8 = event.target || event.srcElement || {},
253
- tagName = _ref8.tagName,
254
- className = _ref8.className;
255
-
256
- return !(event.key === 'Enter' && tagName === 'INPUT' && !~className.indexOf('hot-key-not-filter'));
257
- }
258
- });
259
-
260
- _this.hotKeyCreate.observer(undefined, { attributes: true, childList: true, subtree: true, attributeFilter: ['class', 'style'] });
261
- _this.hotKeyCreate.register('esc')('.hot-key-focus-container')(_index.operationKeys.esc);
262
- _this.hotKeyCreate.register('enter')('.hot-key-focus-container')(_index.operationKeys.enter);
263
- };
264
-
265
- _this.observerDom = function () {
266
- var visibleModal = void 0;
267
- var modals = document.querySelectorAll('.ant-modal-wrap'); //ant-module
268
- var _iteratorNormalCompletion = true;
269
- var _didIteratorError = false;
270
- var _iteratorError = undefined;
271
-
272
- try {
273
- for (var _iterator = (0, _getIterator3.default)(modals), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
274
- var modal = _step.value;
275
-
276
- var display = modal.style.display;
277
- if (display != "none") {
278
- visibleModal = modal;
279
- }
280
- }
281
- } catch (err) {
282
- _didIteratorError = true;
283
- _iteratorError = err;
284
- } finally {
285
- try {
286
- if (!_iteratorNormalCompletion && _iterator.return) {
287
- _iterator.return();
288
- }
289
- } finally {
290
- if (_didIteratorError) {
291
- throw _iteratorError;
292
- }
293
- }
294
- }
295
-
296
- var visibleDrawer = void 0;
297
- var drawers = document.querySelectorAll('.ant-drawer-open'); //ant-drawer
298
- var _iteratorNormalCompletion2 = true;
299
- var _didIteratorError2 = false;
300
- var _iteratorError2 = undefined;
301
-
302
- try {
303
- for (var _iterator2 = (0, _getIterator3.default)(drawers), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
304
- var drawer = _step2.value;
305
-
306
- visibleDrawer = drawer;
307
- break;
308
- }
309
- } catch (err) {
310
- _didIteratorError2 = true;
311
- _iteratorError2 = err;
312
- } finally {
313
- try {
314
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
315
- _iterator2.return();
316
- }
317
- } finally {
318
- if (_didIteratorError2) {
319
- throw _iteratorError2;
320
- }
321
- }
322
- }
323
-
324
- if (visibleModal) {
325
- if (_this.currentFocus !== visibleModal) {
326
- $.clearFocus();
327
- _this.currentFocus = visibleModal;
328
- return $.setFocus(visibleModal);
329
- }
330
- return;
331
- }
332
-
333
- if (visibleDrawer) {
334
- if (_this.currentFocus !== visibleDrawer) {
335
- $.clearFocus();
336
- _this.currentFocus = visibleDrawer;
337
- return $.setFocus(visibleDrawer);
338
- }
339
- return;
340
- }
341
-
342
- if ($.getFocusId() !== '1') {
343
- if (_this.currentFocus !== 'App' || !document.querySelector(".hot-key-focus-container")) {
344
- $.clearFocus();
345
- _this.currentFocus = 'App';
346
- $.find('.app', true).setFocus();
347
- }
348
- return;
349
- }
350
- };
351
-
352
- _this.hotKeyAction = function (event, handle) {
353
- var _ref9 = handle || {},
354
- key = _ref9.key;
355
-
356
- var toggleKeyCode = 'ctrl+f1';
357
- if (key === toggleKeyCode) {
358
- var isSetHotKey = _this.isSetHotKey = !_this.isSetHotKey;
359
- var message = isSetHotKey ? '设置' : '取消';
360
- if (isSetHotKey) {
361
- $.bind(_this.keys.filter(function (i) {
362
- return i !== toggleKeyCode;
363
- }), _this.hotKeyAction);
364
- } else {
365
- $.unbind(_this.keys.filter(function (i) {
366
- return i !== toggleKeyCode;
367
- }));
368
- }
369
- return _tplusComponentsTouch.Message.info('\u5DF2' + message + '\u5FEB\u6377\u952E');
370
- }
371
-
372
- $.action(key);
373
- };
374
-
375
- _this.handleInfoRender = function (solt) {
376
- _this.setState({ solt: solt });
377
- };
378
-
379
- _this.onCollapse = function () {
380
- var collapsed = _this.state.collapsed;
381
-
382
- _this.setState({ collapsed: !collapsed });
383
- };
384
-
385
- _this.menuOnClick = function (_ref10) {
386
- var key = _ref10.key;
387
-
388
- console.log(key);
389
- _this.setState({ selectedKeys: key });
390
- };
391
-
392
- _this.handleClose = function () {
393
- _tplusComponentsTouch.Keyboard.close();
394
- };
395
-
396
- _this.handleOk = function (type, count) {
397
- _mutantsMicrofx.stores.modifyPassStore.modifyPassWord();
398
- };
399
-
400
- _this.headMenuSelect = function (_ref11) {
401
- var key = _ref11.key;
402
-
403
- var footer = [{ text: '取消', className: 'modifypass-cancal-button', closable: true, action: _this.handleClose }, { text: '确定', className: 'modifypass-ok-button', action: _this.handleOk, type: 'primary' }];
404
- footer = !!footer.length && _react2.default.createElement(
405
- 'div',
406
- null,
407
- footer.map(function (btn, i) {
408
- return _react2.default.createElement(
409
- _antd.Button,
410
- {
411
- className: btn.className || '',
412
- key: i,
413
- type: btn.type,
414
- loading: btn.loading,
415
- onClick: function onClick() {
416
- var _ref12 = btn || {},
417
- action = _ref12.action;
418
-
419
- if (typeof action === 'function') action();
420
- if (btn.closable) {
421
- _mutantsMicrofx.stores.modalRouter.hide('/modifypass');
422
- }
423
- }
424
- },
425
- btn.text
426
- );
427
- })
428
- );
429
- switch (key) {
430
- case 'logout':
431
- _tplusApi.User.logout();
432
- break;
433
- case 'modifypass':
434
- {
435
- if (!_mutantsMicrofx.stores.offlineSys.shouldInOffline()) return;
436
- _mutantsMicrofx.stores.modalRouter.show({
437
- url: '/modifypass',
438
- title: '修改密码',
439
- className: 'modify-password',
440
- width: 402,
441
- footer: footer, modalType: 'mid',
442
- onHide: function onHide() {
443
- return _mutantsMicrofx.stores.modalRouter.hide('/modifypass');
444
- },
445
- destroyOnClose: true
446
- });
447
- }
448
- break;
449
- default:
450
- _mutantsMicrofx.history.push('/' + key);
451
- break;
452
- }
453
- };
454
-
455
- _this.hasElectron = hasElectron;
456
- _this.state = {
457
- hsy_s: false,
458
- hsy_f: null
459
- };
460
- _stores2.default.posLoginStore.savePosCode();
461
- _this.electron = _mutantsMicrofx.nativeMs && _mutantsMicrofx.nativeMs.get('electron');
462
- _this.isAutoTest = (0, _index.getQueryString)(location.search, 'at');
463
- _this.isShowFourTab = _this.hasElectron && window.screen.width < 1024 ? true : false;
464
- //针对800*600分辨率下,页面显示不全的做一下处理。
465
- if (_this.isShowFourTab == true) _this.initWebFrameZoom();
466
-
467
- var isHorizontalPad = _mutantsUtil.localStore.get('isHorizontalPad'); // 是否在PAD
468
- var isHorizontalSunMi = _mutantsUtil.localStore.get('isHorizontalSunMi'); //是否在商米(SunMi)
469
- var isHorizontalSunMi_FuPing = _mutantsUtil.localStore.get('isHorizontalSunMi_FuPing'); //是否在商米(SunMi)
470
-
471
- _this.isHorizontalSunMi_FuPing = !!isHorizontalSunMi_FuPing;
472
- _this.isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi || !!isHorizontalSunMi_FuPing;
473
- return _this;
474
- }
475
-
476
- (0, _createClass3.default)(MainContainer, [{
477
- key: 'getChildContext',
478
- value: function getChildContext() {
479
- var _this2 = this;
480
-
481
- return {
482
- infoRender: this.handleInfoRender,
483
- headHook: {
484
- addClass: function addClass(id, key) {
485
- _this2.setState(function (state) {
486
- return (0, _defineProperty3.default)({}, key, [].concat((0, _toConsumableArray3.default)(state[key] || []), [id]));
487
- });
488
- },
489
- removeClass: function removeClass(id, key) {
490
- _this2.setState(function (state) {
491
- return (0, _defineProperty3.default)({}, key, state[key].filter(function (currentId) {
492
- return currentId !== id;
493
- }));
494
- });
495
- }
496
- },
497
- actionHook: {
498
- actionFrom: this.actionFrom,
499
- actionChange: function actionChange(value) {
500
- _this2.actionFrom = value;
501
- }
502
- }
503
- };
504
- }
505
-
506
- // 内置默认
507
- // keys = ['esc', 'enter', 'ctrl+f1', ...Object.keys(hotKey.hotKeyConfig)];
508
-
509
- // 解决从url地址唤醒exe,不同账号的处理问题。
510
-
511
- }, {
512
- key: 'componentWillMount',
513
- value: function componentWillMount() {
514
- this.changeLogoSubject();
515
- this.changeHsySubject();
516
-
517
- var _ref15 = _mutantsUtil.platform || {},
518
- isVerticalTouch = _ref15.isVerticalTouch;
519
-
520
- if (isVerticalTouch === true) {
521
- document.body.classList.add('vertical-touch-platform');
522
- }
523
- }
524
- }, {
525
- key: 'componentDidMount',
526
- value: function componentDidMount() {
527
- this.registerHotKey();
528
- this.addHotKeyChangeLister();
529
- rx$.changeLogo.next();
530
- document.body.addEventListener('focus', this.blurButton, true);
531
- this.doDeeplinkingUrl();
532
-
533
- if (this.hasElectron === true) {
534
- document.body.classList.add('electron-env');
535
- } else {
536
- if (this.isAutoTest || this.isMobileEnvironment) return; //自动化测试不弹窗
537
- _tplusComponentsTouch.ModalWraper.confirm({
538
- className: 'tplus-confirm-modal',
539
- title: "温馨提示",
540
- content: '智+新零售POS端不允许浏览器直接访问,请从智+产品中下载安装客户端程序使用!',
541
- cancelable: false,
542
- onOk: function onOk() {
543
- (0, _index.closeWebPage)();
544
- },
545
- onCancel: function onCancel() {
546
- (0, _index.closeWebPage)();
547
- }
548
- });
549
- }
550
- }
551
- }, {
552
- key: 'componentWillUnmount',
553
- value: function componentWillUnmount() {
554
- rx$.changeLogo.unsubscribe();
555
- rx$.changeHsy.unsubscribe();
556
- document.body.removeEventListener('focus', this.blurButton, true);
557
- // clearInterval(this.addObserverDomTimer);
558
- }
559
-
560
- //未使用?
561
-
562
- }, {
563
- key: 'render',
564
- value: function render() {
565
- var _state = this.state,
566
- collapsed = _state.collapsed,
567
- selectedKeys = _state.selectedKeys,
568
- solt = _state.solt,
569
- _state$portalHead = _state.portalHead,
570
- portalHead = _state$portalHead === undefined ? [] : _state$portalHead,
571
- _state$loginHead = _state.loginHead,
572
- loginHead = _state$loginHead === undefined ? [] : _state$loginHead,
573
- _state$retailOrder = _state.retailOrder,
574
- retailOrder = _state$retailOrder === undefined ? [] : _state$retailOrder,
575
- logoUrl = _state.logoUrl,
576
- hsy_s = _state.hsy_s;
577
-
578
- var pathname = _mutantsMicrofx.history.location.pathname;
579
- var storeInfo = _mutantsMicrofx.stores.user.options.get('store');
580
- var isPortal = !!portalHead.length;
581
- var isLogin = !!loginHead.length;
582
- var isRetailOrder = !!retailOrder.length;
583
-
584
- var _ref16 = _mutantsUtil.platform || {},
585
- isNewRetailBCPos = _ref16.isNewRetailBCPos;
586
-
587
- var headProps = {
588
- logo: this.logoNode(logoUrl, isPortal, isLogin),
589
- businessName: '',
590
- storeName: '',
591
- dateFormat: 'yyyy年MM月dd日 hh:mm:ss',
592
- menu: [{ title: '注销', key: 'logout', icon: 'zhuxiao' }, { title: '修改密码', key: 'modifypass', icon: 'suoping' }],
593
- onClick: this.headMenuSelect
594
- };
595
- if (storeInfo) {
596
- headProps.businessName = storeInfo.orgName;
597
- headProps.storeName = storeInfo.storeName;
598
- headProps.posCode = storeInfo.posCode;
599
- }
600
-
601
- // 如果存在商米副屏则优先加载商米副屏
602
- if (this.isHorizontalSunMi_FuPing) {
603
- return _react2.default.createElement(_reactRouter.Redirect, { to: '/vicescreen' });
604
- }
605
- console.log('!stores.posLoginStore.posIsLogin=============', !_mutantsMicrofx.stores.posLoginStore.posIsLogin);
606
- if (!_mutantsMicrofx.stores.posLoginStore.posIsLogin && !~pathname.indexOf('login')) {
607
- _mutantsMicrofx.stores.modalRouter.hideAll && _mutantsMicrofx.stores.modalRouter.hideAll();
608
- return _react2.default.createElement(_reactRouter.Redirect, { to: '/login' });
609
- }
610
- var classNames = ['isPortal-layout', 'isRetailOrder-layout'];
611
- var layoutClassName = [isPortal, isRetailOrder].map(function (v, i) {
612
- return v ? classNames[i] : '';
613
- }).join(' ');
614
- return _react2.default.createElement(
615
- _tplusComponentsTouch.Layout,
616
- {
617
- style: { height: '100%' },
618
- className: layoutClassName
619
- },
620
- _react2.default.createElement(
621
- _tplusComponentsTouch.Layout,
622
- null,
623
- _react2.default.createElement(_header2.default, (0, _extends3.default)({}, headProps, {
624
- solt: solt,
625
- isPortal: isPortal,
626
- className: (!hsy_s && isPortal ? 'isPortal-head' : '') + ' ' + (isLogin ? 'isLogin-head' : ''),
627
- isLogin: isLogin,
628
- location: this.props.location,
629
- history: this.props.history
630
- })),
631
- _react2.default.createElement(
632
- _tplusComponentsTouch.Layout.Content,
633
- null,
634
- this.props.match.isExact ? _react2.default.createElement(_Portalbc2.default, null) : _react2.default.createElement(
635
- _mutantsMicrofx.Switch,
636
- null,
637
- this.props.routes
638
- )
639
- )
640
- )
641
- );
642
- }
643
- }]);
644
- return MainContainer;
645
- }(_react.Component), _class2.childContextTypes = {
646
- infoRender: _propTypes2.default.func,
647
- headHook: _propTypes2.default.object,
648
- actionHook: _propTypes2.default.object
649
- }, _temp)) || _class;
650
-
651
- function Main(props) {
652
- var routes = props.routes,
653
- modalRouter = props.modalRouter;
654
-
655
-
656
- if (modalRouter) {
657
- return _react2.default.createElement(
658
- _mutantsMicrofx.Switch,
659
- null,
660
- routes
661
- );
662
- }
663
-
664
- return _react2.default.cloneElement(_react2.default.createElement(MainContainer, null), props);
665
- }
666
- //# sourceMappingURL=index.js.map