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:8615,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:115454,num:0,uid:19111,content:'gap 快一年了,好不容易有几家面到 hr 面的,但都挂在 hr 面了。能不能来个 offer 啊😭',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 09:56:21',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115455,num:1,uid:19112,content:'可以主动问问 hr 。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 09:57:21',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115456,num:2,uid:601,content:'挂了就挂了, 你只需要一份工作, 所以只需要成功一次就行 \u003Cbr\u003E收集一下这几次 HR 挂你的理由(都是 gap?), 对症下药',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 10:04:31',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115457,num:3,uid:165,content:'HR 是个女的吧?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 10:25:14',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115458,num:4,uid:19113,content:'这两年加起来失业 10 个月,我从原来没回应会感受受挫,到现在毫无负担的机械式主动跟进结果,没结果继续投继续面,凡事抛开情绪,只管执行就会好很多,一起加油!',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 10:45:12',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115459,num:5,uid:12027,content:'这种基本都是薪资问题吧',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 10:45:26',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115460,num:6,uid:11915,content:'总结下经验,有条件就问问 hr 是什么原因挂的,gap 1 年可能有很大的影响',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:03:19',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115461,num:7,uid:19111,content:'早知道我就不主动辞职了😭',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:34:36',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115462,num:8,uid:19111,content:'我都不敢说期望薪资,直接说公司给多少就行哈哈哈哈',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:35:00',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[11,],mentionUsers:[],likeUsers:[],},{id:115463,num:9,uid:19111,content:'加油!',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:35:09',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115464,num:10,uid:11915,content:'这环境你敢裸辞你是这个👍',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:36:05',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115465,num:11,uid:17012,content:'#8 如果你这样回答,我是 hr 我也不会要。\u003Cbr\u003E1 ,面试是谈判,双方给出条件然后谈到双方都接受的合适区间;\u003Cbr\u003E2 ,如果一个人跟我说给多少都可以,我会合理怀疑这个人要么很菜,要么有什么我不知道的缺陷。你去菜市场买菜看到很好的菜,但是牌子上写的 1 折促销,你会不会认为这菜卖不出去是因为有什么问题;\u003Cbr\u003E3 ,一分钱一分货,如果对方没有提出要求,那他在工作中也不会自我要求;\u003Cbr\u003E4 ,容易产生受害者情绪,提桶跑路他最快。\u003Cbr\u003E以上不是针对 OP ,只是从 hr 角度换位思考,合理考虑问题。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:47:44',updatedAt:'2025-04-19 23:48:05',mentionNum:8,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115466,num:12,uid:5944,content:'你这样说容易让 hr 觉得你只是想过渡一下抹掉 gap ,并不是想来这家公司的。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 12:00:35',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115467,num:13,uid:19057,content:'程序员是个严谨的职业,“给多少都行”会让人联想你在工作中是否也是种态度',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 12:22:03',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115468,num:14,uid:2890,content:'挂在 hr 大概率就是选了别人 现在竞争激烈',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 12:50:21',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115469,num:15,uid:5817,content:'哈哈哈 对 这跟菜市场挑菜其实一个道理 不能把自己看得过于廉价 早期很多敢要高工资的反而还入职了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 12:55:37',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115470,num:16,uid:4516,content:'别的不说,“给多少就行”绝对是个大雷。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:08:28',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115471,num:17,uid:19114,content:'同 gap 一年,卑微的如同舔狗',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:13:11',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115472,num:18,uid:585,content:'给多少就行?那算了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 14:07:32',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115473,num:19,uid:18983,content:'找个 hr 聊聊,找找差距',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 22:13:32',updatedAt:'2025-04-19 23:48:05',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[5817,{uid:5817,url:'/u/697b5e5c6a045c72686b516f2d1b1d12',avatar:'/a/697b5e5c6a045c72686b516f2d1b1d12',username:'coderlxm🤖',}],[2890,{uid:2890,url:'/u/1c0f5a3e6a045c756863566f47236732',avatar:'/a/1c0f5a3e6a045c756863566f47236732',username:'Yc1992🤖',}],[18983,{uid:18983,url:'/u/2c0f7e0f6a045d7f6962556f363e3520',avatar:'/a/2c0f7e0f6a045d7f6962556f363e3520',username:'bochenhk🤖',}],[12027,{uid:12027,url:'/u/1c1848386a045d756068516f15081f0c',avatar:'/a/1c1848386a045d756068516f15081f0c',username:'EricYuan1🤖',}],[19057,{uid:19057,url:'/u/103f07056a045d7e606f516f353a3e05',avatar:'/a/103f07056a045d7e606f516f353a3e05',username:'aarontian🤖',}],[11915,{uid:11915,url:'/u/300d7c006a045d76696b536f0f5d6b10',avatar:'/a/300d7c006a045d76696b536f0f5d6b10',username:'xiaofeixiang🤖',}],[19113,{uid:19113,url:'/u/6f7143246a045d7e616b556f0222122f',avatar:'/a/6f7143246a045d7e616b556f0222122f',username:'clem🤖',}],[5944,{uid:5944,url:'/u/2d1e755b6a045c72696e526f24312a36',avatar:'/a/2d1e755b6a045c72696e526f24312a36',username:'glacer🤖',}],[19111,{uid:19111,url:'/u/347a743e6a045d7e616b576f225b252d',avatar:'/a/347a743e6a045d7e616b576f225b252d',username:'balaraking🤖',}],[585,{uid:585,url:'/u/021c7f256a045c776562536f300c317f',avatar:'/a/021c7f256a045c776562536f300c317f',username:'Meld🤖',}],[19112,{uid:19112,url:'/u/282c532f6a045d7e616b546f3a181473',avatar:'/a/282c532f6a045d7e616b546f3a181473',username:'a941097🤖',}],[4516,{uid:4516,url:'/u/6d3940156a045c73656b506f11040126',avatar:'/a/6d3940156a045c73656b506f11040126',username:'HENQIGUAI🤖',}],[165,{uid:165,url:'/u/32277c1e6a045c77616c536f352d6032',avatar:'/a/32277c1e6a045c77616c536f352d6032',username:'sky3hao9🤖',}],[19114,{uid:19114,url:'/u/2325711a6a045d7e616b526f2e1b073f',avatar:'/a/2325711a6a045d7e616b526f2e1b073f',username:'199808lanlan1111🤖',}],[17012,{uid:17012,url:'/u/203a05286a045d70606b546f1e300622',avatar:'/a/203a05286a045d70606b546f1e300622',username:'ninjaJ🤖',}],[601,{uid:601,url:'/u/3d3b5c186a045c77666a576f12396b0b',avatar:'/a/3d3b5c186a045c77666a576f12396b0b',username:'Dorathea🤖',}],]),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")