wxr
2023-07-30 d76b0e40e5bb127fd33aa1f7842447a1df0628d5
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs
@@ -24,7 +24,6 @@
        VideoDoorlockUser doorlockUser;
        public Action delCallBackAction;
        Loading waitPage;
        public VideoDoorlockUserManagerPage(Function function,VideoDoorlockUser user)
        {
@@ -32,9 +31,7 @@
            device = function;
            doorlockUser = user;
            BackgroundColor = CSS_Color.BackgroundColor;
            waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Hide();
        }
        public void LoadPage()
@@ -47,6 +44,8 @@
                Height = Application.GetRealHeight(667 - 70),
            };
            bodyView.AddChidren(contentView);
            #region 用户名称
            var userNameView = new FrameLayout()
@@ -113,7 +112,7 @@
                    {
                        return;
                    }
                    if (System.Text.Encoding.Default.GetBytes(str).Length > 20)
                    if (System.Text.Encoding.UTF8.GetBytes(str).Length > 20)
                    {
                        new Tip()
                        {
@@ -123,13 +122,15 @@
                        }.Show(bodyView);
                        return;
                    }
                    var waitPage = new Loading();
                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
                    bodyView.AddChidren(waitPage);
                    new System.Threading.Thread(() =>
                    {
                        try
                        {
                            var resultObj = ApiUtlis.Ins.HttpRequest.EditDoorlockUserName(device.deviceId, doorlockUser.extUserId, str);
                            if (resultObj.Code == StateCode.SUCCESS)
                            var pack = ApiUtlis.Ins.HttpRequest.EditDoorlockUserName(device.deviceId, doorlockUser.extUserId, str);
                            if (pack.Code == StateCode.SUCCESS)
                            {
                                Application.RunOnMainThread(() =>
                                {
@@ -139,7 +140,23 @@
                            else
                            {
                                //失败提示
                                IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
                                Application.RunOnMainThread(() =>
                                {
                                    if (string.IsNullOrEmpty(pack.message))
                                    {
                                        pack.message = Language.StringByID(StringId.OperationFailed);
                                    }
                                    {
                                        var tip = new Tip()
                                        {
                                            MaxWidth = Application.GetRealWidth(300),
                                            Text = $"{pack.message}({pack.Code})",
                                            CloseTime = 3,
                                            Direction = AMPopTipDirection.None
                                        };
                                        tip.Show(MainPage.BaseView);
                                    }
                                });
                            }
                        }
                        catch (Exception ex)
@@ -151,6 +168,11 @@
                            Application.RunOnMainThread(() =>
                            {
                                waitPage.Hide();
                                if(waitPage!= null)
                                {
                                    waitPage.RemoveFromParent();
                                    waitPage = null;
                                }
                            });
                        }
                    })
@@ -158,7 +180,7 @@
                };
                var pa = new PublicAssmebly();
                pa.entryMaxLength = 20;
                pa.LoadDialog_EditParater(StringId.ChangeName, doorlockUser.lockUserName, callBack, StringId.UesrNameCannotBeEmpty, 0, new List<string>());
                pa.LoadDialog_EditParater(StringId.ChangeName, "", callBack, StringId.UesrNameCannotBeEmpty, 0, new List<string>());
            };
            btnUserName.MouseUpEventHandler = eventHandler;
            btnEditUserNameIcon.MouseUpEventHandler = eventHandler;
@@ -169,7 +191,7 @@
        void initOptionView(bool isEdit)
        {
            if(doorlockUser.faceCount == 0&&
                doorlockUser.faceCount == 0 &&
                doorlockUser.fingerCount == 0 &&
                doorlockUser.pwdCount == 0 &&
                doorlockUser.cardCount == 0)
            {
@@ -183,17 +205,17 @@
            int childrenViewHeight = Application.GetRealWidth(116);
            int permissionsViewHeight = Application.GetRealHeight(291 + 92);
            int permissionsViewHeight = Application.GetRealHeight(291 + 92 + 100);
            if (userPermissionsView!= null)
            {
                userPermissionsView.RemoveAll();
                if (isEdit)
                {
                    permissionsViewHeight = Application.GetRealHeight(391 + 50);
                    permissionsViewHeight = Application.GetRealHeight(391 + 50 + 100);
                    childrenViewHeight = Application.GetRealWidth(156);
                }
                userPermissionsView.Height = permissionsViewHeight;
                userPermissionsView.Height = permissionsViewHeight ;
            }
            else
            {
@@ -315,7 +337,9 @@
                    fingerprintView.AddChidren(btnClearFingerprints);
                    btnClearFingerprints.MouseUpEventHandler = (sender, e) =>
                    {
                        var waitPage = new Loading();
                        waitPage.Start(Language.StringByID(StringId.PleaseWait));
                    bodyView.AddChidren(waitPage);
                        new System.Threading.Thread(() =>
                        {
                            try
@@ -356,6 +380,11 @@
                                Application.RunOnMainThread(() =>
                                {
                                    waitPage.Hide();
                                    if (waitPage != null)
                                    {
                                        waitPage.RemoveFromParent();
                                        waitPage = null;
                                    }
                                });
                            }
                        })
@@ -425,7 +454,9 @@
                    digitalPasswordView.AddChidren(btnClearDigitalPassword);
                    btnClearDigitalPassword.MouseUpEventHandler = (sender, e) =>
                    {
                        var waitPage = new Loading();
                        waitPage.Start(Language.StringByID(StringId.PleaseWait));
                    bodyView.AddChidren(waitPage);
                        new System.Threading.Thread(() =>
                        {
                            try
@@ -466,6 +497,11 @@
                                Application.RunOnMainThread(() =>
                                {
                                    waitPage.Hide();
                                    if (waitPage != null)
                                    {
                                        waitPage.RemoveFromParent();
                                        waitPage = null;
                                    }
                                });
                            }
                        })
@@ -534,7 +570,9 @@
                    };
                    nfcView.AddChidren(btnClearNfc);
                    btnClearNfc.MouseUpEventHandler = (sender, e) => {
                        var waitPage = new Loading();
                        waitPage.Start(Language.StringByID(StringId.PleaseWait));
                    bodyView.AddChidren(waitPage);
                        new System.Threading.Thread(() =>
                        {
                            try
@@ -574,6 +612,11 @@
                                Application.RunOnMainThread(() =>
                                {
                                    waitPage.Hide();
                                    if (waitPage != null)
                                    {
                                        waitPage.RemoveFromParent();
                                        waitPage = null;
                                    }
                                });
                            }
                        })
@@ -642,7 +685,9 @@
                    };
                    faceView.AddChidren(btnClearFace);
                    btnClearFace.MouseUpEventHandler = (sender, e) => {
                        var waitPage = new Loading();
                        waitPage.Start(Language.StringByID(StringId.PleaseWait));
                    bodyView.AddChidren(waitPage);
                        new System.Threading.Thread(() =>
                        {
                            try
@@ -682,6 +727,11 @@
                                Application.RunOnMainThread(() =>
                                {
                                    waitPage.Hide();
                                    if (waitPage != null)
                                    {
                                        waitPage.RemoveFromParent();
                                        waitPage = null;
                                    }
                                });
                            }
                        })
@@ -699,7 +749,7 @@
            var delUserView = new FrameLayout()
            {
                Y = unlockOptionView.Bottom,
                Height = Application.GetRealHeight(110),
                Height = Application.GetRealHeight(310),
                BackgroundColor = CSS_Color.BackgroundColor,
            };
            userPermissionsView.AddChidren(delUserView);
@@ -722,6 +772,7 @@
            {
                new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteDoorlockUserTip, () =>
                {
                    var waitPage = new Loading();
                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
                    new System.Threading.Thread(() =>
                    {
@@ -743,6 +794,9 @@
                            {
                                Application.RunOnMainThread(() =>
                                {
                                    if (string.IsNullOrEmpty(pack.message)) {
                                        pack.message = Language.StringByID(StringId.OperationFailed);
                                    }
                                    //失败提示
                                    var tip = new Tip()
                                    {
@@ -764,6 +818,11 @@
                            Application.RunOnMainThread(() =>
                            {
                                waitPage.Hide();
                                if (waitPage != null)
                                {
                                    waitPage.RemoveFromParent();
                                    waitPage = null;
                                }
                            });
                        }
                    })