| | |
| | | using System.Collections.Generic; |
| | | using Shared.Phone.Device.Logic; |
| | | |
| | | |
| | | |
| | | namespace Shared.Phone.Device.VideoIntercom |
| | | { |
| | | public class VideoMachine : FrameLayout |
| | |
| | | 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 |
| | |
| | | |
| | | var name1Btn = new Button |
| | | { |
| | | Text = "2,2,0801", |
| | | Text = videoInfos.RoomName, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 12, |
| | |
| | | } |
| | | |
| | | } |
| | | public async static void Video(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 { } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | 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"); |
| | |
| | | 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(",")) |
| | | { |
| | |
| | | } |
| | | return eSVideoInfosList; |
| | | } |
| | | |
| | | } |
| | | |
| | | class VideoCalss |
| | | public class VideoCalss |
| | | { |
| | | /// <summary> |
| | | /// 室外机的UUID |
| | |
| | | public string RoomName = string.Empty; |
| | | |
| | | } |
| | | public class CloudsVideo |
| | | { |
| | | /// <summary> |
| | | /// 栋楼单元号 |
| | | /// </summary> |
| | | public string FLBuildingID = string.Empty; |
| | | /// <summary> |
| | | /// 那栋楼的名称 |
| | | /// </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; |
| | | |
| | | } |
| | | } |