黄学彪
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
138
139
140
141
142
using Shared.Phone.UserCenter;
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter.Transfer
{
    /// <summary>
    /// 过户的结果界面
    /// </summary>
    public class TransferResidenceResultForm : DialogCommonForm
    {
        #region ■ 变量声明___________________________
 
        /// <summary>
        /// 界面关闭事件
        /// </summary>
        public Action FinishEvent = null;
        /// <summary>
        /// 清空事件
        /// </summary>
        private bool clearEvent = true;
        /// <summary>
        /// 过户信息
        /// </summary>
        private AccountInfoResult memberResult = null;
 
        #endregion
 
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        /// <param name="i_memberResult">过户信息</param>
        /// <param name="i_result">true:成功 false:失败</param>
        public void ShowForm(AccountInfoResult i_memberResult, bool i_result)
        {
            this.memberResult = i_memberResult;
            this.CloseFormByClickBack = false;
 
            //初始化中部控件
            this.InitMiddleFrame(i_result);
        }
 
 
        /// <summary>
        /// 初始化中部控件
        /// </summary>
        private void InitMiddleFrame(bool success)
        {
            //背景框
            var frameBack = new FrameLayout();
            frameBack.Width = Application.GetRealWidth(838);
            frameBack.Height = Application.GetRealHeight(1097);
            frameBack.Y = Application.GetRealHeight(392);
            frameBack.BackgroundColor = UserCenterColor.Current.White;
            frameBack.Gravity = Gravity.CenterHorizontal;
            frameBack.Radius = (uint)Application.GetRealHeight(17);
            bodyFrameLayout.AddChidren(frameBack);
 
            //关闭按钮(失败专用)
            if (success == false)
            {
                var btnCloseIcon = new IconViewControl(86);
                btnCloseIcon.Y = Application.GetRealHeight(23);
                btnCloseIcon.X = frameBack.Width - btnCloseIcon.IconSize - Application.GetRealWidth(58);
                btnCloseIcon.UnSelectedImagePath = "Item/CancelIcon.png";
                frameBack.AddChidren(btnCloseIcon);
                btnCloseIcon.ButtonClickEvent += (sender, e) =>
                {
                    this.CloseForm();
                };
            }
 
            //图标
            var btnIcon = new IconViewControl(420);
            btnIcon.Y = Application.GetRealHeight(92);
            btnIcon.Gravity = Gravity.CenterHorizontal;
            btnIcon.UnSelectedImagePath = success == true ? "Item/AdjustSuccessIcon.png" : "Item/AdjustFailIcon.png";
            frameBack.AddChidren(btnIcon);
 
            //过户成功 / 过户失败
            var btnMsg = new NormalViewControl(frameBack.Width, Application.GetRealHeight(85), false);
            btnMsg.Y = btnIcon.Bottom + Application.GetRealHeight(29);
            btnMsg.TextAlignment = TextAlignment.Center;
            btnMsg.IsBold = true;
            btnMsg.TextSize = 20;
            btnMsg.TextID = success == true ? R.MyInternationalizationString.uTransferSuccess : R.MyInternationalizationString.uTransferFail;
            frameBack.AddChidren(btnMsg);
 
            if (success == true)
            {
                string strMsg = Language.StringByID(R.MyInternationalizationString.uCongratulationsXXBecomingNNAdministrator);
                strMsg = strMsg.Replace("{0}", memberResult.MemberName).Replace("{1}", Common.Config.Instance.Home.Name);
 
                //恭喜XXXXX成为「NNNNN」管理员
                var btnMsg2 = new NormalViewControl(frameBack.Width - Application.GetRealWidth(100), Application.GetRealHeight(105), false);
                btnMsg2.Y = btnMsg.Bottom + Application.GetRealHeight(12);
                btnMsg2.Gravity = Gravity.CenterHorizontal;
                btnMsg2.TextSize = 12;
                btnMsg2.TextColor = UserCenterColor.Current.TextGrayColor1;
                btnMsg2.TextAlignment = TextAlignment.Center;
                btnMsg2.IsMoreLines = true;
                btnMsg2.Text = strMsg;
                frameBack.AddChidren(btnMsg2);
            }
 
            //完成
            var btnFinish = new BottomClickButton(688);
            btnFinish.Y = Application.GetRealHeight(867);
            btnFinish.TextID = success == true ? R.MyInternationalizationString.uFinish : R.MyInternationalizationString.uReDoAgain;
            frameBack.AddChidren(btnFinish);
            btnFinish.ButtonClickEvent += (sender, e) =>
            {
                this.clearEvent = false;
 
                this.CloseForm();
                FinishEvent?.Invoke();
                FinishEvent = null;
            };
        }
 
        #endregion
 
        #region ■ 界面关闭___________________________
 
        /// <summary>
        /// 界面关闭
        /// </summary>
        public override void CloseFormBefore()
        {
            if (clearEvent == true)
            {
                FinishEvent = null;
            }
            base.CloseFormBefore();
        }
 
        #endregion
    }
}