特权添加时间
parent
dea7c12ded
commit
965f9c19e9
|
|
@ -291,31 +291,31 @@ function EveryDayGift:OnDestroy()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- --特权商城专属
|
--特权商城专属
|
||||||
-- function EveryDayGift:SpecialTime(t)
|
function EveryDayGift:SpecialTime(t)
|
||||||
-- if not t or t < 0 then
|
if not t or t < 0 then
|
||||||
-- return Language[11749]
|
return Language[11749]
|
||||||
-- end
|
end
|
||||||
-- local _sec = t % 60
|
local _sec = t % 60
|
||||||
-- local allMin = math.floor(t / 60)
|
local allMin = math.floor(t / 60)
|
||||||
-- local _min = allMin % 60
|
local _min = allMin % 60
|
||||||
-- local allHour = math.floor(t / 3600)
|
local allHour = math.floor(t / 3600)
|
||||||
-- local _hour = allHour % 24
|
local _hour = allHour % 24
|
||||||
-- local allDays = math.floor(t / 86400)
|
local allDays = math.floor(t / 86400)
|
||||||
|
|
||||||
-- if allDays>=1 then
|
if allDays>=1 then
|
||||||
-- return string.format(Language[11750],allDays),allDays
|
return string.format(Language[11703],allDays),allDays
|
||||||
-- else
|
else
|
||||||
-- if _hour>=1 then
|
if _hour>=1 then
|
||||||
-- return string.format(Language[11751], _hour), _hour
|
return string.format(Language[11704], _hour), _hour
|
||||||
-- else
|
else
|
||||||
-- if _min>=1 then
|
if _min>=1 then
|
||||||
-- return string.format(Language[11752], _min), _min
|
return string.format(Language[11705], _min), _min
|
||||||
-- else
|
else
|
||||||
-- return "1分"
|
return Language[12152]
|
||||||
-- end
|
end
|
||||||
-- end
|
end
|
||||||
-- end
|
end
|
||||||
-- return Language[11749]
|
return Language[11749]
|
||||||
-- end
|
end
|
||||||
return EveryDayGift
|
return EveryDayGift
|
||||||
|
|
@ -255,9 +255,26 @@ function GiftPre:SetIcon(_itemdata)
|
||||||
self.icon.gameObject:SetActive(false)
|
self.icon.gameObject:SetActive(false)
|
||||||
end
|
end
|
||||||
self.price.text = _itemdata.data.price
|
self.price.text = _itemdata.data.price
|
||||||
|
self.buyInfo.text = self.isCanBuy == 2 and "" or _itemdata.data.buyInfo
|
||||||
if self.isCanBuy == 2 then
|
if self.isCanBuy == 2 then
|
||||||
self.icon.gameObject:SetActive(false)
|
self.icon.gameObject:SetActive(false)
|
||||||
self.price.text = "已购买"
|
self.price.text = "已购买"
|
||||||
|
if self.data.DataType == DataType.Direct and self.data.buyType == DirectBuyType.FINDTREASURE_GIFT then
|
||||||
|
if self.time then
|
||||||
|
self.time:Stop()
|
||||||
|
self.time = nil
|
||||||
|
end
|
||||||
|
local fresh = _itemdata.data.endTime - GetTimeStamp()
|
||||||
|
self.buyInfo.text = Language[10469]..self.parent:SpecialTime(fresh)
|
||||||
|
self.time = Timer.New(function()
|
||||||
|
if fresh <= 0 then
|
||||||
|
self.parent:RefreshData()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.buyInfo.text = Language[10469]..self.parent:SpecialTime(fresh)
|
||||||
|
end,1,-1,true)
|
||||||
|
self.time:Start()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if _itemdata.data.finalNum == 0 and self.isCanBuy == 0 then
|
if _itemdata.data.finalNum == 0 and self.isCanBuy == 0 then
|
||||||
self.redPoint.gameObject:SetActive(true)
|
self.redPoint.gameObject:SetActive(true)
|
||||||
|
|
@ -266,10 +283,13 @@ function GiftPre:SetIcon(_itemdata)
|
||||||
end
|
end
|
||||||
Util.SetGray(self.btnBuy, (self.isCanBuy == 2))
|
Util.SetGray(self.btnBuy, (self.isCanBuy == 2))
|
||||||
LayoutRebuilder.ForceRebuildLayoutImmediate(self.btnBuy.transform)
|
LayoutRebuilder.ForceRebuildLayoutImmediate(self.btnBuy.transform)
|
||||||
self.buyInfo.text = self.isCanBuy == 2 and "" or _itemdata.data.buyInfo
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function GiftPre:OnClose()
|
function GiftPre:OnClose()
|
||||||
|
if self.time then
|
||||||
|
self.time:Stop()
|
||||||
|
self.time = nil
|
||||||
|
end
|
||||||
DynamicActivityManager.SetSelectIndex(0,{})
|
DynamicActivityManager.SetSelectIndex(0,{})
|
||||||
for k,v in pairs(self.itemList) do
|
for k,v in pairs(self.itemList) do
|
||||||
SubUIManager.Close(v)
|
SubUIManager.Close(v)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue