From 7167334c0e89dd84827d59e726123d14776e3a09 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 16 六月 2020 11:14:13 +0800
Subject: [PATCH] 2020-06-16-1

---
 HDL_ON/UI/Music/MusicMain.cs |   75 +++++++++++++++++++++++--------------
 1 files changed, 47 insertions(+), 28 deletions(-)

diff --git a/HDL_ON/UI/Music/MusicMain.cs b/HDL_ON/UI/Music/MusicMain.cs
index dff60b5..fd99774 100644
--- a/HDL_ON/UI/Music/MusicMain.cs
+++ b/HDL_ON/UI/Music/MusicMain.cs
@@ -45,7 +45,7 @@
         /// <summary>
         ///  鏄剧ず鍔犺浇鐣岄潰
         /// </summary>
-        public static Loading Loading = new Loading();
+        public static Loading loading = new Loading();
         VerticalRefreshLayout verticalRefresh;
 
         public void Show()
@@ -72,11 +72,10 @@
 
             verticalRefresh.BeginHeaderRefreshingAction += () =>
             {
-                SeachMusic();
-                verticalRefresh.EndHeaderRefreshing();
+                SeachMusic(false);
 
             };
-            this.AddChidren(Loading);
+            this.AddChidren(loading);
 
             if (A31MusicModel.A31MusicModelList.Count == 0)
             {
@@ -94,6 +93,14 @@
                     {
                         continue;
                     }
+                    if (A31MusicModel.A31MusicModelList.Count - 1 == i)
+                    {
+                        a31player.IsEnd = true;
+                    }
+                    else
+                    {
+                        a31player.IsEnd = false;
+                    }
                     ///鍔犺浇鐣岄潰鏃堕粯璁や笉鍦ㄧ嚎
                     ///杩欓噷鏍囪鏄负浜嗕笉璇诲彇涓嶅湪绾挎挱鏀惧櫒鐘舵��
                     a31player.IsOnLine = false;
@@ -107,7 +114,7 @@
                         if (obj == null)
                         {
                             ///杩欓噷瑕佽鍙栦富浠庡叧绯�
-                            //readServerOrClientMode();
+                            readServerOrClientMode();
                             A31MusicModel.Save();
                             return;
                         }
@@ -137,7 +144,7 @@
             if (Yes)
             {
                 //涓轰簡绗竴娆¤繘鏉og涓�涓�;
-                Loading.Start();
+                loading.Start();
             }
             SendMethod.Seach((obj) =>
             {
@@ -145,12 +152,17 @@
                 {
                     readServerOrClientMode();
                     A31MusicModel.Save();
+                    if (!Yes)
+                    {
+                        ///绛夊緟璺戝畬鍦ㄥ叧闂�
+                        verticalRefresh.EndHeaderRefreshing();
+                    }
                     Application.RunOnMainThread(() =>
                     {
                         if (Yes)
                         {
                             //涓轰簡绗竴娆¤繘鏉og涓�涓�;
-                            Loading.Hide();
+                            loading.Hide();
                         }
                         verticalRefresh.RemoveAll();
                         for (int i = 0; i < A31MusicModel.A31MusicModelList.Count; i++)
@@ -161,8 +173,17 @@
                             {
                                 continue;
                             }
+                            if (A31MusicModel.A31MusicModelList.Count - 1 == i)
+                            {
+                                a31player.IsEnd = true;
+                            }
+                            else
+                            {
+                                a31player.IsEnd = false;
+                            }
                             MusicListView(a31player);
                         }
+
                     });
                     return;
                 }
@@ -197,14 +218,22 @@
             musicView.View(verticalRefresh);
             musicView.singerBtn.Text = a31player.A31PlayStatus.Artist;
             musicView.songNameBtn.Text = a31player.A31PlayStatus.Title;
-            musicView.musicNameBtn.Text = a31player.Name;
+            musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(a31player);
             musicView.regionBtn.TextID = StringId.region;
-          
-
-
+            if (a31player.IsEnd) {
+                musicView.muiscFl.Height =Application.GetRealHeight(12 + 139 + 12);
+            }
             EventHandler<MouseEventArgs> clickMergence = (sender, e) =>
             {
-                new View.DialogView { }.PlayMergence();
+                if (a31player.ServerClientType == 0)
+                {
+                    new View.DialogView { }.PlayMergence();
+                }
+                else if (a31player.ServerClientType == 1)
+                {
+                    new View.DialogView { }.DetachPlayMergence(a31player);
+
+                }
             };
             musicView.mergeBjBtn.MouseUpEventHandler += clickMergence;
             musicView.mergeBtn.MouseUpEventHandler += clickMergence;
@@ -272,14 +301,7 @@
                     {
                         musicView.singerBtn.Text = a31player.A31PlayStatus.Artist;
                         musicView.songNameBtn.Text = a31player.A31PlayStatus.Title;
-                        if (a31player.ServerClientType == 1)
-                        {
-                            musicView.musicNameBtn.Text = a31player.MainPlayName;
-                        }
-                        else
-                        {
-                            musicView.musicNameBtn.Text = a31player.Name;
-                        }
+                        musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(a31player);
                         if (a31player.A31PlayStatus.status == "play")
                         {
                             musicView.playBtn.IsSelected = true;
@@ -312,11 +334,11 @@
                     {
                         a31player.ServerClientType = 0;
                         var result = SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:getSlaveList");
-                        if (result == null)
+                        if (result == null && result == "Failed")
                         {
                             result = SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:getSlaveList");
                         }
-                        if (result != null)
+                        if (result != null && result != "Failed")
                         {
                             a31player.Slave = Newtonsoft.Json.JsonConvert.DeserializeObject<Slaves>(result);
                         }
@@ -357,7 +379,7 @@
                                         UniqueDeviceName = slave.uuid.Replace("uuid:", ""),
                                         Name = slave.name,
                                         IsCanShow = false,
-                                        IsOnLine = false,
+                                        IsOnLine = false,//true浣滅敤涓轰簡璇诲彇浠庢挱鏀惧櫒鐨勯煶閲�
                                     });
                                 }
                                 //濡傛灉鎵惧埌灏辨洿鏂颁负浠庣殑
@@ -369,7 +391,7 @@
                                     tempA31Player.Name = slave.name;
                                     tempA31Player.UniqueDeviceName = slave.uuid.Replace("uuid:", "");
                                     tempA31Player.IsCanShow = false;
-                                    tempA31Player.IsOnLine = false;
+                                    tempA31Player.IsOnLine = false;//true浣滅敤涓轰簡璇诲彇浠庢挱鏀惧櫒鐨勯煶閲�
 
                                 }
                             }
@@ -383,10 +405,7 @@
                 }
 
             }
-            catch (Exception e)
-            {
-                var ss = e.Message;
-            }
+            catch { }
         }
 
     }

--
Gitblit v1.8.0