| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- local UIActivityDailyRechargeCtr = class("UIActivityDailyRechargeCtr", require("UICtrBase"))
- function UIActivityDailyRechargeCtr:Init(view)
- self.view = view
- self.curShowID = 0
- self.maxID = 0
- self.minID = 0
- end
- function UIActivityDailyRechargeCtr:SetData(data)
- self.asyncIdx = 0
- if data == nil then return end
- self.data = data
- end
- function UIActivityDailyRechargeCtr:GetAsyncIdx()
- self.asyncIdx = self.asyncIdx + 1
- return self.asyncIdx
- end
- function UIActivityDailyRechargeCtr:GetData()
- return self.data
- end
- function UIActivityDailyRechargeCtr:GetActId()
- return self.data.actId
- end
- function UIActivityDailyRechargeCtr:GetNextTiredChargeCfgData()
- local curNum = self:GetDailyTiredChargeCount()
- self.cfgData = ManagerContainer.CfgMgr:GetNextActivitiesTiredChargeCfgByNum(curNum)
- if self.cfgData then
- self.needChargeCount = self.cfgData.RechargeAmount - curNum
- end
- return self.cfgData
- end
- function UIActivityDailyRechargeCtr:GetDailyTiredChargeCount()
- return ManagerContainer.PayMgr:GetDayRecharge()
- end
- function UIActivityDailyRechargeCtr:GetDailyRewardState()
- local actId = self:GetActId()
- local activeItem = ManagerContainer.DataMgr.ActsDataMgr:GetActivityItemById(actId)
- if not activeItem then
- return 0
- end
- --self.curShowID = activeItem:GetRewardState()
- self.minID,self.maxID = ManagerContainer.CfgMgr:GetNextActivitiesTiredChargeCfg_New_MaxAndMInIndexByDay(activeItem:GetCurDay())
- return activeItem:GetRewardState(), activeItem:GetCurDay()
- end
- function UIActivityDailyRechargeCtr:GetDailyRPState()
- local actId = self:GetActId()
- local activeItem = ManagerContainer.DataMgr.ActsDataMgr:GetActivityItemById(actId)
- if not activeItem then
- return false
- end
- return activeItem:HasRedPoint()
- end
- function UIActivityDailyRechargeCtr:GetNeedChargeCount()
- return self.needChargeCount
- end
- function UIActivityDailyRechargeCtr:SendRewardReq(pageId)
- local actId = self:GetActId()
- ManagerContainer.DataMgr.ActsDataMgr:SendGetActivityRewardReq(actId)
- end
- function UIActivityDailyRechargeCtr:IsInActivityDrops(cfgId)
- return ManagerContainer.DataMgr.ActsDataMgr:IsInActivityDrop(cfgId)
- end
- function UIActivityDailyRechargeCtr:OnDispose()
- self.data = nil
- self.view = nil
- end
- function UIActivityDailyRechargeCtr:NextShowID()
- self.curShowID = self.curShowID + 1
- if self.curShowID > self.maxID then
- self.curShowID = self.minID
- end
- --LogError(" NextShowID Max = "..self.maxID.." minID = "..self.minID.." curShowID = "..self.curShowID)
- return self.curShowID
- end
- function UIActivityDailyRechargeCtr:LastShowID()
- self.curShowID = self.curShowID - 1
- if self.curShowID < self.minID then
- self.curShowID = self.maxID
- end
- --LogError("LastShowID Max = "..self.maxID.." minID = "..self.minID.." curShowID = "..self.curShowID)
- return self.curShowID
- end
- return UIActivityDailyRechargeCtr
|