bug修复

This commit is contained in:
xiekaidong 2023-09-18 12:00:29 +08:00
parent c9d73ceaf6
commit b9dcd70ffe
3 changed files with 15 additions and 4 deletions

View File

@ -216,7 +216,11 @@ end
function ActPvpManager:rspOverCD(result) function ActPvpManager:rspOverCD(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, {reqCDOver = true}) EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, {reqCDOver = true})
DataManager.ActPvpData:setMatchCdEndAt() local isAd = false
if result.reqData and result.reqData.ad then
isAd = true
end
DataManager.ActPvpData:setMatchCdEndAt(isAd)
self:showMatchUI(true) self:showMatchUI(true)
end end
end end

View File

@ -61,7 +61,7 @@ function ActPvpMatchResultUI:onClickRefresh()
self:closeUI() self:closeUI()
ModuleManager.ActPvpManager:showMatchUI(true) ModuleManager.ActPvpManager:showMatchUI(true)
else else
if DataManager.ActPvpData:getCanAdFlush() then if DataManager.ActPvpData:getCanAdRefreshHero() then
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.ACT_PVP_AD_REMATCH, function() SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.ACT_PVP_AD_REMATCH, function()
ModuleManager.ActPvpManager:reqOverCD(true) ModuleManager.ActPvpManager:reqOverCD(true)
end) end)
@ -81,7 +81,7 @@ function ActPvpMatchResultUI:refreshTime()
adImg:setVisible(false) adImg:setVisible(false)
else else
str = Time:formatNumTime(remainTime) str = Time:formatNumTime(remainTime)
if DataManager.ActPvpData:getCanAdFlush() then if DataManager.ActPvpData:getCanAdRefreshHero() then
adImg:setVisible(true) adImg:setVisible(true)
else else
adImg:setVisible(false) adImg:setVisible(false)

View File

@ -260,14 +260,21 @@ function ActPvpData:getMatchCdEndAt()
return self.matchCdEndAt return self.matchCdEndAt
end end
function ActPvpData:setMatchCdEndAt() function ActPvpData:setMatchCdEndAt(isAd)
self.matchCdEndAt = Time:getServerTime() self.matchCdEndAt = Time:getServerTime()
if isAd then
self.todayAdCount = self.todayAdCount +1
end
end end
function ActPvpData:getMatchCdEndTime() function ActPvpData:getMatchCdEndTime()
return self.matchCdEndAt - Time:getServerTime() return self.matchCdEndAt - Time:getServerTime()
end end
function ActPvpData:getCanAdRefreshHero()
return self.todayAdCount <= 0
end
function ActPvpData:getNeedReMatch() function ActPvpData:getNeedReMatch()
if not self.rivalInfo or not self.rivalInfo.level then if not self.rivalInfo or not self.rivalInfo.level then
return true return true