chunk-20becc2c.3427157e.js 6.7 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-20becc2c"],{"06b47":function(t,i,e){"use strict";e("ca2e")},"0ac9":function(t,i,e){"use strict";e.r(i);e("7f7f");var s=function(){var t=this,i=t._self._c;return i("div",{staticClass:"wrap"},[i("div",{staticClass:"header"},[i("div",{staticClass:"back",on:{click:function(i){return t.$router.back()}}},[i("img",{attrs:{src:e("16de")}}),i("span",[t._v("返回")])])]),i("div",{staticClass:"content"},[i("div",{staticClass:"info"},[i("div",{staticClass:"header"},[i("div",{staticClass:"user"},[i("img",{staticClass:"avatar",attrs:{src:t.info.headimg,alt:""}}),i("div",{staticClass:"name"},[t._v(t._s(t.info.name))])])]),i("div",{staticClass:"question-content",attrs:{slot:"content"},slot:"content"},[i("div",{staticClass:"title"},[t._v(t._s(t.info.title))]),i("div",{staticClass:"detail",class:{hide:!t.detail_show},domProps:{innerHTML:t._s(t.info.content)}}),i("div",{staticClass:"show-all",on:{click:function(i){t.detail_show=!t.detail_show}}},[i("span",[t._v(t._s(t.detail_show?"收起":"展开")+"全部")]),i("img",{style:{transform:"rotate(".concat(t.detail_show?"270deg":"90deg",")")},attrs:{src:e("2501")}})])]),i("div",{staticClass:"footer"},[i("div",{staticClass:"btn-box"},[i("div",{staticClass:"tag-btn",class:{"tag-btn-select":!!t.info.is_like},on:{click:t.handleLike}},[i("img",{staticClass:"icon",attrs:{src:e("8cba")("./".concat(t.info.is_like?"dianzan_fill_blue":"dianzan_border_grey",".png"))}}),i("span",[t._v(t._s(t.info.like_num)+" 点赞")])]),i("div",{staticClass:"tag-btn",on:{click:function(i){t.info.comment_num&&t.openAllComment()}}},[i("img",{staticClass:"icon",attrs:{src:e("2e94")}}),i("span",[t._v(t._s(t.info.comment_num)+" 评论")])]),i("div",{staticClass:"tag-btn",on:{click:function(i){t.reportVisible=!0}}},[i("img",{staticClass:"icon",attrs:{src:e("597a")}}),i("span",[t._v("举报")])])])])]),i("div",{staticClass:"line"}),i("div",{staticClass:"comment"},[i("div",{staticClass:"header"},[i("div",{staticClass:"comment-num"},[t._v("评论 "+t._s(t.info.comment_num))]),i("div",{staticClass:"right"},[i("div",{staticClass:"sort"},[i("span",{class:{current:1==t.params.sort_type},on:{click:function(i){t.params.sort_type=1,t.params.page=1,t.getCommentList()}}},[t._v("最新")]),t._v("\n |\n "),i("span",{class:{current:2==t.params.sort_type},on:{click:function(i){t.params.sort_type=2,t.params.page=1,t.getCommentList()}}},[t._v("最热")])])])]),i("div",{staticClass:"edit"},[i("img",{staticClass:"avatar",attrs:{src:t.userInfo.headimg,alt:""}}),i("div",{staticClass:"edit-box"},[i("textarea",{directives:[{name:"model",rawName:"v-model",value:t.edit_value,expression:"edit_value"}],staticClass:"edit-value",attrs:{placeholder:"发布一条友善的评论"},domProps:{value:t.edit_value},on:{input:function(i){i.target.composing||(t.edit_value=i.target.value)}}}),i("div",{staticClass:"edit-btn",class:{"can-user":!!t.edit_value},on:{click:function(i){t.edit_value&&t.handleComment()}}},[t._v("\n 发表评论\n ")])])]),i("div",{staticClass:"list"},t._l(t.list,(function(e,s){return i("div",{staticClass:"list-item"},[i("ForumCommentCard",{attrs:{comment:e,option:t.option,reportType:t.option.reportType},on:{reply:function(i){return t.handleReply(i,e)},delete:function(i){return t.handleDelete(s)}}})],1)})),0)])]),i("Report",{attrs:{type:t.option.reportType,info:t.info},model:{value:t.reportVisible,callback:function(i){t.reportVisible=i},expression:"reportVisible"}}),i("ForumAllComment",{ref:"forumAllComment",attrs:{option:t.option}})],1)},n=[],a=(e("1c01"),e("58b2"),e("8e6e"),e("f3e2"),e("d25f"),e("ac6a"),e("456d"),e("c5f6"),e("ade3")),o=e("a882"),r=e("5a37"),l=e("75a2"),c=e("f523"),d=e("2f62");function u(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);i&&(s=s.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),e.push.apply(e,s)}return e}function m(t){for(var i=1;i<arguments.length;i++){var e=null!=arguments[i]?arguments[i]:{};i%2?u(Object(e),!0).forEach((function(i){Object(a["a"])(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}))}return t}var p={components:{Report:o["a"],ForumCommentCard:r["a"],ForumAllComment:l["a"]},data:function(){return{info:{},reportVisible:!1,all_comment:!1,edit_value:"",params:{page:1,page_num:10,sort_type:1},list:[],detail_show:!1,loading:!1,finished:!1}},computed:m(m({},Object(d["b"])(["userInfo"])),{},{option:function(){var t=this;return{listApi:function(i){return c["f"].getReplyCommentList(m(m({},i),{},{forum_id:t.info.forum_id,reply_id:t.info.id}))},likeApi:function(t){return c["f"].forumTags(t)},postApi:function(i){return c["f"].commentReply(m(m({},i),{},{forum_id:t.info.forum_id}))},postReplyApi:function(t,i){return c["f"].forumSecondComment(m(m({},t),{},{id:i.id}))},reportType:12,delApi:function(t){return c["f"].batchesDel({id:t.id,type:9})}}}}),mounted:function(){this.info.id=this.$route.query.reply_id,this.info.forum_id=this.$route.query.forum_id,window.scrollTo(0,0),this.getAnswerDetail()},methods:{TouchBottom:function(){this.finished||this.loading||this.getCommentList()},getAnswerDetail:function(){var t=this;c["f"].getReplyInfo({id:this.info.id}).then((function(i){var e=i.data;t.info=e.detail,t.loading=!0,t.getCommentList()}))},getCommentList:function(){var t=this;this.loading=!0,this.option.listApi(this.params).then((function(i){var e=i.data;t.list=1==t.params.page?e.list:t.list.concat(e.list),t.params.page++,t.loading=!1,t.finished=e.list.length<t.params.pageNum||t.list.length==e.total_count,t.info.comment_num=e.total_count}))},handleLike:function(){var t=this;this.option.likeApi({like_id:this.info.id,type:3}).then((function(i){var e=i.data,s=i.msg;t.info.is_like=e.tags,t.info.like_num=e.tags?Number(t.info.like_num)+1:Number(t.info.like_num)-1,t.$message.success(s)}))},handleComment:function(){var t=this,i={content:this.edit_value};i.reply_id=this.info.id,this.option.postApi(i).then((function(i){var e=i.data,s=i.msg;t.edit_value="",t.$message.success(s),e.detail.is_like=0,e.detail.can_delete=1,t.list=1==t.params.sort_type?[e.detail].concat(t.list):t.list.concat([e.detail])}))},handleReply:function(t,i){console.log(t);var e=m(m({},t),{},{parent_comment:i,is_like:0,can_delete:1});this.list=1==this.params.sort_type?[e].concat(this.list):this.list.concat([e])},handleDelete:function(t){var i=JSON.parse(JSON.stringify(this.list));i.splice(t,1),this.list=i},openAllComment:function(){this.$refs["forumAllComment"].open("answer",this.info)}}},f=p,_=(e("06b47"),e("2877")),v=Object(_["a"])(f,s,n,!1,null,"15e158c0",null);i["default"]=v.exports},ca2e:function(t,i,e){}}]);
  2. //# sourceMappingURL=chunk-20becc2c.3427157e.js.map