GameAchievementCell.js 1.48 KB
//明星列表ListCell
var Common = require('Common');
var FocusInfo = require('FocusInfo');
var ListCell = require('ListCell');
var Network = require('Network');

cc.Class({
    extends: ListCell,

    properties: {
        id: 0,
        apkName:"",         //包名
        bg: cc.Sprite,      //背景
        starName: cc.Label,     //名称
        pic: cc.Sprite,     //动漫图片
    },

    statics: {
        PFB_NAME: 'prefab/pfbGameAchievementCell',
        CELL_NAME: 'StarListCell',
    },

    init: function (iCellIndex, bIsFocusEnable, compSceneCanvas) {
        //准备焦点坐标
        let fiCategoryBlock = this.node.addComponent(FocusInfo);
        fiCategoryBlock.init(
            null, false, null, null, 1.0
        );
        compSceneCanvas.addNodeToFocusTarget(2, this.node.name, this.node);
    },

    render(oData, iRecordIndex) {
        // this.id = oData.id;
        // this.starName.string = oData.title;
        // this.apkName=oData.packageName;
        // var self = this;
        // cc.loader.loadRes(oData.image[0].fileUrl, cc.Texture2D, function (err, texture) {
        //     self.pic.spriteFrame = new cc.SpriteFrame(texture);
        // });
        // //准备焦点坐标oData.tvlink
        // this.node.getComponent(FocusInfo).setTVLink("");
    },

    enableFocusInfo: function () {
        this.node.getComponent(FocusInfo).setEnable(true);
    },

    disableFocusInfo: function () {
        this.node.getComponent(FocusInfo).setEnable(false);
    },

});