@fonixtree/magic-design 2.0.47 → 2.0.49
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.
- package/es/common/CardCarousel/index.less +1 -2
- package/es/composite-comp/bol/components/Wallet/mobile/index.js +69 -88
- package/es/composite-comp/bol/second-config-panels/WalletSecondConfig/index.js +1 -0
- package/es/core/Renderer/index.js +1 -2
- package/lib/common/CardCarousel/index.less +1 -2
- package/lib/composite-comp/bol/components/Wallet/mobile/index.js +69 -88
- package/lib/composite-comp/bol/second-config-panels/WalletSecondConfig/index.js +1 -0
- package/lib/core/Renderer/index.js +1 -2
- package/package.json +1 -1
|
@@ -244,14 +244,14 @@ function (_super) {
|
|
|
244
244
|
|
|
245
245
|
_this.getMyWalletData = function () {
|
|
246
246
|
return __awaiter(_this, void 0, void 0, function () {
|
|
247
|
-
var data, _a, userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet,
|
|
247
|
+
var data, _a, userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet, bnplObj, creditObj, B2BObj;
|
|
248
248
|
|
|
249
249
|
var _b;
|
|
250
250
|
|
|
251
|
-
var
|
|
251
|
+
var _this = this;
|
|
252
252
|
|
|
253
|
-
return __generator(this, function (
|
|
254
|
-
switch (
|
|
253
|
+
return __generator(this, function (_c) {
|
|
254
|
+
switch (_c.label) {
|
|
255
255
|
case 0:
|
|
256
256
|
data = this.props.data;
|
|
257
257
|
return [4
|
|
@@ -259,86 +259,60 @@ function (_super) {
|
|
|
259
259
|
, (0, _commonUtil.commonFetch)('/designer/v1/h5/mywallet/list', {}, 'GET')];
|
|
260
260
|
|
|
261
261
|
case 1:
|
|
262
|
-
_a =
|
|
263
|
-
// userCreditResps: [
|
|
264
|
-
// {
|
|
265
|
-
// userCreditId: 1023,
|
|
266
|
-
// creditId: 1,
|
|
267
|
-
// partyType: null,
|
|
268
|
-
// state: 'Pass',
|
|
269
|
-
// isUrlExpired: false,
|
|
270
|
-
// creditLimit: 150000,
|
|
271
|
-
// usageAmount: 100000,
|
|
272
|
-
// availableAmount: 1000,
|
|
273
|
-
// comments: null,
|
|
274
|
-
// userNearestBillDto: null,
|
|
275
|
-
// },
|
|
276
|
-
// {
|
|
277
|
-
// userCreditId: 1026,
|
|
278
|
-
// creditId: 2,
|
|
279
|
-
// partyType: null,
|
|
280
|
-
// state: 'Locked',
|
|
281
|
-
// isUrlExpired: false,
|
|
282
|
-
// creditLimit: 100000,
|
|
283
|
-
// usageAmount: 100000,
|
|
284
|
-
// availableAmount: 2000,
|
|
285
|
-
// comments: null,
|
|
286
|
-
// userNearestBillDto: null,
|
|
287
|
-
// },
|
|
288
|
-
// {
|
|
289
|
-
// userCreditId: 1027,
|
|
290
|
-
// creditId: 3,
|
|
291
|
-
// partyType: 'I',
|
|
292
|
-
// state: 'Pass',
|
|
293
|
-
// isUrlExpired: false,
|
|
294
|
-
// creditLimit: 100000000,
|
|
295
|
-
// usageAmount: 0,
|
|
296
|
-
// availableAmount: 3000,
|
|
297
|
-
// comments: 'ty',
|
|
298
|
-
// userNearestBillDto: null,
|
|
299
|
-
// },
|
|
300
|
-
// ],
|
|
301
|
-
// userCashbackValues: 4000,
|
|
302
|
-
// userBalance: 5000,
|
|
303
|
-
// userPoint: 6000,
|
|
304
|
-
// defaultShowWallet: 'Balance',
|
|
305
|
-
// };
|
|
306
|
-
|
|
307
|
-
if (data.customize.layout === 'layout2' && this.carouselRef) {
|
|
308
|
-
defaultShowIndex_1 = 0;
|
|
309
|
-
data.groupSource.forEach(function (f, i) {
|
|
310
|
-
if (f.sourceType === defaultShowWallet) defaultShowIndex_1 = i;
|
|
311
|
-
});
|
|
312
|
-
(_c = this.carouselRef.current) === null || _c === void 0 ? void 0 : _c.slideTo(defaultShowIndex_1);
|
|
313
|
-
}
|
|
314
|
-
|
|
262
|
+
_a = _c.sent(), userCreditResps = _a.userCreditResps, userCashbackValues = _a.userCashbackValues, userBalance = _a.userBalance, userPoint = _a.userPoint, defaultShowWallet = _a.defaultShowWallet;
|
|
315
263
|
bnplObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
316
|
-
return item.creditId === 1
|
|
264
|
+
return item.creditId === 1;
|
|
317
265
|
});
|
|
318
266
|
creditObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
319
|
-
return item.creditId === 2
|
|
267
|
+
return item.creditId === 2;
|
|
320
268
|
});
|
|
321
269
|
B2BObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
322
|
-
return item.creditId === 3
|
|
270
|
+
return item.creditId === 3;
|
|
323
271
|
});
|
|
324
272
|
this.setState({
|
|
325
273
|
userWalletData: (_b = {}, _b[_constants.walletType.BNPL] = {
|
|
326
|
-
amount: userCreditResps === null ? '****' : bnplObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(bnplObj.availableAmount) : 'APPLY'
|
|
274
|
+
amount: userCreditResps === null ? '****' : bnplObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(bnplObj.availableAmount) : 'APPLY',
|
|
275
|
+
show: userCreditResps === null || [_constants.CREDIT_STATE.APPROVED.KEY].includes(bnplObj === null || bnplObj === void 0 ? void 0 : bnplObj.state)
|
|
327
276
|
}, _b[_constants.walletType.CREDIT] = {
|
|
328
|
-
amount: userCreditResps === null ? '****' : creditObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(creditObj.availableAmount) : 'APPLY'
|
|
277
|
+
amount: userCreditResps === null ? '****' : creditObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(creditObj.availableAmount) : 'APPLY',
|
|
278
|
+
show: userCreditResps === null || [_constants.CREDIT_STATE.APPROVED.KEY].includes(creditObj === null || creditObj === void 0 ? void 0 : creditObj.state)
|
|
329
279
|
}, _b[_constants.walletType.B2B] = {
|
|
330
280
|
amount: userCreditResps === null ? '****' : B2BObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(B2BObj.availableAmount) : 'APPLY',
|
|
331
|
-
text: B2BObj ? 'Add
|
|
332
|
-
btnText: 'Procure Product'
|
|
281
|
+
text: B2BObj ? 'Add more products to your shop!' : '',
|
|
282
|
+
btnText: B2BObj ? 'Procure Product' : '',
|
|
283
|
+
show: userCreditResps === null || [_constants.CREDIT_STATE.APPROVED.KEY].includes(B2BObj === null || B2BObj === void 0 ? void 0 : B2BObj.state)
|
|
333
284
|
}, _b[_constants.walletType.CASHBACK] = {
|
|
334
|
-
amount: userCashbackValues === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userCashbackValues)
|
|
285
|
+
amount: userCashbackValues === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userCashbackValues),
|
|
286
|
+
show: true
|
|
335
287
|
}, _b[_constants.walletType.BALANCE] = {
|
|
336
288
|
amount: userBalance === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userBalance),
|
|
337
|
-
btnText: 'Social Commerce'
|
|
289
|
+
btnText: userBalance ? 'Social Commerce' : '',
|
|
290
|
+
show: true
|
|
338
291
|
}, _b[_constants.walletType.CENDUIT] = {
|
|
339
|
-
amount: userPoint === null ? '****' :
|
|
340
|
-
btnText: 'Cenduit Mall'
|
|
292
|
+
amount: userPoint === null ? '****' : userPoint,
|
|
293
|
+
btnText: userPoint ? 'Cenduit Mall' : '',
|
|
294
|
+
show: true
|
|
341
295
|
}, _b)
|
|
296
|
+
}, function () {
|
|
297
|
+
var _a;
|
|
298
|
+
|
|
299
|
+
if (data.customize.layout === 'layout2' && _this.carouselRef) {
|
|
300
|
+
var userWalletData_1 = _this.state.userWalletData;
|
|
301
|
+
|
|
302
|
+
var _groupSource = data.groupSource.filter(function (f) {
|
|
303
|
+
var _a;
|
|
304
|
+
|
|
305
|
+
return (_a = userWalletData_1[f.sourceType]) === null || _a === void 0 ? void 0 : _a.show;
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
var defaultShowIndex_1 = 0;
|
|
309
|
+
|
|
310
|
+
_groupSource.forEach(function (f, i) {
|
|
311
|
+
if (f.sourceType === defaultShowWallet) defaultShowIndex_1 = i;
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
(_a = _this.carouselRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(defaultShowIndex_1);
|
|
315
|
+
}
|
|
342
316
|
});
|
|
343
317
|
return [2
|
|
344
318
|
/*return*/
|
|
@@ -428,11 +402,20 @@ function (_super) {
|
|
|
428
402
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
429
403
|
|
|
430
404
|
var data = this.props.data;
|
|
431
|
-
var
|
|
405
|
+
var _j = this.state,
|
|
406
|
+
sliderIndex = _j.sliderIndex,
|
|
407
|
+
userWalletData = _j.userWalletData;
|
|
432
408
|
var colNum = data.customize.rowNum;
|
|
433
409
|
var autoplay = (_b = (_a = data.setting) === null || _a === void 0 ? void 0 : _a.autoplay) === null || _b === void 0 ? void 0 : _b.open;
|
|
410
|
+
|
|
411
|
+
var _groupSource = data.groupSource.filter(function (f) {
|
|
412
|
+
var _a;
|
|
413
|
+
|
|
414
|
+
return (_a = userWalletData[f.sourceType]) === null || _a === void 0 ? void 0 : _a.show;
|
|
415
|
+
});
|
|
434
416
|
/** 设计器模式下 如果选中特定group 自动播放关闭 */
|
|
435
417
|
|
|
418
|
+
|
|
436
419
|
if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
|
|
437
420
|
autoplay = false;
|
|
438
421
|
}
|
|
@@ -461,36 +444,34 @@ function (_super) {
|
|
|
461
444
|
}
|
|
462
445
|
}
|
|
463
446
|
|
|
447
|
+
item.text.text = ((_a = userWalletData[item.sourceType]) === null || _a === void 0 ? void 0 : _a.text) || 'Make money and shop on Cendol!';
|
|
464
448
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
465
449
|
className: "text-content",
|
|
466
450
|
style: _bgStyle
|
|
467
|
-
}, ((
|
|
451
|
+
}, ((_b = item.title) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
468
452
|
className: "title",
|
|
469
453
|
data: item.title,
|
|
470
454
|
GAData: __assign(__assign({}, GAData), {
|
|
471
455
|
groupId: item.id,
|
|
472
456
|
groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
|
|
473
457
|
})
|
|
474
|
-
}), ((
|
|
458
|
+
}), ((_c = item.amount) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
475
459
|
className: "amount",
|
|
476
460
|
data: __assign(__assign({}, item.amount), {
|
|
477
|
-
text: (
|
|
461
|
+
text: (_d = userWalletData[item.sourceType]) === null || _d === void 0 ? void 0 : _d.amount
|
|
478
462
|
}),
|
|
479
463
|
GAData: __assign(__assign({}, GAData), {
|
|
480
464
|
groupId: item.id,
|
|
481
465
|
groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
|
|
482
466
|
}),
|
|
483
467
|
readonly: true
|
|
484
|
-
}), ((
|
|
468
|
+
}), ((_e = item.text) === null || _e === void 0 ? void 0 : _e.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
485
469
|
className: "text",
|
|
486
|
-
data:
|
|
487
|
-
text: ((_e = userWalletData[item.sourceType]) === null || _e === void 0 ? void 0 : _e.text) || 'Make money and shop on Cendol!'
|
|
488
|
-
}),
|
|
470
|
+
data: item.text,
|
|
489
471
|
GAData: __assign(__assign({}, GAData), {
|
|
490
472
|
groupId: item.id,
|
|
491
473
|
groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
|
|
492
|
-
})
|
|
493
|
-
readonly: true
|
|
474
|
+
})
|
|
494
475
|
}), ((_f = item.button) === null || _f === void 0 ? void 0 : _f.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
495
476
|
className: "wallet-btn",
|
|
496
477
|
data: __assign(__assign({}, item.button), {
|
|
@@ -553,7 +534,7 @@ function (_super) {
|
|
|
553
534
|
style: (0, _commonUtil.pxToRem)({
|
|
554
535
|
gap: MOBILE_IMG_SIZE[colNum].gap
|
|
555
536
|
})
|
|
556
|
-
},
|
|
537
|
+
}, _groupSource.map(function (item) {
|
|
557
538
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
558
539
|
key: item.id,
|
|
559
540
|
className: "item-wrap",
|
|
@@ -563,7 +544,7 @@ function (_super) {
|
|
|
563
544
|
}, getItemContent(item));
|
|
564
545
|
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
565
546
|
className: "carousel-layout"
|
|
566
|
-
}, data.setting.navigation.open &&
|
|
547
|
+
}, data.setting.navigation.open && _groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
567
548
|
className: "carousel-icon-left",
|
|
568
549
|
onClick: function onClick() {
|
|
569
550
|
return _this.carouselRef.current.toPrev();
|
|
@@ -581,16 +562,16 @@ function (_super) {
|
|
|
581
562
|
sliderIndex: index
|
|
582
563
|
});
|
|
583
564
|
}
|
|
584
|
-
},
|
|
585
|
-
var preItemFirst =
|
|
586
|
-
var preItemLast =
|
|
587
|
-
var preItem = index === 0 ? preItemFirst :
|
|
588
|
-
var nextItem = index ===
|
|
565
|
+
}, _groupSource.map(function (item, index) {
|
|
566
|
+
var preItemFirst = _groupSource.length > 1 ? _groupSource[_groupSource.length - 1] : null;
|
|
567
|
+
var preItemLast = _groupSource.length > 1 ? _groupSource[0] : null;
|
|
568
|
+
var preItem = index === 0 ? preItemFirst : _groupSource[index - 1];
|
|
569
|
+
var nextItem = index === _groupSource.length - 1 ? preItemLast : _groupSource[index + 1];
|
|
589
570
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
590
571
|
key: item.id,
|
|
591
572
|
className: "item-wrap"
|
|
592
573
|
}, getItemContent(item, preItem, nextItem));
|
|
593
|
-
})), data.setting.navigation.open &&
|
|
574
|
+
})), data.setting.navigation.open && _groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
594
575
|
className: "carousel-icon-right",
|
|
595
576
|
onClick: function onClick() {
|
|
596
577
|
return _this.carouselRef.current.toNext();
|
|
@@ -599,9 +580,9 @@ function (_super) {
|
|
|
599
580
|
onMouseLeave: this.mouseLeaveBtn,
|
|
600
581
|
style: navStyle,
|
|
601
582
|
type: "icon-right"
|
|
602
|
-
}), data.setting.dots.open &&
|
|
583
|
+
}), data.setting.dots.open && _groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
603
584
|
className: "swiper-ban"
|
|
604
|
-
},
|
|
585
|
+
}, _groupSource.map(function (item, i) {
|
|
605
586
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
606
587
|
key: i,
|
|
607
588
|
className: (0, _classnames["default"])('ban', {
|
|
@@ -102,8 +102,7 @@ var Renderer = function Renderer(props) {
|
|
|
102
102
|
magic_design: "",
|
|
103
103
|
style: {
|
|
104
104
|
height: '100%',
|
|
105
|
-
background: pageBackground
|
|
106
|
-
overflow: 'auto'
|
|
105
|
+
background: pageBackground
|
|
107
106
|
}
|
|
108
107
|
}, floors.length > 0 && floors.map(function (nodeData, moduleIndex) {
|
|
109
108
|
var Clazz = _componentTypes.componentMap[nodeData.type];
|
|
@@ -244,14 +244,14 @@ function (_super) {
|
|
|
244
244
|
|
|
245
245
|
_this.getMyWalletData = function () {
|
|
246
246
|
return __awaiter(_this, void 0, void 0, function () {
|
|
247
|
-
var data, _a, userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet,
|
|
247
|
+
var data, _a, userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet, bnplObj, creditObj, B2BObj;
|
|
248
248
|
|
|
249
249
|
var _b;
|
|
250
250
|
|
|
251
|
-
var
|
|
251
|
+
var _this = this;
|
|
252
252
|
|
|
253
|
-
return __generator(this, function (
|
|
254
|
-
switch (
|
|
253
|
+
return __generator(this, function (_c) {
|
|
254
|
+
switch (_c.label) {
|
|
255
255
|
case 0:
|
|
256
256
|
data = this.props.data;
|
|
257
257
|
return [4
|
|
@@ -259,86 +259,60 @@ function (_super) {
|
|
|
259
259
|
, (0, _commonUtil.commonFetch)('/designer/v1/h5/mywallet/list', {}, 'GET')];
|
|
260
260
|
|
|
261
261
|
case 1:
|
|
262
|
-
_a =
|
|
263
|
-
// userCreditResps: [
|
|
264
|
-
// {
|
|
265
|
-
// userCreditId: 1023,
|
|
266
|
-
// creditId: 1,
|
|
267
|
-
// partyType: null,
|
|
268
|
-
// state: 'Pass',
|
|
269
|
-
// isUrlExpired: false,
|
|
270
|
-
// creditLimit: 150000,
|
|
271
|
-
// usageAmount: 100000,
|
|
272
|
-
// availableAmount: 1000,
|
|
273
|
-
// comments: null,
|
|
274
|
-
// userNearestBillDto: null,
|
|
275
|
-
// },
|
|
276
|
-
// {
|
|
277
|
-
// userCreditId: 1026,
|
|
278
|
-
// creditId: 2,
|
|
279
|
-
// partyType: null,
|
|
280
|
-
// state: 'Locked',
|
|
281
|
-
// isUrlExpired: false,
|
|
282
|
-
// creditLimit: 100000,
|
|
283
|
-
// usageAmount: 100000,
|
|
284
|
-
// availableAmount: 2000,
|
|
285
|
-
// comments: null,
|
|
286
|
-
// userNearestBillDto: null,
|
|
287
|
-
// },
|
|
288
|
-
// {
|
|
289
|
-
// userCreditId: 1027,
|
|
290
|
-
// creditId: 3,
|
|
291
|
-
// partyType: 'I',
|
|
292
|
-
// state: 'Pass',
|
|
293
|
-
// isUrlExpired: false,
|
|
294
|
-
// creditLimit: 100000000,
|
|
295
|
-
// usageAmount: 0,
|
|
296
|
-
// availableAmount: 3000,
|
|
297
|
-
// comments: 'ty',
|
|
298
|
-
// userNearestBillDto: null,
|
|
299
|
-
// },
|
|
300
|
-
// ],
|
|
301
|
-
// userCashbackValues: 4000,
|
|
302
|
-
// userBalance: 5000,
|
|
303
|
-
// userPoint: 6000,
|
|
304
|
-
// defaultShowWallet: 'Balance',
|
|
305
|
-
// };
|
|
306
|
-
|
|
307
|
-
if (data.customize.layout === 'layout2' && this.carouselRef) {
|
|
308
|
-
defaultShowIndex_1 = 0;
|
|
309
|
-
data.groupSource.forEach(function (f, i) {
|
|
310
|
-
if (f.sourceType === defaultShowWallet) defaultShowIndex_1 = i;
|
|
311
|
-
});
|
|
312
|
-
(_c = this.carouselRef.current) === null || _c === void 0 ? void 0 : _c.slideTo(defaultShowIndex_1);
|
|
313
|
-
}
|
|
314
|
-
|
|
262
|
+
_a = _c.sent(), userCreditResps = _a.userCreditResps, userCashbackValues = _a.userCashbackValues, userBalance = _a.userBalance, userPoint = _a.userPoint, defaultShowWallet = _a.defaultShowWallet;
|
|
315
263
|
bnplObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
316
|
-
return item.creditId === 1
|
|
264
|
+
return item.creditId === 1;
|
|
317
265
|
});
|
|
318
266
|
creditObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
319
|
-
return item.creditId === 2
|
|
267
|
+
return item.creditId === 2;
|
|
320
268
|
});
|
|
321
269
|
B2BObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
322
|
-
return item.creditId === 3
|
|
270
|
+
return item.creditId === 3;
|
|
323
271
|
});
|
|
324
272
|
this.setState({
|
|
325
273
|
userWalletData: (_b = {}, _b[_constants.walletType.BNPL] = {
|
|
326
|
-
amount: userCreditResps === null ? '****' : bnplObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(bnplObj.availableAmount) : 'APPLY'
|
|
274
|
+
amount: userCreditResps === null ? '****' : bnplObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(bnplObj.availableAmount) : 'APPLY',
|
|
275
|
+
show: userCreditResps === null || [_constants.CREDIT_STATE.APPROVED.KEY].includes(bnplObj === null || bnplObj === void 0 ? void 0 : bnplObj.state)
|
|
327
276
|
}, _b[_constants.walletType.CREDIT] = {
|
|
328
|
-
amount: userCreditResps === null ? '****' : creditObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(creditObj.availableAmount) : 'APPLY'
|
|
277
|
+
amount: userCreditResps === null ? '****' : creditObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(creditObj.availableAmount) : 'APPLY',
|
|
278
|
+
show: userCreditResps === null || [_constants.CREDIT_STATE.APPROVED.KEY].includes(creditObj === null || creditObj === void 0 ? void 0 : creditObj.state)
|
|
329
279
|
}, _b[_constants.walletType.B2B] = {
|
|
330
280
|
amount: userCreditResps === null ? '****' : B2BObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(B2BObj.availableAmount) : 'APPLY',
|
|
331
|
-
text: B2BObj ? 'Add
|
|
332
|
-
btnText: 'Procure Product'
|
|
281
|
+
text: B2BObj ? 'Add more products to your shop!' : '',
|
|
282
|
+
btnText: B2BObj ? 'Procure Product' : '',
|
|
283
|
+
show: userCreditResps === null || [_constants.CREDIT_STATE.APPROVED.KEY].includes(B2BObj === null || B2BObj === void 0 ? void 0 : B2BObj.state)
|
|
333
284
|
}, _b[_constants.walletType.CASHBACK] = {
|
|
334
|
-
amount: userCashbackValues === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userCashbackValues)
|
|
285
|
+
amount: userCashbackValues === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userCashbackValues),
|
|
286
|
+
show: true
|
|
335
287
|
}, _b[_constants.walletType.BALANCE] = {
|
|
336
288
|
amount: userBalance === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userBalance),
|
|
337
|
-
btnText: 'Social Commerce'
|
|
289
|
+
btnText: userBalance ? 'Social Commerce' : '',
|
|
290
|
+
show: true
|
|
338
291
|
}, _b[_constants.walletType.CENDUIT] = {
|
|
339
|
-
amount: userPoint === null ? '****' :
|
|
340
|
-
btnText: 'Cenduit Mall'
|
|
292
|
+
amount: userPoint === null ? '****' : userPoint,
|
|
293
|
+
btnText: userPoint ? 'Cenduit Mall' : '',
|
|
294
|
+
show: true
|
|
341
295
|
}, _b)
|
|
296
|
+
}, function () {
|
|
297
|
+
var _a;
|
|
298
|
+
|
|
299
|
+
if (data.customize.layout === 'layout2' && _this.carouselRef) {
|
|
300
|
+
var userWalletData_1 = _this.state.userWalletData;
|
|
301
|
+
|
|
302
|
+
var _groupSource = data.groupSource.filter(function (f) {
|
|
303
|
+
var _a;
|
|
304
|
+
|
|
305
|
+
return (_a = userWalletData_1[f.sourceType]) === null || _a === void 0 ? void 0 : _a.show;
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
var defaultShowIndex_1 = 0;
|
|
309
|
+
|
|
310
|
+
_groupSource.forEach(function (f, i) {
|
|
311
|
+
if (f.sourceType === defaultShowWallet) defaultShowIndex_1 = i;
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
(_a = _this.carouselRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(defaultShowIndex_1);
|
|
315
|
+
}
|
|
342
316
|
});
|
|
343
317
|
return [2
|
|
344
318
|
/*return*/
|
|
@@ -428,11 +402,20 @@ function (_super) {
|
|
|
428
402
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
429
403
|
|
|
430
404
|
var data = this.props.data;
|
|
431
|
-
var
|
|
405
|
+
var _j = this.state,
|
|
406
|
+
sliderIndex = _j.sliderIndex,
|
|
407
|
+
userWalletData = _j.userWalletData;
|
|
432
408
|
var colNum = data.customize.rowNum;
|
|
433
409
|
var autoplay = (_b = (_a = data.setting) === null || _a === void 0 ? void 0 : _a.autoplay) === null || _b === void 0 ? void 0 : _b.open;
|
|
410
|
+
|
|
411
|
+
var _groupSource = data.groupSource.filter(function (f) {
|
|
412
|
+
var _a;
|
|
413
|
+
|
|
414
|
+
return (_a = userWalletData[f.sourceType]) === null || _a === void 0 ? void 0 : _a.show;
|
|
415
|
+
});
|
|
434
416
|
/** 设计器模式下 如果选中特定group 自动播放关闭 */
|
|
435
417
|
|
|
418
|
+
|
|
436
419
|
if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
|
|
437
420
|
autoplay = false;
|
|
438
421
|
}
|
|
@@ -461,36 +444,34 @@ function (_super) {
|
|
|
461
444
|
}
|
|
462
445
|
}
|
|
463
446
|
|
|
447
|
+
item.text.text = ((_a = userWalletData[item.sourceType]) === null || _a === void 0 ? void 0 : _a.text) || 'Make money and shop on Cendol!';
|
|
464
448
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
465
449
|
className: "text-content",
|
|
466
450
|
style: _bgStyle
|
|
467
|
-
}, ((
|
|
451
|
+
}, ((_b = item.title) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
468
452
|
className: "title",
|
|
469
453
|
data: item.title,
|
|
470
454
|
GAData: __assign(__assign({}, GAData), {
|
|
471
455
|
groupId: item.id,
|
|
472
456
|
groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
|
|
473
457
|
})
|
|
474
|
-
}), ((
|
|
458
|
+
}), ((_c = item.amount) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
475
459
|
className: "amount",
|
|
476
460
|
data: __assign(__assign({}, item.amount), {
|
|
477
|
-
text: (
|
|
461
|
+
text: (_d = userWalletData[item.sourceType]) === null || _d === void 0 ? void 0 : _d.amount
|
|
478
462
|
}),
|
|
479
463
|
GAData: __assign(__assign({}, GAData), {
|
|
480
464
|
groupId: item.id,
|
|
481
465
|
groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
|
|
482
466
|
}),
|
|
483
467
|
readonly: true
|
|
484
|
-
}), ((
|
|
468
|
+
}), ((_e = item.text) === null || _e === void 0 ? void 0 : _e.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
485
469
|
className: "text",
|
|
486
|
-
data:
|
|
487
|
-
text: ((_e = userWalletData[item.sourceType]) === null || _e === void 0 ? void 0 : _e.text) || 'Make money and shop on Cendol!'
|
|
488
|
-
}),
|
|
470
|
+
data: item.text,
|
|
489
471
|
GAData: __assign(__assign({}, GAData), {
|
|
490
472
|
groupId: item.id,
|
|
491
473
|
groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
|
|
492
|
-
})
|
|
493
|
-
readonly: true
|
|
474
|
+
})
|
|
494
475
|
}), ((_f = item.button) === null || _f === void 0 ? void 0 : _f.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
495
476
|
className: "wallet-btn",
|
|
496
477
|
data: __assign(__assign({}, item.button), {
|
|
@@ -553,7 +534,7 @@ function (_super) {
|
|
|
553
534
|
style: (0, _commonUtil.pxToRem)({
|
|
554
535
|
gap: MOBILE_IMG_SIZE[colNum].gap
|
|
555
536
|
})
|
|
556
|
-
},
|
|
537
|
+
}, _groupSource.map(function (item) {
|
|
557
538
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
558
539
|
key: item.id,
|
|
559
540
|
className: "item-wrap",
|
|
@@ -563,7 +544,7 @@ function (_super) {
|
|
|
563
544
|
}, getItemContent(item));
|
|
564
545
|
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
565
546
|
className: "carousel-layout"
|
|
566
|
-
}, data.setting.navigation.open &&
|
|
547
|
+
}, data.setting.navigation.open && _groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
567
548
|
className: "carousel-icon-left",
|
|
568
549
|
onClick: function onClick() {
|
|
569
550
|
return _this.carouselRef.current.toPrev();
|
|
@@ -581,16 +562,16 @@ function (_super) {
|
|
|
581
562
|
sliderIndex: index
|
|
582
563
|
});
|
|
583
564
|
}
|
|
584
|
-
},
|
|
585
|
-
var preItemFirst =
|
|
586
|
-
var preItemLast =
|
|
587
|
-
var preItem = index === 0 ? preItemFirst :
|
|
588
|
-
var nextItem = index ===
|
|
565
|
+
}, _groupSource.map(function (item, index) {
|
|
566
|
+
var preItemFirst = _groupSource.length > 1 ? _groupSource[_groupSource.length - 1] : null;
|
|
567
|
+
var preItemLast = _groupSource.length > 1 ? _groupSource[0] : null;
|
|
568
|
+
var preItem = index === 0 ? preItemFirst : _groupSource[index - 1];
|
|
569
|
+
var nextItem = index === _groupSource.length - 1 ? preItemLast : _groupSource[index + 1];
|
|
589
570
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
590
571
|
key: item.id,
|
|
591
572
|
className: "item-wrap"
|
|
592
573
|
}, getItemContent(item, preItem, nextItem));
|
|
593
|
-
})), data.setting.navigation.open &&
|
|
574
|
+
})), data.setting.navigation.open && _groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
594
575
|
className: "carousel-icon-right",
|
|
595
576
|
onClick: function onClick() {
|
|
596
577
|
return _this.carouselRef.current.toNext();
|
|
@@ -599,9 +580,9 @@ function (_super) {
|
|
|
599
580
|
onMouseLeave: this.mouseLeaveBtn,
|
|
600
581
|
style: navStyle,
|
|
601
582
|
type: "icon-right"
|
|
602
|
-
}), data.setting.dots.open &&
|
|
583
|
+
}), data.setting.dots.open && _groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
603
584
|
className: "swiper-ban"
|
|
604
|
-
},
|
|
585
|
+
}, _groupSource.map(function (item, i) {
|
|
605
586
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
606
587
|
key: i,
|
|
607
588
|
className: (0, _classnames["default"])('ban', {
|
|
@@ -102,8 +102,7 @@ var Renderer = function Renderer(props) {
|
|
|
102
102
|
magic_design: "",
|
|
103
103
|
style: {
|
|
104
104
|
height: '100%',
|
|
105
|
-
background: pageBackground
|
|
106
|
-
overflow: 'auto'
|
|
105
|
+
background: pageBackground
|
|
107
106
|
}
|
|
108
107
|
}, floors.length > 0 && floors.map(function (nodeData, moduleIndex) {
|
|
109
108
|
var Clazz = _componentTypes.componentMap[nodeData.type];
|