55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
const ItemBase = require("nx.fx.sv.expand.item");
|
|
const ItemLay = require("cmp.common.itemlayout");
|
|
const ADVCT = require("adventure_controller");
|
|
cc.Class({
|
|
extends: ItemBase,
|
|
|
|
properties: {
|
|
confirm:{
|
|
default:null,
|
|
type:cc.Node
|
|
},
|
|
got:{
|
|
default:null,
|
|
type:cc.Node
|
|
},
|
|
items:{
|
|
default:null,
|
|
type:ItemLay
|
|
},
|
|
score:{
|
|
default:null,
|
|
type:cc.Label
|
|
},
|
|
},
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
rebind(_index,_data,_key){
|
|
this._super(_index,_data,_key);
|
|
this.setData(_data);
|
|
},
|
|
|
|
start () {
|
|
|
|
},
|
|
|
|
setData(data){
|
|
if(nx.dt.objEmpty(data))return;
|
|
this.data = data.data;
|
|
|
|
this.confirm.active = this.mdata.status == 1;
|
|
this.got.active = this.mdata.status == 2;
|
|
this.score.string = String(this.data.count);
|
|
this.items.rebuild(this.data.items);
|
|
},
|
|
|
|
onClickAward(){
|
|
if(this.mdata.status == 1){
|
|
ADVCT.getInstance().send29535(this.data.id);
|
|
}
|
|
}
|
|
|
|
// update (dt) {},
|
|
});
|