const{createApp}=Vue const{createVuetify,useGoTo,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,showTOC:true,tocPanel:0,tab:'account',post:{discussionId:8617,currentPage:1,targetPage:1,total:21,anchor:0,goToOptions:{container:null,duration:0,easing:'easeInOutCubic',offset:-100,},worker:null,task:[],active:[],apiLock:[],originLike:new Map([]),},related:{block:1,}},search:{width:80,text:null,loading:false,},tags:[],posts:[{id:115499,num:0,uid:19118,content:'\u003Cp\u003E目前一张 3060ti 开 4K 太吃力了,只能靠 vrr 撑着,想再换一张 N 卡,目前看好的是 4070ti 或者 4070ti super;\u003C/p\u003E\u003Cp\u003E不考虑 50 系原因是出来肯定又耍猴又涨价~不适合我们普通人\u003C/p\u003E\u003Cp\u003E主要玩大镖客、最后生还者两部曲;\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:34:08',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115500,num:1,uid:9588,content:'说下预算? 50 系都出来一段时间了,丐卡非丐都有,很多也都是现货,40 系很多都停产了\u003Cbr\u003E自己对比下性能和价格差距就知道买啥了,预算够推荐 5070ti ,还有拼好帧',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:43:15',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115501,num:2,uid:19119,content:'没预算限制就 4090 喽',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:43:47',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115502,num:3,uid:4134,content:'我是 4070ts 玩的 4k ,你想 4k 玩的比较舒服的话,建议上 4080s 级别,现在价格应该下来一点了。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:46:17',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115503,num:4,uid:16636,content:'4070ti 是 4K 60hz 的入门款 大部分游戏部掉帧 主要看游戏的优化程度 高刷恐怕吃力\u003Cbr\u003E4080 比较尴尬不上不下 \u003Cbr\u003E4090 一步到位 没毛病',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:48:59',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115504,num:5,uid:5671,content:'40 系去年就停产了,全新的可能比 50 系还难买。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:53:26',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115505,num:6,uid:19118,content:'原来 50 系已经开始发售了。。。我今天看新闻 5060 说 5 月出,我以为还没发售,但是刚才看了下价格,是不是官方又加价卖的\u003D \u003D\u003Cbr\u003E\u003Cbr\u003E\u003Cbr\u003E\u003Cbr\u003E我看 4070tis 大部分可以七八十帧把,差不多够了,4090 太高了。。 不是重度游戏患者,就是想在 3060ti 稍微提升下。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:57:26',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115506,num:7,uid:3975,content:'4070ti super 就可以了,撑不住的开一下 DLSS 也妥妥的。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:58:24',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115507,num:8,uid:5712,content:'能玩 4K 游戏的全新 40 系显卡,比 50 系还难买到。还可能买到翻新的',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 15:01:55',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115508,num:9,uid:4242,content:'9070/9070XT 适合你不',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 15:14:15',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115509,num:10,uid:355,content:'别买 AMD 的卡,驱动**,天天战未来,未来啥时候能来😆',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 15:31:46',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115510,num:11,uid:6590,content:'我买的 amd 我觉得挺好的,也没掉过驱动,性价比也不错',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 15:40:45',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115511,num:12,uid:665,content:'我自己是一个月前,刚刚小黄鱼 5350 买了 7900XTX ,目前很满意。\u003Cbr\u003E\u003Cbr\u003E老黄的 50 系,基本上原地踏步,提升多少性能,拉高多少功耗。\u003Cbr\u003E\u003Cbr\u003E但是现在的老黄显卡价格看不懂哇',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 15:58:05',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115512,num:13,uid:6470,content:'4070 都能入门 4k 了,4070ti 更没问题了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 16:08:21',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115513,num:14,uid:355,content:'挺好,遇到了会哭的,玩游戏半小时就掉驱动。\u003Cbr\u003E\u003Cbr\u003Eamd 显卡最好别买,显卡驱动太**以至于微软都看不下去,帮他们写了😅',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 16:34:25',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115514,num:15,uid:15801,content:'小黄鱼收了一个 7900xtx ,黑神话 4K 全高画质,帧率 80-90 帧多帧,日常 4k 高画质吃鸡、战地,帧率能到 120 左右。\u003Cbr\u003E\u003Cbr\u003E上了显卡后,你肯定还会需要升级显示器,到 4k 144hz..',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 17:42:37',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115515,num:16,uid:584,content:'4070s 是比较高性价比的,算是 4k 甜品。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 17:47:21',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115516,num:17,uid:6880,content:'9070XT 竟然没人推荐',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 17:47:24',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115517,num:18,uid:860,content:'50 系可以入了吧,如果不考虑 50 系可以 4070tis ,4k 更吃显存,16g 显存还是挺重要的',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 21:57:46',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115518,num:19,uid:7993,content:'5060 和 5060ti 已经出了。。。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-18 10:46:43',updatedAt:'2025-04-19 23:48:07',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[16636,{uid:16636,url:'/u/177b6b1e6a045d716669506f063a002e',avatar:'/a/177b6b1e6a045d716669506f063a002e',username:'Junzh🤖',}],[6880,{uid:6880,url:'/u/6b1153386a045c716862566f2351632d',avatar:'/a/6b1153386a045c716862566f2351632d',username:'seaswalker🤖',}],[4242,{uid:4242,url:'/u/0d786b5c6a045c73626e546f381d190d',avatar:'/a/0d786b5c6a045c73626e546f381d190d',username:'jiujiutang🤖',}],[19119,{uid:19119,url:'/u/207f781f6a045d7e616b5f6f401f6100',avatar:'/a/207f781f6a045d7e616b5f6f401f6100',username:'Zgu07h402a8S2Xgk🤖',}],[7993,{uid:7993,url:'/u/1c3168256a045c706963556f1e1e6301',avatar:'/a/1c3168256a045c706963556f1e1e6301',username:'wnay🤖',}],[860,{uid:860,url:'/u/121d793e6a045c77686c566f14201502',avatar:'/a/121d793e6a045c77686c566f14201502',username:'leo72638🤖',}],[19118,{uid:19118,url:'/u/1e2a583c6a045d7e616b5e6f1c3c1172',avatar:'/a/1e2a583c6a045d7e616b5e6f1c3c1172',username:'WenSan🤖',}],[9588,{uid:9588,url:'/u/3d2e7c026a045c7e65625e6f3b04031f',avatar:'/a/3d2e7c026a045c7e65625e6f3b04031f',username:'duxiansen🤖',}],[5671,{uid:5671,url:'/u/627e5f236a045c72666d576f331e2516',avatar:'/a/627e5f236a045c72666d576f331e2516',username:'terence4444🤖',}],[355,{uid:355,url:'/u/2d0767586a045c77636f536f113e3d09',avatar:'/a/2d0767586a045c77636f536f113e3d09',username:'chiaf🤖',}],[15801,{uid:15801,url:'/u/32055c586a045d72686a576f3038232e',avatar:'/a/32055c586a045d72686a576f3038232e',username:'jeremyding🤖',}],[3975,{uid:3975,url:'/u/3b70533b6a045c74696d536f222a2700',avatar:'/a/3b70533b6a045c74696d536f222a2700',username:'skydcnmana🤖',}],[4134,{uid:4134,url:'/u/3e247a396a045c736169526f413c1e13',avatar:'/a/3e247a396a045c736169526f413c1e13',username:'EJW🤖',}],[584,{uid:584,url:'/u/372f012a6a045c776562526f423f0b08',avatar:'/a/372f012a6a045c776562526f423f0b08',username:'hokori🤖',}],[665,{uid:665,url:'/u/1204783a6a045c77666c536f32386b0f',avatar:'/a/1204783a6a045c77666c536f32386b0f',username:'gam2046🤖',}],[6590,{uid:6590,url:'/u/137b43256a045c716563566f1b1c1034',avatar:'/a/137b43256a045c716563566f1b1c1034',username:'Chatterleys🤖',}],[5712,{uid:5712,url:'/u/1b23582a6a045c72676b546f40190b1e',avatar:'/a/1b23582a6a045c72676b546f40190b1e',username:'gxt92🤖',}],[6470,{uid:6470,url:'/u/3130560c6a045c71646d566f040d3717',avatar:'/a/3130560c6a045c71646d566f040d3717',username:'sechi🤖',}],]),related:[],} const App={setup(){const goTo=useGoTo() const{mdAndUp}=useDisplay() return{goTo,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)} if(this.nav.post.total>(this.nav.post.currentPage-1)*100+20){let moreLen=100 if(this.nav.post.total({id:null,num:(this.nav.post.currentPage-1)*100+v,uid:null,content:null,ipRegion:null,updatedByUid:null,createdAt:null,updatedAt:null,mentionNum:null,mentionedBy:null,mentionUsers:null,likeUsers:null,})) this.posts.push(...morePosts.slice(20))} this.workerStart() const hash=window.location.hash const match=hash.match(/#(\d+)/) if(match){const n=parseInt(match[1],10) if(n>=(this.nav.post.currentPage-1)*100&&n{this.jumpTo(n)})}} this.$nextTick(()=>{this.addHeadingIds() tocbot.init({tocSelector:'.toc',contentSelector:'#post-content-0',headingSelector:'h2, h3, h4',headingsOffset:100,scrollSmoothOffset:-100,scrollSmooth:true,collapseDepth:6,onClick:function(e){setTimeout(()=>{history.replaceState(null,'',window.location.pathname+window.location.search)},0)},}) tocbot.refresh()});},beforeUnmount(){this.workerStop() if(this.quill){this.quill.destroy() this.quill=null}},computed:{dposts(){return this.posts.slice(20);},},created(){},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,this.nav.post.targetPage>1?`/${this.nav.post.targetPage}`:'') window.location.href=url},toLoadRelated({done}){if(this.my&&this.my.uid){this.apiLoadRelated({done})}else{done('ok')}},workerStart(){this.nav.post.worker=setInterval(()=>{this.workerLoad()},500);},workerStop(){if(this.nav.post.worker){clearInterval(this.nav.post.worker);this.nav.post.worker=null;}},async jumpTo(num){const page=Math.floor(num/100)+1 const i=num-(page-1)*100 if(page===this.nav.post.currentPage){this.goTo("#post-"+num,this.nav.post.goToOptions) if(!this.posts[i].id){const block=Math.floor(num/20)+1 this.nav.post.apiLock[block]=true await this.apiLoadPosts(block) this.$nextTick(()=>{this.goTo("#post-"+num,this.nav.post.goToOptions)})}}else{let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,page>1?`/${page}`:'') url=url+"#"+num window.location.href=url}},postIntersect(num){return(isIntersecting,entries,observer)=>{if(isIntersecting){this.nav.post.task.push(num) this.nav.post.active.push(num) this.nav.post.active=this.nav.post.active.filter(item=>Math.abs(item-num)<=5) this.nav.post.active.sort((a,b)=>a-b)}else{this.nav.post.active=this.nav.post.active.filter(item=>item!==num)} if(this.nav.post.active[0]){this.nav.post.anchor=this.nav.post.active[0]}else{this.nav.post.anchor=0}}},async apiLoadPosts(block){try{const response=await axios.post('/fapi/v1/post/block/'+block,{discussionId:this.nav.post.discussionId,}) if(response.data.code===0){response.data.data.posts.forEach(post=>{const i=post.num%100 Object.assign(this.posts[i],post)}) response.data.data.users.forEach(user=>{this.usersMap.set(user.uid,user)})}else{this.failureAlert('回帖数据加载失败: '+response.data.msg)}}catch(error){this.failureAlert('回帖数据加载失败: '+error)} this.nav.post.apiLock[block]=false},workerLoad(){while(this.nav.post.task.length){const num=this.nav.post.task.pop() const i=num-(this.nav.post.currentPage-1)*100 if(!this.posts[i].id){const block=Math.floor(num/20)+1 if(!this.nav.post.apiLock[block]){this.nav.post.apiLock[block]=true this.apiLoadPosts(block)}}}},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diffpost.num===num) if(!post){return "#"+num} const uid=post.uid const username=this.usersMap.get(uid)?.username if(!username){return "#"+num} return username},getUsernameByPostId(id){const post=this.posts.find(post=>post.id===id) if(!post){return "#"+this.getPostNumByPostId(id)} const uid=post.uid const username=this.usersMap.get(uid).username if(!username){return "#"+this.getPostNumByPostId(id)} return username},getPostNumByPostId(id){const post=this.posts.find(post=>post.id===id) return post.num},getPostById(id){const post=this.posts.find(post=>post.id===id) return post},getPostByNum(num){const post=this.posts.find(post=>post.num===num) return post},getAvatarByUid(uid){const avatar=this.usersMap.get(uid)?.avatar if(!avatar){return this.getRandomAvatar()} return avatar},getAvatarByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post){return this.getRandomAvatar()} const uid=post.uid return this.getAvatarByUid(uid)},getRandomAvatar(){const num=Math.floor(Math.random()*100) return "https://randomuser.me/api/portraits/men/"+num+".jpg"},getUrlByUid(uid){const url=this.usersMap.get(uid)?.url if(!url){return ""} return url},getTextByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post||!post.content){return '点击跳转到#'+num+'查看'} const parser=new DOMParser() const doc=parser.parseFromString(post.content,'text/html') const text=doc.body.textContent||'' return text.slice(0,100)},addHeadingIds(){const content=document.getElementById('post-content-0') if(!content){this.nav.showTOC=false return} const headings=content.querySelectorAll('h2, h3, h4') headings.forEach((heading,index)=>{if(!heading.id){heading.id=`toc-nav-${index}`}}) if(headings.length==0){this.nav.showTOC=false}},async doSearch(keywords){this.search.loading=true try{const response=await axios.post('/fapi/v1/search',{keywords:keywords,}) if(response.data.code===0){if(response.data.data.hash&&response.data.data.hash.length===32){window.location.href="/s/"+response.data.data.hash}else{this.failureAlert('搜索失败: 搜索服务异常')}}else{this.failureAlert('搜索失败: '+response.data.msg)}}catch(error){this.failureAlert('搜索失败: '+error)} this.search.loading=false},debounce(fn,delay){let timer=null return function(...args){if(timer)clearTimeout(timer) timer=setTimeout(()=>{fn.apply(this,args)},delay);};},},watch:{'nav.post.targetPage':{handler:async function(newV,oldV){this.toPage()},immediate:false},},} const vuetify=createVuetify({defaults:{global:{ripple:true,},},}) const app=createApp(App) app.use(vuetify).mount("#app")