1 line
4.4 KiB
JavaScript
1 line
4.4 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10980,e=>{"use strict";let s=(0,e.i(75254).default)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);e.s(["BookOpen",()=>s],10980)},69638,e=>{"use strict";let s=(0,e.i(75254).default)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);e.s(["CheckCircle",()=>s],69638)},73375,e=>{"use strict";let s=(0,e.i(75254).default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>s],73375)},11724,e=>{"use strict";var s=e.i(43476),t=e.i(22016),a=e.i(73375),l=e.i(10980),r=e.i(69638),c=e.i(4421),i=e.i(98400);function d(){let{user:e,isLoggedIn:d}=(0,c.useStore)();if(!d||!e)return(0,s.jsx)("div",{className:"min-h-screen bg-[#0a1628] text-white flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("p",{className:"text-gray-400 mb-4",children:"请先登录"}),(0,s.jsx)(t.default,{href:"/",className:"text-[#38bdac] hover:underline",children:"返回首页"})]})});let n=(0,i.getAllSections)(),x=e.hasFullBook?n.length:e.purchasedSections.length;return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a1628] text-white",children:[(0,s.jsx)("header",{className:"sticky top-0 z-50 bg-[#0a1628]/90 backdrop-blur-md border-b border-gray-800",children:(0,s.jsxs)("div",{className:"max-w-4xl mx-auto px-4 py-4 flex items-center",children:[(0,s.jsxs)(t.default,{href:"/",className:"flex items-center gap-2 text-gray-400 hover:text-white transition-colors",children:[(0,s.jsx)(a.ChevronLeft,{className:"w-5 h-5"}),(0,s.jsx)("span",{children:"返回"})]}),(0,s.jsx)("h1",{className:"flex-1 text-center text-lg font-semibold",children:"我的购买"}),(0,s.jsx)("div",{className:"w-16"})]})}),(0,s.jsxs)("main",{className:"max-w-4xl mx-auto px-4 py-8",children:[(0,s.jsx)("div",{className:"bg-[#0f2137]/60 backdrop-blur-md rounded-xl p-6 border border-gray-700/50 mb-8",children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("p",{className:"text-3xl font-bold text-white",children:x}),(0,s.jsx)("p",{className:"text-gray-400 text-sm",children:"已购买章节"})]}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("p",{className:"text-3xl font-bold text-[#38bdac]",children:e.hasFullBook?"全书":`${x}/${n.length}`}),(0,s.jsx)("p",{className:"text-gray-400 text-sm",children:e.hasFullBook?"已解锁":"进度"})]})]})}),e.hasFullBook?(0,s.jsxs)("div",{className:"bg-gradient-to-r from-[#38bdac]/20 to-[#0f2137] rounded-xl p-6 border border-[#38bdac]/30 text-center mb-8",children:[(0,s.jsx)(r.CheckCircle,{className:"w-12 h-12 text-[#38bdac] mx-auto mb-3"}),(0,s.jsx)("h3",{className:"text-xl font-semibold text-white mb-2",children:"您已购买整本书"}),(0,s.jsx)("p",{className:"text-gray-400",children:"全部55节内容已解锁,可随时阅读"})]}):0===e.purchasedSections.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)(l.BookOpen,{className:"w-16 h-16 text-gray-600 mx-auto mb-4"}),(0,s.jsx)("p",{className:"text-gray-400 mb-4",children:"您还没有购买任何章节"}),(0,s.jsx)(t.default,{href:"/chapters",className:"text-[#38bdac] hover:underline",children:"去浏览章节"})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("h2",{className:"text-gray-400 text-sm mb-4",children:"已购买的章节"}),i.bookData.map(a=>{let l=a.chapters.flatMap(s=>s.sections.filter(s=>e.purchasedSections.includes(s.id)));return 0===l.length?null:(0,s.jsxs)("div",{className:"bg-[#0f2137]/40 rounded-xl border border-gray-800/50 overflow-hidden",children:[(0,s.jsx)("div",{className:"px-4 py-3 bg-[#0a1628]/50",children:(0,s.jsx)("p",{className:"text-gray-400 text-sm",children:a.title})}),(0,s.jsx)("div",{className:"divide-y divide-gray-800/30",children:l.map(e=>(0,s.jsxs)(t.default,{href:`/read/${e.id}`,className:"flex items-center gap-3 px-4 py-3 hover:bg-[#0f2137]/40 transition-colors",children:[(0,s.jsx)(r.CheckCircle,{className:"w-4 h-4 text-[#38bdac]"}),(0,s.jsx)("span",{className:"text-gray-400 font-mono text-sm",children:e.id}),(0,s.jsx)("span",{className:"text-gray-300",children:e.title})]},e.id))})]},a.id)})]})]})]})}e.s(["default",()=>d])}]); |