JLChen
2021-07-06 d72ca686a3e262693f8a6e45e747e8e8da43335b
HDL_ON/Common/HDLCommon.cs
@@ -277,22 +277,45 @@
                    }
                    else if (jpushMessageInfo.messageType.Contains(PushMessageType.FLCall.ToString()))
                    {
#if DEBUG
#if __Android__
                        ShowAlert("来电通知!!!!");
                        if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return;
#else
                        ESOnVideo.Current.Test();
#endif
#endif
                        //解析呼叫的门口机UUID信息,并跳转丰林呼叫页面
                        //ESVideoInfo eSVideoInfo = new ESVideoInfo()
                        //{
                        //    DeviceName = "室外机88",
                        //    ESVideoUUID = "JJY000019VPLLF",
                        //};
                        //ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo);
                        ESVideoInfo eSVideoInfo = GetESOnVideoJson(jpushMessageInfo.expantContent);
                        if (eSVideoInfo == null) return;
                        if (string.IsNullOrEmpty(eSVideoInfo.uuid)) return;
                        if (eSVideoInfo.uuid.Contains(","))
                        {
                            var uuid = eSVideoInfo.uuid.Split(',');
                            eSVideoInfo.ESVideoUUID = uuid[0];
                        }
                        else
                        {
                            eSVideoInfo.ESVideoUUID = eSVideoInfo.uuid;
                        }
                        ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, "FLVI");
                    }
                    else if (jpushMessageInfo.messageType.Contains(PushMessageType.HDL_INTERPHONE.ToString()))
                    {
                        if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return;
                        //字段兼容问题,只能直接取值了
                        var json= Newtonsoft.Json.Linq.JObject.Parse(jpushMessageInfo.expantContent);
                        ESVideoInfo eSVideoInfo = new ESVideoInfo();// GetESOnVideoJson(jpushMessageInfo.expantContent);
                        eSVideoInfo.callId = json["callId"].ToString();
                        //eSVideoInfo.Lc_AccessToken = UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken;//json["subAccountToken"].ToString();//
                        eSVideoInfo.Lc_AccessToken = json["subAccountToken"].ToString();//2021-05-13 目前云端还没拿到Lc_AccessToken,目前没办法正常使用
                        eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString();
                        eSVideoInfo.Lc_Location = OnAppConfig.Instance.RequestHttpsHost.Contains("China") ? 0 : 1;
                        eSVideoInfo.Lc_PlayToken = json["token"].ToString();
                        eSVideoInfo.Lc_Psk = json["cname"].ToString();
                        if (eSVideoInfo == null) return;
                        ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, "IMOUVISIAL");
                    }
                }
@@ -304,6 +327,27 @@
        }
        /// <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;
            }
        }
        /// <summary>
        /// 账号在别处登陆,被踢下线 跳转到登录页面
        /// 要在主线程调用
        /// 退出登录操作