diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index 094b119a..42335261 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -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)) 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) local m = time // 60 return I18N:getGlobalText(I18N.GlobalConst.TIME_STR_M, m) diff --git a/lua/app/ui/shop/cell/hot_sell_cell.lua b/lua/app/ui/shop/cell/hot_sell_cell.lua index 15550963..64b4cbe2 100644 --- a/lua/app/ui/shop/cell/hot_sell_cell.lua +++ b/lua/app/ui/shop/cell/hot_sell_cell.lua @@ -10,7 +10,9 @@ function HotSellCell:init() uiMap["hot_sell_cell.help_btn"]:addClickListener(function() ModuleManager.TipsManager:showDescTips(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_29), uiMap["hot_sell_cell.help_btn"]) 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 = {} for i = 1, CELL_COUNT do local cellObj = uiMap["hot_sell_cell.cell_" .. i] @@ -67,7 +69,10 @@ function HotSellCell:refreshTime() if remainTime < 0 then remainTime = 0 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 function HotSellCell:getCellHeight()