TCX_LongZhu
DESKTOP-RH64908\Administrator 2025-12-30 19:08:11 +08:00
parent 6af8d5a7f2
commit e0eb80c80e
1 changed files with 14 additions and 4 deletions

View File

@ -32,6 +32,7 @@ function WeekCardPanel:InitComponent()
self.cardPres[i].hint = Util.GetGameObject(self.cardPres[i].go, "hint"):GetComponent("Text")
self.cardPres[i].Text = Util.GetGameObject(self.cardPres[i].go, "Text"):GetComponent("Text")
self.cardPres[i].timeTxt = Util.GetGameObject(self.cardPres[i].go, "time"):GetComponent("Text")
self.cardPres[i].lideTxt = Util.GetGameObject(self.cardPres[i].go, "lide"):GetComponent("Text")
-- self.cardPres[i].icon1 = Util.GetGameObject(self.cardPres[i].go, "tip1/icon"):GetComponent("Image")
-- self.cardPres[i].icon2 = Util.GetGameObject(self.cardPres[i].go, "tip2/icon"):GetComponent("Image")
-- self.cardPres[i].icon3 = Util.GetGameObject(self.cardPres[i].go, "Image/icon"):GetComponent("Image")
@ -252,10 +253,13 @@ function WeekCardPanel:ShowCardInfo(index, config)
-- 每日奖励数量
local itemId = 0
local dayNum = 0
local residueTimeNum = endTime - GetTimeStamp()
local dayNum = math.floor(residueTimeNum / (24 * 3600))
local leijiDayNum = 7 - dayNum
-- pre.rewards
-- weekReward
local allNum = 0
local leijiNum = 0
local name = ""
local icon = ""
local oneNum = 0
@ -283,7 +287,9 @@ function WeekCardPanel:ShowCardInfo(index, config)
else
numTxt.text = num
end
if leijiDayNum >= config.BaseRewardID[i][1] then
leijiNum = leijiNum + num
end
allNum = allNum + num
end
@ -311,13 +317,14 @@ function WeekCardPanel:ShowCardInfo(index, config)
getNum = getNum + 1
end
end
local residueTimeNum = endTime - GetTimeStamp()
local dayNum = math.floor(residueTimeNum / (24 * 3600))
--local residueTimeNum = endTime - GetTimeStamp()
--local dayNum = math.floor(residueTimeNum / (24 * 3600))
pre.timeTxt.text = "(剩余" .. dayNum .. "天)"
if dayNum == 0 then
pre.timeTxt.gameObject:SetActive(false)
else
pre.timeTxt.gameObject:SetActive(true)
end
if getNum > 0 then
-- 领取奖励
@ -341,9 +348,12 @@ function WeekCardPanel:ShowCardInfo(index, config)
PopupTipPanel.ShowTip("您已领取该奖励")
end)
end
pre.lideTxt.gameObject:SetActive(false)
else
-- 购买周卡
pre.timeTxt.gameObject:SetActive(false)
pre.lideTxt.gameObject:SetActive(true)
pre.lideTxt.text = "<color=#382600>激活立得</color><color=#C72F2B>"..name.."*"..PrintWanNum2(leijiNum).."</color>"
pre.btnText.text = MoneyUtil.GetMoneyUnitNameWithMoney(rechargeCfg.Price)
pre.red:SetActive(false)
Util.SetGray(pre.btn, false)