61 lines
1.4 KiB
JavaScript
61 lines
1.4 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '3c456p4IllD6q2B2oMN/GML', 'cmp.act.totalcharge');
|
|
// Scripts/mod/acts/totalcharge/cmp.act.totalcharge.js
|
|
|
|
"use strict";
|
|
|
|
/******************************************************************
|
|
*
|
|
* 今日纍充
|
|
*
|
|
******************************************************************/
|
|
|
|
var BasePage = require("act.page.base");
|
|
var NxExpand = require("nx.fx.sv.expand");
|
|
var PathTool = require("pathtool");
|
|
cc.Class({
|
|
"extends": BasePage,
|
|
properties: {
|
|
list: {
|
|
"default": null,
|
|
type: NxExpand
|
|
},
|
|
roleSp: {
|
|
"default": null,
|
|
type: cc.Node
|
|
}
|
|
},
|
|
// 初始化
|
|
build: function build(_data) {
|
|
this._super(_data);
|
|
|
|
// 无效
|
|
if (!this.mod) {
|
|
return;
|
|
}
|
|
var respath = cc.js.formatStr("resDB/models/%s/half_show", "H30113");
|
|
nx.gui.setSpriteFrame(this.roleSp, "", respath);
|
|
// 活动监听
|
|
this.mod.vbind(this, [["totalChargeData", this.freshInfos.bind(this)]]);
|
|
},
|
|
onEnable: function onEnable() {
|
|
this.mod.reqTotalChargeData();
|
|
},
|
|
onDisable: function onDisable() {
|
|
this.list.rebuild([]);
|
|
},
|
|
// 销毁
|
|
onDestroy: function onDestroy() {
|
|
// 活动监听解除
|
|
if (this.mod) {
|
|
this.mod.vunbind(this);
|
|
}
|
|
this._super();
|
|
},
|
|
freshInfos: function freshInfos(data) {
|
|
if (nx.dt.objEmpty(data)) return;
|
|
this.list.rebuild(data.aim_list);
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |