排序修改

dev_chengFeng
jiaoyangna 2021-01-15 18:00:40 +08:00
parent cd47bb92aa
commit f75b921ea0
1 changed files with 12 additions and 1 deletions

View File

@ -65,9 +65,20 @@ function TrialRewardPopup:OnDestroy()
scrollView=nil
end
--0 已经领取1 可领取2不能领取·
local sortIndex = {
[0] = 0,
[1] = 2,
[2] = 1,
}
--刷新
function this.RefreshPanel()
table.sort(rewardConfig,function(a,b)
if sortIndex[a.state] == sortIndex[b.state] then
return a.Id < b.Id
end
return sortIndex[a.state] > sortIndex[b.state]
end)
scrollView:SetData(rewardConfig,function(index,root)
this.SetScrollPre(root,rewardConfig[index])
end)