chunk-1e160aad.1a7361d6.js 7.7 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1e160aad"],{"0725":function(t,e,s){},"3e04":function(t,e,s){"use strict";var i=s("469e"),n=s.n(i);n.a},"469e":function(t,e,s){},"47f6":function(t,e,s){"use strict";var i=s("0725"),n=s.n(i);n.a},"4d7a":function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"hot-group"},[s("div",{staticClass:"top-search"},[t.searchShow?s("input",{directives:[{name:"focus",rawName:"v-focus"}],staticClass:"search-wrap",attrs:{type:"text"},on:{input:function(e){return t.searchUser(e,t.sessionList)},blur:t.handleBlur}}):s("div",{staticClass:"search-tips search-wrap",on:{click:function(e){t.searchShow=!0}}},[s("i",{staticClass:"el-icon-search"}),t._v(t._s(t.$t("public.searchHotGroup"))+"\n ")]),s("span",{on:{click:function(e){return t.$router.go(-1)}}},[t._v(t._s(t.$t("public.cancel")))])]),t.isSearch?t._l(t.searchList,function(t,e){return s("session-item",{key:e,staticClass:"current",attrs:{item:t}})}):t._e(),s("h2",{staticClass:"hot-title"},[t._v(t._s(t.$t("group.recommendGroup")))]),s("div",{staticClass:"hot-list"},t._l(t.showHotList,function(e,i){return s("div",{key:i,staticClass:"hot-item current",on:{contextmenu:function(e){return e.preventDefault(),t.onToolBtn(e)}}},[s("div",{staticClass:"avatar-wrap"},[e.cover_photo?s("img",{staticClass:"user-avatar",attrs:{src:e.cover_photo,alt:""}}):s("div",{staticClass:"user-avatar",class:"avatar_bg"+t.bgColorNum(e.group_id),attrs:{"data-name":e.group_title&&e.group_title.slice(0,2).toUpperCase()}}),1==e.is_auth?s("i",{staticClass:"icon-auth"}):t._e()]),s("div",{staticClass:"info"},[s("h3",[t._v(t._s(e.group_title))]),s("p",[t._v(t._s(e.member_num))])]),s("el-button",{attrs:{type:"primary"},on:{click:function(s){return t.joinGroup(e.group_id,e.is_join)}}},[t._v(t._s(1==e.is_join?t.$t("group.enter"):"+ "+t.$t("group.join")))])],1)}),0)],2)},n=[],a=s("bd31"),o=(s("dc12"),s("5cf1"),s("ad09"),s("94c8")),r=s.n(o),c=s("8973"),u=s("bced"),m=s("52c1"),l=s("8869"),p=s("57d1");c["default"].component(r.a.name,r.a);var h={name:"hotGroup",mixins:[u["a"],l["f"]],components:{sessionItem:p["a"]},data:function(){return{searchShow:!1}},computed:Object(a["a"])({},Object(m["e"])({sessionList:function(t){return t.chat.sessionList}})),methods:{handleBlur:function(t){var e=t.target.value;e||(this.searchShow=!1)}},created:function(){}},_=h,d=(s("47f6"),s("fc05")),f=Object(d["a"])(_,i,n,!1,null,"e91c91b8",null);e["default"]=f.exports},"57d1":function(t,e,s){"use strict";var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"pub-chat-item",class:{current:t.item.session_id==t.curSession,top:1==t.item.is_pin},on:{click:function(e){return t.changeSessionId(t.item)},contextmenu:function(e){return e.preventDefault(),t.onToolBtn(e)}}},[s("div",{staticClass:"avatar-wrap"},[t.item.unread>0&&1==t.item.is_mute?s("i",{staticClass:"mute mute-point"}):t.item.unread>0&&0==t.item.is_mute?s("i",{staticClass:"mute mute-num"},[t._v(t._s(t.item.unread))]):t._e(),t.item.cover_photo?s("img",{staticClass:"user-avatar",attrs:{src:t.item.cover_photo,alt:""}}):s("div",{staticClass:"user-avatar",class:"avatar_bg"+t.bgColorNum(t.item.session_id),attrs:{"data-name":t.item.name&&t.item.name.slice(0,2).toUpperCase()}}),1==t.item.is_auth?s("i",{staticClass:"icon-auth"}):t._e()]),s("div",{staticClass:"info"},[s("h3",[1==t.item.is_group?s("i",{staticClass:"icon-group"}):t._e(),s("span",[t._v(t._s(t.item.name))])]),s("p",[t.item.unread>0&&1==t.item.is_mute?s("span",[t._v("["+t._s(t.item.unread)+t._s(t.$t("public.item"))+"]")]):t._e(),t.item.last_msg?[t.item.is_group?[t._v("\n "+t._s(t.item.last_msg.nick_name)+":"+t._s(0===t.item.last_msg.msg_type?t.item.cont:-1===t.item.last_msg.msg_type?t.$t("chat.revokeMsg"):"["+t.$t("chat.msgType["+(t.item.last_msg.msg_type-1)+"]")+"]")+"\n ")]:[t._v("\n "+t._s(0===t.item.last_msg.msg_type?t.item.cont:-1===t.item.last_msg.msg_type?""+(t.userId==t.item.last_msg.from?t.$t("public.you"):t.item.last_msg.nick_name)+t.$t("chat.revokeMsg"):"["+t.$t("chat.msgType["+(t.item.last_msg.msg_type-1)+"]")+"]")+"\n ")]]:t._e()],2),s("span",{staticClass:"time"},[t._v(t._s(t.handleUpdate(t.item.update_time_int)))]),1==t.item.is_mute?s("i",{staticClass:"icon-mute"}):t._e()]),t.item.session_id?s("ul",{directives:[{name:"show",rawName:"v-show",value:t.showToolbar,expression:"showToolbar"}],staticClass:"pub-pop-toolbar ext-session",style:{left:t.toolBarLeft,top:t.toolBarTop}},[s("li",{on:{click:function(e){return e.stopPropagation(),t.changePin(t.item.session_id,t.item.is_pin)}}},[t._v(t._s(1==t.item.is_pin?""+t.$t("public.cancel")+t.$t("chat.sticky"):t.$t("chat.sticky")))]),s("li",{on:{click:function(e){return e.stopPropagation(),t.changeMute(t.item.session_id,t.item.is_mute)}}},[t._v(t._s(1==t.item.is_mute?t.$t("group.cancelDisturb"):t.$t("group.doNotDisturb")))]),s("li",{on:{click:function(e){return e.stopPropagation(),t.delSession(t.item.session_id)}}},[t._v(t._s(t.$t("chat.deleteSession")))])]):t._e()])},n=[],a=(s("b5aa"),s("4457")),o=s("bd31"),r=s("52c1"),c=s("5975"),u=s("33f8"),m={name:"msgItem",props:{item:{type:Object}},data:function(){return{toolBarLeft:0,toolBarTop:0,showToolbar:!1,meechatType:Object(u["o"])()}},computed:Object(o["a"])({},Object(r["e"])(["curSession","userId"]),{userInfo:function(){return this.$store.state.userInfo}}),methods:{changeSessionId:function(t){var e=1==t.is_group?"/group/".concat(t.session_id):"/pm/".concat(t.session_id);this.$router.push({path:e})},bgColorNum:function(t){return Object(u["l"])(t,this.userId)},hideToolbar:function(t){!1!==this.showToolbar&&(this.showToolbar=!1,document.body.removeEventListener("click",this.hideToolbar,!1),document.body.removeEventListener("contextmenu",this.hideToolbar,!1))},getPagePos:function(t){var e=t,s=0,i=0;while(!/pub-chat-item/gi.test(e.getAttribute("class")))e=e.offsetParent;while(null!=e)s+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{actualX:s,actualY:i}},onToolBtn:function(t){var e=this;if(this.showToolbar)this.hideToolbar(t);else{var s="h5"==this.meechatType?window.innerWidth:276,i=100,n=this.getPagePos(t.target),a=n.actualX,o=t.pageX,r=o-a,c=s-i-20;this.toolBarLeft="".concat(r<c?r:c,"px"),setTimeout(function(){document.body.addEventListener("click",e.hideToolbar,!1),document.body.addEventListener("contextmenu",e.hideToolbar,!1)},0),this.showToolbar=!0}},changePin:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(e,s){var i,n,a,o;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return i=0==s?"setPin":"cancelPin",n=0==s?"updateSessionListByPin":"cancelSessionListByPin",t.next=4,c["a"].session[i]({session_id:e});case 4:a=t.sent,o=a.data.data,this.$store.commit("updatePin",s),this.hideToolbar(),this.$store.commit(n,{session_id:e,is_pin:o.is_pin,pin_time_int:o.pin_time_int});case 9:case"end":return t.stop()}},t,this)}));function e(e,s){return t.apply(this,arguments)}return e}(),changeMute:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(e,s){var i,n;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return i=0==s?"setMute":"cancelMute",n=0==s?"updateSessionListByMute":"cancelSessionListByMute",t.next=4,c["a"].session[i]({session_id:e});case 4:this.hideToolbar(),this.$store.commit("updateMute",s),this.$store.commit(n,e);case 7:case"end":return t.stop()}},t,this)}));function e(e,s){return t.apply(this,arguments)}return e}(),delSession:function(t){var e=this;Object(u["f"])(this.$t("chat.closeSessionMsg")).then(function(){e.$store.commit("removeSessionListById",t),e.hideToolbar(),e.curSession==t&&(e.$store.commit("changeSessionId",0),e.$router.push({path:"/"}))})},handleUpdate:function(t){return Object(u["j"])(t,1,this)}}},l=m,p=(s("3e04"),s("fc05")),h=Object(p["a"])(l,i,n,!1,null,null,null);e["a"]=h.exports}}]);