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