【礼包 公会援助】列表刷新置顶问题

dev_chengFeng
zhangqiang 2021-04-15 16:25:00 +08:00
parent 8f611f0340
commit 3a4d593fdb
4 changed files with 19 additions and 18 deletions

View File

@ -51,7 +51,8 @@ function this.ShowPanelData(isTop,isAni)
allMyAidData = MyGuildManager.GetAllGuildHelpInfo() allMyAidData = MyGuildManager.GetAllGuildHelpInfo()
this.ScrollView:SetData(allMyAidData, function (index, go) this.ScrollView:SetData(allMyAidData, function (index, go)
this.SingleHelpAidDataShow(go, allMyAidData[index]) this.SingleHelpAidDataShow(go, allMyAidData[index])
end) end,not isTop,not isAni)
this.emptyObj:SetActive(#allMyAidData <= 0)
end) end)
else else
this.ScrollView:SetData(allMyAidData, function (index, go) this.ScrollView:SetData(allMyAidData, function (index, go)

View File

@ -109,15 +109,15 @@ function GrowthGiftPage:OnShow(_sortingOrder)
else else
self.titleTip.gameObject:SetActive(false) self.titleTip.gameObject:SetActive(false)
end end
self:RefreshData() self:RefreshData(true,true)
end end
function GrowthGiftPage:RefreshData() function GrowthGiftPage:RefreshData(isTop,isAni)
if self.actType == ActivityTypeDef.GrowthReward then if self.actType == ActivityTypeDef.GrowthReward then
self:SetBtnInvestState() self:SetBtnInvestState()
self.clickFun = self.GrowthGiftPageOnClick self.clickFun = self.GrowthGiftPageOnClick
end end
self:RefreshGiftData(true) self:RefreshGiftData(isTop,isAni)
end end
--设置投资按钮初始状态 --设置投资按钮初始状态
@ -136,7 +136,7 @@ function GrowthGiftPage:SetBtnInvestState()
end end
end end
function GrowthGiftPage:RefreshGiftData(anim) function GrowthGiftPage:RefreshGiftData(isTop,isAni)
self.mission = DynamicActivityManager.GetMissionDataByActId(self.curActiId) self.mission = DynamicActivityManager.GetMissionDataByActId(self.curActiId)
if not self.missionPre then if not self.missionPre then
self.missionPre = {} self.missionPre = {}
@ -148,7 +148,7 @@ function GrowthGiftPage:RefreshGiftData(anim)
self.scrollView:SetData(self.mission, function(index, item) self.scrollView:SetData(self.mission, function(index, item)
self:RefreshShowData(item, self.mission[index]) self:RefreshShowData(item, self.mission[index])
end,not anim) end,not isTop,not isAni)
end end
--刷新每一条item --刷新每一条item
@ -217,7 +217,7 @@ function GrowthGiftPage:RefreshStatus()
-- 检测红点状态 -- 检测红点状态
RedpotManager.CheckRedPointStatus(RedPointType.GrowthGift) RedpotManager.CheckRedPointStatus(RedPointType.GrowthGift)
-- 刷新当前界面显示 -- 刷新当前界面显示
self:RefreshData() self:RefreshData(false,false)
end end
--界面关闭时调用(用于子类重写) --界面关闭时调用(用于子类重写)

View File

@ -70,7 +70,7 @@ function EveryDayGift:BindEvent()
FirstRechargeManager.RefreshAccumRechargeValue(1004) FirstRechargeManager.RefreshAccumRechargeValue(1004)
PlayerPrefs.SetInt(PlayerManager.uid.."czlb", 0) PlayerPrefs.SetInt(PlayerManager.uid.."czlb", 0)
CheckRedPointStatus(RedPointType.GrowthPackage) CheckRedPointStatus(RedPointType.GrowthPackage)
self:RefreshData() self:RefreshData(nil,false,false)
end) end)
end) end)
end end
@ -127,10 +127,10 @@ function EveryDayGift:OnShow(_sortingOrder)
VipManager.SetGrowthPackagePointStatus() VipManager.SetGrowthPackagePointStatus()
CheckRedPointStatus(RedPointType.GrowthPackage) CheckRedPointStatus(RedPointType.GrowthPackage)
end end
self:RefreshData(true) self:RefreshData(true,true,true)
end end
function EveryDayGift:RefreshData(isUpdata) function EveryDayGift:RefreshData(isUpdata,isTop,isAni)
if self.actConfig.RpType > 0 then if self.actConfig.RpType > 0 then
CheckRedPointStatus(self.actConfig.RpType) CheckRedPointStatus(self.actConfig.RpType)
end end
@ -143,11 +143,11 @@ function EveryDayGift:RefreshData(isUpdata)
self:RefreshFreeData() self:RefreshFreeData()
end end
-- 刷新商品数据 -- 刷新商品数据
self:RefreshGiftData() self:RefreshGiftData(isTop,isAni)
end end
-- 刷新礼包的数据 -- 刷新礼包的数据
function EveryDayGift:RefreshGiftData() function EveryDayGift:RefreshGiftData(isTop,isAni)
rechargeNum = VipManager.GetChargedNum()--已经充值的金额 rechargeNum = VipManager.GetChargedNum()--已经充值的金额
self:isBought() self:isBought()
self.scrollView:ForeachItemGO(function(index, go) self.scrollView:ForeachItemGO(function(index, go)
@ -158,7 +158,7 @@ function EveryDayGift:RefreshGiftData()
self:RefreshShowData(item, self.shopData[index],index) self:RefreshShowData(item, self.shopData[index],index)
end end
local curindex = 0 local curindex = 0
self.scrollView:SetData(self.shopData, callBack) self.scrollView:SetData(self.shopData, callBack,not isTop,not isAni)
for i = 1 ,#self.shopData do for i = 1 ,#self.shopData do
if self.shopData[i].DataType == DynamicActivityManager.selectIndex.dataType then if self.shopData[i].DataType == DynamicActivityManager.selectIndex.dataType then
for j = 1 , #DynamicActivityManager.selectIndex.goodsId do for j = 1 , #DynamicActivityManager.selectIndex.goodsId do
@ -172,8 +172,8 @@ function EveryDayGift:RefreshGiftData()
break break
end end
end end
LogGreen("curindex:"..curindex) -- LogGreen("curindex:"..curindex)
self.scrollView:SetIndex(curindex) -- self.scrollView:SetIndex(curindex)
end end
function EveryDayGift:isBought() function EveryDayGift:isBought()
@ -249,7 +249,7 @@ function EveryDayGift:GetRemainTime()
self.endTime.text = Language[11355]..formatTime--时分秒 self.endTime.text = Language[11355]..formatTime--时分秒
end end
elseif showfreshTime < 0 then elseif showfreshTime < 0 then
self:RefreshData(true) self:RefreshData(true,false,false)
end end
end end
UpDate() UpDate()

View File

@ -111,7 +111,7 @@ function GiftPre:BindEvent()
CheckRedPointStatus(RedPointType.WeekGiftPage) CheckRedPointStatus(RedPointType.WeekGiftPage)
CheckRedPointStatus(RedPointType.MonthGiftPage) CheckRedPointStatus(RedPointType.MonthGiftPage)
CheckRedPointStatus(RedPointType.GrowthPackage) CheckRedPointStatus(RedPointType.GrowthPackage)
self.parent:RefreshData() self.parent:RefreshData(nil,false,false)
end) end)
end end
end end
@ -128,7 +128,7 @@ function GiftPre:BuyAction(costId, costNum, shopType, itemId)
else else
local func = function(shopType, itemId) local func = function(shopType, itemId)
ShopManager.RequestBuyShopItem(shopType, itemId, 1, function() ShopManager.RequestBuyShopItem(shopType, itemId, 1, function()
self.parent:RefreshData() self.parent:RefreshData(nil,false,false)
CheckRedPointStatus(RedPointType.DailyGift) CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.GrowthPackage) CheckRedPointStatus(RedPointType.GrowthPackage)
end) end)