import{d as K,r as b,G as I,g as u,J as R,z as h,k as d,w as e,K as j,c as _,H as g,F as C,e as t,t as o,x as s,b as n,y as q,l as Q,L as W,_ as X}from"./index-CUnFTKV2.js";import{a as Y,O as z,b as k}from"./order-BSmesayL.js";const Z={class:"order-detail"},$={class:"money"},ee={class:"money"},te={key:0,class:"prize-section"},le={class:"prize-groups"},se={class:"prize-header"},ae={class:"image-error"},oe={class:"prize-info"},ne={class:"prize-title"},ie={class:"prize-meta"},re={class:"money"},de={class:"recovery-money"},ce={key:0,class:"prize-items"},ue={key:0},_e={key:1},me={key:2,class:"text-muted"},pe=K({__name:"OrderDetailDialog",props:{modelValue:{type:Boolean},orderId:{}},emits:["update:modelValue","close"],setup(O,{emit:T}){const p=O,N=T,f=b(p.modelValue),y=b(!1),l=b(null);I(()=>p.modelValue,i=>{f.value=i,i&&p.orderId&&F()}),I(f,i=>{N("update:modelValue",i)});const F=async()=>{if(p.orderId){y.value=!0;try{const i=await Y(p.orderId);l.value=i.data}catch(i){console.error("获取订单详情失败:",i)}finally{y.value=!1}}},S=i=>{switch(i){case z.Paid:return"success";case z.Unpaid:return"warning";case z.Cancelled:return"info";default:return"info"}},B=i=>{switch(i){case k.Pending:return"warning";case k.Recovered:return"info";case k.Shipped:return"success";default:return"info"}},V=()=>{f.value=!1,l.value=null,N("close")};return(i,c)=>{const r=u("el-descriptions-item"),w=u("el-tag"),U=u("el-descriptions"),G=u("el-icon"),A=u("el-image"),v=u("el-table-column"),L=u("el-table"),M=u("el-empty"),P=u("el-button"),E=u("el-dialog"),H=R("loading");return d(),h(E,{modelValue:f.value,"onUpdate:modelValue":c[0]||(c[0]=a=>f.value=a),title:"订单详情",width:"800px","close-on-click-modal":!1,onClose:V},{footer:e(()=>[t(P,{onClick:V},{default:e(()=>[...c[4]||(c[4]=[o("关闭",-1)])]),_:1})]),default:e(()=>[j((d(),_("div",Z,[l.value?(d(),_(C,{key:0},[t(U,{column:2,border:"",class:"order-info"},{default:e(()=>[t(r,{label:"订单号"},{default:e(()=>[o(s(l.value.orderNum),1)]),_:1}),t(r,{label:"订单状态"},{default:e(()=>[t(w,{type:S(l.value.status),size:"small"},{default:e(()=>[o(s(l.value.statusName),1)]),_:1},8,["type"])]),_:1}),t(r,{label:"用户昵称"},{default:e(()=>[o(s(l.value.userNickname||"-"),1)]),_:1}),t(r,{label:"用户ID"},{default:e(()=>[o(s(l.value.userId),1)]),_:1}),t(r,{label:"手机号"},{default:e(()=>[o(s(l.value.userMobile||"-"),1)]),_:1}),t(r,{label:"盒子名称"},{default:e(()=>[o(s(l.value.goodsTitle||"-"),1)]),_:1}),t(r,{label:"抽奖次数"},{default:e(()=>[o(s(l.value.num),1)]),_:1}),t(r,{label:"中奖数量"},{default:e(()=>[o(s(l.value.prizeNum),1)]),_:1}),t(r,{label:"订单金额"},{default:e(()=>{var a;return[n("span",$,"¥"+s(((a=l.value.orderTotal)==null?void 0:a.toFixed(2))||"0.00"),1)]}),_:1}),t(r,{label:"实付金额"},{default:e(()=>{var a;return[n("span",ee,"¥"+s(((a=l.value.discountTotal)==null?void 0:a.toFixed(2))||"0.00"),1)]}),_:1}),t(r,{label:"下单时间"},{default:e(()=>[o(s(l.value.createdAt),1)]),_:1}),t(r,{label:"支付时间"},{default:e(()=>[o(s(l.value.payTime||"-"),1)]),_:1})]),_:1}),l.value.prizeGroups&&l.value.prizeGroups.length>0?(d(),_("div",te,[c[3]||(c[3]=n("h4",{class:"section-title"},"中奖奖品明细",-1)),n("div",le,[(d(!0),_(C,null,q(l.value.prizeGroups,(a,J)=>{var x,D;return d(),_("div",{key:J,class:"prize-group"},[n("div",se,[a.imgUrl?(d(),h(A,{key:0,src:a.imgUrl,"preview-src-list":[a.imgUrl],fit:"cover",class:"prize-img",lazy:""},{error:e(()=>[n("div",ae,[t(G,null,{default:e(()=>[t(Q(W))]),_:1})])]),_:1},8,["src","preview-src-list"])):g("",!0),n("div",oe,[n("div",ne,s(a.title||"-"),1),n("div",ie,[n("span",null,[c[1]||(c[1]=o("价值: ",-1)),n("span",re,"¥"+s(((x=a.price)==null?void 0:x.toFixed(2))||"0.00"),1)]),n("span",null,[c[2]||(c[2]=o("兑换价值: ",-1)),n("span",de,"¥"+s(((D=a.recoveryMoney)==null?void 0:D.toFixed(2))||"0.00"),1)]),n("span",null,"数量: "+s(a.count),1)])])]),a.items&&a.items.length>0?(d(),_("div",ce,[t(L,{data:a.items,size:"small",border:""},{default:e(()=>[t(v,{prop:"luckNo",label:"幸运号",width:"80",align:"center"}),t(v,{label:"状态",width:"100",align:"center"},{default:e(({row:m})=>[t(w,{type:B(m.status),size:"small"},{default:e(()=>[o(s(m.statusName),1)]),_:2},1032,["type"])]),_:1}),t(v,{label:"关联单号","min-width":"180"},{default:e(({row:m})=>[m.recoveryNum?(d(),_("span",ue,"回收: "+s(m.recoveryNum),1)):m.sendNum?(d(),_("span",_e,"发货: "+s(m.sendNum),1)):(d(),_("span",me,"-"))]),_:1}),t(v,{prop:"createdAt",label:"中奖时间","min-width":"160"})]),_:1},8,["data"])])):g("",!0)])}),128))])])):(d(),h(M,{key:1,description:"暂无中奖记录"}))],64)):g("",!0)])),[[H,y.value]])]),_:1},8,["modelValue"])}}}),ye=X(pe,[["__scopeId","data-v-caf193f4"]]);export{ye as default};
