wxr
2021-07-01 93c3423f0fdb79500b3779e2fcbd3a041be061fd
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs
@@ -1,95 +1,140 @@
using System;
using Shared;
using HDL_ON.UI.CSS;
using HDL_ON.Stan;
namespace HDL_ON.UI
{
    /// <summary>
    /// 管理员权限迁移确认提醒界面
    /// </summary>
    public class AdminMigrationConfirmPage : EditorCommonForm
    public class AdminMigrationConfirmPage : FrameLayout
    {
        #region ■ 变量声明___________________________
        #endregion
        #region ■ 初始化_____________________________
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        ///
        /// </summary>
        public void ShowForm()
        {
            //管理员权限转移
            base.SetTitleText(Language.StringByID(StringId.AdminAuthorityTransfer));
        FrameLayout bodyView;
            //初始化中部信息
            this.InitMiddleFrame();
        public AdminMigrationConfirmPage()
        {
            bodyView = this;
        }
        /// <summary>
        /// 初始化中部信息
        ///
        /// </summary>
        private void InitMiddleFrame()
        public void LoadPage()
        {
            //清空bodyFrame
            this.ClearBodyFrame();
            BackgroundColor = CSS_Color.MainBackgroundColor;
            //账号自己的头像
            var btnHeadImage = new ImageView();
            btnHeadImage.X = Application.GetRealWidth(48);
            btnHeadImage.Y = Application.GetRealHeight(32);
            btnHeadImage.Width = Application.GetRealWidth(84);
            btnHeadImage.Height = Application.GetRealWidth(84);
            btnHeadImage.Radius = (uint)Application.GetRealWidth(42);
            btnHeadImage.ImagePath = UserInfo.Current.headImagePagePath;
            bodyFrameLayout.AddChidren(btnHeadImage);
            new TopViewDiv(bodyView, Language.StringByID(StringId.AdministratorPermissionMigration)).LoadTopView();
            //箭头
            var btnArrow = new PicViewControl(84, 32);
            btnArrow.X = btnHeadImage.Right + Application.GetRealWidth(12);
            btnArrow.Y = Application.GetRealHeight(58);
            btnArrow.UnSelectedImagePath = "PersonalCenter/Transfer.png";
            bodyFrameLayout.AddChidren(btnArrow);
            //一个默认头像
            var btnHead2 = new IconViewControl(102);
            btnHead2.X = btnArrow.Right + Application.GetRealWidth(3);
            btnHead2.Y = Application.GetRealHeight(26);
            btnHead2.UnSelectedImagePath = "PersonalCenter/Head.png";
            bodyFrameLayout.AddChidren(btnHead2);
            //您将转移您的管理员权限给其他成员
            this.AddListMsgControls(bodyFrameLayout, Language.StringByID(StringId.AdminAuthorityTransferMag1), CSS_FontSize.SubheadingFontSize,
                CSS_Color.FirstLevelTitleColor, Application.GetRealHeight(23), btnHead2.Bottom + Application.GetRealHeight(12));
            //请注意:
            var btnAttention = new NormalViewControl(200, 18, true);
            btnAttention.X = HdlControlResourse.XXLeft;
            btnAttention.Y = btnHeadImage.Bottom + Application.GetRealHeight(84);
            btnAttention.TextID = StringId.Attention;
            btnAttention.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
            btnAttention.TextColor = CSS_Color.FirstLevelTitleColor;
            bodyFrameLayout.AddChidren(btnAttention);
            //1.该住宅您的管理员数据(云端数据)将全部转移给新的管理员
            //2.您的数据将会与目标成员互换,您的权限将变更为目标成员的权限
            var listContr = this.AddListMsgControls(bodyFrameLayout, Language.StringByID(StringId.AdminAuthorityTransferMag2), CSS_FontSize.PromptFontSize_FirstLevel,
                CSS_Color.TextualColor, Application.GetRealHeight(18), btnAttention.Bottom + Application.GetRealHeight(8), TextAlignment.CenterLeft);
            //确认转移
            var btnConfirm = new BottomClickButton(220);
            btnConfirm.Y = listContr[listContr.Count - 1].Bottom + Application.GetRealHeight(75);
            btnConfirm.TextID = StringId.ConfirmTransfer2;
            bodyFrameLayout.AddChidren(btnConfirm);
            btnConfirm.ButtonClickEvent += (sender, e) =>
            #region 头像
            FrameLayout headView = new FrameLayout()
            {
                var form = new AdminMigrationMemberListPage();
                form.AddForm();
                Y = Application.GetRealHeight(72),
                Height = Application.GetRealHeight(132),
            };
            bodyView.AddChidren(headView);
            ImageView myHeadImage = new ImageView()
            {
                X = Application.GetRealWidth(48),
                Y = Application.GetRealHeight(96),
                Width = Application.GetRealWidth(84),
                Height = Application.GetRealWidth(84),
                Radius = (uint)Application.GetRealWidth(42),
                ImagePath = UserInfo.Current.headImagePagePath,
                Gravity = Gravity.CenterVertical,
            };
            headView.AddChidren(myHeadImage);
            ImageView transferImage = new ImageView()
            {
                X = Application.GetRealWidth(144),
                Y = Application.GetRealHeight(96),
                Width = Application.GetRealWidth(84),
                Height = Application.GetRealWidth(32),
                ImagePath = "PersonalCenter/Transfer.png",
                Gravity = Gravity.Center,
            };
            headView.AddChidren(transferImage);
            ImageView otherHeadImage = new ImageView()
            {
                X = Application.GetRealWidth(231),
                Y = Application.GetRealHeight(96),
                Width = Application.GetRealWidth(101),
                Height = Application.GetRealWidth(101),
                ImagePath = "PersonalCenter/Head.png",
                Gravity = Gravity.CenterVertical,
            };
            headView.AddChidren(otherHeadImage);
            #endregion
            var btnTip = new Button()
            {
                Y = headView.Bottom,
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(22),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                Text = "您将转移您的管理员权限给其他HDL账号",
            };
            bodyView.AddChidren(btnTip);
            //请注意
            var btnPleaseNote = new Button()
            {
                Y = btnTip.Bottom + Application.GetRealHeight(38),
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(17),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = "请注意:",
            };
            bodyView.AddChidren(btnPleaseNote);
            //请注意的内容
            var btnPleaseNoteStr = new Button()
            {
                Y = btnPleaseNote.Bottom + Application.GetRealHeight(8),
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(170),
                TextAlignment = TextAlignment.TopLeft,
                TextColor = CSS_Color.TextualColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                IsMoreLines = true,
                Text = "1.该住宅您的管理员数据(云端数据)将全部转移给新的管理员 \n\n2.新的管理员可以选择不保留原有住宅成员的数据,其他成员将会不能使用 \n\n3.在转移后,您若需要成为家庭成员,由新的管理员设置 \n\n4.接收方账号为有效的HDL账号 \n\n5.接收方账号与转移方账号不可为同一个账号 (绑定的其他登录)",
            };
            bodyView.AddChidren(btnPleaseNoteStr);
            //
            var btnConfirm = new ConfirmButton()
            {
                Y = Application.GetRealHeight(583),
                Text = "确认转移",
            };
            bodyView.AddChidren(btnConfirm);
            btnConfirm.MouseUpEventHandler = (sender, e) => {
                //Utlis.ShowTip("暂不支持");
                var skipPage = new AdminMigrationInputPage();
                MainPage.BasePageView.AddChidren(skipPage);
                skipPage.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
        }
        #endregion
    }
}