From f23ad1b3f9f6193f35f72104d690b21dc67d5c1f Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 06 七月 2020 12:35:25 +0800 Subject: [PATCH] 去掉了访问外网的异步 --- ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs | 107 +++++++++++++++++++++++++++-------------------------- 1 files changed, 54 insertions(+), 53 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs index b36ff40..09a400e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs @@ -14,7 +14,7 @@ /// <summary> /// 妗屽竷鎺т欢 /// </summary> - private FrameLayout frameTable = null; + private NormalFrameLayout frameTable = null; /// <summary> /// 鍒楄〃鎺т欢(鐧借壊鑳屾櫙) /// </summary> @@ -87,13 +87,13 @@ var btnHomeName = rowHome.frameTable.AddLeftCaption(Common.Config.Instance.Home.Name, 700, 60); btnHomeName.TextSize = 15; btnHomeName.Y = Application.GetRealHeight(35); - rowHome.frameTable.AddChidren(btnHomeName, ChidrenBindMode.BindEventOnly); + rowHome.frameTable.AddChidren(btnHomeName, ChidrenBindMode.BindEvent); //褰撳墠浣忓畢 var btnNowView = rowHome.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uNowResidence), 700, 49); btnNowView.TextSize = 12; btnNowView.Y = Application.GetRealHeight(95); btnNowView.TextColor = UserCenterColor.Current.TextGrayColor1; - rowHome.frameTable.AddChidren(btnNowView, ChidrenBindMode.BindEventOnly); + rowHome.frameTable.AddChidren(btnNowView, ChidrenBindMode.BindEvent); //涓讳汉鎴栬�呯鐞嗗憳鎵嶄細鍑虹幇杩欎釜鑿滃崟 if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2) { @@ -102,6 +102,8 @@ } //缁忕含搴� var btnLocation = rowHome.frameTable.AddMostRightView(string.Empty, 500); + btnLocation.IsMoreLines = true; + btnLocation.TextSize = 10; btnLocation.Text = Common.Config.Instance.Home.ResidenceAddressName; //涓讳汉鎴栬�呯鐞嗗憳鎵嶄細鍑虹幇杩欎釜鑿滃崟 @@ -152,7 +154,7 @@ }; } //鍒濆鍖栨甯� - this.frameTable = new FrameLayout(); + this.frameTable = new NormalFrameLayout(); frameTable.Y = rowHome.Bottom + Application.GetRealHeight(23); frameTable.Height = listBackContr.frameTable.Height - rowHome.Bottom - Application.GetRealHeight(23); listBackContr.frameTable.AddChidren(frameTable); @@ -384,11 +386,6 @@ listDeleteId.Add(listAllRoom[i].Id); } } - //濡傛灉褰撳墠閫夋嫨鐨勬埧闂存槸鍒犻櫎瀵硅薄鐨勮瘽 - if (HdlRoomLogic.Current.CurrentRoom.FloorId == keys) - { - HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom(); - } //鍒犻櫎鎴块棿 foreach (string roomId in listDeleteId) { @@ -425,6 +422,8 @@ //璋冩暣妗屽竷楂樺害 this.AdjustContrlTableHeight(); } + //鍒犻櫎妤煎眰鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; }); }; } @@ -495,6 +494,8 @@ //鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠� this.InitFrameTableByMode(); } + //鍒涘缓鎴栬�呬慨鏀规ゼ灞傜殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; } }); } @@ -612,11 +613,6 @@ //纭鍒犻櫎鎴块棿? this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteRoomMsg), () => { - if (HdlRoomLogic.Current.CurrentRoom.Id == room.Id) - { - //濡傛灉鍒犻櫎鐨勬槸褰撳墠鎴块棿鐨勮瘽 - HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom(); - } HdlRoomLogic.Current.RemoveRoom(room.Id); //淇濆瓨椤哄簭 this.listRoomSort.Remove(room.Id); @@ -649,6 +645,8 @@ //璋冩暣妗屽竷楂樺害 this.AdjustContrlTableHeight(); } + //鍒犻櫎鎴块棿鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; }); }; } @@ -660,7 +658,7 @@ /// <summary> /// 鍒犻櫎浣忓畢 /// </summary> - public async void DeleteResidence() + private void DeleteResidence() { //寮�鍚繘搴︽潯 this.ShowProgressBar(); @@ -672,7 +670,7 @@ Pra.HomeId = Common.Config.Instance.Home.Id; Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); - bool result = await UserCenterLogic.GetResultStatuByRequestHttps("App/DelHome", true, Pra); + bool result = UserCenterLogic.GetResultStatuByRequestHttps("App/DelHome", true, Pra); if (result == false) { //鍏抽棴杩涘害鏉� @@ -688,7 +686,7 @@ HomeId = Common.Config.Instance.Home.Id, PrimaryUserId = Common.Config.Instance.Home.MainUserDistributedMark }; - bool result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/SubAccountDelShareHome", false, Pra2); + bool result = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/SubAccountDelShareHome", false, Pra2); if (result == false) { //鍏抽棴杩涘害鏉� @@ -720,18 +718,17 @@ } } - var myHouse = Common.House.GetHouseByFilePath(Common.Config.Instance.HomeFilePathList[index]); + var myHouse = HdlResidenceLogic.Current.GetHouseByFilePath(Common.Config.Instance.HomeFilePathList[index]); //鍒囨崲浣忓畢 Common.Config.Instance.HomeId = myHouse.Id; Common.Global.CreateHomeDirectory(myHouse.Id); Common.Config.Instance.Save(); //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenterLogic.InitUserCenterMenmoryAndThread(false); - HdlRoomLogic.Current.InitAllRoom(); + UserCenterLogic.InitUserCenterMenmoryAndThread(false); //鍒犻櫎浣忓畢 - Common.House.DeleteHouseByHouseId(deleteId); + HdlResidenceLogic.Current.DeleteHouseMemmory(deleteId); Application.RunOnMainThread(() => { @@ -751,47 +748,51 @@ /// <param name="latitude">绾害</param> /// <param name="longitude">缁忓害</param> /// <param name="addresName">浣嶇疆鍚嶇О</param> - private async void SaveResidenceAdrress(NormalViewControl btnLocation, double latitude, double longitude, string addresName) + private void SaveResidenceAdrress(NormalViewControl btnLocation, double latitude, double longitude, string addresName) { - //寮�鍚繘搴︽潯 - this.ShowProgressBar(); - - var Pra = new EditorResidencePra(); - Pra.HomeId = Common.Config.Instance.Home.Id; - Pra.Name = Common.Config.Instance.Home.Name; - Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); - Pra.Latitude = latitude; - Pra.Longitude = longitude; - - //缂栬緫浣忓畢 - bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("App/EditHome", true, Pra); - if (flage == false) + //濡傛灉涓嶆槸铏氭嫙浣忓畢,鎵嶆洿鏂颁簯绔� + if (Common.Config.Instance.Home.IsVirtually == false) { - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); - return; - } - //璁剧疆鍏ㄩ儴缃戝叧鐨勪綇瀹呭湴鍧� - var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway(); - foreach (var gateway in listGateway) - { - ZigBee.Device.ZbGateway realWay = null; - if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, gateway) == false) - { - //閿欒:缃戝叧瀵硅薄涓㈠け - continue; - } - var result = HdlGatewayLogic.Current.SetGatewaySite(gateway, longitude, latitude, ShowErrorMode.YES); - if (result == false) + //寮�鍚繘搴︽潯 + this.ShowProgressBar(); + + var Pra = new EditorResidencePra(); + Pra.HomeId = Common.Config.Instance.Home.Id; + Pra.Name = Common.Config.Instance.Home.Name; + Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); + Pra.Latitude = latitude; + Pra.Longitude = longitude; + + //缂栬緫浣忓畢 + bool flage = UserCenterLogic.GetResultStatuByRequestHttps("App/EditHome", true, Pra); + if (flage == false) { //鍏抽棴杩涘害鏉� this.CloseProgressBar(); return; } + //璁剧疆鍏ㄩ儴缃戝叧鐨勪綇瀹呭湴鍧� + var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway(); + foreach (var gateway in listGateway) + { + ZigBee.Device.ZbGateway realWay = null; + if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, gateway) == false) + { + //閿欒:缃戝叧瀵硅薄涓㈠け + continue; + } + var result = HdlGatewayLogic.Current.SetGatewaySite(gateway, longitude, latitude, ShowErrorMode.YES); + if (result == false) + { + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + return; + } + } + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); } - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); //淇濆瓨缂撳瓨 Common.Config.Instance.Home.Longitude = longitude; Common.Config.Instance.Home.Latitude = latitude; -- Gitblit v1.8.0