From 6d73bf6e816570291865674bef8bce8972e4de3f Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期三, 01 十二月 2021 16:32:57 +0800 Subject: [PATCH] 2021-12-01-01 --- HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs | 78 ++++++++++++++++++++++++++++++--------- 1 files changed, 60 insertions(+), 18 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs index b08335b..cb881c5 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs @@ -3,6 +3,8 @@ 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 { @@ -13,24 +15,31 @@ /// </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 { @@ -39,13 +48,14 @@ 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> @@ -68,18 +78,18 @@ } }, "鑾峰彇鍙瀵硅", "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()); @@ -132,6 +142,7 @@ catch { } return callViewList; } + /// <summary> /// 鍙戦�佸懡浠ょ嚎绋� /// </summary> @@ -165,11 +176,12 @@ { if (str == "鑾峰彇鍙瀵硅") { - responsePackNew = VideoSend.GetVideo(); + // responsePackNew = VideoSend.GetVideo(); + responsePackNew = VideoSend.GetVideoInfoList(); } else if (str == "鑾峰彇閫氳瘽璁板綍") { - responsePackNew = VideoSend.GetCall(videoObj.id); + responsePackNew = VideoSend.GetCall(); } } @@ -189,7 +201,7 @@ } else { - Method method = new Method(); + PirMethod method = new PirMethod(); //鑷畾涔夐敊璇彁绀烘枃鏈� string eorroText = ""; if (str == "鑾峰彇鍙瀵硅") @@ -206,19 +218,49 @@ } + /// <summary> /// 闅忔満瀵嗙爜6浣� /// </summary> - /// <returns></returns> public static string GetCode() { Random rand = new Random(); string code = ""; for (int ctr = 0; ctr < 6; ctr++) { code += rand.Next(10).ToString(); } return code; } - /// <summary> /// 鑾峰彇褰撳墠鏃堕棿鎴� /// </summary> /// <returns></returns> public static string GetCurrentTimeStamp() { //TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); //return Convert.ToInt64(ts.TotalSeconds).ToString(); System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯 + /// <returns></returns> + public static string GetCode() + { + Random rand = new Random(); + string code = ""; + for (int ctr = 0; ctr < 6; ctr++) + { + code += rand.Next(10).ToString(); + } + return code; + } + + /// <summary> + /// 鑾峰彇褰撳墠鏃堕棿鎴� + /// </summary> + /// <returns></returns> + public static string GetCurrentTimeStamp() + { + //TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); + //return Convert.ToInt64(ts.TotalSeconds).ToString(); + + System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯 return ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟 - } - /// <summary> /// 鑾峰彇褰撳墠鏃堕棿鎴� /// </summary> /// <returns></returns> public static string GetTomorrowTimeStamp() { //褰撳墠鏃堕棿鐨勫悗涓�澶� //TimeSpan ts = DateTime.Now.AddDays(1) - new DateTime(1970, 1, 1, 0, 0, 0, 0); //return Convert.ToInt64(ts.TotalSeconds).ToString(); + + } + + /// <summary> + /// 鑾峰彇褰撳墠鏃堕棿鎴� + /// </summary> + /// <returns></returns> + public static string GetTomorrowTimeStamp() + { + //褰撳墠鏃堕棿鐨勫悗涓�澶� + //TimeSpan ts = DateTime.Now.AddDays(1) - new DateTime(1970, 1, 1, 0, 0, 0, 0); + //return Convert.ToInt64(ts.TotalSeconds).ToString(); System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯 return ((long)(DateTime.Now.AddDays(1) - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟 } - } } -- Gitblit v1.8.0