import{t as J,r as s,aN as N,aO as h,aP as y,s as m,aQ as d,aR as A}from"./index-xnhGKCfe.js";const x=()=>{const o=s(!1),e=s({pageNum:1,pageSize:20,total:0,totalCount:0}),r=s([]),n=s([]),l=s(!1),i=s(!1),g=s({}),p=s([]),S=J(),c=async t=>{try{o.value=!0;const u={pageNo:e.value.pageNum,pageSize:e.value.pageSize};t!==void 0&&(u.receiveState=t);const{data:a}=await A(u);r.value.push(...(a==null?void 0:a.list)||[]),e.value.total=(a==null?void 0:a.totalPage)||0,e.value.totalCount=(a==null?void 0:a.totalCount)||0,l.value=e.value.pageNum>=e.value.total,o.value=!1}catch{o.value=!1,l.value=!0}},k=async()=>{l.value||f()},w=async()=>{l.value||(e.value.pageNum++,v())},v=async t=>{try{o.value=!0;const u={pageNo:e.value.pageNum,pageSize:e.value.pageSize};t!==void 0&&(u.receiveState=t);const{data:a}=await N(u);n.value.push(...(a==null?void 0:a.list)||[]),e.value.total=(a==null?void 0:a.totalPage)||0,e.value.totalCount=(a==null?void 0:a.totalCount)||0,l.value=e.value.pageNum>=e.value.total,o.value=!1}catch{o.value=!1,l.value=!0}},f=()=>{e.value.pageNum<e.value.total&&(e.value.pageNum++,c())};return{loading:o,pageInfo:e,superJackpotList:r,getSuperJackpotList:c,nextPage:f,prevPage:()=>{e.value.pageNum>1&&(e.value.pageNum--,c())},getSuperJackpotAward:async t=>{try{o.value=!0;const{code:u,data:a}=await d(t);u===0&&(i.value=!0,g.value=a,r.value=[],e.value.pageNum=1,c())}catch{m({message:"领取失败"})}},receiveAllBigJackpotAward:async()=>{try{o.value=!0;const{code:t,data:u}=await y();t===0&&(i.value=!0,g.value=u,r.value=[],e.value.pageNum=1,c())}catch{m({message:"领取失败"})}},finished:l,getSuperJackpotConfig:async()=>{try{const{data:t}=await h();t&&(p.value=t||[])}catch{}},superJackpotConfig:p,showDialog:i,arardData:g,goBet:()=>{S.push({path:"/"})},getWinStarList:v,winStarList:n,listLoad:k,winStartLoad:w}};export{x as u};
