private applk(listNode: Laya.List, listData) {
var data: any[] = [];
listData.sort(function () {
return 0.5 - Math.random();
});
listData.map((item, index) => {
var hotShow: boolean = false;
var newShow: boolean = false;
if (index >= 3 && index < 8) {
hotShow = true;
}
if (index >= 11 && index < 16) {
newShow = true;
}
data.push({
gameName: {
text: item.name
},
gameIcon: {
skin: item.pic
},
hot: {
visible: hotShow
},
new: {
visible: newShow
},
name: JSON.stringify(item)
});
})
// console.log("表的数据:", JSON.stringify(data));
listNode.array = data;
}