3 lines
13 KiB
JavaScript
3 lines
13 KiB
JavaScript
module.exports=[16201,a=>{"use strict";let b=(0,a.i(70106).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"}]]);a.s(["CheckCircle",()=>b],16201)},4720,a=>{"use strict";let b=(0,a.i(70106).default)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);a.s(["FileText",()=>b],4720)},69520,a=>{"use strict";let b=(0,a.i(70106).default)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);a.s(["RefreshCw",()=>b],69520)},58011,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(78310),e=a.i(4720),f=a.i(70106);let g=(0,f.default)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),h=(0,f.default)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var i=a.i(16201);let j=(0,f.default)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),k=(0,f.default)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var l=a.i(69520);function m(){let[a,f]=(0,c.useState)(!1),[m,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(0),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)([]),[u,v]=(0,c.useState)(null),[w,x]=(0,c.useState)(!1),y=(0,c.useRef)(null),z=(0,c.useMemo)(()=>(function(){let a=[{path:"/",title:"首页",subtitle:"应用主入口",caption:"首页是用户进入应用的第一个页面,展示书籍封面、简介、目录预览和购买入口。用户可以快速了解内容概要并进行购买决策。",group:"核心页面",order:1},{path:"/chapters",title:"目录页",subtitle:"章节浏览与导航",caption:"目录页展示全书的完整章节结构,用户可以浏览各篇、各章内容,查看已解锁和待解锁章节,并快速跳转到阅读页面。",group:"核心页面",order:2},{path:"/about",title:"关于页面",subtitle:"作者与产品介绍",caption:"关于页面展示作者信息、产品理念、运营数据等,帮助用户建立对内容的信任和理解。",group:"核心页面",order:3},{path:"/my",title:"个人中心",subtitle:"用户账户入口",caption:"个人中心聚合用户的账户信息、购买记录、分销收益等功能入口,是用户管理个人信息的核心页面。",group:"用户中心",order:4},{path:"/my/purchases",title:"我的购买",subtitle:"已购内容管理",caption:"展示用户已购买的所有章节,包括购买时间、解锁进度,用户可快速跳转到已购内容继续阅读。",group:"用户中心",order:5},{path:"/my/settings",title:"账户设置",subtitle:"个人信息配置",caption:"用户可在此页面管理个人基础信息、通知偏好、隐私设置等账户相关配置。",group:"用户中心",order:6},{path:"/my/referral",title:"分销中心",subtitle:"邀请与收益管理",caption:"分销中心展示用户的专属邀请链接、邀请人数统计、收益明细,支持一键分享到朋友圈或Soul派对。",group:"用户中心",order:7},{path:"/admin/login",title:"后台登录",subtitle:"管理员入口",caption:"管理后台的登录页面,管理员通过账号密码验证后进入管理系统。",group:"管理后台",order:8},{path:"/admin",title:"后台管理",subtitle:"系统配置中心",caption:"管理后台的核心页面,包含数据概览、内容管理、用户管理、支付配置、二维码管理、系统设置等功能模块。",group:"管理后台",order:9},{path:"/docs",title:"开发文档",subtitle:"技术与配置说明",caption:"面向开发者和运营人员的技术文档,包含支付接口配置说明、分销规则详解、提现流程等内容。",group:"运营支持",order:10}],b=function(){let a=[];for(let b of(a.push({id:d.specialSections.preface.id,title:d.specialSections.preface.title,group:"阅读页面"}),d.bookData)){let c=b.chapters[0],d=c?.sections?.[0];d&&a.push({id:d.id,title:`${b.number} ${b.title}|${d.title}`,group:"阅读页面"})}for(let b of["9.11","9.10","9.9"]){let c=d.bookData.flatMap(a=>a.chapters).flatMap(a=>a.sections).find(a=>a.id===b);c&&a.push({id:c.id,title:c.title,group:"阅读页面"})}let b=new Set;return a.filter(a=>!b.has(a.id)&&(b.add(a.id),!0))}();for(let c=0;c<b.length;c++){let d=b[c];a.push({path:`/read/${encodeURIComponent(d.id)}`,title:d.title,subtitle:"章节阅读",caption:"阅读页面展示章节的完整内容,未购买用户可预览部分内容,付费墙引导购买解锁全文。",group:d.group,waitForSelector:"main",order:100+c})}return a.sort((a,b)=>(a.order||999)-(b.order||999))})(),[]),A=(0,c.useMemo)(()=>{let a={};for(let b of z)a[b.group]||(a[b.group]=[]),a[b.group].push(b);return a},[z]);(0,c.useEffect)(()=>{t(z.map(a=>({page:a,status:"pending"})))},[z]);let B=async()=>{n(null),f(!0),p(0),r(null),t(z.map(a=>({page:a,status:"loading"})));try{let a=0,b=setInterval(()=>{a+=2;let b=Math.floor(a/100*z.length),c=z[Math.min(b,z.length-1)];c&&r(c.title),p(Math.min(a,90)),t(a=>a.map((a,c)=>({...a,status:c<b?"success":c===b?"loading":"pending"})))},800),c=new URLSearchParams(window.location.search).get("token")||"",d=await fetch(`/api/documentation/generate${c?`?token=${c}`:""}`,{method:"POST",headers:{"Content-Type":"application/json",...c?{"x-documentation-token":c}:{}}});if(clearInterval(b),!d.ok){let a=await d.text().catch(()=>""),b=`生成失败(${d.status})`;try{b=JSON.parse(a).error||b}catch{a&&(b=a)}throw Error(b)}p(100),r("完成"),t(z.map(a=>({page:a,status:"success"})));let e=await d.blob(),f=URL.createObjectURL(e),g=document.createElement("a");g.href=f,g.download=`应用功能文档_${new Date().toISOString().slice(0,10)}.docx`,document.body.appendChild(g),g.click(),g.remove(),URL.revokeObjectURL(f)}catch(a){n(a instanceof Error?a.message:String(a)),t(a=>a.map(a=>({...a,status:"error"})))}finally{f(!1)}},C=(0,c.useCallback)(a=>{v(a),x(!0)},[]);return(0,b.jsxs)("main",{className:"min-h-screen bg-background text-foreground p-4 pb-24",children:[(0,b.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 py-2",children:[(0,b.jsx)(e.FileText,{className:"w-6 h-6 text-teal-400"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-lg font-semibold",children:"文档生成器"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"自动截图并导出专业文档"})]})]}),(0,b.jsxs)("div",{className:"bg-card border border-border rounded-xl p-4 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"页面总数"}),(0,b.jsxs)("span",{className:"font-medium text-teal-400",children:[z.length," 个"]})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"分组数量"}),(0,b.jsxs)("span",{className:"font-medium",children:[Object.keys(A).length," 组"]})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"输出格式"}),(0,b.jsx)("span",{className:"font-medium",children:"Word (.docx)"})]})]}),a&&(0,b.jsxs)("div",{className:"bg-card border border-border rounded-xl p-4 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"生成进度"}),(0,b.jsxs)("span",{className:"font-medium text-teal-400",children:[Math.round(o),"%"]})]}),(0,b.jsx)("div",{className:"w-full h-2 bg-muted rounded-full overflow-hidden",children:(0,b.jsx)("div",{className:"h-full bg-gradient-to-r from-teal-500 to-cyan-400 transition-all duration-300",style:{width:`${o}%`}})}),q&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground truncate",children:["正在处理: ",q]})]}),m&&(0,b.jsxs)("div",{className:"bg-destructive/10 border border-destructive/30 text-destructive rounded-xl p-3 text-sm",children:[(0,b.jsx)("p",{className:"font-medium mb-1",children:"生成失败"}),(0,b.jsx)("p",{className:"text-xs opacity-80",children:m}),(0,b.jsx)("p",{className:"text-xs mt-2 opacity-60",children:"提示: 如需授权,请在URL中添加 ?token=your_token"})]}),(0,b.jsx)("button",{type:"button",onClick:B,disabled:a,className:"w-full bg-gradient-to-r from-teal-500 to-cyan-500 text-white rounded-xl py-3.5 font-medium disabled:opacity-60 flex items-center justify-center gap-2 shadow-lg shadow-teal-500/20",children:a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h,{className:"w-5 h-5 animate-spin"}),(0,b.jsx)("span",{children:"正在生成文档..."})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g,{className:"w-5 h-5"}),(0,b.jsx)("span",{children:"一键生成 Word 文档"})]})}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("h2",{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[(0,b.jsx)("span",{children:"文档目录预览"}),(0,b.jsxs)("span",{className:"text-xs opacity-60",children:["(",z.length,"个页面)"]})]}),Object.entries(A).map(([a,c])=>(0,b.jsxs)("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:[(0,b.jsx)("div",{className:"px-3 py-2 bg-muted/50 border-b border-border",children:(0,b.jsx)("h3",{className:"text-sm font-medium text-teal-400",children:a})}),(0,b.jsx)("div",{className:"divide-y divide-border",children:c.map((a,c)=>{let d=s.find(b=>b.page.path===a.path);return(0,b.jsxs)("div",{className:"px-3 py-2.5 flex items-center gap-3 hover:bg-muted/30 transition-colors",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground w-5",children:c+1}),d&&(a=>{switch(a){case"pending":return(0,b.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-600"});case"loading":return(0,b.jsx)(h,{className:"w-4 h-4 animate-spin text-teal-400"});case"success":return(0,b.jsx)(i.CheckCircle,{className:"w-4 h-4 text-green-500"});case"error":return(0,b.jsx)(j,{className:"w-4 h-4 text-red-500"})}})(d.status),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:"text-sm font-medium truncate",children:a.title}),a.subtitle&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.subtitle})]}),(0,b.jsx)("button",{type:"button",onClick:()=>C(a.path),className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded-lg transition-colors",title:"预览页面",children:(0,b.jsx)(k,{className:"w-4 h-4"})})]},a.path)})})]},a))]}),(0,b.jsxs)("div",{className:"bg-card border border-border rounded-xl p-4 space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"文档包含内容"}),(0,b.jsxs)("ul",{className:"text-xs text-muted-foreground space-y-2",children:[(0,b.jsxs)("li",{className:"flex items-start gap-2",children:[(0,b.jsx)(i.CheckCircle,{className:"w-4 h-4 text-green-500 flex-shrink-0 mt-0.5"}),(0,b.jsx)("span",{children:"自动生成的目录结构"})]}),(0,b.jsxs)("li",{className:"flex items-start gap-2",children:[(0,b.jsx)(i.CheckCircle,{className:"w-4 h-4 text-green-500 flex-shrink-0 mt-0.5"}),(0,b.jsx)("span",{children:"所有页面的真实截图(iPhone 14 Pro Max尺寸)"})]}),(0,b.jsxs)("li",{className:"flex items-start gap-2",children:[(0,b.jsx)(i.CheckCircle,{className:"w-4 h-4 text-green-500 flex-shrink-0 mt-0.5"}),(0,b.jsx)("span",{children:"每个页面的功能说明与路径"})]}),(0,b.jsxs)("li",{className:"flex items-start gap-2",children:[(0,b.jsx)(i.CheckCircle,{className:"w-4 h-4 text-green-500 flex-shrink-0 mt-0.5"}),(0,b.jsx)("span",{children:"按功能模块分组整理"})]})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:"生成过程需要30-60秒,请耐心等待"})]}),w&&u&&(0,b.jsx)("div",{className:"fixed inset-0 bg-black/80 z-50 flex items-center justify-center p-4",children:(0,b.jsxs)("div",{className:"bg-card rounded-2xl w-full max-w-md overflow-hidden border border-border",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,b.jsx)("h3",{className:"font-medium text-sm",children:"页面预览"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("button",{type:"button",onClick:()=>y.current?.contentWindow?.location.reload(),className:"p-1.5 text-muted-foreground hover:text-foreground rounded-lg",children:(0,b.jsx)(l.RefreshCw,{className:"w-4 h-4"})}),(0,b.jsx)("button",{type:"button",onClick:()=>x(!1),className:"p-1.5 text-muted-foreground hover:text-foreground rounded-lg",children:(0,b.jsx)(j,{className:"w-4 h-4"})})]})]}),(0,b.jsx)("div",{className:"w-full aspect-[430/932] bg-white",children:(0,b.jsx)("iframe",{ref:y,src:u,className:"w-full h-full",title:"Page Preview"})})]})})]})}a.s(["default",()=>m],58011)}];
|
||
|
||
//# sourceMappingURL=_00961d02._.js.map
|