HDL-ON_Android/Assets/Language.ini
@@ -527,6 +527,7 @@ 539=Smart panel 540=In Alarm 541=Monitoring 542=Wandering alarm 1000=Room Humidity @@ -1681,6 +1682,7 @@ 539=智能面板 540=报警中 541=监控中 542=徘徊报警 1000=室内湿度 1001=童锁 @@ -2811,7 +2813,9 @@ 537=Humidity statistics 538=Uint 539=Smart panel 419=Нормальный 540=Нормальный 541=Monitoring 542=Wandering alarm @@ -3961,13 +3965,13 @@ 533=Statistical Chart 534=Data 535=Dew point temperature 536=Temperature statistics 536=Temperature statistics 537=Humidity statistics 538=Uint 539=Smart panel 540=En alarma 541=Monitoring 542=Wandering alarm 1000=Humedad de ambiente HDL-ON_Android/Other/JPush/JPushReceiver.cs
@@ -257,7 +257,7 @@ { while (MainPage.BasePageView == null) { System.Threading.Thread.Sleep(300); System.Threading.Thread.Sleep(300); } Shared.Application.RunOnMainThread(() => { HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202205061"> <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="30" /> <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28" /> <!--友盟--> <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>--> HDL-ON_Android/Resources/values-zh/strings.xml
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <resources> <string name="app_name">ON_Plus</string> <string name="app_name">On_Pro</string> <string name="action_settings">设置</string> <string name="video_screenshot">截图</string> <string name="video_unlock">开锁</string> HDL-ON_iOS/Resources/Language.ini
@@ -527,6 +527,7 @@ 539=Smart panel 540=In Alarm 541=Monitoring 542=Wandering alarm 1000=Room Humidity @@ -1681,6 +1682,7 @@ 539=智能面板 540=报警中 541=监控中 542=徘徊报警 1000=室内湿度 1001=童锁 @@ -2813,6 +2815,7 @@ 539=Smart panel 540=Нормальный 541=Monitoring 542=Wandering alarm @@ -3968,6 +3971,7 @@ 539=Smart panel 540=En alarma 541=Monitoring 542=Wandering alarm 1000=Humedad de ambiente HDL_ON/Common/ImageUtlis.cs
@@ -466,6 +466,47 @@ } } /// <summary> /// 下载用户头像 /// </summary> /// <param name="imageUrl"></param> /// <param name="ignoreCache">忽略缓存</param> /// <param name="regionUrl">指定服务器域名,传空为使用当前用户地址</param> /// <returns></returns> public byte[] DownImageByImageUrl(string imageUrl, bool ignoreCache = false) { try { if (string.IsNullOrEmpty(imageUrl)) return null; byte[] imageBytes; if (!ignoreCache && Exists(imageUrl)) { //本地有缓存 imageBytes = ReadFile(imageUrl); } else { //下载 imageBytes = HttpUtil.HttpsDownload(imageUrl); if (imageBytes != null) { //保存到本地 WriteFileByBytes(imageUrl, imageBytes); } } return imageBytes; } catch { return null; } } #endregion } } HDL_ON/Common/R.cs
@@ -4,6 +4,11 @@ { public static class StringId { /// <summary> /// 徘徊报警 /// </summary> public const int WanderingAlarm = 542; /// <summary> /// 监控中 /// </summary> HDL_ON/DAL/DriverLayer/Control.cs
@@ -460,6 +460,7 @@ var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson); new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id,resend); MainPage.Log($"本地通讯 发送HDL-Link数据:{functionControlDataJson}"); //Control.Ins.MsgInfoList.Add($"本地通讯 发送HDL-Link数据:{functionControlDataJson}"+"\r\n"); } } //远程通讯 HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -518,6 +518,8 @@ var revString = Encoding.UTF8.GetString(bytes); MainPage.Log($"mqtt 状态更新:{revString}"); Control.Ins.UpdataFunctionStatus(revString, null, true); //Control.Ins.MsgInfoList.Add($"mqtt 状态更新:{revString}"); //Control.Ins.MsgInfoList.Add(revString + "\r\n"); } //一端口数据解析 HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -2621,6 +2621,23 @@ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Check, requestJson); return pack; } /// <summary> /// 获取门口机徘徊报警数据 /// </summary> /// <param name="deviceId"></param> /// <returns></returns> public ResponsePackNew GetAlarmRecords(string deviceId,string alarmType = "PROWLER_ALARM") { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("deviceId", deviceId); d.Add("alarmType", alarmType); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_ALARM_RECORDS, requestJson); return pack; } #endregion #region ■ 门锁相关____________________________ HDL_ON/DAL/Server/NewAPI.cs
@@ -668,6 +668,21 @@ /// 动态密码/二维码开锁 /// </summary> public const string API_POST_FL_QRcode = "http://112.74.164.111:180/api.php/Device/setdynamicpwd"; /// <summary> /// 临时密码 /// 二维码 /// </summary> public const string API_Post_Temporary_Password = "/home-wisdom/app/freeview/temppwd/add"; /// <summary> /// 获取门禁二维码 /// </summary> public const string API_POST_OwnerQRCode = "/community-wisdom/doorDevice/getOwnerQRCode"; /// <summary> /// 徘徊报警 /// </summary> public const string API_POST_ALARM_RECORDS = "/home-wisdom/app/device/alarmRecords/listByPage"; #endregion HDL_ON/HDL_ON.projitems
@@ -498,6 +498,7 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Form\DeviceFunction4CardCommonForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ContentView\FhContentView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ContentView\AcContentView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\WanderingAlarmPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -217,6 +217,7 @@ //etAccount.Text = "18316120654";//tujie //etAccount.Text = "13450425807";//黄竹溪 knx项目 etAccount.Text = "18244942707"; etAccount.Text = "13826414433";//陈伟潮 自研可视对讲 } else { HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
@@ -993,7 +993,9 @@ }) { IsBackground = true }.Start(); } catch { } catch (Exception ex) { MainPage.Log("上传图片异常:" + ex.Message); } } } } HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
@@ -928,7 +928,7 @@ #endif #endregion #region 获取支持 //#region 获取支持 //FrameLayout supView = new FrameLayout() //{ // Height = Application.GetRealWidth(44), @@ -1022,7 +1022,7 @@ // BackgroundColor = CSS_Color.DividingLineColor //}; //supView.AddChidren(btnSupportViewLine); #endregion //#endregion #region 关于On Pro FrameLayout aboutView = new FrameLayout() HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs
@@ -132,6 +132,11 @@ /// </summary> public string deviceName = string.Empty; /// <summary> /// 区分是狄耐克还是自研 /// 目前只有自研有值:door.gate /// </summary> public string spk = string.Empty; /// <summary> /// 设备id、序列号、uuid /// </summary> public string deviceId = string.Empty; HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
@@ -2,14 +2,16 @@ using HDL_ON.UI.Music; using System.Collections.Generic; using Shared; using HDL_ON.Stan; using ZXing.QrCode.Internal; using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod; using HDL_ON.UI.CSS; namespace HDL_ON.UI.UI2.FuntionControlView.Video { public class VideoMainView : FrameLayout { List<Video> ximoVideoList = new List<Video>(); /// <summary> /// 加载可视对讲UI /// </summary> @@ -17,6 +19,8 @@ /// <param name="videoList">可视对讲列表</param> public void Show(List<CallView> listCall, List<Video> videoList) { ximoVideoList = videoList.FindAll((obj) => obj.spk == "door.gate"); #region 布局界面 this.BackgroundColor = MusicColor.ViewColor; var topView = new TopView(); @@ -191,11 +195,17 @@ }; bjFl.AddChidren(vv); bool bol = haveFlVideo(videoList); bool bol = haveQRCodeVideo(videoList); if (bol) { //门禁二维码固定有的,虚拟一个出来 videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100" }); videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100",devType = "100" }); } if (ximoVideoList.Count > 0) { //徘徊报警 videoList.Add(new Video { deviceName = Language.StringByID(StringId.WanderingAlarm), interphoneType = "222", devType = "222" }); } //数组个数 //int value = 15; @@ -217,10 +227,13 @@ }; vv.AddChidren(fL); int line = 0; #endregion for (int i = 1, j = 0; i <= videoList.Count; i++, j++) { var video = videoList[i - 1]; #region var fLayout = new FrameLayout { @@ -239,6 +252,7 @@ UnSelectedImagePath = "VideoIcon/weiqiangji.png", }; fLayout.AddChidren(iconBtn); var deviceNameBtn = new Button { @@ -267,19 +281,28 @@ //门口机的点击事件 clickBtn.MouseUpEventHandler += (sender, e) => { if (video.devType == "VisitorQrCode") { return; } else if (video.devType == "FaceManagement") { return; } var video2 = clickBtn.Tag as Video; if (video2.devType == "100") { //门禁二维码固定有的 VideoSend.GetQRcode(this, video2, (tag, paw) => { if (tag) { //注意:密码有可能延时1分钟生效 View.ShowDialog showDialog = new View.ShowDialog(); showDialog.QRcode(paw); } }); ChooseVideoShowQRCode(); } else if(video2.devType == "222") { ChooseAlarmShow(); } else { @@ -544,20 +567,313 @@ //判断是否有 丰林可视对讲 private bool haveFlVideo(List<Video> videoList) private bool haveQRCodeVideo(List<Video> videoList) { bool bol = false; for (int i = 0; i < videoList.Count; i++) { var _video = videoList[i]; if (_video.interphoneType == "FLVI") if (_video.interphoneType == "FLVI"|| _video.spk == "door.gate") { return true; } } return bol; } /// <summary> /// 加载提示弹窗 /// </summary> public void ChooseVideoShowQRCode() { Dialog dialog = new Dialog() { BackgroundColor = CSS_Color.DialogTransparentColor1, }; FrameLayout dialogView = new FrameLayout(); dialog.AddChidren(dialogView); dialogView.MouseUpEventHandler = (sender, e) => { dialog.Close(); }; var contentView = new FrameLayout() { Gravity = Gravity.Center, Width = Application.GetRealWidth(270), Height = Application.GetRealHeight(280), BackgroundColor = CSS_Color.MainBackgroundColor, BorderColor = 0x00000000, BorderWidth = 0, Radius = (uint)Application.GetMinRealAverage(10), }; dialogView.AddChidren(contentView); var btnTitle = new Button() { Height = Application.GetRealHeight(64), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.FirstLevelTitleColor, TextID = StringId.menjinerweima, TextSize = CSS_FontSize.SubheadingFontSize, }; contentView.AddChidren(btnTitle); var listView = new VerticalScrolViewLayout() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(70), Width = Application.GetRealWidth(230), Height = Application.GetRealHeight(200), }; contentView.AddChidren(listView); if (ximoVideoList.Count == 1) { Loading loading = new Loading(); contentView.AddChidren(loading); loading.Start(""); new System.Threading.Thread(() => { try { var pack = VideoSend.GetQRcode(); var pairs = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AccessControlQRode>>(pack.Data.ToString()); if (pairs.Count > 0) { Application.RunOnMainThread(() => { ImageView codeImage = new ImageView() { Gravity = Gravity.Center, Height = Application.GetRealWidth(200), Width = Application.GetRealWidth(200), ImageBytes = Scan.BytesFromText(pairs[0].qrcode, Application.GetRealWidth(200), Application.GetRealWidth(200)), }; contentView.AddChidren(codeImage); }); } } catch (Exception ex) { MainPage.Log($"获取门禁二维码异常:{ex.Message}"); } finally { Application.RunOnMainThread(() => { if (loading != null) { loading.Hide(); loading.RemoveFromParent(); } }); } }) { IsBackground = true }.Start(); } else { foreach (var v in ximoVideoList) { Button btnMsg = new Button() { Gravity = Gravity.CenterHorizontal, Height = Application.GetRealHeight(50), Width = Application.GetRealHeight(160), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.TextualColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, Text = v.deviceName, Radius = (uint)Application.GetRealWidth(5), BackgroundColor = CSS_Color.DividingLineColor, IsMoreLines = true, }; listView.AddChidren(btnMsg); listView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); btnMsg.MouseUpEventHandler = (sender, e) => { if (v.spk == "door.gate") { Loading loading = new Loading(); contentView.AddChidren(loading); loading.Start(""); new System.Threading.Thread(() => { try { var pack = VideoSend.GetQRcode(); var pairs = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AccessControlQRode>>(pack.Data.ToString()); if (pairs.Count > 0) { Application.RunOnMainThread(() => { ImageView codeImage = new ImageView() { Gravity = Gravity.Center, Height = Application.GetRealWidth(200), Width = Application.GetRealWidth(200), ImageBytes = Scan.BytesFromText(pairs[0].qrcode, Application.GetRealWidth(200), Application.GetRealWidth(200)), }; contentView.AddChidren(codeImage); }); } } catch (Exception ex) { MainPage.Log($"获取门禁二维码异常:{ex.Message}"); } finally { Application.RunOnMainThread(() => { if (loading != null) { loading.Hide(); loading.RemoveFromParent(); } }); } }) { IsBackground = true }.Start(); return; } //门禁二维码固定有的 VideoSend.GetQRcode(this, v, (tag, paw) => { if (tag) { //注意:密码有可能延时1分钟生效 View.ShowDialog showDialog = new View.ShowDialog(); showDialog.QRcode(paw); } }); dialog.Close(); }; } } dialog.Show(); } /// <summary> /// 选择徘徊报警列表显示 /// </summary> public void ChooseAlarmShow() { Dialog dialog = new Dialog() { BackgroundColor = CSS_Color.DialogTransparentColor1, }; FrameLayout dialogView = new FrameLayout(); dialog.AddChidren(dialogView); dialogView.MouseUpEventHandler = (sender, e) => { dialog.Close(); }; var contentView = new FrameLayout() { Gravity = Gravity.Center, Width = Application.GetRealWidth(270), Height = Application.GetRealHeight(280), BackgroundColor = CSS_Color.MainBackgroundColor, BorderColor = 0x00000000, BorderWidth = 0, Radius = (uint)Application.GetMinRealAverage(10), }; dialogView.AddChidren(contentView); var btnTitle = new Button() { Height = Application.GetRealHeight(64), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.FirstLevelTitleColor, TextID = StringId.menjinerweima, TextSize = CSS_FontSize.SubheadingFontSize, }; contentView.AddChidren(btnTitle); var listView = new VerticalScrolViewLayout() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(70), Width = Application.GetRealWidth(230), Height = Application.GetRealHeight(200), }; contentView.AddChidren(listView); if (ximoVideoList.Count == 1) { var wanderingAlarmPage = new WanderingAlarmPage(); MainPage.BasePageView.AddChidren(wanderingAlarmPage); wanderingAlarmPage.LoadPage(ximoVideoList[0].deviceId); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; } else { foreach (var v in ximoVideoList) { Button btnMsg = new Button() { Gravity = Gravity.CenterHorizontal, Height = Application.GetRealHeight(50), Width = Application.GetRealHeight(160), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.TextualColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, Text = v.deviceName, Radius = (uint)Application.GetRealWidth(5), BackgroundColor = CSS_Color.DividingLineColor, IsMoreLines = true, }; listView.AddChidren(btnMsg); listView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); btnMsg.MouseUpEventHandler = (sender, e) => { var wanderingAlarmPage = new WanderingAlarmPage(); MainPage.BasePageView.AddChidren(wanderingAlarmPage); wanderingAlarmPage.LoadPage(v.deviceId); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; dialog.Close(); }; } } dialog.Show(); } } public class AccessControlQRode { public string title = string.Empty; public string codeType = string.Empty; public string userName = string.Empty; public string houseFullName = string.Empty; public string communityName = string.Empty; public string desc = string.Empty; public string businessType = string.Empty; public string qrcode = string.Empty; } } HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs
@@ -3,6 +3,7 @@ using System.IO; using System.Net; using HDL_ON.DAL.Server; using HDL_ON.Entity; using HDL_ON.UI.UI2.PersonalCenter.PirDevice; using Newtonsoft.Json.Linq; using Shared; @@ -81,6 +82,18 @@ return revertObj; } public static ResponsePackNew GetQRcode() { var jobject = new JObject(); jobject.Add("userId", UserInfo.Current.ID); jobject.Add("userType", "C"); jobject.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); jobject.Add("codeSecond", "60"); var requestJson = HttpUtil.GetSignRequestJson(jobject);//数据签名 var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_OwnerQRCode, requestJson); return revertObj; } /// <summary> /// 上报动态开锁密码(注意:密码有可能延时1分钟生效) /// </summary> @@ -90,12 +103,21 @@ bool if_bool = false; //临时密码 string pwd = VideoMethod.GetCode(); var jobject = new JObject(); jobject.Add("communityID", video.flRoomBindVO.flCmtId);//社区ID jobject.Add("fromTime", VideoMethod.GetCurrentTimeStamp());//开始时间 jobject.Add("validTime", VideoMethod.GetTomorrowTimeStamp());//有效时间 jobject.Add("unitno", video.flRoomBindVO.flBuildingId);//单元号 jobject.Add("roomno", video.flRoomBindVO.flRoomId);//房间号 jobject.Add("code", pwd); jobject.Add("userKey", video.flRoomBindVO.id); jobject.Add("timestamp", VideoMethod.GetCurrentTimeStamp()); jobject.Add("secretKey", video.flRoomBindVO.flSecretKey); jobject.Add("method", "setdynamicpwd"); jobject.Add("numTimes", "5"); var jobject = new JObject(); jobject.Add("communityID", video.flRoomBindVO.flCmtId);//社区ID jobject.Add("fromTime", VideoMethod.GetCurrentTimeStamp());//开始时间 jobject.Add("validTime", VideoMethod.GetTomorrowTimeStamp());//有效时间 jobject.Add("unitno", video.flRoomBindVO.flBuildingId);//单元号 jobject.Add("roomno", video.flRoomBindVO.flRoomId);//房间号 jobject.Add("code", pwd); jobject.Add("userKey", video.flRoomBindVO.id); jobject.Add("timestamp", VideoMethod.GetCurrentTimeStamp()); jobject.Add("secretKey", video.flRoomBindVO.flSecretKey); jobject.Add("method", "setdynamicpwd"); jobject.Add("numTimes", "5"); //加载log Loading loading = new Loading(); frame.AddChidren(loading); @@ -104,7 +126,9 @@ { try { var str = HttpWebRequest(NewAPI.API_POST_FL_QRcode, jobject.ToString(), "POST"); string str = ""; str = HttpWebRequest(NewAPI.API_POST_FL_QRcode, jobject.ToString(), "POST"); if (!string.IsNullOrEmpty(str)) { var json = JObject.Parse(str); HDL_ON/UI/UI2/FuntionControlView/Video/WanderingAlarmPage.cs
New file @@ -0,0 +1,188 @@ using System; using System.Collections.Generic; using HDL_ON.DAL.Server; using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI.UI2.FuntionControlView.Video { public class WanderingAlarmPage : FrameLayout { FrameLayout bodyView; public WanderingAlarmPage() { bodyView = this; } VerticalScrolViewLayout contentView; public void LoadPage(string deviceId) { bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; new TopViewDiv(bodyView, Language.StringByID(StringId.WanderingAlarm)).LoadTopView(); var btnTipMsg = new Button() { Y = Application.GetRealHeight(64), X = Application.GetRealWidth(20), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(318), TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, Text = "*可视对讲可以自动识别门口可疑人员,并发起徘徊报警记录" }; if(Language.CurrentLanguage != "Chinese") { btnTipMsg.Text = "*Visual intercom can automatically identify suspicious persons at the door and initiate wandering alarm records"; } bodyView.AddChidren(btnTipMsg); contentView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(64 + 62), Height = Application.GetRealHeight(550), }; bodyView.AddChidren(contentView); Loading loading = new Loading(); bodyView.AddChidren(loading); loading.Start(""); new System.Threading.Thread(()=> { try { HttpServerRequest http = new HttpServerRequest(); var pack = http.GetAlarmRecords(deviceId); if (pack.Code == StateCode.SUCCESS) { var obj = Newtonsoft.Json.JsonConvert.DeserializeObject<AlarmRecordInfoPack>(pack.Data.ToString()); LoadSceneGallery(obj); } } catch (Exception ex) { MainPage.Log($"读取徘徊报警数据异常:{ex.Message}"); } finally { Application.RunOnMainThread(() => { if (loading != null) { loading.Hide(); loading.RemoveFromParent(); } }); } }) { IsBackground = true }.Start(); } /// <summary> /// 加载场景图库 /// </summary> void LoadSceneGallery(AlarmRecordInfoPack pack) { FrameLayout sceneImageRow = new FrameLayout() { Height = Application.GetRealWidth(128), }; Application.RunOnMainThread(() => { for (int i = 0; i < pack.list.Count; i++) { var item = pack.list[i]; var imageBytes = ImageUtlis.Current.DownImageByImageUrl(item.alarmImg); var sceneImageView = new ImageView() { Width = Application.GetRealWidth(172), Height = Application.GetRealHeight(90), Radius = (uint)Application.GetRealWidth(12), ImageBytes = imageBytes }; var btnTime = new Button() { Width = Application.GetRealHeight(160), Height = Application.GetRealHeight(41), Y = Application.GetRealHeight(90), Text = Utlis.UnixToDateTimeMS(item.alarmTime).ToString(), TextColor = CSS_Color.FirstLevelTitleColor, TextAlignment = TextAlignment.Center }; if (i % 2 == 0) { sceneImageRow = new FrameLayout() { Height = Application.GetRealHeight(90 + 53), }; contentView.AddChidren(sceneImageRow); sceneImageView.X = Application.GetRealWidth(10); sceneImageRow.AddChidren(sceneImageView); btnTime.X = Application.GetRealWidth(10); sceneImageRow.AddChidren(btnTime); } else { sceneImageView.X = Application.GetRealWidth(194); sceneImageRow.AddChidren(sceneImageView); btnTime.X = Application.GetRealWidth(194); sceneImageRow.AddChidren(btnTime); } sceneImageView.MouseUpEventHandler = (sender, e) => { Dialog dialog = new Dialog(); FrameLayout dialogContentView = new FrameLayout(); dialog.AddChidren(dialogContentView); dialogContentView.MouseUpEventHandler = (sender, e) => { dialog.Close(); }; ImageView btnImage = new ImageView() { Gravity = Gravity.Center, Height = Application.GetRealHeight(211), ImageBytes = sceneImageView.ImageBytes, }; dialogContentView.AddChidren(btnImage); dialog.Show(); }; System.Threading.Thread.Sleep(200); } }); } } public class AlarmRecordInfoPack { public int totalCount = 0; public int totalPage = 0; public int pageNo = 0; public int pageSize = 0; public List<AlarmRecordInfo> list = new List<AlarmRecordInfo>(); } /// <summary> /// 徘徊报警信息 /// </summary> public class AlarmRecordInfo { public string alarmImg = string.Empty; public long alarmTime; public string alarmType = string.Empty; public string alarmTypeDesc = string.Empty; } }