@fonixtree/magic-design 1.0.169 → 1.0.171
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/common/components/ProductItem/index.js +1 -1
- package/es/composite-comp/dito/components/SearchDITO/pc/components/Header/index.js +2 -2
- package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +16 -16
- package/es/composite-comp/dito/components/SlideImage/pc/index.js +1 -1
- package/es/utils/commonUtil.js +60 -89
- package/lib/composite-comp/common/components/ProductItem/index.js +1 -1
- package/lib/composite-comp/dito/components/SearchDITO/pc/components/Header/index.js +2 -2
- package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +16 -16
- package/lib/composite-comp/dito/components/SlideImage/pc/index.js +1 -1
- package/lib/utils/commonUtil.js +60 -89
- package/package.json +1 -1
|
@@ -161,7 +161,7 @@ function (_super) {
|
|
|
161
161
|
}, data.url && /*#__PURE__*/_react["default"].createElement("img", {
|
|
162
162
|
alt: "welcome advertise",
|
|
163
163
|
onClick: function onClick() {
|
|
164
|
-
(
|
|
164
|
+
if (window.magicDesign.h5JumpUrlConfig) window.magicDesign.h5JumpUrlConfig(data.adObj, 'voucherRedeemed');
|
|
165
165
|
},
|
|
166
166
|
src: data.url
|
|
167
167
|
}));
|
|
@@ -486,7 +486,7 @@ function (_super) {
|
|
|
486
486
|
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
487
487
|
key: m.model.catgId,
|
|
488
488
|
onClick: function onClick() {
|
|
489
|
-
|
|
489
|
+
if (window.magicDesign.h5JumpUrlConfig) window.magicDesign.h5JumpUrlConfig(m.model.catgRela);
|
|
490
490
|
},
|
|
491
491
|
onMouseEnter: function onMouseEnter(e) {
|
|
492
492
|
return _this.onMouseEnter(e.target, m);
|
|
@@ -506,7 +506,7 @@ function (_super) {
|
|
|
506
506
|
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
507
507
|
key: m.model.catgId,
|
|
508
508
|
onClick: function onClick() {
|
|
509
|
-
|
|
509
|
+
if (window.magicDesign.h5JumpUrlConfig) window.magicDesign.h5JumpUrlConfig(m.model.catgRela);
|
|
510
510
|
}
|
|
511
511
|
}, /*#__PURE__*/_react["default"].createElement("div", null, m.model.catgName), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
512
512
|
className: "icon_right",
|
|
@@ -118,16 +118,16 @@ function (_super) {
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
VideoItem.prototype.render = function () {
|
|
121
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
data =
|
|
125
|
-
cursor =
|
|
126
|
-
onLoad =
|
|
127
|
-
moveIcon =
|
|
128
|
-
var
|
|
129
|
-
playing =
|
|
130
|
-
videoPoster =
|
|
121
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
122
|
+
|
|
123
|
+
var _j = this.props,
|
|
124
|
+
data = _j.data,
|
|
125
|
+
cursor = _j.cursor,
|
|
126
|
+
onLoad = _j.onLoad,
|
|
127
|
+
moveIcon = _j.moveIcon;
|
|
128
|
+
var _k = this.state,
|
|
129
|
+
playing = _k.playing,
|
|
130
|
+
videoPoster = _k.videoPoster;
|
|
131
131
|
var img = ((_b = (_a = data.overilay) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.pcImgSrc) || videoPoster;
|
|
132
132
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
133
133
|
ref: this.cardRef,
|
|
@@ -135,9 +135,9 @@ function (_super) {
|
|
|
135
135
|
onMouseEnter: this.onMouseEnter,
|
|
136
136
|
onMouseLeave: this.onMouseLeave,
|
|
137
137
|
style: {
|
|
138
|
-
cursor: cursor && moveIcon.open ? "url('" + moveIcon.content.pcImgSrc + "'), pointer" : 'unset'
|
|
138
|
+
cursor: cursor && (moveIcon === null || moveIcon === void 0 ? void 0 : moveIcon.open) ? "url('" + ((_c = moveIcon === null || moveIcon === void 0 ? void 0 : moveIcon.content) === null || _c === void 0 ? void 0 : _c.pcImgSrc) + "'), pointer" : 'unset'
|
|
139
139
|
}
|
|
140
|
-
}, ((
|
|
140
|
+
}, ((_d = data.video) === null || _d === void 0 ? void 0 : _d.sourceUrl) && /*#__PURE__*/_react["default"].createElement("video", {
|
|
141
141
|
ref: this.videoRef,
|
|
142
142
|
loop: true,
|
|
143
143
|
muted: true,
|
|
@@ -146,12 +146,12 @@ function (_super) {
|
|
|
146
146
|
visibility: playing ? 'visible' : 'hidden'
|
|
147
147
|
}
|
|
148
148
|
}, /*#__PURE__*/_react["default"].createElement("source", {
|
|
149
|
-
src: (
|
|
149
|
+
src: (_e = data.video) === null || _e === void 0 ? void 0 : _e.sourceUrl,
|
|
150
150
|
type: "video/mp4"
|
|
151
|
-
})), ((
|
|
151
|
+
})), ((_f = data.overilay) === null || _f === void 0 ? void 0 : _f.open) && img && /*#__PURE__*/_react["default"].createElement("img", {
|
|
152
152
|
alt: "",
|
|
153
153
|
className: (0, _classnames["default"])('video-img', {
|
|
154
|
-
cover: (
|
|
154
|
+
cover: (_g = data.video) === null || _g === void 0 ? void 0 : _g.sourceUrl
|
|
155
155
|
}),
|
|
156
156
|
onLoad: onLoad,
|
|
157
157
|
src: img,
|
|
@@ -160,7 +160,7 @@ function (_super) {
|
|
|
160
160
|
}
|
|
161
161
|
}), /*#__PURE__*/_react["default"].createElement("canvas", {
|
|
162
162
|
ref: this.canvasRef
|
|
163
|
-
}), ((
|
|
163
|
+
}), ((_h = data.background) === null || _h === void 0 ? void 0 : _h.image) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
164
164
|
className: "hover-image",
|
|
165
165
|
style: {
|
|
166
166
|
backgroundImage: "url('" + data.background.image + "')"
|
|
@@ -59,7 +59,7 @@ function (_super) {
|
|
|
59
59
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
60
60
|
className: "m-slide-image-pc"
|
|
61
61
|
}, /*#__PURE__*/_react["default"].createElement(_ParallaxScroll["default"], {
|
|
62
|
-
moveIcon: content.moveIcon,
|
|
62
|
+
moveIcon: content === null || content === void 0 ? void 0 : content.moveIcon,
|
|
63
63
|
source: groupSource,
|
|
64
64
|
xGap: columnSpace,
|
|
65
65
|
yGap: lineSpace
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -21,7 +21,7 @@ exports.getUrlParams = void 0;
|
|
|
21
21
|
exports.goLogin = goLogin;
|
|
22
22
|
exports.importAsync = void 0;
|
|
23
23
|
exports.isLogin = isLogin;
|
|
24
|
-
exports.onListenTouch = exports.nextTick = exports.navigateTo =
|
|
24
|
+
exports.onListenTouch = exports.nextTick = exports.navigateTo = void 0;
|
|
25
25
|
exports.pushGA = pushGA;
|
|
26
26
|
exports.setDefaultAddressFromIP = exports.pxToRem = void 0;
|
|
27
27
|
exports.shareFacebook = shareFacebook;
|
|
@@ -42,8 +42,6 @@ var _androidUtil = require("./androidUtil");
|
|
|
42
42
|
|
|
43
43
|
var _storeUtil = require("./storeUtil");
|
|
44
44
|
|
|
45
|
-
var _businessUtil = require("./businessUtil");
|
|
46
|
-
|
|
47
45
|
var _coreUtil = require("./coreUtil");
|
|
48
46
|
|
|
49
47
|
var _constants = require("../constants");
|
|
@@ -518,99 +516,72 @@ var JsonToUrl = function JsonToUrl(data) {
|
|
|
518
516
|
|
|
519
517
|
var urlParamsStr = tempArr.join('&');
|
|
520
518
|
return urlParamsStr;
|
|
521
|
-
};
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
519
|
+
}; // export const jumpUrlConfig = item => {
|
|
520
|
+
// const { objType, objValue } = item || {};
|
|
521
|
+
// let jumpUrl = '';
|
|
522
|
+
// switch (objType) {
|
|
523
|
+
// // 新增case
|
|
524
|
+
// case 'ProductList': {
|
|
525
|
+
// const { offerIdList } = objValue.filteredProductsRela;
|
|
526
|
+
// jumpUrl = `/product/list?from=home&objType=ProductList&offerIdList=${offerIdList}`;
|
|
527
|
+
// break;
|
|
528
|
+
// }
|
|
529
|
+
// case 'Category':
|
|
530
|
+
// jumpUrl = isPc() ? `/product/list?from=home&objType=Category&catgIds=${objValue.objId}` : `/product/list/${objValue.objId}`;
|
|
531
|
+
// break;
|
|
532
|
+
// case 'StoreCategory':
|
|
533
|
+
// jumpUrl = isPc() ? `/product/list?from=home&objType=Category&catgIds=${objValue.objId}&storeCatgIds=${objValue.objId}` : `/product/list/${objValue.objId}?storeCatgIds=${objValue.objId}`;
|
|
534
|
+
// break;
|
|
535
|
+
// case 'Coupons':
|
|
536
|
+
// getAdCoupon(objValue.objId);
|
|
537
|
+
// return;
|
|
538
|
+
// case 'ProductDetail': {
|
|
539
|
+
// const offerId = objValue.objId && objValue.objId.split(',')[0];
|
|
540
|
+
// const productId = objValue.objId && objValue.objId.split(',')[1];
|
|
541
|
+
// jumpUrl = `/product/detail/${offerId}?productId=${productId}`;
|
|
542
|
+
// break;
|
|
543
|
+
// }
|
|
544
|
+
// case 'ProductDetailPage': {
|
|
545
|
+
// const offerId = objValue.objId && objValue.objId.split(',')[0];
|
|
546
|
+
// const productId = objValue.objId && objValue.objId.split(',')[1];
|
|
547
|
+
// jumpUrl = `/product/detail/${offerId}?productId=${productId}`;
|
|
548
|
+
// break;
|
|
549
|
+
// }
|
|
550
|
+
// case 'FilteredProducts': {
|
|
551
|
+
// let params = JsonToUrl(objValue.filteredProductsRela);
|
|
552
|
+
// params = params.replace('productName', 'q').replace('cmpTypeId', 'campaignType');
|
|
553
|
+
// jumpUrl = isPc() ? `/product/list?from=home&objType=FilteredProducts&${params}` : `/product/list/null?${params}`;
|
|
554
|
+
// break;
|
|
555
|
+
// }
|
|
556
|
+
// case 'FunctionPage': {
|
|
557
|
+
// const url = objValue.objId && objValue.objId.split(',')[1];
|
|
558
|
+
// jumpUrl = `${url}`;
|
|
559
|
+
// break;
|
|
560
|
+
// }
|
|
561
|
+
// case 'CustomizedPage':
|
|
562
|
+
// jumpUrl = `/poster/${objValue.objId}`;
|
|
563
|
+
// break;
|
|
564
|
+
// case 'URL': {
|
|
565
|
+
// if (objValue.urlRelaDto?.openMode === 'new') {
|
|
566
|
+
// window.open(objValue.urlRelaDto.url);
|
|
567
|
+
// } else {
|
|
568
|
+
// window.location.href = objValue?.urlRelaDto?.url ?? objValue.url;
|
|
569
|
+
// }
|
|
570
|
+
// return;
|
|
571
|
+
// }
|
|
572
|
+
// default:
|
|
573
|
+
// break;
|
|
574
|
+
// }
|
|
575
|
+
// clickUrl(jumpUrl);
|
|
576
|
+
// };
|
|
562
577
|
|
|
563
|
-
case 'ProductDetailPage':
|
|
564
|
-
{
|
|
565
|
-
var offerId = objValue.objId && objValue.objId.split(',')[0];
|
|
566
|
-
var productId = objValue.objId && objValue.objId.split(',')[1];
|
|
567
|
-
jumpUrl = "/product/detail/" + offerId + "?productId=" + productId;
|
|
568
|
-
break;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
case 'FilteredProducts':
|
|
572
|
-
{
|
|
573
|
-
var params = JsonToUrl(objValue.filteredProductsRela);
|
|
574
|
-
params = params.replace('productName', 'q').replace('cmpTypeId', 'campaignType');
|
|
575
|
-
jumpUrl = (0, _coreUtil.isPc)() ? "/product/list?from=home&objType=FilteredProducts&" + params : "/product/list/null?" + params;
|
|
576
|
-
break;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
case 'FunctionPage':
|
|
580
|
-
{
|
|
581
|
-
var url = objValue.objId && objValue.objId.split(',')[1];
|
|
582
|
-
jumpUrl = "" + url;
|
|
583
|
-
break;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
case 'CustomizedPage':
|
|
587
|
-
jumpUrl = "/poster/" + objValue.objId;
|
|
588
|
-
break;
|
|
589
|
-
|
|
590
|
-
case 'URL':
|
|
591
|
-
{
|
|
592
|
-
if (((_a = objValue.urlRelaDto) === null || _a === void 0 ? void 0 : _a.openMode) === 'new') {
|
|
593
|
-
window.open(objValue.urlRelaDto.url);
|
|
594
|
-
} else {
|
|
595
|
-
window.location.href = (_c = (_b = objValue === null || objValue === void 0 ? void 0 : objValue.urlRelaDto) === null || _b === void 0 ? void 0 : _b.url) !== null && _c !== void 0 ? _c : objValue.url;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
default:
|
|
602
|
-
break;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
(0, _coreUtil.clickUrl)(jumpUrl);
|
|
606
|
-
};
|
|
607
578
|
/**
|
|
608
579
|
* 补0 函数
|
|
609
580
|
* @param {*} num 数字
|
|
610
581
|
*/
|
|
611
582
|
|
|
612
583
|
|
|
613
|
-
exports.
|
|
584
|
+
exports.JsonToUrl = JsonToUrl;
|
|
614
585
|
|
|
615
586
|
var addZero = function addZero(num) {
|
|
616
587
|
return String(num).length === 1 ? "0" + String(num) : String(num);
|
|
@@ -161,7 +161,7 @@ function (_super) {
|
|
|
161
161
|
}, data.url && /*#__PURE__*/_react["default"].createElement("img", {
|
|
162
162
|
alt: "welcome advertise",
|
|
163
163
|
onClick: function onClick() {
|
|
164
|
-
(
|
|
164
|
+
if (window.magicDesign.h5JumpUrlConfig) window.magicDesign.h5JumpUrlConfig(data.adObj, 'voucherRedeemed');
|
|
165
165
|
},
|
|
166
166
|
src: data.url
|
|
167
167
|
}));
|
|
@@ -486,7 +486,7 @@ function (_super) {
|
|
|
486
486
|
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
487
487
|
key: m.model.catgId,
|
|
488
488
|
onClick: function onClick() {
|
|
489
|
-
|
|
489
|
+
if (window.magicDesign.h5JumpUrlConfig) window.magicDesign.h5JumpUrlConfig(m.model.catgRela);
|
|
490
490
|
},
|
|
491
491
|
onMouseEnter: function onMouseEnter(e) {
|
|
492
492
|
return _this.onMouseEnter(e.target, m);
|
|
@@ -506,7 +506,7 @@ function (_super) {
|
|
|
506
506
|
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
507
507
|
key: m.model.catgId,
|
|
508
508
|
onClick: function onClick() {
|
|
509
|
-
|
|
509
|
+
if (window.magicDesign.h5JumpUrlConfig) window.magicDesign.h5JumpUrlConfig(m.model.catgRela);
|
|
510
510
|
}
|
|
511
511
|
}, /*#__PURE__*/_react["default"].createElement("div", null, m.model.catgName), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
512
512
|
className: "icon_right",
|
|
@@ -118,16 +118,16 @@ function (_super) {
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
VideoItem.prototype.render = function () {
|
|
121
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
data =
|
|
125
|
-
cursor =
|
|
126
|
-
onLoad =
|
|
127
|
-
moveIcon =
|
|
128
|
-
var
|
|
129
|
-
playing =
|
|
130
|
-
videoPoster =
|
|
121
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
122
|
+
|
|
123
|
+
var _j = this.props,
|
|
124
|
+
data = _j.data,
|
|
125
|
+
cursor = _j.cursor,
|
|
126
|
+
onLoad = _j.onLoad,
|
|
127
|
+
moveIcon = _j.moveIcon;
|
|
128
|
+
var _k = this.state,
|
|
129
|
+
playing = _k.playing,
|
|
130
|
+
videoPoster = _k.videoPoster;
|
|
131
131
|
var img = ((_b = (_a = data.overilay) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.pcImgSrc) || videoPoster;
|
|
132
132
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
133
133
|
ref: this.cardRef,
|
|
@@ -135,9 +135,9 @@ function (_super) {
|
|
|
135
135
|
onMouseEnter: this.onMouseEnter,
|
|
136
136
|
onMouseLeave: this.onMouseLeave,
|
|
137
137
|
style: {
|
|
138
|
-
cursor: cursor && moveIcon.open ? "url('" + moveIcon.content.pcImgSrc + "'), pointer" : 'unset'
|
|
138
|
+
cursor: cursor && (moveIcon === null || moveIcon === void 0 ? void 0 : moveIcon.open) ? "url('" + ((_c = moveIcon === null || moveIcon === void 0 ? void 0 : moveIcon.content) === null || _c === void 0 ? void 0 : _c.pcImgSrc) + "'), pointer" : 'unset'
|
|
139
139
|
}
|
|
140
|
-
}, ((
|
|
140
|
+
}, ((_d = data.video) === null || _d === void 0 ? void 0 : _d.sourceUrl) && /*#__PURE__*/_react["default"].createElement("video", {
|
|
141
141
|
ref: this.videoRef,
|
|
142
142
|
loop: true,
|
|
143
143
|
muted: true,
|
|
@@ -146,12 +146,12 @@ function (_super) {
|
|
|
146
146
|
visibility: playing ? 'visible' : 'hidden'
|
|
147
147
|
}
|
|
148
148
|
}, /*#__PURE__*/_react["default"].createElement("source", {
|
|
149
|
-
src: (
|
|
149
|
+
src: (_e = data.video) === null || _e === void 0 ? void 0 : _e.sourceUrl,
|
|
150
150
|
type: "video/mp4"
|
|
151
|
-
})), ((
|
|
151
|
+
})), ((_f = data.overilay) === null || _f === void 0 ? void 0 : _f.open) && img && /*#__PURE__*/_react["default"].createElement("img", {
|
|
152
152
|
alt: "",
|
|
153
153
|
className: (0, _classnames["default"])('video-img', {
|
|
154
|
-
cover: (
|
|
154
|
+
cover: (_g = data.video) === null || _g === void 0 ? void 0 : _g.sourceUrl
|
|
155
155
|
}),
|
|
156
156
|
onLoad: onLoad,
|
|
157
157
|
src: img,
|
|
@@ -160,7 +160,7 @@ function (_super) {
|
|
|
160
160
|
}
|
|
161
161
|
}), /*#__PURE__*/_react["default"].createElement("canvas", {
|
|
162
162
|
ref: this.canvasRef
|
|
163
|
-
}), ((
|
|
163
|
+
}), ((_h = data.background) === null || _h === void 0 ? void 0 : _h.image) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
164
164
|
className: "hover-image",
|
|
165
165
|
style: {
|
|
166
166
|
backgroundImage: "url('" + data.background.image + "')"
|
|
@@ -59,7 +59,7 @@ function (_super) {
|
|
|
59
59
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
60
60
|
className: "m-slide-image-pc"
|
|
61
61
|
}, /*#__PURE__*/_react["default"].createElement(_ParallaxScroll["default"], {
|
|
62
|
-
moveIcon: content.moveIcon,
|
|
62
|
+
moveIcon: content === null || content === void 0 ? void 0 : content.moveIcon,
|
|
63
63
|
source: groupSource,
|
|
64
64
|
xGap: columnSpace,
|
|
65
65
|
yGap: lineSpace
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -21,7 +21,7 @@ exports.getUrlParams = void 0;
|
|
|
21
21
|
exports.goLogin = goLogin;
|
|
22
22
|
exports.importAsync = void 0;
|
|
23
23
|
exports.isLogin = isLogin;
|
|
24
|
-
exports.onListenTouch = exports.nextTick = exports.navigateTo =
|
|
24
|
+
exports.onListenTouch = exports.nextTick = exports.navigateTo = void 0;
|
|
25
25
|
exports.pushGA = pushGA;
|
|
26
26
|
exports.setDefaultAddressFromIP = exports.pxToRem = void 0;
|
|
27
27
|
exports.shareFacebook = shareFacebook;
|
|
@@ -42,8 +42,6 @@ var _androidUtil = require("./androidUtil");
|
|
|
42
42
|
|
|
43
43
|
var _storeUtil = require("./storeUtil");
|
|
44
44
|
|
|
45
|
-
var _businessUtil = require("./businessUtil");
|
|
46
|
-
|
|
47
45
|
var _coreUtil = require("./coreUtil");
|
|
48
46
|
|
|
49
47
|
var _constants = require("../constants");
|
|
@@ -518,99 +516,72 @@ var JsonToUrl = function JsonToUrl(data) {
|
|
|
518
516
|
|
|
519
517
|
var urlParamsStr = tempArr.join('&');
|
|
520
518
|
return urlParamsStr;
|
|
521
|
-
};
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
519
|
+
}; // export const jumpUrlConfig = item => {
|
|
520
|
+
// const { objType, objValue } = item || {};
|
|
521
|
+
// let jumpUrl = '';
|
|
522
|
+
// switch (objType) {
|
|
523
|
+
// // 新增case
|
|
524
|
+
// case 'ProductList': {
|
|
525
|
+
// const { offerIdList } = objValue.filteredProductsRela;
|
|
526
|
+
// jumpUrl = `/product/list?from=home&objType=ProductList&offerIdList=${offerIdList}`;
|
|
527
|
+
// break;
|
|
528
|
+
// }
|
|
529
|
+
// case 'Category':
|
|
530
|
+
// jumpUrl = isPc() ? `/product/list?from=home&objType=Category&catgIds=${objValue.objId}` : `/product/list/${objValue.objId}`;
|
|
531
|
+
// break;
|
|
532
|
+
// case 'StoreCategory':
|
|
533
|
+
// jumpUrl = isPc() ? `/product/list?from=home&objType=Category&catgIds=${objValue.objId}&storeCatgIds=${objValue.objId}` : `/product/list/${objValue.objId}?storeCatgIds=${objValue.objId}`;
|
|
534
|
+
// break;
|
|
535
|
+
// case 'Coupons':
|
|
536
|
+
// getAdCoupon(objValue.objId);
|
|
537
|
+
// return;
|
|
538
|
+
// case 'ProductDetail': {
|
|
539
|
+
// const offerId = objValue.objId && objValue.objId.split(',')[0];
|
|
540
|
+
// const productId = objValue.objId && objValue.objId.split(',')[1];
|
|
541
|
+
// jumpUrl = `/product/detail/${offerId}?productId=${productId}`;
|
|
542
|
+
// break;
|
|
543
|
+
// }
|
|
544
|
+
// case 'ProductDetailPage': {
|
|
545
|
+
// const offerId = objValue.objId && objValue.objId.split(',')[0];
|
|
546
|
+
// const productId = objValue.objId && objValue.objId.split(',')[1];
|
|
547
|
+
// jumpUrl = `/product/detail/${offerId}?productId=${productId}`;
|
|
548
|
+
// break;
|
|
549
|
+
// }
|
|
550
|
+
// case 'FilteredProducts': {
|
|
551
|
+
// let params = JsonToUrl(objValue.filteredProductsRela);
|
|
552
|
+
// params = params.replace('productName', 'q').replace('cmpTypeId', 'campaignType');
|
|
553
|
+
// jumpUrl = isPc() ? `/product/list?from=home&objType=FilteredProducts&${params}` : `/product/list/null?${params}`;
|
|
554
|
+
// break;
|
|
555
|
+
// }
|
|
556
|
+
// case 'FunctionPage': {
|
|
557
|
+
// const url = objValue.objId && objValue.objId.split(',')[1];
|
|
558
|
+
// jumpUrl = `${url}`;
|
|
559
|
+
// break;
|
|
560
|
+
// }
|
|
561
|
+
// case 'CustomizedPage':
|
|
562
|
+
// jumpUrl = `/poster/${objValue.objId}`;
|
|
563
|
+
// break;
|
|
564
|
+
// case 'URL': {
|
|
565
|
+
// if (objValue.urlRelaDto?.openMode === 'new') {
|
|
566
|
+
// window.open(objValue.urlRelaDto.url);
|
|
567
|
+
// } else {
|
|
568
|
+
// window.location.href = objValue?.urlRelaDto?.url ?? objValue.url;
|
|
569
|
+
// }
|
|
570
|
+
// return;
|
|
571
|
+
// }
|
|
572
|
+
// default:
|
|
573
|
+
// break;
|
|
574
|
+
// }
|
|
575
|
+
// clickUrl(jumpUrl);
|
|
576
|
+
// };
|
|
562
577
|
|
|
563
|
-
case 'ProductDetailPage':
|
|
564
|
-
{
|
|
565
|
-
var offerId = objValue.objId && objValue.objId.split(',')[0];
|
|
566
|
-
var productId = objValue.objId && objValue.objId.split(',')[1];
|
|
567
|
-
jumpUrl = "/product/detail/" + offerId + "?productId=" + productId;
|
|
568
|
-
break;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
case 'FilteredProducts':
|
|
572
|
-
{
|
|
573
|
-
var params = JsonToUrl(objValue.filteredProductsRela);
|
|
574
|
-
params = params.replace('productName', 'q').replace('cmpTypeId', 'campaignType');
|
|
575
|
-
jumpUrl = (0, _coreUtil.isPc)() ? "/product/list?from=home&objType=FilteredProducts&" + params : "/product/list/null?" + params;
|
|
576
|
-
break;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
case 'FunctionPage':
|
|
580
|
-
{
|
|
581
|
-
var url = objValue.objId && objValue.objId.split(',')[1];
|
|
582
|
-
jumpUrl = "" + url;
|
|
583
|
-
break;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
case 'CustomizedPage':
|
|
587
|
-
jumpUrl = "/poster/" + objValue.objId;
|
|
588
|
-
break;
|
|
589
|
-
|
|
590
|
-
case 'URL':
|
|
591
|
-
{
|
|
592
|
-
if (((_a = objValue.urlRelaDto) === null || _a === void 0 ? void 0 : _a.openMode) === 'new') {
|
|
593
|
-
window.open(objValue.urlRelaDto.url);
|
|
594
|
-
} else {
|
|
595
|
-
window.location.href = (_c = (_b = objValue === null || objValue === void 0 ? void 0 : objValue.urlRelaDto) === null || _b === void 0 ? void 0 : _b.url) !== null && _c !== void 0 ? _c : objValue.url;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
default:
|
|
602
|
-
break;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
(0, _coreUtil.clickUrl)(jumpUrl);
|
|
606
|
-
};
|
|
607
578
|
/**
|
|
608
579
|
* 补0 函数
|
|
609
580
|
* @param {*} num 数字
|
|
610
581
|
*/
|
|
611
582
|
|
|
612
583
|
|
|
613
|
-
exports.
|
|
584
|
+
exports.JsonToUrl = JsonToUrl;
|
|
614
585
|
|
|
615
586
|
var addZero = function addZero(num) {
|
|
616
587
|
return String(num).length === 1 ? "0" + String(num) : String(num);
|