local UIBaseOptionalPopup = UIViewClass() function UIBaseOptionalPopup:OnOpened(context) self:RegistSystemEvent(EventID.UI_OperationActivity_CloseView, self.OnCloseActivitySelf) self.activityId = context.activityId self:SetInfo() end function UIBaseOptionalPopup:OnButtonClicked(comp) if self.UICommonPopUp.btn_Close == comp or self.btn_Cancel == comp then self:CloseView() end end function UIBaseOptionalPopup:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UIBaseOptionalPopup:OnCloseActivitySelf(viewClassPath, activityId) if viewClassPath == self.__viewClassPath then if self.activityId and activityId == self.activityId then self:CloseView() end end end return UIBaseOptionalPopup