From c207cd8df8a432d044bbc9e0da7f05d200769ef1 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 02 九月 2022 16:41:45 +0800 Subject: [PATCH] 合并光伏储能代码 --- HDL-ON_Android/Resources/Resource.designer.cs | 2 HDL_ON/UI/UI2/UserPage.cs | 5 -- HDL_ON/Entity/Function/InverterInfo.cs | 55 +++++++++++++++++++++++++++ HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 12 ++++++ HDL_ON/UI/UI2/H5Page.cs | 12 +++--- 5 files changed, 74 insertions(+), 12 deletions(-) diff --git a/HDL-ON_Android/Resources/Resource.designer.cs b/HDL-ON_Android/Resources/Resource.designer.cs index 2b7d618..11a6b26 100644 --- a/HDL-ON_Android/Resources/Resource.designer.cs +++ b/HDL-ON_Android/Resources/Resource.designer.cs @@ -14,7 +14,7 @@ { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.8.165")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] public partial class Resource { diff --git a/HDL_ON/Entity/Function/InverterInfo.cs b/HDL_ON/Entity/Function/InverterInfo.cs index 5e73d1f..fc548f2 100644 --- a/HDL_ON/Entity/Function/InverterInfo.cs +++ b/HDL_ON/Entity/Function/InverterInfo.cs @@ -1,8 +1,63 @@ 锘縰sing System; using System.Collections.Generic; +using HDL_ON.UI.UI2; +using Shared; namespace HDL_ON.Entity { + + public class Inverter + { + static Inverter _control; + public static Inverter Ins + { + get + { + if (_control == null) + { + _control = new Inverter(); + } + return _control; + } + } + + + WebView _h5Page; + + string showPageUrl = ""; + + public WebView H5Page + { + get + { + if(_h5Page == null) + { + _h5Page = new WebView(); + //_h5Page.CallJS("action('back')"); + } + return _h5Page; + } + set + { + _h5Page = value; + } + } + /// <summary> + /// 鍔犺浇鎸囧畾Url鐨剋ebview + /// </summary> + /// <param name="showUrl"></param> + public void ShowWebviewFormUrl(string showUrl) + { + if(showUrl == showPageUrl) + { + return; + } + showPageUrl = showUrl; + _h5Page.LoadFileUrl(showPageUrl); + } + + } + /// <summary> /// 鍏変紡鏁版嵁 /// </summary> diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index 3873cb5..f32c15f 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -1196,6 +1196,18 @@ }; inverterListView.AddChidren(btnOperationDataTotalData); + var clickButton = new Button(); + inverterListView.AddChidren(clickButton); + + clickButton.MouseUpEventHandler = (sender2, e2) => { + var h5BasePage = new FrameLayout(); + MainPage.BasePageView.AddChidren(h5BasePage); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + + h5BasePage.AddChidren(Inverter.Ins.H5Page); + Inverter.Ins.ShowWebviewFormUrl("h5/index"); + }; + index++; } diff --git a/HDL_ON/UI/UI2/H5Page.cs b/HDL_ON/UI/UI2/H5Page.cs index b1d3e73..46f6b8f 100644 --- a/HDL_ON/UI/UI2/H5Page.cs +++ b/HDL_ON/UI/UI2/H5Page.cs @@ -13,12 +13,12 @@ this.AddChidren(webView); webView.LoadFileUrl("h5/index"); - Button button = new Button { Width = 200, Height = 200, Text = "Hello", Y = 300, BackgroundColor = 0xFFFF0012 }; - button.MouseUpEventHandler += (s, e) => - { - webView.CallJS("uniAppAndroidFun(" + "'hello world'" + ")"); - }; - this.AddChidren(button); + //Button button = new Button { Width = 200, Height = 200, Text = "Hello", Y = 300, BackgroundColor = 0xFFFF0012 }; + //button.MouseUpEventHandler += (s, e) => + //{ + // webView.CallJS("uniAppAndroidFun(" + "'hello world'" + ")"); + //}; + //this.AddChidren(button); } } diff --git a/HDL_ON/UI/UI2/UserPage.cs b/HDL_ON/UI/UI2/UserPage.cs index 8488cd8..e8c5add 100644 --- a/HDL_ON/UI/UI2/UserPage.cs +++ b/HDL_ON/UI/UI2/UserPage.cs @@ -588,11 +588,6 @@ /// </summary> public void ChoosePersonalCenter() { - ContextView.RemoveAll(); - var h5Page = new HDL_ON.UI.UI2.H5Page(); - ContextView.AddChidren(h5Page); - h5Page.LoadView(); - return; if (MainPage.CurPageIndex == 3) { return; -- Gitblit v1.8.0