wei
2020-11-27 e53a1951d6aa07ad22aad9816da4703496fcbccd
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
using System;
using Shared;
using HDL_ON.UI.CSS;
 
namespace HDL_ON.UI
{
    /// <summary>
    /// 获取支持-常见问题页面
    /// </summary>
    public class FAQHelpPage : FrameLayout
    {
        /// <summary>
        /// 
        /// </summary>
        FrameLayout bodyView;
        /// <summary>
        /// 搜索页面
        /// </summary>
        FrameLayout searchView;
        /// <summary>
        /// 菜单按钮
        /// </summary>
        Button btnMenu;
        /// <summary>
        /// 电话按钮
        /// </summary>
        Button btnTelephone;
        /// <summary>
        /// 发送信息按钮
        /// </summary>
        Button btnSendMes;
 
 
        /// <summary>
        /// 菜单按钮是否展开
        /// </summary>
        bool isbtnMenuOpen;
 
        public FAQHelpPage()
        {
            bodyView = this;
        }
 
        public void LoadPage()
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            new TopViewDiv(bodyView, Language.StringByID(StringId.GetSupport)).LoadTopView();
 
            //搜索按钮
            searchView = new FrameLayout()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(76),
                Height = Application.GetRealHeight(28),
                Width = Application.GetRealWidth(343),
                Radius = (uint)Application.GetRealHeight(6),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            bodyView.AddChidren(searchView);
 
            ImageView searchImage = new ImageView()
            {
                Width = Application.GetRealWidth(20),
                Height = Application.GetRealWidth(20),
                Gravity = Gravity.Center,
                ImagePath = "PersonalCenter/Support/Search.png"
            };
            searchView.AddChidren(searchImage);
 
            #region Help
            var helpView = new FrameLayout()
            {
                Y = Application.GetRealHeight(112),
                Height = Application.GetRealHeight(208),
                BackgroundColor = CSS_Color.MainBackgroundColor,
 
            };
            bodyView.AddChidren(helpView);
 
            var helpTip = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(10),
                Height = Application.GetRealHeight(28),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                Width = Application.GetRealWidth(200),
                TextID = StringId.WhatCanWeDoForYou
            };
            helpView.AddChidren(helpTip);
 
            #region 功能问题
            var functionView = new ListIconCellView()
            {
                Y = Application.GetRealHeight(58),
            };
            helpView.AddChidren(functionView);
            functionView.BtnTilte.TextID = StringId.FunctionalQuestion;
            functionView.BtnIcon.UnSelectedImagePath = "PersonalCenter/Support/Function.png";
 
            Action functionAction = () =>
            {
                OpenQuestionListPage(1);
            };
            functionView.GoAction = functionAction;
            #endregion
 
            #region 场景问题
            var sceneView = new ListIconCellView()
            {
                Y = functionView.Bottom,
            };
            helpView.AddChidren(sceneView);
            sceneView.BtnTilte.TextID = StringId.SceneQuestion;
            sceneView.BtnIcon.UnSelectedImagePath = "PersonalCenter/Support/Scene.png";
 
            Action sceneAction = () =>
            {
                OpenQuestionListPage(2);
            };
            sceneView.GoAction = functionAction;
            #endregion
 
            #region APP使用问题
            var appUseView = new ListIconCellView()
            {
                Y = sceneView.Bottom,
            };
            helpView.AddChidren(appUseView);
            appUseView.BtnTilte.TextID = StringId.AppUsageAssistance;
            appUseView.BtnIcon.UnSelectedImagePath = "PersonalCenter/Support/Help.png";
            appUseView.LineView.RemoveFromParent();
 
            Action appUseAction = () =>
            {
                OpenQuestionListPage(3);
            };
            appUseView.GoAction = appUseAction;
            #endregion
            #endregion
 
 
            #region question View
            int qY = Application.GetRealHeight(328);
            var questionView = new FrameLayout()
            {
                Y = qY,
                Height = bodyView.Height - qY,
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            bodyView.AddChidren(questionView);
 
            var questionTitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(10),
                Height = Application.GetRealHeight(28),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                Width = Application.GetRealWidth(200),
                Text = Language.StringByID(StringId.CommonQuestion) + ":"
            };
            questionView.AddChidren(questionTitle);
            #endregion
 
            #region 功能按钮
            btnMenu = new Button()
            {
                Y = Application.GetRealHeight(542),
                X = Application.GetRealWidth(302),
                Width = Application.GetRealWidth(58),
                Height = Application.GetRealWidth(58),
                UnSelectedImagePath = "PersonalCenter/Support/Menu.png",
                SelectedImagePath = "PersonalCenter/Support/Close.png",
            };
            bodyView.AddChidren(btnMenu);
 
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                isbtnMenuOpen = !isbtnMenuOpen;
                SetMenuButtonState(isbtnMenuOpen);
            };
            btnMenu.MouseUpEventHandler = eventHandler;
 
            btnTelephone = new Button()
            {
                Y = Application.GetRealHeight(494),
                X = Application.GetRealWidth(274),
                Width = Application.GetRealWidth(58),
                Height = Application.GetRealWidth(58),
                UnSelectedImagePath = "PersonalCenter/Support/Telephone.png",
                Visible = false,
            };
            bodyView.AddChidren(btnTelephone);
 
            btnTelephone.MouseUpEventHandler = (sender, e) =>
            {
                OpenGetSupportPage();
            };
 
            btnSendMes = new Button()
            {
                Y = Application.GetRealHeight(590),
                X = Application.GetRealWidth(274),
                Width = Application.GetRealWidth(58),
                Height = Application.GetRealWidth(58),
                UnSelectedImagePath = "PersonalCenter/Support/SendMessage.png",
                Visible = false,
            };
            bodyView.AddChidren(btnSendMes);
 
            btnSendMes.MouseUpEventHandler = (sender, e) =>
            {
                OpenGetSupportPage();
            };
 
            #endregion
 
 
        }
 
 
 
        /// <summary>
        /// 是否展开
        /// </summary>
        /// <param name="isOpen"></param>
        void SetMenuButtonState(bool isOpen)
        {
            btnMenu.IsSelected = isOpen;
            btnTelephone.Visible = isOpen;
            btnSendMes.Visible = isOpen;
 
 
            if (isOpen)
            {
                //展开
 
            }
            else
            {
                //关闭隐藏
 
            }
 
        }
 
        /// <summary>
        /// 打开问题列表页面
        /// </summary>
        /// <param name="questionType">1:功能问题 2:场景问题 3:APP使用辅助</param>
        void OpenQuestionListPage(int questionType)
        {
            int titleId = 0;
            if (questionType == 1)
            {
                titleId = StringId.FunctionalQuestion;
            }
            else if (questionType == 2)
            {
                titleId = StringId.SceneQuestion;
            }
            else if (questionType == 3)
            {
                titleId = StringId.AppUsageAssistance;
            }
 
            var mPage = new QuestionListPage();
            MainPage.BasePageView.AddChidren(mPage);
            mPage.LoadPage(titleId);
            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
        }
 
        /// <summary>
        /// 打开获取支持电话页面
        /// </summary>
        void OpenGetSupportPage()
        {
            var mPage = new GetSupportPage();
            MainPage.BasePageView.AddChidren(mPage);
            mPage.LoadPage();
            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
        }
    }
}