window.__require=function e(t,o,n){function i(a,r){if(!o[a]){if(!t[a]){var s=a.split("/");if(s=s[s.length-1],!t[s]){var l="function"==typeof __require&&__require;if(!r&&l)return l(s,!0);if(c)return c(s,!0);throw new Error("Cannot find module '"+a+"'")}}var h=o[a]={exports:{}};t[a][0].call(h.exports,function(e){return i(t[a][1][e]||e)},h,h.exports,e,t,o,n)}return o[a].exports}for(var c="function"==typeof __require&&__require,a=0;a<n.length;a++)i(n[a]);return i}({rank:[function(e,t,o){"use strict";cc._RF.push(t,"dc2c1dEKyNBJ79z1JWGLjJR","rank");var n=[],i=!1,c=[];cc.Class({extends:cc.Component,properties:{scrollview:{default:null,type:cc.ScrollView},scrollbg:{default:null,type:cc.Node},layer:{default:null,type:cc.Layout}},loadPic:function(e,t){var o=t.avatarUrl,n=wx.createImage();n.src=o,n.onload=function(){var t=new cc.Texture2D;t.initWithElement(n),t.handleLoadedTexture(),e.spriteFrame=new cc.SpriteFrame(t),console.log("load!!!!!!!!!!")}},initItem:function(e,t,o){e.active=!0,e.getChildByName("rank").getComponent(cc.Label).string=o;var n=e.getChildByName("icon").getComponent(cc.Sprite);this.loadPic(n,t);var i=e.getChildByName("name");i.x=-92,i.getComponent(cc.Label).string=t.nickname,e.getChildByName("score").getComponent(cc.Label).string=t.KVDataList[1].value},loadItems:function(){var e=this.scrollbg.children,t=c,o=t.length,n=0,i=0;console.log("ggggggggggggggggggg"),console.log(t);for(var a=0;a<e.length;a++){var r=e[a],s=-n-40;n+=r.getContentSize().height,r.y=s,a<10&&o>0?(i=n,this.initItem(r,t[0],a+1)):r.active=!1}this.scrollbg.height<i&&(this.scrollbg.height=i)},TouchEvent:function(e,t){e.type==cc.Node.EventType.TOUCH_END&&"sharerank"==t&&(this.layer.node.active=!0,this.layer.node.scale=1)},start:function(){this.onListen(),console.log("rank start>>>>>>>>>>>>>>>>>>>>");var e=this.layer.node.getChildByName("listbg"),t=(cc.winSize,cc.winSize.width/640);e.scale=t,this.loadItems()},update:function(e){i&&(console.log("hhhhhhhhhhhhhhhhhhhhhhhhh"),this.loadItems(),i=!1)},getFriendCloudStorage:function(){console.log("22222222"),cc.sys.platform==cc.sys.WECHAT_GAME&&(console.log("444444444"),wx.getFriendCloudStorage({keyList:["highscore","token"],success:function(e){console.log(e);for(var t=e.data,o=t.length,n=0;n<o;n++)c[n]=t[n];i=!0},fail:function(e){console.log(e)}}))},getGroupCloudStorage:function(e){cc.sys.platform==cc.sys.WECHAT_GAME&&wx.getGroupCloudStorage({shareTicket:e,keyList:["highscore","token"],success:function(e){console.log(e);for(var t=e.data,o=t.length,c=0;c<o;c++)n[c]=t[c];i=!0},fail:function(e){console.log(e)}})},getUserCloudStorage:function(){var e=this;cc.sys.platform==cc.sys.WECHAT_GAME&&wx.getUserCloudStorage({keyList:["highscore","token"],success:function(t){console.log(t);for(var o=t.data,i=0;i<c.length;i++)if(o.token==c[i].value){e.getFriendCloudStorage();break}for(i=0;i<n.length;i++)if(o.token==n[i].value){e.getGroupCloudStorage();break}},fail:function(e){console.log(e)}})},onListen:function(){var e=this;cc.sys.platform==cc.sys.WECHAT_GAME&&wx.onMessage(function(t){console.log(t);var o=t.data;console.log(o);var n=o.flag;if("getFriendsData"==n)e.getFriendCloudStorage();else if("getGroupData"==n){var i=o.ticket;e.getGroupCloudStorage(i)}else"getUserData"==n&&e.getUserCloudStorage()})}}),cc._RF.pop()},{}],test:[function(e,t,o){"use strict";cc._RF.push(t,"6993ac3Kq9CpKiE/5pFBgk8","test");cc.Class({extends:cc.Component,properties:{ranklayout:{default:null,type:cc.Layout},open:!1},TouchEvent:function(e,t){e.type==cc.Node.EventType.TOUCH_END&&("rank"==t?this.onclick():"back"==t&&(this.open=!1,this.ranklayout.node.active=!1))},onclick:function(){this.ranklayout.node.active=!0,this.open=!0,this.tex=new cc.Texture2D;var e=cc.winSize,t=this.ranklayout.node;t.setContentSize(e),t.on(cc.Node.EventType.TOUCH_END,function(e){});var o=wx.getOpenDataContext().canvas;o.width=e.width,o.height=e.height},_updateSubDomainCanvas:function(){if(void 0!=this.tex&&null!=this.tex){var e=wx.getOpenDataContext().canvas;this.tex.initWithElement(e),this.tex.handleLoadedTexture(),this.ranklayout.node.getComponent(cc.Sprite).spriteFrame=new cc.SpriteFrame(this.tex)}},setBackPosition:function(){var e=cc.winSize,t=this.ranklayout.node.getChildByName("backbtn");t.x=-e.width/2+50,t.y=e.height/2-50},start:function(){this.ranklayout.node.active=!1},update:function(e){this.open&&this._updateSubDomainCanvas()}}),cc._RF.pop()},{}]},{},["rank","test"]);