newfront/dist/js/550.07384c2a.js
2025-12-04 16:13:47 +08:00

2 lines
4.9 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[550],{1550:function(a,n,t){t.r(n),t.d(n,{default:function(){return z}});t(4114);var e=t(6768),s=t(4232);const i={class:"ranking-page"},r={class:"container"},o={key:0,class:"loading-container"},l={key:1,class:"error-container"},c={key:2,class:"ranking-content"},k={key:0,class:"my-ranking-block"},u={class:"my-rank-content"},d={class:"my-rank-text"},g={class:"value-wrapper"},v={key:0,class:"value unranked"},p={key:1,class:"value ranked"},h={class:"my-rank-tip"},b={key:0,class:"my-rank-opt-out-tip"},y={class:"ranking-list"},m={class:"rank-badge"},P={key:0,class:"medal-icon"},f={key:1,class:"rank-number"},C={class:"user-info-wrapper"},L={class:"contribution-stats"},E={class:"stat-box"},X={class:"stat-value"},w={key:1,class:"pagination"},_=["disabled"],I={class:"page-info"},R=["disabled"];function A(a,n,t,A,q,x){const F=(0,e.g2)("NavBar"),N=(0,e.g2)("UserMeta");return(0,e.uX)(),(0,e.CE)("div",i,[(0,e.bF)(F),(0,e.Lk)("div",r,[n[9]||(n[9]=(0,e.Fv)('<div class="ranking-header" data-v-b24e0f26><h1 class="page-title" data-v-b24e0f26>🏆 投稿排行榜</h1><p class="page-subtitle" data-v-b24e0f26>感谢每一位为 NEU 小站贡献优质内容的创作者❤️</p><div class="ranking-notice" data-v-b24e0f26><i class="info-icon" data-v-b24e0f26></i><span data-v-b24e0f26>本榜单每小时更新一次,综合考量投稿数量、投稿质量及有效浏览量计算得出。榜单前三名用户将获得炫彩昵称特效。</span></div></div>',1)),q.loading?((0,e.uX)(),(0,e.CE)("div",o,n[4]||(n[4]=[(0,e.Lk)("div",{class:"spinner"},null,-1),(0,e.Lk)("p",null,"正在加载排行榜...",-1)]))):q.error?((0,e.uX)(),(0,e.CE)("div",l,[(0,e.Lk)("p",null,(0,s.v_)(q.error),1),(0,e.Lk)("button",{onClick:n[0]||(n[0]=a=>x.fetchRanking(q.currentPage)),class:"retry-btn"},"重试")])):((0,e.uX)(),(0,e.CE)("div",c,[null!==q.myPosition&&void 0!==q.myPosition?((0,e.uX)(),(0,e.CE)("div",k,[(0,e.Lk)("div",u,[(0,e.Lk)("div",d,[n[5]||(n[5]=(0,e.Lk)("span",{class:"label"},"我的当前排名",-1)),(0,e.Lk)("div",g,[-1===q.myPosition?((0,e.uX)(),(0,e.CE)("span",v,"未上榜")):((0,e.uX)(),(0,e.CE)("span",p,"NO."+(0,s.v_)(q.myPosition),1))])]),(0,e.Lk)("div",h,(0,s.v_)(-1===q.myPosition?"您暂未上榜哦~":"太厉害了,感谢您的贡献~"),1)]),-1!==q.myPosition?((0,e.uX)(),(0,e.CE)("div",b,[n[6]||(n[6]=(0,e.eW)(" 您可以在")),(0,e.Lk)("span",{class:"link-text",onClick:n[1]||(n[1]=n=>a.$router.push("/user-center"))},"【个人中心】"),n[7]||(n[7]=(0,e.eW)("—【我的投稿记录】处自愿选择是否加入排行榜。 "))])):(0,e.Q3)("",!0)])):(0,e.Q3)("",!0),(0,e.Lk)("div",y,[((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(q.rankingData,((a,t)=>((0,e.uX)(),(0,e.CE)("div",{key:a.userId,class:(0,s.C4)(["ranking-item",x.getRankClass(a.rank)])},[(0,e.Lk)("div",m,[a.rank<=3?((0,e.uX)(),(0,e.CE)("span",P,(0,s.v_)(x.getMedalIcon(a.rank)),1)):((0,e.uX)(),(0,e.CE)("span",f,(0,s.v_)(a.rank),1))]),(0,e.Lk)("div",C,[(0,e.bF)(N,{id:a.userId},null,8,["id"])]),(0,e.Lk)("div",L,[(0,e.Lk)("div",E,[n[8]||(n[8]=(0,e.Lk)("span",{class:"stat-label"},"投稿数量",-1)),(0,e.Lk)("span",X,(0,s.v_)(a.contributionCount),1)])])],2)))),128))]),q.totalPages>1?((0,e.uX)(),(0,e.CE)("div",w,[(0,e.Lk)("button",{class:"page-btn",disabled:1===q.currentPage,onClick:n[2]||(n[2]=a=>x.changePage(q.currentPage-1))}," 上一页 ",8,_),(0,e.Lk)("span",I,(0,s.v_)(q.currentPage)+" / "+(0,s.v_)(q.totalPages),1),(0,e.Lk)("button",{class:"page-btn",disabled:q.currentPage===q.totalPages,onClick:n[3]||(n[3]=a=>x.changePage(q.currentPage+1))}," 下一页 ",8,R)])):(0,e.Q3)("",!0)]))])])}var q=t(1362),x=t(3108),F=t(4373),N=t(8704),$={name:"RankingView",components:{NavBar:q.A,UserMeta:x.A},data(){return{rankingData:[],loading:!0,error:null,currentPage:1,totalPages:0,limit:20,myPosition:null}},mounted(){const a=parseInt(this.$route.query.page)||1;this.fetchRanking(a),document.title="投稿排行榜 - NEU 小站"},watch:{"$route.query.page"(a){const n=parseInt(a)||1;n!==this.currentPage&&this.fetchRanking(n)}},methods:{async fetchRanking(a){this.loading=!0,this.error=null;try{const n=N.A.get("token"),t={};n&&(t["Authorization"]=n);const e=await F.A.get("https://newfront.xn--xhq44jb2fzpc.com/ranking",{params:{page:a,limit:this.limit},headers:t}),{data:s,totalPages:i,page:r,my_position:o}=e.data;this.rankingData=s,this.totalPages=i,this.currentPage=r,this.myPosition=o,window.scrollTo({top:0,behavior:"smooth"})}catch(n){console.error("Failed to fetch ranking:",n),this.error="获取排行榜数据失败,请稍后重试"}finally{this.loading=!1}},changePage(a){a>=1&&a<=this.totalPages&&this.$router.push({query:{...this.$route.query,page:a}})},getRankClass(a){return 1===a?"rank-gold":2===a?"rank-silver":3===a?"rank-bronze":""},getMedalIcon(a){const n=["🥇","🥈","🥉"];return n[a-1]||""}}},M=t(1241);const U=(0,M.A)($,[["render",A],["__scopeId","data-v-b24e0f26"]]);var z=U}}]);
//# sourceMappingURL=550.07384c2a.js.map