import{_ as T,u as H,r as _,b as y,l as N,c as t,h as o,e,f as n,w as u,g as v,p as J,v as M,F as U,i as F,s as A,t as d,d as K,x as l,m as O,y as j,z as q,C as Q,E}from"./index-BpXYCW1n.js";import{e as W,p as X,f as Y,g as Z}from"./pay-EEWGeT4Q.js";import{p as ee}from"./padding-CLyithQn.js";const te=h=>(j("data-v-477f396c"),h=h(),q(),h),se={class:"my-order"},oe={class:"header-nav"},ae=te(()=>e("div",{class:"nav-item"},"订单列表",-1)),ie={class:"nav-item-clear"},le={class:"header-input"},ne={class:"order-list","infinite-scroll-distance":"300","infinite-scroll-delay":"500",style:{overflow:"auto"}},ce=["onClick"],de={class:"top"},_e={class:"create-time"},re={class:"shop"},ue={key:0,class:"left"},ve={key:0,class:"shop-name"},pe={class:"right"},fe={class:"money"},me={class:"count"},he={class:"bottom"},ye={class:"pay"},ge={key:0},ke={key:0},$e={key:1},be={key:2},Ce={key:3},Ve={key:4},we={key:5},Se={key:6},Pe={key:1,style:{color:"#ff4a00"}},Le={key:0,class:"cashier"},xe={key:1,class:"cashier"},Ie={key:0,class:"load-end"},Ae={key:1,class:"load-end"},Re={__name:"order",setup(h){const P=H();_([]);const a=_(1),S=$=>{f.value.page=1,m.value=!1,r.value=!1,k.value=[],C(!0)};_(null);const f=_({page:1,limit:20,search_info:""}),r=_(!1),L=_(0),V=_(0),m=_(!1),k=_([]),C=($=!1)=>{if($)f.value.page=1;else if(m.value||r.value)return;r.value=!0,a.value==1&&(f.value.paid=null),a.value==2&&(f.value.paid=0),W(P.userInfo.service.mer_id,f.value).then(i=>{$?k.value=i.data.list:k.value=[...k.value,...i.data.list],i.data.list.length{m.value=!0,r.value=!1})},R=($,i)=>{V.value=i,O.emit("set-order-detail",$)};return($,i)=>{const c=y("el-radio-button"),x=y("el-radio-group"),w=y("el-button"),z=y("el-input"),b=y("el-image"),B=N("loading"),D=N("infinite-scroll");return t(),o("div",se,[e("div",oe,[ae,e("div",ie,[n(x,{modelValue:a.value,"onUpdate:modelValue":i[0]||(i[0]=s=>a.value=s),onChange:S,size:"small"},{default:u(()=>[n(c,{value:1},{default:u(()=>[v("全部")]),_:1}),n(c,{value:2},{default:u(()=>[v("未支付")]),_:1})]),_:1},8,["modelValue"])])]),e("div",le,[n(z,{modelValue:f.value.search_info,"onUpdate:modelValue":i[2]||(i[2]=s=>f.value.search_info=s),placeholder:"请输入订单编号",onKeydown:i[3]||(i[3]=J(s=>C(!0),["enter"])),onClear:i[4]||(i[4]=s=>C(!0)),clearable:""},{append:u(()=>[n(w,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 5px 5px 0"},onClick:i[1]||(i[1]=s=>C(!0))},{default:u(()=>[v("搜索")]),_:1})]),_:1},8,["modelValue"])]),M((t(),o("div",ne,[(t(!0),o(U,null,F(k.value,(s,g)=>(t(),o("div",{class:A(["item",{"item-active":V.value==g}]),key:g,onClick:I=>R(s,g)},[e("div",de,[e("div",{class:A(["sn",s.pay_type===11||s.pay_type===12||s.pay_type===13?"cahier":"cahier2"])},"单号: "+d(s.order_sn),3),e("div",_e,d(s.create_time),1)]),e("div",re,[s.orderProduct?(t(),o("div",ue,[(t(!0),o(U,null,F(s.orderProduct.slice(0,5),(I,G)=>(t(),K(b,{key:G,src:I.cart_info.productAttr.image||I.cart_info.product.image,class:"shop-img"},null,8,["src"]))),128)),s.orderProduct.length==1?(t(),o("div",ve,d(s.orderProduct[0].cart_info.product.store_name),1)):l("",!0)])):l("",!0),e("div",pe,[e("div",fe,"¥"+d(s.pay_price),1),e("div",me,"共"+d(s.total_num)+"件商品",1)])]),e("div",he,[e("div",ye,[s.paid?(t(),o("div",ge,[v(" 已支付 "),s.pay_type==13?(t(),o("span",ke,"(支付宝收款)")):l("",!0),s.pay_type==12?(t(),o("span",$e,"(现金支付)")):l("",!0),s.pay_type==11?(t(),o("span",be,"(微信收款)")):l("",!0),s.pay_type==0?(t(),o("span",Ce,"(余额支付)")):l("",!0),s.pay_type==1?(t(),o("span",Ve,"(微信支付)")):l("",!0),s.pay_type==9?(t(),o("span",we,"(商户余额支付)")):l("",!0),s.pay_type==10?(t(),o("span",Se,"(对公转账)")):l("",!0)])):(t(),o("div",Pe,"未支付"))]),s.service_info?(t(),o("div",Le,"收银员: "+d(s.service_info.nickname),1)):(t(),o("div",xe,"平台订单"))])],10,ce))),128)),m.value?(t(),o("div",Ie,"没有更多了")):l("",!0),r.value?(t(),o("div",Ae,"加载中...")):l("",!0)])),[[B,r.value],[D,C]])])}}},ze=T(Re,[["__scopeId","data-v-477f396c"]]),p=h=>(j("data-v-f0903720"),h=h(),q(),h),Be={class:"my-order"},De={class:"header-nav"},Ee=["onClick"],Ne={class:"detail"},Ue={key:0,class:"table"},Fe={style:{"font-size":"0.9rem"}},Ke={style:{color:"#ff4a00"}},Oe={style:{display:"flex","align-items":"center"}},Te={style:{"margin-left":"0.5rem"}},He={key:1,class:"table"},Me=p(()=>e("div",{class:"table-title"},"订单信息",-1)),je={class:"table-info"},qe={class:"info-item"},Ge=p(()=>e("div",{class:"info-item-title"},"创建时间:",-1)),Je={class:"info-item-info"},Qe={class:"info-item"},We=p(()=>e("div",{class:"info-item-title"},"商品总数:",-1)),Xe={class:"info-item-info"},Ye={class:"info-item"},Ze=p(()=>e("div",{class:"info-item-title"},"商品总价:",-1)),et={class:"info-item-info"},tt={class:"info-item"},st=p(()=>e("div",{class:"info-item-title"},"支付时间:",-1)),ot={class:"info-item-info"},at={class:"info-item"},it=p(()=>e("div",{class:"info-item-title"},"优惠抵扣:",-1)),lt={class:"info-item-info"},nt={class:"info-item"},ct=p(()=>e("div",{class:"info-item-title"},"实际支付:",-1)),dt={class:"info-item-info"},_t={class:"info-item"},rt=p(()=>e("div",{class:"info-item-title"},"支付方式:",-1)),ut={class:"info-item-info"},vt={key:0},pt={key:1},ft={key:2},mt={key:3},ht={key:4},yt={key:5},gt={key:6},kt={key:0,class:"table-title"},$t={key:1,class:"table-info",style:{"flex-direction":"column"}},bt={class:"info-item"},Ct=p(()=>e("div",{class:"info-item-title"},"头像:",-1)),Vt={class:"info-item-info"},wt={class:"info-item"},St=p(()=>e("div",{class:"info-item-title"},"昵称:",-1)),Pt={class:"info-item-info"},Lt={class:"info-item"},xt=p(()=>e("div",{class:"info-item-title"},"账号:",-1)),It={class:"info-item-info"},At={key:2,class:"footer"},Rt={class:"info"},zt={class:"ser"},Bt={class:"price"},Dt={key:0,class:"handle"},Et={key:1,class:"handle"},Nt=p(()=>e("span",null,"提单前请清空购物车, 避免提单的商品与购物车商品混合, 请确保购物车内无数据后再进行提单",-1)),Ut={class:"dialog-footer"},Ft={__name:"detail",setup(h){H();const P=Q(),a=_({});O.on("set-order-detail",i=>{a.value=i}),_([]);const S=_(null),f=_(!1);_(0);const r=_(0),L=_(["商品信息","订单详情"]),V=_(""),m=_(!1),k=i=>{V.value=i,m.value=!0},C=()=>{m.value=!1,Y({order_sn:V.value}).then(i=>{E({message:i.message,type:"success"}),P.push({name:"home"})})},R=i=>{S.value.setRePay({price:i.pay_price,order_id:i.group_order_id}),S.value.drawer=!0},$=i=>{Z({order_sn:i}).then(c=>{c.data.paid==1||c.message=="支付成功"?E({message:c.message,type:"success"}):E({message:c.message,type:"error"})}).catch(c=>{})};return(i,c)=>{const x=y("el-image"),w=y("el-table-column"),z=y("el-table"),b=y("el-button"),B=y("el-dialog"),D=N("loading");return t(),o("div",Be,[e("div",De,[(t(!0),o(U,null,F(L.value,(s,g)=>(t(),o("div",{key:g,class:A(["nav-item",{"nav-item-active":r.value==g,"nav-item-radius1":r.value==g+1,"nav-item-radius2":r.value==g-1}]),onClick:I=>r.value=g},d(s),11,Ee))),128)),e("div",{class:A(["nav-item",{"nav-item-radius2":r.value==L.value.length-1}]),style:{flex:"1"}},null,2)]),M((t(),o("div",Ne,[a.value.orderProduct&&r.value==0?(t(),o("div",Ue,[e("div",Fe,[v(" 共计 "),e("span",Ke,d(a.value.total_num),1),v(" 件商品 ")]),n(z,{style:{height:"calc(100vh - 100px - 14rem)"},data:a.value.orderProduct},{default:u(()=>[n(w,{prop:"cart_info.product.store_name",label:"商品信息"},{default:u(({row:s})=>[e("div",Oe,[n(x,{style:{height:"3rem",width:"3rem"},src:s.cart_info.productAttr.image||s.cart_info.product.image},null,8,["src"]),e("span",Te,d(s.cart_info.product.store_name),1)])]),_:1}),n(w,{prop:"cart_info.productAttr.price",label:"单价",width:"150"}),n(w,{prop:"product_num",label:"数量",width:"150"}),n(w,{prop:"total_price",label:"总价",width:"150"})]),_:1},8,["data"])])):l("",!0),a.value.orderProduct&&r.value==1?(t(),o("div",He,[Me,e("div",je,[e("div",qe,[Ge,e("div",Je,d(a.value.create_time),1)]),e("div",Qe,[We,e("div",Xe,d(a.value.total_num),1)]),e("div",Ye,[Ze,e("div",et,"¥"+d(a.value.total_price),1)]),e("div",tt,[st,e("div",ot,d(a.value.pay_time),1)]),e("div",at,[it,e("div",lt,"¥"+d(a.value.deduction_price),1)]),e("div",nt,[ct,e("div",dt,"¥"+d(a.value.pay_price),1)]),e("div",_t,[rt,e("div",ut,[a.value.pay_type==11?(t(),o("span",vt,"微信收款")):l("",!0),a.value.pay_type==12?(t(),o("span",pt,"现金支付")):l("",!0),a.value.pay_type==13?(t(),o("span",ft,"支付宝收款")):l("",!0),a.value.pay_type==0?(t(),o("span",mt,"余额支付")):l("",!0),a.value.pay_type==1?(t(),o("span",ht,"微信支付")):l("",!0),a.value.pay_type==9?(t(),o("span",yt,"商户余额支付")):l("",!0),a.value.pay_type==10?(t(),o("span",gt,"对公转账")):l("",!0)])])]),a.value.service_info?(t(),o("div",kt,"收银员信息")):l("",!0),a.value.service_info?(t(),o("div",$t,[e("div",bt,[Ct,e("div",Vt,[n(x,{style:{height:"4rem",width:"4rem","border-radius":"50%"},src:a.value.service_info.avatar},null,8,["src"])])]),e("div",wt,[St,e("div",Pt,d(a.value.service_info.nickname),1)]),e("div",Lt,[xt,e("div",It,d(a.value.service_info.account),1)])])):l("",!0)])):l("",!0),a.value.service_info?(t(),o("div",At,[e("div",Rt,[e("div",zt,"收银员: "+d(a.value.service_info.nickname),1),e("div",Bt,[v(" 实付: "),e("span",null,"¥"+d(a.value.pay_price),1)])]),a.value.pay_time?(t(),o("div",Et,"已支付")):(t(),o("div",Dt,[n(b,{class:"btn",type:"primary",onClick:c[0]||(c[0]=s=>R(a.value))},{default:u(()=>[v("重新支付")]),_:1}),n(b,{class:"btn",type:"primary",onClick:c[1]||(c[1]=s=>$(a.value.order_sn))},{default:u(()=>[v("检测状态")]),_:1}),n(b,{class:"btn",type:"success",onClick:c[2]||(c[2]=s=>k(a.value.order_sn))},{default:u(()=>[v("提单")]),_:1})]))])):l("",!0)])),[[D,f.value]]),n(X,{ref_key:"payRef",ref:S},null,512),n(B,{modelValue:m.value,"onUpdate:modelValue":c[4]||(c[4]=s=>m.value=s),title:"提示",width:"500"},{footer:u(()=>[e("div",Ut,[n(b,{onClick:c[3]||(c[3]=s=>m.value=!1)},{default:u(()=>[v("取消")]),_:1}),i.cartCount>0?(t(),K(b,{key:0,onClick:i.goHome},{default:u(()=>[v(" 前去清空购物车 ")]),_:1},8,["onClick"])):(t(),K(b,{key:1,type:"primary",onClick:C},{default:u(()=>[v(" 确认提单 ")]),_:1}))])]),default:u(()=>[Nt]),_:1},8,["modelValue"])])}}},Kt=T(Ft,[["__scopeId","data-v-f0903720"]]),Ot={class:"my-card"},jt={__name:"index",setup(h){return(P,a)=>(t(),o("div",Ot,[n(ze,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),n(ee),n(Kt,{ref:"detailRef"},null,512)]))}};export{jt as default};