From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 10 七月 2020 10:52:13 +0800 Subject: [PATCH] 2020-07-10-01 --- ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs | 112 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 97 insertions(+), 15 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs b/ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs index a00c9dd..070ceac 100644 --- a/ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs +++ b/ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs @@ -4,8 +4,6 @@ using System.Collections.Generic; using Shared.Phone.Device.Logic; - - namespace Shared.Phone.Device.VideoIntercom { public class VideoMachine : FrameLayout @@ -13,15 +11,11 @@ public VideoMachine() { } - public async void Show() + public void Show(List<VideoCalss> videoInfosLists) { - - var videoInfosLists = await GetVideoInfoList(); - TopView view = new TopView(); this.AddChidren(view.TopRowView()); - //view.toptitleNameBtn.TextID = R.MyInternationalizationString.selection; - view.toptitleNameBtn.Text = "鍙瀵硅"; + view.toptitleNameBtn.TextID = R.MyInternationalizationString.videoIntercom; view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); }; var middle = new VerticalRefreshLayout @@ -65,7 +59,7 @@ var name1Btn = new Button { - Text = "2,2,0801", + Text = videoInfos.RoomName, TextAlignment = TextAlignment.CenterLeft, TextColor = ZigbeeColor.Current.LogicBtnCancelColor, TextSize = 12, @@ -118,13 +112,73 @@ } } + /// <summary> + /// 鍒ゆ柇璐﹀彿鏄惁鏀寔鍙瀵硅 + /// </summary> + /// <param name="topFrameLayout"></param> + public async static void AccountSupportVideo(FrameLayout topFrameLayout) + { + var jobject = new JObject(); + jobject.Add("RequestVersion", CommonPage.RequestVersion); + jobject.Add("RequestSource", "0"); + jobject.Add("HomeID", Config.Instance.HomeId); + var url = "https://developer.hdlcontrol.com/ProposedProductionApi/VideoIntercom/CheckBindRecord"; + var str = await Send.HttpWebRequest(url, jobject.ToString(), "POST", 3, true); + if (!string.IsNullOrEmpty(str)) + { + try + { + var json = JObject.Parse(str); + if (json != null) + { + var stateCode = json["StateCode"].ToString(); + //鍙瀵硅蹇嵎鏂瑰紡 + var videoIntercomBtn = new Button(); + videoIntercomBtn.Gravity = Gravity.CenterVertical; + videoIntercomBtn.UnSelectedImagePath = "Item/videoIntercom.png"; + videoIntercomBtn.Width = Application.GetMinRealAverage(69); + videoIntercomBtn.Height = Application.GetMinRealAverage(69); + List<VideoCalss> videoList= new List<VideoCalss>(); + if (stateCode == "Success") + {//鍒ゆ柇杩欎釜璐﹀彿鏄惁缁戝畾; + topFrameLayout.AddChidren(videoIntercomBtn); + CloudsVideo cloudsVideo = Newtonsoft.Json.JsonConvert.DeserializeObject<CloudsVideo>(json["ResponseData"].ToString()); + videoList = await GetVideoInfoList(cloudsVideo); + } + if (UserCenter.UserCenterResourse.ResidenceOption.SafetyShortcut) + { + videoIntercomBtn.X = Application.GetRealWidth(746 + 10); + } + else + { + videoIntercomBtn.X = Application.GetRealWidth(850 + 10); + } + videoIntercomBtn.MouseUpEventHandler += (sender, e) => + { - async System.Threading.Tasks.Task<List<VideoCalss>> GetVideoInfoList() + var videoMachine = new Device.VideoIntercom.VideoMachine(); + UserView.HomePage.Instance.AddChidren(videoMachine); + UserView.HomePage.Instance.PageIndex += 1; + videoMachine.Show(videoList); + + }; + } + } + catch { } + } + + + + } + /// <summary> + /// 鑾峰彇鍙瀵硅鍒楄〃 + /// </summary> + static async System.Threading.Tasks.Task<List<VideoCalss>> GetVideoInfoList(CloudsVideo clouds) { List<VideoCalss> eSVideoInfosList = new List<VideoCalss>(); var jobject = new JObject(); - jobject.Add("cmtID", "10006"); - jobject.Add("unitno", "0801"); + jobject.Add("cmtID", clouds.FLCommunityID); + jobject.Add("unitno", clouds.FLBuildingID); jobject.Add("method", "getUUIDList"); var url = " http://112.74.164.111:180/api.php/Device/getmonitorUUID"; var str = await Send.HttpWebRequest(url, jobject.ToString(), "POST"); @@ -149,6 +203,10 @@ foreach (var videoInfo in list) { VideoCalss eSVideoInfo = new VideoCalss(); + eSVideoInfo.ESRoomID = int.Parse(clouds.FLRoomID); + string str1 = clouds.FLBuildingID.Substring(0, 2).TrimStart('0'); + string str2 = clouds.FLBuildingID.Substring(2, 2).TrimStart('0'); + eSVideoInfo.RoomName = str1 +Language.StringByID( R.MyInternationalizationString.dong) + str2 + Language.StringByID(R.MyInternationalizationString.unit); eSVideoInfo.DeviceName = videoInfo["aliasName"]; if (videoInfo["uuid"].Contains(",")) { @@ -163,10 +221,8 @@ } return eSVideoInfosList; } - } - - class VideoCalss + public class VideoCalss { /// <summary> /// 瀹ゅ鏈虹殑UUID @@ -190,4 +246,30 @@ public string RoomName = string.Empty; } + public class CloudsVideo + { + /// <summary> + /// 鏍嬫ゼ鍗曞厓鍙� + /// </summary> + public string FLBuildingID = string.Empty; + /// <summary> + /// 閭f爧妤肩殑鍚嶇О + /// </summary> + public string FLBuildingName = string.Empty; + /// <summary> + /// 灏忓尯ID + /// </summary> + public string FLCommunityID = string.Empty; + /// <summary> + /// 鎴块棿ID + /// </summary> + public string FLRoomID = string.Empty; + /// <summary> + /// 浣忓畢ID + /// </summary> + public string HomeID = string.Empty; + + public string FLSecretKey = string.Empty; + + } } -- Gitblit v1.8.0