parent
374e41fdc2
commit
268b8df801
|
|
@ -2,13 +2,13 @@ local LevelMoney = quick_class("WeekCard")
|
||||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||||
local EncourageTaskConfig = ConfigManager.GetConfig(ConfigName.EncourageTaskConfig)
|
local EncourageTaskConfig = ConfigManager.GetConfig(ConfigName.EncourageTaskConfig)
|
||||||
local EncouragePlanConfig = ConfigManager.GetConfig(ConfigName.EncouragePlanConfig)
|
local EncouragePlanConfig = ConfigManager.GetConfig(ConfigName.EncouragePlanConfig)
|
||||||
local allData={}
|
local allData = {}
|
||||||
local bannerImg = {
|
local bannerImg = {
|
||||||
[15] = {GetPictureFont("X1_zhanling_pata_bg"), "", 131},--爬塔
|
[15] = { GetPictureFont("X1_zhanling_pata_bg"), "", 131 }, --爬塔
|
||||||
[16] = {GetPictureFont("X1_zhanling_mota_bg"), "X1_zhanling_mota_icon", 132},--魔之塔
|
[16] = { GetPictureFont("X1_zhanling_mota_bg"), "X1_zhanling_mota_icon", 132 }, --魔之塔
|
||||||
[17] = {GetPictureFont("X1_zhanling_yiduan_bg"),"X1_zhanling_yiduan_icon", 133},--异端
|
[17] = { GetPictureFont("X1_zhanling_yiduan_bg"), "X1_zhanling_yiduan_icon", 133 }, --异端
|
||||||
[18] = {GetPictureFont("X1_zhanling_miwu_bg"), "X1_zhanling_miwu_icon", 134},--迷雾
|
[18] = { GetPictureFont("X1_zhanling_miwu_bg"), "X1_zhanling_miwu_icon", 134 }, --迷雾
|
||||||
[19] = {GetPictureFont("X1_zhanling_shenyuan_bg"), "X1_zhanling_shenyuan_icon", 135},--深渊
|
[19] = { GetPictureFont("X1_zhanling_shenyuan_bg"), "X1_zhanling_shenyuan_icon", 135 }, --深渊
|
||||||
}
|
}
|
||||||
local curIndex
|
local curIndex
|
||||||
local lastGlobalSystemId
|
local lastGlobalSystemId
|
||||||
|
|
@ -81,7 +81,7 @@ function LevelMoney:SetData()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local setTop = false
|
local setTop = false
|
||||||
table.sort(allData,function(a, b)
|
table.sort(allData, function(a, b)
|
||||||
if a.state == b.state then
|
if a.state == b.state then
|
||||||
return a.value < b.value
|
return a.value < b.value
|
||||||
else
|
else
|
||||||
|
|
@ -95,13 +95,13 @@ function LevelMoney:SetData()
|
||||||
rewardMoney = rewardMoney + data.money
|
rewardMoney = rewardMoney + data.money
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert(allData,{})
|
table.insert(allData, {})
|
||||||
if not curIndex then
|
if not curIndex then
|
||||||
curIndex = #allData
|
curIndex = #allData
|
||||||
setTop = true
|
setTop = true
|
||||||
end
|
end
|
||||||
|
|
||||||
self.scrollView:SetData(allData, function (index, go)
|
self.scrollView:SetData(allData, function(index, go)
|
||||||
self:SetItem(go, allData[index], index, #allData)
|
self:SetItem(go, allData[index], index, #allData)
|
||||||
end)
|
end)
|
||||||
if setTop then
|
if setTop then
|
||||||
|
|
@ -111,8 +111,8 @@ end
|
||||||
|
|
||||||
function LevelMoney:SetBanner()
|
function LevelMoney:SetBanner()
|
||||||
self.level.text = PlayerManager.level
|
self.level.text = PlayerManager.level
|
||||||
self.rewardMoney.text = rewardMoney.."元"
|
self.rewardMoney.text = rewardMoney .. GetLanguageStrById("钻石")
|
||||||
self.shengYuMoney.text = allMoney - rewardMoney.."元"
|
self.shengYuMoney.text = allMoney - rewardMoney .. GetLanguageStrById("钻石")
|
||||||
end
|
end
|
||||||
|
|
||||||
function LevelMoney:SetItem(go, data, index, max)
|
function LevelMoney:SetItem(go, data, index, max)
|
||||||
|
|
@ -134,7 +134,7 @@ function LevelMoney:SetItem(go, data, index, max)
|
||||||
local redpoint = Util.GetGameObject(go, "btn/redpoint")
|
local redpoint = Util.GetGameObject(go, "btn/redpoint")
|
||||||
|
|
||||||
upLine:SetActive(index ~= 1)
|
upLine:SetActive(index ~= 1)
|
||||||
downLine:SetActive(index ~= max-1)
|
downLine:SetActive(index ~= max - 1)
|
||||||
|
|
||||||
if not self.itemList then
|
if not self.itemList then
|
||||||
self.itemList = {}
|
self.itemList = {}
|
||||||
|
|
@ -173,10 +173,10 @@ function LevelMoney:SetItem(go, data, index, max)
|
||||||
btnTxt.text = GetLanguageStrById(50536)
|
btnTxt.text = GetLanguageStrById(50536)
|
||||||
end
|
end
|
||||||
|
|
||||||
Util.AddOnceClick(btn, function ()
|
Util.AddOnceClick(btn, function()
|
||||||
if state == 2 then
|
if state == 2 then
|
||||||
local curActivityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.LevelLiJin)
|
local curActivityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.LevelLiJin)
|
||||||
NetManager.GetActivityRewardRequest(sConFigData.id, curActivityId,function(drop)
|
NetManager.GetActivityRewardRequest(sConFigData.id, curActivityId, function(drop)
|
||||||
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1)
|
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1)
|
||||||
self:OnShow()
|
self:OnShow()
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.WanYuan.Refresh)
|
Game.GlobalEvent:DispatchEvent(GameEvent.WanYuan.Refresh)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
local LoginMoney = quick_class("WeekCard")
|
local LoginMoney = quick_class("WeekCard")
|
||||||
|
|
||||||
local EncouragePlanConfig = ConfigManager.GetConfig(ConfigName.EncouragePlanConfig)
|
local EncouragePlanConfig = ConfigManager.GetConfig(ConfigName.EncouragePlanConfig)
|
||||||
local allData={}
|
local allData = {}
|
||||||
local this = LoginMoney
|
local this = LoginMoney
|
||||||
local curIndex
|
local curIndex
|
||||||
local lastGlobalSystemId
|
local lastGlobalSystemId
|
||||||
|
|
@ -62,12 +62,12 @@ function LoginMoney:OnShow()
|
||||||
self:SetBanner()
|
self:SetBanner()
|
||||||
--self:SetWarOrdersBtn()
|
--self:SetWarOrdersBtn()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function LoginMoney:Refresh()
|
-- function LoginMoney:Refresh()
|
||||||
-- self:SetData()
|
-- self:SetData()
|
||||||
-- self:SetBanner()
|
-- self:SetBanner()
|
||||||
-- end
|
-- end
|
||||||
function LoginMoney:OnHide()
|
function LoginMoney:OnHide()
|
||||||
|
|
||||||
self.gameObject:SetActive(false)
|
self.gameObject:SetActive(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ function LoginMoney:SetData()
|
||||||
if allData == nil then
|
if allData == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
table.sort(allData,function(a, b)
|
table.sort(allData, function(a, b)
|
||||||
if a.state == b.state then
|
if a.state == b.state then
|
||||||
return a.value < b.value
|
return a.value < b.value
|
||||||
else
|
else
|
||||||
|
|
@ -93,7 +93,7 @@ function LoginMoney:SetData()
|
||||||
rewardMoney = rewardMoney + data.money
|
rewardMoney = rewardMoney + data.money
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert(allData,{})
|
table.insert(allData, {})
|
||||||
|
|
||||||
local setTop = false
|
local setTop = false
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ function LoginMoney:SetData()
|
||||||
setTop = true
|
setTop = true
|
||||||
end
|
end
|
||||||
|
|
||||||
self.scrollView:SetData(allData, function (index, go)
|
self.scrollView:SetData(allData, function(index, go)
|
||||||
self:SetItem(go, allData[index], index, #allData)
|
self:SetItem(go, allData[index], index, #allData)
|
||||||
end)
|
end)
|
||||||
if setTop then
|
if setTop then
|
||||||
|
|
@ -112,11 +112,10 @@ end
|
||||||
|
|
||||||
function LoginMoney:SetBanner()
|
function LoginMoney:SetBanner()
|
||||||
self.loginDay.text = loginDay
|
self.loginDay.text = loginDay
|
||||||
self.rewardMoney.text = rewardMoney.."元"
|
self.rewardMoney.text = rewardMoney .. GetLanguageStrById("钻石")
|
||||||
self.shengYuMoney.text = allMoney - rewardMoney.."元"
|
self.shengYuMoney.text = allMoney - rewardMoney .. GetLanguageStrById("钻石")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function LoginMoney:SetItem(go, data, index, max)
|
function LoginMoney:SetItem(go, data, index, max)
|
||||||
if index == max then
|
if index == max then
|
||||||
go:SetActive(false)
|
go:SetActive(false)
|
||||||
|
|
@ -136,7 +135,7 @@ function LoginMoney:SetItem(go, data, index, max)
|
||||||
local redpoint = Util.GetGameObject(go, "btn/redpoint")
|
local redpoint = Util.GetGameObject(go, "btn/redpoint")
|
||||||
|
|
||||||
upLine:SetActive(index ~= 1)
|
upLine:SetActive(index ~= 1)
|
||||||
downLine:SetActive(index ~= max-1)
|
downLine:SetActive(index ~= max - 1)
|
||||||
|
|
||||||
if not self.itemList then
|
if not self.itemList then
|
||||||
self.itemList = {}
|
self.itemList = {}
|
||||||
|
|
@ -170,11 +169,11 @@ function LoginMoney:SetItem(go, data, index, max)
|
||||||
elseif state == 0 then
|
elseif state == 0 then
|
||||||
btnTxt.text = GetLanguageStrById(50536)
|
btnTxt.text = GetLanguageStrById(50536)
|
||||||
end
|
end
|
||||||
Util.AddOnceClick(btn, function ()
|
Util.AddOnceClick(btn, function()
|
||||||
if state == 2 then
|
if state == 2 then
|
||||||
local curActivityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.LoginLiJin)
|
local curActivityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.LoginLiJin)
|
||||||
Log("curActivityId login "..curActivityId)
|
Log("curActivityId login " .. curActivityId)
|
||||||
NetManager.GetActivityRewardRequest(sConFigData.id, curActivityId,function(drop)
|
NetManager.GetActivityRewardRequest(sConFigData.id, curActivityId, function(drop)
|
||||||
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1)
|
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1)
|
||||||
self:OnShow()
|
self:OnShow()
|
||||||
CheckRedPointStatus(RedPointType.WanYuan) --万元礼金
|
CheckRedPointStatus(RedPointType.WanYuan) --万元礼金
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue