【连购礼包】提交
parent
1287c8f37c
commit
d5bd38be25
|
@ -8,6 +8,11 @@ local BTNS = {
|
|||
[2] = {bg1 = "b_baibao_andi",bg2 = "b_baibao_liangdi",text1 = "b_baibao_meiritehui-a",text2 = "b_baibao_meiritehui",title = "b_baibao_meiritehui-b"},
|
||||
[3] = {bg1 = "b_baibao_andi",bg2 = "b_baibao_liangdi",text1 = "b_baibao_chaozhitehui-a",text2 = "b_baibao_chaozhitehui",title = "b_baibao_chaozhitehui-b"},
|
||||
}
|
||||
local btnType = {
|
||||
LianGou = 1,
|
||||
Meiri = 2,
|
||||
ChaoZhi = 3,
|
||||
}
|
||||
|
||||
function ContinuePackagePanel:InitComponent()
|
||||
self.spLoader = SpriteLoader.New()
|
||||
|
@ -31,7 +36,7 @@ function ContinuePackagePanel:InitComponent()
|
|||
self.scrollView.elastic = false
|
||||
self.itemViewList = {}
|
||||
self.sortingOrder = 0
|
||||
self.curPage = 1
|
||||
self.curPage = btnType.LianGou
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
|
@ -141,6 +146,7 @@ function ContinuePackagePanel:ShowSingleHero(go,data,index)
|
|||
btnText.gameObject:SetActive(false)
|
||||
obj:SetActive(false)
|
||||
canBuyTime.text = string.format( "剩余:%s次",data.progress)
|
||||
canBuyTime.gameObject:SetActive(self.curPage ~= btnType.LianGou)--第一页连购好礼不显示剩余次数
|
||||
btnImg.sprite = self.spLoader:LoadSprite("s_slbz_anniu")
|
||||
if data.otherData.GoodType == 1 then--直购
|
||||
btnText.gameObject:SetActive(true)
|
||||
|
@ -205,9 +211,17 @@ function ContinuePackagePanel:SetTime()
|
|||
self.timer = nil
|
||||
end
|
||||
local time = self.actData.endTime - GetTimeStamp()
|
||||
local leftDay = math.floor( time/86400 )
|
||||
if self.curPage == btnType.Meiri then--如果是每日特惠显示每日倒计时
|
||||
time = CalculateSecondsNowTo_N_OClock(24)
|
||||
end
|
||||
self.leftTime.text = Language[10512]..TimeToFelaxible(time)
|
||||
self.timer = Timer.New(function ()
|
||||
if time <= 0 then
|
||||
if self.curPage == btnType.Meiri and leftDay > 0 then
|
||||
self:Refresh(false,false)
|
||||
return
|
||||
end
|
||||
self:ClosePanel()
|
||||
end
|
||||
self.leftTime.text = Language[10512]..TimeToFelaxible(time)
|
||||
|
|
Loading…
Reference in New Issue