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