local UICommonThirdPopup = UIViewClass() function UICommonThirdPopup:OnOpened(context) --标题 UIUtils.SetLabel(self.UICommonPopUp.txt_Title, context.title) --内容 UIUtils.SetLabel(self.txt_Info,context.content) --消耗的道具数量和图标 UIUtils.SetLabel(self.lab_Consume,context.consume) UIUtils.SetLabel(self.txt_Count,context.count) UTL.Item.MoneyIcon(self.img_Icon, context.itemId) --点击确定执行的方法 self.sureFunc = context.sureFunc end function UICommonThirdPopup:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UICommonThirdPopup:OnButtonClicked(comp) if comp == self.UICommonPopUp.btn_Close then self:CloseView() elseif comp == self.btn_Sure then if self.sureFunc then self.sureFunc() end self:CloseView() end end return UICommonThirdPopup