陈嘉乐
2021-03-16 e1ac4ab0e68024e6289e0b11756962d662749b04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
    public class ThirdPartyBrandListPage : FrameLayout
    {
 
        FrameLayout bodyView;
        FrameLayout contentView;
        Button btnAdd;
 
        public ThirdPartyBrandListPage()
        {
            bodyView = this;
        }
 
        public void LoadPage()
        {
            new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionBrand)).LoadTopView();
 
            contentView = new FrameLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(667-64),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            bodyView.AddChidren(contentView);
 
            AddEmptyTipView();
 
            Button btnTipMsg = new Button()
            {
                Height = Application.GetRealHeight(17 + 24),
                Y = Application.GetRealHeight(535 - 12),
                TextColor = CSS_Color.TextualColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextAlignment = TextAlignment.Center,
                TextID = StringId.TipAddThirdPartyDeviceMsg,
            };
            bodyView.AddChidren(btnTipMsg);
 
            btnAdd = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(564),
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealWidth(44),
                Radius = (uint)Application.GetRealWidth(22),
                BackgroundColor = CSS_Color.MainColor,
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainBackgroundColor,
                TextID = StringId.Add,
            };
            bodyView.AddChidren(btnAdd);
 
            LoadEvent_SikpAddBrand();
        }
 
        /// <summary>
        /// 添加内容为空提示页面
        /// </summary>
        void AddEmptyTipView()
        {
           var emptyTipView = new FrameLayout()
            {
                Height =Application.GetRealWidth(470),
                Width = contentView.Width,
            };
            contentView.AddChidren(emptyTipView);
 
            var tipView = new EmptyTipView(Language.StringByID(StringId.TipNotThirdPartyDevice))
            {
                Gravity = Gravity.Center
            };
            emptyTipView.AddChidren(tipView);
        }
        /// <summary>
        /// 跳转绑定第三方品牌界面
        /// </summary>
        void LoadEvent_SikpAddBrand()
        {
            btnAdd.MouseUpEventHandler = (sender, e) => {
                var page = new AddThirdPartyBrandListpage();
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            }; 
        }
    }
}