日常 轩辕 列表优化

dev_chengFeng
jiaoyangna 2020-08-26 12:23:10 +08:00
parent 59204790d2
commit 78ea78303d
2 changed files with 9 additions and 6 deletions

View File

@ -168,14 +168,20 @@ function this.RefreshShow(i)
DailyCarbonPanel:RefreshRedPotShow()
end
--设置滚动条
local curMaxOpenId = 0
function this.SetScroll(i)
curMaxOpenId = 1
this.scrollView:SetData(curData,function(index,root)
this.SetData(root,curData[index], curData[index - 1])
end)
this.scrollView:SetIndex(1)
for k,v in ipairs(curData) do
if not CarbonManager.IsDailyCarbonPass(v.Id) then
curMaxOpenId = k
break
end
end
this.scrollView:SetIndex(curMaxOpenId - 2 < 1 and 1 or (curMaxOpenId - 2))
end
--设置滚动条数据 root根节点 data本地表数据 ldata 上一条数据
@ -245,9 +251,6 @@ function this.SetData(root, data, ldata)
goBtnText.text=Language[10336]
goBtnImage.sprite=Util.LoadSprite("s_slbz_1anniuhuise")
tip.text=Language[10337]
if curMaxOpenId < data.Id then
curMaxOpenId = data.Id
end
end
else
type=0

View File

@ -151,7 +151,7 @@ function this:SwitchView()
break
end
end
this.ScrollView:SetIndex(t - 2 < 1 and 1 or t - 2)
this.ScrollView:SetIndex(t - 2 < 1 and 1 or (t - 2))
end
function this:NewItemView(config, gameObject, ...)