parent
25aed04450
commit
875325fabb
|
|
@ -275,9 +275,15 @@ function RecruitMainPanel:RemoveListener()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local redSort = {
|
||||||
|
[1] = 3,
|
||||||
|
[2] = 2,
|
||||||
|
[3] = 1,
|
||||||
|
}
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function RecruitMainPanel:OnOpen(_index)
|
function RecruitMainPanel:OnOpen(_index)
|
||||||
self.dicData = RecruitManager.GetRecruitData()
|
|
||||||
if not _index then
|
if not _index then
|
||||||
if GuideManager.IsInMainGuide() and GuideManager.GetCurId(1) == 105 then
|
if GuideManager.IsInMainGuide() and GuideManager.GetCurId(1) == 105 then
|
||||||
self.CurRecruitId = TableRecruitType.Putong
|
self.CurRecruitId = TableRecruitType.Putong
|
||||||
|
|
@ -286,11 +292,15 @@ function RecruitMainPanel:OnOpen(_index)
|
||||||
elseif GuideManager.IsFunctionGuideExist() then
|
elseif GuideManager.IsFunctionGuideExist() then
|
||||||
self.CurRecruitId = TableRecruitType.Siyuanzhen
|
self.CurRecruitId = TableRecruitType.Siyuanzhen
|
||||||
else
|
else
|
||||||
|
local data = RecruitManager.GetRecruitData()
|
||||||
local isRed = 0
|
local isRed = 0
|
||||||
for i = 1,#self.dicData do
|
table.sort(data,function(a,b)
|
||||||
if self.dicData[i].RpType and self.dicData[i].RpType > 0 then
|
return redSort[a.Sort] < redSort[b.Sort]
|
||||||
if RecruitManager.GetAllRecruitBtnRedpoint(self.dicData[i].RpType) then
|
end)
|
||||||
isRed = self.dicData[i].ShopData[1][1]
|
for i = 1,#data do
|
||||||
|
if data[i].RpType and data[i].RpType > 0 then
|
||||||
|
if RecruitManager.GetAllRecruitBtnRedpoint(data[i].RpType) then
|
||||||
|
isRed = data[i].ShopData[1][1]
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -298,9 +308,8 @@ function RecruitMainPanel:OnOpen(_index)
|
||||||
if isRed > 0 then
|
if isRed > 0 then
|
||||||
self.CurRecruitId = isRed
|
self.CurRecruitId = isRed
|
||||||
else
|
else
|
||||||
self.CurRecruitId = RecruitManager.CurRecruitId
|
self.CurRecruitId = TableRecruitType.Shenjiang
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.CurRecruitId = _index
|
self.CurRecruitId = _index
|
||||||
|
|
@ -311,6 +320,7 @@ end
|
||||||
-- 打开,重新打开时回调
|
-- 打开,重新打开时回调
|
||||||
function RecruitMainPanel:OnShow()
|
function RecruitMainPanel:OnShow()
|
||||||
orginLayer = self.sortingOrder
|
orginLayer = self.sortingOrder
|
||||||
|
self.dicData = RecruitManager.GetRecruitData()
|
||||||
this:RefreshTabData()
|
this:RefreshTabData()
|
||||||
for i = 1,#self.dicData do
|
for i = 1,#self.dicData do
|
||||||
if self.dicData[i].ShopData[1][1] == self.CurRecruitId then
|
if self.dicData[i].ShopData[1][1] == self.CurRecruitId then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue