Files
Sub-Router/dist/assets/Home-zDwhMuTN.js
T
abingyydsandClaude Sonnet 4.6 b27fa4df53 fix: 修复官方等价对比 pattern 无法匹配后端 model_name 的问题
- Pattern 改为匹配后端实际格式(如 claude-opus-4-5 而非 claude-4.5-opus)
- 确保更具体的 pattern 排在前面,避免 Opus 4.5 误匹配到 Opus 4 的 $15 官方价
- 补充更多模型:GPT-4.1 Mini/Nano、Gemini Flash Lite、DeepSeek R1/V3 等

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 17:41:01 +09:00

2 lines
8.4 KiB
JavaScript

import{u as p,a as y,r as d,f as N,l as v,j as e,L as a,Q as f}from"./index-D8eKls75.js";import{c as w,R as M}from"./RotatingEquiv-DkCC_t4y.js";import{C as c}from"./CountUp-BixuEoA6.js";import{F as l}from"./FadeContent-B3Mc1Ysf.js";import{u as k}from"./useTranslation-D_OVvIX9.js";function q(){const{t}=k(),{user:i}=p(),{site:n}=y(),[u,g]=d.useState([]),[x,b]=d.useState([]);d.useEffect(()=>{N().then(s=>{s.data.success&&g(s.data.data||[])}).catch(()=>{}),v().then(s=>{s.data.success&&b(s.data.data||[])}).catch(()=>{})},[]);const r=u.filter(s=>s.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(l,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("p",{className:"text-sm font-medium text-blue-600 mb-4 tracking-wide",children:t("home.heroTagline")||"AI API Platform"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-gray-900 leading-[1.1] tracking-tight",children:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-gray-500 mt-6 leading-relaxed max-w-xl mx-auto",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:i?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:t("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-gray-500 font-medium text-sm hover:text-gray-900 transition-colors",children:[t("home.viewPricing")," →"]})]})})]})}),e.jsx(l,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"grid grid-cols-3 gap-8 max-w-lg mx-auto mt-20 pt-10 border-t border-gray-100",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(c,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:t("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-3",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-gray-500",children:t("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc"),color:"blue",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc"),color:"indigo",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc"),color:"emerald",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((s,o)=>e.jsxs("div",{className:"p-6 rounded-xl border border-gray-100 hover:border-gray-200 hover:shadow-sm transition-all",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg bg-${s.color}-50 text-${s.color}-600 flex items-center justify-center mb-4`,children:s.icon}),e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:s.desc})]},o))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-2",children:t("home.availableModels")}),e.jsx("p",{className:"text-gray-500",children:t("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(a,{to:"/pricing",className:"text-sm text-blue-600 hover:text-blue-700 transition-colors",children:[t("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((s,o)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-gray-100 hover:border-gray-200 transition-colors",children:e.jsx("span",{className:"text-sm text-gray-600 font-mono",children:s.display_name||s.model_name})},s.id||o))})]})}),x.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-gray-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map((s,o)=>{const j=s.quota_amount>0?s.quota_amount/f:0,m=w(r,j);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-all ${o===1?"border-blue-200 bg-blue-50/50 shadow-sm":"border-gray-100 hover:border-gray-200"}`,children:[o===1&&e.jsx("span",{className:"text-xs text-blue-600 font-semibold mb-2 uppercase tracking-wider",children:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-gray-900",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-gray-900",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-gray-500 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["🔥 ",e.jsx(M,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.equivDollars})})]}),e.jsx(a,{to:i?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${o===1?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:t(i?"home.subscribe":"home.getStarted")})]},s.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(l,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-gray-100 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-3",children:t("home.readyToStart")}),e.jsx("p",{className:"text-gray-500 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[t("home.createFreeAccount")," →"]}),e.jsx(a,{to:"/login",className:"px-7 py-3 text-gray-500 font-medium text-sm hover:text-gray-900 transition-colors",children:t("home.signIn")})]})})]})})})]})}export{q as default};