47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
// Learn cc.Class:
|
|
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
|
|
// - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
|
|
// Learn Attribute:
|
|
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
|
|
// - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html
|
|
// Learn life-cycle callbacks:
|
|
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
|
|
// - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
|
|
let viewCell = require("viewCell")
|
|
cc.Class({
|
|
extends: viewCell,
|
|
|
|
properties: {
|
|
nd_1: {
|
|
default: null,
|
|
type: cc.Node,
|
|
},
|
|
nd_2: {
|
|
default: null,
|
|
type: cc.Node,
|
|
},
|
|
},
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {},
|
|
|
|
init: function(index, data, reload, group) {
|
|
if (index >= data.array.length) { //
|
|
this.node.active = false
|
|
return;
|
|
}
|
|
this.target = data.target
|
|
var sdata = data.array[index]
|
|
|
|
|
|
this.nd_1.getComponent("battlechoseone").initdata(sdata[0])
|
|
this.nd_2.getComponent("battlechoseone").initdata(sdata[1])
|
|
|
|
// this.accountid = sdata.base_data.account_id
|
|
// this.showsenderinfo(sdata.base_data)
|
|
// this.showbg()
|
|
},
|
|
|
|
// update (dt) {},
|
|
}); |