From 2c2e67caeec81d6b9272378be32be23a2ebf7b12 Mon Sep 17 00:00:00 2001 From: chenxi Date: Thu, 15 Jun 2023 16:25:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=9C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../game_setting/game_setting_manager.lua | 46 +++++++++++++++++++ lua/app/ui/game_setting/game_setting_ui.lua | 12 ++++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/lua/app/module/game_setting/game_setting_manager.lua b/lua/app/module/game_setting/game_setting_manager.lua index bad7126d..0a496aa9 100644 --- a/lua/app/module/game_setting/game_setting_manager.lua +++ b/lua/app/module/game_setting/game_setting_manager.lua @@ -36,4 +36,50 @@ function GameSettingManager:onExchangeCdkey(result) EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CDKEY_FINISH, result.status) end +function GameSettingManager:showSupport(objectId) + if not objectId then + objectId = DataManager.PlayerData:getAcountId() or "" + end + local url = "https://perfeggs.aihelp.net/webchatv3/#/appKey/perfeggs_app_b666f90daa2a40edab1e043f72869374/domain/perfeggs.aihelp.net/appId/perfeggs_platform_4f3578be7390d5e8264ddee5002e76ac/?mode=showAllFAQSections&showConversationMoment=1&conversationIntent=1&alwaysShowHumanSupportButtonInBotPage=true&sdkVersion=3.2.0" + local platform = "Android" + if Platform:isIosPlatform() then + platform = "IOS" + end + -- 繁体,日语和韩语跳对应的语言,其他语言跳英文 + local language = "&language=" + local currLanguage = I18N:getCurLanguage() + if currLanguage == GConst.LANGUAGE.CHINESE_TC then + language = language .. "zh-TW" + elseif currLanguage == GConst.LANGUAGE.CHINESE then + language = language .. "zh-CN" + elseif currLanguage == GConst.LANGUAGE.JAPANESE then + language = language .. "ja" + elseif currLanguage == GConst.LANGUAGE.KOREAN then + language = language .. "ko" + else + language = language .. "en" + end + local userId = string.format('&userId=%s', objectId) + -- local userName = string.format('&userName=%s', + -- DataManager.PlayerData:getName() -- 用户名 + -- ) + local applicationIdentifier = string.format('&applicationIdentifier=%s', Platform:getIdentifier()) + local applicationVersion = string.format('&applicationVersion=%s', Platform:getClientVersion()) + local applicationName = string.format('&applicationName=Knights Combo') + local deviceModel = string.format('&deviceModel=%s', DeviceHelper:getDeviceModel()) + local osVersion = string.format('&osVersion=%s',DeviceHelper:getOSVersion()) + local networkType = string.format('&networkType=%s',DeviceHelper:getNetworkType()) + local customData = string.format('&customData={"UserID":"%s","GameName":"Knights Combo","GameVersion":"%s","DeviceModel":"%s","Platform":"%s","OSversion":"%s","ApplicationIdentifier":"%s","NetworkType":"%s"}', + objectId, -- 用户名 + Platform:getClientVersion(), --应用版本 + DeviceHelper:getDeviceModel(), -- 机型 + platform, -- 安卓还是苹果 + DeviceHelper:getOSVersion(), -- OS 版本 + Platform:getIdentifier(), -- 应用包名 + DeviceHelper:getNetworkType() -- 网络类型 + ) + local tempStr = applicationIdentifier .. applicationVersion .. applicationName .. deviceModel .. osVersion .. networkType + GFunc.openUrl(CS.System.Uri(url .. language .. userId .. tempStr .. customData).AbsoluteUri) +end + return GameSettingManager \ No newline at end of file diff --git a/lua/app/ui/game_setting/game_setting_ui.lua b/lua/app/ui/game_setting/game_setting_ui.lua index d4c8f810..fdb5eecc 100644 --- a/lua/app/ui/game_setting/game_setting_ui.lua +++ b/lua/app/ui/game_setting/game_setting_ui.lua @@ -43,6 +43,7 @@ function GameSettingUI:_display() self:initLoginBtn() self:initCDKeyBtn() + self:initSupportBtn() self:refreshMusic() self:refreshVoice() end @@ -125,12 +126,21 @@ function GameSettingUI:initAppleLoginBtn() end function GameSettingUI:initCDKeyBtn() - self.uiMap["game_setting_ui.bg.cdkey_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.CDKEY_NAME)) + self.uiMap["game_setting_ui.bg.cdkey_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CDKEY_NAME)) + self.uiMap["game_setting_ui.bg.cdkey_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.CDKEY_EXCHANGE)) self.uiMap["game_setting_ui.bg.cdkey_btn"]:addClickListener(function() ModuleManager.GameSettingManager:showCDKeyUI() end) end +function GameSettingUI:initSupportBtn() + self.uiMap["game_setting_ui.bg.support_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUPPORT_DESC_1)) + self.uiMap["game_setting_ui.bg.support_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUPPORT_DESC_2)) + self.uiMap["game_setting_ui.bg.support_btn"]:addClickListener(function() + ModuleManager.GameSettingManager:showSupport() + end) +end + function GameSettingUI:_addListeners() self.uiMap["game_setting_ui.bg.close_btn"]:addClickListener(function() self:closeUI()