--[[ 宠物放生确认弹窗 ]]-- local UIPetReleasePopUp = UIViewClass() function UIPetReleasePopUp:OnOpened(context) UIUtils.SetLabelText(self.UIPetPopUpSmall.txt_Title, Const_IDS.IDS_PetRelease1) self.petInfo = context.petInfo self.releaseType = context.releaseType self.toggle_AutoInvited.isOn = true UIUtils.SetLabelText(self.txt_AutoInvited, Const_IDS.IDS_PetRelease4) local costTable = MDL.Pet.GetSumReleaseMat(self.petInfo, self.toggle_AutoInvited.isOn) self.loop_Reward:ReloadAll(costTable) end function UIPetReleasePopUp:OnValueChanged(comp, state) local costTable = MDL.Pet.GetSumReleaseMat(self.petInfo, state) self.loop_Reward:ReloadAll(costTable) end function UIPetReleasePopUp:OnBackButtonPressed() self:OnButtonClicked(self.UIPetPopUpSmall.btn_Close) end function UIPetReleasePopUp:OnButtonClicked(comp) if comp == self.btn_1 then MDL.Pet.ReleasePetReq(self.petInfo.petUniqId, self.releaseType, self.toggle_AutoInvited.isOn) self:CloseView() elseif comp == self.btn_2 or comp == self.UIPetPopUpSmall.btn_Close then self:CloseView() end end function UIPetReleasePopUp:OnCellInit(scrollRect, index, cellTable, data) UTL.Item.SetItemCell(cellTable.UIItem, data.itemId, data.itemNum) end function UIPetReleasePopUp:OnCellClicked(scrollRect, index, cellTable, target, data) UTL.ItemTips.ShowCommonTipsById(data.itemId) end return UIPetReleasePopUp