From 0d4ae0f7283f5e013f2ddee854dfb6aaad07bd50 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 01 四月 2021 16:35:11 +0800
Subject: [PATCH] Merge branch 'WJC' into temp-wxr
---
HDL-ON_Android/Properties/AndroidManifest.xml | 11
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs | 532 ++++++++++++++++++++
HDL-ON_Android/VideoActivity.cs | 2
HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs | 32
HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs | 2
HDL_ON/Common/ApiUtlis.cs | 2
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 9
HDL_ON/HDL_ON.projitems | 3
HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs | 115 ++++
HDL_ON/Entity/FunctionList.cs | 2
/dev/null | 536 --------------------
HDL_ON/DAL/Server/HttpUtil.cs | 6
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs | 53 +
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs | 241 ++------
14 files changed, 789 insertions(+), 757 deletions(-)
diff --git a/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs b/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs
index 3d69f40..7585efa 100644
--- a/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs
+++ b/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs
@@ -279,7 +279,7 @@
{
string UserData = "user text";
//娉ㄦ剰锛歊equestAudio 璇锋眰瀵规柟闊抽锛孯equestVideo璇锋眰瀵规柟瑙嗛 SendAudio鍙戦�佹湰鍦伴煶棰� SendVideo 鍙戦�佹湰鍦拌棰� 涓�鑸棬鍙d笉鎺ユ敹鍒拌棰戯紝鎵�浠ユ渶濂借缃�0锛屽噺灏戞祦閲忔秷鑰�
- string param = string.Format("RequestAudio=1\r\n" + "RequestVideo=1\r\n" + "SendAudio=1\r\n" + "SendVideo=0r\n" + "UserData=%s\r\n", UserData);
+ string param = string.Format("RequestAudio=1\r\n" + "RequestVideo=1\r\n" + "SendAudio=1\r\n" + "SendVideo=1r\n" + "UserData=%s\r\n", UserData);
mPhone.AcceptRing(param);
answerLayout.Visibility = ViewStates.Gone;
PostAnswer();
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 429a44a..cb0a90f 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,6 +1,17 @@
锘�<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202104011" android:versionName="1.2.202104011" package="com.hdl.onpro">
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" />
+ <!-- 鍙瀵硅鏉冮檺-->
+ <uses-permission android:name="android.permission.CAMERA" />
+ <uses-feature android:name="android.hardware.camera" />
+ <uses-feature android:name="android.hardware.camera.autofocus" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+ <uses-permission android:name="android.permission.VIBRATE" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- 瀹氫綅鏉冮檺-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
diff --git a/HDL-ON_Android/VideoActivity.cs b/HDL-ON_Android/VideoActivity.cs
index 5229a2a..385ba73 100644
--- a/HDL-ON_Android/VideoActivity.cs
+++ b/HDL-ON_Android/VideoActivity.cs
@@ -169,7 +169,7 @@
mPhone.SetRemoteSurfaceHolder(mRemoteSurfaceHolder, "mRemoteSurfaceHolder!=null"); //璁剧疆鏉ョ數绐楀彛
}
- ViewGroup v = (ViewGroup)FindViewById(Resource.Id.localVideo);
+ ViewGroup v = (ViewGroup)FindViewById(Resource.Id.locaVideo);
mPhone.SetLocalVideoContainer(v);//璁剧疆鏈湴瑙嗛绐楀彛锛屼竴瀹氳璋冪敤锛屼笉鐒跺悗浼氬嚭鐜版病澹伴煶
}
else
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 364561b..2013562 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -281,7 +281,7 @@
var flVideoInfo = HttpRequest.CheckFlVideo();
if(flVideoInfo.Code == StateCode.SUCCESS)
{
- FunctionList.List.videoIntercom = Newtonsoft.Json.JsonConvert.DeserializeObject<UI.UI2.FuntionControlView.Video.VideoMethod.VideoClouds>(flVideoInfo.Data.ToString());
+ FunctionList.List.videoIntercom = Newtonsoft.Json.JsonConvert.DeserializeObject<UI.UI2.FuntionControlView.Video.VideoClouds>(flVideoInfo.Data.ToString());
}
}
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 2b7664b..7f7b499 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -17,8 +17,8 @@
/// 鍥哄畾鍩熷悕,姝e紡鐜
/// 鍏叡鍩熷悕灏辫繎瑙f瀽
/// </summary>
- public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
- //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
+ //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+ public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
/// <summary>
/// RegionMark
/// </summary>
@@ -157,7 +157,7 @@
////**************娴嬭瘯**************
- // string requestFullUrl = GlobalRequestHttpsHost + apiPath;
+ //string requestFullUrl = GlobalRequestHttpsHost + apiPath;
////**************娴嬭瘯**************
RestClient client = new RestClient(requestFullUrl);
diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index a53457b..5725ed5 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -131,7 +131,7 @@
/// <summary>
/// 鍙瀵硅鍒楄〃
/// </summary>
- public UI.UI2.FuntionControlView.Video.VideoMethod.VideoClouds videoIntercom;
+ public UI.UI2.FuntionControlView.Video.VideoClouds videoIntercom;
/// <summary>
/// 鍦烘櫙鍒楄〃
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index f11d072..560e165 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -380,7 +380,6 @@
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AcControlPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\FhControlPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\TvControlPage.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\MainView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\FrameLayout50.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\FrameLayout60.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\ShowDialog.cs" />
@@ -394,6 +393,8 @@
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AirFreshControlPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoMethod.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoSend.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoMainView.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\ObjectClass.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)DAL\" />
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 383a189..8e33a2b 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -627,7 +627,7 @@
LoadEvent_SwitchFunction(btnLightPower, item, functionView);
};
functionPageTitleId = StringId.Lights;
-
+
#endregion
break;
case ShowFunction.AC:
@@ -805,13 +805,10 @@
break;
case ShowFunction.VideoIntercom:
btnName.TextID = StringId.VideoIntercom;
-
btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
{
- var mainView = new HDL_ON.UI.UI2.FuntionControlView.Video.MainView();
- MainPage.BasePageView.AddChidren(mainView);
- mainView.Show();
- MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ var videoMethod = new UI2.FuntionControlView.Video.VideoMethod();
+ videoMethod.MianView(this,FunctionList.List.videoIntercom);
};
break;
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
index 12b1c82..49bab2e 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -286,21 +286,28 @@
{
//娓呯┖涔嬪墠鏁版嵁
DeviceTypeList.Clear();
- var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString());
- for (int a = 0; a < jArray.Count; a++)
+ try
{
- var jay = jArray[a];
- var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
- var objDeviceType = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceType>(str);
- if (objDeviceType != null)
+ var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString());
+ for (int a = 0; a < jArray.Count; a++)
{
- if (null == DeviceTypeList.Find((c) => c.id == objDeviceType.id))
+ var jay = jArray[a];
+ var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
+ var objDeviceType = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceType>(str);
+ if (objDeviceType != null)
{
- DeviceTypeList.Add(objDeviceType);
+ if (null == DeviceTypeList.Find((c) => c.id == objDeviceType.id))
+ {
+ DeviceTypeList.Add(objDeviceType);
+ }
}
}
+ action();
}
- action();
+ catch
+ {
+
+ }
}
else
{
@@ -325,21 +332,31 @@
{
//娓呯┖涔嬪墠鏁版嵁
brandList.Clear();
- var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString());
- for (int a = 0; a < jArray.Count; a++)
+ try
{
- var jay = jArray[a];
- var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
- var brand = Newtonsoft.Json.JsonConvert.DeserializeObject<Brand>(str);
- if (brand != null)
+ var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString());
+ for (int a = 0; a < jArray.Count; a++)
{
- if (null == brandList.Find((c) => c.id == brand.id))
+ var jay = jArray[a];
+ var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
+ var brand = Newtonsoft.Json.JsonConvert.DeserializeObject<Brand>(str);
+ if (brand != null)
{
- brandList.Add(brand);
+ if (null == brandList.Find((c) => c.id == brand.id))
+ {
+ brandList.Add(brand);
+ }
}
}
}
- actionBrand(brandList);
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ actionBrand(brandList);
+ });
+ }
}
else
{
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs
deleted file mode 100644
index 9ec50bf..0000000
--- a/HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs
+++ /dev/null
@@ -1,536 +0,0 @@
-锘縰sing System;
-using HDL_ON.UI.Music;
-using System.Collections.Generic;
-using Shared;
-using HDL_ON.Stan;
-using ZXing.QrCode.Internal;
-using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
-using HDL_ON.Entity;
-
-namespace HDL_ON.UI.UI2.FuntionControlView.Video
-{
- public class MainView : FrameLayout
- {
- /// <summary>
- /// 鍔犺浇鍙瀵硅UI
- /// </summary>
- /// <param name="listVideo">闂ㄥ彛鏈哄垪琛�</param>
- /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
- /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param>
- //public void Show(List<VideoMethod.FlVideo> listVideo, List<CallView> listCall, VideoClouds video)
- public void Show()
- {
-
- #region 甯冨眬鐣岄潰
- this.BackgroundColor = MusicColor.ViewColor;
- var topView = new TopView();
- this.AddChidren(topView.TopFLayoutView());
- topView.topNameBtn.TextID = StringId.keshiduijiang;
- topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- var pageView = new PageLayout()
- {
- Y = Application.GetRealHeight(64),
- Height = Application.GetRealHeight(667 - 64),
- IsShowPoint = false,
- };
- this.AddChidren(pageView);
- var view1 = new FrameLayout();
- pageView.AddChidren(view1);
- var view2 = new FrameLayout();
- pageView.AddChidren(view2);
- View1(view1);
- View2(view2);
- Button btn11 = new Button
- {
- X = Application.GetRealWidth(170),
- Y = Application.GetRealHeight(578),
- Width = Application.GetRealWidth(14),
- Height = Application.GetRealHeight(6),
- BackgroundColor = MusicColor.SelectedColor,
- Radius = (uint)Application.GetRealHeight(4),
- };
- view1.AddChidren(btn11);
-
- Button btn12 = new Button
- {
- X = Application.GetRealWidth(192),
- Y = Application.GetRealHeight(578),
- Width = Application.GetRealWidth(14),
- Height = Application.GetRealHeight(6),
- BackgroundColor = 0x404484F4,
- Radius = (uint)Application.GetRealHeight(4),
- };
- view1.AddChidren(btn12);
- Button btn21 = new Button
- {
- X = Application.GetRealWidth(170),
- Y = Application.GetRealHeight(578),
- Width = Application.GetRealWidth(14),
- Height = Application.GetRealHeight(6),
- BackgroundColor = 0x404484F4,
- Radius = (uint)Application.GetRealHeight(4),
- };
- view2.AddChidren(btn21);
-
- Button btn22 = new Button
- {
- X = Application.GetRealWidth(192),
- Y = Application.GetRealHeight(578),
- Width = Application.GetRealWidth(14),
- Height = Application.GetRealHeight(6),
- BackgroundColor = MusicColor.SelectedColor,
- Radius = (uint)Application.GetRealHeight(4),
- };
- view2.AddChidren(btn22);
-
- pageView.PageChange = (sender, e) =>
- {
-
- if (pageView.PageIndex == 0)
- {
- topView.topNameBtn.TextID = StringId.keshiduijiang;
- }
- else
- {
- topView.topNameBtn.TextID = StringId.tonghuajilu;
-
- }
- };
- #endregion
- }
- /// <summary>
- /// 绗竴涓晫闈�
- /// </summary>
- /// <param name="view1">鐖舵帶浠�</param>
- /// <param name="list">闂ㄥ彛鏈哄垪琛�</param>
- /// <param name="videoClouds">褰撳墠鐨勫彲瑙嗗璁�</param>
- void View1(FrameLayout view1)
- {
-
- new System.Threading.Thread(() =>
- {
- var list = VideoSend.GetVideoInfoList(FunctionList.List.videoIntercom);
- Application.RunOnMainThread(() =>
- {
- #region 甯冨眬鐣岄潰
- var bjFl = new FrameLayout
- {
- Y = Application.GetRealHeight(24),
- X = Application.GetRealWidth(24),
- Height = Application.GetRealHeight(526),
- Width = Application.GetRealWidth(327),
- BackgroundImagePath = "MusicIcon/playBj.png",
- };
- view1.AddChidren(bjFl);
- /// <summary>
- /// 姹夊瓧
- /// </summary>
- Button nameBtn = new Button
- {
- X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(16),
- Width = Application.GetRealWidth(100),
- Height = Application.GetRealHeight(33),
- TextColor = MusicColor.MusicTxet14Color,
- TextSize = TextSize.Text24,
- TextAlignment = TextAlignment.CenterLeft,
- //Text = "鍙瀵硅",
- TextID = StringId.keshiduijiang,
- };
- bjFl.AddChidren(nameBtn);
- /// <summary>
- /// 鍖哄煙鍚嶇О
- /// </summary>
- Button regionBtn = new Button
- {
- X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(53),
- Width = Application.GetRealWidth(270),
- Height = Application.GetRealHeight(17),
- TextColor = MusicColor.MusicNoTxetColor,
- TextSize = TextSize.Text12,
- TextAlignment = TextAlignment.CenterLeft,
- Text = "123456"
- };
- bjFl.AddChidren(regionBtn);
- /// <summary>
- ///鏀惰棌鍥炬爣
- /// </summary>
- Button collectIconBtn = new Button
- {
- X = Application.GetRealWidth(273),
- Y = Application.GetRealHeight(14),
- Width = Application.GetRealWidth(40),
- Height = Application.GetRealWidth(40),
- UnSelectedImagePath = "MusicIcon/collect.png",
- SelectedImagePath = "MusicIcon/collectSelected.png",
- };
- bjFl.AddChidren(collectIconBtn);
- ///鍙瀵硅鍥炬爣
- Button intercomBtnIcon = new Button
- {
- X = Application.GetRealWidth(84),
- Y = Application.GetRealHeight(118),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealWidth(160),
- UnSelectedImagePath = "VideoIcon/keshiduijiang.png",
-
- };
- bjFl.AddChidren(intercomBtnIcon);
-
- var vv = new VerticalScrolViewLayout
- {
- Y = Application.GetRealHeight(306),
- Height = Application.GetRealHeight(220),
- Width = Application.GetRealWidth(327),
- };
- bjFl.AddChidren(vv);
- if (list.Count > 0)
- {
- //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�,铏氭嫙涓�涓嚭鏉�
- list.Add(new VideoMethod.FlVideo { aliasName = Language.StringByID(StringId.menjinerweima), devType = "100" });
- }
- //鏁扮粍涓暟
- //int value = 15;
- //鍏堣绠楁暟鎹墍闇�瑕佺殑寰堥珮搴︼紱
- int l = 0;
- if (list.Count % 3 == 0)
- {
- l = list.Count / 3;
- }
- else
- {
- l = (list.Count / 3) + 1;
- }
- var fL = new FrameLayout
- {
- Height = Application.GetRealHeight((48 + 24) * l),
- };
- vv.AddChidren(fL);
- int line = 0;
- #endregion
- for (int i = 1, j = 0; i <= list.Count; i++, j++)
- {
- var video = list[i - 1];
- #region
- var fLayout = new FrameLayout
- {
- Width = Application.GetRealWidth(50),
- Height = Application.GetRealWidth(48),
- X = Application.GetRealWidth(31 + (58 + 50) * j),
- Y = Application.GetRealHeight(20 + (48 + 24) * line),
-
- };
- fL.AddChidren(fLayout);
-
- var iconBtn = new Button
- {
- X = Application.GetRealWidth(11),
- Width = Application.GetRealWidth(28),
- Height = Application.GetRealWidth(28),
- UnSelectedImagePath = "VideoIcon/weiqiangji.png",
- };
- fLayout.AddChidren(iconBtn);
-
- var deviceNameBtn = new Button
- {
- Y = iconBtn.Bottom + Application.GetRealHeight(6),
- Width = Application.GetRealWidth(50),
- Height = Application.GetRealHeight(14),
- TextSize = TextSize.Text10,
- TextColor = CSS.CSS_Color.TextualColor,
- TextAlignment = TextAlignment.Center,
- Text = video.aliasName,
- };
- fLayout.AddChidren(deviceNameBtn);
-
- var clickBtn = new Button { Tag = video };
-
- fLayout.AddChidren(clickBtn);
- if (i % 3 == 0)
- {
- //婊′竴琛岄噸缃甹=0鍊�;
- j = -1;
- line += 1;
- }
- getIconAndText(video, iconBtn);
- #endregion
- //闂ㄥ彛鏈虹殑鐐瑰嚮浜嬩欢
- clickBtn.MouseUpEventHandler += (sender, e) =>
- {
- var flVideo = clickBtn.Tag as VideoMethod.FlVideo;
- if (flVideo.devType == "100")
- {
- //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�
- VideoSend.GetQRcode(this, FunctionList.List.videoIntercom, (tag, paw) =>
- {
- if (tag)
- {
- //娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥
- View.ShowDialog showDialog = new View.ShowDialog();
- showDialog.QRcode(paw);
- }
- });
- }
- else
- {
- if (string.IsNullOrEmpty(flVideo.uuid))
- {
- new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.peizhicanshuyouyichang));
- }
- ESVideoInfo eSVideoInfo = new ESVideoInfo
- {
- ESVideoUUID = getUuid(flVideo.uuid),
- DeviceName = flVideo.aliasName,
- roomno = FunctionList.List.videoIntercom.flRoomId,
- unitno = FunctionList.List.videoIntercom.flBuildingId,
- };
- ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo);
- }
-
-
- };
- }
- });
- })
- { IsBackground = true }.Start();
- }
- /// <summary>
- /// 绗簩涓晫闈�
- /// </summary>
- /// <param name="view2">鐖舵帶浠�</param>
- /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
- /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param>
- void View2(FrameLayout view2)
- {
- new System.Threading.Thread(() =>
- {
- var listCall = new HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod().getCall(FunctionList.List.videoIntercom.id);
- Application.RunOnMainThread(() =>
- {
- var bjFl = new FrameLayout
- {
- Y = Application.GetRealHeight(24),
- X = Application.GetRealWidth(24),
- Height = Application.GetRealHeight(526),
- Width = Application.GetRealWidth(327),
- BackgroundImagePath = "MusicIcon/playBj.png",
- };
- view2.AddChidren(bjFl);
- /// <summary>
- /// 姹夊瓧
- /// </summary>
- Button nameBtn = new Button
- {
- X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(16),
- Width = Application.GetRealWidth(100),
- Height = Application.GetRealHeight(33),
- TextColor = MusicColor.MusicTxet14Color,
- TextSize = TextSize.Text24,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = StringId.tonghuajilu,
- };
- bjFl.AddChidren(nameBtn);
- /// <summary>
- /// 浜戠鐓х墖鍙繚鐣�30澶�
- /// </summary>
- Button regionBtn = new Button
- {
- X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(53),
- Width = Application.GetRealWidth(270),
- Height = Application.GetRealHeight(17),
- TextColor = MusicColor.SelectedColor,
- TextSize = TextSize.Text12,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = StringId.baolu30,
- };
- bjFl.AddChidren(regionBtn);
-
- var vv = new VerticalRefreshLayout
- {
- X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(58),
- Height = Application.GetRealHeight(458),
- Width = Application.GetRealWidth(295),
- };
- bjFl.AddChidren(vv);
- vv.BeginHeaderRefreshingAction += () =>
- {
- VideoMethod videoMethod = new VideoMethod();
- var list = videoMethod.getCall(FunctionList.List.videoIntercom.id);
- RefreshView(vv, list);
- //鍏抽棴鍒锋柊View锛�
- vv.EndHeaderRefreshing();
- };
- //RefreshView(vv, listCall);
- });
- })
- { IsBackground = true }.Start();
- }
- /// <summary>
- /// 閫氳瘽璁板綍鍒锋柊鐣岄潰
- /// </summary>
- /// <param name="vv">涓婁笅婊戝姩鎺т欢</param>
- /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
- public void RefreshView(VerticalRefreshLayout vv, List<CallView> listCall)
- {
- vv.RemoveAll();
- for (int i = 0; i < listCall.Count; i++)
- {
- var year = listCall[i];
- //骞存枃鏈埗鎺т欢
- View.FrameLayout50 frameLayout50 = new View.FrameLayout50();
- vv.AddChidren(frameLayout50.FLayoutView());
- frameLayout50.btnText.Text = year.year + Language.StringByID(StringId.nian);//骞�
- for (int j = 0; j < year.callList.Count; j++)
- {
- var call = year.callList[j];
- //闂ㄥ彛鏈虹姸鎬佺埗鎺т欢
- View.FrameLayout60 frameLayout60 = new View.FrameLayout60();
- vv.AddChidren(frameLayout60.FLayoutView());
- ///鍛煎彨鏃堕棿
- frameLayout60.btnTime.Text = getTime(call.callTime);
- ///鍛煎彨鐘舵�侊紙0锛氭湭鎺ワ紱1锛氬凡鎺ワ紱2锛氭嫆鎺ワ級锛涙槸鍚﹀紑閿侊紱
- frameLayout60.btnStateText.Text = getStateText(call.callStatus) + "," + getUnlockText(call.isUnlock);
-
- }
-
- }
-
-
- }
- /// <summary>
- /// 鏄剧ず鍥炬爣
- /// </summary>
- /// <param name="flVideo"></param>
- /// <param name="iconBtn">鍥炬爣</param>
- private void getIconAndText(FlVideo flVideo, Button iconBtn)
- {
- //(1瀹ゅ唴鏈�,2瀹ゅ鏈猴紝3鍥村鏈猴紝4绠$悊鏈�,5浜屾纭鏈�)
- string iconstr = "";
- switch (flVideo.devType)
- {
- case "1":
- {
- iconstr = "VideoIcon/danyuanji.png";
- }
- break;
- case "2":
- {
- iconstr = "VideoIcon/danyuanji.png";
- }
- break;
- case "3":
- {
- iconstr = "VideoIcon/weiqiangji.png";
- }
- break;
- case "4":
- {
- iconstr = "VideoIcon/weiqiangji.png";
- }
- break;
- case "5":
- {
- iconstr = "VideoIcon/weiqiangji.png";
- }
- break;
- case "100":
- {
- iconstr = "VideoIcon/menjin.png";
- }
- break;
- default:
- {
- iconstr = "VideoIcon/weiqiangji.png";
- }
- break;
-
- }
- iconBtn.UnSelectedImagePath = iconstr;
-
- }
- /// <summary>
- /// 鑾峰彇鏄剧ず鏃堕棿鏂囨湰
- /// </summary>
- /// <param name="str">utcTime</param>
- /// <returns></returns>
- private string getTime(string str)
- {
- var utcTime = Convert.ToDateTime(str);
- var dateTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, TimeZoneInfo.Local);
- return dateTime.ToString("HH") + ":" + dateTime.ToString("mm");
- }
- /// <summary>
- /// 鑾峰彇鍛煎彨鐘舵�佹枃鏈�
- /// </summary>
- /// <param name="str">鐘舵�佸��0锛氭湭鎺ワ紱1锛氬凡鎺ワ紱2锛氭嫆鎺�</param>
- /// <returns></returns>
- private string getStateText(string str)
- {
- string s = "";
- switch (str)
- {
- case "0":
- {
- s = Language.StringByID(StringId.weijieting);
- }
- break;
- case "1":
- {
- Language.StringByID(StringId.yijieting);
- }
- break;
- case "2":
- {
- Language.StringByID(StringId.yijujue);
- }
- break;
- }
- return s;
- }
- /// <summary>
- /// 鑾峰彇寮�閿佺姸鎬佹枃鏈�
- /// </summary>
- /// <param name="if_bool"></param>
- /// <returns></returns>
- private string getUnlockText(bool if_bool)
- {
- string s = "";
- if (if_bool)
- {
- s = Language.StringByID(StringId.yikaisuo);
- }
- else
- {
- s = Language.StringByID(StringId.weikaisuo);
- }
- return s;
- }
- /// <summary>
- /// 鑾峰彇uuid
- /// </summary>
- /// <param name="uuid"></param>
- /// <returns></returns>
- private string getUuid(string uuid)
- {
- if (uuid.Contains(","))
- {
- var uuid1 = uuid.Split(',');
- return uuid1[0];
- }
- else
- {
- return uuid;
- }
- }
-
- }
-
-}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs
new file mode 100644
index 0000000..6114108
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs
@@ -0,0 +1,115 @@
+锘縰sing System;
+using System.Collections.Generic;
+
+namespace HDL_ON.UI.UI2.FuntionControlView.Video
+{
+ public class ObjectClass
+ {
+
+ }
+ [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;
+ }
+}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
new file mode 100644
index 0000000..e70db56
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
@@ -0,0 +1,532 @@
+锘縰sing System;
+using HDL_ON.UI.Music;
+using System.Collections.Generic;
+using Shared;
+using HDL_ON.Stan;
+using ZXing.QrCode.Internal;
+using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
+
+namespace HDL_ON.UI.UI2.FuntionControlView.Video
+{
+ public class VideoMainView : FrameLayout
+ {
+ /// <summary>
+ /// 鍔犺浇鍙瀵硅UI
+ /// </summary>
+ /// <param name="listVideo">闂ㄥ彛鏈哄垪琛�</param>
+ /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
+ /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param>
+ public void Show(List<FlVideo> listVideo, List<CallView> listCall, VideoClouds video)
+ {
+ #region 甯冨眬鐣岄潰
+ this.BackgroundColor = MusicColor.ViewColor;
+ var topView = new TopView();
+ this.AddChidren(topView.TopFLayoutView());
+ topView.topNameBtn.TextID = StringId.keshiduijiang;
+
+
+ var pageView = new PageLayout()
+ {
+ Y = Application.GetRealHeight(64),
+ Height = Application.GetRealHeight(667 - 64),
+ IsShowPoint = false,
+ };
+ this.AddChidren(pageView);
+ var view1 = new FrameLayout();
+ pageView.AddChidren(view1);
+ var view2 = new FrameLayout();
+ pageView.AddChidren(view2);
+ View1(view1, listVideo, video);
+ View2(view2, listCall, video);
+ Button btn11 = new Button
+ {
+ X = Application.GetRealWidth(170),
+ Y = Application.GetRealHeight(578),
+ Width = Application.GetRealWidth(14),
+ Height = Application.GetRealHeight(6),
+ BackgroundColor = MusicColor.SelectedColor,
+ Radius = (uint)Application.GetRealHeight(4),
+ };
+ view1.AddChidren(btn11);
+
+ Button btn12 = new Button
+ {
+ X = Application.GetRealWidth(192),
+ Y = Application.GetRealHeight(578),
+ Width = Application.GetRealWidth(14),
+ Height = Application.GetRealHeight(6),
+ BackgroundColor = 0x404484F4,
+ Radius = (uint)Application.GetRealHeight(4),
+ };
+ view1.AddChidren(btn12);
+ Button btn21 = new Button
+ {
+ X = Application.GetRealWidth(170),
+ Y = Application.GetRealHeight(578),
+ Width = Application.GetRealWidth(14),
+ Height = Application.GetRealHeight(6),
+ BackgroundColor = 0x404484F4,
+ Radius = (uint)Application.GetRealHeight(4),
+ };
+ view2.AddChidren(btn21);
+
+ Button btn22 = new Button
+ {
+ X = Application.GetRealWidth(192),
+ Y = Application.GetRealHeight(578),
+ Width = Application.GetRealWidth(14),
+ Height = Application.GetRealHeight(6),
+ BackgroundColor = MusicColor.SelectedColor,
+ Radius = (uint)Application.GetRealHeight(4),
+ };
+ view2.AddChidren(btn22);
+
+ pageView.PageChange = (sender, e) =>
+ {
+
+ if (pageView.PageIndex == 0)
+ {
+ topView.topNameBtn.TextID = StringId.keshiduijiang;
+ }
+ else
+ {
+ topView.topNameBtn.TextID = StringId.tonghuajilu;
+
+ }
+ };
+ topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ if (pageView.PageIndex == 1)
+ {
+ pageView.PageIndex = 0;
+ }
+ else
+ {
+ RemoveFromParent();
+ }
+
+ };
+ #endregion
+ }
+ /// <summary>
+ /// 绗竴涓晫闈�
+ /// </summary>
+ /// <param name="view1">鐖舵帶浠�</param>
+ /// <param name="list">闂ㄥ彛鏈哄垪琛�</param>
+ /// <param name="videoClouds">褰撳墠鐨勫彲瑙嗗璁�</param>
+ void View1(FrameLayout view1, List<FlVideo> list, VideoClouds videoClouds)
+ {
+ #region 甯冨眬鐣岄潰
+ var bjFl = new FrameLayout
+ {
+ Y = Application.GetRealHeight(24),
+ X = Application.GetRealWidth(24),
+ Height = Application.GetRealHeight(526),
+ Width = Application.GetRealWidth(327),
+ BackgroundImagePath = "MusicIcon/playBj.png",
+ };
+ view1.AddChidren(bjFl);
+ /// <summary>
+ /// 姹夊瓧
+ /// </summary>
+ Button nameBtn = new Button
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(16),
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(33),
+ TextColor = MusicColor.MusicTxet14Color,
+ TextSize = TextSize.Text24,
+ TextAlignment = TextAlignment.CenterLeft,
+ //Text = "鍙瀵硅",
+ TextID = StringId.keshiduijiang,
+ };
+ bjFl.AddChidren(nameBtn);
+ /// <summary>
+ /// 鍖哄煙鍚嶇О
+ /// </summary>
+ Button regionBtn = new Button
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(53),
+ Width = Application.GetRealWidth(270),
+ Height = Application.GetRealHeight(17),
+ TextColor = MusicColor.MusicNoTxetColor,
+ TextSize = TextSize.Text12,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = "123456"
+ };
+ // bjFl.AddChidren(regionBtn);
+ /// <summary>
+ ///鏀惰棌鍥炬爣
+ /// </summary>
+ Button collectIconBtn = new Button
+ {
+ X = Application.GetRealWidth(273),
+ Y = Application.GetRealHeight(14),
+ Width = Application.GetRealWidth(40),
+ Height = Application.GetRealWidth(40),
+ UnSelectedImagePath = "MusicIcon/collect.png",
+ SelectedImagePath = "MusicIcon/collectSelected.png",
+ };
+ // bjFl.AddChidren(collectIconBtn);
+ ///鍙瀵硅鍥炬爣
+ Button intercomBtnIcon = new Button
+ {
+ X = Application.GetRealWidth(84),
+ Y = Application.GetRealHeight(118),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealWidth(160),
+ UnSelectedImagePath = "VideoIcon/keshiduijiang.png",
+
+ };
+ bjFl.AddChidren(intercomBtnIcon);
+
+ var vv = new VerticalScrolViewLayout
+ {
+ Y = Application.GetRealHeight(306),
+ Height = Application.GetRealHeight(220),
+ Width = Application.GetRealWidth(327),
+ };
+ bjFl.AddChidren(vv);
+ if (list.Count > 0)
+ {
+ //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�,铏氭嫙涓�涓嚭鏉�
+ list.Add(new FlVideo { aliasName = Language.StringByID(StringId.menjinerweima), devType = "100" });
+ }
+ //鏁扮粍涓暟
+ //int value = 15;
+ //鍏堣绠楁暟鎹墍闇�瑕佺殑寰堥珮搴︼紱
+ int l = 0;
+ if (list.Count % 3 == 0)
+ {
+ l = list.Count / 3;
+ }
+ else
+ {
+
+ l = (list.Count / 3) + 1;
+ }
+ var fL = new FrameLayout
+ {
+ Height = Application.GetRealHeight((48 + 24) * l),
+
+ };
+ vv.AddChidren(fL);
+ int line = 0;
+ #endregion
+ for (int i = 1, j = 0; i <= list.Count; i++, j++)
+ {
+ var video = list[i - 1];
+ #region
+ var fLayout = new FrameLayout
+ {
+ Width = Application.GetRealWidth(50),
+ Height = Application.GetRealWidth(48),
+ X = Application.GetRealWidth(31 + (58 + 50) * j),
+ Y = Application.GetRealHeight(20 + (48 + 24) * line),
+
+ };
+ fL.AddChidren(fLayout);
+
+ var iconBtn = new Button
+ {
+ X = Application.GetRealWidth(11),
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
+ UnSelectedImagePath = "VideoIcon/weiqiangji.png",
+ };
+ fLayout.AddChidren(iconBtn);
+
+ var deviceNameBtn = new Button
+ {
+ Y = iconBtn.Bottom + Application.GetRealHeight(6),
+ Width = Application.GetRealWidth(50),
+ Height = Application.GetRealHeight(14),
+ TextSize = TextSize.Text10,
+ TextColor = CSS.CSS_Color.TextualColor,
+ TextAlignment = TextAlignment.Center,
+ Text = video.aliasName,
+ };
+ fLayout.AddChidren(deviceNameBtn);
+
+ var clickBtn = new Button { Tag = video };
+
+ fLayout.AddChidren(clickBtn);
+ if (i % 3 == 0)
+ {
+ //婊′竴琛岄噸缃甹=0鍊�;
+ j = -1;
+ line += 1;
+ }
+ getIconAndText(video, iconBtn);
+ #endregion
+ //闂ㄥ彛鏈虹殑鐐瑰嚮浜嬩欢
+ clickBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ var flVideo = clickBtn.Tag as FlVideo;
+ if (flVideo.devType == "100")
+ {
+ //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�
+ VideoSend.GetQRcode(this, videoClouds, (tag, paw) =>
+ {
+ if (tag)
+ {
+ //娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥
+ View.ShowDialog showDialog = new View.ShowDialog();
+ showDialog.QRcode(paw);
+ }
+ });
+ }
+ else
+ {
+ if (string.IsNullOrEmpty(flVideo.uuid))
+ {
+ new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.peizhicanshuyouyichang));
+ return;
+ }
+ ESVideoInfo eSVideoInfo = new ESVideoInfo
+ {
+ ESVideoUUID = getUuid(flVideo.uuid),
+ DeviceName = flVideo.aliasName,
+ roomno = videoClouds.flRoomId,
+ unitno = videoClouds.flBuildingId,
+ };
+ ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo);
+ }
+
+
+ };
+ }
+
+
+ }
+ /// <summary>
+ /// 绗簩涓晫闈�
+ /// </summary>
+ /// <param name="view2">鐖舵帶浠�</param>
+ /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
+ /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param>
+ void View2(FrameLayout view2, List<CallView> listCall, VideoClouds video)
+ {
+
+ var bjFl = new FrameLayout
+ {
+ Y = Application.GetRealHeight(24),
+ X = Application.GetRealWidth(24),
+ Height = Application.GetRealHeight(526),
+ Width = Application.GetRealWidth(327),
+ BackgroundImagePath = "MusicIcon/playBj.png",
+ };
+ view2.AddChidren(bjFl);
+ /// <summary>
+ /// 姹夊瓧
+ /// </summary>
+ Button nameBtn = new Button
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(16),
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(33),
+ TextColor = MusicColor.MusicTxet14Color,
+ TextSize = TextSize.Text24,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = StringId.tonghuajilu,
+ };
+ bjFl.AddChidren(nameBtn);
+ /// <summary>
+ /// 浜戠鐓х墖鍙繚鐣�30澶�
+ /// </summary>
+ Button regionBtn = new Button
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(53),
+ Width = Application.GetRealWidth(270),
+ Height = Application.GetRealHeight(17),
+ TextColor = MusicColor.SelectedColor,
+ TextSize = TextSize.Text12,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = StringId.baolu30,
+ };
+ bjFl.AddChidren(regionBtn);
+
+ var vv = new VerticalRefreshLayout
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(58 + 17),
+ Height = Application.GetRealHeight(458 - 17),
+ Width = Application.GetRealWidth(295),
+ };
+ bjFl.AddChidren(vv);
+ vv.BeginHeaderRefreshingAction += () =>
+ {
+ VideoMethod videoMethod = new VideoMethod();
+ var list = videoMethod.GetCall(video.id);
+ RefreshView(vv, list);
+ //鍏抽棴鍒锋柊View锛�
+ vv.EndHeaderRefreshing();
+ };
+ RefreshView(vv, listCall);
+
+ }
+ /// <summary>
+ /// 閫氳瘽璁板綍鍒锋柊鐣岄潰
+ /// </summary>
+ /// <param name="vv">涓婁笅婊戝姩鎺т欢</param>
+ /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
+ public void RefreshView(VerticalRefreshLayout vv, List<CallView> listCall)
+ {
+ vv.RemoveAll();
+ for (int i = 0; i < listCall.Count; i++)
+ {
+ var year = listCall[i];
+ //骞存枃鏈埗鎺т欢
+ View.FrameLayout50 frameLayout50 = new View.FrameLayout50();
+ vv.AddChidren(frameLayout50.FLayoutView());
+ frameLayout50.btnText.Text = year.year + Language.StringByID(StringId.nian);//骞�
+ for (int j = 0; j < year.callList.Count; j++)
+ {
+ var call = year.callList[j];
+ //闂ㄥ彛鏈虹姸鎬佺埗鎺т欢
+ View.FrameLayout60 frameLayout60 = new View.FrameLayout60();
+ vv.AddChidren(frameLayout60.FLayoutView());
+ ///鍛煎彨鏃堕棿
+ frameLayout60.btnTime.Text = getTime(call.callTime);
+ ///鍛煎彨鐘舵�侊紙0锛氭湭鎺ワ紱1锛氬凡鎺ワ紱2锛氭嫆鎺ワ級锛涙槸鍚﹀紑閿侊紱
+ frameLayout60.btnStateText.Text = getStateText(call.callStatus) + "," + getUnlockText(call.isUnlock);
+
+ }
+
+ }
+
+
+ }
+ /// <summary>
+ /// 鏄剧ず鍥炬爣
+ /// </summary>
+ /// <param name="flVideo"></param>
+ /// <param name="iconBtn">鍥炬爣</param>
+ private void getIconAndText(FlVideo flVideo, Button iconBtn)
+ {
+ //(1瀹ゅ唴鏈�,2瀹ゅ鏈猴紝3鍥村鏈猴紝4绠$悊鏈�,5浜屾纭鏈�)
+ string iconstr = "";
+ switch (flVideo.devType)
+ {
+ case "1":
+ {
+ iconstr = "VideoIcon/danyuanji.png";
+ }
+ break;
+ case "2":
+ {
+ iconstr = "VideoIcon/danyuanji.png";
+ }
+ break;
+ case "3":
+ {
+ iconstr = "VideoIcon/weiqiangji.png";
+ }
+ break;
+ case "4":
+ {
+ iconstr = "VideoIcon/weiqiangji.png";
+ }
+ break;
+ case "5":
+ {
+ iconstr = "VideoIcon/weiqiangji.png";
+ }
+ break;
+ case "100":
+ {
+ iconstr = "VideoIcon/menjin.png";
+ }
+ break;
+ default:
+ {
+ iconstr = "VideoIcon/weiqiangji.png";
+ }
+ break;
+
+ }
+ iconBtn.UnSelectedImagePath = iconstr;
+
+ }
+ /// <summary>
+ /// 鑾峰彇鏄剧ず鏃堕棿鏂囨湰
+ /// </summary>
+ /// <param name="str">utcTime</param>
+ /// <returns></returns>
+ private string getTime(string str)
+ {
+ var utcTime = Convert.ToDateTime(str);
+ var dateTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, TimeZoneInfo.Local);
+ return dateTime.ToString("HH") + ":" + dateTime.ToString("mm");
+ }
+ /// <summary>
+ /// 鑾峰彇鍛煎彨鐘舵�佹枃鏈�
+ /// </summary>
+ /// <param name="str">鐘舵�佸��0锛氭湭鎺ワ紱1锛氬凡鎺ワ紱2锛氭嫆鎺�</param>
+ /// <returns></returns>
+ private string getStateText(string str)
+ {
+ string s = "";
+ switch (str)
+ {
+ case "0":
+ {
+ s = Language.StringByID(StringId.weijieting);
+ }
+ break;
+ case "1":
+ {
+ s = Language.StringByID(StringId.yijieting);
+ }
+ break;
+ case "2":
+ {
+ s = Language.StringByID(StringId.yijujue);
+ }
+ break;
+ }
+ return s;
+ }
+ /// <summary>
+ /// 鑾峰彇寮�閿佺姸鎬佹枃鏈�
+ /// </summary>
+ /// <param name="if_bool"></param>
+ /// <returns></returns>
+ private string getUnlockText(bool if_bool)
+ {
+ string s = "";
+ if (if_bool)
+ {
+ s = Language.StringByID(StringId.yikaisuo);
+ }
+ else
+ {
+ s = Language.StringByID(StringId.weikaisuo);
+ }
+ return s;
+ }
+ /// <summary>
+ /// 鑾峰彇uuid
+ /// </summary>
+ /// <param name="uuid"></param>
+ /// <returns></returns>
+ private string getUuid(string uuid)
+ {
+ if (uuid.Contains(","))
+ {
+ var uuid1 = uuid.Split(',');
+ return uuid1[0];
+ }
+ else
+ {
+ return uuid;
+ }
+ }
+
+ }
+
+}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
index 3b5bcd8..b08335b 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
@@ -8,66 +8,71 @@
{
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 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>
+ /// <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<FlVideo> listESVideoInfo = new List<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 VideoMainView();
+ 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>
+ /// <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();
+ 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
@@ -126,7 +131,7 @@
}
catch { }
return callViewList;
- }
+ }
/// <summary>
/// 鍙戦�佸懡浠ょ嚎绋�
/// </summary>
@@ -137,9 +142,8 @@
/// <param name="frame">log鐖舵帶浠�</param>
/// <param name="dialog">log鐖舵帶浠�</param>
/// <param name="tag">鏄惁瑕佹樉绀簂og</param>
- public void ThreadSend(VideoClouds 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")
@@ -202,114 +206,19 @@
}
-
+ /// <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
- {
- /// <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;
- }
}
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs
index e4d944d..d4ed6a6 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs
@@ -12,8 +12,6 @@
public class VideoSend
{
-
-
/// <summary>
/// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋楋紝骞惰幏鍙栭棬鍙f満鍒楄〃
/// </summary>
@@ -24,23 +22,22 @@
var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_FL_Check);
return responsePackNew;
}
-
/// <summary>
/// 鑾峰彇閫氳瘽璁板綍
/// </summary>
/// <returns></returns>
public static ResponsePackNew GetCall(string flBindId)
{
- var jObject = new JObject { { "homeId", PirSend.HomeId }, { "flBindId", flBindId }, { "pageSize", 100 } };
+ var jObject = new JObject { { "homeId", PirSend.HomeId }, { "flBindId", flBindId }, { "pageSize", int.MaxValue } };
var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_FL_GetCallList);
return responsePackNew;
}
/// <summary>
/// 鑾峰彇闂ㄥ彛鏈哄垪琛�(1瀹ゅ唴鏈�,2瀹ゅ鏈猴紝3鍥村鏈猴紝4绠$悊鏈�,5浜屾纭鏈�)
/// </summary>
- public static List<VideoMethod.FlVideo> GetVideoInfoList(VideoMethod.VideoClouds video)
+ public static List<FlVideo> GetVideoInfoList(VideoClouds video)
{
- List<VideoMethod.FlVideo> eSVideoInfosList = new List<VideoMethod.FlVideo>();
+ List<FlVideo> eSVideoInfosList = new List<FlVideo>();
var jobject = new JObject();
jobject.Add("cmtID", video.flCmtId);
jobject.Add("unitno", video.flBuildingId);
@@ -61,38 +58,27 @@
{
return eSVideoInfosList;
}
- eSVideoInfosList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<VideoMethod.FlVideo>>(json["list"].ToString());
+ eSVideoInfosList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<FlVideo>>(json["list"].ToString());
}
catch { }
return eSVideoInfosList;
}
-
- /// <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>
/// 涓婃姤鍔ㄦ�佸紑閿佸瘑鐮�(娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥)
/// </summary>
- public static void GetQRcode(FrameLayout frame, VideoMethod.VideoClouds video, Action<bool, string> action)
+ public static void GetQRcode(FrameLayout frame, VideoClouds video, Action<bool, string> action)
{
- System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯
- var timeStamp = ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟
- var timeStamp2 = ((long)(DateTime.Now.AddDays(1) - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟
-
///鏍囪鏄惁鎴愬姛
bool if_bool = false;
//涓存椂瀵嗙爜
- string pwd = getCode();
+ string pwd = VideoMethod.GetCode();
var jobject = new JObject();
jobject.Add("communityID", video.flCmtId);//绀惧尯ID
- jobject.Add("fromTime", timeStamp);//寮�濮嬫椂闂�
- jobject.Add("validTime", timeStamp2);//鏈夋晥鏃堕棿
+ jobject.Add("fromTime", VideoMethod.GetCurrentTimeStamp());//寮�濮嬫椂闂�
+ jobject.Add("validTime", VideoMethod.GetTomorrowTimeStamp());//鏈夋晥鏃堕棿
jobject.Add("unitno", video.flBuildingId);//鍗曞厓鍙�
jobject.Add("roomno", video.flRoomId);//鎴块棿鍙�
- jobject.Add("code", pwd);
jobject.Add("userKey", video.id);
jobject.Add("timestamp", timeStamp);
jobject.Add("secretKey", video.flSecretKey);
jobject.Add("method", "setdynamicpwd");
jobject.Add("numTimes", "5");
+ jobject.Add("code", pwd);
jobject.Add("userKey", video.id);
jobject.Add("timestamp", VideoMethod.GetCurrentTimeStamp());
jobject.Add("secretKey", video.flSecretKey);
jobject.Add("method", "setdynamicpwd");
jobject.Add("numTimes", "5");
//鍔犺浇log
Loading loading = new Loading();
frame.AddChidren(loading);
--
Gitblit v1.8.0