| | |
| | | using HDL_ON.UI.UI2.PersonalCenter.PirDevice; |
| | | using System.Collections.Generic; |
| | | using Shared; |
| | | using HDL_ON.Entity; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.Video |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="frameLayout">log父控件</param> |
| | | /// <param name="video">可视对讲对象</param> |
| | | public void MianView(FrameLayout frameLayout, VideoClouds video) |
| | | public void MianView(FrameLayout frameLayout) |
| | | { |
| | | //加载log |
| | | Loading loading = new Loading(); |
| | | frameLayout.AddChidren(loading); |
| | | loading.Start(); |
| | | List<FlVideo> listESVideoInfo = new List<FlVideo>(); |
| | | List<CallView> listCall = new List<CallView>(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | listESVideoInfo = VideoSend.GetVideoInfoList(video); |
| | | listCall = GetCall(video.id); |
| | | // 这里再获取一次设备列表(更新数据) |
| | | var videoInfo = VideoSend.GetVideoInfoList(); |
| | | if (videoInfo.Code == StateCode.SUCCESS) |
| | | { |
| | | string data_str = videoInfo.Data.ToString(); |
| | | FunctionList.List.videoIntercom = JsonConvert.DeserializeObject<List<UI.UI2.FuntionControlView.Video.Video>>(data_str); |
| | | } |
| | | |
| | | // 获取通话记录 |
| | | listCall = GetCall(); |
| | | } |
| | | catch |
| | | { |
| | | |
| | | // |
| | | } |
| | | finally |
| | | { |
| | |
| | | loading.Hide(); |
| | | var mainView = new VideoMainView(); |
| | | MainPage.BasePageView.AddChidren(mainView); |
| | | mainView.Show(listESVideoInfo, listCall, video); |
| | | mainView.Show(listCall, FunctionList.List.videoIntercom); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取可视对讲 |
| | | /// </summary> |
| | |
| | | } |
| | | }, "获取可视对讲", "fram", frame, null, tag); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取历史通话记录 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | public List<CallView> GetCall(string id) |
| | | public List<CallView> GetCall() |
| | | { |
| | | List<CallView> callViewList = new List<CallView>(); |
| | | try |
| | | { |
| | | |
| | | List<Call> listCall = new List<Call>(); |
| | | var responsePackNew = VideoSend.GetCall(id); |
| | | var responsePackNew = VideoSend.GetCall(); |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | { |
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(responsePackNew.Data.ToString()); |
| | |
| | | catch { } |
| | | return callViewList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 发送命令线程 |
| | | /// </summary> |
| | |
| | | { |
| | | if (str == "获取可视对讲") |
| | | { |
| | | responsePackNew = VideoSend.GetVideo(); |
| | | // responsePackNew = VideoSend.GetVideo(); |
| | | responsePackNew = VideoSend.GetVideoInfoList(); |
| | | } |
| | | else if (str == "获取通话记录") |
| | | { |
| | | responsePackNew = VideoSend.GetCall(videoObj.id); |
| | | responsePackNew = VideoSend.GetCall(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 随机密码6位 |
| | | /// </summary> |
| | |
| | | } |
| | | return code; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取当前时间戳 |
| | | /// </summary> |
| | |
| | | return ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 相差秒数 |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取当前时间戳 |
| | | /// </summary> |
| | |
| | | System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区 |
| | | return ((long)(DateTime.Now.AddDays(1) - startTime).TotalSeconds).ToString(); // 相差秒数 |
| | | } |
| | | |
| | | |
| | | } |
| | | } |