tplus-portaltouch 3.44.9 → 3.46.1
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.
@@ -116,20 +116,19 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
116
116
|
(0, _inherits3.default)(_default, _Component);
|
117
117
|
|
118
118
|
function _default(props) {
|
119
|
-
var
|
119
|
+
var _this2 = this;
|
120
120
|
|
121
121
|
(0, _classCallCheck3.default)(this, _default);
|
122
122
|
|
123
|
-
var
|
123
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, (_default.__proto__ || (0, _getPrototypeOf2.default)(_default)).call(this, props));
|
124
124
|
|
125
|
-
|
126
|
-
_this2.catchOfflineData = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
|
125
|
+
_this.catchOfflineData = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
|
127
126
|
var offlineSys, isLoginAfter, downloadCatcherDay, currentDay, downProgress, result;
|
128
127
|
return _regenerator2.default.wrap(function _callee$(_context) {
|
129
128
|
while (1) {
|
130
129
|
switch (_context.prev = _context.next) {
|
131
130
|
case 0:
|
132
|
-
offlineSys =
|
131
|
+
offlineSys = _this.context.stores.offlineSys;
|
133
132
|
isLoginAfter = _mutantsMicrofx.localStore.get("isLoginAfter");
|
134
133
|
downloadCatcherDay = _mutantsMicrofx.localStore.get("downloadCatcherDay");
|
135
134
|
currentDay = Math.ceil(new Date() / 1000 / 60 / 60 / 24);
|
@@ -187,17 +186,17 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
187
186
|
return _context.stop();
|
188
187
|
}
|
189
188
|
}
|
190
|
-
}, _callee,
|
189
|
+
}, _callee, _this2, [[6, 16, 20, 23]]);
|
191
190
|
}));
|
192
191
|
|
193
|
-
|
192
|
+
_this.getOperation = function () {
|
194
193
|
return new _promise2.default(function (resolve, reject) {
|
195
194
|
var homeOperation = _ModifyPassApi.Request.homeOperation,
|
196
195
|
functionData = _ModifyPassApi.Request.functionData;
|
197
196
|
|
198
197
|
homeOperation().then(function (operations) {
|
199
198
|
_mutantsMicrofx.localStore.set('operationsAuth', (0, _stringify2.default)(operations));
|
200
|
-
|
199
|
+
_this.setState({ operations: operations || [] });
|
201
200
|
resolve();
|
202
201
|
}).catch(function (err) {
|
203
202
|
console.log('homeOperation.error======', err);
|
@@ -210,16 +209,16 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
210
209
|
});
|
211
210
|
};
|
212
211
|
|
213
|
-
|
214
|
-
var
|
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;
|
215
214
|
|
216
215
|
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
217
216
|
while (1) {
|
218
217
|
switch (_context2.prev = _context2.next) {
|
219
218
|
case 0:
|
220
|
-
|
221
|
-
|
222
|
-
addClass =
|
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;
|
223
222
|
hasUseOffline = (0, _tplusPoslogin.PosInitData)('IsOfflineCash') === "1" && !_mutantsUtil.platform.otherOfflineStatus;
|
224
223
|
; //是否允许离线
|
225
224
|
// const hasUseOffline = true;
|
@@ -230,7 +229,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
230
229
|
}
|
231
230
|
|
232
231
|
_context2.next = 8;
|
233
|
-
return
|
232
|
+
return _this.catchOfflineData();
|
234
233
|
|
235
234
|
case 8:
|
236
235
|
_tplusComponentsTouch.Loading.show({
|
@@ -240,7 +239,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
240
239
|
//权限加载
|
241
240
|
_context2.prev = 9;
|
242
241
|
_context2.next = 12;
|
243
|
-
return
|
242
|
+
return _this.getOperation();
|
244
243
|
|
245
244
|
case 12:
|
246
245
|
_context2.next = 17;
|
@@ -259,13 +258,13 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
259
258
|
return _context2.finish(17);
|
260
259
|
|
261
260
|
case 20:
|
262
|
-
addClass && addClass(
|
261
|
+
addClass && addClass(_this.state.id, 'portalHead');
|
263
262
|
// 初始化参数设置。
|
264
263
|
stores.setStore.initSetParams().then(function (ret) {
|
265
264
|
// 在客户端中,如果开启了副屏设置,尝试这打开副屏。
|
266
|
-
if (
|
267
|
-
if (
|
268
|
-
|
265
|
+
if (_this.getScreenType() === true) {
|
266
|
+
if (_this.isHorizontalSunMi) {
|
267
|
+
_this.sunMiPresentationInit(ret);
|
269
268
|
return;
|
270
269
|
}
|
271
270
|
console.log('副屏页面打开之前,user信息', (0, _stringify2.default)(stores.user));
|
@@ -275,23 +274,17 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
275
274
|
}, 3000);
|
276
275
|
}
|
277
276
|
});
|
277
|
+
_this.hsyBasicInfoInit();
|
278
278
|
|
279
|
-
case
|
279
|
+
case 23:
|
280
280
|
case 'end':
|
281
281
|
return _context2.stop();
|
282
282
|
}
|
283
283
|
}
|
284
|
-
}, _callee2,
|
284
|
+
}, _callee2, _this2, [[9, 14, 17, 20]]);
|
285
285
|
}));
|
286
286
|
|
287
|
-
|
288
|
-
if (_this2.isHsyIframeInclude) {
|
289
|
-
_this2.initHsyBasicPageInfo();
|
290
|
-
_this2.initHsyFrameWin();
|
291
|
-
}
|
292
|
-
};
|
293
|
-
|
294
|
-
_this2.sunMiPresentationInit = function (result) {
|
287
|
+
_this.sunMiPresentationInit = function (result) {
|
295
288
|
//SunMi初始化参数设置。
|
296
289
|
//副屏幕交互。硬件改动20200428 需要在商米页面加载成功后才能发送 初始化命令
|
297
290
|
// 进行主副屏数据交互 初始化
|
@@ -315,10 +308,10 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
315
308
|
});
|
316
309
|
};
|
317
310
|
|
318
|
-
|
311
|
+
_this.getTcBasicInfoInit = function () {
|
319
312
|
var userStore = _tplusApi.User.restore();
|
320
313
|
var sid = userStore.sid;
|
321
|
-
var tplusUrl =
|
314
|
+
var tplusUrl = _this.tplusSiteUrl;
|
322
315
|
if (!tplusUrl) {
|
323
316
|
var msg = "请用admin登录,在服务器配置–地址配置处,设置“内部或外部网络访问T+服务器的地址”!";
|
324
317
|
_tplusComponentsTouch.ModalWraper.warning({
|
@@ -337,7 +330,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
337
330
|
ossjumpUrl = tplusUrl + 'view/ossjump.html?t=' + new Date().getTime() + '&sid=' + sid;
|
338
331
|
}
|
339
332
|
var postMsgUrl = ossjumpUrl;
|
340
|
-
var user =
|
333
|
+
var user = _this.context.stores.user;
|
341
334
|
|
342
335
|
var loginInfo = user.options.get('loginInfo');
|
343
336
|
|
@@ -347,18 +340,18 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
347
340
|
posCode = _ref4.posCode,
|
348
341
|
TplusStoreId = _ref4.TplusStoreId;
|
349
342
|
|
350
|
-
var uid =
|
351
|
-
var pwd =
|
352
|
-
var accNum =
|
353
|
-
var code =
|
354
|
-
var store =
|
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 + '');
|
355
348
|
ossjumpUrl += '&fromApp=nretail&way=inframe&user=' + uid + '&pwd=' + pwd + '&accNum=' + accNum + '&posCode=' + code + '&storeID=' + store;
|
356
349
|
return { ossjumpUrl: ossjumpUrl, postMessageUrl: postMsgUrl };
|
357
350
|
};
|
358
351
|
|
359
|
-
|
352
|
+
_this.getScreenType = function () {
|
360
353
|
var flag = false;
|
361
|
-
if (
|
354
|
+
if (_this.hasElectron === true || _this.isHorizontalSunMi) {
|
362
355
|
var data = _mutantsMicrofx.localStore.get('setting_setData') || [];
|
363
356
|
data = data.filter(function (item) {
|
364
357
|
return item.Name === 'EnableDoubleScreen';
|
@@ -371,14 +364,14 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
371
364
|
return flag;
|
372
365
|
};
|
373
366
|
|
374
|
-
|
367
|
+
_this.saveLog = function (name) {
|
375
368
|
var saveLogo = _ModifyPassApi.Request.saveLogo;
|
376
369
|
|
377
370
|
name = "进入模块:" + name;
|
378
371
|
saveLogo('进入模块', undefined, name);
|
379
372
|
};
|
380
373
|
|
381
|
-
|
374
|
+
_this.handelClick = function () {
|
382
375
|
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
383
376
|
var type = values.key,
|
384
377
|
isModal = values.isModal,
|
@@ -389,9 +382,9 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
389
382
|
style = values.style,
|
390
383
|
search = values.search,
|
391
384
|
tmenuCode = values.tmenuCode;
|
392
|
-
var
|
393
|
-
operations =
|
394
|
-
isHsyLoadFinish =
|
385
|
+
var _this$state = _this.state,
|
386
|
+
operations = _this$state.operations,
|
387
|
+
isHsyLoadFinish = _this$state.isHsyLoadFinish;
|
395
388
|
|
396
389
|
var controllable = operations.find(function (vv) {
|
397
390
|
return vv.Name === Name;
|
@@ -412,20 +405,20 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
412
405
|
}
|
413
406
|
|
414
407
|
// 会员拉新
|
415
|
-
if (type == 'memberRecruitment' && (
|
408
|
+
if (type == 'memberRecruitment' && (_this.isEnablePromotion == false || _this.isEnableMember == false)) {
|
416
409
|
_tplusComponentsTouch.Message.warn("您还未开通会员/促销管理,请立即开通", { duration: 3 });
|
417
410
|
return;
|
418
411
|
}
|
419
412
|
|
420
413
|
// 会员消费查询
|
421
|
-
if (type == 'memberConsumDetail' &&
|
414
|
+
if (type == 'memberConsumDetail' && _this.isEnableMember == false) {
|
422
415
|
_tplusComponentsTouch.Message.warn("您还未开通会员管理,请立即开通", { duration: 3 });
|
423
416
|
return;
|
424
417
|
}
|
425
418
|
|
426
419
|
// 更多
|
427
420
|
if (type == 'more') {
|
428
|
-
return
|
421
|
+
return _this.setState({ showMoreModal: true });
|
429
422
|
}
|
430
423
|
|
431
424
|
if (!Title) {
|
@@ -445,7 +438,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
445
438
|
} else if (!HoldFunctionAuth) {
|
446
439
|
errorTip = '\u60A8\u6CA1\u6709\u64CD\u4F5C ' + Title + ' \u7684\u6743\u9650';
|
447
440
|
}
|
448
|
-
var portalStore =
|
441
|
+
var portalStore = _this.context.stores.portalStore;
|
449
442
|
|
450
443
|
if (errorTip) {
|
451
444
|
return _tplusComponentsTouch.Message.warn(errorTip);
|
@@ -454,7 +447,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
454
447
|
return _mutantsMicrofx.stores.modalRouter.show({ url: '/' + type, width: 800, title: title });
|
455
448
|
}
|
456
449
|
// 支持页面内打开,减少再次加载页面的时间。
|
457
|
-
if (iframe === true) return
|
450
|
+
if (iframe === true) return _this.toFramePage({ type: type, app: app, title: title, style: style, search: search, MenuCode: MenuCode, tmenuCode: tmenuCode, isHsyLoadFinish: isHsyLoadFinish });
|
458
451
|
switch (type) {
|
459
452
|
case 'cashier':
|
460
453
|
portalStore.checkDuty().then(function (onDutyMessage) {
|
@@ -467,7 +460,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
467
460
|
|
468
461
|
(0, _tplusPoslogin.PosSetData)({ ShiftCode: Code, IdShiftVoucher: IdShiftVoucher, Shift: Shift, IdDailyVoucher: IdDailyVoucher, DailyCode: DailyCode });
|
469
462
|
console.log('onDutyMessage======', onDutyMessage);
|
470
|
-
|
463
|
+
_this.saveLog(title);
|
471
464
|
_mutantsMicrofx.history.push('/RE/RE01');
|
472
465
|
}
|
473
466
|
}).catch(function (data) {
|
@@ -497,7 +490,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
497
490
|
}
|
498
491
|
};
|
499
492
|
|
500
|
-
|
493
|
+
_this.toFramePage = function (params) {
|
501
494
|
var _ref6 = params || {},
|
502
495
|
app = _ref6.app,
|
503
496
|
title = _ref6.title,
|
@@ -510,7 +503,10 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
510
503
|
switch (app) {
|
511
504
|
case 'cc':
|
512
505
|
var sh = '';
|
513
|
-
if (
|
506
|
+
// if (this.isMobileEnvironment) { //暂时不支持android系统跳转
|
507
|
+
// return Message.warn('新功能正在研发中,敬请期待。');
|
508
|
+
// }
|
509
|
+
if (!isHsyLoadFinish && !_this.isMobileEnvironment) {
|
514
510
|
return _tplusComponentsTouch.Message.warn('正在加载资源中,请稍后。');
|
515
511
|
}
|
516
512
|
if (!search) {
|
@@ -524,22 +520,22 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
524
520
|
if (!sh) {
|
525
521
|
return _tplusComponentsTouch.Message.warn('传递参数有误,请查证。');
|
526
522
|
}
|
527
|
-
|
523
|
+
_this.toHsyPage((0, _extends3.default)({}, style, sh));
|
528
524
|
break;
|
529
525
|
case 'tc':
|
530
526
|
if (tmenuCode || MenuCode) {
|
531
|
-
|
527
|
+
_this.saveLog(title);
|
532
528
|
if (MenuCode) {
|
533
|
-
|
529
|
+
_this.toTplusPage(MenuCode, search);
|
534
530
|
} else {
|
535
|
-
|
531
|
+
_this.toTplusPage(tmenuCode, search);
|
536
532
|
}
|
537
533
|
}
|
538
534
|
break;
|
539
535
|
}
|
540
536
|
};
|
541
537
|
|
542
|
-
|
538
|
+
_this.getTplusUrlFromCloudServer = function () {
|
543
539
|
//获取T+服务器配置地址。
|
544
540
|
var userStore = _tplusApi.User.restore();
|
545
541
|
var data = 'accesstoken=' + ('' + userStore.accessToken) + '&cloudOrgId=' + ('' + userStore.orgId);
|
@@ -563,7 +559,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
563
559
|
});
|
564
560
|
};
|
565
561
|
|
566
|
-
|
562
|
+
_this.toTplusPage = function () {
|
567
563
|
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(tmenuCode, search) {
|
568
564
|
var ret, _ref8, ossjumpUrl, postMessageUrl, dsearchPlanID, portalStore, menu, external_frame_tc, win, loadTcURL;
|
569
565
|
|
@@ -571,7 +567,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
571
567
|
while (1) {
|
572
568
|
switch (_context3.prev = _context3.next) {
|
573
569
|
case 0:
|
574
|
-
ret =
|
570
|
+
ret = _this.getTcBasicInfoInit();
|
575
571
|
|
576
572
|
if (!(ret === false)) {
|
577
573
|
_context3.next = 3;
|
@@ -589,7 +585,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
589
585
|
break;
|
590
586
|
}
|
591
587
|
|
592
|
-
portalStore =
|
588
|
+
portalStore = _this.context.stores.portalStore;
|
593
589
|
_context3.next = 9;
|
594
590
|
return portalStore.getSearchPlanId(search);
|
595
591
|
|
@@ -597,14 +593,14 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
597
593
|
dsearchPlanID = _context3.sent;
|
598
594
|
|
599
595
|
case 10:
|
600
|
-
menu =
|
596
|
+
menu = _this.tplusEncode(tmenuCode);
|
601
597
|
|
602
|
-
ossjumpUrl += '&menu=' + menu + '&fromUrl=' +
|
598
|
+
ossjumpUrl += '&menu=' + menu + '&fromUrl=' + _this.tplusEncode(location.origin);
|
603
599
|
if (dsearchPlanID) {
|
604
|
-
ossjumpUrl += '&searchPlanID=' +
|
600
|
+
ossjumpUrl += '&searchPlanID=' + _this.tplusEncode(dsearchPlanID);
|
605
601
|
}
|
606
602
|
|
607
|
-
if (!
|
603
|
+
if (!_this.isHorizontalSunMi) {
|
608
604
|
_context3.next = 17;
|
609
605
|
break;
|
610
606
|
}
|
@@ -614,7 +610,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
614
610
|
break;
|
615
611
|
|
616
612
|
case 17:
|
617
|
-
if (!(
|
613
|
+
if (!(_this.new_retail_app == 'tc' || _this.new_retail_app == 'tczsy' || _this.new_retail_app == 'tcyzj')) {
|
618
614
|
_context3.next = 20;
|
619
615
|
break;
|
620
616
|
}
|
@@ -625,18 +621,18 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
625
621
|
case 20:
|
626
622
|
external_frame_tc = document.getElementById('external-frame-tc');
|
627
623
|
win = external_frame_tc.contentWindow;
|
628
|
-
loadTcURL =
|
624
|
+
loadTcURL = _this.state.loadTcURL;
|
629
625
|
|
630
626
|
if (loadTcURL) {
|
631
627
|
win && win.postMessage({ doType: 'openMenuFromPos', tmenuCode: tmenuCode, ossjumpUrl: ossjumpUrl, dsearchPlanID: dsearchPlanID }, postMessageUrl);
|
632
|
-
|
628
|
+
_this.setState({ loadTcPage: true });
|
633
629
|
} else {
|
634
|
-
|
630
|
+
_this.setState({ loadTcURL: ossjumpUrl, loadTcPage: true });
|
635
631
|
}
|
636
632
|
rx$.changeHsy.next({
|
637
633
|
back: true, fn: function fn() {
|
638
634
|
win && win.postMessage({ doType: 'closeCurrentMenuFromPos' }, postMessageUrl);
|
639
|
-
|
635
|
+
_this.setState({ loadTcPage: false });
|
640
636
|
rx$.changeHsy.next({ back: false });
|
641
637
|
}
|
642
638
|
});
|
@@ -646,7 +642,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
646
642
|
return _context3.stop();
|
647
643
|
}
|
648
644
|
}
|
649
|
-
}, _callee3,
|
645
|
+
}, _callee3, _this2);
|
650
646
|
}));
|
651
647
|
|
652
648
|
return function (_x2, _x3) {
|
@@ -654,9 +650,9 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
654
650
|
};
|
655
651
|
}();
|
656
652
|
|
657
|
-
|
653
|
+
_this.toHsyPage = function () {
|
658
654
|
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(params) {
|
659
|
-
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
|
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;
|
660
656
|
|
661
657
|
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
662
658
|
while (1) {
|
@@ -666,9 +662,9 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
666
662
|
filter = {};
|
667
663
|
//对仓库参数的处理
|
668
664
|
|
669
|
-
IdWarehouse =
|
670
|
-
WarehouseName =
|
671
|
-
IsPerformanceDistribution =
|
665
|
+
IdWarehouse = _this.idWarehouse;
|
666
|
+
WarehouseName = _this.warehouseName;
|
667
|
+
IsPerformanceDistribution = _this.performanceDistribution === 'SHIPPER_STORE' || false;
|
672
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;
|
673
669
|
_ref11 = _mutantsMicrofx.stores.user.options.get('store') || {}, _ref11$storeName = _ref11.storeName, storeName = _ref11$storeName === undefined ? '' : _ref11$storeName;
|
674
670
|
_context4.t0 = pageType;
|
@@ -769,19 +765,19 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
769
765
|
case 18:
|
770
766
|
bar_bg = encodeURIComponent(bar_bg);
|
771
767
|
bar_active_bg = encodeURIComponent(bar_active_bg);
|
772
|
-
menu = secondRouter ? menu + '/' +
|
768
|
+
menu = secondRouter ? menu + '/' + _this.randomWord(true, 13) : menu;
|
773
769
|
pageId = menu;
|
774
770
|
pageParams = (0, _assign2.default)(pageParams, filter);
|
775
771
|
path = encodeURIComponent(path);
|
776
|
-
_k =
|
772
|
+
_k = _this.randomWord(false, 6);
|
777
773
|
|
778
774
|
commonArgs = '?posid=' + PosId + '&content_only=' + content_only + '&bar_bg=' + bar_bg + '&bar_active_bg=' + bar_active_bg;
|
779
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;
|
780
|
-
cc_url =
|
776
|
+
cc_url = _this.hsy_domain.replace('#/', '') + commonArgs + actionUrl;
|
781
777
|
|
782
778
|
console.log('web_hsy_url:', cc_url);
|
783
779
|
|
784
|
-
if (!
|
780
|
+
if (!_this.isHorizontalSunMi) {
|
785
781
|
_context4.next = 37;
|
786
782
|
break;
|
787
783
|
}
|
@@ -794,32 +790,33 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
794
790
|
|
795
791
|
console.log('CC_WEB_URL:', CC_WEB_URL);
|
796
792
|
window.android_CommonFun.openWebUrlByOutBrowser(CC_WEB_URL);
|
797
|
-
_context4.next =
|
793
|
+
_context4.next = 40;
|
798
794
|
break;
|
799
795
|
|
800
796
|
case 37:
|
801
|
-
|
802
|
-
|
803
|
-
|
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 });
|
804
803
|
}
|
805
|
-
_hsyPage = document.getElementById(CC_FRAME_CONF.id);
|
806
|
-
|
807
|
-
if (_hsyPage) _hsyPage.style.top = '60px';
|
808
804
|
rx$.changeHsy.next({
|
809
805
|
back: true, fn: function fn() {
|
810
|
-
|
806
|
+
_this.setState({ loadHsyPage: false });
|
811
807
|
rx$.changeHsy.next({ back: false });
|
812
808
|
// 在打开页签之前,关闭之前的,返回键的回调函数
|
813
|
-
|
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 });
|
814
811
|
}
|
815
812
|
});
|
816
813
|
|
817
|
-
case
|
814
|
+
case 40:
|
818
815
|
case 'end':
|
819
816
|
return _context4.stop();
|
820
817
|
}
|
821
818
|
}
|
822
|
-
}, _callee4,
|
819
|
+
}, _callee4, _this2);
|
823
820
|
}));
|
824
821
|
|
825
822
|
return function (_x4) {
|
@@ -827,7 +824,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
827
824
|
};
|
828
825
|
}();
|
829
826
|
|
830
|
-
|
827
|
+
_this.randomWord = function (only, digits) {
|
831
828
|
var str = "";
|
832
829
|
var number = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
833
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'];
|
@@ -839,24 +836,24 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
839
836
|
return str;
|
840
837
|
};
|
841
838
|
|
842
|
-
|
843
|
-
|
839
|
+
_this.closeFrameModal = function () {
|
840
|
+
_this.setState({ showModal: false });
|
844
841
|
};
|
845
842
|
|
846
|
-
|
847
|
-
|
843
|
+
_this.closeMoreModal = function () {
|
844
|
+
_this.setState({ showMoreModal: false });
|
848
845
|
};
|
849
846
|
|
850
|
-
|
847
|
+
_this.tplusEncode = function (code) {
|
851
848
|
var c = String.fromCharCode(code.charCodeAt(0) + code.length);
|
852
849
|
for (var i = 1; i < code.length; i++) {
|
853
850
|
c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1));
|
854
851
|
}
|
855
|
-
var ret =
|
852
|
+
var ret = _this.TplusBase64Encode(c);
|
856
853
|
return ret;
|
857
854
|
};
|
858
855
|
|
859
|
-
|
856
|
+
_this.TplusBase64Encode = function (input) {
|
860
857
|
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
861
858
|
var output = "";
|
862
859
|
var chr1 = void 0,
|
@@ -867,7 +864,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
867
864
|
enc3 = void 0,
|
868
865
|
enc4 = void 0;
|
869
866
|
var i = 0;
|
870
|
-
input =
|
867
|
+
input = _this._utf8_encode(input);
|
871
868
|
while (i < input.length) {
|
872
869
|
chr1 = input.charCodeAt(i++);
|
873
870
|
chr2 = input.charCodeAt(i++);
|
@@ -886,7 +883,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
886
883
|
return output;
|
887
884
|
};
|
888
885
|
|
889
|
-
|
886
|
+
_this._utf8_encode = function (string) {
|
890
887
|
string = string.replace(/\r\n/g, "\n");
|
891
888
|
var utftext = "";
|
892
889
|
for (var n = 0; n < string.length; n++) {
|
@@ -905,13 +902,13 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
905
902
|
return utftext;
|
906
903
|
};
|
907
904
|
|
908
|
-
|
905
|
+
_this.operationControl = function () {
|
909
906
|
var menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
910
|
-
var operations =
|
907
|
+
var operations = _this.state.operations;
|
911
908
|
|
912
909
|
menu.forEach(function (v) {
|
913
910
|
if (v.sub) {
|
914
|
-
return
|
911
|
+
return _this.operationControl(v.sub);
|
915
912
|
}
|
916
913
|
var controllable = operations.find(function (vv) {
|
917
914
|
return vv.Name === v.Name;
|
@@ -933,9 +930,9 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
933
930
|
return menu;
|
934
931
|
};
|
935
932
|
|
936
|
-
|
937
|
-
var menu =
|
938
|
-
var width = menu.length == 0 ?
|
933
|
+
_this.createLeftNode = function () {
|
934
|
+
var menu = _this.leftMenu;
|
935
|
+
var width = menu.length == 0 ? _this.isMobileEnvironment & !_this.isNewRetailBCPosTC ? 5 : 4 : 7;
|
939
936
|
if (menu.length == 0) {
|
940
937
|
return _react2.default.createElement(
|
941
938
|
_antd.Col,
|
@@ -951,14 +948,14 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
951
948
|
v.sub.map(function (vv) {
|
952
949
|
var item = vv;
|
953
950
|
if (vv.maybe === true) {
|
954
|
-
item =
|
951
|
+
item = _this.showStorePrice ? vv : vv.second;
|
955
952
|
}
|
956
953
|
return _react2.default.createElement(
|
957
954
|
'div',
|
958
955
|
{
|
959
956
|
className: 'member-item ' + item.className + ' ' + (item.disabled ? 'menu-item-disabled' : ''),
|
960
957
|
key: item.className,
|
961
|
-
onClick:
|
958
|
+
onClick: _this.handelClick.bind(_this, item)
|
962
959
|
},
|
963
960
|
!!item.title && _react2.default.createElement(
|
964
961
|
'h1',
|
@@ -978,7 +975,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
978
975
|
{
|
979
976
|
className: 'member-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
|
980
977
|
key: v.className,
|
981
|
-
onClick:
|
978
|
+
onClick: _this.handelClick.bind(_this, v)
|
982
979
|
},
|
983
980
|
v.title && _react2.default.createElement(
|
984
981
|
'h1',
|
@@ -1004,15 +1001,15 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1004
1001
|
);
|
1005
1002
|
};
|
1006
1003
|
|
1007
|
-
|
1008
|
-
var menuLeftNode =
|
1004
|
+
_this.createCenterNode = function () {
|
1005
|
+
var menuLeftNode = _this.centerLeftMenu.map(function (v) {
|
1009
1006
|
return _react2.default.createElement(
|
1010
1007
|
'div',
|
1011
1008
|
{
|
1012
1009
|
className: 'worktop-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
|
1013
1010
|
style: v.style,
|
1014
1011
|
key: v.className,
|
1015
|
-
onClick:
|
1012
|
+
onClick: _this.handelClick.bind(_this, v)
|
1016
1013
|
},
|
1017
1014
|
v.title && _react2.default.createElement(
|
1018
1015
|
'h1',
|
@@ -1028,7 +1025,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1028
1025
|
v.disabled && _react2.default.createElement('div', { className: 'item-disabled-placeholder' })
|
1029
1026
|
);
|
1030
1027
|
});
|
1031
|
-
var menuRightNode =
|
1028
|
+
var menuRightNode = _this.centerRightMenu.map(function (v) {
|
1032
1029
|
return v.container ? _react2.default.createElement(
|
1033
1030
|
'div',
|
1034
1031
|
{ style: v.container.style, className: v.container.className, key: v.container.className },
|
@@ -1038,7 +1035,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1038
1035
|
{
|
1039
1036
|
className: 'worktop-item ' + vv.className + ' ' + (vv.disabled ? 'menu-item-disabled' : ''),
|
1040
1037
|
key: vv.className,
|
1041
|
-
onClick:
|
1038
|
+
onClick: _this.handelClick.bind(_this, vv)
|
1042
1039
|
},
|
1043
1040
|
vv.title && _react2.default.createElement(
|
1044
1041
|
'h1',
|
@@ -1058,7 +1055,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1058
1055
|
{
|
1059
1056
|
className: 'worktop-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
|
1060
1057
|
key: v.className,
|
1061
|
-
onClick:
|
1058
|
+
onClick: _this.handelClick.bind(_this, v)
|
1062
1059
|
},
|
1063
1060
|
v.title && _react2.default.createElement(
|
1064
1061
|
'h1',
|
@@ -1089,9 +1086,9 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1089
1086
|
);
|
1090
1087
|
};
|
1091
1088
|
|
1092
|
-
|
1093
|
-
var width =
|
1094
|
-
var node =
|
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) {
|
1095
1092
|
return v.container ? _react2.default.createElement(
|
1096
1093
|
'div',
|
1097
1094
|
{ style: v.container.style, className: v.container.className, key: v.container.className },
|
@@ -1101,7 +1098,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1101
1098
|
{
|
1102
1099
|
className: 'stock-item ' + vv.className + ' ' + (vv.disabled ? 'menu-item-disabled' : ''),
|
1103
1100
|
key: vv.className,
|
1104
|
-
onClick:
|
1101
|
+
onClick: _this.handelClick.bind(_this, vv)
|
1105
1102
|
},
|
1106
1103
|
vv.title && _react2.default.createElement(
|
1107
1104
|
'h1',
|
@@ -1122,7 +1119,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1122
1119
|
className: 'stock-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
|
1123
1120
|
style: v.style,
|
1124
1121
|
key: v.className,
|
1125
|
-
onClick:
|
1122
|
+
onClick: _this.handelClick.bind(_this, v)
|
1126
1123
|
},
|
1127
1124
|
!!v.title && _react2.default.createElement(
|
1128
1125
|
'h1',
|
@@ -1143,9 +1140,9 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1143
1140
|
);
|
1144
1141
|
};
|
1145
1142
|
|
1146
|
-
|
1147
|
-
var arrs =
|
1148
|
-
var items =
|
1143
|
+
_this.createMoreNode = function () {
|
1144
|
+
var arrs = _this.getMoreNodeInfo();
|
1145
|
+
var items = _this.isNewRetailBCPosTC ? arrs.sub_tc : arrs.sub_cc || [];
|
1149
1146
|
var node = items.length > 0 && items.map(function (v) {
|
1150
1147
|
return _react2.default.createElement(
|
1151
1148
|
'div',
|
@@ -1153,7 +1150,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1153
1150
|
className: 'modal-quick ' + v.className,
|
1154
1151
|
style: v.style,
|
1155
1152
|
key: v.className,
|
1156
|
-
onClick:
|
1153
|
+
onClick: _this.handelClick.bind(_this, v)
|
1157
1154
|
},
|
1158
1155
|
!!v.icon && _react2.default.createElement(
|
1159
1156
|
'div',
|
@@ -1170,30 +1167,39 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1170
1167
|
return node;
|
1171
1168
|
};
|
1172
1169
|
|
1173
|
-
|
1174
|
-
if (
|
1175
|
-
|
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
1176
|
return v.sub && v.sub.find(function (vv) {
|
1177
1177
|
return vv.key == 'more';
|
1178
1178
|
});
|
1179
1179
|
}).sub[1] || {};
|
1180
|
+
// }
|
1180
1181
|
} else {
|
1181
|
-
|
1182
|
+
// if (this.isMobileEnvironment) {
|
1183
|
+
// return this.centerRightMenu.find(vv => vv.key == 'more') || {};
|
1184
|
+
// } else {
|
1185
|
+
return _this.centerRightMenu.find(function (v) {
|
1182
1186
|
return v.sub && v.sub.find(function (vv) {
|
1183
1187
|
return vv.key == 'more';
|
1184
1188
|
});
|
1185
1189
|
}).sub[1] || {};
|
1190
|
+
// }
|
1186
1191
|
}
|
1187
1192
|
};
|
1188
1193
|
|
1189
|
-
|
1190
|
-
|
1191
|
-
_this2.state = {
|
1194
|
+
_this.hasElectron = hasElectron;
|
1195
|
+
_this.state = {
|
1192
1196
|
id: Date.now(),
|
1193
1197
|
operations: [],
|
1194
1198
|
showModal: false,
|
1195
1199
|
showMoreModal: false,
|
1196
|
-
|
1200
|
+
loadHsyPage: false,
|
1201
|
+
loadHsyURL: '',
|
1202
|
+
isHsyLoadFinish: false,
|
1197
1203
|
loadTcPage: false,
|
1198
1204
|
loadTcURL: '',
|
1199
1205
|
modalURL: ''
|
@@ -1205,33 +1211,36 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1205
1211
|
isHorizontalSunMi = _ref13.isHorizontalSunMi,
|
1206
1212
|
isNewRetailBCPosTC = _ref13.isNewRetailBCPosTC;
|
1207
1213
|
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
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();
|
1216
1222
|
// 是否嵌套好生意的iframe
|
1217
|
-
|
1223
|
+
_this.isHsyIframeInclude = !_this.isVerticalTouch && !_this.isMobileEnvironment;
|
1218
1224
|
//获取初始化参数
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
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');
|
1227
1233
|
|
1228
1234
|
//首页布局
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
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;
|
1235
1244
|
}
|
1236
1245
|
|
1237
1246
|
(0, _createClass3.default)(_default, [{
|
@@ -1273,46 +1282,37 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1273
1282
|
key: 'getMenuByEnvironment',
|
1274
1283
|
value: function getMenuByEnvironment(ccMenu, tcMenu, tcMobilMenu, ccMobilMenu) {
|
1275
1284
|
if (this.isNewRetailBCPosTC) {
|
1285
|
+
// if(this.isMobileEnvironment){
|
1286
|
+
// return tcMobilMenu;
|
1287
|
+
// }else{
|
1288
|
+
// return tcMenu;
|
1289
|
+
// }
|
1276
1290
|
return tcMenu;
|
1277
1291
|
} else {
|
1292
|
+
// if(this.isMobileEnvironment){
|
1293
|
+
// return ccMobilMenu;
|
1294
|
+
// }else{
|
1295
|
+
// return ccMenu;
|
1296
|
+
// }
|
1278
1297
|
return ccMenu;
|
1279
1298
|
}
|
1280
1299
|
}
|
1281
1300
|
}, {
|
1282
1301
|
key: 'componentDidMount',
|
1283
1302
|
value: function componentDidMount() {
|
1284
|
-
var _this4 = this;
|
1285
|
-
|
1286
1303
|
this.initPageData();
|
1287
|
-
|
1288
|
-
var hsyPageLoadIsFinish = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('hsyPageLoadIsFinish');
|
1289
|
-
if (hsyPageLoadIsFinish == 'true') {
|
1290
|
-
this.loadHsyPage();
|
1291
|
-
} else {
|
1292
|
-
setTimeout(function () {
|
1293
|
-
_this4.loadHsyPage();
|
1294
|
-
}, 1000);
|
1295
|
-
}
|
1304
|
+
this.isHsyIframeInclude && this.initCCFrameWin();
|
1296
1305
|
}
|
1297
|
-
|
1298
|
-
// 初始化加载hsy
|
1306
|
+
// 初始化好生意iframe
|
1299
1307
|
|
1300
1308
|
}, {
|
1301
|
-
key: '
|
1302
|
-
|
1303
|
-
|
1304
|
-
// 初始化好生意iframe
|
1305
|
-
value: function initHsyFrameWin() {
|
1306
|
-
var _this = this;
|
1309
|
+
key: 'initCCFrameWin',
|
1310
|
+
value: function initCCFrameWin() {
|
1311
|
+
var that = this;
|
1307
1312
|
this.ccFrameStore = new _mutantsMicrofx.stores.IframeStore(document.getElementById(CC_FRAME_CONF.id), this.hsy_domain, function (e, instance) {
|
1308
1313
|
console.log(e, instance, 'cciframe 接收消息');
|
1309
1314
|
if (e.data && e.data.type === CC_FRAME_CONF.HsyLoadFinish) {
|
1310
|
-
|
1311
|
-
var hsyPageLoadIsFinish = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('hsyPageLoadIsFinish');
|
1312
|
-
if (!(hsyPageLoadIsFinish == 'true')) {
|
1313
|
-
_mutantsMicrofx.localStore && _mutantsMicrofx.localStore.set('hsyPageLoadIsFinish', true);
|
1314
|
-
_this.setState({ isHsyLoadFinish: true });
|
1315
|
-
}
|
1315
|
+
!that.state.isHsyLoadFinish && that.setState({ isHsyLoadFinish: true });
|
1316
1316
|
}
|
1317
1317
|
}, function (e, instance) {
|
1318
1318
|
console.log("ccFrameWin 加载成功========>", e, instance);
|
@@ -1322,15 +1322,11 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1322
1322
|
// 初始化商米副屏
|
1323
1323
|
|
1324
1324
|
}, {
|
1325
|
-
key: '
|
1325
|
+
key: 'hsyBasicInfoInit',
|
1326
1326
|
|
1327
1327
|
|
1328
1328
|
// 初始化智+模块信息
|
1329
|
-
value: function
|
1330
|
-
console.log('start create iframe-hsyPage');
|
1331
|
-
var hsyPageLoadIsFinish = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('hsyPageLoadIsFinish');
|
1332
|
-
var _hsyPage = document.getElementById(CC_FRAME_CONF.id);
|
1333
|
-
if (hsyPageLoadIsFinish == 'true' && _hsyPage) return;
|
1329
|
+
value: function hsyBasicInfoInit() {
|
1334
1330
|
var theme = _mutantsMicrofx.stores.portalStore.themeStore;
|
1335
1331
|
var color = '#FF8C25';
|
1336
1332
|
switch (theme) {
|
@@ -1347,23 +1343,13 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1347
1343
|
color = "#FF6B8C";
|
1348
1344
|
break;
|
1349
1345
|
}
|
1350
|
-
var _height = document.body.clientHeight;
|
1351
1346
|
|
1352
1347
|
var _ref14 = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('StoreKey') || {},
|
1353
1348
|
_ref14$PosId = _ref14.PosId,
|
1354
1349
|
PosId = _ref14$PosId === undefined ? '' : _ref14$PosId;
|
1355
1350
|
|
1356
1351
|
var cc_url = this.hsy_domain.replace('#/', '') + '?fromApp=nretail&posid=' + PosId + '&content_only=true&bar_bg=' + encodeURIComponent('#FFFFFF') + '&bar_active_bg=' + encodeURIComponent(color);
|
1357
|
-
|
1358
|
-
iframe.width = '100%';
|
1359
|
-
iframe.height = _height - 60 + 'px';
|
1360
|
-
iframe.setAttribute("scrolling", "yes");
|
1361
|
-
iframe.setAttribute("frameborder", 0);
|
1362
|
-
iframe.style.position = 'absolute';
|
1363
|
-
iframe.src = cc_url;
|
1364
|
-
iframe.id = CC_FRAME_CONF.id;
|
1365
|
-
document.body.appendChild(iframe);
|
1366
|
-
console.log('finish create iframe-hsyPage succeed.');
|
1352
|
+
this.setState({ loadHsyURL: cc_url });
|
1367
1353
|
}
|
1368
1354
|
|
1369
1355
|
//初始化tc、tcyzj、tczsy信息
|
@@ -1371,9 +1357,7 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1371
1357
|
}, {
|
1372
1358
|
key: 'componentWillUnmount',
|
1373
1359
|
value: function componentWillUnmount() {
|
1374
|
-
|
1375
|
-
this.ccFrameStore.destroy();
|
1376
|
-
}
|
1360
|
+
this.ccFrameStore && this.ccFrameStore.destroy();
|
1377
1361
|
var _context$headHook = this.context.headHook;
|
1378
1362
|
_context$headHook = _context$headHook === undefined ? {} : _context$headHook;
|
1379
1363
|
var removeClass = _context$headHook.removeClass;
|
@@ -1415,6 +1399,8 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1415
1399
|
showModal = _state.showModal,
|
1416
1400
|
showMoreModal = _state.showMoreModal,
|
1417
1401
|
modalURL = _state.modalURL,
|
1402
|
+
loadHsyPage = _state.loadHsyPage,
|
1403
|
+
loadHsyURL = _state.loadHsyURL,
|
1418
1404
|
loadTcPage = _state.loadTcPage,
|
1419
1405
|
loadTcURL = _state.loadTcURL;
|
1420
1406
|
|
@@ -1422,63 +1408,72 @@ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_C
|
|
1422
1408
|
var htmlContent = null;
|
1423
1409
|
if (this.isVerticalTouch) {
|
1424
1410
|
htmlContent = _react2.default.createElement(_verticalPortal2.default, { handelClick: this.handelClick });
|
1425
|
-
}
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
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' },
|
1432
1419
|
_react2.default.createElement(
|
1433
|
-
|
1434
|
-
{ className: 'portal-
|
1435
|
-
this.createLeftNode(),
|
1420
|
+
Content,
|
1421
|
+
{ style: { paddingLeft: '50px', paddingRight: '50px' }, className: 'portal-container portal-container-center' },
|
1436
1422
|
_react2.default.createElement(
|
1437
|
-
_antd.
|
1438
|
-
{
|
1423
|
+
_antd.Row,
|
1424
|
+
{ className: 'portal-content-row' },
|
1425
|
+
this.createLeftNode(),
|
1439
1426
|
_react2.default.createElement(
|
1440
|
-
|
1441
|
-
{ className: 'portal-center-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
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()
|
1446
1474
|
)
|
1447
|
-
)
|
1448
|
-
|
1449
|
-
'div',
|
1450
|
-
{ className: loadTcPage ? 'portal-hsy-tc-container' : 'portal-hsy-tc-container portal-hsy-tc-container-hide' },
|
1451
|
-
_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' })
|
1452
|
-
),
|
1453
|
-
this.isMobileEnvironment && _react2.default.createElement(
|
1454
|
-
_antd.Modal,
|
1455
|
-
{
|
1456
|
-
visible: showModal,
|
1457
|
-
onCancel: this.closeFrameModal,
|
1458
|
-
width: '99%',
|
1459
|
-
height: '99%',
|
1460
|
-
footer: null
|
1461
|
-
},
|
1462
|
-
_react2.default.createElement('iframe', { src: modalURL, width: '100%', height: screenHeight, frameborder: 'no', border: '0', marginwidth: '0', marginheight: '0', scrolling: 'yes', allowtransparency: 'true' })
|
1463
|
-
),
|
1464
|
-
_react2.default.createElement(
|
1465
|
-
_antd.Modal,
|
1466
|
-
{
|
1467
|
-
title: '更多',
|
1468
|
-
className: 'portal-container-modal-more',
|
1469
|
-
visible: showMoreModal,
|
1470
|
-
onCancel: this.closeMoreModal,
|
1471
|
-
width: 800,
|
1472
|
-
height: 375,
|
1473
|
-
footer: null,
|
1474
|
-
centered: true,
|
1475
|
-
maskClosable: false,
|
1476
|
-
keyboard: false
|
1477
|
-
},
|
1478
|
-
this.createMoreNode()
|
1479
|
-
)
|
1480
|
-
);
|
1481
|
-
}
|
1475
|
+
);
|
1476
|
+
}
|
1482
1477
|
return htmlContent;
|
1483
1478
|
}
|
1484
1479
|
}]);
|