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_Android/VideoActivity.cs | 26 ++ HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs | 83 ++++--- HDL-ON_Android/Assets/Language.ini | 2 HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs | 61 ++++- HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs | 5 HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs | 167 ++++++++++++--- HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Video/View/ShowDialog.cs | 5 HDL-ON_iOS/Resources/Language.ini | 2 HDL_ON/DAL/Server/HttpUtil.cs | 4 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs | 168 ---------------- HDL_ON/Common/R.cs | 2 HDL_ON/DAL/Server/HttpServerRequest.cs | 5 HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs | 14 + .vs/HDL_APP_Project/xs/UserPrefs.xml | 41 +--- 15 files changed, 287 insertions(+), 300 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index ab2b70a..2d58337 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,50 +1,31 @@ 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> - <MonoDevelop.Ide.Workbench ActiveDocument="../../Application.cs"> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs"> <Files> - <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" /> + <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs" Line="19" Column="106" /> + <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" Line="28" Column="58" /> + <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs" Line="80" Column="25" /> </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 name="VideoSend.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 name="HDL-ON_Android" expanded="True"> + <Node name="Assets" expanded="True"> + <Node name="Phone" expanded="True"> + <Node name="VideoIcon" expanded="True" /> + </Node> + </Node> </Node> </Node> </State> diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 875ded3..604e885 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -1279,6 +1279,8 @@ 4010=鏈帴鍚� 4011=宸叉嫆缁� 4012=閰嶇疆鍙傛暟鏈夊紓甯�! +4013=闂ㄧ浜岀淮鐮� +4014=涓存椂瀵嗙爜 5000=闊充箰 diff --git a/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs b/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs index 983b35a..e67d8e5 100644 --- a/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs +++ b/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs @@ -38,7 +38,7 @@ private TextView unlockText; // 鏇存柊绾跨▼ - private Thread thread = null; + public static Thread thread = null; public MonitorFragment(VideoPhone phone) { diff --git a/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs b/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs index b92134a..3d69f40 100644 --- a/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs +++ b/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs @@ -113,6 +113,7 @@ } } + public static Thread unlockThread = null;//鍏紑鍑烘潵锛屽叧闂璦ctivity鐨勬椂鍊欒缁撴潫杩欎釜绾跨▼锛屼笉鐒朵細寮曡捣宕╂簝 /// <summary> /// 鏇存柊寮�閿佹寜閽姸鎬�,寮�閿佹垚鍔燂紝15绉掑唴涓嶇粰鍐嶇偣鍑绘寜閽� /// </summary> @@ -124,18 +125,28 @@ unlockImg.Enabled = false; - new Thread(() => - { - Thread.Sleep(15 * 1000); - Activity.RunOnUiThread(() => - { - try { - if (unlockImg != null) - unlockImg.Enabled = true; - } - catch { } - }); - }).Start(); + unlockThread = new Thread(() => + { + try + { + Thread.Sleep(15 * 1000); + + Activity.RunOnUiThread(() => + { + try { + if (unlockImg != null) + unlockImg.Enabled = true; + } + catch { } + }); + + } + catch { } + });//.Start(); + + unlockThread.Start(); + + PostUnlock(); } catch { } } @@ -221,7 +232,7 @@ switch (event1) { - case "EVT_RECV_CUSTOM_DATA": + case "EVT_RECV_CUSTOM_DATA":// 寮�閿佹垚鍔� string data = tp.GetString("data"); UpdataUnlockState(); break; @@ -320,7 +331,7 @@ Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("callId", VideoActivity.CallId); d.Add("images", images); - d.Add("imagesName", img_name); + d.Add("imagesName", "_Android.jpg"); string jsonString = HttpUtil.GetSignRequestJson(d); string url = "/home-wisdom/app/fl/vi/screenshot"; @@ -403,5 +414,27 @@ }).Start(); } + + /// <summary> + /// post 寮�閿佽褰� + /// </summary> + private void PostUnlock() + { + new Thread(() => + { + try + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("callId", VideoActivity.CallId);//鍛煎彨璁板綍id int + string jsonString = HttpUtil.GetSignRequestJson(d); + + string url = "/home-wisdom/app/fl/vi/unlock"; + ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); + Log.Info("FengLinVideo", "Post Reject Response code=" + response.Code); + } + catch { } + + }).Start(); + } } } diff --git a/HDL-ON_Android/VideoActivity.cs b/HDL-ON_Android/VideoActivity.cs index 1a9cf00..5229a2a 100644 --- a/HDL-ON_Android/VideoActivity.cs +++ b/HDL-ON_Android/VideoActivity.cs @@ -43,7 +43,7 @@ public static int Tpye = 0;//绫诲瀷锛�0 鐩戞帶锛�1鍙嶅懠 public static string UUId; - public static int CallId;//callId 鍛煎彨璁板綍id + public static string CallId;//callId 鍛煎彨璁板綍id public static string CmtID;//cmtID 涓版灄绀惧尯鍙� public static string Roomno;//roomno 涓版灄鎴块棿鍙� public static string Unitno;//unitno 涓版灄妤兼爧鍙� string @@ -60,7 +60,7 @@ ESVideoUUID = Intent.GetStringExtra("ESVideoUUID");//瀹ゅ鏈篣UID锛屼緥:JJY000007FSEYX DeviceName = Intent.GetStringExtra("DeviceName");//瀹ゅ鏈虹殑鍚嶇О锛屼緥锛屽澶栨満 UUId = Intent.GetStringExtra("uuid");// - CallId = Intent.GetIntExtra("callId", 0); + CallId = Intent.GetStringExtra("callId"); CmtID = Intent.GetStringExtra("cmtID"); Roomno = Intent.GetStringExtra("roomno"); Unitno = Intent.GetStringExtra("unitno"); @@ -215,6 +215,28 @@ mPhone = null; //mPhone.OnActivityDestroy(); } + + if (ReverseCallFragment.unlockThread != null) + { + try + { + // + ReverseCallFragment.unlockThread.Interrupt(); + } + catch { } + ReverseCallFragment.unlockThread = null; + } + + if (MonitorFragment.thread != null) + { + try + { + // + MonitorFragment.thread.Interrupt(); + } + catch { } + MonitorFragment.thread = null; + } } public override void OnBackPressed() diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index b3e33bc..b0b9d93 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -1279,6 +1279,8 @@ 4010=鏈帴鍚� 4011=宸叉嫆缁� 4012=閰嶇疆鍙傛暟鏈夊紓甯�! +4013=闂ㄧ浜岀淮鐮� +4014=涓存椂瀵嗙爜 5000=闊充箰 5001=缁勫悎 diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 0b4a240..d87a2dd 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -755,6 +755,8 @@ public const int weijieting = 4010; public const int yijujue = 4011; public const int peizhicanshuyouyichang = 4012; + public const int menjinerweima = 4013; + public const int linshimima = 4014; public const int a31Music = 5000; public const int merge = 5001; diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 5499083..e08a283 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -492,6 +492,11 @@ Address = mHome.homeAddress, isAllowCreateScene = mHome.isAllowCreateScene, }; +#if DEBUG + + UserInfo.Current.regionList.Add(home); + continue; +#endif if (home.isBindGateway) { UserInfo.Current.regionList.Add(home); diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 7f7b499..b2743d6 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -17,7 +17,7 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + // public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; /// <summary> /// RegionMark @@ -157,7 +157,7 @@ ////**************娴嬭瘯************** - //string requestFullUrl = GlobalRequestHttpsHost + apiPath; + // string requestFullUrl = GlobalRequestHttpsHost + apiPath; ////**************娴嬭瘯************** RestClient client = new RestClient(requestFullUrl); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs index 1c50a75..04b6f87 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs @@ -261,9 +261,10 @@ EventHandler<MouseEventArgs> eventHandler = (sender, e) => { HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod videoMethod = new UI2.FuntionControlView.Video.VideoMethod(); - videoMethod.getVideo((device)=> { + videoMethod.getVideo((device) => + { videoMethod.MianView(this, device); - }, this,true); + }, this, true); return; var page = new BrandListPage();// AddThirdPartyBrandListpage(); // BrandListPage(); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs index 981952e..a4884ea 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs @@ -148,174 +148,6 @@ #endregion ///鍒濆鍖栫晫闈� UIView(vv); - - } - - void GoToShowSortSelection(List<string> dataList) - { - Dictionary<string, List<string>> dict = new Dictionary<string, List<string>>(); - - foreach (var data in dataList) - { - //鎻愬彇瀛楃涓茬涓�浣� - //string s = data.Substring(0, 1); - var key = GetCharSpellCode(data); - - if (dict.ContainsKey(key)) - { - var value = dict[key]; - if (value == null) - { - value = new List<string>(); - } - value.Add(data); - - - } - else - { - var value = new List<string>(); - value.Add(data); - dict.Add(key, value); - } - - - } - - - Application.RunOnMainThread(() => - { - JLCountrycode.CountryCodeView.Current.ShowSortSelection("閫夋嫨绾㈠鍝佺墝", dict, (countryName) => - { - //Console.WriteLine("countryName: " + countryName); - Utlis.ShowTip("閫変腑浜�:" + countryName); - - - }); - }); - } - - /// <summary> - /// 鑾峰彇姹夊瓧棣栧瓧姣� - /// </summary> - /// <param name="textValue"></param> - /// <returns></returns> - private string GetCharSpellCode(string textValue) - { - long iCnChar; - - byte[] ZW = Encoding.GetEncoding("gb2312").GetBytes(textValue); - - //濡傛灉鏄瓧姣嶏紝鍒欑洿鎺ヨ繑鍥� - if (ZW.Length == 1) - { - return textValue.ToUpper(); - } - else - { - // get the array of byte from the single char - int i1 = (short)(ZW[0]); - int i2 = (short)(ZW[1]); - iCnChar = i1 * 256 + i2; - } - - - - // iCnChar match the constant - if ((iCnChar >= 45217) && (iCnChar <= 45252)) - { - return "A"; - } - else if ((iCnChar >= 45253) && (iCnChar <= 45760)) - { - return "B"; - } - else if ((iCnChar >= 45761) && (iCnChar <= 46317)) - { - return "C"; - } - else if ((iCnChar >= 46318) && (iCnChar <= 46825)) - { - return "D"; - } - else if ((iCnChar >= 46826) && (iCnChar <= 47009)) - { - return "E"; - } - else if ((iCnChar >= 47010) && (iCnChar <= 47296)) - { - return "F"; - } - else if ((iCnChar >= 47297) && (iCnChar <= 47613)) - { - return "G"; - } - else if ((iCnChar >= 47614) && (iCnChar <= 48118)) - { - return "H"; - } - else if ((iCnChar >= 48119) && (iCnChar <= 49061)) - { - return "J"; - } - else if ((iCnChar >= 49062) && (iCnChar <= 49323)) - { - return "K"; - } - else if ((iCnChar >= 49324) && (iCnChar <= 49895)) - { - return "L"; - } - else if ((iCnChar >= 49896) && (iCnChar <= 50370)) - { - return "M"; - } - - else if ((iCnChar >= 50371) && (iCnChar <= 50613)) - { - return "N"; - } - else if ((iCnChar >= 50614) && (iCnChar <= 50621)) - { - return "O"; - } - else if ((iCnChar >= 50622) && (iCnChar <= 50905)) - { - return "P"; - } - else if ((iCnChar >= 50906) && (iCnChar <= 51386)) - { - return "Q"; - } - else if ((iCnChar >= 51387) && (iCnChar <= 51445)) - { - return "R"; - } - else if ((iCnChar >= 51446) && (iCnChar <= 52217)) - { - return "S"; - } - else if ((iCnChar >= 52218) && (iCnChar <= 52697)) - { - return "T"; - } - else if ((iCnChar >= 52698) && (iCnChar <= 52979)) - { - return "W"; - } - else if ((iCnChar >= 52980) && (iCnChar <= 53640)) - { - return "X"; - } - else if ((iCnChar >= 53689) && (iCnChar <= 54480)) - { - return "Y"; - } - else if ((iCnChar >= 54481) && (iCnChar <= 55289)) - { - return "Z"; - } - else return (""); } /// <summary> 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; + } + } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs index 39d18e8..fea81eb 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs @@ -207,13 +207,19 @@ /// 闅忔満瀵嗙爜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(); } + /// <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(); System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯 + + return ((long)(DateTime.Now - startTime).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(); + System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯 + return ((long)(DateTime.Now.AddDays(1) - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟 + } [Serializable] public class VideoClouds - { + { /// <summary> - /// 涓版灄缁戝畾id锛坒lBindId锛� + /// 涓版灄缁戝畾id锛坒lBindId锛�(userKey) /// </summary> public string id = string.Empty; /// <summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs index 9539a84..6ebce59 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs @@ -31,7 +31,7 @@ /// <returns></returns> public static ResponsePackNew GetCall(string flBindId) { - var jObject = new JObject { { "homeId", PirSend.HomeId }, { "flBindId", flBindId }, { "pageSize", int.MaxValue } }; + var jObject = new JObject { { "homeId", PirSend.HomeId }, { "flBindId", flBindId }, { "pageSize", 100 } }; var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_FL_GetCallList); return responsePackNew; } @@ -61,36 +61,16 @@ { return eSVideoInfosList; } - var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(json["list"].ToString()); - if (list.Count == 0) - { - return eSVideoInfosList; - } - foreach (var videoInfo in list) - { - VideoMethod.FlVideo flVideo = new VideoMethod.FlVideo(); - flVideo.aliasName = videoInfo["aliasName"]; - if (videoInfo["uuid"].Contains(",")) - { - var uuid = videoInfo["uuid"].Split(','); - flVideo.uuid = uuid[0]; - } - else - { - flVideo.uuid = videoInfo["uuid"]; - } - flVideo.devType = videoInfo["devType"]; - //eSVideoInfo.roomno = video.flRoomId; - eSVideoInfosList.Add(flVideo); - } + eSVideoInfosList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<VideoMethod.FlVideo>>(json["list"].ToString()); + } catch { } return eSVideoInfosList; } /// <summary> - /// 涓婃姤鍔ㄦ�佸紑閿佸瘑鐮� + /// 涓婃姤鍔ㄦ�佸紑閿佸瘑鐮�(娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥) /// </summary> - public static void GetQRcode(FrameLayout frame, VideoMethod.VideoClouds video,Action<bool,string>action) + public static void GetQRcode(FrameLayout frame, VideoMethod.VideoClouds video, Action<bool, string> action) { ///鏍囪鏄惁鎴愬姛 bool if_bool = false; @@ -101,7 +81,7 @@ 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"); + jobject.Add("code", pwd); jobject.Add("userKey", video.id); 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); @@ -113,20 +93,14 @@ 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 json = JObject.Parse(str); - if (json != null) + var stateCode = json["status"].ToString(); + if (stateCode == "0") { - var stateCode = json["resCode"].ToString(); - if (stateCode != "0") - { - if_bool = true; - } + if_bool = true; } - } - catch { - } } } @@ -137,6 +111,33 @@ { loading.Hide(); action(if_bool, pwd); + + }); + } + + }) + { IsBackground = true }.Start(); + } + /// <summary> + /// 涓嬭浇鍥剧墖 + /// </summary> + public static void GetIcon(FrameLayout frame,string url) + { + Loading loading = new Loading(); + frame.AddChidren(loading); + loading.Start(); + new System.Threading.Thread(() => + { + try + { + var responsePackNew = RequestServerhomeId(null, url); + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + loading.Hide(); }); } @@ -197,5 +198,13 @@ return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout); } + + + } + class FlResponsePackNew + {// + public string status = string.Empty; + public string desc = string.Empty; + } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/View/ShowDialog.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/View/ShowDialog.cs index 6e15f59..42bcf97 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/View/ShowDialog.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/View/ShowDialog.cs @@ -119,7 +119,7 @@ TextSize = TextSize.Text16, TextAlignment = TextAlignment.Center, IsBold = true, - Text = "涓存椂瀵嗙爜", + TextID=StringId.linshimima, }; whiteView.AddChidren(btnTitle); //瀵嗙爜 @@ -142,7 +142,8 @@ Y = Application.GetRealHeight(68), Width = Application.GetRealWidth(20), Height = Application.GetRealWidth(20), - UnSelectedImagePath = "VideoIcon/hangup.png", + UnSelectedImagePath = "LoginIcon/ShowPasswordIcon.png", + SelectedImagePath = "LoginIcon/HidePasswordIcon.png", }; whiteView.AddChidren(iconBtn); //浜岀淮鐮� -- Gitblit v1.8.0