66 lines
1.2 KiB
JavaScript
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) {},
|
|
});
|