From 813aee559e544e6bf7777404612a4712cad184c8 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 01 四月 2021 16:31:38 +0800 Subject: [PATCH] 2021-04-01 1.更新丰林iOS最新SDK --- HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs | 156 ++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 109 insertions(+), 47 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs index e8086fb..e7b3272 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs @@ -6,67 +6,79 @@ namespace HDL_ON.UI.UI2.FuntionControlView.Video { - public class VideoMethod : FrameLayout + public class VideoMethod { - public void MianView() + /// <summary> + /// 绋嬪簭涓诲叆鍙� + /// </summary> + /// <param name="frameLayout">log鐖舵帶浠�</param> + /// <param name="video">鍙瀵硅瀵硅薄</param> + public void MianView(FrameLayout frameLayout, VideoClouds video) { - var d = VideoSend.GetVideo(); - getVideo((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(() => { - List<ESVideoInfo> listESVideoInfo = new List<ESVideoInfo>(); - List<CallView> listCall = new List<CallView>(); - new System.Threading.Thread(() => + try { - try - { - listESVideoInfo = VideoSend.GetVideoInfoList(video); - listCall = getCall(video.id); - } - catch - { + listESVideoInfo = VideoSend.GetVideoInfoList(video); + listCall = GetCall(video.id); + } + catch + { - } - finally + } + finally + { + Application.RunOnMainThread(() => { - Application.RunOnMainThread(() => - { - var mainView = new MainView(); - MainPage.BasePageView.AddChidren(mainView); - mainView.Show(listESVideoInfo, listCall); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }); - } - }) - { IsBackground = true }.Start(); - }, this, true); + 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<VideoObj> action, FrameLayout frame, bool tag) + /// <param name="tag">鏄惁瑕佹樉绀簂og(榛樿鏄剧ずtag=true)</param> + public void GetVideo(Action<VideoClouds> action, FrameLayout frame, bool tag) { + VideoClouds videoObj = null; ThreadSend(null, (responsePackNew) => - { - try - { - var str = responsePackNew.Data.ToString(); - var videoObj = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoObj>(str); - action(videoObj); - } - catch { } - }, "鑾峰彇鍙瀵硅", "fram", frame, null, tag); + { + try + { + var str = responsePackNew.Data.ToString(); + videoObj = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoClouds>(str); + action(videoObj); + } + catch + { + action(videoObj); + } + }, "鑾峰彇鍙瀵硅", "fram", frame, null, tag); } /// <summary> /// 鑾峰彇鍘嗗彶閫氳瘽璁板綍 /// </summary> /// <param name="id"></param> - public List<CallView> getCall(string id) + public List<CallView> GetCall(string id) { List<CallView> callViewList = new List<CallView>(); try { + List<Call> listCall = new List<Call>(); var responsePackNew = VideoSend.GetCall(id); if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") @@ -77,6 +89,7 @@ } List<string> strYear = new List<string>(); + //鏌ヨ骞翠唤 for (int i = 0; i < listCall.Count; i++) { var call = listCall[i]; @@ -93,7 +106,7 @@ } } - + //閲嶆柊瀛樺偍 for (int j = 0; j < strYear.Count; j++) { var year = strYear[j]; @@ -130,9 +143,8 @@ /// <param name="frame">log鐖舵帶浠�</param> /// <param name="dialog">log鐖舵帶浠�</param> /// <param name="tag">鏄惁瑕佹樉绀簂og</param> - public static void ThreadSend(VideoObj videoObj, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, bool tag = true) + public static void ThreadSend(VideoClouds videoObj, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, bool tag = true) { - //鍔犺浇log Loading loading = new Loading(); if (view == "dialog") @@ -195,11 +207,51 @@ } + /// <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 VideoObj + public class VideoClouds { /// <summary> - /// 涓版灄缁戝畾id锛坒lBindId锛� + /// 涓版灄缁戝畾id锛坒lBindId锛�(userKey) /// </summary> public string id = string.Empty; /// <summary> @@ -276,7 +328,6 @@ /// </summary> public string flBindId = string.Empty; } - [Serializable] public class CallView { @@ -285,11 +336,22 @@ /// </summary> public string year = string.Empty; - public List<Call> callList = new List<Call>(); + public List<Call> callList = new List<Call>(); } + [Serializable] + public class FlVideo + { + /// <summary> + /// 璁惧鍚嶇О + /// </summary> + public string aliasName = string.Empty; + /// <summary> + /// 璁惧绫诲瀷锛�(1瀹ゅ唴鏈�,2瀹ゅ鏈猴紝3鍥村鏈猴紝4绠$悊鏈�,5浜屾纭鏈�) + /// </summary> + public string devType = string.Empty; + public string uuid = string.Empty; + } - - } } -- Gitblit v1.8.0