1 line
5.2 KiB
JavaScript
1 line
5.2 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10980,e=>{"use strict";let t=(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",()=>t],10980)},70065,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(47163);let r=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)("div",{ref:r,className:(0,a.cn)("rounded-xl border bg-card text-card-foreground shadow",e),...s}));r.displayName="Card";let l=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)("div",{ref:r,className:(0,a.cn)("flex flex-col space-y-1.5 p-6",e),...s}));l.displayName="CardHeader";let i=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)("h3",{ref:r,className:(0,a.cn)("font-semibold leading-none tracking-tight",e),...s}));i.displayName="CardTitle";let d=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)("p",{ref:r,className:(0,a.cn)("text-sm text-muted-foreground",e),...s}));d.displayName="CardDescription";let c=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)("div",{ref:r,className:(0,a.cn)("p-6 pt-0",e),...s}));c.displayName="CardContent",s.forwardRef(({className:e,...s},r)=>(0,t.jsx)("div",{ref:r,className:(0,a.cn)("flex items-center p-6 pt-0",e),...s})).displayName="CardFooter",e.s(["Card",()=>r,"CardContent",()=>c,"CardDescription",()=>d,"CardHeader",()=>l,"CardTitle",()=>i])},25652,e=>{"use strict";let t=(0,e.i(75254).default)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);e.s(["TrendingUp",()=>t],25652)},50965,e=>{"use strict";let t=(0,e.i(75254).default)("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);e.s(["ShoppingBag",()=>t],50965)},23261,e=>{"use strict";var t=e.i(43476),s=e.i(70065),a=e.i(4421),r=e.i(61911),l=e.i(10980),i=e.i(50965),d=e.i(25652);function c(){let{getAllUsers:e,getAllPurchases:c}=(0,a.useStore)(),n=e(),x=c(),o=x.reduce((e,t)=>e+t.amount,0),m=n.length,h=x.length,p=[{title:"总用户数",value:m,icon:r.Users,color:"text-blue-500"},{title:"总收入",value:`\xa5${o.toFixed(2)}`,icon:d.TrendingUp,color:"text-green-500"},{title:"订单数",value:h,icon:i.ShoppingBag,color:"text-purple-500"},{title:"转化率",value:`${m>0?(h/m*100).toFixed(1):0}%`,icon:l.BookOpen,color:"text-orange-500"}];return(0,t.jsxs)("div",{className:"p-8 max-w-7xl mx-auto text-white",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold mb-8",children:"数据概览"}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:p.map((e,a)=>(0,t.jsxs)(s.Card,{className:"bg-[#1e293b] border-gray-700",children:[(0,t.jsxs)(s.CardHeader,{className:"flex flex-row items-center justify-between pb-2",children:[(0,t.jsx)(s.CardTitle,{className:"text-sm font-medium text-gray-400",children:e.title}),(0,t.jsx)(e.icon,{className:`w-4 h-4 ${e.color}`})]}),(0,t.jsx)(s.CardContent,{children:(0,t.jsx)("div",{className:"text-2xl font-bold text-white",children:e.value})})]},a))}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,t.jsxs)(s.Card,{className:"bg-[#1e293b] border-gray-700",children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsx)(s.CardTitle,{className:"text-white",children:"最近订单"})}),(0,t.jsx)(s.CardContent,{children:(0,t.jsxs)("div",{className:"space-y-4",children:[x.slice(-5).reverse().map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 bg-[#0f172a] rounded-lg",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-white",children:e.sectionTitle||"整本购买"}),(0,t.jsx)("p",{className:"text-xs text-gray-400",children:new Date(e.createdAt).toLocaleString()})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsxs)("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",e.amount]}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:e.paymentMethod})]})]},e.id)),0===x.length&&(0,t.jsx)("p",{className:"text-gray-500 text-center py-4",children:"暂无订单数据"})]})})]}),(0,t.jsxs)(s.Card,{className:"bg-[#1e293b] border-gray-700",children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsx)(s.CardTitle,{className:"text-white",children:"新注册用户"})}),(0,t.jsx)(s.CardContent,{children:(0,t.jsxs)("div",{className:"space-y-4",children:[n.slice(-5).reverse().map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 bg-[#0f172a] rounded-lg",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center text-xs",children:e.nickname.charAt(0)}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-white",children:e.nickname}),(0,t.jsx)("p",{className:"text-xs text-gray-400",children:e.phone})]})]}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:new Date(e.createdAt).toLocaleDateString()})]},e.id)),0===n.length&&(0,t.jsx)("p",{className:"text-gray-500 text-center py-4",children:"暂无用户数据"})]})})]})]})]})}e.s(["default",()=>c])}]); |