@fonixtree/magic-design 2.0.39 → 2.0.41
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/composite-comp/bol/components/Wallet/index.js +11 -15
- package/es/composite-comp/bol/components/Wallet/mobile/index.js +108 -86
- package/lib/composite-comp/bol/components/Wallet/index.js +11 -15
- package/lib/composite-comp/bol/components/Wallet/mobile/index.js +108 -86
- package/package.json +1 -1
|
@@ -7,8 +7,6 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var _pc = _interopRequireDefault(require("./pc"));
|
|
11
|
-
|
|
12
10
|
var _mobile = _interopRequireDefault(require("./mobile"));
|
|
13
11
|
|
|
14
12
|
var _defaultJSON = require("./defaultJSON");
|
|
@@ -59,30 +57,28 @@ var __decorate = void 0 && (void 0).__decorate || function (decorators, target,
|
|
|
59
57
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
60
58
|
};
|
|
61
59
|
|
|
62
|
-
var
|
|
60
|
+
var Wallet =
|
|
63
61
|
/** @class */
|
|
64
62
|
function (_super) {
|
|
65
|
-
__extends(
|
|
63
|
+
__extends(Wallet, _super);
|
|
66
64
|
|
|
67
|
-
function
|
|
65
|
+
function Wallet() {
|
|
68
66
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
69
67
|
}
|
|
70
68
|
|
|
71
|
-
|
|
69
|
+
Wallet.prototype.render = function () {
|
|
72
70
|
var nodeData = this.props.nodeData;
|
|
73
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, window.magicDesign.device === 'pc' ? /*#__PURE__*/_react["default"].createElement(
|
|
74
|
-
data: nodeData
|
|
75
|
-
}) : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
|
|
71
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, window.magicDesign.device === 'pc' ? null : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
|
|
76
72
|
data: nodeData
|
|
77
73
|
}));
|
|
78
74
|
};
|
|
79
75
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return
|
|
76
|
+
Wallet.defaultProps = {};
|
|
77
|
+
Wallet.type = 'WALLET';
|
|
78
|
+
Wallet.getDefaultJSON = _defaultJSON.getDefaultJSON;
|
|
79
|
+
Wallet = __decorate([_compositeDecorator["default"]], Wallet);
|
|
80
|
+
return Wallet;
|
|
85
81
|
}(_react.Component);
|
|
86
82
|
|
|
87
|
-
var _default =
|
|
83
|
+
var _default = Wallet;
|
|
88
84
|
exports["default"] = _default;
|
|
@@ -240,93 +240,112 @@ function (_super) {
|
|
|
240
240
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
241
241
|
|
|
242
242
|
_this.state = {
|
|
243
|
-
sliderIndex: 0
|
|
243
|
+
sliderIndex: 0,
|
|
244
|
+
userWalletData: {}
|
|
244
245
|
};
|
|
245
246
|
_this.sliderRef = null;
|
|
246
247
|
_this.destroy = null;
|
|
247
|
-
_this.userWalletData = {};
|
|
248
248
|
|
|
249
249
|
_this.getMyWalletData = function () {
|
|
250
250
|
return __awaiter(_this, void 0, void 0, function () {
|
|
251
|
-
var _a, userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet,
|
|
251
|
+
var data, _a, userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet, defaultShowIndex_1, bnplObj, creditObj, B2BObj;
|
|
252
252
|
|
|
253
253
|
var _b;
|
|
254
254
|
|
|
255
255
|
return __generator(this, function (_c) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
256
|
+
switch (_c.label) {
|
|
257
|
+
case 0:
|
|
258
|
+
data = this.props.data;
|
|
259
|
+
return [4
|
|
260
|
+
/*yield*/
|
|
261
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/mywallet/list', {}, 'GET')];
|
|
262
|
+
|
|
263
|
+
case 1:
|
|
264
|
+
_a = _c.sent(), userCreditResps = _a.userCreditResps, userCashbackValues = _a.userCashbackValues, userBalance = _a.userBalance, userPoint = _a.userPoint, defaultShowWallet = _a.defaultShowWallet; // const { userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet } = {
|
|
265
|
+
// userCreditResps: [
|
|
266
|
+
// {
|
|
267
|
+
// userCreditId: 1023,
|
|
268
|
+
// creditId: 1,
|
|
269
|
+
// partyType: null,
|
|
270
|
+
// state: 'Pass',
|
|
271
|
+
// isUrlExpired: false,
|
|
272
|
+
// creditLimit: 150000,
|
|
273
|
+
// usageAmount: 100000,
|
|
274
|
+
// availableAmount: 1000,
|
|
275
|
+
// comments: null,
|
|
276
|
+
// userNearestBillDto: null,
|
|
277
|
+
// },
|
|
278
|
+
// {
|
|
279
|
+
// userCreditId: 1026,
|
|
280
|
+
// creditId: 2,
|
|
281
|
+
// partyType: null,
|
|
282
|
+
// state: 'Locked',
|
|
283
|
+
// isUrlExpired: false,
|
|
284
|
+
// creditLimit: 100000,
|
|
285
|
+
// usageAmount: 100000,
|
|
286
|
+
// availableAmount: 2000,
|
|
287
|
+
// comments: null,
|
|
288
|
+
// userNearestBillDto: null,
|
|
289
|
+
// },
|
|
290
|
+
// {
|
|
291
|
+
// userCreditId: 1027,
|
|
292
|
+
// creditId: 3,
|
|
293
|
+
// partyType: 'I',
|
|
294
|
+
// state: 'Pass',
|
|
295
|
+
// isUrlExpired: false,
|
|
296
|
+
// creditLimit: 100000000,
|
|
297
|
+
// usageAmount: 0,
|
|
298
|
+
// availableAmount: 3000,
|
|
299
|
+
// comments: 'ty',
|
|
300
|
+
// userNearestBillDto: null,
|
|
301
|
+
// },
|
|
302
|
+
// ],
|
|
303
|
+
// userCashbackValues: 4000,
|
|
304
|
+
// userBalance: 5000,
|
|
305
|
+
// userPoint: 6000,
|
|
306
|
+
// defaultShowWallet: 'Balance',
|
|
307
|
+
// };
|
|
308
|
+
|
|
309
|
+
if (data.customize.layout === 'layout2' && this.sliderRef) {
|
|
310
|
+
defaultShowIndex_1 = 0;
|
|
311
|
+
data.groupSource.forEach(function (f, i) {
|
|
312
|
+
if (f.sourceType === defaultShowWallet) defaultShowIndex_1 = i;
|
|
313
|
+
});
|
|
314
|
+
this.sliderRef.slickGoTo(defaultShowIndex_1);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
bnplObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
318
|
+
return item.creditId === 1 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
|
|
319
|
+
});
|
|
320
|
+
creditObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
321
|
+
return item.creditId === 2 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
|
|
322
|
+
});
|
|
323
|
+
B2BObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
324
|
+
return item.creditId === 3 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
|
|
325
|
+
});
|
|
326
|
+
this.setState({
|
|
327
|
+
userWalletData: (_b = {}, _b[_constants.walletType.BNPL] = {
|
|
328
|
+
amount: userCreditResps === null ? '****' : bnplObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(bnplObj.availableAmount) : 'APPLY'
|
|
329
|
+
}, _b[_constants.walletType.CREDIT] = {
|
|
330
|
+
amount: userCreditResps === null ? '****' : creditObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(creditObj.availableAmount) : 'APPLY'
|
|
331
|
+
}, _b[_constants.walletType.B2B] = {
|
|
332
|
+
amount: userCreditResps === null ? '****' : B2BObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(B2BObj.availableAmount) : 'APPLY',
|
|
333
|
+
text: B2BObj ? 'Add ore products to your shop!' : '',
|
|
334
|
+
btnText: 'Procure Product'
|
|
335
|
+
}, _b[_constants.walletType.CASHBACK] = {
|
|
336
|
+
amount: userCashbackValues === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userCashbackValues)
|
|
337
|
+
}, _b[_constants.walletType.BALANCE] = {
|
|
338
|
+
amount: userBalance === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userBalance),
|
|
339
|
+
btnText: 'Social Commerce'
|
|
340
|
+
}, _b[_constants.walletType.CENDUIT] = {
|
|
341
|
+
amount: userBalance === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userPoint),
|
|
342
|
+
btnText: 'Cenduit Mall'
|
|
343
|
+
}, _b)
|
|
344
|
+
});
|
|
345
|
+
return [2
|
|
346
|
+
/*return*/
|
|
347
|
+
];
|
|
348
|
+
}
|
|
330
349
|
});
|
|
331
350
|
});
|
|
332
351
|
};
|
|
@@ -377,12 +396,14 @@ function (_super) {
|
|
|
377
396
|
|
|
378
397
|
this.getMyWalletData();
|
|
379
398
|
this.destroy = (0, _mobx.autorun)(function () {
|
|
380
|
-
|
|
381
|
-
|
|
399
|
+
if (_this.props.data.customize.layout === 'layout2' && _this.sliderRef) {
|
|
400
|
+
_this.sliderGoTo(_this.props.data.groupSource);
|
|
401
|
+
/** 设计器模式下 如果选中特定group 自动播放关闭 */
|
|
382
402
|
|
|
383
403
|
|
|
384
|
-
|
|
385
|
-
|
|
404
|
+
if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
|
|
405
|
+
_this.sliderRef.slickPause();
|
|
406
|
+
}
|
|
386
407
|
}
|
|
387
408
|
});
|
|
388
409
|
};
|
|
@@ -437,6 +458,7 @@ function (_super) {
|
|
|
437
458
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
438
459
|
|
|
439
460
|
var data = _this.props.data;
|
|
461
|
+
var userWalletData = _this.state.userWalletData;
|
|
440
462
|
var GAData = (0, _commonUtil.getGAData)(data);
|
|
441
463
|
var _bgStyle = {};
|
|
442
464
|
|
|
@@ -464,7 +486,7 @@ function (_super) {
|
|
|
464
486
|
}), item.amount.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
465
487
|
className: "amount",
|
|
466
488
|
data: __assign(__assign({}, item.amount), {
|
|
467
|
-
text: (_a =
|
|
489
|
+
text: (_a = userWalletData[item.sourceType]) === null || _a === void 0 ? void 0 : _a.amount
|
|
468
490
|
}),
|
|
469
491
|
GAData: __assign(__assign({}, GAData), {
|
|
470
492
|
groupId: item.id,
|
|
@@ -474,7 +496,7 @@ function (_super) {
|
|
|
474
496
|
}), item.text.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
475
497
|
className: "text",
|
|
476
498
|
data: __assign(__assign({}, item.text), {
|
|
477
|
-
text: ((_b =
|
|
499
|
+
text: ((_b = userWalletData[item.sourceType]) === null || _b === void 0 ? void 0 : _b.text) || 'Make money and shop on Cendol!'
|
|
478
500
|
}),
|
|
479
501
|
GAData: __assign(__assign({}, GAData), {
|
|
480
502
|
groupId: item.id,
|
|
@@ -484,7 +506,7 @@ function (_super) {
|
|
|
484
506
|
}), item.button.open && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
485
507
|
className: "wallet-btn",
|
|
486
508
|
data: __assign(__assign({}, item.button), {
|
|
487
|
-
text: ((_c =
|
|
509
|
+
text: ((_c = userWalletData[item.sourceType]) === null || _c === void 0 ? void 0 : _c.btnText) || 'Lets Go!'
|
|
488
510
|
}),
|
|
489
511
|
GAData: __assign(__assign({}, GAData), {
|
|
490
512
|
groupId: item.id,
|
|
@@ -503,7 +525,7 @@ function (_super) {
|
|
|
503
525
|
readonly: true
|
|
504
526
|
}), /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
505
527
|
data: __assign(__assign({}, item.peek), {
|
|
506
|
-
text: "" + (((_e =
|
|
528
|
+
text: "" + (((_e = userWalletData[preItem === null || preItem === void 0 ? void 0 : preItem.sourceType]) === null || _e === void 0 ? void 0 : _e.amount) || '')
|
|
507
529
|
}),
|
|
508
530
|
GAData: __assign(__assign({}, GAData), {
|
|
509
531
|
groupId: item.id,
|
|
@@ -523,7 +545,7 @@ function (_super) {
|
|
|
523
545
|
readonly: true
|
|
524
546
|
}), /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
525
547
|
data: __assign(__assign({}, item.peek), {
|
|
526
|
-
text: "" + (((_g =
|
|
548
|
+
text: "" + (((_g = userWalletData[nextItem === null || nextItem === void 0 ? void 0 : nextItem.sourceType]) === null || _g === void 0 ? void 0 : _g.amount) || '')
|
|
527
549
|
}),
|
|
528
550
|
GAData: __assign(__assign({}, GAData), {
|
|
529
551
|
groupId: item.id,
|
|
@@ -7,8 +7,6 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var _pc = _interopRequireDefault(require("./pc"));
|
|
11
|
-
|
|
12
10
|
var _mobile = _interopRequireDefault(require("./mobile"));
|
|
13
11
|
|
|
14
12
|
var _defaultJSON = require("./defaultJSON");
|
|
@@ -59,30 +57,28 @@ var __decorate = void 0 && (void 0).__decorate || function (decorators, target,
|
|
|
59
57
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
60
58
|
};
|
|
61
59
|
|
|
62
|
-
var
|
|
60
|
+
var Wallet =
|
|
63
61
|
/** @class */
|
|
64
62
|
function (_super) {
|
|
65
|
-
__extends(
|
|
63
|
+
__extends(Wallet, _super);
|
|
66
64
|
|
|
67
|
-
function
|
|
65
|
+
function Wallet() {
|
|
68
66
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
69
67
|
}
|
|
70
68
|
|
|
71
|
-
|
|
69
|
+
Wallet.prototype.render = function () {
|
|
72
70
|
var nodeData = this.props.nodeData;
|
|
73
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, window.magicDesign.device === 'pc' ? /*#__PURE__*/_react["default"].createElement(
|
|
74
|
-
data: nodeData
|
|
75
|
-
}) : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
|
|
71
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, window.magicDesign.device === 'pc' ? null : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
|
|
76
72
|
data: nodeData
|
|
77
73
|
}));
|
|
78
74
|
};
|
|
79
75
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return
|
|
76
|
+
Wallet.defaultProps = {};
|
|
77
|
+
Wallet.type = 'WALLET';
|
|
78
|
+
Wallet.getDefaultJSON = _defaultJSON.getDefaultJSON;
|
|
79
|
+
Wallet = __decorate([_compositeDecorator["default"]], Wallet);
|
|
80
|
+
return Wallet;
|
|
85
81
|
}(_react.Component);
|
|
86
82
|
|
|
87
|
-
var _default =
|
|
83
|
+
var _default = Wallet;
|
|
88
84
|
exports["default"] = _default;
|
|
@@ -240,93 +240,112 @@ function (_super) {
|
|
|
240
240
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
241
241
|
|
|
242
242
|
_this.state = {
|
|
243
|
-
sliderIndex: 0
|
|
243
|
+
sliderIndex: 0,
|
|
244
|
+
userWalletData: {}
|
|
244
245
|
};
|
|
245
246
|
_this.sliderRef = null;
|
|
246
247
|
_this.destroy = null;
|
|
247
|
-
_this.userWalletData = {};
|
|
248
248
|
|
|
249
249
|
_this.getMyWalletData = function () {
|
|
250
250
|
return __awaiter(_this, void 0, void 0, function () {
|
|
251
|
-
var _a, userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet,
|
|
251
|
+
var data, _a, userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet, defaultShowIndex_1, bnplObj, creditObj, B2BObj;
|
|
252
252
|
|
|
253
253
|
var _b;
|
|
254
254
|
|
|
255
255
|
return __generator(this, function (_c) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
256
|
+
switch (_c.label) {
|
|
257
|
+
case 0:
|
|
258
|
+
data = this.props.data;
|
|
259
|
+
return [4
|
|
260
|
+
/*yield*/
|
|
261
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/mywallet/list', {}, 'GET')];
|
|
262
|
+
|
|
263
|
+
case 1:
|
|
264
|
+
_a = _c.sent(), userCreditResps = _a.userCreditResps, userCashbackValues = _a.userCashbackValues, userBalance = _a.userBalance, userPoint = _a.userPoint, defaultShowWallet = _a.defaultShowWallet; // const { userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet } = {
|
|
265
|
+
// userCreditResps: [
|
|
266
|
+
// {
|
|
267
|
+
// userCreditId: 1023,
|
|
268
|
+
// creditId: 1,
|
|
269
|
+
// partyType: null,
|
|
270
|
+
// state: 'Pass',
|
|
271
|
+
// isUrlExpired: false,
|
|
272
|
+
// creditLimit: 150000,
|
|
273
|
+
// usageAmount: 100000,
|
|
274
|
+
// availableAmount: 1000,
|
|
275
|
+
// comments: null,
|
|
276
|
+
// userNearestBillDto: null,
|
|
277
|
+
// },
|
|
278
|
+
// {
|
|
279
|
+
// userCreditId: 1026,
|
|
280
|
+
// creditId: 2,
|
|
281
|
+
// partyType: null,
|
|
282
|
+
// state: 'Locked',
|
|
283
|
+
// isUrlExpired: false,
|
|
284
|
+
// creditLimit: 100000,
|
|
285
|
+
// usageAmount: 100000,
|
|
286
|
+
// availableAmount: 2000,
|
|
287
|
+
// comments: null,
|
|
288
|
+
// userNearestBillDto: null,
|
|
289
|
+
// },
|
|
290
|
+
// {
|
|
291
|
+
// userCreditId: 1027,
|
|
292
|
+
// creditId: 3,
|
|
293
|
+
// partyType: 'I',
|
|
294
|
+
// state: 'Pass',
|
|
295
|
+
// isUrlExpired: false,
|
|
296
|
+
// creditLimit: 100000000,
|
|
297
|
+
// usageAmount: 0,
|
|
298
|
+
// availableAmount: 3000,
|
|
299
|
+
// comments: 'ty',
|
|
300
|
+
// userNearestBillDto: null,
|
|
301
|
+
// },
|
|
302
|
+
// ],
|
|
303
|
+
// userCashbackValues: 4000,
|
|
304
|
+
// userBalance: 5000,
|
|
305
|
+
// userPoint: 6000,
|
|
306
|
+
// defaultShowWallet: 'Balance',
|
|
307
|
+
// };
|
|
308
|
+
|
|
309
|
+
if (data.customize.layout === 'layout2' && this.sliderRef) {
|
|
310
|
+
defaultShowIndex_1 = 0;
|
|
311
|
+
data.groupSource.forEach(function (f, i) {
|
|
312
|
+
if (f.sourceType === defaultShowWallet) defaultShowIndex_1 = i;
|
|
313
|
+
});
|
|
314
|
+
this.sliderRef.slickGoTo(defaultShowIndex_1);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
bnplObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
318
|
+
return item.creditId === 1 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
|
|
319
|
+
});
|
|
320
|
+
creditObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
321
|
+
return item.creditId === 2 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
|
|
322
|
+
});
|
|
323
|
+
B2BObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
|
|
324
|
+
return item.creditId === 3 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
|
|
325
|
+
});
|
|
326
|
+
this.setState({
|
|
327
|
+
userWalletData: (_b = {}, _b[_constants.walletType.BNPL] = {
|
|
328
|
+
amount: userCreditResps === null ? '****' : bnplObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(bnplObj.availableAmount) : 'APPLY'
|
|
329
|
+
}, _b[_constants.walletType.CREDIT] = {
|
|
330
|
+
amount: userCreditResps === null ? '****' : creditObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(creditObj.availableAmount) : 'APPLY'
|
|
331
|
+
}, _b[_constants.walletType.B2B] = {
|
|
332
|
+
amount: userCreditResps === null ? '****' : B2BObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(B2BObj.availableAmount) : 'APPLY',
|
|
333
|
+
text: B2BObj ? 'Add ore products to your shop!' : '',
|
|
334
|
+
btnText: 'Procure Product'
|
|
335
|
+
}, _b[_constants.walletType.CASHBACK] = {
|
|
336
|
+
amount: userCashbackValues === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userCashbackValues)
|
|
337
|
+
}, _b[_constants.walletType.BALANCE] = {
|
|
338
|
+
amount: userBalance === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userBalance),
|
|
339
|
+
btnText: 'Social Commerce'
|
|
340
|
+
}, _b[_constants.walletType.CENDUIT] = {
|
|
341
|
+
amount: userBalance === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userPoint),
|
|
342
|
+
btnText: 'Cenduit Mall'
|
|
343
|
+
}, _b)
|
|
344
|
+
});
|
|
345
|
+
return [2
|
|
346
|
+
/*return*/
|
|
347
|
+
];
|
|
348
|
+
}
|
|
330
349
|
});
|
|
331
350
|
});
|
|
332
351
|
};
|
|
@@ -377,12 +396,14 @@ function (_super) {
|
|
|
377
396
|
|
|
378
397
|
this.getMyWalletData();
|
|
379
398
|
this.destroy = (0, _mobx.autorun)(function () {
|
|
380
|
-
|
|
381
|
-
|
|
399
|
+
if (_this.props.data.customize.layout === 'layout2' && _this.sliderRef) {
|
|
400
|
+
_this.sliderGoTo(_this.props.data.groupSource);
|
|
401
|
+
/** 设计器模式下 如果选中特定group 自动播放关闭 */
|
|
382
402
|
|
|
383
403
|
|
|
384
|
-
|
|
385
|
-
|
|
404
|
+
if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
|
|
405
|
+
_this.sliderRef.slickPause();
|
|
406
|
+
}
|
|
386
407
|
}
|
|
387
408
|
});
|
|
388
409
|
};
|
|
@@ -437,6 +458,7 @@ function (_super) {
|
|
|
437
458
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
438
459
|
|
|
439
460
|
var data = _this.props.data;
|
|
461
|
+
var userWalletData = _this.state.userWalletData;
|
|
440
462
|
var GAData = (0, _commonUtil.getGAData)(data);
|
|
441
463
|
var _bgStyle = {};
|
|
442
464
|
|
|
@@ -464,7 +486,7 @@ function (_super) {
|
|
|
464
486
|
}), item.amount.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
465
487
|
className: "amount",
|
|
466
488
|
data: __assign(__assign({}, item.amount), {
|
|
467
|
-
text: (_a =
|
|
489
|
+
text: (_a = userWalletData[item.sourceType]) === null || _a === void 0 ? void 0 : _a.amount
|
|
468
490
|
}),
|
|
469
491
|
GAData: __assign(__assign({}, GAData), {
|
|
470
492
|
groupId: item.id,
|
|
@@ -474,7 +496,7 @@ function (_super) {
|
|
|
474
496
|
}), item.text.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
475
497
|
className: "text",
|
|
476
498
|
data: __assign(__assign({}, item.text), {
|
|
477
|
-
text: ((_b =
|
|
499
|
+
text: ((_b = userWalletData[item.sourceType]) === null || _b === void 0 ? void 0 : _b.text) || 'Make money and shop on Cendol!'
|
|
478
500
|
}),
|
|
479
501
|
GAData: __assign(__assign({}, GAData), {
|
|
480
502
|
groupId: item.id,
|
|
@@ -484,7 +506,7 @@ function (_super) {
|
|
|
484
506
|
}), item.button.open && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
485
507
|
className: "wallet-btn",
|
|
486
508
|
data: __assign(__assign({}, item.button), {
|
|
487
|
-
text: ((_c =
|
|
509
|
+
text: ((_c = userWalletData[item.sourceType]) === null || _c === void 0 ? void 0 : _c.btnText) || 'Lets Go!'
|
|
488
510
|
}),
|
|
489
511
|
GAData: __assign(__assign({}, GAData), {
|
|
490
512
|
groupId: item.id,
|
|
@@ -503,7 +525,7 @@ function (_super) {
|
|
|
503
525
|
readonly: true
|
|
504
526
|
}), /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
505
527
|
data: __assign(__assign({}, item.peek), {
|
|
506
|
-
text: "" + (((_e =
|
|
528
|
+
text: "" + (((_e = userWalletData[preItem === null || preItem === void 0 ? void 0 : preItem.sourceType]) === null || _e === void 0 ? void 0 : _e.amount) || '')
|
|
507
529
|
}),
|
|
508
530
|
GAData: __assign(__assign({}, GAData), {
|
|
509
531
|
groupId: item.id,
|
|
@@ -523,7 +545,7 @@ function (_super) {
|
|
|
523
545
|
readonly: true
|
|
524
546
|
}), /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
525
547
|
data: __assign(__assign({}, item.peek), {
|
|
526
|
-
text: "" + (((_g =
|
|
548
|
+
text: "" + (((_g = userWalletData[nextItem === null || nextItem === void 0 ? void 0 : nextItem.sourceType]) === null || _g === void 0 ? void 0 : _g.amount) || '')
|
|
527
549
|
}),
|
|
528
550
|
GAData: __assign(__assign({}, GAData), {
|
|
529
551
|
groupId: item.id,
|