// --------------------------------------------------------------------
// @author: shiraho@syg.com(必填, 创建模块的人员)
// @description:
// 好友主界面
//
Create: new Date().toISOString()
// --------------------------------------------------------------------
var StrongerController = require("stronger_controller")
var PathTool = require("pathtool");
var StrongerEvent = require("stronger_event")
const FxTogs = require( "nx.fx.togs" );
const BridgeWindow = require("bridge.window")
const BaseLayout = require( "cmp.common.itemlayout" );
cc.Class({
extends: BridgeWindow,
properties: {
togs:{
default:null,
type:FxTogs
},
communal_nd:{
default:null,
type:cc.Node
},
StrongerPanel:{
default:null,
type:cc.Node
},
ziyuan_sv:{
default:null,
type:BaseLayout
},
zhenrong_sv:{
default:null,
type:BaseLayout
},
wenti_sv:{
default:null,
type:BaseLayout
},
},
// LIFE-CYCLE CALLBACKS:
onLoad () {
this.ctrl = StrongerController.getInstance();
this.model = this.ctrl.getModel();
this.togs.posTog = this.onTogMenu.bind( this );
this.togs.togTo(0);
},
//当前根节点销毁前进行的预处理操作
onPreClosed(){
this.StrongerPanel.getComponent("cmp.stronger.panel").desPartners();
this.ziyuan_sv.rebuild([]);
this.wenti_sv.rebuild([]);
},
start () {
},
createSubPanel: function (index) {
switch(index){
case 0:
this.StrongerPanel.active = true;
gcore.GlobalEvent.fire(StrongerEvent.PATCH_DATA_BY_TYPE,this.partner_id);
break
case 1:
// this.view_list[index] = this.ziyuan_sv.content
this.resourcePanel()
break
case 3:
// this.view_list[index] = this.zhenrong_sv.content
// this.recommandPanel()
break
case 2:
this.problemPanel()
break
}
if(index == 0){
this.communal_nd.active = false;
}else{
this.communal_nd.active = true;
this.StrongerPanel.active = false;
for(let i=0;i