Files
fc/dev/project/assets/Scripts/mod/acts/totalcharge/cmp.act.totalcharge.js
T

67 lines
1.3 KiB
JavaScript
Raw Normal View History

2026-05-23 22:10:14 +08:00
/******************************************************************
*
* 今日纍充
*
******************************************************************/
const BasePage = require( "act.page.base" );
const NxExpand = require("nx.fx.sv.expand");
const PathTool = require("pathtool");
cc.Class( {
extends: BasePage,
properties: {
list:{
default:null,
type:NxExpand
},
roleSp:{
default:null,
type:cc.Node
},
},
// 初始化
build: function( _data ) {
this._super( _data );
// 无效
if( !this.mod ) {
return;
}
let 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(){
this.mod.reqTotalChargeData();
},
onDisable(){
this.list.rebuild([]);
},
// 销毁
onDestroy: function() {
// 活动监听解除
if( this.mod ) {
this.mod.vunbind( this );
}
this._super();
},
freshInfos(data){
if(nx.dt.objEmpty(data))return;
this.list.rebuild(data.aim_list);
},
} );