From a2927467ebfa938a420f392deb6882b35570fd33 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 01 十二月 2020 16:48:06 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/CJL-NEW' --- HDL-ON_Android/libs/armeabi-v7a/libelianjni.so | 0 HDL-ON_Android/Properties/AndroidManifest.xml | 74 + HDL-ON_Android/Assets/Language.ini | 6 HDL-ON_Android/Assets/Phone/Classification/Room/Roombg2.png | 0 HDL-ON_Android/Assets/Phone/Collection/MesCenter/ShareOn.png | 0 HDL-ON_Android/Assets/Phone/Collection/MesCenter/SystemOn.png | 0 HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg6.png | 0 HDL-ON_iOS/HDL-ON_iOS.csproj | 18 HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs | 2 HDL_ON/DAL/Mqtt/MqttClient.cs | 13 HDL_ON/HDL_ON.projitems | 7 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferConfirmPage.cs | 40 HDL-ON_Android/HDL-ON_Android.csproj | 28 HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg5.png | 0 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 18 HDL-ON_iOS/Resources/Phone/Collection/MesCenter/ShareOn.png | 0 HDL_ON/DAL/Server/NewApiRes.cs | 69 + HDL_ON/Common/HDLCommon.cs | 2 HDL-ON_Android/Assets/Phone/Classification/Room/Roombg1.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs | 14 HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Share.png | 0 DLL/Shared.Droid.dll | 0 HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs | 499 +++++++++ HDL-ON_Android/Assets/Phone/Classification/Room/Roombg9.png | 0 HDL_ON/DAL/FileUtils.cs | 15 HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg4.png | 0 HDL_ON/Common/Constant.cs | 21 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs | 50 HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs | 132 + HDL-ON_Android/Assets/Phone/Collection/MesCenter/Alarm.png | 0 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs | 120 + HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Alarm.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs | 4 HDL-ON_iOS/Resources/Phone/Collection/MesCenter/All.png | 0 HDL_ON/Entity/DB_ResidenceData.cs | 94 + HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 6 HDL-ON_Android/Assets/Phone/Collection/MesCenter/All.png | 0 HDL-ON_Android/libs/armeabi-v7a/libjcore127.so | 0 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPage.cs | 4 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPage.cs | 48 HDL-ON_Android/Assets/Phone/Collection/MesCenter/System.png | 0 HDL-ON_Android/Assets/Phone/Classification/Room/Roombg8.png | 0 HDL_ON/DAL/Server/HttpUtil.cs | 12 HDL-ON_iOS/Resources/Phone/.DS_Store | 0 HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg3.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs | 128 + HDL-ON_Android/Assets/Phone/Classification/Room/Roombg7.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs | 21 HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 32 HDL-ON_iOS/Resources/Phone/Collection/MesCenter/SystemOn.png | 0 HDL-ON_iOS/Resources/Phone/Collection/MesCenter/AlarmOn.png | 0 HDL_ON/UI/UI0-Public/RoomGalleryPage.cs | 104 + HDL_ON/UI/UI2/UserPage.cs | 12 HDL-ON_Android/JPush.cs | 186 +++ HDL-ON_Android/Assets/Phone/Classification/Room/Roombg6.png | 0 HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg2.png | 0 DLL/Shared.Droid.xml | 52 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationInputPage.cs | 150 ++ HDL-ON_iOS/AppDelegate.cs | 191 +++ HDL-ON_Android/Assets/Phone/Collection/MesCenter/AllOn.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/ComplaintsPage.cs | 1 HDL-ON_iOS/Resources/Language.ini | 6 DLL/Shared.Droid.HDLWidget.dll | 0 HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs | 5 HDL_ON/UI/UI0-Public/Widget/MenuButton.cs | 95 + HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg1.png | 0 HDL-ON_Android/Assets/Phone/Classification/Room/Roombg5.png | 0 HDL-ON_Android/Application.cs | 63 + HDL-ON_Android/Assets/Phone/Collection/MesCenter/AlarmOn.png | 0 HDL-ON_Android/Assets/Phone/Classification/Room/Roombg10.png | 0 HDL-ON_Android/Assets/Phone/Classification/Room/Roombg4.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs | 68 + HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg9.png | 0 HDL-ON_Android/Assets/Phone/Collection/MesCenter/Share.png | 0 HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg8.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferInputPage.cs | 159 +++ HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs | 140 ++ HDL_ON/UI/UI1-Login/RegisterPage.cs | 2 DLL/Android/JPushAndroid.dll | 0 HDL_ON/DAL/Server/NewAPI.cs | 172 +- HDL-ON_Android/Assets/Phone/Classification/Room/Roombg3.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPageBLL.cs | 4 HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg10.png | 0 HDL_ON/Entity/OnAppConfig.cs | 4 HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg7.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/GetSupport/GetSupportPage.cs | 1 HDL-ON_iOS/Resources/Phone/Collection/MesCenter/System.png | 0 HDL-ON_iOS/Resources/Phone/Collection/MesCenter/AllOn.png | 0 HDL_ON/Common/R.cs | 20 HDL_ON/DAL/Server/HttpServerRequest.cs | 233 ++- 90 files changed, 2,766 insertions(+), 379 deletions(-) diff --git a/DLL/Android/JPushAndroid.dll b/DLL/Android/JPushAndroid.dll new file mode 100644 index 0000000..f92019d --- /dev/null +++ b/DLL/Android/JPushAndroid.dll Binary files differ diff --git a/DLL/Shared.Droid.HDLWidget.dll b/DLL/Shared.Droid.HDLWidget.dll index 20b2fd3..edc580f 100644 --- a/DLL/Shared.Droid.HDLWidget.dll +++ b/DLL/Shared.Droid.HDLWidget.dll Binary files differ diff --git a/DLL/Shared.Droid.dll b/DLL/Shared.Droid.dll index 980ca24..9379ed5 100644 --- a/DLL/Shared.Droid.dll +++ b/DLL/Shared.Droid.dll Binary files differ diff --git a/DLL/Shared.Droid.xml b/DLL/Shared.Droid.xml index 1229952..608df93 100644 --- a/DLL/Shared.Droid.xml +++ b/DLL/Shared.Droid.xml @@ -252,6 +252,17 @@ 鍏抽棴瀹氫綅鏈嶅姟 </summary> </member> + <member name="F:Shared.Application.IsStatusBarBlack"> + <summary> + 褰撳墠鏄惁璁剧疆椤堕儴鐘舵�佹爮瀛椾綋棰滆壊 + </summary> + </member> + <member name="M:Shared.Application.SetStatusBarTextBlack(System.Boolean)"> + <summary> + 璁剧疆椤堕儴鐘舵�佹爮瀛椾綋棰滆壊 + </summary> + <param name="isBlack">鏄惁璁剧疆榛戣壊</param> + </member> <member name="T:Shared.Button"> <summary> Button 鎸夐敭 @@ -1504,6 +1515,16 @@ Y鍧愭爣 </summary> </member> + <member name="F:Shared.Tip.IsTipLong"> + <summary> + 閽堝Android鏈夋晥 + </summary> + </member> + <member name="P:Shared.Tip.CloseTime"> + <summary> + 閽堝iOS鏈夋晥 + </summary> + </member> <member name="M:Shared.Tip.Show(Shared.View)"> <summary> 鐐瑰嚮鍝釜View鏃舵樉璧彁绀� @@ -2070,6 +2091,12 @@ <summary> Y杞村潗鏍� </summary> + </member> + <member name="M:Shared.BaseActivity.HideVirtualButtons(Android.App.Activity)"> + <summary> + HideVirtualButtons + </summary> + <param name="activity"></param> </member> <member name="M:Shared.BaseActivity.SetImagePermission(System.Action{System.Boolean})"> <summary> @@ -3031,16 +3058,6 @@ </summary> <value>鏄惁鍙互婊戝姩</value> </member> - <member name="P:Shared.CurtainRollSeekBar.CurtainPaddingLeftRight"> - <summary> - 杩涘害鏉′笌宸﹀彸杈规杈硅窛 - </summary> - </member> - <member name="P:Shared.CurtainRollSeekBar.CurtainPaddingTop"> - <summary> - 椤堕儴padding - </summary> - </member> <member name="P:Shared.CurtainRollSeekBar.IsOffline"> <summary> 鏄惁绂荤嚎 绂荤嚎鐨勮瘽绂佹婊戝姩骞剁粯鍒惰儗鏅伄鎸″眰 @@ -3537,6 +3554,11 @@ </summary> <value>X鍧愭爣</value> </member> + <member name="P:Shared.DiyImageSeekBar.IsInvertedProgress"> + <summary> + 杩涘害鍊兼槸鍚﹀彇鍙� + </summary> + </member> <member name="F:Shared.DiyImageSeekBar.OnProgressChangedEvent"> <summary> EventHandler @@ -3854,6 +3876,11 @@ </summary> <value>X鍧愭爣</value> </member> + <member name="P:Shared.CurtainSeekBarOn.IsInvertedProgress"> + <summary> + 杩涘害鍊兼槸鍚﹀彇鍙� + </summary> + </member> <member name="F:Shared.CurtainSeekBarOn.OnProgressChangedEvent"> <summary> EventHandler @@ -3946,6 +3973,11 @@ 璁剧疆鏄惁涓虹櫨鍙剁獥鏍峰紡 </summary> </member> + <member name="P:Shared.CurtainRollSeekBarOn.IsInvertedProgress"> + <summary> + 杩涘害鍊兼槸鍚﹀彇鍙� + </summary> + </member> <member name="F:Shared.CurtainRollSeekBarOn.OnProgressChangedEvent"> <summary> EventHandler diff --git a/HDL-ON_Android/Application.cs b/HDL-ON_Android/Application.cs index 1e33f4e..a61ad97 100644 --- a/HDL-ON_Android/Application.cs +++ b/HDL-ON_Android/Application.cs @@ -5,6 +5,7 @@ using Android.Content; using Android.Net; using Android.OS; +using CN.Jpush.Android.Api; using HDL_ON; using Java.Util; using Shared; @@ -60,6 +61,10 @@ { Language.CurrentLanguage = "Chinese"; } +#if Release + //娉ㄥ唽鏋佸厜鎺ㄩ�� + InitJPush(activity); +#endif BaseActivity.NetworkStateChanged += (int obj) => { @@ -111,11 +116,66 @@ MainPage.Log($"缁忕含搴�:::{arg1}:{arg2}"); }; } + + /// <summary> + /// + /// </summary> + /// <param name="activity"></param> + void InitJPush(BaseActivity activity) + { + try + { + //#if Release + //淇濆瓨鑾峰彇鐨勬瀬鍏夋湇鍔″櫒涓婄殑娉ㄥ唽ID鍒版湰鍦版枃浠� + var tokenID = JPushInterface.GetRegistrationID(activity); + Console.WriteLine("RegistrationID: " + tokenID); + if (!string.IsNullOrEmpty(tokenID) && OnAppConfig.Instance.PushDeviceToken != tokenID) + { + OnAppConfig.Instance.PushDeviceToken = tokenID; + OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; + OnAppConfig.Instance.SaveUserConfig(); + } + int loadTokenCount = 0; + System.Threading.Tasks.Task.Run(() => + { + while (string.IsNullOrEmpty(tokenID)) + { + System.Threading.Thread.Sleep(1000); + tokenID = JPushInterface.GetRegistrationID(activity); + Utlis.WriteLine("Sleep.tokenID + " + JPushInterface.GetRegistrationID(activity)); + loadTokenCount++; + if (loadTokenCount > 30) + { + break; + } + } + Utlis.WriteLine("RegistrationID: " + tokenID); + if (!string.IsNullOrEmpty(tokenID) && OnAppConfig.Instance.PushDeviceToken != tokenID) + { + OnAppConfig.Instance.PushDeviceToken = tokenID; + OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; + OnAppConfig.Instance.SaveUserConfig(); + } + }); + + //#endif + } + catch + { + + } + } + public static bool IsShowTip = true; void init() { //鎵嬫満鍚嶇О Android.OS.Build.Manufacturer; - OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; + //OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; +#if Release + //璁剧疆鏋佸厜璋冭瘯妯″紡锛屼负false鏃跺彧鎵撳嵃璀﹀憡淇℃伅 + JPushInterface.SetDebugMode(false); + JPushInterface.Init(this);//淇濆瓨鎵嬫満鍚嶇О鍒版湰鍦版枃浠� +#endif } void checkSomeInfo() { @@ -256,4 +316,5 @@ //BusSocket.Start(); } } + } \ No newline at end of file diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 30d97ad..ae55f72 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -471,7 +471,11 @@ 9036=鍦烘櫙闂 9037=APP浣跨敤杈呭姪 9038=甯歌闂 - +9039=鍒嗕韩涓庡姛鑳� +9040=鎶ヨ绫� +9041=绯荤粺淇℃伅 +9042=淇℃伅涓績 +9043=璇ヨ处鍙峰凡鍦ㄥ叾瀹冭澶囩櫥褰� 10000=鏃犳晥鐧诲綍瀵嗛挜锛岃閲嶆柊鐧诲綍锛� diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg1.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg1.png new file mode 100644 index 0000000..178214d --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg1.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg10.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg10.png new file mode 100644 index 0000000..04d0636 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg10.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg2.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg2.png new file mode 100644 index 0000000..04d6836 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg2.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg3.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg3.png new file mode 100644 index 0000000..36dcfe2 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg3.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg4.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg4.png new file mode 100644 index 0000000..5e98ad4 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg4.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg5.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg5.png new file mode 100644 index 0000000..611457b --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg5.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg6.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg6.png new file mode 100644 index 0000000..7c73be0 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg6.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg7.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg7.png new file mode 100644 index 0000000..b60e2da --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg7.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg8.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg8.png new file mode 100644 index 0000000..0f9f576 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg8.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg9.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg9.png new file mode 100644 index 0000000..e5323ab --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg9.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/Alarm.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/Alarm.png new file mode 100644 index 0000000..ab3e5c8 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/Alarm.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/AlarmOn.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/AlarmOn.png new file mode 100644 index 0000000..5179577 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/AlarmOn.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/All.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/All.png new file mode 100644 index 0000000..fd548d7 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/All.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/AllOn.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/AllOn.png new file mode 100644 index 0000000..60f91b3 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/AllOn.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/Share.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/Share.png new file mode 100644 index 0000000..563bed4 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/Share.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/ShareOn.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/ShareOn.png new file mode 100644 index 0000000..8977640 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/ShareOn.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/System.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/System.png new file mode 100644 index 0000000..c4940d5 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/System.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/SystemOn.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/SystemOn.png new file mode 100644 index 0000000..5c44894 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/SystemOn.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index e1316cb..c04a550 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -125,6 +125,9 @@ <Reference Include="Shared.Droid.JLCountryCode"> <HintPath>..\DLL\Android\Shared.Droid.JLCountryCode.dll</HintPath> </Reference> + <Reference Include="JPushAndroid"> + <HintPath>..\DLL\Android\JPushAndroid.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="MainActivity.cs" /> @@ -135,6 +138,7 @@ <Compile Include="ZXingCustomScanView.cs" /> <Compile Include="ZXingOverlayView.cs" /> <Compile Include="Other\JLCountrycode.cs" /> + <Compile Include="JPush.cs" /> </ItemGroup> <ItemGroup> <None Include="Resources\AboutResources.txt" /> @@ -214,7 +218,7 @@ <Version>12.0.3</Version> </PackageReference> <PackageReference Include="MQTTnet"> - <Version>3.0.8</Version> + <Version>3.0.13</Version> </PackageReference> <PackageReference Include="ZXing.Net.Mobile"> <Version>2.4.1</Version> @@ -593,6 +597,28 @@ <AndroidAsset Include="Assets\Phone\PersonalCenter\Support\Close.png" /> <AndroidAsset Include="Assets\Phone\PersonalCenter\Head.png" /> <AndroidAsset Include="Assets\Phone\PersonalCenter\Transfer.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\All.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\System.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\Alarm.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\AllOn.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\Share.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\AlarmOn.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\ShareOn.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\SystemOn.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg1.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg2.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg3.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg4.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg5.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg6.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg7.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg8.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg9.png" /> + <AndroidAsset Include="Assets\Phone\Classification\Room\Roombg10.png" /> + </ItemGroup> + <ItemGroup> + <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> + <AndroidNativeLibrary Include="libs\armeabi-v7a\libjcore127.so" /> </ItemGroup> <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> diff --git a/HDL-ON_Android/JPush.cs b/HDL-ON_Android/JPush.cs new file mode 100644 index 0000000..61cb7d3 --- /dev/null +++ b/HDL-ON_Android/JPush.cs @@ -0,0 +1,186 @@ +锘縰sing System; +using Android.App; +using Android.Content; +using Android.OS; +using CN.Jpush.Android.Api; +using CN.Jpush.Android.Service; +using HDL_ON; +using Shared; + +namespace HDL_ON_Android +{ + [BroadcastReceiver(Name = "com.hdl.onpro.JpushNotificationReceiver", Exported = false, Enabled = true)] + [IntentFilter(new string[] { "cn.jpush.android.intent.REGISTRATION", + "cn.jpush.android.intent.MESSAGE_RECEIVED", + "cn.jpush.android.intent.NOTIFICATION_RECEIVED", + "cn.jpush.android.intent.NOTIFICATION_OPENED", + "cn.jpush.android.intent.CONNECTION" }, Categories = new string[] { "com.hdl.onpro" })] + public class JpushNotificationReceiver : BroadcastReceiver + { + private static string TAG = "JpushNotificationReceiver"; + private NotificationManager nm; + static string ACTION = "android.intent.action.BOOT_COMPLETED"; + public override void OnReceive(Context context, Intent intent) + { + if (nm == null) + { + nm = (NotificationManager)context.GetSystemService(Context.NotificationService); + } + //base.OnReceive (context, intent); + try + { + Bundle bundle = intent.Extras; + if (intent.Action == ACTION) + { + //寮�鏈鸿嚜鍔ㄦ湇鍔¤嚜鍔ㄥ惎鍔�,PushService鏄鍚姩鐨勬湇鍔� + Intent service = new Intent(context, typeof(PushService)); + context.StartService(service); + } + + //鎺ユ敹Registration Id + if (JPushInterface.ActionRegistrationId == intent.Action) + { + string regId = bundle.GetString(JPushInterface.ExtraRegistrationId); + if (!string.IsNullOrEmpty(regId)) + { + OnAppConfig.Instance.PushDeviceToken = regId; + //OnAppConfig.Instance.PhoneName = userPhoneName; + OnAppConfig.Instance.SaveUserConfig(); + } + } + //鐢ㄦ埛鐐瑰嚮鎵撳紑浜嗛�氱煡 + else if (JPushInterface.ActionNotificationOpened == intent.Action) + { + OpenNotification(context, bundle); + } + //鎺ュ彈鍒版帹閫佷笅鏉ョ殑閫氱煡 + else if (JPushInterface.ActionNotificationReceived == intent.Action) + { + //int notifactionId = bundle.GetInt(JPushInterface.ExtraNotificationId); + ReceivingNotification(context, bundle); + //Shared.Common.CommonPage.Instance.SingOut(); + } + //鎺ユ敹鍒版帹閫佷笅鏉ョ殑鑷畾涔夋秷鎭� + else if (JPushInterface.ActionMessageReceived == intent.Action) + { + bundle.GetString(JPushInterface.ExtraMessage); + } + else + { + } + } + catch (System.Exception e) + { + + System.Console.WriteLine("鏋佸厜鎺ㄩ�佸嚭閿�:" + e.Message); + } + } + /// <summary> + /// 鎺ユ敹娑堟伅閫氱煡 + /// </summary> + /// <param name="context">Context.</param> + /// <param name="bundle">Bundle.</param> + private void ReceivingNotification(Context context, Bundle bundle) + { + String title = bundle.GetString(JPushInterface.ExtraNotificationTitle); + System.Console.WriteLine(TAG, " title : " + title); + String message = bundle.GetString(JPushInterface.ExtraAlert); + System.Console.WriteLine(TAG, "message : " + message); + String extras = bundle.GetString(JPushInterface.ExtraExtra); + System.Console.WriteLine(TAG, "extras : " + extras); + + //澶勭悊鏋佸厜娑堟伅鎺ㄩ�佺殑閫昏緫鍑芥暟 + AdjustJiguangMsgPush(title, message, extras); + } + + /// <summary> + /// 澶勭悊鏋佸厜淇℃伅鎺ㄩ�� + /// </summary> + /// <param name="title">鏍囬</param> + /// <param name="message">淇℃伅</param> + /// <param name="extras">璐熻浇鏁版嵁</param> + public void AdjustJiguangMsgPush(string title, string message, string extras) + { + if (extras.Contains("Offline") == true) + { + + Shared.Application.RunOnMainThread(() => + { + //姝ゅ笎鍙峰凡鍦ㄥ埆澶勭櫥褰�,鎮ㄨ杩笅绾� + //ShowAlert("姝ゅ笎鍙峰凡鍦ㄥ埆澶勭櫥褰�,鎮ㄨ杩笅绾�"); + //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈� + HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices)); + + }); + return; + } + } + + /// <summary> + /// 鎵撳紑娑堟伅鏄剧ず鐣岄潰 + /// </summary> + /// <param name="context">Context.</param> + /// <param name="bundle">Bundle.</param> + private void OpenNotification(Context context, Bundle bundle) + { + + Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class); + i.PutExtras(bundle); + i.SetFlags(ActivityFlags.NewTask); + context.StartActivity(i); + + String extras = bundle.GetString(JPushInterface.ExtraExtra); + //String myValue = ""; + try + { + VideoMethod(extras); + //JSONObject extrasJson = new JSONObject(extras); + //myValue = extrasJson.OptString("myKey"); + + } + catch (Exception e) + { + System.Console.WriteLine(TAG, "Unexpected: extras is not a valid json", e); + return; + } + + //if (TYPE_THIS.equals(myValue)) + //{ + //Intent mIntent = new Intent(context, ThisActivity.class); + //mIntent.putExtras(bundle); + //mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + //context.startActivity(mIntent); + //} + //else if (TYPE_ANOTHER.equals(myValue)) + //{ + //Intent mIntent = new Intent(context, AnotherActivity.class); + //mIntent.putExtras(bundle); + //mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + //context.startActivity(mIntent); + //} + } + + /// <summary> + /// android閫氱煡鏍忕偣鍑诲鐞嗘柟娉� + /// </summary> + /// <param name="hiddenJson">浜戠鎺ㄨ繃鏉ョ殑鏁版嵁</param> + private void VideoMethod(string hiddenJson) + { + Utlis.WriteLine("JPUSH:" + hiddenJson); + var hiddanJson = Newtonsoft.Json.Linq.JObject.Parse(hiddenJson); + if (hiddanJson == null) + { + return; + } + var json = Newtonsoft.Json.Linq.JObject.Parse(hiddanJson["HiddanJson"].ToString()); + if (json == null) + { + return; + } + + + + } + } + +} diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index f943917..be0ad59 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-ON_Android/Properties/AndroidManifest.xml @@ -13,9 +13,83 @@ <!-- 鎾斁鏈湴闊充箰鏉冮檺--> <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> + <!--鏋佸厜鎺ㄩ�� Required 涓�浜涚郴缁熻姹傜殑鏉冮檺锛屽璁块棶缃戠粶绛�--> + <!-- Required 涓�浜涚郴缁熻姹傜殑鏉冮檺锛屽璁块棶缃戠粶绛�--> + <uses-permission android:name="com.hdl.onpro.permission.JPUSH_MESSAGE" /> + <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" /> + <uses-permission android:name="android.permission.INTERNET" /> + <uses-permission android:name="android.permission.READ_PHONE_STATE" /> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> + <uses-permission android:name="android.permission.WRITE_SETTINGS" /> + <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> + <!-- Optional for location --> + <uses-permission android:name="android.permission.VIBRATE" /> + <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> + <!-- 鐢ㄤ簬寮�鍚� debug 鐗堟湰鐨勫簲鐢ㄥ湪6.0 绯荤粺涓� 灞傚彔绐楀彛鏉冮檺 --> + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> + <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> + <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> + <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> + <uses-permission android:name="android.permission.GET_TASKS" /> + <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /> + <!-- 鏋佸厜鎺ㄩ�佺粨鏉� --> <application android:allowBackup="true" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="ON+"> <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hdl.onpro.fileProvider" android:grantUriPermissions="true" android:exported="false"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> </provider> + <!--鏋佸厜鎺ㄩ��--> + <activity android:name="cn.jpush.android.ui.PopWinActivity" android:exported="false" /> + <activity android:name="cn.jpush.android.ui.PushActivity" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar" android:exported="false"> + <intent-filter> + <action android:name="cn.jpush.android.ui.PushActivity" /> + <category android:name="android.intent.category.DEFAULT" /> + <category android:name="com.hdl.onpro" /> + </intent-filter> + </activity> + <service android:name="cn.jpush.android.service.PushService" android:process=":mult"> + <intent-filter> + <action android:name="cn.jpush.android.intent.REGISTER" /> + <action android:name="cn.jpush.android.intent.REPORT" /> + <action android:name="cn.jpush.android.intent.PushService" /> + <action android:name="cn.jpush.android.intent.PUSH_TIME" /> + </intent-filter> + </service> + <!-- since 3.0.9 Required SDK 鏍稿績鍔熻兘--> + <provider android:authorities="com.hdl.onpro.DataProvider" android:name="cn.jpush.android.service.DataProvider" android:process=":pushcore" android:exported="false" /> + <service android:name="cn.jpush.android.service.DaemonService" android:enabled="true" android:exported="true"> + <intent-filter> + <action android:name="cn.jpush.android.intent.DaemonService" /> + <category android:name="com.hdl.onpro" /> + </intent-filter> + </service> + <!-- since 3.1.0 Required SDK 鏍稿績鍔熻兘--> + <provider android:authorities="com.hdl.onpro.DownloadProvider" android:name="cn.jpush.android.service.DownloadProvider" android:exported="true" /> + <receiver android:name="cn.jpush.android.service.PushReceiver" android:enabled="true"> + <intent-filter android:priority="1000"> + <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" /> + <category android:name="com.hdl.onpro" /> + </intent-filter> + <intent-filter> + <action android:name="android.intent.action.USER_PRESENT" /> + <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> + </intent-filter> + <!-- Optional --> + <intent-filter> + <action android:name="android.intent.action.PACKAGE_ADDED" /> + <action android:name="android.intent.action.PACKAGE_REMOVED" /> + <data android:scheme="package" /> + </intent-filter> + </receiver> + <receiver android:name="cn.jpush.android.service.AlarmReceiver" android:exported="false" /> + <!-- User defined. For test only 鐢ㄦ埛鑷畾涔夌殑骞挎挱鎺ユ敹鍣�--> + <!-- Required . Enable it you can get statistics data with channel --> + <meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" /> + <meta-data android:name="JPUSH_APPKEY" android:value="cbd90743ac45cbca06c8118b" /> + <!-- </>鍊兼潵鑷紑鍙戣�呭钩鍙板彇寰楃殑AppKey--> + <!-- 鏋佸厜鎺ㄩ�佺粨鏉� --> </application> </manifest> \ No newline at end of file diff --git a/HDL-ON_Android/libs/armeabi-v7a/libelianjni.so b/HDL-ON_Android/libs/armeabi-v7a/libelianjni.so new file mode 100755 index 0000000..04e9fcc --- /dev/null +++ b/HDL-ON_Android/libs/armeabi-v7a/libelianjni.so Binary files differ diff --git a/HDL-ON_Android/libs/armeabi-v7a/libjcore127.so b/HDL-ON_Android/libs/armeabi-v7a/libjcore127.so new file mode 100755 index 0000000..d5fa49f --- /dev/null +++ b/HDL-ON_Android/libs/armeabi-v7a/libjcore127.so Binary files differ diff --git a/HDL-ON_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs index 9335648..0709827 100644 --- a/HDL-ON_iOS/AppDelegate.cs +++ b/HDL-ON_iOS/AppDelegate.cs @@ -118,6 +118,102 @@ //璇诲彇鎺ㄩ�佷俊鎭� UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; + + if (userInfo == null) + { + return; + } + + Console.WriteLine(userInfo); + + if (application.ApplicationState == UIApplicationState.Active || application.ApplicationState == UIApplicationState.Background) + { + NSString key_hiddenJson = new NSString("HiddenJson"); + if (userInfo.ContainsKey(key_hiddenJson)) + { + var hiddenJson = userInfo["HiddenJson"].ToString(); + if (string.IsNullOrEmpty(hiddenJson)) + { + return; + } + + if (hiddenJson.Contains("cmtID")) + { + /////鐩墠鏍规嵁杩欎釜鍒ゆ柇鏄惁鏄彲瑙嗗璁叉暟鎹� + //VideoMethod(hiddenJson); + } + else + { + + NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; + if (hiddenJsonDic == null) + { + return; + } + NSString key_Offline = new NSString("Offline"); + if (hiddenJsonDic.ContainsKey(key_Offline)) + { + string signOut = hiddenJsonDic["Offline"].ToString(); + + if (signOut == "0") + { + //涓嶄笅绾� + } + else + { + //寮哄埗涓嬬嚎 + //CommonPage.Instance.SingOut(); + HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices)); + } + } + } + } + } + else + { + NSString key_hiddenJson = new NSString("HiddenJson"); + if (userInfo.ContainsKey(key_hiddenJson)) + { + + var hiddenJson = userInfo["HiddenJson"].ToString(); + if (string.IsNullOrEmpty(hiddenJson)) + { + return; + } + + if (hiddenJson.Contains("cmtID")) + { + /////鐩墠鏍规嵁杩欎釜鍒ゆ柇鏄惁鏄彲瑙嗗璁叉暟鎹� + //VideoMethod(hiddenJson); + } + else + { + + NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; + if (hiddenJsonDic == null) + { + return; + } + NSString key_Offline = new NSString("Offline"); + if (hiddenJsonDic.ContainsKey(key_Offline)) + { + string signOut = hiddenJsonDic["Offline"].ToString(); + + if (signOut == "0") + { + //涓嶄笅绾� + } + else + { + //鏍囪涓嬬嚎 + haveToSignOut = true; + } + } + } + } + + } + completionHandler(UIBackgroundFetchResult.NewData); } public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) @@ -173,19 +269,24 @@ Console.WriteLine("OnActivated"); base.OnActivated(application); + if (haveToSignOut == true) + { + //寮哄埗涓嬬嚎 + //CommonPage.Instance.SingOut(); + HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices)); + } + } public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { //Shared.Application.FontSize = 12; - //Shared.Application.IsUsePingFang = true; + Shared.Application.IsUsePingFang = true; Window = new UIWindow(UIScreen.MainScreen.Bounds); rootViewController = new UINavigationController(new ViewController()) { NavigationBarHidden = true }; Window.RootViewController = rootViewController; Window.MakeKeyAndVisible(); - - AppCenter.Start("e1add75a-82c6-4a5c-a902-4705b195748e",typeof(Analytics), typeof(Crashes)); base.FinishedLaunching(application, launchOptions); @@ -203,24 +304,14 @@ // UserInfo.Current.areaCode = nsCount; // OnAppConfig.Instance.SaveUserConfig(); //} + application.IdleTimerDisabled = true; application.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound); //window.AccessibilityNavigationStyle = UIAccessibilityNavigationStyle.Automatic; // check for a notification - if (launchOptions != null) - { - // check for a remote notification - if (launchOptions.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey)) - { - - NSDictionary remoteNotification = launchOptions[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary; - if (remoteNotification != null) - { - //UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; - } - } - } + DealWithPushMes(launchOptions); + if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null); @@ -249,6 +340,74 @@ Console.WriteLine("FinishedLaunching"); return true; } + + /// <summary> + /// 閫�鍑虹櫥褰曟爣璁� + /// </summary> + bool haveToSignOut; + /// <summary> + /// 澶勭悊閫氱煡 + /// </summary> + /// <param name="launchOptions"></param> + void DealWithPushMes(NSDictionary launchOptions) + { + haveToSignOut = false; + if (launchOptions != null) + { + // check for a remote notification + if (launchOptions.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey)) + { + NSDictionary userInfo = launchOptions[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary; + if (userInfo != null) + { + NSString key_hiddenJson = new NSString("HiddenJson"); + if (userInfo.ContainsKey(key_hiddenJson)) + { + var hiddenJson = userInfo["HiddenJson"].ToString(); + if (!string.IsNullOrEmpty(hiddenJson)) + { + if (hiddenJson.Contains("cmtID")) + { + + ///鐩墠鏍规嵁杩欎釜鍒ゆ柇鏄惁鏄彲瑙嗗璁叉暟鎹� + // VideoMethod(hiddenJson); + } + else + { + + NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; + if (hiddenJsonDic != null) + { + NSString key_Offline = new NSString("Offline"); + if (hiddenJsonDic.ContainsKey(key_Offline)) + { + string signOut = hiddenJsonDic["Offline"].ToString(); + + if (signOut == "0") + { + //涓嶄笅绾� + } + else + { + //鏍囪涓嬬嚎 + haveToSignOut = true; + } + } + + } + } + } + + + } + + } + } + } + } + + + } } diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index fe64565..ef64313 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -573,6 +573,24 @@ <BundleResource Include="Resources\Phone\Public\Search.png" /> <BundleResource Include="Resources\Phone\PersonalCenter\Head.png" /> <BundleResource Include="Resources\Phone\PersonalCenter\Transfer.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\All.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\System.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\Alarm.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\AllOn.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\Share.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\AlarmOn.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\ShareOn.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\SystemOn.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg1.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg2.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg3.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg4.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg5.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg6.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg7.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg8.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg9.png" /> + <BundleResource Include="Resources\Phone\Classification\Room\Roombg10.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index 30d97ad..ae55f72 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -471,7 +471,11 @@ 9036=鍦烘櫙闂 9037=APP浣跨敤杈呭姪 9038=甯歌闂 - +9039=鍒嗕韩涓庡姛鑳� +9040=鎶ヨ绫� +9041=绯荤粺淇℃伅 +9042=淇℃伅涓績 +9043=璇ヨ处鍙峰凡鍦ㄥ叾瀹冭澶囩櫥褰� 10000=鏃犳晥鐧诲綍瀵嗛挜锛岃閲嶆柊鐧诲綍锛� diff --git a/HDL-ON_iOS/Resources/Phone/.DS_Store b/HDL-ON_iOS/Resources/Phone/.DS_Store index e96e8b1..ec1b415 100644 --- a/HDL-ON_iOS/Resources/Phone/.DS_Store +++ b/HDL-ON_iOS/Resources/Phone/.DS_Store Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg1.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg1.png new file mode 100644 index 0000000..178214d --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg1.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg10.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg10.png new file mode 100644 index 0000000..04d0636 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg10.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg2.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg2.png new file mode 100644 index 0000000..04d6836 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg2.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg3.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg3.png new file mode 100644 index 0000000..36dcfe2 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg3.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg4.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg4.png new file mode 100644 index 0000000..5e98ad4 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg4.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg5.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg5.png new file mode 100644 index 0000000..611457b --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg5.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg6.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg6.png new file mode 100644 index 0000000..7c73be0 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg6.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg7.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg7.png new file mode 100644 index 0000000..b60e2da --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg7.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg8.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg8.png new file mode 100644 index 0000000..0f9f576 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg8.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg9.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg9.png new file mode 100644 index 0000000..e5323ab --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg9.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Alarm.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Alarm.png new file mode 100644 index 0000000..ab3e5c8 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Alarm.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/AlarmOn.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/AlarmOn.png new file mode 100644 index 0000000..5179577 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/AlarmOn.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/All.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/All.png new file mode 100644 index 0000000..fd548d7 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/All.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/AllOn.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/AllOn.png new file mode 100644 index 0000000..60f91b3 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/AllOn.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Share.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Share.png new file mode 100644 index 0000000..563bed4 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Share.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/ShareOn.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/ShareOn.png new file mode 100644 index 0000000..8977640 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/ShareOn.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/System.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/System.png new file mode 100644 index 0000000..c4940d5 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/System.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/SystemOn.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/SystemOn.png new file mode 100644 index 0000000..5c44894 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/SystemOn.png Binary files differ diff --git a/HDL_ON/Common/Constant.cs b/HDL_ON/Common/Constant.cs index 46c8b0a..d5c497e 100644 --- a/HDL_ON/Common/Constant.cs +++ b/HDL_ON/Common/Constant.cs @@ -189,5 +189,26 @@ ON_Plus, } + /// <summary> + /// 鍒嗕韩 绫诲瀷 + /// 鍒嗕韩绫诲瀷 1.ROOM 2.DEVICE 3.SCENE + /// </summary> + public enum ShareType + { + /// <summary> + /// + /// </summary> + ROOM = 1, + /// <summary> + /// + /// </summary> + DEVICE, + /// <summary> + /// + /// </summary> + SCENE, + } + + #endregion } diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index 43e137d..df996d7 100644 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -85,7 +85,7 @@ #if __IOS__ requestObj.DeviceType = PhoneDeviceType.IOS.ToString(); #endif - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + var requestJson = HttpUtil.GetSignRequestJson(requestObj); var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_CheckAppVersion, requestJson); if (revertObj.Code == StateCode.SUCCESS) { diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 33ad7fa..20455f3 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -584,6 +584,26 @@ /// 甯歌闂 /// </summary> public const int CommonQuestion = 9038; + /// <summary> + /// 鍒嗕韩涓庡姛鑳� + /// </summary> + public const int SharingAndFunctionality = 9039; + /// <summary> + /// 鎶ヨ绫� + /// </summary> + public const int AlarmType = 9040; + /// <summary> + /// 绯荤粺淇℃伅 + /// </summary> + public const int SystemMessage = 9041; + /// <summary> + /// 淇℃伅涓績 + /// </summary> + public const int MessageCenter = 9042; + /// <summary> + /// 璇ヨ处鍙峰凡鍦ㄥ叾瀹冭澶囩櫥褰曘�� + /// </summary> + public const int LoggedOnOtherDevices = 9043; #region 缃戠粶璇锋眰鍝嶅簲閿欒鎻愮ず淇℃伅 diff --git a/HDL_ON/DAL/FileUtils.cs b/HDL_ON/DAL/FileUtils.cs index 821be14..3ca621b 100644 --- a/HDL_ON/DAL/FileUtils.cs +++ b/HDL_ON/DAL/FileUtils.cs @@ -406,6 +406,21 @@ } } + /// <summary> + /// + /// </summary> + /// <param name="fileName"></param> + /// <param name="imagePath"></param> + public static void FileCopyToRootPath(string oldPath, string fileName) + { + System.IO.FileInfo fileInfo = new System.IO.FileInfo(oldPath); + if (fileInfo.Exists) + { + fileInfo.CopyTo(Path.Combine(RootPath, fileName), true); + //Utlis.WriteLine("FileCopyToRootPath : " + Path.Combine(RootPath, fileName)); + } + } + ///// <summary> ///// 涓嬭浇鐢靛彴銆侀煶涔愩�丏LNA绛夌瓑缃戠粶鍥剧墖 ///// </summary> diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index 137d082..1682fc1 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -9,6 +9,7 @@ using System.Text; using System.Security.Cryptography; using HDL_ON.DriverLayer; +using HDL_ON.Entity; namespace HDL_ON.DAL.Mqtt { @@ -644,6 +645,18 @@ { MqttInfoConfig.Current.mMqttInfo = mqttInfoRequestResult_Obj; await MQTTConnectAsync(); + //1.鍒ゆ柇鏄惁缁戝畾浜嗙綉鍏筹紝鑾峰彇缃戝叧杩滅▼杩炴帴鐨勫姞瀵咾EY + if (DB_ResidenceData.residenceData.CheckWhetherGatewayIsBound()) + { + //2.鎵惧嚭鏄惁瀛樺湪鍖归厤褰撳墠浣忓畢鐨刴ac锛屽瓨鍦ㄥ啀杩涜杩滅▼銆� + MqttInfoConfig.Current.HomeGatewayInfo = DB_ResidenceData.residenceData.HomeGateway; + //3.寮�濮嬭繛鎺� + await MQTTConnectAsync(); + } + else + { + Utlis.WriteLine("============>杩樻病缁戝畾缃戝叧"); + } } } diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index da2a2e1..6e286dc 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -406,9 +406,7 @@ /// <returns></returns> public string UpdataUserHeadImage(string fileName) { - FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); - byte[] bytes = new byte[fs.Length]; - fs.Read(bytes, 0, bytes.Length); + byte[] bytes = Shared.IO.FileUtils.ReadFile(fileName); var revertObj = HttpUtil.RequestHttpsUpload(RestSharp.Method.POST, NewAPI.API_POST_Head_Upload, bytes); return revertObj.Code; } @@ -458,7 +456,7 @@ /// </summary> public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL) { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new GetHomeListObj() { homeType = homeType.ToString() }); + var requestJson = HttpUtil.GetSignRequestJson(new GetHomeListObj() { homeType = homeType.ToString() }); var resultObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Gethomepager, requestJson); if (resultObj.Code == StateCode.SUCCESS) { @@ -504,6 +502,9 @@ } DB_ResidenceData.residenceData.SaveResidenceData(); UserInfo.Current.SaveUserInfo(); + + //鍒锋柊涓�娆′綇瀹呯綉鍏� + GetHomeGatewayList(); } } @@ -605,47 +606,48 @@ requestObj.Address = editName; } - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + var requestJson = HttpUtil.GetSignRequestJson(requestObj); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Home_UpdateHome, requestJson); } /// <summary> - /// 鑾峰彇鍒锋柊褰撳墠浣忓畢缃戝叧鎺ュ彛 + /// 鑾峰彇鍒锋柊褰撳墠浣忓畢鐨勭綉鍏冲垪琛� /// </summary> public void GetHomeGatewayList() { - if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.residecenInfo.RegionID)) return; - var nowhomeId = DB_ResidenceData.residenceData.residecenInfo.RegionID; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new HomeIdObj() { homeId = nowhomeId }); - var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson); - if (revertObj.Code == StateCode.SUCCESS) + try { - var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGatewayInfo>>(revertObj.Data.ToString()); - if (nowhomeId == DB_ResidenceData.residenceData.residecenInfo.RegionID) + if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.residecenInfo.RegionID)) return; + var nowhomeId = DB_ResidenceData.residenceData.residecenInfo.RegionID; + var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = nowhomeId }); + var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson); + if (revertObj.Code == StateCode.SUCCESS) { - if (mHomeGatewayRes != null) + var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGatewayInfo>>(revertObj.Data.ToString()); + if (nowhomeId == DB_ResidenceData.residenceData.residecenInfo.RegionID) { - if (mHomeGatewayRes.Count > 0) + if (mHomeGatewayRes != null) { - DB_ResidenceData.residenceData.residenceGatewayMAC = mHomeGatewayRes[0].mac; + if (mHomeGatewayRes.Count > 0) + { + DB_ResidenceData.residenceData.HomeGateway = mHomeGatewayRes[0]; + DB_ResidenceData.residenceData.SaveResidenceData(); + return; + } } - else - { - DB_ResidenceData.residenceData.residenceGatewayMAC = ""; - - } + //鍏朵綑鎯呭喌娓呯┖缃戝叧淇℃伅 + DB_ResidenceData.residenceData.HomeGateway = null; DB_ResidenceData.residenceData.SaveResidenceData(); } - - if (mHomeGatewayRes != null) - { - //Utlis.WriteLine ("鑾峰緱褰撳墠浣忓畢缃戝叧涓暟锛�" + mHomeGatewayRes.content.Count); - } + } + else + { + //鎻愮ず閿欒 } } - else + catch { - //鎻愮ず閿欒 + } } @@ -655,7 +657,7 @@ /// <returns></returns> public ResponsePackNew GetResidenceMemberAccount() { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new HomeIdObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID }); + var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID }); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_FindAll, requestJson); } @@ -670,7 +672,7 @@ childAccountId = subaccount.childAccountId, homeId = subaccount.homeId }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + var requestJson = HttpUtil.GetSignRequestJson(requestObj); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Delete, requestJson); } @@ -682,7 +684,7 @@ /// <returns></returns> public ResponsePackNew EditSubAccountNickName(string nickName, string childAccountId) { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new UpdateChildNickNameObj() + var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID, childAccountId = childAccountId, @@ -699,7 +701,7 @@ /// <returns></returns> public ResponsePackNew ChangeCreateSceneState(bool isAllow, string childAccountId) { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new UpdateChildAllowCreateSceneObj() + var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID, childAccountId = childAccountId, @@ -707,6 +709,44 @@ }); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson); } + + #region 鏂版暟鎹垎浜� + /// <summary> + /// 娣诲姞鍒嗕韩 + /// </summary> + /// <param name="addShareObj"></param> + /// <returns></returns> + public ResponsePackNew AddShare(AddShareObj addShareObj) + { + var requestJson = HttpUtil.GetSignRequestJson(addShareObj); + + return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_Add, requestJson); + } + + /// <summary> + /// 鍒犻櫎鍒嗕韩 + /// </summary> + /// <param name="deleteShareObj"></param> + /// <returns></returns> + public ResponsePackNew DeleteShare(DeleteShareObj deleteShareObj) + { + var requestJson = HttpUtil.GetSignRequestJson(deleteShareObj); + + return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_Delete, requestJson); + } + + /// <summary> + /// 鑾峰彇鍒嗕韩 + /// </summary> + /// <param name="addShareObj"></param> + /// <returns></returns> + public ResponsePackNew GetShare(GetShareObj getShareObj) + { + var requestJson = HttpUtil.GetSignRequestJson(getShareObj); + + return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_Delete, requestJson); + } + #endregion /// <summary> /// 鑾峰彇浣忓畢涓嬪瓙璐﹀彿鐨勫叡浜暟鎹垪琛� @@ -720,7 +760,7 @@ //string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); //return RequestHttps($"{severAddress}/ZigbeeDataShare/GetShareDataBySubAccount", jsonString, true); - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new HomeShareFindAll() + var requestJson = HttpUtil.GetSignRequestJson(new HomeShareFindAll() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID, childAccountId = childAccountId @@ -805,7 +845,7 @@ /// <returns></returns> public ResponsePackNew DeleteShareData(ShareData shareData) { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new ShareFileDownObj() + var requestJson = HttpUtil.GetSignRequestJson(new ShareFileDownObj() { homeId = shareData.homeId, homeShareId = shareData.id @@ -840,7 +880,7 @@ { //娣诲姞瀛愯处鍙� var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID, account = subAccount, nickName = nickName }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + var requestJson = HttpUtil.GetSignRequestJson(requestObj); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson); } @@ -887,7 +927,7 @@ { try { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new GetMqttRemoteInfoObj() + var requestJson = HttpUtil.GetSignRequestJson(new GetMqttRemoteInfoObj() { attachClientId = attachClientId, homeType = HomeTypeEnum.BUSPRO.ToString() @@ -921,13 +961,16 @@ #if __IOS__ deviceType = PhoneDeviceType.IOS.ToString(); #endif - //鏄惁鐢熸垚妯″紡 + //鏄惁鐢熶骇妯″紡 bool isProduce = true; #if DEBUG isProduce = false; #endif - if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) return false; + if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) { + Utlis.WriteLine("PushDeviceToken 涓虹┖"); + return false; + } var mAddpushinfoObj = new AddpushinfoObj() { @@ -935,9 +978,10 @@ deviceName = OnAppConfig.Instance.PhoneName, deviceType = deviceType, produce = isProduce, - }; + var mAddpushinfoJson = Newtonsoft.Json.JsonConvert.SerializeObject(mAddpushinfoObj); + //var mAddpushinfoJson = HttpUtil.GetSignRequestJson(mAddpushinfoObj); var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_AddToken, mAddpushinfoJson); if (revertObj.Code == StateCode.SUCCESS) { @@ -948,14 +992,15 @@ { OnAppConfig.Instance.PushId = pushId; OnAppConfig.Instance.SaveUserConfig(); + return true; } } - Utlis.WriteLine("AddToken 鎴愬姛"); + } else { - Utlis.WriteLine("AddToken 澶辫触"); + //Utlis.WriteLine("AddToken 澶辫触"); } return false; } @@ -965,13 +1010,14 @@ } } + /// <summary> /// 鏌ヨ鎺ㄩ�佷俊鎭垪琛� /// </summary> /// <returns></returns> - public ResponsePackNew PushSerivceGetpushmessagelist() + public ResponsePackNew PushSerivceGetPushmessagelist() { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new GetMessageListObj() + var requestJson = HttpUtil.GetSignRequestJson(new GetMessageListObj() { pushId = OnAppConfig.Instance.PushId }); @@ -986,7 +1032,7 @@ { if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushIdObj() + var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() { pushId = OnAppConfig.Instance.PushId }); @@ -1012,7 +1058,7 @@ if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; try { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushIdObj() { + var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() { pushId = OnAppConfig.Instance.PushId }); @@ -1044,7 +1090,7 @@ try { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushIdObj() + var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() { pushId = OnAppConfig.Instance.PushId }); @@ -1076,7 +1122,7 @@ try { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushMsgIdObj() + var requestJson = HttpUtil.GetSignRequestJson(new PushMsgIdObj() { msgId = msgId }); @@ -1109,7 +1155,7 @@ try { - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new PushMsgIdObj() + var requestJson = HttpUtil.GetSignRequestJson(new PushMsgIdObj() { msgId = msgId }); @@ -1130,6 +1176,47 @@ return false; } } + + /// <summary> + /// 娉ㄥ唽鎺ㄩ�� + /// </summary> + public void RegisteredPush() + { + new System.Threading.Thread(() => + { + var success = PushSerivceAddPushInfo(); + if (success) + { + Utlis.WriteLine("鎺ㄩ�佹敞鍐屾垚鍔�"); + } + else + { + Utlis.WriteLine("鎺ㄩ�佹敞鍐屽け璐�"); + } + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 娉ㄩ攢鎺ㄩ�� + /// </summary> + public void SignOutPush() + { + new System.Threading.Thread(() => + { + var success = PushSerivceSignOut(); + if (success) + { + Utlis.WriteLine("鎺ㄩ�佹敞閿�鎴愬姛"); + } + else + { + Utlis.WriteLine("鎺ㄩ�佹敞閿�澶辫触"); + } + }) + { IsBackground = true }.Start(); + } + #endregion #region 妫�娴嬫洿鏂� @@ -1146,7 +1233,7 @@ #if __IOS__ requestObj.DeviceType = PhoneDeviceType.IOS.ToString(); #endif - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + var requestJson = HttpUtil.GetSignRequestJson(requestObj); return HttpUtil.RequestHttpsPost(NewAPI.API_POST_CheckAppVersion, requestJson); } @@ -1163,7 +1250,7 @@ #if __IOS__ requestObj.DeviceType = PhoneDeviceType.IOS.ToString(); #endif - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + var requestJson = HttpUtil.GetSignRequestJson(requestObj); return HttpUtil.RequestHttpsPost(NewAPI.API_POST_GetAppVersion, requestJson); } @@ -1236,52 +1323,6 @@ #endregion - #region mqtt杩滅▼杩炴帴锛堟棫锛� - /// <summary> - /// 璇锋眰Mqtt鏁版嵁 - /// </summary> - /// <param name="dataStringJson">璇锋眰鐨勫弬鏁�.</param> - public ResponsePack RequestMqttInfo(string dataStringJson) - { - ResponsePack revertObj = null; - - var webClient = new WebClient(); - #region - webClient.Headers.Add("CONTENT-TYPE", "application/json"); - var url = "https://global.hdlcontrol.com/ProposedProductionApi/EmqMqtt/GetConnMqttInfo"; - - byte[] bytes = null; - try - { - bytes = webClient.UploadData(url, Encoding.UTF8.GetBytes(dataStringJson)); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - revertObj = new ResponsePack() { StateCode = "Net_Error" }; - } - - string responseString = null; - if (bytes != null) - { - responseString = Encoding.UTF8.GetString(bytes); - } - - if (responseString != null) - { - try - { - revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(responseString); - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } - } - return revertObj; - #endregion - } - #endregion #region 澶囦唤閮ㄥ垎 ///// <summary> diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 6784b4c..0fa2299 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -96,12 +96,12 @@ public static ResponsePackNew RequestHttpsPostFroHome(string apiPath, string bodyParameterJson, int mTimeout = 10) { string urlHead = DB_ResidenceData.residenceData.residecenInfo.regionUrl; - var replaceToken = ""; - if (DB_ResidenceData.residenceData.residecenInfo.IsOthreShare) - { - replaceToken = DB_ResidenceData.residenceData.MasterToken; - } - return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, replaceToken, mTimeout); + //var replaceToken = ""; + //if (DB_ResidenceData.residenceData.residecenInfo.IsOthreShare) + //{ + // replaceToken = DB_ResidenceData.residenceData.MasterToken; + //} + return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, "", mTimeout); } /// <summary> diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs index 3aa86cc..b45adda 100644 --- a/HDL_ON/DAL/Server/NewAPI.cs +++ b/HDL_ON/DAL/Server/NewAPI.cs @@ -56,15 +56,15 @@ /// <summary> /// 涓婁紶澶村儚 /// </summary> - public const string API_POST_Head_Upload = "/home-wisdom/head/portrait/upload"; + public const string API_POST_Head_Upload = "/home-wisdom/app/head/portrait/upload"; /// <summary> /// 涓嬭浇澶村儚 /// </summary> - public const string API_POST_Head_Down = "/home-wisdom/head/portrait/down"; + public const string API_POST_Head_Down = "/home-wisdom/app/head/portrait/down"; /// <summary> /// 鏍规嵁璐﹀彿涓嬭浇澶村儚 /// </summary> - public const string API_POST_Head_DownWithAccount = "/home-wisdom/head/portrait/downWithAccount"; + public const string API_POST_Head_DownWithAccount = "/home-wisdom/app/head/portrait/downWithAccount"; /// <summary> /// 缁戝畾璁よ瘉(鎵嬫満/閭) /// </summary> @@ -78,88 +78,84 @@ #endregion #region 鈻� HomeCluster -- 浣忓畢绠$悊鎺ュ彛___________________________ - ///// <summary> - ///// 娣诲姞浣忓畢 - ///// </summary> - //public const string API_POST_Addhome = "/HomeCluster/V1/addhome"; /// <summary> /// 鑾峰彇浣忓畢鍒嗛〉 /// </summary> - public const string API_POST_Gethomepager = "/home-wisdom/home/list"; + public const string API_POST_Gethomepager = "/home-wisdom/app/home/list"; /// <summary> /// 鍒犻櫎浣忓畢 /// </summary> - public const string API_POST_Home_Delete = "/home-wisdom/home/delete"; + public const string API_POST_Home_Delete = "/home-wisdom/app/home/delete"; /// <summary> /// 鏇存柊浣忓畢 /// </summary> - public const string API_POST_Home_UpdateHome = "/home-wisdom/home/update"; - + public const string API_POST_Home_UpdateHome = "/home-wisdom/app/home/update"; + /// <summary> + /// 浣忓畢杩佺Щ + /// </summary> + public const string API_POST_Home_Transfer = "/home-wisdom/app/home/transfer"; #endregion #region 鈻� 瀛愯处鍙� -- 娣诲姞浣忓畢鎴愬憳___________________________ /// <summary> /// 娣诲姞瀛愯处鎴� /// </summary> - public const string API_POST_Child_Add = "/home-wisdom/child/account/add"; + public const string API_POST_Child_Add = "/home-wisdom/app/child/account/add"; /// <summary> /// 鍒犻櫎瀛愯处鎴� /// </summary> - public const string API_POST_Child_Delete = "/home-wisdom/child/account/delete"; + public const string API_POST_Child_Delete = "/home-wisdom/app/child/account/delete"; /// <summary> /// 鏍规嵁浣忓畢 id 鏌ヨ鎵�鏈夌殑瀛愯处鎴� /// </summary> - public const string API_POST_Child_FindAll = "/home-wisdom/child/account/findAll"; + public const string API_POST_Child_FindAll = "/home-wisdom/app/child/account/findAll"; /// <summary> /// 鏇存柊杩滅▼鎺у埗 /// </summary> - public const string API_POST_Child_Update = "/home-wisdom/child/account/update"; + public const string API_POST_Child_Update = "/home-wisdom/app/child/account/update"; /// <summary> /// 瀛愯处鍙风鐞嗗憳鑾峰彇涓昏处鍙锋巿鏉僒oken /// </summary> - public const string API_POST_Child_GetMasterToken = "/home-wisdom/child/account/masterToken/get"; + public const string API_POST_Child_GetMasterToken = "/home-wisdom/app/child/account/masterToken/get"; /// <summary> /// 涓嬭浇瀛愯处鍙峰ご鍍� /// </summary> - public const string API_POST_Child_DownloadHeadImage = "/home-wisdom/child/account/getHeadPortrait"; + public const string API_POST_Child_DownloadHeadImage = "/home-wisdom/app/child/account/getHeadPortrait"; #region 鏁版嵁鍒嗕韩 /// <summary> /// 鍒嗕韩鎸囧畾鏂囦欢缁欐寚瀹氭垚鍛� /// </summary> - public const string API_POST_Home_Share_Add = "/home-wisdom/home/share/add"; + public const string API_POST_Home_Share_Add = "/home-wisdom/app/home/share/add"; /// <summary> /// 鏌ヨ鎸囧畾鎴愬憳鐨勬墍鏈夊垎浜枃浠� /// </summary> - public const string API_POST_Home_Share_FindAll = "/home-wisdom/home/share/findAll"; + public const string API_POST_Home_Share_FindAll = "/home-wisdom/app/home/share/findAll"; /// <summary> /// 涓嬭浇鎸囧畾鐨勫垎浜枃浠� /// </summary> - public const string API_POST_Home_Share_DownOne = "/home-wisdom/home/share/downOne"; + public const string API_POST_Home_Share_DownOne = "/home-wisdom/app/home/share/downOne"; /// <summary> /// 鍒犻櫎鎸囧畾鐨勫垎浜枃浠� /// </summary> - public const string API_POST_Home_Share_Delete = "/home-wisdom/home/share/delete"; + public const string API_POST_Home_Share_Delete = "/home-wisdom/app/home/share/delete"; #endregion #endregion #region 鈻� GatewayCluster -- 缃戝叧___________________________ - - /// <summary> - /// 缁戝畾缃戝叧鍒颁綇瀹� - /// </summary> - public const string API_POST_BindGateway = "/home-wisdom/gateway/bindGateway"; - + ///// <summary> + ///// 缁戝畾缃戝叧鍒颁綇瀹� + ///// </summary> + //public const string API_POST_BindGateway = "/home-wisdom/app/gateway/bindGateway"; /// <summary> /// 鑾峰彇浣忓畢缃戝叧鍒嗛〉 /// </summary> - public const string API_POST_GetGatewayList = "/home-wisdom/gateway/getGatewayList"; - + public const string API_POST_GetGatewayList = "/home-wisdom/app/gateway/getGatewayList"; ///// <summary> ///// 瑙g粦缁戠綉鍏冲埌浣忓畢 ///// </summary> - public const string API_POST_UntieGateway = "/home-wisdom/gateway/untieGateway"; + public const string API_POST_UntieGateway = "/home-wisdom/app/gateway/untieGateway"; #endregion @@ -175,73 +171,73 @@ /// <summary> /// 鑾峰彇杩滅▼杩炴帴 /// </summary> - public const string API_POST_GetMqttRemoteInfo = "/home-wisdom/mqtt/getRemoteInfo"; + public const string API_POST_GetMqttRemoteInfo = "/home-wisdom/app/mqtt/getRemoteInfo"; #endregion #region 鈻� HomebackupCluster -- 浣忓畢澶囦唤寰湇鍔__________________________ - /// <summary> - /// 鍒涘缓鏂囦欢澶� - /// </summary> - public const string API_POST_Folder_Create = "/home-wisdom/backup/folder/create"; - - /// <summary> - /// 鍒犻櫎鏂囦欢澶� - /// </summary> - public const string API_POST_Folder_Delete = "/home-wisdom/backup/folder/delete"; - - /// <summary> - /// 鏌ユ壘鎵�鏈夋枃浠跺す - /// </summary> - public const string API_POST_Folder_FindAll = "/home-wisdom/backup/folder/findAll"; - - /// <summary> - /// 鏇存柊鏂囦欢澶� - /// </summary> - public const string API_POST_Folder_Update = "/home-wisdom/backup/folder/update"; - - /// <summary> - /// 涓婁紶鏂囦欢 - /// </summary> - public const string API_POST_File_Create = "/home-wisdom/backup/file/create"; + ///// <summary> + ///// 鍒涘缓鏂囦欢澶� + ///// </summary> + //public const string API_POST_Folder_Create = "/home-wisdom/app/backup/folder/create"; ///// <summary> - ///// 鍒犻櫎鏂囦欢 + ///// 鍒犻櫎鏂囦欢澶� ///// </summary> - //public const string API_DELETE_File_Delete = "/HomebackupCluster/V1/file/delete"; + //public const string API_POST_Folder_Delete = "/home-wisdom/app/backup/folder/delete"; - /// <summary> - /// 涓嬭浇澶囦唤鏂囦欢 - /// </summary> - public const string API_POST_File_Down = "/home-wisdom/backup/file/downOne"; + ///// <summary> + ///// 鏌ユ壘鎵�鏈夋枃浠跺す + ///// </summary> + //public const string API_POST_Folder_FindAll = "/home-wisdom/app/backup/folder/findAll"; - /// <summary> - /// 鏌ヨ涓�涓枃浠跺す鎵�鏈夋枃浠跺悕 - /// </summary> - public const string API_POST_File_FindAll = "/home-wisdom/backup/file/findAll"; + ///// <summary> + ///// 鏇存柊鏂囦欢澶� + ///// </summary> + //public const string API_POST_Folder_Update = "/home-wisdom/app/backup/folder/update"; + + ///// <summary> + ///// 涓婁紶鏂囦欢 + ///// </summary> + //public const string API_POST_File_Create = "/home-wisdom/app/backup/file/create"; + + /////// <summary> + /////// 鍒犻櫎鏂囦欢 + /////// </summary> + ////public const string API_DELETE_File_Delete = "/HomebackupCluster/V1/file/delete"; + + ///// <summary> + ///// 涓嬭浇澶囦唤鏂囦欢 + ///// </summary> + //public const string API_POST_File_Down = "/home-wisdom/app/backup/file/downOne"; + + ///// <summary> + ///// 鏌ヨ涓�涓枃浠跺す鎵�鏈夋枃浠跺悕 + ///// </summary> + //public const string API_POST_File_FindAll = "/home-wisdom/app/backup/file/findAll"; #endregion #region 鈻� zigbeespeakerservice -- 璇煶鎺у埗鏈嶅姟___________________________ - /// <summary> - /// 鑾峰彇闊崇鍒楄〃 - /// </summary> - public const string API_GET_Speaker_Auth = "/speakerservices/Auth"; + ///// <summary> + ///// 鑾峰彇闊崇鍒楄〃 + ///// </summary> + //public const string API_GET_Speaker_Auth = "/speakerservices/Auth"; - /// <summary> - /// 淇敼闊崇澶囨敞 - /// </summary> - public const string API_PUT_Speaker_Auth_Rename = "/speakerservices/Auth"; + ///// <summary> + ///// 淇敼闊崇澶囨敞 + ///// </summary> + //public const string API_PUT_Speaker_Auth_Rename = "/speakerservices/Auth"; - /// <summary> - /// 鑾峰彇璁惧鍜屽満鏅垪琛� - /// </summary> - public const string API_GET_Speaker_BatchEdit_V2 = "/speakerservices/BatchEdit_V2"; + ///// <summary> + ///// 鑾峰彇璁惧鍜屽満鏅垪琛� + ///// </summary> + //public const string API_GET_Speaker_BatchEdit_V2 = "/speakerservices/BatchEdit_V2"; - /// <summary> - /// 娣诲姞璁惧鍜屽満鏅垪琛� - /// </summary> - public const string API_POST_Speaker_BatchEdit_V2 = "/speakerservices/BatchEdit_V2"; + ///// <summary> + ///// 娣诲姞璁惧鍜屽満鏅垪琛� + ///// </summary> + //public const string API_POST_Speaker_BatchEdit_V2 = "/speakerservices/BatchEdit_V2"; #endregion @@ -380,6 +376,20 @@ + #region 鈻� -- 鎴块棿銆佽澶囥�佸満鏅垎浜玙__________________________ + /// <summary> + /// 娣诲姞鍒嗕韩 + /// </summary> + public const string API_POST_Share_Add = "/home-wisdom/app/share/add"; + /// <summary> + /// 鍒犻櫎鍒嗕韩 + /// </summary> + public const string API_POST_Share_Delete = "/home-wisdom/app/share/delete"; + /// <summary> + /// 鑾峰彇鍒嗕韩 + /// </summary> + public const string API_POST_Share_Get = "/home-wisdom/app/share/get"; + #endregion #endregion } diff --git a/HDL_ON/DAL/Server/NewApiRes.cs b/HDL_ON/DAL/Server/NewApiRes.cs index 8f5bf92..5f99529 100644 --- a/HDL_ON/DAL/Server/NewApiRes.cs +++ b/HDL_ON/DAL/Server/NewApiRes.cs @@ -1214,6 +1214,75 @@ #endregion + #region 鏁版嵁鍒嗕韩 + /// <summary> + /// 娣诲姞鍒嗕韩 + /// </summary> + [System.Serializable] + public class AddShareObj + { + /// <summary> + /// 浣忓畢ID + /// </summary> + public int homeId; + /// <summary> + /// + /// </summary> + public List<ShareDatasItem> shareDatas; + /// <summary> + /// 瀛愯处鍙稩D + /// </summary> + public List<string> childAccountIds; + } + + + public class ShareDatasItem + { + /// <summary> + /// 鍒嗕韩绫诲瀷琛╥d + /// </summary> + public string shareTypeId; + /// <summary> + /// 鍒嗕韩绫诲瀷 1.ROOM 2.DEVICE 3.SCENE + /// </summary> + public string shareType; + } + + + /// <summary> + /// 鍒犻櫎鍒嗕韩 + /// </summary> + [System.Serializable] + public class DeleteShareObj + { + /// <summary> + /// + /// </summary> + public List<ShareDatasItem> shareDatas; + /// <summary> + /// 瀛愯处鍙稩D + /// </summary> + public List<string> childAccountIds; + } + + /// <summary> + /// 鑾峰彇鍒嗕韩 + /// </summary> + [System.Serializable] + public class GetShareObj + { + /// <summary> + /// 浣忓畢ID + /// </summary> + public int homeId; + /// <summary> + /// 鍒嗕韩涓婚敭ids + /// </summary> + public List<string> ids; + } + + #endregion + #endregion diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs index b5def69..fccfe8f 100644 --- a/HDL_ON/Entity/DB_ResidenceData.cs +++ b/HDL_ON/Entity/DB_ResidenceData.cs @@ -1,5 +1,7 @@ 锘縰sing System; using System.Collections.Generic; +using System.Threading; +using HDL_ON.DAL.Server; using Shared; namespace HDL_ON.Entity @@ -9,6 +11,7 @@ public DB_ResidenceData() { } + /// <summary> /// 涓讳汉token /// </summary> @@ -31,11 +34,47 @@ } else { - var curRegion = UserInfo.Current.regionList.Find((obj) => obj.RegionID == CurReginID); + var curRegion = UserInfo.Current.regionList.Find((obj) => obj.RegionID == CurReginID); + //if (curRegion == null) + //{ + // CurReginID = UserInfo.Current.regionList[0].RegionID; + // return UserInfo.Current.regionList[0]; + //} return curRegion; } } } + + ///// <summary> + ///// 鑾峰彇缃戝叧鍒楄〃 + ///// </summary> + //void GetHomeGatewayList() + //{ + // new Thread(() => + // { + // //鍒囨崲浣忓畢鍚庯紝鏌ヨ涓�娆$綉鍏冲垪琛� + // new HttpServerRequest().GetHomeGatewayList(); + // }) + // { IsBackground = true }.Start(); + + //} + + //string curReginID; + ///// <summary> + ///// 褰撳墠閫夋嫨鐨勪綇瀹呯储寮� + ///// </summary> + //public string CurReginID + //{ + // set + // { + // curReginID = value; + // GetHomeGatewayList(); + // } + // get + // { + // return curReginID; + // } + //} /// <summary> /// 褰撳墠閫夋嫨鐨勪綇瀹呯储寮� /// </summary> @@ -406,13 +445,64 @@ } /// <summary> + /// 缃戝叧璇︾粏淇℃伅 + /// </summary> + public HomeGatewayInfo HomeGateway; + + /// <summary> + /// 妫�娴嬩綇瀹呮槸鍚︾粦瀹氫簡缃戝叧 + /// </summary> + /// <returns></returns> + public bool CheckWhetherGatewayIsBound() + { + if (HomeGateway != null && !string.IsNullOrEmpty(HomeGateway.mac)) + { + return true; + } + else + { + return false; + } + } + + /// <summary> + /// 褰撳墠浣忓畢鐨勭綉鍏矼AC + /// </summary> + public string residenceGatewayMAC + { + get + { + if (CheckWhetherGatewayIsBound()) + { + return HomeGateway.mac.ToUpper(); + } + else + { + return ""; + } + } + set + { + if (CheckWhetherGatewayIsBound()) + { + HomeGateway.mac = value; + } + else + { + HomeGateway = new HomeGatewayInfo() { mac = value }; + } + } + + } + + /// <summary> /// 浣忓畢鍥剧墖 /// </summary> public string residenceImage; /// <summary> /// 褰撳墠浣忓畢鐨勭綉鍏矼AC /// </summary> - public string residenceGatewayMAC = "4E47323347591243";//"0281B9078C000000";// "00964E19C4467B1E"; + //public string residenceGatewayMAC = "4E47323347591243";//"0281B9078C000000";// "00964E19C4467B1E"; /// <summary> /// 淇濆瓨浣忓畢鏁版嵁 /// </summary> diff --git a/HDL_ON/Entity/OnAppConfig.cs b/HDL_ON/Entity/OnAppConfig.cs index d77875c..4446f29 100644 --- a/HDL_ON/Entity/OnAppConfig.cs +++ b/HDL_ON/Entity/OnAppConfig.cs @@ -26,7 +26,9 @@ } else { instance = temp; } - } catch { } + } catch { + instance = new OnAppConfig() { }; + } } return instance; } diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index db92a02..61d911d 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -211,6 +211,13 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\GetSupport\GetSupportPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferConfirmPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\ConfirmButton.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\AdminMigrationConfirmPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferInputPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\AdminMigrationInputPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferUserConfirmPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\1-HomePage\MessageCenterPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\MenuButton.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\RoomGalleryPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)UI\" /> diff --git a/HDL_ON/UI/UI0-Public/RoomGalleryPage.cs b/HDL_ON/UI/UI0-Public/RoomGalleryPage.cs new file mode 100644 index 0000000..14eaa12 --- /dev/null +++ b/HDL_ON/UI/UI0-Public/RoomGalleryPage.cs @@ -0,0 +1,104 @@ +锘縰sing HDL_ON.UI.CSS; +using Shared; +using System; +namespace HDL_ON.UI +{ + /// <summary> + /// 鎴块棿鍥惧簱鐣岄潰 + /// </summary> + public class RoomGalleryPage : FrameLayout + { + FrameLayout bodyView; + VerticalScrolViewLayout contentView; + + string lastPath; + + Action<string> backAction; + + public RoomGalleryPage(string lastPath, Action<string> action) + { + bodyView = this; + this.lastPath = lastPath; + backAction = action; + } + + public void LoadPage(bool loadSceneGallery) + { + bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; + new TopViewDiv(bodyView, Language.StringByID(StringId.DefaultGallery)).LoadTopView(); + + + contentView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(603), + }; + bodyView.AddChidren(contentView); + + if(loadSceneGallery) + { + LoadSceneGallery(); + } + } + /// <summary> + /// 鍔犺浇鍦烘櫙鍥惧簱 + /// </summary> + void LoadSceneGallery() + { + contentView.RemoveAll(); + + + FrameLayout roomImageRow = new FrameLayout() + { + Height = Application.GetRealWidth(97), + }; + for (int i = 0; i < 10; i++) + { + string curImagePath = $"Classification/Room/Roombg{i + 1}.png"; + + var sceneImageView = new FrameLayout() + { + Width = Application.GetRealWidth(172), + Height = Application.GetRealWidth(97), + BackgroundImagePath = curImagePath, + }; + if (i % 2 == 0) + { + roomImageRow = new FrameLayout() + { + Height = Application.GetRealWidth(97), + }; + contentView.AddChidren(new Button() { Height = Application.GetRealWidth(12) }); + contentView.AddChidren(roomImageRow); + sceneImageView.X = Application.GetRealWidth(10); + roomImageRow.AddChidren(sceneImageView); + } + else + { + sceneImageView.X = Application.GetRealWidth(194); + roomImageRow.AddChidren(sceneImageView); + } + if (lastPath == curImagePath) + { + var btnLastChooseTip = new Button() + { + X = Application.GetRealWidth(146), + Y = Application.GetRealWidth(6), + Width = Application.GetRealWidth(20), + Height = Application.GetRealWidth(20), + UnSelectedImagePath = "Intelligence/Gallery/chooseTipIcon.png", + }; + sceneImageView.AddChidren(btnLastChooseTip); + } + + sceneImageView.MouseUpEventHandler = (sender, e) => { + this.RemoveFromParent(); + backAction(curImagePath); + }; + } + + } + + + } +} diff --git a/HDL_ON/UI/UI0-Public/Widget/MenuButton.cs b/HDL_ON/UI/UI0-Public/Widget/MenuButton.cs new file mode 100644 index 0000000..3b4d1e7 --- /dev/null +++ b/HDL_ON/UI/UI0-Public/Widget/MenuButton.cs @@ -0,0 +1,95 @@ +锘縰sing System; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + /// <summary> + /// 淇℃伅涓績鐨勮彍鍗曟寜閽� + /// 瀹介珮閮芥槸86 + /// </summary> + public class MenuButton : FrameLayout + { + /// <summary> + /// + /// </summary> + public Button ImageButton; + /// <summary> + /// + /// </summary> + public Button TextButton; + /// <summary> + /// + /// </summary> + public Action SelectAction; + + /// <summary> + /// + /// </summary> + public MenuButton() + { + Height = Application.GetRealWidth(86); + Width = Application.GetRealWidth(86); + Show(); + } + + /// <summary> + /// + /// </summary> + void Show() + { + ImageButton = new Button() + { + Height = Application.GetRealWidth(60), + Width = Application.GetRealWidth(60), + Gravity = Gravity.CenterHorizontal + }; + this.AddChidren(ImageButton); + + TextButton = new Button() + { + Y = Application.GetRealWidth(68), + Height = this.Height - Application.GetRealWidth(68), + Width = Application.GetRealWidth(86), + TextColor = CSS_Color.PromptingColor1, + SelectedTextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextAlignment = TextAlignment.Center + }; + this.AddChidren(TextButton); + + + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + SelectAction?.Invoke(); + }; + + ImageButton.MouseUpEventHandler = eventHandler; + TextButton.MouseUpEventHandler = eventHandler; + this.MouseUpEventHandler = eventHandler; + } + + /// <summary> + /// + /// </summary> + bool isSelected; + /// <summary> + /// 閫変腑鐘舵�� + /// </summary> + /// <value><c>true</c> if this instance is selected; otherwise, <c>false</c>.</value> + public bool IsSelected + { + get + { + return isSelected; + } + set + { + isSelected = value; + ImageButton.IsSelected = isSelected; + TextButton.IsSelected = isSelected; + + } + } + } +} diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs index e936f17..ecdb411 100644 --- a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs +++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs @@ -169,7 +169,7 @@ callbackAction = action; bodyView = new FrameLayout() { - BackgroundColor = CSS_Color.BackgroundColor, + BackgroundColor = CSS_Color.MainBackgroundColor, }; AddChidren(bodyView); diff --git a/HDL_ON/UI/UI1-Login/RegisterPage.cs b/HDL_ON/UI/UI1-Login/RegisterPage.cs index 1cc2e76..6cdac76 100644 --- a/HDL_ON/UI/UI1-Login/RegisterPage.cs +++ b/HDL_ON/UI/UI1-Login/RegisterPage.cs @@ -210,7 +210,7 @@ { bodyView = new FrameLayout() { - BackgroundColor = CSS_Color.BackgroundColor, + BackgroundColor = CSS_Color.MainBackgroundColor, }; AddChidren(bodyView); diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index a9eb697..e29a96a 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -34,15 +34,15 @@ /// <summary> /// 褰撳墠娓╁害淇℃伅 /// </summary> - Button btnTempValues; + TextButton btnTempValues; /// <summary> /// 褰撳墠婀垮害淇℃伅 /// </summary> - Button btnHumidityValues; + TextButton btnHumidityValues; /// <summary> /// 褰撳墠pm2.5鐘舵�� /// </summary> - Button btnPm25Values; + TextButton btnPm25Values; /// <summary> /// 鍒囨崲鏄剧ず鍔熻兘绫诲瀷鍖哄煙 /// </summary> @@ -78,6 +78,13 @@ /// 褰撳墠鏄剧ず瀵规帶鍒剁被鍨嬫槸鍚︽槸璁惧鍔熻兘鎺у埗 /// </summary> bool CurShowTypeIsFunction = true; + #endregion + + #region 鎶ヨ淇℃伅 + Button btnMsgBg; + Button btnMsgTime; + Button btnMsg; + Button btnMsgIcon; #endregion public HomePage() @@ -158,7 +165,7 @@ }; environmentalView.AddChidren(btnTempIcon); - btnTempValues = new Button() + btnTempValues = new TextButton() { X = btnTempIcon.Right + Application.GetRealWidth(4), Width = Application.GetRealWidth(30), @@ -180,7 +187,7 @@ }; environmentalView.AddChidren(btnHumidityIcon); - btnHumidityValues = new Button() + btnHumidityValues = new TextButton() { X = btnHumidityIcon.Right + Application.GetRealWidth(4), Width = Application.GetRealWidth(30), @@ -202,7 +209,7 @@ }; environmentalView.AddChidren(btnPm25Icon); - btnPm25Values = new Button() + btnPm25Values = new TextButton() { X = btnPm25Icon.Right + Application.GetRealWidth(4), Width = Application.GetRealWidth(130), @@ -226,14 +233,14 @@ }; topView.AddChidren(msgView); - var btngb = new Button() + btnMsgBg = new Button() { BackgroundColor = CSS_Color.MainColor,//0x3F4484F4, Alpha = 0.4f, }; - msgView.AddChidren(btngb); + msgView.AddChidren(btnMsgBg); - Button btnMsgIcon; + btnMsgIcon = new Button() { X = Application.GetRealWidth(12), @@ -245,7 +252,7 @@ }; msgView.AddChidren(btnMsgIcon); - Button btnMsg; + btnMsg = new Button() { X = Application.GetRealWidth(10) + btnMsgIcon.Right, @@ -257,7 +264,7 @@ }; msgView.AddChidren(btnMsg); - Button btnMsgTime; + btnMsgTime = new Button() { X = Application.GetRealWidth(299), @@ -267,6 +274,9 @@ TextAlignment = TextAlignment.CenterLeft, }; msgView.AddChidren(btnMsgTime); + + LoadEvent_GotoMessageCenterPage(); + #endregion #endregion diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs index 261d808..1441781 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs @@ -269,5 +269,23 @@ }; } + /// <summary> + /// 鍔犺浇璺宠浆淇℃伅涓績椤甸潰 + /// </summary> + void LoadEvent_GotoMessageCenterPage() + { + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + var skipPage = new MessageCenterPage(); + MainPage.BasePageView.AddChidren(skipPage); + skipPage.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + btnMsgBg.MouseUpEventHandler = eventHandler; + btnMsgTime.MouseUpEventHandler = eventHandler; + btnMsg.MouseUpEventHandler = eventHandler; + btnMsgIcon.MouseUpEventHandler = eventHandler; + } + } } diff --git a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs new file mode 100644 index 0000000..602b8eb --- /dev/null +++ b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs @@ -0,0 +1,499 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.CSS; +using System.Collections.Generic; +using System.Threading; +using HDL_ON.DAL.Server; + +namespace HDL_ON.UI +{ + /// <summary> + /// 淇℃伅涓績椤甸潰 + /// </summary> + public class MessageCenterPage : FrameLayout + { + FrameLayout bodyView; + /// <summary> + /// 褰撳墠 + /// </summary> + VerticalScrolViewLayout bodyScrolView; + /// <summary> + /// 鍐呭涓虹┖鎻愮ずView + /// </summary> + EmptyTipView emptyTipView; + + /// <summary> + /// menuView + /// </summary> + FrameLayout menuView; + MenuButton allMenuButton; + MenuButton shareMenuButton; + MenuButton alarmMenuButton; + MenuButton systemMenuButton; + FrameLayout messageView; + + /// <summary> + /// 鏄剧ず鐨勬秷鎭被鍨� + /// 1鍏ㄩ儴 2鍒嗕韩涓庡姛鑳� 3鎶ヨ绫� 4绯荤粺淇℃伅 + /// </summary> + int showMesType = 1; + /// <summary> + /// 鎺ㄩ�佹秷鎭垪琛� + /// </summary> + List<PushMessageInfo> PushMessageInfoList = new List<PushMessageInfo>(); + + + /// <summary> + /// + /// </summary> + public MessageCenterPage() + { + bodyView = this; + BackgroundColor = CSS_Color.BackgroundColor; + } + + /// <summary> + /// + /// </summary> + public void LoadPage() + { + new TopViewDiv(bodyView, Language.StringByID(StringId.MessageCenter)).LoadTopView(); + + AddTopMenuView(); + AddMessageView(); + MenuButtonSelect(1); + //TestLoad(); + GetPushMessageList(); + } + + /// <summary> + /// 椤堕儴鑿滃崟閫夐」 + /// </summary> + void AddTopMenuView() + { + + menuView = new FrameLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealWidth(117), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + bodyView.AddChidren(menuView); + + + #region 鍏ㄩ儴鎸夐挳 + allMenuButton = new MenuButton() + { + X = Application.GetRealWidth(15), + Y = Application.GetRealWidth(16), + }; + menuView.AddChidren(allMenuButton); + allMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/AllOn.png"; + allMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/All.png"; + allMenuButton.TextButton.TextID = StringId.All; + Action allAction = () => + { + MenuButtonSelect(1); + }; + allMenuButton.SelectAction = allAction; + #endregion + + #region 鍒嗕韩涓庡姛鑳� + shareMenuButton = new MenuButton() + { + X = allMenuButton.Right, + Y = Application.GetRealWidth(16), + }; + menuView.AddChidren(shareMenuButton); + shareMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/ShareOn.png"; + shareMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/Share.png"; + shareMenuButton.TextButton.TextID = StringId.SharingAndFunctionality; + Action shateAction = () => + { + MenuButtonSelect(2); + }; + shareMenuButton.SelectAction = shateAction; + #endregion + + #region 鎶ヨ绫� + alarmMenuButton = new MenuButton() + { + X = shareMenuButton.Right, + Y = Application.GetRealWidth(16), + }; + menuView.AddChidren(alarmMenuButton); + alarmMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/AlarmOn.png"; + alarmMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/Alarm.png"; + alarmMenuButton.TextButton.TextID = StringId.AlarmType; + Action alarmAction = () => + { + MenuButtonSelect(3); + }; + alarmMenuButton.SelectAction = alarmAction; + #endregion + + #region 绯荤粺淇℃伅 + systemMenuButton = new MenuButton() + { + X = alarmMenuButton.Right, + Y = Application.GetRealWidth(16), + }; + menuView.AddChidren(systemMenuButton); + systemMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/SystemOn.png"; + systemMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/System.png"; + systemMenuButton.TextButton.TextID = StringId.SystemMessage; + Action systemAction = () => + { + MenuButtonSelect(4); + }; + systemMenuButton.SelectAction = systemAction; + #endregion + + } + + /// <summary> + /// 涓棿淇℃伅鍐呭 + /// </summary> + void AddMessageView() + { + int messageViewY = menuView.Bottom + Application.GetRealWidth(8); + int messageViewHeight = bodyView.Height - messageViewY; + messageView = new FrameLayout() + { + Y = messageViewY, + Height = messageViewHeight, + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + bodyView.AddChidren(messageView); + + bodyScrolView = new VerticalScrolViewLayout() + { + Height = messageViewHeight, + }; + messageView.AddChidren(bodyScrolView); + + } + + /// <summary> + /// + /// </summary> + /// <param name="selectId">1鍏ㄩ儴 2鍒嗕韩涓庡姛鑳� 3鎶ヨ绫� 4绯荤粺淇℃伅</param> + void MenuButtonSelect(int selectId) + { + showMesType = selectId; + + if (selectId == 1) + { + allMenuButton.IsSelected = true; + shareMenuButton.IsSelected = false; + alarmMenuButton.IsSelected = false; + systemMenuButton.IsSelected = false; + + } + else if (selectId == 2) + { + allMenuButton.IsSelected = false; + shareMenuButton.IsSelected = true; + alarmMenuButton.IsSelected = false; + systemMenuButton.IsSelected = false; + + } + else if (selectId == 3) + { + allMenuButton.IsSelected = false; + shareMenuButton.IsSelected = false; + alarmMenuButton.IsSelected = true; + systemMenuButton.IsSelected = false; + } + else if (selectId == 4) + { + allMenuButton.IsSelected = false; + shareMenuButton.IsSelected = false; + alarmMenuButton.IsSelected = false; + systemMenuButton.IsSelected = true; + + } + } + + + + /// <summary> + /// 娣诲姞鍐呭涓虹┖鎻愮ず椤甸潰 + /// </summary> + void AddEmptyTipView() + { + emptyTipView = new EmptyTipView() + { + Gravity = Gravity.Center + }; + messageView.AddChidren(emptyTipView); + } + + /// <summary> + /// 鍔犺浇鎶ヨ淇℃伅RowView + /// </summary> + /// <param name="VerticalScrolViewMiddle"></param> + /// <param name="pushMessageInfo"></param> + void AddRowView(VerticalScrolViewLayout VerticalScrolViewMiddle, PushMessageInfo pushMessageInfo) + { + var rowView = new RowLayout() + { + Height = Application.GetRealHeight(65), + LineColor = CSS_Color.MainBackgroundColor, + }; + VerticalScrolViewMiddle.AddChidren(rowView); + + //鏍囬 + var btnTilte = new Button() + { + X = Application.GetRealWidth(16), + Y = Application.GetRealHeight(12), + Width = Application.GetRealWidth(320), + Height = Application.GetRealHeight(20), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + Text = pushMessageInfo.messageTitle + }; + rowView.AddChidren(btnTilte); + + //鍓爣棰� + var btnSubtitle = new Button() + { + X = Application.GetRealWidth(16), + Y = btnTilte.Bottom + Application.GetRealHeight(4), + Width = Application.GetRealWidth(240), + Height = Application.GetRealHeight(17), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = pushMessageInfo.messageContent + }; + rowView.AddChidren(btnSubtitle); + + //鏃ユ湡 + var btnDatetime = new Button() + { + X = Application.GetRealWidth(259), + Y = btnTilte.Bottom + Application.GetRealHeight(4), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(17), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = pushMessageInfo.createTime + }; + rowView.AddChidren(btnDatetime); + + var lineView = new LineView(rowView.Height); + rowView.AddChidren(lineView); + + //鍒犻櫎鎸夐挳 + var deleteBtn = new Button() + { + TextID = StringId.Del, + BackgroundColor = CSS_Color.AuxiliaryColor2, + TextColor = CSS_Color.MainBackgroundColor, + TextSize = CSS_FontSize.TextFontSize, + }; + rowView.AddRightView(deleteBtn); + deleteBtn.MouseUpEventHandler = (sender, e) => + { + rowView.RemoveFromParent(); + }; + + //EventHandler<MouseEventArgs> eventHandler = (sender, e) => + //{ + //}; + + //btnTilte.MouseUpEventHandler = eventHandler; + //btnSubtitle.MouseUpEventHandler = eventHandler; + } + + /// <summary> + /// 鍔犺浇骞翠唤鏍囬 + /// </summary> + /// <param name="VerticalScrolViewMiddle"></param> + /// <param name="yearStr"></param> + void AddYearRowView(VerticalScrolViewLayout VerticalScrolViewMiddle, string yearStr) + { + var bgView = new FrameLayout() + { + Height = Application.GetRealHeight(57), + }; + VerticalScrolViewMiddle.AddChidren(bgView); + + var yearBtn = new Button() + { + X = Application.GetRealWidth(16), + Y = Application.GetRealHeight(16), + Width = Application.GetRealWidth(320), + Height = Application.GetRealHeight(33), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, + IsBold = true, + Text = yearStr + }; + bgView.AddChidren(yearBtn); + } + + /// <summary> + /// + /// </summary> + void GetPushMessageList() + { + var waitPage = new Loading(); + waitPage.Start(Language.StringByID(StringId.PleaseWait)); + bodyScrolView.RemoveAll(); + PushMessageInfoList.Clear(); + + new Thread(() => + { + try + { + var result = new HttpServerRequest().PushSerivceGetPushmessagelist(); + if (result.Code == StateCode.SUCCESS) + { + PushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString()); + Application.RunOnMainThread(() => + { + if (PushMessageInfoList != null && PushMessageInfoList.Count > 0) + { + + ParseAndDisplayPushList(); + } + else + { + AddEmptyTipView(); + } + }); + } + else + { + Application.RunOnMainThread(() => + { + AddEmptyTipView(); + }); + IMessageCommon.Current.ShowErrorInfoAlter(result.Code); + } + } + catch (Exception ex) + { + } + finally + { + Application.RunOnMainThread(() => + { + if (waitPage != null) + { + waitPage.RemoveFromParent(); + waitPage = null; + } + }); + } + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 瑙f瀽鍜屾樉绀烘帹閫佹秷鎭� + /// </summary> + void ParseAndDisplayPushList() + { + // + if (showMesType == 1) + { + + } + } + + #region 娴嬭瘯 + /// <summary> + /// + /// </summary> + void TestLoad() + { + PushMessageInfoList.Add(new PushMessageInfo() + { + messageTitle = "鎶ヨ淇℃伅", + messageContent = "闂ㄩ攣琚墦寮�", + createTime = "11鏈�30 10:50", + }); + + PushMessageInfoList.Add(new PushMessageInfo() + { + messageTitle = "鎶ヨ淇℃伅1", + messageContent = "闂ㄩ攣琚墦寮�", + createTime = "11鏈�30 11:50", + }); + + PushMessageInfoList.Add(new PushMessageInfo() + { + messageTitle = "鎶ヨ淇℃伅2", + messageContent = "闂ㄩ攣琚墦寮�", + createTime = "11鏈�30 12:50", + }); + + AddYearRowView(bodyScrolView, "2020骞�"); + foreach (var info in PushMessageInfoList) + { + AddRowView(bodyScrolView, info); + } + + AddYearRowView(bodyScrolView, "2019骞�"); + foreach (var info in PushMessageInfoList) + { + AddRowView(bodyScrolView, info); + } + } + #endregion + } + + + /// <summary> + /// 鎺ㄩ�佹秷鎭被鍨� + /// </summary> + [System.Serializable] + public class PushMessageInfo + { + /// <summary> + /// 璁板綍Id + /// </summary> + public string id; + /// <summary> + /// 鏄惁宸茶 + /// </summary> + public bool isRead; + /// <summary> + /// 娑堟伅鍐呭 + /// </summary> + public string messageContent; + /// <summary> + /// 鎵╁睍鏁版嵁 + /// </summary> + public string messageExpand; + /// <summary> + /// 娑堟伅涓婚 + /// </summary> + public string messageTitle; + /// <summary> + /// 娑堟伅绫诲瀷锛�0锛氭彁绀猴紱1锛氭姤璀︼紱2锛氫赴鏋楀彲鏄璁插懠鍙紱3锛氬己鍒朵笅绾挎帹閫� + /// </summary> + public string messageType; + /// <summary> + /// 鎺ㄩ�乀oken璁板綍Id + /// </summary> + public string pushId; + /// <summary> + /// 鎺ㄩ�佺被鍨嬶紱0锛氶粯璁わ紱1锛氭姤璀︼紱2锛氭彁绀猴紱3锛氭柊闂伙紱4锛氭帹鑽愶紱 + /// </summary> + public string pushType; + /// <summary> + /// 鎺ㄩ�佹椂闂� + /// </summary> + public string createTime; + + } + +} diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index 9f9455e..16e1c44 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -224,7 +224,7 @@ { Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(184), + Height = Application.GetRealWidth(192),//2020-12-01 鎴块棿鍥剧墖姣斾緥鏀瑰洖16:9 Radius = (uint)Application.GetRealWidth(12), Tag = room.sid, }; @@ -233,7 +233,7 @@ var roomViewbg = new ImageView() { Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(184), + Height = Application.GetRealWidth(192),//2020-12-01 鎴块棿鍥剧墖姣斾緥鏀瑰洖16:9 ImagePath = room.backgroundImage, Radius = (uint)Application.GetRealWidth(12), }; @@ -353,7 +353,7 @@ var btn = new Button() { - Height = Application.GetRealHeight(20), + Height = Application.GetRealWidth(20), }; roomListView.AddChidren(btn); diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs index 00ae5a7..056eb91 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs @@ -740,20 +740,29 @@ { btnTakePicture.IsSelected = false; - var pid = Guid.NewGuid(); + //var pid = Guid.NewGuid(); + //CropImage.TakePicture((imagePath) => + //{ + // if (imagePath != null) + // { + // addSceneImageView.ImagePath = imagePath.ToString(); + // scene.ImagePath = addSceneImageView.ImagePath; + // MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + // } + //}, pid.ToString(), 4, 3); + + + //var imageName = Guid.NewGuid().ToString(); + var imageName = scene.sid; CropImage.TakePicture((imagePath) => { - if (imagePath != null) - { - addSceneImageView.ImagePath = imagePath.ToString(); - scene.ImagePath = addSceneImageView.ImagePath; - MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); - } - }, pid.ToString(), 4, 3); - if (pageTitleId == StringId.EditScene) - { - scene.SaveSceneData(); - } + CropImageCallBack(imagePath, imageName); + }, imageName, 4, 3); + + //if (pageTitleId == StringId.EditScene) + //{ + // scene.SaveFunctionData(); + //} pictureOptionView.Parent.RemoveFromParent(); }; btnAlbum.MouseDownEventHandler = (sender, e) => { @@ -763,20 +772,30 @@ btnAlbum.MouseUpEventHandler = (sender, e) => { btnAlbum.IsSelected = false; - var pid = Guid.NewGuid(); + //var pid = Guid.NewGuid(); + //CropImage.SelectPicture((imagePath) => + //{ + // if (imagePath != null) + // { + // addSceneImageView.ImagePath = imagePath.ToString(); + // scene.ImagePath = addSceneImageView.ImagePath; + // MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + // } + //}, pid.ToString(), 4, 3); + + //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀 + //var imageName = Guid.NewGuid().ToString(); + var imageName = scene.sid; CropImage.SelectPicture((imagePath) => { - if (imagePath != null) - { - addSceneImageView.ImagePath = imagePath.ToString(); - scene.ImagePath = addSceneImageView.ImagePath; - MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); - } - }, pid.ToString(), 4, 3); - if (pageTitleId == StringId.EditScene) - { - scene.SaveSceneData(); - } + CropImageCallBack(imagePath, imageName); + }, imageName, 4, 3); + + + //if (pageTitleId == StringId.EditScene) + //{ + // scene.SaveFunctionData(); + //} pictureOptionView.Parent.RemoveFromParent(); }; @@ -796,6 +815,58 @@ galleryPage.LoadPage(true); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; + + } + + /// <summary> + /// 瑁佸壀瀹岀収鐗囧洖璋冿紝缁熶竴澶勭悊 + /// </summary> + /// <param name="imagePath">瑁佸壀鍚庣殑鐪熷疄璺緞</param> + /// <param name="imageName">鑷畾涔夌殑鍥剧墖鍚嶇О</param> + void CropImageCallBack(string imagePath, string imageName) + { + if (string.IsNullOrEmpty(imagePath) == true) + { + return; + } + + try + { + var mPath = imagePath; + MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + +#if __IOS__ + + +#else + //1.浣跨敤鏂板悕瀛楋紝瑙e喅鐩稿悓璺緞涓嶅埛鏂板浘鐗囬棶棰� + imageName = Guid.NewGuid().ToString() + ".png"; + //1.2濡傛灉鏄嚜瀹氫箟鍥剧墖鍒犻櫎涔嬪墠鐨� + if (!addSceneImageView.ImagePath.Contains("Gallery/scenebg")) + { + Utlis.WriteLine("鍒犻櫎: " + addSceneImageView.ImagePath); + System.IO.File.Delete(addSceneImageView.ImagePath); + } + //1.3濡傛灉鏄畨鍗撻渶瑕佹嫹璐濆洖鏉PP鏍圭洰褰� + FileUtils.FileCopyToRootPath(imagePath, imageName); + System.IO.File.Delete(imagePath); + MainPage.Log("SelectPicture 鏈�缁堣矾寰�: " + imageName); + mPath = imageName; +#endif + //娓呯┖鍘熸潵鍥剧墖 + addSceneImageView.ImagePath = "NULL"; + addSceneImageView.ImagePath = mPath; + scene.ImagePath = mPath; + + if (pageTitleId == StringId.EditScene) + { + scene.SaveFunctionData(); + } + } + catch + { + + } } @@ -884,5 +955,6 @@ btnEditSceneNameIcon.MouseUpEventHandler = eventHandler; } + } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs index 9b068fd..6ad72a9 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs @@ -134,9 +134,8 @@ versionUpdateView.BtnTilte.TextID = StringId.VersionUpdate; Action versionUpdateAction = () => { - //OpenUrl(); - - TestDDDDD(); + OpenUrl(); + //TestDDDDD(); }; versionUpdateView.GoAction = versionUpdateAction; #endregion diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/ComplaintsPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/ComplaintsPage.cs index ea908e1..e17cc43 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/ComplaintsPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/ComplaintsPage.cs @@ -20,6 +20,7 @@ public ComplaintsPage() { bodyView = this; + BackgroundColor = CSS_Color.MainBackgroundColor; } public void LoadPage() diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/GetSupport/GetSupportPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/GetSupport/GetSupportPage.cs index d9b916d..c7fd8cf 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/GetSupport/GetSupportPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/GetSupport/GetSupportPage.cs @@ -20,6 +20,7 @@ public GetSupportPage() { bodyView = this; + BackgroundColor = CSS_Color.MainBackgroundColor; } public void LoadPage() diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs index 91a039c..2b6108e 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs @@ -59,20 +59,20 @@ headPortraitView.AddChidren(btnMemberName); #region RoomList - FrameLayout contentView = new FrameLayout() + VerticalScrolViewLayout roomListView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(138), - Height = Application.GetRealHeight(485), - BackgroundColor = CSS_Color.MainBackgroundColor, + Height = Application.GetRealHeight(471), + //BackgroundColor = CSS_Color.MainBackgroundColor, }; - bodyView.AddChidren(contentView); + bodyView.AddChidren(roomListView); var titleView = new FrameLayout() { BackgroundColor = CSS_Color.MainBackgroundColor, Height = Application.GetRealWidth(44), }; - contentView.AddChidren(titleView); + roomListView.AddChidren(titleView); var btnTitle = new Button() { @@ -92,15 +92,15 @@ Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor, }; - contentView.AddChidren(btnLine); + roomListView.AddChidren(btnLine); //--------------------------------------------- - var roomListView = new VerticalScrolViewLayout() - { - Y = btnLine.Bottom, - Height = Application.GetRealHeight(440), - }; - contentView.AddChidren(roomListView); + //var roomListView = new VerticalScrolViewLayout() + //{ + // Y = btnLine.Bottom, + // Height = Application.GetRealHeight(440), + //}; + //contentView.AddChidren(roomListView); //List<Function> funss = new List<Function>(); //if (memberInfo.CurResidenceShareDate.Count > 0) @@ -207,20 +207,20 @@ } } - if (DB_ResidenceData.rooms.Count > 10) - { - roomListView.ScrollEnabled = true; - } - else - { - roomListView.ScrollEnabled = false; + //if (DB_ResidenceData.rooms.Count > 10) + //{ + // roomListView.ScrollEnabled = true; + //} + //else + //{ + // roomListView.ScrollEnabled = false; - roomListView.AddChidren(new Button() - { - Height = Application.GetRealWidth(441), - BackgroundColor = CSS_Color.BackgroundColor, - }); - } + // roomListView.AddChidren(new Button() + // { + // Height = Application.GetRealWidth(441), + // BackgroundColor = CSS_Color.BackgroundColor, + // }); + //} #endregion btnDelMember = new Button() diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs index 834db5c..dac34eb 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs @@ -1,4 +1,5 @@ 锘縰sing System; +using HDL_ON.DAL.Server; using HDL_ON.Entity; using Shared; @@ -214,6 +215,9 @@ OnAppConfig.Instance.SaveUserConfig(); DB_ResidenceData.InitRoomFunction(); DB_ResidenceData.residenceData.SaveResidenceData(); + //鍒锋柊涓�娆′綇瀹呯綉鍏� + new HttpServerRequest().GetHomeGatewayList(); + Application.RunOnMainThread(() => { btnCurResidenceName.Text = DB_ResidenceData.residenceData.residecenInfo.Name; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs index 09934a6..fd746a4 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs @@ -69,6 +69,9 @@ }).Start(); #endregion + //2.娉ㄩ攢鎺ㄩ�� + new HttpServerRequest().SignOutPush(); + //3.璺宠浆鐧诲綍椤甸潰 UserInfo.Current.LastTime = DateTime.MinValue; UserInfo.Current.SaveUserInfo(); MainPage.GoLoginPage(UserInfo.Current); @@ -115,23 +118,33 @@ btnTakePicture.MouseUpEventHandler = (sender, e) => { btnTakePicture.IsSelected = false; - var pid = Guid.NewGuid(); - CropImage.TakePicture((Action<string>)((imagePath) => + //var pid = Guid.NewGuid(); + //CropImage.TakePicture((Action<string>)((imagePath) => + //{ + // if (imagePath != null) + // { + // UserInfo.Current.headImagePagePath = imagePath.ToString(); + // userHeadImageView.ImagePath = imagePath.ToString(); + // updataHeadImage(); + // new System.Threading.Thread(() => + // { + // new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); + // }) + // { IsBackground = true }.Start(); + // UserInfo.Current.SaveUserInfo(); + // MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + // } + //}), pid.ToString(), 1, 1); + + //鎷嶇収瑁佸壀 + var imageName = "headImage"; + //var imageName = Guid.NewGuid().ToString(); + CropImage.TakePicture((imagePath) => { - if (imagePath != null) - { - UserInfo.Current.headImagePagePath = imagePath.ToString(); - userHeadImageView.ImagePath = imagePath.ToString(); - updataHeadImage(); - new System.Threading.Thread(() => - { - new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); - }) - { IsBackground = true }.Start(); - UserInfo.Current.SaveUserInfo(); - MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); - } - }), pid.ToString(), 1, 1); + CropImageCallBack(imagePath, imageName); + + }, imageName, 1, 1); + pictureOptionView.RemoveFromParent(); baseView.RemoveFromParent(); }; @@ -144,29 +157,88 @@ btnAlbum.MouseUpEventHandler = (sender, e) => { btnAlbum.IsSelected = false; - var pid = Guid.NewGuid(); + //var pid = Guid.NewGuid(); + //CropImage.SelectPicture((imagePath) => + //{ + // if (imagePath != null) + // { + // UserInfo.Current.headImagePagePath = imagePath.ToString(); + // userHeadImageView.ImagePath = imagePath.ToString(); + // updataHeadImage(); + + // new System.Threading.Thread(() => + // { + // new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); + // }) + // { IsBackground = true }.Start(); UserInfo.Current.SaveUserInfo(); + // MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + // } + //}, pid.ToString(), 1, 1); + + //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀 + //var imageName = Guid.NewGuid().ToString(); + var imageName = "headImage"; CropImage.SelectPicture((imagePath) => { - if (imagePath != null) - { - UserInfo.Current.headImagePagePath = imagePath.ToString(); - userHeadImageView.ImagePath = imagePath.ToString(); - updataHeadImage(); + CropImageCallBack(imagePath, imageName); + }, imageName, 1, 1); - new System.Threading.Thread(() => - { - new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); - }) - { IsBackground = true }.Start(); UserInfo.Current.SaveUserInfo(); - MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); - } - }, pid.ToString(), 1, 1); pictureOptionView.RemoveFromParent(); baseView.RemoveFromParent(); }; } /// <summary> + /// 瑁佸壀瀹岀収鐗囧洖璋冿紝缁熶竴澶勭悊 + /// </summary> + /// <param name="imagePath">瑁佸壀鍚庣殑鐪熷疄璺緞</param> + /// <param name="imageName">鑷畾涔夌殑鍥剧墖鍚嶇О</param> + void CropImageCallBack(string imagePath, string imageName) + { + if (string.IsNullOrEmpty(imagePath) == true) + { + return; + } + try + { + MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + + var headPath = imagePath; +#if __IOS__ + + +#else + //1.浣跨敤鏂板悕瀛楋紝瑙e喅鐩稿悓璺緞涓嶅埛鏂板浘鐗囬棶棰� + imageName = Guid.NewGuid().ToString() + ".png"; + //1.2鍒犻櫎鍘熸潵鏈湴澶村儚 + System.IO.File.Delete(userHeadImageView.ImagePath); + Utlis.WriteLine("鍒犻櫎: " + userHeadImageView.ImagePath); + //1.3濡傛灉鏄畨鍗撻渶瑕佹嫹璐濆洖鏉PP鏍圭洰褰� + FileUtils.FileCopyToRootPath(imagePath, imageName); + System.IO.File.Delete(imagePath); + headPath = imageName; + MainPage.Log("SelectPicture 鏈�缁堣矾寰�: " + imageName); +#endif + + //娓呯┖鍘熸潵鍥剧墖 + userHeadImageView.ImagePath = "NULL"; + //鐢熸垚鍥剧墖 + UserInfo.Current.headImagePagePath = headPath; + userHeadImageView.ImagePath = headPath; + updataHeadImage(); + + new System.Threading.Thread(() => + { + new DAL.Server.HttpServerRequest().UpdataUserHeadImage(headPath); + }) + { IsBackground = true }.Start(); + UserInfo.Current.SaveUserInfo(); + } + catch { } + + } + + /// <summary> /// 鍔犺浇淇敼鐢ㄦ埛鍚嶇О浜嬩欢 /// </summary> void LoadEvent_EditUserName() diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs index 35d4bff..330e535 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs @@ -57,6 +57,13 @@ /// </summary> Button btnCommissioningAuthoritySwitchIcon; + #region 绠$悊鍛樻潈闄愯縼绉� + FrameLayout administratorPermissionMigrationRow; + Button btnAdministratorPermissionMigrationTitle; + Button btnAdministratorPermissionMigrationExplan; + Button btnAdministratorPermissionMigrationSkinIcon; + #endregion + #region 杩囨埛 /// <summary> /// @@ -262,7 +269,6 @@ #region 绠$悊鍛樻潈闄愯縼绉� - FrameLayout administratorPermissionMigrationRow; administratorPermissionMigrationRow = new FrameLayout() { Y = Application.GetRealHeight(8) + roomManagementRow.Bottom, @@ -271,7 +277,7 @@ }; bodyView.AddChidren(administratorPermissionMigrationRow); - var btnAdministratorPermissionMigrationTitle = new Button() + btnAdministratorPermissionMigrationTitle = new Button() { X = Application.GetRealWidth(16), Y = Application.GetRealHeight(10), @@ -284,7 +290,7 @@ }; administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationTitle); - var btnAdministratorPermissionMigrationExplan = new Button() + btnAdministratorPermissionMigrationExplan = new Button() { X = Application.GetRealWidth(16), Y = btnAdministratorPermissionMigrationTitle.Bottom, @@ -297,7 +303,7 @@ }; administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationExplan); - Button btnAdministratorPermissionMigrationSkinIcon; + btnAdministratorPermissionMigrationSkinIcon = new Button() { X = Application.GetRealWidth(343), diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs index 2d20372..905fce7 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs @@ -14,6 +14,7 @@ LoadEvent_SkipRoomsPage(); LoadEvent_EditResidencName(); LoadEvent_EditResidencAddress(); + //LoadEvent_SkipAdminMigrationConfirmPage(); //LoadEvent_SkipTransferConfirmPage(); } @@ -211,6 +212,24 @@ } /// <summary> + /// 璺宠浆绠$悊鍛樻潈闄愯縼绉婚〉闈� + /// </summary> + void LoadEvent_SkipAdminMigrationConfirmPage() + { + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { + var skipPage = new AdminMigrationConfirmPage(); + MainPage.BasePageView.AddChidren(skipPage); + skipPage.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + administratorPermissionMigrationRow.MouseUpEventHandler = eventHandler; + btnAdministratorPermissionMigrationTitle.MouseUpEventHandler = eventHandler; + btnAdministratorPermissionMigrationExplan.MouseUpEventHandler = eventHandler; + btnAdministratorPermissionMigrationSkinIcon.MouseUpEventHandler = eventHandler; + } + + /// <summary> /// 璺宠浆杩囨埛椤甸潰 /// </summary> void LoadEvent_SkipTransferConfirmPage() @@ -227,5 +246,7 @@ btnTrasferSkinIcon.MouseUpEventHandler = eventHandler; btnTransferTitle.MouseUpEventHandler = eventHandler; } + + } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPage.cs index d48d638..c74f95b 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPage.cs @@ -158,7 +158,7 @@ roomBgView = new FrameLayout() { Y = Application.GetRealHeight(64), - Height = Application.GetRealHeight(224), + Height = Application.GetRealWidth(232), BackgroundColor = CSS_Color.MainBackgroundColor, }; bodyView.AddChidren(roomBgView); @@ -168,7 +168,7 @@ Gravity = Gravity.CenterHorizontal, Y = Application.GetRealWidth(20), Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(184), + Height = Application.GetRealWidth(192),//2020-12-01 鎴块棿鍥剧墖姣斾緥鏀瑰洖16:9 //UnSelectedImagePath = room.backgroundImage, ImagePath = room.backgroundImage, Radius = (uint)Application.GetRealWidth(12), diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs index 93308e5..8cd2f51 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs @@ -39,7 +39,7 @@ }.Show(bodyView); return; } - if(string.IsNullOrEmpty( room.floorName)) + if (string.IsNullOrEmpty(room.floorName)) { new Tip() { @@ -222,51 +222,133 @@ { baseView.RemoveFromParent(); }; - btnTakePicture.MouseDownEventHandler = (sender, e) => { + btnTakePicture.MouseDownEventHandler = (sender, e) => + { btnTakePicture.IsSelected = true; }; + //鎷嶇収 btnTakePicture.MouseUpEventHandler = (sender, e) => { btnTakePicture.IsSelected = false; - var pid = Guid.NewGuid(); + //var pid = Guid.NewGuid(); + //CropImage.TakePicture((imagePath) => + //{ + // if (imagePath != null) + // { + // btnRoomBg.ImagePath = imagePath.ToString(); + // room.backgroundImage = btnRoomBg.ImagePath; + // MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + // } + //}, pid.ToString(), 16, 9); + + //var imageName = Guid.NewGuid().ToString(); + var imageName = room.sid; CropImage.TakePicture((imagePath) => { - if (imagePath != null) - { - btnRoomBg.ImagePath = imagePath.ToString(); - room.backgroundImage = btnRoomBg.ImagePath; - MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); - } - }, pid.ToString(), 16, 9); - if (pageTitleId == StringId.EditRoomInfo) - { - room.SaveRoomData(); - } + CropImageCallBack(imagePath, imageName); + + }, imageName, 16, 9); + baseView.RemoveFromParent(); }; - btnAlbum.MouseDownEventHandler = (sender, e) => { + //閫夋嫨鐓х墖 + btnAlbum.MouseDownEventHandler = (sender, e) => + { btnAlbum.IsSelected = true; }; btnAlbum.MouseUpEventHandler = (sender, e) => { btnAlbum.IsSelected = false; - var pid = Guid.NewGuid(); + //var pid = Guid.NewGuid(); + //CropImage.SelectPicture((imagePath) => + //{ + // if (imagePath != null) + // { + // btnRoomBg.ImagePath = imagePath.ToString(); + // room.backgroundImage = btnRoomBg.ImagePath; + // MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + // } + //}, pid.ToString(), 16, 9); + + //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀 + //var imageName = Guid.NewGuid().ToString(); + var imageName = room.sid; CropImage.SelectPicture((imagePath) => { - if (imagePath != null) + CropImageCallBack(imagePath, imageName); + + }, imageName, 16, 9); + + baseView.RemoveFromParent(); + + }; + + //鎴块棿榛樿鍥惧簱 + btnDefaultGallery.MouseUpEventHandler = (sender, e) => { + pictureOptionView.Parent.RemoveFromParent(); + Action<string> action = (obj) => { + room.backgroundImage = obj; + btnRoomBg.ImagePath = room.backgroundImage; + if (pageTitleId == StringId.EditRoomInfo) { - btnRoomBg.ImagePath = imagePath.ToString(); - room.backgroundImage = btnRoomBg.ImagePath; - MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + room.SaveRoomData(); } - }, pid.ToString(), 16, 9); + }; + + var galleryPage = new RoomGalleryPage(room.backgroundImage, action); + MainPage.BasePageView.AddChidren(galleryPage); + galleryPage.LoadPage(true); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + + }; + } + + /// <summary> + /// 瑁佸壀瀹岀収鐗囧洖璋冿紝缁熶竴澶勭悊 + /// </summary> + /// <param name="imagePath">瑁佸壀鍚庣殑鐪熷疄璺緞</param> + /// <param name="imageName">鑷畾涔夌殑鍥剧墖鍚嶇О</param> + void CropImageCallBack(string imagePath, string imageName) + { + if (string.IsNullOrEmpty(imagePath) == true) + { + return; + } + try + { + var mPath = imagePath; + MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); +#if __IOS__ + + +#else + //imageName = imageName + ".png"; + + //1.浣跨敤鏂板悕瀛楋紝瑙e喅鐩稿悓璺緞涓嶅埛鏂板浘鐗囬棶棰� + imageName = Guid.NewGuid().ToString() + ".png"; + //1.2濡傛灉鏄嚜瀹氫箟鍥剧墖鍒犻櫎涔嬪墠鐨� + if (!btnRoomBg.ImagePath.Contains("Room")) { + Utlis.WriteLine("鍒犻櫎: " + btnRoomBg.ImagePath); + System.IO.File.Delete(btnRoomBg.ImagePath); + } + //1.3濡傛灉鏄畨鍗撻渶瑕佹嫹璐濆洖鏉PP鏍圭洰褰� + FileUtils.FileCopyToRootPath(imagePath, imageName); + System.IO.File.Delete(imagePath); + mPath = imageName; +#endif + //娓呯┖鍘熸潵鍥剧墖 + btnRoomBg.ImagePath = "NULL"; + //鐢熸垚鍥剧墖 + room.backgroundImage = mPath; + btnRoomBg.ImagePath = mPath; + if (pageTitleId == StringId.EditRoomInfo) { room.SaveRoomData(); } - baseView.RemoveFromParent(); - }; + } + catch { } } } } \ No newline at end of file diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPage.cs index 2c6b29a..e5e2666 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPage.cs @@ -50,61 +50,43 @@ /// </summary> void LoadRoomRow(Room room) { - roomsListView.AddChidren(new Button() - { - Height = Application.GetRealHeight(8), - Tag = room.name+"line", - }); - var roomRow = new FrameLayout() { - Gravity = Gravity.CenterHorizontal, Tag = room.name + "row", - Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(92), - Radius = (uint)Application.GetRealWidth(12), + Height = Application.GetRealHeight(100), }; roomsListView.AddChidren(roomRow); - var btnBg = new Button() + var btnBg = new ImageView() { - Y = Application.GetRealHeight(0 - (192 - 92) / 2), - Height = Application.GetRealHeight(192), - UnSelectedImagePath = room.backgroundImage, + Y = Application.GetRealHeight(10), + Height = Application.GetRealHeight(90), + Width = Application.GetRealWidth(343), + ImagePath = room.backgroundImage, Radius = (uint)Application.GetRealWidth(12), + Gravity = Gravity.CenterHorizontal, }; roomRow.AddChidren(btnBg); - //ImageView imageView = new ImageView() - //{ - // Height = Application.GetRealHeight(92), - // Radius = (uint)Application.GetRealWidth(12), - //}; - //roomRow.AddChidren(imageView); - - var btnShadow = new Button() - { - BackgroundColor = 0x19333333, - }; - roomRow.AddChidren(btnShadow); - var btnRoomName = new Button() { - X = Application.GetRealWidth(12), - Y = Application.GetRealHeight(10), + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(21), Width = Application.GetRealWidth(266), - Height = Application.GetRealHeight(26), - TextAlignment = TextAlignment.CenterLeft, + Height = Application.GetRealHeight(22), + TextAlignment = TextAlignment.TopLeft, TextColor = CSS_Color.MainBackgroundColor, TextSize = CSS_FontSize.SubheadingFontSize, Text = room.floorName + room.name, }; roomRow.AddChidren(btnRoomName); - btnShadow.MouseUpEventHandler += (sender, e) => - { + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { LoadEvent_SkipEditRoomPage(room, btnRoomName, btnBg); }; + btnBg.MouseUpEventHandler = eventHandler; + roomRow.MouseUpEventHandler = eventHandler; + btnRoomName.MouseUpEventHandler = eventHandler; } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPageBLL.cs index d1a08c8..11bd8e0 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomsManagementPageBLL.cs @@ -43,7 +43,7 @@ /// <summary> /// 璺宠浆鍒扮紪杈戞埧闂寸殑鐣岄潰 /// </summary> - void LoadEvent_SkipEditRoomPage(Room r,Button btnRoomName,Button btnBg) + void LoadEvent_SkipEditRoomPage(Room r, Button btnRoomName, ImageView btnBg) { editBackAction = () => { @@ -64,7 +64,7 @@ else { btnRoomName.Text = r.floorName + r.name; - btnBg.UnSelectedImagePath = r.backgroundImage; + btnBg.ImagePath = r.backgroundImage; } }; var skipPage = new RoomEditPage(r, StringId.EditRoomInfo,editBackAction); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs new file mode 100644 index 0000000..0b29974 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs @@ -0,0 +1,140 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.CSS; + +namespace HDL_ON.UI +{ + /// <summary> + /// 绠$悊鍛樻潈闄愯縼绉荤‘璁ゆ彁閱掔晫闈� + /// </summary> + public class AdminMigrationConfirmPage : FrameLayout + { + /// <summary> + /// + /// </summary> + FrameLayout bodyView; + + public AdminMigrationConfirmPage() + { + bodyView = this; + } + + /// <summary> + /// + /// </summary> + public void LoadPage() + { + BackgroundColor = CSS_Color.MainBackgroundColor; + + new TopViewDiv(bodyView, Language.StringByID(StringId.AdministratorPermissionMigration)).LoadTopView(); + + #region 澶村儚 + FrameLayout headView = new FrameLayout() + { + Y = Application.GetRealHeight(72), + Height = Application.GetRealHeight(132), + }; + bodyView.AddChidren(headView); + + + ImageView myHeadImage = new ImageView() + { + X = Application.GetRealWidth(48), + Y = Application.GetRealHeight(96), + Width = Application.GetRealWidth(84), + Height = Application.GetRealWidth(84), + Radius = (uint)Application.GetRealWidth(42), + ImagePath = UserInfo.Current.headImagePagePath, + Gravity = Gravity.CenterVertical, + }; + headView.AddChidren(myHeadImage); + + ImageView transferImage = new ImageView() + { + X = Application.GetRealWidth(144), + Y = Application.GetRealHeight(96), + Width = Application.GetRealWidth(84), + Height = Application.GetRealWidth(32), + ImagePath = "PersonalCenter/Transfer.png", + Gravity = Gravity.Center, + }; + headView.AddChidren(transferImage); + + ImageView otherHeadImage = new ImageView() + { + X = Application.GetRealWidth(231), + Y = Application.GetRealHeight(96), + Width = Application.GetRealWidth(101), + Height = Application.GetRealWidth(101), + ImagePath = "PersonalCenter/Head.png", + Gravity = Gravity.CenterVertical, + }; + headView.AddChidren(otherHeadImage); + + #endregion + + var btnTip = new Button() + { + Y = headView.Bottom, + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(22), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + Text = "鎮ㄥ皢杞Щ鎮ㄧ殑绠$悊鍛樻潈闄愮粰鍏朵粬HDL璐﹀彿", + }; + bodyView.AddChidren(btnTip); + + + //璇锋敞鎰� + var btnPleaseNote = new Button() + { + Y = btnTip.Bottom + Application.GetRealHeight(38), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(17), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = "璇锋敞鎰忥細", + }; + bodyView.AddChidren(btnPleaseNote); + + //璇锋敞鎰忕殑鍐呭 + var btnPleaseNoteStr = new Button() + { + Y = btnPleaseNote.Bottom + Application.GetRealHeight(8), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(170), + TextAlignment = TextAlignment.TopLeft, + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + IsMoreLines = true, + Text = "1.璇ヤ綇瀹呮偍鐨勭鐞嗗憳鏁版嵁锛堜簯绔暟鎹級灏嗗叏閮ㄨ浆绉荤粰鏂扮殑绠$悊鍛� \n\n2.鏂扮殑绠$悊鍛樺彲浠ラ�夋嫨涓嶄繚鐣欏師鏈変綇瀹呮垚鍛樼殑鏁版嵁,鍏朵粬鎴愬憳灏嗕細涓嶈兘浣跨敤 \n\n3.鍦ㄨ浆绉诲悗锛屾偍鑻ラ渶瑕佹垚涓哄搴垚鍛橈紝鐢辨柊鐨勭鐞嗗憳璁剧疆 \n\n4.鎺ユ敹鏂硅处鍙蜂负鏈夋晥鐨凥DL璐﹀彿 \n\n5.鎺ユ敹鏂硅处鍙蜂笌杞Щ鏂硅处鍙蜂笉鍙负鍚屼竴涓处鍙� (缁戝畾鐨勫叾浠栫櫥褰�)", + }; + bodyView.AddChidren(btnPleaseNoteStr); + + // + var btnConfirm = new ConfirmButton() + { + Y = Application.GetRealHeight(583), + Text = "纭杞Щ", + }; + bodyView.AddChidren(btnConfirm); + + btnConfirm.MouseUpEventHandler = (sender, e) => { + //Utlis.ShowTip("鏆備笉鏀寔"); + var skipPage = new AdminMigrationInputPage(); + MainPage.BasePageView.AddChidren(skipPage); + skipPage.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + + } + + } + +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationInputPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationInputPage.cs new file mode 100644 index 0000000..8f4c011 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationInputPage.cs @@ -0,0 +1,150 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.CSS; + +namespace HDL_ON.UI +{ + /// <summary> + /// 绠$悊鍛樿浆绉昏緭鍏ヨ处鍙风晫闈� + /// </summary> + public class AdminMigrationInputPage : FrameLayout + { + /// <summary> + /// + /// </summary> + FrameLayout bodyView; + + public AdminMigrationInputPage() + { + bodyView = this; + } + + /// <summary> + /// + /// </summary> + public void LoadPage() + { + BackgroundColor = CSS_Color.BackgroundColor; + + new TopViewDiv(bodyView, Language.StringByID(StringId.AdministratorPermissionMigration)).LoadTopView(); + + #region 璐﹀彿濉啓 + var accountView = new FrameLayout() + { + Y = Application.GetRealHeight(72), + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor + }; + bodyView.AddChidren(accountView); + + var btnAccountIcon = new Button() + { + X = Application.GetRealWidth(16), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(24), + Height = Application.GetMinRealAverage(24), + UnSelectedImagePath = "LoginIcon/AccountIcon.png", + }; + accountView.AddChidren(btnAccountIcon); + + var etAccount = new EditText() + { + X = Application.GetRealWidth(52), + Width = Application.GetRealWidth(307), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = "璇疯緭鍏ユ帴鏀舵柟璐﹀彿", + }; + accountView.AddChidren(etAccount); + + var btnLine = new Button() + { + BackgroundColor = CSS_Color.DividingLineColor, + Height = Application.GetRealHeight(1), + Y = accountView.Height - Application.GetRealHeight(1), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343), + }; + accountView.AddChidren(btnLine); + #endregion + + #region 璐﹀彿濉啓 + var accountConfirmView = new FrameLayout() + { + Y = accountView.Bottom, + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor + }; + bodyView.AddChidren(accountConfirmView); + + var btnAccountConfirmIcon = new Button() + { + X = Application.GetRealWidth(16), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(24), + Height = Application.GetMinRealAverage(24), + UnSelectedImagePath = "LoginIcon/AccountIcon.png", + }; + accountConfirmView.AddChidren(btnAccountConfirmIcon); + + var etAccountConfirm = new EditText() + { + X = Application.GetRealWidth(52), + Width = Application.GetRealWidth(307), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = "璇峰啀娆¤緭鍏ユ帴鏀舵柟璐﹀彿", + }; + accountConfirmView.AddChidren(etAccountConfirm); + + //var btnLine2 = new Button() + //{ + // BackgroundColor = CSS_Color.DividingLineColor, + // Height = Application.GetRealHeight(1), + // Y = accountConfirmView.Height - Application.GetRealHeight(1), + //}; + //accountConfirmView.AddChidren(btnLine2); + #endregion + + var btnTip = new Button() + { + Y = accountConfirmView.Bottom + Application.GetRealHeight(12), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343), + TextAlignment = TextAlignment.TopLeft, + TextColor = CSS_Color.AuxiliaryColor2, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = "*璇风‘璁よ处鍙锋棤璇紝鍦ㄦ暟鎹浆绉昏繃绋嬩腑涓嶅彲鍙栨秷鎿嶄綔", + IsMoreLines = true + + }; + bodyView.AddChidren(btnTip); + + var btnConfirm = new ConfirmButton() + { + Y = Application.GetRealHeight(251), + Text = "杞Щ", + }; + bodyView.AddChidren(btnConfirm); + + Button btnEmailOption = new Button() + { + Y = btnConfirm.Bottom + Application.GetRealWidth(6), + Width = Application.GetRealWidth(220), + Height = Application.GetRealWidth(32), + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.MainColor, + Gravity = Gravity.CenterHorizontal, + TextAlignment = TextAlignment.Center, + Text = "鎵弿浜岀淮鐮佽縼绉�" + }; + bodyView.AddChidren(btnEmailOption); + } + + } + +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferConfirmPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferConfirmPage.cs index 5f8b0e6..9013b14 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferConfirmPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferConfirmPage.cs @@ -86,6 +86,36 @@ }; bodyView.AddChidren(btnTip); + + //璇锋敞鎰� + var btnPleaseNote = new Button() + { + Y = btnTip.Bottom + Application.GetRealHeight(38), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(17), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = "璇锋敞鎰忥細", + }; + bodyView.AddChidren(btnPleaseNote); + + //璇锋敞鎰忕殑鍐呭 + var btnPleaseNoteStr = new Button() + { + Y = btnPleaseNote.Bottom + Application.GetRealHeight(8), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(170), + TextAlignment = TextAlignment.TopLeft, + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + IsMoreLines = true, + Text = "1.璇ヤ綇瀹呮偍鐨勬暟鎹紙浜戠鏁版嵁锛夊皢鍏ㄩ儴杞Щ缁欐柊鐨勬埛涓� \n\n2.杩囨埛鍚庯紝鍘熸湁鐨勬垚鍛樺皢鑷姩瑙g粦璇ヤ綇瀹� \n\n3.鏂版埛涓昏处鍙蜂负鏈夋晥鐨凥DL璐﹀彿 \n\n4.鎺ユ敹鏂硅处鍙蜂笌杞Щ鏂硅处鍙蜂笉鍙负鍚屼竴涓处鍙� (缁戝畾鐨勫叾浠栫櫥褰�)", + }; + bodyView.AddChidren(btnPleaseNoteStr); + // var btnConfirm = new ConfirmButton() { @@ -94,6 +124,16 @@ }; bodyView.AddChidren(btnConfirm); + btnConfirm.MouseUpEventHandler = (sender, e) => { + //Utlis.ShowTip("鏆備笉鏀寔"); + + var skipPage = new TransferInputPage(); + MainPage.BasePageView.AddChidren(skipPage); + skipPage.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + + }; + } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferInputPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferInputPage.cs new file mode 100644 index 0000000..6ad0dcc --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferInputPage.cs @@ -0,0 +1,159 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.CSS; + +namespace HDL_ON.UI +{ + /// <summary> + /// 杩囨埛杈撳叆璐﹀彿鐣岄潰 + /// </summary> + public class TransferInputPage : FrameLayout + { + /// <summary> + /// + /// </summary> + FrameLayout bodyView; + + public TransferInputPage() + { + bodyView = this; + } + + /// <summary> + /// + /// </summary> + public void LoadPage() + { + BackgroundColor = CSS_Color.BackgroundColor; + + new TopViewDiv(bodyView, Language.StringByID(StringId.Transfer)).LoadTopView(); + + #region 璐﹀彿濉啓 + var accountView = new FrameLayout() + { + Y = Application.GetRealHeight(72), + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor + }; + bodyView.AddChidren(accountView); + + var btnAccountIcon = new Button() + { + X = Application.GetRealWidth(16), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(24), + Height = Application.GetMinRealAverage(24), + UnSelectedImagePath = "LoginIcon/AccountIcon.png", + }; + accountView.AddChidren(btnAccountIcon); + + var etAccount = new EditText() + { + X = Application.GetRealWidth(52), + Width = Application.GetRealWidth(307), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = "璇疯緭鍏ユ帴鏀舵柟璐﹀彿", + }; + accountView.AddChidren(etAccount); + + var btnLine = new Button() + { + BackgroundColor = CSS_Color.DividingLineColor, + Height = Application.GetRealHeight(1), + Y = accountView.Height - Application.GetRealHeight(1), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343), + }; + accountView.AddChidren(btnLine); + #endregion + + #region 璐﹀彿濉啓 + var accountConfirmView = new FrameLayout() + { + Y = accountView.Bottom, + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor + }; + bodyView.AddChidren(accountConfirmView); + + var btnAccountConfirmIcon = new Button() + { + X = Application.GetRealWidth(16), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(24), + Height = Application.GetMinRealAverage(24), + UnSelectedImagePath = "LoginIcon/AccountIcon.png", + }; + accountConfirmView.AddChidren(btnAccountConfirmIcon); + + var etAccountConfirm = new EditText() + { + X = Application.GetRealWidth(52), + Width = Application.GetRealWidth(307), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = "璇峰啀娆¤緭鍏ユ帴鏀舵柟璐﹀彿", + }; + accountConfirmView.AddChidren(etAccountConfirm); + + //var btnLine2 = new Button() + //{ + // BackgroundColor = CSS_Color.DividingLineColor, + // Height = Application.GetRealHeight(1), + // Y = accountConfirmView.Height - Application.GetRealHeight(1), + //}; + //accountConfirmView.AddChidren(btnLine2); + #endregion + + var btnTip = new Button() + { + Y = accountConfirmView.Bottom + Application.GetRealHeight(12), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343), + TextAlignment = TextAlignment.TopLeft, + TextColor = CSS_Color.AuxiliaryColor2, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = "*璇风‘璁よ处鍙锋棤璇紝鍦ㄦ暟鎹浆绉昏繃绋嬩腑涓嶅彲鍙栨秷鎿嶄綔", + IsMoreLines = true + + }; + bodyView.AddChidren(btnTip); + + var btnConfirm = new ConfirmButton() + { + Y = Application.GetRealHeight(251), + Text = "杩囨埛", + }; + bodyView.AddChidren(btnConfirm); + + btnConfirm.MouseUpEventHandler = (sender, e) => { + var skipPage = new TransferUserConfirmPage(); + MainPage.BasePageView.AddChidren(skipPage); + skipPage.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + Button btnEmailOption = new Button() + { + Y = btnConfirm.Bottom + Application.GetRealWidth(6), + Width = Application.GetRealWidth(220), + Height = Application.GetRealWidth(32), + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.MainColor, + Gravity = Gravity.CenterHorizontal, + TextAlignment = TextAlignment.Center, + Text = "鎵弿浜岀淮鐮佽繃鎴�" + }; + bodyView.AddChidren(btnEmailOption); + + + } + + } + +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs new file mode 100644 index 0000000..e29f3fd --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs @@ -0,0 +1,68 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.CSS; + +namespace HDL_ON.UI +{ + /// <summary> + /// 杩囨埛璐﹀彿纭鐣岄潰 + /// 涓汉璧勬枡 + /// </summary> + public class TransferUserConfirmPage : FrameLayout + { + /// <summary> + /// + /// </summary> + FrameLayout bodyView; + + public TransferUserConfirmPage() + { + bodyView = this; + } + + /// <summary> + /// + /// </summary> + public void LoadPage() + { + BackgroundColor = CSS_Color.BackgroundColor; + + new TopViewDiv(bodyView, "涓汉璧勬枡").LoadTopView(); + + var headView = new FrameLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(204), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + bodyView.AddChidren(headView); + + ImageView myHeadImage = new ImageView() + { + Y = Application.GetRealHeight(32), + Width = Application.GetRealWidth(84), + Height = Application.GetRealWidth(84), + Radius = (uint)Application.GetRealWidth(42), + ImagePath = UserInfo.Current.headImagePagePath, + Gravity = Gravity.CenterHorizontal, + }; + headView.AddChidren(myHeadImage); + + var btnConfirm = new Button() + { + Y = headView.Bottom + Application.GetRealHeight(8), + Height = Application.GetRealHeight(50), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.SubheadingFontSize, + BackgroundColor = CSS_Color.MainBackgroundColor, + Text = "纭杩囨埛" + + }; + bodyView.AddChidren(btnConfirm); + + } + + } + +} diff --git a/HDL_ON/UI/UI2/UserPage.cs b/HDL_ON/UI/UI2/UserPage.cs index 61db3e3..fca117f 100644 --- a/HDL_ON/UI/UI2/UserPage.cs +++ b/HDL_ON/UI/UI2/UserPage.cs @@ -2,6 +2,7 @@ using HDL_ON.Entity; using Shared; using HDL_ON.UI.CSS; +using HDL_ON.DAL.Server; namespace HDL_ON.UI { @@ -130,6 +131,9 @@ //鍒锋柊鍔熻兘鐘舵�� DB_ResidenceData.residenceData.RefreshResidenceFunctionStatus(); + //娉ㄥ唽鎺ㄩ�両D + RegisteredPush(); + } catch (Exception ex) { @@ -652,5 +656,13 @@ ContextView.AddChidren(personalCenterPage); personalCenterPage.LoadView(); } + + /// <summary> + /// 娉ㄥ唽鎺ㄩ�� + /// </summary> + void RegisteredPush() + { + new HttpServerRequest().RegisteredPush(); + } } } -- Gitblit v1.8.0