【用户隐私协议】提交

dev_chengFeng
ZhangBiao 2021-06-24 11:38:43 +08:00
parent 57426134aa
commit 6c5d6a4be4
3 changed files with 816 additions and 321 deletions

File diff suppressed because it is too large Load Diff

View File

@ -112,12 +112,12 @@ function PackageManager.SetVideo(obj, bg)
obj:SetActive(true)
end
else
LogError("视频加载失败:"..this.config.VideoName)
Log("视频加载失败:"..this.config.VideoName)
end
end)
end
else
LogError("包名:"..tostring(this.config.PackageName).."登录视频为空!")
Log("包名:"..tostring(this.config.PackageName).."登录视频为空!")
end
end
end

View File

@ -26,8 +26,8 @@ local orginLayer
local timeStamp = Time.realtimeSinceStartup
local timeSign = Util.MD5Encrypt(string.format("%s%s", timeStamp, LoginManager.sign))
local instructionsUrl = "instructionsUrl"
local privacyUrl = "privacyUrl"
local UrlList = {}
local HaveConfirm = false
--初始化组件(用于子类重写)
function this:InitComponent()
@ -92,7 +92,7 @@ function this:InitComponent()
this.healthTip:SetActive(IS_SHOW_HEALTH_TIP)
this.bh = Util.GetGameObject(this.gameObject, "healthTip/bh"):GetComponent("Text")
local bhContent = PackageManager.GetBHContent()
LogError(tostring(bhContent))
-- LogError(tostring(bhContent))
if bhContent then
this.bh.text = bhContent
else
@ -102,8 +102,11 @@ function this:InitComponent()
this.video = Util.GetGameObject(this.gameObject, "VideoPlayer")
--用户隐私协议
this.protos = Util.GetGameObject(this.gameObject, "protos")
this.instructionsBtn = Util.GetGameObject(this.gameObject, "protos/instructionsBtn")
this.privacyBtn = Util.GetGameObject(this.gameObject, "protos/privacyBtn")
this.ConfirmBtn = Util.GetGameObject(this.gameObject, "protos/Confirm")
this.ConfirmImg = Util.GetGameObject(this.ConfirmBtn, "gou")
end
--绑定事件(用于子类重写)
@ -165,10 +168,20 @@ function this:BindEvent()
--用户隐私协议
Util.AddClick(this.instructionsBtn, function()
SDKMgr:OpenWeb(instructionsUrl)
SDKMgr:OpenWeb(UrlList[1])
end)
Util.AddClick(this.privacyBtn, function()
SDKMgr:OpenWeb(privacyUrl)
SDKMgr:OpenWeb(UrlList[2])
end)
Util.AddClick(this.ConfirmBtn, function()
local confirm = PlayerPrefs.GetInt("IHaveConfirmProtos")
if confirm == 0 then
this.ConfirmImg:SetActive(true)
PlayerPrefs.SetInt("IHaveConfirmProtos",1)
elseif confirm == 1 then
this.ConfirmImg:SetActive(false)
PlayerPrefs.SetInt("IHaveConfirmProtos",0)
end
end)
end
@ -270,7 +283,7 @@ function this:OnOpen(...)
-- 获取服务器列表
this.RequestServerList(userId, this.OnReceiveServerList)
end
local tran = this.tip:GetComponent("RectTransform")
--LayoutUtility.GetPreferredWidth(tran)
local offsetX = (GetPreferredWidth(tran) + Screen.width) / 2
@ -299,14 +312,6 @@ function this.ShowNotice()
networkMgr:SendGetHttp(LoginRoot_Url .. "jl_loginserver/getNotice?timestamp="..timeStamp.."&sign=".. timeSign.."&packageName="..LoginRoot_NoticeChannel,function (str)
UIManager.OpenPanel(UIName.NoticePopup,str)
end, nil, nil, nil)
--获取用户隐私协议
networkMgr:SendGetHttp("http://60.1.1.232:8083/jl_loginserver/getAgreement?gamePack=com.jieling.server",function (str)
local json = require 'cjson'
local data = json.decode(str)
instructionsUrl = data.parms.instructions
privacyUrl = data.parms.privacy
end, nil, nil, nil)
end
-- 请求获取服务器列表
@ -317,8 +322,40 @@ function this.RequestServerList(userId, callback)
LoginRoot_Url, userId, LoginRoot_Channel, LoginRoot_SubChannel, ServerVersion)
Log(url)
networkMgr:SendGetHttp(url, callback, nil, nil, nil)
--用户协议,隐私政策
this.RequestProtos(userId)
end
--获取用户隐私协议
function this.RequestProtos(userId)
this.protos:SetActive(false)
this.ConfirmImg:SetActive(PlayerPrefs.GetInt("IHaveConfirmProtos") == 1)
UrlList[1] = ""
UrlList[2] = ""
networkMgr:SendGetHttp(LoginRoot_Url.."jl_loginserver/getAgreement?gamePack=com.jieling.server", function (str)
local json = require 'cjson'
local data = json.decode(str)
if data.parms then
UrlList[1] = data.parms.instructions
UrlList[2] = data.parms.privacy
Log("instructionsUrl:"..tostring(UrlList[1]).." privacyUrl:"..tostring(UrlList[2]))
HaveConfirm = true
else
this.protos:SetActive(false)
Log("用户和隐私协议地址为空")
HaveConfirm = false
return
end
if UrlList[1] ~= "" and UrlList[2] ~="" then
this.protos:SetActive(true)
HaveConfirm = true
else
this.protos:SetActive(false)
HaveConfirm = false
end
end, nil, nil, nil)
end
--界面销毁时调用(用于子类重写)
function this:OnDestroy()
@ -583,6 +620,10 @@ end
this.isLoginClick = false
function this.OnLoginClick()
if HaveConfirm and PlayerPrefs.GetInt("IHaveConfirmProtos") == 0 then
PopupTipPanel.ShowTip("为了保证您的个人隐私和隐私安全,请详细阅读并同意用户协议及隐私政策")
return
end
if LoginManager.state == 0 or LoginManager.state == 1 then
local function reServerCallback(str)
if str == nil then