CrabtreeOn,印度客户定制APP,迁移2.0平台版本
wxr
2023-02-01 c96d62ac9c6bb1d880a9170f9dd477fcb5f76fc0
备注同步功能
3个文件已删除
6个文件已修改
122 ■■■■■ 已修改文件
.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/ON/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/ON/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/MainPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Room/GenericDialog.cs 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserDeviceListPage.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.DS_Store
Binary files differ
Crabtree/.DS_Store
Binary files differ
Crabtree/ON/.DS_Store
Binary files differ
Crabtree/ON/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.801062" android:versionCode="202301062">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.802011" android:versionCode="202302011">
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="30" />
    <!-- 在安卓P版本之后,必须要授予FOREGROUND_SERVICE权限,才能够使用前台服务 -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
Crabtree/SmartHome/UI/SimpleControl/MainPage.cs
@@ -38,7 +38,7 @@
        //public static Button LogoButton = new Button ();
  
        public static string RequestVersion = "2.801091";
        public static string RequestVersion = "2.802011";
        public static UserInfo LoginUser;
        /// <summary>
        /// 是否是管理员权限(变更了,成员的时候,这个也为ture。为什么会声明这样变量,因为有些接口必须使用原来的Token)
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
@@ -86,6 +86,7 @@
            //etAccount.Text = "2791308028@qq.com";
            etAccount.Text = "464027401@qq.com";
            etAccount.Text = "460649739@qq.com";
            etAccount.Text = "1489771324@qq.com";
            //etAccount.Text = "jai.panghal2201@gmail.com";
            //etAccount.Text = "858539859@qq.com";
#endif
@@ -143,6 +144,7 @@
            //etPasswrod.Text = "123456";
            etPasswrod.Text = "123456";
            etPasswrod.Text = "kkkkkk333";
            etPasswrod.Text = "Hdl1985.";
            //etPasswrod.Text = "Haryana@2201";
#endif
            passwrodView.AddChidren (etPasswrod);
Crabtree/SmartHome/UI/SimpleControl/Phone/Room/GenericDialog.cs
@@ -96,6 +96,8 @@
            dialogBottomView.AddChidren (editor);
            editor.MouseUpEventHandler += (dff, ffd) => {
                string remakeStr = etDeviceName.Text.Trim ();
                if (string.IsNullOrEmpty (remakeStr)) {
                    //备注不能为空
@@ -107,6 +109,21 @@
                if (remakeBytes.Length > 20) {
                    new Alert ("", ErrorCode.RemarkLengthExceededTheLimit, "Close").Show ();
                    return;
                }
                //修改云端备注
                var cloudDataLoop = CommonConfig.Current.FunctionList.Find ((obj) => obj.bus.SubnetID == commonDevice.SubnetID
                 && obj.bus.DeviceID == commonDevice.DeviceID && obj.bus.LoopId == commonDevice.LoopID);
                if (cloudDataLoop == null) {
                    new Alert (Language.StringByID (R.MyInternationalizationString.Tip), "Data is not synchronized to the cloud.", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                } else {
                    new System.Threading.Thread (() => {
                        var http = new HttpServerRequest ();
                        var pack = http.EditDeviceName (cloudDataLoop.deviceId, UserConfig.Instance.CurrentRegion.Id, remakeStr);
                        if (pack.Code != "0") {
                            new Alert (Language.StringByID (R.MyInternationalizationString.Tip), $"Cloud data modification failed({pack.Code}).", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                        }
                    }) { IsBackground = true }.Start ();
                }
                MainPage.Loading.Start ();
@@ -146,14 +163,14 @@
                                IO.FileUtils.SaveEquipmentMessage (commonDevice, commonDevice.LoopID.ToString ());
                            }
                            successAction?.Invoke ();
                            //IO.FileUtils.SaveEquipmentMessage (commonDevice, commonDevice.LoopID.ToString ());
                            MainPage.Loading.Hide ();
                            dialog.Close ();
                        });
                        //修改成功回调
                        successAction?.Invoke ();
                    } else {
                        Application.RunOnMainThread (() => {
                            new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.FailureToModify), Language.StringByID (R.MyInternationalizationString.Close)).Show ();
@@ -162,6 +179,76 @@
                        });
                    }
                });
                //string remakeStr = etDeviceName.Text.Trim ();
                //if (string.IsNullOrEmpty (remakeStr)) {
                //    //备注不能为空
                //    new Alert ("", ErrorCode.RemarksCannotBeEmpty, "Close").Show ();
                //    return;
                //}
                //byte [] remakeBytes = CommonPage.MyEncodingGB2312.GetBytes (remakeStr);
                //if (remakeBytes.Length > 20) {
                //    new Alert ("", ErrorCode.RemarkLengthExceededTheLimit, "Close").Show ();
                //    return;
                //}
                //MainPage.Loading.Start ();
                ////byte [] remakeBytes = CommonPage.MyEncodingGB2312.GetBytes (etDeviceName.Text.Trim ());
                //System.Threading.Tasks.Task.Run (() => {
                //    byte [] updateBytes = null;
                //    if (commonDevice.Type == DeviceType.LightSwitchSocket) {
                //        updateBytes = Control.ControlBytesSendHasReturn (Command.ReadDeviceLoopInfo, commonDevice.SubnetID, commonDevice.DeviceID, new byte [] { commonDevice.BigClass, 1, commonDevice.LoopID });
                //    } else {
                //        updateBytes = Control.ControlBytesSendHasReturn (Command.ReadDeviceLoopInfo, commonDevice.SubnetID, commonDevice.DeviceID, new byte [] { commonDevice.BigClass, commonDevice.MinClass, commonDevice.LoopID });
                //    }
                //    if (updateBytes == null) {
                //        Application.RunOnMainThread (() => {
                //            new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.TipEquipmentNotOnline), Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                //            MainPage.Loading.Hide ();
                //            dialog.Close ();
                //        });
                //        return;
                //    }
                //    byte [] uBytes = new byte [20];
                //    Array.Copy (remakeBytes, 0, uBytes, 0, remakeBytes.Length < 20 ? remakeBytes.Length : 20);
                //    Array.Copy (uBytes, 0, updateBytes, 3, 20 < uBytes.Length ? 20 : uBytes.Length);
                //    byte [] reBytes = Control.ControlBytesSendHasReturn (Command.SetDeviceLoopInfo, commonDevice.SubnetID, commonDevice.DeviceID, updateBytes);
                //    if (reBytes != null) {
                //        Application.RunOnMainThread (() => {
                //            btnEquipment.Text = commonDevice.Name = etDeviceName.Text.Trim ();
                //            if (commonDevice.Type == DeviceType.InfraredMode) {
                //                //2020-07-03 修复红外电视修改后变红外模块问题
                //                InfraredMode mTV = Newtonsoft.Json.JsonConvert.DeserializeObject<InfraredMode> (System.Text.Encoding.UTF8.GetString (commonBytes));
                //                if (mTV == null) {
                //                    IO.FileUtils.SaveEquipmentMessage (commonDevice, commonDevice.LoopID.ToString ());
                //                } else {
                //                    mTV.Name = etDeviceName.Text.Trim ();
                //                    IO.FileUtils.SaveEquipmentMessage (mTV, mTV.LoopID.ToString ());
                //                }
                //            } else {
                //                IO.FileUtils.SaveEquipmentMessage (commonDevice, commonDevice.LoopID.ToString ());
                //            }
                //            //IO.FileUtils.SaveEquipmentMessage (commonDevice, commonDevice.LoopID.ToString ());
                //            MainPage.Loading.Hide ();
                //            dialog.Close ();
                //        });
                //        //修改成功回调
                //        successAction?.Invoke ();
                //    } else {
                //        Application.RunOnMainThread (() => {
                //            new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.FailureToModify), Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                //            MainPage.Loading.Hide ();
                //            dialog.Close ();
                //        });
                //    }
                //});
            };
            dialog.Show ();
        }
Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserDeviceListPage.cs
@@ -443,11 +443,19 @@
                                    }
                                    //修改云端备注
                                    new System.Threading.Thread (() => {
                                        var http = new HttpServerRequest ();
                                        http.EditDeviceName (commonDevice.DeviceID.ToString (), UserConfig.Instance.CurrentRegion.Id, remakeStr);
                                    }) { IsBackground = true }.Start ();
                                    var cloudDataLoop = CommonConfig.Current.FunctionList.Find ((obj) => obj.bus.SubnetID == commonDevice.SubnetID
                                     && obj.bus.DeviceID == commonDevice.DeviceID && obj.bus.LoopId == commonDevice.LoopID);
                                    if (cloudDataLoop == null) {
                                        new Alert (Language.StringByID (R.MyInternationalizationString.Tip), "Data is not synchronized to the cloud.", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                                    } else {
                                        new System.Threading.Thread (() => {
                                            var http = new HttpServerRequest ();
                                            var pack = http.EditDeviceName (cloudDataLoop.deviceId, UserConfig.Instance.CurrentRegion.Id, remakeStr);
                                            if (pack.Code != "0") {
                                                new Alert (Language.StringByID (R.MyInternationalizationString.Tip), $"Cloud data modification failed({pack.Code}).", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                                            }
                                        }) { IsBackground = true }.Start ();
                                    }
                                    MainPage.Loading.Start ();
                                    //byte [] remakeBytes = CommonPage.MyEncodingGB2312.GetBytes (etDeviceName.Text.Trim ());
Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs
@@ -1096,6 +1096,8 @@
                    fhRowView.AddChidren (btnFHNull);
                    #endregion
                }
                //InitRoomView (roomFilePath);
                foreach (var devcieCommon in room.DeviceList) {
                    if (devcieCommon == null)
                        continue;
@@ -2401,6 +2403,7 @@
                //if (!roomDeviceFilePathList.Contains (filePath)) {
                //    roomDeviceFilePathList.Add (filePath);
                //}
            };
            GenericDialog.Current.ShowModifyRemarksDialog (commonDevice, commonBytes, btnEquipment, successAction);
        }