陈嘉乐
2020-12-03 0f2e0147e8990e913d16d99bc1b94fb6bc53abd7
HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FunctionIntroductionPage.cs
@@ -1,6 +1,7 @@
using System;
using Shared;
using HDL_ON.UI.CSS;
using System.Collections.Generic;
namespace HDL_ON.UI
{
@@ -18,6 +19,10 @@
        /// 当前
        /// </summary>
        VerticalScrolViewLayout bodyScrolView;
        /// <summary>
        /// 内容为空提示View
        /// </summary>
        EmptyTipView emptyTipView;
        public FunctionIntroductionPage()
        {
@@ -38,6 +43,8 @@
            bodyView.AddChidren(bodyScrolView);
            AddEmptyTipView();
            //TestLoad();
        }
        /// <summary>
@@ -45,20 +52,132 @@
        /// </summary>
        void AddEmptyTipView()
        {
            //int bodyY = Application.GetRealHeight(64);
            //emptyTipFrameLayout = new FrameLayout()
            //{
            //    Y = bodyY,
            //    Height = bodyView.Height - bodyY,
            //    BackgroundColor = CSS_Color.MainBackgroundColor,
            //};
            //bodyView.AddChidren(emptyTipFrameLayout);
            var emptyTipView = new EmptyTipView()
            emptyTipView = new EmptyTipView()
            {
                Gravity = Gravity.Center
            };
            bodyView.AddChidren(emptyTipView);
        }
        /// <summary>
        /// 加载区域选择RowView
        /// </summary>
        /// <param name="VerticalScrolViewMiddle"></param>
        void AddRowView(VerticalScrolViewLayout VerticalScrolViewMiddle, HelpURLInfo functionInfo)
        {
            var rowView = new FrameLayout()
            {
                Height = Application.GetRealHeight(54),
            };
            VerticalScrolViewMiddle.AddChidren(rowView);
            //标题
            var btnTilte = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(8),
                Width = Application.GetRealWidth(320),
                Height = Application.GetRealHeight(20),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                Text = functionInfo.Title
            };
            rowView.AddChidren(btnTilte);
            //副标题
            var btnSubtitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = btnTilte.Bottom + Application.GetRealHeight(4),
                Width = Application.GetRealWidth(320),
                Height = Application.GetRealHeight(14),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                Text = functionInfo.CreateTime
            };
            rowView.AddChidren(btnSubtitle);
            var btnGo = new Button()
            {
                X = Application.GetRealWidth(343),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            rowView.AddChidren(btnGo);
            var lineView = new LineView(rowView.Height);
            rowView.AddChidren(lineView);
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                new WebViewDialog().LoadPage(functionInfo.Title, functionInfo.Url);
            };
            btnTilte.MouseUpEventHandler = eventHandler;
            btnSubtitle.MouseUpEventHandler = eventHandler;
            btnGo.MouseUpEventHandler = eventHandler;
        }
        #region 测试
        List<HelpURLInfo> list = new List<HelpURLInfo>();
        /// <summary>
        ///
        /// </summary>
        void TestLoad()
        {
            list.Add(new HelpURLInfo()
            {
                Title = "HDL ON PRO 1.0.10 主要更新",
                CreateTime = "11月26",
                Url = Constant.URL_PRIVACYPOLICY,
            });
            list.Add(new HelpURLInfo()
            {
                Title = "HDL ON PRO 1.0.09 主要更新",
                CreateTime = "10月26",
                Url = Constant.URL_PRIVACYPOLICY,
            });
            list.Add(new HelpURLInfo()
            {
                Title = "HDL ON PRO 1.0.08 主要更新",
                CreateTime = "09月26",
                Url = Constant.URL_PRIVACYPOLICY,
            });
            foreach (var info in list)
            {
                AddRowView(bodyScrolView, info);
            }
        }
        #endregion
    }
    /// <summary>
    /// 帮助网页地址
    /// </summary>
    [System.Serializable]
    public class HelpURLInfo
    {
        /// <summary>
        ///
        /// </summary>
        public string Title;
        /// <summary>
        ///
        /// </summary>
        public string CreateTime;
        /// <summary>
        ///
        /// </summary>
        public string Url;
    }
}