1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-335f5c5d"],{2671:function(e,t,n){"use strict";n.d(t,"b",function(){return p}),n.d(t,"a",function(){return f});n("4453");var r=n("ee95"),a=(n("b06f"),n("3f47")),s=n("52c1"),i=n("5975"),c=n("2593"),o=n("33f8"),u=n("6bec"),d=n("eef2"),h=n.n(d),p={data:function(){return{accountList:null,userInfo:null,meechatType:Object(o["o"])()}},computed:Object(a["a"])({},Object(s["e"])({members:function(e){return e.group.members},groupId:function(e){return e.group.groupId},sessionList:function(e){return e.chat.sessionList},meId:function(e){return e.userId},meInfo:function(e){return e.userInfo}}),{linkToOther:function(){var e=this.userInfo.user_id,t=Number(e)<Number(this.meId)?"".concat(e,"-").concat(this.meId):"".concat(this.meId,"-").concat(e);return"".concat(location.origin,"/#/pm/").concat(t)}}),methods:Object(a["a"])({},Object(s["b"])(["getUserInfo"]),{sendMsg:function(){this.visible=!1;var e=this.userInfo.user_id,t=Number(e)<Number(this.meId)?"".concat(e,"-").concat(this.meId):"".concat(this.meId,"-").concat(e),n=this.sessionList.some(function(e){return e.session_id==t});if(!n){var r={cover_photo:this.userInfo.cover_photo,is_group:"0",name:this.userInfo.nick_name,session_id:t};this.$store.commit("addSessionItem",r)}this.$router.push({path:"/pm/".concat(t)})}}),created:function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.meInfo){e.next=3;break}return e.next=3,this.getUserInfo();case 3:i["a"].user.getOtherInfo({target_id:this.userId,group_id:this.groupId||null}).then(function(e){var n=e.data;if(t.accountList=n.data.binds,t.userInfo=n.data,t.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 e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},f={data:function(){return{isLoading:!1}},computed:Object(a["a"])({},Object(s["e"])({scatter:function(e){return e.scatter}})),methods:Object(a["a"])({},Object(s["d"])(["changeUserBinds"]),Object(s["b"])(["setScatter","doScatterBind","getUserInfo"]),{bindEos:function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(t){var n=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return Object(o["z"])("eosType",t),this.isLoading=!0,e.next=4,u["a"].scatter.connect("MEE_CHAT").then(function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(r){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:r&&(n.setScatter(u["a"].scatter),window.ScatterJS=null,n.doScatterBind().then(function(e){n.isLoading=!1,n.changeUserBinds({type:t,account:e.account})}).catch(function(e){Object(o["A"])(e),n.isLoading=!1}));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}());case 4:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),bindTg:function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(){var t,n,r,a=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.winHandler=Object(o["x"])(""),e.next=3,i["a"].user.tgCSRF({type:"bind"});case 3:t=e.sent,n=t.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 e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),bindEth:function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(window.ethereum&&window.web3){e.next=3;break}return Object(o["A"])("你还没有安装eth插件"),e.abrupt("return");case 3:if(!window.ethereum){e.next=15;break}return window.web3||(window.web3=new h.a(window.ethereum)),e.prev=5,e.next=8,window.ethereum.enable();case 8:this.getEthAccount(),e.next=13;break;case 11:e.prev=11,e.t0=e["catch"](5);case 13:e.next=16;break;case 15:window.web3&&(window.web3||(window.web3=new h.a(window.web3.currentProvider)),this.getEthAccount());case 16:case"end":return e.stop()}},e,this,[[5,11]])}));function t(){return e.apply(this,arguments)}return t}(),getEthAccount:function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(){var t,n,a,s,c=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,window.web3.eth.getAccounts();case 2:if(t=e.sent,n=t[0],!n){e.next=10;break}return e.next=7,i["a"].user.getRandom2({account:n});case 7:a=e.sent,s=window.web3.utils.sha3(a.data.data.random),window.web3.eth.sign(s,n,function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(t,r){var a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return a=r,e.next=3,i["a"].user.ethBind({account:n,sign:a});case 3:c.changeUserBinds({type:"eth",account:n}),console.log(t);case 5:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}());case 10:case"end":return e.stop()}},e)}));function t(){return e.apply(this,arguments)}return t}(),bindTron:function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(){var t,n,r,a,s;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(window.tronWeb){e.next=3;break}return Object(o["A"])("你还没有安装tron插件"),e.abrupt("return");case 3:return t=window.tronWeb.defaultAddress.base58,e.next=6,i["a"].user.getRandom2({account:t});case 6:return n=e.sent,r=window.tronWeb.sha3(n.data.data.random),e.prev=8,e.next=11,window.tronWeb.trx.signMessage(r);case 11:a=e.sent,e.next=18;break;case 14:return e.prev=14,e.t0=e["catch"](8),Object(o["A"])(e.t0),e.abrupt("return");case 18:return e.next=20,window.tronWeb.trx.verifyMessage(r,a,t);case 20:if(s=e.sent,!s){e.next=27;break}return e.next=24,i["a"].user.tronBind({account:t,sign:a});case 24:this.changeUserBinds({type:"tron",account:t}),e.next=28;break;case 27:this.setLogining(!1);case 28:case"end":return e.stop()}},e,this,[[8,14]])}));function t(){return e.apply(this,arguments)}return t}(),bindCheck:function(){var e=Object(r["a"])(regeneratorRuntime.mark(function e(t,n){var r,a=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.isLoading=!0,0!==n){e.next=5;break}clearTimeout(this.timeoutHandler),e.next=7;break;case 5:if(!(n>=60)){e.next=7;break}return e.abrupt("return",!1);case 7:return r={},e.prev=8,e.next=11,i["a"].user.tgBind2({csrf_token:t});case 11:r=e.sent,e.next=17;break;case 14:e.prev=14,e.t0=e["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(t,++n)},1e3)):null!=this.winHandler&&(this.winHandler.close(),this.winHandler=null);case 18:case"end":return e.stop()}},e,this,[[8,14]])}));function t(t,n){return e.apply(this,arguments)}return t}(),unbindAccount:function(e){var t=this;Object(o["f"])("".concat(this.$t("userinfo.unbindMsg")," ").concat(e.toLocaleUpperCase()," ?")).then(function(){i["a"].user.unBind({type:e}).then(function(){"eos"==e&&t.scatter&&t.scatter.forgetIdentity&&t.scatter.forgetIdentity(),t.$showTips(t.$t("userinfo.unbindSuccess")),t.changeUserBinds({type:e,account:""})})})}})}},"97e9":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"about-me"},[n("back-bar",{attrs:{title:"用户信息"}}),e.userInfo?n("div",{staticClass:"pub-user-top"},[n("div",{staticClass:"avatar-wrap"},[e.userInfo.cover_photo?n("img",{staticClass:"user-avatar",attrs:{src:e.userInfo.cover_photo,alt:""},on:{click:function(t){return t.stopPropagation(),e.$showImgPreview(e.userInfo.cover_photo)}}}):n("div",{staticClass:"user-avatar",class:"avatar_bg"+e.userInfo.user_id%9,attrs:{"data-name":e.userInfo.nick_name.slice(0,2).toUpperCase()}})]),n("div",{staticClass:"top-info"},[n("div",{staticClass:"name"},[e._v(e._s(e.userInfo.nick_name))]),n("div",{staticClass:"code"},[e._v(e._s(e.$t("h5.username"))+":@"+e._s(e.userInfo.user_name))])])]):e._e(),e.userInfo?n("ul",{staticClass:"pub-account-list"},e._l(e.userInfo.binds,function(t,r){return n("li",{key:r,staticClass:"list-item"},[n("div",{staticClass:"icon-wrap"},[n("i",{class:t.type+"-icon"})]),n("div",{staticClass:"info"},[n("div",{staticClass:"title-wrap"},[n("h4",[e._v(e._s(t.type.toUpperCase()))]),n("p",[e._v(e._s(t.account||e.$t("h5.notBind")))])]),t.account?n("div",{staticClass:"opetate"},[n("i",{class:0===t.is_visible?"unopen":"open"}),n("p",[e._v(e._s(0===t.is_visible?e.$t("userinfo.private"):e.$t("userinfo.public")))])]):e._e()])])}),0):e._e(),n("div",{staticClass:"pub-bottom-btn ext-send",on:{click:e.sendMsg}},[e._v(e._s(e.$t("public.sendMessage")))])],1)},a=[],s=n("1848"),i=n("2671"),c={name:"aboutOther",mixins:[i["b"]],components:{backBar:s["a"]},data:function(){return{userId:this.$route.params.id}},computed:{},methods:{}},o=c,u=n("17cc"),d=Object(u["a"])(o,r,a,!1,null,"7a8b5ad0",null);t["default"]=d.exports}}]);
|