From 55fa84e7079b06de00a0f9d92ddc1c11c60bd562 Mon Sep 17 00:00:00 2001
From: Client_PangDeRong <593317293@qq.com>
Date: 星期二, 30 十月 2018 15:29:49 +0800
Subject: [PATCH] 4428 【前端】【1.2.0】社交按钮界面标签页选中逻辑优化

---
 System/FriendSystem/New/SocialModel.cs.meta |   12 ++++++
 System/FriendSystem/New/SocialModel.cs      |   57 ++++++++++++++++++++++++++++
 System/WindowBase/ModelCenter.cs            |    1 
 System/FriendSystem/New/SocialWin.cs        |   10 +++++
 4 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/System/FriendSystem/New/SocialModel.cs b/System/FriendSystem/New/SocialModel.cs
new file mode 100644
index 0000000..74f9ddd
--- /dev/null
+++ b/System/FriendSystem/New/SocialModel.cs
@@ -0,0 +1,57 @@
+锘縰sing System.Collections.Generic;
+
+namespace Snxxz.UI
+{
+    public class SocialModel : Model,IBeforePlayerDataInitialize,IPlayerLoginOk
+    {
+        FriendsModel friendsModel { get { return ModelCenter.Instance.GetModel<FriendsModel>(); } }
+
+        public override void Init()
+        {
+          
+        }
+
+        public void OnBeforePlayerDataInitialize()
+        {
+            selectType = SocialType.Union;
+        }
+
+        public void OnPlayerLoginOk()
+        {
+
+        }
+
+        public override void UnInit()
+        {
+          
+        }
+        public SocialType selectType { get; private set;}
+        public void SetDefaultSelectTitle()
+        {
+            if(friendsModel.redpointSocial.state != RedPointState.None)
+            {
+                selectType = SocialType.XianYuan;
+            }
+            else if(ChatCtrl.Inst.GetSocialChatRedpoint(ChatInfoType.Team) != RedPointState.None)
+            {
+                selectType = SocialType.Team;
+            }
+            else if (ChatCtrl.Inst.GetSocialChatRedpoint(ChatInfoType.Fairy) != RedPointState.None)
+            {
+                selectType = SocialType.Union;
+            }
+        }
+
+        public void UpdateSelectTitle(SocialType type)
+        {
+            selectType = type;
+        }
+        //涓巉unctionOrder瀵瑰簲
+        public enum SocialType
+        {
+            Union = 0, //浠欑洘
+            XianYuan = 1, //浠欑紭
+            Team = 2, //闃熶紞
+        }
+    }
+}
diff --git a/System/FriendSystem/New/SocialModel.cs.meta b/System/FriendSystem/New/SocialModel.cs.meta
new file mode 100644
index 0000000..8d23439
--- /dev/null
+++ b/System/FriendSystem/New/SocialModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: dc71c46225ba0ad48bb31bc4b4fee117
+timeCreated: 1540881971
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/FriendSystem/New/SocialWin.cs b/System/FriendSystem/New/SocialWin.cs
index 894f70d..111228d 100644
--- a/System/FriendSystem/New/SocialWin.cs
+++ b/System/FriendSystem/New/SocialWin.cs
@@ -14,6 +14,8 @@
         [SerializeField] GameObject friendTipsObj;
         [SerializeField] ChatSendComponent m_ChatSend;
 
+        SocialModel socialModel { get { return ModelCenter.Instance.GetModel<SocialModel>(); } }
+
         protected override void BindController()
         {
 
@@ -28,12 +30,17 @@
 
         protected override void OnPreOpen()
         {
+            socialModel.SetDefaultSelectTitle();
             m_ChatSend.parent = this;
         }
 
         protected override void OnActived()
         {
             base.OnActived();
+            if(!WindowJumpMgr.Instance.IsJumpState)
+            {
+                functionOrder = (int)socialModel.selectType;
+            }
             btnGroup.TriggerByOrder(functionOrder);
         }
 
@@ -57,6 +64,7 @@
 
         private void ClickXianYuanBtn()
         {
+            socialModel.UpdateSelectTitle(SocialModel.SocialType.XianYuan);
             CloseChild();
             friendTipsObj.SetActive(true);
             functionOrder = xianyuanBtn.order;
@@ -64,6 +72,7 @@
 
         private void TeamChat()
         {
+            socialModel.UpdateSelectTitle(SocialModel.SocialType.Team);
             CloseChild();
             WindowCenter.Instance.Open<TeamChatWin>();
             functionOrder = m_TeamChat.order;
@@ -71,6 +80,7 @@
 
         private void FairyChat()
         {
+            socialModel.UpdateSelectTitle(SocialModel.SocialType.Union);
             CloseChild();
             WindowCenter.Instance.Open<FairyChatWin>();
             functionOrder = m_FairyChat.order;
diff --git a/System/WindowBase/ModelCenter.cs b/System/WindowBase/ModelCenter.cs
index d160460..a38ebc3 100644
--- a/System/WindowBase/ModelCenter.cs
+++ b/System/WindowBase/ModelCenter.cs
@@ -201,6 +201,7 @@
             RegisterModel<FairyFeastModel>();
             RegisterModel<WishingPoolModel>();
             RegisterModel<RolePointModel>();
+            RegisterModel<SocialModel>();
             inited = true;
         }
 

--
Gitblit v1.8.0