From 564c60519d425617fcc482e10100e427ecb7b8d9 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期三, 31 三月 2021 15:26:55 +0800 Subject: [PATCH] 2021-3-31-1 --- HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs | 83 +++++++++++++++++++++++------------------ 1 files changed, 46 insertions(+), 37 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs index 9539a84..6ebce59 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs @@ -31,7 +31,7 @@ /// <returns></returns> public static ResponsePackNew GetCall(string flBindId) { - var jObject = new JObject { { "homeId", PirSend.HomeId }, { "flBindId", flBindId }, { "pageSize", int.MaxValue } }; + var jObject = new JObject { { "homeId", PirSend.HomeId }, { "flBindId", flBindId }, { "pageSize", 100 } }; var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_FL_GetCallList); return responsePackNew; } @@ -61,36 +61,16 @@ { return eSVideoInfosList; } - var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(json["list"].ToString()); - if (list.Count == 0) - { - return eSVideoInfosList; - } - foreach (var videoInfo in list) - { - VideoMethod.FlVideo flVideo = new VideoMethod.FlVideo(); - flVideo.aliasName = videoInfo["aliasName"]; - if (videoInfo["uuid"].Contains(",")) - { - var uuid = videoInfo["uuid"].Split(','); - flVideo.uuid = uuid[0]; - } - else - { - flVideo.uuid = videoInfo["uuid"]; - } - flVideo.devType = videoInfo["devType"]; - //eSVideoInfo.roomno = video.flRoomId; - eSVideoInfosList.Add(flVideo); - } + eSVideoInfosList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<VideoMethod.FlVideo>>(json["list"].ToString()); + } catch { } return eSVideoInfosList; } /// <summary> - /// 涓婃姤鍔ㄦ�佸紑閿佸瘑鐮� + /// 涓婃姤鍔ㄦ�佸紑閿佸瘑鐮�(娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥) /// </summary> - public static void GetQRcode(FrameLayout frame, VideoMethod.VideoClouds video,Action<bool,string>action) + public static void GetQRcode(FrameLayout frame, VideoMethod.VideoClouds video, Action<bool, string> action) { ///鏍囪鏄惁鎴愬姛 bool if_bool = false; @@ -101,7 +81,7 @@ jobject.Add("validTime", VideoMethod.GetTomorrowTimeStamp());//鏈夋晥鏃堕棿 jobject.Add("unitno", video.flBuildingId);//鍗曞厓鍙� jobject.Add("roomno", video.flRoomId);//鎴块棿鍙� - jobject.Add("code", pwd); jobject.Add("userKey", video.flSecretKey); jobject.Add("timestamp", VideoMethod.GetCurrentTimeStamp()); jobject.Add("secretKey", video.flSecretKey); jobject.Add("method", "setdynamicpwd"); jobject.Add("numTimes", "5"); + jobject.Add("code", pwd); jobject.Add("userKey", video.id); jobject.Add("timestamp", VideoMethod.GetCurrentTimeStamp()); jobject.Add("secretKey", video.flSecretKey); jobject.Add("method", "setdynamicpwd"); jobject.Add("numTimes", "5"); //鍔犺浇log Loading loading = new Loading(); frame.AddChidren(loading); @@ -113,20 +93,14 @@ var str = HttpWebRequest(NewAPI.API_POST_FL_QRcode, jobject.ToString(), "POST"); if (!string.IsNullOrEmpty(str)) { - try + var json = JObject.Parse(str); + if (json != null) { - var json = JObject.Parse(str); - if (json != null) + var stateCode = json["status"].ToString(); + if (stateCode == "0") { - var stateCode = json["resCode"].ToString(); - if (stateCode != "0") - { - if_bool = true; - } + if_bool = true; } - } - catch { - } } } @@ -137,6 +111,33 @@ { loading.Hide(); action(if_bool, pwd); + + }); + } + + }) + { IsBackground = true }.Start(); + } + /// <summary> + /// 涓嬭浇鍥剧墖 + /// </summary> + public static void GetIcon(FrameLayout frame,string url) + { + Loading loading = new Loading(); + frame.AddChidren(loading); + loading.Start(); + new System.Threading.Thread(() => + { + try + { + var responsePackNew = RequestServerhomeId(null, url); + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + loading.Hide(); }); } @@ -197,5 +198,13 @@ return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout); } + + + } + class FlResponsePackNew + {// + public string status = string.Empty; + public string desc = string.Empty; + } } -- Gitblit v1.8.0