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,1370 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = undefined;
7
-
8
- var _assign = require('babel-runtime/core-js/object/assign');
9
-
10
- var _assign2 = _interopRequireDefault(_assign);
11
-
12
- var _extends2 = require('babel-runtime/helpers/extends');
13
-
14
- var _extends3 = _interopRequireDefault(_extends2);
15
-
16
- var _stringify = require('babel-runtime/core-js/json/stringify');
17
-
18
- var _stringify2 = _interopRequireDefault(_stringify);
19
-
20
- var _promise = require('babel-runtime/core-js/promise');
21
-
22
- var _promise2 = _interopRequireDefault(_promise);
23
-
24
- var _regenerator = require('babel-runtime/regenerator');
25
-
26
- var _regenerator2 = _interopRequireDefault(_regenerator);
27
-
28
- var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
29
-
30
- var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
31
-
32
- var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
33
-
34
- var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
35
-
36
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
37
-
38
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
39
-
40
- var _createClass2 = require('babel-runtime/helpers/createClass');
41
-
42
- var _createClass3 = _interopRequireDefault(_createClass2);
43
-
44
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
45
-
46
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
47
-
48
- var _inherits2 = require('babel-runtime/helpers/inherits');
49
-
50
- var _inherits3 = _interopRequireDefault(_inherits2);
51
-
52
- var _class, _class2, _temp; /*
53
- * @Description:
54
- * @Date: 2019-08-13 08:42:18
55
- * @LastEditTime: 2021-11-10 14:48:46
56
- * @LastEditors: chenlongad
57
- * @modify:修改跳转到T+的查询方案方式
58
- */
59
-
60
-
61
- var _react = require('react');
62
-
63
- var _react2 = _interopRequireDefault(_react);
64
-
65
- var _mobxReact = require('mobx-react');
66
-
67
- var _mobx = require('mobx');
68
-
69
- var _antd = require('antd');
70
-
71
- var _mutantsMicrofx = require('mutants-microfx');
72
-
73
- var _tplusComponentsTouch = require('tplus-components-touch');
74
-
75
- var _tplusApi = require('tplus-api');
76
-
77
- var _tplusPoslogin = require('tplus-poslogin');
78
-
79
- var _mutantsUtil = require('mutants-util');
80
-
81
- var _propTypes = require('prop-types');
82
-
83
- var _propTypes2 = _interopRequireDefault(_propTypes);
84
-
85
- var _ModifyPassApi = require('../../api/ModifyPassApi');
86
-
87
- var _data = require('./data');
88
-
89
- var _data2 = _interopRequireDefault(_data);
90
-
91
- var _middleWare = require('../../middleWare');
92
-
93
- var _middleWare2 = _interopRequireDefault(_middleWare);
94
-
95
- var _verticalPortal = require('./verticalPortal');
96
-
97
- var _verticalPortal2 = _interopRequireDefault(_verticalPortal);
98
-
99
- var _horizontalPadPortal = require('./horizontalPadPortal');
100
-
101
- var _horizontalPadPortal2 = _interopRequireDefault(_horizontalPadPortal);
102
-
103
- require('./index.less');
104
-
105
- var _rxjs = require('rxjs');
106
-
107
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
108
-
109
- var hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
110
- var Content = _tplusComponentsTouch.Layout.Content,
111
- Footer = _tplusComponentsTouch.Layout.Footer;
112
-
113
- var tplusWindow = null;
114
- var HTTP_PROXY_URL = 'http://tfproxy.chanjet.com/?url=';
115
-
116
- var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_Component) {
117
- (0, _inherits3.default)(_default, _Component);
118
-
119
- function _default(props) {
120
- var _this2 = this;
121
-
122
- (0, _classCallCheck3.default)(this, _default);
123
-
124
- var _this = (0, _possibleConstructorReturn3.default)(this, (_default.__proto__ || (0, _getPrototypeOf2.default)(_default)).call(this, props));
125
-
126
- _this.catchOfflineData = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
127
- var offlineSys, isLoginAfter, downloadCatcherDay, currentDay, downProgress, result;
128
- return _regenerator2.default.wrap(function _callee$(_context) {
129
- while (1) {
130
- switch (_context.prev = _context.next) {
131
- case 0:
132
- offlineSys = _this.context.stores.offlineSys;
133
- isLoginAfter = _mutantsMicrofx.localStore.get("isLoginAfter");
134
- downloadCatcherDay = _mutantsMicrofx.localStore.get("downloadCatcherDay");
135
- currentDay = Math.ceil(new Date() / 1000 / 60 / 60 / 24);
136
-
137
- if (!(isLoginAfter == 1)) {
138
- _context.next = 14;
139
- break;
140
- }
141
-
142
- if (!(!downloadCatcherDay || currentDay > downloadCatcherDay)) {
143
- _context.next = 13;
144
- break;
145
- }
146
-
147
- downProgress = function downProgress(params) {
148
- _tplusComponentsTouch.Loading.transfer(params);
149
- };
150
-
151
- _tplusComponentsTouch.Loading.show({
152
- text: '离线数据下载中',
153
- delay: 0,
154
- showProgress: true
155
- });
156
- _context.next = 10;
157
- return offlineSys.downloadCatcherData(downProgress);
158
-
159
- case 10:
160
- result = _context.sent;
161
-
162
- _tplusComponentsTouch.Loading.hide();
163
- if (result) {
164
- _mutantsMicrofx.localStore.set("downloadCatcherDay", currentDay);
165
- }
166
-
167
- case 13:
168
- _mutantsMicrofx.localStore.set("isLoginAfter", 0);
169
-
170
- case 14:
171
- case 'end':
172
- return _context.stop();
173
- }
174
- }
175
- }, _callee, _this2);
176
- }));
177
-
178
- _this.getOperation = function () {
179
- return new _promise2.default(function (resolve, reject) {
180
- var homeOperation = _ModifyPassApi.Request.homeOperation,
181
- functionData = _ModifyPassApi.Request.functionData;
182
-
183
- homeOperation().then(function (operations) {
184
- _mutantsMicrofx.localStore.set('operationsAuth', (0, _stringify2.default)(operations));
185
- _this.setState({ operations: operations || [] });
186
- resolve();
187
- }).catch(function (err) {
188
- console.log('homeOperation.error======', err);
189
- _tplusComponentsTouch.Loading.hide();
190
- resolve();
191
- });
192
- functionData().then(function (data) {
193
- (0, _tplusPoslogin.PosSetData)(data);
194
- });
195
- });
196
- };
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
-
261
- _this.initHsyPage = function () {
262
- var external_frame = document.getElementById('external-frame-cc');
263
- var win = external_frame && external_frame.contentWindow;
264
- var timer = setTimeout(function () {
265
- _this.setState({ isHsyLoadFinish: true });
266
- }, 15000);
267
- if (!win) return;
268
- win.HsyLoadFinish = function () {
269
- clearTimeout(timer);
270
- _this.setState({ isHsyLoadFinish: true });
271
- };
272
- };
273
-
274
- _this.sunMiPresentationInit = function (result) {
275
- //SunMi初始化参数设置。
276
- //副屏幕交互。硬件改动20200428 需要在商米页面加载成功后才能发送 初始化命令
277
- // 进行主副屏数据交互 初始化
278
- var _ref3 = _mutantsMicrofx.localStore.get('user') || {},
279
- _ref3$store = _ref3.store;
280
-
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;
284
-
285
- console.log(result);
286
-
287
- var _enumController$getEn = _mutantsUtil.enumController.getEnumOj(),
288
- RE_POSParamType = _enumController$getEn.RE_POSParamType;
289
-
290
- var DUAL_SCREEN_SETTING = RE_POSParamType.DUAL_SCREEN_SETTING;
291
-
292
- var filterResult = result && result.filter ? result.filter(function (settingItem) {
293
- return settingItem.ParamType === DUAL_SCREEN_SETTING;
294
- }) : [];
295
- window.sunMi_PresentationManager && window.sunMi_PresentationManager.sharedPreferencesSet("setting_setData", filterResult).then(function () {
296
- console.log("缓存数据成功");
297
- window.sunMi_PresentationManager && window.sunMi_PresentationManager.sendMessageToSecondScreen({ step: 0, storeName: storeName });
298
- });
299
- };
300
-
301
- _this.getTcBasicInfoInit = function () {
302
- var userStore = _tplusApi.User.restore();
303
- var sid = userStore.sid;
304
- var tplusUrl = (0, _tplusPoslogin.PosInitData)("TplusSite") || (0, _tplusPoslogin.PosInitData)("tplusinnersite");
305
- if (!tplusUrl) {
306
- var msg = "请用admin登录,在服务器配置–地址配置处,设置“内部或外部网络访问T+服务器的地址”!";
307
- _tplusComponentsTouch.ModalWraper.warning({
308
- title: '温馨提示',
309
- content: msg,
310
- okText: '确定',
311
- okType: 'primary'
312
- });
313
- return false;
314
- }
315
- if (tplusUrl.substring(tplusUrl.length - 1) !== '/') {
316
- tplusUrl += '/';
317
- }
318
- var ossjumpUrl = tplusUrl + 'view/portal/portal.html?t=' + new Date().getTime();
319
- if (sid) {
320
- ossjumpUrl = tplusUrl + 'view/ossjump.html?t=' + new Date().getTime() + '&sid=' + sid;
321
- }
322
- var postMsgUrl = ossjumpUrl;
323
- var user = _this.context.stores.user;
324
-
325
- var loginInfo = user.options.get('loginInfo');
326
-
327
- var _ref4 = loginInfo || {},
328
- UserCode = _ref4.UserCode,
329
- AccountNum = _ref4.AccountNum,
330
- posCode = _ref4.posCode,
331
- TplusStoreId = _ref4.TplusStoreId;
332
-
333
- var uid = _this.tplusEncode(UserCode);
334
- var pwd = _this.tplusEncode(user.options.get("password"));
335
- var accNum = _this.tplusEncode(AccountNum);
336
- var code = _this.tplusEncode(posCode);
337
- var store = _this.tplusEncode(TplusStoreId + '');
338
- ossjumpUrl += '&fromApp=nretail&way=inframe&user=' + uid + '&pwd=' + pwd + '&accNum=' + accNum + '&posCode=' + code + '&storeID=' + store;
339
- return { ossjumpUrl: ossjumpUrl, postMessageUrl: postMsgUrl };
340
- };
341
-
342
- _this.getScreenType = function () {
343
- var flag = false;
344
- if (_this.hasElectron === true || _this.isHorizontalSunMi) {
345
- var data = _mutantsMicrofx.localStore.get('setting_setData') || [];
346
- data = data.filter(function (item) {
347
- return item.Name === 'EnableDoubleScreen';
348
- });
349
- data = data && data.length > 0 ? data.shift() : null;
350
- if (data && data.Value === '1') {
351
- flag = true;
352
- }
353
- }
354
- return flag;
355
- };
356
-
357
- _this.saveLog = function (name) {
358
- var saveLogo = _ModifyPassApi.Request.saveLogo;
359
-
360
- name = "进入模块:" + name;
361
- saveLogo('进入模块', undefined, name);
362
- };
363
-
364
- _this.handelClick = function () {
365
- var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
366
- var type = values.key,
367
- isModal = values.isModal,
368
- iframe = values.iframe,
369
- app = values.app,
370
- title = values.title,
371
- Name = values.Name,
372
- style = values.style,
373
- search = values.search,
374
- tmenuCode = values.tmenuCode;
375
- var _this$state = _this.state,
376
- operations = _this$state.operations,
377
- isHsyLoadFinish = _this$state.isHsyLoadFinish;
378
-
379
- var controllable = operations.find(function (vv) {
380
- return vv.Name === Name;
381
- });
382
-
383
- var _ref5 = controllable || {},
384
- Visibility = _ref5.Visibility,
385
- HoldFunctionAuth = _ref5.HoldFunctionAuth,
386
- Title = _ref5.Title,
387
- MenuCode = _ref5.MenuCode;
388
-
389
- var errorTip = void 0;
390
-
391
- if (!_mutantsMicrofx.stores.offlineSys.shouldOpenHomeOperation(Name)) {
392
- _tplusComponentsTouch.Message.warn("离线模式下此操作不可用");
393
- return;
394
- }
395
-
396
- if (type == 'more') {
397
- if (_this.isMobileEnvironment) {
398
- //暂时不支持android系统跳转
399
- return _tplusComponentsTouch.Message.warn('新功能正在研发中,敬请期待。');
400
- }
401
- return _this.setState({ showMoreModal: true });
402
- }
403
- if (!Title) {
404
- return _tplusComponentsTouch.ModalWraper.warning({
405
- title: '提示',
406
- content: '您的权限配置请求失败,请重新登录',
407
- onOk: function onOk() {
408
- _tplusApi.User.logout();
409
- },
410
-
411
- okType: 'primary'
412
- });
413
- }
414
-
415
- if (!Visibility) {
416
- errorTip = '\u60A8\u7684 ' + Title + ' \u6A21\u5757\u6CA1\u6709\u542F\u7528';
417
- } else if (!HoldFunctionAuth) {
418
- errorTip = '\u60A8\u6CA1\u6709\u64CD\u4F5C ' + Title + ' \u7684\u6743\u9650';
419
- }
420
- var portalStore = _this.context.stores.portalStore;
421
-
422
- if (errorTip) {
423
- return _tplusComponentsTouch.Message.warn(errorTip);
424
- }
425
- if (isModal) {
426
- return _mutantsMicrofx.stores.modalRouter.show({ url: '/' + type, width: 800, title: title });
427
- }
428
- // 支持页面内打开,减少再次加载页面的时间。
429
- if (iframe === true) return _this.toFramePage({ type: type, app: app, title: title, style: style, search: search, MenuCode: MenuCode, tmenuCode: tmenuCode, isHsyLoadFinish: isHsyLoadFinish });
430
- switch (type) {
431
- case 'cashier':
432
- portalStore.checkDuty().then(function (onDutyMessage) {
433
- if (!!onDutyMessage) {
434
- var Code = onDutyMessage.Code,
435
- IdShiftVoucher = onDutyMessage.IdShiftVoucher,
436
- Shift = onDutyMessage.Shift,
437
- IdDailyVoucher = onDutyMessage.IdDailyVoucher,
438
- DailyCode = onDutyMessage.DailyCode;
439
-
440
- (0, _tplusPoslogin.PosSetData)({ ShiftCode: Code, IdShiftVoucher: IdShiftVoucher, Shift: Shift, IdDailyVoucher: IdDailyVoucher, DailyCode: DailyCode });
441
- console.log('onDutyMessage======', onDutyMessage);
442
- _this.saveLog(title);
443
- _mutantsMicrofx.history.push('/RE/RE01');
444
- }
445
- }).catch(function (data) {
446
- console.log("进入前台收银检查是否当班返回错误", data);
447
- });
448
- break;
449
- case 'onDuty':
450
- portalStore.onDuty().then(function (onDutyMessage) {
451
- if (onDutyMessage && onDutyMessage.shift) {
452
- _middleWare2.default.execute('onDuty');
453
- }
454
- });
455
- break;
456
- case 'offDuty':
457
- _mutantsMicrofx.history.push('/offDuty?type=offDuty');
458
- break;
459
- case 'settleDialy':
460
- if (portalStore.bPosDaily()) {
461
- _mutantsMicrofx.history.push('/offDuty?type=settleDaily');
462
- } else {
463
- portalStore.onMakerDaily();
464
- }
465
- break;
466
- default:
467
- _mutantsMicrofx.history.push('/' + type);
468
- break;
469
- }
470
- };
471
-
472
- _this.toFramePage = function (params) {
473
- var _ref6 = params || {},
474
- app = _ref6.app,
475
- title = _ref6.title,
476
- style = _ref6.style,
477
- search = _ref6.search,
478
- tmenuCode = _ref6.tmenuCode,
479
- MenuCode = _ref6.MenuCode,
480
- isHsyLoadFinish = _ref6.isHsyLoadFinish;
481
-
482
- switch (app) {
483
- case 'cc':
484
- var sh = '';
485
- if (_this.isMobileEnvironment) {
486
- //暂时不支持android系统跳转
487
- return _tplusComponentsTouch.Message.warn('新功能正在研发中,敬请期待。');
488
- }
489
- if (!isHsyLoadFinish) {
490
- return _tplusComponentsTouch.Message.warn('正在加载资源中,请稍后。');
491
- }
492
- if (!search) {
493
- return _tplusComponentsTouch.Message.warn('正在紧急研发中...');
494
- } else if (search && search.length > 0) {
495
- sh = search.length > 1 && MenuCode ? search.find(function (v) {
496
- return v.menu === MenuCode;
497
- }) : search[0];
498
- sh = sh || search[0];
499
- }
500
- if (!sh) {
501
- return _tplusComponentsTouch.Message.warn('传递参数有误,请查证。');
502
- }
503
- _this.toHsyPage((0, _extends3.default)({}, style, sh));
504
- break;
505
- case 'tc':
506
- if (tmenuCode || MenuCode) {
507
- _this.saveLog(title);
508
- if (MenuCode) {
509
- _this.toTplusPage(MenuCode, search);
510
- } else {
511
- _this.toTplusPage(tmenuCode, search);
512
- }
513
- }
514
- break;
515
- }
516
- };
517
-
518
- _this.getTplusUrlFromCloudServer = function () {
519
- //获取T+服务器配置地址。
520
- var userStore = _tplusApi.User.restore();
521
- var data = 'accesstoken=' + ('' + userStore.accessToken) + '&cloudOrgId=' + ('' + userStore.orgId);
522
- var url = '' + HTTP_PROXY_URL + encodeURIComponent('http://mns.chanapp.chanjet.com/web/WebServer/get?' + ('' + data));
523
- console.log(url);
524
- var fetchHeader = {
525
- headers: {
526
- 'Content-Type': 'application/x-www-form-urlencoded'
527
- }
528
- };
529
- return new _promise2.default(function (resolve, reject) {
530
- fetch(url, fetchHeader).then(function (response) {
531
- return response.json();
532
- }).then(function (json) {
533
- console.log(json);
534
- resolve(json);
535
- }).catch(function (ex) {
536
- console.log(ex);
537
- reject(err);
538
- });
539
- });
540
- };
541
-
542
- _this.toTplusPage = function () {
543
- var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(tmenuCode, search) {
544
- var ret, _ref8, ossjumpUrl, postMessageUrl, dsearchPlanID, portalStore, menu, external_frame_tc, win, loadTcURL;
545
-
546
- return _regenerator2.default.wrap(function _callee3$(_context3) {
547
- while (1) {
548
- switch (_context3.prev = _context3.next) {
549
- case 0:
550
- ret = _this.getTcBasicInfoInit();
551
-
552
- if (!(ret === false)) {
553
- _context3.next = 3;
554
- break;
555
- }
556
-
557
- return _context3.abrupt('return');
558
-
559
- case 3:
560
- _ref8 = ret || {}, ossjumpUrl = _ref8.ossjumpUrl, postMessageUrl = _ref8.postMessageUrl;
561
- dsearchPlanID = '';
562
-
563
- if (!(search && search.id)) {
564
- _context3.next = 10;
565
- break;
566
- }
567
-
568
- portalStore = _this.context.stores.portalStore;
569
- _context3.next = 9;
570
- return portalStore.getSearchPlanId(search);
571
-
572
- case 9:
573
- dsearchPlanID = _context3.sent;
574
-
575
- case 10:
576
- menu = _this.tplusEncode(tmenuCode);
577
-
578
- ossjumpUrl += '&menu=' + menu + '&fromUrl=' + _this.tplusEncode(location.origin);
579
- if (dsearchPlanID) {
580
- ossjumpUrl += '&searchPlanID=' + _this.tplusEncode(dsearchPlanID);
581
- }
582
-
583
- if (!_this.isHorizontalSunMi) {
584
- _context3.next = 17;
585
- break;
586
- }
587
-
588
- window.android_CommonFun.openWebUrlByOutBrowser(ossjumpUrl);
589
- _context3.next = 25;
590
- break;
591
-
592
- case 17:
593
- if (!(_this.new_retail_app == 'tc' || _this.new_retail_app == 'tczsy' || _this.new_retail_app == 'tcyzj')) {
594
- _context3.next = 20;
595
- break;
596
- }
597
-
598
- _mutantsMicrofx.nativeMs.useDefaultBrowser(ossjumpUrl);
599
- return _context3.abrupt('return');
600
-
601
- case 20:
602
- external_frame_tc = document.getElementById('external-frame-tc');
603
- win = external_frame_tc.contentWindow;
604
- loadTcURL = _this.state.loadTcURL;
605
-
606
- if (loadTcURL) {
607
- win && win.postMessage({ doType: 'openMenuFromPos', tmenuCode: tmenuCode, ossjumpUrl: ossjumpUrl, dsearchPlanID: dsearchPlanID }, postMessageUrl);
608
- _this.setState({ loadTcPage: true });
609
- } else {
610
- _this.setState({ loadTcURL: ossjumpUrl, loadTcPage: true });
611
- }
612
- rx$.changeHsy.next({
613
- back: true, fn: function fn() {
614
- win && win.postMessage({ doType: 'closeCurrentMenuFromPos' }, postMessageUrl);
615
- _this.setState({ loadTcPage: false });
616
- rx$.changeHsy.next({ back: false });
617
- }
618
- });
619
-
620
- case 25:
621
- case 'end':
622
- return _context3.stop();
623
- }
624
- }
625
- }, _callee3, _this2);
626
- }));
627
-
628
- return function (_x2, _x3) {
629
- return _ref7.apply(this, arguments);
630
- };
631
- }();
632
-
633
- _this.toHsyPage = function () {
634
- var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(params) {
635
- 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;
636
-
637
- return _regenerator2.default.wrap(function _callee4$(_context4) {
638
- while (1) {
639
- switch (_context4.prev = _context4.next) {
640
- case 0:
641
- 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;
642
- filter = {};
643
- //对仓库参数的处理
644
-
645
- IdWarehouse = (0, _tplusPoslogin.PosInitData)('IdWarehouse') || '';
646
- WarehouseName = (0, _tplusPoslogin.PosInitData)('WarehouseName') || '';
647
- IsPerformanceDistribution = (0, _tplusPoslogin.PosInitData)('PerformanceDistribution') === 'SHIPPER_STORE' || false;
648
- _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;
649
- _ref10$store = _ref10$store === undefined ? {} : _ref10$store;
650
- _ref10$store$storeNam = _ref10$store.storeName, storeName = _ref10$store$storeNam === undefined ? '' : _ref10$store$storeNam;
651
- _context4.t0 = pageType;
652
- _context4.next = _context4.t0 === 'voucher' ? 11 : _context4.t0 === 'report' ? 14 : 18;
653
- break;
654
-
655
- case 11:
656
- filter = {
657
- defaultValue: {
658
- storeId: {
659
- id: IdStore,
660
- storeName: storeName
661
- },
662
- warehouseId: {
663
- id: IdWarehouse,
664
- name: WarehouseName
665
- }
666
- }
667
- //要货单特殊处理
668
- };if (menu == 'require-goods-new') {
669
- filter = {
670
- defaultValue: {
671
- storeId: {
672
- id: IdStore,
673
- storeName: storeName
674
- },
675
- requireWarehouseId: {
676
- id: IdWarehouse,
677
- name: WarehouseName
678
- }
679
- }
680
- };
681
- }
682
- return _context4.abrupt('break', 18);
683
-
684
- case 14:
685
- filter = {
686
- filterValue: {
687
- storeId: {
688
- value: {
689
- id: IdStore,
690
- storeName: storeName
691
- }
692
- },
693
- warehouseId: {
694
- value: [{
695
- id: IdWarehouse,
696
- name: WarehouseName
697
- }]
698
- }
699
- }
700
- // 收银统计表
701
- };if (IsPerformanceDistribution && menu == 'retail-cash-report') {
702
- filter = {
703
- filterValue: {
704
- deliveryStoreId: {
705
- value: {
706
- id: IdStore,
707
- storeName: storeName
708
- }
709
- },
710
- warehouseId: {
711
- value: [{
712
- id: IdWarehouse,
713
- name: WarehouseName
714
- }]
715
- }
716
- }
717
- };
718
- }
719
- // 售后、配送
720
- if (menu == 'return-order' || menu == 'order-manage') {
721
- filter = {
722
- filterValue: {
723
- storeId: {
724
- value: {
725
- id: IdStore,
726
- storeName: storeName
727
- }
728
- },
729
- deliveryWarehouseId: {
730
- value: [{
731
- id: IdWarehouse,
732
- name: WarehouseName
733
- }]
734
- }
735
- }
736
- };
737
- }
738
- return _context4.abrupt('break', 18);
739
-
740
- case 18:
741
- bar_bg = encodeURIComponent(bar_bg);
742
- bar_active_bg = encodeURIComponent(bar_active_bg);
743
- menu = secondRouter ? menu + '/' + _this.randomWord(true, 13) : menu;
744
- pageId = menu;
745
- pageParams = (0, _assign2.default)(pageParams, filter);
746
- path = encodeURIComponent(path);
747
- _k = _this.randomWord(false, 6);
748
-
749
- commonArgs = '?posid=' + PosId + '&content_only=' + content_only + '&bar_bg=' + bar_bg + '&bar_active_bg=' + bar_active_bg;
750
- actionUrl = '#/' + menu + '?activePrompt=' + activePrompt + '&closePrompt=' + closePrompt + '&closeable=' + closeable + '&leavePrompt=' + leavePrompt + '&lock=' + lock + '&pageId=' + pageId + '&pageParams=' + encodeURIComponent((0, _stringify2.default)(pageParams)) + '&path=' + path + '&tabId=' + tabId + '&tabLabel=' + encodeURIComponent(tabLabel) + '&_k=' + _k;
751
- cc_url = _this.hsy_domain.replace('#/', '') + commonArgs + actionUrl;
752
-
753
- console.log('web_hsy_url:', cc_url);
754
-
755
- if (!_this.isHorizontalSunMi) {
756
- _context4.next = 37;
757
- break;
758
- }
759
-
760
- _context4.next = 32;
761
- return _tplusApi.User.getLoginCCMidWebUrl(cc_url);
762
-
763
- case 32:
764
- CC_WEB_URL = _context4.sent;
765
-
766
- console.log('CC_WEB_URL:', CC_WEB_URL);
767
- window.android_CommonFun.openWebUrlByOutBrowser(CC_WEB_URL);
768
- _context4.next = 42;
769
- break;
770
-
771
- case 37:
772
- external_frame = document.getElementById('external-frame-cc');
773
- win = external_frame.contentWindow;
774
-
775
- win && win.HsyRouterJump && win.HsyRouterJump(pageId, pageParams, { closeable: closeable, tabLabel: tabLabel });
776
- if (_this.state.showMoreModal === true) {
777
- _this.setState({ loadHsyPage: true, showMoreModal: false });
778
- } else {
779
- _this.setState({ loadHsyPage: true });
780
- }
781
- rx$.changeHsy.next({
782
- back: true, fn: function fn() {
783
- _this.setState({ loadHsyPage: false });
784
- rx$.changeHsy.next({ back: false });
785
- // 在打开页签之前,关闭之前的。
786
- var external_frame_a = document.getElementById('external-frame-cc');
787
- var wins = external_frame_a.contentWindow;
788
- wins && wins.HsyRouterClean && win.HsyRouterClean();
789
- }
790
- });
791
-
792
- case 42:
793
- case 'end':
794
- return _context4.stop();
795
- }
796
- }
797
- }, _callee4, _this2);
798
- }));
799
-
800
- return function (_x4) {
801
- return _ref9.apply(this, arguments);
802
- };
803
- }();
804
-
805
- _this.randomWord = function (only, digits) {
806
- var str = "";
807
- var number = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
808
- var letter = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
809
- var arr = only ? [].concat(number) : [].concat(number, letter);
810
- for (var i = 0; i < digits; i++) {
811
- var pos = Math.round(Math.random() * (arr.length - 1));
812
- str += arr[pos];
813
- }
814
- return str;
815
- };
816
-
817
- _this.closeFrameModal = function () {
818
- _this.setState({ showModal: false });
819
- };
820
-
821
- _this.closeMoreModal = function () {
822
- _this.setState({ showMoreModal: false });
823
- };
824
-
825
- _this.tplusEncode = function (code) {
826
- var c = String.fromCharCode(code.charCodeAt(0) + code.length);
827
- for (var i = 1; i < code.length; i++) {
828
- c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1));
829
- }
830
- var ret = _this.TplusBase64Encode(c);
831
- return ret;
832
- };
833
-
834
- _this.TplusBase64Encode = function (input) {
835
- var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
836
- var output = "";
837
- var chr1 = void 0,
838
- chr2 = void 0,
839
- chr3 = void 0,
840
- enc1 = void 0,
841
- enc2 = void 0,
842
- enc3 = void 0,
843
- enc4 = void 0;
844
- var i = 0;
845
- input = _this._utf8_encode(input);
846
- while (i < input.length) {
847
- chr1 = input.charCodeAt(i++);
848
- chr2 = input.charCodeAt(i++);
849
- chr3 = input.charCodeAt(i++);
850
- enc1 = chr1 >> 2;
851
- enc2 = (chr1 & 3) << 4 | chr2 >> 4;
852
- enc3 = (chr2 & 15) << 2 | chr3 >> 6;
853
- enc4 = chr3 & 63;
854
- if (isNaN(chr2)) {
855
- enc3 = enc4 = 64;
856
- } else if (isNaN(chr3)) {
857
- enc4 = 64;
858
- }
859
- output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
860
- }
861
- return output;
862
- };
863
-
864
- _this._utf8_encode = function (string) {
865
- string = string.replace(/\r\n/g, "\n");
866
- var utftext = "";
867
- for (var n = 0; n < string.length; n++) {
868
- var c = string.charCodeAt(n);
869
- if (c < 128) {
870
- utftext += String.fromCharCode(c);
871
- } else if (c > 127 && c < 2048) {
872
- utftext += String.fromCharCode(c >> 6 | 192);
873
- utftext += String.fromCharCode(c & 63 | 128);
874
- } else {
875
- utftext += String.fromCharCode(c >> 12 | 224);
876
- utftext += String.fromCharCode(c >> 6 & 63 | 128);
877
- utftext += String.fromCharCode(c & 63 | 128);
878
- }
879
- }
880
- return utftext;
881
- };
882
-
883
- _this.operationControl = function () {
884
- var menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
885
- var operations = _this.state.operations;
886
-
887
- menu.forEach(function (v) {
888
- if (v.sub) {
889
- return _this.operationControl(v.sub);
890
- }
891
- var controllable = operations.find(function (vv) {
892
- return vv.Name === v.Name;
893
- });
894
-
895
- var _ref11 = controllable || {},
896
- Visibility = _ref11.Visibility,
897
- HoldFunctionAuth = _ref11.HoldFunctionAuth,
898
- Title = _ref11.Title;
899
-
900
- var errorTip = void 0;
901
- if (!Visibility) {
902
- errorTip = '\u60A8\u7684 ' + Title + ' \u6A21\u5757\u6CA1\u6709\u542F\u7528';
903
- } else if (!HoldFunctionAuth) {
904
- errorTip = '\u60A8\u6CA1\u6709\u64CD\u4F5C ' + Title + ' \u7684\u6743\u9650';
905
- }
906
- v.errorTip = errorTip;
907
- });
908
- return menu;
909
- };
910
-
911
- _this.createLeftNode = function () {
912
- var menu = _this.leftMenu;
913
- var menuNode = menu.map(function (v) {
914
- return v.container ? _react2.default.createElement(
915
- 'div',
916
- { style: v.container.style, className: v.container.className, key: v.container.className },
917
- v.sub.map(function (vv) {
918
- var item = vv;
919
- if (vv.maybe === true) {
920
- var status = !!(0, _tplusPoslogin.PosInitData)('ShowStorePrice');
921
- item = status ? vv : vv.second;
922
- }
923
- return _react2.default.createElement(
924
- 'div',
925
- {
926
- className: 'member-item ' + item.className + ' ' + (item.disabled ? 'menu-item-disabled' : ''),
927
- key: item.className,
928
- onClick: _this.handelClick.bind(_this, item)
929
- },
930
- !!item.title && _react2.default.createElement(
931
- 'h1',
932
- null,
933
- item.title
934
- ),
935
- !!item.label && _react2.default.createElement(
936
- 'p',
937
- null,
938
- item.label
939
- ),
940
- !!item.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: item.icon })
941
- );
942
- })
943
- ) : _react2.default.createElement(
944
- 'div',
945
- {
946
- className: 'member-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
947
- key: v.className,
948
- onClick: _this.handelClick.bind(_this, v)
949
- },
950
- v.title && _react2.default.createElement(
951
- 'h1',
952
- null,
953
- v.title
954
- ),
955
- v.label && _react2.default.createElement(
956
- 'p',
957
- null,
958
- v.label
959
- ),
960
- v.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: v.icon })
961
- );
962
- });
963
- return menuNode;
964
- };
965
-
966
- _this.createCenterNode = function () {
967
- var menuLeftNode = _this.centerLeftMenu.map(function (v) {
968
- return _react2.default.createElement(
969
- 'div',
970
- {
971
- className: 'worktop-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
972
- style: v.style,
973
- key: v.className,
974
- onClick: _this.handelClick.bind(_this, v)
975
- },
976
- v.title && _react2.default.createElement(
977
- 'h1',
978
- null,
979
- v.title
980
- ),
981
- v.label && _react2.default.createElement(
982
- 'p',
983
- null,
984
- v.label
985
- ),
986
- v.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: v.icon }),
987
- v.disabled && _react2.default.createElement('div', { className: 'item-disabled-placeholder' })
988
- );
989
- });
990
- var menuRightNode = _this.centerRightMenu.map(function (v) {
991
- return v.container ? _react2.default.createElement(
992
- 'div',
993
- { style: v.container.style, className: v.container.className, key: v.container.className },
994
- v.sub.map(function (vv) {
995
- return _react2.default.createElement(
996
- 'div',
997
- {
998
- className: 'worktop-item ' + vv.className + ' ' + (vv.disabled ? 'menu-item-disabled' : ''),
999
- key: vv.className,
1000
- onClick: _this.handelClick.bind(_this, vv)
1001
- },
1002
- vv.title && _react2.default.createElement(
1003
- 'h1',
1004
- null,
1005
- vv.title
1006
- ),
1007
- vv.label && _react2.default.createElement(
1008
- 'p',
1009
- null,
1010
- vv.label
1011
- ),
1012
- vv.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: vv.icon })
1013
- );
1014
- })
1015
- ) : _react2.default.createElement(
1016
- 'div',
1017
- {
1018
- className: 'worktop-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
1019
- key: v.className,
1020
- onClick: _this.handelClick.bind(_this, v)
1021
- },
1022
- v.title && _react2.default.createElement(
1023
- 'h1',
1024
- null,
1025
- v.title
1026
- ),
1027
- v.label && _react2.default.createElement(
1028
- 'p',
1029
- null,
1030
- v.label
1031
- ),
1032
- v.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: v.icon })
1033
- );
1034
- });
1035
- return _react2.default.createElement(
1036
- 'div',
1037
- null,
1038
- _react2.default.createElement(
1039
- 'div',
1040
- { className: 'worktop-container-left' },
1041
- menuLeftNode
1042
- ),
1043
- _react2.default.createElement(
1044
- 'div',
1045
- { className: 'worktop-container-right' },
1046
- menuRightNode
1047
- )
1048
- );
1049
- };
1050
-
1051
- _this.createRightNode = function () {
1052
- var node = _this.rightMenu.map(function (v) {
1053
- return v.container ? _react2.default.createElement(
1054
- 'div',
1055
- { style: v.container.style, className: v.container.className, key: v.container.className },
1056
- v.sub.map(function (vv) {
1057
- return _react2.default.createElement(
1058
- 'div',
1059
- {
1060
- className: 'stock-item ' + vv.className + ' ' + (vv.disabled ? 'menu-item-disabled' : ''),
1061
- key: vv.className,
1062
- onClick: _this.handelClick.bind(_this, vv)
1063
- },
1064
- vv.title && _react2.default.createElement(
1065
- 'h1',
1066
- null,
1067
- vv.title
1068
- ),
1069
- vv.label && _react2.default.createElement(
1070
- 'p',
1071
- null,
1072
- vv.label
1073
- ),
1074
- vv.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: vv.icon })
1075
- );
1076
- })
1077
- ) : _react2.default.createElement(
1078
- 'div',
1079
- {
1080
- className: 'stock-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
1081
- style: v.style,
1082
- key: v.className,
1083
- onClick: _this.handelClick.bind(_this, v)
1084
- },
1085
- !!v.title && _react2.default.createElement(
1086
- 'h1',
1087
- null,
1088
- v.title
1089
- ),
1090
- !!v.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: v.icon })
1091
- );
1092
- });
1093
- return node;
1094
- };
1095
-
1096
- _this.createMoreNode = function () {
1097
- var arrs = _this.centerRightMenu.find(function (v) {
1098
- return v.sub && v.sub.find(function (vv) {
1099
- return vv.key == 'more';
1100
- });
1101
- }).sub[1];
1102
- var items = _this.new_retail_app == 'cc' ? arrs.sub_cc : _this.new_retail_app == 'tc' || _this.new_retail_app == 'tczsy' || _this.new_retail_app == 'tcyzj' ? arrs.sub_tc : [];
1103
- var node = items.length > 0 && items.map(function (v) {
1104
- return _react2.default.createElement(
1105
- 'div',
1106
- {
1107
- className: 'modal-quick ' + v.className,
1108
- style: v.style,
1109
- key: v.className,
1110
- onClick: _this.handelClick.bind(_this, v)
1111
- },
1112
- !!v.icon && _react2.default.createElement(
1113
- 'div',
1114
- { className: 'quick' },
1115
- _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: v.icon })
1116
- ),
1117
- !!v.title && _react2.default.createElement(
1118
- 'h1',
1119
- null,
1120
- v.title
1121
- )
1122
- );
1123
- });
1124
- return node;
1125
- };
1126
-
1127
- _this.hasElectron = hasElectron;
1128
- _this.state = {
1129
- id: Date.now(),
1130
- operations: [],
1131
- showModal: false,
1132
- showMoreModal: false,
1133
- loadHsyPage: false,
1134
- loadHsyURL: '',
1135
- isHsyLoadFinish: false,
1136
- loadTcPage: false,
1137
- loadTcURL: '',
1138
- modalURL: ''
1139
- };
1140
-
1141
- var _ref12 = _mutantsUtil.platform || {},
1142
- isVerticalTouch = _ref12.isVerticalTouch,
1143
- isHorizontalPad = _ref12.isHorizontalPad,
1144
- isHorizontalSunMi = _ref12.isHorizontalSunMi,
1145
- isNewRetailBCPos = _ref12.isNewRetailBCPos,
1146
- isNewRetailBCPosTC = _ref12.isNewRetailBCPosTC;
1147
-
1148
- _this.isVerticalTouch = !!isVerticalTouch;
1149
- _this.isHorizontalPad = !!isHorizontalPad;
1150
- _this.isHorizontalSunMi = !!isHorizontalSunMi;
1151
- _this.isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi;
1152
- _this.FuPingIsLoaded = false;
1153
- _this.isNewRetailBCPos = !!isNewRetailBCPos;
1154
- _this.isNewRetailBCPosTC = !!isNewRetailBCPosTC;
1155
- _this.new_retail_app = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('newRetailAppType');
1156
-
1157
- //首页布局
1158
- var leftMenu = _data2.default.leftMenu,
1159
- centerLeftMenu = _data2.default.centerLeftMenu,
1160
- centerRightMenu = _data2.default.centerRightMenu,
1161
- rightMenu = _data2.default.rightMenu,
1162
- leftMenuTC = _data2.default.leftMenuTC,
1163
- rightMenuTC = _data2.default.rightMenuTC;
1164
-
1165
- _this.leftMenu = isNewRetailBCPosTC ? leftMenuTC : leftMenu;
1166
- _this.centerLeftMenu = centerLeftMenu;
1167
- _this.centerRightMenu = centerRightMenu;
1168
- _this.rightMenu = isNewRetailBCPosTC ? rightMenuTC : rightMenu;
1169
- _this.hsy_domain = _tplusApi.User && _tplusApi.User.getWebEntry();
1170
- _this.randomWord = _this.randomWord.bind(_this);
1171
- (0, _mobx.autorun)(function () {
1172
- _this.hsyBasicInfoInit();
1173
- });
1174
- return _this;
1175
- }
1176
-
1177
- (0, _createClass3.default)(_default, [{
1178
- key: 'componentDidMount',
1179
- value: function componentDidMount() {
1180
- this.initPageData();
1181
- if (this.isNewRetailBCPos && !this.isVerticalTouch && !this.isMobileEnvironment) {
1182
- this.initHsyPage();
1183
- }
1184
- }
1185
-
1186
- // 初始化好生意页面
1187
-
1188
-
1189
- // 初始化商米副屏
1190
-
1191
- }, {
1192
- key: 'hsyBasicInfoInit',
1193
-
1194
-
1195
- // 初始化智+模块信息
1196
- value: function hsyBasicInfoInit() {
1197
- var theme = _mutantsMicrofx.stores.portalStore.themeStore;
1198
- var color = '#FF8C25';
1199
- switch (theme) {
1200
- case 'orange':
1201
- color = "#FF8C25";
1202
- break;
1203
- case 'blue':
1204
- color = "#3491FF";
1205
- break;
1206
- case 'dark':
1207
- color = "#26A0DE";
1208
- break;
1209
- case 'pink':
1210
- color = "#FF6B8C";
1211
- break;
1212
- }
1213
-
1214
- var _ref13 = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('StoreKey') || {},
1215
- _ref13$PosId = _ref13.PosId,
1216
- PosId = _ref13$PosId === undefined ? '' : _ref13$PosId;
1217
-
1218
- var cc_url = this.hsy_domain.replace('#/', '') + '?fromApp=nretail&posid=' + PosId + '&content_only=true&bar_bg=' + encodeURIComponent('#FFFFFF') + '&bar_active_bg=' + encodeURIComponent(color);
1219
- this.setState({ loadHsyURL: cc_url });
1220
- }
1221
-
1222
- //初始化tc、tcyzj、tczsy信息
1223
-
1224
- }, {
1225
- key: 'componentWillUnmount',
1226
- value: function componentWillUnmount() {
1227
- var _context$headHook = this.context.headHook;
1228
- _context$headHook = _context$headHook === undefined ? {} : _context$headHook;
1229
- var removeClass = _context$headHook.removeClass;
1230
-
1231
- removeClass && removeClass(this.state.id, 'portalHead');
1232
- }
1233
- }, {
1234
- key: 'componentWillReceiveProps',
1235
- value: function componentWillReceiveProps() {
1236
- if (this.getScreenType() === true) {
1237
- if (this.isHorizontalSunMi && this.FuPingIsLoaded) {
1238
- window.sunMi_PresentationManager && window.sunMi_PresentationManager.sendMessageToSecondScreen({ step: 1 });
1239
- } else {
1240
- _mutantsMicrofx.nativeMs && _mutantsMicrofx.nativeMs.setIpcRendererMethod('ReplyScreen', { step: 1 });
1241
- }
1242
- }
1243
- }
1244
-
1245
- // 获取副屏的状态
1246
-
1247
- }, {
1248
- key: 'menuClick',
1249
- value: function menuClick(item, e) {
1250
- _mutantsMicrofx.history.push(item.path);
1251
- }
1252
-
1253
- //跳转其他页面,以内嵌形式打开
1254
-
1255
-
1256
- //跳转到T+
1257
-
1258
-
1259
- //跳转CC
1260
-
1261
- }, {
1262
- key: 'render',
1263
- value: function render() {
1264
- var _state = this.state,
1265
- showModal = _state.showModal,
1266
- showMoreModal = _state.showMoreModal,
1267
- modalURL = _state.modalURL,
1268
- loadHsyPage = _state.loadHsyPage,
1269
- loadHsyURL = _state.loadHsyURL,
1270
- loadTcPage = _state.loadTcPage,
1271
- loadTcURL = _state.loadTcURL;
1272
-
1273
- var screenHeight = window.screen.availHeight - 100;
1274
- var htmlContent = null;
1275
- if (this.isVerticalTouch) {
1276
- htmlContent = _react2.default.createElement(_verticalPortal2.default, { handelClick: this.handelClick });
1277
- } else if (this.isHorizontalPad) {
1278
- htmlContent = _react2.default.createElement(_horizontalPadPortal2.default, { handelClick: this.handelClick });
1279
- } else {
1280
- htmlContent = _react2.default.createElement(
1281
- _tplusComponentsTouch.Layout,
1282
- { style: { height: '100%' }, className: 'portal-content' },
1283
- _react2.default.createElement(
1284
- Content,
1285
- { style: { paddingLeft: '50px', paddingRight: '50px' }, className: 'portal-container' },
1286
- _react2.default.createElement(
1287
- _antd.Row,
1288
- null,
1289
- _react2.default.createElement(
1290
- _antd.Col,
1291
- { xl: 7, md: 7, className: 'portal-left-col', key: 'left' },
1292
- _react2.default.createElement(
1293
- 'div',
1294
- { className: 'portal-left-content' },
1295
- this.createLeftNode()
1296
- )
1297
- ),
1298
- _react2.default.createElement(
1299
- _antd.Col,
1300
- { xl: 10, md: 10, className: 'portal-center-col', key: 'center' },
1301
- _react2.default.createElement(
1302
- 'div',
1303
- { className: 'portal-center-content' },
1304
- this.createCenterNode()
1305
- )
1306
- ),
1307
- _react2.default.createElement(
1308
- _antd.Col,
1309
- { xl: 7, md: 7, className: 'portal-right-col', key: 'right' },
1310
- _react2.default.createElement(
1311
- 'div',
1312
- { className: 'portal-right-content' },
1313
- this.createRightNode()
1314
- )
1315
- )
1316
- )
1317
- ),
1318
- _react2.default.createElement(
1319
- 'div',
1320
- { className: loadHsyPage ? 'portal-hsy-tc-container' : 'portal-hsy-tc-container portal-hsy-tc-container-hide' },
1321
- _react2.default.createElement('iframe', { src: loadHsyURL, width: '100%', height: '93%', frameborder: 'no', border: '0', marginwidth: '0', marginheight: '0', scrolling: 'yes', allowtransparency: 'true', id: 'external-frame-cc' })
1322
- ),
1323
- _react2.default.createElement(
1324
- 'div',
1325
- { className: loadTcPage ? 'portal-hsy-tc-container' : 'portal-hsy-tc-container portal-hsy-tc-container-hide' },
1326
- _react2.default.createElement('iframe', { src: loadTcURL, width: '100%', height: '93%', frameborder: 'no', border: '0', marginwidth: '0', marginheight: '0', scrolling: 'yes', allowtransparency: 'true', id: 'external-frame-tc' })
1327
- ),
1328
- this.isMobileEnvironment && _react2.default.createElement(
1329
- _antd.Modal,
1330
- {
1331
- visible: showModal,
1332
- onCancel: this.closeFrameModal,
1333
- width: '99%',
1334
- height: '99%',
1335
- footer: null
1336
- },
1337
- _react2.default.createElement('iframe', { src: modalURL, width: '100%', height: screenHeight, frameborder: 'no', border: '0', marginwidth: '0', marginheight: '0', scrolling: 'yes', allowtransparency: 'true' })
1338
- ),
1339
- _react2.default.createElement(
1340
- _antd.Modal,
1341
- {
1342
- title: '更多',
1343
- className: 'portal-container-modal-more',
1344
- visible: showMoreModal,
1345
- onCancel: this.closeMoreModal,
1346
- width: 800,
1347
- height: 375,
1348
- footer: null,
1349
- centered: true,
1350
- maskClosable: false,
1351
- keyboard: false
1352
- },
1353
- this.createMoreNode()
1354
- )
1355
- );
1356
- }
1357
- return htmlContent;
1358
- }
1359
- }]);
1360
- return _default;
1361
- }(_react.Component), _class2.propTypes = {
1362
- routes: _propTypes2.default.array
1363
- }, _class2.contextTypes = {
1364
- stores: _propTypes2.default.object,
1365
- infoRender: _propTypes2.default.func,
1366
- headHook: _propTypes2.default.object
1367
- }, _temp)) || _class;
1368
-
1369
- exports.default = _default;
1370
- //# sourceMappingURL=index.js.map