【旗开得胜】社稷赏商店购买限购商品到达上限后,页面不限时已售空,需要切换页签。

dev_chengFeng
jiaoyangna 2021-05-28 15:02:17 +08:00
parent edd52b5eaa
commit 33909a2f91
3 changed files with 18 additions and 0 deletions

View File

@ -228,6 +228,7 @@ GameEvent = {
},
Shop = {
OnShopInfoChange = "Shop.OnShopInfoChange",
RefreshItem = "Shop.RefreshItem",
},
Vip = {
OnVipTaskStatusChanged = "Vip.OnVipTaskStatusChanged",

View File

@ -53,6 +53,7 @@ function ShopBuyPopup:BindEvent()
end
ShopManager.RequestBuyShopItem(this.shopType, this.shopItemId, count, function()
Game.GlobalEvent:DispatchEvent(GameEvent.Shop.RefreshItem)
self:ClosePanel()
end)
end)

View File

@ -113,6 +113,22 @@ function ShopViewNew:BindEvent()
end)
end
local RefreshData = function(self)
self:RefreshItemList(false)
end
--添加事件监听(用于子类重写)
function ShopViewNew:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Shop.RefreshItem,RefreshData,self)
end
--移除事件监听(用于子类重写)
function ShopViewNew:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Shop.RefreshItem,RefreshData,self)
end
--界面打开时调用(用于子类重写)
function ShopViewNew:OnOpen(_activityConfig,_index,parent)
self.actConfig = _activityConfig