perf: 支持跳转到分享页面
This commit is contained in:
@@ -13,6 +13,9 @@ export class PageHome extends BaseView {
|
||||
@property({ type: Node, tooltip: '开始游戏按钮' })
|
||||
startGameBtn: Node | null = null;
|
||||
|
||||
@property({ type: Node, tooltip: 'PK按钮' })
|
||||
pkBtn: Node | null = null;
|
||||
|
||||
/**
|
||||
* 页面首次加载时调用
|
||||
*/
|
||||
@@ -40,6 +43,9 @@ export class PageHome extends BaseView {
|
||||
if (this.startGameBtn) {
|
||||
this.startGameBtn.on(Button.EventType.CLICK, this._onStartGameClick, this);
|
||||
}
|
||||
if (this.pkBtn) {
|
||||
this.pkBtn.on(Button.EventType.CLICK, this._onPkClick, this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,6 +56,14 @@ export class PageHome extends BaseView {
|
||||
ViewManager.instance.open('PageLevel');
|
||||
}
|
||||
|
||||
/**
|
||||
* PK按钮点击回调
|
||||
*/
|
||||
private _onPkClick(): void {
|
||||
console.log('[PageHome] PK按钮点击');
|
||||
ViewManager.instance.open('PageWriteLevels');
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面每次显示时调用
|
||||
*/
|
||||
@@ -73,5 +87,8 @@ export class PageHome extends BaseView {
|
||||
if (this.startGameBtn) {
|
||||
this.startGameBtn.off(Button.EventType.CLICK, this._onStartGameClick, this);
|
||||
}
|
||||
if (this.pkBtn) {
|
||||
this.pkBtn.off(Button.EventType.CLICK, this._onPkClick, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user