import{_ as a,aj as e,s,u as t,az as l,m as i,f as o,r,eK as c,bF as n,o as d,c as m,d as u,W as g,t as p,v,b as A,F as h,g as y,aF as U,e as E,a0 as k,p as C,$ as N,q as f,a as G,bI as V,E as b,bJ as B,bH as j}from"./index-BhrLSE9x.js";import{_ as S,a as _}from"./theme-C6sWowPh.js";import{L as z}from"./index-CWkD8ML6.js";/* empty css                                                              */const F={class:"favorite-list"},I={class:"tips"},x={class:"num"},w={class:"lists"},M={class:"item-wrapper"},P=["onClick"],q={class:"tags"},K={key:1,class:"tag ellipsis"},L={class:"img-box"},Q=["data-src","data-error"],R=["onClick","src"],Y=["onClick"],J={key:2,class:"maintain"},T={key:1,class:"more"},Z={key:1,class:"empty"},D=["src"],W=a({__name:"favoriteList",setup(a,{expose:W}){const O=new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAMAAABG8BK2AAAAM1BMVEUAAABVUEpYUEhWUEpVUElVUElVUElVUElQUFBVUElUUEhWUElWUEpVUElXUElTUElVUEkKNPNHAAAAEHRSTlMAnyCA379g7xCQQK8wz3BQu6ngDQAAAVhJREFUWMPtltuSwiAMhiFAQs95/6fdcSqbuBwsU71avrtq/Az/BKgZDAb/hJ34OttasUTuIlQ0wF34hmaz16C2xplrhKEZmi9r7Ec0yNMHNOCZ8b7GMjOtdzRybPh4U+ObhxPgckmD/KA1ArGlkXwTR9YI4gzy3NJM/AuBrpnoeaLjBQ2woGN2+mN8q1lYY1PBxi+4NxrkV/YzU89/cG1NVj+f83gScE8FR0vj8jsJjEF1P80p/ljXAAuqnU2vRJZV1VjOIGNWfrLof/JVDZbv610pzcEJqGk850x6BkBPJ1Y0eb6nPcgv9cNe1gDVNdIayTdljWV+t6ggcdcWtXARq+OgiGoSck3zlehQUi/KvrctMJGKbfZpnNoiYUUSfZeGomzwVYKypqRptzNLqgvX741IrXZkj/spWcCUmG0D9yjwrAhi6QQsqaP4BhFt8H6ZZjMYDL7ID9MvRjXvYVkzAAAAAElFTkSuQmCC",import.meta.url).href,X=e(),{userInfo:H}=s(X),$=t(),aa=l(),{theme:ea}=i();o((()=>{ia()}));const sa=r(!1),ta=r(!1),la=r({pageNo:1,list:[],totalCount:0,pageSize:24}),ia=async(a=!1)=>{if(!H.value.token)return;a&&(la.value.pageNo=1,la.value.list=[],la.value.totalCount=0,sa.value=!0,ta.value=!1);const e={pageNo:la.value.pageNo,pageSize:la.value.pageSize,queryType:1};try{sa.value=!0;const a=await c(e),{totalCount:s,pageNo:t}=a.data;let{records:l}=a.data;l=l||[],la.value.totalCount=s||0,1===t?la.value.list=l:la.value.list.push(...l),sa.value=!1,la.value.list.length>=s?ta.value=!0:la.value.pageNo++}catch(s){sa.value=!1,ta.value=!0}},oa={0:"",1:"NEW",2:"热门",3:"推荐"},ra={0:"",1:"#4B64AC",2:"#EB544D",3:"#EB544D"},ca=async a=>{H.value.token?1==+a.isFavorite?V({thirdSubGameId:a.gameId?a.gameId:a.id}).then((()=>{la.value.list.forEach((e=>{e.id===a.id&&(e.isFavorite=0)})),b({message:"取消收藏成功!",type:"success"})})):B({thirdSubGameId:a.gameId?a.gameId:a.id}).then((()=>{la.value.list.forEach((e=>{e.id===a.id&&(e.isFavorite=1)})),b({message:"收藏成功!",type:"success"})})):$.setLoginShowAction(!0)};return W({getFavoriteList:ia}),(a,e)=>{const s=j,t=n("lazy-container");return d(),m("div",F,[u("div",I,[e[1]||(e[1]=g(" 我已收藏了")),u("span",x,p(la.value.totalCount),1),e[2]||(e[2]=g(" 款游戏 "))]),u("div",w,[la.value.list.length>0?(d(),v(s,{key:0},{default:A((()=>[u("div",M,[(d(!0),m(h,null,y(la.value.list,(a=>(d(),m("div",{class:"items",key:a.id,onClick:e=>(async a=>{if(!H.value.token)return void $.setLoginShowAction(!0);if("ZYCP"===a.thirdGameCode)return void aa.push({path:"/home/lottery",query:{lotteryId:a.gameCode??80032}});const e={thirdGameCode:a.thirdGameCode,gameCode:a.gameCode||a.pcRedirectParam||"",gameName:a.gameName||a.thirdGameName,id:a.id};aa.push({name:"ThirdGame",params:{game:JSON.stringify(e)}})})(a)},[u("div",q,[0!==a.cornerType?(d(),m("span",{key:0,class:"tag tag1",style:U({"background-color":ra[a.cornerType]})},p(oa[a.cornerType]),5)):E("",!0),a.thirdGameShortName?(d(),m("span",K,p(a.thirdGameShortName),1)):E("",!0)]),k((d(),m("div",L,[u("img",{class:"img","data-src":a.gamePcLogoUrl?a.gamePcLogoUrl:C(O),"data-error":C(O),alt:""},null,8,Q)])),[[t,{selector:"img"}]]),1===a.isFavorite?(d(),m("img",{key:0,onClick:N((e=>ca(a)),["stop"]),class:"icon",src:C(f)(`main/collected_${C(ea)}.png`),alt:""},null,8,R)):(d(),m("img",{key:1,class:"icon",onClick:N((e=>ca(a)),["stop"]),src:S,alt:""},null,8,Y)),1===a.isMaintain?(d(),m("div",J,"维护中")):E("",!0)],8,P)))),128))]),ta.value?(d(),m("div",T,e[4]||(e[4]=[u("span",{class:"text"},"已全部加载完",-1)]))):(d(),m("div",{key:0,class:"more",onClick:e[0]||(e[0]=a=>ia(!1))},e[3]||(e[3]=[u("span",{class:"text"},"加载更多",-1),u("img",{class:"icon",src:_,alt:""},null,-1)])))])),_:1})):(d(),m("div",Z,[u("img",{class:"img",src:C(f)(`games/empty_${C(ea)}.png`),alt:""},null,8,D),e[5]||(e[5]=u("div",{class:"des"},"暂无数据",-1))])),G(z,{loading:sa.value},null,8,["loading"])])])}}},[["__scopeId","data-v-d0bcf272"]]);export{W as default};
