You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
15 KiB

1 year ago
  1. var t=Object.defineProperty,e=Object.prototype.hasOwnProperty,s=Object.getOwnPropertySymbols,n=Object.prototype.propertyIsEnumerable,a=(e,s,n)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n,i=(t,i)=>{for(var o in i||(i={}))e.call(i,o)&&a(t,o,i[o]);if(s)for(var o of s(i))n.call(i,o)&&a(t,o,i[o]);return t};import{B as o,x as l,v as c,K as p,n as r,T as d,G as u,p as w,m as h,c as m,t as I,u as A,F as k,q as v,s as g,y,L as T,w as C,M as x,r as P,o as S}from"./vendor.269b2875.js";import{_ as f}from"./returnBar.35b6215f.js";import{c as D}from"./tool.8db46c9c.js";import{_ as q}from"./gz@2x.4eecd945.js";import"./pinlun@2x.628190cf.js";import"./paixu@2x.fd1743af.js";const L={components:{ReturnBar:f},setup(){const{proxy:t}=o(),e=l({topTitle:"",typeBar:1,questionId:"",questionDetail:{},answerList:[],attenHasIndex:0,reportIndex:0,attenPopShow:!1,reportPopShow:!1,textareaContent:"",contlength:0,commentTxtShow:!1,textareaShow:!1,invitePopShow:!1,inviteList:[],pageIndex:1,totalPages:0,hasNextPage:!1,isFlag:!1,loading:!1,singInParam:null,isToast:!1,toastmassage:""});c((()=>{const e=t;e.questionId=t.$route.query.id,e.type=t.$route.query.type,e.singInParam=JSON.parse(localStorage.getItem("singInAnswer")),"answer"==e.type?e.topTitle="回答详情":e.topTitle="问题详情",n(),a()})),p((()=>e.textareaContent),(t=>{e.contlength=t.length})),p((()=>e.isToast),((t,s)=>{let n=e;clearTimeout(n.timer),n.timer=null,n.timer=setTimeout((function(){n.isToast=!1}),1500)}));const s=r((()=>""!==e.textareaContent));let n=()=>{const e=t;e.$http.get(t.$API.GETQUESTIONBYID,{params:{id:e.questionId}}).then((t=>{200==t.type?e.questionDetail=t.data[0]:d(t.content)})).catch((t=>{}))},a=()=>{const e=t;let s={ShowId:"",BelongId:e.questionId,Order:"Date_desc",pageIndex:1,pageSize:10};e.$http.get(t.$API.GETANSEWRPAGES,{params:s,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((t=>{200==t.type?e.answerList=t.data:d(t.content)})).catch((t=>{}))},w=()=>{const e=t;let s={model:{BelongId:e.answerList[e.reportIndex].id,RepPath:"dynamic"}};e.$http.post(t.$API.ADDREPORT,s,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((t=>{200==t.type?d("举报成功"):d(t.content)})).catch((t=>{}))},h=()=>{const e=t;let s;s=0==e.isSelf?{AttnId:e.custIds}:{AttnId:e.answerList[e.attenHasIndex].custId},e.$http.post(t.$API.DYNAMICEDITATTN,s,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((t=>{200==t.type?0==e.isSelf?(e.isHasAttn=!e.isHasAttn,1==e.isHasAttn?d("关注成功"):d("取消关注")):(e.answerList[e.attenHasIndex].hasAttn=!e.answerList[e.attenHasIndex].hasAttn,1==e.answerList[e.attenHasIndex].hasAttn?d("关注成功"):d("取消关注"),e.answerList=[],e.pageIndex=1,a()):d(t.content)})).catch((t=>{}))},m=()=>{const e=t;e.$http.get(t.$API.GETCUSTFORANSWER,{params:{QuestionId:e.questionId,pageIndex:e.pageIndex}}).then((t=>{200==t.type&&(e.isFlag=!0,e.totalPages=t.pages,e.hasNextPage=t.hasNextPage,e.inviteList=e.inviteList.concat(t.data))})).catch((t=>{}))},I=()=>{let s=e.singInParam;t.$http.post(t.$API.ADDPOINTLOG,s,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{200==e.type?t.$router.push("/MineSignIn"):d(e.content)})).catch((t=>{}))};return i(i({},u(e)),{GetQuestionDetails:n,GetAnswerPages:a,cutTime:D,isuse:s,openPopup:(e,s)=>{const n=t;switch(e){case 1:n.attenHasIndex=s,1==n.isHasAttn?n.attenPopShow=!0:h();break;case 2:n.reportPopShow=!0,n.reportIndex=s;break;case 3:n.invitePopShow=!0,m();break;case 4:n.commentTxtShow=!0,n.$nextTick((()=>{n.textareaShow=!0,n.autoFocus=!0}))}},closePopup:e=>{const s=t;switch(s.attenPopShow=!1,s.reportPopShow=!1,s.invitePopShow=!1,s.commentTxtShow=!1,s.textareaShow=!1,e){case 1:h();break;case 2:w()}},AddReport:w,IsAttention:h,skipComment:(e,s)=>{localStorage.setItem("Answer_key",JSON.stringify(s)),t.$router.push({path:"/dyComment",query:{CmtPath:"comment",id:e}})},toHomeInfo:(e,s)=>{t.$router.push({path:"/mineDynamic",query:{custid:e,isSelf:s}})},questionLike:(s,n,a)=>{const i=t;let o={LikeId:s,LikePath:"question",LikeCustId:n};i.$http.