3 lines
5.2 KiB
JavaScript
3 lines
5.2 KiB
JavaScript
module.exports=[53722,a=>{"use strict";let b=(0,a.i(70106).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"}]]);a.s(["BookOpen",()=>b],53722)},3130,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(97895);let e=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("div",{ref:e,className:(0,d.cn)("rounded-xl border bg-card text-card-foreground shadow",a),...c}));e.displayName="Card";let f=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("div",{ref:e,className:(0,d.cn)("flex flex-col space-y-1.5 p-6",a),...c}));f.displayName="CardHeader";let g=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("h3",{ref:e,className:(0,d.cn)("font-semibold leading-none tracking-tight",a),...c}));g.displayName="CardTitle";let h=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("p",{ref:e,className:(0,d.cn)("text-sm text-muted-foreground",a),...c}));h.displayName="CardDescription";let i=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("div",{ref:e,className:(0,d.cn)("p-6 pt-0",a),...c}));i.displayName="CardContent",c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("div",{ref:e,className:(0,d.cn)("flex items-center p-6 pt-0",a),...c})).displayName="CardFooter",a.s(["Card",()=>e,"CardContent",()=>i,"CardDescription",()=>h,"CardHeader",()=>f,"CardTitle",()=>g])},24669,a=>{"use strict";let b=(0,a.i(70106).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"}]]);a.s(["TrendingUp",()=>b],24669)},40784,a=>{"use strict";let b=(0,a.i(70106).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"}]]);a.s(["ShoppingBag",()=>b],40784)},37079,a=>{"use strict";var b=a.i(87924),c=a.i(3130),d=a.i(68515),e=a.i(60246),f=a.i(53722),g=a.i(40784),h=a.i(24669);function i(){let{getAllUsers:a,getAllPurchases:i}=(0,d.useStore)(),j=a(),k=i(),l=k.reduce((a,b)=>a+b.amount,0),m=j.length,n=k.length,o=[{title:"总用户数",value:m,icon:e.Users,color:"text-blue-500"},{title:"总收入",value:`\xa5${l.toFixed(2)}`,icon:h.TrendingUp,color:"text-green-500"},{title:"订单数",value:n,icon:g.ShoppingBag,color:"text-purple-500"},{title:"转化率",value:`${m>0?(n/m*100).toFixed(1):0}%`,icon:f.BookOpen,color:"text-orange-500"}];return(0,b.jsxs)("div",{className:"p-8 max-w-7xl mx-auto text-white",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold mb-8",children:"数据概览"}),(0,b.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:o.map((a,d)=>(0,b.jsxs)(c.Card,{className:"bg-[#1e293b] border-gray-700",children:[(0,b.jsxs)(c.CardHeader,{className:"flex flex-row items-center justify-between pb-2",children:[(0,b.jsx)(c.CardTitle,{className:"text-sm font-medium text-gray-400",children:a.title}),(0,b.jsx)(a.icon,{className:`w-4 h-4 ${a.color}`})]}),(0,b.jsx)(c.CardContent,{children:(0,b.jsx)("div",{className:"text-2xl font-bold text-white",children:a.value})})]},d))}),(0,b.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,b.jsxs)(c.Card,{className:"bg-[#1e293b] border-gray-700",children:[(0,b.jsx)(c.CardHeader,{children:(0,b.jsx)(c.CardTitle,{className:"text-white",children:"最近订单"})}),(0,b.jsx)(c.CardContent,{children:(0,b.jsxs)("div",{className:"space-y-4",children:[k.slice(-5).reverse().map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between p-4 bg-[#0f172a] rounded-lg",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-white",children:a.sectionTitle||"整本购买"}),(0,b.jsx)("p",{className:"text-xs text-gray-400",children:new Date(a.createdAt).toLocaleString()})]}),(0,b.jsxs)("div",{className:"text-right",children:[(0,b.jsxs)("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",a.amount]}),(0,b.jsx)("p",{className:"text-xs text-gray-500",children:a.paymentMethod})]})]},a.id)),0===k.length&&(0,b.jsx)("p",{className:"text-gray-500 text-center py-4",children:"暂无订单数据"})]})})]}),(0,b.jsxs)(c.Card,{className:"bg-[#1e293b] border-gray-700",children:[(0,b.jsx)(c.CardHeader,{children:(0,b.jsx)(c.CardTitle,{className:"text-white",children:"新注册用户"})}),(0,b.jsx)(c.CardContent,{children:(0,b.jsxs)("div",{className:"space-y-4",children:[j.slice(-5).reverse().map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between p-4 bg-[#0f172a] rounded-lg",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center text-xs",children:a.nickname.charAt(0)}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-white",children:a.nickname}),(0,b.jsx)("p",{className:"text-xs text-gray-400",children:a.phone})]})]}),(0,b.jsx)("p",{className:"text-xs text-gray-500",children:new Date(a.createdAt).toLocaleDateString()})]},a.id)),0===j.length&&(0,b.jsx)("p",{className:"text-gray-500 text-center py-4",children:"暂无用户数据"})]})})]})]})]})}a.s(["default",()=>i])}];
|
|
|
|
//# sourceMappingURL=_b56cbc5e._.js.map
|