From 19e762179bdc9efc23704bc471cf974ed282b43d Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期三, 31 三月 2021 17:42:30 +0800 Subject: [PATCH] 合并可视对讲代码 --- HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs | 128 +++++++++++++++++++----------------------- 1 files changed, 59 insertions(+), 69 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs index fea81eb..3b5bcd8 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs @@ -8,62 +8,61 @@ { public class VideoMethod { - /// <summary> - /// 绋嬪簭涓诲叆鍙� - /// </summary> - /// <param name="frameLayout">log鐖舵帶浠�</param> - /// <param name="video">鍙瀵硅瀵硅薄</param> - public void MianView(FrameLayout frameLayout, VideoClouds video) - { - //鍔犺浇log - Loading loading = new Loading(); - frameLayout.AddChidren(loading); - loading.Start(); - List<VideoMethod.FlVideo> listESVideoInfo = new List<VideoMethod.FlVideo>(); - List<CallView> listCall = new List<CallView>(); - new System.Threading.Thread(() => - { - try - { - listESVideoInfo = VideoSend.GetVideoInfoList(video); - listCall = getCall(video.id); - } - catch - { - - } - finally - { - Application.RunOnMainThread(() => - { - loading.Hide(); - var mainView = new MainView(); - MainPage.BasePageView.AddChidren(mainView); - mainView.Show(listESVideoInfo, listCall, video); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }); - } - }) - { IsBackground = true }.Start(); - } - /// <summary> - /// 鑾峰彇鍙瀵硅 - /// </summary> - /// <param name="action">鍥炶皟鍑芥暟</param> - /// <param name="frame">log鐖舵帶浠�</param> - public void getVideo(Action<VideoClouds> action, FrameLayout frame, bool tag) - { - ThreadSend(null, (responsePackNew) => - { - try - { - var str = responsePackNew.Data.ToString(); - var videoObj = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoClouds>(str); - action(videoObj); - } - catch { } - }, "鑾峰彇鍙瀵硅", "fram", frame, null, tag); - } + ///// <summary> + ///// 绋嬪簭涓诲叆鍙� + ///// </summary> + ///// <param name="frameLayout">log鐖舵帶浠�</param> + ///// <param name="video">鍙瀵硅瀵硅薄</param> + //public void MianView(FrameLayout frameLayout, VideoClouds video) + //{ + // //鍔犺浇log + // Loading loading = new Loading(); + // frameLayout.AddChidren(loading); + // loading.Start(); + // List<VideoMethod.FlVideo> listESVideoInfo = new List<VideoMethod.FlVideo>(); + // List<CallView> listCall = new List<CallView>(); + // new System.Threading.Thread(() => + // { + // try + // { + // listESVideoInfo = VideoSend.GetVideoInfoList(video); + // listCall = getCall(video.id); + // } + // catch + // { + // } + // finally + // { + // Application.RunOnMainThread(() => + // { + // loading.Hide(); + // var mainView = new HDL_ON.UI.UI2.FuntionControlView.Video.MainView(); + // MainPage.BasePageView.AddChidren(mainView); + // mainView.Show(); + // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + // }); + // } + // }) + // { IsBackground = true }.Start(); + //} + ///// <summary> + ///// 鑾峰彇鍙瀵硅 + ///// </summary> + ///// <param name="action">鍥炶皟鍑芥暟</param> + ///// <param name="frame">log鐖舵帶浠�</param> + //public void getVideo(Action<VideoClouds> action, FrameLayout frame, bool tag) + //{ + // ThreadSend(null, (responsePackNew) => + // { + // try + // { + // var str = responsePackNew.Data.ToString(); + // var videoObj = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoClouds>(str); + // action(videoObj); + // } + // catch { } + // }, "鑾峰彇鍙瀵硅", "fram", frame, null, tag); + //} /// <summary> /// 鑾峰彇鍘嗗彶閫氳瘽璁板綍 /// </summary> @@ -138,7 +137,7 @@ /// <param name="frame">log鐖舵帶浠�</param> /// <param name="dialog">log鐖舵帶浠�</param> /// <param name="tag">鏄惁瑕佹樉绀簂og</param> - public static void ThreadSend(VideoClouds videoObj, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, bool tag = true) + public void ThreadSend(VideoClouds videoObj, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, bool tag = true) { //鍔犺浇log @@ -203,18 +202,9 @@ } - /// <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)); // 褰撳湴鏃跺尯 - - 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(); - System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯 - return ((long)(DateTime.Now.AddDays(1) - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟 - } + + + [Serializable] public class VideoClouds { -- Gitblit v1.8.0