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