chunk-4be0e358.731c8795.js 9.5 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4be0e358"],{2671:function(t,e,n){"use strict";n.d(e,"b",function(){return p}),n.d(e,"a",function(){return l});n("4453");var r=n("ee95"),a=(n("b06f"),n("3f47")),i=n("52c1"),s=n("5975"),c=n("2593"),o=n("33f8"),u=n("6bec"),d=n("bf49"),h=n("ef30"),p={data:function(){return{accountList:null,userInfo:null,meechatType:Object(o["o"])()}},computed:Object(a["a"])({},Object(i["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(a["a"])({},Object(i["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)}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 c["a"],a={cover_photo:n.data.cover_photo,nick_name:n.data.nick_name,user_name:n.data.user_name};r.updateObject(a,{user_id:n.data.user_id})}});case 4:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}()},l={data:function(){return{isLoading:!1}},computed:Object(a["a"])({},Object(i["e"])({scatter:function(t){return t.scatter}})),methods:Object(a["a"])({},Object(i["d"])(["changeUserBinds"]),Object(i["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(o["A"])("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(r){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:r&&(n.setScatter(u["a"].scatter),window.ScatterJS=null,n.doScatterBind().then(function(t){n.isLoading=!1,n.changeUserBinds({type:e,account:t.account})}).catch(function(t){Object(o["B"])(t),n.isLoading=!1}));case 1:case"end":return t.stop()}},t)}));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,a=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.winHandler=Object(o["y"])(""),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!=a.winHandler&&a.winHandler.closed&&(clearInterval(r),a.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}(),bindEth:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(){var e,n,r;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.isLoading=!0,t.prev=1,t.next=4,d["a"].initEth();case 4:return e=t.sent,n=e.account,r=e.sign,t.next=9,s["a"].user.ethBind({account:n,sign:r});case 9:return t.next=11,this.changeUserBinds({type:"eth",account:n});case 11:t.next=16;break;case 13:t.prev=13,t.t0=t["catch"](1),this.isLoading=!1;case 16:this.isLoading=!1;case 17:case"end":return t.stop()}},t,this,[[1,13]])}));function e(){return t.apply(this,arguments)}return e}(),bindTron:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(){var e,n,r;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.isLoading=!0,t.prev=1,t.next=4,h["a"].initTron();case 4:return e=t.sent,n=e.account,r=e.sign,t.next=9,s["a"].user.tronBind({account:n,sign:r});case 9:return t.next=11,this.changeUserBinds({type:"tron",account:n});case 11:t.next=15;break;case 13:t.prev=13,t.t0=t["catch"](1);case 15:this.isLoading=!1;case 16:case"end":return t.stop()}},t,this,[[1,13]])}));function e(){return t.apply(this,arguments)}return e}(),bindCheck:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(e,n){var r,a=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(){a.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(o["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.changeUserBinds({type:t,account:""})})})}})}},"2f56":function(t,e,n){"use strict";var r=n("39f1"),a=n.n(r);a.a},"39ab":function(t,e,n){},"39f1":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)])])])},a=[],i=(n("612f"),n("ea65"),n("f91a"),n("4453"),n("ee95")),s=(n("3a23"),n("39ab"),n("3050"),n("c843")),c=n.n(s),o=n("6e6d"),u=n("5975"),d=n("33f8"),h=n("2671");o["default"].component(c.a.name,c.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(i["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(i["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("17cc")),g=Object(f["a"])(l,r,a,!1,null,"73409fd2",null);e["default"]=g.exports}}]);