cc.Class({
    extends: cc.Component,

    properties: {
        avatar: cc.Sprite,
        scoreLabel: cc.Label,
        nickLabel: cc.Label,
        rankLabel: cc.Label,
    },

    // onLoad () {},

    start() {},

    updateItem(data, i) {
        this.scoreLabel.string = data.score;
        this.nickLabel.string = data.nick;
        this.rankLabel.string = i + 1;

        cc.loader.load({
            url: data.url,
            type: 'jpg'
        }, (err, texture) => {
            if (err === undefined || err === null) {
                this.avatar.spriteFrame = new cc.SpriteFrame(texture);
            } else {
                console.log(err);
            }
        });
    },

    // update (dt) {},
})