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"),o=n("2593"),c=n("33f8"),u=n("6bec"),d=n("eef2"),h=n.n(d),p={data:function(){return{accountList:null,userInfo:null,meechatType:Object(c["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 o["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(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(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(c["A"])(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(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!=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(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(window.ethereum&&window.web3){t.next=3;break}return Object(c["A"])("你还没有安装eth插件"),t.abrupt("return");case 3:if(!window.ethereum){t.next=15;break}return window.web3||(window.web3=new h.a(window.ethereum)),t.prev=5,t.next=8,window.ethereum.enable();case 8:this.getEthAccount(),t.next=13;break;case 11:t.prev=11,t.t0=t["catch"](5);case 13:t.next=16;break;case 15:window.web3&&(window.web3||(window.web3=new h.a(window.web3.currentProvider)),this.getEthAccount());case 16:case"end":return t.stop()}},t,this,[[5,11]])}));function e(){return t.apply(this,arguments)}return e}(),getEthAccount:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(){var e,n,a,i,o=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,window.web3.eth.getAccounts();case 2:if(e=t.sent,n=e[0],!n){t.next=10;break}return t.next=7,s["a"].user.getRandom2({account:n});case 7:a=t.sent,i=window.web3.utils.sha3(a.data.data.random),window.web3.eth.sign(i,n,function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(e,r){var a;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return a=r,t.next=3,s["a"].user.ethBind({account:n,sign:a});case 3:o.changeUserBinds({type:"eth",account:n}),console.log(e);case 5:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}());case 10:case"end":return t.stop()}},t)}));function e(){return t.apply(this,arguments)}return e}(),bindTron:function(){var t=Object(r["a"])(regeneratorRuntime.mark(function t(){var e,n,r,a,i;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(window.tronWeb){t.next=3;break}return Object(c["A"])("你还没有安装tron插件"),t.abrupt("return");case 3:return e=window.tronWeb.defaultAddress.base58,t.next=6,s["a"].user.getRandom2({account:e});case 6:return n=t.sent,r=window.tronWeb.sha3(n.data.data.random),t.prev=8,t.next=11,window.tronWeb.trx.signMessage(r);case 11:a=t.sent,t.next=18;break;case 14:return t.prev=14,t.t0=t["catch"](8),Object(c["A"])(t.t0),t.abrupt("return");case 18:return t.next=20,window.tronWeb.trx.verifyMessage(r,a,e);case 20:if(i=t.sent,!i){t.next=27;break}return t.next=24,s["a"].user.tronBind({account:e,sign:a});case 24:this.changeUserBinds({type:"tron",account:e}),t.next=28;break;case 27:this.setLogining(!1);case 28:case"end":return t.stop()}},t,this,[[8,14]])}));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(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.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")),o=n.n(s),c=n("6e6d"),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(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}}]);
|