wxr
2023-04-07 a3313818a548d51777ae4e6cc006e9d1e2c1036e
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
@@ -76,7 +76,7 @@
        /// <summary>
        /// 表示来自那个界面
        /// </summary>
        private UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom Comerom;
        private CommonMethod.Comerom comerom;
        /// <summary>
        /// 删除设备后需要更新界面的回调
        /// </summary>
@@ -88,14 +88,14 @@
        /// 构造函数
        /// </summary>
        /// <param name="function">设备</param>
        /// <param name="btnDeviceName">上一级界面的设备名字控件</param>
        /// <param name="btnRoomName">上一级界面的房间名字控件</param>
        public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom comerom, Action action)
        /// <param name="btnDeviceName">上一级界面的设备名字控件(注:不能传null,没有可以传new Button())</param>
        /// <param name="btnRoomName">上一级界面的房间名字控件(注:不能传null,没有可以传new Button())</param>
        public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, CommonMethod.Comerom comerom, Action action)
        {
            this.device = function;
            this.btnDeviceName = btnDeviceName;
            this.btnRoomName = btnRoomName;
            this.Comerom = comerom;
            this.comerom = comerom;
            this.action = action;
        }
@@ -108,8 +108,6 @@
            this.EventListener();
            //读取数据
            this.ReadData();
        }
@@ -276,38 +274,39 @@
            //返回
            this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
            {
                RemoveFromParent();
                this.RemoveFromParent();
            };
            //设置
            this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) =>
            {
                //调用秀绕的界面
                var infoView = new UI.FunctionBaseInfoSetPage(this.device, () =>
                CommonMethod.Current.MainThread(() =>
                {
                    //调用秀绕的界面
                    var infoView = new UI.FunctionBaseInfoSetPage(this.device, () =>
                     {
                         if (this.btnDeviceName == null || this.btnRoomName == null || this.device == null)
                         {
                             return;
                         }
                         ////刷新显示
                         this.btnDeviceName.Text = this.device.name;
                         this.btnRoomName.Text = this.device.GetRoomListName();
                         this.btnCurrDeviceName.Text = this.device.name;
                         this.btnCurrDeviceRoom.Text = this.device.GetRoomListName();
                         this.CalculatedPosition();//重新计算宽度
                     });
                    infoView.actionDel += () =>
                      {
                          //解绑设备后
                          this.RemoveFromParent();
                          this.action?.Invoke();
                    if (this.btnDeviceName == null || this.btnRoomName == null)
                    {
                        return;
                    }
                    ////刷新显示
                    this.btnDeviceName.Text = this.device.name;
                    this.btnRoomName.Text = this.device.GetRoomListName();
                    this.btnCurrDeviceName.Text = this.device.name;
                    this.btnCurrDeviceRoom.Text = this.device.GetRoomListName();
                    this.CalculatedPosition();//重新计算宽度
                }, () =>
                {
                    //解绑设备后
                    this.RemoveFromParent();
                    this.action?.Invoke();
                      };
                    MainPage.BasePageView.AddChidren(infoView);
                    infoView.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                });
                MainPage.BasePageView.AddChidren(infoView);
                infoView.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            //收藏
            this.btnCollectIcon.MouseUpEventHandler += (sender, e) =>
@@ -318,15 +317,17 @@
            //实时视频
            this.rtvFL.SetClickListener((fl, btnStateImage, btnStateText) =>
            {
               CommonMethod.Current.SkipRTVActivity(this.device.sid,this.device.deviceId,this.device.spk);
                CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk, false);
            });
            //临时密码
            this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => {
                CommonMethod.Current.SkipPSWActivity();
            this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) =>
            {
                CommonMethod.Current.SkipPSWActivity(this.device.deviceId);
            });
            //历史记录
            this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) => {
                CommonMethod.Current.SkipRecordActivity();
            this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) =>
            {
                CommonMethod.Current.SkipRecordActivity(this.device.deviceId);
            });
@@ -336,16 +337,14 @@
        /// </summary>
        private void ReadData()
        {
            Loading loading = new Loading();
            this.AddChidren(loading);
            loading.Start();
            new System.Threading.Thread(() =>
            CommonMethod.Current.Loading.Start();
            CommonMethod.Current.SunThread(() =>
            {
                try
                {
                    var videoDoorLockInfo = UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetVideoDoorLockState(this.device);
                    var cellInfo = UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetCellValue(this.device);
                    Application.RunOnMainThread(() =>
                    var videoDoorLockInfo = VideDoorLockSend.Current.GetVideoDoorLockState(this.device);
                    var cellInfo = VideDoorLockSend.Current.GetCellValue(this.device);
                    CommonMethod.Current.MainThread(() =>
                    {
                        //this.cellDiyArcSeekBar.Progress = i;
                        //更新电量值
@@ -358,12 +357,13 @@
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        CommonMethod.Current.Loading.Hide();
                    });
                }
            })
            { IsBackground = true }.Start();
            });
        }
        /// <summary>
        /// 重新计算宽度(设备名称,房间控件)
@@ -385,6 +385,33 @@
            this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20);
        }
        /// <summary>
        /// 更新状态
        /// </summary>
        public void UpdateState(PushMessageType pushMessageType)
        {
            CommonMethod.Current.MainThread(() =>
            {
                if (pushMessageType == PushMessageType.Alarm)
                {
                    //门锁电池值
                    if (this.btnCell != null)
                    {
                        //videoDoorLockPage.btnCell.Text = "";
                    }
                }
                else
                {
                    if (this.btnDoorLockIcon != null && !this.btnDoorLockIcon.IsSelected)
                    {
                        this.btnDoorLockIcon.IsSelected = false;
                    }
                }
            });
        }
    }
    /// <summary>
    /// 自己弄一个FrameLayout