Quellcode durchsuchen

绑定手机号提交

zhangyuqian vor 11 Monaten
Ursprung
Commit
f679334342

+ 12 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/RoleInfoSProxy.cs

@@ -284,5 +284,17 @@ namespace GFGGame
             MainDataManager.Instance.CardBgID = 0;
             return true;
         }
+        //绑定获取验证码
+        public static async ETTask<bool> GetMobileVerification(string phoneNumber)
+        {
+            S2C_GetMobileVerificationCodeUnit response = (S2C_GetMobileVerificationCodeUnit)await MessageHelper.SendToServer(new C2S_GetMobileVerificationCodeUnit() { PhoneNumber = phoneNumber});
+            return true;
+        }
+        //绑定手机
+        public static async ETTask<bool> BindMobilePhoneNumber(string phoneNumber,string code)
+        {
+            S2C_BindMobilePhoneNumber response = (S2C_BindMobilePhoneNumber)await MessageHelper.SendToServer(new C2S_BindMobilePhoneNumber() { PhoneNumber = phoneNumber ,VerCode = code});
+            return true;
+        }
     }
 }

+ 28 - 4
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/PhoneBindingView.cs

@@ -48,6 +48,8 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+            _ui.m_inputPhoneNumber.text = "";
+            _ui.m_inputName.text = "";
         }
 
         protected override void OnHide()
@@ -55,14 +57,36 @@ namespace GFGGame
             base.OnHide();
         }
 
-        private void OnBtnSureClick()
+        private async void OnBtnSureClick()
         {
-            Hide();
+            bool result = await RoleInfoSProxy.BindMobilePhoneNumber(_ui.m_inputPhoneNumber.text ,_ui.m_inputName.text);
+            if(result)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("绑定成功!");
+                Hide();
+            }
+            else
+            {
+                PromptController.Instance.ShowFloatTextPrompt("绑定失败!");
+            }   
         }
 
-        private void OnBtnGetCode()
+        private  async void OnBtnGetCode()
         {
-
+            if(_ui.m_inputPhoneNumber.text == null || _ui.m_inputPhoneNumber.text== "")
+            {
+                PromptController.Instance.ShowFloatTextPrompt("麻烦输入手机号码!");
+                return;
+            }
+            bool result = await RoleInfoSProxy.GetMobileVerification(_ui.m_inputPhoneNumber.text);
+            if (result)
+            {
+                //PromptController.Instance.ShowFloatTextPrompt("获取成功!");
+            }
+            else
+            {
+                //PromptController.Instance.ShowFloatTextPrompt("获取失败!麻烦输入正确的手机号码!");
+            }
         }
 
         private void AddEffect()

BIN
GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_fui.bytes