2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
import{L as H,_ as ce,w as be,j as A,c as O,b as e,D as b,n as h,q as s,Q as U,t as c,v as X,S as _,an as ve,k as Ae,r as n,a$ as _e,o as Te,i as xe,Y as J,l as C,ac as Ie,ay as ie,F as Re,x as Ce,G as ne,m as re,J as Be,X as se,b0 as Oe,a_ as Se}from"./index-CIAVq8iD-1776148658686.js";import{_ as K}from"./coin-Dqu2_ND9-1776148658686.js";import{c as Ue}from"./appConnector-B5Pbaops-1776148658686.js";import{p as Fe}from"./imagePreloader-C_QM-Nv8-1776148658686.js";import{g as Ee}from"./imagePaths-Bi1Bwe4Z-1776148658686.js";import{h as B}from"./imageHandler-DstQGL3Z-1776148658686.js";import{B as ue}from"./BackgroundLayer-DJYogygx-1776148658686.js";import{i as de}from"./itemCenter-DveKthYv-1776148658686.js";const De="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADxSURBVHgB7dvBDYJAFEXRHyuhBEuzA+3EWAmlUIJ2MDJCNATy5m1I1H9PwoZhww3Mgh8iAAAAAACllG48joGlOUxfPoZ6LvCOM5S1PrITcV4is1acuhY7O8SXmveX+gp14rJbZGQ8OdUlMiKOQByBOAJxBOIIxBGIIxBHII5AHIE4AnEE4gjEEYgjEKeBOMJ488d/irPHN+lHYz33JKIqywHflnNkZm7SRCJSA5EMRDIQyUAkA5EMRDIQyUAkA5EMRDIQyUAkA5EMRDIQyWBGOkVmRqR7ZNeKFJCRroHJRqS+8DvUWpkGk10AAAAAwO96AiOznp1YXpZWAAAAAElFTkSuQmCC",Me=async()=>{try{return await H("/activity/leaderboard/gifts-send")}catch(i){throw console.error("Failed to fetch get wealth ranking:",i),console.error("error:"+i.response.errorMsg),i}},We=async()=>{try{return await H("/activity/leaderboard/gifts-received")}catch(i){throw console.error("Failed to fetch get charm ranking:",i),console.error("error:"+i.response.errorMsg),i}},$e=async()=>{try{return await H("/activity/leaderboard/room-gifts")}catch(i){throw console.error("Failed to fetch get room ranking:",i),console.error("error:"+i.response.errorMsg),i}},je=async(i,a)=>{try{return await H(`/activity/leaderboard/my-rank?type=${i}&dateType=${a}`)}catch(v){throw console.error("Failed to fetch get my ranking:",v),console.error("error:"+v.response.errorMsg),v}},He={style:{width:"100%"}},Ve=["src"],ze=["src"],Ge={style:{position:"absolute",bottom:"0",left:"0",right:"0","z-index":"3",display:"flex","flex-direction":"column","justify-content":"flex-end","align-items":"center",gap:"1vw"}},Ne={style:{display:"flex","justify-content":"center","align-items":"center",gap:"2px",padding:"3px 5px"}},Pe={src:K,alt:"",style:{display:"block",width:"1.3em","object-fit":"cover"}},qe={__name:"topUser",props:{Type:{type:Boolean,default:""},isTopOne:{type:Boolean,default:!1},avatarUrl:{type:String,default:"/src/assets/icon/Atu/defaultAvatar.png"},BorderImgUrl:{type:String,required:!0},name:{type:String,default:""},distributionValue:{type:String,default:""}},setup(i){const a=i;be(()=>a.Type,(d,g)=>{console.log("Type 变化 =>","新值:",d,"旧值:",g)});const v=_(()=>{if(a.Type=="Wealth")return a.isTopOne?"76.5vw":"44vw";if(a.Type=="Charm")return a.isTopOne?"80vw":"44vw";if(a.Type=="Room")return a.isTopOne?"76vw":"52vw"}),Z=_(()=>{if(a.Type=="Wealth")return a.isTopOne?"height:110%":"height:72%";if(a.Type=="Charm")return a.isTopOne?"height:98%":"height:74%";if(a.Type=="Room")return a.isTopOne?"height:110%":"height:80%"}),o=_(()=>{if(a.Type=="Wealth")return a.isTopOne?"31%":"45%";if(a.Type=="Charm")return a.isTopOne?"30%":"45%";if(a.Type=="Room")return a.isTopOne?"30%":"50%"}),F=_(()=>{if(a.Type=="Wealth")return a.isTopOne?"height: 8vw;width: 30%;":"height: 5vw;width: 50%;";if(a.Type=="Charm")return a.isTopOne?"height: 10vw;width: 40%;":"height: 5vw;width: 40%;";if(a.Type=="Room")return a.isTopOne?"height: 7vw;width: 28%;":"height: 4.5vw;width: 40%;"}),r=_(()=>{if(a.Type=="Wealth")return a.isTopOne?"30%":"50%";if(a.Type=="Charm")return a.isTopOne?"35%":"50%";if(a.Type=="Room")return a.isTopOne?"30%":"50%"});return(d,g)=>{const f=ve("smart-img");return A(),O("div",He,[e("div",{style:h([{position:"relative"},{minHeight:v.value}])},[b((A(),O("img",{src:i.BorderImgUrl,key:i.BorderImgUrl,alt:"",width:"100%",style:{display:"block",position:"relative","z-index":"2"}},null,8,Ve)),[[f]]),e("div",{style:h([{position:"absolute",top:"0",left:"0",right:"0","z-index":"1",display:"flex","justify-content":"center","align-items":"center"},Z.value])},[e("div",{style:h({width:o.value})},[e("img",{src:i.avatarUrl||"",alt:"",width:"100%",style:{display:"block","aspect-ratio":"1/1","border-radius":"50%","object-fit":"cover"},onError:g[0]||(g[0]=(...p)=>s(B)&&s(B)(...p))},null,40,ze)],4)],4),e("div",Ge,[e("div",{style:h([{display:"flex","justify-content":"center","align-items":"center"},F.value])},[e("div",{style:{"font-weight":"860"},class:U(["showText",i.isTopOne?"top1Text":"text"])},c(i.name),3)],4),i.distributionValue?(A(),O("div",{key:0,style:h([{position:"relative","border-radius":"80px",border:"1px solid #ffdf36",background:"linear-gradient(270deg, #000 0%, #3b3b3b 47.45%, #000 100%)","box-shadow":"0 0 4px 0 rgba(0, 0, 0, 0.4) inset"},{width:r.value}])},[e("div",Ne,[b(e("img",Pe,null,512),[[f]]),e("div",{style:{"font-weight":"700",background:"linear-gradient(180deg, #ffe656 0%, #fff 100%)","background-clip":"text","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"},class:U(["showText",i.isTopOne?"top1Text":"text"])},c(i.distributionValue),3)])],4)):X("",!0)])],4)])}}},Q=ce(qe,[["__scopeId","data-v-7e43213b"]]),Le={class:"loading-container"},Ye={style:{position:"relative","z-index":"4"}},Je={style:{padding:"4px 8%"}},Qe={style:{display:"flex","justify-content":"space-around",position:"relative"}},Xe={style:{margin:"1vw 6vw 4vw",padding:"4px","border-radius":"32px",border:"1px solid #b2a67d",background:"linear-gradient(90deg, #0d0d0d 0%, #232323 100%)","backdrop-filter":"blur(32px)",display:"grid","grid-template-columns":"repeat(3, 1fr)"}},Ke={style:{}},Ze={style:{margin:"0 10px"}},et={style:{display:"flex","justify-content":"center"}},tt={style:{display:"flex","justify-content":"space-between","margin-top":"0"}},at={style:{padding:"3vw 3vw 0",display:"flex","flex-direction":"column",gap:"2vw"}},lt={style:{flex:"1","min-width":"0","align-self":"stretch",display:"flex","justify-content":"space-around","align-items":"center",gap:"8px"}},ot={style:{width:"auto","min-width":"0","align-self":"stretch",display:"flex","justify-content":"center","align-items":"center"}},it={style:{"font-weight":"700"}},nt=["src"],rt={style:{flex:"1","min-width":"0",padding:"0 4px","font-weight":"700",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},st={style:{width:"auto","min-width":"0","align-self":"stretch",display:"flex","align-items":"center"}},ut={src:K,alt:"",style:{display:"block",width:"1.3em","aspect-ratio":"1/1"}},dt={style:{"font-weight":"500",color:"rgba(248, 182, 45, 1)"}},ct={key:0,style:{height:"26vw"}},vt={style:{flex:"1","min-width":"0","align-self":"stretch",display:"flex","justify-content":"space-around","align-items":"center",gap:"8px"}},gt={style:{width:"auto","min-width":"0","align-self":"stretch",display:"flex","justify-content":"center","align-items":"center"}},pt={style:{"font-weight":"700"}},yt=["src"],mt={style:{flex:"1","min-width":"0","font-weight":"700",padding:"0 4px",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},ht={style:{width:"auto","min-width":"0","align-self":"stretch",display:"flex","align-items":"center"}},ft={src:K,alt:"",style:{display:"block",width:"1.3em","aspect-ratio":"1/1"}},kt={style:{"font-weight":"500",color:"rgba(248, 182, 45, 1)"}},wt={__name:"Ranking",setup(i){const a=Be(),{t:v,locale:Z}=Ae(),o=t=>Ee("Ranking/Overall/",t),F=n(!1),r=n(a.query.first||"Wealth"),d=n("Daily"),g=n("GIFTS_SEND"),f=n("DAY"),p=n({}),y=n([]),k=n({}),S=n(!0),V=n(null),x=n(!0),T=n(10),ee=_(()=>r.value=="Wealth"?o("bgWealth"):r.value=="Charm"?o("bgCharm"):r.value=="Room"?o("bgRoom"):""),ge=async()=>{const t=[o("bgWealth"),o("bgCharm"),o("bgRoom"),o("top1-wealth"),o("top1-charm"),o("top1-room"),o("top2"),o("top3"),o("top2-room"),o("top3-room")];await Fe(t)},te=()=>{console.log("updateTimeRanking()//筛选展示榜单"),d.value=="Hourly"&&p.value.hourly?(y.value=p.value.hourly,console.log("showRanking.value:",y.value)):d.value=="Daily"&&p.value.daily?y.value=p.value.daily:d.value=="Weekly"&&p.value.weekly?y.value=p.value.weekly:d.value=="Monthly"&&p.value.monthly&&(y.value=p.value.monthly),T.value=10,x.value=!0},z=se(t=>{r.value!=t&&(console.log("改变rankingType"),r.value=t,d.value="Daily",f.value="DAY",t=="Wealth"?g.value="GIFTS_SEND":t=="Charm"?g.value="GIFTS_RECEIVED":t=="Room"&&(g.value="ROOM_GIFTS"),p.value={},y.value=[],k.value={},T.value=10,x.value=!0,le(),Y())},1e3),G=se(t=>{d.value!=t&&(console.log("改变rankingType"),d.value=t,t=="Hourly"?f.value="HOUR":t=="Daily"?f.value="DAY":t=="Weekly"?f.value="WEEK":t=="Monthly"&&(f.value="MONTH"),y.value=[],k.value={},te(),Y())},500),m=_(()=>{console.log("刷新RankingTop3");let t=[...y.value];if(y.value.length<3){let l=Array.from({length:3-y.value.length},()=>({avatar:"",nickname:"",quantityFormat:""}));t.push(...l)}return t}),pe=_(()=>y.value.filter((l,w)=>w>=3).slice(0,T.value)),ye=n(""),N=n(""),P=n(""),I=n(""),q=n(""),L=n(""),E=n(""),D=n(""),M=n(""),ae=n(null),W=n(null);_e(()=>{r.value=="Wealth"&&(E.value=o("top1-wealth"),D.value=o("top2"),M.value=o("top3"),I.value=o("tabSelectedBg"),N.value="1px solid rgba(221, 114, 0, 0.39)",P.value="rgba(252, 194, 147, 0.20)",q.value="linear-gradient(97deg, rgba(50, 34, 21, 0.60) 12.03%, rgba(99, 52, 33, 0.60) 100.37%)",L.value="solid #FFA166",g.value="GIFTS_SEND"),r.value=="Charm"&&(E.value=o("top1-charm"),D.value=o("top2"),M.value=o("top3"),I.value=o("tabSelectedBg"),N.value="1px solid rgba(0, 221, 74, 0.39)",P.value="rgba(147, 252, 166, 0.20)",q.value="linear-gradient(97deg, rgba(21, 50, 22, 0.60) 12.03%, rgba(33, 99, 40, 0.60) 100.37%)",L.value="solid #66FF82",g.value="GIFTS_RECEIVED"),r.value=="Room"&&(E.value=o("top1-room"),D.value=o("top2-room"),M.value=o("top3-room"),I.value=o("tabSelectedBg"),N.value="1px solid rgba(155, 0, 221, 0.39)",P.value="rgba(219, 147, 252, 0.20)",q.value="linear-gradient(97deg, rgba(33, 21, 50, 0.60) 12.03%, rgba(60, 33, 99, 0.60) 100.37%)",L.value="solid #A366FF",g.value="ROOM_GIFTS")});const me=new IntersectionObserver(t=>{t.forEach(l=>{l.isIntersecting?W.value.classList.remove("stuck"):(console.log("哨兵元素离开视口"),W.value?(W.value.classList.add("stuck"),console.log("添加stuck类")):console.log("元素未找到!"))})}),he=new IntersectionObserver(t=>{t.forEach(l=>{if(l.isIntersecting&&x.value){console.log("触发上拉加载更多");const w=y.value.filter((u,j)=>j>=3).length,R=T.value;R<w?(T.value=Math.min(R+10,w),console.log(`已加载 ${T.value} 条数据,总共 ${w} 条`),T.value>=w&&(x.value=!1,console.log("没有更多数据了"))):(x.value=!1,console.log("没有更多数据了"))}})},{rootMargin:"100px"}),$=t=>{F.value&&(r.value=="Room"?Oe(t):Se(t))},le=async()=>{console.log("获取榜单");let t={};r.value=="Wealth"?t=await Me():r.value=="Charm"?t=await We():r.value=="Room"&&(t=await $e()),t.status&&t.body&&(p.value=t.body,te())},Y=async()=>{console.log("获取我的排名");const t=await je(g.value,f.value);t.status&&t.body?k.value=t.body:k.value={}},fe=async()=>{await Promise.all([le(),Y()])},ke=async()=>{try{await Promise.all([fe(),ge()])}catch(t){console.error("预加载过程中发生错误:",t)}finally{S.value=!1}},we=async()=>{await Ue(()=>{ke()})};return Te(()=>{we(),F.value=xe(),me.observe(ae.value),V.value&&he.observe(V.value)}),(t,l)=>{const w=Ie,R=ve("smart-img");return A(),O("div",{class:"fullPage",style:h({backgroundColor:ye.value})},[b(e("div",Le,[C(ue,{backgroundImages:[ee.value]},null,8,["backgroundImages"]),C(w),e("p",null,c(t.$t("loading"))+"...",1)],512),[[J,S.value]]),b(e("div",Ye,[C(ue,{backgroundImages:[ee.value],layerStyle:{zIndex:-1}},null,8,["backgroundImages"]),e("div",{ref_key:"sentinel",ref:ae},null,512),e("div",{ref_key:"stickyHeader",ref:W,style:{position:"sticky",top:"0","z-index":"999","border-radius":"0 0 12px 12px",transition:"all 0.3s",height:"35vw"}},[l[12]||(l[12]=e("div",{style:{height:"13vw"}},null,-1)),e("div",Je,[e("div",Qe,[e("div",{class:"tab",onClick:l[0]||(l[0]=u=>s(z)("Wealth")),style:h([{},{color:r.value=="Wealth"?"#FF9500":"#fff"}])},c(s(v)("ranking_wealth")),5),e("div",{class:"tab",onClick:l[1]||(l[1]=u=>s(z)("Charm")),style:h([{},{color:r.value=="Charm"?"#FF9500":"#fff"}])},c(s(v)("ranking_charm")),5),e("div",{class:"tab",onClick:l[2]||(l[2]=u=>s(z)("Room")),style:h([{},{color:r.value=="Room"?"#FF9500":"#fff"}])},c(s(v)("ranking_room")),5),b(e("img",{src:De,alt:"",style:{position:"absolute",left:"-4%",top:"45%",transform:"translateY(-50%)"},width:"6%",onClick:l[3]||(l[3]=(...u)=>s(ie)&&s(ie)(...u))},null,512),[[R]])])]),e("div",Xe,[e("div",{class:"tabItem",style:h(d.value=="Daily"?{backgroundImage:`url(${I.value})`,backgroundSize:"100% 100%",backgroundRepeat:"no-repeat",backgroundPosition:"center"}:{})},[e("div",{class:U(["tag",{tagActive:d.value=="Daily"}]),onClick:l[4]||(l[4]=u=>s(G)("Daily"))},c(s(v)("ranking_daily")),3)],4),e("div",{class:"tabItem",style:h(d.value=="Weekly"?{backgroundImage:`url(${I.value})`,backgroundSize:"100% 100%",backgroundRepeat:"no-repeat",backgroundPosition:"center"}:{})},[e("div",{class:U(["tag",{tagActive:d.value=="Weekly"}]),onClick:l[5]||(l[5]=u=>s(G)("Weekly"))},c(s(v)("ranking_weekly")),3)],4),e("div",{class:"tabItem",style:h(d.value=="Monthly"?{backgroundImage:`url(${I.value})`,backgroundSize:"100% 100%",backgroundRepeat:"no-repeat",backgroundPosition:"center"}:{})},[e("div",{class:U(["tag",{tagActive:d.value=="Monthly"}]),onClick:l[6]||(l[6]=u=>s(G)("Monthly"))},c(s(v)("ranking_monthly")),3)],4)])],512),e("div",Ke,[e("div",Ze,[e("div",et,[C(Q,{Type:r.value,isTopOne:!0,BorderImgUrl:E.value,avatarUrl:m.value[0].avatar||"",name:m.value[0].nickname||"",distributionValue:m.value[0].quantityFormat||"",style:{width:"85%"},onClick:l[7]||(l[7]=u=>$(m.value[0].id))},null,8,["Type","BorderImgUrl","avatarUrl","name","distributionValue"])]),e("div",tt,[C(Q,{Type:r.value,BorderImgUrl:D.value,avatarUrl:m.value[1].avatar||"",name:m.value[1].nickname||"",distributionValue:m.value[1].quantityFormat||"",style:{width:"43%"},onClick:l[8]||(l[8]=u=>$(m.value[1].id))},null,8,["Type","BorderImgUrl","avatarUrl","name","distributionValue"]),C(Q,{Type:r.value,BorderImgUrl:M.value,avatarUrl:m.value[2].avatar||"",name:m.value[2].nickname||"",distributionValue:m.value[2].quantityFormat||"",style:{width:"43%"},onClick:l[9]||(l[9]=u=>$(m.value[2].id))},null,8,["Type","BorderImgUrl","avatarUrl","name","distributionValue"])])]),e("div",at,[(A(!0),O(Re,null,Ce(pe.value,(u,j)=>(A(),ne(de,{style:{"min-height":"19vw"},key:u.id,imgUrl:o("RankingItem"),contentStyle:"padding: 3vw;justify-content: space-between;gap: 8px;",lazy:!0,immediate:j<10,onClick:oe=>$(u.id)},{default:re(()=>[e("div",lt,[e("div",ot,[e("div",it,c(j+4),1)]),e("img",{src:u.avatar||"",alt:"",style:{display:"block",width:"3em","aspect-ratio":"1/1","border-radius":"50%","object-fit":"cover"},onError:l[10]||(l[10]=(...oe)=>s(B)&&s(B)(...oe))},null,40,nt),e("div",rt,c(u.nickname),1)]),e("div",st,[b(e("img",ut,null,512),[[R]]),e("div",dt,c(u.quantityFormat),1)])]),_:2},1032,["imgUrl","immediate","onClick"]))),128)),b(e("div",{ref_key:"RankingLoadmore",ref:V},null,512),[[J,x.value]])])])],512),[[J,!S.value]]),S.value?X("",!0):(A(),O("div",ct)),S.value?X("",!0):(A(),ne(de,{key:1,style:{"min-height":"25vw",position:"fixed",bottom:"0","z-index":"999",padding:"0 1px"},imgUrl:o("myRankingBg"),contentStyle:"padding:4vw 4vw 0;justify-content: space-between;gap: 8px;"},{default:re(()=>[e("div",vt,[e("div",gt,[e("div",pt,c(k.value.rank||999),1)]),e("img",{src:k.value.avatar||"",alt:"",style:{display:"block",width:"3em","aspect-ratio":"1/1","border-radius":"50%","object-fit":"cover"},onError:l[11]||(l[11]=(...u)=>s(B)&&s(B)(...u))},null,40,yt),e("div",mt,c(k.value.nickname||""),1)]),e("div",ht,[b(e("img",ft,null,512),[[R]]),e("div",kt,c(k.value.quantityFormat||0),1)])]),_:1},8,["imgUrl"]))],4)}}},St=ce(wt,[["__scopeId","data-v-93c53aed"]]);export{St as default};
|