From ce646aa99af43539ac865977f0177f9d97d596a5 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期一, 21 十二月 2020 14:36:20 +0800 Subject: [PATCH] 2020-12-21 1.功能介绍列表拉取 --- HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FunctionIntroductionPage.cs | 179 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 145 insertions(+), 34 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FunctionIntroductionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FunctionIntroductionPage.cs old mode 100755 new mode 100644 index c0eccff..c82d7af --- a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FunctionIntroductionPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FunctionIntroductionPage.cs @@ -2,6 +2,8 @@ using Shared; using HDL_ON.UI.CSS; using System.Collections.Generic; +using System.Threading; +using HDL_ON.DAL.Server; namespace HDL_ON.UI { @@ -22,13 +24,23 @@ /// <summary> /// 鍐呭涓虹┖鎻愮ずView /// </summary> - EmptyTipView emptyTipView; + FrameLayout emptyTipView; + /// <summary> + /// 鍔熻兘浠嬬粛List + /// </summary> + List<APPFunctionURLInfo> functionURLInfoList = new List<APPFunctionURLInfo>(); + /// <summary> + /// + /// </summary> public FunctionIntroductionPage() { bodyView = this; } + /// <summary> + /// + /// </summary> public void LoadPage() { new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionIntroduced)).LoadTopView(); @@ -42,9 +54,9 @@ }; bodyView.AddChidren(bodyScrolView); - AddEmptyTipView(); - - //TestLoad(); + //AddEmptyTipView(); + // + GetFunctionIntroductionList(); } /// <summary> @@ -52,15 +64,22 @@ /// </summary> void AddEmptyTipView() { - emptyTipView = new EmptyTipView() + emptyTipView = new FrameLayout() + { + Height = bodyScrolView.Height, + Width = bodyScrolView.Width, + }; + bodyScrolView.AddChidren(emptyTipView); + + var tipView = new EmptyTipView() { Gravity = Gravity.Center }; - bodyView.AddChidren(emptyTipView); + emptyTipView.AddChidren(tipView); } /// <summary> - /// 鍔犺浇鍖哄煙閫夋嫨RowView + /// 鍔犺浇鍔熻兘浠嬬粛鍒楄〃鏌ヨ /// </summary> /// <param name="VerticalScrolViewMiddle"></param> void AddRowView(VerticalScrolViewLayout VerticalScrolViewMiddle, APPFunctionURLInfo functionInfo) @@ -95,7 +114,7 @@ TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, - Text = functionInfo.CreateTime + //Text = functionInfo.CreateTime }; rowView.AddChidren(btnSubtitle); @@ -122,42 +141,134 @@ btnTilte.MouseUpEventHandler = eventHandler; btnSubtitle.MouseUpEventHandler = eventHandler; btnGo.MouseUpEventHandler = eventHandler; + + if (Language.CurrentLanguage == "Chinese") + { + btnSubtitle.Text = Utlis.UnixToDateTimeWithFormatMS(functionInfo.CreateTime, "MM鏈坉d鏃�"); + } + else + { + btnSubtitle.Text = Utlis.UnixToDateTimeWithFormatMS(functionInfo.CreateTime, "MM/dd"); + } + } - #region 娴嬭瘯 - List<APPFunctionURLInfo> list = new List<APPFunctionURLInfo>(); /// <summary> - /// + /// 鍔熻兘浠嬬粛鍒楄〃鏌ヨ /// </summary> - void TestLoad() + void GetFunctionIntroductionList() { - list.Add(new APPFunctionURLInfo() + bodyScrolView.RemoveAll(); + if (functionURLInfoList == null) { - Title = "HDL ON PRO 1.0.10 涓昏鏇存柊", - CreateTime = "11鏈�26", - Url = Constant.URL_PRIVACYPOLICY, - }); - - list.Add(new APPFunctionURLInfo() + functionURLInfoList = new List<APPFunctionURLInfo>(); + } + else { - Title = "HDL ON PRO 1.0.09 涓昏鏇存柊", - CreateTime = "10鏈�26", - Url = Constant.URL_PRIVACYPOLICY, - }); + functionURLInfoList.Clear(); + } - list.Add(new APPFunctionURLInfo() + var waitPage = new Loading(); + bodyView.AddChidren(waitPage); + waitPage.Start(Language.StringByID(StringId.PleaseWait)); + + new Thread(() => { - Title = "HDL ON PRO 1.0.08 涓昏鏇存柊", - CreateTime = "09鏈�26", - Url = Constant.URL_PRIVACYPOLICY, - }); + try + { + var requestJson = HttpUtil.GetSignRequestJson(new AppNameObj() + { + }); - foreach (var info in list) + var result = HttpUtil.RequestHttpsPost(NewAPI.API_POST_FunctionIntroductionList, requestJson); + if (result.Code == StateCode.SUCCESS) + { + functionURLInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<APPFunctionURLInfo>>(result.Data.ToString()); + Application.RunOnMainThread(() => + { + if (functionURLInfoList != null && functionURLInfoList.Count > 0) + { + //鍔犺浇鍒锋柊List + LoadAPPFunctionURLInfoView(functionURLInfoList); + } + else + { + AddEmptyTipView(); + } + }); + } + else + { + Application.RunOnMainThread(() => + { + AddEmptyTipView(); + }); + IMessageCommon.Current.ShowErrorInfoAlter(result.Code); + } + } + catch (Exception ex) + { + } + finally + { + Application.RunOnMainThread(() => + { + if (waitPage != null) + { + waitPage.RemoveFromParent(); + waitPage = null; + } + }); + } + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 鍔犺浇鍔熻兘浠嬬粛CellView + /// </summary> + void LoadAPPFunctionURLInfoView(List<APPFunctionURLInfo> mList) + { + foreach (var info in mList) { AddRowView(bodyScrolView, info); } } - #endregion + + //#region 娴嬭瘯 + //List<APPFunctionURLInfo> list = new List<APPFunctionURLInfo>(); + ///// <summary> + ///// + ///// </summary> + //void TestLoad() + //{ + // list.Add(new APPFunctionURLInfo() + // { + // Title = "HDL ON PRO 1.0.10 涓昏鏇存柊", + // CreateTime = "11鏈�26", + // Url = Constant.URL_PRIVACYPOLICY, + // }); + + // list.Add(new APPFunctionURLInfo() + // { + // Title = "HDL ON PRO 1.0.09 涓昏鏇存柊", + // CreateTime = "10鏈�26", + // Url = Constant.URL_PRIVACYPOLICY, + // }); + + // list.Add(new APPFunctionURLInfo() + // { + // Title = "HDL ON PRO 1.0.08 涓昏鏇存柊", + // CreateTime = "09鏈�26", + // Url = Constant.URL_PRIVACYPOLICY, + // }); + + // foreach (var info in list) + // { + // AddRowView(bodyScrolView, info); + // } + //} + //#endregion } @@ -168,15 +279,15 @@ public class APPFunctionURLInfo { /// <summary> - /// + /// 鍔熻兘浠嬬粛鏍囬 /// </summary> public string Title; /// <summary> - /// + /// 鍔熻兘浠嬬粛鍙戝竷浜嬩欢 /// </summary> - public string CreateTime; + public long CreateTime; /// <summary> - /// + /// 鍔熻兘浠嬬粛瀵瑰簲鐨凥TML鍦板潃 /// </summary> public string Url; } -- Gitblit v1.8.0