1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a7081a9a"],{2671:function(t,e,n){"use strict";n.d(e,"b",function(){return d}),n.d(e,"a",function(){return h});n("b5aa");var r=n("4457"),i=(n("46b5"),n("bd31")),a=n("52c1"),s=n("5975"),o=n("2593"),c=n("33f8"),u=n("6bec"),d={data:function(){return{accountList:null,userInfo:null,meechatType:Object(c["o"])()}},computed:Object(i["a"])({},Object(a["e"])({members:function(t){return t.group.members},groupId:function(t){return t.group.groupId},sessionList:function(t){return t.chat.sessionList},meId:function(t){return t.userId},meInfo:function(t){return t.userInfo}}),{linkToOther:function(){var t=this.userInfo.user_id,e=Number(t)<Number(this.meId)?"".concat(t,"-").concat(this.meId):"".concat(this.meId,"-").concat(t);return"".concat(location.origin,"/#/pm/").concat(e)}}),methods:Object(i["a"])({},Object(a["b"])(["getUserInfo"]),{sendMsg:function(){this.visible=!1;var t=this.userInfo.user_id,e=Number(t)<Number(this.meId)?"".concat(t,"-").concat(this.meId):"".concat(this.meId,"-").concat(t),n=this.sessionList.some(function(t){return t.session_id==e});if(!n){var r={cover_photo:this.userInfo.cover_photo,is_group:"0",name:this.userInfo.nick_name,session_id:e};this.$store.commit("addSessionItem",r)}var i=this.meInfo.user_id,a={};a[i]={cover_photo:this.meInfo.cover_photo,nick_name:this.meInfo.nick_name},a[this.userInfo.user_id]={cover_photo:this.userInfo.cover_photo,nick_name:this.userInfo.nick_name},this.$store.commit("updateGroup",{key:"members",data:a}),this.$store.commit("updateGroup",{key:"privateName",data:this.userInfo.nick_name}),this.$router.push({path:"/pm/".concat(e)})}}),created:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(this.meInfo){t.next=3;break}return t.next=3,this.getUserInfo();case 3:s["a"].user.getOtherInfo({target_id:this.userId,group_id:this.groupId||null}).then(function(t){var n=t.data;if(e.accountList=n.data.binds,e.userInfo=n.data,e.visible=!0,n.data.user_id){var r=new o["a"],i={cover_photo:n.data.cover_photo,nick_name:n.data.nick_name,user_name:n.data.user_name};r.updateObject(i,{user_id:n.data.user_id})}});case 4:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}()},h={data:function(){return{isLoading:!1}},computed:Object(i["a"])({},Object(a["e"])({scatter:function(t){return t.scatter}})),methods:Object(i["a"])({},Object(a["b"])(["setScatter","doScatterBind","getUserInfo"]),{bindEos:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(e){var n=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return Object(c["z"])("eosType",e),this.isLoading=!0,t.next=4,u["a"].scatter.connect("MEE_CHAT").then(function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:e&&(n.setScatter(u["a"].scatter),window.ScatterJS=null,n.doScatterBind().then(function(){n.isLoading=!1,n.getUserInfo()}).catch(function(t){console.log(t),Object(c["A"])(t),n.isLoading=!1}));case 1:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}());case 4:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),bindTg:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(){var e,n,r,i=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.winHandler=Object(c["x"])(""),t.next=3,s["a"].user.tgCSRF({type:"bind"});case 3:e=t.sent,n=e.data,this.winHandler.location.href=n.data.url,r=setInterval(function(){null!=i.winHandler&&i.winHandler.closed&&(clearInterval(r),i.winHandler=null)},800),this.bindCheck(n.data.csrf_token);case 8:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),bindCheck:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(e,n){var r,i=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(this.isLoading=!0,0!==n){t.next=5;break}clearTimeout(this.timeoutHandler),t.next=7;break;case 5:if(!(n>=60)){t.next=7;break}return t.abrupt("return",!1);case 7:return r={},t.prev=8,t.next=11,s["a"].user.tgBind2({csrf_token:e});case 11:r=t.sent,t.next=17;break;case 14:t.prev=14,t.t0=t["catch"](8),this.isLoading=!1;case 17:r.data&&r.data.data&&r.data.data.status>0?(this.isLoading=!1,null!=this.winHandler&&(this.winHandler.close(),this.winHandler=null),this.getSyncInfo&&this.getSyncInfo(this.params),this.getUserInfo()):r.data?(null!=this.winHandler||r.data&&0==r.data.status)&&(this.timeoutHandler=setTimeout(function(){i.bindCheck(e,++n)},1e3)):null!=this.winHandler&&(this.winHandler.close(),this.winHandler=null);case 18:case"end":return t.stop()}},t,this,[[8,14]])}));function e(e,n){return t.apply(this,arguments)}return e}(),unbindAccount:function(t){var e=this;Object(c["f"])("".concat(this.$t("userinfo.unbindMsg")," ").concat(t.toLocaleUpperCase()," ?")).then(function(){s["a"].user.unBind({type:t}).then(function(){"eos"==t&&e.scatter&&e.scatter.forgetIdentity&&e.scatter.forgetIdentity(),e.$showTips(e.$t("userinfo.unbindSuccess")),e.getUserInfo()})})}})}},"2f56":function(t,e,n){"use strict";var r=n("4008"),i=n.n(r);i.a},4008:function(t,e,n){},"5cf1":function(t,e,n){},e479:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.isLoading,expression:"isLoading"}],staticClass:"c-view"},[n("div",{staticClass:"box"},[n("div",{staticClass:"box-hd"},[n("div",{staticClass:"title-wrap"},[t._v(t._s(t.$t("group.relateTelegram")))])]),t.isLoadingRoom?n("div",{staticClass:"pub-loading"}):n("div",{staticClass:"box-bd pub-scroll-box"},[n("h2",[t._v(t._s(t.$t("group.needRelateTelegram"))+":"),n("span",[t._v(t._s(t.tgGroupTitle))])]),t.isBind?n("ul",{staticClass:"list-group"},[t._l(t.groups,function(e,r){return n("li",{key:r,staticClass:"group-item"},[n("h3",[t._v(t._s(e.group_title))]),n("p",[t._v(t._s("https://mee.chat/s/"+e.group_id))]),n("p",[t._v(t._s(t.$t("group.groupId"))+":"+t._s(e.group_id))]),n("el-button",{staticClass:"btn-relate",attrs:{type:"primary"},on:{click:function(e){return t.doSync(r)}}},[t._v(t._s(t.$t("group.relate")))])],1)}),n("li",{staticClass:"group-item ext-add",on:{click:function(e){return t.createAndSync()}}},[n("h3",[t._v(t._s(t.$t("group.createGroupToRelate")))]),n("i",{staticClass:"el-icon-plus"})])],2):n("div",{staticClass:"no-data"},[n("h3",[t._v(t._s(t.$t("group.needRelateTip")))]),n("i",{staticClass:"icon-tele"}),n("el-button",{staticClass:"btn-relate",attrs:{type:"primary"},on:{click:t.bindTg}},[t._v(t._s(t.$t("group.clickBind")))])],1)])])])},i=[],a=(n("dcfb"),n("c7d9"),n("4694"),n("b5aa"),n("4457")),s=(n("dc12"),n("5cf1"),n("ad09"),n("94c8")),o=n.n(s),c=n("8973"),u=n("5975"),d=n("33f8"),h=n("2671");c["default"].component(o.a.name,o.a);var p={name:"relateGroup",mixins:[h["a"]],components:{},data:function(){return{params:{},isLoadingRoom:!0,isLoading:!1,isBind:!1,tgGroupTitle:"",tgGroupId:0,winHandler:null,groups:[],timeoutHandler:0,meechatType:Object(d["o"])()}},created:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(){var e,n,r;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:e=location.hash.replace("#/relateGroup?",""),n=e.split("&"),r={},n.forEach(function(t){var e=t.split("=");r[e[0]]=e[1]}),this.params=r,this.getSyncInfo(this.params);case 6:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),methods:{getSyncInfo:function(t){var e=this;u["a"].tg.getSyncInfo(t).then(function(t){var n=t.data;e.groups=n.data.groups,e.isBind=!!n.data.userId,e.tgGroupTitle=decodeURI(n.data.tgGroupTitle),e.tgGroupId=n.data.tgGroupId,e.isLoadingRoom=!1}).catch(function(t){e.isLoadingRoom=!1})},doSync:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(e){var n,r=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:this.isLoading=!0,n=this.groups[e].group_id,u["a"].tg.doSync({group_id:n,tg_group_id:this.tgGroupId}).then(function(){r.isLoading=!1,r.$router.replace("/group/".concat(n))}).catch(function(t){r.isLoading=!1,console.log(t)});case 3:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),createAndSync:function(){"h5"==this.meechatType?this.$router.push("/invite/1?tgGroupId=".concat(this.tgGroupId)):this.$showInvite(1,{tgGroupId:this.tgGroupId})}}},l=p,f=(n("2f56"),n("fc05")),g=Object(f["a"])(l,r,i,!1,null,"73409fd2",null);e["default"]=g.exports}}]);
|