From cda2410f9c29f2fadc16e9de38ccae95b75a89dd Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 09 六月 2021 10:51:13 +0800
Subject: [PATCH] 1

---
 HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs |  161 +++++++++++++++--------------------------------------
 1 files changed, 47 insertions(+), 114 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
index 39d18e8..c7d4797 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
@@ -19,14 +19,14 @@
             Loading loading = new Loading();
             frameLayout.AddChidren(loading);
             loading.Start();
-            List<VideoMethod.FlVideo> listESVideoInfo = new List<VideoMethod.FlVideo>();
+            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);
+                    listCall = GetCall(video.id);
                 }
                 catch
                 {
@@ -37,7 +37,7 @@
                     Application.RunOnMainThread(() =>
                     {
                         loading.Hide();
-                        var mainView = new MainView();
+                        var mainView = new VideoMainView();
                         MainPage.BasePageView.AddChidren(mainView);
                         mainView.Show(listESVideoInfo, listCall, video);
                         MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -51,29 +51,33 @@
         /// </summary>
         /// <param name="action">鍥炶皟鍑芥暟</param>
         /// <param name="frame">log鐖舵帶浠�</param>
-        public void getVideo(Action<VideoClouds> 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<VideoClouds>(str);
+                     videoObj = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoClouds>(str);
                      action(videoObj);
                  }
-                 catch { }
+                 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() != "")
@@ -127,7 +131,7 @@
             }
             catch { }
             return callViewList;
-        }
+        } 
         /// <summary>
         /// 鍙戦�佸懡浠ょ嚎绋�
         /// </summary>
@@ -140,7 +144,6 @@
         /// <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)
         {
-
             //鍔犺浇log
             Loading loading = new Loading();
             if (view == "dialog")
@@ -186,7 +189,7 @@
                         }
                         else
                         {
-                            Method method = new Method();
+                            PirMethod method = new PirMethod();
                             //鑷畾涔夐敊璇彁绀烘枃鏈�
                             string eorroText = "";
                             if (str == "鑾峰彇鍙瀵硅")
@@ -206,114 +209,44 @@
         /// <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();
        }
-        /// <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();
        }
-        [Serializable] 
-        public class VideoClouds
-        { 
-            /// <summary>
-            /// 涓版灄缁戝畾id锛坒lBindId锛�
-            /// </summary>
-            public string id = string.Empty;
-            /// <summary>
-            /// 浣忓畢id
-            /// </summary>
-            public string homeId = string.Empty;
-            /// <summary>
-            /// 铏氭嫙鎵嬫満鍙�
-            /// </summary>
-            public string phone = string.Empty;
-            /// <summary>
-            /// 铏氭嫙韬唤璇佸彿鐮�
-            /// </summary>
-            public string idCard = string.Empty;
-            /// <summary>
-            /// 绀惧尯涓婚敭Id
-            /// </summary>
-            public string communtiyId = string.Empty;
-            /// <summary>
-            /// 涓版灄妤兼爧鍙�
-            /// </summary>
-            public string flBuildingId = string.Empty;
-            /// <summary>
-            /// 涓版灄妤兼爧鍚嶇О
-            /// </summary>
-            public string flBuildingName = string.Empty;
-            /// <summary>
-            /// 涓版灄鎴块棿鍚嶇О
-            /// </summary>
-            public string flRoomId = string.Empty;
-            /// <summary>
-            /// 涓版灄瀹夊叏瀵嗛挜
-            /// </summary>
-            public string flSecretKey = string.Empty;
-            /// <summary>
-            /// 涓版灄鐨勫皬鍖篒d
-            /// </summary>
-            public string flCmtId = string.Empty;
-
-        }
-        [Serializable]
-        public class Call
+        /// <returns></returns>
+        public static string GetCode()
         {
-            /// <summary>
-            ///璁板綍涓婚敭Id
-            /// </summary>
-            public string id = string.Empty;
-            /// <summary>
-            /// 浣忓畢id
-            /// </summary>
-            public string homeId = string.Empty;
-            /// <summary>
-            /// 鍛煎彨鏃堕棿
-            /// </summary>
-            public string callTime = string.Empty;
-            /// <summary>
-            /// 閫氳瘽鏃堕暱
-            /// </summary>
-            public string callDuration = string.Empty;
-            /// <summary>
-            /// 鍛煎彨鐘舵�侊紙0锛氭湭鎺ワ紱1锛氬凡鎺ワ紱2锛氭嫆鎺ワ級
-            /// </summary>
-            public string callStatus = string.Empty;
-            /// <summary>
-            /// 鏄惁寮�閿�
-            /// </summary>
-            public bool isUnlock;
-            /// <summary>
-            /// 鎴浘鍦板潃
-            /// </summary>
-            public string screenshotUrl = string.Empty;
-            /// <summary>
-            ///涓版灄缁戝畾涓婚敭id锛堥棬鍙f満涓婚敭Id锛�
-            /// </summary>
-            public string flBindId = string.Empty;
-        }
-        [Serializable]
-        public class CallView
+            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()
         {
-            /// <summary>
-            ///骞�
-            /// </summary>
-            public string year = string.Empty;
+            //TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
+            //return Convert.ToInt64(ts.TotalSeconds).ToString();
 
-           public List<Call> callList = new List<Call>();
-
+            System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯
+          
+            return ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟
+            
         }
-        [Serializable]
-        public class FlVideo
+        /// <summary>
+        /// 鑾峰彇褰撳墠鏃堕棿鎴�
+        /// </summary>
+        /// <returns></returns>
+        public static string GetTomorrowTimeStamp()
         {
-            /// <summary>
-            /// 璁惧鍚嶇О
-            /// </summary>
-            public string aliasName = string.Empty;
-            /// <summary>
-            /// 璁惧绫诲瀷锛�(1瀹ゅ唴鏈�,2瀹ゅ鏈猴紝3鍥村鏈猴紝4绠$悊鏈�,5浜屾纭鏈�)
-            /// </summary>
-            public string devType = string.Empty;
-            public string uuid = string.Empty;
+            //褰撳墠鏃堕棿鐨勫悗涓�澶�
+            //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