From ac9a9ea595168753cc45dff7f4eb9843beb2b0ca Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期五, 11 八月 2023 19:40:56 +0800 Subject: [PATCH] 2023年08月11日19:40:20 --- HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs | 165 ++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 114 insertions(+), 51 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs index 663707f..86a8cdb 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs @@ -1,15 +1,10 @@ 锘縰sing Shared; -using System; using System.Collections.Generic; -using System.Text; -using HDL_ON.UI.CSS; -using HDL_ON.Entity; -using HDL_ON.DriverLayer; using HDL_ON.UI.Music; -using HDL_ON.UI.UI2.Intelligence.Automation; -using System.Linq; using HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView; using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock; +using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity; + namespace HDL_ON.UI.UI2.FuntionControlView.Aks { /// <summary> @@ -17,88 +12,156 @@ /// </summary> public class CollectPage : FrameLayout { - public CollectPage() + public CollectPage(RemoteControlEntity remoteControlEntity) { + this.remoteControl = remoteControlEntity; + //璇荤紦瀛樻暟鎹� + this.mMovieLibraryList.AddRange(AksCommonMethod.Current.CollectList); } - - + /// <summary> + /// 褰辩墖鍒楄〃 + /// </summary> + private List<MovieLibrary> mMovieLibraryList; + /// <summary> + /// 褰撳墠鐨勯仴鎺у櫒瀵硅薄 + /// </summary> + RemoteControlEntity remoteControl; + /// <summary> + /// 褰辩墖鍒楄〃涓婁笅婊戝姩瀹瑰櫒 + /// </summary> + VerticalRefreshLayout vv; + /// <summary> + /// 褰辩墖瀹瑰櫒 + /// </summary> + CornerFramLayout imageFLayout; /// <summary> /// 澶撮儴甯冨眬 /// </summary> private TopView topView; /// <summary> - /// 鍒犻櫎璁惧鍚庨渶瑕佹洿鏂扮晫闈㈢殑鍥炶皟 + /// 褰撳墠椤垫暟 /// </summary> - public Action action; + private int pageNo=1; + + public void Show() { //鍒濆鍖朥I - this.InitTop(); + this.InitUi(); this.InitMiddle(); - //鍒濆鍖栦簨浠� - this.EventListener(); //璇诲彇鏁版嵁 + ReadData(); } /// <summary> /// 鍒濆鍖栧ご閮ㄧ晫闈� /// </summary> - private void InitTop() + private void InitUi() { this.BackgroundColor = MusicColor.ViewColor; this.topView = new TopView(); this.topView.setBtn.Visible = false; //this.topView.topNameBtn.TextID = StringId.shanchushebei; this.topView.topNameBtn.Text ="鎴戠殑鏀惰棌"; - this.AddChidren(topView.TopFLayoutView()); - } - /// <summary> - /// 鍒濆鍖栦腑閮ㄧ晫闈� - /// </summary> - private void InitMiddle() - { - - var vv = new VerticalRefreshLayout + vv = new VerticalRefreshLayout { Y = topView.fLayout.Bottom, Height = Application.GetRealHeight(H_W.H - H_W.T_Height), BackgroundColor = MusicColor.WhiteColor, }; this.AddChidren(vv); - vv.BeginHeaderRefreshingAction += () => - { - //鍏抽棴鍒锋柊View锛� - vv.EndHeaderRefreshing(); - }; - CornerFramLayout imageFLayout = new CornerFramLayout(343, 20 * 168, 0); - vv.AddChidren(imageFLayout); - imageFLayout.X = Application.GetRealWidth(16); - imageFLayout.LoadImagePage(new List<Entity.MovieLibrary>()); - imageFLayout.selectAction += (index) => - { - CommonMethod.Current.MainThread(() => - { - DetailPage detailPage = new DetailPage(); - MainPage.BasePageView.AddChidren(detailPage); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - detailPage.Show(); - }); - }; - imageFLayout.AdjustRealHeight(16); - } - /// <summary> - /// 娉ㄥ唽浜嬩欢 - /// </summary> - private void EventListener() - { //杩斿洖 this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); }; + } + /// <summary> + /// 鍒濆鍖栦腑閮ㄧ晫闈� + /// </summary> + private void InitMiddle() + { + if (vv == null) + { + return; + } + 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.AdjustRealHeight(16); + + vv.BeginHeaderRefreshingAction += () => + { + //鍏抽棴鍒锋柊View锛� + vv.EndHeaderRefreshing(); + mMovieLibraryList.Clear(); + ReadData(); + }; + imageFLayout.selectImageAction += (movieLibrary) => + { + CommonMethod.Current.MainThread(() => + { + DetailPage detailPage = new DetailPage(remoteControl, movieLibrary); + MainPage.BasePageView.AddChidren(detailPage); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + detailPage.Show(); + detailPage.action += (isUpdate) => + { + if (isUpdate) + { + this.mMovieLibraryList = AksCommonMethod.Current.CollectList; + InitMiddle(); + } + }; + }); + }; + + } + + /// <summary> + /// 鍒濆鏁版嵁 + /// </summary> + private void ReadData() + { + if (mMovieLibraryList.Count > 0) + { + CommonMethod.Current.MainThread(() => + { + //鏈夌紦瀛樻暟鎹洿鎺ュ姞杞� + InitMiddle(); + }); + return; + } + CommonMethod.Current.Loading.Start(); + CommonMethod.Current.SunThread(() => + { + try + { + this.mMovieLibraryList = SendMethod.Current.GetcollectPage(this.remoteControl.deviceId, this.remoteControl.rcId, pageNo, SendMethod.pageSize); + for (int i = 0; i < this.mMovieLibraryList.Count; i++) + { + var mMovieLibrary = this.mMovieLibraryList[i]; + var bytes = SendMethod.Current.GetImage(mMovieLibrary.posterUrl); + mMovieLibrary.imageBytes = bytes; + } + } + catch { } + finally + { + CommonMethod.Current.MainThread(() => + { + CommonMethod.Current.Loading.Hide(); + InitMiddle(); + + }); + } + }); } -- Gitblit v1.8.0