local UICommonRelationActivePopUp = UIViewClass() function UICommonRelationActivePopUp:OnOpened(context) UIUtils.SetLabel(self.txt_Info, context.InfoStr) UIUtils.SetLabel(self.UITemplatePopUpZero.txt_Title, context.TitleStr) UTL.Item.SetItemCell(self.Hero, context.itemId1) UTL.Item.SetItemCell(self.Horse, context.itemId2) UIUtils.SetActive(self.Horse.group_Shard, false) UIUtils.SetActive(self.Horse.group_Count, false) self:SetAttr(context.attrTable) end function UICommonRelationActivePopUp:OnButtonClicked(comp) if comp == self.UITemplatePopUpZero.Bottom then self:CloseView() end end function UICommonRelationActivePopUp:SetAttr(attrTable) for i = 1, #self.group_AttrInfo do UIUtils.SetActive(self.group_AttrInfo[i].gameObject, false) end for i = 1, #attrTable do local cell = self.group_AttrInfo[i] local attr = attrTable[i] if attr then UTL.Attr.SetAttrItemByCompName(cell, attr.AttrType, attr.AttrNum, true, true) UIUtils.SetActive(cell.gameObject, true) end end end return UICommonRelationActivePopUp