修复sdk支付时界面不刷新的问题,
parent
ed0a54ab56
commit
42a2496ef7
|
@ -303,6 +303,7 @@ GameEvent = {
|
|||
},
|
||||
LoginSuccess = {
|
||||
OnLoginSuccess = "LoginSuccess.OnLoginSuccess",
|
||||
OnLogout = "LoginSuccess.OnLogout",
|
||||
},
|
||||
HeroGrade = {
|
||||
OnHeroGradeChange = "HeroGrade.OnHeroGradeChange",
|
||||
|
|
|
@ -45,6 +45,8 @@ function this.Initialize()
|
|||
ThinkingAnalyticsManager.Track("quit_account")
|
||||
Framework.Dispose()
|
||||
App.Instance:ReStart()
|
||||
-- 发送登出事件
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLogout)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -116,6 +116,7 @@ function this:AddListener()
|
|||
Game.GlobalEvent:AddEvent(Protocal.Connect, this.OnConnect)
|
||||
Game.GlobalEvent:AddEvent(Protocal.Disconnect, this.OnDisconnect)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.LoginSuccess.OnLoginSuccess, this.RefreshLoginStatus)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.LoginSuccess.OnLogout, this.RefreshLoginStatus)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
|
@ -124,6 +125,38 @@ function this:RemoveListener()
|
|||
Game.GlobalEvent:RemoveEvent(Protocal.Connect, this.OnConnect)
|
||||
Game.GlobalEvent:RemoveEvent(Protocal.Disconnect, this.OnDisconnect)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.LoginSuccess.OnLoginSuccess, this.RefreshLoginStatus)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.LoginSuccess.OnLogout, this.RefreshLoginStatus)
|
||||
end
|
||||
|
||||
function this:OnLogout()
|
||||
if IsSDKLogin then
|
||||
this.sdkLoginBtn:SetActive(false)
|
||||
this.inputField.gameObject:SetActive(false)
|
||||
this.UserBtn:SetActive(false)
|
||||
this.btnUser:SetActive(false)
|
||||
this.btnNotice.transform.position = this.btnUser.transform.position
|
||||
this.SDKLogin()
|
||||
else
|
||||
this.sdkLoginBtn:SetActive(false)
|
||||
|
||||
local userId = PlayerPrefs.GetString(openIdkey, defaultOpenIdkey)
|
||||
if IsDevelopLogin then
|
||||
this.UserBtn:SetActive(false)
|
||||
this.btnUser:SetActive(false)
|
||||
this.inputField.gameObject:SetActive(true)
|
||||
this.inputField.text = userId
|
||||
else
|
||||
this.UserBtn:SetActive(true)
|
||||
this.btnUser:SetActive(true)
|
||||
this.inputField.gameObject:SetActive(false)
|
||||
this.UserBtnText.text = userId
|
||||
end
|
||||
|
||||
RequestPanel.Show(Language[11121])
|
||||
this.SetLoginPart(true)
|
||||
networkMgr:SendGetHttp(string.format("%sjl_loginserver/getServerList?openId=%s&channel=%s&plat=android&sub_channel=%s", LoginRoot_Url, userId, LoginRoot_Channel, LoginRoot_SubChannel),
|
||||
this.OnReceiveServerList, nil, nil, nil)
|
||||
end
|
||||
end
|
||||
|
||||
function this:OnSortingOrderChange()
|
||||
|
|
|
@ -525,7 +525,10 @@ function this.PaySuccess(buffer)
|
|||
local tip = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, msg.goodsId).Tip
|
||||
PopupTipPanel.ShowTip(tip)
|
||||
--FirstRechargeManager.RefreshAccumRechargeValue(msg.goodsId)
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.MoneyPay.OnPayResultSuccess, msg.goodsId)
|
||||
-- 延时0.5秒刷新。避免sdk支付时商店次数未刷新,界面刷新的问题
|
||||
Timer.New(function()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.MoneyPay.OnPayResultSuccess, msg.goodsId)
|
||||
end, 0.5):Start()
|
||||
--end
|
||||
end
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ function this.RequestPay(context)
|
|||
params.productId = context.Id
|
||||
params.productName = context.Name or ""
|
||||
params.productDesc = context.Desc or ""
|
||||
params.price = context.Price
|
||||
params.price = context.Price * 100 -- 以分为单位
|
||||
params.ratio = 1
|
||||
params.buyNum = context.BuyNum or 1
|
||||
params.coinNum = BagManager.GetItemCountById(16)
|
||||
|
|
Loading…
Reference in New Issue