78 lines
1.8 KiB
JavaScript
78 lines
1.8 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '4040a4YCB1NBZhpgSP2s8Mp', 'cmp.act.seven.item');
|
||
|
|
// Scripts/mod/acts/sevengoal/cmp/cmp.act.seven.item.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
var ItemBase = require("nx.fx.sv.expand.item");
|
||
|
|
var CmpActSeven = require("cmp.act.seven");
|
||
|
|
var ItemLay = require("cmp.common.itemlayout");
|
||
|
|
cc.Class({
|
||
|
|
"extends": ItemBase,
|
||
|
|
properties: {
|
||
|
|
cmpAct: {
|
||
|
|
"default": null,
|
||
|
|
type: CmpActSeven
|
||
|
|
},
|
||
|
|
desc: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
},
|
||
|
|
lay: {
|
||
|
|
"default": null,
|
||
|
|
type: ItemLay
|
||
|
|
},
|
||
|
|
pro: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.ProgressBar
|
||
|
|
},
|
||
|
|
tagTxt: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
},
|
||
|
|
gotBtn: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
},
|
||
|
|
getBtn: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
},
|
||
|
|
gotoBtn: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
}
|
||
|
|
},
|
||
|
|
rebind: function rebind(_index, _data, _key) {
|
||
|
|
this._super(_index, _data, _key);
|
||
|
|
this.setData(_data);
|
||
|
|
},
|
||
|
|
setData: function setData(data) {
|
||
|
|
if (nx.dt.objEmpty(data)) {
|
||
|
|
this.lay.rebuild([]);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if (data.cfgs) {
|
||
|
|
nx.gui.setString(this.desc, "", data.cfgs.desc);
|
||
|
|
this.lay.rebuild(data.cfgs.award);
|
||
|
|
}
|
||
|
|
this.pro.progress = data.value / data.target_val;
|
||
|
|
nx.gui.setString(this.tagTxt, "", cc.js.formatStr("%s/%s", data.value, data.target_val));
|
||
|
|
nx.gui.setActive(this.gotoBtn, "", data.finish == 0);
|
||
|
|
nx.gui.setActive(this.getBtn, "", data.finish == 1);
|
||
|
|
nx.gui.setActive(this.gotBtn, "", data.finish == 2);
|
||
|
|
},
|
||
|
|
onClickComitTask: function onClickComitTask() {
|
||
|
|
if (this.mdata) {
|
||
|
|
this.cmpAct.mod.send13606(this.mdata.id);
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onClickJump: function onClickJump() {
|
||
|
|
if (this.mdata.cfgs) {
|
||
|
|
nx.bridge.jumper.jump2Window(this.mdata.cfgs.source_id);
|
||
|
|
nx.bridge.closePanel("WndActsSevenGoals");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
cc._RF.pop();
|