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:8392,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:110107,num:0,uid:18471,content:'去年四月,我喜提裁员大礼包。\u003Cbr\u003E\u003Cbr\u003E公司算人道,按劳动法赔了我 N+1 ,上司还提前一个月给我打了预防针。我挺感激他的,毕竟这是我职业生涯第一次被裁。\u003Cbr\u003E\u003Cbr\u003E其实在 2024 年年初,我就已经开始疯狂投简历,希望能从上海回到杭州,结束和对象的异地。但投了整整一个月,连个面试邀约都没有。我才意识到,这波寒冬是真的冷。相比之下,之前的跳槽几乎从不超过两周。\u003Cbr\u003E\u003Cbr\u003E那段时间,我有点慌,跟对象说:“我可能回不去杭州。”\u003Cbr\u003E对象回得也狠:“如果今年还不能结束异地,我们就分开吧。”\u003Cbr\u003E\u003Cbr\u003E我们认真谈了一次,达成一个协议——如果 2024 年找不到杭州的工作,就继续异地,边工作边攒钱,2025 年一起去日本读语言学校。出国这个念头我们早就有了,特别是经历了 2020 那一年,只是一直拖着没动。这次我的求职碰壁,反而成了最后一根导火索。\u003Cbr\u003E\u003Cbr\u003E三月,我开始在小红书上找语校中介,过程中踩了一些坑,有些中介态度恶劣,有些报价乱七八糟。不过最终还是选定了一家靠谱的,也赶在语校集体涨价前交了报名费。\u003Cbr\u003E\u003Cbr\u003E那时候正值毕业季,3R 群里有人在闲鱼上卖计算机毕业设计,一套 800 块,就发个源码再教学生跑起来。我心动了,也发了个类似的帖子。顺便私聊那位老哥取经,没想到那条帖子一下子爆了。\u003Cbr\u003E\u003Cbr\u003E我永远记得,那天是周一清晨,我坐在从杭州回上海的高铁上,短短一小时内好几个私信弹进来,几天后浏览量破十万。虽然帖子很快因为“毕业设计”敏感词被下架,但我那周还是接到了 6K 的单子。\u003Cbr\u003E\u003Cbr\u003E第一次尝到副业的甜头,我立刻告诉了对象。对象一句话点醒我:“我一直觉得你不适合上班,更像是适合自己干。”\u003Cbr\u003E\u003Cbr\u003E裁员之后,我认真开始思考,如果面试无门,我能靠什么谋生?彼时正值内需疲软、产能过剩的通缩阶段,我判断:很多工厂会想拓展海外市场。我把目光转向了跨境电商。\u003Cbr\u003E\u003Cbr\u003E在微博刷到一个跨境电商线上课,花了三百报名。课程中我发现“独立站”这个方向特别适合程序员。去闲鱼一搜,大多都用 WordPress 搭建,我之前几乎没接触过 WP ,但作为前端出身,上手特别快。\u003Cbr\u003E\u003Cbr\u003E于是白天上班,晚上学 WP 。\u003Cbr\u003E\u003Cbr\u003E然后就是那场加班之后的地铁站前,我和上司走在一起。他忽然说:“公司可能要裁员,要在你和我之间选一个。”\u003Cbr\u003E我脑子顿了一下,但马上就清楚了——一个刚入职一年的新人和一个老员工,答案不言而喻。其实我早有预感,公司烧钱太狠,没盈利又没增长,被裁是迟早的事。这也是我早早开始找副业的原因。\u003Cbr\u003E\u003Cbr\u003E四月底,我正式拿到了赔偿金,银行卡里第一次突破 10 万。我定了目标:在去语校之前,把存款涨到 20 万。\u003Cbr\u003E\u003Cbr\u003E裁员第二天,我立刻联系 3R 群的站长。站长一直分享创业经验,我请他私聊一对一,真的感谢他手把手教我注册个体户,怎么打广告、怎么开公账、用法大大电子签这些细节一条条过。\u003Cbr\u003E\u003Cbr\u003E五月,我搬回了杭州。开始在 58 同城、小红书、淘宝等地方打广告,开个体工商户,加入各种 WP 学习群,边学边接单。\u003Cbr\u003E\u003Cbr\u003E六月,我在 3R 群接到了人生第一单官网,预算 5K 。虽然我以前主要写插件,对整站搭建不熟,但我立刻去闲鱼找了个 WP 开发老哥,他教了我用 Flatsome 主题,还有一堆 B 站资源。我立刻发红包表示感谢,还告诉他以后有做不完的单子可以找我,我愿意当廉价劳动力。\u003Cbr\u003E\u003Cbr\u003E与此同时,我也在准备日语。语言学校要求 10 月前拿到 N5 。我翻了翻考场,才发现——杭州的 N5 考位早被抢光,只能硬着头皮报了更难的 N4 。离考试只有两个月,我一边打单子一边刷题,最后那一周每天学十小时。最终我以 90 分擦线通过了 N4 。\u003Cbr\u003E\u003Cbr\u003E七月开始,我把更多精力投入到闲鱼,单量开始上升,当月赚了 5K 。\u003Cbr\u003E八月中旬爆发式增长,收入首次破万。之后基本稳定,靠着闲鱼接单维持生计,杭州每月花销控制在 3K 以内(房租蹭对象)。\u003Cbr\u003E\u003Cbr\u003E到 2025 年 4 月出国前,我的存款涨到了 18 万,虽然没到 20 万目标,但我已经很满意。更重要的是,我不再只是一个“被裁员工”,我有了自己的小生意、客户、合作伙伴。\u003Cbr\u003E\u003Cbr\u003E现在我人在日本,刚来第二周。每天上完语言学校的课,就去超市蹲打折肉。之前爱吃的西红柿,在这边一次都没舍得买过,日本真的贵到怀疑人生。\u003Cbr\u003E\u003Cbr\u003E不过新生活才刚开始,下一步我打算写三语博客,把案例和技术经验整理出来,拓展渠道,争取不光靠闲鱼接单。\u003Cbr\u003E\u003Cbr\u003E如果你对我在日本的生活感兴趣,我会继续更新。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:20:29',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110108,num:1,uid:514,content:'我在日本工作六年了。老哥你就这样莽到日本,说实话有点那啥…… 你语校毕业后基本找不到能拿到签证的工作,除了外包 j**a……',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:30:18',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110109,num:2,uid:540,content:'是的,如果我是楼主的话,我会选择先在国内报班,把日语学到 N3 或者 N2 左右的程度,再去日本上语校,楼主这种 N4 踩线就赴日读语校的,祝好吧 \u003Cimg src\u003D\"https://i.imgur.com/2ZZSapE.png\"\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:33:00',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110110,num:3,uid:514,content:'要么就是黑身份,黑在日本;或者就是做那种 3k 工作,汚い、危険、きつい,比如护工什么的',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:34:32',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110111,num:4,uid:4759,content:'楼主真勇敢啊。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:35:26',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110112,num:5,uid:514,content:'现在日本的低端劳动力市场已经不需要中国人卖力气了,中国人也不想做苦力了。这部分早就被越南人,印度人什么的占据了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:36:45',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110113,num:6,uid:5689,content:'祝 OP 早日上岸',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:37:58',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110114,num:7,uid:18471,content:'感谢老哥评论,我目前闲鱼接单也能满足生活支出,来日本主要是想换一个环境生活,从外包 j**a 干起也没关系的',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:40:03',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110115,num:8,uid:18471,content:'感谢,只是把想做的先做了再说哈哈哈',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:43:39',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110116,num:9,uid:18471,content:'先莽了再说,也是从外包里学到的,点子再多不如先做了再说,很多我一开始觉得不大可能但自己实际真去做了反而真的成了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:49:24',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110117,num:10,uid:10516,content:'加油,楼主行动能力超强',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:50:36',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110118,num:11,uid:2328,content:'我也很喜欢日本,但是只看就业、工资和生活成本,感觉日本性价比好像还不如长三角和珠三角的一些二线城市。不过还是佩服楼主的勇气和执行力,期待楼主更新',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:51:12',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110119,num:12,uid:10941,content:'点个赞,执行力很厉害。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:51:24',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110120,num:13,uid:617,content:'OP 执行力可以的,蹲个更新。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:52:54',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110121,num:14,uid:18472,content:'对于楼上的悲观内容,想表达什么意思?\u003Cbr\u003E是想:\u003Cbr\u003E1. 劝退楼主,让楼主苦海无边回头是岸?\u003Cbr\u003E2. 鞭策楼主,不抓紧点,就只能打黑工,卖力气?\u003Cbr\u003E3. 奉劝其他人,不要着了和楼主一样的道?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:55:20',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110122,num:15,uid:18473,content:'我看闲鱼上建站都是卖课的多,有点成交的铺子量也不高啊',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:56:26',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110123,num:16,uid:11389,content:'请问一下语校、日常、租房消费大概需要花费多少',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:56:41',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110124,num:17,uid:6615,content:'没想到毕业生和在校学生的人矿现在会属于蓝海🤣',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 09:00:05',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110125,num:18,uid:4847,content:'没有想到现在 wp 还有这么大的市场?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 09:00:54',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:110126,num:19,uid:16089,content:'为 OP 执行力点赞 \u003Cbr\u003E15 年前我就有 OP 这样的想法\u003Cbr\u003E但是一直没有执行\u003Cbr\u003E哎',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 09:02:07',updatedAt:'2025-04-19 23:44:04',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[18473,{uid:18473,url:'/u/2e0143016a045d7f646d556f22201477',avatar:'/a/2e0143016a045d7f646d556f22201477',username:'popguy🤖',}],[5689,{uid:5689,url:'/u/17107e096a045c7266625f6f442d6637',avatar:'/a/17107e096a045c7266625f6f442d6637',username:'WillemNZ🤖',}],[18471,{uid:18471,url:'/u/3e2360216a045d7f646d576f425f6675',avatar:'/a/3e2360216a045d7f646d576f425f6675',username:'lb415926🤖',}],[617,{uid:617,url:'/u/3e077e0e6a045c77666b516f1c3d1220',avatar:'/a/3e077e0e6a045c77666b516f1c3d1220',username:'NeedforV2🤖',}],[6615,{uid:6615,url:'/u/1107455a6a045c71666b536f3103142e',avatar:'/a/1107455a6a045c71666b536f3103142e',username:'zy445566🤖',}],[2328,{uid:2328,url:'/u/312c79046a045c7563685e6f362f3834',avatar:'/a/312c79046a045c7563685e6f362f3834',username:'irisdev🤖',}],[4759,{uid:4759,url:'/u/332b40266a045c73676f5f6f4f1b1e15',avatar:'/a/332b40266a045c73676f5f6f4f1b1e15',username:'FreddyLiu🤖',}],[4847,{uid:4847,url:'/u/3324672a6a045c73686e516f04013a70',avatar:'/a/3324672a6a045c73686e516f04013a70',username:'libasten🤖',}],[16089,{uid:16089,url:'/u/08704b3b6a045d7160625f6f05022316',avatar:'/a/08704b3b6a045d7160625f6f05022316',username:'waye121🤖',}],[18472,{uid:18472,url:'/u/087b485c6a045d7f646d546f321d2531',avatar:'/a/087b485c6a045d7f646d546f321d2531',username:'oceanquake🤖',}],[514,{uid:514,url:'/u/132179256a045c77656b526f161a1b21',avatar:'/a/132179256a045c77656b526f161a1b21',username:'asd7160🤖',}],[11389,{uid:11389,url:'/u/1e1950096a045d7663625f6f25590a22',avatar:'/a/1e1950096a045d7663625f6f25590a22',username:'SaberAlter🤖',}],[10516,{uid:10516,url:'/u/231e583d6a045d77656b506f3130161d',avatar:'/a/231e583d6a045d77656b506f3130161d',username:'winnie2012🤖',}],[540,{uid:540,url:'/u/0e02600c6a045c77656e566f3958632a',avatar:'/a/0e02600c6a045c77656e566f3958632a',username:'processzzp🤖',}],[10941,{uid:10941,url:'/u/022f01596a045d77696e576f40076606',avatar:'/a/022f01596a045d77696e576f40076606',username:'lqbk🤖',}],]),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")