Files
fc/dev/project/assets/Scripts/mod/acts/optionalparty/cmp/cmp.act.optional.select.js
T
2026-05-23 22:10:14 +08:00

66 lines
1.2 KiB
JavaScript

const BridgeWindow = require("bridge.window");
const FxSVC = require( "nx.fx.sv.expand" );
cc.Class({
extends: BridgeWindow,
properties: {
list:{
default:null,
type:FxSVC
}
},
// LIFE-CYCLE CALLBACKS:
onLoad () {
},
start () {
},
// 重载:关闭前
onPreClosed: function() {
this.list.rebuild([]);
},
onOpenConfigs: function( params ){
this.camp = params.camp;
this.plist = params.plist || [];
this.mod = params.mod;
if(!this.mod){
this.delayClose();
return;
}
this.list.rebuild(this.plist);
},
onFoucusSelectHero: function( _item ){
// 空
if( nx.dt.objEmpty( _item ) ||
nx.dt.objEmpty( _item.mdata ) ) {
return;
}
// 聚焦
this.list.cleanFocus();
this.list.addFocus( _item.index );
this.select_id = _item.mdata.partner_id;
},
onClickSure(){
if( this.select_id ){
this.mod.reqSetOptionalParty( this.camp, this.select_id,()=>{
this.close();
});
}
}
// update (dt) {},
});