import{d as k,r as f,a as T,o as w,g as _,J as x,K as M,z as N,k as p,w as r,b as s,c as B,H as D,x as l,l as o,e as m,ad as E,s as V,t as j,E as H,_ as I}from"./index-CUnFTKV2.js";import{e as A}from"./statistics-B7ukxmWr.js";import{a as n,b as c}from"./format-C0IiqLeQ.js";const R={class:"card-header"},S={class:"stats-grid"},Z={class:"stat-item"},z={class:"stat-value"},J={class:"stat-item"},K={class:"stat-value"},q={class:"stat-item"},F={class:"stat-value"},G={class:"stat-item"},L={class:"stat-value currency"},P={class:"stat-item"},Q={class:"stat-value currency"},U={class:"stat-item"},W={class:"stat-value currency"},X={class:"stat-item"},Y={class:"stat-value currency"},$={class:"stat-item"},ss={class:"stat-value"},ts={class:"stat-item"},es={class:"stat-value"},as={class:"stat-item"},os={class:"stat-value"},ls={key:0,class:"error-message"},is=k({__name:"TodayOrderCard",setup(ns,{expose:g}){const d=f(!1),i=f(null),u={initiateOrderCount:0,paidOrderCount:0,userCount:0,orderZheTotal:0,goodsTotalAmount:0,useCoupon:0,price:0,useMoney:0,useIntegral:0,useMoney2:0},e=T({...u});async function v(){d.value=!0,i.value=null;try{const a=await A();a.code===0&&a.data?Object.assign(e,a.data):(i.value=a.message||"获取数据失败",Object.assign(e,u))}catch(a){console.error("加载今日订单数据失败:",a),a instanceof Error?a.message.includes("403")||a.message.includes("权限")?i.value="无权限访问此页面":a.message.includes("network")||a.message.includes("Network")?i.value="网络连接失败，请检查网络":i.value="服务器繁忙，请稍后重试":i.value="获取数据失败",Object.assign(e,u)}finally{d.value=!1}}function y(){v(),H.info("正在刷新数据...")}return w(()=>{v()}),g({refresh:v}),(a,t)=>{const b=_("el-button"),C=_("el-icon"),h=_("el-card"),O=x("loading");return M((p(),N(h,{class:"today-order-card"},{header:r(()=>[s("div",R,[t[1]||(t[1]=s("span",{class:"card-title"},"今日订单",-1)),m(b,{type:"primary",link:"",icon:o(V),onClick:y,loading:d.value},{default:r(()=>[...t[0]||(t[0]=[j(" 刷新 ",-1)])]),_:1},8,["icon","loading"])])]),default:r(()=>[s("div",S,[s("div",Z,[t[2]||(t[2]=s("div",{class:"stat-label"},"发起订单数",-1)),s("div",z,l(o(n)(e.initiateOrderCount)),1)]),s("div",J,[t[3]||(t[3]=s("div",{class:"stat-label"},"支付订单数",-1)),s("div",K,l(o(n)(e.paidOrderCount)),1)]),s("div",q,[t[4]||(t[4]=s("div",{class:"stat-label"},"消费人数",-1)),s("div",F,l(o(n)(e.userCount)),1)]),s("div",G,[t[5]||(t[5]=s("div",{class:"stat-label"},"订单总金额",-1)),s("div",L,l(o(c)(e.orderZheTotal)),1)]),s("div",P,[t[6]||(t[6]=s("div",{class:"stat-label"},"出货总金额",-1)),s("div",Q,l(o(c)(e.goodsTotalAmount)),1)]),s("div",U,[t[7]||(t[7]=s("div",{class:"stat-label"},"优惠券抵扣",-1)),s("div",W,l(o(c)(e.useCoupon)),1)]),s("div",X,[t[8]||(t[8]=s("div",{class:"stat-label"},"RMB支付",-1)),s("div",Y,l(o(c)(e.price)),1)]),s("div",$,[t[9]||(t[9]=s("div",{class:"stat-label"},"钻石支付",-1)),s("div",ss,l(o(n)(e.useMoney)),1)]),s("div",ts,[t[10]||(t[10]=s("div",{class:"stat-label"},"HH币支付",-1)),s("div",es,l(o(n)(e.useIntegral)),1)]),s("div",as,[t[11]||(t[11]=s("div",{class:"stat-label"},"达达券支付",-1)),s("div",os,l(o(n)(e.useMoney2)),1)])]),i.value?(p(),B("div",ls,[m(C,null,{default:r(()=>[m(o(E))]),_:1}),s("span",null,l(i.value),1)])):D("",!0)]),_:1})),[[O,d.value]])}}}),us=I(is,[["__scopeId","data-v-f640df0a"]]);export{us as default};
