From d6c09ce6fdb01350db2336d287bbd3c123289a30 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期日, 09 十月 2022 16:52:08 +0800 Subject: [PATCH] 图片key加密问题修复,百叶帘 --- HDL-ON_iOS/ViewControllerBase.cs | 84 ++++++++++++--------- HDL-ON_Android/Assets/Language.ini | 2 HDL_ON/DAL/Server/HttpUtil.cs | 4 HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs | 3 HDL_ON/Common/R.cs | 4 + HDL_ON/UI/UI2/FuntionControlView/Curtain/VenetianBlindsPage.cs | 74 ++++++++++------- HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs | 4 HDL_ON/Common/ImageUtlis.cs | 2 SiriIntents/Server/HttpUtil.cs | 4 9 files changed, 107 insertions(+), 74 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index bd75aa9..8d174a9 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -557,6 +557,7 @@ + 2532=Visitor Invitation Record 2533=Visitor management 2534=Visitor Invitation @@ -1772,6 +1773,7 @@ 567=鐢垫睜SOC: --% 568=杩愯鏁伴噺/鎬绘暟閲�: --/-- 569=浜哄眳鐜 +570=瀹ゅ:{0}掳/瀹ゅ唴:{1}掳 diff --git a/HDL-ON_iOS/ViewControllerBase.cs b/HDL-ON_iOS/ViewControllerBase.cs index 053c35c..36d7bdd 100644 --- a/HDL-ON_iOS/ViewControllerBase.cs +++ b/HDL-ON_iOS/ViewControllerBase.cs @@ -2,7 +2,7 @@ using System.Drawing; using Foundation; using UIKit; - +using WebKit; namespace HDL_ON_iOS { public class ViewControllerBase : Shared.BaseViewController @@ -31,50 +31,54 @@ // } //} - public override void ViewDidLoad () + public override void ViewDidLoad() { - base.ViewDidLoad (); + base.ViewDidLoad(); //璁剧疆閿洏浜嬩欢澶勭悊绋嬪簭 - RegisterForKeyboardNotifications (); + RegisterForKeyboardNotifications(); } - protected virtual void RegisterForKeyboardNotifications () + protected virtual void RegisterForKeyboardNotifications() { _keyboardObserverWillShow = NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.WillShowNotification, KeyboardWillShowNotification); _keyboardObserverWillHide = NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.WillHideNotification, KeyboardWillHideNotification); } - protected virtual void UnregisterKeyboardNotifications () + protected virtual void UnregisterKeyboardNotifications() { - NSNotificationCenter.DefaultCenter.RemoveObserver (_keyboardObserverWillShow); - NSNotificationCenter.DefaultCenter.RemoveObserver (_keyboardObserverWillHide); + NSNotificationCenter.DefaultCenter.RemoveObserver(_keyboardObserverWillShow); + NSNotificationCenter.DefaultCenter.RemoveObserver(_keyboardObserverWillHide); } - protected virtual UIView KeyboardGetActiveView () + protected virtual UIView KeyboardGetActiveView() { - return this.View.FindFirstResponder (); + return this.View.FindFirstResponder(); } - protected virtual void KeyboardWillShowNotification (NSNotification notification) + protected virtual void KeyboardWillShowNotification(NSNotification notification) { - UIView activeView = KeyboardGetActiveView (); + UIView activeView = KeyboardGetActiveView(); if (activeView == null) return; - UIView scrollView = activeView.FindSuperviewOfType_Self (this.View, typeof (UIView)) as UIView; + string sss = activeView.ToString(); + if (sss.StartsWith("<WKContentView")) + return; + UIView scrollView = activeView.FindSuperviewOfType_Self(this.View, typeof(UIView)) as UIView; if (scrollView == null) return; - CoreGraphics.CGRect keyboardBounds = UIKeyboard.BoundsFromNotification (notification); + CoreGraphics.CGRect keyboardBounds = UIKeyboard.BoundsFromNotification(notification); //UIEdgeInsets contentInsets = new UIEdgeInsets (0.0f, 0.0f, keyboardBounds.Size.Height, 0.0f); //scrollView.ContentInset = contentInsets; //scrollView.ScrollIndicatorInsets = contentInsets; - CoreGraphics.CGRect viewRectAboveKeyboard = new CoreGraphics.CGRect (this.View.Frame.Location, - new CoreGraphics.CGSize (this.View.Frame.Width, this.View.Frame.Size.Height - keyboardBounds.Size.Height)); - CoreGraphics.CGRect activeFieldAbsoluteFrame = activeView.Superview.ConvertRectToView (activeView.Frame, this.View); - if (!viewRectAboveKeyboard.Contains (activeFieldAbsoluteFrame)) { + CoreGraphics.CGRect viewRectAboveKeyboard = new CoreGraphics.CGRect(this.View.Frame.Location, + new CoreGraphics.CGSize(this.View.Frame.Width, this.View.Frame.Size.Height - keyboardBounds.Size.Height)); + CoreGraphics.CGRect activeFieldAbsoluteFrame = activeView.Superview.ConvertRectToView(activeView.Frame, this.View); + if (!viewRectAboveKeyboard.Contains(activeFieldAbsoluteFrame)) + { //PointF scrollPoint = new PointF (0.0f, // (float)(activeFieldAbsoluteFrame.Location.Y + activeFieldAbsoluteFrame.Height // + scrollView.ContentOffset.Y - viewRectAboveKeyboard.Height)); // scrollView.SetContentOffset (scrollPoint, true); - scrollView.Bounds = new CoreGraphics.CGRect (0.0f, + scrollView.Bounds = new CoreGraphics.CGRect(0.0f, (float)(activeFieldAbsoluteFrame.Location.Y + activeFieldAbsoluteFrame.Height + scrollView.Frame.Y - viewRectAboveKeyboard.Height) , this.View.Frame.Width, this.View.Frame.Height); @@ -82,55 +86,63 @@ //if (this.View.Frame.Height - activeView.Frame.Bottom < keyboardBounds.Size.Height) // scrollView.Bounds = new CoreGraphics.CGRect (0.0f, this.View.Frame.Height - activeView.Frame.Height - keyboardBounds.Size.Height, this.View.Frame.Width, this.View.Frame.Height); } - protected virtual void KeyboardWillHideNotification (NSNotification notification) + protected virtual void KeyboardWillHideNotification(NSNotification notification) { - UIView activeView = KeyboardGetActiveView (); + UIView activeView = KeyboardGetActiveView(); if (activeView == null) return; - UIView scrollView = activeView.FindSuperviewOfType_Self (this.View, typeof (UIView)) as UIView; + string sss = activeView.ToString(); + if (sss.StartsWith("<WKContentView")) + return; + UIView scrollView = activeView.FindSuperviewOfType_Self(this.View, typeof(UIView)) as UIView; if (scrollView == null) return; - double animationDuration = UIKeyboard.AnimationDurationFromNotification (notification); + double animationDuration = UIKeyboard.AnimationDurationFromNotification(notification); //UIEdgeInsets contentInsets = new UIEdgeInsets (0.0f, 0.0f, 0.0f, 0.0f); //UIView.Animate (animationDuration, delegate { // scrollView.ContentInset = contentInsets; // scrollView.ScrollIndicatorInsets = contentInsets; //}); - scrollView.Bounds = new CoreGraphics.CGRect (0.0f, 0.0f, this.View.Frame.Width, this.View.Frame.Height); - + scrollView.Bounds = new CoreGraphics.CGRect(0.0f, 0.0f, this.View.Frame.Width, this.View.Frame.Height); + } } public static class ViewExtensions { - public static UIView FindFirstResponder (this UIView view) + public static UIView FindFirstResponder(this UIView view) { - if (view.IsFirstResponder) { + if (view.IsFirstResponder) + { return view; } - foreach (UIView subView in view.Subviews) { - var firstResponder = subView.FindFirstResponder (); + foreach (UIView subView in view.Subviews) + { + var firstResponder = subView.FindFirstResponder(); if (firstResponder != null) return firstResponder; } return null; } - public static UIView FindSuperviewOfType (this UIView view, UIView stopAt, Type type) + public static UIView FindSuperviewOfType(this UIView view, UIView stopAt, Type type) { - if (view.Superview != null) { - if (type.IsAssignableFrom (view.Superview.GetType ())) { + if (view.Superview != null) + { + if (type.IsAssignableFrom(view.Superview.GetType())) + { return view.Superview; } if (view.Superview != stopAt) - return view.Superview.FindSuperviewOfType (stopAt, type); + return view.Superview.FindSuperviewOfType(stopAt, type); } return null; } - public static UIView FindSuperviewOfType_Self (this UIView view, UIView stopAt, Type type) + public static UIView FindSuperviewOfType_Self(this UIView view, UIView stopAt, Type type) { - if (view.Superview != null) { - return view.Superview.FindSuperviewOfType_Self (stopAt, type); + if (view.Superview != null) + { + return view.Superview.FindSuperviewOfType_Self(stopAt, type); } return view; } diff --git a/HDL_ON/Common/ImageUtlis.cs b/HDL_ON/Common/ImageUtlis.cs index 54cdb55..34c5bf5 100644 --- a/HDL_ON/Common/ImageUtlis.cs +++ b/HDL_ON/Common/ImageUtlis.cs @@ -347,7 +347,7 @@ if (imageUrl.StartsWith("http")) { - imageKey = Encrypt(imageKey); + imageKey = Encrypt(imageKey).Replace("/","123"); } //1.鏈湴榛樿鍥惧簱鍥剧墖锛岀洿鎺ュ姞杞芥湰鍦� diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index bd61d6c..91f1b18 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -5,6 +5,10 @@ public static class StringId { /// <summary> + /// 瀹ゅ:27掳/瀹ゅ唴:27掳 + /// </summary> + public const int IndoorTempOutdoorTemp = 570; + /// <summary> /// 绉戞妧 /// </summary> public const int Acst = 569; diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 4a01eef..1c3250c 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -18,8 +18,8 @@ /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm + public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm /// <summary> /// RegionMark /// </summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/VenetianBlindsPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/VenetianBlindsPage.cs index c60430f..d11fce7 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/VenetianBlindsPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/VenetianBlindsPage.cs @@ -143,17 +143,19 @@ btnProgress = new Button() { + X = Application.GetRealWidth(80), Y = Application.GetRealHeight(80), + Width = Application.GetRealWidth(170), Height = Application.GetRealHeight(50), TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.PromptingColor1, Text = curtainTemp.GetPercent(function).ToString() + "%", }; - controlView.AddChidren(btnProgress); + //controlView.AddChidren(btnProgress); curtainSeekBar = new CurtainRollSeekBarOn() { - Gravity = Gravity.CenterHorizontal, + X = Application.GetRealWidth(40), Y = Application.GetRealHeight(130), Width = Application.GetRealWidth(170), Height = Application.GetRealWidth(210), @@ -169,10 +171,10 @@ int angleValut = Convert.ToInt32(function.GetAttrState("angle")) - 90; var angleView = new FrameLayout() { - Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(300),//414,璁捐鏁版嵁 - Width = Application.GetRealWidth(250), - Height = Application.GetRealWidth(30), + X = Application.GetRealWidth(240), + Y = Application.GetRealHeight(145), + Width = Application.GetRealWidth(40), + Height = Application.GetRealWidth(220), BackgroundColor = 0x00ff0000 }; controlView.AddChidren(angleView); @@ -182,10 +184,10 @@ { var btn = new Button() { - X = Application.GetRealWidth(12 * i + 4), - Y = Application.GetRealHeight(5), - Width = Application.GetRealWidth(4), - Height = Application.GetRealHeight(20), + X = Application.GetRealWidth(5), + Y = Application.GetRealHeight(8 * i + 4), + Width = Application.GetRealWidth(25), + Height = Application.GetRealHeight(3), BackgroundColor = 0xFFDFE1E6, }; btn.SetRotation(angleValut); @@ -195,46 +197,56 @@ var btnAngle = new Button() { - TextAlignment = TextAlignment.CenterRight, + Y = Application.GetRealHeight(8 * 17 + 14), + Height = Application.GetRealHeight(20), + TextAlignment = TextAlignment.Center, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextColor = CSS_Color.PromptingColor1, Text = function.GetAttrState("angle") + "掳" }; angleView.AddChidren(btnAngle); - var angleBar = new DiyImageSeekBar() - { - Width = Application.GetRealWidth(220), - Height = Application.GetRealHeight(30), - SeekBarViewHeight = Application.GetRealHeight(20), - SeekBarBackgroundColor = 0x00000000, - ThumbImagePath = "Public/ThumbImage2.png", - ThumbImageHeight = Application.GetRealHeight(40), - ProgressBarColor = 0x00000000, - ProgressTextColor = 0x00000000, - ProgressTextSize = 0, - MaxValue = 180, - Progress = 90, - ProgressChangeDelayTime = 0 + var angleBar = new Button() { + Height = Application.GetRealHeight(8 * 18 + 14), }; angleView.AddChidren(angleBar); - angleBar.OnProgressChangedEvent = (sender, e) => + float angle = 0; + angleBar.MouseMoveEventHandler = (sender, e) => { - float angle = (e - 90); - btnAngle.Text = e + "掳"; + int data = angleBar.Height / 180; + int data1 = Convert.ToInt32(e.Y / data); + angle = (90 - data1); + + Console.WriteLine($"angle:: {angle}"); + if (angle > 90) + { + angle = 90; + } + else if (angle < -90) + { + angle = -90; + } + btnAngle.Text = angle + "掳"; foreach (var btn in buttons) { btn.SetRotation(angle); } - + if (angle == 90 || angle == -90) + { + curtainSeekBar.SetBlindsType(false); + } + else + { + curtainSeekBar.SetBlindsType(true); + } }; - angleBar.OnStopTrackingTouchEvent = (sende, e) => + angleBar.MouseUpEventHandler = (sende, e) => { function.refreshTime = DateTime.Now; new System.Threading.Thread(() => { Dictionary<string, string> dic = new Dictionary<string, string>(); - dic.Add("angle", e.ToString()); + dic.Add("angle", angle.ToString()); Control.Ins.SendWriteCommand(function, dic); }) { IsBackground = true }.Start(); diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs index 04f939c..431655c 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs @@ -226,11 +226,12 @@ Y = btnTemp.Bottom+ Application.GetRealWidth(10), Width = Application.GetRealWidth(100), Height = Application.GetRealHeight(20), - Text = Language.StringByID(StringId.IndoorTemp) + "20掳C", + Text = Language.StringByID(StringId.IndoorTempOutdoorTemp).Replace("{1}",function.GetAttrState(FunctionAttributeKey.IndoorTemp)).Replace("{0}",MainPage.cityInfo.temperature), TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, }; controlView.AddChidren(btnIndoorTemp); + btnMinus = new Button() { diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs index 14d031a..6835fc1 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs @@ -21,7 +21,9 @@ } var outinTemp = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); bodyView.btnTemp.Text = outinTemp.ToString(); - bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "掳C"; + //bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "掳C"; + bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTempOutdoorTemp).Replace("{1}", Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))).ToString()).Replace("{0}", MainPage.cityInfo.temperature); + bodyView.btnMode.SelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode)); bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode), false); bodyView.arcBar.Progress = outinTemp; diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs index 56a78a0..f61de04 100644 --- a/SiriIntents/Server/HttpUtil.cs +++ b/SiriIntents/Server/HttpUtil.cs @@ -16,8 +16,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm + public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm /// <summary> /// RegionMark /// </summary> -- Gitblit v1.8.0