From 675df74cdd4103ffdcbfa0a6ccfc105fd61af15a Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 29 十月 2021 15:44:18 +0800
Subject: [PATCH] 2021-10-29 1.更新乐橙 AndroidSDK
---
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs | 183 +++++++++++----------------------------------
1 files changed, 46 insertions(+), 137 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
index e7b3272..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,74 +15,81 @@
/// </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<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);
+ // 杩欓噷鍐嶈幏鍙栦竴娆¤澶囧垪琛紙鏇存柊鏁版嵁锛�
+ 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
{
Application.RunOnMainThread(() =>
{
loading.Hide();
- var mainView = new MainView();
+ 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>
/// <param name="action">鍥炶皟鍑芥暟</param>
/// <param name="frame">log鐖舵帶浠�</param>
/// <param name="tag">鏄惁瑕佹樉绀簂og(榛樿鏄剧ずtag=true)</param>
- public void GetVideo(Action<VideoClouds> action, FrameLayout frame, bool tag)
+ public void GetVideo(Action<VideoClouds> action, FrameLayout frame, bool tag)
{
- VideoClouds videoObj = null;
+ VideoClouds videoObj =null;
ThreadSend(null, (responsePackNew) =>
- {
- try
- {
- var str = responsePackNew.Data.ToString();
- videoObj = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoClouds>(str);
- action(videoObj);
- }
- catch
- {
- action(videoObj);
- }
- }, "鑾峰彇鍙瀵硅", "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()
{
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,7 +141,8 @@
}
catch { }
return callViewList;
- }
+ }
+
/// <summary>
/// 鍙戦�佸懡浠ょ嚎绋�
/// </summary>
@@ -166,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();
}
}
@@ -190,7 +201,7 @@
}
else
{
- Method method = new Method();
+ PirMethod method = new PirMethod();
//鑷畾涔夐敊璇彁绀烘枃鏈�
string eorroText = "";
if (str == "鑾峰彇鍙瀵硅")
@@ -207,6 +218,7 @@
}
+
/// <summary>
/// 闅忔満瀵嗙爜6浣�
/// </summary>
@@ -220,7 +232,8 @@
code += rand.Next(10).ToString();
}
return code;
- }
+ }
+
/// <summary>
/// 鑾峰彇褰撳墠鏃堕棿鎴�
/// </summary>
@@ -231,10 +244,11 @@
//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>
@@ -246,111 +260,6 @@
//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
- {
- /// <summary>
- /// 涓版灄缁戝畾id锛坒lBindId锛�(userKey)
- /// </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
- {
- /// <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
- {
- /// <summary>
- ///骞�
- /// </summary>
- public string year = string.Empty;
-
- 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