1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d42f0a14"],{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"),r=n("7d8e"),o=n("fadb"),a=n("41e9"),c=n("0445"),u=n("a713"),h=n("a8b2");s(s.S+s.F*!n("5557")(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,s,f,l=r(t),d="function"==typeof this?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,v=void 0!==m,g=0,S=h(l);if(v&&(m=i(m,p>2?arguments[2]:void 0,2)),void 0==S||d==Array&&a(S))for(e=c(l.length),n=new d(e);e>g;g++)u(n,g,v?m(l[g],g):l[g]);else for(f=S.call(l),n=new d;!(s=f.next()).done;g++)u(n,g,v?o(f,m,[s.value,g],!0):s.value);return n.length=g,n}})},"63bf":function(t,e,n){t.exports=n("62cb")},7486:function(t,e,n){"use strict";var i=n("e29a"),s=n.n(i);function r(t){if(s()(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}var o=n("41dd"),a=n.n(o),c=n("63bf"),u=n.n(c);function h(t){if(u()(Object(t))||"[object Arguments]"===Object.prototype.toString.call(t))return a()(t)}function f(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function l(t){return r(t)||h(t)||f()}n.d(e,"a",function(){return l})},8869:function(t,e,n){"use strict";n.d(e,"f",function(){return l}),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 v}),n.d(e,"b",function(){return g});var i=n("34f3"),s=(n("8e5d"),n("bd31")),r=(n("0adb"),n("7486")),o=(n("dcfb"),n("b5aa"),n("4457")),a=(n("dc12"),n("5975")),c=n("33f8"),u=n("52c1"),h=n("c1f9"),f=n.n(h),l={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(),r=(t.nick_name||"").toLocaleLowerCase();return e=!!s&&s.indexOf(n)>-1,i=!!r&&r.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(o["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(o["a"])(regeneratorRuntime.mark(function t(){var s,o;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(s=e.target.value.toLocaleLowerCase(),o=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,r=(t.user_name||"").toLocaleLowerCase(),o=(t.nick_name||"").toLocaleLowerCase();e=!!r&&r.indexOf(s)>-1,n=!!o&&o.indexOf(s)>-1,i.$set(t,"isShow",e||n)}),n.length+1>=i.membersNum||1==o||2==o){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=f.a.unionBy([].concat(Object(r["a"])(n),Object(r["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 r in s){var o=s[r].user_name,a=new RegExp("@".concat(o," $"));if(a.test(i))return t.preventDefault(),e.setSelectionRange(n-o.length-2,n-o.length-2),!0}},handleRight:function(t){var e=this.$refs.chatInput,n=e.selectionStart,i=this.getStrAfterSelection(),s=this.group.members;for(var r in s){var o=s[r].user_name,a=new RegExp("^@".concat(o," "));if(a.test(i))return t.preventDefault(),e.setSelectionRange(n+o.length+2,n+o.length+2),!0}return!0},handleDel:function(t){var e=this,n=this.$refs.chatInput,s=n.selectionStart;if(0!==s){var r=this.getStrBeforeSelection(),o=this.group.members,a=function(i){var a=o[i].user_name,c=new RegExp("@".concat(a," $"));if(c.test(r))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 o){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)}}},v={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,r={cover_photo:s.cover_photo,is_group:"0",name:s.nick_name,session_id:e,unread:0};n.$store.commit("addSessionItem",r)})}}},g={data:function(){return{curLang:localStorage.getItem("lang")||Object(c["n"])()}},methods:{changeLang:function(){var t="en"==this.curLang?"zh":"en";this.$i18n.locale=t,this.curLang=t,localStorage.setItem("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}},c918: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:"about-me"},[t.userInfo?n("div",{staticClass:"pub-user-top",on:{click:function(e){return t.$router.push("/editMe")}}},[n("div",{staticClass:"avatar-wrap"},[t.userInfo.cover_photo?n("img",{staticClass:"user-avatar",attrs:{src:t.userInfo.cover_photo,alt:""},on:{click:function(e){return e.stopPropagation(),t.$showImgPreview(t.userInfo.cover_photo)}}}):n("div",{staticClass:"user-avatar",class:"avatar_bg"+t.userInfo.user_id%9,attrs:{"data-name":t.userInfo.nick_name.slice(0,2).toUpperCase()}})]),n("div",{staticClass:"top-info"},[n("div",{staticClass:"name"},[t._v(t._s(t.userInfo.nick_name))]),n("div",{staticClass:"code"},[t._v(t._s(t.$t("h5.username"))+":@"+t._s(t.userInfo.user_name))])]),n("i",{staticClass:"arrow-icon el-icon-arrow-right"})]):t._e(),t.userInfo?n("ul",{staticClass:"pub-account-list"},[t._l(t.userInfo.binds,function(e,i){return n("li",{key:i,staticClass:"list-item"},[n("div",{staticClass:"icon-wrap"},[n("i",{class:e.type+"-icon"})]),n("div",{staticClass:"info"},[n("div",{staticClass:"title"},[t._v(t._s(e.type.toUpperCase()))]),n("div",{staticClass:"code"},[t._v(t._s(e.account||t.$t("h5.notBind")))]),e.account?n("div",{staticClass:"opetate",on:{click:function(n){return t.hanldeChange(e)}}},[n("i",{class:0===e.is_visible?"unopen":"open"}),n("p",[t._v(t._s(0===e.is_visible?t.$t("userinfo.private"):t.$t("userinfo.public")))])]):t._e()])])}),n("li",{staticClass:"list-item ext-psw",on:{click:t.handlePsw}},[t._m(0),n("div",{staticClass:"info"},[n("div",{staticClass:"title"},[t._v(t._s(t.$t("public.pswSetting")))]),n("i",{staticClass:"arrow-icon el-icon-arrow-right"})])])],2):t._e(),n("div",{staticClass:"pub-bottom-btn ext-lang",on:{click:t.changeLang}},[n("i",{staticClass:"icon-change"}),t._v(t._s("en"==t.curLang?t.$t("public.chinese"):t.$t("public.english")))]),n("div",{staticClass:"pub-bottom-btn",on:{click:t.loginOut}},[t._v(t._s(t.$t("h5.logout")))])])},s=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"icon-wrap"},[n("i",{staticClass:"psw-icon"})])}],r=(n("4694"),n("bd31")),o=n("52c1"),a=n("5975"),c=n("8869"),u={name:"chatList",mixins:[c["b"]],data:function(){return{}},computed:Object(r["a"])({},Object(o["e"])({userInfo:function(t){return t.userInfo}})),methods:{loginOut:function(){var t=this;this.$store.dispatch("doScatterLogout").then(function(){t.$router.replace({name:"login",query:{from:"/me"}}),t.$store.commit("setUserInfo",null),t.$store.commit("initChatData"),t.$store.commit("initGroupData"),t.$store.commit("chatAppLogin",!1),t.$store.commit("toApp",!0)})},hanldeChange:function(t){var e=this,n=t.type,i=0==t.is_visible?1:0;a["a"].user.setVisible({type:n,is_visible:i}).then(function(t){t.data;e.$store.dispatch("getUserInfo")})},handlePsw:function(){this.$router.push("/password")}},created:function(){this.$store.dispatch("getUserInfo")}},h=u,f=n("fc05"),l=Object(f["a"])(h,i,s,!1,null,"8c7639aa",null);e["default"]=l.exports}}]);
|