From 7c4da83c338c9b34c51bb60820c5a82f33258fc4 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 16 九月 2021 09:25:19 +0800 Subject: [PATCH] 2021-09-16 1.新增物业公告对接,增加物业公告详情页面 --- HDL-ON_iOS/HDL-ON_iOS.csproj | 2 HDL-ON_iOS/Resources/Phone/Collection/MesCenter/PropertyOn.png | 0 HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs | 56 ++++++++- DLL/Shared.Droid.xml | 11 + HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Property.png | 0 HDL-ON_Android/Assets/Phone/Collection/MesCenter/Property.png | 0 DLL/Shared.IOS.xml | 6 + HDL-ON_Android/Assets/Phone/Collection/MesCenter/PropertyOn.png | 0 HDL-ON_Android/HDL-ON_Android.csproj | 2 DLL/Shared.IOS.dll | 0 HDL_ON/DAL/Server/NewAPI.cs | 5 HDL_ON/DAL/Server/HttpServerRequest.cs | 16 ++ .vs/HDL_APP_Project/xs/UserPrefs.xml | 20 +-- DLL/Shared.Droid.dll | 0 HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs | 186 ++++++++++++++++++++++++++++-- 15 files changed, 264 insertions(+), 40 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index c00177e..52caede 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,25 +1,17 @@ 锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" /> - <MonoDevelop.Ide.Workbench> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL-ON_iOS/AppDelegate.cs"> <Files> - <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="1124" Column="21" IsPinned="True" /> - <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="258" Column="59" /> - <File FileName="HDL_ON/DAL/DriverLayer/Packet.cs" Line="30" Column="16" /> - <File FileName="HDL_ON/DAL/DriverLayer/UdpSocket.cs" Line="56" Column="14" /> - <File FileName="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs" Line="467" Column="19" /> - <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="1209" Column="45" /> - <File FileName="HDL_ON/DAL/Server/NewApiRes.cs" Line="1122" Column="30" /> - <File FileName="HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs" Line="38" Column="33" /> + <File FileName="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs" Line="346" Column="5" /> + <File FileName="HDL-ON_iOS/Info.plist" /> + <File FileName="HDL-ON_iOS/AppDelegate.cs" Line="303" Column="1" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="HDL_APP_Project" expanded="True"> - <Node name="HDL-ON_Android" expanded="True"> - <Node name="References" expanded="True"> - <Node name="Shared.Droid" selected="True" /> - </Node> - <Node name="Packages" expanded="True" /> + <Node name="HDL-ON_iOS" expanded="True"> + <Node name="AppDelegate.cs" selected="True" /> </Node> </Node> </State> diff --git a/DLL/Shared.Droid.dll b/DLL/Shared.Droid.dll index 999dac3..ff87e25 100644 --- a/DLL/Shared.Droid.dll +++ b/DLL/Shared.Droid.dll Binary files differ diff --git a/DLL/Shared.Droid.xml b/DLL/Shared.Droid.xml index 3dc8941..f2014e5 100644 --- a/DLL/Shared.Droid.xml +++ b/DLL/Shared.Droid.xml @@ -1311,6 +1311,11 @@ 鐐瑰嚮寮硅捣浜嬩欢 </summary> </member> + <member name="F:Shared.View.MouseUpOutsideEventHandler"> + <summary> + 鐐瑰嚮寮硅捣浜嬩欢 UpOutside + </summary> + </member> <member name="F:Shared.View.MouseLongEventHandler"> <summary> 闀挎寜鐐瑰嚮浜嬩欢 @@ -4323,6 +4328,12 @@ 鍔犺浇鏈湴HTML </summary> </member> + <member name="M:Shared.WebView.LoadHTMLString(System.String)"> + <summary> + 鍔犺浇Html鏍囩鐨勫瘜鏂囨湰 + </summary> + <param name="htmlStr"></param> + </member> <member name="T:Shared.WebView.MyWebViewClient"> <summary> MyWebViewClient diff --git a/DLL/Shared.IOS.dll b/DLL/Shared.IOS.dll index 36127be..bcbf111 100644 --- a/DLL/Shared.IOS.dll +++ b/DLL/Shared.IOS.dll Binary files differ diff --git a/DLL/Shared.IOS.xml b/DLL/Shared.IOS.xml index 04be6ae..76c018c 100644 --- a/DLL/Shared.IOS.xml +++ b/DLL/Shared.IOS.xml @@ -1720,6 +1720,12 @@ 鍔犺浇鏈湴HTML </summary> </member> + <member name="M:Shared.WebView.LoadHTMLString(System.String)"> + <summary> + 鍔犺浇Html鏍囩鐨勫瘜鏂囨湰 + </summary> + <param name="htmlStr"></param> + </member> <member name="T:Shared.WebView.OnWKNavigationDelegate"> <summary> OnWKNavigationDelegate diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/Property.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/Property.png new file mode 100644 index 0000000..6304c84 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/Property.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Collection/MesCenter/PropertyOn.png b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/PropertyOn.png new file mode 100644 index 0000000..9eab09d --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Collection/MesCenter/PropertyOn.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index 4df5f13..7031ef5 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -462,6 +462,8 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" /> <AndroidAsset Include="Assets\Phone\LogicIcon\security.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\Property.png" /> + <AndroidAsset Include="Assets\Phone\Collection\MesCenter\PropertyOn.png" /> </ItemGroup> <ItemGroup> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\BindScene.png" /> diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index 0fc2a6b..09a1d4f 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -1353,6 +1353,8 @@ <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" /> <BundleResource Include="Resources\Phone\LogicIcon\security.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\Property.png" /> + <BundleResource Include="Resources\Phone\Collection\MesCenter\PropertyOn.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Property.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Property.png new file mode 100644 index 0000000..6304c84 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/Property.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/PropertyOn.png b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/PropertyOn.png new file mode 100644 index 0000000..9eab09d --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Collection/MesCenter/PropertyOn.png Binary files differ diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 48f2b5f..513ed6e 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -1271,9 +1271,21 @@ { IsBackground = true }.Start(); } -#endregion + /// <summary> + /// 鑾峰彇鐗╀笟鍏憡璇︽儏 + /// </summary> + /// <param name="noticeId"></param> + /// <returns></returns> + public ResponsePackNew GetPropertyNoticeDetails(string noticeId) + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("noticeId", noticeId); + var requestJson = HttpUtil.GetSignRequestJson(d); + return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_GetNoticeInfo, requestJson); + } + #endregion -#region 妫�娴嬫洿鏂� + #region 妫�娴嬫洿鏂� /// <summary> /// /// </summary> diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs index 0c9455e..180b762 100644 --- a/HDL_ON/DAL/Server/NewAPI.cs +++ b/HDL_ON/DAL/Server/NewAPI.cs @@ -322,6 +322,11 @@ /// 閫氳繃涓婚敭id鍒犻櫎涓�鏉℃帹閫佽褰� /// </summary> public const string API_POST_PushSerivce_Deletepushinfo = "/smart-footstone/app/message/delete_by_id"; + /// <summary> + /// 鑾峰彇鐗╀笟鍏憡璇︽儏 + /// </summary> + public const string API_POST_PushSerivce_GetNoticeInfo = "/community-footstone/app/notice/info"; + #endregion #region 鈻� -- 妫�娴嬫洿鏂版帴鍙__________________________ diff --git a/HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs b/HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs index c53bfd5..cae77b9 100644 --- a/HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs +++ b/HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs @@ -14,6 +14,10 @@ /// bodyView /// </summary> FrameLayout bodyView; + /// <summary> + /// mWebView + /// </summary> + public WebView mWebView; /// <summary> /// WebViewDialog @@ -26,28 +30,37 @@ /// <summary> /// 鍔犺浇椤甸潰 /// </summary> - /// <param name="titleStr"></param> - /// <param name="url"></param> - public void LoadPage(string titleStr, string url) + void AddBodyViewWithTittle(string titleStr) { bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; this.AddChidren(bodyView); new TopViewDiv(this, bodyView, titleStr).LoadTopView(); - //WebView - var webView = new WebView() { + mWebView = new WebView() + { Y = Application.GetRealHeight(64), Height = bodyView.Height - Application.GetRealHeight(64), X = Application.GetRealWidth(16), Width = bodyView.Width - Application.GetRealWidth(32) }; - bodyView.AddChidren(webView); + bodyView.AddChidren(mWebView); + } + + /// <summary> + /// 鍔犺浇椤甸潰 + /// </summary> + /// <param name="titleStr"></param> + /// <param name="url"></param> + public void LoadPage(string titleStr, string url) { + + AddBodyViewWithTittle(titleStr); + try { if (!string.IsNullOrEmpty(url)) { //鍔犺浇缃戝潃 - webView.LoadRequest(url); + mWebView.LoadRequest(url); } } catch @@ -57,5 +70,34 @@ this.Show(); } + + + /// <summary> + /// 鍔犺浇椤甸潰 + /// html瀵屾枃鏈� + /// </summary> + /// <param name="titleStr"></param> + /// <param name="htmlStr"></param> + public void LoadPageWithHtmlStr(string titleStr, string htmlStr) + { + + AddBodyViewWithTittle(titleStr); + + try + { + if (!string.IsNullOrEmpty(htmlStr)) + { + //html瀵屾枃鏈� + mWebView.LoadHTMLString(htmlStr); + } + } + catch + { + + } + + this.Show(); + } + } } diff --git a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs index 152714a..b2635af 100644 --- a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs @@ -194,15 +194,15 @@ systemMenuButton.SelectAction = systemAction; #endregion - #region 鐗╀笟閫氱煡 + #region 鐗╀笟閫氱煡 2021-09-15澧炲姞 propertyMenuButton = new MenuButton() { X = systemMenuButton.Right, Y = Application.GetRealWidth(16), }; - menuView.AddChidren(propertyMenuButton); //鍏堝睆钄� - propertyMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/SystemOn.png"; - propertyMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/System.png"; + menuView.AddChidren(propertyMenuButton); + propertyMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/PropertyOn.png"; + propertyMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/Property.png"; propertyMenuButton.TextButton.TextID = StringId.Propertynotice; propertyMenuButton.TextButton.IsMoreLines = true; Action propertyAction = () => @@ -212,7 +212,6 @@ propertyMenuButton.SelectAction = propertyAction; #endregion - //鍏堝睆钄� //鍙硃addingView menuView.AddChidren(new Button() { @@ -408,14 +407,15 @@ btnDatetime.Text = GetUnixToDateTime(pushMessageInfo.createTime); - //2020-12-23 鍘绘帀鐐瑰嚮寮圭獥浜嬩欢 - //EventHandler<MouseEventArgs> eventHandler = (sender, e) => - //{ - // new Alert(pushMessageInfo.messageTitle, pushMessageInfo.messageContent, Language.StringByID(StringId.Close)).Show(); - //}; - //rowView.MouseUpEventHandler = eventHandler; - //btnTilte.MouseUpEventHandler = eventHandler; - //btnSubtitle.MouseUpEventHandler = eventHandler; + + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + OnClickPushMessageInfo(pushMessageInfo); + //new Alert(pushMessageInfo.messageTitle, pushMessageInfo.messageContent, Language.StringByID(StringId.Close)).Show(); + }; + rowView.MouseUpEventHandler = eventHandler; + btnTilte.MouseUpEventHandler = eventHandler; + btnSubtitle.MouseUpEventHandler = eventHandler; } @@ -624,6 +624,106 @@ } } + /// <summary> + /// 鑾峰彇鐗╀笟閫氱煡璇︽儏 + /// </summary> + /// <param name="noticeId"></param> + void GetPropertyNoticeDetails(string noticeId) + { + var waitPage = new Loading(); + bodyView.AddChidren(waitPage); + waitPage.Start(Language.StringByID(StringId.PleaseWait)); + + new Thread(() => + { + try + { + var result = new HttpServerRequest().GetPropertyNoticeDetails(noticeId); + if (result.Code == StateCode.SUCCESS) + { + var mPushNoticeInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<PushNoticeInfo>(result.Data.ToString()); + if (mPushNoticeInfo != null) + { + Application.RunOnMainThread(() => + { + new WebViewDialog().LoadPageWithHtmlStr(mPushNoticeInfo.title, mPushNoticeInfo.content); + }); + } + } + } + catch (Exception ex) + { + } + finally + { + Application.RunOnMainThread(() => + { + if (waitPage != null) + { + waitPage.RemoveFromParent(); + waitPage = null; + } + }); + } + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 閫氱煡淇℃伅鐐瑰嚮浜嬩欢 + /// </summary> + /// <param name="pushMessageInfo"></param> + void OnClickPushMessageInfo(PushMessageInfo pushMessageInfo) + { + + if (pushMessageInfo.pushType == PushType.Notice.ToString()) + { + //Utlis.WriteLine("鐗╀笟閫氱煡"); + string noticeId = GetNoticeId(pushMessageInfo.messageExpand); + if (!string.IsNullOrEmpty(noticeId)) + { + GetPropertyNoticeDetails(noticeId); + } + else + { + Utlis.WriteLine("noticeId null"); + } + } + else + { + Utlis.WriteLine("鍏跺畠閫氱煡绫诲瀷"); + } + } + + /// <summary> + /// 瑙f瀽messageExpand 鎻愬彇targetId + /// </summary> + /// <param name="messageExpand"></param> + /// <returns></returns> + string GetNoticeId(string messageExpand) + { + try + { + if (!string.IsNullOrEmpty(messageExpand)) + { + var mMessageExpandInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageExpandInfo>(messageExpand); + if (mMessageExpandInfo != null) + { + var mExpantContentInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ExpantContentInfo>(mMessageExpandInfo.expantContent); + if(mExpantContentInfo != null) + { + return mExpantContentInfo.targetId; + } + } + } + return null; + } + catch + { + return null; + } + } + #region 娴嬭瘯 #if DEBUG /// <summary> @@ -789,10 +889,10 @@ /// 娑堟伅鍐呭 /// </summary> public string messageContent; - ///// <summary> - ///// 鎵╁睍鏁版嵁 - ///// </summary> - //public string messageExpand; + /// <summary> + /// 鎵╁睍鏁版嵁 + /// </summary> + public string messageExpand; ///// <summary> ///// 娑堟伅绫诲瀷锛�0锛氭彁绀猴紱1锛氭姤璀︼紱2锛氫赴鏋楀彲鏄璁插懠鍙紱3锛氬己鍒朵笅绾挎帹閫� ///// </summary> @@ -817,4 +917,56 @@ } + + /// <summary> + /// 鐗╀笟鍏憡璇︽儏 + /// </summary> + [System.Serializable] + public class PushNoticeInfo + { + /// <summary> + /// 娑堟伅ID + /// </summary> + public string noticeId; + /// <summary> + /// 娑堟伅鏍囬 + /// </summary> + public string title; + /// <summary> + /// 瀵屾枃鏈唴瀹� + /// </summary> + public string content; + } + + /// <summary> + /// 鎺ㄩ�佹墿灞曚俊鎭� + /// </summary> + [System.Serializable] + public class MessageExpandInfo + { + /// <summary> + /// expantContent + /// </summary> + public string expantContent; + + } + + /// <summary> + /// 鎺ㄩ�佹墿灞曚俊鎭� + /// </summary> + [System.Serializable] + public class ExpantContentInfo + { + /// <summary> + /// targetId + /// </summary> + public string targetId; + /// <summary> + /// messageType + /// </summary> + public string messageType; + + } + + } -- Gitblit v1.8.0