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:8266,currentPage:1,targetPage:1,total:101,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:107148,num:0,uid:18125,content:'现在女方父母认为现在各种事情都是我们之间传达,男方父母没有打过电话直接沟通,女方父母认为不尊重他们,现在因为这个事情又有矛盾了。我认为没有多少事,传达一下也没有啥,,,',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 08:55:03',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107149,num:1,uid:787,content:'我不知道你们那边什么情况,我们这亲家之间肯定要有沟通的啊。退一步来说,既然女方父母已经表达不满意了,你们又硬撑着不然男方父母直接沟通的原因是什么?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:00:04',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107150,num:2,uid:18125,content:'不硬撑了,我跟家里面说一声让他们沟通一下,主要想问一下大家的看法',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:01:29',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107151,num:3,uid:2735,content:'看你未婚妻的态度,如果她站你这边的没事,如果她站父母那边的建议分,女方家如果太玻璃心日后相处会有非常非常多的矛盾。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:03:51',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107152,num:4,uid:15185,content:'这种两个人都不能脱离父母做决定的情况请直接交给双方父母安排。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:06:35',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107153,num:5,uid:18125,content:'站在她们家的立场,我自己感觉两个人合的来最重要,如何传达信息都不是啥大问题,,',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:07:10',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[96,],mentionUsers:[],likeUsers:[],},{id:107154,num:6,uid:18125,content:'我能脱离,她和她家父母认为脱离不了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:07:48',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[49,],mentionUsers:[],likeUsers:[],},{id:107155,num:7,uid:18126,content:'不应该两家坐一起商量一些重要的事情,虽然很多时候啥也定不下来,但这个时候态度得拿出来,',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:25:43',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107156,num:8,uid:18127,content:'我结婚的时候全程都是我们自己商量,商量完通知双方父母。\u003Cbr\u003E\u003Cbr\u003E我们定好婚期了然后就安排双方父母见个面',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:30:39',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107157,num:9,uid:2735,content:'属于三观不一致,你家觉得没什么,她家觉得事很大,还是那句话,看你未婚妻的态度决定,她要是站你这边,你就多少给她点面子,该配合她的多配合她,如果她完全站她家那边的,建议分。这不是谁对谁错的问题,婚姻就是考虑两个人的兼容性问题,她要是会努力兼容你,你就得多想办法兼容她,她要是半点不想兼容你,你就该考虑要不要你去兼容她了。单方面兼容的婚姻日后肯定会一地鸡毛。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:35:45',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107158,num:10,uid:18128,content:'如果双方都是完全经济独立于原家庭,而且也完全不打算依靠原家庭的资金来买房/车,那通知一下就行,否则还是要商量一下。说难听点,股东对企业运行状况有知情权 doge',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:37:33',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107159,num:11,uid:163,content:'长大了经济独立了,就把父母放一边了呗;意思用完了就丢呗;女方家长就不应该让这种人进门,养育自己的父母都可以完全不考虑,何况岳父母呢',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:49:04',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[27,71,82,],mentionUsers:[],likeUsers:[],},{id:107160,num:12,uid:18129,content:'不然呢?还真当是投资?调侃一句“股东对企业运行状况有知情权”已经是给足了面子了,还真想分红啊?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:54:31',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107161,num:13,uid:163,content:'这是投资吗?人家是让你给钱了还是咋滴?只是说商量下事情咋办\u003Cbr\u003E对待自己父母都这样?人之无情,乃可至於是乎',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 09:56:31',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107162,num:14,uid:18129,content:'谁结婚谁做主,看小两口怎么安排就得了。知会一下还不够?还想掺合啥?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:01:23',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107163,num:15,uid:4545,content:'核心问题就是你愿意不愿意去理解女方的家庭?不单单指这一行为,而是这一行为背后的行为逻辑,就是从小养成的各种习惯、为人处世、三观等等,而且单单理解还不够,你还得要接受,哪怕有些行为你不赞同,这就是婚姻。\u003Cbr\u003E\u003Cbr\u003E老哥也可以参考下 V 社各种关于婚姻问题的帖子,90%的争吵其实就是双方家庭的不合,别看现在很多年轻人鼓吹,婚姻是俩人的事情,不必要太理会父母,说这些话的人,基本上都是没结过婚的小年轻,你要是真信,那你就完了,只有极个别的少数人可以真的完全不去理会父母的因素,而是小俩口完完全全自作主张,其余大部分都要与双方的父母产生这样那样的交集,矛盾自然也必不可少。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:02:58',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107164,num:16,uid:6004,content:'这就好比俩家大公司谈并购/收购,结果从头到尾都是下面俩个员工在谈,对方老板提出来是不是应该见一下你们大老板,有什么问题吗?你们大老板是有多忙?忙着大贸易战?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:05:00',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107165,num:17,uid:18129,content:'谁结婚谁才是老板。老板亲属还把公司当自己的了?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:07:35',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[97,],mentionUsers:[],likeUsers:[],},{id:107166,num:18,uid:8,content:'按传统文化,结婚是两个家庭的事,儿女结婚父母需要出钱出力,双方父母直接肯定要沟通的,不沟通确实是不尊重。\u003Cbr\u003E按现代文化,结婚是两个人的事,儿女结婚父母出席就行,父母直接沟通并没有绝对必要,结婚前吃顿饭就行。\u003Cbr\u003E\u003Cbr\u003E都没对错,只有接受不接受,现在是对方不接受了,楼主考虑下自己家庭是什么思想,接不接受对方思想就行了。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:09:55',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107167,num:19,uid:6004,content:'还是得看经济实力,如果自己全程操办,不需要家里出钱,自己做主,但是大部分人还得父母帮忙出力,结果对方连面都不见,电话也不打,会感觉不被重视,正常来说心理有意见是一定的',ipRegion:'',updatedByUid:0,createdAt:'2025-04-13 10:11:06',updatedAt:'2025-04-16 23:08:18',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[2735,{uid:2735,url:'/u/0307565b6a045c756769536f1c181736',avatar:'/a/0307565b6a045c756769536f1c181736',username:'uqf0663🤖',}],[6004,{uid:6004,url:'/u/6f1c68226a045c71606a526f06211837',avatar:'/a/6f1c68226a045c71606a526f06211837',username:'danhahaha🤖',}],[18127,{uid:18127,url:'/u/281f73036a045d7f6168516f1e5a2a29',avatar:'/a/281f73036a045d7f6168516f1e5a2a29',username:'pulutom40🤖',}],[787,{uid:787,url:'/u/31197b0c6a045c776762516f4f3c0712',avatar:'/a/31197b0c6a045c776762516f4f3c0712',username:'xtx🤖',}],[924,{uid:924,url:'/u/3c385f5d6a045c776968526f263a3174',avatar:'/a/3c385f5d6a045c776968526f263a3174',username:'a852695🤖',}],[8,{uid:8,url:'/u/1b2673156a045c77606a5e6f0d5a2711',avatar:'/a/1b2673156a045c77606a5e6f0d5a2711',username:'coderluan🤖',}],[15185,{uid:15185,url:'/u/0e035a266a045d726162536f0e506124',avatar:'/a/0e035a266a045d726162536f0e506124',username:'kyuuseiryuu🤖',}],[156,{uid:156,url:'/u/120a063b6a045c77616f506f1d5b3a31',avatar:'/a/120a063b6a045c77616f506f1d5b3a31',username:'chixinzei🤖',}],[18126,{uid:18126,url:'/u/2f10592b6a045d7f6168506f252a1d72',avatar:'/a/2f10592b6a045d7f6168506f252a1d72',username:'kanganxi🤖',}],[18125,{uid:18125,url:'/u/03045e2f6a045d7f6168536f190f2b15',avatar:'/a/03045e2f6a045d7f6168536f190f2b15',username:'myTrip🤖',}],[4545,{uid:4545,url:'/u/0b0853246a045c73656e536f2f2a371f',avatar:'/a/0b0853246a045c73656e536f2f2a371f',username:'ThomasKim🤖',}],[163,{uid:163,url:'/u/091b022f6a045c77616c556f21051733',avatar:'/a/091b022f6a045c77616c556f21051733',username:'Duanye7X24🤖',}],[18129,{uid:18129,url:'/u/033c00216a045d7f61685f6f2f311a30',avatar:'/a/033c00216a045d7f61685f6f2f311a30',username:'dawn009🤖',}],[18128,{uid:18128,url:'/u/333860236a045d7f61685e6f250b317f',avatar:'/a/333860236a045d7f61685e6f250b317f',username:'dustynight🤖',}],]),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")