(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-45dda609"],{"0449":function(t,e,n){},"07a8":function(t,e,n){t.exports=n.p+"img/praise.981f2823.svg"},"0cb0":function(t,e,n){},1302:function(t,e,n){},"16de":function(t,e,n){},"1da1":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));n("d3b7");function r(t,e,n,r,i,o,s){try{var a=t[o](s),c=a.value}catch(u){return void n(u)}a.done?e(c):Promise.resolve(c).then(r,i)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,c,"next",t)}function c(t){r(s,i,o,a,c,"throw",t)}a(void 0)}))}}},"3a87":function(t,e,n){"use strict";var r=n("1302"),i=n.n(r);i.a},4579:function(t,e,n){},"5aa0":function(t,e,n){t.exports=n.p+"img/back.8059563a.svg"},"60bf":function(t,e,n){},"62f2":function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{attrs:{id:"Moment"}},[r("NavBar",{staticClass:"nav-bar"},[r("div",{staticClass:"back",attrs:{slot:"left"},on:{click:t.backClick},slot:"left"},[r("img",{attrs:{src:n("5aa0"),alt:""}})]),r("div",{staticClass:"title",attrs:{slot:"center"},slot:"center"},[t._v("动态详情")])]),t.isshow?r("ChildDetailMoment",{staticClass:"ChildDetailMoment",attrs:{comments:t.comments},on:{refresh:t.refresh}}):t._e()],1)},i=[],o=(n("96cf"),n("1da1")),s=n("a7ac"),a=n("6e74");function c(t){return Object(a["a"])({url:"/moment/"+t})}function u(t){return Object(a["a"])({url:"/comment",params:{momentId:t}})}var l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"moment"},[n("Scroll",{ref:"scroll",staticClass:"content",attrs:{"pull-up-load":!0,"probe-type":3},on:{pullingUp:t.loadMore,pullingDown:t.pullingDown}},[n("div",{staticClass:"top"},[n("img",{attrs:{src:t.comments.author&&t.comments.author.avatarUrl}}),n("div",{staticClass:"desc"},[n("div",{staticClass:"name"},[t._v(t._s(t.comments.author&&t.comments.author.name))]),n("div",{staticClass:"time"},[t._v(" "+t._s(this.$moment(t.comments.createTime).fromNow())+" ")])])]),n("div",{staticClass:"maincontent"},[t._v(t._s(t.comments.content))]),n("div",[n("div",{staticClass:"image"},t._l(t.comments.images,(function(t,e){return n("li",{key:e,staticClass:"picture"},[n("img",{attrs:{width:"100px",height:"100px",preview:e,src:t+"?type=small"}})])})),0)]),this.isdisplay?n("icon",{staticClass:"icon",attrs:{comments:t.comments,praise:this.praise},on:{clickpraise:t.clickpraise,Popup:t.Popup}}):t._e(),this.showpraise?n("PraiseList",{staticClass:"praise",attrs:{praises:this.praise.praise}}):t._e(),n("CommentList",{staticClass:"commentsarea",attrs:{newcomments:this.allcomment,Author:t.comments.author}})],1),n("van-popup",{staticClass:"showcomment",attrs:{position:"bottom"},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[n("van-field",{directives:[{name:"focus",rawName:"v-focus"}],ref:"gain",staticClass:"inputcomment",attrs:{rows:"1",autosize:"",placeholder:"输入你想表达~","show-word-limit":"",type:"textarea",size:"large"},model:{value:t.comment.content,callback:function(e){t.$set(t.comment,"content",e)},expression:"comment.content"}}),n("span",{attrs:{className:"postcomment",round:"",type:"info"},on:{click:t.createcomment}},[t._v("发送")])],1)],1)},m=[],h=(n("c975"),function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"icon"},[r("div",[r("i",{attrs:{id:"icon-1"},on:{click:t.clickpraise}},[r("img",{attrs:{src:n("07a8")}})]),r("sup",{staticClass:"praiseclass"},[t._v(t._s(t.promiseCount()))])]),r("div",[r("i",{staticClass:"el-icon-chat-dot-square",staticStyle:{"font-size":"20px"},attrs:{id:"icon-1"},on:{click:t.Popup}}),r("sup",{staticClass:"commentclass"},[t._v(t._s(t.comments.commentCount))])])])}),f=[],p={name:"icon",props:{comments:{type:Object,default:function(){return{}}}},data:function(){return{praise:{},momentId:"",token:""}},mounted:function(){this.token=window.localStorage.getItem("token")},created:function(){this.momentId=this.$route.params.iid,this.getAllPraise()},methods:{promiseCount:function(){return this.praise.promiseCount||0},getAllPraise:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.get("/praise/"+t.momentId);case 2:n=e.sent,r=n.data,t.praise=r;case 5:case"end":return e.stop()}}),e)})))()},clickpraise:function(){this.token?this.$emit("clickpraise"):this.$router.push("/login")},Popup:function(){this.token?this.$emit("Popup"):this.$router.push("/login")}}},d=p,v=(n("fa05"),n("2877")),g=Object(v["a"])(d,h,f,!1,null,"7e819b08",null),w=g.exports,y=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"comment-list"},t._l(t.newcomments,(function(e,r){return n("CommentListItem",{key:r,staticClass:"comment-list-item",attrs:{comments:e,Author:t.Author}})})),1)},b=[],x=n("8d33"),k=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"comment-list-item",on:{click:t.createcomment}},[n("span",{staticClass:"main"},[t._v(t._s(t.comments.user.name))]),t._v("回复"),n("span",[t._v(t._s(this.name))]),t._v(":"+t._s(t.comments.content)+" ")])},_=[],$=(n("b0c0"),{name:"CommentListItem",props:{comments:{type:Object,default:function(){return{}}},Author:{type:Object,default:function(){return{}}}},data:function(){return{name:"",token:""}},created:function(){this.getName()},methods:{createcomment:function(){this.token=window.localStorage.getItem("token"),this.token?(this.$bus.$emit("commentId",this.comments.id),this.$bus.$emit("comment")):this.$router.push("/login")},getName:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.get("/comment/"+t.comments.comment_id);case 2:n=e.sent,r=n.data,t.name=r.user&&r.user.name,void 0==t.name&&(t.name=t.Author.name);case 6:case"end":return e.stop()}}),e)})))()}},mounted:function(){}}),C=$,L=(n("7825"),Object(v["a"])(C,k,_,!1,null,"3cc7b61b",null)),I=L.exports,O={name:"CommentList",components:{CommentListItem:I,Scroll:x["a"]},data:function(){return{pullingdown:!1}},props:{newcomments:{type:Array,defalut:function(){return[]}},Author:{type:Object,defalut:function(){return{}}}},created:function(){window.localStorage.setItem("ispraise","1")},methods:{loadMore:function(){this.$refs.scroll.refresh()},pullingDown:function(){var t=this;this.pullingdown=!0,setTimeout((function(){t.pullingdown=!1,t.$refs.scroll.finishPullDown()}),1e3)}}},j=O,E=(n("dad5"),Object(v["a"])(j,y,b,!1,null,"704f6eb2",null)),P=E.exports,T=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"PraiseListItem"},t._l(t.praises,(function(t,e){return n("PraiseListItem",{key:e,attrs:{praise:t}})})),1)},S=[],R=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"praise"},[r("img",{attrs:{src:n("94f6")}}),r("span",[t._v(t._s(t.praise.name))])])},D=[],N={name:"PraiseListItem",props:{praise:{type:Object,default:function(){return{}}}},data:function(){return{ispraise:"点赞"}}},A=N,M=(n("3a87"),Object(v["a"])(A,R,D,!1,null,"5a4adf46",null)),U=M.exports,G={name:"PraiseList",components:{PraiseListItem:U},props:{praises:{type:Array,defalut:function(){return[]}}}},F=G,z=(n("b642"),Object(v["a"])(F,T,S,!1,null,"48248490",null)),B=z.exports,H={name:"ChildDetailMoment",components:{CommentList:P,PraiseList:B,icon:w,Scroll:x["a"]},props:{comments:{type:Object,default:function(){return{}}}},data:function(){return{id:"",show:!1,isResize:!1,isshow:!0,comment:{content:"",momentId:""},iscomment:!0,allcomment:[],praise:{},ispraise:"",number:"",isdisplay:!0,clientHeight:document.documentElement.clientHeight,showpraise:!0}},created:function(){var t=this;this.momentId=this.$route.params.iid,u(this.momentId).then((function(e){t.allcomment=e.data})),this.getdata()},directives:{focus:{inserted:function(t){t.focus()}}},methods:{loadMore:function(){this.$refs.scroll.refresh()},pullingDown:function(){var t=this;this.pullingdown=!0,setTimeout((function(){t.pullingdown=!1,t.$refs.scroll.finishPullDown()}),300)},getdata:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.get("/praise/"+t.momentId);case 2:n=e.sent,r=n.data,t.praise=r;case 5:case"end":return e.stop()}}),e)})))()},Popup:function(){this.show=!this.show;var t=this;this.$nextTick((function(){t.$refs.gain.focus()}),300)},refresh:function(){var t=this;this.showpraise=!1,this.isdisplay=!1;var e=this;this.$nextTick(Object(o["a"])(regeneratorRuntime.mark((function n(){var r,i;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$http.get("/praise/"+t.momentId);case 2:r=n.sent,i=r.data,e.praise=i,e.isdisplay=!0,e.showpraise=!0;case 7:case"end":return n.stop()}}),n)}))),100)},createcomment:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,r,i,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.comment.momentId=t.comments.id,!t.iscomment){e.next=9;break}return e.next=4,t.$http.post("comment",t.comment);case 4:n=e.sent,r=n.data,0!=r.insertId&&(t.$emit("refresh"),t.$message.success("评论成功")),e.next=14;break;case 9:return e.next=11,t.$http.post("comment/"+t.commentId+"/reply",t.comment);case 11:i=e.sent,o=i.data,0!=o.insertId&&(t.iscomment=!0,t.$emit("refresh"),t.$message.success("评论成功"));case 14:case"end":return e.stop()}}),e)})))()},clickpraise:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,r,i,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.post("/praise/ispraise/"+t.momentId);case 2:if(n=e.sent,r=n.data,"200"!=r.status&&(t.number=window.localStorage.getItem("number"),"1"===t.number?window.localStorage.setItem("number","0"):window.localStorage.setItem("number","1")),"200"!=r.status){e.next=11;break}return e.next=8,t.$http.post("/praise/"+t.momentId);case 8:t.$nextTick((function(){t.refresh()}),100),e.next=19;break;case 11:return t.number=window.localStorage.getItem("number"),i={ispraise:""},i.ispraise=t.number,e.next=16,t.$http.post("/praise/update/"+t.momentId,i);case 16:o=e.sent,o.data,t.$nextTick((function(){t.refresh()}),100);case 19:case"end":return e.stop()}}),e)})))()}},mounted:function(){var t=this;this.$bus.$on("commentId",(function(e){t.commentId=e,t.iscomment=!1})),this.$bus.$on("comment",this.Popup);var e=navigator.userAgent;document.getElementsByClassName("van-popup")[0];e.indexOf("iPhone")<=-1&&(window.onresize=function(){t.clientHeight,document.documentElement.clientHeight})}},Y=H,q=(n("d1eb"),Object(v["a"])(Y,l,m,!1,null,"240d20be",null)),J=q.exports,K={name:"DetailMoment",components:{NavBar:s["a"],ChildDetailMoment:J},data:function(){return{iid:"",comments:{},isshow:!0,pullingdown:!1}},created:function(){this.getComment()},methods:{backClick:function(){this.$router.push("/moment")},refresh:function(){var t=this;this.isshow=!1,this.$nextTick((function(){t.isshow=!0}),100),this.getComment()},getComment:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.iid=t.$route.params.iid,e.next=3,c(t.iid);case 3:n=e.sent,t.comments=n.data;case 5:case"end":return e.stop()}}),e)})))()}}},Q=K,V=(n("ee99"),Object(v["a"])(Q,r,i,!1,null,"43e92e87",null));e["default"]=V.exports},"6e74":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("bc3a"),i=n.n(r);function o(t){var e=i.a.create({baseURL:"http://47.108.153.30:8001/",timeout:15e3});return e.interceptors.request.use((function(t){return t.headers.Authorization=window.localStorage.getItem("token"),t})),e(t)}},7825:function(t,e,n){"use strict";var r=n("0449"),i=n.n(r);i.a},"8d33":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"wrapper",staticClass:"wrapper"},[n("div",{staticClass:"content"},[t._t("default")],2)])},i=[],o=(n("a9e3"),n("f40f")),s={name:"Scroll",props:{probeType:{type:Number,default:0},pullUpLoad:{type:Boolean,default:!1},pullDownLoad:{type:Boolean,default:!1}},data:function(){return{scroll:null}},mounted:function(){var t=this;this.$nextTick((function(){t.scroll=new o["a"](t.$refs.wrapper,{click:!0,probeType:t.probeType,pullUpLoad:{threshold:80,stop:80},useTransition:!1,pullDownRefresh:{threshold:40,stop:30},disableMouse:!1,disableTouch:!1}),t.scroll.on("scroll",(function(e){t.$emit("scrollw",e)})),t.scroll.on("pullingUp",(function(){t.$emit("pullingUp")})),t.scroll.on("pullingDown",(function(){t.$emit("pullingDown")})),t.scroll.scrollTo(0,0)}))},methods:{scrollTo:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;this.scroll&&this.scroll.scrollTo(t,e,n)},finishPullUp:function(){this.refresh(),this.scroll&&this.scroll.finishPullUp()},finishPullDown:function(){this.refresh(),this.scroll&&this.scroll.finishPullDown()},refresh:function(){this.scroll&&this.scroll.refresh()},getScrollY:function(){return this.scroll?this.scroll.y:0}}},a=s,c=n("2877"),u=Object(c["a"])(a,r,i,!1,null,"62c7f78a",null);e["a"]=u.exports},"94f6":function(t,e,n){t.exports=n.p+"img/praise-icon.fcdfd963.svg"},"96cf":function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(T){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new j(r||[]);return o._invoke=C(t,n,s),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(T){return{type:"throw",arg:T}}}t.wrap=u;var m="suspendedStart",h="suspendedYield",f="executing",p="completed",d={};function v(){}function g(){}function w(){}var y={};y[o]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(E([])));x&&x!==n&&r.call(x,o)&&(y=x);var k=w.prototype=v.prototype=Object.create(y);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function $(t,e){function n(i,o,s,a){var c=l(t[i],t,o);if("throw"!==c.type){var u=c.arg,m=u.value;return m&&"object"===typeof m&&r.call(m,"__await")?e.resolve(m.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(m).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}var i;function o(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}this._invoke=o}function C(t,e,n){var r=m;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return P()}n.method=i,n.arg=o;while(1){var s=n.delegate;if(s){var a=L(s,n);if(a){if(a===d)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===m)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=l(t,e,n);if("normal"===c.type){if(r=n.done?p:h,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=p,n.method="throw",n.arg=c.arg)}}}function L(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator["return"]&&(n.method="return",n.arg=e,L(t,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=l(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function E(t){if(t){var n=t[o];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function n(){while(++i=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(c&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;O(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:E(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}},b0c0:function(t,e,n){var r=n("83ab"),i=n("9bf2").f,o=Function.prototype,s=o.toString,a=/^\s*function ([^ (]*)/,c="name";r&&!(c in o)&&i(o,c,{configurable:!0,get:function(){try{return s.call(this).match(a)[1]}catch(t){return""}}})},b42b:function(t,e,n){},b642:function(t,e,n){"use strict";var r=n("0cb0"),i=n.n(r);i.a},d1eb:function(t,e,n){"use strict";var r=n("b42b"),i=n.n(r);i.a},dad5:function(t,e,n){"use strict";var r=n("16de"),i=n.n(r);i.a},ee99:function(t,e,n){"use strict";var r=n("60bf"),i=n.n(r);i.a},fa05:function(t,e,n){"use strict";var r=n("4579"),i=n.n(r);i.a}}]); //# sourceMappingURL=chunk-45dda609.a597b399.js.map