黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
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
using System;
using System.Collections.Generic;
 
namespace Shared.Phone.UserCenter.Transfer
{
    /// <summary>
    /// 需要过户账号的信息(确认)画面
    /// </summary>
    public class AddMemberInfoForm : EditorCommonForm
    {
        #region ■ 变量声明___________________________
 
        /// <summary>
        /// 1:移交给用户  2:授权给调试人员
        /// </summary>
        private int TransferDiv = 0;
        /// <summary>
        /// 成员信息
        /// </summary>
        private AccountInfoResult memberResult = null;
 
        #endregion
 
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        /// <param name="i_infoResult">成员信息</param>
        /// <param name="i_TransferDiv">1:移交给用户  2:授权给调试人员</param>
        public void ShowForm(AccountInfoResult i_infoResult, int i_TransferDiv)
        {
            this.TransferDiv = i_TransferDiv;
            this.memberResult = i_infoResult;
 
            //设置标题信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAccountInfo));
 
            //初始化中部控件
            this.InitMiddleFrame();
        }
 
 
        /// <summary>
        /// 初始化中部控件
        /// </summary>
        private void InitMiddleFrame()
        {
            //清空bodyFrame
            this.ClearBodyFrame();
 
            //头像
            var btnUserIcon = new ImageView();
            btnUserIcon.Height = this.GetPictrueRealSize(207);
            btnUserIcon.Width = this.GetPictrueRealSize(207);
            btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2;
            if (memberResult.HeadImage != null)
            {
                btnUserIcon.ImageBytes = memberResult.HeadImage;
            }
            else
            {
                btnUserIcon.ImagePath = "Center/Admin.png";
            }
            btnUserIcon.Y = Application.GetRealHeight(219);
            btnUserIcon.Gravity = Gravity.CenterHorizontal;
            bodyFrameLayout.AddChidren(btnUserIcon);
 
            //成员ID
            var btnUserId = new NormalViewControl(800, 50, true);
            btnUserId.IsBold = true;
            btnUserId.Y = Application.GetRealHeight(472);
            btnUserId.Gravity = Gravity.CenterHorizontal;
            btnUserId.Text = memberResult.Account;
            btnUserId.TextAlignment = TextAlignment.Center;
            btnUserId.TextColor = UserCenterColor.Current.TextGrayColor1;
            bodyFrameLayout.AddChidren(btnUserId);
 
            //昵称
            var btnName = new NormalViewControl(800, 55, true);
            btnName.IsBold = true;
            btnName.Y = Application.GetRealHeight(541);
            btnName.Gravity = Gravity.CenterHorizontal;
            btnName.TextAlignment = TextAlignment.Center;
            btnName.TextSize = 16;
            btnName.Text = memberResult.MemberName;
            bodyFrameLayout.AddChidren(btnName);
 
            //请确认账号是否正确{0}如正确请点击确认
            string strMsg = Language.StringByID(R.MyInternationalizationString.uPleaseConfirmAccoutIsRightAndClick);
            if (strMsg.Contains("{0}") == true)
            {
                strMsg = string.Format(strMsg, "\r\n");
            }
            var btnmsg = new NormalViewControl(800, 100, true);
            btnmsg.IsBold = true;
            btnmsg.Y = Application.GetRealHeight(913);
            btnmsg.TextSize = 12;
            btnmsg.Text = strMsg;
            btnmsg.IsMoreLines = true;
            btnmsg.TextAlignment = TextAlignment.Center;
            btnmsg.TextColor = UserCenterColor.Current.TextGrayColor2;
            btnmsg.Gravity = Gravity.CenterHorizontal;
            bodyFrameLayout.AddChidren(btnmsg);
 
            //确认
            var btnOk = new BottomClickButton(688);
            btnOk.Y = Application.GetRealHeight(1045);
            btnOk.TextID = R.MyInternationalizationString.uConfirm1;
            bodyFrameLayout.AddChidren(btnOk);
            btnOk.ButtonClickEvent += (sender, e) =>
            {
                if (this.memberResult.Account == HdlUserCenterResourse.UserInfo.UserPhone
                  || this.memberResult.Account == HdlUserCenterResourse.UserInfo.UserEmail)
                {
                    if (this.TransferDiv == 1)
                    {
                        //不能自己过户给自己
                        this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uYouCannotTransferOwnershipToYourself));
                    }
                    else
                    {
                        //不能自己授权给自己
                        this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uYouCanotDelegateToYourself));
                    }
                    return;
                }
                this.CloseForm();
 
                var form = new TransferingResidenceForm();
                form.AddForm(this.memberResult, this.TransferDiv);
            };
        }
 
        #endregion
    }
}