wei
2021-06-16 de53d12e223eb8c9a562aeefdcfa9b4039b3d0b0
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
 
namespace HDL_ON.UI.UI1Login
{
    public partial class LoginPage : FrameLayout
    {
        public LoginPage()
        {
            //bodyView = new FrameLayout();
            //AddChidren(bodyView);
            bodyView = this;
            //2020-12-22 增加点击隐藏键盘事件
            bodyView.MouseDownEventHandler += (sender, e) => {
                Application.HideSoftInput();
            };
            pm = new HttpServerRequest();
        }
 
        public override void RemoveFromParent()
        {
            //如果当前界面存在正在等待数据的情况,先将该动作关掉
            if (waitPage != null)
            {
                waitPage.RemoveFromParent();
                waitPage = null;
            }
 
            base.RemoveFromParent();
 
            ////2020-12-22 增加点击隐藏键盘事件
            //Application.HideSoftInput();
        }
 
        #region 局部变量
        /// <summary>
        /// 登录类型
        /// 0:手机
        /// 1:邮箱
        /// </summary>
        int loginType = 0;
        /// <summary>
        /// 登录方式
        /// 0:密码
        /// 1:验证码
        /// </summary>
        int logintMode = 0;
        string account = "";
        string password = "";
        #endregion
 
        #region 控件列表
        /// <summary>
        /// 等待提示
        /// </summary>
        Loading waitPage;
        /// <summary>
        /// 当前界面
        /// </summary>
        FrameLayout bodyView;
        /// <summary>
        /// 选择手机登录按钮
        /// </summary>
        Button btnPhoneLogin;
        /// <summary>
        /// 选择邮箱登录按钮
        /// </summary>
        Button btnEmailLogin;
        /// <summary>
        /// 账号子区域
        /// </summary>
        FrameLayout accountView;
        /// <summary>
        /// 国际区号按钮
        /// </summary>
        Button btnGlobalRoaming;
        /// <summary>
        /// 账号子区域里面的分割线
        /// </summary>
        Button btnDividingLineVertical_AccountView;
        /// <summary>
        /// 账号文本框
        /// </summary>
        EditText etAccount;
        /// <summary>
        /// 账号Icon按钮
        /// </summary>
        Button btnAccountIcon;
        /// <summary>
        /// 密码子区域
        /// </summary>
        FrameLayout passwordView;
        /// <summary>
        /// 密码Icon按钮
        /// </summary>
        Button btnPasswordIcon;
        /// <summary>
        /// 密码文本框
        /// </summary>
        EditText etPassword;
        /// <summary>
        /// 密码子区域里面的分割线1
        /// </summary>
        Button btnDividingLineVertical_PasswordView1;
        /// <summary>
        /// 密码子区域里面的分割线2
        /// </summary>
        Button btnDividingLineVertical_PasswordView2;
        /// <summary>
        /// 忘记密码按钮
        /// </summary>
        Button btnForgetPassword;
        /// <summary>
        /// 获取手机验证码按钮
        /// </summary>
        Button btnGetVerificationCode;
        /// <summary>
        /// 密码是否可见按钮
        /// </summary>
        Button btnVisiblePassword;
        /// <summary>
        /// 账号子区域底部横线
        /// </summary>
        Button btnAccountViewBottomLine;
        /// <summary>
        /// 密码子区域底部横线
        /// </summary>
        Button btnPasswordViewBottomLine;
        /// <summary>
        /// 注册按钮
        /// </summary>
        Button btnRegister;
        /// <summary>
        /// 验证码登录按钮
        /// </summary>
        Button btnSwitchLoginMode;
        /// <summary>
        /// 登录按钮
        /// </summary>
        Button btnLogin;
        /// <summary>
        /// 服务器请求对象
        /// </summary>
        HttpServerRequest pm;
        #endregion
 
        string verAccount = "";
 
        /// <summary>
        /// 
        /// </summary>
        string registerPhone;
        string registerEmail;
        /// <summary>
        /// 手机区号
        /// </summary>
        string phoneZoneCode = "86";
 
        /// <summary>
        /// 加载视图
        /// </summary>
        public void LoadView(UserInfo userInfo = null)
        {
            var btnIcon = new Button()
            {
                X = Application.GetRealWidth(28),
                Y = Application.GetRealHeight(73),
                Width = Application.GetMinRealAverage(62),
                Height = Application.GetMinRealAverage(62),
                UnSelectedImagePath = "Public/Logo.png",
            };
            bodyView.AddChidren(btnIcon);
 
            var btnIcon_bg = new Button()
            {
                X = Application.GetRealWidth(171),
                Y = Application.GetRealHeight(69),
                Width = Application.GetMinRealAverage(254),
                Height = Application.GetMinRealAverage(156),
                UnSelectedImagePath = "Public/Logo-bg.png"
            };
            bodyView.AddChidren(btnIcon_bg);
 
#if DEBUG
            btnIcon_bg.MouseUpEventHandler += (sender, e) =>
            {
                MainPage.NoLoginMode = true;
                //楼层房间列表
                var floor1 = new SpatialInfo("FLOOR") { roomName = "F1", parentId = DB_ResidenceData.Instance.CurrentRegion.id };
                floor1.SaveRoomFile();
                //处理房间列表
                var room1 = new Room() {
                    roomId = "r1",
                    roomName = "客厅",
                    parentId = "f1"
                };
                room1.SaveRoomFile();
                //功能
                var light1 = new Function()
                {
                    sid = "light1",
                    deviceId = "light1",
                    name = "RGB1",
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, curValue="0,0,0",state = "0,0,0"   },
                    },
                };
                light1.SaveFunctionFile();
                //场景
            };
 
            bool b = false;
            btnIcon.MouseUpEventHandler += (sender, e) =>
            {
                //ESOnVideo.Current.Test(false);
 
                //return;
                if (b)
                {
                    etAccount.Text = "15626203746";//测试服务器
                    //etAccount.Text = "13375012446";//测试服务器
                    //etAccount.Text = "1033326940@qq.com";
                    //etAccount.Text = "18022428438";//wjc
                    //etAccount.Text = "13602944661";//kx
                    //etAccount.Text = "13226233133";//豆豆
                    //etAccount.Text = "18316672920";//lcg "18316672920";//hzx;// "13415629083"//cf;;
                    //etAccount.Text = "18316120654";//tujie
                    // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 
                }
                else
                {
                    //etAccount.Text = "15217626103";//
                    //etAccount.Text = "13682244600";//波哥
                    //etAccount.Text = "BB01010101@evoyo.com";//可视对讲
                    //etAccount.Text = "13168123446";
                    //etAccount.Text = "13676202754";//巴林服务器
                    //etAccount.Text = "13602944661";//kx
                    etAccount.Text = "551775569@qq.com";//wcf
                    //etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374
                    //etAccount.Text = "15971583093";// gs//tzy 274116637@qq.com//Sumant.Bhatia@havells.com 国外服务器测试
                }
                b = !b;
                etPassword.Text = "123456";
                btnLogin.IsSelected = true;
            };
#endif
 
            #region 登录方式选择
            btnPhoneLogin = new Button()
            {
                X = Application.GetRealWidth(28),
                Y = Application.GetRealHeight(177),
                Width = Application.GetRealWidth(150),
                Height = Application.GetRealHeight(40),
                TextID = StringId.LoginByPhone,
                TextColor = CSS_Color.MainColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
            };
            bodyView.AddChidren(btnPhoneLogin);
 
            btnEmailLogin = new Button()
            {
                X = btnPhoneLogin.Right ,//+ Application.GetRealWidth(20),
                Y = Application.GetRealHeight(177),
                Width = Application.GetRealWidth(140),
                Height = Application.GetRealHeight(40),
                TextID = StringId.LoginByEmail,
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.TextFontSize,
            };
            bodyView.AddChidren(btnEmailLogin);
            #endregion
 
            #region 账号填写
            accountView = new FrameLayout()
            {
                X = Application.GetRealWidth(28),
                Y = Application.GetRealHeight(232),
                Width = Application.GetRealWidth(319),
                Height = Application.GetRealHeight(44),
            };
            bodyView.AddChidren(accountView);
 
            btnGlobalRoaming = new Button()
            {
                Width = Application.GetRealWidth(65),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.FirstLevelTitleColor,
                Text = "+" + phoneZoneCode,
                TextSize = CSS_FontSize.TextFontSize,
                Enable = true,
            };
 
            //跳转国家区号选择界面
            EventHandler<MouseEventArgs> eHandler = (sender, e) =>
            {
                JLCountrycode.CountryCodeView.Current.Show((countryName, code) =>
                {
                    if (!string.IsNullOrEmpty(code))
                    {
                        phoneZoneCode = code;
                        btnGlobalRoaming.Text = "+" + phoneZoneCode;
                    }
                });
            };
            btnGlobalRoaming.MouseUpEventHandler += eHandler;
 
            if (loginType == 0)
            {
                accountView.AddChidren(btnGlobalRoaming);
            }
 
            btnDividingLineVertical_AccountView = new Button()
            {
                X = Application.GetRealWidth(65),
                Gravity = Gravity.CenterVertical,
                Width = 1,
                Height = Application.GetRealHeight(20),
                BackgroundColor = CSS_Color.DividingLineColor,
            };
            accountView.AddChidren(btnDividingLineVertical_AccountView);
 
            etAccount = new EditText()
            {
                X = Application.GetRealWidth(78),
                Width = Application.GetRealWidth(319 - 78),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                PlaceholderTextColor = CSS_Color.PromptingColor1,
                PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber),
                TextAlignment = TextAlignment.CenterLeft,
            };
            accountView.AddChidren(etAccount);
 
            if (userInfo != null)
            {
                registerEmail = userInfo.userEmailInfo;
                etAccount.Text = registerPhone = userInfo.userMobileInfo;
            }
 
            btnAccountViewBottomLine = new Button()
            {
                Y = Application.GetRealHeight(42),
                BackgroundColor = CSS_Color.DividingLineColor,
                Height = Application.GetRealHeight(1),
            };
            accountView.AddChidren(btnAccountViewBottomLine);
 
            btnAccountIcon = new Button()
            {
                X = Application.GetRealWidth(21),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(20),
                Height = Application.GetMinRealAverage(20),
                UnSelectedImagePath = "LoginIcon/AccountIcon.png",
            };
            if (loginType == 1)
            {
                accountView.AddChidren(btnAccountIcon);
            }
 
            #endregion
 
            #region 密码填写
            passwordView = new FrameLayout()
            {
                X = Application.GetRealWidth(28),
                Y = Application.GetRealHeight(288),
                Width = Application.GetRealWidth(319),
                Height = Application.GetRealHeight(44),
            };
            bodyView.AddChidren(passwordView);
 
 
            btnPasswordIcon = new Button()
            {
                X = Application.GetRealWidth(21),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(20),
                Height = Application.GetMinRealAverage(20),
                UnSelectedImagePath = "LoginIcon/PasswordIcon.png",
                SelectedImagePath = "LoginIcon/VerificationCodeIcon.png",
            };
            passwordView.AddChidren(btnPasswordIcon);
            btnDividingLineVertical_PasswordView1 = new Button()
            {
                X = Application.GetRealWidth(65),
                Gravity = Gravity.CenterVertical,
                Width = 1,
                Height = Application.GetRealHeight(20),
                BackgroundColor = CSS_Color.DividingLineColor,
            };
            passwordView.AddChidren(btnDividingLineVertical_PasswordView1);
 
            etPassword = new EditText()
            {
                X = Application.GetRealWidth(78),
                Width = Application.GetRealWidth(61 + 84),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                PlaceholderTextColor = CSS_Color.PromptingColor1,
                PlaceholderText = Language.StringByID(StringId.PlsEntryPassword),
                SecureTextEntry = true,
                TextAlignment = TextAlignment.CenterLeft,
            };
            passwordView.AddChidren(etPassword);
 
            #region 密码登录-控件加载
            btnVisiblePassword = new Button()
            {
                X = Application.GetRealWidth(223),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(20),
                Height = Application.GetMinRealAverage(20),
                UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png",
                SelectedImagePath = "LoginIcon/ShowPasswordIcon.png",
            };
            passwordView.AddChidren(btnVisiblePassword);
 
            btnDividingLineVertical_PasswordView2 = new Button()
            {
                X = Application.GetRealWidth(253),
                Gravity = Gravity.CenterVertical,
                Width = 1,
                Height = Application.GetRealHeight(20),
                BackgroundColor = CSS_Color.DividingLineColor,
            };
            passwordView.AddChidren(btnDividingLineVertical_PasswordView2);
 
            btnForgetPassword = new Button()
            {
                X = Application.GetRealWidth(263),
                Width = Application.GetRealWidth(56),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextID = StringId.ForgetPassword,
                TextSize = 12,
            };
            passwordView.AddChidren(btnForgetPassword);
            #endregion
 
            #region 验证码登录-控件加载
            btnGetVerificationCode = new Button()
            {
                X = Application.GetRealWidth(219),
                Width = Application.GetRealWidth(100),
                TextID = StringId.GetVerificationCode,
                SelectedTextColor = CSS_Color.MainColor,
                TextAlignment = TextAlignment.CenterRight,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextColor = CSS_Color.PromptingColor1,
                Visible = false,
                IsSelected = false,
            };
            passwordView.AddChidren(btnGetVerificationCode);
            #endregion
 
            btnPasswordViewBottomLine = new Button()
            {
                Y = Application.GetRealHeight(42),
                BackgroundColor = CSS_Color.DividingLineColor,
                SelectedBackgroundColor = CSS_Color.MainColor,
                Height = Application.GetRealHeight(1),
            };
            passwordView.AddChidren(btnPasswordViewBottomLine);
 
            #endregion
 
            #region 注册与快捷登录
            btnRegister = new Button()
            {
                X = Application.GetRealWidth(28),
                Y = passwordView.Bottom,
                Width = Application.GetRealWidth(60),
                Height = Application.GetRealHeight(17 + 12 + 12),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextID = StringId.SingUp,
                TextAlignment = TextAlignment.CenterLeft,
            };
            bodyView.AddChidren(btnRegister);
 
            btnSwitchLoginMode = new Button()
            {
                X = Application.GetRealWidth(223 + 28),
                Y = passwordView.Bottom,
                Width = Application.GetRealWidth(96),
                Height = Application.GetRealHeight(51),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextID = StringId.VerificationCodeLogin,
                TextAlignment = TextAlignment.CenterRight,
            };
            bodyView.AddChidren(btnSwitchLoginMode);
 
            #endregion
 
            btnLogin = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(403),
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealWidth(44),
                Radius = (uint)Application.GetRealWidth(22),
                SelectedBackgroundColor = CSS_Color.MainColor,
                BackgroundColor = CSS_Color.PromptingColor1,
                TextID = StringId.Login,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextColor = CSS_Color.MainBackgroundColor,
                TextAlignment = TextAlignment.Center,
            };
            bodyView.AddChidren(btnLogin);
 
           LoadEventList();
            account = etAccount.Text.Trim();
 
            #if DEBUG1211
            //本地模式
            Button btnLocalMode = new Button()
            {
                Y = Application.GetRealHeight(600),
                Height = Application.GetRealHeight(67),
                Text = "Local Mode",
                TextAlignment = TextAlignment.Center,
                BackgroundColor  = CSS_Color.MainColor,
                TextColor = CSS_Color.TextualColor,
            };
            bodyView.AddChidren(btnLocalMode);
 
            btnLocalMode.MouseUpEventHandler = (sender, e) =>
            {
                MainPage.LocalMode = true;
                 UserInfo.Current = new UserInfo();
                MainPage.GoUserPage();
            };
 
            MainPage.Log("etAccount.TextAlignment : " + etAccount.TextAlignment.ToString());
 
            #endif
 
            #region 隐私政策
            AddServiceAgreementControl(bodyView);
            #endregion
 
        }
 
        #region ■ 服务协议___________________________
        bool isAgreePrivacyPolicy = false;
        /// <summary>
        /// 添加服务协议控件
        /// </summary>
        /// <param name="frameBack"></param>
        private void AddServiceAgreementControl(FrameLayout frameLayout)
        {
            isAgreePrivacyPolicy = OnAppConfig.Instance.isAgreePrivacyPolicy;
            var frameRow = new FrameLayout()
            {
                Height = Application.GetRealHeight(28),
                Y = Application.GetRealHeight(628),
            };
            frameLayout.AddChidren(frameRow);
 
            //同意按钮背景
            var agreeView = new FrameLayout()
            {
                Height = Application.GetRealHeight(28),
                Width = Application.GetRealWidth(28),
                X = Application.GetRealWidth(22),
            };
            frameRow.AddChidren(agreeView);
            if(Language.CurrentLanguage == "Chinese")
            {
                agreeView.X = Application.GetRealWidth(82);
            }
            //同意图标按钮
            var agreeBtn = new Button()
            {
                Width = Application.GetMinRealAverage(28),
                Height = Application.GetMinRealAverage(28),
                UnSelectedImagePath = "Public/ChooseIcon.png",
                SelectedImagePath = "Public/ChooseOnIcon.png",
                IsSelected = isAgreePrivacyPolicy,
                Gravity = Gravity.Center
            };
            agreeView.AddChidren(agreeBtn);
 
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                isAgreePrivacyPolicy = !isAgreePrivacyPolicy;
                agreeBtn.IsSelected = isAgreePrivacyPolicy;
                OnAppConfig.Instance.isAgreePrivacyPolicy = isAgreePrivacyPolicy;
                OnAppConfig.Instance.SaveConfig();
            };
 
            agreeBtn.MouseUpEventHandler = eventHandler;
            agreeView.MouseUpEventHandler = eventHandler;
 
            //int btnWidth = 0;
            //同意文本
            var agreeTextBtn = new TextButton()
            {
                X = agreeView.Right,
                Width = Application.GetRealWidth(28),
                Height = Application.GetRealHeight(28),
                TextColor = CSS_Color.TextualColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextID = StringId.Agree
            };
            frameRow.AddChidren(agreeTextBtn);
            agreeTextBtn.Width = Utlis.GetRealWidthByTextButton(agreeTextBtn);
 
            //用户协议按钮
            var userAgreementBtn = new TextButton()
            {
                X = agreeTextBtn.Right,
                Width = Application.GetRealWidth(28),
                Height = Application.GetRealHeight(28),
                TextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = "《" + Language.StringByID(StringId.UserAgreement) + "》"
            };
            frameRow.AddChidren(userAgreementBtn);
            userAgreementBtn.Width = Utlis.GetRealWidthByTextButton(userAgreementBtn);
 
            //和文本
            var andTextBtn = new TextButton()
            {
                X = userAgreementBtn.Right,
                Width = Application.GetRealWidth(28),
                Height = Application.GetRealHeight(28),
                TextColor = CSS_Color.TextualColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextID = StringId.And
            };
            frameRow.AddChidren(andTextBtn);
            andTextBtn.Width = Utlis.GetRealWidthByTextButton(andTextBtn);
 
            //隐私政策按钮
            var privacyPolicyBtn = new TextButton()
            {
                X = andTextBtn.Right,
                Width = Application.GetRealWidth(28),
                Height = Application.GetRealHeight(28),
                TextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = "《" + Language.StringByID(StringId.PrivacyPolicy) + "》"
            };
            frameRow.AddChidren(privacyPolicyBtn);
            privacyPolicyBtn.Width = Utlis.GetRealWidthByTextButton(privacyPolicyBtn);
 
            //打开用户协议
            userAgreementBtn.MouseUpEventHandler = (sender, e) =>
            {
                OpenWebViewPage(false);
            };
 
            //打开隐私政策
            privacyPolicyBtn.MouseUpEventHandler = (sender, e) =>
            {
                OpenWebViewPage(true);
            };
        }
 
        /// <summary>
        /// OpenWebViewPage
        /// </summary>
        /// <param name="isOpenPrivacyPolicy">是否隐私政策</param>
        private void OpenWebViewPage(bool isOpenPrivacyPolicy)
        {
            string url = isOpenPrivacyPolicy ? Constant.URL_PRIVACYPOLICY : Constant.URL_USERAGREEMENT;
            string titleStr = isOpenPrivacyPolicy ? Language.StringByID(StringId.PrivacyPolicy) : Language.StringByID(StringId.UserAgreement);
            new WebViewDialog().LoadPage(titleStr, url);
        }
 
        /// <summary>
        /// 检测隐私协议
        /// </summary>
        /// <returns></returns>
        private bool CheckPrivacyPolicy()
        {
            if (isAgreePrivacyPolicy == false)
            {
                //请同意《用户协议》和《隐私政策》
                Utlis.ShowTip(Language.StringByID(StringId.PleaseReadAndAgreePrivacyPolicyMsg));
                return false;
            }
            return true;
        }
 
        #endregion
    }
}