From 101b9a6cade468847d0b78d6c32bbeffc3202847 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 29 三月 2023 15:39:51 +0800
Subject: [PATCH] 2023年03月29日15:39:36
---
HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/History.png | 0
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs | 248 +++++++++++++++++++++++-------------------------
HDL_ON/Common/HDLCommon.cs | 1
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs | 40 ++++++-
4 files changed, 152 insertions(+), 137 deletions(-)
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/History.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/History.png
new file mode 100644
index 0000000..7609540
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/History.png
Binary files differ
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 5b8bd28..1baaed0 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -7,7 +7,6 @@
using HDL_ON.Entity;
using System.Threading;
using HDL_ON.DriverLayer;
-using Foundation;
namespace HDL_ON
{
/// <summary>
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
index 6708c7d..efa787c 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
@@ -11,7 +11,7 @@
using Shared;
namespace HDL_ON.UI
{
- public class DeviceListPage : FrameLayout
+ public class DeviceListPage : FrameLayout
{
FrameLayout bodyView;
VerticalRefreshLayout contentView;
@@ -59,7 +59,8 @@
{
var waitPage = new Loading();
waitPage.Start();
- new System.Threading.Thread(() => {
+ new System.Threading.Thread(() =>
+ {
try
{
var pm = new HttpServerRequest();
@@ -77,7 +78,7 @@
}
else
{
- var tipView = new EmptyTipView(Language.StringByID(StringId.NotAddedAnyDevices),160)
+ var tipView = new EmptyTipView(Language.StringByID(StringId.NotAddedAnyDevices), 160)
{
Gravity = Gravity.CenterHorizontal,
};
@@ -96,7 +97,8 @@
}
finally
{
- Application.RunOnMainThread(() => {
+ Application.RunOnMainThread(() =>
+ {
if (waitPage != null)
{
waitPage.RemoveFromParent();
@@ -113,6 +115,10 @@
bool isFrist = true;
foreach (var device in deviceList)
{
+ if (!this.CheckSupportDevice(device))
+ {
+ continue;
+ }
var row = new RowLayout()
{
Height = Application.GetRealHeight(50),
@@ -168,7 +174,8 @@
};
row.AddChidren(btnName);
- btnName.MouseUpEventHandler = (sender, e) => {
+ btnName.MouseUpEventHandler = (sender, e) =>
+ {
switch (device.spk)
{
case SPK.IrModule:
@@ -187,7 +194,8 @@
contentView.BeginHeaderRefreshing();
};
break;
- case SPK.SensorEnvironment:case SPK.SensorEnvironmentHailin:
+ case SPK.SensorEnvironment:
+ case SPK.SensorEnvironmentHailin:
case SPK.SensorEnvironment2:
case SPK.SensorEnvironment3:
var smPage1 = new SensorEnvironmentManagerPage();
@@ -267,7 +275,8 @@
Width = Application.GetRealWidth(150),
};
row.AddChidren(btnEdit);
- btnEdit.MouseUpEventHandler = (sender, e) =>{
+ btnEdit.MouseUpEventHandler = (sender, e) =>
+ {
Action<string> callBack = (str) =>
{
if (string.IsNullOrEmpty(str))
@@ -337,6 +346,23 @@
}
+ /// <summary>
+ /// 妫�鏌ユ槸鍚︽敮鎸�
+ /// </summary>
+ /// <param name="function"></param>
+ /// <returns></returns>
+ bool CheckSupportDevice(Function function)
+ {
+
+ if (function == null) return false;
+ if (function.spk == SPK.VideoDoorLock)
+ {
+ return false;
+ }
+ return true;
+
+ }
+
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
index fc60e23..0af7600 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
@@ -47,20 +47,53 @@
public void SkipAddDeviceActivity(string spk)
{
- this.InitializationAndroidData((isBools) =>
+ this.InitializationAndroidData((isEzChildAccessToken) =>
{
this.MainThread(() =>
{
- if (!isBools)
- {
- this.ShowTip("鍏堣幏鍙栬悿鐭充簯瀛愯处鍙穞oken澶辫触銆�");
- }
#if __IOS__
- //璺宠浆娣诲姞钀ょ煶璁惧
- ezsdkDelegate = new IosIHdlInterface();
- ezsdkDelegate.mAction += (serials) => {
- var list = VideDoorLockSend.Current.GetVideoDoorLockDeviceList(SPK.VideoDoorLock);
+ //璺宠浆娣诲姞钀ょ煶璁惧
+ ezsdkDelegate = new IosIHdlInterface();
+ ezsdkDelegate.mAction += (serials) =>
+ {
+ this.GetYingshiDeviceList(serials);
+ };
+ EZSDK.IOS.EZSDK.SharedInstance().Delegate = ezsdkDelegate;
+ EZSDK.IOS.EZSDK.SharedInstance().AddEzvizMonitorWithDeviceType(spk);
+
+#else
+ HDLEzvizSdk.Instance.JumpToEZScanActivity(Application.Activity,spk);
+ HDLEzvizSdk.SetAddCallback(new AndroidIHdlInterface((isBool, serials) =>
+ {
+ if (isBool)
+ {
+ this.GetYingshiDeviceList(serials);
+ }
+
+ }));
+#endif
+
+ });
+
+
+ });
+
+
+
+
+
+ }
+ /// <summary>
+ /// 璇诲彇浜戠鐨勪笂钀ょ煶璁惧鍒楄〃
+ /// <paramref name="serials"/>搴忓垪鍙�</param>
+ private void GetYingshiDeviceList(string serials)
+ {
+ this.SunThread(() =>
+ {
+ var list = VideDoorLockSend.Current.GetVideoDoorLockDeviceList(SPK.VideoDoorLock);
+ this.MainThread(() =>
+ {
if (list.Count > 0)
{
var function = list.Find((o) => o.sid == serials);
@@ -69,41 +102,8 @@
this.SaveFunctionFile(function);
}
}
- };
- EZSDK.IOS.EZSDK.SharedInstance().Delegate= ezsdkDelegate;
- EZSDK.IOS.EZSDK.SharedInstance().AddEzvizMonitorWithDeviceType(spk);
-
-#else
- HDLEzvizSdk.Instance.JumpToEZScanActivity(Application.Activity,spk);
- HDLEzvizSdk.SetAddCallback(new AndroidIHdlInterface((isBool, adnroidActionDevSerial) =>
- {
- if (isBool)
- {
-
- var list = VideDoorLockSend.Current.GetVideoDoorLockDeviceList(SPK.VideoDoorLock);
- if (list.Count > 0)
- {
- var function = list.Find((o) => o.sid == adnroidActionDevSerial);
- if (function != null)
- {
- this.SaveFunctionFile(function);
- }
- }
-
-
- }
-
- }));
-#endif
-
- });
-
-
+ });
});
-
-
-
-
}
/// <summary>
@@ -116,50 +116,47 @@
public void SkipRTVActivity(string deviceSerial, string deviceId, string spk, bool isDialog)
{
- this.InitializationAndroidData((isBools) =>
+ this.InitializationAndroidData((isEzChildAccessToken) =>
{
- if (!isBools)
+ this.MainThread(() =>
{
- this.MainThread(() =>
+ if (isDialog)
{
- this.ShowTip("鍏堣幏鍙栬悿鐭充簯瀛愯处鍙穞oken澶辫触銆�");
-
- });
- }
-
- if (isDialog)
- {
- Video.View.ShowDialog.Currnet.ClickBox(Language.StringByID(StringId.laizimenlinghujiao), (dialog) =>
+ Video.View.ShowDialog.Currnet.ClickBox(Language.StringByID(StringId.laizimenlinghujiao), (dialog) =>
+ {
+ dialog.Close();
+ this.SkipRTVActivity(deviceSerial, deviceId, spk);
+ }, (dialog) => { dialog.Close(); });
+ }
+ else
{
- dialog.Close();
-#if __IOS__
- //鎵撳紑钀ょ煶瑙嗛鐣岄潰
- EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(deviceSerial, deviceId, spk);
-#else
- HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk);
-#endif
- }, (dialog) =>
- {
- dialog.Close();
- });
- }
- else
- {
-#if __IOS__
- //鎵撳紑钀ょ煶瑙嗛鐣岄潰
- EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(deviceSerial, deviceId, spk);
+ this.SkipRTVActivity(deviceSerial, deviceId, spk);
+ }
-#else
- HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk);
-#endif
- }
-
-
+ });
});
+ }
+ /// <summary>
+ /// 鎵撳紑瀹炴椂瑙嗛鐢婚潰
+ /// </summary>
+ /// <param name="deviceSerial">璁惧搴忓垪鍙�</param>
+ /// <param name="deviceId">璁惧id(浜戠涓奷eviceId)</param>
+ /// <param name="spk">璁惧spk(浜戦泙涓婂畾涔夊ソ鐨�)</param>
+ private void SkipRTVActivity(string deviceSerial, string deviceId, string spk)
+ {
+
+#if __IOS__
+ //鎵撳紑钀ょ煶瑙嗛鐣岄潰
+ EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(deviceSerial, deviceId, spk);
+
+#else
+ HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk);
+#endif
}
+
/// <summary>
/// 娴忚鍘嗗彶璁板綍
/// </summary>
@@ -167,16 +164,17 @@
{
this.InitializationAndroidData((s) =>
{
-
+ this.MainThread(() =>
+ {
#if __IOS__
- //鎵撳紑钀ょ煶鍘嗗彶璁板綍鐣岄潰
- EZSDK.IOS.EZSDK.SharedInstance().ToDeviceMsgListView(deviceId);
+ //鎵撳紑钀ょ煶鍘嗗彶璁板綍鐣岄潰
+ EZSDK.IOS.EZSDK.SharedInstance().ToDeviceMsgListView(deviceId);
#else
HDLEzvizSdk.Instance.JumpLockHistoryActivity(Application.Activity, deviceId);
#endif
-
+ });
});
-
+
}
/// <summary>
/// 涓存椂瀵嗙爜寮�闂�
@@ -186,21 +184,15 @@
{
this.InitializationAndroidData((isBools) =>
{
- if (!isBools)
+ this.MainThread(() =>
{
- this.MainThread(() =>
- {
- this.ShowTip("鍏堣幏鍙栬悿鐭充簯瀛愯处鍙穞oken澶辫触銆�");
-
- });
- }
#if __IOS__
- //鎵撳紑钀ょ煶涓存椂瀵嗙爜鐣岄潰
- EZSDK.IOS.EZSDK.SharedInstance().ToTemPassView(deviceId);
+ //鎵撳紑钀ょ煶涓存椂瀵嗙爜鐣岄潰
+ EZSDK.IOS.EZSDK.SharedInstance().ToTemPassView(deviceId);
#else
HDLEzvizSdk.Instance.JumpTempPasswordActivity(Application.Activity, deviceId);
#endif
-
+ });
});
}
@@ -209,8 +201,6 @@
/// </summary>
public void InitializationAndroidData(Action<bool> action)
{
-
-
bool isBool = true;
this.SunThread(() =>
{
@@ -224,29 +214,29 @@
{
//Token
isBool = false;
+ this.ShowTip("鍏堣幏鍙栬悿鐭充簯瀛愯处鍙穞oken澶辫触銆�");
return;
}
- Application.RunOnMainThread(() =>
- {
+
#if __IOS__
- //iOS
- //鍒濆鍖栬悿鐭充簯SDK锛屼腑鏂囧浗鍐卥ey銆佽嫳鏂囨捣澶杒ey 寮�鍙戣�呰处鍙蜂娇鐢ㄥ簲鐢ㄥ寘鍚嶇敵璇风殑APPKEY锛屼笉鍚屽寘鍚嶅簲鐢ㄩ渶閰嶇疆涓嶅悓鐨凙PPKEY
- EZSDK.IOS.EZSDK.SharedInstance().InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b");
- //1.璁剧疆鎵�闇�娌充笢鐨凙ccessToken鍜孯efreshToken銆佸煙鍚嶅湴鍧�
- EZSDK.IOS.EZSDK.SharedInstance().SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken);
- EZSDK.IOS.EZSDK.SharedInstance().SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, DB_ResidenceData.Instance.CurrentRegion.id);
- //2.璁剧疆钀ょ煶瀛愯处鍙风殑AccessToken鍒癝DK
- EZSDK.IOS.EZSDK.SharedInstance().SetEZAccessToken(ezChildAccessToken);
- //////3.鎵撳紑鎽勫儚澶磋澶囧垪琛ㄩ〉闈�
- //EZSDK.IOS.EZSDK.SharedInstance().Go2EZvizMonitor();
- //EZSDK.IOS.EZDeviceInfo info = new EZSDK.IOS.EZDeviceInfo();
- //info.de
- //EZSDK.IOS.EZSDK.Play(info);
+ //iOS
+ //鍒濆鍖栬悿鐭充簯SDK锛屼腑鏂囧浗鍐卥ey銆佽嫳鏂囨捣澶杒ey 寮�鍙戣�呰处鍙蜂娇鐢ㄥ簲鐢ㄥ寘鍚嶇敵璇风殑APPKEY锛屼笉鍚屽寘鍚嶅簲鐢ㄩ渶閰嶇疆涓嶅悓鐨凙PPKEY
+ EZSDK.IOS.EZSDK.SharedInstance().InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b");
+ //1.璁剧疆鎵�闇�娌充笢鐨凙ccessToken鍜孯efreshToken銆佸煙鍚嶅湴鍧�
+ EZSDK.IOS.EZSDK.SharedInstance().SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken);
+ EZSDK.IOS.EZSDK.SharedInstance().SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, DB_ResidenceData.Instance.CurrentRegion.id);
+ //2.璁剧疆钀ょ煶瀛愯处鍙风殑AccessToken鍒癝DK
+ EZSDK.IOS.EZSDK.SharedInstance().SetEZAccessToken(ezChildAccessToken);
+ //////3.鎵撳紑鎽勫儚澶磋澶囧垪琛ㄩ〉闈�
+ //EZSDK.IOS.EZSDK.SharedInstance().Go2EZvizMonitor();
+ //EZSDK.IOS.EZDeviceInfo info = new EZSDK.IOS.EZDeviceInfo();
+ //info.de
+ //EZSDK.IOS.EZSDK.Play(info);
#else
HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, "1aa98a90489b4838b966b57018b4b04b", 1, DB_ResidenceData.Instance.CurrentRegion.id);
#endif
- });
+
});
@@ -270,7 +260,7 @@
/// <param name="home">瀵硅薄</param>
public void ChangeCurrHome(RegionInfoRes home)
{
-
+
if (DB_ResidenceData.Instance.CurrentRegion.id == home.id || string.IsNullOrEmpty(home.id)) return;
#if __IOS__
#else
@@ -281,7 +271,7 @@
#endregion
/// <summary>
- /// 鑾峰彇闂ㄩ攣鍨嬪彿鍒楄〃
+ /// 鑾峰彇銆愰棬閿佸瀷鍙枫�戝垪琛�
/// </summary>
/// <returns>杩斿洖缁撴灉涓嶄細涓簄ull</returns>
public List<string> GetVideoDoorLockLockModelsList()
@@ -289,7 +279,19 @@
return VideDoorLockSend.Current.GetVideoDoorLockLockModelsList();
}
-
+ /// <summary>
+ /// 鑾峰彇钀ょ煶瑙嗛銆愰棬閿併�戝垪琛�
+ /// </summary>
+ /// <returns></returns>
+ public List<Function> GetVideoDoorLockList()
+ {
+ var list = FunctionList.List.GetVideoDoorLockList();
+#if DEBUG
+ //list.Add(new Function { name = "瑙嗛闂ㄩ攣涓�", sid = "23456789", spk = SPK.VideoDoorLock });
+ //list.Add(new Function { name = "瑙嗛闂ㄩ攣浜�", sid = "2345678922", spk = SPK.VideoDoorLock });
+#endif
+ return list;
+ }
#region --------- 鍔熻兘鏂囦欢淇濆瓨锛屽垹闄� --------
/// <summary>
/// 淇濆瓨鏈湴鏂囦欢
@@ -331,7 +333,7 @@
}
}
-
+
/// <summary>
/// 鑾峰彇Loading瀵硅薄
/// </summary>
@@ -365,19 +367,7 @@
}
- /// <summary>
- /// 鑾峰彇钀ょ煶瑙嗛闂ㄩ攣鍒楄〃
- /// </summary>
- /// <returns></returns>
- public List<Function> GetVideoDoorLockList()
- {
- var list = FunctionList.List.GetVideoDoorLockList();
-#if DEBUG
- //list.Add(new Function { name = "瑙嗛闂ㄩ攣涓�", sid = "23456789", spk = SPK.VideoDoorLock });
- //list.Add(new Function { name = "瑙嗛闂ㄩ攣浜�", sid = "2345678922", spk = SPK.VideoDoorLock });
-#endif
- return list;
- }
+
#region ---------鑷畾涔夌嚎绋�(瀛愮嚎绋嬶紝涓荤嚎绋�)--------
/// <summary>
/// 瀛愮嚎绋�
@@ -489,10 +479,10 @@
/// </summary>
public class IosIHdlInterface : EZSDK.IOS.EZSDKDelegate
{
- public Action<string> mAction;
+ public Action<string> mAction;
public IosIHdlInterface()
{
-
+
}
/// <summary>
///
--
Gitblit v1.8.0