From 5bfb959c47017825c8cf7dc8570c55b04dab694c Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 09 六月 2021 16:42:11 +0800 Subject: [PATCH] Merge branch 'dev-tzy' into wxr6 --- HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs | 80 +++++++++++----------------------------- 1 files changed, 22 insertions(+), 58 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs index 908d600..41c544c 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs @@ -12,10 +12,10 @@ Tag = "PirView"; } - public void Show(List<Brand> brandList,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(); @@ -105,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, }; @@ -125,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, }; @@ -141,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, @@ -160,7 +160,7 @@ { if (index>1) { index--; - sumBtn.Text = "(" + index.ToString() + "/20)"; + sumBtn.Text = $"({index.ToString()}/{libraryList.Count})"; } code = 1; GetBtnText(testBtn, code, spk); @@ -168,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); @@ -180,24 +180,29 @@ //娴嬭瘯Text testBtn.MouseUpEventHandler += (sender, e) => { - var library = libraryList[index]; + // testBtn.BackgroundColor = CSS.CSS_Color.viewMiddle; + var library = libraryList[index - 1]; var control = GetControl(spk, testBtn.TextID, library); //鍙戦�佹祴璇曠爜鍛戒护 - CodeTest(control); + Method.ThreadSend(control, (responsePackNew) => { }, "搴撶爜娴嬭瘯", "frame", this, null); if (code == 3) { //鏍囪鏈�鍚庨偅涓爜 if_bool = true; } }; + testBtn.MouseDownEventHandler += (sender, e) => + { + //testBtn.BackgroundColor = CSS.CSS_Color.textConfirmColor; + }; //鎺у埗澶辫触 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; //鏇存柊鐘舵�� @@ -214,16 +219,16 @@ 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(); //鍙戦�佸簱娣诲姞閬ユ帶鍣ㄥ懡浠� - method.ThreadAddControl(control, this, (cont) => + method.ThreadAddControl(control, this, (device) => { MainPage.BasePageView.RemoveViewByTag("PirView"); AddControlComplete addControlComplete = new AddControlComplete(); MainPage.BasePageView.AddChidren(addControlComplete); - addControlComplete.Show(cont, true); + addControlComplete.Show(device, true); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }); @@ -316,47 +321,6 @@ } return control; - } - - /// <summary> - /// 鍙戦�佸簱鐮佹祴璇曞懡浠� - /// </summary> - /// <param name="control"></param> - private void CodeTest(Control control) - { - - //鍔犺浇log - Loading loading = new Loading(); - this.AddChidren(loading); - HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; - loading.Start(); - new System.Threading.Thread(() => - { - try - { - responsePackNew = PirSend.CodeTest(control); - } - catch { } - finally - { - Application.RunOnMainThread(() => - { - loading.Hide(); - if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") - { - - } - else - { - //Method method = new Method(); - //method.ErrorShow(responsePackNew); - } - - }); - } - - }) - { IsBackground = true }.Start(); } /// <summary> -- Gitblit v1.8.0