少年修仙传客户端代码仓库
client_Hale
2019-04-13 d4b5806a57e4e88a1fc57dd95f17e185f33e4e43
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, March 14, 2018
//--------------------------------------------------------
 
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using LitJson;
 
namespace Snxxz.UI
{
 
    public class IDAuthenticationWin : Window
    {
        [SerializeField] InputField m_UserName;
        [SerializeField] InputField m_IdentityNumber;
 
        [SerializeField] Button m_Authentication;
 
        #region Built-in
        protected override void BindController()
        {
        }
 
        protected override void AddListeners()
        {
            m_Authentication.AddListener(Authentication);
        }
 
        protected override void OnPreOpen()
        {
        }
 
        protected override void OnAfterOpen()
        {
            SDKUtility.Instance.onFreePlatfromDoIDAuthenticationOk += OnAuthenticationOk;
        }
 
        protected override void OnPreClose()
        {
            SDKUtility.Instance.onFreePlatfromDoIDAuthenticationOk -= OnAuthenticationOk;
        }
 
        protected override void OnAfterClose()
        {
        }
 
        #endregion
 
        private void Authentication()
        {
            if (string.IsNullOrEmpty(m_UserName.text))
            {
                ServerTipDetails.DisplayNormalTip(Language.Get("UserName_Z"));
                return;
            }
 
            var userName = m_UserName.text;
 
            if (string.IsNullOrEmpty(m_IdentityNumber.text))
            {
                ServerTipDetails.DisplayNormalTip(Language.Get("IdentityNumber_Z"));
                return;
            }
 
            var identityNumber = m_IdentityNumber.text;
            if (identityNumber.Length != 15 && identityNumber.Length != 18)
            {
                ServerTipDetails.DisplayNormalTip(Language.Get("IdentityNumber_Z1"));
                return;
            }
 
            var account = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
            SDKUtility.Instance.FreePlatformDoIDAuthentication(account, userName, identityNumber);
        }
 
        private void OnAuthenticationOk(SDKUtility.FP_DoIDAuthentication _result)
        {
            ServerTipDetails.DisplayNormalTip(_result.errordesc);
 
            if (_result.errorcode == "1")
            {
                var send = new CA103_tagCMAdult();
                send.Adult = MathUtility.CheckAdult(_result.card_id) ? (byte)1 : (byte)0;
                GameNetSystem.Instance.SendInfo(send);
 
                var account = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
                SDKUtility.Instance.FreePlatformCheckIDAuthentication(account);
 
                CloseClick();
            }
        }
 
 
    }
 
}