账号绑定的apple处理
This commit is contained in:
parent
8891f004ff
commit
00ec7c553d
@ -13,13 +13,7 @@ function AccountBindUI:onLoadRootComplete()
|
||||
|
||||
self.uiMap["account_bind_ui.title_bg_img.title_text"]:setText(I18N:getGlobalText(I18N.GlobalConst.MESSAGE_BOX_TITLE))
|
||||
self.uiMap["account_bind_ui.title_bg_img.bg.content_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BIND_TIPS_DESC))
|
||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn"]:addClickListener(function()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
return
|
||||
end
|
||||
ModuleManager.AccountManager:bindAccount()
|
||||
end)
|
||||
self:initBindBtn()
|
||||
self.uiMap["account_bind_ui.close_btn"]:addClickListener(function()
|
||||
self:closeUI()
|
||||
end)
|
||||
@ -30,11 +24,43 @@ function AccountBindUI:onLoadRootComplete()
|
||||
self:refreshAccountInfo()
|
||||
end
|
||||
|
||||
function AccountBindUI:refreshAccountInfo()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
function AccountBindUI:initBindBtn()
|
||||
if Platform:isIosPlatform() then
|
||||
self.uiMap["account_bind_ui.title_bg_img.apple_sign_btn"]:setVisible(true)
|
||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn"]:setVisible(false)
|
||||
self.uiMap["account_bind_ui.title_bg_img.apple_sign_btn"]:addClickListener(function()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
return
|
||||
end
|
||||
ModuleManager.AccountManager:bindAccount()
|
||||
end)
|
||||
else
|
||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BIND_ACCOUNT_DESC))
|
||||
self.uiMap["account_bind_ui.title_bg_img.apple_sign_btn"]:setVisible(false)
|
||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn"]:setVisible(true)
|
||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn"]:addClickListener(function()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
return
|
||||
end
|
||||
ModuleManager.AccountManager:bindAccount()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function AccountBindUI:refreshAccountInfo()
|
||||
if Platform:isIosPlatform() then
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
self.uiMap["account_bind_ui.title_bg_img.apple_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
else
|
||||
self.uiMap["account_bind_ui.title_bg_img.apple_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BIND_ACCOUNT_DESC))
|
||||
end
|
||||
else
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
else
|
||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BIND_ACCOUNT_DESC))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -47,31 +47,8 @@ function GameSettingUI:_display()
|
||||
end
|
||||
|
||||
function GameSettingUI:initLoginBtn()
|
||||
self.uiMap["game_setting_ui.bg.google_sign_btn"]:addClickListener(function()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
return
|
||||
end
|
||||
ModuleManager.AccountManager:bindAccount()
|
||||
end)
|
||||
|
||||
self.uiMap["game_setting_ui.bg.google_switch_btn"]:addClickListener(function()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
ModuleManager.AccountManager:changeAccount()
|
||||
else
|
||||
local params = {
|
||||
content = I18N:getGlobalText(I18N.GlobalConst.CHANGE_ACCOUNT_TIPS_DESC),
|
||||
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
|
||||
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
||||
okFunc = function()
|
||||
ModuleManager.AccountManager:changeAccount()
|
||||
end
|
||||
}
|
||||
GFunc.showMessageBox(params)
|
||||
end
|
||||
end)
|
||||
self.uiMap["game_setting_ui.bg.google_switch_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.CHANGE_ACCOUNT_DESC))
|
||||
|
||||
self:initGoogleLoginBtn()
|
||||
self:initAppleLoginBtn()
|
||||
local deleteBtn = self.uiMap["game_setting_ui.bg.delete_btn"]
|
||||
deleteBtn:addClickListener(function()
|
||||
ModuleManager.AccountManager:showDeleteUI()
|
||||
@ -79,6 +56,73 @@ function GameSettingUI:initLoginBtn()
|
||||
self:refreshAccountInfo()
|
||||
end
|
||||
|
||||
function GameSettingUI:initGoogleLoginBtn()
|
||||
if Platform:isIosPlatform() then
|
||||
self.uiMap["game_setting_ui.bg.google_sign_btn"]:setVisible(false)
|
||||
self.uiMap["game_setting_ui.bg.google_switch_btn"]:setVisible(false)
|
||||
else
|
||||
self.uiMap["game_setting_ui.bg.google_sign_btn"]:setVisible(true)
|
||||
self.uiMap["game_setting_ui.bg.google_sign_btn"]:addClickListener(function()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
return
|
||||
end
|
||||
ModuleManager.AccountManager:bindAccount()
|
||||
end)
|
||||
|
||||
self.uiMap["game_setting_ui.bg.google_switch_btn"]:setVisible(true)
|
||||
self.uiMap["game_setting_ui.bg.google_switch_btn"]:addClickListener(function()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
ModuleManager.AccountManager:changeAccount()
|
||||
else
|
||||
local params = {
|
||||
content = I18N:getGlobalText(I18N.GlobalConst.CHANGE_ACCOUNT_TIPS_DESC),
|
||||
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
|
||||
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
||||
okFunc = function()
|
||||
ModuleManager.AccountManager:changeAccount()
|
||||
end
|
||||
}
|
||||
GFunc.showMessageBox(params)
|
||||
end
|
||||
end)
|
||||
self.uiMap["game_setting_ui.bg.google_switch_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.CHANGE_ACCOUNT_DESC))
|
||||
end
|
||||
end
|
||||
|
||||
function GameSettingUI:initAppleLoginBtn()
|
||||
if Platform:isIosPlatform() then
|
||||
self.uiMap["game_setting_ui.bg.apple_sign_btn"]:setVisible(true)
|
||||
self.uiMap["game_setting_ui.bg.apple_sign_btn"]:addClickListener(function()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
return
|
||||
end
|
||||
ModuleManager.AccountManager:bindAccount()
|
||||
end)
|
||||
self.uiMap["game_setting_ui.bg.apple_switch_btn"]:setVisible(true)
|
||||
self.uiMap["game_setting_ui.bg.apple_switch_btn"]:addClickListener(function()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
ModuleManager.AccountManager:changeAccount()
|
||||
else
|
||||
local params = {
|
||||
content = I18N:getGlobalText(I18N.GlobalConst.CHANGE_ACCOUNT_TIPS_DESC),
|
||||
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
|
||||
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
||||
okFunc = function()
|
||||
ModuleManager.AccountManager:changeAccount()
|
||||
end
|
||||
}
|
||||
GFunc.showMessageBox(params)
|
||||
end
|
||||
end)
|
||||
self.uiMap["game_setting_ui.bg.apple_switch_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.CHANGE_ACCOUNT_DESC))
|
||||
else
|
||||
self.uiMap["game_setting_ui.bg.apple_sign_btn"]:setVisible(false)
|
||||
self.uiMap["game_setting_ui.bg.apple_switch_btn"]:setVisible(false)
|
||||
end
|
||||
end
|
||||
|
||||
function GameSettingUI:_addListeners()
|
||||
self.uiMap["game_setting_ui.bg.close_btn"]:addClickListener(function()
|
||||
self:closeUI()
|
||||
@ -149,10 +193,18 @@ function GameSettingUI:refreshVoice()
|
||||
end
|
||||
|
||||
function GameSettingUI:refreshAccountInfo()
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
self.uiMap["game_setting_ui.bg.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
if Platform:isIosPlatform() then
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
self.uiMap["game_setting_ui.bg.apple_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
else
|
||||
self.uiMap["game_setting_ui.bg.apple_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BIND_ACCOUNT_DESC))
|
||||
end
|
||||
else
|
||||
self.uiMap["game_setting_ui.bg.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BIND_ACCOUNT_DESC))
|
||||
if ModuleManager.AccountManager:getIsBinded() then
|
||||
self.uiMap["game_setting_ui.bg.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
||||
else
|
||||
self.uiMap["game_setting_ui.bg.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BIND_ACCOUNT_DESC))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user