From acc8caee31c4be90bd38d1af18136b0e84f6fe94 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期五, 27 九月 2024 14:01:19 +0800 Subject: [PATCH] Merge branch 'feature/v2.7_迭代' into feature/V2.7_Google --- HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs | 36 HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs | 924 ++++---- HDL-ON_Android/Assets/Language.ini | 31 HDL-ON_iOS/HDL-ON_iOS.csproj | 3 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 2 HDL_ON/Common/ApiUtlis.cs | 332 ++ HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs | 7 HDL_ON/DAL/Mqtt/MqttClient.cs | 65 HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandListPage.cs | 2 HDL-ON_Android/HDL-ON_Android.csproj | 6 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 114 HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs | 358 +++ HDL-ON_iOS/Info.plist | 4 HDL_ON/DAL/Server/NewApiRes.cs | 7 HDL_ON/Common/HDLCommon.cs | 454 +++ HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 10 .idea/workspace.xml | 47 HDL_ON/UI/UI0-Public/PublicAssmebly.cs | 12 HDL_ON/Common/OnAppConfig.cs | 16 HDL-ON_Android/Assets/Phone/Public/RightIcon2.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs | 58 HDL_ON/UI/UI1-Login/LoginPage.cs | 17 HDL_ON/Entity/Function/Scene.cs | 4 HDL-ON_iOS/Resources/Phone/Public/RightIcon2.png | 0 HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs | 42 HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs | 2 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs | 18 HDL_ON/UI/UI1-Login/LoginPageBLL.cs | 47 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs | 4 HDL_ON/Entity/DB_ResidenceData.cs | 2 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 5 HDL_ON/DAL/DriverLayer/Control_Udp.cs | 8 HDL_ON/UI/UI0-Public/TopViewDiv.cs | 25 HDL_ON/Entity/Function/Function.cs | 21 HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs | 48 HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs | 1022 ++++---- HDL_ON/DAL/Server/HttpUtil.cs | 10 HDL-ON_Android/Other/HDLONUtils.cs | 44 HDL_ON/Common/UserInfo.cs | 24 HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs | 5 HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs | 1 HDL-ON_iOS/Resources/Phone/Collection/TokenInvalidTipIcon.png | 0 HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs | 6 HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/Power80pIcon.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs | 850 +++--- HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPage.cs | 1432 ++++++------ HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs | 9 HDL-ON_iOS/ViewController.cs | 26 HDL-ON_Android/Assets/Phone/Collection/TokenInvalidTipIcon.png | 0 HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 2 HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 62 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 8 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs | 18 HDL-ON_iOS/AppDelegate.cs | 9 HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs | 2 HDL-ON_Android/SplashActivity.cs | 2 HDL-ON_iOS/Resources/Language.ini | 31 HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/Power80pIcon.png | 0 HDL_ON/UI/UI1-Login/RegisterPageBLL.cs | 101 HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs | 10 HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs | 42 HDL-ON_Android/Other/JLCountrycode.cs | 40 HDL_ON/DAL/DriverLayer/Control.cs | 18 HDL_ON/UI/MainPage.cs | 64 HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs | 41 HDL-ON_iOS/Other/JLCountrycode.cs | 36 HDL_ON/Common/AliyunLog/AliyunLogClient.cs | 8 HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs | 20 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 2 HDL_ON/UI/UI1-Login/RegisterPage.cs | 122 - HDL_ON/UI/UI1-Login/SelectServerDialog.cs | 35 HDL_ON/Common/R.cs | 17 HDL_ON/DAL/Server/HttpServerRequest.cs | 5 HDL-ON_Android/Other/JPush/JPushReceiver.cs | 16 74 files changed, 3,998 insertions(+), 2,873 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..cb465dc --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="AutoImportSettings"> + <option name="autoReloadType" value="NONE" /> + </component> + <component name="ChangeListManager"> + <list default="true" id="cf0246ae-9d48-4043-85a6-ed222e82c849" name="Changes" comment=""> + <change beforePath="$PROJECT_DIR$/HDL-ON_iOS/AppDelegate.cs" beforeDir="false" afterPath="$PROJECT_DIR$/HDL-ON_iOS/AppDelegate.cs" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/HDL_ON/Common/AliyunLog/AliyunLogClient.cs" beforeDir="false" afterPath="$PROJECT_DIR$/HDL_ON/Common/AliyunLog/AliyunLogClient.cs" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/HDL_ON/DAL/Server/HttpUtil.cs" beforeDir="false" afterPath="$PROJECT_DIR$/HDL_ON/DAL/Server/HttpUtil.cs" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/HDL_ON/UI/MainPage.cs" beforeDir="false" afterPath="$PROJECT_DIR$/HDL_ON/UI/MainPage.cs" afterDir="false" /> + </list> + <option name="SHOW_DIALOG" value="false" /> + <option name="HIGHLIGHT_CONFLICTS" value="true" /> + <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> + <option name="LAST_RESOLUTION" value="IGNORE" /> + </component> + <component name="Git.Settings"> + <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> + </component> + <component name="ProjectId" id="2lwzDA5wL1ox0Tq2CH7Wy9DYWWF" /> + <component name="ProjectViewState"> + <option name="hideEmptyMiddlePackages" value="true" /> + <option name="showLibraryContents" value="true" /> + </component> + <component name="PropertiesComponent"><![CDATA[{ + "keyToString": { + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.cidr.known.project.marker": "true", + "cidr.known.project.marker": "true", + "dart.analysis.tool.window.visible": "false", + "last_opened_file_path": "/Users/kaede/Desktop/Projcect/OnPro" + } +}]]></component> + <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> + <component name="TaskManager"> + <task active="true" id="Default" summary="Default task"> + <changelist id="cf0246ae-9d48-4043-85a6-ed222e82c849" name="Changes" comment="" /> + <created>1726105805372</created> + <option name="number" value="Default" /> + <option name="presentableId" value="Default" /> + <updated>1726105805372</updated> + </task> + <servers /> + </component> +</project> \ No newline at end of file diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 0a74118..a942d15 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -691,6 +691,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control @@ -2097,9 +2101,10 @@ 704=闈炰腑鍥界敤鎴烽�夋嫨 705=璇烽�夋嫨鏈嶅姟鍣� 706=鏂拌兘婧� - - - +707=绂荤嚎鎺у埗涓紝濡傞渶鍒囨崲鑷宠繙绋嬫帶鍒讹紝鐐规鐧诲綍 +708=鎮ㄥ綋鍓嶇殑鐧诲綍鐘舵�佸凡缁忓け鏁堬紝璇烽噸鏂扮櫥褰� +709=鍘荤櫥褰� +710=绂荤嚎鎺у埗 @@ -3500,7 +3505,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy - +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control @@ -4898,7 +4906,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy - +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control @@ -6284,7 +6295,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy - +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control @@ -7688,7 +7702,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy - +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control diff --git a/HDL-ON_Android/Assets/Phone/Collection/TokenInvalidTipIcon.png b/HDL-ON_Android/Assets/Phone/Collection/TokenInvalidTipIcon.png new file mode 100644 index 0000000..b48cc2e --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/TokenInvalidTipIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/Power80pIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/Power80pIcon.png new file mode 100644 index 0000000..0dc5570 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/Power80pIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Public/RightIcon2.png b/HDL-ON_Android/Assets/Phone/Public/RightIcon2.png new file mode 100644 index 0000000..9821b76 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Public/RightIcon2.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index 677d862..f456c11 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -187,6 +187,9 @@ <Reference Include="Shared.Droid.HDLLinphone"> <HintPath>..\DLL\Linphone\Android\Shared.Droid.HDLLinphone.dll</HintPath> </Reference> + <Reference Include="System.Net.Http"> + <HintPath>..\..\..\..\..\..\Library\Frameworks\Xamarin.Android.framework\Versions\13.2.2.0\lib\xamarin.android\xbuild-frameworks\MonoAndroid\v1.0\System.Net.Http.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="Other\JPush\JPushFirmBroadcast.cs" /> @@ -633,6 +636,9 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\Inverter\BatteryIconDischarg100.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\Inverter\BatteryIconFault100.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\Inverter\BatteryIconShutdown100.png" /> + <AndroidAsset Include="Assets\Phone\Collection\TokenInvalidTipIcon.png" /> + <AndroidAsset Include="Assets\Phone\Public\RightIcon2.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmSensor\Power80pIcon.png" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\values\colors.xml" /> 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/JLCountrycode.cs b/HDL-ON_Android/Other/JLCountrycode.cs index 487892b..6590e00 100644 --- a/HDL-ON_Android/Other/JLCountrycode.cs +++ b/HDL-ON_Android/Other/JLCountrycode.cs @@ -4,6 +4,9 @@ using Com.Widget.Jlcountrycode.Sortselect; using System.Collections.Generic; using Java.Util; +using Newtonsoft.Json.Linq; +using System.Threading.Tasks; +using System.Net.Http; namespace JLCountrycode { @@ -27,6 +30,41 @@ return m_Current; } } + + + /// <summary> + /// 鏍规嵁鎵嬫満褰撳墠鐨処P鑾峰彇鍥藉淇℃伅 + /// </summary> + /// <returns></returns> + public async Task<string> GetCountryByIP() + { + string country = "Unknown"; + + 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) + { + Console.WriteLine($"Error fetching IP info: {ex.Message}"); + } + + return country; + } + /// <summary> /// 鍥藉鍖哄彿閫夋嫨 @@ -125,4 +163,6 @@ } + + } \ No newline at end of file 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 1cd1497..274ce31 100644 --- a/HDL-ON_Android/SplashActivity.cs +++ b/HDL-ON_Android/SplashActivity.cs @@ -21,7 +21,6 @@ { protected override void OnActivityResult(int requestCode, Result resultVal, Intent data) { - Console.WriteLine("123456"); if (requestCode == 99) { if (resultVal == Result.Ok) @@ -44,7 +43,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_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs index 737cce7..a6a7280 100644 --- a/HDL-ON_iOS/AppDelegate.cs +++ b/HDL-ON_iOS/AppDelegate.cs @@ -271,14 +271,14 @@ AppDomain.CurrentDomain.UnhandledException += (sender, e) => { if(e.ExceptionObject is Exception exception) { - MainPage.Log("error", "鏈鐞嗙殑寮傚父锛�" + exception.Message + "\r\nStackTrace: " + exception.StackTrace); + MainPage.Log("error", "鏈鐞嗙殑寮傚父锛�" + exception.Message + "StackTrace: " + exception.StackTrace); } }; TaskScheduler.UnobservedTaskException += (sender, e) => { if (e.Exception is Exception exception) { - MainPage.Log("error", "鏈鐞嗙殑寮傚父锛�" + exception.Message + "\r\nStackTrace: " + exception.StackTrace); + MainPage.Log("error", "鏈鐞嗙殑寮傚父锛�" + exception.Message + "StackTrace: " + exception.StackTrace); } }; #endregion @@ -291,7 +291,7 @@ //{ // Shared.IOS.HDLFVSDK.Video.FVapplication(application, new NSDictionary()); //} - Console.WriteLine("111111111111"); + //Console.WriteLine("111111111111"); SetCurrentLanguage(); //Shared.Application.FontSize = 12; //Bugly.Bugly.StartWithAppId("1dc40c170a"); @@ -410,9 +410,8 @@ { if (pushMes.Extras.Contains("OffLine")) { - //haveToSignOut = true; //寮哄埗涓嬬嚎 - UserInfo.Current.LastTime = DateTime.MinValue; + UserInfo.Current.ValidToken = false; UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//閲嶇疆鐢ㄦ埛澶村儚 UserInfo.Current.SaveUserInfo(); HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices)); diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index 7bf23ac..6a28bf6 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -1847,6 +1847,9 @@ <BundleResource Include="Resources\Phone\FunctionIcon\Acst\Inverter\BatteryIconDischarg100.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Acst\Inverter\BatteryIconFault100.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Acst\Inverter\BatteryIconShutdown100.png" /> + <BundleResource Include="Resources\Phone\Collection\TokenInvalidTipIcon.png" /> + <BundleResource Include="Resources\Phone\Public\RightIcon2.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\Power80pIcon.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index a30b196..d34ffc9 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -11,7 +11,7 @@ <key>CFBundleName</key> <string>On Pro</string> <key>CFBundleShortVersionString</key> - <string>2.6.0</string> + <string>2.7.0</string> <key>CFBundleURLTypes</key> <array> <dict> @@ -36,7 +36,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>2.6.0</string> + <string>2.7.0</string> <key>LSApplicationQueriesSchemes</key> <array> <string>weixinULAPI</string> diff --git a/HDL-ON_iOS/Other/JLCountrycode.cs b/HDL-ON_iOS/Other/JLCountrycode.cs index 176a7df..0346b43 100644 --- a/HDL-ON_iOS/Other/JLCountrycode.cs +++ b/HDL-ON_iOS/Other/JLCountrycode.cs @@ -2,6 +2,9 @@ using Shared.IOS.JLCountryCode; using Foundation; using System.Collections.Generic; +using Newtonsoft.Json.Linq; +using System.Net.Http; +using System.Threading.Tasks; namespace JLCountrycode { @@ -95,6 +98,39 @@ return newDictionary; } + /// <summary> + /// 鏍规嵁鎵嬫満褰撳墠鐨処P鑾峰彇鍥藉淇℃伅 + /// </summary> + /// <returns></returns> + public async Task<string> GetCountryByIP() + { + string country = "Unknown"; + + 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) + { + Console.WriteLine($"Error fetching IP info: {ex.Message}"); + } + + return country; + } + } diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index 0a74118..a942d15 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -691,6 +691,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control @@ -2097,9 +2101,10 @@ 704=闈炰腑鍥界敤鎴烽�夋嫨 705=璇烽�夋嫨鏈嶅姟鍣� 706=鏂拌兘婧� - - - +707=绂荤嚎鎺у埗涓紝濡傞渶鍒囨崲鑷宠繙绋嬫帶鍒讹紝鐐规鐧诲綍 +708=鎮ㄥ綋鍓嶇殑鐧诲綍鐘舵�佸凡缁忓け鏁堬紝璇烽噸鏂扮櫥褰� +709=鍘荤櫥褰� +710=绂荤嚎鎺у埗 @@ -3500,7 +3505,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy - +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control @@ -4898,7 +4906,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy - +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control @@ -6284,7 +6295,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy - +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control @@ -7688,7 +7702,10 @@ 704=Non Chinese users choose 705=Please select a server 706=NewEnergy - +707=Off-line Controlling, to switch to remote control, click here to login. +708=Your current login status has expired, please log in again. +709=Log in +710=Off-line Control diff --git a/HDL-ON_iOS/Resources/Phone/Collection/TokenInvalidTipIcon.png b/HDL-ON_iOS/Resources/Phone/Collection/TokenInvalidTipIcon.png new file mode 100644 index 0000000..b48cc2e --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/TokenInvalidTipIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/Power80pIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/Power80pIcon.png new file mode 100644 index 0000000..0dc5570 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/Power80pIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Public/RightIcon2.png b/HDL-ON_iOS/Resources/Phone/Public/RightIcon2.png new file mode 100644 index 0000000..9821b76 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/RightIcon2.png Binary files differ diff --git a/HDL-ON_iOS/ViewController.cs b/HDL-ON_iOS/ViewController.cs index 5e5749e..bfddb87 100644 --- a/HDL-ON_iOS/ViewController.cs +++ b/HDL-ON_iOS/ViewController.cs @@ -56,18 +56,20 @@ } //鍚姩鍙嬬洘sdk - new System.Threading.Thread(() => { - while (true) - { - if (OnAppConfig.Instance.IsLogin) - { - //var um = new UMSdk.HDLUMSDK(); - //UMSdk.HDLUMSDK.InitUMSDKWithAppKey("61d56642e0f9bb492bbc3e72", "IOS"); - break; - } - System.Threading.Thread.Sleep(1000); - } - }) { IsBackground = true }.Start(); + //new System.Threading.Thread(() => { + // int count = 0; + // while (count<5) + // { + // count++; + // if (OnAppConfig.Instance.IsLogin) + // { + // var um = new UMSdk.HDLUMSDK(); + // UMSdk.HDLUMSDK.InitUMSDKWithAppKey("61d56642e0f9bb492bbc3e72", "IOS"); + // break; + // } + // System.Threading.Thread.Sleep(1000); + // } + //}) { IsBackground = true }.Start(); diff --git a/HDL_ON/Common/AliyunLog/AliyunLogClient.cs b/HDL_ON/Common/AliyunLog/AliyunLogClient.cs index 7cce42e..20cb277 100644 --- a/HDL_ON/Common/AliyunLog/AliyunLogClient.cs +++ b/HDL_ON/Common/AliyunLog/AliyunLogClient.cs @@ -118,7 +118,6 @@ LogTags = new Dictionary<string, string> { {"tag1", DateTime.Now.ToLongTimeString()}, - }, Logs = new List<LogInfo> { @@ -127,12 +126,13 @@ Time = DateTimeOffset.Now, Contents = new Dictionary<string, string> { - {"id", DateTime.Now.Ticks.ToString()}, - {"homeid", Entity.DB_ResidenceData.Instance.CurrentRegion.id}, + {"version", MainPage.VersionString}, + {"userAccount", UserInfo.Current.AccountString}, {"userid", UserInfo.Current.ID}, {"userAccount", UserInfo.Current.AccountString}, {"userName", UserInfo.Current.userName}, - {"server", DAL.Server.HttpUtil.GlobalRequestHttpsHost}, + {"homeid", Entity.DB_ResidenceData.Instance.CurrentRegion.id}, + {"server", Entity.DB_ResidenceData.Instance.CurrentRegion.regionUrl}, {"message", msg}, } } diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs index 8ca313c..7d6dbd5 100644 --- a/HDL_ON/Common/ApiUtlis.cs +++ b/HDL_ON/Common/ApiUtlis.cs @@ -1,9 +1,10 @@ 锘縰sing System; using System.Collections.Generic; -using HDL_ON; -using HDL_ON.DAL; +using System.Net.Http; +using System.Threading.Tasks; using HDL_ON.DAL.Server; using HDL_ON.Entity; +using HDL_ON.UI; using HDL_ON.UI.UI2.FuntionControlView.Video; using HDL_ON.UI.UI2.Intelligence.Automation; using Newtonsoft.Json; @@ -73,6 +74,11 @@ /// </summary> public bool DownloadDataComplete = false; + /// <summary> + /// token鏄惁鏈夋晥 + /// </summary> + public bool IsValidToken = false; + public bool hadInternet = true; /// <summary> /// 涓嬭浇鏁版嵁 @@ -104,7 +110,7 @@ try { //澧炲姞3绉掍簯鏈嶅姟鍣ㄨ繛鎺ユ娴嬶紝杩炰笉涓婃湇鍔″櫒鐨勬椂鍊欎笉鍒锋柊鏁版嵁 - hadInternet = true; + //hadInternet = true; var dataList = new List<GlobalRegionListRes>(); var requestJson = HttpUtil.GetSignRequestJson(new GetRegionListObj() { regionMark = HttpUtil.RegionMark }); var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost, "", 3); @@ -127,7 +133,7 @@ } catch (Exception ex) { - MainPage.Log($"{this.GetType()}:鍔犺浇缂撳瓨鎴块棿鏁版嵁寮傚父:{ex.Message}"); + MainPage.Log("Error",$"{this.GetType()}:鍔犺浇缂撳瓨鎴块棿鏁版嵁寮傚父:{ex.StackTrace}"); } try @@ -141,10 +147,8 @@ } catch (Exception ex) { - MainPage.Log($"{this.GetType()}:鍔犺浇缂撳瓨璁惧鏁版嵁寮傚父:{ex.Message}"); + MainPage.Log("Error", $"{this.GetType()}:鍔犺浇缂撳瓨璁惧鏁版嵁寮傚父:{ex.StackTrace}"); } - - return; } else @@ -154,12 +158,13 @@ } catch (Exception ex) { - MainPage.Log($"Error锛氫笅杞芥暟鎹�1锛歿ex.Message}"); + MainPage.Log("Error", $"涓嬭浇鏁版嵁1锛歿ex.StackTrace}"); DownloadDataComplete = true; return; } finally { + MainPage.Log("鏈嶅姟鍣ㄨ繛鎺ョ姸鎬�:" + hadInternet); if (!hadInternet) { Application.RunOnMainThread(() => @@ -177,6 +182,42 @@ code = Ins.HttpRequest.RefreshToken(); if (code != StateCode.SUCCESS) { + DownloadDataComplete = true; + IsValidToken= false; + try + { + var spatialInfoDataBytes = FileUtlis.Files.ReadFile("SpatialInfoData"); + if (spatialInfoDataBytes != null) + { + var spatialInfoDataString = System.Text.Encoding.UTF8.GetString(spatialInfoDataBytes); + if (spatialInfoDataString != null && !string.IsNullOrEmpty(spatialInfoDataString)) + { + var spatialInfoDataList = JsonConvert.DeserializeObject<List<SpatialInfo>>(spatialInfoDataString); + SpatialInfo.CurrentSpatial.UpdateSpatialList(spatialInfoDataList); + } + } + } + catch (Exception ex) + { + MainPage.Log("Error", $"{this.GetType()}:鍔犺浇缂撳瓨鎴块棿鏁版嵁寮傚父:{ex.StackTrace}"); + } + + try + { + var fileList = Common.FileUtlis.Files.ReadFiles(); + foreach (var file in fileList) + { + FunctionList.List.IniFunctionList(file, true); + } + Room.CurrentSpatial.InitRoomListFunctions(); + } + catch (Exception ex) + { + MainPage.Log("Error", $"{this.GetType()}:鍔犺浇缂撳瓨璁惧鏁版嵁寮傚父:{ex.StackTrace}"); + } + MainPage.Log($"鍒锋柊token澶辫触"); + + if (waitPage != null) { Application.RunOnMainThread(() => @@ -190,8 +231,11 @@ catch { } }); } - MainPage.Log($"鍒锋柊token澶辫触"); return; + } + else + { + hadInternet = true; } MainPage.Log($"鍒锋柊token鎴愬姛"); //===================鍒锋柊浣忓畢淇℃伅======================= @@ -237,26 +281,6 @@ } MainPage.Log($"鍒锋柊涓汉淇℃伅鎴愬姛"); - //int count = 0; - //while (count < 10) - //{ - // if (DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) - // { - // System.Threading.Thread.Sleep(200); - // } - // else - // { - // break; - // } - // count++; - //} - //if (DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) - //{ - // return; - //} - - //return; - try { //===================鎴块棿======================= @@ -277,9 +301,10 @@ { var ssd = System.Text.Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(revData.list)); FileUtlis.Files.WriteFileByBytes("SpatialInfoData", ssd); - }catch(Exception ex) + } + catch (Exception ex) { - MainPage.Log($"{this.GetType()}:淇濆瓨鎴块棿淇℃伅寮傚父锛歿ex.Message}"); + MainPage.Log("Error", $"{this.GetType()}:淇濆瓨鎴块棿淇℃伅寮傚父锛歿ex.StackTrace}"); } }) { IsBackground = true }.Start(); @@ -301,7 +326,7 @@ { FunctionList.List.ClearDatas(); MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛"); - MainPage.Log($"sid鍒楄〃鑾峰彇====\r\n" , deviceResult.Data.ToString()); + //MainPage.Log($"sid鍒楄〃鑾峰彇====\r\n", deviceResult.Data.ToString()); var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); if (deviceList == null) { @@ -325,7 +350,7 @@ } finally { - + } string delFile = ""; @@ -356,8 +381,8 @@ foreach (var newFunction in deviceList.list) { newFunction.AssembleStatus(); - newFunction.SaveFunctionFile(); - FunctionList.List.IniFunctionList(newFunction.savePath,true); + newFunction.SaveFunctionFile(); + FunctionList.List.IniFunctionList(newFunction.savePath, true); //MainPage.Log($"============璁惧============{iiii++}"); } @@ -379,7 +404,7 @@ string videoList = videoInfo.Data.ToString(); FunctionList.List.videoIntercom = JsonConvert.DeserializeObject<List<UI.UI2.FuntionControlView.Video.Video>>(videoList); - for(int i =0;i< FunctionList.List.videoIntercom.Count;i++) + for (int i = 0; i < FunctionList.List.videoIntercom.Count; i++) { var video = FunctionList.List.videoIntercom[i]; @@ -387,7 +412,91 @@ { UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken; } + else if (video.interphoneType == InterphoneType.HDL.ToString()) + { + isInterphoneType_HDL = true; + DB_ResidenceData.Instance.SupportFacePass = true; + DB_ResidenceData.Instance.SaveResidenceData(); + DB_ResidenceData.Instance.SupportFVDevice = true; + } + else if (video.interphoneType == InterphoneType.FREEVIEW.ToString()) + { +#if __IOS__ + try + { + FunctionList.List.videoIntercom.Remove(video); + --i; + }catch(Exception ex) + { + MainPage.Log("Error", $"ios 鍏ㄨ閫氬紓甯� : {ex.StackTrace}"); + } + +#else + //涓哄叏瑙嗛�氬彲瑙嗗璁� + DB_ResidenceData.Instance.SupportFacePass = true; + Entity.DB_ResidenceData.Instance.SupportVisitorManage = true; + Entity.DB_ResidenceData.Instance.SupportFVDevice = true; + isInterphoneType_FREEVIEW = true; +#endif + } } + } + + + //======================鑾峰彇Sip璐﹀彿骞朵笖鍒濆鍖朣DK鍙瀵硅璁惧鍒楄〃==================== + //濡傛灉妫�娴嬬嚎绋嬫病鍚姩锛屾墠缁х画涓嬮潰鎿嶄綔 鍥犱负App鏈夊彲鑳藉垰鍚姩椹笂鏀跺埌鎺ㄩ�佷簡锛岀劧鍚庢墠鎵ц鍒拌繖閲� + if (HDLLinphone.Current.CheckIncomingCallThreadIsNull()) + { + + //褰撳墠浣忓畢鏄疕DL鍙瀵硅绫诲瀷鐨勮澶� + if (isInterphoneType_HDL) + { + //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK + HDLCallVideoInfo callVideoInfo = new HDLCallVideoInfo(); + callVideoInfo.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; + callVideoInfo.InterphoneType = InterphoneType.HDL.ToString(); + HDLLinphone.Current.GetHDLSipInfoAndInitSDK(callVideoInfo); + } + else if (isInterphoneType_FREEVIEW) + { + //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK + HDLCallVideoInfo callVideoInfo = new HDLCallVideoInfo(); + callVideoInfo.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; + callVideoInfo.InterphoneType = InterphoneType.FREEVIEW.ToString(); + HDLLinphone.Current.GetHDLSipInfoAndInitSDK(callVideoInfo); + } + else + { + Utlis.WriteLine("褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅,閫�鍑虹櫥褰曟墍鏈夎处鍙�"); + //褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅 + HDLLinphone.Current.LogoutAllAccount(); + } + } + + + + //======================鐧诲綍鍏ㄨ閫�==================== + if (isInterphoneType_FREEVIEW) + { + +#if __IOS__ + //string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; + //string errorVersion = "16.2.0"; + //if (systemVersion.CompareTo(errorVersion) < 0)///鍏ㄨ閫氫笉鍏煎ios16浠ヤ笂鐨勭郴缁燂紝涓嶈鍔犺浇杩欎釜鍏� + //{ + // List<VisitorTempPassword> dataList = new List<VisitorTempPassword>(); + // Dictionary<string, object> dictionary = new Dictionary<string, object>(); + // dictionary.Add("homeId", Entity.DB_ResidenceData.Instance.CurrentRegion.id); + // var requestJson = HttpUtil.GetSignRequestJson(dictionary); + // ResponsePackNew pack = HttpUtil.RequestHttpsPost(NewAPI.Api_Post_GetExtMemberInfo, requestJson); + // if (pack != null) + // { + // var data = JsonConvert.DeserializeObject<FreeviewMemberInfo>(pack.Data.ToString()); + // //鐧诲綍鍏ㄨ閫� + // Shared.IOS.HDLFVSDK.Video.Init("", data.extUserId, DB_ResidenceData.Instance.CurrentRegion.id, "78FF1E4D-FC0A-4E71-9B79-0448E4460BD7", "T0001", "120.77.53.170:9700", "120.77.53.170:21664"); + // } + //} +#endif } } @@ -395,16 +504,16 @@ { MainPage.Log($"璇诲彇浜戠璁惧鏁版嵁澶辫触:Code:{deviceResult.Code}; Msg:{deviceResult.message}"); } - }catch (Exception ex) + } + catch (Exception ex) { - MainPage.Log($"============璁惧============{ex.Message}"); + MainPage.Log("Error", $"============璁惧============{ex.StackTrace}"); } finally { complateDevice = true; MainPage.Log($"============璁惧============瀹屾垚" + FunctionList.List.Functions.Count); } - //======================缇ゆ帶==================== if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) @@ -418,16 +527,16 @@ { var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); var readSidList = new List<string>(); - foreach(var temp in groupControlList) + foreach (var temp in groupControlList) { FunctionList.List.groupControls.Clear(); readSidList.Add(temp.userDeviceGroupControlId); if (readSidList.Count >= 20) { var data = Ins.httpRequest.GetGroupControInfo(readSidList); - if(data != null) + if (data != null) { - if(data.Code == StateCode.SUCCESS) + if (data.Code == StateCode.SUCCESS) { var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); FunctionList.List.groupControls.AddRange(groupControlInfoList); @@ -461,7 +570,7 @@ } catch (Exception ex) { - MainPage.Log($"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.Message}"); + MainPage.Log("Error", $"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.StackTrace}"); } } else @@ -523,9 +632,10 @@ { MainPage.Log($"璇诲彇浜戠鍦烘櫙鏁版嵁澶辫触:Code:{pack.Code}; Msg:{pack.message}"); } - }catch(Exception ex) + } + catch (Exception ex) { - MainPage.Log($"===鍦烘櫙==={ex.Message}"); + MainPage.Log("Error", $"===鍦烘櫙==={ex.StackTrace}"); } finally { @@ -546,7 +656,7 @@ } catch (Exception ex) { - MainPage.Log($"鏁版嵁鍒濆鍖栧け璐ワ細{ex.Message}"); + MainPage.Log("Error", $"鏁版嵁鍒濆鍖栧け璐ワ細{ex.StackTrace}"); } finally { @@ -565,9 +675,10 @@ try { FunctionList.List.Read3tyFunctionStatus(); - }catch(Exception ex) + } + catch (Exception ex) { - MainPage.Log("璇诲彇绗笁鏂硅澶囩姸鎬佸け璐�:"+ex.Message); + MainPage.Log("Error", "璇诲彇绗笁鏂硅澶囩姸鎬佸け璐�:" + ex.StackTrace); } } }); @@ -603,13 +714,46 @@ { if (DB_ResidenceData.Instance.CurrentRegion != null) { -#region 璇诲彇鏈湴鏁版嵁 - //鎼滅储缃戝叧 - DriverLayer.Control.Ins.SearchLoaclGateway(); - //閲嶆柊杩炴帴mqtt - DAL.Mqtt.MqttClient.DisConnectRemote("鍒锋柊鏁版嵁锛岄噸杩瀖qtt",false); -#endregion + try + { + #region 璇诲彇鏈湴鏁版嵁 + //鎼滅储缃戝叧 + DriverLayer.Control.Ins.SearchLoaclGateway(); + //閲嶆柊杩炴帴mqtt + DAL.Mqtt.MqttClient.DisConnectRemote("鍒锋柊鏁版嵁锛岄噸杩瀖qtt", false); + #endregion + } + catch (Exception ex){ + MainPage.Log("Error", $"璇诲彇鏈湴鏁版嵁寮傚父锛歿ex.StackTrace}"); + } + try + { + HomePage.LoadEvent_CheckTokenValid(); + if (IsValidToken && !UserInfo.Current.IsTipedInvalidToken) + { + UserInfo.Current.IsTipedInvalidToken = true; + UserInfo.Current.SaveUserInfo(); + Application.RunOnMainThread(() => + { + try + { + new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TokenInvalidTipMsg, StringId.OfflineControl, StringId.GoLogin, () => + { + HDLCommon.Current.Logout(); + }); + } + catch (Exception ex) + { + MainPage.Log("Error", $"鎻愮ず鐧诲綍鍑瘉绐楀彛鍔犺浇寮傚父:{ex.StackTrace}"); + } + }); + } + } + catch (Exception ex) + { + MainPage.Log("Error", $"鏇存柊鐧诲綍鍑瘉鏂规硶璋冪敤寮傚父:{ex.StackTrace}"); + } } } }) @@ -642,39 +786,50 @@ { lock (FunctionList.List.securities) { - var pack = Ins.HttpRequest.GetSecurityList(); - if (pack.Code == StateCode.SUCCESS) + try { - var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); - Console.WriteLine("瀹夐槻鎬绘暟锛�" + packList.Count); - var sidList = new List<string>(); - foreach (var function in packList) + var pack = Ins.HttpRequest.GetSecurityList(); + if (pack.Code == StateCode.SUCCESS) { - sidList.Add(function.sid); - } - var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>()); - var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString()); - if (infoList != null) - { - var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_")); - if (filePathList != null) + var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); + Console.WriteLine("瀹夐槻鎬绘暟锛�" + packList.Count); + var sidList = new List<string>(); + foreach (var function in packList) { - foreach (var file in filePathList) + sidList.Add(function.sid); + } + if (sidList.Count == 0) + { + return; + } + var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>()); + var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString()); + if (infoList != null) + { + var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_")); + if (filePathList != null) { - FileUtlis.Files.DeleteFile(file); + foreach (var file in filePathList) + { + FileUtlis.Files.DeleteFile(file); + } + } + FunctionList.List.securities.Clear(); + foreach (var function in infoList) + { + function.SaveFile(); + FunctionList.List.IniFunctionList(function.savePath, true); } } - FunctionList.List.securities.Clear(); - foreach (var function in infoList) - { - function.SaveFile(); - FunctionList.List.IniFunctionList(function.savePath, true); - } + } + else + { + MainPage.Log($"璇诲彇瀹夐槻鍒楄〃澶辫触:Code:{pack.Code}; Msg:{pack.message}"); } } - else + catch (Exception ex) { - MainPage.Log($"璇诲彇瀹夐槻鍒楄〃澶辫触:Code:{pack.Code}; Msg:{pack.message}"); + MainPage.Log("Error", $"璇诲彇瀹夐槻鍒楄〃澶辫触:Code:{ex.StackTrace}"); } } } @@ -687,6 +842,25 @@ var pack = Ins.HttpRequest.GetSecurityList(); } + //public async Task<bool> CanConnectToHost() + //{ + // try + // { + // using (HttpClient client = new HttpClient()) + // { + // client.Timeout = TimeSpan.FromSeconds(3); // 瓒呮椂鏃堕棿 + // HttpResponseMessage response = await client.GetAsync(HttpUtil.GlobalRequestHttpsHost); + // return response.IsSuccessStatusCode; + // } + // } + // catch (Exception ex) + // { + // MainPage.Log(ex.StackTrace); + // return false; + // } + //} + } -} \ No newline at end of file +} + diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index 5a6979b..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; @@ -283,14 +267,200 @@ { //鎶ヨ鎺ㄩ�佸脊绐楁彁绀� ShowAlarmPushMessage(jpushMessageInfo, true); + //钀ょ煶闂ㄩ攣鎺ㄩ�� + UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DoorLockPush(jpushMessageInfo); + } + else if (jpushMessageInfo.messageType == (PushMessageType.FLCall.ToString())) + { + if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return; + + ESVideoInfo eSVideoInfo = GetESOnVideoJson(jpushMessageInfo.expantContent); + + if (eSVideoInfo == null) return; + + if (string.IsNullOrEmpty(eSVideoInfo.uuid)) return; + + if (eSVideoInfo.uuid.Contains(",")) + { + var uuid = eSVideoInfo.uuid.Split(','); + eSVideoInfo.ESVideoUUID = uuid[0]; + } + else + { + eSVideoInfo.ESVideoUUID = eSVideoInfo.uuid; + } + + ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, InterphoneType.FLVI.ToString()); + + } + 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(); + if (string.IsNullOrEmpty(interphoneTypeEnum)) return; + ESVideoInfo eSVideoInfo = new ESVideoInfo();// GetESOnVideoJson(jpushMessageInfo.expantContent); + //2.鏍规嵁鍙瀵硅鍘傚绫诲瀷锛屽鐞嗕笉鍚岀殑鏁版嵁 + if (interphoneTypeEnum == InterphoneType.IMOUVISIAL.ToString()) + { + //澶у崕涔愭 + eSVideoInfo.callId = json["callId"].ToString(); + //eSVideoInfo.Lc_AccessToken = UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken;//json["subAccountToken"].ToString();// + eSVideoInfo.Lc_AccessToken = json["subAccountToken"].ToString();//2021-05-13 鐩墠浜戠杩樻病鎷垮埌Lc_AccessToken锛岀洰鍓嶆病鍔炴硶姝e父浣跨敤 + eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString(); + eSVideoInfo.Lc_Location = OnAppConfig.Instance.RequestHttpsHost.Contains("China") ? 0 : 1; + eSVideoInfo.Lc_PlayToken = json["token"].ToString(); + //eSVideoInfo.Lc_Psk = json["cname"].ToString(); + eSVideoInfo.Lc_Psk = json["psk"].ToString();//2021-10-15 PSK瀛楁涓嶈兘鍙朿name + } + else if (interphoneTypeEnum == InterphoneType.EZVIZ.ToString()) + { + //钀ょ煶鐚溂 + eSVideoInfo.Lc_AccessToken = json["subToken"].ToString();//"瀛愯处鍙穞oken + eSVideoInfo.DeviceSerial = json["devSerial"].ToString();//璁惧搴忓垪鍙� + eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString(); + eSVideoInfo.spk = json["spk"].ToString(); + + eSVideoInfo.HomeId = jpushMessageInfo.HomeId; + if (json.ContainsKey("msgId") && !string.IsNullOrEmpty(json["msgId"].ToString())) + { + eSVideoInfo.msgId = json["msgId"].ToString(); + } + if (json.ContainsKey("currentTime") && !string.IsNullOrEmpty(json["currentTime"].ToString())) + { + eSVideoInfo.currentTime = json["currentTime"].ToString(); + } + } + else if (interphoneTypeEnum == InterphoneType.HDL.ToString()) + { + try + { + var pushTime = json["pushTime"]; + if (pushTime == null) + { + return; + } + if (!string.IsNullOrEmpty(pushTime.ToString())) + { + var pushDateTime = Utlis.UnixToDateTimeMS(Convert.ToInt64(pushTime)); + if (pushDateTime.AddSeconds(30) < DateTime.Now) + { + return; + } + } + } + catch (Exception ex) { + MainPage.Log("Error", $"鑷爺鍙瀵硅閫氱煡寮傚父:{ex.StackTrace}"); + } + +#if __ANDROID__ + Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MissedCallsTime = 30; + Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.SetMediaPlayerLooping(true); + Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone(); + new Thread(() => + { + try + { + DateTime dateTime = DateTime.Now; + while (true) + { + Thread.Sleep(1000); + if (!Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MediaPlayerPlayingStatus || dateTime.AddSeconds(Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MissedCallsTime) <= DateTime.Now) + { + break; + } + } + Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.SetMediaPlayerLooping(false); + } + catch (Exception ex) + { + MainPage.Log("error", "鑷爺鍙瀵硅閾冨0鎾斁寮傚父:" + ex.Message); + } + }) + { IsBackground = true }.Start(); + + #elif __IOS__ + SoundPlayer.Ins.PlaySound(); + new Thread(() => { + int count = 0; + while (true) + { + if (SoundPlayer.Ins.player == null) + { + break; + } + if (!SoundPlayer.Ins.player.Playing) + { + break; + } + System.Threading.Thread.Sleep(1000); + count++; + MainPage.Log("linphone 鍛煎彨璁℃椂锛�" + count); + if (count > 29) + { + SoundPlayer.Ins.StopSound(); + Application.RunOnMainThread(() => { + try + { + HDLLinPhoneSDK.Instance().HideIntercomeVC(); + }catch(Exception ex) + { + MainPage.Log("error", "ios linphone 鍛煎彨瓒呮椂鍏抽棴鐣岄潰寮傚父锛�" + ex.Message); + } + }); + break; + } + } + }) + { IsBackground = true }.Start(); + #endif + + 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(); + //鎵撳紑鍛煎彨椤甸潰 + HDLLinphone.Current.ShowESVideoIntercom(eSVideoInfo, InterphoneType.HDL.ToString(), jpushMessageInfo.isNotificationGoing); + return; + } + else if (interphoneTypeEnum == InterphoneType.FREEVIEW.ToString()) + { + //鍏ㄨ閫� 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.FREEVIEW.ToString()); + return; + } + + //3.鎵撳紑鍛煎彨椤甸潰 + if (eSVideoInfo == null) return; + ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, interphoneTypeEnum); + } else if (jpushMessageInfo.messageType == (PushMessageType.Prompt.ToString())) { ShowAlarmPushMessage(jpushMessageInfo, false); + //钀ょ煶闂ㄩ攣鎺ㄩ�� + HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DoorLockPush(jpushMessageInfo); } else if (jpushMessageInfo.messageType == (PushMessageType.DOOR_BELL.ToString())) { //钀ょ煶闂ㄩ攣鎺ㄩ�� + HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DoorLockPush(jpushMessageInfo); } @@ -301,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> @@ -341,24 +509,22 @@ //Application.Activity.StartActivity() #endif - //娴嬭瘯璐﹀彿锛屼笉鎸や笅绾� - switch (UserInfo.Current.AccountString) - { - case "464027401@qq.com": - case "649362315@qq.com": - case "13580507523": - case "15626203746": - case "18316672920": - - return; - } + //鏈櫥褰曚笉鐢ㄥ鐞� - if (!UserInfo.Current.IsLogin) return; - - //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈� - new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show(); - + //if (!UserInfo.Current.IsLogin) return; + try + { + Application.RunOnMainThread(() => + { + //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈� + new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show(); + }); + } + catch (Exception ex) + { + MainPage.Log("Error", $"鎸や笅绾挎彁绀虹獥鍙e紓甯革細{ex.StackTrace}"); + } try { Logout(); @@ -373,51 +539,65 @@ /// </summary> public void Logout() { - //鍔犺浇Loading鏁堟灉 - var waitPage = new Loading(); - MainPage.BaseView.AddChidren(waitPage); - waitPage.Start(Language.StringByID(StringId.PleaseWait)); - - new Thread(() => + try { - try + Application.RunOnMainThread(() => { - //2.娉ㄩ攢鎺ㄩ�� - new HttpServerRequest().SignOutPush(); - //3.璺宠浆鐧诲綍椤甸潰 - UserInfo.Current.LastTime = DateTime.MinValue; - UserInfo.Current.SaveUserInfo(); - DB_ResidenceData.Instance.EixtAccount(); - MainPage.Log("閫�鍑鸿处鍙锋竻绌烘暟鎹�"); - MainPage.Log("娉ㄩ攢HDLSIP璐﹀彿鐧诲綍"); + //鍔犺浇Loading鏁堟灉 + var waitPage = new Loading(); + MainPage.BaseView.AddChidren(waitPage); + waitPage.Start(Language.StringByID(StringId.PleaseWait)); + + new Thread(() => + { + try + { + //2.娉ㄩ攢鎺ㄩ�� + new HttpServerRequest().SignOutPush(); + //3.璺宠浆鐧诲綍椤甸潰 + UserInfo.Current.ValidToken = false; + UserInfo.Current.SaveUserInfo(); + OnAppConfig.Instance.LastLoginUserId = ""; + OnAppConfig.Instance.SaveConfig(); + DB_ResidenceData.Instance.EixtAccount(); + MainPage.Log("閫�鍑鸿处鍙锋竻绌烘暟鎹�"); + //4.娉ㄩ攢HDLSIP璐﹀彿鐧诲綍 2021-08-20 + HDLLinphone.Current.LogoutAllAccount(); + MainPage.Log("娉ㄩ攢HDLSIP璐﹀彿鐧诲綍"); #if __IOS__ - //5.鍏ㄨ閫氱櫥鍑� - //Shared.IOS.HDLFVSDK.Video.Logout(); - //6.娓呯┖Siri鍏变韩鏁版嵁淇℃伅 - new Other.SkipControl().SetData(false, "", "", "", ""); - var sDM = new SiriKit.SceneDateManager(); - Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}"); + //5.鍏ㄨ閫氱櫥鍑� + //Shared.IOS.HDLFVSDK.Video.Logout(); + //6.娓呯┖Siri鍏变韩鏁版嵁淇℃伅 + new Other.SkipControl().SetData(false, "", "", "", ""); + var sDM = new SiriKit.SceneDateManager(); + //Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}"); #endif - } - catch (Exception ex) - { - MainPage.Log($"xxx:{ex.Message}"); - } - finally - { - Application.RunOnMainThread(() => - { - if (waitPage != null) - { - waitPage.Hide(); - waitPage.RemoveFromParent(); - waitPage = null; } - MainPage.GoLoginPage(UserInfo.Current); - }); - } - }).Start(); + catch (Exception ex) + { + MainPage.Log($"xxx:{ex.Message}"); + } + finally + { + Application.RunOnMainThread(() => + { + if (waitPage != null) + { + waitPage.Hide(); + waitPage.RemoveFromParent(); + waitPage = null; + } + MainPage.GoLoginPage(UserInfo.Current); + }); + } + }).Start(); + }); + } + catch (Exception ex) + { + MainPage.Log("Error", $"閫�鍑虹櫥褰曞紓甯�:{ex.StackTrace}"); + } } /// <summary> @@ -432,7 +612,7 @@ public void ShowAlarmPushMessage(JPushMessageInfo jpushMessageInfo, bool isAlarm) { //娌$櫥褰曚笉澶勭悊 - if (UserInfo.Current == null || !UserInfo.Current.IsLogin || MainPage.BasePageView == null) + if (UserInfo.Current == null || MainPage.BasePageView == null) { return; } @@ -580,5 +760,129 @@ } #endregion +#region 璺宠浆鎵撳紑钀ょ煶浜戞柟娉� + + /// <summary> + /// 鑾峰彇瀛愯处鍙穞oken骞惰烦杞澶囧垪琛ㄩ〉闈� + /// </summary> + /// <param name="bodyView"></param> + public void Go2EZvizMonitor(FrameLayout bodyView) + { + var waitPage = new Loading(); + bodyView.AddChidren(waitPage); + waitPage.Start(Language.StringByID(StringId.PleaseWait)); + + new Thread(() => + { + try + { + var list = UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.GetVideoDoorLockLockModelsList(); + //鍏堣幏鍙栬悿鐭充簯瀛愯处鍙穞oken + var result = new HttpServerRequest().EZGetChildToken(); + if (result.Code == StateCode.SUCCESS) + { + var ezChildAccessToken = result.Data.ToString(); + + //var ezChildAccessToken = Newtonsoft.Json.JsonConvert.DeserializeObject<EZChildAccessToken>(result.Data.ToString()); + Application.RunOnMainThread(() => + { + if (!string.IsNullOrEmpty(ezChildAccessToken)) + { + +#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); + + //2023骞�03鏈�29鏃�13:08:35 淇敼 + Foundation.NSObject[] nSObject = new Foundation.NSObject[list.Count]; + for (int i = 0; i < list.Count; i++) + { + string strValue = list[i]; + nSObject[i] = new Foundation.NSString(strValue); + } + EZSDK.IOS.EZSDK.SharedInstance().ToEZDeviceListViewWithFilterTypes(nSObject); + + + +#else + //Android + //1.璁剧疆鎵�闇�娌充笢鐨則oken銆佸煙鍚嶅湴鍧� + //2.璁剧疆钀ょ煶瀛愯处鍙风殑token + //3.鎵撳紑鎽勫儚澶磋澶囧垪琛ㄩ〉闈� + ((BaseActivity)Shared.Application.Activity).SetCamera(b => + { + if (b) + { + ((BaseActivity)Shared.Application.Activity).SetPermission(result => + { + //2023骞�03鏈�29鏃�13:08:35 淇敼 + Com.Videogo.Hdl.HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, "1aa98a90489b4838b966b57018b4b04b", 1, DB_ResidenceData.Instance.CurrentRegion.id, + HttpUtil.APP_KEY, HttpUtil.SECRET_KEY); + Com.Videogo.Hdl.HDLEzvizSdk.Instance.JumpToCameraListActivity(Shared.Application.Activity, list); + //if (result) + //{ + // Android.Content.Intent intent = new Android.Content.Intent(); + // var bundle = new Android.OS.Bundle(); + // //浼犻�抧ame鍙傛暟涓簍inyphp + // bundle.PutString("EzChildAccessToken", ezChildAccessToken); + // bundle.PutString("HdlToken", UserInfo.Current.LoginTokenString); + // bundle.PutString("Url", OnAppConfig.Instance.RequestHttpsHost); + // bundle.PutString("EzvizAppKey", "1aa98a90489b4838b966b57018b4b04b"); + // bundle.PutInt("Platform", 1); + // bundle.PutString("HomeId", DB_ResidenceData.Instance.CurrentRegion.id); + // intent.PutExtras(bundle); + // intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); + // Shared.Application.Activity.StartActivity(intent); + //} + }, "android.permission.RECORD_AUDIO"); + + } + }); +#endif + + + } + + }); + } + else + { + if (result.Code != "-1") + IMessageCommon.Current.ShowErrorInfoAlter(result.Code); + } + } + catch (Exception ex) + { + } + finally + { + Application.RunOnMainThread(() => + { + if (waitPage != null) + { + waitPage.RemoveFromParent(); + waitPage = null; + } + }); + } + }) + { IsBackground = true }.Start(); + } + +#endregion } } diff --git a/HDL_ON/Common/OnAppConfig.cs b/HDL_ON/Common/OnAppConfig.cs index 8c86dc0..6f75baa 100644 --- a/HDL_ON/Common/OnAppConfig.cs +++ b/HDL_ON/Common/OnAppConfig.cs @@ -65,12 +65,26 @@ return false; else { - //return (DateTime.Now - LastTime).TotalDays < 7; return true; } } } + 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/Common/R.cs b/HDL_ON/Common/R.cs index b0e0a67..8353782 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -5,6 +5,23 @@ { public static class StringId { + + /// <summary> + /// 绂荤嚎鎺у埗 + /// </summary> + public const int OfflineControl = 710; + /// <summary> + /// 鍘荤櫥褰� + /// </summary> + public const int GoLogin = 709; + /// <summary> + /// 鎮ㄥ綋鍓嶇殑鐧诲綍鐘舵�佸凡缁忓け鏁堬紝璇烽噸鏂扮櫥褰� + /// </summary> + public const int TokenInvalidTipMsg = 708; + /// <summary> + /// 绂荤嚎鎺у埗涓紝濡傞渶鍒囨崲鑷宠繙绋嬫帶鍒讹紝鐐规鐧诲綍 + /// </summary> + public const int TokenInvalidMsg = 707; /// <summary> /// 鏂拌兘婧� /// </summary> diff --git a/HDL_ON/Common/UserInfo.cs b/HDL_ON/Common/UserInfo.cs index df2d66b..4f59c01 100644 --- a/HDL_ON/Common/UserInfo.cs +++ b/HDL_ON/Common/UserInfo.cs @@ -164,19 +164,27 @@ /// </summary> public List<RegionInfoRes> regionList = new List<RegionInfoRes>(); /// <summary> + /// token鏄惁鏈夋晥 + /// </summary> + public bool ValidToken = false; + /// <summary> + /// 鏄惁鎻愮ず杩嘥oken杩囨湡 + /// </summary> + public bool IsTipedInvalidToken = false; + /// <summary> /// 涓婁竴娆$櫥褰曟椂闂� /// </summary> - public DateTime LastTime = DateTime.MinValue; + //public DateTime LastTime = DateTime.MinValue; /// <summary> /// 鏄惁鏄櫥褰曠姸鎬� /// </summary> - public bool IsLogin - { - get - { - return (DateTime.Now - LastTime).TotalDays < 90; - } - } + //public bool IsLogin = false; + //{ + // get + // { + // return (DateTime.Now - LastTime).TotalDays < 7; + // } + //} [Newtonsoft.Json.JsonIgnore] public DateTime LastTimeOpenDoor = DateTime.MinValue; diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index e66c1c3..a887526 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -276,8 +276,8 @@ public void SearchLoaclGateway() { //2021-01-15 : 浣忓畢娌℃湁缁戝畾缃戝叧鐨勬椂鍊欎笉鐢ㄦ悳绱紝骞朵笖涓嶈兘閾炬帴mqtt - if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId) || - !UserInfo.Current.IsLogin) + if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId)) + //|| !UserInfo.Current.IsLogin) { return; } @@ -444,7 +444,7 @@ //濡傛灉鏄帶鍒惰皟鍏夌殑寮�鏃讹紝浜害鍊间笉鑳戒负0 - if (commandDictionary.Count > 2) + if (commandDictionary.Count >= 2) { if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff) && commandDictionary.ContainsKey(FunctionAttributeKey.Brightness)) { @@ -978,10 +978,10 @@ /// <returns></returns> public void ConvertReceiveData(byte[] receiveBytes, string ip) { - if (!UserInfo.Current.IsLogin) - { - return; - } + //if (!UserInfo.Current.IsLogin) + //{ + // return; + //} var reString = Encoding.UTF8.GetString(receiveBytes); AnalysisReceiveData(reString, receiveBytes, ip); } @@ -1124,7 +1124,7 @@ //2021-09-23 鏂板鑾峰彇褰撳墠缃戝叧鏄惁鏈湴鍔犲瘑 Ins.IsLocalEncrypt = device.isLocalEncrypt; //MainPage.Log("缃戝叧鏈湴鍔犲瘑鐘舵�侊細" + device.local_encrypt.ToString()); - //鐧诲綍缃戝叧Tcp + //鐧诲綍缃戝叧Tcp tcp杩炴帴缃戝叧 //OpenTcpClent(); @@ -1431,7 +1431,7 @@ VenetianBlindsPage.UpdataState(localFunction); break; case SPK.AcStandard: - case SPK.HvacAC: + case SPK.HvacAC:case SPK.HvacAcPanel: case SPK.AcIr: Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status); if (localFunction != null) diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs index 6ad5775..bc21d64 100644 --- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs +++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs @@ -104,7 +104,7 @@ try { //璐﹀彿娌$櫥褰曚笉鍥炲 - if ( UserInfo.Current == null || ! UserInfo.Current.IsLogin) + if ( UserInfo.Current == null )///|| ! UserInfo.Current.IsLogin) { return; } @@ -197,7 +197,7 @@ } break; case SPK.AcStandard: - case SPK.HvacAC: + case SPK.HvacAC:case SPK.HvacAcPanel: AC acTemp = new AC(); byte onoff = 0; byte mode = 0; @@ -609,7 +609,7 @@ } break; case SPK.AcStandard: - case SPK.HvacAC: + case SPK.HvacAC:case SPK.HvacAcPanel: var ac = new AC(); byte onoff = 0; @@ -957,7 +957,7 @@ ControlBytesSend(Command.ReadCurtainStatus, subnetId, deviceId, new byte[] { function.bus.LoopId }); break; case SPK.AcStandard: - case SPK.HvacAC: + case SPK.HvacAC:case SPK.HvacAcPanel: ControlBytesSend(Command.ReadACMode, subnetId, deviceId, new byte[] { function.bus.LoopId }); break; case SPK.HvacFloorHeat:case SPK.FloorHeatStandard:case SPK.HvacFloorHeatPanel: diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index cea69ec..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鐨勯摼鎺� @@ -353,11 +353,11 @@ } MainPage.LinkHdlMqttCount++; - if (!UserInfo.Current.IsLogin) - { - return; - } - if (DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.id == null) + //if (!UserInfo.Current.IsLogin) + //{ + // return; + //} + if (OnAppConfig.Instance.LastLoginUserId == ""|| DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.id == null) { return; } @@ -860,18 +860,8 @@ /// </summary> static void ReceiveNotifySqueezeAsync(string mMes) { + MainPage.Log($"鎺ㄩ�佹爣璇嗭細{mMes};鏈湴鏍囪瘑锛歿PushSignStr}"); if (mMes == PushSignStr) return;//鏄嚜宸辩殑鐧诲綍鎺ㄩ�佷笉澶勭悊//鎴栬�呭綋鍓嶄笉鏄繙绋嬮摼鎺ョ姸鎬� - //娴嬭瘯璐﹀彿锛屼笉鎸や笅绾� - switch (UserInfo.Current.userMobileInfo) - { - case "15626203746": - return; - } - - if (!UserInfo.Current.IsLogin) - { - return; - } DisConnectRemoteMqttClient("鎸や笅绾�"); @@ -880,40 +870,26 @@ //寮圭獥鎻愮ず琚尋涓嬬嚎 HDLCommon.Current.CheckLogout(); }); - - - //UserInfo.Current.LastTime = DateTime.MinValue; - //UserInfo.Current.SaveUserInfo(); - - //Application.RunOnMainThread(() => { - // MainPage.GoLoginPage(UserInfo.Current); - // //寮圭獥鎻愮ず琚尋涓嬬嚎 - //}); - - //2020-08-11 鍒犻櫎鎺ㄩ�佹暟鎹� - //HDLRequest.Current.PushserivceSignOut (); } - - ///// <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> static void SendPushSignOut() { +#if DEBUG + MainPage.Log("璋冭瘯妯″紡锛屼笉鍙戝竷鎸や笅绾夸富棰樸��"); + return; +#endif + //娴嬭瘯璐﹀彿锛屼笉鎸や笅绾� + switch (UserInfo.Current.AccountString) + { + case "15626203746": + case "13580507523": + case "18475593023": + return; + } + byte[] message = Encoding.UTF8.GetBytes(PushSignStr); MqttRemoteSend(message, 4); } @@ -941,7 +917,6 @@ break; case 4://鍙戝竷鏂版柟妗堢殑鎸や笅绾夸富棰� topicName = $"/BusGateWayToClient/{UserInfo.Current.ID}" + PushNotifySqueeze; - //message = Encoding.UTF8.GetBytes (PushSignStr); await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Payload = message, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }); break; } diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index d818a1c..10cec37 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -171,7 +171,7 @@ UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken; UserInfo.Current.AccessToken = revertData.accessToken; UserInfo.Current.RefreshToken = revertData.refreshToken; - UserInfo.Current.LastTime = DateTime.Now; + UserInfo.Current.ValidToken = true; UserInfo.Current.SaveUserInfo(); #if __IOS__ @@ -182,7 +182,7 @@ } else if (revertObj.Code == StateCode.PasswrodError) { - UserInfo.Current.LastTime = DateTime.MinValue; + UserInfo.Current.ValidToken = false; } #if __IOS__ else if (revertObj.Code == "10001") @@ -190,7 +190,6 @@ if (canRefresh) { UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken); - //UserInfo.Current.AccessToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken); RefreshToken(false); } } diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index bac48c5..5882515 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -251,7 +251,7 @@ } else { - HDL_ON.Utlis.WriteLine($"鎺ュ彛寮傚父:{requestFullUrl} \r\n"+response.Content); + MainPage.Log("Error", $"鎺ュ彛寮傚父:{requestFullUrl} \r\n" + response.Content); if(response.Content!= null) { try @@ -270,7 +270,7 @@ } catch (Exception ex) { - HDL_ON.Utlis.WriteLine(ex.Message); + MainPage.Log("Error", $"鎺ュ彛寮傚父x锛歿ex.StackTrace}"); return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR ,message = Language.StringByID(StringId.FailedRequestServer) }; } @@ -330,7 +330,7 @@ UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken; UserInfo.Current.AccessToken = revertData.accessToken; UserInfo.Current.RefreshToken = revertData.refreshToken; - UserInfo.Current.LastTime = DateTime.Now; + UserInfo.Current.ValidToken = true; UserInfo.Current.SaveUserInfo(); #if __IOS__ var sdm = new SiriKit.SceneDateManager(); @@ -339,9 +339,9 @@ #endif return true; } - else if (revertObj.Code == StateCode.PasswrodError) + else //if (revertObj.Code == StateCode.PasswrodError) { - UserInfo.Current.LastTime = DateTime.MinValue; + UserInfo.Current.ValidToken = false; } return false; } 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/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs index d61b4b0..f734255 100644 --- a/HDL_ON/Entity/DB_ResidenceData.cs +++ b/HDL_ON/Entity/DB_ResidenceData.cs @@ -156,7 +156,7 @@ FunctionList.List.ClearDatas(); ///鍒囨崲浣忓畢娓呯┖鍓嶄綇瀹呯紦瀛樿嚜鍔ㄥ寲鍒楄〃锛� - HDL_ON.UI.UI2.Intelligence.Automation.Logic.LogicList.Clear(); + UI.UI2.Intelligence.Automation.Logic.LogicList.Clear(); DAL.Mqtt.MqttClient.DisConnectRemote("閫�鍑虹櫥褰曪紝鎴栬�呭垏鎹綇瀹�"); #if IOS diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 04b4104..15480d4 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -198,7 +198,7 @@ case SPK.HvacAirFreshJinmao: iconPath = "airFreshjinmao"; break; - case SPK.HvacAC: + case SPK.HvacAC:case SPK.HvacAcPanel: iconPath = "acstandard"; break; case SPK.HvacFan: @@ -677,10 +677,12 @@ collect = !collect; IMessageCommon.Current.ShowErrorInfoAlter(result); }); - } else + } + else { Application.RunOnMainThread(() => { + this.SaveFunctionFile(); UI.HomePage.RefreshFunctionView(); }); } @@ -1727,6 +1729,16 @@ public static class SPK { /// <summary> + /// 鏈煡SPK + /// (鑷畾涔�) + /// </summary> + public const string NULL = "NULL"; + /// <summary> + /// 瑗垮ⅷ鍙瀵硅闂ㄥ彛鏈� + /// (鑷畾涔�) + /// </summary> + public const string LinphoneXiMo = "door.gate"; + /// <summary> /// 缇ゆ帶锛堣嚜瀹氫箟锛� /// </summary> public const string GroupControl = "groupControl"; @@ -1932,6 +1944,10 @@ /// </summary> public const string HvacAC = "hvac.ac"; /// <summary> + /// 闈㈡澘绌鸿皟 + /// </summary> + public const string HvacAcPanel = "hvac.ac_panel"; + /// <summary> /// 姣涚粏绠$┖璋� /// </summaryc public const string HvacCac = "hvac.cac"; @@ -1945,6 +1961,7 @@ var spkList = new List<string>(); spkList.Add(AcStandard); spkList.Add(HvacAC); + spkList.Add(HvacAcPanel); spkList.Add(AcIr); spkList.Add(HvacCac); return spkList; diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs index 9b57845..585d39d 100644 --- a/HDL_ON/Entity/Function/Scene.cs +++ b/HDL_ON/Entity/Function/Scene.cs @@ -421,6 +421,10 @@ IMessageCommon.Current.ShowErrorInfoAlter(result); }); } + else + { + this.SaveSceneFile(); + } }) { IsBackground = true }.Start(); } diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index f9fb909..5e03b01 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -26,7 +26,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string VersionString = "2.6.0"; + public static string VersionString = "2.7.0"; ///// <summary> ///// 瀹㈡埛绔被鍨� ///// </summary> @@ -115,7 +115,7 @@ public static List<string> SceneSupportFunctionList = new List<string> { SPK.LightCCT,SPK.LightDimming,SPK.LightSwitch,SPK.LightRGB, SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex,SPK.CurtainDream, - SPK.AcIr,SPK.AcStandard,SPK.HvacAC, + SPK.AcIr,SPK.AcStandard,SPK.HvacAC,SPK.HvacAcPanel, SPK.FloorHeatStandard,SPK.HvacFloorHeat,SPK.HvacFloorHeatPanel, SPK.AirFreshStandard,SPK.HvacAirFresh, SPK.AirSwitch, @@ -170,51 +170,29 @@ BaseView = Application.MainPage; Application.MainPage.BackgroundColor = CSS_Color.MainBackgroundColor; - //Application.MainPage.BackgroundColor = 0xFFFF0000;// CSS_Color.MainBackgroundColor; - //BaseView = new FrameLayout() - //{ - // Y = Application.GetRealHeight(20), - // Width = Application.GetRealWidth(376), - // Height = Application.GetRealHeight(667), - //}; - //Application.MainPage.AddChidren(BaseView); Language.UpdateLanguage(); - //#region 娴嬭瘯 - //var ddd = new UI.test.TestDialog(); - //ddd.InitView(); - //return; - //#endregion if (string.IsNullOrEmpty(OnAppConfig.Instance.LastLoginUserId)) { - GoLoginPage(); + GoLoginPage(UserInfo.Current); } else { //鍒ゆ柇闇�涓嶉渶瑕佺櫥褰曪紝鏈夋病鏈夌櫥褰曪紝鎴栬�呯櫥褰曟槸鍚﹁繃鏈燂紝 - if (UserInfo.Current == null || !UserInfo.Current.IsLogin) + if (UserInfo.Current == null)// || !UserInfo.Current.IsLogin) { GoLoginPage(UserInfo.Current); } else { - //new System.Threading.Thread(() => - //{ - // var pm = new DAL.Server.HttpServerRequest(); - // pm.RefreshToken();//鍒锋柊Token - // pm.GetHomePager();//鍒锋柊浣忓畢淇℃伅 - // pm.GetUserInfo();//鍒锋柊涓汉淇℃伅 - //}) - //{ IsBackground = true }.Start(); Common.ApiUtlis.Ins.DownloadData(); - GoUserPage(false, true); } } } catch (Exception ex) { - Log("root erorr : " + ex.Message); + Log("Error", "root erorr : " + ex.StackTrace); } finally { @@ -238,36 +216,6 @@ } -//#if __ANDROID__ -// new System.Threading.Thread(async () => -// { -// int i = 10; -// while (i < 10) { -// try -// { -// var location_android = await HDL_ON_Android.LocationUtils.GetCurrentLocationAsync(); -// if (location_android != null) -// { -// MainPage.cityInfo.lat = location_android.Latitude.ToString(); -// MainPage.cityInfo.lon = location_android.Longitude.ToString(); -// new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(MainPage.cityInfo.lon.Replace(",", "."), MainPage.cityInfo.lat.ToString().Replace(",", ".")); -// i = 100; -// Application.RunOnMainThread(() => { -// HomePage.LoadEvent_RefreshAir(); -// }); -// } -// else -// { -// i++; -// } -// } catch (Exception ex) -// { -// Log($"缁忕含搴﹁幏鍙栧紓甯�: {ex.Message}"); -// } -// } -// }) -// { IsBackground = true }.Start(); -//#endif } /// <summary> @@ -283,6 +231,8 @@ } } catch { } + OnAppConfig.Instance.LastLoginUserId = ""; + UserInfo.Current.ClearUserInfo(); BaseView.BackgroundColor = CSS_Color.BackgroundColor; var fisrtView = new UI.UI1Login.LoginPage(); fisrtView.BackgroundColor = CSS_Color.MainBackgroundColor; diff --git a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs index ef20fb3..5ac7e29 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs @@ -244,13 +244,19 @@ { TipOptionMsg(titleId, Language.StringByID(msgId), callBackAction); } + + public void TipOptionMsg(int titleId, int msgId,int cancelTextId,int confrimTextId, Action callBackAction) + { + TipOptionMsg(titleId, Language.StringByID(msgId), callBackAction, 0,cancelTextId, confrimTextId); + } + /// <summary> /// 鍔犺浇鎻愮ず寮圭獥 /// </summary> /// <param name="titleId"></param> /// <param name="msgId"></param> /// <param name="callBackAction"></param> - public void TipOptionMsg(int titleId, string msg, Action callBackAction,int extraHeight = 0) + public void TipOptionMsg(int titleId, string msg, Action callBackAction,int extraHeight = 0, int cancelTextId = StringId.Cancel, int confrimTextId = StringId.Confirm) { Dialog dialog = new Dialog() { @@ -314,7 +320,7 @@ TextSize = CSS_FontSize.SubheadingFontSize, //SelectedTextColor = CSS_Color.MainBackgroundColor, //SelectedBackgroundColor = CSS_Color.MainColor, - TextID = StringId.Cancel, + TextID = cancelTextId, }; contentView.AddChidren(btnCancel); @@ -329,7 +335,7 @@ TextSize = CSS_FontSize.SubheadingFontSize, TextColor = CSS_Color.MainBackgroundColor, BackgroundColor = CSS_Color.MainColor, - TextID = StringId.Confirm, + TextID = confrimTextId, }; contentView.AddChidren(btnConfirm); //渚嬶細鍙充笅鍦嗚 澶у皬涓�50 diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs index 49f5304..ca78386 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs @@ -227,7 +227,7 @@ break; case SPK.AcIr: case SPK.AcStandard: - case SPK.HvacAC: + case SPK.HvacAC:case SPK.HvacAcPanel: var acPage = new AcControlPage(); acPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); break; diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs index a98c233..e20186f 100644 --- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs +++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs @@ -228,31 +228,6 @@ }; } - public void LoadTopView_Linphone() - { - LoadTopView(); - - var btnSetting = new Button() - { - X = Application.GetRealWidth(337), - Y = Application.GetRealHeight(28 + maginY), - Width = Application.GetMinRealAverage(32), - Height = Application.GetMinRealAverage(32), - UnSelectedImagePath = "Public/FuncInfoSetIcon.png", - }; - contentView.AddChidren(btnSetting); - - btnSetting.MouseUpEventHandler = (sender, e) => - { - var infoView = new FunctionBaseInfoSetPage(); - MainPage.BasePageView.AddChidren(infoView); - infoView.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - } - - - /// <summary> /// 鎴块棿鏍囬鍖哄煙 /// </summary> diff --git a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs index 2ba65dc..e319bfa 100644 --- a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs +++ b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs @@ -20,11 +20,11 @@ /// <summary> /// 杩涘害鏉� /// </summary> - private NormalViewControl btnProgress = null; + public NormalViewControl btnProgress = null; /// <summary> /// 鍥炬爣鎺т欢 /// </summary> - private IconViewControl btnIcon = null; + public IconViewControl btnIcon = null; #endregion @@ -91,12 +91,14 @@ //鍙樼孩鑹� this.btnProgress.BackgroundColor = 0xfff62f48; this.btnIcon.UnSelectedImagePath = "Public/BatteryNot.png"; + this.btnIcon.SelectedImagePath = "Public/BatteryNot.png"; } else { //鍙樼伆鑹� this.btnProgress.BackgroundColor = CSS_Color.PromptingColor1; this.btnIcon.UnSelectedImagePath = "Public/BatteryEnough.png"; + this.btnIcon.SelectedImagePath = "Public/BatteryEnough.png"; } } diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index 0800f63..320356d 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -291,13 +291,8 @@ }; bool b = false; - btnIcon.MouseUpEventHandler += (sender, e) => + btnIcon.MouseUpEventHandler = (sender, e) => { - - - //ESOnVideo.Current.Test(false); - - //return; if (b) { //etAccount.Text = "18022428438";//wjc @@ -308,7 +303,6 @@ //etAccount.Text = "455740454@qq.com"; //etAccount.Text = "13288623489";//缃楁檽涓� //etAccount.Text = "18688414428";//澶╂渤3妤� - //etAccount.Text = "pjh@hdlchina.com.cn"; //etAccount.Text = "12345678904";//2.0 娴嬭瘯 钀ょ煶 //etAccount.Text = "1272061968@qq.com";//涓囩鍩庡競涔嬪厜E鍖�8鏍�206 //etAccount.Text = "marketing@australindo.co.id"; @@ -317,10 +311,12 @@ etAccount.Text = "13336018868"; etAccount.Text = "649362315@qq.com";//钄℃窇濞� //etAccount.Text = "18402017839"; - //etAccount.Text = "18620993214"; //etAccount.Text = "13414984501";//鍚存檽鑱� + etAccount.Text = "13682244600"; + etAccount.Text = "pjh@hdlchina.com.cn"; etAccount.Text = "13580507523"; etAccount.Text = "18475593023"; + //etAccount.Text = "13960905167"; } else { @@ -337,11 +333,12 @@ etAccount.Text = "15626203746"; } + //etAccount.Text = "13580507523"; b = !b; etPassword.Text = "123456"; - if (etAccount.Text == "18620993214") + if (etAccount.Text == "13682244600") { - etPassword.Text = "hdl1985."; + etPassword.Text = "asd123456789123"; } else if (etAccount.Text == "18475593023") { diff --git a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs index 096ad5c..46c3048 100644 --- a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs @@ -648,24 +648,6 @@ var getResidencesResult = LoadMethod_GetResidences(); if (getResidencesResult) { - /* - * Wait : 鎺ㄩ�佹敞鍐� - */ - - /* - * 鏌ョ湅鏈湴鏄惁瀛樺湪鏁版嵁 - * 瀛樺湪鍒欏鍑� - */ - //var isExis = FileUtils.IsExisFolder(DB_ResidenceData.residenceData.CurReginID); - //if (isExis) - //{ - // FileUtils.DeleteAllFile(); - // string regionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID); - // FileUtils.RestoreRegionFiles(regionRootPath); - // DB_ResidenceData.residenceData.EixtAccount(); - // OnAppConfig.Instance.RefreshUserConfig(); - // SpatialInfo.CurrentSpatial.InitRoomFunction(); - //} Application.RunOnMainThread(() => { //20201223-鐧诲綍鎴愬姛涔嬪悗锛屽皢涓嬭浇鏁版嵁瀹屾垚鏍囪鏍囪涓篺alse锛岄槻姝富椤垫彁鍓嶅姞杞� @@ -677,18 +659,9 @@ } else { - //Application.RunOnMainThread(() => - //{ - // BindingResidencePage page = new BindingResidencePage(); - // MainPage.BaseView.AddChidren(page); - // page.LoadView(); - //}); - - - //2020-11-13 寰呯‘璁� //鑾峰彇浣忓畢澶辫触锛岄噸鏂版爣璁颁负鏈櫥褰曠姸鎬� - UserInfo.Current.LastTime = DateTime.MinValue; + UserInfo.Current.ValidToken = false; UserInfo.Current.SaveUserInfo(); //鐧诲綍澶辫触锛岃鍏堟坊鍔犱綇瀹咃紒 //Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList)); @@ -740,17 +713,6 @@ if (loginResult.Code == StateCode.SUCCESS) { var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString()); - // UserInfo.Current = new UserInfo - //{ - // userType = revertData.userType, - // accountString = account, - // password = password, - // lastTime = DateTime.Now, - // ID = revertData.userId, - // loginTokenString = revertData.headerPrefix + revertData.accessToken, - // refreshToken = revertData.refreshToken, - // userName = revertData.name - //}; if (OnAppConfig.Instance.LastLoginUserId != revertData.userId) { OnAppConfig.Instance.LastLoginUserId = revertData.userId; @@ -759,17 +721,12 @@ UserInfo.Current.ClearUserInfo(); UserInfo.Current.userType = revertData.userType; UserInfo.Current.AccountString = account; - //UserInfo.Current.password = password; - UserInfo.Current.LastTime = DateTime.Now; + UserInfo.Current.ValidToken = true; UserInfo.Current.ID = revertData.userId; UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken; UserInfo.Current.AccessToken = revertData.accessToken; UserInfo.Current.RefreshToken = revertData.refreshToken; UserInfo.Current.userName = revertData.name; - //UserInfo.Current.userMobileInfo = "";//閲嶇疆鐢ㄦ埛鎵嬫満 - //UserInfo.Current.userEmailInfo = "";//閲嶇疆鐢ㄦ埛閭 - //UserInfo.Current.headImagePagePath = "LoginIcon/2.png";// - //UserInfo.Current.CurrentRegion.RegionID = ""; UserInfo.Current.SaveUserInfo(); MainPage.Log("鐧诲綍鎴愬姛銆�"); #if __IOS__ diff --git a/HDL_ON/UI/UI1-Login/RegisterPage.cs b/HDL_ON/UI/UI1-Login/RegisterPage.cs index 8bcf14a..69c1291 100644 --- a/HDL_ON/UI/UI1-Login/RegisterPage.cs +++ b/HDL_ON/UI/UI1-Login/RegisterPage.cs @@ -245,6 +245,8 @@ { OnAppConfig.Instance.GlobalRegion.regionUrl = ""; } + getServerList(); + }catch(Exception ex) { MainPage.Log("Error", "杩涘叆娉ㄥ唽鐣岄潰AppConfig寮傚父锛�" + ex.Message); @@ -271,8 +273,7 @@ Application.HideSoftInput(); }; - new TopViewDiv(this, bodyView, Language.StringByID(StringId.Register)).LoadTopView(backAction); - //new PublicAssmebly().LoadTopView(this, bodyView, Language.StringByID(StringId.Register)); + new TopViewDiv(this, bodyView, Language.StringByID(StringId.Register)) { maginY = 10 }.LoadTopView(backAction); #region 娉ㄥ唽鏂瑰紡閫夋嫨 btnPhoneLogin = new Button() @@ -758,10 +759,7 @@ Thread.Sleep(1500); Application.RunOnMainThread(() => { - ////鍒涘缓鐧诲綍绾跨▼ - //var loginThread = LoadThread_Login(account, password); - //waitPage = new Loading(); - //new PublicAssmebly().LoadPage_WaitPage(loginThread, bodyView, waitPage); + //鍒涘缓鐧诲綍绾跨▼ dialog.Close(); var isPhone = registerType == 0; @@ -771,117 +769,5 @@ { IsBackground = true }.Start(); } - //#region 鐧诲綍绾跨▼閮ㄥ垎 - ///// <summary> - ///// 鍔犺浇鐧诲綍绾跨▼ - ///// </summary> - //Thread LoadThread_Login(string account,string password) - //{ - // var loginThread = new Thread(() => - // { - // try - // { - // //鐧诲綍 - // var loginResult = LoadMethod_Login(account,password); - // if (loginResult) - // { - // //鑾峰彇浣忓畢淇℃伅 - // var getResidencesResult = LoadMethod_GetResidences(); - // if (getResidencesResult) - // { - // /* - // * Wait : 鎺ㄩ�佹敞鍐� - // */ - - // Application.RunOnMainThread(() => - // { - // waitPage.RemoveFromParent(); - // waitPage = null; - - // //璺宠浆椤甸潰---- - // MainPage.GoUserPage(); - // }); - // } - // } - // } - // catch (Exception ex) - // { - // MainPage.Log($"LoginPage : {ex.Message}"); - // } - // }) - // { IsBackground = true }; - // return loginThread; - //} - - ///// <summary> - ///// 璋冪敤鐧诲綍鎺ュ彛鐧诲綍 - ///// </summary> - //bool LoadMethod_Login(string account, string password) - //{ - // var result = false; - // //璋冪敤鐧诲綍鎺ュ彛 - // var loginResult = pm.LoginByPassword(account, password); - // if (loginResult.Code == StateCode.SUCCESS) - // { - // var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString()); - // // UserInfo.Current = new UserInfo - // //{ - // // userType = revertData.userType, - // // accountString = account, - // // password = password, - // // lastTime = DateTime.Now, - // // ID = revertData.userId, - // // loginTokenString = revertData.headerPrefix + revertData.accessToken, - // // refreshToken = revertData.refreshToken, - // // userName = revertData.name - // //}; - // UserInfo.Current.userType = revertData.userType; - // UserInfo.Current.AccountString = account; - // //UserInfo.Current.password = password; - // UserInfo.Current.LastTime = DateTime.Now; - // UserInfo.Current.ID = revertData.userId; - // UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken; - // UserInfo.Current.RefreshToken = revertData.refreshToken; - // UserInfo.Current.userName = revertData.name; - - // UserInfo.Current.SaveUserInfo(); - // MainPage.Log("鐧诲綍鎴愬姛銆�"); - // result = true; - // } - // else - // { - // //鐧诲綍澶辫触 - // IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code); - // Application.RunOnMainThread(() => - // { - // btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; - // btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); - // }); - // } - // return result; - //} - - ///// <summary> - ///// 鑾峰彇浣忓畢鍒楄〃 - ///// </summary> - //bool LoadMethod_GetResidences() - //{ - // var result = false; - // var responsePack = pm.GetHomePager(); - // if (responsePack == StateCode.SUCCESS) - // { - // //2020-11-13 寰呯‘璁わ紝娌℃湁浣忓畢锛屼笉绠楃櫥褰曟垚鍔� - // if (UserInfo.Current.regionList != null && UserInfo.Current.regionList.Count > 0) - // { - // result = true; - // } - // } - // else - // { - // IMessageCommon.Current.ShowErrorInfoAlter(responsePack); - // } - // return result; - //} - //#endregion } } \ No newline at end of file diff --git a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs index cb6abf2..d055779 100644 --- a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs @@ -1,14 +1,20 @@ 锘縰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 { public partial class RegisterPage { + + List<GlobalRegionListRes> serverList; + /// <summary> /// 鍔犺浇浜嬩欢鍒楄〃 /// </summary> @@ -760,5 +766,100 @@ } return true; } + + + /// <summary> + /// 鑾峰彇鏈嶅姟鍣ㄥ垪琛� + /// </summary> + void getServerList() + { + var waitPage = new Loading(); + bodyView.AddChidren(waitPage); + waitPage.Start(Language.StringByID(StringId.PleaseWait)); + + + System.Threading.Tasks.Task.Run(() => { + try + { + //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); + if (revertObj.Code == StateCode.SUCCESS) + { + Application.RunOnMainThread(() => + { + var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GlobalRegionListRes>>(revertObj.Data.ToString()); + if (responseDataObj != null) + { + serverList = responseDataObj; + if (serverList.Count > 0) + { + if (Language.CurrentLanguage == "Chinese")//if (country == "CN")// + { + var server = serverList.Find((obj) => obj.regionUrl.Contains("china-gateway")); + if (server != null) + { + OnAppConfig.Instance.GlobalRegion = server; + SetServerText(); + } + } + else + { + var server = serverList.Find((obj) => obj.regionUrl.Contains("bahrain-gateway")); + if (server != null) + { + OnAppConfig.Instance.GlobalRegion = server; + SetServerText(); + } + } + } + } + }); + } + else + { + //鎻愮ず閿欒 + IMessageCommon.Current.ShowErrorInfoAlter(revertObj.Code); + } + } + catch (Exception ex) + { + MainPage.Log("Error", $"鑾峰彇鏈嶅姟鍣ㄥ紓甯革細{ex.StackTrace}"); + } + finally + { + Application.RunOnMainThread(() => + { + if (waitPage != null) + { + waitPage.RemoveFromParent(); + waitPage = null; + } + }); + } + }); + + } } } \ No newline at end of file diff --git a/HDL_ON/UI/UI1-Login/SelectServerDialog.cs b/HDL_ON/UI/UI1-Login/SelectServerDialog.cs index 6d71973..671d5b8 100644 --- a/HDL_ON/UI/UI1-Login/SelectServerDialog.cs +++ b/HDL_ON/UI/UI1-Login/SelectServerDialog.cs @@ -44,7 +44,7 @@ bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; this.AddChidren(bodyView); //鍔犺浇椤堕儴鑿滃崟鏍� - new TopViewDiv(this, bodyView, Language.StringByID(StringId.PlsSelectServer)).LoadTopView(); + new TopViewDiv(this, bodyView, Language.StringByID(StringId.PlsSelectServer)) { maginY = 10}.LoadTopView(); //鍔犺浇鏈嶅姟鍣ㄥ尯鍩熼�夋嫨 AddRegionalSelectionView(); //Show @@ -60,8 +60,8 @@ VerticalScrolViewLayout VerticalScrolViewMiddle = new VerticalScrolViewLayout() { - Y = Application.GetRealHeight(74), - Height = bodyView.Height - Application.GetRealHeight(74), + Y = Application.GetRealHeight(84), + Height = bodyView.Height - Application.GetRealHeight(84), ScrollEnabled = false, }; bodyView.AddChidren(VerticalScrolViewMiddle); @@ -125,35 +125,6 @@ } }); - //var bottomView = new FrameLayout() - //{ - // Y = Application.GetRealHeight(591), - // Height = Application.GetRealHeight(76) + Application.GetRealWidth(44), - // Radius = (uint)Application.GetRealWidth(22), - // BackgroundColor = CSS_Color.MainBackgroundColor, - //}; - //bodyView.AddChidren(bottomView); - - - //btnConfrim = new Button() - //{ - // Gravity = Gravity.CenterHorizontal, - // Y = Application.GetRealHeight(603), - // Width = Application.GetRealWidth(220), - // Height = Application.GetRealWidth(44), - // Radius = (uint)Application.GetRealWidth(22), - // BackgroundColor = CSS_Color.MainColor, - // TextColor = CSS_Color.MainBackgroundColor, - // TextSize = CSS_FontSize.SubheadingFontSize, - // TextAlignment = TextAlignment.Center, - // IsBold = true, - // TextID = StringId.ConfirmAdd, - //}; - //bodyView.AddChidren(btnConfrim); - - //btnConfrim.MouseUpEventHandler = (sender, e) => { - - //}; } /// <summary> diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index dbe2dc1..7bded39 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Collections.Generic; +using HDL_ON.Common; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; @@ -24,7 +25,11 @@ /// <summary> /// 杩炴帴鐘舵�佹彁绀� /// </summary> - FrameLayout divLinkStateTip; + FrameLayout linkStateMsgView; + /// <summary> + /// 鐧诲綍鐘舵�佹彁绀哄尯鍩� + /// </summary> + FrameLayout tokenInvalidMsgView; /// <summary> /// 瀹夐槻鐘舵�佸浘鏍� /// </summary> @@ -159,14 +164,14 @@ }; topView = new FrameLayout() { - Height = Application.GetRealHeight(113),//216), + Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216), BackgroundImagePath = DB_ResidenceData.Instance.residenceImage, }; bodyView.AddChidren(topView); #else VerticalRefreshLayout refreshLayout = new VerticalRefreshLayout() { - Height = Application.GetRealHeight(113),//216), + Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216), BackgroundImagePath = DB_ResidenceData.Instance.residenceImage, }; bodyView.AddChidren(refreshLayout); @@ -179,20 +184,21 @@ }; topView = new FrameLayout() { - Height = Application.GetRealHeight(113),//216), + Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216), }; refreshLayout.AddChidren(topView); #endif - #region topView - - - - Button btnTop; - btnTop = new Button() + topView.AddChidren(new Button() { BackgroundColor = CSS_Color.DialogTransparentColor2, - }; - topView.AddChidren(btnTop); + }); + + topView.AddChidren( + new Button() {Y = Application.GetRealHeight(113), + BackgroundColor = CSS_Color.BackgroundColor, + Height = Application.GetRealWidth(24) }); + + #region topView btnResidenceName = new Button() { @@ -207,15 +213,19 @@ IsBold = true }; topView.AddChidren(btnResidenceName); + //鐧诲綍鍑瘉鏄惁鏈夋晥 + CheckTokenValid(); - divLinkStateTip = new FrameLayout() + #region 缃戝叧杩炴帴鐘舵�� + linkStateMsgView = new FrameLayout() { - Y = Application.GetRealHeight(113) - Application.GetRealWidth(24), + Y = ApiUtlis.Ins.IsValidToken ? Application.GetRealHeight(113) : Application.GetRealHeight(113) - Application.GetRealWidth(24), Height = Application.GetRealWidth(24), BackgroundColor = 0xFFFF4747, Visible = false, }; - topView.AddChidren(divLinkStateTip); + topView.AddChidren(linkStateMsgView); + Button btnLinkStateIcon = new Button() { X = Application.GetRealWidth(16), @@ -224,7 +234,7 @@ Height = Application.GetRealWidth(20), UnSelectedImagePath = "Collection/GatewayOnlineTipIcon.png" }; - divLinkStateTip.AddChidren(btnLinkStateIcon); + linkStateMsgView.AddChidren(btnLinkStateIcon); var btnLinkStateTip = new Button() { @@ -234,15 +244,18 @@ TextColor = CSS_Color.MainBackgroundColor, TextID = StringId.NetworkAnomaly, }; - divLinkStateTip.AddChidren(btnLinkStateTip); + linkStateMsgView.AddChidren(btnLinkStateTip); + //鏇存柊閾炬帴鐘舵�乮con棰滆壊 + CheckLinkStatus();//2020-12-22 + #endregion + environmentalView = new FrameLayout() { Y = Application.GetRealHeight(1) + btnResidenceName.Bottom, Height = Application.GetRealHeight(32), }; topView.AddChidren(environmentalView); - CheckLinkStatus();//2020-12-22 #region 鐜鏁版嵁 var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); @@ -535,7 +548,7 @@ #region 鍔熻兘鍦烘櫙鍒囨崲 - bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0x00000000 }); + //bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0xFFFF0000 }); loadNavView(); @@ -553,10 +566,7 @@ #if DEBUG btnResidenceName.MouseUpEventHandler = (envent, ee) => { - MainPage.Log("sss"); - #if __ANDROID__ - //HDLLinphoneKit.Instance.MediaPlayerLooping(true); Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone(); #elif __IOS__ @@ -996,10 +1006,10 @@ // continue; //} //else - { - if (!function.collect&& function.spk != SPK.InverterJinmao) - continue; - } + //{ + if (!function.collect&& function.spk != SPK.InverterJinmao) + continue; + //} if (index % 2 == 0) { rowView = new FrameLayout() diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs index d47510b..53cd5a5 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs @@ -1,8 +1,10 @@ 锘縰sing System; using System.Collections.Generic; +using HDL_ON.Common; using HDL_ON.DAL.Server; using HDL_ON.DriverLayer; using HDL_ON.Entity; +using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI @@ -254,7 +256,89 @@ } } + void CheckTokenValid() + { + //Dome妯″紡 + if (MainPage.NoLoginMode) + { + return; + } + try + { + #region 璐﹀彿鐧诲綍鐘舵�侊紙鐧诲綍token鏄惁鏈夋晥锛� + if (ApiUtlis.Ins.IsValidToken) + { + if (tokenInvalidMsgView == null) + { + tokenInvalidMsgView = new FrameLayout() + { + Y = Application.GetRealHeight(113) - Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), + BackgroundColor = 0xFF69A0F7, + }; + topView.AddChidren(tokenInvalidMsgView); + + Button btnTokenInvalidIcon = new Button() + { + X = Application.GetRealWidth(16), + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(20), + Height = Application.GetRealWidth(20), + UnSelectedImagePath = "Collection/TokenInvalidTipIcon.png" + }; + tokenInvalidMsgView.AddChidren(btnTokenInvalidIcon); + var btnTokenInvalidTip = new Button() + { + X = btnTokenInvalidIcon.Right + Application.GetRealWidth(4), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextColor = CSS_Color.MainBackgroundColor, + TextID = StringId.TokenInvalidMsg, + }; + btnTokenInvalidTip.Width = btnTokenInvalidTip.GetTextWidth() + Application.GetRealWidth(8); + tokenInvalidMsgView.AddChidren(btnTokenInvalidTip); + btnTokenInvalidTip.MouseUpEventHandler = (sender, e) => { + new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TokenInvalidTipMsg,StringId.Cancel,StringId.GoLogin, () => { + HDLCommon.Current.Logout(); + }); + }; + + var btnRight = new Button() + { + X= btnTokenInvalidTip.Right, + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(8), + Height = Application.GetMinRealAverage(8), + UnSelectedImagePath = "Public/RightIcon2.png", + }; + + tokenInvalidMsgView.AddChidren(btnRight); + + } + } + else + { + if (tokenInvalidMsgView != null) + { + if (tokenInvalidMsgView.Parent != null) + { + tokenInvalidMsgView.RemoveAll(); + tokenInvalidMsgView.RemoveFromParent(); + tokenInvalidMsgView = null; + } + } + } + #endregion + if (bodyView.linkStateMsgView != null){ + bodyView.linkStateMsgView.Y = ApiUtlis.Ins.IsValidToken ? Application.GetRealHeight(113) : Application.GetRealHeight(113) - Application.GetRealWidth(24); + } + } + catch (Exception ex) + { + MainPage.Log("Error", $"HomePage 璐﹀彿鐧诲綍鐘舵�佷俊鎭樉绀哄紓甯�:{ex.StackTrace}"); + } + } /// <summary> /// 鏇存柊杩炴帴鐘舵�佸浘鏍� @@ -267,17 +351,15 @@ return; } + bodyView.linkStateMsgView.Y = ApiUtlis.Ins.IsValidToken ? Application.GetRealHeight(113) : Application.GetRealHeight(113) - Application.GetRealWidth(24); + if (!Control.Ins.GatewayOnline_Local && !Control.Ins.GatewayOnline_Cloud) { - bodyView.divLinkStateTip.Visible = true; + bodyView.linkStateMsgView.Visible = true; } - //else if () - //{ - // bodyView.divLinkStateTip.Visible = true; - //} else { - bodyView.divLinkStateTip.Visible = false; + bodyView.linkStateMsgView.Visible = false; } } @@ -300,6 +382,26 @@ } }); } + /// <summary> + /// 纭Token鏄惁鏈夋晥 + /// </summary> + public static void LoadEvent_CheckTokenValid() + { + Application.RunOnMainThread(() => + { + try + { + if (bodyView != null) + { + bodyView.CheckTokenValid(); + } + } + catch (Exception ex) + { + MainPage.Log("Error",$"LoadEvent_CheckTokenValid : {ex.StackTrace}"); + } + }); + } /// <summary> /// 鍔犺浇鍔熻兘鏀惰棌鎸夐挳浜嬩欢 diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index bf4e54f..841d748 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -752,7 +752,10 @@ case ShowFunction.VideoIntercom: if (FunctionList.List.videoIntercom != null && FunctionList.List.videoIntercom.Count > 0) { - functionCount = 1; + if (Common.ApiUtlis.Ins.hadInternet) + { + functionCount = 1; + } } break; case ShowFunction.SecurityCenter: diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs index 7c6cfa8..89f04ba 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs @@ -405,6 +405,14 @@ { switch (functionCategory) { + case ShowFunction.FreshAir: + List<Function> faList = new List<Function>(); + foreach (var f in FunctionList.List.GetAirFreshList()) + { + faList.Add(f); + } + Control.Ins.SwtichFunctions(onoff == "on", faList); + break; case ShowFunction.AC: List<Function> acList = new List<Function>(); foreach(var f in FunctionList.List.GetAcList()) @@ -452,7 +460,7 @@ } catch (Exception ex) { - MainPage.Log($"{functionCategory}鍏ㄥ紑鍏ㄥ叧澶辫触:{ex.Message}"); + MainPage.Log("Error", $"{functionCategory}鍏ㄥ紑鍏ㄥ叧澶辫触:{ex.Message}"); } finally { diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs index 8da322e..60d7722 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs @@ -1,5 +1,6 @@ 锘縰sing System; using HDL_ON.Entity; +using HDL_ON.Stan; using HDL_ON.UI.CSS; using Shared; @@ -93,27 +94,38 @@ } else if (SPK.EvironmentSensorList().Contains(function.spk) || SPK.ArmSensorSpkList().Contains(function.spk)) //浼犳劅鍣ㄦ病鏈夊紑鍏虫寜閽�) { + //if(function.spk == SPK.SensorPir || function.spk == SPK.SensorWater) { } var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); - if (powerLowTipAttr != null) + if (powerLowTipAttr != null && !string.IsNullOrEmpty( powerLowTipAttr.state.ToString())) { - if (powerLowTipAttr.state.ToLower() == "low") + //鐢垫睜鎺т欢銆� + Button btnTipPowerLow = new Button() { - Button btnTipPowerLow = new Button() - { - X = Application.GetRealWidth(307), - Y = Application.GetRealHeight(45), - Width = Application.GetRealWidth(24), - Height = Application.GetRealWidth(24), - UnSelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", - SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", - }; - this.AddChidren(btnTipPowerLow); - } + X = Application.GetRealWidth(307), + Y = Application.GetRealHeight(45), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), + UnSelectedImagePath = "FunctionIcon/ArmSensor/Power80pIcon.png", + SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", + IsSelected = powerLowTipAttr.state.ToLower() == "low" + }; + this.AddChidren(btnTipPowerLow); + + //var batteryControl = new BatteryPersentControl(); + //batteryControl.X = Application.GetRealWidth(107); + //batteryControl.Y = Application.GetRealHeight(45); + //batteryControl.InitControl(); + //this.AddChidren(batteryControl); + //batteryControl.SetValue(80); + //if (powerLowTipAttr.state.ToLower() == "low") + //{ + // batteryControl.SetValue(20); + //} + //batteryControl.btnIcon.Visible = true; + //batteryControl.btnIcon.BackgroundColor = 0x88008800; } - - - else if (function.spk == SPK.SenesorMegahealth || function.spk == SPK.SensorMmvPose ) + else if (function.spk == SPK.SenesorMegahealth || function.spk == SPK.SensorMmvPose) { var btnStatus = new Button() { @@ -127,8 +139,6 @@ Tag = function.sid + "_SenesorMegahealth_Status" }; bodyDiv.AddChidren(btnStatus); - - var tempStatus = function.attributes.Find((sta) => sta.key == FunctionAttributeKey.TargetStatus); if (tempStatus != null) @@ -207,7 +217,7 @@ bodyDiv.AddChidren(btnStatus); var alarm_status = function.attributes.Find((sta) => sta.key == FunctionAttributeKey.AlarmStatus); - if(alarm_status!= null) + if (alarm_status != null) { if (alarm_status.curValue.ToString() == "normal") { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index 55a905f..460c087 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -99,7 +99,7 @@ case SPK.CurtainTrietex: //绌鸿皟 case SPK.AcStandard: - case SPK.HvacAC: + case SPK.HvacAC:case SPK.HvacAcPanel: case SPK.AcIr: //鍦扮儹 case SPK.FloorHeatStandard: diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index ea5c8f9..d56eb68 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -161,7 +161,7 @@ case SPK.CurtainTrietex: //绌鸿皟 case SPK.AcStandard: - case SPK.HvacAC: + case SPK.HvacAC:case SPK.HvacAcPanel: case SPK.AcIr: //鍦扮儹 case SPK.HvacFloorHeat:case SPK.HvacFloorHeatPanel: @@ -1259,7 +1259,7 @@ } break; case SPK.AcStandard: - case SPK.HvacAC: + case SPK.HvacAC:case SPK.HvacAcPanel: case SPK.AcIr: { string on_off = GetKeyValue("on_off", dicList); @@ -1946,7 +1946,7 @@ } break; - case SPK.AcStandard: + case SPK.AcStandard:case SPK.HvacAcPanel: case SPK.HvacAC: case SPK.AcIr: { @@ -2688,7 +2688,7 @@ } } break; - case SPK.AcStandard: + case SPK.AcStandard:case SPK.HvacAcPanel: case SPK.HvacAC: case SPK.AcIr: case SPK.FloorHeatStandard:case SPK.HvacFloorHeatPanel: diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 9f3f1d2..18d4a41 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -418,7 +418,7 @@ deviceStrTypeList.Add(Language.StringByID(StringId.Curtain)); } ///绌鸿皟绫� - var ac = deviceList.Find((device) => device.spk == SPK.AcStandard || device.spk == SPK.HvacAC|| device.spk == SPK.AcIr); + var ac = deviceList.Find((device) => device.spk == SPK.AcStandard || device.spk == SPK.HvacAC|| device.spk == SPK.AcIr || device.spk == SPK.HvacAcPanel); if (ac != null) { deviceStrTypeList.Add(Language.StringByID(StringId.AC)); @@ -552,7 +552,7 @@ else if (deviceType == Language.StringByID(StringId.AC)) { functionTypeList.Add(SPK.AcStandard); - functionTypeList.Add(SPK.HvacAC); + functionTypeList.Add(SPK.HvacAC); functionTypeList.Add(SPK.HvacAcPanel); functionTypeList.Add(SPK.HvacCac); functionTypeList.Add(SPK.AcIr); } @@ -648,7 +648,7 @@ functionTypeList.Add(SPK.CurtainRoller); functionTypeList.Add(SPK.CurtainTrietex); functionTypeList.Add(SPK.AcStandard); - functionTypeList.Add(SPK.HvacAC); + functionTypeList.Add(SPK.HvacAC); functionTypeList.Add(SPK.HvacAcPanel); functionTypeList.Add(SPK.AcIr); functionTypeList.Add(SPK.FloorHeatStandard); functionTypeList.Add(SPK.HvacFloorHeat); functionTypeList.Add(SPK.HvacFloorHeatPanel); @@ -720,7 +720,7 @@ deviceTypeList.Add(SPK.CurtainSwitch); deviceTypeList.Add(SPK.CurtainRoller); deviceTypeList.Add(SPK.CurtainTrietex); - deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC);deviceTypeList.Add(SPK.AcIr); + deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC);deviceTypeList.Add(SPK.AcIr); deviceTypeList.Add(SPK.HvacAcPanel); deviceTypeList.Add(SPK.AirFreshStandard); deviceTypeList.Add(SPK.HvacAirFresh); deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); deviceTypeList.Add(SPK.HvacFloorHeatPanel); deviceTypeList.Add(SPK.SensorSmoke); @@ -770,7 +770,7 @@ deviceTypeList.Add(SPK.CurtainSwitch); deviceTypeList.Add(SPK.CurtainRoller); deviceTypeList.Add(SPK.CurtainTrietex); - deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC); deviceTypeList.Add(SPK.AcIr); + deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC); deviceTypeList.Add(SPK.AcIr); deviceTypeList.Add(SPK.HvacAcPanel); deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); deviceTypeList.Add(SPK.HvacFloorHeatPanel); deviceTypeList.Add(SPK.AirFreshStandard); deviceTypeList.Add(SPK.HvacAirFresh); deviceTypeList.Add(SPK.AirSwitch); diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs index 62b146d..dbe83ef 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs @@ -54,8 +54,9 @@ //濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) { - RefreshToken(); - GetLogicIdList(isTip); + //RefreshToken(); + //GetLogicIdList(isTip); + return null; } if (Check(responsePackNew, isTip) == false) { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index 9575c4f..9db7d82 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -455,6 +455,7 @@ break; case SPK.AcStandard: case SPK.HvacAC: + case SPK.HvacAcPanel: case SPK.AcIr: { #region 鐣岄潰 @@ -910,6 +911,7 @@ } case SPK.HvacAC: case SPK.AcIr: + case SPK.HvacAcPanel: case SPK.AcStandard: case SPK.FloorHeatStandard: case SPK.HvacFloorHeat:case SPK.HvacFloorHeatPanel: diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs index f602898..67643d3 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs @@ -462,13 +462,23 @@ }; row.AddChidren(btnFunctionDelayInfo); - if (Convert.ToInt32(scenefunction.delay) > 0) + try { - btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText(); + int delayTime = 0; + int.TryParse(scenefunction.delay, out delayTime); + + if (!string.IsNullOrEmpty(scenefunction.delay) && delayTime > 0) + { + btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText(); + } + else + { + btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay); + } } - else + catch (Exception ex) { - btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay); + MainPage.Log("Error", $"鍦烘櫙缂栬緫锛岃浆璇戞暟鎹紓甯革細{ex.StackTrace}"); } var btnFunctionFloorAndRoom = new Button() diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs index a5020be..75f6c69 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs @@ -595,13 +595,23 @@ }; row.AddChidren(btnFunctionDelayInfo); - if (!string.IsNullOrEmpty(scenefunction.delay) && Convert.ToInt32(scenefunction.delay) > 0) + try { - btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText(); + int delayTime = 0; + int.TryParse(scenefunction.delay, out delayTime); + + if (!string.IsNullOrEmpty(scenefunction.delay) && delayTime > 0) + { + btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText(); + } + else + { + btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay); + } } - else + catch (Exception ex) { - btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay); + MainPage.Log("Error", $"鍦烘櫙缂栬緫锛岃浆璇戞暟鎹紓甯革細{ex.StackTrace}"); } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs index 5ca6120..bd57a2c 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs @@ -181,8 +181,6 @@ }; row.AddChidren(btnName); - - btnName.MouseUpEventHandler = (sender, e) => { switch (device.spk) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs index f54199f..1dfa8c2 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs @@ -109,11 +109,13 @@ bool isFrist = true; foreach (var brand in brandList) { - if(brand.productPlatform == "HaiLin")//瀛愭櫞闇�瑕侀殣钘忚繖涓叆鍙o紝鐢辫皟璇曡蒋浠朵笂浼犳暟鎹� 2023-03-09 17:20:33 + if (brand.productPlatform == "HaiLin")//瀛愭櫞闇�瑕侀殣钘忚繖涓叆鍙o紝鐢辫皟璇曡蒋浠朵笂浼犳暟鎹� 2023-03-09 17:20:33 { continue; - }else if(brand.productPlatform == "TUYA") { - if(DB_ResidenceData.Instance.CurrentRegion.regionUrl != "https://test-gz.hdlcontrol.com" && + } + else if (brand.productPlatform == "TUYA") + { + if (DB_ResidenceData.Instance.CurrentRegion.regionUrl != "https://test-gz.hdlcontrol.com" && DB_ResidenceData.Instance.CurrentRegion.regionUrl != "https://china-gateway.hdlcontrol.com") { continue; @@ -127,22 +129,16 @@ }; contentView.AddChidren(row); - //if (isFrist) - //{ - // isFrist = false; - //} - //else + + Button btnLine = new Button() { - Button btnLine = new Button() - { - Y = Application.GetRealHeight(86), - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(343), - Height = 1, - BackgroundColor = CSS_Color.DividingLineColor, - }; - row.AddChidren(btnLine); - } + Y = Application.GetRealHeight(86), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = 1, + BackgroundColor = CSS_Color.DividingLineColor, + }; + row.AddChidren(btnLine); ImageView btnIcon = new ImageView() { @@ -177,8 +173,8 @@ //涓嬭浇绗笁鏂瑰搧鐗宨con ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.brandIcon, btnIcon); - EventHandler<MouseEventArgs> eventHandler = (sender, e) => { - + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { var page = new DeviceListPage(brand); MainPage.BasePageView.AddChidren(page); page.LoadPage(); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs index 66da31c..114ddb0 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs @@ -23,7 +23,6 @@ brand = integratedBrand; } - public void LoadPage() { Action<string, string> action = (s, a) => @@ -67,7 +66,7 @@ { var pm = new HttpServerRequest(); var pack = pm.Get3TyBrandBindDeviceList(brand.productPlatform, brand.productBrand); - if (pack.Code == DAL.Server.StateCode.SUCCESS) + if (pack.Code == StateCode.SUCCESS) { var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<Function3tyBrandObj>(pack.Data.ToString()); @@ -117,10 +116,6 @@ bool isFrist = true; foreach (var device in deviceList) { - //if (!this.CheckSupportDevice(device)) - //{ - // continue; - //} var row = new RowLayout() { Height = Application.GetRealHeight(50), diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandListPage.cs index 46448a5..640aad8 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandListPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandListPage.cs @@ -26,8 +26,6 @@ public void LoadPage() { - - var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.Bind3thIotAccount)); topView.maginY = 10; topView.LoadTopView(CSS_Color.MainBackgroundColor); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs index 72e11f2..0a17a85 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs @@ -286,7 +286,6 @@ btnExit.MouseUpEventHandler = (sender, e) => { MainPage.NoLoginMode = false; - UserInfo.Current.ClearUserInfo(); HDLCommon.Current.Logout(); }; bodyView.AddChidren(btnExit); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs index 070c5c1..04ae455 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs @@ -443,7 +443,7 @@ userEmailInfoView.AddChidren(btnUserEmailRight); optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); #endregion -#region 涓汉閫夐」-鎵嬫満淇℃伅鍖哄煙 + #region 涓汉閫夐」-鎵嬫満淇℃伅鍖哄煙 /// <summary> /// 涓汉閫夐」-鎵嬫満淇℃伅鍖哄煙 /// </summary> @@ -558,11 +558,11 @@ resetPasswordView.AddChidren(btnResetPasswordRight); optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); #endregion - + #region 涓汉閫夐」-娣诲姞浣忓畢 addResidenceView = new FrameLayout() { - Height = Application.GetRealHeight(50), + Height = Application.GetRealHeight(50), }; optionListView.AddChidren(addResidenceView); btnAddResidenceScan = new Button() @@ -710,58 +710,6 @@ Height = Application.GetRealHeight(8) }; bodyScrolView.AddChidren(topPaddingView2); - -#region 瑙i攣璁剧疆鍖哄煙 - ///// <summary> - ///// 瑙i攣璁剧疆鍖哄煙 - ///// </summary> - //interpretationSettingsView = new FrameLayout() - //{ - // BackgroundColor = CSS_Color.MainBackgroundColor, - // Height = Application.GetRealHeight(70), - //}; - //bodyScrolView.AddChidren(interpretationSettingsView); - //if(Language.CurrentLanguage != "Chinese") - //{ - // interpretationSettingsView.Height = Application.GetRealHeight(80); - //} - - //btnInterpretationSettingsTitle = new Button() - //{ - // X = Application.GetRealWidth(16), - // Height = Application.GetRealHeight(32), - // TextAlignment = TextAlignment.BottomLeft, - // TextColor = CSS_Color.FirstLevelTitleColor, - // TextSize = CSS_FontSize.SubheadingFontSize, - // TextID = StringId.InterpretationSettings, - //}; - //interpretationSettingsView.AddChidren(btnInterpretationSettingsTitle); - - //btnInterpretationSettingsTip = new Button() - //{ - // X = Application.GetRealWidth(16), - // Y = btnInterpretationSettingsTitle.Bottom, - // Height = Application.GetRealHeight(32), - // Width = Application.GetRealWidth(310), - // TextAlignment = TextAlignment.TopLeft, - // TextColor = CSS_Color.PromptingColor1, - // TextSize = CSS_FontSize.TextFontSize, - // TextID = StringId.AppUnlockSettingsTip, - // IsMoreLines = true, - //}; - //interpretationSettingsView.AddChidren(btnInterpretationSettingsTip); - - //btnInterpretationSettingsRight = new Button() - //{ - // X = Application.GetRealWidth(339), - // Gravity = Gravity.CenterVertical, - // Width = Application.GetMinRealAverage(16), - // Height = Application.GetMinRealAverage(16), - // UnSelectedImagePath = "Public/Right.png", - //}; - //interpretationSettingsView.AddChidren(btnInterpretationSettingsRight); - //interpretationSettingsView.AddChidren(new LineView(interpretationSettingsView.Height)); -#endregion #region 鏈嶅姟鍣ㄤ俊鎭� ListCellView myServerInfoCellView = new ListCellView() diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs index e84a5cb..706e841 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs @@ -420,7 +420,7 @@ } #endregion -#region 瑙i攣璁剧疆鍖哄煙 + #region 瑙i攣璁剧疆鍖哄煙 //void LoadEvent_SkipInterpretationSettings() //{ // EventHandler<MouseEventArgs> eventHandler = (sender, e) => diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs index 489d1a5..2a05647 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs @@ -1,462 +1,462 @@ -锘縰sing System; -using HDL_ON.UI.CSS; -using Shared; -using HDL_ON.DAL.Server; +锘�//using System; +//using HDL_ON.UI.CSS; +//using Shared; +//using HDL_ON.DAL.Server; -namespace HDL_ON.UI -{ - /// <summary> - /// 鎵嬪娍瑙i攣 - /// </summary> - public class AppUnlockGesturePage : FrameLayout - { - /// <summary> - /// - /// </summary> - FrameLayout bodyView; - /// <summary> - /// 閿欒鎻愮ず鎸夐挳 - /// </summary> - Button btnTipMsg; +//namespace HDL_ON.UI +//{ +// /// <summary> +// /// 鎵嬪娍瑙i攣 +// /// </summary> +// public class AppUnlockGesturePage : FrameLayout +// { +// /// <summary> +// /// +// /// </summary> +// FrameLayout bodyView; +// /// <summary> +// /// 閿欒鎻愮ず鎸夐挳 +// /// </summary> +// Button btnTipMsg; - string passwrod = ""; - string oldPasswrod = ""; - Action backAction; - public AppUnlockGesturePage(string pw, Action action) - { - bodyView = this; - bodyView.Tag = "unlockpage"; - oldPasswrod = pw; - backAction = action; - } +// string passwrod = ""; +// string oldPasswrod = ""; +// Action backAction; +// public AppUnlockGesturePage(string pw, Action action) +// { +// bodyView = this; +// bodyView.Tag = "unlockpage"; +// oldPasswrod = pw; +// backAction = action; +// } - /// <summary> - /// - /// </summary> - /// <param name="optionType"> - /// 鎿嶄綔鏂瑰紡锛� - /// 1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆; - /// 5:鍏抽棴鎸囩汗ID锛�6:鍏抽棴闈㈠ID;7:瑙i攣楠岃瘉 - /// </param> - public void LoadPage(string optionType) - { - bodyView.BackgroundColor = CSS_Color.BackgroundColor; - //瑙i攣楠岃瘉鏃犳硶鍚庨��锛屽繀椤婚獙璇� - if (optionType != "7") - { - if (oldPasswrod == "") - new TopViewDiv(bodyView, Language.StringByID(StringId.SetGesturePassword)).LoadTopView(); - else - new TopViewDiv(bodyView, Language.StringByID(StringId.VerifyGesturePassword)).LoadTopView(); - } - Button btnGestureIcon = new Button() - { - Y = Application.GetRealHeight(96), - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(64), - Height = Application.GetRealWidth(64), - //UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureGrayIcon.png", - }; - bodyView.AddChidren(btnGestureIcon); +// /// <summary> +// /// +// /// </summary> +// /// <param name="optionType"> +// /// 鎿嶄綔鏂瑰紡锛� +// /// 1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆; +// /// 5:鍏抽棴鎸囩汗ID锛�6:鍏抽棴闈㈠ID;7:瑙i攣楠岃瘉 +// /// </param> +// public void LoadPage(string optionType) +// { +// bodyView.BackgroundColor = CSS_Color.BackgroundColor; +// //瑙i攣楠岃瘉鏃犳硶鍚庨��锛屽繀椤婚獙璇� +// if (optionType != "7") +// { +// if (oldPasswrod == "") +// new TopViewDiv(bodyView, Language.StringByID(StringId.SetGesturePassword)).LoadTopView(); +// else +// new TopViewDiv(bodyView, Language.StringByID(StringId.VerifyGesturePassword)).LoadTopView(); +// } +// Button btnGestureIcon = new Button() +// { +// Y = Application.GetRealHeight(96), +// Gravity = Gravity.CenterHorizontal, +// Width = Application.GetRealWidth(64), +// Height = Application.GetRealWidth(64), +// //UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureGrayIcon.png", +// }; +// bodyView.AddChidren(btnGestureIcon); - Button btnTipTitle = new Button() - { - Y = Application.GetRealHeight(4) + btnGestureIcon.Bottom, - TextAlignment = TextAlignment.Center, - Height = Application.GetRealHeight(36), - IsBold = true, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.EmphasisFontSize_Secondary, - TextID = StringId.VerifyGesturePassword, - }; - bodyView.AddChidren(btnTipTitle); +// Button btnTipTitle = new Button() +// { +// Y = Application.GetRealHeight(4) + btnGestureIcon.Bottom, +// TextAlignment = TextAlignment.Center, +// Height = Application.GetRealHeight(36), +// IsBold = true, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.EmphasisFontSize_Secondary, +// TextID = StringId.VerifyGesturePassword, +// }; +// bodyView.AddChidren(btnTipTitle); - btnTipMsg = new Button() - { - Y = btnTipTitle.Bottom, - TextAlignment = TextAlignment.Center, - Height = Application.GetRealHeight(36), - IsBold = true, - TextColor = CSS_Color.TextualColor, - SelectedTextColor = CSS_Color.WarningColor, - TextSize = CSS_FontSize.TextFontSize, - TextID = StringId.DrawUnlockPattern, - }; - bodyView.AddChidren(btnTipMsg); +// btnTipMsg = new Button() +// { +// Y = btnTipTitle.Bottom, +// TextAlignment = TextAlignment.Center, +// Height = Application.GetRealHeight(36), +// IsBold = true, +// TextColor = CSS_Color.TextualColor, +// SelectedTextColor = CSS_Color.WarningColor, +// TextSize = CSS_FontSize.TextFontSize, +// TextID = StringId.DrawUnlockPattern, +// }; +// bodyView.AddChidren(btnTipMsg); - if (optionType == "1") - { - btnTipMsg.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.DrawUnlockPattern : StringId.DrawUnlockPatternAgain; - //璁剧疆鎵嬪娍瀵嗙爜 - btnTipTitle.TextID = StringId.SetGesturePassword; - }else if(optionType == "2") - { - //璇疯緭鍏ュ師鎵嬪娍瀵嗙爜 - btnTipTitle.TextID = StringId.PleaseDrawTheOriginalGesturePassword; - } +// if (optionType == "1") +// { +// btnTipMsg.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.DrawUnlockPattern : StringId.DrawUnlockPatternAgain; +// //璁剧疆鎵嬪娍瀵嗙爜 +// btnTipTitle.TextID = StringId.SetGesturePassword; +// }else if(optionType == "2") +// { +// //璇疯緭鍏ュ師鎵嬪娍瀵嗙爜 +// btnTipTitle.TextID = StringId.PleaseDrawTheOriginalGesturePassword; +// } - //if (optionType == "7") - //{ - // //璇风粯鍒惰В閿佸浘妗� - // btnTipTitle.TextID = StringId.DrawUnlockPattern; - //} +// //if (optionType == "7") +// //{ +// // //璇风粯鍒惰В閿佸浘妗� +// // btnTipTitle.TextID = StringId.DrawUnlockPattern; +// //} - GestureLockView mGestureLockView = new GestureLockView - { - Y = Application.GetRealHeight(260), - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(215), - Height = Application.GetRealWidth(215), - LockViewCorrectColor = CSS_Color.MainColor,//0xFF00FF00,//榛樿鍜屾纭� 鏃舵樉绀虹殑棰滆壊 - LockViewErrorColor = 0xFFFF0000, //閿欒鏃� 鏄剧ず鐨勯鑹� - BackgroundColor = CSS_Color.BackgroundColor, - }; - bodyView.AddChidren(mGestureLockView); - mGestureLockView.SetSolidType(true); - //婊戝姩缁撴潫 鍥炶皟瀵嗙爜缁撴灉鍜屽瘑鐮侀暱搴� - mGestureLockView.OnLockVerifyEvent += (selectNumStr, selectCount) => - { - //鑷楠岃瘉瀵嗙爜锛屾彁绀烘纭垨鑰呴敊璇� false涓烘樉绀虹孩鑹查敊璇�, 鑷閫夋嫨璋冪敤鏃舵満 - mGestureLockView.showCorrectStatus(false); - if (selectCount < 4) - { - btnTipMsg.Text = Language.StringByID(StringId.DrawingLengthError); - btnTipMsg.TextColor = CSS_Color.WarningColor; - return; - } +// GestureLockView mGestureLockView = new GestureLockView +// { +// Y = Application.GetRealHeight(260), +// Gravity = Gravity.CenterHorizontal, +// Width = Application.GetRealWidth(215), +// Height = Application.GetRealWidth(215), +// LockViewCorrectColor = CSS_Color.MainColor,//0xFF00FF00,//榛樿鍜屾纭� 鏃舵樉绀虹殑棰滆壊 +// LockViewErrorColor = 0xFFFF0000, //閿欒鏃� 鏄剧ず鐨勯鑹� +// BackgroundColor = CSS_Color.BackgroundColor, +// }; +// bodyView.AddChidren(mGestureLockView); +// mGestureLockView.SetSolidType(true); +// //婊戝姩缁撴潫 鍥炶皟瀵嗙爜缁撴灉鍜屽瘑鐮侀暱搴� +// mGestureLockView.OnLockVerifyEvent += (selectNumStr, selectCount) => +// { +// //鑷楠岃瘉瀵嗙爜锛屾彁绀烘纭垨鑰呴敊璇� false涓烘樉绀虹孩鑹查敊璇�, 鑷閫夋嫨璋冪敤鏃舵満 +// mGestureLockView.showCorrectStatus(false); +// if (selectCount < 4) +// { +// btnTipMsg.Text = Language.StringByID(StringId.DrawingLengthError); +// btnTipMsg.TextColor = CSS_Color.WarningColor; +// return; +// } - passwrod = selectNumStr; +// passwrod = selectNumStr; - if (string.IsNullOrEmpty(oldPasswrod)) - { - this.RemoveFromParent(); - var page = new AppUnlockGesturePage(passwrod, backAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(optionType); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else - { - //2020-12-11 瀵嗙爜鏍¢獙 - if (passwrod == oldPasswrod) - { - //瀵嗙爜楠岃瘉閫氳繃 - PasswordInputPassed(optionType); - } - else - { - //瀵嗙爜楠岃瘉澶辫触 - PasswordInputError(optionType); - } +// if (string.IsNullOrEmpty(oldPasswrod)) +// { +// this.RemoveFromParent(); +// var page = new AppUnlockGesturePage(passwrod, backAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage(optionType); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// } +// else +// { +// //2020-12-11 瀵嗙爜鏍¢獙 +// if (passwrod == oldPasswrod) +// { +// //瀵嗙爜楠岃瘉閫氳繃 +// PasswordInputPassed(optionType); +// } +// else +// { +// //瀵嗙爜楠岃瘉澶辫触 +// PasswordInputError(optionType); +// } - } +// } - }; +// }; - if (optionType == "7") - { - //浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 - AddLoginTipButton(); - } - else if (optionType != "1") - { - //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 - AddInputPasswordTipButton(optionType); - } +// if (optionType == "7") +// { +// //浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 +// AddLoginTipButton(); +// } +// else if (optionType != "1") +// { +// //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 +// AddInputPasswordTipButton(optionType); +// } - //if (optionType == "5" || optionType == "6" || optionType == "7") - //{ - // Button btnLoginAccountVerify = new Button() - // { - // Y = Application.GetRealHeight(517), - // Height = Application.GetRealHeight(60), - // TextAlignment = TextAlignment.Center, - // TextSize = CSS_FontSize.TextFontSize, - // TextColor = CSS_Color.MainColor, - // TextID = StringId.EnterLoginPasswordVerification, - // }; - // bodyView.AddChidren(btnLoginAccountVerify); +// //if (optionType == "5" || optionType == "6" || optionType == "7") +// //{ +// // Button btnLoginAccountVerify = new Button() +// // { +// // Y = Application.GetRealHeight(517), +// // Height = Application.GetRealHeight(60), +// // TextAlignment = TextAlignment.Center, +// // TextSize = CSS_FontSize.TextFontSize, +// // TextColor = CSS_Color.MainColor, +// // TextID = StringId.EnterLoginPasswordVerification, +// // }; +// // bodyView.AddChidren(btnLoginAccountVerify); - // btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => - // { - // if (optionType == "7") - // { - // MainPage.GoLoginPage(UserInfo.Current); - // } - // else - // { - // Action<string> action = (pw) => - // { - // var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); - // if (resultObj.Code == StateCode.SUCCESS) - // { - // UserInfo.Current.appUnlockPasswrod = ""; - // UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); - // UserInfo.Current.SaveUserInfo(); - // this.RemoveFromParent(); - // backAction(); - // } - // else - // { - // //鐧诲綍澶辫触 - // IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); - // } +// // btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => +// // { +// // if (optionType == "7") +// // { +// // MainPage.GoLoginPage(UserInfo.Current); +// // } +// // else +// // { +// // Action<string> action = (pw) => +// // { +// // var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); +// // if (resultObj.Code == StateCode.SUCCESS) +// // { +// // UserInfo.Current.appUnlockPasswrod = ""; +// // UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); +// // UserInfo.Current.SaveUserInfo(); +// // this.RemoveFromParent(); +// // backAction(); +// // } +// // else +// // { +// // //鐧诲綍澶辫触 +// // IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); +// // } - // }; - // new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); - // } - // }; - //} - } +// // }; +// // new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); +// // } +// // }; +// //} +// } - /// <summary> - /// 鎵嬪娍瀵嗙爜杈撳叆閿欒鏄剧ず閿欒淇℃伅 - /// </summary> - /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> - void PasswordInputError(string optionType) - { - int errorTextID = 0; - if (optionType == "1") - { - //2娆$粯鍒剁偣鍥炬涓嶄竴鑷达紝璇烽噸鏂扮粯鍒� - errorTextID = StringId.DrawingInconsistencyError; - } - else - { - //楠岃瘉澶辫触锛屽瘑鐮侀敊璇�. - errorTextID = StringId.AuthenticationFailedPasswordError; - } +// /// <summary> +// /// 鎵嬪娍瀵嗙爜杈撳叆閿欒鏄剧ず閿欒淇℃伅 +// /// </summary> +// /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> +// void PasswordInputError(string optionType) +// { +// int errorTextID = 0; +// if (optionType == "1") +// { +// //2娆$粯鍒剁偣鍥炬涓嶄竴鑷达紝璇烽噸鏂扮粯鍒� +// errorTextID = StringId.DrawingInconsistencyError; +// } +// else +// { +// //楠岃瘉澶辫触锛屽瘑鐮侀敊璇�. +// errorTextID = StringId.AuthenticationFailedPasswordError; +// } - btnTipMsg.TextID = errorTextID; - btnTipMsg.IsSelected = true; - btnTipMsg.Visible = true; - } +// btnTipMsg.TextID = errorTextID; +// btnTipMsg.IsSelected = true; +// btnTipMsg.Visible = true; +// } - /// <summary> - /// 鎵嬪娍瀵嗙爜楠岃瘉閫氳繃鍚庣殑鎿嶄綔 - /// </summary> - /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> - void PasswordInputPassed(string optionType) - { - if (optionType == "1") - { - //璁剧疆瀵嗙爜 楠岃瘉閫氳繃 - this.RemoveFromParent(); - var page = new OperationResultDisPalyPage(); - page.Show(); - page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), ""); - //page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), ""); - string tipMsg = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? Language.StringByID(StringId.TurnOnFingerprintUnlocking) : - Language.StringByID(StringId.TurnOnFaceIdUnlocking); - if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None) - { - var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; +// /// <summary> +// /// 鎵嬪娍瀵嗙爜楠岃瘉閫氳繃鍚庣殑鎿嶄綔 +// /// </summary> +// /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> +// void PasswordInputPassed(string optionType) +// { +// if (optionType == "1") +// { +// //璁剧疆瀵嗙爜 楠岃瘉閫氳繃 +// this.RemoveFromParent(); +// var page = new OperationResultDisPalyPage(); +// page.Show(); +// page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), ""); +// //page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), ""); +// string tipMsg = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? Language.StringByID(StringId.TurnOnFingerprintUnlocking) : +// Language.StringByID(StringId.TurnOnFaceIdUnlocking); +// if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None) +// { +// var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; - //濡傛灉涔嬪墠娌¤缃寚绾规垨鑰呴潰瀹笽D鎵嶆樉绀烘槸鍚﹀紑鍚� - if (!UserInfo.Current.appUnlockType.Contains(unlockType)) - { - Action<bool> action = (result) => - { - if (result) - { - if (!UserInfo.Current.appUnlockType.Contains(unlockType)) - { - UserInfo.Current.appUnlockType.Add(unlockType); - } - } - else - { - if (UserInfo.Current.appUnlockType.Contains(unlockType)) - { - UserInfo.Current.appUnlockType.Remove(unlockType); - } - } - UserInfo.Current.SaveUserInfo(); - backAction(); - }; - page.AdditionalOperations(tipMsg, action); - } - } - if (!UserInfo.Current.appUnlockType.Contains("2")) - { - UserInfo.Current.appUnlockType.Add("2"); - } - UserInfo.Current.appUnlockPasswrod = passwrod; - UserInfo.Current.SaveUserInfo(); - backAction(); - } - else if (optionType == "2") - { - //楠岃瘉瀵嗙爜閫氳繃 - //绉婚櫎褰撳墠鐣岄潰锛屾瘡娆¤繑鍥為兘杩斿洖鍒版渶涓婄骇 - this.RemoveFromParent(); - var page = new AppUnlockGesturePage("", backAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("1"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else if (optionType == "3" || optionType == "4") - { - //3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆 閫氳繃 - if (optionType == "4") - { - backAction(); - this.RemoveFromParent(); - return; - } - if (UserInfo.Current.appUnlockType.Contains("2")) - { - UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); - UserInfo.Current.appUnlockPasswrod = ""; - UserInfo.Current.SaveUserInfo(); - this.RemoveFromParent(); - backAction(); - } +// //濡傛灉涔嬪墠娌¤缃寚绾规垨鑰呴潰瀹笽D鎵嶆樉绀烘槸鍚﹀紑鍚� +// if (!UserInfo.Current.appUnlockType.Contains(unlockType)) +// { +// Action<bool> action = (result) => +// { +// if (result) +// { +// if (!UserInfo.Current.appUnlockType.Contains(unlockType)) +// { +// UserInfo.Current.appUnlockType.Add(unlockType); +// } +// } +// else +// { +// if (UserInfo.Current.appUnlockType.Contains(unlockType)) +// { +// UserInfo.Current.appUnlockType.Remove(unlockType); +// } +// } +// UserInfo.Current.SaveUserInfo(); +// backAction(); +// }; +// page.AdditionalOperations(tipMsg, action); +// } +// } +// if (!UserInfo.Current.appUnlockType.Contains("2")) +// { +// UserInfo.Current.appUnlockType.Add("2"); +// } +// UserInfo.Current.appUnlockPasswrod = passwrod; +// UserInfo.Current.SaveUserInfo(); +// backAction(); +// } +// else if (optionType == "2") +// { +// //楠岃瘉瀵嗙爜閫氳繃 +// //绉婚櫎褰撳墠鐣岄潰锛屾瘡娆¤繑鍥為兘杩斿洖鍒版渶涓婄骇 +// this.RemoveFromParent(); +// var page = new AppUnlockGesturePage("", backAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage("1"); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// } +// else if (optionType == "3" || optionType == "4") +// { +// //3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆 閫氳繃 +// if (optionType == "4") +// { +// backAction(); +// this.RemoveFromParent(); +// return; +// } +// if (UserInfo.Current.appUnlockType.Contains("2")) +// { +// UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); +// UserInfo.Current.appUnlockPasswrod = ""; +// UserInfo.Current.SaveUserInfo(); +// this.RemoveFromParent(); +// backAction(); +// } - } - else if (optionType == "5") - { - //5:鎸囩汗ID寮�鍏� 閫氳繃 - if (UserInfo.Current.appUnlockType.Contains("3")) - UserInfo.Current.appUnlockType.Remove("3"); - else - UserInfo.Current.appUnlockType.Add("3"); +// } +// else if (optionType == "5") +// { +// //5:鎸囩汗ID寮�鍏� 閫氳繃 +// if (UserInfo.Current.appUnlockType.Contains("3")) +// UserInfo.Current.appUnlockType.Remove("3"); +// else +// UserInfo.Current.appUnlockType.Add("3"); - UserInfo.Current.SaveUserInfo(); - this.RemoveFromParent(); - backAction(); - } - else if (optionType == "6") - { - //6:闈㈠ID寮�鍏� 閫氳繃 - if (UserInfo.Current.appUnlockType.Contains("4")) - UserInfo.Current.appUnlockType.Remove("4"); - else - UserInfo.Current.appUnlockType.Add("4"); +// UserInfo.Current.SaveUserInfo(); +// this.RemoveFromParent(); +// backAction(); +// } +// else if (optionType == "6") +// { +// //6:闈㈠ID寮�鍏� 閫氳繃 +// if (UserInfo.Current.appUnlockType.Contains("4")) +// UserInfo.Current.appUnlockType.Remove("4"); +// else +// UserInfo.Current.appUnlockType.Add("4"); - UserInfo.Current.SaveUserInfo(); - this.RemoveFromParent(); +// UserInfo.Current.SaveUserInfo(); +// this.RemoveFromParent(); - } - else if (optionType == "7") - { - //7:瑙i攣楠岃瘉 閫氳繃 - this.RemoveFromParent(); - backAction(); - } - } +// } +// else if (optionType == "7") +// { +// //7:瑙i攣楠岃瘉 閫氳繃 +// this.RemoveFromParent(); +// backAction(); +// } +// } - /// <summary> - /// 浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 - /// </summary> - void AddLoginTipButton() - { - Button btnLoginAccountVerify = new Button() - { - Y = Application.GetRealHeight(517), - Height = Application.GetRealHeight(60), - TextAlignment = TextAlignment.Center, - TextSize = CSS_FontSize.TextFontSize, - TextColor = CSS_Color.MainColor, - TextID = StringId.LogWithAccountAndPassword, - }; - bodyView.AddChidren(btnLoginAccountVerify); +// /// <summary> +// /// 浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 +// /// </summary> +// void AddLoginTipButton() +// { +// Button btnLoginAccountVerify = new Button() +// { +// Y = Application.GetRealHeight(517), +// Height = Application.GetRealHeight(60), +// TextAlignment = TextAlignment.Center, +// TextSize = CSS_FontSize.TextFontSize, +// TextColor = CSS_Color.MainColor, +// TextID = StringId.LogWithAccountAndPassword, +// }; +// bodyView.AddChidren(btnLoginAccountVerify); - btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => - { - //閫�鍑虹櫥褰� - HDLCommon.Current.Logout(); - }; - } +// btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => +// { +// //閫�鍑虹櫥褰� +// HDLCommon.Current.Logout(); +// }; +// } - /// <summary> - /// 杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 - /// </summary> - void AddInputPasswordTipButton(string optionType) - { - Button btnLoginAccountVerify = new Button() - { - Y = Application.GetRealHeight(517), - Height = Application.GetRealHeight(60), - TextAlignment = TextAlignment.Center, - TextSize = CSS_FontSize.TextFontSize, - TextColor = CSS_Color.MainColor, - TextID = StringId.EnterLoginPasswordVerification, - }; - bodyView.AddChidren(btnLoginAccountVerify); +// /// <summary> +// /// 杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 +// /// </summary> +// void AddInputPasswordTipButton(string optionType) +// { +// Button btnLoginAccountVerify = new Button() +// { +// Y = Application.GetRealHeight(517), +// Height = Application.GetRealHeight(60), +// TextAlignment = TextAlignment.Center, +// TextSize = CSS_FontSize.TextFontSize, +// TextColor = CSS_Color.MainColor, +// TextID = StringId.EnterLoginPasswordVerification, +// }; +// bodyView.AddChidren(btnLoginAccountVerify); - btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => - { - //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 - Action<string> action = (pw) => - { - AuthenticationByLoginPassword(pw, optionType); - //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); - //if (resultObj.Code == StateCode.SUCCESS) - //{ - // PasswordInputPassed(optionType); - //} - //else - //{ - // Application.RunOnMainThread(() => - // { - // Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); - // }); - //} +// btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => +// { +// //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 +// Action<string> action = (pw) => +// { +// AuthenticationByLoginPassword(pw, optionType); +// //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); +// //if (resultObj.Code == StateCode.SUCCESS) +// //{ +// // PasswordInputPassed(optionType); +// //} +// //else +// //{ +// // Application.RunOnMainThread(() => +// // { +// // Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); +// // }); +// //} - }; - new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); - }; - } +// }; +// new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); +// }; +// } - /// <summary> - /// 鐧诲綍瀵嗙爜楠岃瘉 - /// </summary> - /// <param name="pw"></param> - /// <param name="optionType"></param> - void AuthenticationByLoginPassword(string pw, string optionType) - { - var waitPage = new Loading(); - bodyView.AddChidren(waitPage); - waitPage.Start(Language.StringByID(StringId.PleaseWait)); +// /// <summary> +// /// 鐧诲綍瀵嗙爜楠岃瘉 +// /// </summary> +// /// <param name="pw"></param> +// /// <param name="optionType"></param> +// void AuthenticationByLoginPassword(string pw, string optionType) +// { +// var waitPage = new Loading(); +// bodyView.AddChidren(waitPage); +// waitPage.Start(Language.StringByID(StringId.PleaseWait)); - new System.Threading.Thread(() => - { - try - { - var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); - Application.RunOnMainThread(() => - { - if (resultObj.Code == StateCode.SUCCESS) - { - PasswordInputPassed(optionType); - } - else - { - Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); - } - }); - } - catch { } - finally - { - Application.RunOnMainThread(() => - { - if (waitPage != null) - { - waitPage.RemoveFromParent(); - waitPage = null; - } - }); - } - }) - { IsBackground = true }.Start(); - } - } -} \ No newline at end of file +// new System.Threading.Thread(() => +// { +// try +// { +// var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); +// Application.RunOnMainThread(() => +// { +// if (resultObj.Code == StateCode.SUCCESS) +// { +// PasswordInputPassed(optionType); +// } +// else +// { +// Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); +// } +// }); +// } +// catch { } +// finally +// { +// Application.RunOnMainThread(() => +// { +// if (waitPage != null) +// { +// waitPage.RemoveFromParent(); +// waitPage = null; +// } +// }); +// } +// }) +// { IsBackground = true }.Start(); +// } +// } +//} \ No newline at end of file diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs index ccb481a..1078754 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs @@ -1,503 +1,503 @@ -锘縰sing System; -using Shared; -using HDL_ON.UI.CSS; -using HDL_ON.DAL.Server; +锘�//using System; +//using Shared; +//using HDL_ON.UI.CSS; +//using HDL_ON.DAL.Server; -namespace HDL_ON.UI -{ - /// <summary> - /// 瀵嗙爜瑙i攣 - /// </summary> - public partial class AppUnlockPasswordPage : FrameLayout - { - FrameLayout bodyView; - EditText etPassword; - /// <summary> - /// - /// </summary> - Button btnTipError; +//namespace HDL_ON.UI +//{ +// /// <summary> +// /// 瀵嗙爜瑙i攣 +// /// </summary> +// public partial class AppUnlockPasswordPage : FrameLayout +// { +// FrameLayout bodyView; +// EditText etPassword; +// /// <summary> +// /// +// /// </summary> +// Button btnTipError; - string passwrod = ""; - string oldPasswrod = ""; - Action backAction; - public AppUnlockPasswordPage(string pw, Action action) - { - bodyView = this; - bodyView.Tag = "unlockpage"; - oldPasswrod = pw; - backAction = action; - } +// string passwrod = ""; +// string oldPasswrod = ""; +// Action backAction; +// public AppUnlockPasswordPage(string pw, Action action) +// { +// bodyView = this; +// bodyView.Tag = "unlockpage"; +// oldPasswrod = pw; +// backAction = action; +// } - /// <summary> - /// - /// </summary> - /// <param name="optionType"> - /// 鎿嶄綔鏂瑰紡锛� - /// 1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆; - /// 5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉 - /// </param> - public void LoadPage(string optionType) - { - bodyView.BackgroundColor = CSS_Color.BackgroundColor; - //瑙i攣楠岃瘉鏃犳硶鍚庨��锛屽繀椤婚獙璇� - if (optionType != "7") - { - if (oldPasswrod == "") - new TopViewDiv(bodyView, Language.StringByID(StringId.SetDigitalPassword)).LoadTopView(); - else - new TopViewDiv(bodyView, Language.StringByID(StringId.VerifyDigitalPassword)).LoadTopView(); - } +// /// <summary> +// /// +// /// </summary> +// /// <param name="optionType"> +// /// 鎿嶄綔鏂瑰紡锛� +// /// 1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆; +// /// 5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉 +// /// </param> +// public void LoadPage(string optionType) +// { +// bodyView.BackgroundColor = CSS_Color.BackgroundColor; +// //瑙i攣楠岃瘉鏃犳硶鍚庨��锛屽繀椤婚獙璇� +// if (optionType != "7") +// { +// if (oldPasswrod == "") +// new TopViewDiv(bodyView, Language.StringByID(StringId.SetDigitalPassword)).LoadTopView(); +// else +// new TopViewDiv(bodyView, Language.StringByID(StringId.VerifyDigitalPassword)).LoadTopView(); +// } - var btnTipTitle = new Button() - { - Y = Application.GetRealWidth(186), - Height = Application.GetRealWidth(42), - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword, - }; - bodyView.AddChidren(btnTipTitle); +// var btnTipTitle = new Button() +// { +// Y = Application.GetRealWidth(186), +// Height = Application.GetRealWidth(42), +// TextAlignment = TextAlignment.Center, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.SubheadingFontSize, +// TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword, +// }; +// bodyView.AddChidren(btnTipTitle); - if (optionType == "1") - { - btnTipTitle.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword; - } - else if (optionType == "2") - { - btnTipTitle.TextID = StringId.PleaseEnterTheOriginalDigitalPassword; - } - else - { - btnTipTitle.TextID = StringId.PlsEntryPassword; - } +// if (optionType == "1") +// { +// btnTipTitle.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword; +// } +// else if (optionType == "2") +// { +// btnTipTitle.TextID = StringId.PleaseEnterTheOriginalDigitalPassword; +// } +// else +// { +// btnTipTitle.TextID = StringId.PlsEntryPassword; +// } - var btnTipIcon1 = new Button() - { - X = Application.GetRealWidth(132), - Y = Application.GetRealWidth(238), - Width = Application.GetRealWidth(16), - Height = Application.GetRealWidth(16), - BorderColor = CSS_Color.FirstLevelTitleColor, - BorderWidth = (uint)Application.GetRealWidth(1), - Radius = (uint)Application.GetRealWidth(8), - BackgroundColor = CSS_Color.MainBackgroundColor, - SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor, - }; - bodyView.AddChidren(btnTipIcon1); +// var btnTipIcon1 = new Button() +// { +// X = Application.GetRealWidth(132), +// Y = Application.GetRealWidth(238), +// Width = Application.GetRealWidth(16), +// Height = Application.GetRealWidth(16), +// BorderColor = CSS_Color.FirstLevelTitleColor, +// BorderWidth = (uint)Application.GetRealWidth(1), +// Radius = (uint)Application.GetRealWidth(8), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor, +// }; +// bodyView.AddChidren(btnTipIcon1); - var btnTipIcon2 = new Button() - { - X = btnTipIcon1.Right + Application.GetRealWidth(16), - Y = Application.GetRealWidth(238), - Width = Application.GetRealWidth(16), - Height = Application.GetRealWidth(16), - BorderColor = CSS_Color.FirstLevelTitleColor, - BorderWidth = (uint)Application.GetRealWidth(1), - Radius = (uint)Application.GetRealWidth(8), - BackgroundColor = CSS_Color.MainBackgroundColor, - SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor, - }; - bodyView.AddChidren(btnTipIcon2); +// var btnTipIcon2 = new Button() +// { +// X = btnTipIcon1.Right + Application.GetRealWidth(16), +// Y = Application.GetRealWidth(238), +// Width = Application.GetRealWidth(16), +// Height = Application.GetRealWidth(16), +// BorderColor = CSS_Color.FirstLevelTitleColor, +// BorderWidth = (uint)Application.GetRealWidth(1), +// Radius = (uint)Application.GetRealWidth(8), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor, +// }; +// bodyView.AddChidren(btnTipIcon2); - var btnTipIcon3 = new Button() - { - X = btnTipIcon2.Right + Application.GetRealWidth(16), - Y = Application.GetRealWidth(238), - Width = Application.GetRealWidth(16), - Height = Application.GetRealWidth(16), - BorderColor = CSS_Color.FirstLevelTitleColor, - BorderWidth = (uint)Application.GetRealWidth(1), - Radius = (uint)Application.GetRealWidth(8), - BackgroundColor = CSS_Color.MainBackgroundColor, - SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor, - }; - bodyView.AddChidren(btnTipIcon3); +// var btnTipIcon3 = new Button() +// { +// X = btnTipIcon2.Right + Application.GetRealWidth(16), +// Y = Application.GetRealWidth(238), +// Width = Application.GetRealWidth(16), +// Height = Application.GetRealWidth(16), +// BorderColor = CSS_Color.FirstLevelTitleColor, +// BorderWidth = (uint)Application.GetRealWidth(1), +// Radius = (uint)Application.GetRealWidth(8), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor, +// }; +// bodyView.AddChidren(btnTipIcon3); - var btnTipIcon4 = new Button() - { - X = btnTipIcon3.Right + Application.GetRealWidth(16), - Y = Application.GetRealWidth(238), - Width = Application.GetRealWidth(16), - Height = Application.GetRealWidth(16), - BorderColor = CSS_Color.FirstLevelTitleColor, - BorderWidth = (uint)Application.GetRealWidth(1), - Radius = (uint)Application.GetRealWidth(8), - BackgroundColor = CSS_Color.MainBackgroundColor, - SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor, - }; - bodyView.AddChidren(btnTipIcon4); +// var btnTipIcon4 = new Button() +// { +// X = btnTipIcon3.Right + Application.GetRealWidth(16), +// Y = Application.GetRealWidth(238), +// Width = Application.GetRealWidth(16), +// Height = Application.GetRealWidth(16), +// BorderColor = CSS_Color.FirstLevelTitleColor, +// BorderWidth = (uint)Application.GetRealWidth(1), +// Radius = (uint)Application.GetRealWidth(8), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// SelectedBackgroundColor = CSS_Color.FirstLevelTitleColor, +// }; +// bodyView.AddChidren(btnTipIcon4); - btnTipError = new Button() - { - Y = Application.GetRealWidth(258), - Height = Application.GetRealWidth(40), - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.WarningColor, - TextSize = CSS_FontSize.TextFontSize, - Visible = false, - }; - bodyView.AddChidren(btnTipError); +// btnTipError = new Button() +// { +// Y = Application.GetRealWidth(258), +// Height = Application.GetRealWidth(40), +// TextAlignment = TextAlignment.Center, +// TextColor = CSS_Color.WarningColor, +// TextSize = CSS_FontSize.TextFontSize, +// Visible = false, +// }; +// bodyView.AddChidren(btnTipError); - etPassword = new EditText() - { - Y = Application.GetRealWidth(100), - Height = 1, - Foucs = true, - //Visible = false, - IsNumberKeyboardType = true, - }; - bodyView.AddChidren(etPassword); +// etPassword = new EditText() +// { +// Y = Application.GetRealWidth(100), +// Height = 1, +// Foucs = true, +// //Visible = false, +// IsNumberKeyboardType = true, +// }; +// bodyView.AddChidren(etPassword); - //etPassword.MouseUpEventHandler = (sender, e) => { }; +// //etPassword.MouseUpEventHandler = (sender, e) => { }; - etPassword.TextChangeEventHandler = (sender, e) => - { - passwrod = etPassword.Text.Trim(); - switch (etPassword.Text.Trim().Length) - { - case 0: - btnTipIcon1.IsSelected = false; - btnTipIcon2.IsSelected = false; - btnTipIcon3.IsSelected = false; - btnTipIcon4.IsSelected = false; - break; - case 1: - btnTipIcon1.IsSelected = true; - btnTipIcon2.IsSelected = false; - btnTipIcon3.IsSelected = false; - btnTipIcon4.IsSelected = false; - btnTipError.Visible = false; - break; - case 2: - btnTipIcon1.IsSelected = true; - btnTipIcon2.IsSelected = true; - btnTipIcon3.IsSelected = false; - btnTipIcon4.IsSelected = false; - break; - case 3: - btnTipIcon1.IsSelected = true; - btnTipIcon2.IsSelected = true; - btnTipIcon3.IsSelected = true; - btnTipIcon4.IsSelected = false; - break; - case 4: - btnTipIcon1.IsSelected = true; - btnTipIcon2.IsSelected = true; - btnTipIcon3.IsSelected = true; - btnTipIcon4.IsSelected = true; - Application.HideSoftInput(); - if (string.IsNullOrEmpty(oldPasswrod)) - { - //绉婚櫎褰撳墠鐣岄潰锛屾瘡娆¤繑鍥為兘杩斿洖鍒版渶涓婄骇 - this.RemoveFromParent(); - var page = new AppUnlockPasswordPage(passwrod, backAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(optionType); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else - { - //2020-12-11 瀵嗙爜鏍¢獙 - if (passwrod == oldPasswrod) - { - //瀵嗙爜楠岃瘉閫氳繃 - PasswordInputPassed(optionType); - } - else - { - //瀵嗙爜楠岃瘉澶辫触 - PasswordInputError(optionType); - } - } - break; - } - }; +// etPassword.TextChangeEventHandler = (sender, e) => +// { +// passwrod = etPassword.Text.Trim(); +// switch (etPassword.Text.Trim().Length) +// { +// case 0: +// btnTipIcon1.IsSelected = false; +// btnTipIcon2.IsSelected = false; +// btnTipIcon3.IsSelected = false; +// btnTipIcon4.IsSelected = false; +// break; +// case 1: +// btnTipIcon1.IsSelected = true; +// btnTipIcon2.IsSelected = false; +// btnTipIcon3.IsSelected = false; +// btnTipIcon4.IsSelected = false; +// btnTipError.Visible = false; +// break; +// case 2: +// btnTipIcon1.IsSelected = true; +// btnTipIcon2.IsSelected = true; +// btnTipIcon3.IsSelected = false; +// btnTipIcon4.IsSelected = false; +// break; +// case 3: +// btnTipIcon1.IsSelected = true; +// btnTipIcon2.IsSelected = true; +// btnTipIcon3.IsSelected = true; +// btnTipIcon4.IsSelected = false; +// break; +// case 4: +// btnTipIcon1.IsSelected = true; +// btnTipIcon2.IsSelected = true; +// btnTipIcon3.IsSelected = true; +// btnTipIcon4.IsSelected = true; +// Application.HideSoftInput(); +// if (string.IsNullOrEmpty(oldPasswrod)) +// { +// //绉婚櫎褰撳墠鐣岄潰锛屾瘡娆¤繑鍥為兘杩斿洖鍒版渶涓婄骇 +// this.RemoveFromParent(); +// var page = new AppUnlockPasswordPage(passwrod, backAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage(optionType); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// } +// else +// { +// //2020-12-11 瀵嗙爜鏍¢獙 +// if (passwrod == oldPasswrod) +// { +// //瀵嗙爜楠岃瘉閫氳繃 +// PasswordInputPassed(optionType); +// } +// else +// { +// //瀵嗙爜楠岃瘉澶辫触 +// PasswordInputError(optionType); +// } +// } +// break; +// } +// }; - EventHandler<MouseEventArgs> eventHandler = (sender, e) => - { - etPassword.Foucs = true; - }; - bodyView.MouseUpEventHandler = eventHandler; - btnTipIcon1.MouseUpEventHandler = eventHandler; - btnTipIcon2.MouseUpEventHandler = eventHandler; - btnTipIcon3.MouseUpEventHandler = eventHandler; - btnTipIcon4.MouseUpEventHandler = eventHandler; +// EventHandler<MouseEventArgs> eventHandler = (sender, e) => +// { +// etPassword.Foucs = true; +// }; +// bodyView.MouseUpEventHandler = eventHandler; +// btnTipIcon1.MouseUpEventHandler = eventHandler; +// btnTipIcon2.MouseUpEventHandler = eventHandler; +// btnTipIcon3.MouseUpEventHandler = eventHandler; +// btnTipIcon4.MouseUpEventHandler = eventHandler; - etPassword.Foucs = true; +// etPassword.Foucs = true; - if (optionType == "7") - { - //浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 - AddLoginTipButton(); - } - else if (optionType != "1") - { - //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 - AddInputPasswordTipButton(optionType); - } - } +// if (optionType == "7") +// { +// //浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 +// AddLoginTipButton(); +// } +// else if (optionType != "1") +// { +// //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 +// AddInputPasswordTipButton(optionType); +// } +// } - /// <summary> - /// 瀵嗙爜杈撳叆閿欒鏄剧ず閿欒淇℃伅 - /// </summary> - /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> - void PasswordInputError(string optionType) - { - int errorTextID = 0; - if (optionType == "1") - { - //涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷达紝璇烽噸鏂拌緭鍏� - errorTextID = StringId.IncorrectRepeatPassword; - } - else - { - //楠岃瘉澶辫触锛屽瘑鐮侀敊璇�. - errorTextID = StringId.AuthenticationFailedPasswordError; - } +// /// <summary> +// /// 瀵嗙爜杈撳叆閿欒鏄剧ず閿欒淇℃伅 +// /// </summary> +// /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> +// void PasswordInputError(string optionType) +// { +// int errorTextID = 0; +// if (optionType == "1") +// { +// //涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷达紝璇烽噸鏂拌緭鍏� +// errorTextID = StringId.IncorrectRepeatPassword; +// } +// else +// { +// //楠岃瘉澶辫触锛屽瘑鐮侀敊璇�. +// errorTextID = StringId.AuthenticationFailedPasswordError; +// } - btnTipError.TextID = errorTextID; - etPassword.Text = ""; - btnTipError.Visible = true; - } +// btnTipError.TextID = errorTextID; +// etPassword.Text = ""; +// btnTipError.Visible = true; +// } - /// <summary> - /// 瀵嗙爜楠岃瘉閫氳繃鍚庣殑鎿嶄綔 - /// </summary> - /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> - void PasswordInputPassed(string optionType) - { - if (optionType == "1") - { - //璁剧疆瀵嗙爜 楠岃瘉閫氳繃 - this.RemoveFromParent(); - var page = new OperationResultDisPalyPage(); - page.Show(); +// /// <summary> +// /// 瀵嗙爜楠岃瘉閫氳繃鍚庣殑鎿嶄綔 +// /// </summary> +// /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> +// void PasswordInputPassed(string optionType) +// { +// if (optionType == "1") +// { +// //璁剧疆瀵嗙爜 楠岃瘉閫氳繃 +// this.RemoveFromParent(); +// var page = new OperationResultDisPalyPage(); +// page.Show(); - page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), ""); - string tipMsg = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? Language.StringByID(StringId.TurnOnFingerprintUnlocking) : - Language.StringByID(StringId.TurnOnFaceIdUnlocking); +// page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), ""); +// string tipMsg = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? Language.StringByID(StringId.TurnOnFingerprintUnlocking) : +// Language.StringByID(StringId.TurnOnFaceIdUnlocking); - if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None) - { - var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; +// if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None) +// { +// var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; - //濡傛灉涔嬪墠娌¤缃寚绾规垨鑰呴潰瀹笽D鎵嶆樉绀烘槸鍚﹀紑鍚� - if (!UserInfo.Current.appUnlockType.Contains(unlockType)) - { - Action<bool> action = (result) => - { - if (result) - { - if (!UserInfo.Current.appUnlockType.Contains(unlockType)) - { - UserInfo.Current.appUnlockType.Add(unlockType); - } - } - else - { - if (UserInfo.Current.appUnlockType.Contains(unlockType)) - { - UserInfo.Current.appUnlockType.Remove(unlockType); - } - } - backAction(); - UserInfo.Current.SaveUserInfo(); - }; +// //濡傛灉涔嬪墠娌¤缃寚绾规垨鑰呴潰瀹笽D鎵嶆樉绀烘槸鍚﹀紑鍚� +// if (!UserInfo.Current.appUnlockType.Contains(unlockType)) +// { +// Action<bool> action = (result) => +// { +// if (result) +// { +// if (!UserInfo.Current.appUnlockType.Contains(unlockType)) +// { +// UserInfo.Current.appUnlockType.Add(unlockType); +// } +// } +// else +// { +// if (UserInfo.Current.appUnlockType.Contains(unlockType)) +// { +// UserInfo.Current.appUnlockType.Remove(unlockType); +// } +// } +// backAction(); +// UserInfo.Current.SaveUserInfo(); +// }; - page.AdditionalOperations(tipMsg, action); - } - } - if (!UserInfo.Current.appUnlockType.Contains("1")) - { - UserInfo.Current.appUnlockType.Add("1"); - } - UserInfo.Current.appUnlockPasswrod = passwrod; - UserInfo.Current.SaveUserInfo(); - backAction(); - } - else if (optionType == "2") - { - //楠岃瘉瀵嗙爜閫氳繃 - //绉婚櫎褰撳墠鐣岄潰锛屾瘡娆¤繑鍥為兘杩斿洖鍒版渶涓婄骇 - this.RemoveFromParent(); - var page = new AppUnlockPasswordPage("", backAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("1"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else if (optionType == "3" || optionType == "4") - { - //3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆 閫氳繃 - if (optionType == "4") - { - backAction(); - this.RemoveFromParent(); - return; - } - if (UserInfo.Current.appUnlockType.Contains("1")) - { - UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();//.Remove("1"); - UserInfo.Current.appUnlockPasswrod = ""; - UserInfo.Current.SaveUserInfo(); - this.RemoveFromParent(); - backAction(); - } - } - else if (optionType == "5") - { - //5:鎸囩汗ID寮�鍏� 閫氳繃 - if (UserInfo.Current.appUnlockType.Contains("3")) - { - UserInfo.Current.appUnlockType.Remove("3"); - } - else - { - UserInfo.Current.appUnlockType.Add("3"); - } - UserInfo.Current.SaveUserInfo(); - this.RemoveFromParent(); - backAction(); - } - else if (optionType == "6") - { - //6:闈㈠ID寮�鍏� 閫氳繃 - if (UserInfo.Current.appUnlockType.Contains("4")) - { - UserInfo.Current.appUnlockType.Remove("4"); - } - else - { - UserInfo.Current.appUnlockType.Add("4"); - } - UserInfo.Current.SaveUserInfo(); - this.RemoveFromParent(); - backAction(); - } - else if (optionType == "7") - { - //7:瑙i攣楠岃瘉 閫氳繃 - this.RemoveFromParent(); - backAction(); - } - } +// page.AdditionalOperations(tipMsg, action); +// } +// } +// if (!UserInfo.Current.appUnlockType.Contains("1")) +// { +// UserInfo.Current.appUnlockType.Add("1"); +// } +// UserInfo.Current.appUnlockPasswrod = passwrod; +// UserInfo.Current.SaveUserInfo(); +// backAction(); +// } +// else if (optionType == "2") +// { +// //楠岃瘉瀵嗙爜閫氳繃 +// //绉婚櫎褰撳墠鐣岄潰锛屾瘡娆¤繑鍥為兘杩斿洖鍒版渶涓婄骇 +// this.RemoveFromParent(); +// var page = new AppUnlockPasswordPage("", backAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage("1"); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// } +// else if (optionType == "3" || optionType == "4") +// { +// //3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆 閫氳繃 +// if (optionType == "4") +// { +// backAction(); +// this.RemoveFromParent(); +// return; +// } +// if (UserInfo.Current.appUnlockType.Contains("1")) +// { +// UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>();//.Remove("1"); +// UserInfo.Current.appUnlockPasswrod = ""; +// UserInfo.Current.SaveUserInfo(); +// this.RemoveFromParent(); +// backAction(); +// } +// } +// else if (optionType == "5") +// { +// //5:鎸囩汗ID寮�鍏� 閫氳繃 +// if (UserInfo.Current.appUnlockType.Contains("3")) +// { +// UserInfo.Current.appUnlockType.Remove("3"); +// } +// else +// { +// UserInfo.Current.appUnlockType.Add("3"); +// } +// UserInfo.Current.SaveUserInfo(); +// this.RemoveFromParent(); +// backAction(); +// } +// else if (optionType == "6") +// { +// //6:闈㈠ID寮�鍏� 閫氳繃 +// if (UserInfo.Current.appUnlockType.Contains("4")) +// { +// UserInfo.Current.appUnlockType.Remove("4"); +// } +// else +// { +// UserInfo.Current.appUnlockType.Add("4"); +// } +// UserInfo.Current.SaveUserInfo(); +// this.RemoveFromParent(); +// backAction(); +// } +// else if (optionType == "7") +// { +// //7:瑙i攣楠岃瘉 閫氳繃 +// this.RemoveFromParent(); +// backAction(); +// } +// } - /// <summary> - /// 浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 - /// </summary> - void AddLoginTipButton() - { - Button btnLoginAccountVerify = new Button() - { - Y = Application.GetRealHeight(517), - Height = Application.GetRealHeight(60), - TextAlignment = TextAlignment.Center, - TextSize = CSS_FontSize.TextFontSize, - TextColor = CSS_Color.MainColor, - TextID = StringId.LogWithAccountAndPassword, - }; - bodyView.AddChidren(btnLoginAccountVerify); +// /// <summary> +// /// 浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 +// /// </summary> +// void AddLoginTipButton() +// { +// Button btnLoginAccountVerify = new Button() +// { +// Y = Application.GetRealHeight(517), +// Height = Application.GetRealHeight(60), +// TextAlignment = TextAlignment.Center, +// TextSize = CSS_FontSize.TextFontSize, +// TextColor = CSS_Color.MainColor, +// TextID = StringId.LogWithAccountAndPassword, +// }; +// bodyView.AddChidren(btnLoginAccountVerify); - btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => - { - //閫�鍑虹櫥褰� - HDLCommon.Current.Logout(); - }; - } +// btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => +// { +// //閫�鍑虹櫥褰� +// HDLCommon.Current.Logout(); +// }; +// } - /// <summary> - /// 杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 - /// </summary> - void AddInputPasswordTipButton(string optionType) - { - Button btnLoginAccountVerify = new Button() - { - Y = Application.GetRealHeight(517), - Height = Application.GetRealHeight(60), - TextAlignment = TextAlignment.Center, - TextSize = CSS_FontSize.TextFontSize, - TextColor = CSS_Color.MainColor, - TextID = StringId.EnterLoginPasswordVerification, - }; - bodyView.AddChidren(btnLoginAccountVerify); +// /// <summary> +// /// 杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 +// /// </summary> +// void AddInputPasswordTipButton(string optionType) +// { +// Button btnLoginAccountVerify = new Button() +// { +// Y = Application.GetRealHeight(517), +// Height = Application.GetRealHeight(60), +// TextAlignment = TextAlignment.Center, +// TextSize = CSS_FontSize.TextFontSize, +// TextColor = CSS_Color.MainColor, +// TextID = StringId.EnterLoginPasswordVerification, +// }; +// bodyView.AddChidren(btnLoginAccountVerify); - btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => - { - //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 - Action<string> action = (pw) => - { - AuthenticationByLoginPassword(pw, optionType); - //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); - //if (resultObj.Code == StateCode.SUCCESS) - //{ - // PasswordInputPassed(optionType); - //} - //else - //{ - // Application.RunOnMainThread(() => - // { - // Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); - // }); +// btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => +// { +// //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 +// Action<string> action = (pw) => +// { +// AuthenticationByLoginPassword(pw, optionType); +// //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); +// //if (resultObj.Code == StateCode.SUCCESS) +// //{ +// // PasswordInputPassed(optionType); +// //} +// //else +// //{ +// // Application.RunOnMainThread(() => +// // { +// // Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); +// // }); - //} +// //} - }; - new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); - }; - } +// }; +// new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); +// }; +// } - /// <summary> - /// 鐧诲綍瀵嗙爜楠岃瘉 - /// </summary> - /// <param name="pw"></param> - /// <param name="optionType"></param> - void AuthenticationByLoginPassword(string pw, string optionType) - { - var waitPage = new Loading(); - bodyView.AddChidren(waitPage); - waitPage.Start(Language.StringByID(StringId.PleaseWait)); +// /// <summary> +// /// 鐧诲綍瀵嗙爜楠岃瘉 +// /// </summary> +// /// <param name="pw"></param> +// /// <param name="optionType"></param> +// void AuthenticationByLoginPassword(string pw, string optionType) +// { +// var waitPage = new Loading(); +// bodyView.AddChidren(waitPage); +// waitPage.Start(Language.StringByID(StringId.PleaseWait)); - new System.Threading.Thread(() => - { - try - { - var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); - Application.RunOnMainThread(() => - { - if (resultObj.Code == StateCode.SUCCESS) - { - PasswordInputPassed(optionType); - } - else - { - Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); - } - }); - } - catch { } - finally - { - Application.RunOnMainThread(() => - { - if (waitPage != null) - { - waitPage.RemoveFromParent(); - waitPage = null; - } - }); - } - }) - { IsBackground = true }.Start(); - } - } -} +// new System.Threading.Thread(() => +// { +// try +// { +// var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); +// Application.RunOnMainThread(() => +// { +// if (resultObj.Code == StateCode.SUCCESS) +// { +// PasswordInputPassed(optionType); +// } +// else +// { +// Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); +// } +// }); +// } +// catch { } +// finally +// { +// Application.RunOnMainThread(() => +// { +// if (waitPage != null) +// { +// waitPage.RemoveFromParent(); +// waitPage = null; +// } +// }); +// } +// }) +// { IsBackground = true }.Start(); +// } +// } +//} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPage.cs index 6eb3d6b..9fe4c9a 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPage.cs @@ -1,810 +1,810 @@ -锘縰sing System; -using HDL_ON.UI.CSS; -using Shared; +锘�//using System; +//using HDL_ON.UI.CSS; +//using Shared; -namespace HDL_ON.UI -{ - public partial class AppUnlockSettingsPage : FrameLayout - { - #region 鎺т欢鍒楄〃 - FrameLayout bodyView; +//namespace HDL_ON.UI +//{ +// public partial class AppUnlockSettingsPage : FrameLayout +// { +// #region 鎺т欢鍒楄〃 +// FrameLayout bodyView; - /// <summary> - /// 涓婇儴鍒嗘樉绀哄尯鍩� - /// </summary> - FrameLayout topContentView; - /// <summary> - /// 瑙i攣椤甸潰閫夋嫨鍒楄〃view - /// </summary> - HorizontalScrolViewLayout optionView; +// /// <summary> +// /// 涓婇儴鍒嗘樉绀哄尯鍩� +// /// </summary> +// FrameLayout topContentView; +// /// <summary> +// /// 瑙i攣椤甸潰閫夋嫨鍒楄〃view +// /// </summary> +// HorizontalScrolViewLayout optionView; - /// <summary> - /// 鏃犱繚鎶ら�夐」鎻愮ず - /// </summary> - Button btnUnprotectedSelectionTip; - /// <summary> - /// 鏃犱繚鎶ら�夐」閫変腑鍥炬爣 - /// </summary> - Button btnUnprotectedSelectionIcon; - /// <summary> - /// 鏃犱繚鎶ら�夐」鑳屾櫙 - /// </summary> - Button btnUnprotectedBg; +// /// <summary> +// /// 鏃犱繚鎶ら�夐」鎻愮ず +// /// </summary> +// Button btnUnprotectedSelectionTip; +// /// <summary> +// /// 鏃犱繚鎶ら�夐」閫変腑鍥炬爣 +// /// </summary> +// Button btnUnprotectedSelectionIcon; +// /// <summary> +// /// 鏃犱繚鎶ら�夐」鑳屾櫙 +// /// </summary> +// Button btnUnprotectedBg; - /// <summary> - /// 鍚姩鏃堕�夐」鎻愮ず - /// </summary> - Button btnStartupSelectionTip; - /// <summary> - /// 鍚姩鏃堕�夐」閫変腑鍥炬爣 - /// </summary> - Button btnStartupSelectionIcon; - /// <summary> - /// 鍚姩鏃堕�夐」鑳屾櫙 - /// </summary> - Button btnStartupBg; +// /// <summary> +// /// 鍚姩鏃堕�夐」鎻愮ず +// /// </summary> +// Button btnStartupSelectionTip; +// /// <summary> +// /// 鍚姩鏃堕�夐」閫変腑鍥炬爣 +// /// </summary> +// Button btnStartupSelectionIcon; +// /// <summary> +// /// 鍚姩鏃堕�夐」鑳屾櫙 +// /// </summary> +// Button btnStartupBg; - #region F3闃舵 - ///// <summary> - ///// 璁剧疆瀹夐槻閫夐」鎻愮ず - ///// </summary> - //Button btnSecuritySelectionTip; - ///// <summary> - ///// 璁剧疆瀹夐槻閫夐」閫変腑鍥炬爣 - ///// </summary> - //Button btnSecuritySelectionIcon; - ///// <summary> - ///// 璁剧疆瀹夐槻閫夐」鑳屾櫙 - ///// </summary> - //Button btnSecurityBg; +// #region F3闃舵 +// ///// <summary> +// ///// 璁剧疆瀹夐槻閫夐」鎻愮ず +// ///// </summary> +// //Button btnSecuritySelectionTip; +// ///// <summary> +// ///// 璁剧疆瀹夐槻閫夐」閫変腑鍥炬爣 +// ///// </summary> +// //Button btnSecuritySelectionIcon; +// ///// <summary> +// ///// 璁剧疆瀹夐槻閫夐」鑳屾櫙 +// ///// </summary> +// //Button btnSecurityBg; - /// <summary> - /// 璁剧疆闂ㄩ攣閫夐」鎻愮ず - /// </summary> - Button btnDoorlockSelectionTip; - /// <summary> - /// 璁剧疆闂ㄩ攣閫夐」閫変腑鍥炬爣 - /// </summary> - Button btnDoorlockSelectionIcon; - /// <summary> - /// 璁剧疆闂ㄩ攣閫夐」鑳屾櫙 - /// </summary> - Button btnDoorlockBg; - #endregion +// /// <summary> +// /// 璁剧疆闂ㄩ攣閫夐」鎻愮ず +// /// </summary> +// Button btnDoorlockSelectionTip; +// /// <summary> +// /// 璁剧疆闂ㄩ攣閫夐」閫変腑鍥炬爣 +// /// </summary> +// Button btnDoorlockSelectionIcon; +// /// <summary> +// /// 璁剧疆闂ㄩ攣閫夐」鑳屾櫙 +// /// </summary> +// Button btnDoorlockBg; +// #endregion - /// <summary> - /// 瀵嗙爜浣跨敤閫夋嫨鐨勮缁嗗唴瀹规彁绀� - /// </summary> - Button btnTipMsg; +// /// <summary> +// /// 瀵嗙爜浣跨敤閫夋嫨鐨勮缁嗗唴瀹规彁绀� +// /// </summary> +// Button btnTipMsg; - /// <summary> - /// 瑙i攣鏂瑰紡鍖哄煙view - /// </summary> - VerticalScrolViewLayout unlockOptionView; +// /// <summary> +// /// 瑙i攣鏂瑰紡鍖哄煙view +// /// </summary> +// VerticalScrolViewLayout unlockOptionView; - /// <summary> - /// 瀵嗙爜璁剧疆鏂囨湰 - /// 浜嬩欢璺宠浆鎸夐挳 - /// </summary> - Button btnPasswordUnlockTitle; - /// <summary> - /// 淇敼瀵嗙爜鏂囨湰 - /// 浜嬩欢璺宠浆鎸夐挳 - /// </summary> - Button btnResetPasswordTitle; +// /// <summary> +// /// 瀵嗙爜璁剧疆鏂囨湰 +// /// 浜嬩欢璺宠浆鎸夐挳 +// /// </summary> +// Button btnPasswordUnlockTitle; +// /// <summary> +// /// 淇敼瀵嗙爜鏂囨湰 +// /// 浜嬩欢璺宠浆鎸夐挳 +// /// </summary> +// Button btnResetPasswordTitle; - /// <summary> - /// 鎵嬪娍璁剧疆鏂囨湰 - /// 浜嬩欢璺宠浆鎸夐挳 - /// </summary> - Button btnGestureUnlockTitle; - /// <summary> - /// 淇敼鎵嬪娍瀵嗙爜 - /// 浜嬩欢璺宠浆鎸夐挳 - /// </summary> - Button btnResetGestureTitle; +// /// <summary> +// /// 鎵嬪娍璁剧疆鏂囨湰 +// /// 浜嬩欢璺宠浆鎸夐挳 +// /// </summary> +// Button btnGestureUnlockTitle; +// /// <summary> +// /// 淇敼鎵嬪娍瀵嗙爜 +// /// 浜嬩欢璺宠浆鎸夐挳 +// /// </summary> +// Button btnResetGestureTitle; - /// <summary> - /// 鎸囩汗璁剧疆鏂囨湰 - /// 浜嬩欢璺宠浆鎸夐挳 - /// </summary> - Button btnFingerprintUnlockSwtichIcon; - /// <summary> - /// 闈㈠ID璁剧疆鏂囨湰 - /// 浜嬩欢璺宠浆鎸夐挳 - /// </summary> - Button btnFaceIdUnlockSwtichIcon; +// /// <summary> +// /// 鎸囩汗璁剧疆鏂囨湰 +// /// 浜嬩欢璺宠浆鎸夐挳 +// /// </summary> +// Button btnFingerprintUnlockSwtichIcon; +// /// <summary> +// /// 闈㈠ID璁剧疆鏂囨湰 +// /// 浜嬩欢璺宠浆鎸夐挳 +// /// </summary> +// Button btnFaceIdUnlockSwtichIcon; - /// <summary> - /// 鎸囩汗瑙i攣鏂瑰紡Row - /// </summary> - FrameLayout fingerprintUnlockDiv; - /// <summary> - /// 闈㈠瑙i攣鏂瑰紡Row - /// </summary> - FrameLayout faceIdUnlockDiv; - #endregion +// /// <summary> +// /// 鎸囩汗瑙i攣鏂瑰紡Row +// /// </summary> +// FrameLayout fingerprintUnlockDiv; +// /// <summary> +// /// 闈㈠瑙i攣鏂瑰紡Row +// /// </summary> +// FrameLayout faceIdUnlockDiv; +// #endregion - /// <summary> - /// 鏄惁鏀寔鎸囩汗瑙i攣 - /// </summary> - bool sTouchID = false; - /// <summary> - /// 鏄惁鏀寔闈㈠瑙i攣 - /// </summary> - bool sFaceID = false; +// /// <summary> +// /// 鏄惁鏀寔鎸囩汗瑙i攣 +// /// </summary> +// bool sTouchID = false; +// /// <summary> +// /// 鏄惁鏀寔闈㈠瑙i攣 +// /// </summary> +// bool sFaceID = false; - public AppUnlockSettingsPage() - { - bodyView = this; - } +// public AppUnlockSettingsPage() +// { +// bodyView = this; +// } - public void LoadPage() - { - bodyView.BackgroundColor = CSS_Color.BackgroundColor; - //濡傛灉鐢ㄦ埛閰嶇疆浜嗛渶瑕佽В閿佺殑鐣岄潰浣嗘槸娌℃湁璁剧疆瀵嗙爜锛屽垯鍦ㄨ繑鍥炴椂娓呯┖闇�瑕佽В閿佺殑鐣岄潰 - Action action = () => { - if(UserInfo.Current.appUnlockPage.Count > 0&& UserInfo.Current.appUnlockPasswrod == "") - { - UserInfo.Current.appUnlockPage = new System.Collections.Generic.List<string>(); - UserInfo.Current.SaveUserInfo(); - } - }; - new TopViewDiv(bodyView, Language.StringByID(StringId.InterpretationSettings)).LoadTopView(action); +// public void LoadPage() +// { +// bodyView.BackgroundColor = CSS_Color.BackgroundColor; +// //濡傛灉鐢ㄦ埛閰嶇疆浜嗛渶瑕佽В閿佺殑鐣岄潰浣嗘槸娌℃湁璁剧疆瀵嗙爜锛屽垯鍦ㄨ繑鍥炴椂娓呯┖闇�瑕佽В閿佺殑鐣岄潰 +// Action action = () => { +// if(UserInfo.Current.appUnlockPage.Count > 0&& UserInfo.Current.appUnlockPasswrod == "") +// { +// UserInfo.Current.appUnlockPage = new System.Collections.Generic.List<string>(); +// UserInfo.Current.SaveUserInfo(); +// } +// }; +// new TopViewDiv(bodyView, Language.StringByID(StringId.InterpretationSettings)).LoadTopView(action); - topContentView = new FrameLayout() - { - Y = Application.GetRealHeight(64), - Height = Application.GetRealWidth(332), - BackgroundColor = CSS_Color.MainBackgroundColor - }; - bodyView.AddChidren(topContentView); +// topContentView = new FrameLayout() +// { +// Y = Application.GetRealHeight(64), +// Height = Application.GetRealWidth(332), +// BackgroundColor = CSS_Color.MainBackgroundColor +// }; +// bodyView.AddChidren(topContentView); - Button btnTip1 = new Button() - { - Y = Application.GetRealHeight(8), - Height = Application.GetRealHeight(30), - TextAlignment = TextAlignment.Center, - IsBold = true, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextID = StringId.PleaseSelectThePageToBeUnlocked, - BackgroundColor = CSS_Color.MainBackgroundColor, - }; - topContentView.AddChidren(btnTip1); +// Button btnTip1 = new Button() +// { +// Y = Application.GetRealHeight(8), +// Height = Application.GetRealHeight(30), +// TextAlignment = TextAlignment.Center, +// IsBold = true, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.SubheadingFontSize, +// TextID = StringId.PleaseSelectThePageToBeUnlocked, +// BackgroundColor = CSS_Color.MainBackgroundColor, +// }; +// topContentView.AddChidren(btnTip1); - Button btnTip2 = new Button() - { - Y = btnTip1.Bottom, - Height = Application.GetRealHeight(25), - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.PromptingColor1, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - BackgroundColor = CSS_Color.MainBackgroundColor, - TextID = StringId.MultipleChoicesOfPagesYouNeedToProtect, - IsMoreLines = true, - }; - topContentView.AddChidren(btnTip2); - if(Language.CurrentLanguage == "Engligh") - { - btnTip2.Height = Application.GetRealHeight(30); - } +// Button btnTip2 = new Button() +// { +// Y = btnTip1.Bottom, +// Height = Application.GetRealHeight(25), +// TextAlignment = TextAlignment.Center, +// TextColor = CSS_Color.PromptingColor1, +// TextSize = CSS_FontSize.PromptFontSize_FirstLevel, +// BackgroundColor = CSS_Color.MainBackgroundColor, +// TextID = StringId.MultipleChoicesOfPagesYouNeedToProtect, +// IsMoreLines = true, +// }; +// topContentView.AddChidren(btnTip2); +// if(Language.CurrentLanguage == "Engligh") +// { +// btnTip2.Height = Application.GetRealHeight(30); +// } - optionView = new HorizontalScrolViewLayout() - { - Y = Application.GetRealWidth(143 - 64), - Height = Application.GetRealWidth(209), - BackgroundColor = CSS_Color.MainBackgroundColor, - }; - topContentView.AddChidren(optionView); +// optionView = new HorizontalScrolViewLayout() +// { +// Y = Application.GetRealWidth(143 - 64), +// Height = Application.GetRealWidth(209), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// }; +// topContentView.AddChidren(optionView); - LoadView_OptionView(); +// LoadView_OptionView(); - btnTipMsg = new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealWidth(288), - Width = Application.GetRealWidth(311), - Height = Application.GetRealWidth(28), - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.FirstLevelTitleColor, - SelectedTextColor = CSS_Color.FirstLevelTitleColor, - BorderColor = CSS_Color.MainColor, - BorderWidth = 1, - Radius = 1, - TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, - TextID = StringId.UnprotectedTipMsg, - }; - topContentView.AddChidren(btnTipMsg); - if (Language.CurrentLanguage == "Engligh") - { - btnTip2.Height = Application.GetRealHeight(40); - topContentView.Height = Application.GetRealHeight(360); - } +// btnTipMsg = new Button() +// { +// Gravity = Gravity.CenterHorizontal, +// Y = Application.GetRealWidth(288), +// Width = Application.GetRealWidth(311), +// Height = Application.GetRealWidth(28), +// TextAlignment = TextAlignment.Center, +// TextColor = CSS_Color.FirstLevelTitleColor, +// SelectedTextColor = CSS_Color.FirstLevelTitleColor, +// BorderColor = CSS_Color.MainColor, +// BorderWidth = 1, +// Radius = 1, +// TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, +// TextID = StringId.UnprotectedTipMsg, +// }; +// topContentView.AddChidren(btnTipMsg); +// if (Language.CurrentLanguage == "Engligh") +// { +// btnTip2.Height = Application.GetRealHeight(40); +// topContentView.Height = Application.GetRealHeight(360); +// } - LoadEventList(); +// LoadEventList(); - LoadView_UnlockView(); +// LoadView_UnlockView(); - } - /// <summary> - /// 鍔犺浇閫夐」鍗� - /// </summary> - void LoadView_OptionView() - { - #region Unprotected - optionView.AddChidren(new Button() { Width = Application.GetRealWidth(24) }); +// } +// /// <summary> +// /// 鍔犺浇閫夐」鍗� +// /// </summary> +// void LoadView_OptionView() +// { +// #region Unprotected +// optionView.AddChidren(new Button() { Width = Application.GetRealWidth(24) }); - FrameLayout unprotectedDiv = new FrameLayout() - { - Width = Application.GetRealWidth(94), - }; - optionView.AddChidren(unprotectedDiv); +// FrameLayout unprotectedDiv = new FrameLayout() +// { +// Width = Application.GetRealWidth(94), +// }; +// optionView.AddChidren(unprotectedDiv); - btnUnprotectedBg = new Button() - { - Height = Application.GetRealWidth(174), - UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/1.png", - SelectedImagePath = "PersonalCenter/AppUnlockSetting/1On.png" - }; - unprotectedDiv.AddChidren(btnUnprotectedBg); +// btnUnprotectedBg = new Button() +// { +// Height = Application.GetRealWidth(174), +// UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/1.png", +// SelectedImagePath = "PersonalCenter/AppUnlockSetting/1On.png" +// }; +// unprotectedDiv.AddChidren(btnUnprotectedBg); - btnUnprotectedSelectionIcon = new Button() - { - X = Application.GetRealWidth(5), - Y = Application.GetRealWidth(174), - Width = Application.GetRealWidth(30), - Height = Application.GetRealWidth(30), - UnSelectedImagePath = "Public/ChooseIcon.png", - SelectedImagePath = "Public/ChooseOnIcon.png", - }; - unprotectedDiv.AddChidren(btnUnprotectedSelectionIcon); +// btnUnprotectedSelectionIcon = new Button() +// { +// X = Application.GetRealWidth(5), +// Y = Application.GetRealWidth(174), +// Width = Application.GetRealWidth(30), +// Height = Application.GetRealWidth(30), +// UnSelectedImagePath = "Public/ChooseIcon.png", +// SelectedImagePath = "Public/ChooseOnIcon.png", +// }; +// unprotectedDiv.AddChidren(btnUnprotectedSelectionIcon); - btnUnprotectedSelectionTip = new Button() - { - X = Application.GetRealWidth(30), - Y = Application.GetRealWidth(174), - Width = Application.GetRealWidth(74), - Height = Application.GetRealWidth(30), - TextID = StringId.Unprotected, - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, - SelectedTextColor = CSS_Color.MainColor, - }; - unprotectedDiv.AddChidren(btnUnprotectedSelectionTip); - #endregion +// btnUnprotectedSelectionTip = new Button() +// { +// X = Application.GetRealWidth(30), +// Y = Application.GetRealWidth(174), +// Width = Application.GetRealWidth(74), +// Height = Application.GetRealWidth(30), +// TextID = StringId.Unprotected, +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, +// SelectedTextColor = CSS_Color.MainColor, +// }; +// unprotectedDiv.AddChidren(btnUnprotectedSelectionTip); +// #endregion - #region Startup - optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) }); +// #region Startup +// optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) }); - FrameLayout startupDiv = new FrameLayout() - { - Width = Application.GetRealWidth(94), - }; - optionView.AddChidren(startupDiv); +// FrameLayout startupDiv = new FrameLayout() +// { +// Width = Application.GetRealWidth(94), +// }; +// optionView.AddChidren(startupDiv); - btnStartupBg = new Button() - { - Height = Application.GetRealWidth(174), - UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/2.png", - SelectedImagePath = "PersonalCenter/AppUnlockSetting/2On.png" - }; - startupDiv.AddChidren(btnStartupBg); +// btnStartupBg = new Button() +// { +// Height = Application.GetRealWidth(174), +// UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/2.png", +// SelectedImagePath = "PersonalCenter/AppUnlockSetting/2On.png" +// }; +// startupDiv.AddChidren(btnStartupBg); - btnStartupSelectionIcon = new Button() - { - X = Application.GetRealWidth(5), - Y = Application.GetRealWidth(174), - Width = Application.GetRealWidth(30), - Height = Application.GetRealWidth(30), - UnSelectedImagePath = "Public/ChooseIcon.png", - SelectedImagePath = "Public/ChooseOnIcon.png", - }; - startupDiv.AddChidren(btnStartupSelectionIcon); +// btnStartupSelectionIcon = new Button() +// { +// X = Application.GetRealWidth(5), +// Y = Application.GetRealWidth(174), +// Width = Application.GetRealWidth(30), +// Height = Application.GetRealWidth(30), +// UnSelectedImagePath = "Public/ChooseIcon.png", +// SelectedImagePath = "Public/ChooseOnIcon.png", +// }; +// startupDiv.AddChidren(btnStartupSelectionIcon); - btnStartupSelectionTip = new Button() - { - X = Application.GetRealWidth(30), - Y = Application.GetRealWidth(174), - Width = Application.GetRealWidth(74), - Height = Application.GetRealWidth(30), - TextID = StringId.AtStartup, - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - SelectedTextColor = CSS_Color.MainColor, - TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel - }; - startupDiv.AddChidren(btnStartupSelectionTip); - #endregion +// btnStartupSelectionTip = new Button() +// { +// X = Application.GetRealWidth(30), +// Y = Application.GetRealWidth(174), +// Width = Application.GetRealWidth(74), +// Height = Application.GetRealWidth(30), +// TextID = StringId.AtStartup, +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// SelectedTextColor = CSS_Color.MainColor, +// TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel +// }; +// startupDiv.AddChidren(btnStartupSelectionTip); +// #endregion - #region F3闃舵 - #region Security - //optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) }); +// #region F3闃舵 +// #region Security +// //optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) }); - //FrameLayout securityDiv = new FrameLayout() - //{ - // Width = Application.GetRealWidth(94), - //}; - //optionView.AddChidren(securityDiv); +// //FrameLayout securityDiv = new FrameLayout() +// //{ +// // Width = Application.GetRealWidth(94), +// //}; +// //optionView.AddChidren(securityDiv); - //btnSecurityBg = new Button() - //{ - // Height = Application.GetRealWidth(174), - // UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/3.png", - // SelectedImagePath = "PersonalCenter/AppUnlockSetting/3On.png" - //}; - //securityDiv.AddChidren(btnSecurityBg); +// //btnSecurityBg = new Button() +// //{ +// // Height = Application.GetRealWidth(174), +// // UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/3.png", +// // SelectedImagePath = "PersonalCenter/AppUnlockSetting/3On.png" +// //}; +// //securityDiv.AddChidren(btnSecurityBg); - //btnSecuritySelectionIcon = new Button() - //{ - // X = Application.GetRealWidth(5), - // Y = Application.GetRealWidth(174), - // Width = Application.GetRealWidth(30), - // Height = Application.GetRealWidth(30), - // UnSelectedImagePath = "Public/ChooseIcon.png", - // SelectedImagePath = "Public/ChooseOnIcon.png", - //}; - //securityDiv.AddChidren(btnSecuritySelectionIcon); +// //btnSecuritySelectionIcon = new Button() +// //{ +// // X = Application.GetRealWidth(5), +// // Y = Application.GetRealWidth(174), +// // Width = Application.GetRealWidth(30), +// // Height = Application.GetRealWidth(30), +// // UnSelectedImagePath = "Public/ChooseIcon.png", +// // SelectedImagePath = "Public/ChooseOnIcon.png", +// //}; +// //securityDiv.AddChidren(btnSecuritySelectionIcon); - //btnSecuritySelectionTip = new Button() - //{ - // X = Application.GetRealWidth(30), - // Y = Application.GetRealWidth(174), - // Width = Application.GetRealWidth(74), - // Height = Application.GetRealWidth(30), - // TextID = StringId.DefenseAndUndefense, - // TextAlignment = TextAlignment.CenterLeft, - // TextColor = CSS_Color.FirstLevelTitleColor, - // SelectedTextColor = CSS_Color.MainColor, - // TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel - //}; - //securityDiv.AddChidren(btnSecuritySelectionTip); - #endregion +// //btnSecuritySelectionTip = new Button() +// //{ +// // X = Application.GetRealWidth(30), +// // Y = Application.GetRealWidth(174), +// // Width = Application.GetRealWidth(74), +// // Height = Application.GetRealWidth(30), +// // TextID = StringId.DefenseAndUndefense, +// // TextAlignment = TextAlignment.CenterLeft, +// // TextColor = CSS_Color.FirstLevelTitleColor, +// // SelectedTextColor = CSS_Color.MainColor, +// // TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel +// //}; +// //securityDiv.AddChidren(btnSecuritySelectionTip); +// #endregion - #region Doorlock - optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) }); +// #region Doorlock +// optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) }); - FrameLayout doorlockDiv = new FrameLayout() - { - Width = Application.GetRealWidth(94), - }; - optionView.AddChidren(doorlockDiv); +// FrameLayout doorlockDiv = new FrameLayout() +// { +// Width = Application.GetRealWidth(94), +// }; +// optionView.AddChidren(doorlockDiv); - btnDoorlockBg = new Button() - { - Height = Application.GetRealWidth(174), - UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/4.png", - SelectedImagePath = "PersonalCenter/AppUnlockSetting/4On.png" - }; - doorlockDiv.AddChidren(btnDoorlockBg); +// btnDoorlockBg = new Button() +// { +// Height = Application.GetRealWidth(174), +// UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/4.png", +// SelectedImagePath = "PersonalCenter/AppUnlockSetting/4On.png" +// }; +// doorlockDiv.AddChidren(btnDoorlockBg); - btnDoorlockSelectionIcon = new Button() - { - X = Application.GetRealWidth(5), - Y = Application.GetRealWidth(174), - Width = Application.GetRealWidth(30), - Height = Application.GetRealWidth(30), - UnSelectedImagePath = "Public/ChooseIcon.png", - SelectedImagePath = "Public/ChooseOnIcon.png", - }; - doorlockDiv.AddChidren(btnDoorlockSelectionIcon); +// btnDoorlockSelectionIcon = new Button() +// { +// X = Application.GetRealWidth(5), +// Y = Application.GetRealWidth(174), +// Width = Application.GetRealWidth(30), +// Height = Application.GetRealWidth(30), +// UnSelectedImagePath = "Public/ChooseIcon.png", +// SelectedImagePath = "Public/ChooseOnIcon.png", +// }; +// doorlockDiv.AddChidren(btnDoorlockSelectionIcon); - btnDoorlockSelectionTip = new Button() - { - X = Application.GetRealWidth(30), - Y = Application.GetRealWidth(174), - Width = Application.GetRealWidth(74), - Height = Application.GetRealWidth(30), - TextID = StringId.RemoteUnlocking, - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - SelectedTextColor = CSS_Color.MainColor, - TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel - }; - doorlockDiv.AddChidren(btnDoorlockSelectionTip); - #endregion - #endregion +// btnDoorlockSelectionTip = new Button() +// { +// X = Application.GetRealWidth(30), +// Y = Application.GetRealWidth(174), +// Width = Application.GetRealWidth(74), +// Height = Application.GetRealWidth(30), +// TextID = StringId.RemoteUnlocking, +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// SelectedTextColor = CSS_Color.MainColor, +// TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel +// }; +// doorlockDiv.AddChidren(btnDoorlockSelectionTip); +// #endregion +// #endregion - optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) }); - } +// optionView.AddChidren(new Button() { Width = Application.GetRealWidth(16) }); +// } - /// <summary> - /// 鍔犺浇瑙i攣鏂瑰紡鍖哄煙 - /// </summary> - void LoadView_UnlockView() - { - if(unlockOptionView!= null) - { - unlockOptionView.RemoveAll(); - } - unlockOptionView = new VerticalScrolViewLayout() - { - Y = topContentView.Bottom + Application.GetRealHeight(8), - Height = Application.GetRealHeight(260), - BackgroundColor = CSS_Color.MainBackgroundColor, - ScrollEnabled = false, - Visible = UserInfo.Current.appUnlockPage.Count > 0 - }; - bodyView.AddChidren(unlockOptionView); +// /// <summary> +// /// 鍔犺浇瑙i攣鏂瑰紡鍖哄煙 +// /// </summary> +// void LoadView_UnlockView() +// { +// if(unlockOptionView!= null) +// { +// unlockOptionView.RemoveAll(); +// } +// unlockOptionView = new VerticalScrolViewLayout() +// { +// Y = topContentView.Bottom + Application.GetRealHeight(8), +// Height = Application.GetRealHeight(260), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// ScrollEnabled = false, +// Visible = UserInfo.Current.appUnlockPage.Count > 0 +// }; +// bodyView.AddChidren(unlockOptionView); - #region 鏍囬鏍� - var unlockTitleDiv = new FrameLayout() - { - Height = Application.GetRealHeight(59), - }; - unlockOptionView.AddChidren(unlockTitleDiv); +// #region 鏍囬鏍� +// var unlockTitleDiv = new FrameLayout() +// { +// Height = Application.GetRealHeight(59), +// }; +// unlockOptionView.AddChidren(unlockTitleDiv); - var btnUnlockTitle = new Button() - { - X = Application.GetRealWidth(16), - Y = Application.GetRealWidth(6), - Width = Application.GetRealWidth(263), - Height = Application.GetRealWidth(26), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - IsBold = true, - TextSize = CSS_FontSize.SubheadingFontSize, - TextID = StringId.SetUnlockingMethod, - }; - unlockTitleDiv.AddChidren(btnUnlockTitle); +// var btnUnlockTitle = new Button() +// { +// X = Application.GetRealWidth(16), +// Y = Application.GetRealWidth(6), +// Width = Application.GetRealWidth(263), +// Height = Application.GetRealWidth(26), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// IsBold = true, +// TextSize = CSS_FontSize.SubheadingFontSize, +// TextID = StringId.SetUnlockingMethod, +// }; +// unlockTitleDiv.AddChidren(btnUnlockTitle); - var btnUnlockTitleTip = new Button() - { - X = Application.GetRealWidth(16), - Y = btnUnlockTitle.Bottom, - Width = Application.GetRealWidth(263), - Height = Application.GetRealWidth(21), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.PromptingColor1, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextID = StringId.ValidForNativeOnly, - }; - unlockTitleDiv.AddChidren(btnUnlockTitleTip); +// var btnUnlockTitleTip = new Button() +// { +// X = Application.GetRealWidth(16), +// Y = btnUnlockTitle.Bottom, +// Width = Application.GetRealWidth(263), +// Height = Application.GetRealWidth(21), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.PromptingColor1, +// TextSize = CSS_FontSize.PromptFontSize_FirstLevel, +// TextID = StringId.ValidForNativeOnly, +// }; +// unlockTitleDiv.AddChidren(btnUnlockTitleTip); - unlockOptionView.AddChidren(new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(359), - Height = 1, - BackgroundColor = CSS_Color.BackgroundColor, - }); - #endregion +// unlockOptionView.AddChidren(new Button() +// { +// X = Application.GetRealWidth(16), +// Width = Application.GetRealWidth(359), +// Height = 1, +// BackgroundColor = CSS_Color.BackgroundColor, +// }); +// #endregion - #region 瀵嗙爜瑙i攣 - var passwordUnlockDiv = new FrameLayout() - { - Height = Application.GetRealHeight(50), - }; - if ( !UserInfo.Current.appUnlockType.Contains("2")) - { - unlockOptionView.AddChidren(passwordUnlockDiv); - } +// #region 瀵嗙爜瑙i攣 +// var passwordUnlockDiv = new FrameLayout() +// { +// Height = Application.GetRealHeight(50), +// }; +// if ( !UserInfo.Current.appUnlockType.Contains("2")) +// { +// unlockOptionView.AddChidren(passwordUnlockDiv); +// } - var btnPasswordUnlockIcon = new Button() - { - X = Application.GetRealWidth(16), - Gravity = Gravity.CenterVertical, - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/PasswordIcon.png", - }; - passwordUnlockDiv.AddChidren(btnPasswordUnlockIcon); +// var btnPasswordUnlockIcon = new Button() +// { +// X = Application.GetRealWidth(16), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetRealWidth(32), +// Height = Application.GetRealWidth(32), +// UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/PasswordIcon.png", +// }; +// passwordUnlockDiv.AddChidren(btnPasswordUnlockIcon); - //var btnPasswordUnlockRightIcon = new Button() - //{ - // X = Application.GetRealWidth(339), - // Gravity = Gravity.CenterVertical, - // Width = Application.GetMinRealAverage(16), - // Height = Application.GetMinRealAverage(16), - // UnSelectedImagePath = "Public/Right.png", - //}; - //passwordUnlockDiv.AddChidren(btnPasswordUnlockRightIcon); +// //var btnPasswordUnlockRightIcon = new Button() +// //{ +// // X = Application.GetRealWidth(339), +// // Gravity = Gravity.CenterVertical, +// // Width = Application.GetMinRealAverage(16), +// // Height = Application.GetMinRealAverage(16), +// // UnSelectedImagePath = "Public/Right.png", +// //}; +// //passwordUnlockDiv.AddChidren(btnPasswordUnlockRightIcon); - var btnPasswordUnlockkSwtichIcon = new Button() - { - X = Application.GetRealWidth(322), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(38), - Height = Application.GetMinRealAverage(38), - UnSelectedImagePath = "Public/Switch_2.png", - SelectedImagePath = "Public/SwitchOn_2.png", - IsSelected = UserInfo.Current.appUnlockType.Contains("1") - }; - passwordUnlockDiv.AddChidren(btnPasswordUnlockkSwtichIcon); +// var btnPasswordUnlockkSwtichIcon = new Button() +// { +// X = Application.GetRealWidth(322), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetMinRealAverage(38), +// Height = Application.GetMinRealAverage(38), +// UnSelectedImagePath = "Public/Switch_2.png", +// SelectedImagePath = "Public/SwitchOn_2.png", +// IsSelected = UserInfo.Current.appUnlockType.Contains("1") +// }; +// passwordUnlockDiv.AddChidren(btnPasswordUnlockkSwtichIcon); - btnPasswordUnlockTitle = new Button() - { - X = Application.GetRealWidth(66), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextID = StringId.PasswordUnlock, - }; - passwordUnlockDiv.AddChidren(btnPasswordUnlockTitle); +// btnPasswordUnlockTitle = new Button() +// { +// X = Application.GetRealWidth(66), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.TextFontSize, +// TextID = StringId.PasswordUnlock, +// }; +// passwordUnlockDiv.AddChidren(btnPasswordUnlockTitle); - unlockOptionView.AddChidren(new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(343), - Height = 1, - BackgroundColor = CSS_Color.BackgroundColor, - }); - #endregion +// unlockOptionView.AddChidren(new Button() +// { +// X = Application.GetRealWidth(16), +// Width = Application.GetRealWidth(343), +// Height = 1, +// BackgroundColor = CSS_Color.BackgroundColor, +// }); +// #endregion - #region 淇敼瀵嗙爜 - var resetPasswordDiv = new FrameLayout() - { - Height = Application.GetRealHeight(50), - }; - if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("1")) - { - unlockOptionView.AddChidren(resetPasswordDiv); - } - var btnPasswordUnlockRightIcon = new Button() - { - X = Application.GetRealWidth(339), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), - UnSelectedImagePath = "Public/Right.png", - }; - resetPasswordDiv.AddChidren(btnPasswordUnlockRightIcon); +// #region 淇敼瀵嗙爜 +// var resetPasswordDiv = new FrameLayout() +// { +// Height = Application.GetRealHeight(50), +// }; +// if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("1")) +// { +// unlockOptionView.AddChidren(resetPasswordDiv); +// } +// var btnPasswordUnlockRightIcon = new Button() +// { +// X = Application.GetRealWidth(339), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetMinRealAverage(16), +// Height = Application.GetMinRealAverage(16), +// UnSelectedImagePath = "Public/Right.png", +// }; +// resetPasswordDiv.AddChidren(btnPasswordUnlockRightIcon); - btnResetPasswordTitle = new Button() - { - X = Application.GetRealWidth(66), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextID = StringId.ResetDigitalPassword, - }; - resetPasswordDiv.AddChidren(btnResetPasswordTitle); +// btnResetPasswordTitle = new Button() +// { +// X = Application.GetRealWidth(66), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.TextFontSize, +// TextID = StringId.ResetDigitalPassword, +// }; +// resetPasswordDiv.AddChidren(btnResetPasswordTitle); - if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("1")) - { - unlockOptionView.AddChidren(new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(343), - Height = 1, - BackgroundColor = CSS_Color.BackgroundColor, - }); - } - #endregion +// if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("1")) +// { +// unlockOptionView.AddChidren(new Button() +// { +// X = Application.GetRealWidth(16), +// Width = Application.GetRealWidth(343), +// Height = 1, +// BackgroundColor = CSS_Color.BackgroundColor, +// }); +// } +// #endregion - #region 鎵嬪娍瑙i攣 - var gestureUnlockDiv = new FrameLayout() - { - Height = Application.GetRealHeight(50), - }; - if (!UserInfo.Current.appUnlockType.Contains("1")) - { - unlockOptionView.AddChidren(gestureUnlockDiv); - } - var btnGestureUnlockIcon = new Button() - { - X = Application.GetRealWidth(16), - Gravity = Gravity.CenterVertical, - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureIcon.png", - }; - gestureUnlockDiv.AddChidren(btnGestureUnlockIcon); +// #region 鎵嬪娍瑙i攣 +// var gestureUnlockDiv = new FrameLayout() +// { +// Height = Application.GetRealHeight(50), +// }; +// if (!UserInfo.Current.appUnlockType.Contains("1")) +// { +// unlockOptionView.AddChidren(gestureUnlockDiv); +// } +// var btnGestureUnlockIcon = new Button() +// { +// X = Application.GetRealWidth(16), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetRealWidth(32), +// Height = Application.GetRealWidth(32), +// UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureIcon.png", +// }; +// gestureUnlockDiv.AddChidren(btnGestureUnlockIcon); - //var btnGestureUnlockRightIcon = new Button() - //{ - // X = Application.GetRealWidth(339), - // Gravity = Gravity.CenterVertical, - // Width = Application.GetMinRealAverage(16), - // Height = Application.GetMinRealAverage(16), - // UnSelectedImagePath = "Public/Right.png", - //}; - //gestureUnlockDiv.AddChidren(btnGestureUnlockRightIcon); +// //var btnGestureUnlockRightIcon = new Button() +// //{ +// // X = Application.GetRealWidth(339), +// // Gravity = Gravity.CenterVertical, +// // Width = Application.GetMinRealAverage(16), +// // Height = Application.GetMinRealAverage(16), +// // UnSelectedImagePath = "Public/Right.png", +// //}; +// //gestureUnlockDiv.AddChidren(btnGestureUnlockRightIcon); - var btnGestureUnlockkSwtichIcon = new Button() - { - X = Application.GetRealWidth(322), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(38), - Height = Application.GetMinRealAverage(38), - UnSelectedImagePath = "Public/Switch_2.png", - SelectedImagePath = "Public/SwitchOn_2.png", - IsSelected = UserInfo.Current.appUnlockType.Contains("2") - }; - gestureUnlockDiv.AddChidren(btnGestureUnlockkSwtichIcon); +// var btnGestureUnlockkSwtichIcon = new Button() +// { +// X = Application.GetRealWidth(322), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetMinRealAverage(38), +// Height = Application.GetMinRealAverage(38), +// UnSelectedImagePath = "Public/Switch_2.png", +// SelectedImagePath = "Public/SwitchOn_2.png", +// IsSelected = UserInfo.Current.appUnlockType.Contains("2") +// }; +// gestureUnlockDiv.AddChidren(btnGestureUnlockkSwtichIcon); - btnGestureUnlockTitle = new Button() - { - X = Application.GetRealWidth(66), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextID = StringId.GestureUnlock, - }; - gestureUnlockDiv.AddChidren(btnGestureUnlockTitle); +// btnGestureUnlockTitle = new Button() +// { +// X = Application.GetRealWidth(66), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.TextFontSize, +// TextID = StringId.GestureUnlock, +// }; +// gestureUnlockDiv.AddChidren(btnGestureUnlockTitle); - if (!UserInfo.Current.appUnlockType.Contains("1")) - { - unlockOptionView.AddChidren(new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(343), - Height = 1, - BackgroundColor = CSS_Color.BackgroundColor, - }); - } - #endregion +// if (!UserInfo.Current.appUnlockType.Contains("1")) +// { +// unlockOptionView.AddChidren(new Button() +// { +// X = Application.GetRealWidth(16), +// Width = Application.GetRealWidth(343), +// Height = 1, +// BackgroundColor = CSS_Color.BackgroundColor, +// }); +// } +// #endregion - #region 淇敼鎵嬪娍 - var resetGestureDiv = new FrameLayout() - { - Height = Application.GetRealHeight(50), - }; - if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("2")) - { - unlockOptionView.AddChidren(resetGestureDiv); - } - var btnGestureRightIcon = new Button() - { - X = Application.GetRealWidth(339), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), - UnSelectedImagePath = "Public/Right.png", - }; - resetGestureDiv.AddChidren(btnGestureRightIcon); +// #region 淇敼鎵嬪娍 +// var resetGestureDiv = new FrameLayout() +// { +// Height = Application.GetRealHeight(50), +// }; +// if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("2")) +// { +// unlockOptionView.AddChidren(resetGestureDiv); +// } +// var btnGestureRightIcon = new Button() +// { +// X = Application.GetRealWidth(339), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetMinRealAverage(16), +// Height = Application.GetMinRealAverage(16), +// UnSelectedImagePath = "Public/Right.png", +// }; +// resetGestureDiv.AddChidren(btnGestureRightIcon); - btnResetGestureTitle = new Button() - { - X = Application.GetRealWidth(66), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextID = StringId.ResetGesturePassword, - }; - resetGestureDiv.AddChidren(btnResetGestureTitle); +// btnResetGestureTitle = new Button() +// { +// X = Application.GetRealWidth(66), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.TextFontSize, +// TextID = StringId.ResetGesturePassword, +// }; +// resetGestureDiv.AddChidren(btnResetGestureTitle); - if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("2")) - { - unlockOptionView.AddChidren(new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(343), - Height = 1, - BackgroundColor = CSS_Color.BackgroundColor, - }); - } - #endregion +// if (UserInfo.Current.appUnlockPasswrod != "" && UserInfo.Current.appUnlockType.Contains("2")) +// { +// unlockOptionView.AddChidren(new Button() +// { +// X = Application.GetRealWidth(16), +// Width = Application.GetRealWidth(343), +// Height = 1, +// BackgroundColor = CSS_Color.BackgroundColor, +// }); +// } +// #endregion - #region 鏌ヨ璁惧鏄惁鏀寔闈㈠ID锛屾寚绾笽D - TouchIDUtils.TouchIDSupperType type = TouchIDUtils.getTouchIDSupperType(); - if (type == TouchIDUtils.TouchIDSupperType.TouchID) - { - sTouchID = true; - MainPage.Log("KK锛氭敮鎸乀ouchID"); - } - else if (type == TouchIDUtils.TouchIDSupperType.FaceID) - { - sFaceID = true; - MainPage.Log("KK锛氭敮鎸丗aceID"); - } +// #region 鏌ヨ璁惧鏄惁鏀寔闈㈠ID锛屾寚绾笽D +// TouchIDUtils.TouchIDSupperType type = TouchIDUtils.getTouchIDSupperType(); +// if (type == TouchIDUtils.TouchIDSupperType.TouchID) +// { +// sTouchID = true; +// MainPage.Log("KK锛氭敮鎸乀ouchID"); +// } +// else if (type == TouchIDUtils.TouchIDSupperType.FaceID) +// { +// sFaceID = true; +// MainPage.Log("KK锛氭敮鎸丗aceID"); +// } - #endregion +// #endregion - #region 鎸囩汗瑙i攣 - fingerprintUnlockDiv = new FrameLayout() - { - Height = Application.GetRealHeight(51), - }; - if (sTouchID && UserInfo.Current.appUnlockPasswrod != "" && !UserInfo.Current.appUnlockType.Contains("4")) - { - unlockOptionView.AddChidren(fingerprintUnlockDiv); - } +// #region 鎸囩汗瑙i攣 +// fingerprintUnlockDiv = new FrameLayout() +// { +// Height = Application.GetRealHeight(51), +// }; +// if (sTouchID && UserInfo.Current.appUnlockPasswrod != "" && !UserInfo.Current.appUnlockType.Contains("4")) +// { +// unlockOptionView.AddChidren(fingerprintUnlockDiv); +// } - var btnFingerprintUnlockIcon = new Button() - { - X = Application.GetRealWidth(16), - Gravity = Gravity.CenterVertical, - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FingerprintIcon.png", - }; - fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockIcon); +// var btnFingerprintUnlockIcon = new Button() +// { +// X = Application.GetRealWidth(16), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetRealWidth(32), +// Height = Application.GetRealWidth(32), +// UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FingerprintIcon.png", +// }; +// fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockIcon); - var btnFingerprintUnlockTitle = new Button() - { - X = Application.GetRealWidth(66), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextID = StringId.FingerprintUnlock, - }; - fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockTitle); +// var btnFingerprintUnlockTitle = new Button() +// { +// X = Application.GetRealWidth(66), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.TextFontSize, +// TextID = StringId.FingerprintUnlock, +// }; +// fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockTitle); - btnFingerprintUnlockSwtichIcon = new Button() - { - X = Application.GetRealWidth(322), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(38), - Height = Application.GetMinRealAverage(38), - UnSelectedImagePath = "Public/Switch_2.png", - SelectedImagePath = "Public/SwitchOn_2.png", - IsSelected = UserInfo.Current.appUnlockType.Contains("3") - }; - fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockSwtichIcon); +// btnFingerprintUnlockSwtichIcon = new Button() +// { +// X = Application.GetRealWidth(322), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetMinRealAverage(38), +// Height = Application.GetMinRealAverage(38), +// UnSelectedImagePath = "Public/Switch_2.png", +// SelectedImagePath = "Public/SwitchOn_2.png", +// IsSelected = UserInfo.Current.appUnlockType.Contains("3") +// }; +// fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockSwtichIcon); - fingerprintUnlockDiv.AddChidren(new Button() - { - X = Application.GetRealWidth(16), - Y = Application.GetRealHeight(50), - Width = Application.GetRealWidth(343), - Height = 1, - BackgroundColor = CSS_Color.BackgroundColor, - //Visible = sFaceID - }); +// fingerprintUnlockDiv.AddChidren(new Button() +// { +// X = Application.GetRealWidth(16), +// Y = Application.GetRealHeight(50), +// Width = Application.GetRealWidth(343), +// Height = 1, +// BackgroundColor = CSS_Color.BackgroundColor, +// //Visible = sFaceID +// }); - #endregion +// #endregion - #region 闈㈠ID瑙i攣 - faceIdUnlockDiv = new FrameLayout() - { - Height = Application.GetRealHeight(50), - }; - if (sFaceID && UserInfo.Current.appUnlockPasswrod != "" && !UserInfo.Current.appUnlockType.Contains("3")) - { - unlockOptionView.AddChidren(faceIdUnlockDiv); - } - var btnFaceIdUnlockIcon = new Button() - { - X = Application.GetRealWidth(16), - Gravity = Gravity.CenterVertical, - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FaceIdIcon.png", - }; - faceIdUnlockDiv.AddChidren(btnFaceIdUnlockIcon); +// #region 闈㈠ID瑙i攣 +// faceIdUnlockDiv = new FrameLayout() +// { +// Height = Application.GetRealHeight(50), +// }; +// if (sFaceID && UserInfo.Current.appUnlockPasswrod != "" && !UserInfo.Current.appUnlockType.Contains("3")) +// { +// unlockOptionView.AddChidren(faceIdUnlockDiv); +// } +// var btnFaceIdUnlockIcon = new Button() +// { +// X = Application.GetRealWidth(16), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetRealWidth(32), +// Height = Application.GetRealWidth(32), +// UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FaceIdIcon.png", +// }; +// faceIdUnlockDiv.AddChidren(btnFaceIdUnlockIcon); - var btnFaceIdUnlockTitle = new Button() - { - X = Application.GetRealWidth(66), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextID = StringId.FaceIdUnlock, - }; - faceIdUnlockDiv.AddChidren(btnFaceIdUnlockTitle); +// var btnFaceIdUnlockTitle = new Button() +// { +// X = Application.GetRealWidth(66), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.TextFontSize, +// TextID = StringId.FaceIdUnlock, +// }; +// faceIdUnlockDiv.AddChidren(btnFaceIdUnlockTitle); - btnFaceIdUnlockSwtichIcon = new Button() - { - X = Application.GetRealWidth(322), - Gravity= Gravity.CenterVertical, - Width = Application.GetMinRealAverage(38), - Height = Application.GetMinRealAverage(38), - UnSelectedImagePath = "Public/Switch_2.png", - SelectedImagePath = "Public/SwitchOn_2.png", - IsSelected = UserInfo.Current.appUnlockType.Contains("4") - }; - faceIdUnlockDiv.AddChidren(btnFaceIdUnlockSwtichIcon); +// btnFaceIdUnlockSwtichIcon = new Button() +// { +// X = Application.GetRealWidth(322), +// Gravity= Gravity.CenterVertical, +// Width = Application.GetMinRealAverage(38), +// Height = Application.GetMinRealAverage(38), +// UnSelectedImagePath = "Public/Switch_2.png", +// SelectedImagePath = "Public/SwitchOn_2.png", +// IsSelected = UserInfo.Current.appUnlockType.Contains("4") +// }; +// faceIdUnlockDiv.AddChidren(btnFaceIdUnlockSwtichIcon); - #endregion +// #endregion - LoadEvet_SkipEventList(); +// //LoadEvet_SkipEventList(); - } +// } - } -} +// } +//} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs index 43e9dc3..3c02d0d 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs @@ -1,551 +1,551 @@ -锘縰sing System; -using Shared; +锘�//using System; +//using Shared; -namespace HDL_ON.UI -{ - public partial class AppUnlockSettingsPage - { - Action refreshAction; - void LoadEventList() - { - LoadEvent_OptionChange(); - LoadEvent_InitOptionState(); +//namespace HDL_ON.UI +//{ +// public partial class AppUnlockSettingsPage +// { +// Action refreshAction; +// void LoadEventList() +// { +// LoadEvent_OptionChange(); +// LoadEvent_InitOptionState(); - refreshAction = () => - { - LoadView_UnlockView(); - //fingerprintUnlockDiv.Visible = sTouchID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2")); - //faceIdUnlockDiv.Visible = sFaceID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2")); - //btnFingerprintUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("3"); - //btnFaceIdUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("4"); - }; - } +// refreshAction = () => +// { +// LoadView_UnlockView(); +// //fingerprintUnlockDiv.Visible = sTouchID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2")); +// //faceIdUnlockDiv.Visible = sFaceID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2")); +// //btnFingerprintUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("3"); +// //btnFaceIdUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("4"); +// }; +// } - /// <summary> - /// 鍔犺浇瀵嗙爜閫夐」浜嬩欢 - /// </summary> - void LoadEvent_OptionChange() - { - EventHandler<MouseEventArgs> eventHandler1 = (sender, e1) => - { - Action action = () => - { - btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; - btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = false; - #region F3闃舵 - //btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = false; - btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = false; - #endregion +// /// <summary> +// /// 鍔犺浇瀵嗙爜閫夐」浜嬩欢 +// /// </summary> +// void LoadEvent_OptionChange() +// { +// EventHandler<MouseEventArgs> eventHandler1 = (sender, e1) => +// { +// Action action = () => +// { +// btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; +// btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = false; +// #region F3闃舵 +// //btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = false; +// btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = false; +// #endregion - btnTipMsg.TextID = StringId.UnprotectedTipMsg; +// btnTipMsg.TextID = StringId.UnprotectedTipMsg; - UserInfo.Current.appUnlockPage = new System.Collections.Generic.List<string>(); - UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); - UserInfo.Current.appUnlockPasswrod = ""; - UserInfo.Current.SaveUserInfo(); - unlockOptionView.Visible = false; - refreshAction(); - }; - Action action1 = () => - { - if (!btnUnprotectedBg.IsSelected) - { - //1:楠岃瘉鎸囩汗 - if (UserInfo.Current.appUnlockType.Contains("3")) - { - TouchIDVerification_TurnOffUnlock(action); - } - else if (UserInfo.Current.appUnlockType.Contains("4")) - { - //Face ID楠岃瘉 - FaceIDVerification_TurnOffUnlock(action); - } - else if (UserInfo.Current.appUnlockType.Contains("1")) - { - var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("4"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else if (UserInfo.Current.appUnlockType.Contains("2")) - { - var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, action); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("4"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - } - }; +// UserInfo.Current.appUnlockPage = new System.Collections.Generic.List<string>(); +// UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); +// UserInfo.Current.appUnlockPasswrod = ""; +// UserInfo.Current.SaveUserInfo(); +// unlockOptionView.Visible = false; +// refreshAction(); +// }; +// Action action1 = () => +// { +// if (!btnUnprotectedBg.IsSelected) +// { +// //1:楠岃瘉鎸囩汗 +// if (UserInfo.Current.appUnlockType.Contains("3")) +// { +// TouchIDVerification_TurnOffUnlock(action); +// } +// else if (UserInfo.Current.appUnlockType.Contains("4")) +// { +// //Face ID楠岃瘉 +// FaceIDVerification_TurnOffUnlock(action); +// } +// else if (UserInfo.Current.appUnlockType.Contains("1")) +// { +// var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage("4"); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// } +// else if (UserInfo.Current.appUnlockType.Contains("2")) +// { +// var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, action); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage("4"); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// } +// } +// }; - if (UserInfo.Current.appUnlockPasswrod != "") - { - new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TipTurnOffUnlockingSetting, action1); - } - else - { - action(); - } - }; - btnUnprotectedBg.MouseUpEventHandler = eventHandler1; - btnUnprotectedSelectionIcon.MouseUpEventHandler = eventHandler1; - btnUnprotectedSelectionTip.MouseUpEventHandler = eventHandler1; +// if (UserInfo.Current.appUnlockPasswrod != "") +// { +// new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TipTurnOffUnlockingSetting, action1); +// } +// else +// { +// action(); +// } +// }; +// btnUnprotectedBg.MouseUpEventHandler = eventHandler1; +// btnUnprotectedSelectionIcon.MouseUpEventHandler = eventHandler1; +// btnUnprotectedSelectionTip.MouseUpEventHandler = eventHandler1; - EventHandler<MouseEventArgs> eventHandler2 = (sender, e) => - { - bool result = !btnStartupBg.IsSelected; - if (!result) - { - //濡傛灉鍚姩瑙i攣 涓嶈兘鍙栨秷鍚姩瑙i攣 - if (!CheckIfCanDeselect("1")) return; - } - btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = result; +// EventHandler<MouseEventArgs> eventHandler2 = (sender, e) => +// { +// bool result = !btnStartupBg.IsSelected; +// if (!result) +// { +// //濡傛灉鍚姩瑙i攣 涓嶈兘鍙栨秷鍚姩瑙i攣 +// if (!CheckIfCanDeselect("1")) return; +// } +// btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = result; - btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg); - if (result) - { - btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; - if (!UserInfo.Current.appUnlockPage.Contains("1")) - { - UserInfo.Current.appUnlockPage.Add("1"); - if (UserInfo.Current.appUnlockPasswrod != "") - UserInfo.Current.SaveUserInfo(); - } - unlockOptionView.Visible = true; - } - else - { - if (UserInfo.Current.appUnlockPage.Contains("1")) - { - UserInfo.Current.appUnlockPage.Remove("1"); - } - if (UserInfo.Current.appUnlockPage.Count == 0) - { - btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; - btnTipMsg.TextID = StringId.UnprotectedTipMsg; - UserInfo.Current.appUnlockPasswrod = ""; - unlockOptionView.Visible = false; - refreshAction(); - } - UserInfo.Current.SaveUserInfo(); - } - }; - btnStartupBg.MouseUpEventHandler = eventHandler2; - btnStartupSelectionIcon.MouseUpEventHandler = eventHandler2; - btnStartupSelectionTip.MouseUpEventHandler = eventHandler2; +// btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg); +// if (result) +// { +// btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; +// if (!UserInfo.Current.appUnlockPage.Contains("1")) +// { +// UserInfo.Current.appUnlockPage.Add("1"); +// if (UserInfo.Current.appUnlockPasswrod != "") +// UserInfo.Current.SaveUserInfo(); +// } +// unlockOptionView.Visible = true; +// } +// else +// { +// if (UserInfo.Current.appUnlockPage.Contains("1")) +// { +// UserInfo.Current.appUnlockPage.Remove("1"); +// } +// if (UserInfo.Current.appUnlockPage.Count == 0) +// { +// btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; +// btnTipMsg.TextID = StringId.UnprotectedTipMsg; +// UserInfo.Current.appUnlockPasswrod = ""; +// unlockOptionView.Visible = false; +// refreshAction(); +// } +// UserInfo.Current.SaveUserInfo(); +// } +// }; +// btnStartupBg.MouseUpEventHandler = eventHandler2; +// btnStartupSelectionIcon.MouseUpEventHandler = eventHandler2; +// btnStartupSelectionTip.MouseUpEventHandler = eventHandler2; - #region F3闃舵 - //EventHandler<MouseEventArgs> eventHandler3 = (sender, e) => - //{ - // bool result = !btnSecurityBg.IsSelected; - // if (!result) - // { - // //濡傛灉鍙墿甯冮槻/鎾ら槻涓�绉� 涓嶈兘鍙栨秷甯冮槻/鎾ら槻 - // if (!CheckIfCanDeselect("2")) return; - // } - // btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = result; - // btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg); - // if (result) - // { - // btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; - // if (!UserInfo.Current.appUnlockPage.Contains("2")) - // { - // UserInfo.Current.appUnlockPage.Add("2"); - // if (UserInfo.Current.appUnlockPasswrod != "") - // UserInfo.Current.SaveUserInfo(); - // } - // unlockOptionView.Visible = true; - // } - // else - // { - // if (UserInfo.Current.appUnlockPage.Contains("2")) - // { - // UserInfo.Current.appUnlockPage.Remove("2"); - // } - // if (UserInfo.Current.appUnlockPage.Count == 0) - // { - // btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = result; - // btnTipMsg.TextID = StringId.UnprotectedTipMsg; - // UserInfo.Current.appUnlockPasswrod = ""; - // unlockOptionView.Visible = false; - // refreshAction(); - // } - // UserInfo.Current.SaveUserInfo(); - // } - //}; - //btnSecurityBg.MouseUpEventHandler = eventHandler3; - //btnSecuritySelectionIcon.MouseUpEventHandler = eventHandler3; - //btnSecuritySelectionTip.MouseUpEventHandler = eventHandler3; +// #region F3闃舵 +// //EventHandler<MouseEventArgs> eventHandler3 = (sender, e) => +// //{ +// // bool result = !btnSecurityBg.IsSelected; +// // if (!result) +// // { +// // //濡傛灉鍙墿甯冮槻/鎾ら槻涓�绉� 涓嶈兘鍙栨秷甯冮槻/鎾ら槻 +// // if (!CheckIfCanDeselect("2")) return; +// // } +// // btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = result; +// // btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg); +// // if (result) +// // { +// // btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; +// // if (!UserInfo.Current.appUnlockPage.Contains("2")) +// // { +// // UserInfo.Current.appUnlockPage.Add("2"); +// // if (UserInfo.Current.appUnlockPasswrod != "") +// // UserInfo.Current.SaveUserInfo(); +// // } +// // unlockOptionView.Visible = true; +// // } +// // else +// // { +// // if (UserInfo.Current.appUnlockPage.Contains("2")) +// // { +// // UserInfo.Current.appUnlockPage.Remove("2"); +// // } +// // if (UserInfo.Current.appUnlockPage.Count == 0) +// // { +// // btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = result; +// // btnTipMsg.TextID = StringId.UnprotectedTipMsg; +// // UserInfo.Current.appUnlockPasswrod = ""; +// // unlockOptionView.Visible = false; +// // refreshAction(); +// // } +// // UserInfo.Current.SaveUserInfo(); +// // } +// //}; +// //btnSecurityBg.MouseUpEventHandler = eventHandler3; +// //btnSecuritySelectionIcon.MouseUpEventHandler = eventHandler3; +// //btnSecuritySelectionTip.MouseUpEventHandler = eventHandler3; - EventHandler<MouseEventArgs> eventHandler4 = (sender, e) => - { - bool result = !btnDoorlockBg.IsSelected; - if (!result) - { - //濡傛灉鍙墿杩滅▼寮�閿佷笉鑳藉彇娑堣繙绋嬪紑閿� - if (!CheckIfCanDeselect("3")) return; - } +// EventHandler<MouseEventArgs> eventHandler4 = (sender, e) => +// { +// bool result = !btnDoorlockBg.IsSelected; +// if (!result) +// { +// //濡傛灉鍙墿杩滅▼寮�閿佷笉鑳藉彇娑堣繙绋嬪紑閿� +// if (!CheckIfCanDeselect("3")) return; +// } - btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = result; +// btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = result; - btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg); - if (result) - { - btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; - if (!UserInfo.Current.appUnlockPage.Contains("3")) - { - UserInfo.Current.appUnlockPage.Add("3"); - if (UserInfo.Current.appUnlockPasswrod != "") - UserInfo.Current.SaveUserInfo(); - } - unlockOptionView.Visible = true; - } - else - { - if (UserInfo.Current.appUnlockPage.Contains("3")) - { - UserInfo.Current.appUnlockPage.Remove("3"); - } - if (UserInfo.Current.appUnlockPage.Count == 0) - { - btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; - btnTipMsg.TextID = StringId.UnprotectedTipMsg; - UserInfo.Current.appUnlockPasswrod = ""; - unlockOptionView.Visible = false; - refreshAction(); - } - UserInfo.Current.SaveUserInfo(); - } - }; - btnDoorlockBg.MouseUpEventHandler = eventHandler4; - btnDoorlockSelectionIcon.MouseUpEventHandler = eventHandler4; - btnDoorlockSelectionTip.MouseUpEventHandler = eventHandler4; - #endregion - } +// btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg); +// if (result) +// { +// btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; +// if (!UserInfo.Current.appUnlockPage.Contains("3")) +// { +// UserInfo.Current.appUnlockPage.Add("3"); +// if (UserInfo.Current.appUnlockPasswrod != "") +// UserInfo.Current.SaveUserInfo(); +// } +// unlockOptionView.Visible = true; +// } +// else +// { +// if (UserInfo.Current.appUnlockPage.Contains("3")) +// { +// UserInfo.Current.appUnlockPage.Remove("3"); +// } +// if (UserInfo.Current.appUnlockPage.Count == 0) +// { +// btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; +// btnTipMsg.TextID = StringId.UnprotectedTipMsg; +// UserInfo.Current.appUnlockPasswrod = ""; +// unlockOptionView.Visible = false; +// refreshAction(); +// } +// UserInfo.Current.SaveUserInfo(); +// } +// }; +// btnDoorlockBg.MouseUpEventHandler = eventHandler4; +// btnDoorlockSelectionIcon.MouseUpEventHandler = eventHandler4; +// btnDoorlockSelectionTip.MouseUpEventHandler = eventHandler4; +// #endregion +// } - /// <summary> - /// 鍔犺浇鐢ㄦ埛瀵嗙爜閫夐」鐘舵�� - /// </summary> - void LoadEvent_InitOptionState() - { - if (UserInfo.Current.appUnlockPage.Count == 0) - { - btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; - } - else - { - if (UserInfo.Current.appUnlockPage.Contains("1")) - { - btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = true; - btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg); - } - #region F3闃舵 - //if (UserInfo.Current.appUnlockPage.Contains("2")) - //{ - // btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true; - // btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg); - //} - if (UserInfo.Current.appUnlockPage.Contains("3")) - { - btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = true; - btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg); - } - #endregion - } - } +// /// <summary> +// /// 鍔犺浇鐢ㄦ埛瀵嗙爜閫夐」鐘舵�� +// /// </summary> +// void LoadEvent_InitOptionState() +// { +// if (UserInfo.Current.appUnlockPage.Count == 0) +// { +// btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; +// } +// else +// { +// if (UserInfo.Current.appUnlockPage.Contains("1")) +// { +// btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = true; +// btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg); +// } +// #region F3闃舵 +// //if (UserInfo.Current.appUnlockPage.Contains("2")) +// //{ +// // btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true; +// // btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg); +// //} +// if (UserInfo.Current.appUnlockPage.Contains("3")) +// { +// btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = true; +// btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg); +// } +// #endregion +// } +// } - /// <summary> - /// 瀵嗙爜璁剧疆璺宠浆浜嬩欢鍒楄〃 - /// </summary> - void LoadEvet_SkipEventList() - { - btnPasswordUnlockTitle.MouseUpEventHandler = (sender, e) => - { - var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(UserInfo.Current.appUnlockType.Contains("1") ? "3" : "1"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; +// /// <summary> +// /// 瀵嗙爜璁剧疆璺宠浆浜嬩欢鍒楄〃 +// /// </summary> +// void LoadEvet_SkipEventList() +// { +// btnPasswordUnlockTitle.MouseUpEventHandler = (sender, e) => +// { +// var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage(UserInfo.Current.appUnlockType.Contains("1") ? "3" : "1"); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// }; - btnResetPasswordTitle.MouseUpEventHandler = (sender, e) => - { - var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("2"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; +// btnResetPasswordTitle.MouseUpEventHandler = (sender, e) => +// { +// var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage("2"); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// }; - btnGestureUnlockTitle.MouseUpEventHandler = (sender, e) => - { - var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(UserInfo.Current.appUnlockType.Contains("2") ? "3" : "1"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - btnResetGestureTitle.MouseUpEventHandler = (sender, e) => - { - var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("2");//2020-12-11 - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; +// btnGestureUnlockTitle.MouseUpEventHandler = (sender, e) => +// { +// var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage(UserInfo.Current.appUnlockType.Contains("2") ? "3" : "1"); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// }; +// btnResetGestureTitle.MouseUpEventHandler = (sender, e) => +// { +// var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage("2");//2020-12-11 +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// }; - if (sTouchID) - { - btnFingerprintUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) => - { - TouchIDVerification_SwtichOnOff(); - }; - } - if (sFaceID) - { - btnFaceIdUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) => - { - FaceIDVerification_SwtichOnOff(); - }; - } - } +// if (sTouchID) +// { +// btnFingerprintUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) => +// { +// TouchIDVerification_SwtichOnOff(); +// }; +// } +// if (sFaceID) +// { +// btnFaceIdUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) => +// { +// FaceIDVerification_SwtichOnOff(); +// }; +// } +// } - /// <summary> - /// 鍒ゆ柇鏄惁鑳藉鍙栨秷锛屽鏋滃彧鍓╂渶鍚庝竴绉嶈В閿佹柟妗堢姝㈠彇娑� - /// </summary> - /// <param name="appUnlockPageType">1:鍚姩鏃� 2:甯冮槻鎾ら槻鏃� 3:杩滅▼寮�閿佹椂</param> - /// <returns></returns> - bool CheckIfCanDeselect(string appUnlockPageType) - { - if (UserInfo.Current.appUnlockPage.Count == 1 && UserInfo.Current.appUnlockPage.Contains(appUnlockPageType)) - { - return false; - } +// /// <summary> +// /// 鍒ゆ柇鏄惁鑳藉鍙栨秷锛屽鏋滃彧鍓╂渶鍚庝竴绉嶈В閿佹柟妗堢姝㈠彇娑� +// /// </summary> +// /// <param name="appUnlockPageType">1:鍚姩鏃� 2:甯冮槻鎾ら槻鏃� 3:杩滅▼寮�閿佹椂</param> +// /// <returns></returns> +// bool CheckIfCanDeselect(string appUnlockPageType) +// { +// if (UserInfo.Current.appUnlockPage.Count == 1 && UserInfo.Current.appUnlockPage.Contains(appUnlockPageType)) +// { +// return false; +// } - return true; - } +// return true; +// } - /// <summary> - /// 闈㈠ID楠岃瘉寮圭獥 - /// </summary> - /// <param name="successAction"></param> - /// <param name="goToVerifyPasswordAction"></param> - void FaceIDVerification_Show(Action successAction, Action goToVerifyPasswordAction) - { - //鎻愮ず鏁板瓧瀵嗙爜楠岃瘉杩樻槸缁樺埗鎵嬪娍楠岃瘉 - string verificationTitleString = GetVerificationTitleString(); +// /// <summary> +// /// 闈㈠ID楠岃瘉寮圭獥 +// /// </summary> +// /// <param name="successAction"></param> +// /// <param name="goToVerifyPasswordAction"></param> +// void FaceIDVerification_Show(Action successAction, Action goToVerifyPasswordAction) +// { +// //鎻愮ず鏁板瓧瀵嗙爜楠岃瘉杩樻槸缁樺埗鎵嬪娍楠岃瘉 +// string verificationTitleString = GetVerificationTitleString(); - TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID)); - TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => - { - if (e == TouchIDUtils.TouchIDState.Success) - { - MainPage.Log("KK:FaceID楠岃瘉鎴愬姛"); - successAction?.Invoke(); - } - else if (e == TouchIDUtils.TouchIDState.NotSupport) - { - MainPage.Log("KK:褰撳墠璁惧涓嶆敮鎸丗aceID楠岃瘉,璇疯緭鍏ュ瘑鐮佹潵楠岃瘉"); - goToVerifyPasswordAction(); - } - else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) - { - MainPage.Log("KK:鐢ㄦ埛閫夋嫨鎵嬪姩杈撳叆瀵嗙爜"); - goToVerifyPasswordAction(); - } - }; - } +// TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID)); +// TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => +// { +// if (e == TouchIDUtils.TouchIDState.Success) +// { +// MainPage.Log("KK:FaceID楠岃瘉鎴愬姛"); +// successAction?.Invoke(); +// } +// else if (e == TouchIDUtils.TouchIDState.NotSupport) +// { +// MainPage.Log("KK:褰撳墠璁惧涓嶆敮鎸丗aceID楠岃瘉,璇疯緭鍏ュ瘑鐮佹潵楠岃瘉"); +// goToVerifyPasswordAction(); +// } +// else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) +// { +// MainPage.Log("KK:鐢ㄦ埛閫夋嫨鎵嬪姩杈撳叆瀵嗙爜"); +// goToVerifyPasswordAction(); +// } +// }; +// } - /// <summary> - /// 闈㈠ID寮�鍚拰鍏抽棴 - /// </summary> - /// <param name="successAction">楠岃瘉鎴愬姛浜嬩欢</param> - void FaceIDVerification_SwtichOnOff() - { - //4:闈㈠ID - string faceIDUnlockType = "4"; - //6:闈㈠ID寮�鍏� - string optionType = "6"; - //鎴愬姛浜嬩欢 - Action successAction = () => - { - var result = btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected; - if (result) - { - if (!UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) - { - UserInfo.Current.appUnlockType.Add(faceIDUnlockType); - UserInfo.Current.SaveUserInfo(); - } - } - else - { - if (UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) - { - UserInfo.Current.appUnlockType.Remove(faceIDUnlockType); - UserInfo.Current.SaveUserInfo(); - } - } - }; +// /// <summary> +// /// 闈㈠ID寮�鍚拰鍏抽棴 +// /// </summary> +// /// <param name="successAction">楠岃瘉鎴愬姛浜嬩欢</param> +// void FaceIDVerification_SwtichOnOff() +// { +// //4:闈㈠ID +// string faceIDUnlockType = "4"; +// //6:闈㈠ID寮�鍏� +// string optionType = "6"; +// //鎴愬姛浜嬩欢 +// Action successAction = () => +// { +// var result = btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected; +// if (result) +// { +// if (!UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) +// { +// UserInfo.Current.appUnlockType.Add(faceIDUnlockType); +// UserInfo.Current.SaveUserInfo(); +// } +// } +// else +// { +// if (UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) +// { +// UserInfo.Current.appUnlockType.Remove(faceIDUnlockType); +// UserInfo.Current.SaveUserInfo(); +// } +// } +// }; - //璺宠浆鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� - Action goToVerifyPasswordAction = () => - { - //鍏抽棴瑙i攣楠岃瘉 - GotogoToVerifyPasswordPage(optionType, successAction); - }; +// //璺宠浆鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� +// Action goToVerifyPasswordAction = () => +// { +// //鍏抽棴瑙i攣楠岃瘉 +// GotogoToVerifyPasswordPage(optionType, successAction); +// }; - FaceIDVerification_Show(successAction, goToVerifyPasswordAction); +// FaceIDVerification_Show(successAction, goToVerifyPasswordAction); - } +// } - /// <summary> - /// FaceID楠岃瘉 鍏抽棴瑙i攣璁剧疆 - /// </summary> - /// <param name="action">楠岃瘉鎴愬姛浜嬩欢</param> - void FaceIDVerification_TurnOffUnlock(Action successAction) - { - //璋冩暣鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� - Action goToVerifyPasswordAction = () => - { - //鍏抽棴瑙i攣楠岃瘉 - GotogoToVerifyPasswordPage("4", successAction); - }; +// /// <summary> +// /// FaceID楠岃瘉 鍏抽棴瑙i攣璁剧疆 +// /// </summary> +// /// <param name="action">楠岃瘉鎴愬姛浜嬩欢</param> +// void FaceIDVerification_TurnOffUnlock(Action successAction) +// { +// //璋冩暣鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� +// Action goToVerifyPasswordAction = () => +// { +// //鍏抽棴瑙i攣楠岃瘉 +// GotogoToVerifyPasswordPage("4", successAction); +// }; - FaceIDVerification_Show(successAction, goToVerifyPasswordAction); - } +// FaceIDVerification_Show(successAction, goToVerifyPasswordAction); +// } - /// <summary> - /// 鎸囩汗ID缁熶竴寮瑰嚭 - /// </summary> - /// <param name="optionType"></param> - /// <param name="successAction"></param> - /// <param name="goToVerifyPasswordAction"></param> - void TouchIDVerification_Show(Action successAction, Action goToVerifyPasswordAction) - { - //鎻愮ず鏁板瓧瀵嗙爜楠岃瘉杩樻槸缁樺埗鎵嬪娍楠岃瘉 - string verificationTitleString = GetVerificationTitleString(); +// /// <summary> +// /// 鎸囩汗ID缁熶竴寮瑰嚭 +// /// </summary> +// /// <param name="optionType"></param> +// /// <param name="successAction"></param> +// /// <param name="goToVerifyPasswordAction"></param> +// void TouchIDVerification_Show(Action successAction, Action goToVerifyPasswordAction) +// { +// //鎻愮ず鏁板瓧瀵嗙爜楠岃瘉杩樻槸缁樺埗鎵嬪娍楠岃瘉 +// string verificationTitleString = GetVerificationTitleString(); - TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); - TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => - { - if (e == TouchIDUtils.TouchIDState.NotSupport) - { - MainPage.Log("KK:褰撳墠璁惧涓嶆敮鎸乀ouchID楠岃瘉,璇疯緭鍏ュ瘑鐮佹潵楠岃瘉"); - goToVerifyPasswordAction?.Invoke(); - } - else if (e == TouchIDUtils.TouchIDState.Success) - { - MainPage.Log("KK:TouchID楠岃瘉鎴愬姛"); - successAction?.Invoke(); - } - else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) - { - MainPage.Log("KK:鐢ㄦ埛閫夋嫨鎵嬪姩杈撳叆瀵嗙爜"); - goToVerifyPasswordAction?.Invoke(); - } +// TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); +// TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => +// { +// if (e == TouchIDUtils.TouchIDState.NotSupport) +// { +// MainPage.Log("KK:褰撳墠璁惧涓嶆敮鎸乀ouchID楠岃瘉,璇疯緭鍏ュ瘑鐮佹潵楠岃瘉"); +// goToVerifyPasswordAction?.Invoke(); +// } +// else if (e == TouchIDUtils.TouchIDState.Success) +// { +// MainPage.Log("KK:TouchID楠岃瘉鎴愬姛"); +// successAction?.Invoke(); +// } +// else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) +// { +// MainPage.Log("KK:鐢ㄦ埛閫夋嫨鎵嬪姩杈撳叆瀵嗙爜"); +// goToVerifyPasswordAction?.Invoke(); +// } - }; - } +// }; +// } - /// <summary> - /// 鎸囩汗ID寮�鍚拰鍏抽棴 5:鎸囩汗ID寮�鍏� - /// </summary> - void TouchIDVerification_SwtichOnOff() - { - //鎸囩汗鍏抽棴鎴愬姛浜嬩欢 鎴愬姛浜嬩欢 - Action successAction = () => - { - var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected; - if (result) - { - if (!UserInfo.Current.appUnlockType.Contains("3")) - { - UserInfo.Current.appUnlockType.Add("3"); - UserInfo.Current.SaveUserInfo(); - } - } - else - { - if (UserInfo.Current.appUnlockType.Contains("3")) - { - UserInfo.Current.appUnlockType.Remove("3"); - UserInfo.Current.SaveUserInfo(); - } - } - }; +// /// <summary> +// /// 鎸囩汗ID寮�鍚拰鍏抽棴 5:鎸囩汗ID寮�鍏� +// /// </summary> +// void TouchIDVerification_SwtichOnOff() +// { +// //鎸囩汗鍏抽棴鎴愬姛浜嬩欢 鎴愬姛浜嬩欢 +// Action successAction = () => +// { +// var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected; +// if (result) +// { +// if (!UserInfo.Current.appUnlockType.Contains("3")) +// { +// UserInfo.Current.appUnlockType.Add("3"); +// UserInfo.Current.SaveUserInfo(); +// } +// } +// else +// { +// if (UserInfo.Current.appUnlockType.Contains("3")) +// { +// UserInfo.Current.appUnlockType.Remove("3"); +// UserInfo.Current.SaveUserInfo(); +// } +// } +// }; - //5:鎸囩汗ID寮�鍏� - string optionType = "5"; - //璺宠浆鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� - Action goToVerifyPasswordAction = () => - { - //5:鎸囩汗ID寮�鍏� - GotogoToVerifyPasswordPage(optionType, successAction); - }; +// //5:鎸囩汗ID寮�鍏� +// string optionType = "5"; +// //璺宠浆鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� +// Action goToVerifyPasswordAction = () => +// { +// //5:鎸囩汗ID寮�鍏� +// GotogoToVerifyPasswordPage(optionType, successAction); +// }; - TouchIDVerification_Show(successAction, goToVerifyPasswordAction); - } +// TouchIDVerification_Show(successAction, goToVerifyPasswordAction); +// } - /// <summary> - /// TouchID楠岃瘉 4:鍏抽棴瑙i攣璁剧疆 - /// </summary> - /// <param name="action">楠岃瘉鎴愬姛浜嬩欢</param> - void TouchIDVerification_TurnOffUnlock(Action successAction) - { - //璺宠浆鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� - Action goToVerifyPasswordAction = () => - { - //4.鍏抽棴瑙i攣楠岃瘉 - GotogoToVerifyPasswordPage("4", successAction); - }; +// /// <summary> +// /// TouchID楠岃瘉 4:鍏抽棴瑙i攣璁剧疆 +// /// </summary> +// /// <param name="action">楠岃瘉鎴愬姛浜嬩欢</param> +// void TouchIDVerification_TurnOffUnlock(Action successAction) +// { +// //璺宠浆鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� +// Action goToVerifyPasswordAction = () => +// { +// //4.鍏抽棴瑙i攣楠岃瘉 +// GotogoToVerifyPasswordPage("4", successAction); +// }; - TouchIDVerification_Show(successAction, goToVerifyPasswordAction); - } +// TouchIDVerification_Show(successAction, goToVerifyPasswordAction); +// } - /// <summary> - /// 璺宠浆鎵嬪娍鎴栬�呭瘑鐮侀獙璇佺晫闈� - /// </summary> - /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> - /// <param name="successAction"></param> - void GotogoToVerifyPasswordPage(string optionType, Action successAction) - { - if (UserInfo.Current.appUnlockType.Contains("1")) - { - var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, successAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(optionType); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else if (UserInfo.Current.appUnlockType.Contains("2")) - { - var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, successAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(optionType); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - } +// /// <summary> +// /// 璺宠浆鎵嬪娍鎴栬�呭瘑鐮侀獙璇佺晫闈� +// /// </summary> +// /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> +// /// <param name="successAction"></param> +// void GotogoToVerifyPasswordPage(string optionType, Action successAction) +// { +// if (UserInfo.Current.appUnlockType.Contains("1")) +// { +// var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, successAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage(optionType); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// } +// else if (UserInfo.Current.appUnlockType.Contains("2")) +// { +// var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, successAction); +// MainPage.BasePageView.AddChidren(page); +// page.LoadPage(optionType); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// } +// } - /// <summary> - /// 鍒ゆ柇鏄惁鏁板瓧楠岃瘉銆佸惁鍒欑粯鍒舵墜鍔块獙璇� - /// </summary> - /// <returns></returns> - bool CheckIfUnlockPassword() - { - return UserInfo.Current.appUnlockType.Contains("1"); - } +// /// <summary> +// /// 鍒ゆ柇鏄惁鏁板瓧楠岃瘉銆佸惁鍒欑粯鍒舵墜鍔块獙璇� +// /// </summary> +// /// <returns></returns> +// bool CheckIfUnlockPassword() +// { +// return UserInfo.Current.appUnlockType.Contains("1"); +// } - /// <summary> - /// 鍒ゆ柇鏄惁鏁板瓧楠岃瘉銆佸惁鍒欑粯鍒舵墜鍔块獙璇� - /// </summary> - /// <returns></returns> - string GetVerificationTitleString() - { - if (CheckIfUnlockPassword()) - { - return Language.StringByID(StringId.PasswordVerification); - } - else - { - return Language.StringByID(StringId.GestureVerification); - } - } - } -} \ No newline at end of file +// /// <summary> +// /// 鍒ゆ柇鏄惁鏁板瓧楠岃瘉銆佸惁鍒欑粯鍒舵墜鍔块獙璇� +// /// </summary> +// /// <returns></returns> +// string GetVerificationTitleString() +// { +// if (CheckIfUnlockPassword()) +// { +// return Language.StringByID(StringId.PasswordVerification); +// } +// else +// { +// return Language.StringByID(StringId.GestureVerification); +// } +// } +// } +//} \ No newline at end of file diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs index 9655256..ebeb336 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs @@ -46,11 +46,38 @@ { IsBackground = true }.Start(); } + BatteryPersentControl batteryControl; /// <summary> /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� /// </summary> private void InitFrameWhiteContent1() { + //鐢垫睜鎺т欢 + this.batteryControl = new BatteryPersentControl(); + //瀹冩湁涓渶灏忕殑X杞� + batteryControl.X = Application.GetRealWidth(104) > base.btnRoomName.Right ? Application.GetRealWidth(104) : base.btnRoomName.Right + Application.GetRealWidth(4); + if (batteryControl.Height > base.btnRoomName.Height) + { + //涓�涓槸25锛屼竴涓槸21锛屽紕涓嶅噯鍒板簳璋佹洿楂�,鍥犱负璁$畻鏂规硶涓嶄竴鏍� + batteryControl.Y = base.btnRoomName.Y - (batteryControl.Height - base.btnRoomName.Height) / 2; + } + else + { + batteryControl.Y = base.btnRoomName.Y + (batteryControl.Height - base.btnRoomName.Height) / 2; + } + batteryControl.InitControl(false); + batteryControl.SetValue(80); + var powerLowTipAttr = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); + if (powerLowTipAttr != null) + { + if (powerLowTipAttr.state.ToLower() == "low") + { + batteryControl.SetValue(20); + } + } + FrameWhiteCentet1.AddChidren(batteryControl); + + btnIcon = new IconViewControl(198) { Gravity = Gravity.CenterHorizontal, @@ -133,8 +160,6 @@ btnSuctionView.IsSelected = false; } } - - else { temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.AlarmStatus); @@ -151,6 +176,19 @@ btnSuctionView.IsSelected = false; } } + + var powerLowTipAttr = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); + if (powerLowTipAttr != null) + { + if (powerLowTipAttr.state.ToLower() == "low") + { + batteryControl.SetValue(20); + } + else + { + batteryControl.SetValue(80); + } + } }); } diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs index a4e92e1..0aef0ed 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs @@ -47,12 +47,38 @@ }) { IsBackground = true }.Start(); } - + BatteryPersentControl batteryControl; /// <summary> /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� /// </summary> private void InitFrameWhiteContent1() { + //鐢垫睜鎺т欢 + this.batteryControl = new BatteryPersentControl(); + //瀹冩湁涓渶灏忕殑X杞� + batteryControl.X = Application.GetRealWidth(104) > base.btnRoomName.Right ? Application.GetRealWidth(104) : base.btnRoomName.Right + Application.GetRealWidth(4); + if (batteryControl.Height > base.btnRoomName.Height) + { + //涓�涓槸25锛屼竴涓槸21锛屽紕涓嶅噯鍒板簳璋佹洿楂�,鍥犱负璁$畻鏂规硶涓嶄竴鏍� + batteryControl.Y = base.btnRoomName.Y - (batteryControl.Height - base.btnRoomName.Height) / 2; + } + else + { + batteryControl.Y = base.btnRoomName.Y + (batteryControl.Height - base.btnRoomName.Height) / 2; + } + batteryControl.InitControl(false); + batteryControl.SetValue(80); + var powerLowTipAttr = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); + if (powerLowTipAttr != null) + { + if(powerLowTipAttr.state.ToLower() == "low") + { + batteryControl.SetValue(20); + } + } + FrameWhiteCentet1.AddChidren(batteryControl); + + btnIcon = new IconViewControl(198) { Gravity = Gravity.CenterHorizontal, @@ -136,6 +162,19 @@ btnSuctionView.IsSelected = false; } } + + var powerLowTipAttr = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); + if (powerLowTipAttr != null) + { + if (powerLowTipAttr.state.ToLower() == "low") + { + batteryControl.SetValue(20); + } + else + { + batteryControl.SetValue(80); + } + } }); } 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/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs index a92197f..0311623 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs @@ -4,6 +4,7 @@ using HDL_ON.DriverLayer; using HDL_ON.Entity; using HDL_ON.UI.CSS; +using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock; using Newtonsoft.Json.Linq; using Shared; @@ -52,12 +53,6 @@ actionRefresh = action; } - public FunctionBaseInfoSetPage() - { - bodyView = this; - - } - public override void RemoveFromParent() { new System.Threading.Thread(() => @@ -89,10 +84,10 @@ ScrollEnabled = false, }; bodyView.AddChidren(contentView); - //鍙瀵硅 - if(function == null) - { + //鍙瀵硅 + if (function.spk == SPK.LinphoneXiMo) + { var linphoneConnectView = new FrameLayout() { Height = Application.GetRealHeight(55), @@ -251,8 +246,6 @@ } - - #region name view var nameView = new FrameLayout() { @@ -396,7 +389,350 @@ // }); #endregion + #region 鍒犻櫎璁惧琛� 搴忓垪鍙� 鍨嬪彿 + if (this.function.spk == SPK.VideoDoorLock) + { + contentView.AddChidren(new Button() + { + Height = Application.GetRealWidth(8), + }); + #region 寮�閿佽缃� + var unlockSettingView = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(unlockSettingView); + + //unlockSettingView.AddChidren(new Button + //{ + // Gravity = Gravity.CenterHorizontal, + // BackgroundColor = CSS_Color.DividingLineColor, + // Width = Application.GetRealWidth(343), + // Height = Application.GetRealHeight(1) + //}); + + var unlockRightBtn = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/RightIcon.png", + }; + unlockSettingView.AddChidren(unlockRightBtn); + + var btnUnlockText = new Button() + { + X = Application.GetRealWidth(16), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.UnlockSetting, + }; + unlockSettingView.AddChidren(btnUnlockText); + + EventHandler<MouseEventArgs> unlockSettingEvent = (sender, e) => + { + var page = new UnlockSettingPage(function); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + btnUnlockText.MouseUpEventHandler = unlockSettingEvent; + #endregion + + #region 闊抽璁剧疆 + var audioSetupView = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(audioSetupView); + + audioSetupView.AddChidren(new Button + { + Gravity = Gravity.CenterHorizontal, + BackgroundColor = CSS_Color.DividingLineColor, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(1) + }); + + var btnAudioSetupRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/RightIcon.png", + }; + audioSetupView.AddChidren(btnAudioSetupRight); + + var btnAudioSetupText = new Button() + { + X = Application.GetRealWidth(16), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.AudioSetup, + }; + audioSetupView.AddChidren(btnAudioSetupText); + btnAudioSetupText.MouseUpEventHandler = (sender, e) => { + var page = new VideoDoorlockAudioSetupPage(function); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + + }; + #endregion + + #region 鐢垫睜绠$悊 + var batteryManagementView = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(batteryManagementView); + + batteryManagementView.AddChidren(new Button + { + Gravity = Gravity.CenterHorizontal, + BackgroundColor = CSS_Color.DividingLineColor, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(1) + }); + + var btnBatteryManagementRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/RightIcon.png", + }; + batteryManagementView.AddChidren(btnBatteryManagementRight); + + var btnBatteryManagementText = new Button() + { + X = Application.GetRealWidth(16), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.BatteryManagement, + }; + batteryManagementView.AddChidren(btnBatteryManagementText); + btnBatteryManagementText.MouseUpEventHandler = (sender, e) => { + var page = new VideoDoorlockBatteryManagementPage(); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + + #endregion + + #region 搴忓垪鍙� + var serialView = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(serialView); + + var serialLineBtn = new Button() + { + Gravity = Gravity.CenterHorizontal, + BackgroundColor = CSS_Color.DividingLineColor, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(1) + }; + serialView.AddChidren(serialLineBtn); + var serialTextBtn = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(160), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.xuliehao, + }; + serialView.AddChidren(serialTextBtn); + var serialValuesBtn = new Button() + { + X = Application.GetRealWidth(106), + Width = Application.GetRealWidth(237), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = this.function.sid, + }; + serialView.AddChidren(serialValuesBtn); + #endregion + + #region 鍨嬪彿 + var modelView = new FrameLayout() + { + Height = Application.GetRealHeight(55), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(modelView); + + var modelLineBtn = new Button() + { + Gravity = Gravity.CenterHorizontal, + BackgroundColor = CSS_Color.DividingLineColor, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(1) + }; + modelView.AddChidren(modelLineBtn); + var modelTextBtn = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(160), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.xinghao, + }; + modelView.AddChidren(modelTextBtn); + var modelValuesBtn = new Button() + { + X = Application.GetRealWidth(106), + Width = Application.GetRealWidth(237), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = this.function.omodel, + }; + modelView.AddChidren(modelValuesBtn); + #endregion + + #region 鍒犻櫎璁惧琛� + contentView.AddChidren(new Button() { + Height = Application.GetRealHeight(48), + }); + + var delTextBtn = new Button() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(220), + Height = Application.GetRealWidth(44), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.WarningColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.DeleteDevice, + Radius = (uint)Application.GetRealWidth(22), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(delTextBtn); + + EventHandler<MouseEventArgs> ClickEvent = (sener, e) => + { + + new HDL_ON.UI.Music.View.TipView().TipBox(-1, StringId.AreYouSureToDeleteThisDevice, () => + { + UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.DelDevice(this.function, (isBool) => + { + Application.RunOnMainThread(() => + { + if (!isBool) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.delFail), + Direction = AMPopTipDirection.None, + }.Show(bodyView); + return; + } + //鍒犻櫎鏈湴鏂囦欢 + UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DeleteFunction(this.function); + this.RemoveFromParent(); + this.actionDel?.Invoke(); + }); + + }); + + }); + }; + delTextBtn.MouseUpEventHandler = ClickEvent; + + #endregion + + + } + #endregion + + #region 鍒犻櫎娴蜂俊鐢佃璁惧 + if (this.function.spk == SPK.ElectricalTvHisense) + { + contentView.AddChidren(new Button() + { + Height = Application.GetRealWidth(8), + }); + + #region 鍒犻櫎璁惧琛� + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(48), + }); + + var delTextBtn = new Button() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(220), + Height = Application.GetRealWidth(44), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.WarningColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.jiebangshebei, + Radius = (uint)Application.GetRealWidth(22), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + //濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳� + if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) + { + contentView.AddChidren(delTextBtn); + } + + + EventHandler<MouseEventArgs> ClickEvent = (sener, e) => + { + + new HDL_ON.UI.Music.View.TipView().TipBox(-1, StringId.AreYouSureToDeleteThisDevice, () => + { + HDL_ON.UI.UI2.FuntionControlView.HisenseTV.Send.Current.DelDevice(this.function.deviceId, (isBool) => + { + Application.RunOnMainThread(() => + { + if (!isBool) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.delFail), + Direction = AMPopTipDirection.None, + }.Show(bodyView); + return; + } + //鍒犻櫎鏈湴鏂囦欢 + UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DeleteFunction(this.function); + this.RemoveFromParent(); + this.actionDel?.Invoke(); + }); + + }); + + }); + }; + delTextBtn.MouseUpEventHandler = ClickEvent; + + #endregion + + + } + #endregion if (function.spk == SPK.ElectricEnergy) { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs index 9cf4210..e41d821 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs @@ -150,7 +150,14 @@ Application.RunOnMainThread(() => { - MusicListView(a31player); + try + { + MusicListView(a31player); + } + catch (Exception ex) + { + MainPage.Log("Error", $"MusicListView 鏂规硶寮傚父锛歿ex.StackTrace}"); + } }); } ///杩涙潵璇讳竴娆¢煶涔愭挱鏀惧櫒鐘舵�� diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs index d219541..a53e62b 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Drawing.Printing; +using HDL_ON.Entity; using HDL_ON.UI.Music; using Shared; @@ -93,6 +94,23 @@ fLayout.AddChidren(clickBackBtn); fLayout.AddChidren(clickSetBtn); + return fLayout; + } + + /// <summary> + /// 鏈�涓婇潰鐨勯偅鍧楁柟娉� + /// </summary> + /// <returns></returns> + public FrameLayout TopFLayoutView2() + { + fLayout.AddChidren(topNameBtn); + fLayout.AddChidren(backBtn); + lineBtn.Y = fLayout.Height - 1; + fLayout.AddChidren(lineBtn); + fLayout.AddChidren(setBtn); + fLayout.AddChidren(clickBackBtn); + fLayout.AddChidren(clickSetBtn); + var btnSetting = new Button() { @@ -106,7 +124,7 @@ btnSetting.MouseUpEventHandler = (sender, e) => { - var infoView = new FunctionBaseInfoSetPage(); + var infoView = new FunctionBaseInfoSetPage(new Entity.Function() { spk = SPK.LinphoneXiMo }, () => { }); MainPage.BasePageView.AddChidren(infoView); infoView.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs index 5bdc129..8597513 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs @@ -24,8 +24,45 @@ #region 甯冨眬鐣岄潰 this.BackgroundColor = MusicColor.ViewColor; var topView = new TopView(); - this.AddChidren(topView.TopFLayoutView()); + //this.AddChidren(topView.TopFLayoutView()); + + + +#if __IOS__ + // 鑾峰彇褰撳墠绯荤粺鐨勭増鏈彿 + string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; + // 灏嗙郴缁熺増鏈瓧绗︿覆杞崲涓� Version 瀵硅薄 + System.Version currentVersion = new System.Version(systemVersion); + // 瀹氫箟 iOS 17 浣滀负姣旇緝鐨勭増鏈� + System.Version version17 = new System.Version(17, 0); + // 姣旇緝褰撳墠鐗堟湰鏄惁澶т簬 iOS 17 + if (currentVersion.CompareTo(version17) > 0) + { + this.AddChidren(topView.TopFLayoutView()); + } + else + { + if (xiMoVideoList.Count > 0) + { + this.AddChidren(topView.TopFLayoutView2()); + } + else + { + this.AddChidren(topView.TopFLayoutView()); + } + topView.topNameBtn.TextID = StringId.keshiduijiang; + } +#else + if (xiMoVideoList.Count > 0) + { + this.AddChidren(topView.TopFLayoutView2()); + } + else + { + this.AddChidren(topView.TopFLayoutView()); + } topView.topNameBtn.TextID = StringId.keshiduijiang; +#endif var pageView = new PageLayout() @@ -127,8 +164,6 @@ /// <param name="video">鍙瀵硅瀵硅薄</param> void View1(FrameLayout view1, List<Video> videoList) { - - #region 甯冨眬鐣岄潰 var bjFl = new FrameLayout { @@ -191,7 +226,6 @@ Width = Application.GetRealWidth(160), Height = Application.GetRealWidth(160), UnSelectedImagePath = "VideoIcon/keshiduijiang.png", - }; bjFl.AddChidren(intercomBtnIcon); -- Gitblit v1.8.0