Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

479 lines
17 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 5d5b47876e53e564.da1ba52a93.js
* Module id: 994938
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t,
r,
n = e.i(462214),
o = e.i(358379),
a = e.i(688907),
i = e.i(827628),
l = e.i(764789);
function s() {
return (s = Object.assign.bind()).apply(null, arguments);
}
let c = function (e) {
return o.createElement(
"svg",
s(
{
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
fill: "none",
viewBox: "0 0 24 24",
},
e,
),
r ||
(r = o.createElement("path", {
stroke: "#fff",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeOpacity: 0.75,
strokeWidth: 2.5,
d: "M18 18 6 6m12 0L6 18",
})),
);
};
var u = e.i(291487);
e.i(606823);
var d = e.i(841183),
f = e.i(626673);
e.i(370357);
var m = e.i(185264);
e.i(693602);
var p = e.i(774042),
h = e.i(385734),
g = e.i(373518),
b = e.i(734911),
v = e.i(192830),
_ = e.i(575117),
y = e.i(664202),
x = e.i(689832),
C =
(((t = C || {}).Discount_A = "new_user_retain_discount_a"),
(t.Discount_B = "new_user_retain_discount_b"),
(t.Discount_C = "new_user_retain_discount"),
t);
let E = (e) => {
let {
handleClose: t,
member: r,
onMemberUpdate: s,
setInnerReady: c,
} = e,
{
reportLevel: b,
syncVipInfo: v,
countDown: C,
setCountDown: E,
} = (0, m.vipInfoStore)(),
[S, w] = (0, o.useState)(null),
[k, j] = (0, o.useState)(null),
[P, R] = (0, o.useState)(!0),
{ inTimelimit: N, takeTimeLimitDiscount: $ } = (0,
d.useTimelimitHooks)(),
[O, T] = (0, o.useState)(!1),
M = (0, f.useReportLog)(),
I = () => {
T(!O);
},
A = (0, o.useCallback)(async () => {
if (S)
try {
let e = await (0, g.payResultInfo)(S?.tradeId),
t = e?.data;
j(t);
} catch (e) {
console.error("获取支付结果信息时发生错误:", e);
}
}, [S]);
(0, o.useEffect)(() => {
if (S) {
let e = setInterval(A, 5e3),
t = setInterval(I, 1e3 * (S?.expireSeconds || 9e3));
return () => {
clearInterval(e), clearInterval(t);
};
}
}, [S, O]);
let L = (0, o.useCallback)(async (e) => {
let t = e?.id;
if (t)
try {
let r = {
memPkgId: t,
packageShopType: e.packageShopType,
var: {
train_billing_referer: "21",
train_vip_level: b,
pageUrl: location.href,
referer: window?.__NEXT_DATA__?.props?.referer,
},
},
n = (await (0, g.getMemberPurchaseInfo)(r)).data;
n && w(n), R(!1), c(!0);
} catch (e) {}
}, []);
(0, o.useEffect)(() => {
r && (L(r), console.log("member", r));
}, [r]);
let B = (0, o.useCallback)(() => {
M({ e: "vip.retainmodal.pay", var: { trade_id: k?.tradeId } }),
M({
e: "vip.retainmodal.ABTest.pay",
var: { experiment_id: "new_user_retain_discount_b" },
}),
j(null),
v(),
(0, h.postPaySuccessMessage)(),
t?.();
}, []);
return (
(0, o.useEffect)(() => {
$({ opSource: 1 }).then((e) => {
e?.data?.discountActivity === null
? t?.(!0)
: e?.data?.remainingSeconds &&
(E(e.data.remainingSeconds), s?.());
});
}, []),
r && S
? (0, n.jsxs)(n.Fragment, {
children: [
(0, n.jsxs)("div", {
className: `${x.default.Discount_B}`,
children: [
(0, n.jsx)("div", {
className: x.default.title,
children: `首购立享${(0, p.disCountDealing)(r?.discountPercent || 0)}折`,
}),
(0, n.jsxs)("div", {
className: x.default.subTitle,
children: [
(0, n.jsxs)("span", {
className: "line-through",
children: [
"原价¥",
(0, _.default)(r?.originalPrice, 100),
],
}),
(0, n.jsxs)("span", {
children: [
",首月仅需¥",
(0, _.default)(r?.firstMonthPrice, 100),
],
}),
],
}),
(0, n.jsxs)("div", {
className: x.default.banner,
children: [
(0, n.jsx)("img", {
src: "https://liblibai-online.liblib.cloud/web/e6484f0bca9c4ff7aaa019eb46405170/989f5a42-ba3c-47de-8a87-f4e043ef82f9.svg",
alt: "",
}),
(0, n.jsxs)("div", {
className: x.default.bannerContent,
children: [
(0, n.jsx)("div", {
className: x.default.bannerTitle,
children: r?.name,
}),
(0, n.jsx)("div", {
className: x.default.bannerSubTitle,
children: `次月起,续费金额\xa5${(0, _.default)(r?.price, 100)}/月,可随时取消`,
}),
],
}),
],
}),
(0, n.jsxs)("div", {
className: x.default.BPayBox,
children: [
(0, n.jsxs)("div", {
className: x.default.qrCode,
children: [
(0, n.jsx)(y.QRCodeSVG, {
className: x.default.qrCodeReal,
value: S.payUrl,
size: 80,
}),
O &&
(0, n.jsxs)("div", {
className: x.default.mask,
onClick: I,
children: [
(0, n.jsx)("img", {
src: u.STATIC_CDN_MAP["refresh.png"],
alt: "",
width: 24,
}),
(0, n.jsx)("span", {
children: "请点击刷新",
}),
],
}),
],
}),
(0, n.jsxs)("div", {
className: x.default.priceBInfo,
children: [
(0, n.jsxs)("div", {
className: x.default.priceValue,
children: [
(0, n.jsx)("div", {
className: x.default.priceUnit,
children: "¥",
}),
(0, n.jsx)("div", {
className: x.default.priceValueNumber,
children: (0, _.default)(
r?.firstMonthPrice,
100,
),
}),
(0, n.jsx)("div", {
className: x.default.priceDiscount,
children: `已减\xa5${(0, _.default)(r?.originalPrice - r?.firstMonthPrice, 100)}`,
}),
],
}),
(0, n.jsx)("div", {
className: x.default.priceMethod,
children: "请使用支付宝扫码支付",
}),
(0, n.jsx)("div", {
className: x.default.priceAgreement,
children: (0, n.jsxs)(a.default, {
href: "https://www.liblib.art/document/vip_agreement",
target: "_blank",
children: [
(0, n.jsx)("span", {
className: x.default.priceAgreementLeft,
children: "开通即代表同意",
}),
(0, n.jsx)("span", {
className: x.default.priceAgreementRight,
children: "《LiblibAI会员协议》",
}),
],
}),
}),
],
}),
],
}),
],
}),
(0, n.jsx)("div", {
className: `${x.default.payBox} !hidden`,
children: (0, n.jsxs)("div", {
className: "ml-[12px]",
children: [
(0, n.jsxs)("div", {
className: x.default.priceInfo,
children: [
(0, n.jsx)("span", {
className: "font-semibold",
children: "¥",
}),
(0, n.jsx)("span", {
className: x.default.price,
children: (0, n.jsx)("span", {
children: (0, n.jsx)(i.default, {
value: (0, _.default)(r.firstMonthPrice, 100),
startVal: (0, _.default)(
r.originalPrice,
100,
),
}),
}),
}),
"已减",
(0, n.jsx)("span", {
children: (0, _.default)(
r.originalPrice - r.firstMonthPrice,
100,
),
}),
"元",
],
}),
(0, n.jsx)("p", {
className: x.default.paymentMethod,
children: "请使用 支付宝 扫码支付",
}),
(0, n.jsx)("div", {
className: x.default.qrtext,
children: (0, n.jsxs)(a.default, {
href: "https://www.liblib.art/document/vip_agreement",
target: "_blank",
children: [
(0, n.jsx)("span", {
className: x.default.qrlefttext,
children: "开通即代表同意",
}),
(0, n.jsx)("span", {
className: `${x.default.qrRightext}`,
children: "《LiblibAI会员协议》",
}),
],
}),
}),
],
}),
}),
k &&
(0, n.jsx)(l.default, {
onClose: B,
onOk: B,
open: 2 === k.payStatus || k?.payStatus === 6,
orderDetail: k,
isPower: !1,
goodsId: -1,
refer: 0,
tradeId: k?.tradeId,
}),
],
})
: ""
);
},
S = (e) => {
let {
opened: t,
onClose: r,
member: a,
withCloseButton: i = !0,
onMemberUpdate: l,
...s
} = e,
u = a?.discountActivity,
[d, m] = (0, o.useState)(!1),
p = (0, f.useReportLog)();
return (
(0, o.useEffect)(() => {
t &&
(p({ e: "vip.retainmodal.show" }),
u &&
p({
e: "vip.retainmodal.ABTest.show",
var: { experiment_id: u },
}));
}, [t]),
(0, n.jsx)(b.Modal, {
opened: t,
centered: !0,
withCloseButton: d,
closeButtonProps: {
className: x.default.closeButton,
children: (0, n.jsx)("img", {
src: c,
style: { height: 24, width: 24 },
}),
h: 36,
onClick: (e) => {
e.stopPropagation(),
p({ e: "vip.retainmodal.close" }),
m(!1),
r();
},
w: 36,
},
zIndex: 1001,
styles: {
content: {
backgroundColor: "transparent",
overflow: "unset !important",
boxShadow: "none",
},
close: {
position: "absolute",
right: -48,
top: 0,
"&:active": { backgroundColor: "unset", opacity: 0.8 },
"&:hover": { backgroundColor: "unset", opacity: 0.8 },
},
overlay: { backgroundColor: "rgba(0, 0, 0, 0.85)" },
},
onClose: () => {
switch (u) {
case "new_user_retain_discount_a":
p({
e: "vip.retainmodal.ABTest.close",
var: { experiment_id: "new_user_discount_a" },
});
break;
case "new_user_retain_discount_b":
case "new_user_retain_discount":
p({
e: "vip.retainmodal.close",
var: { experiment_id: "new_user_discount_a" },
});
}
},
padding: 0,
size: "auto",
...s,
children: (0, n.jsx)(E, {
member: a,
onMemberUpdate: l,
handleClose: r,
setInnerReady: m,
}),
})
);
};
e.s(
[
"useRetainModal",
0,
(e) => {
let { onClose: t, onMemberUpdate: r } = e,
[a, i] = (0, o.useState)({ opened: !1 }),
l = (0, v.useId)(),
{ setRetain: s } = (0, m.vipInfoStore)(),
c = (0, o.useCallback)(
(e) => {
a.member?.discountActivity === "new_user_discount_b" && s(!0),
i({ ...a, opened: !1 }),
e && t?.();
},
[t],
),
u = (0, o.useCallback)((e) => {
e && i({ ...a, ...e, opened: !0 });
}, []),
d = (0, o.useCallback)((e) => {
e && i({ ...a, ...e, opened: !0 });
}, []),
f = (0, o.useCallback)(() => {
r?.();
}, []);
return [
{ close: c, open: u, update: d },
(0, n.jsx)(
S,
{
onClose: c,
onMemberUpdate: f,
opened: a.opened,
member: a.member,
},
l,
),
];
},
],
994938,
);
};
export default moduleFactory;