local UIBagItemUsePanel = require "View/Bag/UIBagItemUsePanel" local UIAnniversaryPrepareItemUse = UIViewClass(UIBagItemUsePanel) function UIAnniversaryPrepareItemUse:OnOpened(context) self.activityId = context.activityId self.parentViewPlayEffectFunc = context.PlayFireEffect if context.desc then self.txt_Desc.text = context.desc UIUtils.SetActive(self.txt_Desc, true) end self.UICommonPopView.btn_1:SetText(Const_IDS.IDS_AnniversaryPrepare_Button_1) self.Count = UTL.Item.GetItemStockCount(self.useData.CfgId) UTL.Item.SetItemCell(self.Item, self.useData.CfgId, self.Count) self._currentUseCount = self.Count self:RefreshUseCount() UIUtils.SetLabelText(self.UICommonPopView.refer_Bg.txt_Title, Const_IDS.IDS_AnniversaryPrepare_Button_2) UIUtils.SetActive(self.UICommonPopView.refer_Bg.img_Info, false) end function UIAnniversaryPrepareItemUse:OnClosed() UIUtils.SetActive(self.txt_Desc, false) end function UIAnniversaryPrepareItemUse:OnClickUse() self:CloseView() self._currentUseCount = tonumber(self.txt_Num.text) MDL.AnniversaryPrepare.FireReq(self.activityId, self.useData.CfgId, self._currentUseCount) if self.parentViewPlayEffectFunc then self:parentViewPlayEffectFunc() end end function UIAnniversaryPrepareItemUse:OnClickCancel() self:CloseView() end function UIAnniversaryPrepareItemUse:OnBackButtonPressed() self:OnClickCancel() end return UIAnniversaryPrepareItemUse