import{d as U}from"./shop-aaa0fa90.js";import{e as $}from"./index-b02b5348.js";import{c as H,_ as K}from"./index-c2dd6a24.js";import{f as Q}from"./date-20546ee0.js";import{e as R,r as i,w as j,P as _,a3 as F,a4 as t,f as a,a7 as e,I as d,H as l,ab as n,ai as G,Q as u,a9 as p,ac as J,ad as W}from"./vue-bf422dc1.js";import{M as X,B as Y,S as Z,T as ee,v as oe,w as te,L as ae,K as se,b as ne,A as le,f as re}from"./ui-ba7aaa7e.js";import{a8 as ce,a9 as ie,aa as _e}from"./icons-a8498fb6.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";const r=f=>(J("data-v-fd5ed89c"),f=f(),W(),f),de={class:"flex-container"},ue={class:"order-title"},pe=r(()=>e("label",null,"订单号:",-1)),me=r(()=>e("div",{class:"remark"},"请牢记订单号，订单查询与订单投诉时使用",-1)),fe={class:"order-copy"},ve={key:0,class:"content"},he={key:0,class:"order-item flex-row"},ge=r(()=>e("span",null,"商品原价",-1)),ye={class:"order-item flex-row"},xe={key:0},ke={class:"order-item flex-row"},we=r(()=>e("span",null,"购买数量",-1)),be={class:"order-item flex-row"},Ce=r(()=>e("span",null,"支付方式",-1)),Te={key:1,class:"order-item flex-row"},Be=r(()=>e("span",null,"优惠金额",-1)),Ie={key:2,class:"order-item flex-row"},De=r(()=>e("span",null,"短信费用",-1)),Se={key:3,class:"order-item flex-row"},Ve=r(()=>e("span",null,"交易手续费(买家承担)",-1)),Oe={class:"order-item flex-row"},ze=r(()=>e("span",null,"订单原价",-1)),Ne=r(()=>e("br",null,null,-1)),Pe={name:"OrderDialog"},Ae=R({...Pe,setup(f,{expose:C}){const[g,T,B]=$(),v=i(!0),I=()=>{v.value=!v.value},y=i(!1),x=i(!1),o=i({trade_no:"",goods_name:"",create_time:"",goods_price_old:"",goods_price:"",quantity:"",paytype:{title:""},coupon_price:"",sms_price:"",total_price:"",fee_player:"",total_product_price:"",fee:"",order_auto_close_time:"",purchase_agreement:""});C({init:c=>{o.value=c,x.value=!0;const s=new Date().getTime()+c.order_auto_close_time*1e3;T(s),k.value={content:"立即支付",theme:"primary",loading:!1}}});const k=i({content:"去支付",theme:"primary",loading:!1}),D=i(!1),S=()=>{var s;if(!y.value){X.error("请先阅读并同意购卡协议");return}const c={trade_no:(s=o.value)==null?void 0:s.trade_no};D.value=!0,k.value={content:"支付中..",theme:"primary",loading:!0},window.open(U(c))},V=i({content:"取消",theme:"default"}),O=()=>{B()};return j(g,c=>{var s;c==="已结束"&&(g.value=`如果已经支付完成，请复制订单号及时取货，订单号为：${(s=o.value)==null?void 0:s.trade_no}`)}),(c,s)=>{const w=Y,z=Z,N=ee,b=oe,P=te,A=ae,q=se,E=ne,L=le,M=re;return _(),F(M,{visible:x.value,"onUpdate:visible":s[2]||(s[2]=m=>x.value=m),width:"500","close-on-overlay-click":!1,"close-btn":!1,"confirm-btn":k.value,"cancel-btn":V.value,"on-cancel":O,"on-confirm":S},{default:t(()=>[a(E,{bordered:!1},{title:t(()=>[e("div",de,[a(w,{shape:"circle",theme:"primary",size:"large"},{icon:t(()=>[a(d(ce))]),_:1}),a(z,{class:"middle-item",direction:"vertical",size:"small"},{default:t(()=>[e("span",ue,[pe,l(" "+n(o.value.trade_no),1)]),me]),_:1})])]),actions:t(()=>[e("span",fe,[a(w,{variant:"outline",theme:"primary",size:"small",shape:"round",onClick:s[0]||(s[0]=m=>d(H)(o.value.trade_no))},{default:t(()=>[l(" 复制订单号 ")]),_:1})])]),default:t(()=>{var m;return[a(P,null,{default:t(()=>[a(b,{flex:"auto"},{default:t(()=>[a(N,null,{default:t(()=>[l(n(o.value.goods_name),1)]),_:1})]),_:1}),a(b,{flex:"none"},{default:t(()=>{var h;return[l(" 订单金额：￥"+n((h=o.value)==null?void 0:h.total_price),1)]}),_:1})]),_:1}),a(w,{block:"",variant:"outline",class:"orderButtonToggle",onClick:I},G({default:t(()=>[l(" 账单明细, 下单时间 "+n(d(Q)(o.value.create_time)),1)]),_:2},[v.value?{name:"icon",fn:t(()=>[a(d(ie))]),key:"0"}:{name:"icon",fn:t(()=>[a(d(_e))]),key:"1"}]),1024),v.value?(_(),u("div",ve,[o.value.goods_price_old!=o.value.goods_price?(_(),u("div",he,[ge,e("span",null,"￥"+n(o.value.goods_price_old),1)])):p("",!0),e("div",ye,[e("span",null,[l("商品单价 "),o.value.goods_price_old!=o.value.goods_price?(_(),u("span",xe," （批发优惠单价）")):p("",!0)]),e("span",null,"￥"+n(o.value.goods_price),1)]),e("div",ke,[we,e("span",null,"* "+n(o.value.quantity),1)]),e("div",be,[Ce,e("span",null,n(o.value.paytype.title),1)]),o.value.coupon_price?(_(),u("div",Te,[Be,e("span",null,"- ￥"+n(o.value.coupon_price),1)])):p("",!0),o.value.sms_price?(_(),u("div",Ie,[De,e("span",null,"+ ￥"+n(o.value.sms_price),1)])):p("",!0),o.value.fee_player==2?(_(),u("div",Se,[Ve,e("span",null,"+ ￥"+n(o.value.fee),1)])):p("",!0),e("div",Oe,[ze,e("span",null,"+ ￥"+n((m=o.value)==null?void 0:m.total_product_price),1)])])):p("",!0),a(q,{modelValue:y.value,"onUpdate:modelValue":s[1]||(s[1]=h=>y.value=h),style:{float:"right"}},{default:t(()=>[l(" 我已阅读并同意 "),a(A,{theme:"primary",size:"small",target:"_blank",href:o.value.purchase_agreement},{default:t(()=>[l("购卡协议")]),_:1},8,["href"])]),_:1},8,["modelValue"])]}),_:1}),a(L,{style:{"margin-top":"20px"}},{default:t(()=>[l(" 请在"+n(o.value.order_auto_close_time/60)+"分钟内完成订单 ",1),Ne,l(" "+n(d(g)),1)]),_:1})]),_:1},8,["visible","confirm-btn","cancel-btn"])}}});const Ge=K(Ae,[["__scopeId","data-v-fd5ed89c"]]);export{Ge as default};
