From fe2b566c8d9c097d2568ad211088fa5bc6f8c229 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 23 三月 2021 13:48:25 +0800
Subject: [PATCH] 2.增加住宅绑定网关判断,没有绑定网关的住宅,ON+不再显示

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs |   37 +++++++++++++++++++++++--------------
 1 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
index 8ef498e..bb2af77 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
@@ -11,14 +11,23 @@
         {
             Tag = "PirView";
         }
-        public void Show(List<Library> libraryList,string spk)
+      
+        public void Show(List<Brand> brandList, List<Library> libraryList,string spk) 
         {
+           
+            
             #region 鐣岄潰甯冨眬
             this.BackgroundColor = CSS.CSS_Color.viewMiddle;
             PirDevice.View.TopView topView = new View.TopView();
             topView.topNameBtn.TextID = StringId.pipeiyaokongqi;
             this.AddChidren(topView.FLayoutView());
-            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); };
+            topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                BrandList brandObj = new BrandList();
+                brandObj.Show(brandList, spk);
+                this.RemoveFromParent();
+
+            };
 
             FrameLayout fLayout = new FrameLayout
             {
@@ -96,10 +105,10 @@
             Button sumBtn = new Button
             {
                 Y = Application.GetRealHeight(267),
-                X = Application.GetRealWidth(170),
-                Width = Application.GetRealWidth(36),
+                X = Application.GetRealWidth(136),
+                Width = Application.GetRealWidth(104),
                 Height = Application.GetRealHeight(17),
-                Text = "(1/20)",
+                Text = $"(1/{libraryList.Count})",
                 TextSize = TextSize.text12,
                 TextColor = CSS.CSS_Color.textCancelColor,
             };
@@ -116,7 +125,7 @@
                 TextSize = TextSize.text16,
                 TextColor = CSS.CSS_Color.textConfirmColor,
                 TextAlignment = TextAlignment.Center,
-                Radius = (uint)Application.GetRealHeight(44),
+                Radius = (uint)Application.GetRealHeight(22),
                 BorderWidth = 1,
                 BorderColor = CSS.CSS_Color.textConfirmColor,
             };
@@ -132,7 +141,7 @@
                 TextSize = TextSize.text16,
                 TextColor = CSS.CSS_Color.textWhiteColor,
                 TextAlignment = TextAlignment.Center,
-                Radius = (uint)Application.GetRealHeight(44),
+                Radius = (uint)Application.GetRealHeight(22),
                 //BorderWidth = 1,
                 //BorderColor = CSS.CSS_Color.textConfirmColor,
                 BackgroundColor = CSS.CSS_Color.textConfirmColor,
@@ -151,7 +160,7 @@
             {
                 if (index>1) {
                     index--;
-                    sumBtn.Text = "(" + index.ToString() + "/20)";
+                    sumBtn.Text = $"({index.ToString()}/{libraryList.Count})";
                 }
                 code = 1;
                 GetBtnText(testBtn, code, spk);
@@ -159,10 +168,10 @@
             //鍙�
             rightIconBtn.MouseUpEventHandler += (sender, e) =>
             {
-                if (index < 20)
+                if (index < libraryList.Count)
                 {
                     index++;
-                    sumBtn.Text = "(" + index.ToString() + "/20)";
+                    sumBtn.Text = $"({index.ToString()}/{libraryList.Count})";
                 }
                 code = 1;
                 GetBtnText(testBtn, code, spk);
@@ -171,7 +180,7 @@
             //娴嬭瘯Text
             testBtn.MouseUpEventHandler += (sender, e) =>
             {
-                var library = libraryList[index];
+                var library = libraryList[index-1];
                 var control = GetControl(spk, testBtn.TextID, library);
                 //鍙戦�佹祴璇曠爜鍛戒护
                 CodeTest(control);
@@ -183,12 +192,12 @@
             //鎺у埗澶辫触
             failedBtn.MouseUpEventHandler += (sender, e) =>
             {
-                if (index < 20)
+                if (index < libraryList.Count)
                 {
                     //鍏堝姞
                     index++;
                     //鏇存柊鏂囨湰
-                    sumBtn.Text = "(" + index.ToString() + "/20)";
+                    sumBtn.Text = $"({index.ToString()}/{libraryList.Count})";
                 }
                 code = 1;
                 //鏇存柊鐘舵��
@@ -205,7 +214,7 @@
                 GetBtnText(testBtn, code, spk);
                 if (if_bool)
                 {
-                    var library = libraryList[index];
+                    var library = libraryList[index-1];
                     var control = GetControl(spk, testBtn.TextID, library);
                     Method method = new Method();
                     //鍙戦�佸簱娣诲姞閬ユ帶鍣ㄥ懡浠�

--
Gitblit v1.8.0