local DouYinRechargeReward_Controller = {} local private = {} local EventSystem = require('Event/EventSystem') function DouYinRechargeReward_Controller.OnStartup() EventSystem.Regist(EventID.FunctionUnlockUpdate, private.RefreshInfoByFunction) EventSystem.Regist(EventID.UI_OperationActivity_InfoChanged, private.CheckFuncOpenIssue) private.ActivityType = MDL.OperationActivity.ActivityType.DouYinRechargeReward private.FunctionType = MDL.Unlock.FunctionType.DouYinRechargeReward end --是否显示入口 function DouYinRechargeReward_Controller.IsCanShowEntrance() return CTL.OperationActivity.IsOperationActivityTypeOpen(private.ActivityType) and CTL.OperationActivity.IsOperationActivityTypeUnlock(private.ActivityType) and MDL.Unlock.IsUnlock(private.FunctionType) end --GMS开关变化时刷新 function private.RefreshInfoByFunction(funcId, isUnlock) if funcId == private.FunctionType then if not isUnlock then private.ForceCloseActivityView() end end end -- 关闭活动界面 function private.ForceCloseActivityView() if UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIDouYinRechargeReward) then CTL.Tips.AddTipsMsg(Const_IDS.IDS_Monopoly_EndTips) end UIManager.CloseView(Const_UI_Lua.UIEnum.UIDouYinRechargeReward) end function private.CheckFuncOpenIssue() if not DouYinRechargeReward_Controller.IsCanShowEntrance() then private.ForceCloseActivityView() return end end return DouYinRechargeReward_Controller