| 12 |
- webpackJsonp([9],{IchT:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=e("zkTZ"),s=e.n(o);for(var i in o)"default"!==i&&function(t){e.d(n,t,function(){return o[t]})}(i);var a=e("LZlM"),c=e("VU/8")(s.a,a.a,!1,null,null,null);n.default=c.exports},LZlM:function(t,n,e){"use strict";var o={render:function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"full"},[t.isLogined?e("div",{staticClass:"h100",style:t.getContentStyle(),attrs:{id:"app"}},[e("div",{staticClass:"header"},[e("div",{staticClass:"account hand",on:{click:function(n){return t.showUser(t.my)}}},[e("img",{staticClass:"avatar",attrs:{src:t.utils.fmtAvatar(t.my.avatar)}})]),t._v(" "),e("ul",{staticClass:"nav"},[e("li",{class:"chat"==t.currNav?"active":"",attrs:{title:"会话"}},[e("router-link",{attrs:{to:"/chat"}},[e("i",{staticClass:"icon iconfont icon-nav-chat"}),t._v(" "),t.newmsgcount>0?e("sup",{staticClass:"el-badge__content el-badge__content--undefined is-fixed"},[t._v(t._s(t.newmsgcount>99?"99":t.newmsgcount))]):t._e()])],1),t._v(" "),e("li",{class:"contact"==t.currNav?"active":"",attrs:{title:"联系人"}},[e("router-link",{attrs:{to:"/contact"}},[e("i",{staticClass:"icon iconfont icon-nav-contact"})])],1),t._v(" "),e("li",{staticClass:"hand",attrs:{title:"加好友"},on:{click:function(n){return t.add()}}},[e("i",{staticClass:"icon iconfont icon-add"})]),t._v(" "),e("li",{staticClass:"hand",attrs:{title:"设置"},on:{click:function(n){return t.set()}}},[e("i",{staticClass:"icon iconfont icon-more"})])])]),t._v(" "),e("router-view")],1):e("div",[e("div",{staticClass:"h100"})]),t._v(" "),e("dialog-set",{ref:"dialog-set"}),t._v(" "),e("dialog-search",{ref:"dialog-search"}),t._v(" "),e("audio",{ref:"sound-new",attrs:{src:"./static/img/sound.mp3"}})],1)},staticRenderFns:[]};n.a=o},ufhE:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o={data:function(){return{my:IM.my,isLogined:!1,logininfo:{account:"",password:""}}},computed:{totalNewMessage:function(){for(var t=IM.listChat(),n=0,e=0;e<t.length;e++)n+=t[e].newmsgcount;return n}},methods:{initPage:function(){this.checkLogin(),IM.events.addHandler("onCallRequest",this.onCallRequest),IM.events.addHandler("onCallReply",this.onCallReply),IM.events.addHandler("onConnectClose",this.onConnectClose),IM.events.addHandler("onReconnect",this.onReconnect),IM.events.addHandler("onReconnectSuccess",this.onReconnectSuccess),IM.events.addHandler("onMessageNew",this.onMessageNew),IM.events.addHandler("onLogout",this.onLogout),IM.events.addHandler("onKicked",this.onKicked)},checkLogin:function(){this.isLogined=1==IM.isLogin();var t=this.$route.query,n={};if(void 0!=t.account&&void 0!=t.password&&(n={account:t.account,password:t.password,entype:t.entype||0,lflag:t.lflag||2},0==this.isLogined||this.isLogined&&IM.my.login_name!=n.account))this.submitLogin(n);else{var e=IM.getHistoryLogininfo();e?this.submitLogin(e):this.isLogined||this.$router.push({path:"login"})}},submitLogin:function(t){this.$showLoading("正在登录中..."),IM.events.addHandler("onConnectSuccess",this.onConnectSuccess),IM.events.addHandler("onConnectError",this.onConnectError),IM.events.addHandler("onLoginSuccess",this.onLoginSuccess),IM.events.addHandler("onLoginError",this.onLoginError),IM.connection(t)},onConnectSuccess:function(){},onConnectError:function(t){this.$tip("连接错误","error")},onLoginSuccess:function(){this.$hideLoading(),IM.events.removeHandler("onConnectSuccess",this.onConnectSuccess),IM.events.removeHandler("onConnectError",this.onConnectError),IM.events.removeHandler("onLoginSuccess",this.onLoginSuccess),IM.events.removeHandler("onLoginError",this.onLoginError),IM.getOfflineMsg(),this.my=IM.my,this.isLogined=!0},onLoginError:function(t){var n=-1==[205,208].indexOf(t)?"登录错误":"帐号或密码错误";this.$hideLoading(),this.$tip(n,"error"),this.$router.push({path:"login"})},onLogout:function(t){this.$tip("注销成功","cancel"),this.$router.push({path:"login"})},onKicked:function(t){this.$tip("在其它设备登入","cancel"),this.$router.push({path:"login"})},onConnectClose:function(){this.$tip("网络断开","cancel")},onReconnect:function(){this.$tip("重连中...","cancel")},onReconnectSuccess:function(){this.$tip("重连成功","cancel")},onMessageNew:function(t){if("/chat/dialogue"==this.$route.path){this.$route.query.id;for(var n=0;n<t.length;n++){var e=t[n];e.cid==this.cid&&IM.setReadedByMsg(e)}}},initCallEvent:function(){},onCallRequest:function(t){this.$root.$children[0].$refs.caller.dealRequest(t)},onCallReply:function(t){this.$root.$children[0].$refs.caller.dealReply(t)}},created:function(){this.initPage()},mounted:function(){}};n.default=o},zkTZ:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,s=e("ufhE"),i=(o=s)&&o.__esModule?o:{default:o};n.default={mixins:[i.default],components:{"dialog-set":function(t){return e.e(22).then(function(){var n=[e("Gutk")];t.apply(null,n)}.bind(this)).catch(e.oe)},"dialog-search":function(t){return e.e(24).then(function(){var n=[e("dc9m")];t.apply(null,n)}.bind(this)).catch(e.oe)}},data:function(){return{currNav:"",newmsgcount:IM.newmsgcount}},watch:{$route:"fetchData"},computed:{totalNewMessage:function(){for(var t=IM.listChat(),n=0,e=0;e<t.length;e++)n+=t[e].newmsgcount;return n}},methods:{fetchData:function(){var t=this.$route.path.split("/");this.currNav=t[1]},showUser:function(t){this.$root.$children[0].showUser(t)},getContentStyle:function(){IM.getApiServer(),IM.my.name;return""},set:function(){this.$refs["dialog-set"].show()},add:function(){this.$refs["dialog-search"].show()},onMessageNewCount:function(t){this.newmsgcount=IM.newmsgcount,this.$onMsgCountChange(this.newmsgcount)},onMessageNew:function(t){var n=this.utils.isMinWindow();"/chat/dialogue"==this.$route.path&&this.$route.query.id;for(var e=0;e<t.length;e++){var o=t[e];if(this.$refs["sound-new"].play(),n){var s={title:"收到新消息",body:o.subject,icon:this.utils.fmtAvatar(o.refer.avatar,o.ctype)};this.$showNotify(s)}}this.$onNewMsg(t)}},created:function(){this.fetchData(),IM.events.addHandler("onMessageNewCount",this.onMessageNewCount),IM.events.addHandler("onMessageNew",this.onMessageNew)},beforeDestroy:function(){IM.events.removeHandler("onMessageNewCount",this.onMessageNewCount),IM.events.removeHandler("onMessageNew",this.onMessageNew)}}}});
- //# sourceMappingURL=9.8fdd0a7ad4b3c24769f3.js.map
|