java-mall-app/unpackage/dist/build/mp-weixin/community/components/douyin-scrollview/douyin-H-scrollview.js
2024-11-01 16:35:40 +08:00

11 lines
17 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["community/components/douyin-scrollview/douyin-H-scrollview"],{3438:function(i,t,e){"use strict";e.r(t);var n=e("e522"),s=e.n(n);for(var o in n)["default"].indexOf(o)<0&&function(i){e.d(t,i,(function(){return n[i]}))}(o);t["default"]=s.a},5756:function(i,t,e){"use strict";e.d(t,"b",(function(){return s})),e.d(t,"c",(function(){return o})),e.d(t,"a",(function(){return n}));var n={uniPopup:function(){return e.e("components/uni-popup/uni-popup").then(e.bind(null,"6ea8"))}},s=function(){var i=this,t=i.$createElement,e=(i._self._c,i.__("条评论")),n=i.pinlunList.length,s=0==n?i.__(" 快来评论吧 "):null,o=i.__("回复"),u=i.pinlunList.length,h=i.__map(i.pinlunList,(function(t,e){var n=i.__get_orig(t),s=i.videouserID==t.user_id?i.__("作者"):null,o=i.__map(t.commentList,(function(e,n){var s=i.__get_orig(e),o=t.iszhangkai&&i.videouserID==e.user_id?i.__("作者"):null,u=t.iszhangkai&&i.videouserID==e.user_id_to?i.__("作者"):null,h=t.iszhangkai?new Date(parseInt(e.comment_reply_time)).format("yyyy-MM-dd hh:mm:ss"):null;return{$orig:s,m4:o,m5:u,g1:h}}));return{$orig:n,m2:s,l0:o}})),a=i.show&&"ios"==i.platform?i.__("有爱评论,说点好听的~"):null,r=i.show&&"ios"!==i.platform?i.__("有爱评论,说点好听的~"):null,m=i.isToShow?i.nowImage.length:null,c=i.isToShow&&0!==m?i.__("清空"):null,l=i.isToShow?i.nowImage.length:null,g=i.isToShow&&0==l?i.__(" 您还没使用过图片 "):null,f=i.isToShow?i.nowTimeEmojiList.length:null,p=i.isToShow&&0!==f?i.__("最近使用"):null,d=i.isToShow&&0!==f?i.__("清空"):null,_=i.isToShow?i.__("全部表情"):null,w=i.isToShow&&(""!==i.value||""!==i.imageURL)&&i.isSend?i.__("发送"):null,I=i.isToShow&&""==i.value&&""==i.imageURL&&i.isSend?i.__("发送"):null;i.$mp.data=Object.assign({},{$root:{m0:e,g0:n,m1:s,m3:o,g2:u,l1:h,m6:a,m7:r,g3:m,m8:c,g4:l,m9:g,g5:f,m10:p,m11:d,m12:_,m13:w,m14:I}})},o=[]},abf1:function(i,t,e){"use strict";var n=e("b9202"),s=e.n(n);s.a},b9202:function(i,t,e){},e522:function(i,t,e){"use strict";(function(i){var n=e("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(e("7ca3")),o=e("8f59"),u=n(e("d073"));function h(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable}))),e.push.apply(e,n)}return e}function a(i){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?h(Object(e),!0).forEach((function(t){(0,s.default)(i,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):h(Object(e)).forEach((function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(e,t))}))}return i}var r={data:function(){return{num:1.15,plHeight:0,value:"",autoHeight:!1,borderRadius:50,lineheight:0,percent:1,show:!0,emojiHeight:0,emojiheight:0,emojihi:0,cursorSpacing:20,autoFocus:!0,isopen:!1,isToShow:!1,adjustPosition:!0,placeholder:"有爱评论,说点好听的~",disabled:!1,current:1,emojilist:[],nowTimeEmojiList:[],sinaEmojilist:[],currentNum:4.4,likeImage:[],nowImage:[],gifAndpngList:[],gifAndpnglist:[],searchGIFValue:"",isSearcopen:!1,GifList:[],isShowImage:!1,imageURL:"",platform:"",systemVerson:"",ischangepinlun:!0,pinlunList:[],pinlunListX:[],pinlun_list:[],videoID:"",isSend:!0,userID:"",update:!0,huifuUser:"",gethuifuUser:"",gethuifuUserID:"",istohuifu:!1,huifuindex:0,iszhangkai:!1,comment_id:0}},name:"douyin-scrollview",props:{Width:Number,Height:Number,story_id:{type:String,default:""},videouserID:{type:Number,default:0},pinlunNum:{type:Number,default:0}},components:{uniPopup:function(){e.e("components/uni-popup/uni-popup").then(function(){return resolve(e("6ea8"))}.bind(null,e)).catch(e.oe)},wxParse:function(){Promise.all([e.e("common/vendor"),e.e("components/u-parse/u-parse")]).then(function(){return resolve(e("986d"))}.bind(null,e)).catch(e.oe)}},computed:(0,o.mapState)(["Config","StateCode","notice","plantformInfo","shopInfo","userInfo","hasLogin","__","$","sprintf"]),watch:{searchGIFValue:function(i){if(this.isopen=!1,""!==i){for(var t=[],e=0;e<this.gifAndpngList.length;e++)-1!==this.gifAndpngList[e].name.indexOf(i)&&t.push(this.gifAndpngList[e]);this.GifList=t}},value:function(i){""==i?(this.autoHeight=!1,""!==this.imageURL?this.percent=.9:this.percent=1):(this.autoHeight=!0,this.percent=.9)},story_id:function(i){this.getnewpinlun()},imageURL:function(i){""!==i?this.percent=.9:""==this.value&&(this.percent=1)},lineheight:function(i,t){Math.abs(i)<30?this.borderRadius=50:this.borderRadius=10}},created:function(){this.placeholder=this.__("有爱评论,说点好听的~"),this.isToShow=!1;i.getSystemInfoSync().model;this.platform=i.getSystemInfoSync().platform,this.emojiHeight=0,this.videoID=i.getStorageSync("videoID"),this.userID=i.getStorageSync("user")._id,this.getnewpinlun(),i.getSystemInfoSync().platform,this.num=1.25,this.windowHeight=i.getSystemInfoSync().screenHeight,this.adjustPosition=!0,this.plHeight=this.Height-this.Height/this.num,""!==this.imageURL&&(this.percent=.9),this.emojilist=u.default,this.likeImage=i.getStorageSync("likeImage"),this.nowImage=i.getStorageSync("nowImage"),this.nowTimeEmojiList=i.getStorageSync("nowTimeEmojiList")},methods:a(a({},(0,o.mapMutations)(["logout","getPlantformInfo","forceUserInfo","getStoreInfo"])),{},{getnewpinlun:function(){var i=this,t={story_id:this.story_id,sidx:"comment_time",sord:"DESC"};i.$.request({url:this.Config.URL.sns.story_comment_lists,data:t,success:function(t,e,n,s){t.items,t.items;for(var o=0;o<t.items.length;o++)0!==t.items[o].commentList.length?(t.items[o].sonpinlunText=i.__("展开")+t.items[o].commentList.length+i.__("条回复"),t.items[o].sonpinlunLength=t.items[o].commentList.length):t.items[o].sonpinlunLength=0,t.items[o].iszhangkai=!1;i.pinlunList=t.items,i.pinlunListX=t.items}})},sendSMS:function(){var t=this,e=this,n=this.value,s="";if(""!==this.value){var o=n.replace(/\[([^(\]|\[)]*)\]/g,(function(i,e){console.log("item: "+i);for(var n=0;n<t.emojilist.length;n++){var s=t.emojilist[n];if(s.alt==i){var o='<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/'+s.url+'" style="width: 21px; height: 21px; margin-left: 1px; margin-right: 1px; margin-top: -2px;" />';return o}}}));s='<div style="width: 292.5px; display: flex; flex-flow: row wrap; margin-top: 7px;">'+o+"</div>"}else[];var u={};if(this.istohuifu){this.isSend=!1,i.showLoading({title:this.__("正在发送...")});u={user_id:this.userInfo.user_id,story_id:this.story_id,comment_content:s,comment_reply_id:0,comment_id:this.comment_id,to_user_id:this.gethuifuUserID};this.$.request({url:this.Config.URL.sns.story_comment_add,data:u,success:function(t,n,s,o){200==n?(i.hideLoading(),e.value="",e.imageURL="",e.$refs.openPinglun.close(),e.isSend=!0,e.getnewpinlun()):e.$.alert(s)}})}else u={user_id:this.videouserID,story_id:this.story_id,comment_content:s,comment_reply_id:0,comment_id:0,to_user_id:0},console.log(u),this.isSend=!1,i.showLoading({title:this.__("正在发送...")}),this.$.request({url:this.Config.URL.sns.story_comment_add,data:u,success:function(t,n,s,o){200==n?(i.hideLoading(),e.value="",e.imageURL="",e.isSend=!0,e.getnewpinlun()):e.$.alert(s)}})},tosonlike:function(i,t){var e=this,n=this.pinlunList[i].commentList[t],s=e.Config.URL.sns.story_comment_reply_like_add,o=1,u=n.comment_reply_helpful_num;n.IsFabulous?(s=e.Config.URL.sns.story_comment_reply_like_remove,o=0,u-=1):u+=1,e.forceUserInfo((function(h){var a={comment_reply_id:n.comment_reply_id};e.$.request({url:s,data:a,success:function(n,s,h,a){200==s&&(e.pinlunList[i].commentList[t].IsFabulous=o,e.pinlunList[i].commentList[t].comment_reply_helpful_num=u,this.getnewpinlun())}})}))},zhangkai:function(i){var t=this.pinlunList[i];0==t.iszhangkai?(t.iszhangkai=!0,t.sonpinlunText=this.__("收起评论")):(t.iszhangkai=!1,t.sonpinlunText=this.__("展开")+this.pinlunList[i].sonpinlunLength+this.__("条回复")),this.pinlunList[i]=t,this.$forceUpdate()},deletesonpinlun:function(i,t){},deletepinlun:function(t){var e=this;i.showModal({title:this.__("确定删除?"),content:this.__("删除后子评论将被删除"),success:function(n){if(n.confirm){i.showLoading({title:e.__("正在删除")});for(var s=[],o=0;o<e.pinlunListX.length;o++)o!==e.pinlunListX.length-1-t&&s.push(e.pinlunListX[o]);i.request({url:"https://bdb24c6d-8c19-4f80-8e7e-c9c9f037f131.bspapp.com/video",method:"POST",data:{info:"add_pinlun",_id:e.videoID,pinlun:s},success:function(t){i.hideLoading(),e.getnewpinlun()}})}}})},addlikeImage:function(){i.showModal({title:"⏰演示项目提醒⏰",content:"请前往 douyin-scrollview.nvue组件\naddlikeImage()函数进行配置",success:function(){}})},sonhuifu:function(t,e){this.huifuUser=i.getStorageSync("user").username,this.gethuifuUser=this.pinlunList[t].sonPinlun[e].username,this.gethuifuUserID=this.pinlunList[t].sonPinlun[e].userID,this.istohuifu=!0,this.placeholder=this.__("回复:")+this.gethuifuUser,this.huifuindex=t,this.openPinglun()},huifu:function(t){this.huifuUser=i.getStorageSync("user").username,this.gethuifuUser=this.pinlunList[t].user_nickname,this.gethuifuUserID=this.pinlunList[t].user_id,this.istohuifu=!0,this.placeholder=this.__("回复:")+this.pinlunList[t].user_nickname,this.comment_id=this.pinlunList[t].comment_id,this.huifuindex=t,this.openPinglun()},clicknowImage:function(i){this.imageURL=this.nowImage[i],this.isShowImage=!0},selectGIF:function(t){if(this.imageURL=this.GifList[t].url,this.isShowImage=!0,this.searchGIFValue="",this.$refs.searchEmoji.close(),0==i.getStorageSync("nowImage").length)this.nowImage=[],this.nowImage.push(this.imageURL),i.setStorageSync("nowImage",this.nowImage);else{this.nowImage=i.getStorageSync("nowImage");for(var e=!0,n=0;n<this.nowImage.length;n++)this.imageURL==this.nowImage[n]&&(e=!1);e&&this.nowImage.push(this.imageURL),i.setStorageSync("nowImage",this.nowImage)}},deleteimageURL:function(){this.imageURL="",this.isShowImage=!1},clickGIF:function(t){if(this.imageURL=this.gifAndpnglist[t].url,this.isShowImage=!0,0==i.getStorageSync("nowImage").length)this.nowImage=[],this.nowImage.push(this.imageURL),i.setStorageSync("nowImage",this.nowImage);else{this.nowImage=i.getStorageSync("nowImage");for(var e=!0,n=0;n<this.nowImage.length;n++)this.imageURL==this.nowImage[n]&&(e=!1);e&&this.nowImage.push(this.imageURL),i.setStorageSync("nowImage",this.nowImage)}},clearSearchValue:function(){this.searchGIFValue=""},blurGIF:function(){this.windowHeight=i.getSystemInfoSync().screenHeight,this.emojiHeight=this.windowHeight/2.1,""==this.searchGIFValue&&this.$refs.searchEmoji.close()},searchGIF:function(){var t=this;this.emojiHeight=0,"ios"==i.getSystemInfoSync().platform?this.$refs.searchEmoji.open("bottom"):setTimeout((function(){t.$refs.searchEmoji.open("bottom")}),500)},deletenowImage:function(t){for(var e=[],n=0;n<this.nowImage.length;n++)this.nowImage[n]!==this.nowImage[t]&&e.push(this.nowImage[n]);this.nowImage=e,i.setStorageSync("nowImage",this.nowImage)},clickLikeImage:function(t){if(0==i.getStorageSync("nowImage").length)this.nowImage=[],this.nowImage.push(this.likeImage[t]),i.setStorageSync("nowImage",this.nowImage);else{this.nowImage=i.getStorageSync("nowImage");for(var e=!0,n=0;n<this.nowImage.length;n++)this.likeImage[t]==this.nowImage[n]&&(e=!1);e&&this.nowImage.push(this.likeImage[t]),i.setStorageSync("nowImage",this.nowImage)}},deleteImage:function(t){var e=this;i.showModal({title:this.__("确定删除?"),success:function(n){n.confirm&&i.removeSavedFile({filePath:e.likeImage[t],success:function(){for(var n=[],s=0;s<e.likeImage.length;s++)e.likeImage[s]!==e.likeImage[t]&&n.push(e.likeImage[s]);for(var o=[],u=0;u<e.nowImage.length;u++)e.nowImage[u]!==e.likeImage[t]&&o.push(e.nowImage[u]);e.nowImage=o,i.setStorageSync("nowImage",e.nowImage),e.likeImage=n,i.setStorageSync("likeImage",e.likeImage)}})}})},qingkonGIF:function(){var t=this;i.showModal({title:this.__("确定清空?"),success:function(e){e.confirm&&(t.nowImage=[],i.removeStorageSync("nowImage"))}})},searchGIFChange:function(i){},change:function(t){1==t.show?this.show=!1:(i.hideKeyboard(),this.isToShow=!1,this.emojiHeight=0,this.show=!0,this.autoFocus=!0,this.isopen=!1,this.current=1,this.currentNum=4.4,this.isShowImage=!1,this.cursorSpacing=20,this.placeholder=this.__("有爱评论,说点好听的~"),this.istohuifu=!1)},closeSheet:function(){this.$emit("closeScrollview")},movehandle:function(){},movesearch:function(){},openPinglun:function(){var i=this;setTimeout((function(){i.$refs.openPinglun.open("bottom")}),500)},linechange:function(i){this.lineheight=i.detail.height},keyboardheightchange:function(){},blur:function(){},clickTextarea:function(){var t=this;this.disabled=!1,"ios"==i.getSystemInfoSync().platform&&(this.autoFocus=!1,setTimeout((function(){t.autoFocus=!0}),200))},focus:function(){var t=this;"ios"==i.getSystemInfoSync().platform&&(this.autoFocus=!1,this.isopen=!0),setTimeout((function(){t.autoFocus=!0,t.isopen=!1,setTimeout((function(){"ios"==i.getSystemInfoSync().platform&&(t.isToShow=!0),""!==t.imageURL&&(t.isShowImage=!0)}),1500)}),20)},toemoji:function(){var t=this;0==this.isopen?(this.windowHeight=i.getSystemInfoSync().screenHeight,this.emojiHeight=this.windowHeight/2.1,this.disabled=!0,this.isopen=!0,this.isToShow=!0):(this.isShowImage=!1,this.isToShow=!1,this.isopen=!1,this.disabled=!1,this.emojiHeight=0,""!==this.imageURL&&setTimeout((function(){t.isShowImage=!0}),1300))},undo:function(){if(""!==this.value){for(var i="",t=0;t<this.value.length-1;t++)i+=this.value[t];this.value=i}},timeEmoji:function(){this.currentNum=1,this.current=0},nowEmoji:function(){this.currentNum=4.3,this.current=1},likeEmoji:function(){this.currentNum=7.6,this.current=2},gifEmoji:function(){this.currentNum=11,this.current=3},qingkon:function(){var t=this;i.showModal({title:this.__("确定清空?"),success:function(e){e.confirm&&(t.nowTimeEmojiList=[],i.removeStorageSync("nowTimeEmojiList"))}})},clicknowTimeEmoji:function(i){var t=this.nowTimeEmojiList[i].alt;this.value+=t},clickEmoji:function(t){var e=this.emojilist[t].alt;if(this.value+=e,0==i.getStorageSync("nowTimeEmojiList").length)this.nowTimeEmojiList=[],this.nowTimeEmojiList.push(this.emojilist[t]),i.setStorageSync("nowTimeEmojiList",this.nowTimeEmojiList);else{this.nowTimeEmojiList=i.getStorageSync("nowTimeEmojiList");for(var n=!0,s=0;s<this.nowTimeEmojiList.length;s++)this.emojilist[t].alt==this.nowTimeEmojiList[s].alt&&(n=!1);n&&this.nowTimeEmojiList.push(this.emojilist[t]),i.setStorageSync("nowTimeEmojiList",this.nowTimeEmojiList)}},clicksinaEmoji:function(i){console.log(this.sinaEmojilist[i])},currentChange:function(i){var t=i.detail.current+1;switch(t){case 1:this.currentNum=1;break;case 2:this.currentNum=4.3;break;case 3:this.currentNum=7.6;break;case 4:this.currentNum=11;break;default:break}},getGif:function(){for(var i=[],t=0;t<15;t++){var e=Math.round(Math.random()*this.gifAndpngList.length);i.push(this.gifAndpngList[e])}this.gifAndpnglist=i},scrolltolowerGIF:function(){for(var i=0;i<15;i++){var t=Math.round(Math.random()*this.gifAndpngList.length);this.gifAndpnglist.push(this.gifAndpngList[t])}},onUnCommentLike:function(i){var t=this;i.stopPropagation(),t.forceUserInfo((function(e){var n={comment_id:i.currentTarget.dataset.comment_id};t.$.request({url:t.Config.URL.sns.story_comment_like_remove,data:n,success:function(e,n,s,o){if(200==n){for(var u=[],h=0;h<t.commentList.length;h++)if(t.commentList[h].comment_id==i.currentTarget.dataset.comment_id){var a=t.commentList[h];0==t.commentList[h].IsFabulous?(a.IsFabulous=1,a.comment_like_count=a.comment_like_count+1):(a.IsFabulous=0,a.comment_like_count=a.comment_like_count-1),u.push(a)}else u.push(t.commentList[h]);t.commentList=u}}})}))},onCommentLike:function(i){var t=this;i.stopPropagation(),t.forceUserInfo((function(e){t.zan(i.currentTarget.dataset.comment_id)}))},zan:function(i){var t=this,e={user_id:t.userInfo.user_id,comment_id:i};t.$.request({url:this.Config.URL.sns.story_comment_like_add,data:e,success:function(e,n,s,o){if(200==n){for(var u=[],h=0;h<t.pinlunList.length;h++)if(t.pinlunList[h].comment_id==i){var a=t.pinlunList[h];0==t.pinlunList[h].IsFabulous?(a.IsFabulous=1,a.comment_like_count=a.comment_like_count+1):(a.IsFabulous=0,a.comment_like_count=a.comment_like_count-1),u.push(a)}else u.push(t.pinlunList[h]);t.commentList=u}}})}})};t.default=r}).call(this,e("df3c")["default"])},febe:function(i,t,e){"use strict";e.r(t);var n=e("5756"),s=e("3438");for(var o in s)["default"].indexOf(o)<0&&function(i){e.d(t,i,(function(){return s[i]}))}(o);e("abf1");var u=e("828b"),h=Object(u["a"])(s["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);t["default"]=h.exports}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'community/components/douyin-scrollview/douyin-H-scrollview-create-component',
{
'community/components/douyin-scrollview/douyin-H-scrollview-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('df3c')['createComponent'](__webpack_require__("febe"))
})
},
[['community/components/douyin-scrollview/douyin-H-scrollview-create-component']]
]);