账号绑定的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.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.bg.content_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BIND_TIPS_DESC))
|
||||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn"]:addClickListener(function()
|
self:initBindBtn()
|
||||||
if ModuleManager.AccountManager:getIsBinded() then
|
|
||||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
|
||||||
return
|
|
||||||
end
|
|
||||||
ModuleManager.AccountManager:bindAccount()
|
|
||||||
end)
|
|
||||||
self.uiMap["account_bind_ui.close_btn"]:addClickListener(function()
|
self.uiMap["account_bind_ui.close_btn"]:addClickListener(function()
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
end)
|
end)
|
||||||
@ -30,11 +24,43 @@ function AccountBindUI:onLoadRootComplete()
|
|||||||
self:refreshAccountInfo()
|
self:refreshAccountInfo()
|
||||||
end
|
end
|
||||||
|
|
||||||
function AccountBindUI:refreshAccountInfo()
|
function AccountBindUI:initBindBtn()
|
||||||
if ModuleManager.AccountManager:getIsBinded() then
|
if Platform:isIosPlatform() then
|
||||||
self.uiMap["account_bind_ui.title_bg_img.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
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
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -47,31 +47,8 @@ function GameSettingUI:_display()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function GameSettingUI:initLoginBtn()
|
function GameSettingUI:initLoginBtn()
|
||||||
self.uiMap["game_setting_ui.bg.google_sign_btn"]:addClickListener(function()
|
self:initGoogleLoginBtn()
|
||||||
if ModuleManager.AccountManager:getIsBinded() then
|
self:initAppleLoginBtn()
|
||||||
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))
|
|
||||||
|
|
||||||
local deleteBtn = self.uiMap["game_setting_ui.bg.delete_btn"]
|
local deleteBtn = self.uiMap["game_setting_ui.bg.delete_btn"]
|
||||||
deleteBtn:addClickListener(function()
|
deleteBtn:addClickListener(function()
|
||||||
ModuleManager.AccountManager:showDeleteUI()
|
ModuleManager.AccountManager:showDeleteUI()
|
||||||
@ -79,6 +56,73 @@ function GameSettingUI:initLoginBtn()
|
|||||||
self:refreshAccountInfo()
|
self:refreshAccountInfo()
|
||||||
end
|
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()
|
function GameSettingUI:_addListeners()
|
||||||
self.uiMap["game_setting_ui.bg.close_btn"]:addClickListener(function()
|
self.uiMap["game_setting_ui.bg.close_btn"]:addClickListener(function()
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
@ -149,10 +193,18 @@ function GameSettingUI:refreshVoice()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function GameSettingUI:refreshAccountInfo()
|
function GameSettingUI:refreshAccountInfo()
|
||||||
if ModuleManager.AccountManager:getIsBinded() then
|
if Platform:isIosPlatform() then
|
||||||
self.uiMap["game_setting_ui.bg.google_sign_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_ALREADY_BINDED_DESC))
|
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
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user