From f676a4c180fc54cc82eecbfcd24d32fe7d8581db Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 26 三月 2021 18:16:58 +0800 Subject: [PATCH] Merge branch 'CJL' into temp-wxr --- HDL_ON/Common/HDLCommon.cs | 78 +++++++++++++++++++++++++++++---------- 1 files changed, 58 insertions(+), 20 deletions(-) diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index 70b5864..6ab29de 100644 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -248,44 +248,82 @@ #region 鈻� 鎺ㄩ�佸鐞哶______________________ /// <summary> /// 鎺ㄩ�佹秷鎭鐞� + /// 娉ㄦ剰锛欰ndroid瑕佸湪涓荤嚎绋嬶紙UI绾跨▼锛夋墽琛� /// </summary> /// <param name="jpushMessageInfo"></param> public void AdjustPushMessage(JPushMessageInfo jpushMessageInfo) { try { - if (jpushMessageInfo.Extras != null && jpushMessageInfo.Extras.Contains("OffLine")) - { - Shared.Application.RunOnMainThread(() => - { - ////璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈� - //new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show(); - //閫�鍑虹櫥褰曟搷浣� - CheckLogout(); + //Extras涓虹┖涓嶅鐞� + if (string.IsNullOrEmpty(jpushMessageInfo.Extras)) return; - }); - return; + if (jpushMessageInfo.Extras.Contains(PushMessageType.OffLine.ToString())) + { + CheckLogout(); } else { - Shared.Application.RunOnMainThread(() => + GetPushMessageAction?.Invoke(); + + //messageType涓虹┖涓嶅鐞� + if (string.IsNullOrEmpty(jpushMessageInfo.messageType)) return; + + //鎶ヨ鎺ㄩ�佹墠寮圭獥鎻愮ず锛坢essageType鍖呭惈Alarm鍏抽敭瀛楃殑锛� + if (jpushMessageInfo.messageType.Contains(PushMessageType.Alarm.ToString())) { - GetPushMessageAction?.Invoke(); - //鎶ヨ鎺ㄩ�佹墠寮圭獥鎻愮ず锛坢essageType鍖呭惈Alarm鍏抽敭瀛楃殑锛� - if (jpushMessageInfo.messageType != null && jpushMessageInfo.messageType.Contains("Alarm")) + //鎶ヨ鎺ㄩ�佸脊绐楁彁绀� + ShowAlarmPushMessage(jpushMessageInfo); + } + else if (jpushMessageInfo.messageType.Contains(PushMessageType.FLCall.ToString())) + { + if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return; + + ESVideoInfo eSVideoInfo = GetESOnVideoJson(jpushMessageInfo.expantContent); + + if (eSVideoInfo == null) return; + + if (string.IsNullOrEmpty(eSVideoInfo.uuid)) return; + + if (eSVideoInfo.uuid.Contains(",")) { - //鎶ヨ鎺ㄩ�佸脊绐楁彁绀� - ShowAlarmPushMessage(jpushMessageInfo); - //new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show(); + var uuid = eSVideoInfo.uuid.Split(','); + eSVideoInfo.ESVideoUUID = uuid[0]; + } + else + { + eSVideoInfo.ESVideoUUID = eSVideoInfo.uuid; } - }); - return; + ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo); + + } } + } + catch(Exception EX) + { + Utlis.WriteLine("catch: " + EX.ToString()); + } + } + + /// <summary> + /// + /// </summary> + /// <param name="jsonStr"></param> + /// <returns></returns> + ESVideoInfo GetESOnVideoJson(string jsonStr) + { + try + { + if (!string.IsNullOrEmpty(jsonStr)) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject<ESVideoInfo>(jsonStr); + } + return null; } catch { - + return null; } } -- Gitblit v1.8.0