This commit is contained in:
xiekaidong 2023-06-01 22:10:05 +08:00
commit 9b0a928b35
2 changed files with 14 additions and 2 deletions

View File

@ -450,6 +450,13 @@ function GFunc.getTimeStrWithHMS(time)
return I18N:getGlobalText(I18N.GlobalConst.TIME_HMS, string.format("%02d", h), string.format("%02d", m), string.format("%02d", s)) return I18N:getGlobalText(I18N.GlobalConst.TIME_HMS, string.format("%02d", h), string.format("%02d", m), string.format("%02d", s))
end end
function GFunc.getTimeWithHMS(time)
local h = math.floor(time/3600)
local m = math.floor((time%3600)/60)
local s = time%60
return string.format("%02d", h), string.format("%02d", m), string.format("%02d", s)
end
function GFunc.getTimeStrWithM2(time) function GFunc.getTimeStrWithM2(time)
local m = time // 60 local m = time // 60
return I18N:getGlobalText(I18N.GlobalConst.TIME_STR_M, m) return I18N:getGlobalText(I18N.GlobalConst.TIME_STR_M, m)

View File

@ -10,7 +10,9 @@ function HotSellCell:init()
uiMap["hot_sell_cell.help_btn"]:addClickListener(function() uiMap["hot_sell_cell.help_btn"]:addClickListener(function()
ModuleManager.TipsManager:showDescTips(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_29), uiMap["hot_sell_cell.help_btn"]) ModuleManager.TipsManager:showDescTips(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_29), uiMap["hot_sell_cell.help_btn"])
end) end)
self.timeTx = uiMap["hot_sell_cell.time_tx"] self.time1Tx = uiMap["hot_sell_cell.time_icon_1.text"]
self.time2Tx = uiMap["hot_sell_cell.time_icon_2.text"]
self.time3Tx = uiMap["hot_sell_cell.time_icon_3.text"]
self.cells = {} self.cells = {}
for i = 1, CELL_COUNT do for i = 1, CELL_COUNT do
local cellObj = uiMap["hot_sell_cell.cell_" .. i] local cellObj = uiMap["hot_sell_cell.cell_" .. i]
@ -67,7 +69,10 @@ function HotSellCell:refreshTime()
if remainTime < 0 then if remainTime < 0 then
remainTime = 0 remainTime = 0
end end
self.timeTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_22, GFunc.getTimeStrWithHMS(remainTime)))-- 刷新时间:{0} local h,m,s = GFunc.getTimeWithHMS(remainTime)
self.time1Tx:setText(h)
self.time2Tx:setText(m)
self.time3Tx:setText(s)
end end
function HotSellCell:getCellHeight() function HotSellCell:getCellHeight()