From a4e9d02ce5cfc501ef9fecac0047c332b5426df2 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 14 八月 2023 15:16:01 +0800
Subject: [PATCH] 2023年08月14日15:15:49

---
 HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs |   72 +++++++++++++++++++++++++-----------
 1 files changed, 50 insertions(+), 22 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs
index 668d031..178e1d2 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs
@@ -3,6 +3,7 @@
 using HDL_ON.UI.Music;
 using HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView;
 using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity;
+using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock;
 using Shared;
 using static HDL_ON.UI.UI2.FuntionControlView.Aks.AksPage;
 namespace HDL_ON.UI.UI2.FuntionControlView.Aks
@@ -54,9 +55,15 @@
 
         private void EventListener()
         {
-            cornerFram.selectKeyAction += (value) =>
+
+            cornerFram.selectKeyAction += (keypadEntity) =>
             {
-                Console.WriteLine("1");
+                //SendMethod.Current.Log(keypad.);
+                if (keypadEntity == null)
+                {
+                    return;
+                }
+                this.KeyControl(keypadEntity.keypad, keypadEntity.name);
             };
 
             typeSingleFramLayout.SetClickListener((f) =>
@@ -67,28 +74,27 @@
                 ykPage.Show();
             });
 
-            menuFram.SetTopClickListener((b) =>
+            menuFram.SetTopClickListener((keypadEntity) =>
             {
+                this.KeyControl(keypadEntity.keypad, keypadEntity.name);
+            });
+            menuFram.SetBottomClickListener((keypadEntity) =>
+            {
+                this.KeyControl(keypadEntity.keypad, keypadEntity.name);
+            });
+            menuFram.SetLeftClickListener((keypadEntity) =>
+            {
+                this.KeyControl(keypadEntity.keypad, keypadEntity.name);
+            });
+            menuFram.SetRightClickListener((keypadEntity) =>
+            {
+                this.KeyControl(keypadEntity.keypad, keypadEntity.name);
 
-                Console.WriteLine("5");
             });
-            menuFram.SetBottomClickListener((b) =>
+            menuFram.SetOkClickListener((keypadEntity) =>
             {
-                Console.WriteLine("6");
+                this.KeyControl(keypadEntity.keypad, keypadEntity.name);
             });
-            menuFram.SetLeftClickListener((b) =>
-            {
-                Console.WriteLine("7");
-            });
-            menuFram.SetRightClickListener((b) =>
-            {
-                Console.WriteLine("8");
-            });
-            menuFram.SetOkClickListener((b) =>
-            {
-                Console.WriteLine("9");
-            });
-
             typeMultiFramLayout.SetLeftFlClickListener((f) =>
             {
                 SxqPage sxqPage = new SxqPage(this.sequencerList, this.remoteControl.deviceId);
@@ -97,10 +103,8 @@
                 sxqPage.Show();
 
             });
-
             typeMultiFramLayout.SetRightFlClickListener((f) =>
             {
-                Console.WriteLine("4");
                 action?.Invoke(IntType.Player);
             });
 
@@ -137,7 +141,7 @@
             cornerBottomFram.Y = cornerFram.Bottom + Application.GetRealHeight(16);
             cornerBottomFram.BackgroundColor = MusicColor.WhiteColor;
             cornerBottomFram.Radius = (uint)Application.GetRealHeight(17);
-          
+
 
             typeSingleFramLayout = new TypeSingleFramLayout();
             typeSingleFramLayout.AddView(cornerBottomFram);
@@ -158,7 +162,31 @@
             this.AdjustRealHeight(16);
         }
 
+        /// <summary>
+        /// 鎸夐敭鎺у埗
+        /// </summary>
+        /// <param name="keypad"><鎸夐敭鏍囪瘑/param>
+        /// <param name="keyName"><鎸夐敭鍚嶇О(鎵撳嵃鐢ㄧ殑)/param>
+        private void KeyControl(string keypad, string keyName)
+        {
+            //CommonMethod.Current.Loading.Start();
+            CommonMethod.Current.SunThread(() =>
+            {
+                try
+                {
+                    SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName);
+                }
+                catch { }
+                finally
+                {
+                    CommonMethod.Current.MainThread(() =>
+                    {
+                        //CommonMethod.Current.Loading.Hide();
+                    });
+                }
+            });
 
+        }
 
     }
 }

--
Gitblit v1.8.0