--[[ 国服:用户协议界面 海外:隐私政策界面 ]] local UIUserAgreementPanel = UIViewClass() local LocalizationCfg = require "Localization/LocalizationCfg" function UIUserAgreementPanel:OnOpened() UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS.IDS_SDK_UserAgreement) if GameAppInfo.IsChinesePackage() then if SDKUtil.ChannelID == LuaConst.SDKChannelId.HuaWei then self.LoopVerticalScrollRect:AddData({ids="IDS_System_UserAgreement", url="https://www.hero.com/p/jws2_hwysxy.html"}, 0) else self.LoopVerticalScrollRect:AddData({ids="IDS_System_UserAgreement", url="https://www.hero.com/p/jws2_ysxy.html"}, 0) end self.LoopVerticalScrollRect:AddData({ids="IDS_System_UserAgreement_Child", url="https://www.hero.com/p/jws2_etxy.html"}, 0) self.LoopVerticalScrollRect:AddData({ids="IDS_SDK_UserAgreement", url="https://www.hero.com/p/yxyhxy.html"}, 0) if SDKUtil.ChannelID == LuaConst.SDKChannelId.XiaoMi then self.LoopVerticalScrollRect:AddData({ids="IDS_Privacy_Xiaomi", url="https://privacy.mi.com/xiaomigame-sdk/zh_CN/"}, 0) end elseif GameAppInfo.IsOverseaPackage() then if Localization.GetLanguage() == LocalizationCfg.LANGUAGE_SC_CHINA or Localization.GetLanguage() == LocalizationCfg.LANGUAGE_SC_WORLD then self.LoopVerticalScrollRect:AddData({ids="IDS_SDK_UserAgreement", url="https://www.newtypegames.com/privacy?lang=zh"}, 0) elseif Localization.GetLanguage() == LocalizationCfg.LANGUAGE_TRADITIONAL then self.LoopVerticalScrollRect:AddData({ids="IDS_SDK_UserAgreement", url="https://www.newtypegames.com/privacy?lang=zh-hmt"}, 0) else self.LoopVerticalScrollRect:AddData({ids="IDS_SDK_UserAgreement", url="https://www.newtypegames.com/privacy?lang=en"}, 0) end end end function UIUserAgreementPanel:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UIUserAgreementPanel:OnButtonClicked(comp) if comp == self.UICommonPopUp.btn_Close then self:CloseView() end end function UIUserAgreementPanel:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.LoopVerticalScrollRect then UIUtils.SetLabelText(cellTable.txt_Title, Const_IDS[data.ids]) end end function UIUserAgreementPanel:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.LoopVerticalScrollRect then if target == cellTable.btn_Confirm then SDKUtil.OpenPlatWebUrl(data.url, "") end end end return UIUserAgreementPanel