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].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].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].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].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].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") -- 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 itemId = 0
local dayNum = 0 local residueTimeNum = endTime - GetTimeStamp()
local dayNum = math.floor(residueTimeNum / (24 * 3600))
local leijiDayNum = 7 - dayNum
-- pre.rewards -- pre.rewards
-- weekReward -- weekReward
local allNum = 0 local allNum = 0
local leijiNum = 0
local name = "" local name = ""
local icon = "" local icon = ""
local oneNum = 0 local oneNum = 0
@ -283,7 +287,9 @@ function WeekCardPanel:ShowCardInfo(index, config)
else else
numTxt.text = num numTxt.text = num
end end
if leijiDayNum >= config.BaseRewardID[i][1] then
leijiNum = leijiNum + num
end
allNum = allNum + num allNum = allNum + num
end end
@ -311,13 +317,14 @@ function WeekCardPanel:ShowCardInfo(index, config)
getNum = getNum + 1 getNum = getNum + 1
end end
end end
local residueTimeNum = endTime - GetTimeStamp() --local residueTimeNum = endTime - GetTimeStamp()
local dayNum = math.floor(residueTimeNum / (24 * 3600)) --local dayNum = math.floor(residueTimeNum / (24 * 3600))
pre.timeTxt.text = "(剩余" .. dayNum .. "天)" pre.timeTxt.text = "(剩余" .. dayNum .. "天)"
if dayNum == 0 then if dayNum == 0 then
pre.timeTxt.gameObject:SetActive(false) pre.timeTxt.gameObject:SetActive(false)
else else
pre.timeTxt.gameObject:SetActive(true) pre.timeTxt.gameObject:SetActive(true)
end end
if getNum > 0 then if getNum > 0 then
-- 领取奖励 -- 领取奖励
@ -341,9 +348,12 @@ function WeekCardPanel:ShowCardInfo(index, config)
PopupTipPanel.ShowTip("您已领取该奖励") PopupTipPanel.ShowTip("您已领取该奖励")
end) end)
end end
pre.lideTxt.gameObject:SetActive(false)
else else
-- 购买周卡 -- 购买周卡
pre.timeTxt.gameObject:SetActive(false) 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.btnText.text = MoneyUtil.GetMoneyUnitNameWithMoney(rechargeCfg.Price)
pre.red:SetActive(false) pre.red:SetActive(false)
Util.SetGray(pre.btn, false) Util.SetGray(pre.btn, false)