From c00da77d00a479fa5d022346a6d9075f90a5c087 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期六, 14 九月 2024 10:05:34 +0800 Subject: [PATCH] 退出登录时间调整,新风,音乐 --- HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL-ON_iOS/Info.plist | 4 HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs | 13 ++- HDL_ON/Common/HDLCommon.cs | 92 ++++++++++++---------- HDL_ON/DAL/Server/HttpUtil.cs | 2 HDL_ON/Common/ApiUtlis.cs | 81 +++++++++++-------- HDL_ON/DAL/DriverLayer/Control.cs | 2 HDL_ON/UI/MainPage.cs | 2 HDL_ON/UI/UI1-Login/LoginPage.cs | 10 +- HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs | 17 ++++ HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs | 9 ++ 12 files changed, 144 insertions(+), 92 deletions(-) diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index d3a57ee..48ceb39 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-ON_Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.6.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202409111"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.6.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202409121"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <!--绋嬪簭鍙互璇诲彇璁惧澶栭儴瀛樺偍绌洪棿(鍐呯疆SDcard鍜屽缃甋DCard)鐨勬枃浠讹紝鎴戠殑鏂囦欢绛�--> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index a30b196..600dad0 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -11,7 +11,7 @@ <key>CFBundleName</key> <string>On Pro</string> <key>CFBundleShortVersionString</key> - <string>2.6.0</string> + <string>2.5.1</string> <key>CFBundleURLTypes</key> <array> <dict> @@ -36,7 +36,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>2.6.0</string> + <string>2.5.1</string> <key>LSApplicationQueriesSchemes</key> <array> <string>weixinULAPI</string> diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs index 9040806..2992899 100644 --- a/HDL_ON/Common/ApiUtlis.cs +++ b/HDL_ON/Common/ApiUtlis.cs @@ -73,6 +73,11 @@ /// </summary> public bool DownloadDataComplete = false; + /// <summary> + /// token鏄惁鏈夋晥 + /// </summary> + public bool tokenInvalid = false; + public bool hadInternet = true; /// <summary> /// 涓嬭浇鏁版嵁 @@ -127,7 +132,7 @@ } catch (Exception ex) { - MainPage.Log($"{this.GetType()}:鍔犺浇缂撳瓨鎴块棿鏁版嵁寮傚父:{ex.Message}"); + MainPage.Log("Error",$"{this.GetType()}:鍔犺浇缂撳瓨鎴块棿鏁版嵁寮傚父:{ex.StackTrace}"); } try @@ -141,10 +146,8 @@ } catch (Exception ex) { - MainPage.Log($"{this.GetType()}:鍔犺浇缂撳瓨璁惧鏁版嵁寮傚父:{ex.Message}"); + MainPage.Log("Error", $"{this.GetType()}:鍔犺浇缂撳瓨璁惧鏁版嵁寮傚父:{ex.StackTrace}"); } - - return; } else @@ -154,7 +157,7 @@ } catch (Exception ex) { - MainPage.Log($"Error锛氫笅杞芥暟鎹�1锛歿ex.Message}"); + MainPage.Log("Error", $"涓嬭浇鏁版嵁1锛歿ex.StackTrace}"); DownloadDataComplete = true; return; } @@ -175,6 +178,7 @@ MainPage.Log($"杩涘叆璇诲彇浜戠鏁版嵁绾跨▼"); //===================鍒锋柊Token======================= code = Ins.HttpRequest.RefreshToken(); + if (code != StateCode.SUCCESS) { if (waitPage != null) @@ -277,9 +281,10 @@ { var ssd = System.Text.Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(revData.list)); FileUtlis.Files.WriteFileByBytes("SpatialInfoData", ssd); - }catch(Exception ex) + } + catch (Exception ex) { - MainPage.Log($"{this.GetType()}:淇濆瓨鎴块棿淇℃伅寮傚父锛歿ex.Message}"); + MainPage.Log("Error", $"{this.GetType()}:淇濆瓨鎴块棿淇℃伅寮傚父锛歿ex.StackTrace}"); } }) { IsBackground = true }.Start(); @@ -301,7 +306,7 @@ { FunctionList.List.ClearDatas(); MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛"); - MainPage.Log($"sid鍒楄〃鑾峰彇====\r\n" , deviceResult.Data.ToString()); + MainPage.Log($"sid鍒楄〃鑾峰彇====\r\n", deviceResult.Data.ToString()); var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); if (deviceList == null) { @@ -325,7 +330,7 @@ } finally { - + } string delFile = ""; @@ -356,8 +361,8 @@ foreach (var newFunction in deviceList.list) { newFunction.AssembleStatus(); - newFunction.SaveFunctionFile(); - FunctionList.List.IniFunctionList(newFunction.savePath,true); + newFunction.SaveFunctionFile(); + FunctionList.List.IniFunctionList(newFunction.savePath, true); //MainPage.Log($"============璁惧============{iiii++}"); } @@ -380,7 +385,7 @@ string videoList = videoInfo.Data.ToString(); FunctionList.List.videoIntercom = JsonConvert.DeserializeObject<List<UI.UI2.FuntionControlView.Video.Video>>(videoList); - for(int i =0;i< FunctionList.List.videoIntercom.Count;i++) + for (int i = 0; i < FunctionList.List.videoIntercom.Count; i++) { var video = FunctionList.List.videoIntercom[i]; @@ -404,7 +409,7 @@ --i; }catch(Exception ex) { - MainPage.Log($"ios 鍏ㄨ閫氬紓甯� : {ex.Message}"); + MainPage.Log("Error", $"ios 鍏ㄨ閫氬紓甯� : {ex.StackTrace}"); } #else @@ -423,7 +428,7 @@ //濡傛灉妫�娴嬬嚎绋嬫病鍚姩锛屾墠缁х画涓嬮潰鎿嶄綔 鍥犱负App鏈夊彲鑳藉垰鍚姩椹笂鏀跺埌鎺ㄩ�佷簡锛岀劧鍚庢墠鎵ц鍒拌繖閲� if (HDLLinphone.Current.CheckIncomingCallThreadIsNull()) { - + //褰撳墠浣忓畢鏄疕DL鍙瀵硅绫诲瀷鐨勮澶� if (isInterphoneType_HDL) { @@ -480,16 +485,16 @@ { MainPage.Log($"璇诲彇浜戠璁惧鏁版嵁澶辫触:Code:{deviceResult.Code}; Msg:{deviceResult.message}"); } - }catch (Exception ex) + } + catch (Exception ex) { - MainPage.Log($"============璁惧============{ex.Message}"); + MainPage.Log("Error", $"============璁惧============{ex.StackTrace}"); } finally { complateDevice = true; MainPage.Log($"============璁惧============瀹屾垚" + FunctionList.List.Functions.Count); } - //======================缇ゆ帶==================== if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) @@ -503,16 +508,16 @@ { var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); var readSidList = new List<string>(); - foreach(var temp in groupControlList) + foreach (var temp in groupControlList) { FunctionList.List.groupControls.Clear(); readSidList.Add(temp.userDeviceGroupControlId); if (readSidList.Count >= 20) { var data = Ins.httpRequest.GetGroupControInfo(readSidList); - if(data != null) + if (data != null) { - if(data.Code == StateCode.SUCCESS) + if (data.Code == StateCode.SUCCESS) { var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); FunctionList.List.groupControls.AddRange(groupControlInfoList); @@ -546,7 +551,7 @@ } catch (Exception ex) { - MainPage.Log($"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.Message}"); + MainPage.Log("Error", $"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.StackTrace}"); } } else @@ -608,9 +613,10 @@ { MainPage.Log($"璇诲彇浜戠鍦烘櫙鏁版嵁澶辫触:Code:{pack.Code}; Msg:{pack.message}"); } - }catch(Exception ex) + } + catch (Exception ex) { - MainPage.Log($"===鍦烘櫙==={ex.Message}"); + MainPage.Log("Error", $"===鍦烘櫙==={ex.StackTrace}"); } finally { @@ -631,7 +637,7 @@ } catch (Exception ex) { - MainPage.Log($"鏁版嵁鍒濆鍖栧け璐ワ細{ex.Message}"); + MainPage.Log("Error", $"鏁版嵁鍒濆鍖栧け璐ワ細{ex.StackTrace}"); } finally { @@ -650,9 +656,10 @@ try { FunctionList.List.Read3tyFunctionStatus(); - }catch(Exception ex) + } + catch (Exception ex) { - MainPage.Log("璇诲彇绗笁鏂硅澶囩姸鎬佸け璐�:"+ex.Message); + MainPage.Log("Error", "璇诲彇绗笁鏂硅澶囩姸鎬佸け璐�:" + ex.StackTrace); } } }); @@ -688,13 +695,18 @@ { if (DB_ResidenceData.Instance.CurrentRegion != null) { -#region 璇诲彇鏈湴鏁版嵁 - //鎼滅储缃戝叧 - DriverLayer.Control.Ins.SearchLoaclGateway(); - //閲嶆柊杩炴帴mqtt - DAL.Mqtt.MqttClient.DisConnectRemote("鍒锋柊鏁版嵁锛岄噸杩瀖qtt",false); -#endregion - + try + { + #region 璇诲彇鏈湴鏁版嵁 + //鎼滅储缃戝叧 + DriverLayer.Control.Ins.SearchLoaclGateway(); + //閲嶆柊杩炴帴mqtt + DAL.Mqtt.MqttClient.DisConnectRemote("鍒锋柊鏁版嵁锛岄噸杩瀖qtt", false); + #endregion + } + catch (Exception ex){ + MainPage.Log("Error", $"璇诲彇鏈湴鏁版嵁寮傚父锛歿ex.StackTrace}"); + } } } }) @@ -774,4 +786,5 @@ } -} \ No newline at end of file +} + diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index 2103bb9..601e1a7 100644 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -565,53 +565,63 @@ /// </summary> public void Logout() { - //鍔犺浇Loading鏁堟灉 - var waitPage = new Loading(); - MainPage.BaseView.AddChidren(waitPage); - waitPage.Start(Language.StringByID(StringId.PleaseWait)); - - new Thread(() => + try { - try + Application.RunOnMainThread(() => { - //2.娉ㄩ攢鎺ㄩ�� - new HttpServerRequest().SignOutPush(); - //3.璺宠浆鐧诲綍椤甸潰 - UserInfo.Current.LastTime = DateTime.MinValue; - UserInfo.Current.SaveUserInfo(); - DB_ResidenceData.Instance.EixtAccount(); - MainPage.Log("閫�鍑鸿处鍙锋竻绌烘暟鎹�"); - //4.娉ㄩ攢HDLSIP璐﹀彿鐧诲綍 2021-08-20 - HDLLinphone.Current.LogoutAllAccount(); - MainPage.Log("娉ㄩ攢HDLSIP璐﹀彿鐧诲綍"); + //鍔犺浇Loading鏁堟灉 + var waitPage = new Loading(); + MainPage.BaseView.AddChidren(waitPage); + waitPage.Start(Language.StringByID(StringId.PleaseWait)); + + new Thread(() => + { + try + { + //2.娉ㄩ攢鎺ㄩ�� + new HttpServerRequest().SignOutPush(); + //3.璺宠浆鐧诲綍椤甸潰 + UserInfo.Current.LastTime = DateTime.MinValue; + UserInfo.Current.SaveUserInfo(); + DB_ResidenceData.Instance.EixtAccount(); + MainPage.Log("閫�鍑鸿处鍙锋竻绌烘暟鎹�"); + //4.娉ㄩ攢HDLSIP璐﹀彿鐧诲綍 2021-08-20 + HDLLinphone.Current.LogoutAllAccount(); + MainPage.Log("娉ㄩ攢HDLSIP璐﹀彿鐧诲綍"); #if __IOS__ - //5.鍏ㄨ閫氱櫥鍑� - //Shared.IOS.HDLFVSDK.Video.Logout(); - //6.娓呯┖Siri鍏变韩鏁版嵁淇℃伅 - new Other.SkipControl().SetData(false, "", "", "", ""); - var sDM = new SiriKit.SceneDateManager(); - Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}"); + //5.鍏ㄨ閫氱櫥鍑� + //Shared.IOS.HDLFVSDK.Video.Logout(); + //6.娓呯┖Siri鍏变韩鏁版嵁淇℃伅 + new Other.SkipControl().SetData(false, "", "", "", ""); + var sDM = new SiriKit.SceneDateManager(); + Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}"); #endif - } - catch (Exception ex) - { - MainPage.Log($"xxx:{ex.Message}"); - } - finally - { - Application.RunOnMainThread(() => - { - if (waitPage != null) - { - waitPage.Hide(); - waitPage.RemoveFromParent(); - waitPage = null; } - MainPage.GoLoginPage(UserInfo.Current); - }); - } - }).Start(); + catch (Exception ex) + { + MainPage.Log($"xxx:{ex.Message}"); + } + finally + { + Application.RunOnMainThread(() => + { + if (waitPage != null) + { + waitPage.Hide(); + waitPage.RemoveFromParent(); + waitPage = null; + } + MainPage.GoLoginPage(UserInfo.Current); + }); + } + }).Start(); + }); + } + catch (Exception ex) + { + MainPage.Log("Error", $"閫�鍑虹櫥褰曞紓甯�:{ex.StackTrace}"); + } } /// <summary> diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index e66c1c3..318bd99 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -444,7 +444,7 @@ //濡傛灉鏄帶鍒惰皟鍏夌殑寮�鏃讹紝浜害鍊间笉鑳戒负0 - if (commandDictionary.Count > 2) + if (commandDictionary.Count >= 2) { if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff) && commandDictionary.ContainsKey(FunctionAttributeKey.Brightness)) { diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 812e1fb..5030f20 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -339,7 +339,7 @@ #endif return true; } - else if (revertObj.Code == StateCode.PasswrodError) + else //if (revertObj.Code == StateCode.PasswrodError) { UserInfo.Current.LastTime = DateTime.MinValue; } diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs index 1164faa..4898a28 100644 --- a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs +++ b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs @@ -127,7 +127,7 @@ //鐧诲綍sip鏈嶅姟鍣� #if __IOS__ - Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm,DB_ResidenceData.Instance.linphoneConnectType.ToString()); + Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm,"UDP"); #else if (mInterphoneType == InterphoneType.FREEVIEW.ToString()) { diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index af44941..96dbd6a 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -26,7 +26,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string VersionString = "2.6.0"; + public static string VersionString = "2.5.1"; ///// <summary> ///// 瀹㈡埛绔被鍨� ///// </summary> diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index 3efbe95..434c178 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -308,7 +308,6 @@ //etAccount.Text = "455740454@qq.com"; //etAccount.Text = "13288623489";//缃楁檽涓� //etAccount.Text = "18688414428";//澶╂渤3妤� - //etAccount.Text = "pjh@hdlchina.com.cn"; //etAccount.Text = "12345678904";//2.0 娴嬭瘯 钀ょ煶 //etAccount.Text = "1272061968@qq.com";//涓囩鍩庡競涔嬪厜E鍖�8鏍�206 //etAccount.Text = "marketing@australindo.co.id"; @@ -317,10 +316,11 @@ etAccount.Text = "13336018868"; etAccount.Text = "649362315@qq.com";//钄℃窇濞� //etAccount.Text = "18402017839"; - //etAccount.Text = "18620993214"; //etAccount.Text = "13414984501";//鍚存檽鑱� + etAccount.Text = "13682244600"; + etAccount.Text = "pjh@hdlchina.com.cn"; etAccount.Text = "13580507523"; - etAccount.Text = "18475593023"; + etAccount.Text = "15313316909"; } else { @@ -339,9 +339,9 @@ } b = !b; etPassword.Text = "123456"; - if (etAccount.Text == "18620993214") + if (etAccount.Text == "13682244600") { - etPassword.Text = "hdl1985."; + etPassword.Text = "asd123456789123"; } else if (etAccount.Text == "18475593023") { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs index 9cf4210..e41d821 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs @@ -150,7 +150,14 @@ Application.RunOnMainThread(() => { - MusicListView(a31player); + try + { + MusicListView(a31player); + } + catch (Exception ex) + { + MainPage.Log("Error", $"MusicListView 鏂规硶寮傚父锛歿ex.StackTrace}"); + } }); } ///杩涙潵璇讳竴娆¢煶涔愭挱鏀惧櫒鐘舵�� diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs index d219541..ec7cc75 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs @@ -93,6 +93,23 @@ fLayout.AddChidren(clickBackBtn); fLayout.AddChidren(clickSetBtn); + return fLayout; + } + + /// <summary> + /// 鏈�涓婇潰鐨勯偅鍧楁柟娉� + /// </summary> + /// <returns></returns> + public FrameLayout TopFLayoutView2() + { + fLayout.AddChidren(topNameBtn); + fLayout.AddChidren(backBtn); + lineBtn.Y = fLayout.Height - 1; + fLayout.AddChidren(lineBtn); + fLayout.AddChidren(setBtn); + fLayout.AddChidren(clickBackBtn); + fLayout.AddChidren(clickSetBtn); + var btnSetting = new Button() { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs index 5bdc129..835a0ed 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs @@ -24,7 +24,15 @@ #region 甯冨眬鐣岄潰 this.BackgroundColor = MusicColor.ViewColor; var topView = new TopView(); - this.AddChidren(topView.TopFLayoutView()); + this.AddChidren(topView.TopFLayoutView()); + //if (xiMoVideoList.Count > 0) + //{ + // this.AddChidren(topView.TopFLayoutView()); + //} + //else + //{ + // this.AddChidren(topView.TopFLayoutView2()); + //} topView.topNameBtn.TextID = StringId.keshiduijiang; @@ -127,8 +135,6 @@ /// <param name="video">鍙瀵硅瀵硅薄</param> void View1(FrameLayout view1, List<Video> videoList) { - - #region 甯冨眬鐣岄潰 var bjFl = new FrameLayout { @@ -191,7 +197,6 @@ Width = Application.GetRealWidth(160), Height = Application.GetRealWidth(160), UnSelectedImagePath = "VideoIcon/keshiduijiang.png", - }; bjFl.AddChidren(intercomBtnIcon); -- Gitblit v1.8.0