11 lines
7.0 KiB
JavaScript
11 lines
7.0 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/five-mul-commentlist/five-mul-commentlist"],{1904:function(t,e,n){"use strict";n.r(e);var i=n("9c59"),o=n.n(i);for(var m in i)["default"].indexOf(m)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(m);e["default"]=o.a},"2a48":function(t,e,n){"use strict";var i=n("e5a9"),o=n.n(i);o.a},"9c59":function(t,e,n){"use strict";(function(t){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n("7ca3")),m=n("8f59");function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){(0,o.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var r={name:"MulCommentList",components:{FiveComment:function(){n.e("components/five-comment/five-comment").then(function(){return resolve(n("fcb2"))}.bind(null,n)).catch(n.oe)}},props:{commentLists:{type:Array},title:{type:String,default:"网友评论"},story_id:{type:Number,default:0},user_id:{type:Number,default:0}},computed:(0,m.mapState)(["Config","StateCode","notice","plantformInfo","shopInfo","userInfo","hasLogin","__","$","sprintf"]),data:function(){return{placeholder:"请输入评论内容…",commentParam:{},commentList:[],flag:!0,ispage:!0,page:1,winHeight:0,winWidth:0}},created:function(e){this.winHeight=t.getSystemInfoSync().windowHeight,this.winWidth=t.getSystemInfoSync().windowWidth,this.updateHeights()},watch:{commentLists:{handler:function(t,e){this.commentList=t},immediate:!0}},methods:s(s({},(0,m.mapMutations)(["logout","getPlantformInfo","forceUserInfo","getStoreInfo"])),{},{updateHeights:function(){var e=this;this.$nextTick((function(){t.createSelectorQuery().in(e).selectAll(".view-comment").boundingClientRect((function(t){var n=0;t.length>0&&(n=t.map((function(t){return t.height}))),e.updateHeight(e.winHeight-(n[0]+43))})).exec()}))},updateHeight:function(t){this.$emit("updata",t)},clickComment:function(t){this.commentParam={COMMENT_TIME:"2020-07-07 14:30:01",FIRSTNICKNAME:"网友45454545",CHILD_ANWSER_LIST:[],IS_PRAISE:null,PRAISE_NUM:0,CANDELETE:1,HEADIMGURL:"http://img4.imgtn.bdimg.com/it/u=2858424520,3197172862&fm=11&gp=0.jpg",SECONDNICKNAME:null},t.stopPropagation(),this.$refs.detailComment.open()},sendComment:function(t){var e=this,n={user_id:e.userInfo.user_id,story_id:e.story_id,comment_content:t,comment_reply_id:0,comment_id:0,to_user_id:e.user_id},i=n;e.$.request({url:e.Config.URL.sns.story_comment_add,data:i,success:function(t,i,o,m){if(200==i){var c=new Date;n.user_nickname=e.userInfo.user_nickname,n.user_avatar=e.userInfo.user_avatar,n.comment_like_count=0,n.comment_id=t.comment_id,n.IsFabulous=0,n.comment_time=c.toLocaleString(),n.commentList=[],e.commentList.unshift(n),e.$emit("confirm",1)}else e.$.alert(o)}}),console.log(this.commentList)},scrollbottom:function(t){if(this.flag){var e=this;e.flag=!1,clearTimeout(n),e.page=parseInt(e.page)+1;var n=setTimeout((function(){e.GetPostsCommentByPostsId()}),500)}},close:function(t){this.$emit("closesp")},GetPostsCommentByPostsId:function(t){var e=this,n={story_id:e.story_id,page:e.page,sidx:"comment_time",sord:"DESC"};e.$.request({url:this.Config.URL.sns.story_comment_lists,data:n,loading:!1,success:function(t,n,i,o){if(t.items&&t.items.length>0){for(var m=0;m<t.items.length;m++){t.items[m]["comment_time_str"]=t.items[m]["comment_time"],t.items[m]["reply_name_str"]="";for(var c=0;c<t.items[m]["commentList"].length;c++)t.items[m]["commentList"][c]["comment_reply_time_str"]=dateUtil.dateUtils.format(e.$.datetimeFormatter(t.items[m]["commentList"][c]["comment_reply_time"])),t.items[m]["reply_name_str"]=t.items[m]["commentList"][c]["user_nickname"]}t.page>=t.total?(e.commentList=e.commentList.concat(t.items),e.flag=!1,e.ispage=!1):(e.commentList=e.commentList.concat(t.items),e.flag=!0,e.ispage=!0),console.log(e.commentList)}else e.flag=!1,e.ispage=!1}})},clickPraise:function(t){this.$emit("clickPraise",t)},onUnCommentLike:function(t){var e=this;t.stopPropagation(),e.forceUserInfo((function(n){var i={comment_id:t.currentTarget.dataset.comment_id};e.$.request({url:e.Config.URL.sns.story_comment_like_remove,data:i,success:function(n,i,o,m){if(200==i){for(var c=[],s=0;s<e.commentList.length;s++)if(e.commentList[s].comment_id==t.currentTarget.dataset.comment_id){var r=e.commentList[s];0==e.commentList[s].IsFabulous?(r.IsFabulous=1,r.comment_like_count=r.comment_like_count+1):(r.IsFabulous=0,r.comment_like_count=r.comment_like_count-1),c.push(r)}else c.push(e.commentList[s]);e.commentList=c}}})}))},onCommentLike:function(t){var e=this;t.stopPropagation(),e.forceUserInfo((function(n){e.zan(t.currentTarget.dataset.comment_id)}))},zan:function(t){var e=this,n={user_id:e.userInfo.user_id,comment_id:t};e.$.request({url:this.Config.URL.sns.story_comment_like_add,data:n,success:function(n,i,o,m){if(200==i){for(var c=[],s=0;s<e.commentList.length;s++)if(e.commentList[s].comment_id==t){var r=e.commentList[s];0==e.commentList[s].IsFabulous?(r.IsFabulous=1,r.comment_like_count=r.comment_like_count+1):(r.IsFabulous=0,r.comment_like_count=r.comment_like_count-1),c.push(r)}else c.push(e.commentList[s]);e.commentList=c}}})},clickRecomment:function(t){this.$emit("clickRecomment",t)},clickDeleteChild:function(t){this.$emit("clickDeleteChild",t)},clickRecommentChild:function(t){this.$emit("clickRecommentChild",t)}})};e.default=r}).call(this,n("df3c")["default"])},da1d:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return m})),n.d(e,"a",(function(){return i}));var i={fiveComment:function(){return n.e("components/five-comment/five-comment").then(n.bind(null,"fcb2"))}},o=function(){var t=this,e=t.$createElement,n=(t._self._c,t.commentList.length),i=t.commentList.length,o=i>0?t.__map(t.commentList,(function(e,n){var i=t.__get_orig(e),o=t.commentList.length,m=o>0?e.commentList.length:null;return{$orig:i,g2:o,g3:m}})):null;t.$mp.data=Object.assign({},{$root:{g0:n,g1:i,l0:o}})},m=[]},dc74:function(t,e,n){"use strict";n.r(e);var i=n("da1d"),o=n("1904");for(var m in o)["default"].indexOf(m)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(m);n("2a48");var c=n("828b"),s=Object(c["a"])(o["default"],i["b"],i["c"],!1,null,"f15738f2",null,!1,i["a"],void 0);e["default"]=s.exports},e5a9:function(t,e,n){}}]);
|
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
|
'components/five-mul-commentlist/five-mul-commentlist-create-component',
|
|
{
|
|
'components/five-mul-commentlist/five-mul-commentlist-create-component':(function(module, exports, __webpack_require__){
|
|
__webpack_require__('df3c')['createComponent'](__webpack_require__("dc74"))
|
|
})
|
|
},
|
|
[['components/five-mul-commentlist/five-mul-commentlist-create-component']]
|
|
]);
|