From 3f6685c77beeb12baf840733fb890860f4c26e7c Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 25 七月 2024 17:25:59 +0800
Subject: [PATCH] 2024年07月25日17:24:45

---
 HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs |  103 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 90 insertions(+), 13 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs
index d7406b4..3e82841 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs
@@ -24,6 +24,8 @@
         {
             this.remoteControl = remoteControlEntity;
         }
+
+        List<ImageFramlayout> imageFramlayoutList =new List<ImageFramlayout>();
         /// <summary>
         /// 褰撳墠鐨勯仴鎺у櫒瀵硅薄
         /// </summary>
@@ -76,7 +78,7 @@
             this.topView.setBtn.Visible = true;
             this.topView.setBtn.Width = Application.GetMinRealAverage(32);
             this.topView.setBtn.Height = Application.GetMinRealAverage(32);
-            this.topView.setBtn.UnSelectedImagePath = "Collection/CollectionGrayIcon.png";
+            this.topView.setBtn.UnSelectedImagePath = "AksIcon/like.png";
             this.topView.topNameBtn.TextID = StringId.yingku;
             this.AddChidren(topView.TopFLayoutView());
             fLayout = new FrameLayout
@@ -93,7 +95,7 @@
             {
                 this.RemoveFromParent();
             };
-            //鏀惰棌鐐瑰嚮浜嬩欢
+            //鏀惰棌鍥炬爣鐐瑰嚮浜嬩欢
             this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) =>
             {
                 CommonMethod.Current.MainThread(() =>
@@ -128,8 +130,9 @@
             //浜岀骇杩囨护浜嬩欢
             horizontalFl.selectKeyAction += (filters) =>
             {
+                pageNo = 1;//杩樺師椤垫暟
                 AddMemoryFilters(filters);
-                UpdateData();
+                UpdateData(true);
             };
 
         }
@@ -142,16 +145,38 @@
             {
                 return;
             }
-            vv.RemoveAll();
+            vv.RemoveAll(); 
             int count = this.mMovieLibraryList == null ? 0 : this.mMovieLibraryList.Count;
             imageFLayout = new CornerFramLayout(343, count * 168, 0);
             vv.AddChidren(imageFLayout);
             imageFLayout.X = Application.GetRealWidth(16);
-            imageFLayout.LoadImagePage(this.mMovieLibraryList);
+            //imageFLayout.LoadImagePage(this.mMovieLibraryList);
+            imageFLayout.LoadImagePage(imageFramlayoutList);
             imageFLayout.AdjustRealHeight(16);
+
+
+            //鏇村鐨�
+            var btnMore = new Button
+            {
+                Width = Application.GetRealWidth(375),
+                Height = Application.GetRealHeight(30),
+                TextSize = TextSize.Text14,
+                TextColor = MusicColor.TextColor,
+                TextID = StringId.LoadMore,
+                TextAlignment = TextAlignment.TopCenter,
+                Padding = new Padding(0, 20, 0, 20),
+            };
+            vv.AddChidren(btnMore);
+
+            btnMore.MouseDownEventHandler += (sender,e) => {
+                //涓诲姩鏇存柊鏁版嵁
+                UpdateData(false);
+            };
+          
             //褰辩墖浜嬩欢
             imageFLayout.selectImageAction += (movieLibrary) =>
             {
+                
                 CommonMethod.Current.MainThread(() =>
                 {
                     DetailPage detailPage = new DetailPage(remoteControl, movieLibrary);
@@ -166,9 +191,41 @@
             {
                 //鍏抽棴鍒锋柊View锛�
                 vv.EndHeaderRefreshing();
-                UpdateData();
+                //涓诲姩鏇存柊鏁版嵁
+                //UpdateData();
             };
+
+         
+          
         }
+
+
+
+
+
+        /// <summary>
+        /// 鍔犺浇鍥剧墖瀹瑰櫒
+        /// </summary>
+        /// <param name="movieLibrary">movieLibrary</param>
+        private void AddImageFramlayout(MovieLibrary movieLibrary)
+        {
+            CommonMethod.Current.MainThread(() =>
+            {
+                if (movieLibrary == null)
+                {
+                    return;
+                }
+                ImageFramlayout imageFram = new ImageFramlayout();
+                //imageFram.AddView(this);
+                imageFram.Tag = movieLibrary;
+                imageFram.btnName.Text = movieLibrary.name;
+                imageFram.btnImage.ImageBytes = movieLibrary.imageBytes;
+                imageFram.btnScore.Text = movieLibrary.rating;
+                //娣诲姞缂撳瓨
+                imageFramlayoutList.Add(imageFram);
+            });
+        }
+
 
         /// <summary>
         /// 鍒濆鍖栨暟鎹�
@@ -202,7 +259,8 @@
         /// <summary>
         /// 涓诲姩鏇存柊鏁版嵁
         /// </summary>
-        private void UpdateData()
+        /// <param name="isUpdateData">鏄惁鏄簩绾ц繃婊�,true琛ㄧず鏄簩绾ц繃婊よ繃鏉ョ殑</param>
+        private void UpdateData(bool isUpdateData)
         {
 
             CommonMethod.Current.Loading.Start();
@@ -219,7 +277,18 @@
                     CommonMethod.Current.MainThread(() =>
                     {
                         CommonMethod.Current.Loading.Hide();
-                        this.LoadImageFLayout();
+                        if (isUpdateData)
+                        {
+                            //娓呯┖鎵�鏈夋棫褰辩墖鏁版嵁,閲嶆柊鍔犺浇鏂板奖鐗囨暟鎹�
+                            this.LoadImageFLayout();
+                        }
+                        else
+                        {
+                            //杩藉姞鏂版暟鎹湪鏃ф暟鎹悗闈�
+                            imageFLayout.LoadImagePage(imageFramlayoutList);
+                            imageFLayout.AdjustRealHeight(16);
+                        }
+
                     });
                 }
             });
@@ -227,15 +296,18 @@
         }
 
         /// <summary>
-        /// 椤甸潰鏁版嵁澶勭悊閫昏緫
+        /// 鏁版嵁澶勭悊閫昏緫
         /// </summary>
         /// <param name="newList">鏂板垪琛ㄦ暟鎹�</param>
         private void DataTreating(List<MovieLibrary> newList)
         {
-            if (newList == null)
+            if (newList == null || newList.Count == 0)
             {
                 return;
             }
+            //鏈夋柊鏁版嵁锛屾竻绌烘棫鏁版嵁
+            imageFramlayoutList.Clear();
+
             for (int i = 0; i < newList.Count; i++)
             {
                 var mMovieLibrary = newList[i];
@@ -245,19 +317,25 @@
                 mMovieLibrary.imageBytes = bytes;
 
             }
+          
             for (int i = 0; i < newList.Count; i++)
             {
                 //鍘婚噸
                 var mMovieLibrary = this.mMovieLibraryList.Find((o) => o.movieId == newList[i].movieId);
                 if (mMovieLibrary == null)
                 {
-                    //鏂板垪琛ㄩ粯璁ゅ姞鍦ㄥ墠闈�
+                    //鏂板垪琛ㄩ粯璁ゅ姞鍦ㄦ渶鍓嶉潰
                     this.mMovieLibraryList.Insert(0, newList[i]);
+
                 }
+                //娣诲姞鍥剧墖瀹瑰櫒
+                AddImageFramlayout(newList[i]);
+
             }
+
             if (newList.Count == SendMethod.pageSize)
             {
-                //鏁版嵁鍥炲鏇存柊椤垫暟
+                //鏇存柊椤垫暟
                 pageNo++;
             }
 
@@ -270,7 +348,6 @@
         /// <param name="filters">杩囨护鏉′欢</param>
         private void AddMemoryFilters(Filters filters)
         {
-
             if (FiltersList.ContainsKey(filters.category))
             {
                 FiltersList.Remove(filters.category);

--
Gitblit v1.8.0