Files
fc/dev/project/assets/Scripts/mod/payment/cmp/cmp.vip.wnd.js
T
2026-05-23 22:10:14 +08:00

86 lines
1.6 KiB
JavaScript

/******************************************************************
*
* VIP界面
*
******************************************************************/
const FxTogs = require( "nx.fx.togs" );
const BridgeWindow = require( "bridge.window" );
const PageType = cc.Enum( {
Charge : 0, // 充值
Vip : 1, // VIP
DailyGift : 2, // 日常礼包
Privilege : 3, // 特权商店
} );
cc.Class( {
extends: BridgeWindow,
properties: {
togMenu: {
default: null,
type: FxTogs,
},
rootBanners: {
default : null,
type : cc.Node,
},
rootPages: {
default : null,
type : cc.Node,
},
},
onLoad: function() {
// Tog监听
this.togMenu.posTog = this.onTogMenu.bind( this );
this.togMenu.togTo(0);
this.activeMenu( 0 );
},
onDestroy: function() {
},
// 重载:关闭前
onPreClosed: function() {
},
onOpenConfigs: function(params){
this.index = params.index;
this.sub_type = params.sub_type;
},
// 激活菜单
activeMenu: function( _pt ) {
if( this.curPT == _pt ) {
return;
}
this.curPT = _pt;
// 条幅切换
nx.gui.setActive( this.rootBanners, "vip", _pt == PageType.Vip || _pt == PageType.Charge );
// 页面切换
nx.gui.setActive( this.rootPages, "charge", _pt == PageType.Charge );
},
// 背包切换
onTogMenu: function( _index ) {
this.activeMenu( parseInt(_index) );
},
} );