561 lines
20 KiB
JavaScript
561 lines
20 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 5d5b47876e53e564.da1ba52a93.js
|
|
* Module id: 431053
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
var t = e.i(462214),
|
|
r = e.i(358379),
|
|
n = e.i(688907),
|
|
o = e.i(242269),
|
|
a = e.i(291487),
|
|
i = e.i(126098);
|
|
e.i(963527);
|
|
var l = e.i(185264);
|
|
e.i(606823);
|
|
var s = e.i(626673),
|
|
c = e.i(49914),
|
|
u = e.i(734911),
|
|
d = e.i(575117),
|
|
f = e.i(664202);
|
|
e.i(370357), e.i(693602);
|
|
var m = e.i(385734),
|
|
p = e.i(373518),
|
|
h = e.i(711400),
|
|
g = e.i(465255),
|
|
b = e.i(50602),
|
|
v = e.i(464143),
|
|
_ = e.i(764789),
|
|
y = e.i(179729);
|
|
let x = (e) => {
|
|
let {
|
|
open: o,
|
|
purchaseMemberDetail: i,
|
|
isPower: c,
|
|
goods: u,
|
|
closePaySuccessModel: h,
|
|
modelVersionUuid: x,
|
|
billingReferer: C,
|
|
loading: E,
|
|
requestReorder: S,
|
|
isClient: w,
|
|
layoutVariant: k = "embedded",
|
|
} = e,
|
|
[j, P] = (0, r.useState)(!1),
|
|
[R, N] = (0, r.useState)({}),
|
|
[$, O] = (0, r.useState)(!1),
|
|
[T, M] = (0, r.useState)(""),
|
|
I = (0, s.useReportLog)();
|
|
(0, r.useEffect)(() => {
|
|
i?.tradeId && (M(i.payUrl), O(!1));
|
|
}, [i?.tradeId]);
|
|
let A = (0, r.useMemo)(
|
|
() => (u ? u.originalPrice - u.firstMonthPrice : 0),
|
|
[u],
|
|
),
|
|
L = (0, d.default)(i?.payAmount, 100);
|
|
(0, r.useEffect)(() => {
|
|
(R?.payStatus === 2 || R?.payStatus === 6) &&
|
|
(P(!0),
|
|
(0, m.postPaySuccessMessage)(),
|
|
l.vipInfoStore.getState().syncVipInfo(),
|
|
!c &&
|
|
v.default.get("attractSourceId") &&
|
|
v.default.remove("attractSourceId"));
|
|
}, [R?.payStatus]);
|
|
let B = (0, r.useCallback)(async () => {
|
|
try {
|
|
if (i) {
|
|
let e = await (0, p.payResultInfo)(i?.tradeId),
|
|
t = e?.data;
|
|
N(t);
|
|
}
|
|
} catch (e) {
|
|
console.error("获取会员信息时发生错误:", e);
|
|
}
|
|
}, [i]);
|
|
(0, r.useEffect)(() => {
|
|
if (o) {
|
|
let e = setInterval(B, 5e3),
|
|
t = setInterval(() => O(!0), 1e3 * (i?.expireSeconds || 900));
|
|
return () => {
|
|
clearInterval(e), clearInterval(t);
|
|
};
|
|
}
|
|
}, [o, i, $, R?.expireSeconds]);
|
|
let D = (0, r.useCallback)(() => {
|
|
P(!0);
|
|
}, []),
|
|
{ wxPayConfig: H } = (0, l.useUserVipInfo)(),
|
|
z = (0, r.useMemo)(
|
|
() => (u?.type === 2 || u?.type === 3 || c) && H?.wxpay_open,
|
|
[u, c, H?.wxpay_open],
|
|
),
|
|
W = (0, r.useMemo)(() => {
|
|
if (u)
|
|
if (z) return "请扫码完成支付";
|
|
else return "请扫码完成支付";
|
|
}, [u]);
|
|
return (
|
|
(0, r.useMemo)(
|
|
() =>
|
|
u?.id === 16
|
|
? "专业版年包价格-剩余未下发基础版年包月数*基础版年包购买价格/12"
|
|
: u?.id === 25
|
|
? "训练高级会员年包价格-剩余未下发会员年包月数*会员年包购买价格/12"
|
|
: "",
|
|
[u],
|
|
),
|
|
(0, t.jsxs)(t.Fragment, {
|
|
children: [
|
|
(0, t.jsxs)("div", {
|
|
className: `${y.default.container}`,
|
|
children: [
|
|
(0, t.jsxs)("div", {
|
|
className: y.default.tabCode,
|
|
children: [
|
|
(0, t.jsxs)("div", {
|
|
className: y.default.qrCode,
|
|
style: { backgroundImage: `url(${g.default})` },
|
|
children: [
|
|
(0, t.jsx)(f.QRCodeSVG, {
|
|
className: y.default.qrCodeReal,
|
|
value: T,
|
|
size: 144,
|
|
bgColor: "#ffffff",
|
|
fgColor: "#000000",
|
|
}),
|
|
$ &&
|
|
(0, t.jsxs)("div", {
|
|
className: y.default.mask,
|
|
onClick: S,
|
|
children: [
|
|
(0, t.jsx)("img", {
|
|
src: a.STATIC_CDN_MAP["refresh.png"],
|
|
alt: "",
|
|
width: 24,
|
|
}),
|
|
(0, t.jsx)("span", { children: "请点击刷新" }),
|
|
],
|
|
}),
|
|
(0, t.jsx)(b.LoadingOverlay, {
|
|
visible: E,
|
|
overlayBlur: 2,
|
|
overlayOpacity: 0.3,
|
|
}),
|
|
],
|
|
}),
|
|
(0, t.jsxs)("div", {
|
|
className: y.default.qrCodeRight,
|
|
children: [
|
|
(0, t.jsxs)("div", {
|
|
className: y.default.RightAmount,
|
|
children: [
|
|
(0, t.jsx)("span", {
|
|
style: { fontSize: "24px" },
|
|
children: "¥",
|
|
}),
|
|
(0, t.jsx)("span", {
|
|
style: { fontSize: "32px" },
|
|
children: L,
|
|
}),
|
|
!c &&
|
|
(0, t.jsx)("span", {
|
|
className: "relative",
|
|
children: (0, t.jsxs)("span", {
|
|
className: `${y.default.discount} absolute`,
|
|
children: ["已减¥", A / 100],
|
|
}),
|
|
}),
|
|
],
|
|
}),
|
|
(0, t.jsxs)("div", {
|
|
className: y.default.qricon,
|
|
children: [
|
|
z &&
|
|
(0, t.jsx)("img", {
|
|
src: a.STATIC_CDN_MAP["wxpay.png"],
|
|
alt: "Icon",
|
|
}),
|
|
(0, t.jsx)("img", {
|
|
src: a.STATIC_CDN_MAP["zhifu.png"],
|
|
alt: "Icon",
|
|
width: 16,
|
|
height: 16,
|
|
className: "w-4 h-4",
|
|
}),
|
|
(0, t.jsx)("span", {
|
|
className:
|
|
"text-[var(--charge-qr-text,#787878)] text-[12px] font-normal opacity-60",
|
|
children: W,
|
|
}),
|
|
],
|
|
}),
|
|
],
|
|
}),
|
|
],
|
|
}),
|
|
(0, t.jsx)("div", { className: "flex-1" }),
|
|
(0, t.jsx)("div", {
|
|
className: y.default.qrtext,
|
|
children: (0, t.jsxs)(n.default, {
|
|
href: "https://www.liblib.art/document/vip_agreement",
|
|
target: "_blank",
|
|
children: [
|
|
(0, t.jsx)("span", {
|
|
className: y.default.qrlefttext,
|
|
children: "开通即代表同意",
|
|
}),
|
|
(0, t.jsx)("span", {
|
|
className: `${y.default.qrRightext}`,
|
|
children: "《LiblibAI会员协议》",
|
|
}),
|
|
],
|
|
}),
|
|
}),
|
|
],
|
|
}),
|
|
(0, t.jsx)(_.default, {
|
|
onClose: () => {
|
|
I({
|
|
t: 1,
|
|
e: "training.vip.pay.result.train.click",
|
|
page: 9,
|
|
var: {},
|
|
}),
|
|
P(!1),
|
|
h && h();
|
|
},
|
|
onOk: D,
|
|
open: j,
|
|
orderDetail: R,
|
|
isPower: c || !1,
|
|
goodsId: u?.id,
|
|
tradeId: R?.tradeId,
|
|
modelVersionUuid: x,
|
|
billingReferer: C,
|
|
isClient: w,
|
|
refer: 2,
|
|
}),
|
|
],
|
|
})
|
|
);
|
|
};
|
|
e.s(["default", 0, x], 501923);
|
|
var C = e.i(688891);
|
|
let E = (e) => {
|
|
let [t, n] = (0, r.useState)(!1),
|
|
[o, a] = (0, r.useState)({}),
|
|
[i, s] = (0, r.useState)(!1);
|
|
return (
|
|
(0, r.useEffect)(() => {
|
|
e?.tradeId && s(!1);
|
|
}, [e?.tradeId]),
|
|
(0, r.useEffect)(() => {
|
|
(o?.payStatus === 2 || o?.payStatus === 6) &&
|
|
(n(!0),
|
|
(0, m.postPaySuccessMessage)(),
|
|
l.vipInfoStore.getState().syncVipInfo());
|
|
}, [o?.payStatus]),
|
|
(0, r.useEffect)(() => {
|
|
if (e) {
|
|
let t = setInterval(async () => {
|
|
try {
|
|
let t = await (0, p.payResultInfo)(e?.tradeId),
|
|
r = t?.data;
|
|
a(r);
|
|
} catch (e) {
|
|
console.error("获取会员信息时发生错误:", e);
|
|
}
|
|
}, 5e3),
|
|
r = setTimeout(() => s(!0), 1e3 * (e?.expireSeconds || 900));
|
|
return () => {
|
|
clearInterval(t), clearTimeout(r);
|
|
};
|
|
}
|
|
}, [e]),
|
|
{ isPaymentSuccessful: t, showMask: i, orderDetail: o }
|
|
);
|
|
};
|
|
e.s(
|
|
[
|
|
"useOnlyPurchase",
|
|
0,
|
|
(e = { showErrorMessage: !0 }) => {
|
|
let { showErrorMessage: n } = e,
|
|
[o, i] = (0, r.useState)(),
|
|
[l, s] = (0, r.useState)(!1),
|
|
[c, d] = (0, r.useState)(),
|
|
f = (0, r.useCallback)(async (e) => {
|
|
if (e?.id)
|
|
try {
|
|
s(!0), d(e);
|
|
let t = await (0, p.getMemberPurchaseInfo)({
|
|
memPkgId: e?.id,
|
|
packageShopType: e.packageShopType,
|
|
var: {
|
|
pageUrl: location.href,
|
|
referer: window?.__NEXT_DATA__?.props?.referer,
|
|
},
|
|
}),
|
|
r = t.data;
|
|
r
|
|
? i(r)
|
|
: (i(void 0), n && h.message.error(`下单失败,${t.msg}`));
|
|
} catch (e) {
|
|
n && h.message.error(`下单失败,${e?.msg || "请稍后重试"}`),
|
|
i(void 0);
|
|
} finally {
|
|
s(!1);
|
|
}
|
|
else h.message.error("商品缺少参数");
|
|
}, []),
|
|
m = (0, r.useMemo)(
|
|
() =>
|
|
(0, t.jsx)(u.Modal, {
|
|
opened: !!o,
|
|
onClose: () => {},
|
|
closeOnEscape: !1,
|
|
centered: !0,
|
|
size: "auto",
|
|
withCloseButton: !1,
|
|
classNames: {
|
|
content: "!bg-[transparent] !shadow-none ",
|
|
body: "!px-10 !overflow-auto",
|
|
overlay: "backdrop-blur-[4px]",
|
|
},
|
|
children: (0, t.jsxs)("div", {
|
|
className: "px-10 bg-[white] rounded-lg pt-[26px] relative",
|
|
children: [
|
|
(0, t.jsx)("div", {
|
|
className: `${C.default.close} absolute right-2 top-2 z-10 cursor-pointer`,
|
|
onClick: () => i(void 0),
|
|
children: (0, t.jsx)("img", {
|
|
src: a.STATIC_CDN_MAP["close.png"],
|
|
alt: "",
|
|
width: 24,
|
|
}),
|
|
}),
|
|
(0, t.jsx)("div", {
|
|
className:
|
|
"flex items-center justify-center text-[16px] text-[#814600] font-[600]",
|
|
children: c?.name,
|
|
}),
|
|
o &&
|
|
(0, t.jsx)(x, {
|
|
closePaySuccessModel: () => i(void 0),
|
|
open: !0,
|
|
purchaseMemberDetail: o,
|
|
isUpgraded: !1,
|
|
goods: c,
|
|
showClose: !1,
|
|
isClient: !1,
|
|
isPower: !1,
|
|
modelVersionUuid: "-1",
|
|
billingReferer: -1,
|
|
loading: l,
|
|
requestReorder: () => c && f(c),
|
|
onClose: () => {},
|
|
}),
|
|
],
|
|
}),
|
|
}),
|
|
[o, c],
|
|
);
|
|
return {
|
|
handleOpenQRCodeModal: f,
|
|
purchaseMemberDetail: o,
|
|
purchaseHolder: m,
|
|
reorder: () => {
|
|
c && f(c);
|
|
},
|
|
};
|
|
},
|
|
"usePayStateHook",
|
|
0,
|
|
E,
|
|
],
|
|
431053,
|
|
);
|
|
var S = e.i(353023);
|
|
e.s(
|
|
[
|
|
"NewPayQrCodeModal",
|
|
0,
|
|
(e) => {
|
|
let {
|
|
targetSku: m,
|
|
purchaseMemberDetail: p,
|
|
onClose: h,
|
|
reorder: g,
|
|
modelVersionUuid: b,
|
|
billingReferer: v,
|
|
isPower: y = !1,
|
|
onPaymentSuccess: x,
|
|
onOpenPointsStore: C,
|
|
} = e,
|
|
{ isPaymentSuccessful: w, showMask: k, orderDetail: j } = E(p),
|
|
P = (0, r.useRef)(),
|
|
{ reportLevel: R, wxPayConfig: N } = (0, l.useUserVipInfo)(),
|
|
{ payText: $ } = (0, c.useSkuConvertHooks)(m),
|
|
{ isSupportWxpay: O } = (0, c.useSkuConvertHooks)(m),
|
|
T = (0, s.useReportLog)(),
|
|
{ reportAdData: M } = (0, o.useAdDataReportPayment)();
|
|
if (
|
|
((0, r.useEffect)(() => {
|
|
if (!w || !y || !x) return;
|
|
let e = j?.tradeId ?? p?.tradeId;
|
|
null == e || (P.current !== e && ((P.current = e), x()));
|
|
}, [w, y, x, j?.tradeId, p?.tradeId]),
|
|
(0, r.useEffect)(() => {
|
|
try {
|
|
T({
|
|
e: "training.billing.order.show",
|
|
var: {
|
|
vip_model_version_uuid: "",
|
|
train_billing_referer: v,
|
|
train_vip_level: R,
|
|
refer: 0,
|
|
pageUrl: location.href,
|
|
referer: window?.__NEXT_DATA__?.props?.referer,
|
|
source: "",
|
|
order_id: p?.tradeId,
|
|
tab_name: "lib",
|
|
sku_id: m.id,
|
|
sku_name: m.name,
|
|
sku_price: m.firstMonthPrice,
|
|
},
|
|
}),
|
|
M();
|
|
} catch (e) {
|
|
console.warn("埋点失败", e);
|
|
}
|
|
}, []),
|
|
m && p)
|
|
)
|
|
return (0, t.jsxs)(u.Modal, {
|
|
onClose: () => {
|
|
h();
|
|
},
|
|
opened: !0,
|
|
withCloseButton: !1,
|
|
centered: !0,
|
|
classNames: {
|
|
content:
|
|
"!bg-[transparent] shadow-none no-scrollbar !overflow-visible",
|
|
body: "px-10",
|
|
overlay: "backdrop-blur-[7px]",
|
|
},
|
|
trapFocus: !1,
|
|
zIndex: 601,
|
|
children: [
|
|
(0, t.jsxs)("div", {
|
|
className: `${S.default.membershipCard} bg-white dark:bg-[#212121]`,
|
|
children: [
|
|
(0, t.jsx)(i.VipCloseButton, { onClick: h }),
|
|
(0, t.jsxs)("span", {
|
|
className:
|
|
"text-[16px] text-[#303030] dark:text-white font-[600] text-shadow-2xs",
|
|
children: [
|
|
m.name,
|
|
1 === m.isCustom && m.attr?.totalPower
|
|
? ` ${m.attr.totalPower.toLocaleString("zh-CN")}积分`
|
|
: "",
|
|
],
|
|
}),
|
|
(0, t.jsxs)("div", {
|
|
className: "flex items-baseline mt-8 mb-4",
|
|
children: [
|
|
(0, t.jsxs)("p", {
|
|
className: `${S.default.paymentMethod} text-[#424242] dark:text-[#999]`,
|
|
children: [
|
|
(2 === m.type || 3 === m.type) &&
|
|
O &&
|
|
N?.wxpay_open &&
|
|
(0, t.jsx)("img", {
|
|
src: a.STATIC_CDN_MAP["wxpay.png"],
|
|
alt: "Icon",
|
|
className: "w-3 h-3 mr-[2px]",
|
|
}),
|
|
(0, t.jsx)("img", {
|
|
src: a.STATIC_CDN_MAP["zhifu.png"],
|
|
alt: "Icon",
|
|
className: "w-3 h-3 mr-[2px]",
|
|
}),
|
|
$,
|
|
],
|
|
}),
|
|
(0, t.jsxs)("span", {
|
|
className: `${S.default.price} text-[#1f6dff] dark:text-[#09CAF5]`,
|
|
children: ["¥", (0, d.default)(p.payAmount, 100)],
|
|
}),
|
|
],
|
|
}),
|
|
(0, t.jsxs)("div", {
|
|
className: S.default.qrCode,
|
|
children: [
|
|
(0, t.jsx)(f.QRCodeSVG, {
|
|
className: S.default.qrCodeReal,
|
|
value: p?.payUrl,
|
|
size: 148,
|
|
}),
|
|
k &&
|
|
(0, t.jsxs)("div", {
|
|
className: S.default.mask,
|
|
onClick: g,
|
|
children: [
|
|
(0, t.jsx)("img", {
|
|
src: a.STATIC_CDN_MAP["refresh.png"],
|
|
alt: "",
|
|
width: 24,
|
|
}),
|
|
(0, t.jsx)("span", { children: "请点击刷新" }),
|
|
],
|
|
}),
|
|
],
|
|
}),
|
|
(0, t.jsx)("div", {
|
|
className: `${S.default.qrtext} text-[#787878] dark:text-[#999] bg-[#f8f8f8] dark:bg-[#363636]`,
|
|
children: (0, t.jsxs)(n.default, {
|
|
href: "https://www.liblib.art/document/vip_agreement",
|
|
target: "_blank",
|
|
children: [
|
|
(0, t.jsx)("span", { children: "开通即代表同意" }),
|
|
(0, t.jsx)("span", {
|
|
className: `${S.default.qrRightext} text-[#303030] dark:text-white hover:text-[#0d0d0d] dark:hover:text-[#ccc]`,
|
|
children: "《LiblibAI会员协议》",
|
|
}),
|
|
],
|
|
}),
|
|
}),
|
|
],
|
|
}),
|
|
w &&
|
|
(0, t.jsx)(_.default, {
|
|
onClose: h,
|
|
onOk: h,
|
|
open: w,
|
|
orderDetail: j,
|
|
isPower: y,
|
|
goodsId: -1,
|
|
refer: 0,
|
|
tradeId: j?.tradeId,
|
|
modelVersionUuid: b,
|
|
billingReferer: v,
|
|
membershipDisplayName:
|
|
1 === m.isCustom && m.attr?.totalPower
|
|
? `${m.attr.totalPower.toLocaleString("zh-CN")}积分`
|
|
: void 0,
|
|
}),
|
|
],
|
|
});
|
|
},
|
|
],
|
|
254779,
|
|
);
|
|
};
|
|
|
|
export default moduleFactory;
|