From 981ccd4afab6271422d7f169b30a2efa55eafde1 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 26 二月 2021 16:18:16 +0800 Subject: [PATCH] Merge branch 'WJC' into temp-wxr --- HDL-ON_Android/Assets/Phone/PirIcon/air.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/delbuton.png | 0 HDL-ON_Android/Assets/Phone/.DS_Store | 0 HDL-ON_Android/Assets/Language.ini | 61 + HDL-ON_iOS/HDL-ON_iOS.csproj | 18 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 16 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TopView.cs | 87 ++ HDL-ON_Android/Assets/Phone/PirIcon/search.png | 0 HDL_ON/HDL_ON.projitems | 19 HDL-ON_Android/HDL-ON_Android.csproj | 23 HDL-ON_Android/Assets/Phone/PirIcon/projector.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/adddevice.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/failed.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/search.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/icon1.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/SaveView.cs | 52 + HDL_ON/UI/.DS_Store | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/ReplicationView.cs | 69 + HDL-ON_iOS/Resources/Phone/PirIcon/priequipment.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs | 7 HDL-ON_iOS/Resources/Phone/PirIcon/del.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/projector.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/next.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/icon2.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/addlbuton.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/succeed.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/dropdown.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/delbuton.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs | 339 +++++++ HDL-ON_Android/Assets/Phone/PirIcon/offline.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/del.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/next.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs | 90 - HDL-ON_Android/Assets/Phone/PirIcon/dropdown.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs | 244 +++++ HDL_ON/UI/UI2/.DS_Store | 0 HDL-ON_Android/Assets/Phone/PirIcon/custom.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/addlbuton.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/online.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/tv.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/BrandListView.cs | 43 HDL-ON_Android/Assets/Phone/PirIcon/online.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/custom.png | 0 HDL-ON_Android/libs/.DS_Store | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs | 101 ++ HDL-ON_Android/Assets/Phone/PirIcon/tv.png | 0 HDL-ON_iOS/Resources/Language.ini | 18 HDL_ON/UI/CSS/CSS.cs | 2 HDL-ON_iOS/Resources/Phone/PirIcon/Infraredtreasure.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/Infraredtreasure.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/offline.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/fan.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/STB.png | 0 HDL-ON_Android/Assets/Phone/PirIcon/dvd.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs | 179 ++++ HDL-ON_iOS/Resources/Phone/PirIcon/stb.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs | 48 + HDL-ON_iOS/Resources/Phone/PirIcon/air.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs | 102 ++ HDL-ON_iOS/Resources/Phone/PirIcon/dvd.png | 0 HDL-ON_iOS/Resources/Phone/PirIcon/fan.png | 0 HDL_ON/DAL/Server/NewAPI.cs | 26 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs | 179 ++++ HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs | 279 ++++++ HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs | 121 ++ HDL-ON_Android/Assets/Phone/PirIcon/priequipment.png | 0 HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store | 0 HDL-ON_Android/Assets/Phone/PirIcon/adddevice.png | 0 HDL_ON/.DS_Store | 0 HDL_ON/Common/R.cs | 63 + HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PatchView.cs | 96 ++ HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs | 175 ++++ HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/FailView.cs | 65 + 73 files changed, 2,423 insertions(+), 99 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 8849016..dae92a1 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -1164,6 +1164,67 @@ 5047=浣犳墜鏈烘殏鏈畨瑁�"QQ闊充箰"{\r\n}璇峰墠寰�鎵嬫満鍟嗗満瀹夎 + +6000=姝e父 +6001=璁惧鐘舵�� +6002=涓� +6003=褰撳墠绾㈠閬ユ帶璁惧 +6004=宸叉坊鍔犻仴鎺у櫒 +6005=绌鸿皟 +6006=鐢佃 +6007=椋庢墖 +6008=鏈洪《鐩� +6009=DVD/EVD/VCD +6010=鎶曞奖浠� +6011=鑷畾涔� +6012=绾㈠閬ユ帶 +6013=璁惧绠$悊 +6014=娣诲姞閬ユ帶鍣� +6015=鍦ㄧ嚎 +6016=绂荤嚎 +6017=鐗堟湰鍙� +6018=璇疯緭鍏ラ仴鎺у櫒鍚嶇О +6019=鎻愮ず锛氶仴鎺у櫒鍒涘缓鍚庡彲鍦ㄥ姛鑳�-鐢靛櫒鍒嗙被{\r\n}鏌ユ壘浣跨敤 +6020=鎺ㄨ崘鎸夐敭 +6021=璇疯緭鍏ユ寜閿悕绉� +6022=涓嬩竴姝� +6023=鐢垫簮 +6024=闊抽噺+ +6025=闊抽噺- +6026=棰戦亾+ +6027=棰戦亾- +6028=涓� +6029=涓� +6030=宸� +6031=鍙� +6032=闈欓煶 +6034=纭 +6035=鎾斁 +6037=閫�鍑� +6038=鑿滃崟 +6039=鏆傚仠 +6040=杩斿洖 +6041=鍋滄 +6042=涓婚〉 +6043=蹇繘 +6044=蹇�� +6045=瀹氭椂 +6046=澶嶅埗閬ユ帶鍔熻兘 +6047=瀵瑰噯閬ユ帶鍣ㄤ腑蹇冩寜涓嬬浉鍚屾寜閿� +6048=鏅鸿兘閬ユ帶鍣� +6049=娣诲姞鎸夐敭 +6050=*闀挎寜鍙繘琛岃嚜瀹氫箟鎺掑簭 +6051=瀹屾垚 +6052=娣诲姞鎴愬姛 +6053=鍙埌鍒嗙被-鍔熻兘-鐢靛櫒鎿嶄綔浣跨敤 +6054=鎵�灞炲垎绫� +6055=閬ユ帶鍣ㄥ悕绉� +6056=鎵�灞炲尯鍩� +6057=缁х画娣诲姞 +6058=鐢靛櫒 +6059=娣诲姞澶辫触 +6060=閲嶈瘯 + 7000=鏂板缓鑷姩鍖� 7001=缂栬緫鑷姩鍖� 7002=濡傛灉 diff --git a/HDL-ON_Android/Assets/Phone/.DS_Store b/HDL-ON_Android/Assets/Phone/.DS_Store new file mode 100644 index 0000000..48a1486 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/.DS_Store Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/Infraredtreasure.png b/HDL-ON_Android/Assets/Phone/PirIcon/Infraredtreasure.png new file mode 100755 index 0000000..8304df6 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/Infraredtreasure.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/STB.png b/HDL-ON_Android/Assets/Phone/PirIcon/STB.png new file mode 100755 index 0000000..3cf8772 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/STB.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/adddevice.png b/HDL-ON_Android/Assets/Phone/PirIcon/adddevice.png new file mode 100755 index 0000000..445d743 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/adddevice.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/addlbuton.png b/HDL-ON_Android/Assets/Phone/PirIcon/addlbuton.png new file mode 100755 index 0000000..568abba --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/addlbuton.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/air.png b/HDL-ON_Android/Assets/Phone/PirIcon/air.png new file mode 100755 index 0000000..87bc5af --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/air.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/custom.png b/HDL-ON_Android/Assets/Phone/PirIcon/custom.png new file mode 100755 index 0000000..80001e0 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/custom.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/del.png b/HDL-ON_Android/Assets/Phone/PirIcon/del.png new file mode 100755 index 0000000..6a93cad --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/del.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/delbuton.png b/HDL-ON_Android/Assets/Phone/PirIcon/delbuton.png new file mode 100755 index 0000000..2421cd5 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/delbuton.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/dropdown.png b/HDL-ON_Android/Assets/Phone/PirIcon/dropdown.png new file mode 100755 index 0000000..ad0f3b1 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/dropdown.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/dvd.png b/HDL-ON_Android/Assets/Phone/PirIcon/dvd.png new file mode 100755 index 0000000..fea8fa9 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/dvd.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/failed.png b/HDL-ON_Android/Assets/Phone/PirIcon/failed.png new file mode 100755 index 0000000..76dcfbe --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/failed.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/fan.png b/HDL-ON_Android/Assets/Phone/PirIcon/fan.png new file mode 100755 index 0000000..a1d4ed6 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/fan.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/icon1.png b/HDL-ON_Android/Assets/Phone/PirIcon/icon1.png new file mode 100755 index 0000000..2430b09 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/icon1.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/icon2.png b/HDL-ON_Android/Assets/Phone/PirIcon/icon2.png new file mode 100755 index 0000000..a68738c --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/icon2.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/next.png b/HDL-ON_Android/Assets/Phone/PirIcon/next.png new file mode 100755 index 0000000..df1fd5e --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/next.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/offline.png b/HDL-ON_Android/Assets/Phone/PirIcon/offline.png new file mode 100755 index 0000000..e93d6e2 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/offline.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/online.png b/HDL-ON_Android/Assets/Phone/PirIcon/online.png new file mode 100755 index 0000000..1df20e6 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/online.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/priequipment.png b/HDL-ON_Android/Assets/Phone/PirIcon/priequipment.png new file mode 100755 index 0000000..b4dd756 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/priequipment.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/projector.png b/HDL-ON_Android/Assets/Phone/PirIcon/projector.png new file mode 100755 index 0000000..74ae608 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/projector.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/search.png b/HDL-ON_Android/Assets/Phone/PirIcon/search.png new file mode 100755 index 0000000..505b270 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/search.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/succeed.png b/HDL-ON_Android/Assets/Phone/PirIcon/succeed.png new file mode 100755 index 0000000..61c36c2 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/succeed.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/PirIcon/tv.png b/HDL-ON_Android/Assets/Phone/PirIcon/tv.png new file mode 100755 index 0000000..c4228d3 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/PirIcon/tv.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index b546ec3..b0f5b71 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -206,6 +206,7 @@ <Folder Include="Other\JPush\" /> <Folder Include="Assets\Phone\FunctionIcon\Electrical\WaterValve\" /> <Folder Include="Assets\Phone\FunctionIcon\Electrical\ClothesHanger\" /> + <Folder Include="Assets\Phone\PirIcon\" /> </ItemGroup> <ItemGroup> <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" /> @@ -784,6 +785,28 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\ClothesHanger\ClothesHangerUpIconOn.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\ClothesHanger\ClothesHangerWindDryIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\ClothesHanger\ClothesHangerWindDryIconOn.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\air.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\custom.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\dvd.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\fan.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\Infraredtreasure.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\projector.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\search.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\tv.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\stb.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\offline.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\online.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\priequipment.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\addlbuton.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\del.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\delbuton.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\dropdown.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\adddevice.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\next.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\failed.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\icon1.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\icon2.png" /> + <AndroidAsset Include="Assets\Phone\PirIcon\succeed.png" /> </ItemGroup> <ItemGroup> <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> diff --git a/HDL-ON_Android/libs/.DS_Store b/HDL-ON_Android/libs/.DS_Store new file mode 100644 index 0000000..ae45fc3 --- /dev/null +++ b/HDL-ON_Android/libs/.DS_Store Binary files differ diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index ef3de29..963e60c 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -1039,6 +1039,24 @@ <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\ClothesHanger\ClothesHangerUpIcon1On.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\ClothesHanger\ClothesHangerUpIcon2.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\ClothesHanger\ClothesHangerUpIcon2On.png" /> + <BundleResource Include="Resources\Phone\PirIcon\fan.png" /> + <BundleResource Include="Resources\Phone\PirIcon\dvd.png" /> + <BundleResource Include="Resources\Phone\PirIcon\stb.png" /> + <BundleResource Include="Resources\Phone\PirIcon\tv.png" /> + <BundleResource Include="Resources\Phone\PirIcon\projector.png" /> + <BundleResource Include="Resources\Phone\PirIcon\air.png" /> + <BundleResource Include="Resources\Phone\PirIcon\custom.png" /> + <BundleResource Include="Resources\Phone\PirIcon\priequipment.png" /> + <BundleResource Include="Resources\Phone\PirIcon\offline.png" /> + <BundleResource Include="Resources\Phone\PirIcon\search.png" /> + <BundleResource Include="Resources\Phone\PirIcon\del.png" /> + <BundleResource Include="Resources\Phone\PirIcon\dropdown.png" /> + <BundleResource Include="Resources\Phone\PirIcon\addlbuton.png" /> + <BundleResource Include="Resources\Phone\PirIcon\delbuton.png" /> + <BundleResource Include="Resources\Phone\PirIcon\Infraredtreasure.png" /> + <BundleResource Include="Resources\Phone\PirIcon\online.png" /> + <BundleResource Include="Resources\Phone\PirIcon\adddevice.png" /> + <BundleResource Include="Resources\Phone\PirIcon\next.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index c21eb31..b39aa8e 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -1180,6 +1180,24 @@ 5047=浣犳墜鏈烘殏鏈畨瑁�"QQ闊充箰"{\r\n}璇峰墠寰�鎵嬫満鍟嗗満瀹夎 +6000=姝e父 +6001=璁惧鐘舵�� +6002=涓� +6003=褰撳墠绾㈠閬ユ帶璁惧 +6004=宸叉坊鍔犻仴鎺у櫒 +6005=绌鸿皟 +6006=鐢佃 +6007=椋庢墖 +6008=鏈洪《鐩� +6009=DVD/EVD/VCD +6010=鎶曞奖浠� +6011=鑷畾涔� +6012=绾㈠閬ユ帶 +6013=璁惧绠$悊 +6014=娣诲姞閬ユ帶鍣� + + + 7000=鏂板缓鑷姩鍖� 7001=缂栬緫鑷姩鍖� 7002=濡傛灉 diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/Infraredtreasure.png b/HDL-ON_iOS/Resources/Phone/PirIcon/Infraredtreasure.png new file mode 100755 index 0000000..8304df6 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/Infraredtreasure.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/adddevice.png b/HDL-ON_iOS/Resources/Phone/PirIcon/adddevice.png new file mode 100755 index 0000000..445d743 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/adddevice.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/addlbuton.png b/HDL-ON_iOS/Resources/Phone/PirIcon/addlbuton.png new file mode 100755 index 0000000..568abba --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/addlbuton.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/air.png b/HDL-ON_iOS/Resources/Phone/PirIcon/air.png new file mode 100755 index 0000000..87bc5af --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/air.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/custom.png b/HDL-ON_iOS/Resources/Phone/PirIcon/custom.png new file mode 100755 index 0000000..80001e0 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/custom.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/del.png b/HDL-ON_iOS/Resources/Phone/PirIcon/del.png new file mode 100755 index 0000000..6a93cad --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/del.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/delbuton.png b/HDL-ON_iOS/Resources/Phone/PirIcon/delbuton.png new file mode 100755 index 0000000..2421cd5 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/delbuton.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/dropdown.png b/HDL-ON_iOS/Resources/Phone/PirIcon/dropdown.png new file mode 100755 index 0000000..ad0f3b1 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/dropdown.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/dvd.png b/HDL-ON_iOS/Resources/Phone/PirIcon/dvd.png new file mode 100755 index 0000000..fea8fa9 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/dvd.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/fan.png b/HDL-ON_iOS/Resources/Phone/PirIcon/fan.png new file mode 100755 index 0000000..a1d4ed6 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/fan.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/next.png b/HDL-ON_iOS/Resources/Phone/PirIcon/next.png new file mode 100755 index 0000000..df1fd5e --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/next.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/offline.png b/HDL-ON_iOS/Resources/Phone/PirIcon/offline.png new file mode 100755 index 0000000..e93d6e2 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/offline.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/online.png b/HDL-ON_iOS/Resources/Phone/PirIcon/online.png new file mode 100755 index 0000000..1df20e6 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/online.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/priequipment.png b/HDL-ON_iOS/Resources/Phone/PirIcon/priequipment.png new file mode 100755 index 0000000..b4dd756 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/priequipment.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/projector.png b/HDL-ON_iOS/Resources/Phone/PirIcon/projector.png new file mode 100755 index 0000000..74ae608 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/projector.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/search.png b/HDL-ON_iOS/Resources/Phone/PirIcon/search.png new file mode 100755 index 0000000..505b270 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/search.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/stb.png b/HDL-ON_iOS/Resources/Phone/PirIcon/stb.png new file mode 100755 index 0000000..3cf8772 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/stb.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/PirIcon/tv.png b/HDL-ON_iOS/Resources/Phone/PirIcon/tv.png new file mode 100755 index 0000000..c4228d3 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/PirIcon/tv.png Binary files differ diff --git a/HDL_ON/.DS_Store b/HDL_ON/.DS_Store new file mode 100644 index 0000000..369c06c --- /dev/null +++ b/HDL_ON/.DS_Store Binary files differ diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index b9032a4..b756090 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -669,6 +669,69 @@ public const int qqMsuicTip = 5047; + public const int zhengchang = 6000; + public const int shebeizhuangtai = 6001; + public const int ge = 6002; + public const int dangqianhongwaishebei = 6003; + public const int yitianjiayaokongqi = 6004; + public const int kongtiao = 6005; + public const int dianshi = 6006; + public const int fengshan = 6007; + public const int jidinghe = 6008; + public const int dvd = 6009; + public const int touyingyi = 6010; + public const int zidingyi = 6011; + public const int hongwaiyaokong = 6012; + public const int shebeigaunli = 6013; + public const int tianjiayaokongqi = 6014; + public const int zaixianhwb= 6015; + public const int lixian = 6016; + public const int banbenhao = 6017; + public const int shuruyaokongqimingcheng = 6018; + public const int fengleichazhao = 6019; + public const int tuijiananjian = 6020; + public const int anjianmingcheng = 6021; + public const int xiayibu= 6022; + public const int dianyuan = 6023; + public const int yinliangjia = 6024; + public const int yinliangjian = 6025; + public const int pindaojia = 6026; + public const int pindaojian = 6027; + public const int shang = 6028; + public const int xia = 6029; + public const int zuo = 6030; + public const int you = 6031; + public const int jingyin = 6032; + public const int queren = 6034; + public const int bofang = 6035; + public const int tuichu = 6037; + public const int caidan = 6038; + public const int zanting = 6039; + public const int fanhui = 6040; + public const int tingzhi = 6041; + public const int zhuye = 6042; + public const int kuaijin = 6043; + public const int kuaitui = 6044; + public const int dingshi = 6045; + public const int fuzhiyaokonggongnneg = 6046; + public const int duizhunanxiaanniu = 6047; + public const int zhinengyaokongqi = 6048; + public const int tianjiaanniu = 6049; + public const int paixu = 6050; + public const int wancheng = 6051; + public const int tianjiachenggong = 6052; + public const int kedaofenlei = 6053; + public const int suoshufenlei = 6054; + public const int yaokongqimingcheng = 6055; + public const int suoshuquyu = 6056; + public const int jixutianjia = 6057; + public const int dianqi = 6058; + public const int tianjiashibai = 6059; + public const int chongshii = 6060; + + + + public const int newAutomation = 7000; public const int editAutomation = 7001; public const int ifCondition = 7002; diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs index 58ab186..15e369a 100644 --- a/HDL_ON/DAL/Server/NewAPI.cs +++ b/HDL_ON/DAL/Server/NewAPI.cs @@ -469,6 +469,32 @@ /// </summary> public const string Api_Post_GetBrandList = "/home-wisdom/app/product/brand/list"; + #region 鈻� -- 绾㈠瀹濇帴鍙__________________________ + /// <summary> + /// 绾㈠瀹濊澶囧畾浣� + /// </summary> + public const string API_POST_Ir_DeviceFind = "/home-wisdom/app/device/ir/deviceFind"; + /// <summary> + /// 绾㈠瀹濅笅鐨勯仴鎺у櫒鍒楄〃 + /// </summary> + public const string API_POST_Ir_List = ":/home-wisdom/app/device/ir/list"; + /// <summary> + /// 閬ユ帶鍣ㄧ孩澶栫爜瀛︿範 + /// </summary> + public const string API_POST_Ir_CodeStudy = "/home-wisdom/app/device/ir/codeStudy"; + /// <summary> + ///绾㈠瀹濈孩澶栫爜搴撹瘯鐮� + /// </summary> + public const string API_POST_Ir_CodeTest = "/home-wisdom/app/device/ir/codeTest"; + /// <summary> + /// 绾㈠瀹濋仴鎺у櫒娣诲姞 + /// </summary> + public const string API_POST_Ir_Add = "/home-wisdom/app/device/ir/add"; + /// <summary> + /// 閬ユ帶鍣ㄨ嚜瀛︽寜閿垹闄� + /// </summary> + public const string API_POST_Ir_CodeRemove = "/home-wisdom/app/device/ir/codeRemove"; + #endregion #endregion diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 953bc4c..ba8f246 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -339,6 +339,23 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\SensorSmokePage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\DeviceFunction.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Entity\Enumerative\ClothsHangerEnum.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\PirMain.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\TopView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\BrandList.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\BrandListView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\DeviceSet.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\TipView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\AddButton.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\SaveView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\Buttons.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\AddControl.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\Pir.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\PirSend.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\AddControlComplete.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\PatchView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\Method.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\FailView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\ReplicationView.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)UI\" /> @@ -376,5 +393,7 @@ <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\" /> <Folder Include="$(MSBuildThisFileDirectory)Entity\Integratedbrand\" /> <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\" /> + <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\" /> + <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\" /> </ItemGroup> </Project> diff --git a/HDL_ON/UI/.DS_Store b/HDL_ON/UI/.DS_Store new file mode 100644 index 0000000..bdfddd3 --- /dev/null +++ b/HDL_ON/UI/.DS_Store Binary files differ diff --git a/HDL_ON/UI/CSS/CSS.cs b/HDL_ON/UI/CSS/CSS.cs index 771502c..7ce6015 100644 --- a/HDL_ON/UI/CSS/CSS.cs +++ b/HDL_ON/UI/CSS/CSS.cs @@ -110,6 +110,8 @@ public const uint viewTrans60lucence = 0x60000000; public const uint viewTranslucence = 0x00000000; public const uint textTipColor = 0XFF798394; + public const uint text1Color = 0XFF4E586A; + #endregion #endregion diff --git a/HDL_ON/UI/UI2/.DS_Store b/HDL_ON/UI/UI2/.DS_Store new file mode 100644 index 0000000..249ba1d --- /dev/null +++ b/HDL_ON/UI/UI2/.DS_Store Binary files differ diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store b/HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store new file mode 100644 index 0000000..b2074c1 --- /dev/null +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store Binary files differ diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index df31fec..cd334f8 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -281,16 +281,22 @@ value = "off"; } break; - case StringId.youren: - case StringId.kaiqi: - { + case StringId.youren: { value = "true"; } break; - case StringId.wuren: + case StringId.wuren: { + value = "false"; + } + break; + case StringId.kaiqi: + { + value = "open"; + } + break; case StringId.bihe: { - value = "false"; + value = "close"; } break; case StringId.zaixian: { diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs index 7569dc4..99458f3 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs @@ -260,9 +260,12 @@ { EventHandler<MouseEventArgs> eventHandler = (sender, e) => { - var page = new ThirdPartyBrandListPage(); + // var page = new ThirdPartyBrandListPage(); + // MainPage.BasePageView.AddChidren(page); + // page.LoadPage(); + var page = new UI2.PersonalCenter.PirDevice.PirMain(); MainPage.BasePageView.AddChidren(page); - page.LoadPage(); + page.Show(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; btnResidenceAddFunctionIcon.MouseUpEventHandler = eventHandler; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs new file mode 100644 index 0000000..4f2aec5 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs @@ -0,0 +1,179 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice +{ + public class AddButton : FrameLayout + { + public AddButton() + { + Tag = "Pir"; + } + public void Show(Control control) + { + #region 鐣岄潰甯冨眬 + this.BackgroundColor = CSS.CSS_Color.viewMiddle; + PirDevice.View.TopView topView = new View.TopView(); + topView.topNameBtn.TextID = StringId.tianjiayaokongqi; + this.AddChidren(topView.FLayoutView()); + topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); }; + + FrameLayout editfLayout = new FrameLayout + { + Y = topView.frameLayout.Bottom, + BackgroundColor = CSS.CSS_Color.textWhiteColor, + Height = Application.GetRealHeight(152), + Width = Application.GetRealWidth(375), + }; + this.AddChidren(editfLayout); + //绾� + Button lineBtn = new Button + { + Y = Application.GetRealHeight(43), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(375 - 16 * 2), + Height = 1, + BackgroundColor = CSS.CSS_Color.viewLine, + }; + editfLayout.AddChidren(lineBtn); + //璇疯緭鍏ユ寜閿悕绉� + EditText editText = new EditText() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(375 - 16 * 2), + Height = Application.GetRealHeight(44), + PlaceholderText = Language.StringByID(StringId.anjianmingcheng), + PlaceholderTextColor = CSS.CSS_Color.textCancelColor, + TextColor = CSS.CSS_Color.textColor, + TextSize = TextSize.text14, + TextAlignment = TextAlignment.CenterLeft, + }; + editfLayout.AddChidren(editText); + //涓嬩竴姝� + Button saveBtn = new Button + { + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + Y = Application.GetRealHeight(92), + X = Application.GetRealWidth(78), + TextID = StringId.xiayibu, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.textWhiteColor, + TextAlignment = TextAlignment.Center, + BackgroundColor = CSS.CSS_Color.btnSaveBackgroundColor, + Radius = (uint)Application.GetRealHeight(22), + }; + editfLayout.AddChidren(saveBtn); + + FrameLayout fLayout = new FrameLayout + { + Y = editfLayout.Bottom + Application.GetRealHeight(8), + Height = Application.GetRealHeight(667 - 64 - 152 - 8), + Width = Application.GetRealWidth(375), + BackgroundColor = CSS.CSS_Color.textWhiteColor, + }; + this.AddChidren(fLayout); + //鎺ㄨ崘鎸夐敭 + Button titleBtn = new Button + { + Y = Application.GetRealHeight(12), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(20), + TextID = StringId.tuijiananjian, + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.text1Color, + TextAlignment = TextAlignment.CenterLeft, + }; + fLayout.AddChidren(titleBtn); + //鍔ㄦ�佸姞杞紹utton鎸夐挳鐖舵帶浠� + FrameLayout buttonFLayout = new FrameLayout + { + Y = Application.GetRealHeight(32), + Height = Application.GetRealHeight(667 - 64 - 152 - 8 - 12 - 20), + Width = Application.GetRealWidth(375), + }; + fLayout.AddChidren(buttonFLayout); + #endregion + View.Buttons buttons = new View.Buttons(); + var buttonNameList = buttons.GetList("榛樿鎸夐挳"); + buttons.AddButton(buttonFLayout, buttonNameList, (s) => + { + editText.Text = s; +#if __Android__ + editText.SetSelectionEnd(); +#endif + }); + ///涓嬩竴姝ョ殑鐐瑰嚮浜嬩欢 + saveBtn.MouseUpEventHandler += (sender, e) => + { + var texts = editText.Text.Trim(); + if (string.IsNullOrEmpty(editText.Text)) + { + //鍚嶇О涓嶈兘涓虹┖ + return; + } + var butName = Pir.BuottonList.Find((c) => c.value == texts); + if (butName != null) + { + //鍚嶇О宸茬粡瀛樺湪 + return; + } + //new寮曞鐣岄潰 + View.ReplicationView replication = new View.ReplicationView(); + replication.Show(); + + //娣诲姞鏁版嵁瀵硅薄 + ButtonObj buttonObj = new ButtonObj(); + buttonObj.Key = "key" + Pir.BuottonList.Count.ToString(); + buttonObj.value = texts; + + PirSend.CodeStudy(buttonObj, (responsePackNew) => + { + ///杩欓噷锛氱洃鍚琈TTP鎺ㄩ�佷笅鏉ヤ富棰橈紝鎵嶇煡閬撴槸鍚︽坊鍔犳垚鍔� + /// + //浼戠湢鏄负鏄剧ず寮曞鐣岄潰 + System.Threading.Thread.Sleep(5000); + //绉婚櫎娣诲姞鎸夐挳寮曞鐣岄潰 + replication.RemView(); + //if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") + //{ + var buttonName = Pir.BuottonList.Find((c) => c.value == buttonObj.value); + if (buttonName == null) + { + //娣诲姞鏁版嵁 + Pir.BuottonList.Add(buttonObj); + } + //绉婚櫎娣诲姞鎸夐挳鐣岄潰 + this.RemoveFromParent(); + + for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--) + { + var view = MainPage.BasePageView.GetChildren(i); + if (view.GetType() == typeof(AddControl)) + { + view.RemoveFromParent(); + } + + } + + //鍔犺浇鏁版嵁鐣岄潰 + AddControl addControl = new AddControl(); + MainPage.BasePageView.AddChidren(addControl); + addControl.Show(control); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + //} + //else + //{ + // PirSend.Error(responsePackNew); + //} + + }); + + + }; + + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs new file mode 100644 index 0000000..97af281 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs @@ -0,0 +1,279 @@ +锘縰sing System; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +using System.Collections.Generic; +using System.Text; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice +{ + public class AddControl : FrameLayout + { + public AddControl() + { + Tag = "Pir"; + } + public void Show(Control control) + { + + #region 鐣岄潰甯冨眬 + + this.BackgroundColor = CSS.CSS_Color.viewMiddle; + PirDevice.View.TopView topView = new View.TopView(); + topView.topNameBtn.TextID = StringId.zhinengyaokongqi; + topView.topIconBtn.Visible = true; + topView.topIconBtn.UnSelectedImagePath = "PirIcon/del.png"; + this.AddChidren(topView.FLayoutView()); + topView.clickBackBtn.MouseUpEventHandler += (sender, e) => + { + + this.RemoveFromParent(); + + }; + + #region 娣诲姞鎸夐挳 + FrameLayout addLayout = new FrameLayout + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(84), + Width = Application.GetRealWidth(TextSize.view375), + }; + this.AddChidren(addLayout); + + Button addBtn = new Button + { + Width = Application.GetRealWidth(344), + Height = Application.GetRealHeight(44), + Y = Application.GetRealHeight(24), + X = Application.GetRealWidth(16), + TextID = StringId.tianjiaanniu, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.btnSaveBackgroundColor, + BorderColor = CSS.CSS_Color.btnSaveBackgroundColor, + BorderWidth = 1, + Radius = (uint)Application.GetRealHeight(22), + }; + addLayout.AddChidren(addBtn); + #endregion + FrameLayout frameLayout = new FrameLayout + { + Y = Application.GetRealHeight(64 + 84), + Height = Application.GetRealHeight(667 - 64 - 84), + Width = Application.GetRealWidth(TextSize.view375), + }; + this.AddChidren(frameLayout); + + #region 淇濆瓨 + FrameLayout saveLayout = new FrameLayout + { + Y = Application.GetRealHeight(667 - 104), + Height = Application.GetRealHeight(104), + Width = Application.GetRealWidth(TextSize.view375), + BackgroundColor = CSS.CSS_Color.viewLine, + }; + this.AddChidren(saveLayout); + saveLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); + + Button paixuBtn = new Button + { + Width = Application.GetRealWidth(375 - 16 * 2), + Height = Application.GetRealHeight(20), + Y = Application.GetRealHeight(12), + X = Application.GetRealWidth(16), + TextID = StringId.paixu, + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textTipColor, + }; + saveLayout.AddChidren(paixuBtn); + + Button saveBtn = new Button + { + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + Y = paixuBtn.Bottom + Application.GetRealHeight(12), + X = Application.GetRealWidth(78), + TextID = StringId.save, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.textWhiteColor, + TextAlignment = TextAlignment.Center, + BackgroundColor = CSS.CSS_Color.btnSaveBackgroundColor, + Radius = (uint)Application.GetRealHeight(22), + + }; + saveLayout.AddChidren(saveBtn); + #endregion + + VerticalScrolViewLayout vv = new VerticalScrolViewLayout(); + frameLayout.AddChidren(vv); + RefreshView(vv, false); + #endregion + + #region 鐣岄潰鐐瑰嚮浜嬩欢 + //鍒犻櫎鐐瑰嚮浜嬩欢 + topView.clickSetBtn.MouseUpEventHandler += (sender, e) => + { + topView.clickSetBtn.IsSelected = !topView.clickSetBtn.IsSelected; + if (topView.clickSetBtn.IsSelected) + { + topView.topIconBtn.UnSelectedImagePath = ""; + topView.topIconBtn.Text = Language.StringByID(StringId.wancheng); + topView.topIconBtn.TextSize = TextSize.text14; + topView.topIconBtn.TextColor = CSS.CSS_Color.textColor; + RefreshView(vv, true); + } + else + { + topView.topIconBtn.UnSelectedImagePath = "PirIcon/del.png"; + topView.topIconBtn.Text = ""; + RefreshView(vv, false); + } + + + + }; + //娣诲姞鎸夐挳鐐瑰嚮浜嬩欢 + addBtn.MouseUpEventHandler += (sender, e) => + { + AddButton addButton = new AddButton(); + MainPage.BasePageView.AddChidren(addButton); + addButton.Show(control); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + //淇濆瓨鐐瑰嚮浜嬩欢 + saveBtn.MouseUpEventHandler += (sender, e) => + { + //绉婚櫎褰撳墠鐣岄潰 + this.RemoveFromParent(); + //鍙兘涔嬪墠宸茬粡瀛樺湪璇ョ晫闈� + for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--) + { + var view = MainPage.BasePageView.GetChildren(i); + if (view.GetType() == typeof(AddControlComplete)) + { + view.RemoveFromParent(); + } + } + //MainPage.BasePageView.RemoveViewByTag("Pir"); + AddControlComplete addControlComplete = new AddControlComplete(); + MainPage.BasePageView.AddChidren(addControlComplete); + addControlComplete.Show(control); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + #endregion + } + /// <summary> + /// 鍔犺浇鎸夐挳鎺т欢View鐨勬柟娉� + /// </summary> + /// <param name="vv">涓婁笅婊戝姩鎺т欢</param> + /// <param name="if_bool">琛ㄧず鏄惁鏄剧ず鍒犻櫎鍥炬爣</param> + void RefreshView(VerticalScrolViewLayout vv, bool if_bool) + { + vv.RemoveAll(); + //瀹氫箟涓�涓彉閲忚褰曡鏁� + int sum = 0; + if (Pir.BuottonList.Count % 3 == 0) + { + sum = Pir.BuottonList.Count / 3; + } + else + { + sum = Pir.BuottonList.Count / 3 + 1; + } + //璁$畻鍔犺浇鍑烘潵鐨勬暟鎹渶瑕佺殑楂樺害 + int h = 16 + sum * (16 + 44) + 104 + 76; + int line = 0; + //鎸夐挳鐨勭埗鎺т欢 + var FLayout = new FrameLayout + { + Height = Application.GetRealWidth(h), + }; + vv.AddChidren(FLayout); + for (int i = 1, j = 0; i <= Pir.BuottonList.Count; i++, j++) + { + var nameObj = Pir.BuottonList[i - 1]; + //鎸夐挳 + var buttonNameBtn = new Button + { + + Y = Application.GetRealHeight(16 + line * (16 + 44)), + X = Application.GetRealWidth(16 + (16 + 104) * j), + Width = Application.GetRealWidth(104), + Height = Application.GetRealHeight(44), + Text = nameObj.value, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.textColor, + TextAlignment = TextAlignment.Center, + Radius = (uint)Application.GetRealHeight(18), + BorderWidth = 1, + BorderColor = CSS.CSS_Color.textCancelColor, + }; + FLayout.AddChidren(buttonNameBtn); + //鍒犻櫎鍥炬爣 + var delIconBtn = new Button + { + UnSelectedImagePath = "PirIcon/delbuton.png", + Y = Application.GetRealHeight(12 + line * (16 + 44)), + X = Application.GetRealWidth((16 + 92) + (104 + 16) * j), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), + Tag = nameObj, + }; + if (if_bool) + { + FLayout.AddChidren(delIconBtn); + } + //鍒犻櫎鍥炬爣鐨勭偣鍑讳簨浠� + delIconBtn.MouseUpEventHandler += (sender, e) => + { + var obj = delIconBtn.Tag as ButtonObj; + //鍔犺浇log + Loading loading = new Loading(); + this.AddChidren(loading); + HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; + loading.Start(); + new System.Threading.Thread(() => + { + try + { + //鍙戦�佹寜閿垹闄わ紱 + responsePackNew = PirSend.CodeRemove(obj); + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + loading.Hide(); + if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") + { + ///杩欓噷锛氱洃鍚琈TTP鎺ㄩ�佷笅鏉ヤ富棰橈紝鎵嶇煡閬撴槸鍚︽坊鍔犳垚鍔� + var buttonObj = Pir.BuottonList.Find((c) => c.value == obj.value); + if (buttonObj != null) + { + Pir.BuottonList.Remove(buttonObj); + } + RefreshView(vv, true); + } + else { + Method method = new Method(); + method.ErrorShow(responsePackNew); + } + + }); + } + + }) + { IsBackground = true }.Start(); + + + }; + if (i % 3 == 0) + { + //婊′竴琛岄噸缃甹=0鍊�; + j = -1; + line += 1; + } + + } + + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs new file mode 100644 index 0000000..5a50897 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs @@ -0,0 +1,121 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice +{ + public class AddControlComplete:FrameLayout + { + public AddControlComplete() + { + Tag = "Pir"; + } + public void Show(Control control) { + #region 鐣岄潰甯冨眬 + this.BackgroundColor = CSS.CSS_Color.viewMiddle; + PirDevice.View.TopView topView = new View.TopView(); + topView.topNameBtn.TextID = StringId.tianjiayaokongqi; + this.AddChidren(topView.FLayoutView()); + topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); }; + + FrameLayout fLayout = new FrameLayout + { + Y =Application.GetRealHeight(64), + BackgroundColor = CSS.CSS_Color.textWhiteColor, + Height = Application.GetRealHeight(224), + Width = Application.GetRealWidth(375), + }; + this.AddChidren(fLayout); + // + Button iconBtn = new Button + { + Y = Application.GetRealHeight(28), + X = Application.GetRealWidth(137), + Width = Application.GetRealWidth(102), + Height = Application.GetRealWidth(102), + UnSelectedImagePath = "PirIcon/succeed.png", + }; + fLayout.AddChidren(iconBtn); + + //娣诲姞鎴愬姛 + Button text1Btn = new Button + { + Width = Application.GetRealWidth(375-32), + Height = Application.GetRealHeight(22), + Y = Application.GetRealHeight(158), + X = Application.GetRealWidth(16), + TextID = StringId.tianjiachenggong, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.btnSaveBackgroundColor, + TextAlignment = TextAlignment.Center, + }; + fLayout.AddChidren(text1Btn); + //鍙埌鍒嗙被-鍔熻兘-鐢靛櫒鎿嶄綔浣跨敤 + Button text2Btn = new Button + { + Width = Application.GetRealWidth(375 - 32), + Height = Application.GetRealHeight(22), + Y = Application.GetRealHeight(188), + X = Application.GetRealWidth(16), + TextID = StringId.kedaofenlei, + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textTipColor, + TextAlignment = TextAlignment.Center, + }; + fLayout.AddChidren(text2Btn); + //鎵�灞炲垎绫� + View.PatchView fenlei = new View.PatchView(); + fenlei.frameLayout.Y = fLayout.Bottom+ Application.GetRealHeight(8); + this.AddChidren(fenlei.FLayoutView(false)); + fenlei.btnText1.TextID = StringId.suoshufenlei; + fenlei.btnText2.TextID = StringId.dianqi; + //閬ユ帶鍣ㄥ悕绉� + View.PatchView namePatchView = new View.PatchView(); + namePatchView.frameLayout.Y = fenlei.frameLayout.Bottom; + this.AddChidren(namePatchView.FLayoutView()); + namePatchView.btnText1.TextID = StringId.yaokongqimingcheng; + namePatchView.btnText2.Text = control.name; + //鎵�灞炲尯鍩� + View.PatchView quyuPatchView = new View.PatchView(); + quyuPatchView.frameLayout.Y = namePatchView.frameLayout.Bottom; + this.AddChidren(quyuPatchView.FLayoutView()); + quyuPatchView.btnText1.TextID = StringId.suoshuquyu; + quyuPatchView.btnText2.TextID = StringId.dianqi; + + //缁х画娣诲姞 + Button addBtn = new Button + { + Y = quyuPatchView.frameLayout.Bottom + Application.GetRealHeight(125), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(375-32), + Height = Application.GetRealHeight(20), + TextID = StringId.jixutianjia, + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textConfirmColor, + TextAlignment = TextAlignment.Center, + }; + this.AddChidren(addBtn); + //瀹屾垚 + View.SaveView saveView = new View.SaveView(); + this.AddChidren(saveView.FLayoutView()); + saveView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); + #endregion + #region 鐣岄潰鐐瑰嚮浜嬩欢 + //閬ユ帶鍣ㄥ悕绉扮偣鍑讳簨浠� + namePatchView.btnClick.MouseUpEventHandler += (sender,e) => { }; + //鎵�灞炲尯鍩熺偣鍑讳簨浠� + quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) => { }; + //缁х画娣诲姞鐐瑰嚮浜嬩欢 + addBtn.MouseUpEventHandler += (sender, e) => { + Method method = new Method(); + method.AddControl(); + }; + //瀹屾垚鐐瑰嚮浜嬩欢 + saveView.btnClick.MouseUpEventHandler += (sender, e) => { + MainPage.BasePageView.RemoveViewByTag("AddControl"); + MainPage.BasePageView.RemoveViewByTag("Pir"); + }; + #endregion + } + } +} diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/EmptyClass.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs similarity index 83% copy from HDL_ON/UI/UI2/3-Intelligence/Automation/EmptyClass.cs copy to HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs index 2293a25..06e00f9 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/EmptyClass.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs @@ -4,20 +4,21 @@ using System.Collections.Generic; using System.Text; -namespace HDL_ON.UI.UI2.Intelligence.Automation +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice { - public class EmptyClass : FrameLayout + public class BrandList : FrameLayout { + public BrandList() + { + Tag = "PirView"; + } /// <summary> /// /// </summary> /// <param name="list">琛ㄧず璇ュ垪琛ㄥ厓绱燗-Z瀛楁瘝绛涢�夋樉绀哄嚭鏉�</param> /// <param name="list6">琛ㄧず璇ュ垪琛ㄥ厓绱犳樉绀哄湪list鍓嶉潰(璇ュ垪琛ㄥ厓绱犱笉鍋欰-Z瀛楁瘝绛涢��),娌℃湁鍙互涓簂ist6=null</param> - /// <param name="action">杩斿洖閫変腑鏂囨湰</param> - public void Show(List<string> list, List<string> list6, Action<string> action) + public void Show(List<string> list, List<string> list6) { - - //string text = "30"; //byte[] bytes = new byte[text.Length / 2]; //for (int i = 0, j = 0; i < bytes.Length; j += 2, i++) @@ -27,8 +28,6 @@ //} ////鎶奲yte鏁扮粍杞崲鎴愭枃瀛� //string str = System.Text.Encoding.UTF8.GetString(bytes); - - var frameLayout = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTop, @@ -59,7 +58,14 @@ UnSelectedImagePath = "LogicIcon/back.png", }; frameLayout.AddChidren(backBtn); - backBtn.MouseUpEventHandler += (sen, e) => + var clickBackBtn = new Button + { + Width = Application.GetRealWidth(12+16+20), + Height = Application.GetRealWidth(20+20), + Y = Application.GetRealHeight(32), + }; + frameLayout.AddChidren(clickBackBtn); + clickBackBtn.MouseUpEventHandler += (sen, e) => { this.RemoveFromParent(); }; @@ -86,16 +92,7 @@ }; this.AddChidren(fram); - - //var list11 = new List<string> { - // "鐖变綘", "鍝庡懄","鍩冨強","鍝堝紬鎹㈠3鍝堝紬", "鐖卞痉鍗庡v","淇哄嚑涓柉浜�", - // "鎷滀簡", "宸村+", "鐧惧か", "鐧惧悎鍦扮悊璇句綘鎵撶畻", "涓嶅害鑰侀浼忔灔", "姣斿埌涔濈偣", - // "杞︾珯","娴嬭瘯","姝ゅ湴", "鎵嶇湅瑙佸ソ寰楀揩","鍚冭蒋楗�","浠庣湅瑙佷簩鍗佸", - // "绛夊緟鏈轰細鍚�","鐨勫鎴�", "澶氬枬鐐�", "鐧昏鍝︾劧鍚�", "鎵撶數璇�", - // "鎭╄偆闇滅湅灏辩湅浜�", "楗挎os","鎭堕瓟鍩�","鍎跨鑱斿姩", "鎭╁叚棰楀瓙寮规媺鎷夎¥娲楁尽浜�","鍙戝ぇ瀛︾敓鍙戝彂", - // "鐪熷帀瀹砳鍙戝灏�", "鐭ラ亾浣犱粯娆句簡鍙�", "灏厭鍥炲", "鏀硅繘鐨勮瘽", "澶╁ぉ閫熷害鍥炵瓟", "澶ソ浜嗗紑杞�", - // "鍑忚偉鐨勭湅杩�","妗″嚭鍙e閭�","濡傛灉瑙夊緱", "寰堣垝鏈嶇殑","鍚冭蒋楗�","浠庣湅瑙佷簩鍗佸", - // "榫欏嵎椋庝簭澶у彂","鍘诲ソ鐪�", "澶氬枬鐐�", "濂芥氮璐瑰ソ", "鎵撶數璇�"}; + if (list == null) { list = new List<string>(); @@ -105,10 +102,7 @@ list6 = new List<string>(); } var list1 = GetDateList(list); - list1.Add("1"); list1.InsertRange(0, list6); - - var vv = new VerticalScrolViewLayout(); fram.AddChidren(vv); @@ -125,10 +119,9 @@ listStr.Add(s); } } - RefreshLayout(vv, listStr, action); + RefreshLayout(vv, listStr); }; - #region A-Z @@ -140,7 +133,7 @@ Width = Application.GetRealWidth(10 + 6), }; fram.AddChidren(a_zFra); - var list2 = GetList(); + var list2 = GetList(); for (int i = 0; i < list2.Count; i++) { @@ -183,11 +176,7 @@ } #endregion - RefreshLayout(vv, list1,action); - - - - + RefreshLayout(vv, list1); } /// <summary> @@ -195,7 +184,7 @@ /// </summary> /// <param name="vv">鐖舵帶浠�</param> /// <param name="list">鏄剧ず鍒楄〃</param> - private void RefreshLayout(VerticalScrolViewLayout vv, List<string> list,Action<string> action) + private void RefreshLayout(VerticalScrolViewLayout vv, List<string> list) { vv.RemoveAll(); foreach (var str in list) @@ -235,10 +224,10 @@ vv.AddChidren(rowLayout); clickBtn.MouseUpEventHandler += (sen, e) => { - //鎵惧埌绱㈠紩鍊� - var index = list.IndexOf(clickBtn.Tag.ToString()); + ////鎵惧埌绱㈠紩鍊� + //var index = list.IndexOf(clickBtn.Tag.ToString()); - this.RemoveFromParent(); + //this.RemoveFromParent(); }; } @@ -261,7 +250,6 @@ return false; } } - /// <summary> /// 鑾峰彇鏄剧ず鍒楄〃 /// </summary> @@ -300,7 +288,6 @@ } return list; } - /// <summary> /// 鑾峰彇A-Z瀛楁瘝鍒楄〃 /// </summary> @@ -321,7 +308,6 @@ } return list; } - /// <summary> /// 鑾峰彇姹夊瓧棣栧瓧姣� /// </summary> @@ -346,34 +332,7 @@ iCnChar = i1 * 256 + i2; } - //expresstion - //table of the constant list - // 'A'; //45217..45252 - // 'B'; //45253..45760 - // 'C'; //45761..46317 - // 'D'; //46318..46825 - // 'E'; //46826..47009 - // 'F'; //47010..47296 - // 'G'; //47297..47613 - - // 'H'; //47614..48118 - // 'J'; //48119..49061 - // 'K'; //49062..49323 - // 'L'; //49324..49895 - // 'M'; //49896..50370 - // 'N'; //50371..50613 - // 'O'; //50614..50621 - // 'P'; //50622..50905 - // 'Q'; //50906..51386 - - // 'R'; //51387..51445 - // 'S'; //51446..52217 - // 'T'; //52218..52697 - //娌℃湁U,V - // 'W'; //52698..52979 - // 'X'; //52980..53640 - // 'Y'; //53689..54480 - // 'Z'; //54481..55289 + // iCnChar match the constant if ((iCnChar >= 45217) && (iCnChar <= 45252)) @@ -473,3 +432,4 @@ } } } + diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs new file mode 100644 index 0000000..8ba618f --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/DeviceSet.cs @@ -0,0 +1,244 @@ +锘縰sing System; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +using System.Collections.Generic; +using System.Text; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice +{ + public class DeviceSet : FrameLayout + { + public DeviceSet() + { + Tag = "PirView"; + } + public void Show() { + #region 鐣岄潰甯冨眬 + this.BackgroundColor = CSS.CSS_Color.viewMiddle; + PirDevice.View.TopView topView = new View.TopView(); + topView.topNameBtn.TextID = StringId.shebeigaunli; + topView.topIconBtn.Visible = true; + this.AddChidren(topView.FLayoutView()); + topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); }; + VerticalScrolViewLayout vv = new VerticalScrolViewLayout(); + vv.Height = Application.GetRealHeight(667 - 64); + vv.Y = Application.GetRealHeight(64); + this.AddChidren(vv); + #endregion + int a = 3; + int b = 3; + for (int i = 0; i < b; i++) + { + #region 绾㈠瀹濆浘鏍� 鐗堟湰鍙� 鍚嶇О 鐘舵�� + FrameLayout fLayout = new FrameLayout + { + Width = Application.GetRealWidth(375), + Height = Application.GetRealHeight(12+92+(50* a)), + }; + vv.AddChidren(fLayout); + + //绾㈠瀹濇樉绀虹埗鎺т欢 + FrameLayout devfLayout = new FrameLayout + { + Y = Application.GetRealHeight(12), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(375-16*2), + Height = Application.GetRealHeight(92 + (50 * a)), + BackgroundColor = CSS.CSS_Color.view, + Radius = (uint)Application.GetRealHeight(12), + }; + fLayout.AddChidren(devfLayout); + //绾㈠瀹濆浘鏍� + Button priequipmentBtn = new Button + { + Y=Application.GetRealHeight(16), + X = Application.GetRealWidth(5), + Width = Application.GetRealWidth(60), + Height = Application.GetRealWidth(60), + UnSelectedImagePath = "PirIcon/priequipment.png", + TextAlignment = TextAlignment.Center, + }; + devfLayout.AddChidren(priequipmentBtn); + //绾㈠瀹濆悕绉� + Button deviceNameBtn = new Button + { + Y=Application.GetRealHeight(16), + X = priequipmentBtn.Right + Application.GetRealWidth(7), + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(20), + Text = "绾㈠瀹滱"+i.ToString(), + TextAlignment = TextAlignment.CenterLeft, + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textColor, + IsBold = true, + }; + devfLayout.AddChidren(deviceNameBtn); + //鐗堟湰鍙� + Button versionBtn = new Button + { + Y = deviceNameBtn.Bottom+ Application.GetRealHeight(4), + X = priequipmentBtn.Right + Application.GetRealWidth(7), + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(17), + Text = "鐗堟湰鍙穠1.3.5", + TextAlignment = TextAlignment.CenterLeft, + TextSize = TextSize.text12, + TextColor = CSS.CSS_Color.textCancelColor, + }; + devfLayout.AddChidren(versionBtn); + // 5/10 + Button geBtn = new Button + { + Y = versionBtn.Bottom + Application.GetRealHeight(2), + X = priequipmentBtn.Right + Application.GetRealWidth(7), + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(17), + Text = "2", + TextAlignment = TextAlignment.CenterLeft, + TextSize = TextSize.text12, + TextColor = CSS.CSS_Color.textConfirmColor, + }; + devfLayout.AddChidren(geBtn); + geBtn.Width = geBtn.GetTextWidth(); + // 5/10 + Button sumBtn = new Button + { + Y = versionBtn.Bottom + Application.GetRealHeight(2), + X = geBtn.Right, + Width = Application.GetRealWidth(20), + Height = Application.GetRealHeight(17), + Text ="/10", + TextAlignment = TextAlignment.CenterLeft, + TextSize = TextSize.text12, + TextColor = CSS.CSS_Color.textCancelColor, + }; + devfLayout.AddChidren(sumBtn); + //鐘舵�佸浘鏍� + Button stateIconBtn = new Button + { + Y =Application.GetRealHeight(23), + X = Application.GetRealWidth(291), + Width = Application.GetRealWidth(8), + Height = Application.GetRealWidth(8), + UnSelectedImagePath = "PirIcon/online.png", + }; + devfLayout.AddChidren(stateIconBtn); + //绾㈠瀹濈姸鎬侊紙鍦ㄧ嚎-绂荤嚎锛� + Button stateTextBtn = new Button + { + Y = Application.GetRealHeight(18), + X = Application.GetRealWidth(303), + Width = Application.GetRealWidth(30), + Height = Application.GetRealHeight(17), + TextID=StringId.zaixianhwb, + TextAlignment = TextAlignment.CenterLeft, + TextSize = TextSize.text12, + TextColor = 0xFF67D569,// CSS.CSS_Color.textColor, + IsBold=true, + }; + devfLayout.AddChidren(stateTextBtn); + //绾� + Button lineBtn = new Button + { + Y = Application.GetRealHeight(92)-1, + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(343-16*2), + Height =1, + BackgroundColor = CSS.CSS_Color.viewLine, + }; + devfLayout.AddChidren(lineBtn); + + if (b - 1 == i) + { + //鏈�鍚庝竴涓悗闈㈠鍔犻棿闅旇儗鏅� + vv.AddChidren(new FrameLayout { Height = Application.GetRealHeight(20) }); + } + #endregion + + for (int j = 0; j < a; j++) { + RowLayout funControlRow = new RowLayout + { + Y = Application.GetRealHeight(92 + (50 * j)), + Width = Application.GetRealWidth(375 - 16 * 2), + Height = Application.GetRealHeight(50), + LineColor = CSS.CSS_Color.textWhiteColor, + SubViewWidth=Application.GetRealWidth(68), + }; + devfLayout.AddChidren(funControlRow); + //閬ユ帶鍣ㄥ悕绉� + Button nameBtn = new Button + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(150), + Height = Application.GetRealHeight(20), + Text =j.ToString(), + TextAlignment=TextAlignment.CenterLeft, + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textColor, + Gravity=Gravity.CenterVertical, + }; + funControlRow.AddChidren(nameBtn); + //閬ユ帶鍣ㄥ尯鍩� + Button areaBtn = new Button + { + X=Application.GetRealWidth(311+16-(40+100)), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(17), + Text = j.ToString(), + TextAlignment = TextAlignment.CenterRight, + TextSize = TextSize.text12, + TextColor = CSS.CSS_Color.textCancelColor, + Gravity =Gravity.CenterVertical, + }; + funControlRow.AddChidren(areaBtn); + //涓嬩竴绾у浘鏍� + Button nextIconBtn = new Button + { + X = Application.GetRealWidth(295+16), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), + UnSelectedImagePath = "PirIcon/next.png", + Gravity = Gravity.CenterVertical, + }; + funControlRow.AddChidren(nextIconBtn); + //鍒犻櫎 + Button delBtn = new Button + { + Width = Application.GetRealWidth(50), + Height = Application.GetRealHeight(22), + TextID = StringId.Del, + TextAlignment = TextAlignment.Center, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.textWhiteColor, + IsBold=true, + BackgroundColor= CSS.CSS_Color.textRedColor, + }; + funControlRow.AddRightView(delBtn); + //绾� + Button line1Btn = new Button + { + Y = Application.GetRealHeight(50 - 2), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(311), + Height = 1, + BackgroundColor = CSS.CSS_Color.viewLine, + }; + funControlRow.AddChidren(line1Btn); + if (j == a - 1) + { + //鏈�鍚庢敼鍙樹竴涓嚎鐨勯鑹� + line1Btn.BackgroundColor = CSS.CSS_Color.viewTranslucence; + funControlRow.LineColor = CSS.CSS_Color.viewTranslucence; + } + delBtn.MouseUpEventHandler += (sender,e) => { + + + }; + } + + + + } + + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs new file mode 100644 index 0000000..0c7d14f --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs @@ -0,0 +1,101 @@ +锘縰sing System; +using HDL_ON.DAL.Server; +using Shared; + +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice +{ + public class Method + { + /// <summary> + /// 娣诲姞閬ユ帶鍣ㄧ殑鏂规硶 + /// </summary> + public void AddControl() + { + View.TipView tipView = new View.TipView(); + tipView.InputBox("", (s, dialog) => + { + ///娓呴櫎涔嬪墠鍒楄〃鏁版嵁 + Pir.BuottonList.Clear(); + if (!string.IsNullOrEmpty(s)) + { + Control control = new Control(); + control.name = s; + control.type = "learn"; + + ThreadAddControl(control,dialog); + + + + } + },false); + + } + /// <summary> + /// 鍙戦�侀仴鎺у櫒鍛戒护鏂规硶 + /// </summary> + /// <param name="control"></param> + /// <param name="dialog"></param> + public void ThreadAddControl(Control control, Dialog dialog) { + + DAL.Server.ResponsePackNew responsePackNew = null; + Loading loading = new Loading(); + dialog.AddChidren(loading); + loading.Start(); + new System.Threading.Thread(() => + { + try + { + responsePackNew = PirSend.Add(control); + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + loading.Hide(); + //if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") + //{ + ///杩欓噷锛氱洃鍚琈TTP鎺ㄩ�佷笅鏉ヤ富棰橈紝鎵嶇煡閬撴槸鍚︽坊鍔犳垚鍔� + dialog.Close();//娣诲姞鎴愬姛鍏抽棴寮圭獥 + AddButton addButton = new AddButton(); + MainPage.BasePageView.AddChidren(addButton); + addButton.Show(control); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + + //鐩戝惉Mqtt鎺ㄩ�佷笅鏉ョ姸鎬佺爜鍋氭彁绀� + //View.FailView failView = new View.FailView(); + //failView.ShouError((view) => { + // view.Close(); + // ThreadAddControl(control, dialog); + //}); + //} + //else + //{ + // ErrorShow(responsePackNew); + //} + }); + } + }) + { IsBackground = true }.Start(); + + } + /// <summary> + /// 閿欒鐮佹彁绀� + /// </summary> + /// <param name="responsePackNew"></param> + public void ErrorShow(ResponsePackNew responsePackNew) + { + + if (responsePackNew != null && responsePackNew.Code == "14005") + { + new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.gatewayNotOnline)); + + } + else + { + new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.saveFail)); + + } + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs new file mode 100644 index 0000000..23d3c91 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs @@ -0,0 +1,48 @@ +锘縰sing System; +using System.Collections.Generic; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice +{ + public class Pir + { + /// <summary> + /// 娣诲姞鎸夐敭鍒楄〃 + /// </summary> + public static List<ButtonObj> BuottonList = new List<ButtonObj>(); + + } + public class ButtonObj + { + public string Key = string.Empty; + /// <summary> + /// #app 鏄剧ず鐨勬枃瀛� + /// </summary> + public string value = string.Empty; + } + public class Control + { + /// <summary> + /// 绾㈠瀹濊澶嘔d + /// </summary> + public string deviceId = "0"; + /// <summary> + /// 绾㈠閬ユ帶鍣ㄥ悕绉� + /// </summary> + public string name = "0"; + /// <summary> + /// 绾㈠閬ユ帶鍣╯pk + /// </summary> + public string spk = "ir.module"; + /// <summary> + /// library=搴撶被鍨�, learn=涓嶉渶瑕侀澶栬拷鍔犲睘鎬� + /// </summary> + public string type = "learn"; + /// <summary> + /// 鐮佺粍鍙� + /// </summary> + public string group_id = "12"; + /// <summary> + /// 绾㈠鐮� + /// </summary> + public List<string> library = new List<string>(); + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs new file mode 100644 index 0000000..9da222a --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs @@ -0,0 +1,339 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice +{ + public class PirMain : FrameLayout + { + public PirMain() + { + Tag = "PirView"; + } + public void Show() + { + #region 鐣岄潰甯冨眬 + this.BackgroundColor = CSS.CSS_Color.viewMiddle; + PirDevice.View.TopView topView = new View.TopView(); + topView.topNameBtn.TextID = StringId.hongwaiyaokong; + this.AddChidren(topView.FLayoutView()); + topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); }; + FrameLayout middFLayout = new FrameLayout(); + middFLayout.Y = Application.GetRealHeight(64); + middFLayout.Height = Application.GetRealHeight(667 - 64); + this.AddChidren(middFLayout); + + FrameLayout pirDeviceFLayout = new FrameLayout(); + pirDeviceFLayout.Y = Application.GetRealHeight(12); + pirDeviceFLayout.X = Application.GetRealWidth(16); + pirDeviceFLayout.Width = Application.GetRealWidth(343); + pirDeviceFLayout.Height = Application.GetRealHeight(187); + pirDeviceFLayout.BackgroundColor = CSS.CSS_Color.view; + pirDeviceFLayout.Radius = (uint)Application.GetRealHeight(12); + middFLayout.AddChidren(pirDeviceFLayout); + + //璁惧绠$悊 + Button text1Btn = new Button + { + Y = Application.GetRealHeight(11), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(20), + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textConfirmColor, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.shebeigaunli, + IsBold=true, + }; + pirDeviceFLayout.AddChidren(text1Btn); + + + Button pirIcon = new Button + { + Y = Application.GetRealHeight(47), + X = Application.GetRealWidth(28), + Width = Application.GetRealWidth(66), + Height = Application.GetRealWidth(66), + UnSelectedImagePath = "PirIcon/Infraredtreasure.png", + }; + pirDeviceFLayout.AddChidren(pirIcon); + + //mini鏅鸿兘閬ユ帶鍣� + Button text2Btn = new Button + { + Y = Application.GetRealHeight(70), + X = Application.GetRealWidth(112), + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(20), + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textTipColor, + TextAlignment = TextAlignment.CenterLeft, + Text = "mini鏅鸿兘閬ユ帶鍣�", + }; + pirDeviceFLayout.AddChidren(text2Btn); + + // + Button numberDeviceBtn = new Button + { + Y = Application.GetRealHeight(137), + X = Application.GetRealWidth(32), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(20), + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textColor, + TextAlignment = TextAlignment.CenterLeft, + Text = "1" + Language.StringByID(StringId.ge), + IsBold = true, + }; + pirDeviceFLayout.AddChidren(numberDeviceBtn); + //褰撳墠绾㈠閬ユ帶璁惧 + Button numberDeviceTextBtn = new Button + { + Y = numberDeviceBtn.Bottom + Application.GetRealHeight(4), + X = Application.GetRealWidth(32), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(14), + TextSize = TextSize.text10, + TextColor = CSS.CSS_Color.textCancelColor, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.dangqianhongwaishebei, + }; + pirDeviceFLayout.AddChidren(numberDeviceTextBtn); + // + Button currDeviceNumberControlBtn = new Button + { + Y = Application.GetRealHeight(137), + X = Application.GetRealWidth(198), + Width = Application.GetRealWidth(80), + Height = Application.GetRealHeight(20), + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textColor, + TextAlignment = TextAlignment.CenterLeft, + Text = "1" + Language.StringByID(StringId.ge), + IsBold = true, + }; + pirDeviceFLayout.AddChidren(currDeviceNumberControlBtn); + //宸叉坊鍔犻仴鎺у櫒 + Button currDeviceNumberControlTextBtn = new Button + { + Y = currDeviceNumberControlBtn.Bottom + Application.GetRealHeight(4), + X = Application.GetRealWidth(198), + Width = Application.GetRealWidth(80), + Height = Application.GetRealHeight(14), + TextSize = TextSize.text10, + TextColor = CSS.CSS_Color.textCancelColor, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.yitianjiayaokongqi, + }; + pirDeviceFLayout.AddChidren(currDeviceNumberControlTextBtn); + ///绾㈠瀹濈偣鍑讳簨浠� + FrameLayout clickFLayout = new FrameLayout(); + pirDeviceFLayout.AddChidren(clickFLayout); + clickFLayout.MouseUpEventHandler += (sender,e) => { + + DeviceSet deviceSet = new DeviceSet(); + MainPage.BasePageView.AddChidren(deviceSet); + deviceSet.Show(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + FrameLayout deviceListFLayout = new FrameLayout(); + deviceListFLayout.Y = pirDeviceFLayout.Bottom + Application.GetRealHeight(12); + deviceListFLayout.X = Application.GetRealWidth(16); + deviceListFLayout.Width = Application.GetRealWidth(343); + deviceListFLayout.Height = Application.GetRealHeight(328); + deviceListFLayout.BackgroundColor = CSS.CSS_Color.view; + deviceListFLayout.Radius = (uint)Application.GetRealHeight(12); + middFLayout.AddChidren(deviceListFLayout); + ///娣诲姞閬ユ帶鍣� + Button text3Btn = new Button + { + Y = Application.GetRealHeight(11), + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(20), + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textConfirmColor, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.tianjiayaokongqi, + IsBold = true, + }; + deviceListFLayout.AddChidren(text3Btn); + ///绾㈠瀹濆悕绉� + Button deviceNameBtn= new Button + { + Y = Application.GetRealHeight(13), + X = Application.GetRealWidth(161), + Width = Application.GetRealWidth(150), + Height = Application.GetRealHeight(17), + TextSize = TextSize.text12, + TextColor = CSS.CSS_Color.textColor, + TextAlignment = TextAlignment.CenterRight, + Text = "mini鏅鸿兘閬ユ帶鍣�", + }; + deviceListFLayout.AddChidren(deviceNameBtn); + + //涓嬫媺鍥炬爣 + var dropdownIconBtn = new Button + { + Y = Application.GetRealHeight(13), + X = Application.GetRealWidth(343-8-16), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), + UnSelectedImagePath = "PirIcon/dropdown.png", + }; + deviceListFLayout.AddChidren(dropdownIconBtn); + + #endregion + int line = 0; + for (int i = 1, j = 0; i <= 7; i++, j++) + { + var currpirdeviceFLayout = new FrameLayout + { + Width = Application.GetRealWidth(80), + Height = Application.GetRealWidth(80), + X = Application.GetRealWidth(26 + (80 + 25) * j), + Y = Application.GetRealHeight(52 + (80 + 12) * line), + + }; + deviceListFLayout.AddChidren(currpirdeviceFLayout); + var deviceIconBtn = new Button + { + Y = Application.GetRealHeight(8), + X = Application.GetRealWidth(20), + Width = Application.GetRealWidth(40), + Height = Application.GetRealWidth(40), + UnSelectedImagePath = "PirIcon/Infraredtreasure.png", + }; + currpirdeviceFLayout.AddChidren(deviceIconBtn); + var iconNameBtn = new Button + { + Y = deviceIconBtn.Bottom+Application.GetRealHeight(8), + Width = Application.GetRealWidth(80), + Height = Application.GetRealHeight(17), + TextSize = TextSize.text12, + TextColor = CSS.CSS_Color.TextualColor, + TextAlignment = TextAlignment.Center, + }; + currpirdeviceFLayout.AddChidren(iconNameBtn); + var clickBtn = new Button { Tag = i }; + currpirdeviceFLayout.AddChidren(clickBtn); + if (i % 3 == 0) + { + //婊′竴琛岄噸缃甹=0鍊�; + j = -1; + line += 1; + } + GetIconAndText(i, deviceIconBtn, iconNameBtn); + clickBtn.MouseUpEventHandler += (sender, e) => + { + //1=绌鸿皟;2=鐢佃;3=椋庢墖;4=鏈洪《鐩�;5=DVD/EVD/VCD;6=鎶曞奖浠�;7=鑷畾涔�; + int if_value =int.Parse(clickBtn.Tag.ToString()); + var list11 = new List<string> { + "鐖变綘", "鍝庡懄","鍩冨強","鍝堝紬鎹㈠3鍝堝紬", "鐖卞痉鍗庡v","淇哄嚑涓柉浜�", + "鎷滀簡", "宸村+", "鐧惧か", "鐧惧悎鍦扮悊璇句綘鎵撶畻", "涓嶅害鑰侀浼忔灔", "姣斿埌涔濈偣", + "杞︾珯","娴嬭瘯","姝ゅ湴", "鎵嶇湅瑙佸ソ寰楀揩","鍚冭蒋楗�","浠庣湅瑙佷簩鍗佸", + "绛夊緟鏈轰細鍚�","鐨勫鎴�", "澶氬枬鐐�", "鐧昏鍝︾劧鍚�", "鎵撶數璇�", + "鎭╄偆闇滅湅灏辩湅浜�", "楗挎os","鎭堕瓟鍩�","鍎跨鑱斿姩", "鎭╁叚棰楀瓙寮规媺鎷夎¥娲楁尽浜�","鍙戝ぇ瀛︾敓鍙戝彂", + "鐪熷帀瀹砳鍙戝灏�", "鐭ラ亾浣犱粯娆句簡鍙�", "灏厭鍥炲", "鏀硅繘鐨勮瘽", "澶╁ぉ閫熷害鍥炵瓟", "澶ソ浜嗗紑杞�", + "鍑忚偉鐨勭湅杩�","妗″嚭鍙e閭�","濡傛灉瑙夊緱", "寰堣垝鏈嶇殑","鍚冭蒋楗�","浠庣湅瑙佷簩鍗佸", + "榫欏嵎椋庝簭澶у彂","鍘诲ソ鐪�", "澶氬枬鐐�", "濂芥氮璐瑰ソ", "鎵撶數璇�"}; + System.Threading.Tasks.Task.Run(() => + { + Application.RunOnMainThread(() => + { + switch (if_value) + { + case 1: + { + } + break; + case 2: + { + } + break; + case 3: + { + } + break; + case 4: + { + } + break; + case 5: + { + } + break; + case 6: + { + } + break; + case 7: + { + Method method = new Method(); + method.AddControl(); + + } + break; + + } + + + //BrandList brandList = new BrandList(); + //MainPage.BasePageView.AddChidren(brandList); + //brandList.Show(list11, null); + //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }); + }); + }; + + } + + } + /// <summary> + /// 璁剧疆鍥剧墖鍜屽娉� + /// </summary> + /// <param name="index">绱㈠紩鍊�</param> + /// <param name="deviceIconBtn">鍥炬爣Btn</param> + /// <param name="deviceNameBtn">璁惧澶囨敞Btn</param> + private void GetIconAndText(int index,Button deviceIconBtn, Button deviceNameBtn) { + string iconPath = ""; + int deviceNameIndex=0; + switch (index) + { + case 1: { + iconPath = "PirIcon/air.png"; + deviceNameIndex = StringId.kongtiao; + } break; + case 2: { + iconPath = "PirIcon/tv.png"; + deviceNameIndex = StringId.dianshi; + } break; + case 3: { + iconPath = "PirIcon/fan.png"; + deviceNameIndex = StringId.fengshan; + } break; + case 4: { + iconPath = "PirIcon/stb.png"; + deviceNameIndex = StringId.jidinghe; + } break; + case 5: { + iconPath = "PirIcon/dvd.png"; + deviceNameIndex = StringId.dvd; + } break; + case 6: { + iconPath = "PirIcon/projector.png"; + deviceNameIndex = StringId.touyingyi; + } break; + case 7: { + iconPath = "PirIcon/custom.png"; + deviceNameIndex = StringId.zidingyi; + } break; + + } + deviceIconBtn.UnSelectedImagePath = iconPath; + deviceNameBtn.TextID = deviceNameIndex; + } + + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs new file mode 100644 index 0000000..abb0874 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs @@ -0,0 +1,175 @@ +锘縰sing System; +using System.IO; +using System.Net; +using HDL_ON.DAL.Server; +using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using Shared; + +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice +{ + + public class PirSend + { + /// <summary> + /// 浣忓畢ID + /// </summary> + public static string HomeId + { + get + { + return Entity.DB_ResidenceData.Instance.CurrentRegion.RegionID; + } + } + /// <summary> + /// 鏄惁涓哄叾浠栦富鐢ㄦ埛鍒嗕韩杩囨潵鐨勪綇瀹� + /// </summary> + public static bool IsOthreShare + { + get + { + return Entity.DB_ResidenceData.Instance.CurrentRegion.IsOthreShare; + } + } + /// <summary> + /// 閬ユ帶鍣ㄦ坊鍔� + /// </summary> + /// <returns></returns> + public static ResponsePackNew Add(Control control) + { + var jObject = new JObject { }; + jObject.Add("homeId", HomeId); + jObject.Add("deviceId", control.deviceId); + jObject.Add("name", control.name); + jObject.Add("spk", "ir.module"); + jObject.Add("type", control.type); + if (control.type == "library") + { + //jObject.Add("group_id", "123"); + var libraryjay = new JArray { }; + for (int i = 0; i < control.library.Count; i++) + { + libraryjay.Add(control.library[i]); + } + jObject.Add("library", libraryjay); + } + var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_Add); + return responsePackNew; + } + /// <summary> + /// 绾㈠鐮佸涔� + /// </summary> + /// <returns></returns> + public static void CodeStudy(ButtonObj buttonObj, Action<ResponsePackNew> action) + { + //var whichDayJson = jay["whichDay"].ToString(); + //var whichDayAry = Newtonsoft.Json.Linq.JArray.Parse(whichDayJson); + //for (int b = 0; b < whichDayAry.Count; b++) + //{ + // var days = whichDayAry[b].ToString(); + // timer.whichDay.Add(int.Parse(days)); + //} + var job = new JObject { }; + job.Add("key", buttonObj.Key); + job.Add("data_type", "string"); + var valuejArray = new JArray { }; + valuejArray.Add(buttonObj.value); + job.Add("value", valuejArray); + var jArray = new JArray { }; + jArray.Add(job); + var jObject = new JObject { { "homeId", HomeId }, { "deviceId", "0" }, { "attributes", jArray } }; + ResponsePackNew responsePackNew = null; + new System.Threading.Thread(() => + { + + try + { + //鍙戦�佺孩澶栫爜瀛︿範鍛戒护 + responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeStudy); + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + action(responsePackNew); + }); + } + + }) + { IsBackground = true }.Start(); + } + /// <summary> + /// 鑷鎸夐敭鍒犻櫎 + /// </summary> + /// <returns></returns> + public static ResponsePackNew CodeRemove(ButtonObj buttonObj) + { + var job = new JObject { }; + job.Add("key", buttonObj.Key); + job.Add("data_type", "string"); + var valuejArray = new JArray { }; + valuejArray.Add(buttonObj.value); + job.Add("value", valuejArray); + var jArray = new JArray { }; + jArray.Add(job); + var jObject = new JObject { { "homeId", HomeId }, { "deviceId", "0" }, { "attributes", jArray } }; + var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeRemove); + return responsePackNew; + } + /// <summary> + /// 鑾峰彇閫昏緫 + /// </summary> + /// <param name="listIdList">閫昏緫ID鍒楄〃</param> + /// <returns></returns> + public static ResponsePackNew GetLogic(List<string> listIdList) + { + var jArray = new JArray { }; + for (int i = 0; i < listIdList.Count; i++) + { + jArray.Add(listIdList[i]); + } + var jObject = new JObject { { "userLogicIds", jArray } }; + var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Info); + //濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken + if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) + { + RefreshToken(); + GetLogic(listIdList); + } + return responsePackNew; + } + + + + /// <summary> + ///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛� + /// </summary> + /// <returns></returns> + public static ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 20) + { + var requestJson = HttpUtil.GetSignRequestJson(o); + return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout); + + } + /// <summary> + /// 璇锋眰鏈嶅姟鍣� + /// </summary> + /// <returns></returns> + public static ResponsePackNew RequestServer(object o, string api_Url) + { + var requestJson = HttpUtil.GetSignRequestJson(o); + return HttpUtil.RequestHttpsPost(api_Url, requestJson); + + } + /// <summary> + /// 鍒锋柊Token + /// </summary> + public static void RefreshToken() + { + IMessageCommon.Current.StartRefreshToken(); + } + + } + +} diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/EmptyClass.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/BrandListView.cs similarity index 90% rename from HDL_ON/UI/UI2/3-Intelligence/Automation/EmptyClass.cs rename to HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/BrandListView.cs index 2293a25..1d0bfe1 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/EmptyClass.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/BrandListView.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using System.Text; -namespace HDL_ON.UI.UI2.Intelligence.Automation +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View { - public class EmptyClass : FrameLayout + public class BrandListView : FrameLayout { /// <summary> /// @@ -14,10 +14,8 @@ /// <param name="list">琛ㄧず璇ュ垪琛ㄥ厓绱燗-Z瀛楁瘝绛涢�夋樉绀哄嚭鏉�</param> /// <param name="list6">琛ㄧず璇ュ垪琛ㄥ厓绱犳樉绀哄湪list鍓嶉潰(璇ュ垪琛ㄥ厓绱犱笉鍋欰-Z瀛楁瘝绛涢��),娌℃湁鍙互涓簂ist6=null</param> /// <param name="action">杩斿洖閫変腑鏂囨湰</param> - public void Show(List<string> list, List<string> list6, Action<string> action) + public void Show(List<string> list, List<string> list6, Action<string> action) { - - //string text = "30"; //byte[] bytes = new byte[text.Length / 2]; //for (int i = 0, j = 0; i < bytes.Length; j += 2, i++) @@ -27,8 +25,6 @@ //} ////鎶奲yte鏁扮粍杞崲鎴愭枃瀛� //string str = System.Text.Encoding.UTF8.GetString(bytes); - - var frameLayout = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTop, @@ -59,7 +55,14 @@ UnSelectedImagePath = "LogicIcon/back.png", }; frameLayout.AddChidren(backBtn); - backBtn.MouseUpEventHandler += (sen, e) => + var clickBackBtn = new Button + { + Width = Application.GetRealWidth(12 + 16 + 20), + Height = Application.GetRealWidth(20 + 20), + Y = Application.GetRealHeight(32), + }; + frameLayout.AddChidren(clickBackBtn); + clickBackBtn.MouseUpEventHandler += (sen, e) => { this.RemoveFromParent(); }; @@ -86,16 +89,6 @@ }; this.AddChidren(fram); - - //var list11 = new List<string> { - // "鐖变綘", "鍝庡懄","鍩冨強","鍝堝紬鎹㈠3鍝堝紬", "鐖卞痉鍗庡v","淇哄嚑涓柉浜�", - // "鎷滀簡", "宸村+", "鐧惧か", "鐧惧悎鍦扮悊璇句綘鎵撶畻", "涓嶅害鑰侀浼忔灔", "姣斿埌涔濈偣", - // "杞︾珯","娴嬭瘯","姝ゅ湴", "鎵嶇湅瑙佸ソ寰楀揩","鍚冭蒋楗�","浠庣湅瑙佷簩鍗佸", - // "绛夊緟鏈轰細鍚�","鐨勫鎴�", "澶氬枬鐐�", "鐧昏鍝︾劧鍚�", "鎵撶數璇�", - // "鎭╄偆闇滅湅灏辩湅浜�", "楗挎os","鎭堕瓟鍩�","鍎跨鑱斿姩", "鎭╁叚棰楀瓙寮规媺鎷夎¥娲楁尽浜�","鍙戝ぇ瀛︾敓鍙戝彂", - // "鐪熷帀瀹砳鍙戝灏�", "鐭ラ亾浣犱粯娆句簡鍙�", "灏厭鍥炲", "鏀硅繘鐨勮瘽", "澶╁ぉ閫熷害鍥炵瓟", "澶ソ浜嗗紑杞�", - // "鍑忚偉鐨勭湅杩�","妗″嚭鍙e閭�","濡傛灉瑙夊緱", "寰堣垝鏈嶇殑","鍚冭蒋楗�","浠庣湅瑙佷簩鍗佸", - // "榫欏嵎椋庝簭澶у彂","鍘诲ソ鐪�", "澶氬枬鐐�", "濂芥氮璐瑰ソ", "鎵撶數璇�"}; if (list == null) { list = new List<string>(); @@ -105,7 +98,6 @@ list6 = new List<string>(); } var list1 = GetDateList(list); - list1.Add("1"); list1.InsertRange(0, list6); @@ -140,7 +132,7 @@ Width = Application.GetRealWidth(10 + 6), }; fram.AddChidren(a_zFra); - var list2 = GetList(); + var list2 = GetList(); for (int i = 0; i < list2.Count; i++) { @@ -183,7 +175,7 @@ } #endregion - RefreshLayout(vv, list1,action); + RefreshLayout(vv, list1, action); @@ -195,7 +187,7 @@ /// </summary> /// <param name="vv">鐖舵帶浠�</param> /// <param name="list">鏄剧ず鍒楄〃</param> - private void RefreshLayout(VerticalScrolViewLayout vv, List<string> list,Action<string> action) + private void RefreshLayout(VerticalScrolViewLayout vv, List<string> list, Action<string> action) { vv.RemoveAll(); foreach (var str in list) @@ -236,8 +228,8 @@ clickBtn.MouseUpEventHandler += (sen, e) => { //鎵惧埌绱㈠紩鍊� - var index = list.IndexOf(clickBtn.Tag.ToString()); - + //var index = list.IndexOf(); + action(clickBtn.Tag.ToString()); this.RemoveFromParent(); }; @@ -261,7 +253,6 @@ return false; } } - /// <summary> /// 鑾峰彇鏄剧ず鍒楄〃 /// </summary> @@ -300,7 +291,6 @@ } return list; } - /// <summary> /// 鑾峰彇A-Z瀛楁瘝鍒楄〃 /// </summary> @@ -321,7 +311,6 @@ } return list; } - /// <summary> /// 鑾峰彇姹夊瓧棣栧瓧姣� /// </summary> diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs new file mode 100644 index 0000000..db38adc --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs @@ -0,0 +1,102 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View +{ + public class Buttons + { + /// <summary> + /// 鍔ㄦ�佸姞杞芥寜閽垪琛� + /// </summary> + /// <param name="buttonFLayout">鐖舵帶浠�</param> + /// <param name="buttonList">鏁版嵁鍒楄〃</param> + /// <param name="action">鍥炶皟</param> + /// <param name="line">琛ㄧず澶氬皯琛�</param> + /// <param name="line">琛ㄧず涓�琛屽姞杞藉灏戜釜鎸夐挳</param> + public void AddButton(FrameLayout buttonFLayout, List<string> buttonList, Action<string> action, int line = 7, int sum = 3) + { + VerticalScrolViewLayout vv = new VerticalScrolViewLayout(); + buttonFLayout.AddChidren(vv); + for (int i = 0; i < line; i++) + { + var currFLayout = new FrameLayout { Height = Application.GetRealHeight(16 + 44) }; + vv.AddChidren(currFLayout); + for (int a = i * sum + 1, b = 0; a <= buttonList.Count; a++, b++) + { + var name = buttonList[a - 1]; + var nameBtn = new Button + { + Y = Application.GetRealHeight(16), + X = Application.GetRealWidth(24 + (98 + 16) * b), + // Gravity=Gravity.CenterVertical, + Width = Application.GetRealWidth(98), + Height = Application.GetRealHeight(44), + Text = name, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.textColor, + TextAlignment = TextAlignment.Center, + Radius = (uint)Application.GetRealHeight(8), + BorderWidth = 1, + BorderColor = CSS.CSS_Color.textCancelColor, + }; + currFLayout.AddChidren(nameBtn); + nameBtn.MouseUpEventHandler += (sender, e) => + { + action(nameBtn.Text); + }; + if (a % sum == 0) + { + break; + } + } + if (i == line - 1) + { + //鏈�鍚庝竴涓厓绱犲悗闈㈠姞涓�涓�20楂樺害闂撮殧 + vv.AddChidren(new FrameLayout { Height = Application.GetRealHeight(20) }); + } + } + + } + /// <summary> + /// 鑾峰彇鍒楄〃 + /// </summary> + /// <param name="tag">鏍囪鍊�</param> + /// <returns></returns> + public List<string> GetList(string tag) + { + List<string> list = new List<string>(); + switch (tag) + { + case "榛樿鎸夐挳": + { + list.Add(Language.StringByID(StringId.dianyuan)); + list.Add(Language.StringByID(StringId.yinliangjia)); + list.Add(Language.StringByID(StringId.yinliangjian)); + list.Add(Language.StringByID(StringId.pindaojia)); + list.Add(Language.StringByID(StringId.pindaojian)); + list.Add(Language.StringByID(StringId.shang)); + list.Add(Language.StringByID(StringId.xia)); + list.Add(Language.StringByID(StringId.zuo)); + list.Add(Language.StringByID(StringId.you)); + list.Add(Language.StringByID(StringId.jingyin)); + list.Add(Language.StringByID(StringId.queren)); + list.Add(Language.StringByID(StringId.bofang)); + list.Add(Language.StringByID(StringId.xiayibu)); + list.Add(Language.StringByID(StringId.tuichu)); + list.Add(Language.StringByID(StringId.caidan)); + list.Add(Language.StringByID(StringId.zanting)); + list.Add(Language.StringByID(StringId.fanhui)); + list.Add(Language.StringByID(StringId.tingzhi)); + list.Add(Language.StringByID(StringId.zhuye)); + list.Add(Language.StringByID(StringId.kuaijin)); + list.Add(Language.StringByID(StringId.kuaitui)); + list.Add(Language.StringByID(StringId.dingshi)); + + } + break; + } + return list; + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/FailView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/FailView.cs new file mode 100644 index 0000000..f224e9d --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/FailView.cs @@ -0,0 +1,65 @@ +锘縰sing System; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View +{ + public class FailView + { + public void ShouError(Action<Dialog> action) + { + Dialog dialog = new Dialog(); + #region 鐣岄潰甯冨眬 + dialog.BackgroundColor = CSS.CSS_Color.viewMiddle; + PirDevice.View.TopView topView = new View.TopView(); + topView.topNameBtn.TextID = StringId.tianjiayaokongqi; + dialog.AddChidren(topView.FLayoutView()); + topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { dialog.Close(); }; + + FrameLayout fLayout = new FrameLayout + { + Y = Application.GetRealHeight(64), + BackgroundColor = CSS.CSS_Color.textWhiteColor, + Height = Application.GetRealHeight(667-64), + Width = Application.GetRealWidth(375), + }; + dialog.AddChidren(fLayout); + + //鍥炬爣 + Button iconBtn = new Button + { + Y = Application.GetRealHeight(106), + X = Application.GetRealWidth(98), + Width = Application.GetRealWidth(180), + Height = Application.GetRealWidth(180), + UnSelectedImagePath = "PirIcon/failed.png", + }; + fLayout.AddChidren(iconBtn); + + //娣诲姞澶辫触 + Button text1Btn = new Button + { + Width = Application.GetRealWidth(375 - 32), + Height = Application.GetRealHeight(22), + Y = Application.GetRealHeight(302), + X = Application.GetRealWidth(16), + TextID = StringId.tianjiashibai, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.textRedColor, + TextAlignment = TextAlignment.Center, + }; + fLayout.AddChidren(text1Btn); + //閲嶈瘯 + View.SaveView saveView = new View.SaveView(); + dialog.AddChidren(saveView.FLayoutView()); + saveView.btnSave.TextID = StringId.chongshii; + saveView.frameLayout.BackgroundColor = CSS.CSS_Color.viewLine; + saveView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); + dialog.Show(); + saveView.btnClick.MouseUpEventHandler += (sender,e) => { + action(dialog); + }; + #endregion + + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PatchView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PatchView.cs new file mode 100644 index 0000000..48f3c25 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PatchView.cs @@ -0,0 +1,96 @@ +锘縰sing System; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View +{ + + public class PatchView + { + /// <summary> + /// 涓绘帶浠禫iew + /// </summary> + public FrameLayout frameLayout = new FrameLayout + { + Height = Application.GetRealHeight(44), + BackgroundColor = CSS.CSS_Color.textWhiteColor, + }; + + /// <summary> + /// 鏂囨湰鎻忚堪1 + /// </summary> + public Button btnText1 = new Button + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(300), + Height = Application.GetRealHeight(20), + TextColor = CSS.CSS_Color.textColor, + TextSize = TextSize.text14, + Gravity = Gravity.CenterVertical, + TextAlignment = TextAlignment.CenterLeft, + }; + + /// <summary> + /// 鏂囨湰鎻忚堪2 + /// </summary> + public Button btnText2 = new Button + { + X = Application.GetRealWidth(375 - 40 - 150), + Width = Application.GetRealWidth(150), + Height = Application.GetRealHeight(20), + TextColor = CSS.CSS_Color.textTipColor, + TextSize = TextSize.text14, + Gravity = Gravity.CenterVertical, + TextAlignment = TextAlignment.CenterRight, + }; + /// <summary> + /// 鍥炬爣 + /// </summary> + public Button btnNextIcon = new Button + { + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), + UnSelectedImagePath = "PirIcon/next.png", + X = Application.GetRealWidth(343), + Gravity = Gravity.CenterVertical, + }; + + /// <summary> + /// 绾� + /// </summary> + public Button btnLine = new Button + { + Width = Application.GetRealWidth(343), + X = Application.GetRealWidth(16), + Height = 1, + BackgroundColor = CSS.CSS_Color.viewLine, + + }; + + public Button btnClick = new Button + { + Height = Application.GetRealHeight(44), + }; + /// <summary> + /// View鐨勬柟娉� + /// </summary> + /// <returns></returns> + public FrameLayout FLayoutView(bool if_bool = true) + { + frameLayout.AddChidren(btnText1); + frameLayout.AddChidren(btnText2); + if (if_bool) + { + btnText2.X = Application.GetRealWidth(375 - 40 - 150); + frameLayout.AddChidren(btnNextIcon); + } + else + { + btnText2.X = Application.GetRealWidth(375 - 16 - 150); + } + btnLine.Y = frameLayout.Height - 1; + frameLayout.AddChidren(btnLine); + frameLayout.AddChidren(btnClick); + return frameLayout; + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/ReplicationView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/ReplicationView.cs new file mode 100644 index 0000000..fbebc91 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/ReplicationView.cs @@ -0,0 +1,69 @@ +锘縰sing System; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +using System.Collections.Generic; +using System.Text; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View +{ + public class ReplicationView + { + Dialog dialog = new Dialog(); + /// <summary> + /// + /// </summary> + public void Show() + { + #region 鐣岄潰甯冨眬 + dialog.BackgroundColor = CSS.CSS_Color.viewMiddle; + PirDevice.View.TopView topView = new View.TopView(); + topView.topNameBtn.TextID = StringId.fuzhiyaokonggongnneg; + dialog.AddChidren(topView.FLayoutView()); + topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { dialog.Close();}; + FrameLayout frameLayout = new FrameLayout(); + frameLayout.Height = Application.GetRealHeight(667 - 64); + frameLayout.Y = Application.GetRealHeight(64); + // frameLayout.BackgroundColor = CSS.CSS_Color.textWhiteColor; + dialog.AddChidren(frameLayout); + var textBtn = new Button + { + Y = Application.GetRealHeight(24), + X = Application.GetRealWidth(10), + Width = Application.GetRealWidth(375 - 20), + Height = Application.GetRealHeight(20), + TextSize = TextSize.text14, + TextColor = CSS.CSS_Color.textColor, + TextAlignment = TextAlignment.Center, + TextID = StringId.duizhunanxiaanniu, + }; + frameLayout.AddChidren(textBtn); + + var icon1Btn = new Button + { + Y = Application.GetRealHeight(91), + X = Application.GetRealWidth((375 - 149) / 2), + Width = Application.GetRealWidth(149), + Height = Application.GetRealHeight(95), + UnSelectedImagePath = "PirIcon/icon1.png", + }; + frameLayout.AddChidren(icon1Btn); + var icon2Btn = new Button + { + Y = Application.GetRealHeight(289), + X = Application.GetRealWidth(122), + Width = Application.GetRealWidth(182), + Height = Application.GetRealHeight(314), + UnSelectedImagePath = "PirIcon/icon2.png", + }; + frameLayout.AddChidren(icon2Btn); + dialog.Show(); + #endregion + + } + /// <summary> + /// 绉婚櫎褰撳墠鐣岄潰 + /// </summary> + public void RemView() { + dialog.Close(); + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/SaveView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/SaveView.cs new file mode 100644 index 0000000..37e24d9 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/SaveView.cs @@ -0,0 +1,52 @@ +锘縰sing System; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View +{ + public class SaveView + { + /// <summary> + /// 涓绘帶浠禫iew + /// </summary> + public FrameLayout frameLayout = new FrameLayout + { + Y = Application.GetRealHeight(TextSize.view667 - 76), + Height = Application.GetRealHeight(76), + Width = Application.GetRealWidth(TextSize.view375), + Gravity = Gravity.BottomCenter,//缃簳鐨勫睘鎬� + BackgroundColor = CSS.CSS_Color.view, + + }; + /// <summary> + /// 淇濆瓨 + /// </summary> + public Button btnSave = new Button + { + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + Y = Application.GetRealHeight(12), + X = Application.GetRealWidth(78), + TextID = StringId.save, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.textWhiteColor, + TextAlignment = TextAlignment.Center, + BackgroundColor = CSS.CSS_Color.btnSaveBackgroundColor, + Radius = (uint)Application.GetRealHeight(22), + + }; + public Button btnClick = new Button + { + Height = Application.GetRealHeight(76), + }; + /// <summary> + /// 淇濆瓨 + /// </summary> + /// <returns></returns> + public FrameLayout FLayoutView() + { + frameLayout.AddChidren(btnSave); + frameLayout.AddChidren(btnClick); + return frameLayout; + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs new file mode 100644 index 0000000..5d70028 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs @@ -0,0 +1,179 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.UI.CSS; +using HDL_ON.UI.Music; +using Shared; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View +{ + public class TipView + { + /// <summary> + /// 澶ф鍦嗚鍊� + /// </summary> + public int RradiusFrameLayout = 15; + /// <summary> + /// 灏忔鍦嗚鍊� + /// </summary> + public int radiusEditFrameLayout = 4; + + /// <summary> + /// 杈撳叆妗� + /// </summary> + /// <param name="confirmAction">鍥炶皟鍑芥暟</param> + public void InputBox(string tnputEditTxet, Action<string, Dialog> confirmAction,bool if_bool=true) + { + Dialog dialog = new Dialog() + { + BackgroundColor = MusicColor.PopupBackgroundColor, + }; + + FrameLayout whiteView = new FrameLayout() + { + //Gravity = Gravity.Center, + X = Application.GetRealWidth(53), + Y = Application.GetRealHeight(264), + Width = Application.GetRealWidth(270), + Height = Application.GetRealHeight(201), + BackgroundColor = MusicColor.WhiteColor, + BorderColor = 0x00000000, + BorderWidth = 0, + Radius = (uint)Application.GetRealHeight(RradiusFrameLayout), + }; + dialog.AddChidren(whiteView); + + Button btnTitle = new Button() + { + Y = Application.GetRealHeight(20), + X = Application.GetRealWidth(35), + Height = Application.GetRealHeight(22), + Width = Application.GetRealWidth(200), + TextColor = MusicColor.SelectedColor, + TextSize = TextSize.Text16, + TextAlignment = TextAlignment.Center, + TextID = StringId.shuruyaokongqimingcheng, + + }; + whiteView.AddChidren(btnTitle); + + FrameLayout editBjView = new FrameLayout() + { + // Gravity = Gravity.CenterHorizontal, + Y = btnTitle.Bottom + Application.GetRealHeight(16), + X = Application.GetRealWidth(24), + Width = Application.GetRealWidth(222), + Height = Application.GetRealHeight(40), + BackgroundColor = MusicColor.ViewColor, + BorderColor = 0x00000000, + BorderWidth = 0, + Radius = (uint)Application.GetMinRealAverage(radiusEditFrameLayout), + }; + whiteView.AddChidren(editBjView); + + EditText editText = new EditText() + { + X = Application.GetRealWidth(12), + Y = Application.GetRealHeight(10), + Width = Application.GetRealWidth(160), + Height = Application.GetRealHeight(20), + Text = tnputEditTxet, + TextColor = MusicColor.TextColor, + TextSize = TextSize.Text14, + TextAlignment = TextAlignment.CenterLeft, + }; + editBjView.AddChidren(editText); + + Button clearIconBtn = new Button + { + X = Application.GetRealWidth(194), + Y = Application.GetRealHeight(8), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), + UnSelectedImagePath = "MusicIcon/clear.png", + }; + editBjView.AddChidren(clearIconBtn); + clearIconBtn.MouseUpEventHandler += (sender, e) => + { + editText.Text = ""; + }; + + + Button btnTipText = new Button + { + X = Application.GetRealWidth(24), + Y = editBjView.Bottom + Application.GetRealHeight(12), + Width = Application.GetRealWidth(211), + Height = Application.GetRealHeight(35), + Text = Language.StringByID(StringId.fengleichazhao).Replace("{\\r\\n}", "\r\n"), + IsMoreLines = true, + TextColor = MusicColor.MusicNoTxetColor, + TextSize = TextSize.Text12, + TextAlignment = TextAlignment.CenterLeft, + }; + whiteView.AddChidren(btnTipText); + + Button btnLine = new Button() + { + Y = whiteView.Height -Application.GetRealHeight(44 + 1), + Height = Application.GetRealHeight(1), + BackgroundColor = MusicColor.LineColor, + }; + whiteView.AddChidren(btnLine); + + Button btnCancel = new Button() + { + Y = btnLine.Bottom, + Width = Application.GetRealWidth(135), + Height = Application.GetRealHeight(44), + TextAlignment = TextAlignment.Center, + TextColor = MusicColor.TextCancelColor, + TextSize = TextSize.Text16, + TextID = StringId.cancelMusic, + Gravity = Gravity.BottomLeft, + }; + whiteView.AddChidren(btnCancel); + btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft); + + Button btnConfirm = new Button() + { + X = btnCancel.Right, + Y = btnLine.Bottom, + Width = Application.GetRealWidth(135), + Height = Application.GetRealHeight(44), + TextAlignment = TextAlignment.Center, + TextColor = MusicColor.WhiteColor, + IsBold = true, + TextSize = TextSize.Text16, + TextID = StringId.confirmMusic, + BackgroundColor = MusicColor.SelectedColor, + Gravity = Gravity.BottomRight, + }; + whiteView.AddChidren(btnConfirm); + btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight); + dialog.Show(); + btnCancel.MouseUpEventHandler += (sender, e) => + { + dialog.Close(); + }; + + + + btnConfirm.MouseUpEventHandler += (sender, e) => + { + if (string.IsNullOrEmpty(editText.Text.Trim())) + { + return; + } + confirmAction(editText.Text.Trim(), dialog); + if (if_bool) { + dialog.Close(); + } + }; + + } + + + + + + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TopView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TopView.cs new file mode 100644 index 0000000..65015f8 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TopView.cs @@ -0,0 +1,87 @@ +锘縰sing System; +using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; +using Shared; +namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View +{ + public class TopView + { + #region 鏈�涓婇潰閭e潡鎺т欢 + /// <summary> + /// 鏈�涓婇潰鍧梀iew + /// </summary> + public FrameLayout frameLayout = new FrameLayout + { + BackgroundColor = CSS.CSS_Color.viewTop, + Height = Application.GetRealHeight(64), + Width = Application.GetRealWidth(375), + }; + /// <summary> + /// 鏍囬Btn + /// </summary> + public Button topNameBtn = new Button + { + TextSize = TextSize.text18, + TextColor = CSS.CSS_Color.textColor, + Width = Application.GetRealWidth(TextSize.view375 - 60 - 60), + Height = Application.GetRealHeight(25), + Y = Application.GetRealHeight(30), + X = Application.GetRealWidth(60) + }; + /// <summary> + /// 鍚庨��Btn + /// </summary> + public Button backBtn = new Button + { + Width = Application.GetRealWidth(12), + Height = Application.GetRealWidth(20), + X = Application.GetRealWidth(TextSize.left16), + Y = Application.GetRealHeight(32), + UnSelectedImagePath = "LogicIcon/back.png", + + }; + /// <summary> + /// 鍥炬爣Btn + /// </summary> + public Button topIconBtn = new Button + { + Y = Application.GetRealHeight(29), + X = Application.GetRealWidth(337), + Width = Application.GetRealWidth(28), + Height = Application.GetRealWidth(28), + UnSelectedImagePath = "PirIcon/adddevice.png", + Visible = false, + }; + /// <summary> + /// 澧炲姞鐑敭澶у皬Btn + /// </summary> + public Button clickBackBtn = new Button + { + Width = Application.GetRealWidth(16 + 12 + 16), + Height = Application.GetRealHeight(64), + }; + /// <summary> + /// 璁剧疆鍥炬爣澧炲姞鐑敭澶у皬 + /// </summary> + public Button clickSetBtn = new Button + { + X = Application.GetRealWidth(337 - 37), + Width = Application.GetRealWidth(28 + 37), + Height = Application.GetRealWidth(28 + 7 + 29), + }; + /// <summary> + /// 鏈�涓婇潰鐨勯偅鍧楁柟娉� + /// </summary> + /// <returns></returns> + public FrameLayout FLayoutView() + { + frameLayout.AddChidren(topNameBtn); + frameLayout.AddChidren(backBtn); + frameLayout.AddChidren(topIconBtn); + frameLayout.AddChidren(clickBackBtn); + frameLayout.AddChidren(clickSetBtn); + return frameLayout; + } + #endregion + } +} + -- Gitblit v1.8.0