78 lines
1.8 KiB
JavaScript
78 lines
1.8 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(params){
|
|
this.plist = params.plist || [];
|
|
this.actsType = params.acts_type;//用来切换升星有礼和限时招募升星活动
|
|
this.mod = params.mod;
|
|
if(!this.mod){
|
|
this.delayClose();
|
|
return;
|
|
}
|
|
|
|
this.list.svcKey = this.actsType;
|
|
this.list.rebuild(this.plist);
|
|
},
|
|
|
|
onFoucusSelectHero(_item){
|
|
// 空
|
|
if( nx.dt.objEmpty( _item ) ||
|
|
nx.dt.objEmpty( _item.mdata ) ) {
|
|
return;
|
|
}
|
|
|
|
// 聚焦
|
|
this.list.cleanFocus();
|
|
this.list.addFocus( _item.index );
|
|
if(_item.key == 351){//升星有礼
|
|
this.select_id = _item.mdata.partner_id;
|
|
}else if(_item.key == 475){
|
|
this.select_id = _item.mdata.partner_baseid;
|
|
}
|
|
},
|
|
|
|
onClickSure(){
|
|
if(this.select_id){
|
|
if(this.actsType == 351){//升星有礼
|
|
if(this.mod.send29202){
|
|
this.mod.send29202(this.select_id,()=>{
|
|
this.close();
|
|
});
|
|
}
|
|
}else if(this.actsType == 475){
|
|
if(this.mod.send29222){
|
|
this.mod.send29222(this.select_id,()=>{
|
|
this.close();
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// update (dt) {},
|
|
});
|