UISeasonView.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. local UISeasonView = require("UISeason/UISeasonView_Generate")
  2. local IconItemCtr = require("Common/IconItemCtr")
  3. local rankPercent
  4. local CompetitionType = {
  5. Recruit = 1,
  6. Selection = 2,
  7. Astrolabe = 4,
  8. Idol = 5,
  9. }
  10. local periodIdx = 1
  11. local TypeDesc = {
  12. "3","5","7"
  13. }
  14. local boliScaleX = {-1, 1, 1}
  15. local boliPos = Vector3.zero
  16. local boliScale = Vector3.one
  17. local isEnd = false
  18. local selectionIdx = 0
  19. local remainTime, remainText, remainTextContent, overDsc
  20. local curCompetitionCfgData
  21. local competitionType
  22. function UISeasonView:OnAwake(data)
  23. self.controller = require("UISeason/UISeasonCtr"):new()
  24. self.controller:Init(self)
  25. self.controller:SetData(data)
  26. end
  27. function UISeasonView:AddEventListener()
  28. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.SEASON_EXCHANGE_NTF_MAIN, function()
  29. self:Refresh(true)
  30. end)
  31. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.SEASON_MINUTE_UPDATE, self, self.OneSecondUpdate)
  32. end
  33. function UISeasonView:FillContent(data, uiBase)
  34. self.uiBase = uiBase
  35. local gameObject = self.uiBase:GetRoot()
  36. if gameObject ~= nil then
  37. self.gameObject = gameObject
  38. self.transform = gameObject.transform
  39. end
  40. self:InitGenerate(self.transform, data)
  41. self:Init()
  42. end
  43. function UISeasonView:Init()
  44. ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.SEASON_RANK_CHANGED_NTF, 0)
  45. ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.SEASON_NOTICE_CLOSE_NTF, false)
  46. boliPos.y = self.seasonInfo.boliBox.transform.localPosition.y
  47. self:InitGrid()
  48. local uiJumpId = ManagerContainer.DataMgr.CompetitionData:GetUIJumpId()
  49. local stage = self.controller:GetCurStageAndNextTime()
  50. if stage == 2 and uiJumpId > 0 then
  51. local uiJumpState = ManagerContainer.DataMgr.CompetitionData:GetUIJumpState()
  52. if uiJumpState > 0 then
  53. ManagerContainer.LuaUIMgr:Open(uiJumpId,nil,self.uiBase.MSourceUIID)
  54. end
  55. end
  56. end
  57. function UISeasonView:OnPageInEnd()
  58. self:Refresh()
  59. self.super.OnPageInEnd(self)
  60. end
  61. function UISeasonView:InitGrid()
  62. self.seasonPreview.scrollView.loopGridView:InitGridView(0, function(gridView, itemIndex, row, column)
  63. return self:GetItemByRowColumn(gridView, itemIndex, row, column)
  64. end, nil)
  65. end
  66. function UISeasonView:Refresh(refreshReward)
  67. -- 推地图的进度
  68. local competitionId = self.controller:GetCurCompetitionId()
  69. rankPercent = CommonUtil.GetPreciseDecimal(ManagerContainer.DataMgr.CompetitionData:GetRankPercent(),2)
  70. local stage = self.controller:GetCurStageAndNextTime()
  71. self.seasonResult:SetActive(stage == 3)
  72. self.seasonInfo:SetActive(stage == 2)
  73. self.seasonPreview:SetActive(stage == 1)
  74. self:RefreshTop()
  75. self:RefreshBottom(refreshReward)
  76. --local curCompetitionData = ManagerContainer.DataMgr.CompetitionData:GetCurCompetitionData()
  77. --self:RefreshSeasonInfo(competitionId, curCompetitionData, refreshReward)
  78. end
  79. function UISeasonView:RefreshTop()
  80. local stage, nextTime = self.controller:GetCurStageAndNextTime()
  81. local curCompetitionData = ManagerContainer.DataMgr.CompetitionData:GetCurCompetitionData()
  82. local competitionId = self.controller:GetCurCompetitionId()
  83. local seasons = ManagerContainer.CfgMgr:GetCompetitionDatasByType(competitionId)
  84. if not next(seasons) then
  85. return
  86. end
  87. competitionType = seasons[1].CompetitionType
  88. self.btnSecond:SetActive(competitionType == 2 and stage ~= 1)
  89. self.btnTurnWheel:SetActive(competitionType == 3 and stage ~= 1)
  90. self.btnAstrolabe:SetActive(competitionType == 4 and stage ~= 1)
  91. self.btnGotoIdol:SetActive(competitionType == 5 and stage ~= 1)
  92. local cfgData = seasons[1]
  93. if stage == 1 then
  94. self.seasonPreview.titleSeason.text.text = I18N.T(cfgData.CompetitionName)
  95. self.seasonPreview.describe.text.text = I18N.T(cfgData.BannerDsc)
  96. remainTime = ManagerContainer.LuaTimerMgr:GetRemainSecondsWithUInt64(nextTime, false)
  97. remainText = self.seasonPreview.time.text
  98. if remainTime > 60 then
  99. local time = DateTimeUtil.convertSeconds2TimeStr1(remainTime, true, false)
  100. remainText.text = time
  101. else
  102. remainText.text = I18N.T("LessOneMinu")
  103. end
  104. elseif stage == 2 then
  105. self.seasonInfo.titleSeason.text.text = I18N.T(cfgData.CompetitionName)
  106. if competitionId ~= 1 and competitionId == cfgData.CompetitionCondition[1][1] then --偶像祭特殊显示
  107. local rank = ManagerContainer.DataMgr.CompetitionData:GetRank()
  108. if rank > 0 then
  109. self.seasonInfo.describe.text.text = I18N.SetLanguageValue("DscSeasonR"..cfgData.CompetitionType,"",I18N.SetLanguageValue("DscSeasonTips6",rank), "")
  110. else
  111. self.seasonInfo.describe.text.text = I18N.SetLanguageValue("DscSeasonR"..cfgData.CompetitionType,"",I18N.T("NoRank"), "")
  112. end
  113. else
  114. if rankPercent > 0 then
  115. local tips = ""--rankPercent > 60 and I18N.T("DscSeasonTips3") or I18N.T("DscSeasonTips4")
  116. self.seasonInfo.describe.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType, tips, rankPercent, "")
  117. else
  118. self.seasonInfo.describe.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType, I18N.T("DscSeasonTips4"), 60, "")
  119. end
  120. end
  121. local curTime = ManagerContainer.LuaTimerMgr:GetTimeSecond()
  122. local time = 8 * 3600;
  123. local durationTime = ManagerContainer.LuaTimerMgr:GetOneDaySeconds()*7 - time
  124. local startTime = curCompetitionData.curEndTime/1000 - durationTime
  125. local delta = curTime - startTime
  126. delta = type(delta) == "userdata" and #delta or delta
  127. local days = delta/ManagerContainer.LuaTimerMgr:GetOneDaySeconds()
  128. if days <= 2.67 then
  129. durationTime = ManagerContainer.LuaTimerMgr:GetOneDaySeconds()*9 - time
  130. elseif days <= 3.67 then
  131. durationTime = ManagerContainer.LuaTimerMgr:GetOneDaySeconds()*8 - time
  132. elseif days <= 4.67 then
  133. durationTime = ManagerContainer.LuaTimerMgr:GetOneDaySeconds()*7.5 - time
  134. elseif days <= 5.67 then
  135. durationTime = ManagerContainer.LuaTimerMgr:GetOneDaySeconds()*7.2 - time
  136. elseif days <= 6.67 then
  137. durationTime = ManagerContainer.LuaTimerMgr:GetOneDaySeconds()*7 - time
  138. end
  139. local progress = delta/durationTime
  140. self.daysBar.image.fillAmount = progress
  141. elseif stage == 3 then
  142. self.seasonInfo.titleSeason.text.text = I18N.T(cfgData.CompetitionName)
  143. if rankPercent > 0 then
  144. local tips = rankPercent > 60 and I18N.T("DscSeasonTips3") or I18N.T("DscSeasonTips4")
  145. self.seasonInfo.describe.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType, tips, rankPercent, "")
  146. else
  147. self.seasonInfo.describe.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType, I18N.T("DscSeasonTips4"), 60, "")
  148. end
  149. self.seasonInfo.describe.text.text = I18N.T("DscSeasonOver")
  150. end
  151. end
  152. function UISeasonView:RefreshBottom(refreshReward)
  153. local stage, nextTime = self.controller:GetCurStageAndNextTime()
  154. local curCompetitionData = ManagerContainer.DataMgr.CompetitionData:GetCurCompetitionData()
  155. local competitionId = self.controller:GetCurCompetitionId()
  156. local seasons = ManagerContainer.CfgMgr:GetCompetitionDatasByType(competitionId)
  157. if not next(seasons) then
  158. return
  159. end
  160. curCompetitionCfgData = seasons[1]
  161. if stage == 1 then
  162. self.seasonPreview.scrollView.loopGridView:SetListItemCount(3, true)
  163. elseif stage == 2 then
  164. periodIdx = ManagerContainer.DataMgr.CompetitionData:GetCurPeriodIdx()
  165. if not periodIdx then
  166. return
  167. end
  168. self["toggle"..periodIdx].toggle.isOn = true
  169. self:RefreshSeasonRewards(self["toggle"..periodIdx].toggle, periodIdx, true, refreshReward)
  170. elseif stage == 3 then
  171. self:RefreshSeasonOver()
  172. end
  173. end
  174. function UISeasonView:GetItemByRowColumn(gridView, itemIndex, row, column)
  175. local reward = curCompetitionCfgData["CompetitionReward"..(itemIndex + 1)]
  176. local item
  177. if reward then
  178. item = gridView:NewListViewItem('UISeasonRewardItem')
  179. local itemlua = CommonUtil.BindGridViewItem2Lua(self, 'UISeasonRewardItem', item.gameObject)
  180. CommonUtil.CloseUIClearAsyncSeqIds(itemlua)
  181. CommonUtil.LoadIcon(self, curCompetitionCfgData.CompetitionTitleIcon, function (sprite)
  182. itemlua.icon.image.sprite = sprite
  183. end)
  184. if curCompetitionCfgData.LabelIcon then
  185. CommonUtil.LoadIcon(self, curCompetitionCfgData.LabelIcon, function (sprite)
  186. itemlua.flag.image.sprite = sprite
  187. end)
  188. end
  189. itemlua.rewardName.text.text = I18N.SetLanguageValue("SeasonRewardTitle", (itemIndex * 2) + 3)
  190. local tips1 = I18N.T("DscSeasonTips5")
  191. local competitionId = self.controller:GetCurCompetitionId()
  192. if competitionId ~= 1 and competitionId == curCompetitionCfgData.CompetitionCondition[1][1] then --偶像祭特殊显示
  193. itemlua.progress.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType,"", I18N.SetLanguageValue("DscSeasonTips6",curCompetitionCfgData.CompetitionCondition[1][2]), tips1)
  194. else
  195. itemlua.progress.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType, I18N.T("DscSeasonTips3"), curCompetitionCfgData.CompetitionCondition[1][2], tips1)
  196. end
  197. itemlua.cornerMark:SetActive(false)
  198. itemlua.rewarded:SetActive(false)
  199. CommonUtil.LoopGridViewEleCreateNew(self, itemlua.scrollView.loopHorizontalScrollRect, nil, reward, 0, nil, function (itemLua, idx)
  200. local data = {cfgId = reward[idx + 1][1], num = reward[idx + 1][2]}
  201. CommonUtil.UpdateItemPrefab(self, itemLua, data, Enum.ItemIEnterType.Bag, self, self.ShowItemTips)
  202. end)
  203. end
  204. return item
  205. end
  206. function UISeasonView:RefreshSeasonRewards(toggle, data, result, refreshReward)
  207. if not result then return end
  208. if not periodIdx then return end
  209. if not refreshReward and data == selectionIdx then return end
  210. selectionIdx = data
  211. self.seasonInfo.boliBox:SetActive(true)
  212. self.seasonInfo.boliBox.transform:SetParent(self["toggle"..data].on.transform)
  213. self.seasonInfo.boliBox.transform.localPosition = boliPos
  214. boliScale.x = boliScaleX[data]
  215. self.seasonInfo.boliBox.transform.localScale = boliScale
  216. self.seasonInfo.boliBox.overBox.transform.localScale = boliScale
  217. self.seasonInfo.boliBox.timeBox.transform.localScale = boliScale
  218. --self.seasonInfo.boliBox.timeBox.text.uILocalizeScript:SetContentAndValues("CompetitionTip1", {TypeDesc[data]})
  219. self.seasonInfo.scrollView.loopVerticalScrollRect:ClearCells()
  220. local competitionId = self.controller:GetCurCompetitionId()
  221. local periodData = ManagerContainer.DataMgr.CompetitionData:GetCurPeriodData(data)
  222. if periodData then
  223. remainTime = ManagerContainer.LuaTimerMgr:GetRemainSecondsWithUInt64(periodData.rewardEndTme, false)
  224. else
  225. remainTime = 0
  226. end
  227. self.seasonInfo.boliBox.overBox:SetActive(remainTime <= 0)
  228. self.seasonInfo.boliBox.timeBox:SetActive(remainTime > 0)
  229. if remainTime > 0 then
  230. overDsc = I18N.T("DscSeasonOver1")
  231. remainText = self.seasonInfo.boliBox.timeBox.time.text
  232. remainTextContent = "DscSeasonTime"
  233. if remainTime > 60 then
  234. local time = DateTimeUtil.convertSeconds2TimeStr1(remainTime, true, false)
  235. self.seasonInfo.boliBox.timeBox.time.text.text = time --I18N.SetLanguageValue("DscSeasonTime", time)
  236. else
  237. self.seasonInfo.boliBox.timeBox.time.text.text = I18N.T("LessOneMinu")
  238. end
  239. else
  240. self.seasonInfo.boliBox.timeBox.time.text.text = I18N.T("DscSeasonOver1")
  241. end
  242. local seasons = ManagerContainer.CfgMgr:GetCompetitionDatasByType(competitionId)
  243. local movePos = 0
  244. local selfCompetitionId = seasons[1].Id
  245. if periodData then
  246. selfCompetitionId = periodData.paramList[1]
  247. if not selfCompetitionId then
  248. selfCompetitionId = seasons[#seasons].Id
  249. end
  250. if selfCompetitionId == seasons[#seasons].Id then
  251. movePos = 2
  252. end
  253. end
  254. local competitionId = self.controller:GetCurCompetitionId()
  255. CommonUtil.LoopGridViewEleCreateNew(self, self.seasonInfo.scrollView.loopVerticalScrollRect, nil, seasons, 0, nil, function (itemLua, idx)
  256. local data = {cfgData = seasons[idx + 1],competitionId = competitionId ,curId = selfCompetitionId, selectedPeriodIdx = data, curPeriodIdx = periodIdx, hasData = periodData ~= nil }
  257. CommonUtil.UpdateItemPrefab(self, itemLua, data)
  258. end, false, nil, movePos)
  259. end
  260. function UISeasonView:RefreshSeasonOver()
  261. self.btnSecond:SetActive(false)
  262. self.btnTurnWheel:SetActive(false)
  263. self.btnAstrolabe:SetActive(false)
  264. self.btnGotoIdol:SetActive(false)
  265. local curCompetitionData = ManagerContainer.DataMgr.CompetitionData:GetCurCompetitionData()
  266. local competitionId = self.controller:GetCurCompetitionId()
  267. local competitionCfgDatas = ManagerContainer.CfgMgr:GetCompetitionDatasByType(competitionId)
  268. if not competitionCfgDatas then
  269. return
  270. end
  271. self.seasonResult.titleSeason.text.text = I18N.T(competitionCfgDatas[1].CompetitionName)
  272. local nextTime = ManagerContainer.DataMgr.CompetitionData:GetNextSeasonStartTime(competitionId)
  273. remainTime = ManagerContainer.LuaTimerMgr:GetRemainSecondsWithUInt64(nextTime, false)
  274. local time = DateTimeUtil.TransTimeSecondIntToString(remainTime)
  275. remainTextContent = "DscSeasonResult3"
  276. if nextTime > 0 then
  277. self.seasonResult.time.text.text = time
  278. else
  279. self.seasonResult.time.text.text = I18N.T("CompetitionTip8")
  280. end
  281. remainText = self.seasonResult.time.text
  282. local rewardInfoList = curCompetitionData.rewardInfoList[#curCompetitionData.rewardInfoList]
  283. if not rewardInfoList then
  284. self.seasonResult.dsc.text.text = I18N.T("DscSeasonNoData")
  285. return
  286. end
  287. local seasons = ManagerContainer.CfgMgr:GetCompetitionDatasByType(competitionId)
  288. if not next(seasons) then
  289. return
  290. end
  291. local cfgData = seasons[1]
  292. if competitionId ~= 1 and competitionId == cfgData.CompetitionCondition[1][1] then --偶像祭特殊显示
  293. local rank = ManagerContainer.DataMgr.CompetitionData:GetRank()
  294. if rank > 0 then
  295. self.seasonResult.dsc.text.text = I18N.SetLanguageValue("DscSeasonR"..cfgData.CompetitionType,"",I18N.SetLanguageValue("DscSeasonTips6",rank), "")
  296. else
  297. self.seasonResult.dsc.text.text = I18N.SetLanguageValue("DscSeasonR"..cfgData.CompetitionType,"",I18N.T("NoRank"), "")
  298. end
  299. else
  300. if rankPercent > 0 then
  301. local tips = ""--rankPercent > 60 and I18N.T("DscSeasonTips3") or I18N.T("DscSeasonTips4")
  302. self.seasonResult.dsc.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType, tips, rankPercent, "")
  303. else
  304. self.seasonResult.dsc.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType, I18N.T("DscSeasonTips4"), 60, "")
  305. end
  306. end
  307. -- if rankPercent == 0 then
  308. -- self.seasonResult.dsc.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType, I18N.T("DscSeasonTips4"), 60, "")
  309. -- else
  310. -- local tips = rankPercent > 60 and I18N.T("DscSeasonTips3") or I18N.T("DscSeasonTips4")
  311. -- self.seasonResult.dsc.text.text = I18N.SetLanguageValue("DscSeasonR"..competitionType, tips, rankPercent, "")
  312. -- end
  313. end
  314. function UISeasonView:OneSecondUpdate()
  315. if not remainText then
  316. return
  317. end
  318. local stage, nextTime, nextSmallStage = self.controller:GetCurStageAndNextTime()
  319. if nextSmallStage ~= nil then
  320. nextTime = nextSmallStage
  321. end
  322. if stage == 3 then
  323. nextTime = ManagerContainer.DataMgr.CompetitionData:GetNextSeasonStartTime()
  324. end
  325. remainTime = ManagerContainer.LuaTimerMgr:GetRemainSecondsWithUInt64(nextTime, false)
  326. if remainTime <= 0 then
  327. remainText.text = overDsc or I18N.T("DscSeasonOver")
  328. overDsc = nil
  329. else
  330. if isEnd then
  331. local time = DateTimeUtil.TransTimeSecondIntToString(remainTime)
  332. remainText.text = time --I18N.SetLanguageValue(remainTextContent, time)
  333. else
  334. if remainTime > 60 then
  335. local time = DateTimeUtil.convertSeconds2TimeStr1(remainTime, true, false)
  336. remainText.text = time
  337. else
  338. remainText.text = I18N.T("LessOneMinu")
  339. end
  340. end
  341. end
  342. end
  343. function UISeasonView:ShowItemTips(button, params)
  344. local data = params[0]
  345. local data1 = clone(data)
  346. data1.isPreview = true
  347. --ManagerContainer.LuaUIMgr:OpenItemTips(data.cfgId, Enum.ItemIEnterType.Bag, data)
  348. ManagerContainer.LuaUIMgr:OpenTips(data1)
  349. end
  350. function UISeasonView:RemoveEventListener()
  351. ManagerContainer.LuaEventMgr:Unregister(self.uiData.name)
  352. end
  353. function UISeasonView:AddUIEventListener()
  354. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name)
  355. self.uiBase:AddButtonEventListener(self.btnBack.button, self, self.CloseSelf)
  356. self.uiBase:AddButtonEventListener(self.AnyBtn.button,self, self.CloseSelf)
  357. self.uiBase:AddButtonEventListener(self.seasonResult.btnPlayRule.button, self, self.OnClickPlayRuleBtn)
  358. self.uiBase:AddButtonEventListener(self.seasonInfo.btnPlayRule.button, self, self.OnClickPlayRuleBtn)
  359. self.uiBase:AddButtonEventListener(self.seasonPreview.btnPlayRule.button, self, self.OnClickPlayRuleBtn)
  360. self.uiBase:AddToggleEventListener(self.toggle1.toggle, self, self.RefreshSeasonRewards, 1)
  361. self.uiBase:AddToggleEventListener(self.toggle2.toggle, self, self.RefreshSeasonRewards, 2)
  362. self.uiBase:AddToggleEventListener(self.toggle3.toggle, self, self.RefreshSeasonRewards, 3)
  363. self.uiBase:AddButtonEventListener(self.btnSecond.button, self, self.OnSecondSeasonOpen)
  364. self.uiBase:AddButtonEventListener(self.btnAstrolabe.button, self, self.OnStarSignOpen)
  365. self.uiBase:AddButtonEventListener(self.btnGotoIdol.button, self, self.OnIdolViewOpen)
  366. self.uiBase:AddButtonEventListener(self.btnTurnWheel.button, self, self.OnThirdSeasonOpen)
  367. end
  368. function UISeasonView:CloseSelf()
  369. ManagerContainer.LuaUIMgr:OpenSourceUI(self)
  370. end
  371. function UISeasonView:OnClickPlayRuleBtn()
  372. local rule
  373. if competitionType == CompetitionType.Selection then
  374. rule = "SelectionSeasonPlayExplain"
  375. elseif competitionType == CompetitionType.Recruit then
  376. rule = "RecruitSeasonPlayExplain"
  377. elseif competitionType == CompetitionType.Astrolabe then
  378. rule = "DevineSeasonPlayExplain"
  379. elseif competitionType == CompetitionType.Idol then
  380. rule = "AidouluSeasonPlayExplain"
  381. else
  382. rule = "DojoSeasonPlayExplain"
  383. end
  384. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIPlayRule, {'PlayExplainTitle', rule})
  385. end
  386. function UISeasonView:OnSecondSeasonOpen()
  387. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIExchange, self.uiData.id)
  388. end
  389. function UISeasonView:OnStarSignOpen()
  390. local IsOver = ManagerContainer.DataMgr.CompetitionData:IsOveerCurSeason()
  391. if not IsOver then
  392. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIStarSignTips)
  393. else
  394. ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("LabelOver")
  395. end
  396. end
  397. function UISeasonView:OnIdolViewOpen()
  398. local IsOver = ManagerContainer.DataMgr.CompetitionData:IsOveerCurSeason()
  399. if not IsOver then
  400. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UISeasonIdol,nil,self.uiBase.MSourceUIID)
  401. else
  402. ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("LabelOver")
  403. end
  404. end
  405. function UISeasonView:OnThirdSeasonOpen()
  406. local IsOver = ManagerContainer.DataMgr.CompetitionData:IsOveerCurSeason()
  407. if not IsOver then
  408. ManagerContainer.DataMgr.TrunWheelDataMgr:SendOpenREQ()
  409. else
  410. if not ManagerContainer.LuaUIMgr:GetPage(Enum.UIPageName.UIErrorTips) then
  411. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIErrorTips, {errorId="LabelOver"}, nil, nil, nil, Enum.UISibling[Enum.UIType.Top + 1] + 11)
  412. else
  413. ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.ERROR_DESC_DISPLAY, {errorId="LabelOver"})
  414. end
  415. end
  416. end
  417. function UISeasonView:OnHide()
  418. end
  419. function UISeasonView:OnShow(data)
  420. self.controller:SetData(data)
  421. self:Refresh(true)
  422. end
  423. function UISeasonView:OnClose()
  424. self.seasonPreview.scrollView.loopGridView:Dispose()
  425. end
  426. function UISeasonView:OnDispose()
  427. remainTime = 0
  428. remainText = nil
  429. self.seasonInfo.scrollView.loopVerticalScrollRect:ClearCells()
  430. self.seasonInfo.boliBox.transform:SetParent(self.toggleGroup.transform)
  431. self.seasonInfo.boliBox:SetActive(false)
  432. end
  433. return UISeasonView