tplus-portaltouch 3.46.1 → 3.47.3

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