商店添加

dev_chengFeng
jiaoyangna 2021-12-06 15:53:01 +08:00
parent a0440fa3ae
commit da9b75ee80
1 changed files with 18 additions and 11 deletions

View File

@ -37,9 +37,8 @@ function IncarnationLottery:InitComponent()
self.btns[i].info = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/Text"):GetComponent("Text")
self.btns[i].icon = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/icon"):GetComponent("Image")
self.btns[i].num = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/num"):GetComponent("Text")
self.btns[i].reward = Util.GetGameObject(self.btns[i].btn.gameObject,"reward"):GetComponent("Text")
end
self.btnTime = Util.GetGameObject(self.btns[1].btn,"di1/time"):GetComponent("Text")
--center
self.center = Util.GetGameObject(self.gameObject,"center/TurnTable/itemlist")
self.icons = {}
@ -50,6 +49,7 @@ function IncarnationLottery:InitComponent()
self.icons[i].kuang = Util.GetGameObject(self.icons[i].pre,"itemPos")
self.icons[i].icon = Util.GetGameObject(self.icons[i].pre,"icon"):GetComponent("Image")
self.icons[i].num = Util.GetGameObject(self.icons[i].pre,"numDi/Text"):GetComponent("Text")
end
self.updateTimes = Util.GetGameObject(self.gameObject,"updateTimes")
@ -165,12 +165,6 @@ function IncarnationLottery:refreshMagicNum()
self.updateTimesTip1.text = string.format("<color=#cbb981>活动剩余时间:%s</color>",self:TimeToDHMS(endTime))
local timeDown=CalculateSecondsNowTo_N_OClock(0)
self.timer = Timer.New(function()
if timeDown < 1 then
self:RefreshGetHeroTimes()
return
else
self.btnTime.text = TimeToHMS(timeDown).."后刷新"
end
if endTime < 1 then
self.timer:Stop()
self.timer = nil
@ -185,10 +179,24 @@ function IncarnationLottery:refreshMagicNum()
self.timer:Start()
end
function IncarnationLottery:GetSendStr(reId)
local str = ""
if lotterySetting[reId] and lotterySetting[reId].TenTimesMustGetItem and #lotterySetting[reId].TenTimesMustGetItem > 0 then
for k,v in ipairs(lotterySetting[reId].TenTimesMustGetItem) do
if str == "" then
str = str.."赠送"
else
str = str..""
end
str = str..v[2]..""..itemConfig[v[1]].Name
end
end
return str
end
function IncarnationLottery:refreshBtnShow()
local curTimes = PrivilegeManager.GetPrivilegeUsedTimes(self.maxtimesId)
self.limit.text ="今日召唤上限:"..curTimes.."/"..privilegeConfig[self.maxtimesId].Condition[1][2]
self.btnTime.gameObject:SetActive(false)
local freeTime = 0
if self.freeTimesId and self.freeTimesId > 0 then
freeTime = PrivilegeManager.GetPrivilegeRemainValue(self.freeTimesId)
@ -214,7 +222,6 @@ function IncarnationLottery:refreshBtnShow()
end
local d = {}
if (isFree) then
self.btnTime.gameObject:SetActive(false)
m.info.text="免费抽取"
else
local d = RecruitManager.GetExpendData(type)
@ -223,7 +230,7 @@ function IncarnationLottery:refreshBtnShow()
m.icon.sprite = self.spLoader:LoadSprite(artConfig[itemConfig[itemId].ResourceID].Name)
m.num.text= tostring(itemNum)
end
m.reward.text = self:GetSendStr(n == 1 and self.singleRecruit.Id or self.tenRecruit.Id)
Util.AddOnceClick(m.btn,function()
if not isFree then
if BagManager.GetItemCountById(itemId) < itemNum then