GameAchievementCell.js
1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//明星列表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);
},
});