|
@@ -10,6 +10,7 @@ import { userDataManager } from '../../manager/userDataManager';
|
|
import { user_results } from '../../data';
|
|
import { user_results } from '../../data';
|
|
import { GameManager } from '../../GameManager';
|
|
import { GameManager } from '../../GameManager';
|
|
import { home_modules } from './home_modules';
|
|
import { home_modules } from './home_modules';
|
|
|
|
+import { SdkUtil } from '../../sdkUtil';
|
|
const { ccclass, property } = _decorator;
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('home')
|
|
@ccclass('home')
|
|
@@ -25,20 +26,25 @@ export class home extends Component {
|
|
GameManager.checkPlayGame(this.node,()=>{
|
|
GameManager.checkPlayGame(this.node,()=>{
|
|
tools.playGame(()=>{
|
|
tools.playGame(()=>{
|
|
this.node.parent.active = true
|
|
this.node.parent.active = true
|
|
|
|
+ ClientEvent.dispatchEvent(config.UI_EVENT.HOME_DID_BECOME_ACTIVE)
|
|
})
|
|
})
|
|
this.node.parent.active = false
|
|
this.node.parent.active = false
|
|
|
|
+ ClientEvent.dispatchEvent(config.UI_EVENT.HOME_DID_BECOME_INACTIVE)
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ ClientEvent.on(config.UI_EVENT.HOME_DID_BECOME_ACTIVE,this.homeDidBecomeActive.bind(this),this)
|
|
|
|
+ ClientEvent.on(config.UI_EVENT.HOME_DID_BECOME_INACTIVE,this.homeDidBecomeInactive.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_GAME_FREE_COUNT,this.onUpdateGameFreeCount.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_GAME_FREE_COUNT,this.onUpdateGameFreeCount.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.GAME_OVER_SETTLE_ACCOUNT,this.onGameOverSettleAccount.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.GAME_OVER_SETTLE_ACCOUNT,this.onGameOverSettleAccount.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.GET_NEW_CAR,this.onGetNewCar.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.GET_NEW_CAR,this.onGetNewCar.bind(this),this)
|
|
- ClientEvent.on(config.UI_EVENT.HIDE_HOME_MORE_VIEW,this.onHideHomeMoreView.bind(this),this)
|
|
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_USER_DEFAULT_CAR,this.onUpdateUserDefaultCar.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_USER_DEFAULT_CAR,this.onUpdateUserDefaultCar.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_USER_INFO,this.onUpdateUserInfo.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_USER_INFO,this.onUpdateUserInfo.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_USER_AVATAR_BORDER,this.onUpdateUserAvatarBorder.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_USER_AVATAR_BORDER,this.onUpdateUserAvatarBorder.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_RED_DOT_STATUS,this.onUpdateRedDotStatus.bind(this),this)
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_RED_DOT_STATUS,this.onUpdateRedDotStatus.bind(this),this)
|
|
ClientEvent.on(config.EVENT_TYPE.MSG_DATA,this.onMsgData.bind(this),this)
|
|
ClientEvent.on(config.EVENT_TYPE.MSG_DATA,this.onMsgData.bind(this),this)
|
|
|
|
+
|
|
|
|
+ SdkUtil.showGridGamePanel()
|
|
}
|
|
}
|
|
|
|
|
|
public init(){
|
|
public init(){
|
|
@@ -48,6 +54,17 @@ export class home extends Component {
|
|
this.modules.getComponent(home_modules).init()
|
|
this.modules.getComponent(home_modules).init()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ homeDidBecomeActive() {
|
|
|
|
+ // console.log('home 活跃的 活跃的 活跃的')
|
|
|
|
+ SdkUtil.showGridGamePanel()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ homeDidBecomeInactive() {
|
|
|
|
+ // console.log('home 不活跃的 不活跃的 不活跃的')
|
|
|
|
+ this.modules.getComponent(home_modules).hideGengduoView()
|
|
|
|
+ SdkUtil.hideGridGamePanel()
|
|
|
|
+ }
|
|
|
|
+
|
|
onUpdateGameFreeCount() {
|
|
onUpdateGameFreeCount() {
|
|
this.bottom.getComponent(home_bottom).reloadGameFreeCount()
|
|
this.bottom.getComponent(home_bottom).reloadGameFreeCount()
|
|
}
|
|
}
|
|
@@ -74,10 +91,6 @@ export class home extends Component {
|
|
this.bottom.getComponent(home_bottom).checkIsMineCountryRank()
|
|
this.bottom.getComponent(home_bottom).checkIsMineCountryRank()
|
|
}
|
|
}
|
|
|
|
|
|
- onHideHomeMoreView() {
|
|
|
|
- this.modules.getComponent(home_modules).hideGengduoView()
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
onUpdateUserDefaultCar() {
|
|
onUpdateUserDefaultCar() {
|
|
// 更新首页车
|
|
// 更新首页车
|
|
this.home_car.getComponent(home_car).updateCar()
|
|
this.home_car.getComponent(home_car).updateCar()
|