local UIPushInterfaceGoldHero = UIViewClass() function UIPushInterfaceGoldHero:OnOpened(context) self:RegistSystemEvent(EventID.UI_OperationActivity_CloseView, self.OnCloseActivitySelf) self:InitPanel() local cfg = CTL.PushInterface.GetCfgByViewClass(self.__viewClassPath) if cfg and cfg.RewardShow then local rewardCfg = DataSheetManager.RewardClientShow:GetDataByClientShowID(cfg.RewardShow) if rewardCfg then local itemTable = DataSheetUtil.GetRewardClientShowItemTable(rewardCfg) for _, v in ipairs (itemTable) do self.scroll_Reward:AddData(v, 0) end end end end function UIPushInterfaceGoldHero:InitPanel() logging.error(LTAG.ERROR, "此方法应被重写,不应该出现此LOG,请程序检查!!!") end function UIPushInterfaceGoldHero:OnCloseActivitySelf(viewClassPath, activityId) if viewClassPath == self.__viewClassPath then local heroType = MDL.GoldenHeroMain.GetHeroTypeByActivityId(activityId) if DataSheetManager.GoldHeroActivityModeData:GetDataByHeroType(heroType).SynergyBossHeroID == self.heroId then --判断是不是当前的金将 self:CloseView() end end end function UIPushInterfaceGoldHero:OnClickGetButton() local goldHeroType = MDL.OperationActivity.ActivityType.GoldenHero local goldHeroTypeData = MDL.OperationActivity.HotControlInfo:GetDataByActivityType_ActivityID(goldHeroType) local goldHeroInfoList = MDL.OperationActivity.GetOperationActivityInfo(goldHeroType) if goldHeroTypeData and goldHeroInfoList then for i, v in pairs(goldHeroTypeData) do if CTL.OperationActivity.IsOperationActivityUnlock(v) then local activityId = v.ActivityID local info = goldHeroInfoList[activityId] local heroType = MDL.GoldenHeroMain.GetHeroTypeByActivityId(activityId) if DataSheetManager.GoldHeroActivityModeData:GetDataByHeroType(heroType).SynergyBossHeroID == self.heroId then --判断是不是当前的金将 local isOpen = CTL.OperationActivity.IsOperationActivityOpen(info) local isStillGoing = CTL.OperationActivity.IsOperationActivityStillGoing(goldHeroType, activityId) if isOpen and isStillGoing then CTL.GoldenHeroMain.OpenMainView(activityId) return end end end end end CTL.Tips.AddTipsMsg(Const_IDS["IDS_RebelStrike_NotAtActivityTime"]) end function UIPushInterfaceGoldHero:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIPushInterfaceGoldHero:OnButtonClicked(comp) if self.Bottom == comp or self.btn_Close == comp then CTL.PushInterface.HidePushInterface(self.__viewClassPath, self.toggle_Skip) self:CloseView() elseif self.btn_Check == comp or self.btn_Check_Loc == comp then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIHeroSelectPanel, {heroID = self.heroId}) elseif self.btn_Get == comp then --跳转金将页面 self:OnClickGetButton() end end function UIPushInterfaceGoldHero:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.scroll_Reward then UTL.Item.SetItemCell(cellTable.item, data.ItemID, data.ItemNum) end end function UIPushInterfaceGoldHero:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.scroll_Reward then if target == cellTable.item.event_Click then UTL.ItemTips.ShowCommonTipsById(data.ItemID) end end end return UIPushInterfaceGoldHero