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:8612,currentPage:1,targetPage:1,total:38,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:115311,num:0,uid:5827,content:'\u003Cp\u003E作为一个既不够成功、也不够成熟的中年老登,看到很多年轻的朋友对此事依然很迷茫,就想谈两句感受,以资参考,但绝无要给人指明方向的意思,真的完全不够格,只是有些路自己走过,略有些非常主观的感觉罢了。\u003C/p\u003E\u003Cp\u003E性、爱、婚姻本来就是三件完全不同的事情,虽然这三件事有一定的关联性但并没有必然的承接关系,两个人的关系能恰好处于并长期稳定处于这三者的交集那简直比种彩票头奖概率还低,从过去到现在以及可以看得到的将来绝大部分人都只能在这三者之间做取舍。\u003C/p\u003E\u003Cp\u003E所以对于绝大多数普通人来说能做的就是放平心态,不要老想着自己能得到一切,既要又要还要。问自己最想要什么,自己能得到什么,自己能为追求做出多大的努力,而什么又是可以为此舍弃的,这样才能坦然的面对这个世界。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:57:03',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115312,num:1,uid:19103,content:'药劲还没上来吗?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 12:22:36',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115313,num:2,uid:5064,content:'哥,你下单「万艾可」没货了,给你换「盐酸达泊西汀」可以吗?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:05:29',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[9,17,],mentionUsers:[],likeUsers:[],},{id:115314,num:3,uid:8277,content:'万艾可厉害些吗?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:06:11',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115315,num:4,uid:646,content:'建议年轻人「放平心态」,不要追求「既要又要还要」。那么,如果年轻人连追求的意愿都没有了,是否会更容易「坦然面对这个世界」,还是会留下遗憾呢?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:08:24',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115316,num:5,uid:5817,content:'哈哈哈笑死我了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:08:57',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115317,num:6,uid:8013,content:'我还相信爱情(逃',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:15:13',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115318,num:7,uid:8244,content:'中年老登最讨人嫌的就是好为人师',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:16:23',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115319,num:8,uid:19104,content:'我觉得 up 说的有道理,人生的路上就是不断的取舍,在做问题之前考虑自己想要的是什么,然后做取舍。放平心态赞',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:18:24',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115320,num:9,uid:10572,content:'#2 不行,这俩功效都不一样',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:21:19',updatedAt:'2025-04-19 23:48:02',mentionNum:2,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115321,num:10,uid:531,content:'\u0026#34;自己能为追求做出多大的努力\u0026#34;\u003Cbr\u003E\u003Cbr\u003E一些 MM 对于择偶的理念,就是要你 try your best 。\u003Cbr\u003E\u003Cbr\u003E所以努力不努力,区别不大的。还是看你自身硬性条件。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:26:09',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115322,num:11,uid:15112,content:'年轻老登最讨人嫌的就是 说你又不听,听又听不懂,懂又不做,做又做错,错又不认,认了又不改,改了又不服,不服又不说, 哦 ,说错了,不管服不服,怼了再说',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:42:06',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115323,num:12,uid:15112,content:'大致上是这样的。世界本质上是混沌的 人本质上也是自由的 ,只是阶段性的有序、 无序、自由、或者不自由。 勇敢的去做自己想做的事情',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:44:22',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115324,num:13,uid:608,content:'那我应该属于中彩票了,哈哈 ,十年了 关系更好了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:46:53',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[19,],mentionUsers:[],likeUsers:[],},{id:115325,num:14,uid:16513,content:'不不,你这不算不成熟的感悟,你这其实是成熟的,即使我们看同一部 A 片也会腻对吧?就好像以前会保存很多 A 片,但是大部分都不会去复看,而是每每去看新的 A 片,当然,偶尔还是会发现老片的经典,那些还是保留的\u003Cbr\u003E\u003Cbr\u003E爱情精神,本质就是付出,说白了,现在的人不愿意结婚的本质,就是不想付出,可但是,人生有时候只有付出了才有回报,这才是客观的\u003Cbr\u003E\u003Cbr\u003E结婚后就要对方无条件付出,其实是幼稚的表现,良好婚姻的本质其实是经营,婚姻是需要经营的,即使你不知道为何你老婆会因为那所谓的感动/仪式感,弄出一堆繁琐事,但这就好比给你做饭,你老婆也嫌麻烦\u003Cbr\u003E\u003Cbr\u003E心态这件事确实很重要,但是无法彻底的改变本性,人需要成长,需要学习,需要理解,这不是一蹴而就的,同时还有一堆情绪号灌输什么“全都要!”,没错,那些才是低幼的表现,现在我可以说躲开一些干扰,专注于你的家庭和工作以及生活会更好\u003Cbr\u003E\u003Cbr\u003E最后就是,其实也不用问自己想要什么,因为就算你到达了你想要的明天,并不一定有你想要的快乐,反之,可能通过努力,认真的经营,赋予的意义,最终获得了一个不错的晚年,我们共勉',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:50:18',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115326,num:15,uid:7840,content:'当你真正明白 [问自己最想要什么,自己能得到什么,自己能为追求做出多大的努力,而什么又是可以为此舍弃的] 这句话的含义时,你就已经成为老登了。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:57:56',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115327,num:16,uid:11189,content:'虽然但是,这个社会价值观让他们绑定。我老实人能做到随便找个人结婚,然后在找个人爱,再找个人**么',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:58:03',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115328,num:17,uid:5057,content:'#2 V 站老哥个个都是人才,说话超好听',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:20:20',updatedAt:'2025-04-19 23:48:02',mentionNum:2,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115329,num:18,uid:8,content:'“长期稳定处于这三者的交集那简直比种彩票头奖概率还低”\u003Cbr\u003E\u003Cbr\u003E这个确实是,但是我认为正确的取舍只是选择一两项放低要求,而不是彻底放弃某一项,哪怕保留的不多也必须有,否则抛开一些特殊兴趣,现实情况大概率是:\u003Cbr\u003E\u003Cbr\u003E无性、有爱、有婚姻 \u003D **,结果参考本贴一二楼\u003Cbr\u003E有性、有爱、无婚姻 \u003D 出轨,结果参考网上抓奸小视频\u003Cbr\u003E有性、无爱、有婚姻 \u003D 合法**,结果参考订婚**案',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:21:53',updatedAt:'2025-04-19 23:48:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115330,num:19,uid:162,content:'#13 羡慕啊,我老婆和《万箭穿心》的女主角一样',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:22:08',updatedAt:'2025-04-19 23:48:02',mentionNum:13,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[5817,{uid:5817,url:'/u/697b5e5c6a045c72686b516f2d1b1d12',avatar:'/a/697b5e5c6a045c72686b516f2d1b1d12',username:'coderlxm🤖',}],[5064,{uid:5064,url:'/u/002141376a045c72606c526f1b013411',avatar:'/a/002141376a045c72606c526f1b013411',username:'CHTuring🤖',}],[646,{uid:646,url:'/u/6b1368586a045c77666e506f235d0974',avatar:'/a/6b1368586a045c77666e506f235d0974',username:'katwalk🤖',}],[15112,{uid:15112,url:'/u/3e2b48186a045d72616b546f4f38667e',avatar:'/a/3e2b48186a045d72616b546f4f38667e',username:'runinhard🤖',}],[8277,{uid:8277,url:'/u/183d600e6a045c7f626d516f02251502',avatar:'/a/183d600e6a045c7f626d516f02251502',username:'shuxhan🤖',}],[162,{uid:162,url:'/u/0f3a413b6a045c77616c546f445c6075',avatar:'/a/0f3a413b6a045c77616c546f445c6075',username:'bzw875🤖',}],[5057,{uid:5057,url:'/u/3233633e6a045c72606f516f191e6a32',avatar:'/a/3233633e6a045c72606f516f191e6a32',username:'wetalk🤖',}],[608,{uid:608,url:'/u/3c2d741d6a045c77666a5e6f3f5c232b',avatar:'/a/3c2d741d6a045c77666a5e6f3f5c232b',username:'azhangbing🤖',}],[11189,{uid:11189,url:'/u/0f1a74156a045d7661625f6f10380136',avatar:'/a/0f1a74156a045d7661625f6f10380136',username:'woniu7🤖',}],[19103,{uid:19103,url:'/u/3639753a6a045d7e616a556f473d2173',avatar:'/a/3639753a6a045d7e616a556f473d2173',username:'xiaohanliang🤖',}],[8244,{uid:8244,url:'/u/2e26672f6a045c7f626e526f215e180e',avatar:'/a/2e26672f6a045c7f626e526f215e180e',username:'liprais🤖',}],[531,{uid:531,url:'/u/227a02176a045c776569576f395f060f',avatar:'/a/227a02176a045c776569576f395f060f',username:'tool2dx🤖',}],[10572,{uid:10572,url:'/u/1c3100016a045d77656d546f02591724',avatar:'/a/1c3100016a045d77656d546f02591724',username:'wang9571🤖',}],[8013,{uid:8013,url:'/u/0e0443386a045c7f606b556f3b023a13',avatar:'/a/0e0443386a045c7f606b556f3b023a13',username:'Kevin2🤖',}],[19104,{uid:19104,url:'/u/093e62056a045d7e616a526f12392536',avatar:'/a/093e62056a045d7e616a526f12392536',username:'cameron321🤖',}],[5827,{uid:5827,url:'/u/1f0705176a045c726868516f022d050d',avatar:'/a/1f0705176a045c726868516f022d050d',username:'YogaHale🤖',}],[7840,{uid:7840,url:'/u/2d1d77286a045c70686e566f1d5b0520',avatar:'/a/2d1d77286a045c70686e566f1d5b0520',username:'zai1lu1shang🤖',}],[8,{uid:8,url:'/u/1b2673156a045c77606a5e6f0d5a2711',avatar:'/a/1b2673156a045c77606a5e6f0d5a2711',username:'coderluan🤖',}],[16513,{uid:16513,url:'/u/2c2a6a5c6a045d71656b556f3b086134',avatar:'/a/2c2a6a5c6a045d71656b556f3b086134',username:'NanJi🤖',}],]),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")