【用户隐私协议】内容完善

dev_chengFeng
gaoxin 2021-10-25 13:53:44 +08:00
parent b30a5e09eb
commit ab20dc943c
3 changed files with 1407 additions and 8 deletions

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,16 @@ namespace GameLogic {
[SerializeField]
Text msg;
/// <summary>
/// 消息
/// </summary>
[SerializeField]
GameObject proto;
/// <summary>
/// 消息
/// </summary>
[SerializeField]
GameObject grant;
/// <summary>
/// title
/// </summary>
[SerializeField]
@ -53,11 +63,30 @@ namespace GameLogic {
/// 点击回调
/// </summary>
UnityAction<int> action;
/// <summary>
/// 隐私协议按钮
/// </summary>
[SerializeField]
Button[] protoButton;
[SerializeField]
Button[] privateButton;
protected void Awake()
{
buttonL.onClick.AddListener(LClickHandler);
buttonR.onClick.AddListener(RClickHandler);
buttonC.onClick.AddListener(CClickHandler);
foreach(Button b in protoButton)
{
b.onClick.AddListener(ProtoClickHandler);
}
foreach (Button b in privateButton)
{
b.onClick.AddListener(PrivateClickHandler);
}
title.text = SLanguageMoreLanguageMgr.Instance.GetLanguageChValBykey(more_language.TIPS);
}
@ -87,6 +116,20 @@ namespace GameLogic {
{
CallBack(2);
}
/// <summary>
/// 用户隐私协议按钮点击事件
/// </summary>
private void ProtoClickHandler()
{
SDK.SDKManager.Instance.OpenWeb("http://www.baidu.com");
}
/// <summary>
/// 用户隐私协议按钮点击事件
/// </summary>
private void PrivateClickHandler()
{
SDK.SDKManager.Instance.OpenWeb("http://www.baidu.com");
}
/// <summary>
/// 回调
@ -110,6 +153,9 @@ namespace GameLogic {
public void Show(string strL, string strR, string msg, UnityAction<int> action)
{
this.gameObject.SetActive(true);
this.msg.gameObject.SetActive(true);
this.proto.gameObject.SetActive(false);
this.grant.gameObject.SetActive(false);
this.buttonL.gameObject.SetActive(true);
this.buttonR.gameObject.SetActive(true);
this.buttonC.gameObject.SetActive(false);
@ -128,6 +174,9 @@ namespace GameLogic {
public void Show(string strc, string msg, UnityAction<int> action)
{
this.gameObject.SetActive(true);
this.msg.gameObject.SetActive(true);
this.proto.gameObject.SetActive(false);
this.grant.gameObject.SetActive(false);
this.buttonL.gameObject.SetActive(false);
this.buttonR.gameObject.SetActive(false);
this.buttonC.gameObject.SetActive(true);
@ -146,11 +195,54 @@ namespace GameLogic {
public void Show(string msg)
{
this.gameObject.SetActive(true);
this.msg.gameObject.SetActive(true);
this.proto.gameObject.SetActive(false);
this.grant.gameObject.SetActive(false);
this.buttonL.gameObject.SetActive(false);
this.buttonR.gameObject.SetActive(false);
this.buttonC.gameObject.SetActive(false);
this.msg.text = msg;
}
/// <summary>
/// 显示用户隐私协议
/// </summary>
/// <param name="strL"></param>
/// <param name="strR"></param>
/// <param name="msg"></param>
public void ShowProto(string strL, string strR, UnityAction<int> action)
{
this.gameObject.SetActive(true);
this.msg.gameObject.SetActive(false);
this.proto.gameObject.SetActive(true);
this.grant.gameObject.SetActive(false);
this.buttonL.gameObject.SetActive(true);
this.buttonR.gameObject.SetActive(true);
this.buttonC.gameObject.SetActive(false);
this.buttonLText.text = strL;
this.buttonRText.text = strR;
this.action = action;
}
/// <summary>
/// 显示权限申请
/// </summary>
/// <param name="strL"></param>
/// <param name="strR"></param>
/// <param name="msg"></param>
public void ShowGrant(string strC, UnityAction<int> action)
{
this.gameObject.SetActive(true);
this.msg.gameObject.SetActive(false);
this.proto.gameObject.SetActive(false);
this.grant.gameObject.SetActive(true);
this.buttonL.gameObject.SetActive(false);
this.buttonR.gameObject.SetActive(false);
this.buttonC.gameObject.SetActive(true);
this.buttonCText.text = strC;
this.action = action;
}
}
}

View File

@ -63,7 +63,8 @@ namespace GameLogic
Hashtable table = MiniJSON.jsonDecode(uwr.downloadHandler.text) as Hashtable;
// 判断是否需要用户隐私协议
string userAgree = table["UserAgree"] as string;
bool needUserAgree = userAgree == "1";
needUserAgree = userAgree == "1";
Debug.Log("是否需要用户隐私协议222" + needUserAgree);
// 背景图
string bgName = table["UpdatePanelBG"] as string;
string texPath = Application.streamingAssetsPath + "/Res/" + bgName + ".png";
@ -126,7 +127,8 @@ namespace GameLogic
private void TryGetUserAgree(Action a)
{
// 判断是否需要显示用户隐私界面
if(!needUserAgree)
Debug.Log("是否需要用户隐私协议:" + needUserAgree);
if (!needUserAgree)
{
if (a != null)
{
@ -136,6 +138,7 @@ namespace GameLogic
}
// 判断是否已经同意
bool isAgree = PlayerPrefs.GetInt("APP_IsAgreeUser", 0) == 1;
Debug.Log("判断是否已经同意:" + isAgree);
if (isAgree)
{
if (a != null)
@ -145,19 +148,22 @@ namespace GameLogic
return;
}
// 没同意则弹窗提示
msgBox.Show("拒绝", "同意", "这里是隐私协议的提示内容", (r1) =>
msgBox.ShowProto("不同意", "同意", (r1) =>
{
if (r1 == 1)
{
PlayerPrefs.SetInt("APP_IsAgreeUser", 1);
if (a != null)
msgBox.ShowGrant("确定", (result) =>
{
a();
}
PlayerPrefs.SetInt("APP_IsAgreeUser", 1);
if (a != null)
{
a();
}
});
}
else
{
msgBox.Show("退出游戏", "查看协议", "不同意你就不能玩儿哦", (r2) =>
msgBox.Show("退出游戏", "查看协议", "需要同意本隐私权政策才能继续游戏,若仍不同意本隐私权政策,很遗憾我们将无法为您提供服务。", (r2) =>
{
if (r2 == 1)
{