import{d as j,r as z,G as P,g as u,J as A,c as d,k as l,K as E,e as s,z as x,w as n,b as t,H as c,x as a,l as G,L as H,t as g,_ as J}from"./index-CUnFTKV2.js";import{O as k}from"./order-BSmesayL.js";const K={class:"order-table"},L={class:"user-info"},$={class:"nickname"},q={class:"uid"},Q={key:0,class:"mobile"},R={class:"order-num"},W={class:"goods-info"},X={class:"image-error"},Y={class:"goods-detail"},Z={class:"goods-title"},w={class:"goods-meta"},ee={class:"money-info"},te={class:"money"},ae={key:0},se={class:"discount"},ne={class:"money"},ie={class:"pay-info"},oe={key:0},le={key:1},de={key:2},ce={key:3},re={key:4},ue={class:"time-info"},_e={key:0},me=j({__name:"BuyOrderTable",props:{data:{},loading:{type:Boolean},total:{},page:{},pageSize:{}},emits:["page-change","size-change","view-detail"],setup(v,{emit:C}){const h=v,y=C,f=z(h.page),b=z(h.pageSize);P(()=>h.page,i=>{f.value=i}),P(()=>h.pageSize,i=>{b.value=i});const S=i=>{switch(i){case k.Paid:return"success";case k.Unpaid:return"warning";case k.Cancelled:return"info";default:return"info"}},N=i=>{y("page-change",i)},T=i=>{y("size-change",i)},B=i=>{y("view-detail",i)};return(i,o)=>{const r=u("el-table-column"),U=u("el-icon"),F=u("el-image"),I=u("el-tag"),D=u("el-button"),V=u("el-table"),O=u("el-pagination"),M=A("loading");return l(),d("div",K,[E((l(),x(V,{data:v.data,border:"",stripe:""},{default:n(()=>[s(r,{label:"用户信息","min-width":"160",fixed:"left"},{default:n(({row:e})=>[t("div",L,[t("div",$,a(e.userNickname||"-"),1),t("div",q,"UID: "+a(e.userId),1),e.userMobile?(l(),d("div",Q,a(e.userMobile),1)):c("",!0)])]),_:1}),s(r,{prop:"orderNum",label:"订单号","min-width":"180"},{default:n(({row:e})=>[t("span",R,a(e.orderNum),1)]),_:1}),s(r,{label:"盒子信息","min-width":"200"},{default:n(({row:e})=>[t("div",W,[e.goodsImgUrl?(l(),x(F,{key:0,src:e.goodsImgUrl,"preview-src-list":[e.goodsImgUrl],fit:"cover",class:"goods-img",lazy:""},{error:n(()=>[t("div",X,[s(U,null,{default:n(()=>[s(G(H))]),_:1})])]),_:1},8,["src","preview-src-list"])):c("",!0),t("div",Y,[t("div",Z,a(e.goodsTitle||"-"),1),t("div",w,[t("span",null,"抽奖次数: "+a(e.num),1),t("span",null,"中奖数: "+a(e.prizeNum),1)])])])]),_:1}),s(r,{label:"金额详情","min-width":"180"},{default:n(({row:e})=>{var _,m,p;return[t("div",ee,[t("div",null,[o[2]||(o[2]=g("订单金额: ",-1)),t("span",te,"¥"+a(((_=e.orderTotal)==null?void 0:_.toFixed(2))||"0.00"),1)]),e.discount>0?(l(),d("div",ae,[o[3]||(o[3]=g("折扣: ",-1)),t("span",se,"-¥"+a((m=e.discount)==null?void 0:m.toFixed(2)),1)])):c("",!0),t("div",null,[o[4]||(o[4]=g("实付金额: ",-1)),t("span",ne,"¥"+a(((p=e.discountTotal)==null?void 0:p.toFixed(2))||"0.00"),1)])])]}),_:1}),s(r,{label:"支付方式","min-width":"140"},{default:n(({row:e})=>{var _,m,p;return[t("div",ie,[e.weChatPayment>0?(l(),d("div",oe,"微信: ¥"+a((_=e.weChatPayment)==null?void 0:_.toFixed(2)),1)):c("",!0),e.balancePayment>0?(l(),d("div",le,"余额: ¥"+a((m=e.balancePayment)==null?void 0:m.toFixed(2)),1)):c("",!0),e.integralPayment>0?(l(),d("div",de,"积分: "+a(e.integralPayment),1)):c("",!0),e.scorePayment>0?(l(),d("div",ce,"评分: "+a(e.scorePayment),1)):c("",!0),e.couponPayment&&e.couponPayment>0?(l(),d("div",re,"优惠券: ¥"+a((p=e.couponPayment)==null?void 0:p.toFixed(2)),1)):c("",!0)])]}),_:1}),s(r,{label:"状态",width:"100",align:"center"},{default:n(({row:e})=>[s(I,{type:S(e.status),size:"small"},{default:n(()=>[g(a(e.statusName),1)]),_:2},1032,["type"])]),_:1}),s(r,{label:"时间","min-width":"160"},{default:n(({row:e})=>[t("div",ue,[t("div",null,"下单: "+a(e.createdAt),1),e.payTime?(l(),d("div",_e,"支付: "+a(e.payTime),1)):c("",!0)])]),_:1}),s(r,{label:"操作",width:"120",fixed:"right",align:"center"},{default:n(({row:e})=>[s(D,{type:"primary",link:"",onClick:_=>B(e)},{default:n(()=>[...o[5]||(o[5]=[g(" 查看详情 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])),[[M,v.loading]]),s(O,{"current-page":f.value,"onUpdate:currentPage":o[0]||(o[0]=e=>f.value=e),"page-size":b.value,"onUpdate:pageSize":o[1]||(o[1]=e=>b.value=e),"page-sizes":[10,20,50,100],total:v.total,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:T,onCurrentChange:N,class:"pagination"},null,8,["current-page","page-size","total"])])}}}),ve=J(me,[["__scopeId","data-v-3010f6cf"]]);export{ve as default};
