Files
baiducom/waf/static/js/7819.1c7bcace504127ec.js
T
2024-09-24 17:45:24 +08:00

1425 lines
53 KiB
JavaScript

(self.webpackChunk_N_E = self.webpackChunk_N_E || []).push([
[7819],
{
61673: function (n, e, t) {
"use strict";
t.d(e, {
l: function () {
return r;
},
});
var o = t(4637),
a = t(84875),
i = t.n(a),
r = function (n) {
var e = n.data,
t = n.target,
a = n.dataTrackCategory,
r = n.dataTrackName,
c = n.dataTrackValue,
s = n.style,
l = n.className,
d = n.onClick;
return e && !e.disabled && e.text
? (0, o.jsx)("a", {
className: i()(l),
href: e.href,
target: t || "_self",
"data-track-category": a,
"data-track-name": r,
"data-track-value": null != c ? c : e.text,
style: s,
onClick: d,
children: e.text,
})
: null;
};
},
40826: function (n, e, t) {
"use strict";
t.d(e, {
f: function () {
return d;
},
});
var o = t(59072),
a = t(4637),
i = t(98537),
r = t(41934),
c = t(674),
s = t(39145),
l = t(61230);
t.n(l)().a;
var d = function (n) {
var e = n.cancelText,
t = n.className,
r = n.content,
c = n.maskClosable,
l = n.okText,
d = n.onCancel,
u = n.onOk,
p = n.showCloseIcon,
m = n.title,
v = n.zIndex,
h = (0, o.Z)((0, i.Y)(!0), 2),
x = h[0],
f = h[1],
k = function () {
f(!1), null == d || d();
},
b = function () {
f(!1);
};
return (0, a.jsx)(s.d, {
className: "u-dialog ".concat(t),
show: x,
maskClosable: c,
onClose: k,
style: { zIndex: v },
children: (0, a.jsxs)("div", {
className: "u-dialog-content",
children: [
(0, a.jsx)("div", { className: "u-dialog-head", children: m }),
(0, a.jsx)("div", {
className: "u-dialog-center",
children: (0, a.jsx)("div", {
className: "u-dialog-body",
children: r,
}),
}),
(0, a.jsxs)("div", {
className: "u-dialog-footer",
children: [
Boolean(e) &&
(0, a.jsx)("span", {
className: "u-dialog-button u-dialog-button-cancel",
onClick: function () {
return k();
},
children: e,
}),
(0, a.jsx)("span", {
className: "u-dialog-button",
onClick: function () {
return null == u ? void 0 : u(b);
},
children: l,
}),
],
}),
p &&
(0, a.jsx)("div", {
className: "u-dialog-close-icon",
onClick: k,
}),
],
}),
});
};
d.open = function (n) {
(0, r.BW)(c.K).open({ component: d, props: n });
};
},
20723: function (n, e, t) {
"use strict";
t.d(e, {
R: function () {
return K;
},
C: function () {
return J;
},
});
var o = t(72006),
a = t(4405),
i = t(59072),
r = t(4637),
c = t(83646),
s = t(24462),
l = t(84875),
d = t.n(l),
u = t(59496),
p = t(12005),
m = t(61673),
v = t(40826),
h = t(23381),
x = t(88929),
f = t(41934),
k = t(48522),
b = t(98537),
g = t(16114),
j = t(75239),
N = t(674),
y = t(88576),
_ = t(42314),
w = t(32699),
C = t(25732),
L = t.n(C),
I = function (n) {
var e,
t,
i,
c = n.promotionV3,
s = n.length,
l = n.width,
m = (0, u.useState)(null),
h = m[0],
x = m[1],
k = (0, u.useState)(
null !==
(i =
null == c
? void 0
: null === (e = c.cover) || void 0 === e
? void 0
: null === (t = e.getBtn) || void 0 === t
? void 0
: t.text) && void 0 !== i
? i
: ""
),
b = k[0],
C = k[1],
I = (0, u.useState)(!1),
T = I[0],
O = I[1];
(0, g.FI)(function () {
var n;
(null == c
? void 0
: null === (n = c.cover) || void 0 === n
? void 0
: n.getBtn) &&
(0, f.BW)(_.i).subscribe(function (n) {
x((0, o.Z)({}, n)),
n.hasLogin &&
j.y
.post(y.N.POST_COUPON_PRECONDITION, {
campaignId: c.cover.getBtn.couponId,
})
.then(function (n) {
n.success &&
200 === n.status &&
(18656 === n.result.code
? (C("已领取"), O(!0))
: 0 !== n.result.code && (O(!0), C("条件不符合")));
})
.catch(function () {
O(!0);
});
});
});
var S = function (n) {
var e = n.title,
t = n.content,
o = n.url,
a = n.okText;
(0, f.BW)(N.K).open({
component: v.f,
props: {
title: e,
content: t,
okText: a,
maskClosable: !1,
showCloseIcon: !0,
onOk: function (n) {
o ? (window.location.href = o) : n();
},
},
});
},
P = (0, w.debounce)(
function () {
!T &&
((null == h ? void 0 : h.hasLogin)
? j.y
.post(y.N.POST_COUPON_APPLY, {
campaignId: c.cover.getBtn.couponId,
})
.then(function (n) {
if (200 === n.status && n.success) {
var e = n.result.code;
if (0 === e)
C("已领取"),
O(!0),
S({
title: "领取成功",
content: "".concat(c.cover.title, "领取成功"),
url: "",
okText: "确定",
});
else {
var t = (0, p.iz)()[e] || {
title: "未知错误",
content: "未知错误",
okText: "返回",
url: location.href,
};
S(
(0, a.Z)((0, o.Z)({}, t), {
title: n.result.message,
})
);
}
}
})
: (location.href = (0, p.Zd)()));
},
3e3,
{ leading: !0, trailing: !1 }
);
if (!c || !c.items || !c.cover) return null;
var Z = c.cover,
E = c.items;
return (0, r.jsxs)("div", {
className: L()["coupon-container"],
style: { width: l },
children: [
(0, r.jsx)("div", {
className: L()["coupon-group"],
children: E.slice(0, s).map(function (n, e) {
return (0,
r.jsxs)("div", { className: L().coupon, children: [(0, r.jsx)("div", { className: L()["coupon-tag"], children: n.tagText }), (0, r.jsxs)("div", { className: L().top, children: [(0, r.jsxs)("div", { className: L().price, children: [(0, r.jsx)("span", { className: L()["price-unit"], children: n.priceUnit }), (0, r.jsx)("span", { className: L()["price-number"], children: n.price })] }), (0, r.jsx)("div", { className: L()["price-desc"], children: n.desc })] }), (0, r.jsx)("div", { className: L().bottom, children: n.bottomText })] }, e);
}),
}),
(0, r.jsx)("div", {
className: L()["coupon-cover"],
children: (0, r.jsxs)("div", {
className: L().content,
children: [
(0, r.jsx)("h2", {
className: L().title,
children: Z.title,
}),
(0, r.jsxs)("div", {
className: L()["desc-row"],
children: [
(0, r.jsx)("span", {
className: L().desc,
children: Z.desc,
}),
Z.activityBtn &&
(0, r.jsx)("a", {
className: L()["activity-link"],
target: "_blank",
href: Z.activityBtn.href,
"data-track-category": "产品banner",
"data-track-name": "代金券",
"data-track-value": Z.activityBtn.text,
children: Z.activityBtn.text,
}),
],
}),
(0, r.jsx)("button", {
className: d()(L()["get-btn"], T && L().disabled),
"data-track-category": "产品banner",
"data-track-name": "代金券",
"data-track-value": b,
onClick: P,
children: (0, r.jsx)("span", {
className: L()["get-btn-text"],
children: b,
}),
}),
],
}),
}),
],
});
},
T = t(20460),
O = t.n(T),
S = function (n) {
var e,
t = n.items,
o = n.length,
a = n.width,
i = n.className;
return (0, r.jsx)("ul", {
className: d()(
O()["promotion-list"],
(null === (e = t[2]) || void 0 === e ? void 0 : e.disabled) &&
3 === o &&
O()["col-2"],
i
),
style: { width: a },
children: t.slice(0, o).map(function (n, e) {
return (
!n.disabled &&
(0, r.jsx)(
"li",
{
children: (0, r.jsxs)("a", {
href: n.link,
target: "_blank",
"data-track-category": "banner推广区域",
"data-track-name": "第".concat(e, "个"),
"data-track-value": n.title,
children: [
(0, r.jsxs)("div", {
className: O()["promotion-top"],
children: [
(0, r.jsx)("h3", { children: n.title }),
(0, r.jsx)("span", {
className: O()[n.tagColor],
children: n.tag,
}),
],
}),
(0, r.jsx)("p", { children: n.desc }),
],
}),
},
n.title
)
);
}),
});
},
P = t(79918),
Z = t(63395),
E = t.n(Z),
M = function (n) {
var e = n.banner,
t = function (n) {
(0, f.BW)(N.K).open({
component: P.N,
props: { config: { file: n }, initSdk: !0 },
});
};
return e.video
? (0, r.jsx)("div", {
className: E()["banner-video"],
id: "bannerVideoIcon",
"data-track-category": "banner推广区域",
"data-track-name": "视频",
"data-track-value": e.video.title,
onClick: function () {
t(e.video.url);
},
children: (0, r.jsxs)("div", {
className: E()["banner-video-inner"],
children: [
(0, r.jsx)("h3", { children: e.video.title }),
(0, r.jsx)("p", { children: e.video.desc }),
],
}),
})
: null;
},
B = t(57389),
W = t(39062);
t(2483);
var G = t(55968),
H = t(27482),
R = t(37629),
V = t.n(R),
z = V()["tooltip-overlay"];
function D(n) {
var e,
t = (0, H.C)(n.conponLink),
o = t.showCouponEntry,
a = t.couponGroup,
c = t.handleGetCoupon,
s = t.showCouponModal,
l = (0, u.useRef)(null),
p = (0, i.Z)((0, b.Y)(null), 3),
m = p[0],
v = p[1],
h = p[2],
x = function () {
if ((v("".concat(l.current.offsetWidth, "px")), s))
var n = Date.now(),
e = setInterval(function () {
var t = document.querySelector(".cloud-header-operate"),
o = 0;
if (t) {
var a = document.querySelector(".".concat(z)),
i = a.offsetTop;
(o = t.offsetHeight),
(a.style.top = "".concat(i + o, "px"));
}
(Date.now() - n >= 3e3 || o > 0) &&
e &&
(clearInterval(e), (e = null));
}, 200);
};
return o
? (0, r.jsx)("div", {
className: d()(V()["v5s001-coupon-group"]),
children: (0, r.jsx)(W.default, {
placement: "rightTop",
color: "#fff",
defaultOpen: s,
overlayClassName: z,
onOpenChange: function (n) {
setTimeout(function () {
n && v("".concat(l.current.offsetWidth, "px"));
}, 100);
},
title: (0, r.jsxs)("div", {
className: V()["coupon-list-container"],
children: [
(0, r.jsx)("div", {
className: V()["coupon-list-header"],
children: (0, r.jsx)("p", {
children: null == a ? void 0 : a.title,
}),
}),
(0, r.jsxs)("div", {
className: V()["coupon-list"],
children: [
(0, r.jsx)("div", {
className: V()["desc-wrapper"],
style: { width: h.current || m },
children: (0, r.jsxs)("p", {
className: V()["desc-text"],
children: [
null == a ? void 0 : a.desc,
(0, r.jsxs)("a", {
href: null == a ? void 0 : a.ruleBtnUrl,
"data-track-category": "banner主区域",
"data-track-name": "pc领券-文字链",
"data-track-value":
(null == a ? void 0 : a.ruleBtnText) ||
"活动规则",
"data-track-action": "click",
children: [
(null == a ? void 0 : a.ruleBtnText) ||
"活动规则",
(0, r.jsx)("i", {}),
],
}),
],
}),
}),
(0, r.jsx)(G.F, {
exposureHandler: x,
children: (0, r.jsx)("ul", {
ref: l,
children:
null == a
? void 0
: null === (e = a.coupons) || void 0 === e
? void 0
: e.map(function (n) {
return (0, r.jsxs)(
"li",
{
children: [
(0, r.jsxs)("div", {
className: V()["left-info"],
children: [
(0, r.jsx)("div", {
className: V().title,
children: n.couponGroupName,
}),
(0, r.jsx)("div", {
className: V()["discount-info"],
children: n.coupons.map(
function (n, e) {
return (0, r.jsx)(
"span",
{
children: n.couponInfo,
},
e
);
}
),
}),
],
}),
(0, r.jsx)("div", {
className: d()(
V()["right-btn"],
(0, B.Z)(
{},
V().used,
n.available
)
),
onClick: function () {
return c(n);
},
"data-track-category":
"banner主区域",
"data-track-name": "pc领券-".concat(
n.couponGroupName
),
"data-track-value": n.available
? "去使用"
: "领取",
"data-track-action": "click",
children: n.available
? "去使用"
: "领取",
}),
],
},
n.couponGroupId
);
}),
}),
}),
],
}),
],
}),
children: (0, r.jsx)("span", {
className: V()["coupon-entry-button"],
"data-track-category": "banner主区域",
"data-track-name": "pc领券",
"data-track-value": "pc领券hover",
"data-track-action": "mouseenter",
children: "领券",
}),
}),
})
: null;
}
var F = t(95411),
Y = t.n(F),
X = "banner主区域",
U = "ht:/console.bce.baidu.com/qianfan/ais/console/onlineTest",
q = (0, f.BW)(k.q),
A = q.isDev
? "http://localhost:9889/cloudlive/"
: q.isProdOnline
? "/cloudlive/"
: "ht:/cloudtest.baidu.com/cloudlive/",
J = function (n) {
var e = n.title,
t = n.content,
o = n.okText,
a = n.cb;
v.f.open({
title: e,
content: t,
okText: o,
maskClosable: !0,
showCloseIcon: !0,
zIndex: 1e4,
onOk: function (n) {
n(), a && a();
},
});
};
function K(n) {
var e,
t,
l,
v,
f,
k,
j,
N,
y,
_ = n.data,
w = n.type,
C = _.render,
L = _.config,
T = C.banner,
O = C.promotionV3,
P = (0, u.useState)(!1),
Z = P[0],
E = P[1],
B = (0, i.Z)((0, h.X)({}), 3),
W = B[0],
G = B[2],
H = (0, u.useRef)(null),
R = (0, i.Z)((0, b.Y)(!1), 3),
V = R[0],
z = R[1],
F = R[2],
K = (0, u.useState)(!1),
Q = K[0],
$ = K[1],
nn = (0, u.useState)(!0),
ne = nn[0],
nt = nn[1],
no = (0, i.Z)((0, b.Y)(!1), 3),
na = no[0],
ni = no[1],
nr = no[2],
nc = (0, u.useState)(2),
ns = nc[0],
nl = nc[1],
nd = (0, u.useRef)(null),
nu = q.isProdSandbox,
np = function () {
var n = document.querySelector('[ui-type="V5G031"]');
n
? (n.scrollIntoView({ behavior: "smooth" }),
setTimeout(function () {
var e = n.querySelector("button");
e && e.click();
}, 500))
: window.open(U, "_blank");
},
nm = function (n, e) {
var t = e.login,
i = e.realName,
r = e.href;
if (t) {
if (
(n.preventDefault(), (null == W ? void 0 : W.hasLogin) && !i)
) {
window.open(r, "_blank");
return;
}
var c = function () {
return G()
.then(function (n) {
if (0 === n) return !0;
if (201 === n) {
if (!i) return !0;
c();
} else if (204 === n) {
if (!i) return !0;
J(
(0, a.Z)((0, o.Z)({}, x.uh.NO_REALNAME), {
cb: function () {
return window.open(x.$s[nu ? "sandbox" : "online"]);
},
})
);
} else J((0, o.Z)({}, x.uh.UNKNOWN_ERROR));
return !1;
})
.then(function (n) {
return n && window.open(r, "_blank");
})
.catch(function (n) {
console.error(n), J((0, o.Z)({}, x.uh.UNKNOWN_ERROR));
});
};
c();
}
},
nv = (0, u.useCallback)(
function () {
Q
? top.postMessage("liveRoomShow", "*")
: ((0, p.QU)(0),
nt(!1),
E(!0),
document.body.classList.add(Y()["no-scroll"]),
document.body.classList.add(Y()["hide-fixed-box"]),
H.current.contentWindow.postMessage("playPlayer", "*"));
},
[Q]
),
nh = function () {
nt(!1),
E(!1),
document.body.classList.remove(Y()["no-scroll"]),
document.body.classList.remove(Y()["hide-fixed-box"]);
};
return (
(0, g.FI)(function () {
location.href.includes("fromCloudLive=true") &&
($(!0), document.body.classList.add(Y()["hide-header"])),
window.addEventListener("message", function (n) {
"liveRoomHide" === n.data && nh(),
"show-header" === n.data &&
document.body.classList.remove(Y()["hide-header"]),
"hide-header" === n.data &&
document.body.classList.add(Y()["hide-header"]);
});
}),
(0, u.useEffect)(
function () {
var n;
Q ||
F.current ||
null === (n = H.current) ||
void 0 === n ||
n.contentWindow.addEventListener("load", function () {
z(!0), nr.current && ni(!1);
});
},
[Q, nv, F, nr, z, ni]
),
(0, u.useEffect)(
function () {
na
? (nd.current = setInterval(function () {
nl(function (n) {
return (n + 1) % 3;
});
}, 500))
: nd.current &&
(clearInterval(nd.current), (nd.current = null));
},
[na]
),
(0, r.jsxs)(r.Fragment, {
children: [
(null === (e = T.cloudLive) || void 0 === e
? void 0
: e.liveId) &&
!Q &&
(0, r.jsxs)("div", {
className: d()(
Y()["live-room-container"],
!Z && Y().hide,
ne && Y()["no-transition"]
),
onTransitionEnd: function () {
nt(!0);
},
children: [
(0, r.jsx)("iframe", {
src: ""
.concat(A)
.concat(
T.cloudLive.liveId,
"?isHideHeader=true&fromProduct=true"
),
ref: H,
}),
na &&
(0, r.jsx)("div", {
className: Y()["iframe-loading"],
children: (0, r.jsxs)("span", {
children: [
"加载中",
Array.from({ length: ns + 1 }).map(function () {
return ".";
}),
],
}),
}),
],
}),
(0, r.jsxs)("section", {
"ui-type": w,
className: Y()["banner-2022"],
style: {
backgroundColor: "".concat(T.background.color),
backgroundImage:
"video" === T.background.type
? "none"
: "url(".concat(T.background.image, ")"),
"--banner-height": L.customBannerHeight || "408px",
},
children: [
((null === (t = T.cloudLive) || void 0 === t
? void 0
: t.liveId) ||
Q) &&
(0, r.jsxs)("div", {
className: d()(
Y()["cloud-live-entry"],
T.background.isDark && Y().dark
),
onClick: function () {
nv(), V || Q || ni(!0);
},
children: [
(0, r.jsxs)("div", {
className: Y()["btn-entry"],
children: [
(0, r.jsxs)("div", {
className: Y()["entry-living-animation"],
children: [
(0, r.jsx)("span", {}),
(0, r.jsx)("span", {}),
(0, r.jsx)("span", {}),
],
}),
(0, r.jsx)("span", {
children:
null !==
(y =
null === (l = T.cloudLive) || void 0 === l
? void 0
: l.liveEntryText) && void 0 !== y
? y
: "进入直播间",
}),
],
}),
(0, r.jsx)("div", { className: Y()["bg-entry"] }),
],
}),
"video" === T.background.type &&
(0, r.jsx)("video", {
className: Y()["bg-video"],
autoPlay: !0,
loop: !0,
muted: !0,
src: T.background.video,
}),
(0, r.jsxs)("div", {
className: d()(
Y().group,
T.background.isDark && Y().dark,
"v5-group-base"
),
children: [
(0, r.jsxs)("div", {
className: Y()["title-wrapper"],
children: [
(0, r.jsx)("h1", {
className: Y().title,
children: T.title,
}),
(0, r.jsx)(D, {
conponLink:
null == T
? void 0
: null === (v = T.primaryLink) || void 0 === v
? void 0
: v.href,
}),
],
}),
(0, r.jsx)("p", {
className: Y().desc,
dangerouslySetInnerHTML: { __html: T.content },
}),
L.withRankLink &&
(null === (f = T.rankLink) || void 0 === f
? void 0
: f.text) &&
(0, r.jsx)("p", {
className: Y()["rank-link"],
children: (0, r.jsx)("a", {
href: T.rankLink.href,
target: "_blank",
"data-track-category": X,
"data-track-name": "排行榜",
"data-track-value": T.rankLink.text,
style: {
backgroundImage: "url(".concat(
T.rankLink.rankIcon ||
"ht:/bce.bdstatic.com/p3m/common-service/uploads/hot-rank-icon_39bc8c5.png",
")"
),
},
children: (0, r.jsx)("span", {
className: Y()["text-wrapper"],
children: T.rankLink.text,
}),
}),
}),
!L.withBannerMarket ||
("productRecommend" === L.withBannerMarket &&
(0, r.jsxs)("p", {
className: Y()["similar-product"],
children: [
(0, r.jsx)("span", {
children: T.similarProduct.purchasePercent,
}),
(0, r.jsx)("span", {
children: "的用户同时购买了",
}),
(0, r.jsx)("a", {
href: T.similarProduct.path,
target: "_blank",
"data-track-category": X,
"data-track-name": "产品推荐按钮",
"data-track-value":
T.similarProduct.serviceName,
children: T.similarProduct.serviceName,
}),
],
})),
"activityRecommend" === L.withBannerMarket &&
T.activityLink &&
(0, r.jsx)("p", {
className: Y()["recommend-activity"],
children: (0, r.jsxs)("a", {
href: T.activityLink.href,
target: "_blank",
"data-track-category": X,
"data-track-name": "活动推荐横幅",
"data-track-value": T.activityLink.text,
children: [
T.activityLink.icon &&
(0, r.jsx)("span", {
className: Y().label,
children: (0, r.jsx)("img", {
src: T.activityLink.icon,
alt: T.activityLink.text,
}),
}),
(0, r.jsxs)("span", {
className: Y()["text-wrapper"],
children: [
(0, r.jsx)("span", {
className: Y().text,
children: T.activityLink.text,
}),
T.activityLink.btnText &&
(0, r.jsxs)("span", {
className: Y().btn,
children: [
(0, r.jsx)("i", {}),
(0, r.jsx)("span", {
children: T.activityLink.btnText,
}),
],
}),
],
}),
],
}),
}),
(0, r.jsxs)("div", {
className: Y()["detail-box"],
children: [
(0, r.jsxs)("div", {
className: Y()["btn-group"],
children: [
(0, r.jsx)(m.l, {
data: T.primaryLink,
dataTrackCategory: X,
dataTrackName: "主按钮",
target: "_blank",
className: Y()["primary-link"],
onClick: function (n) {
return nm(n, T.primaryLink);
},
}),
L.withSecondaryLink
? (0, r.jsx)(r.Fragment, {
children:
(null === (k = T.secondaryLink) ||
void 0 === k
? void 0
: k.href) !== U ||
T.secondaryLink.disabled
? (0, r.jsx)(m.l, {
className: Y()["secondary-link"],
data: T.secondaryLink,
dataTrackCategory: X,
dataTrackName: "副按钮",
target: "_blank",
onClick: function (n) {
return nm(n, T.secondaryLink);
},
})
: (0, r.jsx)("div", {
className: Y()["secondary-link"],
"data-track-category": X,
"data-track-name": "副按钮",
"data-track-value":
T.secondaryLink.text,
onClick: np,
children: T.secondaryLink.text,
}),
})
: null,
],
}),
(0, r.jsx)("div", {
className: Y()["link-group"],
children:
null === (j = T.textLink) || void 0 === j
? void 0
: j.map(function (n) {
return (0, r.jsx)(
m.l,
{
className: Y()["text-link"],
data: n,
dataTrackCategory: X,
dataTrackName: "文字链",
target: "_blank",
onClick: function (e) {
return nm(e, n);
},
},
n.text
);
}),
}),
],
}),
],
}),
],
}),
(0, r.jsx)(s.o, {
data: C.nav,
isDefaultHide:
L.withPromotion && "textLink" !== L.promotionMode,
}),
L.withPromotion &&
(0, r.jsx)("section", {
className: d()(
Y()["v5-promotion-v3"],
"textLink" === L.promotionMode && Y()["text-link-promotion"]
),
children: (0, r.jsx)("div", {
className: d()(Y().group, "v5-group-base"),
children:
L.isNewBanner2202 &&
(0, r.jsxs)(r.Fragment, {
children: [
"promotionVideo" === L.promotionMode &&
O &&
(0, r.jsx)(S, {
items: O.items,
length: 3,
width: 824,
}),
"introVideo" === L.promotionMode &&
O &&
(0, r.jsx)("ul", {
className: Y()["intro-list"],
children:
null === (N = O.items) || void 0 === N
? void 0
: N.slice(0, 3).map(function (n) {
return (0,
r.jsxs)("li", { children: [(0, r.jsx)("h3", { children: n.title }), (0, r.jsx)("p", { children: n.desc })] }, n.title);
}),
}),
"coupon3" === L.promotionMode &&
(0, r.jsx)(I, {
promotionV3: O,
length: 3,
width: 1180,
}),
"coupon2" === L.promotionMode &&
(null == O ? void 0 : O.promotion) &&
(0, r.jsxs)("div", {
className: Y()["coupon2-container"],
children: [
(0, r.jsx)(S, {
items: [
{
title: O.promotion.title,
tagColor: O.promotion.tagColor,
tag: O.promotion.tag,
desc: O.promotion.desc,
link: O.promotion.link,
},
],
length: 1,
width: 274,
className: Y()["promotion-list"],
}),
(0, r.jsx)(I, {
promotionV3: O,
length: 2,
width: 886,
}),
],
}),
(!L.promotionMode ||
"promotion" === L.promotionMode) &&
O &&
(0, r.jsx)(S, {
items: O.items,
length: 4,
width: 1180,
}),
("promotionVideo" === L.promotionMode ||
"introVideo" === L.promotionMode) &&
(0, r.jsx)(M, { banner: T }),
"textLink" === L.promotionMode &&
(0, r.jsx)(c.Z, { data: O }),
],
}),
}),
}),
],
})
);
}
},
27482: function (n, e, t) {
"use strict";
t.d(e, {
C: function () {
return b;
},
});
var o = t(72006),
a = t(4405),
i = t(41934),
r = t(29196),
c = t(95667),
s = t(53594),
l = t(16114),
d = t(75239),
u = t(40826),
p = t(51592),
m = t(88576),
v = t(12005),
h = t(42314),
x = t(40531);
t(67269);
var f = t(32699),
k = t(59496);
function b(n) {
var e = (0, k.useRef)(null),
t = (0, k.useState)(!1),
b = t[0],
g = t[1],
j = (0, k.useState)(!0),
N = j[0],
y = j[1],
_ = (0, k.useState)(null),
w = _[0],
C = _[1];
(0, l.FI)(function () {
var n,
t = new r.c(),
a = null;
t.subscribe(function (n) {
var e,
t = (a = (0, o.Z)({}, a, n)).userInfo,
i = a.couponGroup;
t &&
(null == i
? void 0
: null === (e = i.coupons) || void 0 === e
? void 0
: e.length) > 0 &&
i.coupons.forEach(function (n) {
t.hasLogin
? d.y
.post(m.N.POST_COUPON_PRECONDITION, {
campaignId: n.couponGroupId,
})
.then(function (e) {
e.success &&
200 === e.status &&
((n.available = 18656 === e.result.code),
C((0, o.Z)({}, i)));
})
.catch(function () {
(n.available = !1), C((0, o.Z)({}, i));
})
: ((n.available = !1), C((0, o.Z)({}, i)));
});
}),
d.y.get(m.N.GET_COUPON_GROUP_CMS).then(function (n) {
n.forEach(function (n) {
n.urls.includes(location.pathname) &&
(g(!0), C((0, o.Z)({}, n)), t.next({ couponGroup: n }));
});
}),
(0, i.BW)(h.i).subscribe(function (n) {
(e.current = n), t.next({ userInfo: n });
}),
y(
null === (n = (0, c.pM)()) || void 0 === n
? void 0
: n.couponGroupOpen
);
});
var L = function (n) {
d.y
.post(m.N.POST_COUPON_APPLY, { campaignId: n.couponGroupId })
.then(function (e) {
if (200 === e.status && e.success) {
var t = e.result.code;
if (0 === t)
u.f.open({
title: "领取成功",
content: "".concat(n.couponGroupName, "领取成功"),
okText: "确定",
maskClosable: !0,
showCloseIcon: !0,
zIndex: 1e4,
onOk: function (e) {
e(),
C(function (e) {
return (
(e.coupons.find(function (e) {
return e.couponGroupId === n.couponGroupId;
}).available = !0),
(0, o.Z)({}, e)
);
});
},
});
else {
var i = (0, v.iz)()[t] || {
title: "未知错误",
content: "未知错误",
okText: "返回",
url: location.href,
};
u.f.open(
(0, a.Z)((0, o.Z)({}, i), {
title: "温馨提示",
zIndex: 1e4,
maskClosable: !0,
showCloseIcon: !0,
onOk: function (n) {
i.url ? (window.location.href = i.url) : n();
},
})
);
}
}
});
};
return {
showCouponEntry: b,
couponGroup: w,
handleGetCoupon: (0, f.debounce)(function (t) {
var o;
if (t.available) {
location.href = n;
return;
}
(null === (o = e.current) || void 0 === o ? void 0 : o.hasLogin)
? L(t)
: (0, s.b9)()
? p.F.open({
maskClosable: !0,
onOk: function (n) {
var e = n.regSuccess;
window.require
? window.require(["portalCommon"], function (n) {
n.userinfoInit(function (n) {
(null == n ? void 0 : n.hasLogin)
? (L(t), e && (0, v.NN)())
: x.default.error("登录失败");
});
})
: window.portalCommon.userinfoInit(function (n) {
(null == n ? void 0 : n.hasLogin)
? (L(t), e && (0, v.NN)())
: x.default.error("登录失败");
});
},
})
: (location.href = "".concat(
(0, v.Zd)(),
"?couponGroupOpen=true"
));
}, 500),
showCouponModal: N,
setShowCouponModal: y,
};
}
},
61230: function () {},
95411: function (n) {
n.exports = {
center: "QRVIYitJ",
clearInput: "FCcLcZIq",
ellipsis: "V215Bc6e",
"no-scroll": "qXsKo73Y",
"hide-fixed-box": "IsZ3QlQ0",
"hide-header": "nUDxEcVW",
"live-room-container": "jrbPAHbu",
hide: "__3hPv7Iwp",
"no-transition": "rYW55Cj9",
"iframe-loading": "nGGJUa7n",
"cloud-live-entry": "ZhaNCUw_",
moveAnimation: "qbDrvhWq",
moveBackAnimation: "OxSiy6zF",
"bg-entry": "__3mTGsvzN",
dark: "OHalhz8f",
"entry-living-animation": "IwcGDWXO",
"btn-entry": "NbAbPmYo",
bgEntryMove: "om92ozfk",
arrowMove: "_svWw7b7",
lineTrans1: "KzzbPtdd",
lineTrans2: "_X5Hs0Hz",
lineTrans3: "mdED2Hke",
"banner-2022": "_1_w_aDs",
"bg-video": "d07k5Plr",
group: "gFNuBeFA",
"title-wrapper": "hCgyHgCF",
title: "__97Smpdd0",
desc: "wA8grczH",
"recommend-activity": "MDpr_Ylb",
label: "_kqhIqSR",
"text-wrapper": "Pa_xlr6j",
btn: "eje2_kzz",
"detail-box": "kIAe161w",
"secondary-link": "MFQO_fjx",
"link-group": "__1sZuthkX",
"text-link": "C5JLWW2E",
"similar-product": "__94FPbLjb",
"rank-link": "s4YMLdig",
text: "hddDUoms",
btnLightMove: "YKJP7sJD",
"btn-group": "Ek4ybOnS",
"primary-link": "kN_SngIz",
"v5-promotion-v3": "EnRYXVXh",
"text-link-promotion": "__2f1ufw6g",
"intro-list": "__2WWIOerr",
"coupon2-container": "f2CsnWvJ",
"promotion-list": "qef_Fez_",
};
},
37629: function (n) {
n.exports = {
"v5s001-coupon-group": "LT9ss2Bx",
"coupon-entry-button": "shbQYerX",
"tooltip-overlay": "FHLJUcbx",
"coupon-list-container": "Zk52bn9u",
"coupon-list-header": "E2b3yH_E",
"coupon-list": "__4vYH9kdb",
"desc-wrapper": "jpNqTpoe",
"desc-text": "XY_cJXjS",
"left-info": "__4SwpT7Ol",
title: "UnoZyofl",
"discount-info": "ezy0ZC7L",
"right-btn": "m6V1jhFx",
used: "pyh1y_Gn",
};
},
25732: function (n) {
n.exports = {
center: "Xp_Tpjhn",
clearInput: "Tqc660VH",
ellipsis: "sD34OnkH",
"coupon-container": "i0ej_u9a",
"coupon-group": "cxD4HwYh",
coupon: "xnnob29x",
"coupon-tag": "fEqos7XX",
top: "YsiouLxj",
price: "__91gmZE2s",
"price-unit": "HiWVvPhp",
"price-number": "__1LUy3ESW",
"price-desc": "__8GWAXhJJ",
bottom: "hSScaCvR",
"coupon-cover": "_JIN1FXj",
content: "nJ7sGCQ1",
title: "UFC60F68",
"desc-row": "gOWWljYs",
"activity-link": "TVQ57l0z",
"get-btn": "z_T00KuI",
disabled: "__5AEIpKHq",
"get-btn-text": "bX6D1Cih",
"show-btn-arrow": "RuSdIxvJ",
};
},
20460: function (n) {
n.exports = {
center: "VmX_VuZB",
clearInput: "YAbienBv",
ellipsis: "VVzk7Hv4",
"promotion-list": "X4xp0phn",
promotionV3Arrow: "i7mXRfr9",
"promotion-top": "__6JNynOnL",
blue: "gxSKmbCn",
};
},
63395: function (n) {
n.exports = {
center: "DDd_TUOt",
clearInput: "sQrHG8Yp",
ellipsis: "X4MNHWkF",
"banner-video": "s9pf2nK9",
"banner-video-inner": "euXHbMCN",
};
},
},
]);