- 页面顶部添加限时特惠横幅,提示当前为特价 - 每个套餐卡片增加"特惠价"徽章 - 价格区域增加折扣百分比标签和涨价提示 - 中英文 i18n 键补全 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 lines
3.3 KiB
JavaScript
2 lines
3.3 KiB
JavaScript
import{r as n,f as p,j as e}from"./index-DFuC01Yj.js";import{u as h}from"./useTranslation-BEbHB0KC.js";function b(){const{t:s}=h(),[l,i]=n.useState([]),[a,d]=n.useState(""),[c,o]=n.useState(!0);n.useEffect(()=>{p().then(t=>{t.data.success&&i(t.data.data||[])}).catch(()=>{}).finally(()=>o(!1))},[]);const r=l.filter(t=>t.enabled!==!1).filter(t=>!a||(t.display_name||t.model_name||"").toLowerCase().includes(a.toLowerCase()));return c?e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h1",{className:"text-3xl font-heading font-bold text-page mb-3",children:s("pricing.title")}),e.jsx("p",{className:"text-page-secondary max-w-xl mx-auto",children:s("pricing.subtitle")})]}),e.jsx("div",{className:"max-w-md mx-auto mb-8",children:e.jsxs("div",{className:"relative",children:[e.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-page-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("input",{type:"text",value:a,onChange:t=>d(t.target.value),className:"input !pl-10",placeholder:s("pricing.searchPlaceholder")})]})}),r.length===0?e.jsx("div",{className:"text-center py-12 text-page-secondary",children:s(a?"pricing.noMatch":"pricing.noModels")}):e.jsx("div",{className:"glass-sm rounded-xl overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/[0.06]",children:[e.jsx("th",{className:"text-left px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.model")}),e.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.inputPrice")}),e.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.outputPrice")}),e.jsx("th",{className:"text-center px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.status")})]})}),e.jsx("tbody",{children:r.map((t,x)=>e.jsxs("tr",{className:"border-b border-white/[0.04] last:border-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-5 py-3.5",children:e.jsx("span",{className:"font-mono text-page",children:t.display_name||t.model_name})}),e.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:t.input_price!=null?`$${(Number(t.input_price)*1e3).toFixed(4)}`:"-"}),e.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:t.output_price!=null?`$${(Number(t.output_price)*1e3).toFixed(4)}`:"-"}),e.jsx("td",{className:"px-5 py-3.5 text-center",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs border ${t.status==="healthy"?"bg-green-500/10 text-green-400 border-green-500/20":"bg-neutral-500/10 text-page-secondary border-neutral-500/20"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t.status==="healthy"?"bg-green-500":"bg-neutral-500"}`}),t.status==="healthy"?s("pricing.online"):s("pricing.unknown")]})})]},t.model_name||x))})]})})]})}export{b as default};
|