local UIPushInterfaceHegemony = UIViewClass() function UIPushInterfaceHegemony:OnOpened(context) self:OnOpenShow(context) end function UIPushInterfaceHegemony:OnBackButtonPressed() self:OnButtonClicked(self.Bottom) end function UIPushInterfaceHegemony:OnButtonClicked(comp) if self.Bottom == comp or self.Panel1.btn_Close == comp or self.Panel2.btn_Close == comp or self.Panel3.btn_Close == comp or self.Panel4.btn_Close == comp or self.Panel5.btn_Close == comp then CTL.PushInterface.HidePushInterface(self.__viewClassPath, self.toggle_Skip) self:CloseView() elseif self.Panel1.btn_Get == comp or self.Panel2.btn_Get == comp or self.Panel3.btn_Get == comp or self.Panel4.btn_Get == comp or self.Panel5.btn_Get == comp then -- 跳转霸业之始 UIManager.OpenView(Const_UI_Lua.UIEnum.OperationActivity.UIHegemonyActivity) end end function UIPushInterfaceHegemony:OnOpenShowCDTimer(context, panel) if context and panel then local hegemonyInfo = MDL.OperationActivity.GetOperationActivityInfo(MDL.OperationActivity.ActivityType.Hegemony, MDL.Hegemony.GetHegemonyActivityId()) local curTime = UTL.Time.GetServerTimestamp() local openTime = hegemonyInfo.startTime + (context.OpenDay - 1) * UTL.Time.TotalSecondsOneDay local leftTime = os.difftime(openTime, curTime) panel.txt_Time:SetDHMSStr(UIUtils.GetLocalizedTxt(Const_IDS.IDS_7DayActivityNew_Hint2), UIUtils.GetLocalizedTxt(Const_IDS.IDS_7DayActivityNew_Hint3), UIUtils.GetLocalizedTxt(Const_IDS.IDS_7DayActivityNew_Hint4), UIUtils.GetLocalizedTxt(Const_IDS.IDS_7DayActivityNew_Hint5)) panel.txt_Time:ResetAndBeginCustomTimer(false, leftTime, 0, nil) end end return UIPushInterfaceHegemony