--选择心愿金色彩金奖励界面(宝物、坐骑、神兽) local UIBaseOptional = UIViewClass() function UIBaseOptional:OnOpened(context) self.activityId = context.activityId self:RegistSystemEvent(EventID.UI_OperationActivity_CloseView, self.OnCloseActivitySelf) self.selectID = 0 self.cellTableList = {} self:Init() self:InitOptionalView() end function UIBaseOptional:OnButtonClicked(comp) if comp == self.btn_Cancel or comp == self.btn_Close then self:CloseView() elseif comp == self.btn_Info then UIManager.OpenView(Const_UI_Lua.UIEnum.UICommonNoteView, { id = self.noteID }) end end function UIBaseOptional:InitOptionalView() self.loop_Hero:ReloadAll(self.cardPoolList) if # self.cardPoolList < 6 then self.loop_Hero:SetMovementType(3) else self.loop_Hero:SetMovementType(1) end end function UIBaseOptional:OnCellInit(scrollRect, index, cellTable, data) self.cellTableList[index + 1] = cellTable if self.isSuperGold then cellTable.state_Golden:SetState(1) else cellTable.state_Golden:SetState(0) end self:RefreshCellInfo(cellTable, data) end function UIBaseOptional:OnCellClicked(scrollRect, index, cellTable, target, data) if target == cellTable.btn_Select then self:CellClicked(data, index) end end function UIBaseOptional:PlaySelectEffect(index) for k, v in ipairs(self.cellTableList) do if k == index + 1 then v.effect_Select:PlayUIEffect() else v.effect_Select:StopUIEffect() end end end function UIBaseOptional:OnCloseActivitySelf(viewClassPath, activityId) if viewClassPath == self.__viewClassPath then if self.activityId and activityId == self.activityId then self:CloseView() end end end return UIBaseOptional