window.__require=function t(e,a,r){function n(s,c){if(!a[s]){if(!e[s]){var o=s.split("/");if(o=o[o.length-1],!e[o]){var l="function"==typeof __require&&__require;if(!c&&l)return l(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+s+"'")}}var f=a[s]={exports:{}};e[s][0].call(f.exports,function(t){return n(e[s][1][t]||t)},f,f.exports,t,e,a,r)}return a[s].exports}for(var i="function"==typeof __require&&__require,s=0;s<r.length;s++)n(r[s]);return n}({item:[function(t,e,a){"use strict";cc._RF.push(e,"9cdb2ehEPlBNp8P6T2+hlEi","item"),cc.Class({extends:cc.Component,properties:{rankSp:cc.Sprite,selfSp:cc.Sprite,indexLb:cc.Label,headSp:cc.Sprite,nameLb:cc.Label,rankLb:cc.Label,cityLb:cc.Label},start:function(){},updateInfo:function(t){this.rankSp.node.active=!t.isSelf,this.selfSp.node.active=t.isSelf,this.nameLb.string=t.nickname,this.indexLb.string=t.index+"";var e=t.rankNum.split(",");e.length>2&&(this.rankLb.string="\u7b2c"+e[0]+"\u7ad9",this.cityLb.string=e[1]);var a=this;t.avatarUrl.length>0?cc.loader.load({url:t.avatarUrl,type:"png"},function(t,e){t&&console.error(t),a.headSp.spriteFrame=new cc.SpriteFrame(e)}):cc.loader.loadRes("default",cc.SpriteFrame,function(t,e){a.headSp.spriteFrame=e})}}),cc._RF.pop()},{}],launch:[function(t,e,a){"use strict";cc._RF.push(e,"e53e6YiUd9FJLf8yIQu1n47","launch"),cc.Class({extends:cc.Component,properties:{content:cc.Node,prefab:cc.Prefab,selfNode:cc.Node,rankView:cc.Node},start:function(){var t=this;this.selfData=null,this.rankArray=[],this.itemArray=[],this.selfItem=null,wx.onMessage(function(e){t.selfNode.active=e.state,t.rankView.active=e.state,e.state&&t.getFriendInfo()}),this.getFriendInfo()},getFriendInfo:function(){var t=this;wx.getFriendCloudStorage({keyList:["site"],success:function(e){console.log("initFriendInfo===111===",e);for(var a=e.data.length-1;a>=0;--a)e.data[a].KVDataList.length||e.data.splice(a,1);e.data.sort(function(t,e){return e.KVDataList[0].value-t.KVDataList[0].value}),t.rankArray=[];for(var r=0;r<e.data.length;++r){var n={};n.index=r+1,n.nickname=e.data[r].nickname,n.rankNum=e.data[r].KVDataList[0].value,n.avatarUrl=e.data[r].avatarUrl,n.isSelf=!1,t.rankArray.push(n)}t.initUserInfo(e.data)},fail:function(t){console.error(t)}})},initUserInfo:function(t){var e=this;wx.getUserInfo({openIdList:["selfOpenId"],lang:"zh_CN",success:function(a){console.log("initUserInfo===111===",a.data[0]);for(var r=0,n=0;n<t.length;++n)t[n].avatarUrl==a.data[0].avatarUrl&&(r=n);var i="";for(n=0;n<e.rankArray.length;++n)e.rankArray[n].avatarUrl==a.data[0].avatarUrl&&(i=e.rankArray[n].rankNum);e.selfData={},e.selfData.index=r+1,e.selfData.nickname=a.data[0].nickName,e.selfData.rankNum=i,e.selfData.avatarUrl=a.data[0].avatarUrl,e.selfData.isSelf=!0,e.updateView()},fail:function(t){console.error(t)}})},updateView:function(){for(var t=0;t<this.rankArray.length;++t)if(t<this.itemArray.length)this.itemArray[t].updateInfo(this.rankArray[t]);else{(a=cc.instantiate(this.prefab)).parent=this.content;var e=a.getComponent("item");this.itemArray.push(e),e.updateInfo(this.rankArray[t])}var a;this.selfItem||((a=cc.instantiate(this.prefab)).parent=this.selfNode,this.selfItem=a.getComponent("item"));this.selfItem.updateInfo(this.selfData),this.content.height=102*this.rankArray.length+20}}),cc._RF.pop()},{}]},{},["item","launch"]);