import{C as t,p as a,D as s,q as e,t as o,o as r,e as i,w as n,s as l,_ as d,b as u,i as c,k as p,f as g,h as _,F as m,d as f,m as y,y as b,z as v,G as x,u as k,B as j}from"./index-520dfaee.js";import{_ as C}from"./su-tabs.251eecb0.js";import{_ as w}from"./su-sticky.4736fd36.js";import{_ as h}from"./s-empty.b6c95127.js";import{_ as S}from"./s-goods-item.cceb2670.js";import{_ as T}from"./uni-load-more.ba4f287c.js";import{a as G}from"./s-layout.5146c957.js";import{_ as B}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                *//* empty css                                                                     */const M=B({__name:"order",setup(B){const M={data:[],current_page:1,total:1,last_page:1},$=t({currentTab:0,pagination:{data:[],current_page:1,total:1,last_page:1},loadStatus:"",deleteOrderId:0}),q=[{name:"全部",value:"all"},{name:"进行中",value:"ing"},{name:"拼团成功",value:"finish"},{name:"拼团失败",value:"invalid"}];function I(t){$.pagination=M,$.currentTab=t.index,z()}async function z(t=1,a=5){$.loadStatus="loading";let s=await l.$api.activity.myGroupon({type:q[$.currentTab].value});if(1===s.code){let t=d.concat($.pagination.data,s.data.data);$.pagination={...s.data,data:t},$.pagination.current_page<$.pagination.last_page?$.loadStatus="more":$.loadStatus="noMore"}}function D(){"noMore"!==$.loadStatus&&z($.pagination.current_page+1)}return a((t=>{t.type&&($.currentTab=t.type),z()})),s((()=>{D()})),e((()=>{$.pagination=M,z(),setTimeout((function(){o()}),800)})),(t,a)=>{const s=u(f("su-tabs"),C),e=u(f("su-sticky"),w),o=u(f("s-empty"),h),d=y,B=u(f("s-goods-item"),S),M=j,z=u(f("uni-load-more"),T),E=u(f("s-layout"),G);return r(),i(E,{title:"我的拼团"},{default:n((()=>[c(e,{bgColor:"#fff"},{default:n((()=>[c(s,{list:q,scrollable:!1,onChange:I,current:$.currentTab},null,8,["current"])])),_:1}),0===$.pagination.total?(r(),i(o,{key:0,icon:"/static/goods-empty.png"})):p("",!0),$.pagination.total>0?(r(),i(d,{key:1},{default:n((()=>[(r(!0),g(m,null,_($.pagination.data,(t=>(r(),i(d,{class:"order-list-card-box bg-white ss-r-10 ss-m-t-14 ss-m-20",key:t.id},{default:n((()=>[c(d,{class:"order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20"},{default:n((()=>[c(d,{class:"order-no"},{default:n((()=>[b("订单号："+v(t.my.order.order_sn),1)])),_:2},1024),c(d,{class:x(["ss-font-26","ing"===t.status?"warning-color":"invalid"===t.status?"danger-color":"success-color"])},{default:n((()=>[b(v(t.status_text),1)])),_:2},1032,["class"])])),_:2},1024),c(d,{class:"border-bottom"},{default:n((()=>[c(B,{img:t.goods?t.goods.image:t.my.order_item.goods_image,title:t.goods?t.goods.title:t.my.order_item.goods_title,price:t.goods?t.goods.price[0]:t.my.order_item.goods_price,priceColor:"#E1212B",radius:"20"},{groupon:n((()=>[c(d,{class:"ss-flex"},{default:n((()=>[c(d,{class:"sales-title"},{default:n((()=>[b(v(t.num)+"人团 ",1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["img","title","price"])])),_:2},1024),c(d,{class:"order-card-footer ss-flex ss-row-right ss-p-x-20"},{default:n((()=>[c(M,{class:"detail-btn ss-reset-button",onClick:a=>k(l).$router.go("/pages/order/detail",{id:t.my.order_id})},{default:n((()=>[b(" 订单详情 ")])),_:2},1032,["onClick"]),c(M,{class:x(["tool-btn ss-reset-button",{"ui-BG-Main-Gradient":"ing"===t.status}]),onClick:a=>k(l).$router.go("/pages/activity/groupon/detail",{id:t.id})},{default:n((()=>[b(v("ing"===t.status?"邀请拼团":"拼团详情"),1)])),_:2},1032,["class","onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1})):p("",!0),$.pagination.total>0?(r(),i(z,{key:2,status:$.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:D},null,8,["status"])):p("",!0)])),_:1})}}},[["__scopeId","data-v-b2668406"]]);export{M as default};
