"use strict";(self["webpackChunkninepage"]=self["webpackChunkninepage"]||[]).push([[913],{7142:function(e,t,i){i.r(t),i.d(t,{default:function(){return l}});var s=i(6448),n=i(4864),a=(i(4014),i(1001)),o=(0,a.Z)(n.Z,s.s,s.x,!1,null,"646d2ad2",null),l=o.exports},7218:function(){},61:function(e,t,i){i(7658);var s=i(4820),n=i(1809),a=i(6799);i(8697);t["Z"]={name:"detailIndex",data(){return{twoCommentData:null,editCommentPid:null,popState:"",coinConfig:{strategy:{button:"攒币指南",tips:"你的寄托币不够,快去发帖挣币吧",url:a.k}},islogin:!0,prepareLiskeAnimateState:!1,stat:{like:0},iscollect:0,ispostOfferLike:null,offerLikesumTimer:0,offerLikesumAnimateTimer:0,listlist:[],tid:0,info:{},type:0,token:"",offerinfo:{},offerinfoKey:[{key:"schoolname",name:"申请学校"},{key:"degree",name:"学位"},{key:"professional",name:"专业"},{key:"project",name:"项目"},{key:"apply_results",name:"申请结果"},{key:"semester",name:"入学学期"},{key:"noticedate",name:"通知时间"},{key:"useperformanceStr",name:"使用成绩"}],shareurl:"",collegelist:[],tenementKey:[{key:"typeText",name:"出租方式"},{key:"rent",name:"月租/"},{key:"property",name:"房屋类型"},{key:"floor",name:"所在楼层"},{key:"acreage",name:"面积(平方呎)"},{key:"locationText",name:"所在区域"},{key:"addressText",name:"地段/地址"},{key:"school",name:"附近学校"},{key:"gender",name:"性别要求"},{key:"rentaldurationText",name:"出租时长"},{key:"introduction",name:"房东或合租人介绍"},{key:"intermediary_text",name:"发布者身份"},{key:"telText",name:"电话"},{key:"wechatText",name:"微信"}],interviewKey:[{name:"学校",key:"school"},{name:"专业",key:"profession"},{name:"项目",key:"project"},{name:"毕业时间",key:"interviewtime"},{name:"面试过程及内容",key:"message"}],postList:{list:[],page:1,limit:20,count:0},loading:null,commentContent:"",operateState:!1,mybalance:0,islogin:!1,alert:{state:!1,message:""},isloginBtnState:!1}},watch:{popState(e,t){e?this.$pageStop():this.$pageMove()},"$store.state.user":{handler(e,t){"{}"!=JSON.stringify(e)&&(this.islogin=e.uid>0,this.tid=this.$route.query["tid"],this.postList.page=this.$route.query["page"]||1,this.getDetail())},immediate:!0},isloginBtnState(e,t){e&&this.$goTologin()}},mounted(){window.scrollTo(0,0)},methods:{getDetail(){this.$startupUnderLoading(this),this.$http.post("/api/thread",{tid:this.tid}).then((e=>{if(200!=e.code)return;let t=e.data,i=t.info;i["message"]=i["message"].trim();const s=new RegExp("\r\n","g");i["message"]=i["message"].replaceAll(s,"
"),i["message"]=i["message"].replace(/]*>/g,(e=>e.replace(/width="[^"]*"/g,"").replace(/height="[^"]*"/g,"")));let n=`
作者设置了${this.islogin?"回复":"登录"}可见
`,a=`
作者设置了投币可见
`,o='
- 本内容投币可见 -
标记
',l=t.info.ispost,r=t.info.price,c=t.info.isbuy,h=t.info.isauthor;if(r>0&&0==c&&1!=h){let e=i["message"];i["message"]="";const t=/\[(free|hide)\]([^[]+)\[\/(free|hide)\]/g;let s=e.match(t)||[];for(let n=0;ne.index)),a=[];for(let i=0;i{if(0!=s){let n=e.slice(a[s-1][1]+7,i[0]);n=this.goEmpty(n),n&&(t+=o.replace("标记",e.slice(a[s-1][1]+7,i[0])))}if(0==s){let s=e.slice(0,i[0]);s=this.goEmpty(s),s&&(t+=e.slice(0,i[0]))}if(s==a.length-1){let s=e.slice(i[1]+7,e.length-1);s=this.goEmpty(s),s&&(t+=o.replace("标记",e.slice(i[1]+7,e.length-1)))}t+=e.slice(i[0],i[1]+7)})),t=t.replaceAll("[free]",""),t=t.replaceAll("[/free]",""),i["message"]=t}const m=/\[hide(?:=[0-9]+)?\]/;if(m.test(i["message"])){const e=/\[hide\].*?\[\/hide\]/g;if(0==l&&1!=h&&(i["message"]=i["message"].replace(e,n)),1==l||1==h){var p=/\[hide(=\d+)?\]/g;i["message"]=i["message"].replaceAll(p,'
- 本内容回复可见 -
'),i["message"]=i["message"].replaceAll("[/hide]","
")}}this.islogin||0!=c||(i["message"]=i["message"].replaceAll("[free]",""),i["message"]=i["message"].replaceAll("[/free]","")),0==t.type&&(this.$refs["vHtmlMessage"]&&(this.$refs.vHtmlMessage.innerHTML=i["message"]));let g=document.getElementsByClassName("replyVisible");if(!Array.isArray(g)){for(let e=0;e{this.$emit("replyVisibleClick")}));this.$on("replyVisibleClick",(()=>{this.popState="discussionSingle"}))}let d=document.getElementsByClassName("coinVisible");if(!Array.isArray(d)){for(let e=0;e{this.$emit("coinVisibleClick")}));this.$on("coinVisibleClick",(()=>{this.popState=t.mybalance>r?"coindisplayuser":"coinNo"}))}let f=document.getElementsByClassName("registerVisible");if(!Array.isArray(f)){for(let e=0;e{this.$emit("registerVisibleClick")}));this.$on("registerVisibleClick",(()=>{this.isloginBtnState=!0}))}this.info=i,this.type=t.type,this.token=t.token,this.mybalance=t.mybalance,6==this.type?this.getOfferDetail():5==this.type?this.getsummaryDetails():3==this.type?this.getTenementDetails():2==this.type&&this.getInterviewDetails(),0!=i["replies"]&&this.getPostList()})).finally((()=>{this.$closeUnderLoading(this)}))},goEmpty(e){e=e.trim();while(-1!=e.indexOf("
"))e=e.replace("
","");return e},getOfferDetail(){this.$http.get("/api/forum/details",{id:this.token},"offer").then((e=>{let t=e.data,i=t.collegelist[0],s="";i.useperformance&&i.useperformance.forEach(((e,t)=>{s+=e+(i.useperformance.length-1==t?"":"、")})),i["useperformanceStr"]=s,this.offerinfo=i}))},getsummaryDetails(){this.$http.get("/api/forum/details",{id:this.token},"offer").then((e=>{let t=e.data,i=t.collegelist;i.forEach(((e,t)=>{let i="";e.useperformance&&e.useperformance.forEach(((t,s)=>{i+=t+(e.useperformance.length-1==s?"":"、")})),e["useperformanceStr"]=i})),this.info={...this.info,...t.info},this.collegelist=i,this.shareurl=t.shareurl}))},getTenementDetails(){this.$http.post("/tenement/forum/show",{token:this.token},"tenement").then((e=>{201==e.code&&(this.tenementInfoState=!0);let t=this.tenementKey,i={...this.info,...e.info};i["typeText"]=i.gptype+">>"+i.type,t[1].name+=i["currency"]?i["currency"]:"港元",1==i.cityid?i["locationText"]=i.location:i["locationText"]=i.country+">>"+i.city,i["addressText"]=i["address"]||"-",i["rentaldurationText"]=i.rentalduration||"不限",i["telText"]=i.tel||"-",i["wechatText"]=i.wechat||"-";const s=new RegExp("\r\n","g");i["message"]=i["message"].replaceAll(s,"
"),i["message"]=i["message"].replace(/]*>/g,(e=>e.replace(/width="[^"]*"/g,"").replace(/height="[^"]*"/g,""))),this.info=i}))},getInterviewDetails(){this.$http.post("/InterviewExperience/thread",{tid:this.tid,token:this.token},"tenement").then((e=>{if(200!=e.code)return;let t=e.data;this.info={...this.info,...t},1!=t["isvisiblereply"]||t["isreply"]||(console.log("需要回复看详情"),console.log("this.info",this.info["message"]))}))},getPostList(){this.$startupUnderLoading(this);let{page:e,limit:t}=this.postList;this.$http.post("/api/thread/postList",{token:this.token,page:e,limit:t}).then((e=>{if(200!=e.code)return;let t=e.data;const i=this.info.ispost;console.log("ispost",i),t.data.forEach((e=>{e["message"]=e["message"].trim();const t=new RegExp("\r\n","g");e["message"]=e["message"].replaceAll(t,"
"),e["message"]=e["message"].replace(/]*>/g,(e=>e.replace(/width="[^"]*"/g,"").replace(/height="[^"]*"/g,"")));let i=`
作者设置了${this.islogin?"回复":"登录"}可见
`;const s=/\[hide(?:=[0-9]+)?\]/;if(s.test(e["message"])){const t=/\[hide\].*?\[\/hide\]/g;if(this.islogin){var n=/\[hide(=\d+)?\]/g;e["message"]=e["message"].replaceAll(n,'
- 本内容回复可见 -
'),e["message"]=e["message"].replaceAll("[/hide]","
")}else e["message"]=e["message"].replace(t,i)}this.islogin||(e["message"]=e["message"].replaceAll("[free]",""),e["message"]=e["message"].replaceAll("[/free]",""))})),this.postList.list=t.data,this.postList.page=t.page,this.postList.limit=t.limit,this.postList.count=t.count})).finally((()=>{this.$closeUnderLoading(this)}))},openEditPop(e){let t=e.message;t=t.replace(/]*>[\s\S]*?<\/div>/gi,""),t=t.trim(),this.commentContent=t,this.editCommentPid=e.pid,this.popState="discussionMulti"},handleReplyPop(e){this.islogin||(this.isloginBtnState=!0);let t=e.message;t=t.replace(/<[^>]*>/g,""),t=t.trim(),this.twoCommentData={avatar:e.avatar,content:t,pid:e.pid},this.popState="discussionSingle"},postComment(e){let t="";t=this.editCommentPid?"/api/operation/redactPost":"/api/operation/reply",this.$http.post(t,{token:this.token,message:this.commentContent,pid:this.editCommentPid||this.twoCommentData&&this.twoCommentData.pid}).then((e=>{if(200!=e.code)return;if(this.$Message.success("发布成功"),this.popState="",this.twoCommentData=null,this.editCommentPid)return void setTimeout((()=>{this.$router.go(0)}),800);this.editCommentPid=null;let{count:t,limit:i}=this.postList,s=Math.ceil((t+1)/i);setTimeout((()=>{if(s==this.postList.page)return this.$router.go(0),void clearTimeout(timer);let e={page:s,tid:this.tid};this.$router.push({path:"/detailIndex",query:e})}),800)}))},currentChange(){let e={page:this.postList.page,tid:this.tid};this.getPostList(),this.$updateURLSearchParams(e)},tapOperate(e){if(this.operateState)return;this.operateState=!0;let t="";"like"==e?t="/api/operation/threadLike":"collect"==e?t="/api/operation/threadFav":"uncollect"==e&&(t="/api/operation/threadunFav"),this.$http.post(t,{tid:this.tid}).then((t=>{200==t.code&&("like"==e&&(this.info.islike=1,this.info.recommends),"collect"==e&&(this.info.isfav=1),"uncollect"==e&&(this.info.isfav=0),this.openHintBox(t.message))})).finally((()=>{this.operateState=!1}))},transmit(){let e=location.href;this.$copy(e,"已经复制链接,欢迎分享!")},setValue(e,t){console.log("key",e,t),this[e]=t},toAllSection(){this.$router.push({path:"/allSections",query:{fid:this.info.fid}})},handleIsmyself(e){this.popState="discussionMulti",this.commentContent=e.message},postCoin(){this.$http.post("/api/operation/coinPurchase",{token:this.token}).then((e=>{200==e.code&&(this.openHintBox(e.message),this.popState="",this.$router.go(0))}))},openHintBox(e){this.alert.state=!0,this.alert.message=e,setTimeout((()=>{this.alert.state=!1}),1500)}},components:{DetailReply:s.Z,Coins:n.Z}}}}]);