黄学彪
2020-01-06 72be4f06a683de33ddd563c8447c39f7f17e5b7d
ZigbeeApp/Shared/Phone/Device/CommonForm/DeviceDetailInfo.cs
@@ -21,7 +21,7 @@
        /// <summary>
        /// action
        /// </summary>
        public Action action;
        public Action<DeviceUI,Common.Room> EditAction;
        /// <summary>
        /// curRoom
        /// </summary>
@@ -39,6 +39,7 @@
        /// </summary>
        private DeviceInfoRow functionTypeRow;
        #endregion
        #region ◆ 移除____________________________
@@ -47,7 +48,6 @@
        /// </summary>
        public override void RemoveFromParent()
        {
            action();
            base.RemoveFromParent();
        }
        #endregion
@@ -118,7 +118,7 @@
                Height = Application.GetMinRealAverage(207),
                Gravity = Gravity.CenterHorizontal,
                BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
                Radius = (uint)Application.GetMinRealAverage(207)
                Radius = (uint)Application.GetMinRealAverage(207/2)
            };
            bodyFrameLayout.AddChidren(deviceBG);
@@ -129,7 +129,7 @@
                Height = Application.GetMinRealAverage(184),
                Gravity = Gravity.CenterHorizontal,
                BackgroundColor = ZigbeeColor.Current.GXCSelectedBackgroundColor,
                Radius = (uint)Application.GetMinRealAverage(184)
                Radius = (uint)Application.GetMinRealAverage(184/2)
            };
            bodyFrameLayout.AddChidren(deviceBG2);
@@ -143,14 +143,17 @@
            };
            bodyFrameLayout.AddChidren(deviceIMG);
            var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device.CommonDevice);
            var deviceTypeName = new Button()
            {
                Y = Application.GetRealHeight(360),
                Width = Application.GetRealWidth(900),
                Height = Application.GetRealHeight(80),
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                Text = DeviceUI.GetDeviceTypeName(device.CommonDevice.Type),
                Gravity = Gravity.CenterHorizontal
                TextID = info.BeloneTextId,
                Gravity = Gravity.CenterHorizontal,
                TextSize = 15
            };
            bodyFrameLayout.AddChidren(deviceTypeName);
@@ -162,6 +165,8 @@
                BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
            };
            bodyFrameLayout.AddChidren(infoFL);
            var rectCornerID = HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight;
            infoFL.SetCornerWithSameRadius(Application.GetRealHeight(50), rectCornerID);
            var tipBtn = new Button
            {
@@ -223,7 +228,7 @@
                functionTypeRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
                {
                    var DfunctionType = device.CommonDevice.DfunctionType;
                    //功能类型的翻译名字
                    int nowSelectNo = 1;
                    string strType = string.Empty;
@@ -272,19 +277,19 @@
                    };
                };
                sharedRow = new DeviceInfoRow(723);
                sharedRow.Init();
                sharedRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.Share)} : ");
                sharedRow.SetTitle("2人");
                infoFL.AddChidren(sharedRow);
                //sharedRow = new DeviceInfoRow(723);
                //sharedRow.Init();
                //sharedRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.Share)} : ");
                //sharedRow.SetTitle("2人");
                //infoFL.AddChidren(sharedRow);
            }
            else
            {
                sharedRow = new DeviceInfoRow(585);
                sharedRow.Init();
                sharedRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.Share)} : ");
                sharedRow.SetTitle("2人");
                infoFL.AddChidren(sharedRow);
                //sharedRow = new DeviceInfoRow(585);
                //sharedRow.Init();
                //sharedRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.Share)} : ");
                //sharedRow.SetTitle("2人");
                //infoFL.AddChidren(sharedRow);
            }
            var confirmBtn = new CommonForm.CompleteButton(962, 907, 127);
@@ -316,7 +321,7 @@
                    {
                        curRoom = rooms[index1][index2];
                        zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(floorIds[index1])} , {rooms[index1][index2].Name}");
                    }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongFloor),
                    }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongZone),
                   Language.StringByID(R.MyInternationalizationString.Confrim),
                   Language.StringByID(R.MyInternationalizationString.Cancel));
                }
@@ -336,7 +341,7 @@
                    {
                        curRoom = rs[index1];
                        zoneRow.SetTitle(rs[index1].Name);
                    }, 0,Language.StringByID(R.MyInternationalizationString.BelongFloor),
                    }, 0,Language.StringByID(R.MyInternationalizationString.BelongZone),
                   Language.StringByID(R.MyInternationalizationString.Confrim),
                   Language.StringByID(R.MyInternationalizationString.Cancel));
                }
@@ -405,19 +410,15 @@
                            CommonPage.Loading.Hide();
                            if (result)
                            {
                                var alertSuccess = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.Success), Language.StringByID(R.MyInternationalizationString.Confrim));
                                alertSuccess.Show();
                                alertSuccess.ResultEventHandler += (senderSuccess, eSuccess) =>
                                {
                                    //改房间
                                    Shared.Common.Room.CurrentRoom.ChangedRoom(device.CommonDevice, curRoom.Id);
                                    device.CommonDevice.ReSave();
                                    RemoveFromParent();
                                };
                                //改房间
                                Shared.Common.Room.CurrentRoom.ChangedRoom(device.CommonDevice, curRoom.Id);
                                device.CommonDevice.ReSave();
                                EditAction?.Invoke(device, curRoom);
                                RemoveFromParent();
                            }
                            else
                            {
                                CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.FailedPleaseTryAgain);
                                CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.FailedPleaseTryAgain));
                            }
                        });
                    })