73 lines
2.2 KiB
JavaScript
73 lines
2.2 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'cf8c29ahvVJAocxyLBSVFsH', 'cmp.trainingcamp.item');
|
|
// Scripts/mod/pve/trainingcamp/cmp/cmp.trainingcamp.item.js
|
|
|
|
"use strict";
|
|
|
|
var SVCItem = require("nx.fx.sv.expand.item");
|
|
var TrainingcampController = require("trainingcamp_controller");
|
|
cc.Class({
|
|
"extends": SVCItem,
|
|
properties: {
|
|
nodBg: {
|
|
"default": null,
|
|
type: cc.Node,
|
|
displayName: "背景显示"
|
|
},
|
|
nodBaseInfo: {
|
|
"default": null,
|
|
type: cc.Node,
|
|
displayName: "基本信息"
|
|
},
|
|
nodStatus: {
|
|
"default": null,
|
|
type: cc.Node,
|
|
displayName: "完成状态"
|
|
},
|
|
nodLocked: {
|
|
"default": null,
|
|
type: cc.Node,
|
|
displayName: "锁定显示"
|
|
}
|
|
},
|
|
// 数据重置
|
|
rebind: function rebind(_idx, _data, _key) {
|
|
this._super(_idx, _data, _key);
|
|
|
|
// 刷新
|
|
this.setData(_data);
|
|
},
|
|
// 设置相关的显示数据
|
|
setData: function setData(_data) {
|
|
if (!this.mdata) {
|
|
return;
|
|
}
|
|
nx.gui.setString(this.nodBaseInfo, "id/txt", "0" + this.mdata.id);
|
|
nx.gui.setString(this.nodBaseInfo, "desc", this.mdata.name);
|
|
var icon = this.mdata.reward[0][0];
|
|
nx.bridge.setIconS(this, "rewards/icon", icon);
|
|
nx.gui.setString(this, "rewards/count", this.mdata.reward[0][1]);
|
|
nx.gui.setActive(this.nodLocked, "", this.mdata.open == 0);
|
|
nx.gui.setActive(this.nodStatus, "get", this.mdata.finish && !this.mdata.complete);
|
|
nx.gui.setActive(this.nodStatus, "goto", !this.mdata.finish);
|
|
nx.gui.setActive(this.nodStatus, "finish", this.mdata.complete);
|
|
var nod = nx.gui.find(this.nodStatus, "goto/plot");
|
|
if (nod && nx.bridge.plot && nx.bridge.plot.isDoing()) {
|
|
nx.gui.setActive(nod, "", this.mdata.id == 1);
|
|
}
|
|
},
|
|
EnterTrain: function EnterTrain() {
|
|
var id = this.mdata ? this.mdata.id : 1;
|
|
TrainingcampController.getInstance().send27602(id);
|
|
// console.log ( "当前的传入数据" + JSON.stringify( this.mdata ) );
|
|
// // open panel
|
|
// nx.bridge.createPanel( "WndTrainingCampMore", this.mdata );
|
|
// nx.bridge.closePanel( "WndTrainingCamp" );
|
|
},
|
|
|
|
onTouchGet: function onTouchGet() {
|
|
TrainingcampController.getInstance().send27604(this.mdata.id);
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |