diff --git a/lua/app/module/activity/fourteen_day/fourteen_day_manager.lua b/lua/app/module/activity/fourteen_day/fourteen_day_manager.lua index 7cc7d982..452321ab 100644 --- a/lua/app/module/activity/fourteen_day/fourteen_day_manager.lua +++ b/lua/app/module/activity/fourteen_day/fourteen_day_manager.lua @@ -22,6 +22,7 @@ end function FourteenDayManager:rspTaskReward(result) if result.err_code == GConst.ERROR_STR.SUCCESS then DataManager.FourteenDayData:onReceivedTaskReward(result.reqData.id) + GFunc.showRewardBox(result.rewards) end end @@ -41,13 +42,15 @@ function FourteenDayManager:rspBountyReward(result) end -- 请求兑换奖励 -function FourteenDayManager:reqExchangeReward(id) - self:sendMessage(ProtoMsgType.FromMsgEnum.FourteenBountyExchangeAwardReq, {id = id}, {}, self.rspExchangeReward, BIReport.ITEM_GET_TYPE.ACT_FOURTEEN_DAY_EXCHANGE) +function FourteenDayManager:reqExchangeReward(id, count) + self:sendMessage(ProtoMsgType.FromMsgEnum.FourteenBountyExchangeAwardReq, {id = id, count = count or 0}, {}, self.rspExchangeReward, BIReport.ITEM_GET_TYPE.ACT_FOURTEEN_DAY_EXCHANGE) end function FourteenDayManager:rspExchangeReward(result) if result.err_code == GConst.ERROR_STR.SUCCESS then - DataManager.FourteenDayData:onReceivedExchangeReward(result.reqData.id) + if result.reqData.count then + DataManager.FourteenDayData:onReceivedExchangeReward(result.reqData.id, result.reqData.count) + end GFunc.showRewardBox(result.rewards) end diff --git a/lua/app/ui/activity/fourteen_day/cell/fourteen_day_exchange_cell.lua b/lua/app/ui/activity/fourteen_day/cell/fourteen_day_exchange_cell.lua index 00fc915b..0b6ef174 100644 --- a/lua/app/ui/activity/fourteen_day/cell/fourteen_day_exchange_cell.lua +++ b/lua/app/ui/activity/fourteen_day/cell/fourteen_day_exchange_cell.lua @@ -12,7 +12,12 @@ function FourteenDayExchangeCell:init() self:addClickListener(function() if DataManager.FourteenDayData:canExchange(self.id) then - ModuleManager.FourteenDayManager:reqExchangeReward(self.id) + local cost = DataManager.FourteenDayData:getExchangeCost(self.id) + local remainCount = DataManager.FourteenDayData:getExchangeRemainTime(self.id) + local reward = DataManager.FourteenDayData:getExchangeReward(self.id) + ModuleManager.CommonManager:showExchangeUI(1, remainCount, reward, cost, function(count) + ModuleManager.FourteenDayManager:reqExchangeReward(self.id, count) + end) end end) end diff --git a/lua/app/ui/activity/fourteen_day/cell/fourteen_day_task_cell.lua b/lua/app/ui/activity/fourteen_day/cell/fourteen_day_task_cell.lua index b48bb5d5..171c9bf6 100644 --- a/lua/app/ui/activity/fourteen_day/cell/fourteen_day_task_cell.lua +++ b/lua/app/ui/activity/fourteen_day/cell/fourteen_day_task_cell.lua @@ -34,6 +34,9 @@ function FourteenDayTaskCell:refresh(id) local minScore = DataManager.ArenaData:getSeasonGradingMinScore() total = total - minScore cur = cur - minScore + if cur < 0 then + cur = 0 + end end self.imgTask:setSprite(GConst.ATLAS_PATH.ICON_TASK, tostring(DataManager.FourteenDayData:getTaskIcon(self.taskId))) self.txDesc:setText(DataManager.FourteenDayData:getTaskDesc(self.taskId)) diff --git a/lua/app/userdata/activity/fourteen_day/fourteen_day_data.lua b/lua/app/userdata/activity/fourteen_day/fourteen_day_data.lua index 331ae673..1a63d4de 100644 --- a/lua/app/userdata/activity/fourteen_day/fourteen_day_data.lua +++ b/lua/app/userdata/activity/fourteen_day/fourteen_day_data.lua @@ -506,6 +506,10 @@ function FourteenDayData:getExchangeCostNum(id) return GFunc.getRewardNum(self:getExchangeCfg()[id].cost) end +function FourteenDayData:getExchangeCost(id) + return self:getExchangeCfg()[id].cost +end + -- 获取兑换的奖励道具 function FourteenDayData:getExchangeReward(id) return self:getExchangeCfg()[id].reward @@ -521,12 +525,13 @@ function FourteenDayData:onShowExchangeView() end -- 兑换奖励领取成功 -function FourteenDayData:onReceivedExchangeReward(id) +function FourteenDayData:onReceivedExchangeReward(id, count) + count = count or 1 if self.exchangeStatus[id] == nil then self.exchangeStatus[id] = 0 end - self.exchangeStatus[id] = self.exchangeStatus[id] + 1 + self.exchangeStatus[id] = self.exchangeStatus[id] + count self:setDirty() end diff --git a/lua/app/userdata/arena/arena_data.lua b/lua/app/userdata/arena/arena_data.lua index 5d5e04d3..4acb7ca1 100644 --- a/lua/app/userdata/arena/arena_data.lua +++ b/lua/app/userdata/arena/arena_data.lua @@ -720,7 +720,7 @@ function ArenaData:onBattleResultReceived(settlement, result) if self:getGradingIdFromScore(beforeMaxGrading) ~= self:getGradingIdFromScore(self.maxScore) then DataManager.HeroData:checkIfCanShowHeroUnlockDan(self:getFormartMaxGrading()) end - if beforeMaxGrading > self.maxScore then + if beforeMaxGrading < self.maxScore then ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_ARENA_GRADING, self.maxScore - beforeMaxGrading) end