chunk-063fcdb8.bac5db7e.js 17 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-063fcdb8"],{1848:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"back-bar border-bottom"},[n("div",{staticClass:"arrow-icon",on:{click:t.onBack}},[n("i",{staticClass:"el-icon-arrow-left"})]),t._v("\n "+t._s(t.title)+"\n "),t.url?n("a",{staticClass:"icon-link",attrs:{href:t.url,target:"_blank"}}):t._e(),t._t("default")],2)},s=[],o={name:"backBar",props:{title:String,url:String},methods:{onBack:function(){this.$router?this.$router.go(-1):this.$emit("onBack")}}},r=o,a=(n("a7de"),n("fc05")),c=Object(a["a"])(r,i,s,!1,null,"bdea7596",null);e["a"]=c.exports},"1eac":function(t,e,n){},3740:function(t,e,n){n("e324"),n("4248"),t.exports=n("a38c").Array.from},"41dd":function(t,e,n){t.exports=n("3740")},4248:function(t,e,n){"use strict";var i=n("b2ae"),s=n("eaa7"),o=n("7d8e"),r=n("fadb"),a=n("41e9"),c=n("0445"),u=n("a713"),l=n("a8b2");s(s.S+s.F*!n("5557")(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,s,h,f=o(t),d="function"==typeof this?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,g=void 0!==m,v=0,w=l(f);if(g&&(m=i(m,p>2?arguments[2]:void 0,2)),void 0==w||d==Array&&a(w))for(e=c(f.length),n=new d(e);e>v;v++)u(n,v,g?m(f[v],v):f[v]);else for(h=w.call(f),n=new d;!(s=h.next()).done;v++)u(n,v,g?r(h,m,[s.value,v],!0):s.value);return n.length=v,n}})},5119:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.toolShow,expression:"toolShow"}],staticClass:"tool-wrap",on:{click:function(t){t.stopPropagation()}}},[n("div",{staticClass:"tool-item"},[n("div",{staticClass:"icon-box",on:{click:t.$packetSend}},[n("i",{staticClass:"packet-icon"})]),n("span",{staticClass:"type"},[t._v(t._s(t.$t("chat.redpack")))])]),n("div",{staticClass:"tool-item"},[n("div",{staticClass:"icon-box"},[n("i",{staticClass:"picture-icon"}),n("input",{ref:"inputFile1",attrs:{type:"file",accept:"image/*"},on:{change:t.handleFile}})]),n("span",{staticClass:"type"},[t._v(t._s(t.$t("chat.image")))])]),n("div",{staticClass:"tool-item"},[n("div",{staticClass:"icon-box"},[n("i",{staticClass:"audio-icon"}),n("input",{ref:"inputFile2",attrs:{type:"file",accept:"audio/*"},on:{change:t.handleFile}})]),n("span",{staticClass:"type"},[t._v(t._s(t.$t("chat.audio")))])]),n("div",{staticClass:"tool-item"},[n("div",{staticClass:"icon-box"},[n("i",{staticClass:"video-icon"}),n("input",{ref:"inputFile3",attrs:{type:"file",accept:"video/*"},on:{change:t.handleFile}})]),n("span",{staticClass:"type"},[t._v(t._s(t.$t("chat.video")))])])])},s=[],o=n("33f8"),r={name:"toolbar",props:{toolShow:Boolean,meechatType:Object(o["o"])()},methods:{handleFile:function(t){this.$emit("handleFile",t)},resetInput:function(){this.$refs.inputFile1&&(this.$refs.inputFile1.value=null),this.$refs.inputFile2&&(this.$refs.inputFile2.value=null),this.$refs.inputFile3&&(this.$refs.inputFile3.value=null)}}},a=r,c=(n("838e"),n("fc05")),u=Object(c["a"])(a,i,s,!1,null,"5557f4dc",null);e["a"]=u.exports},"63bf":function(t,e,n){t.exports=n("62cb")},"662e":function(t,e,n){"use strict";var i=n("cf50"),s=n.n(i);s.a},7486:function(t,e,n){"use strict";var i=n("e29a"),s=n.n(i);function o(t){if(s()(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}var r=n("41dd"),a=n.n(r),c=n("63bf"),u=n.n(c);function l(t){if(u()(Object(t))||"[object Arguments]"===Object.prototype.toString.call(t))return a()(t)}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function f(t){return o(t)||l(t)||h()}n.d(e,"a",function(){return f})},"838e":function(t,e,n){"use strict";var i=n("1eac"),s=n.n(i);s.a},8869:function(t,e,n){"use strict";n.d(e,"f",function(){return f}),n.d(e,"e",function(){return d}),n.d(e,"c",function(){return p}),n.d(e,"d",function(){return m}),n.d(e,"a",function(){return g}),n.d(e,"b",function(){return v});var i=n("34f3"),s=(n("8e5d"),n("bd31")),o=(n("0adb"),n("7486")),r=(n("dcfb"),n("b5aa"),n("4457")),a=(n("dc12"),n("5975")),c=n("33f8"),u=n("52c1"),l=n("c1f9"),h=n.n(l),f={data:function(){return{isSearch:!1,searchList:null}},methods:{searchUser:function(t,e){var n=t.target.value.toLocaleLowerCase();n?(this.searchList=e.filter(function(t){var e,i,s=(t.name||t.user_name||"").toLocaleLowerCase(),o=(t.nick_name||"").toLocaleLowerCase();return e=!!s&&s.indexOf(n)>-1,i=!!o&&o.indexOf(n)>-1,e||i}),this.isSearch=!0):this.isSearch=!1}}},d={data:function(){return{isSearchGroup:!1,searchUserTimer:null}},methods:{searchUser:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(e,n){var i=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:clearTimeout(this.searchUserTimer),this.searchUserTimer=setTimeout(Object(r["a"])(regeneratorRuntime.mark(function t(){var s,r;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(s=e.target.value.toLocaleLowerCase(),r=i.inviteType,i.isSearchGroup=!0,s.trim()){t.next=7;break}return n.forEach(function(t){i.$set(t,"isShow",!0)}),i.$nextTick(function(){i.isSearchGroup=!1,i.showNum=n.length}),t.abrupt("return");case 7:if(n.forEach(function(t){var e,n,o=(t.user_name||"").toLocaleLowerCase(),r=(t.nick_name||"").toLocaleLowerCase();e=!!o&&o.indexOf(s)>-1,n=!!r&&r.indexOf(s)>-1,i.$set(t,"isShow",e||n)}),n.length+1>=i.membersNum||1==r||2==r){t.next=11;break}return t.next=11,a["a"].group.searchMember({group_id:i.group.groupId,keyword:s}).then(function(t){var e=t.data,i=e.data;i.forEach(function(t){t.isChecked=!1,t.isChoosed=!1,t.isShow=!0}),n=h.a.unionBy([].concat(Object(o["a"])(n),Object(o["a"])(i)),"user_id")});case 11:i.$nextTick(function(){i.isSearchGroup=!1,i.showNum=n.filter(function(t){return t.isShow}).length});case 12:case"end":return t.stop()}},t,this)})),200);case 2:case"end":return t.stop()}},t,this)}));function e(e,n){return t.apply(this,arguments)}return e}()}},p={data:function(){return{atInd:0}},methods:{atPerson:function(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var e=this.$refs.chatInput,n=e.selectionStart,i=n-this.keyAfterAt.length;this.inputMsg=this.inputMsg.slice(0,i)+"".concat(t," ")+this.inputMsg.slice(n),this.atInd=0,e.focus(),this.$nextTick(function(){e.setSelectionRange(i+t.length+1,i+t.length+1)}),this.$store.commit("updateIsNewAt",{isNewAt:this.group.isNewAt,isNewAtFound:!0}),this.$store.commit("updateGroupSearchList",[])},handleUp:function(t){return this.atInd>0&&this.atInd--,this.atShow&&t.preventDefault(),!0},handleDown:function(t){var e=this.filterMembers.length;return this.atInd<e-1?this.atInd++:this.atInd=0,this.atShow&&t.preventDefault(),!0}}},m={data:function(){return{selectionAfterAt:!1,keyAfterAt:"",keyAfterAtTimer:"",lastKeyAfterAt:"",isIOS:!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),isShowContextmenu:!1,menuTop:0,menuLeft:0}},mounted:function(){},computed:Object(s["a"])({},Object(u["e"])(["copyText"]),{filterMembers:function(){if(!this.group.groupId)return[];var t=this.group.membersArray,e=[];if(""!==this.keyAfterAt)e=this.group.searchList;else for(var n=0;n<t.length;n++)t[n].user_id!=this.userId&&e.push(t[n]);return e.slice(0,100)},atShow:function(){return this.atInd=0,this.selectionAfterAt&&this.filterMembers.length}}),watch:{keyAfterAt:function(t){var e=this;clearTimeout(this.keyAfterAtTimer),this.keyAfterAtTimer=setTimeout(function(){e.handleKeyAfterAt(t)},200)},inputMsg:function(t,e){this.handleSelectionChange()}},methods:{handleKeyAfterAt:function(t){var e=this;if(this.group.groupId&&""!=t.trim()&&!this.group.isNewAtFound)if(this.group.membersArray.length<this.group.membersNum)a["a"].group.searchMember({group_id:this.group.groupId,keyword:t}).then(function(t){var n=t.data;e.$store.commit("updateGroupSearchList",n.data)});else{var n=this.group.membersArray.filter(function(e){var n,i;return n=!!e.user_name&&e.user_name.indexOf(t)>-1,i=!!e.nick_name&&e.nick_name.indexOf(t)>-1,n||i});this.$store.commit("updateGroupSearchList",n)}},getStrBeforeSelection:function(){var t=this.$refs.chatInput;if(!t)return"";var e=t.selectionStart,n=this.inputMsg.slice(0,e);return n},getStrAfterSelection:function(){var t=this.$refs.chatInput;if(!t)return"";var e=t.selectionStart,n=this.inputMsg.slice(e);return n},handleClick:function(){this.isShowContextmenu=!1},handleLeft:function(t){var e=this.$refs.chatInput,n=e.selectionStart;if(0===n)return!0;var i=this.getStrBeforeSelection(),s=this.group.members;for(var o in s){var r=s[o].user_name,a=new RegExp("@".concat(r," $"));if(a.test(i))return t.preventDefault(),e.setSelectionRange(n-r.length-2,n-r.length-2),!0}},handleRight:function(t){var e=this.$refs.chatInput,n=e.selectionStart,i=this.getStrAfterSelection(),s=this.group.members;for(var o in s){var r=s[o].user_name,a=new RegExp("^@".concat(r," "));if(a.test(i))return t.preventDefault(),e.setSelectionRange(n+r.length+2,n+r.length+2),!0}return!0},handleDel:function(t){var e=this,n=this.$refs.chatInput,s=n.selectionStart;if(0!==s){var o=this.getStrBeforeSelection(),r=this.group.members,a=function(i){var a=r[i].user_name,c=new RegExp("@".concat(a," $"));if(c.test(o))return t.preventDefault(),e.inputMsg=e.inputMsg.slice(0,s-a.length-2)+e.inputMsg.slice(s),e.$nextTick(function(){n.setSelectionRange(s-a.length-2,s-a.length-2)}),{v:void 0}};for(var c in r){var u=a(c);if("object"===Object(i["a"])(u))return u.v}}},handleKeyDown:function(t){var e=this;if(!this.atShow){if(t.altKey||t.ctrlKey){var n=this.getStrBeforeSelection(),i=this.getStrAfterSelection();this.inputMsg=n+"\n"+i,this.$nextTick(function(){e.$refs.chatInput.setSelectionRange(n.length+1,n.length+1)})}else this.handleSend(t),t.preventDefault();return!0}t.preventDefault();var s=this.filterMembers[this.atInd];this.atPerson(s.user_name,s.nick_name)},handleFocus:function(){var t=this;this.$emit("handleFocus"),this.updateChatInputFocus(!0),document.addEventListener("selectionchange",this.handleSelectionChange),this.isIOS&&setTimeout(function(){t.$root.$el.addEventListener("click",t.fixIOS)},0)},handleBlur:function(){var t=this;if(document.removeEventListener("selectionchange",this.handleSelectionChange),this.updateChatInputFocus(!1),(this.selectionAfterAt||this.isShowContextmenu)&&setTimeout(function(){t.selectionAfterAt=!1,t.isShowContextmenu=!1},200),this.isIOS){var e=document.body.scrollTop;document.body.scrollTop=e,this.$root.$el.removeEventListener("click",this.fixIOS)}},handleEsc:function(){this.selectionAfterAt=!1},handleSelectionChange:function(){var t=this.$refs.chatInput;if(t){var e=t.selectionStart,n=this.$refs.chatInput.selectionEnd;if(e===n){var i=this.getStrBeforeSelection();if(this.selectionAfterAt=/@/.test(i),this.selectionAfterAt){this.keyAfterAt=i.slice(i.lastIndexOf("@")+1);var s=this.keyAfterAt.indexOf(this.lastKeyAfterAt)<0;this.$store.commit("updateIsNewAt",{isNewAt:s,isNewAtFound:!s&&this.group.isNewAtFound}),s&&this.$store.commit("updateGroupSearchList",[]),this.lastKeyAfterAt=this.keyAfterAt}}}},handleContextmenu:function(t){this.copyText&&(this.isShowContextmenu=!this.isShowContextmenu,this.isShowContextmenu&&(this.menuTop=t.offsetY,this.menuLeft=t.offsetX>100?t.offsetX-30:t.offsetX))},handlePaste:function(){this.isShowContextmenu=!1,this.inputMsg+=this.copyText},closeEmojiList:function(){this.emojiShow=!1},fixIOS:function(t){var e=this;setTimeout(function(){e.$refs.chatInput===document.activeElement&&document.activeElement.blur()},0)}}},g={methods:{addPanelSession:function(t,e){var n=this,i=this.sessionList.some(function(t){return t.session_id==e});i||a["a"].user.getOtherInfo({target_id:t}).then(function(t){var i=t.data,s=i.data,o={cover_photo:s.cover_photo,is_group:"0",name:s.nick_name,session_id:e,unread:0};n.$store.commit("addSessionItem",o)})}}},v={data:function(){return{curLang:Object(c["r"])("lang")||Object(c["n"])()}},methods:{changeLang:function(){var t="en"==this.curLang?"zh":"en";this.$i18n.locale=t,this.curLang=t,Object(c["y"])("lang",t)}}}},a713:function(t,e,n){"use strict";var i=n("c96a"),s=n("5dc3");t.exports=function(t,e,n){e in t?i.f(t,e,s(0,n)):t[e]=n}},a7de:function(t,e,n){"use strict";var i=n("b1c0"),s=n.n(i);s.a},b1c0:function(t,e,n){},cf50:function(t,e,n){},d5e1:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"chat-room"},[n("div",{staticClass:"mini-wrap moblie-wrap"},[n("div",{staticClass:"mini-body"},[n("div",{staticClass:"box"},[n("back-bar",{attrs:{title:t.isPrivate?t.group.privateName:t.group.groupName+"("+t.group.membersNum+")",url:!t.isPrivate&&t.group.url?t.group.url:""}},[t.isPrivate||0==t.isJoinGroup?t._e():n("span",{staticClass:"group-set-icon el-icon-more",on:{click:function(e){return t.$router.push("/groupSet/"+t.group.groupId)}}})]),n("chat-pin",t._b({on:{pinMsgClose:t.pinMsgClose,scrollToView:t.scrollToView}},"chat-pin",t.pinMsg,!1)),n("div",{ref:"msgBox",staticClass:"box-bd"},[n("div",{ref:"scrollWrap",staticClass:"scroller",on:{scroll:function(e){return e.preventDefault(),t.handleScroll(e)}}},[n("div",{ref:"msgWrap",staticClass:"msg-wrap"},[t.lockEnd?n("div",{staticClass:"msg-top-more"},[n("em",[t._v(t._s(t.$t("chat.noMore")))])]):t._e(),t.lockMore&&!t.lockEnd?n("div",{staticClass:"msg-top-load"},[n("i",{staticClass:"msg-loading-icon"})]):t._e(),t._l(t.group.chatList,function(e,i){return n("msg-item",t._b({key:i,attrs:{isMobile:!0,isAdmin:t.isAdmin,msgItem:e},on:{quoteMsg:t.quoteMsg,deleteMsg:t.deleteMsg}},"msg-item",e,!1))})],2)]),n("at-me",{staticClass:"mini",attrs:{atList:t.atList},on:{scrollToMsg:t.scrollToMsg}}),n("div",{directives:[{name:"show",rawName:"v-show",value:t.unreadNums>0&&t.enableScroll&&!t.isBottom,expression:"unreadNums > 0 && enableScroll && !isBottom"}],staticClass:"msg-unread",on:{click:t.doSetRead}},[n("em",[n("i",{staticClass:"el-icon-d-arrow-right"}),t._v(t._s(t.unreadNums)+t._s(t.$t("chat.unreadMsg")))])])],1),0==t.isJoinGroup?n("div",{staticClass:"box-ft"},[n("div",{staticClass:"btn-join",on:{click:function(e){return t.joinGroup()}}},[t._v(t._s(t.$t("chat.joinGroup")))])]):n("div",{staticClass:"box-ft"},[t.atShow?n("chat-at",{ref:"chatAt",attrs:{curInd:t.atInd,filterList:t.filterMembers},on:{atperson:t.atPerson}}):t._e(),n("div",{staticClass:"input-con"},[n("div",{staticClass:"more-icon",on:{click:function(e){return e.stopPropagation(),t.handleMoreClick(e)}}}),n("form",{staticClass:"input-wrap",on:{submit:t.handleSend}},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.inputMsg,expression:"inputMsg"}],ref:"chatInput",style:{height:t.inputHeight},attrs:{cols:"1",rows:"1",placeholder:"Write a message"},domProps:{value:t.inputMsg},on:{input:[function(e){e.target.composing||(t.inputMsg=e.target.value)},t.handleInput],keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.handleUp(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.handleDown(e))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])?null:"button"in e&&0!==e.button?null:t.handleLeft(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])?null:"button"in e&&2!==e.button?null:t.handleRight(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:t.handleDel(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.handleEsc(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleKeyDown(e)}],focus:t.handleFocus,blur:t.handleBlur}})]),n("div",{staticClass:"emoji-icon",on:{click:function(e){return e.stopPropagation(),t.handleEmojiClick(e)}}}),n("div",{staticClass:"btn-send",on:{click:t.handleSend}},[t._v(t._s(t.$t("chat.send")))])]),n("toolbar",{ref:"toolbar",attrs:{toolShow:t.toolShow},on:{handleFile:t.handleFile}}),n("emoji",{directives:[{name:"show",rawName:"v-show",value:t.emojiShow,expression:"emojiShow"}],attrs:{emojiShow:t.emojiShow},on:{addEmoji:t.addEmoji,closeEmojiList:t.closeEmojiList}})],1)],1),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isLoadingRoom,expression:"isLoadingRoom"}],staticClass:"pub-loading"})])])])},s=[],o=n("1848"),r=n("2f35"),a=n("4e81"),c=n("a1aa"),u=n("9360"),l=n("34d0"),h=n("5119"),f=n("8869"),d=n("3868"),p={name:"h5ChatRoom",mixins:[f["c"],f["d"],d["a"],d["b"]],components:{msgItem:r["a"],emoji:a["a"],chatAt:c["a"],chatPin:l["a"],atMe:u["a"],backBar:o["a"],toolbar:h["a"]},data:function(){return{emojiShow:!1,toolShow:!1,inputHeight:18}},watch:{inputMsg:function(t,e){var n=this,i=this.$refs.chatInput;this.inputHeight="auto",this.$nextTick(function(){n.inputHeight=Math.max(18,Math.min(i.scrollHeight,75))+"px"})}},methods:{handleEmojiClick:function(){this.toolShow=!1,this.emojiShow=!this.emojiShow,this.checkNeedToBottom()},handleMoreClick:function(){this.emojiShow=!1,this.toolShow=!this.toolShow,this.checkNeedToBottom()},checkNeedToBottom:function(){var t=this;this.isBottom&&this.$nextTick(function(){t.resizeToBottom()})},quoteMsg:function(t){this.inputMsg=t}}},m=p,g=(n("662e"),n("fc05")),v=Object(g["a"])(m,i,s,!1,null,"331b4a86",null);e["default"]=v.exports}}]);