From 1a0a7f736c6d2e7129e7591d40bed67ec7c0f09a Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期五, 05 二月 2021 10:47:42 +0800 Subject: [PATCH] 2021-02-05 1.编译冲突修改 --- HDL_ON/Common/HDLCommon.cs | 82 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 72 insertions(+), 10 deletions(-) diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index ee56f54..e784943 100644 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -258,11 +258,11 @@ { Shared.Application.RunOnMainThread(() => { - //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈� - new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show(); + ////璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈� + //new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show(); //閫�鍑虹櫥褰曟搷浣� CheckLogout(); - + }); return; } @@ -270,12 +270,15 @@ { Shared.Application.RunOnMainThread(() => { + GetPushMessageAction?.Invoke(); //鎶ヨ鎺ㄩ�佹墠寮圭獥鎻愮ず锛坢essageType鍖呭惈Alarm鍏抽敭瀛楃殑锛� if (jpushMessageInfo.messageType != null && jpushMessageInfo.messageType.Contains("Alarm")) { - new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show(); + //鎶ヨ鎺ㄩ�佸脊绐楁彁绀� + ShowAlarmPushMessage(jpushMessageInfo); + //new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show(); } - GetPushMessageAction?.Invoke(); + }); return; } @@ -287,6 +290,8 @@ } /// <summary> + /// 璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈� + /// 瑕佸湪涓荤嚎绋嬭皟鐢� /// 閫�鍑虹櫥褰曟搷浣� /// </summary> public void CheckLogout() @@ -294,9 +299,8 @@ //鏈櫥褰曚笉鐢ㄥ鐞� if (!UserInfo.Current.IsLogin) return; -#if DEBUG - return; -#endif + //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈� + new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show(); Logout(); } @@ -308,7 +312,7 @@ { //鍔犺浇Loading鏁堟灉 var waitPage = new Loading(); - MainPage.BasePageView.AddChidren(waitPage); + MainPage.BaseView.AddChidren(waitPage); waitPage.Start(Language.StringByID(StringId.PleaseWait)); new Thread(() => @@ -340,6 +344,57 @@ } }).Start(); } + + /// <summary> + /// + /// </summary> + ConfirmDialog alarmPushConfirmDialog; + /// <summary> + /// 鎶ヨ鎺ㄩ�佸脊绐楁彁绀�,鐐瑰嚮鏌ョ湅璺宠浆淇℃伅涓績 + /// </summary> + /// <param name="jpushMessageInfo"></param> + public void ShowAlarmPushMessage(JPushMessageInfo jpushMessageInfo) + { + //娌$櫥褰曚笉澶勭悊 + if (UserInfo.Current == null || !UserInfo.Current.IsLogin || MainPage.BasePageView == null) + { + return; + } + + //璺宠浆淇℃伅涓績椤甸潰 + Action goAction = () => + { + //Dialog + alarmPushConfirmDialog = null; + Action backAction = () => { + + }; + var skipPage = new MessageCenterPage(); + MainPage.BasePageView.AddChidren(skipPage); + skipPage.LoadPage(backAction); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + //鍙栨秷浜嬩欢 + Action cancelAction = () => + { + alarmPushConfirmDialog = null; + }; + + //闃叉澶氭寮圭獥澶勭悊 + if (alarmPushConfirmDialog == null) + { + alarmPushConfirmDialog = new ConfirmDialog(); + alarmPushConfirmDialog.ShowDialog(Language.StringByID(StringId.Tip), jpushMessageInfo.Content, goAction, cancelAction, StringId.Cancel, StringId.LookOver); + } + else + { + alarmPushConfirmDialog.RefreshDialog(Language.StringByID(StringId.Tip), jpushMessageInfo.Content, goAction, cancelAction, StringId.Cancel, StringId.LookOver); + + } + + } + #endregion #region 鈻� 甯哥敤鏂规硶_______________________ @@ -396,9 +451,16 @@ //缃戠粶鐘舵�佸彉鍖� 閲嶇疆缃戝叧鐘舵�侀噸鏂版悳绱� Control.Ins.GatewayOnline = false; + //缃戠粶鍙樺寲锛屾柇寮�閲嶈繛涓�娆� + if (Control.Ins.IsRemote) + { + Control.Ins.IsRemote = false; + DAL.Mqtt.MqttClient.DisConnectRemote("UpdateInternetStatus", false); + } + if (internetStatus == 0)//娌℃湁缃戠粶杩炴帴 0 { - //Control.Ins.GatewayOnline = false; + Control.Ins.GatewayOnline = false; Control.Ins.IsRemote = false; MainPage.InternetStatus = 0; } -- Gitblit v1.8.0