From 564c60519d425617fcc482e10100e427ecb7b8d9 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期三, 31 三月 2021 15:26:55 +0800 Subject: [PATCH] 2021-3-31-1 --- HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs | 167 +++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 129 insertions(+), 38 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs index ada70a2..7a14f2e 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs @@ -10,12 +10,19 @@ { public class MainView : FrameLayout { + /// <summary> + /// 鍔犺浇鍙瀵硅UI + /// </summary> + /// <param name="listVideo">闂ㄥ彛鏈哄垪琛�</param> + /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param> + /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param> public void Show(List<VideoMethod.FlVideo> listVideo, List<CallView> listCall, VideoClouds video) { + #region 甯冨眬鐣岄潰 this.BackgroundColor = MusicColor.ViewColor; var topView = new TopView(); this.AddChidren(topView.TopFLayoutView()); - topView.topNameBtn.TextID =StringId.keshiduijiang; + topView.topNameBtn.TextID = StringId.keshiduijiang; topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { RemoveFromParent(); @@ -82,7 +89,7 @@ if (pageView.PageIndex == 0) { - topView.topNameBtn.TextID =StringId.keshiduijiang; + topView.topNameBtn.TextID = StringId.keshiduijiang; } else { @@ -90,14 +97,17 @@ } }; + #endregion } /// <summary> /// 绗竴涓晫闈� /// </summary> /// <param name="view1">鐖舵帶浠�</param> + /// <param name="list">闂ㄥ彛鏈哄垪琛�</param> + /// <param name="videoClouds">褰撳墠鐨勫彲瑙嗗璁�</param> void View1(FrameLayout view1, List<VideoMethod.FlVideo> list, VideoClouds videoClouds) { - + #region 甯冨眬鐣岄潰 var bjFl = new FrameLayout { Y = Application.GetRealHeight(24), @@ -120,8 +130,8 @@ TextSize = TextSize.Text24, TextAlignment = TextAlignment.CenterLeft, //Text = "鍙瀵硅", - TextID= StringId.keshiduijiang, - }; + TextID = StringId.keshiduijiang, + }; bjFl.AddChidren(nameBtn); /// <summary> /// 鍖哄煙鍚嶇О @@ -151,7 +161,7 @@ SelectedImagePath = "MusicIcon/collectSelected.png", }; bjFl.AddChidren(collectIconBtn); - + ///鍙瀵硅鍥炬爣 Button intercomBtnIcon = new Button { X = Application.GetRealWidth(84), @@ -173,7 +183,7 @@ if (list.Count > 0) { //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�,铏氭嫙涓�涓嚭鏉� - list.Add(new VideoMethod.FlVideo { aliasName = "闂ㄧ浜岀淮鐮�", devType = "10" }); + list.Add(new VideoMethod.FlVideo { aliasName =Language.StringByID(StringId.menjinerweima), devType = "100" }); } //鏁扮粍涓暟 //int value = 15; @@ -195,10 +205,11 @@ }; vv.AddChidren(fL); int line = 0; - + #endregion for (int i = 1, j = 0; i <= list.Count; i++, j++) { var video = list[i - 1]; + #region var fLayout = new FrameLayout { Width = Application.GetRealWidth(50), @@ -218,7 +229,7 @@ }; fLayout.AddChidren(iconBtn); - var iconNameBtn = new Button + var deviceNameBtn = new Button { Y = iconBtn.Bottom + Application.GetRealHeight(6), Width = Application.GetRealWidth(50), @@ -228,7 +239,7 @@ TextAlignment = TextAlignment.Center, Text = video.aliasName, }; - fLayout.AddChidren(iconNameBtn); + fLayout.AddChidren(deviceNameBtn); var clickBtn = new Button { Tag = video }; @@ -239,31 +250,42 @@ j = -1; line += 1; } - // GetIconAndText(i, deviceIconBtn, iconNameBtn); + getIconAndText(video, iconBtn); + #endregion + //闂ㄥ彛鏈虹殑鐐瑰嚮浜嬩欢 clickBtn.MouseUpEventHandler += (sender, e) => { var flVideo = clickBtn.Tag as VideoMethod.FlVideo; - if (string.IsNullOrEmpty(flVideo.uuid)) + if (flVideo.devType == "100") { - new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.peizhicanshuyouyichang)); + //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨� + VideoSend.GetQRcode(this, videoClouds, (tag, paw) => + { + if (tag) + { + //娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥 + View.ShowDialog showDialog = new View.ShowDialog(); + showDialog.QRcode(paw); + } + }); } - ESVideoInfo eSVideoInfo = new ESVideoInfo + else { - ESVideoUUID = flVideo.uuid, - DeviceName = flVideo.aliasName, - roomno = videoClouds.flRoomId, - unitno= videoClouds.flBuildingId, - }; - ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo); + if (string.IsNullOrEmpty(flVideo.uuid)) + { + new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.peizhicanshuyouyichang)); + } + ESVideoInfo eSVideoInfo = new ESVideoInfo + { + ESVideoUUID = getUuid(flVideo.uuid), + DeviceName = flVideo.aliasName, + roomno = videoClouds.flRoomId, + unitno = videoClouds.flBuildingId, + }; + ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo); + } - //VideoSend.GetQRcode(this, videoClouds, (tag,paw) => - //{ - // if (tag) - // { - // View.ShowDialog showDialog = new View.ShowDialog(); - // showDialog.QRcode(paw); - // } - //}); + }; } @@ -273,6 +295,8 @@ /// 绗簩涓晫闈� /// </summary> /// <param name="view2">鐖舵帶浠�</param> + /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param> + /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param> void View2(FrameLayout view2, List<CallView> listCall, VideoClouds video) { @@ -297,7 +321,7 @@ TextColor = MusicColor.MusicTxet14Color, TextSize = TextSize.Text24, TextAlignment = TextAlignment.CenterLeft, - TextID=StringId.tonghuajilu, + TextID = StringId.tonghuajilu, }; bjFl.AddChidren(nameBtn); /// <summary> @@ -312,7 +336,7 @@ TextColor = MusicColor.SelectedColor, TextSize = TextSize.Text12, TextAlignment = TextAlignment.CenterLeft, - TextID=StringId.baolu30, + TextID = StringId.baolu30, }; bjFl.AddChidren(regionBtn); @@ -336,22 +360,24 @@ } /// <summary> - /// 鍒锋柊鐣岄潰 + /// 閫氳瘽璁板綍鍒锋柊鐣岄潰 /// </summary> - /// <param name="vv"></param> - /// <param name="listCall"></param> + /// <param name="vv">涓婁笅婊戝姩鎺т欢</param> + /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param> public void RefreshView(VerticalRefreshLayout vv, List<CallView> listCall) { vv.RemoveAll(); for (int i = 0; i < listCall.Count; i++) { var year = listCall[i]; + //骞存枃鏈埗鎺т欢 View.FrameLayout50 frameLayout50 = new View.FrameLayout50(); vv.AddChidren(frameLayout50.FLayoutView()); frameLayout50.btnText.Text = year.year + Language.StringByID(StringId.nian);//骞� for (int j = 0; j < year.callList.Count; j++) { var call = year.callList[j]; + //闂ㄥ彛鏈虹姸鎬佺埗鎺т欢 View.FrameLayout60 frameLayout60 = new View.FrameLayout60(); vv.AddChidren(frameLayout60.FLayoutView()); ///鍛煎彨鏃堕棿 @@ -365,14 +391,63 @@ } + /// <summary> + /// 鏄剧ず鍥炬爣 + /// </summary> + /// <param name="flVideo"></param> + /// <param name="iconBtn">鍥炬爣</param> + private void getIconAndText(FlVideo flVideo, Button iconBtn) + { + //(1瀹ゅ唴鏈�,2瀹ゅ鏈猴紝3鍥村鏈猴紝4绠$悊鏈�,5浜屾纭鏈�) + string iconstr = ""; + switch (flVideo.devType) + { + case "1": + { + iconstr = "VideoIcon/danyuanji.png"; + } + break; + case "2": + { + iconstr = "VideoIcon/danyuanji.png"; + } + break; + case "3": + { + iconstr = "VideoIcon/weiqiangji.png"; + } + break; + case "4": + { + iconstr = "VideoIcon/weiqiangji.png"; + } + break; + case "5": + { + iconstr = "VideoIcon/weiqiangji.png"; + } + break; + case "100": + { + iconstr = "VideoIcon/menjin.png"; + } + break; + default: + { + iconstr = "VideoIcon/weiqiangji.png"; + } + break; + } + iconBtn.UnSelectedImagePath = iconstr; + } /// <summary> /// 鑾峰彇鏄剧ず鏃堕棿鏂囨湰 /// </summary> - /// <param name="str"></param> + /// <param name="str">utcTime</param> /// <returns></returns> - public string getTime(string str) + private string getTime(string str) { var utcTime = Convert.ToDateTime(str); var dateTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, TimeZoneInfo.Local); @@ -383,7 +458,7 @@ /// </summary> /// <param name="str">鐘舵�佸��0锛氭湭鎺ワ紱1锛氬凡鎺ワ紱2锛氭嫆鎺�</param> /// <returns></returns> - public string getStateText(string str) + private string getStateText(string str) { string s = ""; switch (str) @@ -411,7 +486,7 @@ /// </summary> /// <param name="if_bool"></param> /// <returns></returns> - public string getUnlockText(bool if_bool) + private string getUnlockText(bool if_bool) { string s = ""; if (if_bool) @@ -424,7 +499,23 @@ } return s; } - + /// <summary> + /// 鑾峰彇uuid + /// </summary> + /// <param name="uuid"></param> + /// <returns></returns> + private string getUuid(string uuid) + { + if (uuid.Contains(",")) + { + var uuid1 = uuid.Split(','); + return uuid1[0]; + } + else + { + return uuid; + } + } } -- Gitblit v1.8.0