JLChen
2020-11-28 58e81926757b0dd9bf12394c534330dd5af2a8f8
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
using System;
using Shared;
using HDL_ON.UI.CSS;
using Xamarin.Essentials;
 
namespace HDL_ON.UI
{
    /// <summary>
    /// 投诉页面
    /// </summary>
    public class ComplaintsPage : FrameLayout
    {
        FrameLayout bodyView;
 
        /// <summary>
        /// 当前
        /// </summary>
        VerticalScrolViewLayout bodyScrolView;
 
        public ComplaintsPage()
        {
            bodyView = this;
            BackgroundColor = CSS_Color.MainBackgroundColor;
        }
 
        public void LoadPage()
        {
            new TopViewDiv(bodyView, Language.StringByID(StringId.Complaints)).LoadTopView();
 
            int bodyY = Application.GetRealHeight(64);
            bodyScrolView = new VerticalScrolViewLayout()
            {
                Y = bodyY,
                Height = bodyView.Height - bodyY,
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
 
            #region 投诉联系
            FrameLayout phoneRow = new FrameLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(50),
            };
            bodyView.AddChidren(phoneRow);
 
            Button btnPhoneTitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(48),
                TextID = StringId.Telephone,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
            };
            phoneRow.AddChidren(btnPhoneTitle);
 
            Button btnPhoneText = new Button()
            {
                X = btnPhoneTitle.Right,
                Width = Application.GetRealWidth(200),
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.FirstLevelTitleColor,
                Text = "400 855 8535",
            };
            phoneRow.AddChidren(btnPhoneText);
            /// <summary>
            /// 前进图标
            /// </summary>
            var btnImage = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            phoneRow.AddChidren(btnImage);
            phoneRow.AddChidren(new Button() { X = Application.GetRealWidth(16), Y = Application.GetRealWidth(49), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
 
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                PhoneDialer.Open(Constant.SUPPORT_TELEPHONENUMBER);
            };
 
            phoneRow.MouseUpEventHandler = eventHandler;
            btnPhoneText.MouseUpEventHandler = eventHandler;
            btnImage.MouseUpEventHandler = eventHandler;
            #endregion
 
            #region 联系邮箱
            FrameLayout emailRow = new FrameLayout()
            {
                Y = phoneRow.Bottom,
                Height = Application.GetRealHeight(54),
            };
            bodyView.AddChidren(emailRow);
 
            Button btnEmailTitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(48),
                TextID = StringId.Email_,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
            };
            emailRow.AddChidren(btnEmailTitle);
 
            Button btnEmailText = new Button()
            {
                X = btnEmailTitle.Right,
                Y = Application.GetRealHeight(8),
                Height = Application.GetRealHeight(20),
                Width = Application.GetRealWidth(200),
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.FirstLevelTitleColor,
                Text = Constant.SUPPORT_EMAIL,
            };
            emailRow.AddChidren(btnEmailText);
 
            Button btnEmailTipText = new Button()
            {
                X = btnEmailTitle.Right,
                Y = btnEmailText.Bottom + Application.GetRealHeight(4),
                Height = Application.GetRealHeight(20),
                Width = Application.GetRealWidth(200),
                TextAlignment = TextAlignment.TopLeft,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                TextColor = CSS_Color.PromptingColor1,
                TextID = StringId.WillGivePriorityToTheTreatmen,
            };
            emailRow.AddChidren(btnEmailTipText);
            /// <summary>
            /// 前进图标
            /// </summary>
            var btnImage2 = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            emailRow.AddChidren(btnImage2);
 
            emailRow.AddChidren(new Button() { X = Application.GetRealWidth(16), Y = emailRow.Height - Application.GetRealHeight(1), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
 
            EventHandler<MouseEventArgs> eventHandler2 = (sender, e) =>
            {
                CopyToClipboard(Constant.SUPPORT_EMAIL);
            };
 
            emailRow.MouseUpEventHandler = eventHandler2;
            btnEmailText.MouseUpEventHandler = eventHandler2;
            btnImage2.MouseUpEventHandler = eventHandler2;
            #endregion
        }
 
 
 
        /// <summary>
        /// 复制到剪切板
        /// </summary>
        /// <param name="text"></param>
        void CopyToClipboard(string text)
        {
            Clipboard.SetTextAsync(text);
            Utlis.ShowTip(text + "\n" + Language.StringByID(StringId.CopySuccess));
        }
 
    }
 
}