diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/DailyCarbonPanel.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/DailyCarbonPanel.lua index 28d08a0042..8289f17395 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/DailyCarbonPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/DailyCarbonPanel.lua @@ -163,7 +163,7 @@ function this.RefreshShow(i) this.titleBg.sprite=Util.LoadSprite(titleBg[i].bg) this.titleTip.text=titleBg[i].titleTip - this.titleTip.gameObject:GetComponent("RectTransform").localPosition =titleBg[i].pos + this.titleTip.gameObject:GetComponent("RectTransform").localPosition = titleBg[i].pos this.SetTimeTip() this.SetScroll(i) DailyCarbonPanel:RefreshRedPotShow() @@ -174,7 +174,14 @@ function this.SetScroll(i) this.scrollView:SetData(curData,function(index,root) this.SetData(root,curData[index], curData[index - 1]) end) - this.scrollView:SetIndex(1) + local t = 1 + for k,v in ipairs(curData) do + if not CarbonManager.IsDailyCarbonPass(v.Id) then + t = k + break + end + end + this.scrollView:SetIndex(t - 2 < 1 and 1 or t - 2) end --设置滚动条数据 root根节点 data本地表数据 ldata 上一条数据 diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanelList.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanelList.lua index 6c29013cb1..3a1ce88760 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanelList.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanelList.lua @@ -145,6 +145,14 @@ function this:SwitchView() table.insert(list, go) end ) + local t = 1 + for k,v in ipairs(dataList) do + if v.state == 1 then + t = k + break + end + end + this.ScrollView:SetIndex(t - 2 < 1 and 1 or t - 2) end function this:NewItemView(config, gameObject, ...)