陈嘉乐
2021-03-30 003abaf86b766eb40ef62300ab0c707774c36ba9
2021-3-30-2

备份代码
8个文件已修改
301 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/View/ShowDialog.cs 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,11 +1,55 @@
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="../../Application.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs" Line="64" Column="15" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs" Line="253" Column="56" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs" Line="30" Column="23" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" Line="71" Column="49" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="686" Column="1" />
      <File FileName="../../TempQRCode.cs" Line="125" Column="48" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/MyQRCodePage.cs" Line="100" Column="39" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/View/ShowDialog.cs" Line="118" Column="50" />
      <File FileName="HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs" Line="63" Column="29" />
      <File FileName="../../Application.cs" Line="1" Column="1" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="ThirdPartySdk" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI0-Stan" expanded="True">
                  <Node name="Controls" expanded="True">
                    <Node name="NormalControls" expanded="True" />
                  </Node>
                </Node>
                <Node name="UI2" expanded="True">
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="PirDevice" expanded="True" />
                  </Node>
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="Music" expanded="True">
                      <Node name="View" expanded="True" />
                    </Node>
                    <Node name="Video" expanded="True">
                      <Node name="View" expanded="True" />
                      <Node name="MainView.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_Android" expanded="True" />
            <Node name="HDL-ON_iOS" expanded="True">
              <Node name="Resources" expanded="True" />
            </Node>
          </Node>
        </State>
      </Pad>
    </Pads>
  </MonoDevelop.Ide.Workbench>
  <MonoDevelop.Ide.DebuggingService.PinnedWatches />
  <DisabledProjects>
@@ -14,7 +58,7 @@
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.Android_Accelerated_Oreo" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.4b65c4650918" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore />
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
HDL_ON/DAL/Server/NewAPI.cs
@@ -571,6 +571,10 @@
        /// 获取门口机列表
        /// </summary>
        public const string API_POST_FL_List = "http://112.74.164.111:180/api.php/Device/getmonitorUUID";
        /// <summary>
        /// 动态密码/二维码开锁
        /// </summary>
        public const string API_POST_FL_QRcode = "http://112.74.164.111:180/api.php/Device/setdynamicpwd";
        #endregion
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
@@ -59,8 +59,6 @@
        /// <param name="mESVideoInfo"></param>
        public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo)
        {
            this.esVideoInfo = mESVideoInfo;
#if __IOS__
             int roomID = 0;
            int.TryParse(mESVideoInfo.roomno, out roomID);
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
@@ -260,10 +260,10 @@
        {
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                var view = new UI2.FuntionControlView.Video.VideoMethod();// AddThirdPartyBrandListpage(); // BrandListPage();
                view.MianView();
                HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod videoMethod = new UI2.FuntionControlView.Video.VideoMethod();
                videoMethod.getVideo((device)=> {
                    videoMethod.MianView(this, device);
                }, this,true);
                return;
                var page = new BrandListPage();// AddThirdPartyBrandListpage(); // BrandListPage();
HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs
@@ -2,13 +2,15 @@
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;
namespace HDL_ON.UI.UI2.FuntionControlView.Video
{
    public class MainView : FrameLayout
    {
        public void Show(List<ESVideoInfo> listVideo, List<CallView> listCall, VideoClouds video)
        public void Show(List<VideoMethod.FlVideo> listVideo, List<CallView> listCall, VideoClouds video)
        {
            this.BackgroundColor = MusicColor.ViewColor;
            var topView = new TopView();
@@ -30,7 +32,7 @@
            pageView.AddChidren(view1);
            var view2 = new FrameLayout();
            pageView.AddChidren(view2);
            View1(view1, listVideo);
            View1(view1, listVideo, video);
            View2(view2, listCall, video);
            Button btn11 = new Button
            {
@@ -93,9 +95,9 @@
        /// 第一个界面
        /// </summary>
        /// <param name="view1">父控件</param>
        void View1(FrameLayout view1, List<ESVideoInfo> list)
        void View1(FrameLayout view1, List<VideoMethod.FlVideo> list, VideoClouds videoClouds)
        {
            var bjFl = new FrameLayout
            {
                Y = Application.GetRealHeight(24),
@@ -168,6 +170,11 @@
                Width = Application.GetRealWidth(327),
            };
            bjFl.AddChidren(vv);
            if (list.Count > 0)
            {
                //门禁二维码固定有的,虚拟一个出来
                list.Add(new VideoMethod.FlVideo { aliasName = "门禁二维码", devType = "10" });
            }
            //数组个数
            //int value = 15;
            //先计算数据所需要的很高度;
@@ -188,17 +195,16 @@
            };
            vv.AddChidren(fL);
            int line = 0;
            for (int i = 1, j = 0; i <= list.Count; i++, j++)
            {
                var video = list[i - 1];
                var fLayout = new FrameLayout
                {
                    Width = Application.GetRealWidth(50),
                    Height = Application.GetRealWidth(48),
                    X = Application.GetRealWidth(31 + (58 + 50) * j),
                    Y = Application.GetRealHeight(20 + (48 + 24) * line),
                    BackgroundColor=0xff357657
                };
                fL.AddChidren(fLayout);
@@ -220,7 +226,7 @@
                    TextSize = TextSize.Text10,
                    TextColor = CSS.CSS_Color.TextualColor,
                    TextAlignment = TextAlignment.Center,
                    Text = video.DeviceName,
                    Text = video.aliasName,
                };
                fLayout.AddChidren(iconNameBtn);
@@ -236,13 +242,28 @@
                // GetIconAndText(i, deviceIconBtn, iconNameBtn);
                clickBtn.MouseUpEventHandler += (sender, e) =>
                {
                    var eSVideoInfo = clickBtn.Tag as ESVideoInfo;
                    if (string.IsNullOrEmpty(eSVideoInfo.uuid))
                    var flVideo = clickBtn.Tag as VideoMethod.FlVideo;
                    if (string.IsNullOrEmpty(flVideo.uuid))
                    {
                        new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.peizhicanshuyouyichang));
                    }
                    ESVideoInfo eSVideoInfo = new ESVideoInfo
                    {
                        ESVideoUUID = 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);
                    //    }
                    //});
                };
            }
@@ -403,6 +424,8 @@
            }
            return s;
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
@@ -19,7 +19,7 @@
            Loading loading = new Loading();
            frameLayout.AddChidren(loading);
            loading.Start();
            List<ESVideoInfo> listESVideoInfo = new List<ESVideoInfo>();
            List<VideoMethod.FlVideo> listESVideoInfo = new List<VideoMethod.FlVideo>();
            List<CallView> listCall = new List<CallView>();
            new System.Threading.Thread(() =>
            {
@@ -203,7 +203,12 @@
        }
        /// <summary>
        /// 随机密码6位
        /// </summary>
        /// <returns></returns>         public static string getCode()         {             Random rand = new Random();             string code = "";             for (int ctr = 0; ctr < 6; ctr++)             {                 code += rand.Next(10).ToString();             }             return code;         }
        /// <summary>         /// 获取当前时间戳         /// </summary>         /// <returns></returns>         public static string GetCurrentTimeStamp()         {             TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);             return Convert.ToInt64(ts.TotalSeconds).ToString();         }
        /// <summary>         /// 获取当前时间戳         /// </summary>         /// <returns></returns>         public static string GetTomorrowTimeStamp()         {             //当前时间的后一天             TimeSpan ts = DateTime.Now.AddDays(1) - new DateTime(1970, 1, 1, 0, 0, 0, 0);             return Convert.ToInt64(ts.TotalSeconds).ToString();         }
        [Serializable] 
        public class VideoClouds
        { 
@@ -296,6 +301,19 @@
           public List<Call> callList = new List<Call>();
        }
        [Serializable]
        public class FlVideo
        {
            /// <summary>
            /// 设备名称
            /// </summary>
            public string aliasName = string.Empty;
            /// <summary>
            /// 设备类型:(1室内机,2室外机,3围墙机,4管理机,5二次确认机)
            /// </summary>
            public string devType = string.Empty;
            public string uuid = string.Empty;
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs
@@ -6,7 +6,6 @@
using HDL_ON.UI.UI2.PersonalCenter.PirDevice;
using Newtonsoft.Json.Linq;
using Shared;
using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
namespace HDL_ON.UI.UI2.FuntionControlView.Video
{
@@ -39,9 +38,9 @@
        /// <summary>
        /// 获取门口机列表(1室内机,2室外机,3围墙机,4管理机,5二次确认机)
        /// </summary>
        public static List<ESVideoInfo> GetVideoInfoList(VideoClouds video)
        public static List<VideoMethod.FlVideo> GetVideoInfoList(VideoMethod.VideoClouds video)
        {
            List<ESVideoInfo> eSVideoInfosList = new List<ESVideoInfo>();
            List<VideoMethod.FlVideo> eSVideoInfosList = new List<VideoMethod.FlVideo>();
            var jobject = new JObject();
            jobject.Add("cmtID", video.flCmtId);
            jobject.Add("unitno", video.flBuildingId);
@@ -69,26 +68,83 @@
                }
                foreach (var videoInfo in list)
                {
                    ESVideoInfo eSVideoInfo = new ESVideoInfo();
                    eSVideoInfo.DeviceName = videoInfo["aliasName"];
                    VideoMethod.FlVideo flVideo = new VideoMethod.FlVideo();
                    flVideo.aliasName = videoInfo["aliasName"];
                    if (videoInfo["uuid"].Contains(","))
                    {
                        var uuid = videoInfo["uuid"].Split(',');
                        eSVideoInfo.ESVideoUUID = uuid[0];
                        flVideo.uuid = uuid[0];
                    }
                    else
                    {
                        eSVideoInfo.ESVideoUUID = videoInfo["uuid"];
                        flVideo.uuid = videoInfo["uuid"];
                    }
                    eSVideoInfo.uuid = videoInfo["uuid"];
                    eSVideoInfo.roomno = video.flRoomId;
                    eSVideoInfosList.Add(eSVideoInfo);
                    flVideo.devType = videoInfo["devType"];
                    //eSVideoInfo.roomno = video.flRoomId;
                    eSVideoInfosList.Add(flVideo);
                }
            }
            catch { }
            return eSVideoInfosList;
        }
        /// <summary>
        /// 上报动态开锁密码
        /// </summary>
        public static void GetQRcode(FrameLayout frame, VideoMethod.VideoClouds video,Action<bool,string>action)
        {
            ///标记是否成功
            bool if_bool = false;
            //临时密码
            string pwd = VideoMethod.getCode();
            var jobject = new JObject();             jobject.Add("communityID", video.flCmtId);//社区ID
            jobject.Add("fromTime", VideoMethod.GetCurrentTimeStamp());//开始时间
            jobject.Add("validTime", VideoMethod.GetTomorrowTimeStamp());//有效时间
            jobject.Add("unitno", video.flBuildingId);//单元号
            jobject.Add("roomno", video.flRoomId);//房间号
            jobject.Add("code", pwd);             jobject.Add("userKey", video.flSecretKey);             jobject.Add("timestamp", VideoMethod.GetCurrentTimeStamp());             jobject.Add("secretKey", video.flSecretKey);             jobject.Add("method", "setdynamicpwd");             jobject.Add("numTimes", "5");
            //加载log
            Loading loading = new Loading();
            frame.AddChidren(loading);
            loading.Start();
            new System.Threading.Thread(() =>
            {
                try
                {
                    var str = HttpWebRequest(NewAPI.API_POST_FL_QRcode, jobject.ToString(), "POST");
                    if (!string.IsNullOrEmpty(str))
                    {
                        try
                        {
                            var json = JObject.Parse(str);
                            if (json != null)
                            {
                                var stateCode = json["resCode"].ToString();
                                if (stateCode != "0")
                                {
                                    if_bool = true;
                                }
                            }
                        }
                        catch {
                        }
                    }
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        action(if_bool, pwd);
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        ///  请求服务器的方法(支持请求方式为POST/GET)
        /// </summary>
        /// <param name="getUrl">请求的地址</param>
HDL_ON/UI/UI2/FuntionControlView/Video/View/ShowDialog.cs
@@ -87,5 +87,95 @@
        }
        /// <summary>
        /// 生成二维码
        /// </summary>
        /// <param name="str1">标题</param>
        public void QRcode(string str1)
        {
            Dialog dialog = new Dialog()
            {
                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
            };
            FrameLayout frameLayout = new FrameLayout { };
            dialog.AddChidren(frameLayout);
            FrameLayout whiteView = new FrameLayout()
            {
                X = Application.GetRealWidth(56),
                Y = Application.GetRealHeight(199),
                Width = Application.GetRealWidth(282),
                Height = Application.GetRealHeight(316),
                BackgroundColor = MusicColor.WhiteColor,
                Radius = (uint)Application.GetRealHeight(16),
            };
            frameLayout.AddChidren(whiteView);
            //临时密码
            Button btnTitle = new Button()
            {
                Y = Application.GetRealHeight(32),
                Height = Application.GetRealHeight(22),
                TextColor = MusicColor.TextColor,
                TextSize = TextSize.Text16,
                TextAlignment = TextAlignment.Center,
                IsBold = true,
                Text = "临时密码",
            };
            whiteView.AddChidren(btnTitle);
            //密码
            Button btnpaw = new Button()
            {
                X=Application.GetRealWidth(100),
                Y = Application.GetRealHeight(62),
                Height = Application.GetRealHeight(32),
                Width = Application.GetRealWidth(82),
                TextColor = MusicColor.SelectedColor,
                TextSize =24,
                TextAlignment = TextAlignment.Center,
                IsBold = true,
                Text = str1,
            };
            whiteView.AddChidren(btnpaw);
            Button iconBtn = new Button
            {
                X = Application.GetRealWidth(194),
                Y = Application.GetRealHeight(68),
                Width = Application.GetRealWidth(20),
                Height = Application.GetRealWidth(20),
                UnSelectedImagePath = "VideoIcon/hangup.png",
            };
            whiteView.AddChidren(iconBtn);
            //二维码
            int codeWidth = Application.GetRealWidth(142);
            ImageView codeImage = new ImageView()
            {
                X = Application.GetRealWidth(70),
                Y = Application.GetRealHeight(142),
                Height = codeWidth,
                Width = codeWidth,
                ImageBytes = Scan.BytesFromText(str1, codeWidth, codeWidth),
            };
            whiteView.AddChidren(codeImage);
            dialog.Show();
            iconBtn.MouseUpEventHandler += (sender, e) =>
            {
                iconBtn.IsSelected = !iconBtn.IsSelected;
                if (iconBtn.IsSelected)
                {
                    btnpaw.Text = "******";
                }
                else
                {
                    btnpaw.Text = str1;
                }
            };
            frameLayout.MouseUpEventHandler += (sender, e) =>
            {
                dialog.Close();
            };
        }
    }
}