黄学彪
2020-12-16 0d9f64668fd7350d6a21fd157e32009a96d98134
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
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter.Transfer
{
    /// <summary>
    /// 住宅过户的主界面
    /// </summary>
    public class TransferResidenceMainForm : EditorCommonForm
    {
        #region ■ 变量声明___________________________
 
        /// <summary>
        /// 1:移交给用户  2:授权给调试人员
        /// </summary>
        private int TransferDiv = 0;
 
        #endregion
 
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        /// <param name="i_TransferDiv">1:移交给用户  2:授权给调试人员</param>
        public void ShowForm(int i_TransferDiv)
        {
            this.TransferDiv = i_TransferDiv;
            //设置头部信息
            base.SetTitleText(i_TransferDiv == 1
                ? Language.StringByID(R.MyInternationalizationString.HandoverToUser).Replace("{0}", string.Empty)
                : Language.StringByID(R.MyInternationalizationString.AuthorizedToCommissioningPersonnel).Replace("{0}", string.Empty));
 
            //初始化中部信息
            this.InitMiddleFrame();
        }
 
        /// <summary>
        /// 初始化中部信息
        /// </summary>
        private void InitMiddleFrame()
        {
            //转移图片
            var btnPictrue = new PicViewControl(804, 268);
            btnPictrue.Gravity = Gravity.CenterHorizontal;
            btnPictrue.Y = Application.GetRealHeight(222);
            btnPictrue.UnSelectedImagePath = "Item/TransferOfResidence.png";
            bodyFrameLayout.AddChidren(btnPictrue);
 
            //转移住宅到其他Evoyo Home账号
            var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(90), false);
            btnMsg1.Y = Application.GetRealHeight(593);
            btnMsg1.TextSize = 20;
            btnMsg1.IsBold = true;
            btnMsg1.TextAlignment = TextAlignment.Center;
            btnMsg1.Text = this.TransferDiv == 1 ? "转移住宅到其他用户账号" : "转移住宅到其他调试人员账号";
            bodyFrameLayout.AddChidren(btnMsg1);
 
            //该操作不可逆,请注意:
            var btnTip = new NormalViewControl(900, 60, true);
            btnTip.X = Application.GetRealWidth(135);
            btnTip.Y = btnMsg1.Bottom + Application.GetRealHeight(257);
            btnTip.TextID = R.MyInternationalizationString.uThisOperationIsIrreversiblePleaseNote;
            bodyFrameLayout.AddChidren(btnTip);
            //1.接收方为有效注册账号
            var btnTipMsg1 = new NormalViewControl(900, 55, true);
            btnTipMsg1.X = btnTip.X;
            btnTipMsg1.Y = btnTip.Bottom + Application.GetRealHeight(30);
            btnTipMsg1.TextSize = 12;
            btnTipMsg1.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnTipMsg1.Text = "1.接收方为有效注册账号";
            bodyFrameLayout.AddChidren(btnTipMsg1);
            //2.接收方与转移方不可以为同一个账号
            var btnTipMsg2 = new NormalViewControl(900, 55, true);
            btnTipMsg2.X = btnTip.X;
            btnTipMsg2.Y = btnTipMsg1.Bottom + Application.GetRealHeight(30);
            btnTipMsg2.TextSize = 12;
            btnTipMsg2.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnTipMsg2.Text = "2.接收方与转移方不可以为同一个账号";
            bodyFrameLayout.AddChidren(btnTipMsg2);
            //3.转移成功后,将取消转移方成员对该住宅的使用权
            var btnTipMsg3 = new NormalViewControl(900, 55, true);
            btnTipMsg3.X = btnTip.X;
            btnTipMsg3.Y = btnTipMsg2.Bottom + Application.GetRealHeight(30);
            btnTipMsg3.TextSize = 12;
            btnTipMsg3.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnTipMsg3.Text = "3.转移成功后,将取消转移方成员对该住宅的使用权";
            bodyFrameLayout.AddChidren(btnTipMsg3);
 
            //输入账号
            var btnInputAccount = new BottomClickButton(372);
            btnInputAccount.Gravity = Gravity.Frame;
            btnInputAccount.X = Application.GetRealWidth(115);
            btnInputAccount.TextID = R.MyInternationalizationString.uInputAccount;
            bodyFrameLayout.AddChidren(btnInputAccount);
            btnInputAccount.ButtonClickEvent += (sender, e) =>
            {
                var form = new TransferResidenceByIdForm();
                form.AddForm(this.TransferDiv);
            };
 
            //扫描二维码的背景
            var btnScanGroud = new NormalViewControl(429, 184, true);
            btnScanGroud.Y = Application.GetRealHeight(1454);
            btnScanGroud.X = btnInputAccount.Right + Application.GetRealWidth(78);
            btnScanGroud.UnSelectedImagePath = "Item/ScanQrCodeGroud.png";
            bodyFrameLayout.AddChidren(btnScanGroud);
            //扫描二维码
            var btnScanQrCode = new BottomClickButton(372);
            btnScanQrCode.Gravity = Gravity.Frame;
            btnScanQrCode.X = btnScanGroud.X + Application.GetRealWidth(28);
            btnScanQrCode.TextID = R.MyInternationalizationString.uScanQRcode;
            btnScanQrCode.BackgroundColor = UserCenterColor.Current.Transparent;
            btnScanQrCode.UseClickStatu = false;
            bodyFrameLayout.AddChidren(btnScanQrCode);
            btnScanQrCode.ButtonClickEvent += (sender, e) =>
            {
                QRCode.ScanQRcode((qrCode) =>
                {
                    if (string.IsNullOrEmpty(qrCode) == true)
                    {
                        return;
                    }
                    //搜索ID
                    HdlThreadLogic.Current.RunThread(() =>
                    {
                        this.SearchMemberInfo(qrCode);
                    });
                }, 
                Language.StringByID(R.MyInternationalizationString.uCancel),
                Language.StringByID(R.MyInternationalizationString.uFlashlamp),
                Language.StringByID(R.MyInternationalizationString.uScanQRcode));
            };
        }
 
        #endregion
 
        #region ■ 搜索ID_____________________________
 
        /// <summary>
        /// 搜索指定ID的信息
        /// </summary>
        /// <param name="accountId">成员ID</param>
        /// <param name="txtMsg">信息控件</param>
        private void SearchMemberInfo(string accountId)
        {
            //开启进度条
            this.ShowProgressBar();
 
            var result = HdlMemberLogic.Current.SearchNormalInfoByAccount(accountId);
            //关闭进度条
            this.CloseProgressBar();
 
            if (result == null)
            {
                //异常
                return;
            }
            if (result.Account == string.Empty)
            {
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //账号信息
                    var form = new Member.MemberNotEsixtForm();
                    form.AddForm(Language.StringByID(R.MyInternationalizationString.uAccountInfo));
                });
                return;
            }
 
            HdlThreadLogic.Current.RunMain(() =>
            {
                var form2 = new AddMemberInfoForm();
                form2.AddForm(result, this.TransferDiv);
            });
        }
 
        #endregion
    }
}