| | |
| | | { |
| | | 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(); |
| | |
| | | |
| | | if (pageView.PageIndex == 0) |
| | | { |
| | | topView.topNameBtn.TextID =StringId.keshiduijiang; |
| | | topView.topNameBtn.TextID = StringId.keshiduijiang; |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | } |
| | | }; |
| | | #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), |
| | |
| | | TextSize = TextSize.Text24, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | //Text = "可视对讲", |
| | | TextID= StringId.keshiduijiang, |
| | | }; |
| | | TextID = StringId.keshiduijiang, |
| | | }; |
| | | bjFl.AddChidren(nameBtn); |
| | | /// <summary> |
| | | /// 区域名称 |
| | |
| | | SelectedImagePath = "MusicIcon/collectSelected.png", |
| | | }; |
| | | bjFl.AddChidren(collectIconBtn); |
| | | |
| | | ///可视对讲图标 |
| | | Button intercomBtnIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(84), |
| | |
| | | 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; |
| | |
| | | }; |
| | | 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), |
| | |
| | | }; |
| | | fLayout.AddChidren(iconBtn); |
| | | |
| | | var iconNameBtn = new Button |
| | | var deviceNameBtn = new Button |
| | | { |
| | | Y = iconBtn.Bottom + Application.GetRealHeight(6), |
| | | Width = Application.GetRealWidth(50), |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = video.aliasName, |
| | | }; |
| | | fLayout.AddChidren(iconNameBtn); |
| | | fLayout.AddChidren(deviceNameBtn); |
| | | |
| | | var clickBtn = new Button { Tag = video }; |
| | | |
| | |
| | | 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); |
| | | // } |
| | | //}); |
| | | |
| | | }; |
| | | } |
| | | |
| | |
| | | /// 第二个界面 |
| | | /// </summary> |
| | | /// <param name="view2">父控件</param> |
| | | /// <param name="listCall">通话记录列表</param> |
| | | /// <param name="video">当前的可视对讲</param> |
| | | void View2(FrameLayout view2, List<CallView> listCall, VideoClouds video) |
| | | { |
| | | |
| | |
| | | TextColor = MusicColor.MusicTxet14Color, |
| | | TextSize = TextSize.Text24, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID=StringId.tonghuajilu, |
| | | TextID = StringId.tonghuajilu, |
| | | }; |
| | | bjFl.AddChidren(nameBtn); |
| | | /// <summary> |
| | |
| | | TextColor = MusicColor.SelectedColor, |
| | | TextSize = TextSize.Text12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID=StringId.baolu30, |
| | | TextID = StringId.baolu30, |
| | | }; |
| | | bjFl.AddChidren(regionBtn); |
| | | |
| | |
| | | |
| | | } |
| | | /// <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()); |
| | | ///呼叫时间 |
| | |
| | | |
| | | |
| | | } |
| | | /// <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); |
| | |
| | | /// </summary> |
| | | /// <param name="str">状态值0:未接;1:已接;2:拒接</param> |
| | | /// <returns></returns> |
| | | public string getStateText(string str) |
| | | private string getStateText(string str) |
| | | { |
| | | string s = ""; |
| | | switch (str) |
| | |
| | | /// </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) |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |