From a974a2621a6dcb90b8fe52b23d075814873c0960 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 23 十月 2018 20:53:49 +0800
Subject: [PATCH] Merge branch 'master' into leonard

---
 System/Chat/ChatPlayerOtherCell.cs |   54 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/System/Chat/ChatPlayerOtherCell.cs b/System/Chat/ChatPlayerOtherCell.cs
index e68bb5e..2dfeb32 100644
--- a/System/Chat/ChatPlayerOtherCell.cs
+++ b/System/Chat/ChatPlayerOtherCell.cs
@@ -8,11 +8,13 @@
 
 public class ChatPlayerOtherCell : ScrollerUI
 {
-    [SerializeField] Image chatIcon;
-    [SerializeField] Text vipText;
-    [SerializeField] Text playerNameText;
-    [SerializeField] RectTransform bubbleRt;
-    [SerializeField] RichText chatText;
+    [SerializeField] Image m_ChatIcon;
+    [SerializeField] Text m_VipLv;
+    [SerializeField] Text m_PlayerName;
+    [SerializeField] Text m_ChatTime;
+    [SerializeField] RectTransform m_Bottom;
+    [SerializeField] RichText m_Chat;
+    [SerializeField] Button m_Func;
 
     ChatCenter m_ChatCenter;
     ChatCenter chatCenter
@@ -24,45 +26,48 @@
     }
     public override void Refresh(CellView cell)
     {
-        ChatData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index);
-        if (_data == null)
+        var data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index);
+        if (data == null)
         {
             return;
         }
+
         #region 鏇存柊楂樺害
         if (type == ScrollerDataType.Header)
         {
-            if (chatText.preferredWidth > chatText.rectTransform.rect.width)
+            if (m_Chat.preferredWidth > m_Chat.rectTransform.rect.width)
             {
-                chatText.alignment = TextAnchor.UpperLeft;
+                m_Chat.alignment = TextAnchor.UpperLeft;
             }
             else
             {
-                chatText.alignment = TextAnchor.UpperRight;
+                m_Chat.alignment = TextAnchor.UpperRight;
             }
         }
         #endregion
-        Button headBtn = chatIcon.GetComponent<Button>();
-        headBtn.onClick.RemoveAllListeners();
-        headBtn.onClick.AddListener(() =>
+
+        var chatUserData = data as ChatUeseData;
+        m_Func.onClick.RemoveAllListeners();
+        m_Func.onClick.AddListener(() =>
         {
-            OnHeadIconClick(cell);
+            OnFunc(cell);
         });
-        chatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait((_data as ChatUeseData).job, 0));
-        playerNameText.text = (_data as ChatUeseData).name;
-        if ((_data as ChatUeseData).vipLv > 0)
+        m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(chatUserData.job, 0));
+        m_PlayerName.text = chatUserData.name;
+        m_ChatTime.text = data.createTime.ToString("yyyy-MM-dd HH:mm");
+        if (chatUserData.vipLv > 0)
         {
-            vipText.text = string.Format("V{0}", (_data as ChatUeseData).vipLv);
+            m_VipLv.text = string.Format("V{0}", chatUserData.vipLv);
         }
         else
         {
-            vipText.text = string.Empty;
+            m_VipLv.text = string.Empty;
         }
-        chatText.AutoNewLine = true;
-        chatText.text = _data.content;
+        m_Chat.AutoNewLine = true;
+        m_Chat.text = data.content;
     }
 
-    private void OnHeadIconClick(CellView cell)
+    private void OnFunc(CellView cell)
     {
         int index = cell.index;
         ChatData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, index);
@@ -71,7 +76,10 @@
             return;
         }
         ChatUeseData user = _data as ChatUeseData;
-        if (user.player == PlayerDatas.Instance.baseData.PlayerID) return;
+        if (user.player == PlayerDatas.Instance.baseData.PlayerID)
+        {
+            return;
+        }
         HrefAnalysis.Inst.ExcuteHrefEvent(string.Format("showplayer={0}", user.player));
     }
 }

--
Gitblit v1.8.0