import{r as e,o as a,n as l,c as t,b as s,d as o,e as d,f as n,w as r,g as u,x as i,h as c,i as p,F as f,k as _,t as y,p as h,v as m,A as v,l as g,j as k,G as w,B as x,y as b}from"./index-DVkgSHpn.js";import{_ as C}from"./el-navbar.DVIyjZEN.js";import{_ as $}from"./el-tabs.DRFTppt3.js";import{_ as j}from"./el-refresh.CkIPFmzm.js";import{_ as T,a as P}from"./el-layout._U-vZTft.js";import"./el-empty.CMLN1lgh.js";import"./el-loading-icon.Bh3RKCou.js";const B=T({__name:"index",setup(T){const B=e(),H=e(0),M=e(0),S=e(""),R=e([{name:"全部",type:"all"},{name:"未付款",type:"payment"},{name:"待发货",type:"delivery"},{name:"待收货",type:"received"},{name:"待评价",type:"evaluate"}]),A=e=>{R.value.find(((a,l)=>"string"==typeof e&&a.type==e||"number"==typeof e&&e==l?(M.value=l,S.value=a.type,!0):void 0))};a((e=>{A(e.type||"all"),l((()=>{F()}))}));const D=e([]),F=async()=>{var e;null==(e=B.value)||e.resetPage(),D.value=[]},G=e=>{A(e),F()},I=t((()=>{const{windowHeight:e}=_();return e-H.value-50})),L=()=>{F()},U=e=>{B.value.isMore()&&(B.value.loadingPage(),setTimeout((()=>{uni.$http.get("order.index/index",{type:S.value,page:e.page}).then((a=>{1==a.code?(1==e.page&&(D.value=[]),B.value.setData(a.data.total,a.data.list.length),D.value=D.value.concat(a.data.list)):-1==a.code&&(1==e.page&&a.data.list.length<=0&&(D.value=[]),B.value.emptyPage())}))}),100))},V=()=>{y("pages/index/ucenter")};return(e,a)=>{const l=s(o("el-navbar"),C),t=s(o("el-tabs"),$),_=h,T=x,S=b,A=s(o("el-refresh"),j),W=s(o("el-layout"),P);return d(),n(W,null,{default:r((()=>[u(l,{top:H.value,"onUpdate:top":a[0]||(a[0]=e=>H.value=e),placeholder:!0,fixed:!0,border:!1,title:"订单列表",autoBack:!1,onLeft:V},null,8,["top"]),u(_,{class:"tabs",style:i({top:H.value-1+"px"})},{default:r((()=>[u(t,{showBar:!1,list:R.value,current:M.value,onChange:G,itemStyle:{width:"20%"}},null,8,["list","current"])])),_:1},8,["style"]),u(_,{style:{width:"100%",height:"50px"}}),u(A,{ref_key:"refreshRef",ref:B,onRefresh:L,onScrolltolower:U,scrollHeight:I.value},{default:r((()=>[u(_,{class:"wrapper"},{default:r((()=>[u(_,{class:"order-list"},{default:r((()=>[(d(!0),c(f,null,p(D.value,((e,a)=>(d(),n(_,{class:"order-box",key:a},{default:r((()=>[u(_,{class:"top"},{default:r((()=>[u(_,null,{default:r((()=>[m(v(e.create_time),1)])),_:2},1024),u(_,null,{default:r((()=>[m(v(e.text),1)])),_:2},1024)])),_:2},1024),u(_,{class:"content"},{default:r((()=>[u(_,{class:"goods-list",onClick:a=>g(y)(`/pages/order/detail?id=${e.id}`)},{default:r((()=>[(d(!0),c(f,null,p(e.goods,((e,a)=>(d(),n(_,{class:"goods-box",key:a},{default:r((()=>[u(_,{class:"thumb-image"},{default:r((()=>[u(T,{src:e.thumb_image},null,8,["src"])])),_:2},1024),u(_,{class:"goods-info"},{default:r((()=>[u(_,{class:"goods-name"},{default:r((()=>[2==e.type?(d(),n(S,{key:0,class:"gift"},{default:r((()=>[m("[赠品]")])),_:1})):k("",!0),u(S,null,{default:r((()=>[m(v(e.goods_name),1)])),_:2},1024)])),_:2},1024),e.spec.length>0?(d(),n(_,{key:0,class:"spec"},{default:r((()=>[m(v(e.spec),1)])),_:2},1024)):k("",!0),u(_,{class:"price"},{default:r((()=>[m("￥"),u(S,null,{default:r((()=>[m(v(e.sell_price),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),u(_,{class:"num"},{default:r((()=>[m("x"+v(e.goods_total_nums),1)])),_:2},1024)])),_:2},1024)))),128))])),_:2},1032,["onClick"]),u(_,{class:"order-amount"},{default:r((()=>[m(" 实付款："),u(S,null,{default:r((()=>[m("￥")])),_:1}),u(S,null,{default:r((()=>[m(v(e.order_amount),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),u(_,{class:"bottom"},{default:r((()=>[g(w)(e.active,[2])?(d(),n(_,{key:0,class:"white",onClick:a=>(e=>{uni.$layer.showModal("您确定要申请退款吗？").then((()=>{uni.$http.post("order.index/cancel",{id:e.id}).then((e=>{e.code?(uni.$layer.showToast("操作成功"),F()):uni.$layer.showToast(e.msg)}))}))})(e)},{default:r((()=>[m("申请退款")])),_:2},1032,["onClick"])):k("",!0),g(w)(e.active,[5])?(d(),n(_,{key:1,class:"white",onClick:a=>g(y)(`/pages/refund/detail?order_id=${e.id}`)},{default:r((()=>[m("申请退款")])),_:2},1032,["onClick"])):k("",!0),g(w)(e.active,[5])?(d(),n(_,{key:2,class:"white",onClick:a=>(e=>{uni.$layer.showModal("您确定已收到货物吗？").then((()=>{uni.$http.post("order.index/delivery",{id:e.id}).then((e=>{e.code?(uni.$layer.showToast("操作成功"),F()):uni.$layer.showToast(e.msg)}))}))})(e)},{default:r((()=>[m("确认收货")])),_:2},1032,["onClick"])):k("",!0),g(w)(e.active,[7])?(d(),n(_,{key:3,class:"red",onClick:a=>g(y)(`/pages/order/evaluate?order_id=${e.id}`)},{default:r((()=>[m("订单评价")])),_:2},1032,["onClick"])):k("",!0),g(w)(e.active,[1])?(d(),n(_,{key:4,class:"red",onClick:a=>g(y)(`/pages/cart/cashier?pay_type=order&order_id=${e.id}`)},{default:r((()=>[m("去支付")])),_:2},1032,["onClick"])):k("",!0)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1},8,["scrollHeight"])])),_:1})}}},[["__scopeId","data-v-236dc637"]]);export{B as default};
//# sourceMappingURL=pages-order-index.BEMDCSxl.js.map
