-- 暴风奖励预览主界面 local UIStormRewardMain = UIViewClass() local stormRewardIDS = { [1] = Const_IDS.IDS_DemonGod_UI_15, --排行奖励 [2] = Const_IDS.IDS_Storm_DailyRewardTitle, --达标奖励 } function UIStormRewardMain:OnOpened(context) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Storm_AchievementReward, self.OnRefreshRed) self.subViewIndex = -1 UIUtils.SetLabelText(self.UICommonPopUpTab.txt_Title, Const_IDS["IDS_Storm_RewardTitle"]) self.UICommonPopUpTab.loop_Tab:ReloadAll(stormRewardIDS) self.UICommonPopUpTab.loop_Tab:SelectIndex(0) end function UIStormRewardMain:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUpTab.btn_Close) end function UIStormRewardMain:OnButtonClicked(comp) if comp == self.UICommonPopUpTab.btn_Close then self:CloseView() end end function UIStormRewardMain:OnRefreshRed() self.UICommonPopUpTab.loop_Tab:UpdateIndex(1) end function UIStormRewardMain:OnCellSelect(scrollRect, index, cellTable, data) if self.subViewIndex == index then return end self.subViewIndex = index self.subView:CloseAll() if data == stormRewardIDS[1] then self.subView:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIStormRewardRank)) elseif data == stormRewardIDS[2] then self.subView:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIStormRewardAchievement)) end end function UIStormRewardMain:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.UICommonPopUpTab.loop_Tab then UIUtils.SetLabelText(cellTable.txt_Name_Nomal, data) UIUtils.SetLabelText(cellTable.txt_Name_Selected, data) cellTable.state_ArrowState:SetState(0) end end return UIStormRewardMain