local UICommonEquipTips = UIViewClass() local EventSystem = require('Event/EventSystem') function UICommonEquipTips:OnCreated() self.isClosedByParent = false; end function UICommonEquipTips:OnOpened(context) self:RegistSystemEvent(EventID.UI_ItemTips_Closed_Child, self.OnCloseChildItemTips) self.context.rootName = "Common/UICommonEquipTips" self.equipBaseView:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIBaseEquipTips),self.context) UIUtils.SetActive(self.btn_Close, not context.isChildTips); end function UICommonEquipTips:OnCloseChildItemTips(isClosedByParent) if self.context.isChildTips then self.isClosedByParent = isClosedByParent; self:CloseView() end end function UICommonEquipTips:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() end end function UICommonEquipTips:OnClosed() if self.context.isChildTips and not self.isClosedByParent then EventSystem.Dispatch(EventID.UI_ItemTips_Closed) end end return UICommonEquipTips