From 0fc2962749e7e1f4078717a9914ac8175a2c4b26 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期四, 26 九月 2024 20:53:55 +0800
Subject: [PATCH] 可视对讲,注册
---
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs | 12 ++
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs | 4
HDL_ON/DAL/Mqtt/MqttClient.cs | 18 ----
HDL-ON_Android/SplashActivity.cs | 2
HDL_ON/DAL/Server/NewApiRes.cs | 7 +
HDL_ON/Common/HDLCommon.cs | 42 ++--------
HDL_ON/DAL/Server/HttpUtil.cs | 12 +-
HDL-ON_Android/Other/HDLONUtils.cs | 44 +++++++++-
HDL_ON/Common/OnAppConfig.cs | 15 +++
HDL_ON/UI/UI1-Login/RegisterPageBLL.cs | 37 +++++++-
HDL_ON/DAL/DriverLayer/Control.cs | 2
HDL_ON/UI/UI1-Login/LoginPage.cs | 12 --
HDL-ON_Android/Other/JPush/JPushReceiver.cs | 16 ++-
SiriIntents/Server/HttpUtil.cs | 12 +-
14 files changed, 137 insertions(+), 98 deletions(-)
diff --git a/HDL-ON_Android/Other/HDLONUtils.cs b/HDL-ON_Android/Other/HDLONUtils.cs
index 570b56c..14cd26a 100644
--- a/HDL-ON_Android/Other/HDLONUtils.cs
+++ b/HDL-ON_Android/Other/HDLONUtils.cs
@@ -1,5 +1,7 @@
锘縰sing System;
+using Android.App;
using Android.Content;
+using Android.OS;
using Java.IO;
namespace HDL_ON_Android
@@ -32,12 +34,42 @@
}
}
- //public static void StartSplashActivity()
- //{
- // Intent intent = new Intent(Shared.Application.Activity, typeof(SplashActivity));
- // Shared.Application.Activity.StartActivity(intent);
- // Shared.Application.Activity.Finish();
- //}
+
+ [Obsolete]
+ public static bool IsAppInForeground(Context context)
+ {
+ ActivityManager activityManager = (ActivityManager)context.GetSystemService(Context.ActivityService);
+
+ if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
+ {
+ var appProcesses = activityManager.RunningAppProcesses;
+ if (appProcesses != null)
+ {
+ string packageName = context.PackageName;
+ foreach (var appProcess in appProcesses)
+ {
+ if (appProcess.Importance == Importance.Foreground && appProcess.ProcessName.Equals(packageName))
+ {
+ return true; // 搴旂敤鍦ㄥ墠鍙�
+ }
+ }
+ }
+ }
+ else
+ {
+ var tasks = activityManager.GetRunningTasks(1);
+ if (tasks != null && tasks.Count > 0)
+ {
+ var topActivity = tasks[0].TopActivity;
+ if (topActivity.PackageName.Equals(context.PackageName))
+ {
+ return true; // 搴旂敤鍦ㄥ墠鍙�
+ }
+ }
+ }
+
+ return false; // 搴旂敤涓嶅湪鍓嶅彴
+ }
}
}
diff --git a/HDL-ON_Android/Other/JPush/JPushReceiver.cs b/HDL-ON_Android/Other/JPush/JPushReceiver.cs
index 3261a1a..745527d 100644
--- a/HDL-ON_Android/Other/JPush/JPushReceiver.cs
+++ b/HDL-ON_Android/Other/JPush/JPushReceiver.cs
@@ -53,11 +53,8 @@
/// <param name="notificationMessage"></param>
public override void OnNotifyMessageOpened(Context context, NotificationMessage notificationMessage)
{
-
-
- //2020-12-23 瑙e喅鐐瑰嚮閫氱煡鏍忔墦寮�涓嶄簡APP闂
- //base.OnNotifyMessageOpened(context, notificationMessage);
- OpenNotification(context, notificationMessage);
+ MainPage.Log("鎺ユ敹鍒版帹閫�:鐐瑰嚮閫氱煡鍥炶皟");
+ OpenNotification(context, notificationMessage,true);
}
/// <summary>
@@ -137,15 +134,17 @@
/// </summary>
/// <param name="context"></param>
/// <param name="notificationMessage"></param>
- public static void OpenNotification(Context context, NotificationMessage notificationMessage)
+ public static void OpenNotification(Context context, NotificationMessage notificationMessage,bool isNotification = false)
{
try
{
+ MainPage.Log("鎺ユ敹鍒版帹閫�:鎵撳紑娑堟伅鏄剧ず鐣岄潰");
var pushMes = new JPushMessageInfo()
{
Title = notificationMessage.NotificationTitle,
Content = notificationMessage.NotificationContent,
- Extras = notificationMessage.NotificationExtras
+ Extras = notificationMessage.NotificationExtras,
+ isNotificationGoing = isNotification
};
var jpushExpandData = GetJPushExpandData(pushMes);
@@ -171,11 +170,14 @@
else
{
Intent i = new Intent(context, typeof(BaseActivity));
+ i.SetFlags(ActivityFlags.SingleTop);
+ i.SetFlags(ActivityFlags.ClearTop);
i.SetFlags(ActivityFlags.NewTask);
context.StartActivity(i);
}
//瑙f瀽msg
AdjustPushMessage(pushMes);
+
}
catch
{
diff --git a/HDL-ON_Android/SplashActivity.cs b/HDL-ON_Android/SplashActivity.cs
index 04b9ed2..7143579 100644
--- a/HDL-ON_Android/SplashActivity.cs
+++ b/HDL-ON_Android/SplashActivity.cs
@@ -20,7 +20,6 @@
{
protected override void OnActivityResult(int requestCode, Result resultVal, Intent data)
{
- Console.WriteLine("123456");
if (requestCode == 99)
{
if (resultVal == Result.Ok)
@@ -43,7 +42,6 @@
[Obsolete]
protected override void OnCreate(Bundle savedInstanceState)
{
- Console.WriteLine("123456");
base.OnCreate(savedInstanceState);
if(Shared.Application.Activity != null && Shared.Application.Activity.GetType() == typeof(BaseActivity))
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 4a012a9..749d7df 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -237,21 +237,6 @@
#endregion
- ///// <summary>
- ///// 鎭㈠浣忓畢
- ///// 2020-12-03 寰呮祴璇曟湭妫�娴�
- ///// </summary>
- //public void RestoreHomeBackup(string RegionID)
- //{
- // var isExist = FileUtils.ExistRegion(RegionID);
- // if (isExist)
- // {
- // //瀛樺湪鍒欐仮澶�
- // string newRegionRootPath = FileUtils.CreateRegionBackup(RegionID);
- // FileUtils.RestoreRegionFiles(newRegionRootPath);
- // }
- //}
-
#region 鈻� 鎺ㄩ�佸鐞哶______________________
/// <summary>
/// 鎺ㄩ�佹秷鎭鐞�
@@ -262,8 +247,7 @@
{
try
{
- //Console.WriteLine($"鎺ユ敹鍒版帹閫侊紝锛岋紝锛�.{Newtonsoft.Json.JsonConvert.SerializeObject(jpushMessageInfo).ToString()}");
-
+ //MainPage.Log($"鎺ユ敹鍒版帹閫侊紝锛岋紝锛�.{Newtonsoft.Json.JsonConvert.SerializeObject(jpushMessageInfo).ToString()}");
//Extras涓虹┖涓嶅鐞�
if (string.IsNullOrEmpty(jpushMessageInfo.Extras)) return;
@@ -284,7 +268,7 @@
//鎶ヨ鎺ㄩ�佸脊绐楁彁绀�
ShowAlarmPushMessage(jpushMessageInfo, true);
//钀ょ煶闂ㄩ攣鎺ㄩ��
- HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DoorLockPush(jpushMessageInfo);
+ UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DoorLockPush(jpushMessageInfo);
}
else if (jpushMessageInfo.messageType == (PushMessageType.FLCall.ToString()))
{
@@ -311,12 +295,10 @@
}
else if (jpushMessageInfo.messageType == PushMessageType.HDL_INTERPHONE.ToString())
{
-
if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return;
//瀛楁鍏煎闂锛屽彧鑳界洿鎺ュ彇鍊间簡
var json = Newtonsoft.Json.Linq.JObject.Parse(jpushMessageInfo.expantContent);
-
//1.瑙嗗璁插巶瀹剁被鍨�
string interphoneTypeEnum = json["interphoneTypeEnum"].ToString();
@@ -371,9 +353,9 @@
}
}
}
- catch { }
-
-
+ catch (Exception ex) {
+ MainPage.Log("Error", $"鑷爺鍙瀵硅閫氱煡寮傚父:{ex.StackTrace}");
+ }
#if __ANDROID__
Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MissedCallsTime = 30;
@@ -401,7 +383,7 @@
})
{ IsBackground = true }.Start();
-#elif __IOS__
+ #elif __IOS__
SoundPlayer.Ins.PlaySound();
new Thread(() => {
int count = 0;
@@ -435,21 +417,17 @@
}
})
{ IsBackground = true }.Start();
-#endif
+ #endif
-
- //HDL Linphone 鐙勮�愬厠
+ MainPage.Log("鎺ユ敹鍒版帹閫�:HDL Linphone 鐙勮�愬厠");
eSVideoInfo.HomeId = jpushMessageInfo.HomeId;
eSVideoInfo.callId = json["callId"].ToString();
eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString();
eSVideoInfo.DeviceName = json["deviceName"].ToString();
eSVideoInfo.deviceSipAccount = json["deviceSipAccount"].ToString();
eSVideoInfo.spk = json["spk"].ToString();
-
-
- //ShowAlert("鐙勮�愬厠闂ㄥ彛鏈哄懠鍙�");
//鎵撳紑鍛煎彨椤甸潰
- HDLLinphone.Current.ShowESVideoIntercom(eSVideoInfo, InterphoneType.HDL.ToString());
+ HDLLinphone.Current.ShowESVideoIntercom(eSVideoInfo, InterphoneType.HDL.ToString(), jpushMessageInfo.isNotificationGoing);
return;
}
else if (interphoneTypeEnum == InterphoneType.FREEVIEW.ToString())
@@ -493,8 +471,6 @@
Utlis.WriteLine("catch: " + EX.ToString());
}
}
- //{"code":0,"data":{"list":[{"createTime":"1625798305115","modifyTime":"1625798305115","region":"100000000000000001","id":"1413326644794294273","alarmId":"20210709103818-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709103818-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:38:17","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{"createTime":"1625798057197","modifyTime":"1625798057197","region":"100000000000000001","id":"1413325604946640898","alarmId":"20210709103413-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709103413-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:34:12","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797973320","modifyTime":"1625797973320","region":"100000000000000001","id":"1413325253141004289","alarmId":"20210709103236-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709103236-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:32:31","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797782136","modifyTime":"1625797782136","region":"100000000000000001","id":"1413324451261382658","alarmId":"20210709102937-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102937-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:29:37","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797668771","modifyTime":"1625797668771","region":"100000000000000001","id":"1413323975769915394","alarmId":"20210709102743-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102743-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:27:42","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797539846","modifyTime":"1625797539846","region":"100000000000000001","id":"1413323435023466498","alarmId":"20210709102534-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102534-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:25:34","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797530627","modifyTime":"1625797530627","region":"100000000000000001","id":"1413323396351983618","alarmId":"20210709102525-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102525-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:25:25","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625796028089","modifyTime":"1625796028089","region":"100000000000000001","id":"1413317094255034369","alarmId":"20210709100024-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709100024-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:00:23","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625795974558","modifyTime":"1625795974558","region":"100000000000000001","id":"1413316869729746946","alarmId":"20210709095931-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709095931-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T09:59:31","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625795966933","modifyTime":"1625795966933","region":"100000000000000001","id":"1413316837748178946","alarmId":"20210709095923-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"浜轰綋鎰熷簲浜嬩欢","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709095923-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T09:59:22","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"}],"totalCount":"13","totalPage":"2","pageNo":"1","pageSize":"10"},"timestamp":"1625807415164","isSuccess":true}
- //{"platform":"1","timestamp":"1625805660249","appKey":"HDL-HOME-APP-TEST","sign":"02e433c40485b30451ebdc5ca3cd959c","deviceSerial":"F41014762","homeId":"1396717478877241345"}
/// <summary>
/// 瑙f瀽涓版灄鍙瀵硅鎺ㄩ�佹暟鎹�
/// </summary>
diff --git a/HDL_ON/Common/OnAppConfig.cs b/HDL_ON/Common/OnAppConfig.cs
index 7dd4117..6f75baa 100644
--- a/HDL_ON/Common/OnAppConfig.cs
+++ b/HDL_ON/Common/OnAppConfig.cs
@@ -70,6 +70,21 @@
}
}
+ string pushSignStr;
+ /// <summary>
+ ///
+ /// </summary>
+ public string PushSignStr {
+ get
+ {
+ if (string.IsNullOrEmpty(pushSignStr))
+ {
+ pushSignStr = DateTime.Now.Ticks.ToString();
+ }
+ return pushSignStr;
+ }
+ }
+
/// <summary>
/// 瀛樺偍鐧诲綍杩囩殑鐢ㄦ埛
/// </summary>
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 0b5a3db..a887526 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -1124,7 +1124,7 @@
//2021-09-23 鏂板鑾峰彇褰撳墠缃戝叧鏄惁鏈湴鍔犲瘑
Ins.IsLocalEncrypt = device.isLocalEncrypt;
//MainPage.Log("缃戝叧鏈湴鍔犲瘑鐘舵�侊細" + device.local_encrypt.ToString());
- //鐧诲綍缃戝叧Tcp
+ //鐧诲綍缃戝叧Tcp tcp杩炴帴缃戝叧
//OpenTcpClent();
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index cb8b7c4..9593aef 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -59,7 +59,7 @@
/// <summary>
/// 鎺ㄩ�佹爣璇�
/// </summary>
- static string PushSignStr = DateTime.Now.Ticks.ToString();
+ static string PushSignStr = OnAppConfig.Instance.PushSignStr;
/// <summary>
/// 鏂紑杩滅▼Mqtt鐨勯摼鎺�
@@ -872,21 +872,6 @@
});
}
- ///// <summary>
- ///// 鏀跺埌CheckGateway涓婚
- ///// </summary>
- //static void ReceiveCheckGateway(string mMes)
- //{
- // if (!Control.Ins.IsRemote) return;
-
- // Utlis.WriteLine("ReceiveCheckGateway锛�");
-
- // //CheckIfNeedReadAllDeviceStatus ();
-
- // //var obj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(mMes);
- // Control.Ins.GatewayOnline = true;
- //}
-
/// <summary>
/// 鎺ㄩ�佹尋涓嬬嚎涓婚
/// </summary>
@@ -901,6 +886,7 @@
{
case "15626203746":
case "13580507523":
+ case "18475593023":
return;
}
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 5d84f01..5882515 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -18,13 +18,13 @@
/// 鍥哄畾鍩熷悕,姝e紡鐜
/// 鍏叡鍩熷悕灏辫繎瑙f瀽
/// </summary>
- //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
- //public const string APP_KEY = "HDL-HOME-APP";
- //public const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC";
+ public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+ public const string APP_KEY = "HDL-HOME-APP";
+ public const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC";
- public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
- public const string APP_KEY = "HDL-HOME-APP-TEST";
- public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
+ //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
+ //public const string APP_KEY = "HDL-HOME-APP-TEST";
+ //public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
//public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm
//const string APP_KEY = "CPEVRLRT";
diff --git a/HDL_ON/DAL/Server/NewApiRes.cs b/HDL_ON/DAL/Server/NewApiRes.cs
index 41a7f5e..c132a75 100644
--- a/HDL_ON/DAL/Server/NewApiRes.cs
+++ b/HDL_ON/DAL/Server/NewApiRes.cs
@@ -1523,6 +1523,13 @@
/// </summary>
public string sipAccount;
+ /// <summary>
+ /// 鏄惁鏄悗鍙拌繘鍏ョ殑淇℃伅
+ /// 缁欏畨鍗撲娇鐢ㄧ殑锛屽畨鍗撲粠閫氱煡鏍忚繘鍏ユ墦寮�鍙瀵硅鐣岄潰鏈夊紓甯�
+ /// 搴旇鏄墦寮�浜嗕袱娆$殑闂
+ /// </summary>
+ public bool isNotificationGoing = false;
+
}
/// <summary>
diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
index 02610db..d17ae52 100644
--- a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
+++ b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
@@ -523,9 +523,16 @@
/// 鏀跺埌鎺ㄩ�侊紝鍚庡垽鏂懠鍙綇瀹呮槸鍚︿负褰撳墠浣忓畢锛屼笉鏄殑璇濋噸鏂拌幏鍙朣IP璐﹀彿骞剁櫥褰�
/// </summary>
/// <param name="mESVideoInfo"></param>
- public void ShowESVideoIntercom(ESVideoInfo mESVideoInfo,string mInterphoneType)
+ public void ShowESVideoIntercom(ESVideoInfo mESVideoInfo,string mInterphoneType, bool isNotificationGoing = false)
{
- if(this.mHDLCallVideoInfo != null)
+#if __ANDROID__
+ //isNotificationGoing鍙傛暟鏄笓闂ㄧ粰瀹夊崜浣跨敤鐨勶紝鍥犱负瀹夊崜鍦ㄥ悗闈㈢殑鏃跺�欏凡缁忓惎鍔ㄤ簡鎺ュ惉鐨勭晫闈簡锛屼粠閫氱煡鏍忚繘鏉ョ殑鏃跺�欙紝callid宸茬粡琚娇鐢ㄤ簡锛屾墍浠ヨ閲嶇疆鎺夎繖涓睘鎬�
+ if (isNotificationGoing)
+ {
+ this.mHDLCallVideoInfo.CallId = "";
+ }
+#endif
+ if (this.mHDLCallVideoInfo != null)
{
if(this.mHDLCallVideoInfo.CallId == mESVideoInfo.callId)
{
@@ -588,6 +595,7 @@
intent.PutExtra("lpTitleName", mHDLCallVideoInfo.DeviceName);
intent.PutExtra("lpSipAccount", mHDLCallVideoInfo.DeviceSipAccount);
}
+ MainPage.Log("鍚姩鑷爺鍙瀵硅鐣岄潰");
Shared.Application.Activity.StartActivity(intent);
#endif
}
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index 099247a..8a3e320 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -282,11 +282,6 @@
{
Application.HideSoftInput();
};
- //btnIcon.MouseUpEventHandler = (sender, e) =>
- //{
- // etAccount.Text = "13580507523";
- // etPassword.Text = "a123456";
- //};
#if DEBUG
btnIcon_bg.MouseUpEventHandler += (sender, e) =>
@@ -320,7 +315,8 @@
etAccount.Text = "13682244600";
etAccount.Text = "pjh@hdlchina.com.cn";
etAccount.Text = "13580507523";
- //etAccount.Text = "18475593023";
+ etAccount.Text = "18475593023";
+ //etAccount.Text = "13960905167";
}
else
{
@@ -537,10 +533,6 @@
};
passwordView.AddChidren(etPassword);
-
-
- etAccount.Text = "13580507523";
- etPassword.Text = "a123456";
#region 瀵嗙爜鐧诲綍-鎺т欢鍔犺浇
btnVisiblePassword = new Button()
diff --git a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
index 50aa11f..3cb73e7 100644
--- a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
@@ -1,9 +1,11 @@
锘縰sing System;
using System.Collections.Generic;
+using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading;
using HDL_ON.DAL.Server;
using HDL_ON.UI.CSS;
+using Newtonsoft.Json.Linq;
using Shared;
namespace HDL_ON.UI.UI1Login
@@ -776,13 +778,34 @@
waitPage.Start(Language.StringByID(StringId.PleaseWait));
- System.Threading.Tasks.Task.Run(() =>
+ System.Threading.Tasks.Task.Run(async () =>
{
try
{
- Console.WriteLine("GetCountryByIP");
- var ddd = JLCountrycode.CountryCodeView.Current.GetCountryByIP();
- Console.WriteLine(ddd);
+ string country = "CN";
+
+ try
+ {
+ using (HttpClient client = new HttpClient())
+ {
+ // 浣跨敤 ipinfo.io 鑾峰彇浣嶇疆淇℃伅
+ HttpResponseMessage response = await client.GetAsync("https://ipinfo.io/json");
+
+ if (response.IsSuccessStatusCode)
+ {
+ string json = await response.Content.ReadAsStringAsync();
+ JObject jsonObject = JObject.Parse(json);
+
+ // 浠庤繑鍥炵殑 JSON 涓彁鍙栧浗瀹朵俊鎭�
+ country = jsonObject["country"].ToString();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log("Error",$"Error fetching IP info: {ex.StackTrace}");
+ }
+
serverList = new List<GlobalRegionListRes>();
var requestJson = HttpUtil.GetSignRequestJson(new GetRegionListObj() { regionMark = HttpUtil.RegionMark });
var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost);
@@ -796,12 +819,12 @@
serverList = responseDataObj;
if (serverList.Count > 0)
{
- if (Language.CurrentLanguage == "Chinese")
+ if (country == "CN")//if (Language.CurrentLanguage == "Chinese")
{
var server = serverList.Find((obj) => obj.regionUrl.Contains("china-gateway"));
if (server != null)
{
- OnAppConfig.Instance.GlobalRegion.regionUrl = server.regionUrl;
+ OnAppConfig.Instance.GlobalRegion = server;
SetServerText();
}
}
@@ -810,7 +833,7 @@
var server = serverList.Find((obj) => obj.regionUrl.Contains("bahrain-gateway"));
if (server != null)
{
- OnAppConfig.Instance.GlobalRegion.regionUrl = server.regionUrl;
+ OnAppConfig.Instance.GlobalRegion = server;
SetServerText();
}
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
index 77219e2..c175e21 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
@@ -478,7 +478,7 @@
tipValuesView.AddChidren(new Button()
{
Width = Application.GetRealWidth(151),
- Text = "40%",
+ Text = "70%",
TextAlignment = TextAlignment.Center,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
@@ -486,7 +486,7 @@
tipValuesView.AddChidren(new Button()
{
Width = Application.GetRealWidth(151),
- Text = "70%",
+ Text = "40%",
TextAlignment = TextAlignment.Center,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs
index 8a086c3..1a66ef0 100644
--- a/SiriIntents/Server/HttpUtil.cs
+++ b/SiriIntents/Server/HttpUtil.cs
@@ -16,13 +16,13 @@
/// 鍥哄畾鍩熷悕,姝e紡鐜
/// 鍏叡鍩熷悕灏辫繎瑙f瀽
/// </summary>
- //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
- //const string APP_KEY = "HDL-HOME-APP";
- //const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC";
+ public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+ const string APP_KEY = "HDL-HOME-APP";
+ const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC";
- public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
- public const string APP_KEY = "HDL-HOME-APP-TEST";
- public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
+ //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
+ //public const string APP_KEY = "HDL-HOME-APP-TEST";
+ //public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
//public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm
//const string APP_KEY = "CPEVRLRT";
--
Gitblit v1.8.0