From 84fa7c9665d9bed9aef79237be9c5eb57c49f13d Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期五, 05 三月 2021 10:54:37 +0800
Subject: [PATCH] Merge branch 'CJL' into ez-test

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs |  339 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 339 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
new file mode 100644
index 0000000..9da222a
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -0,0 +1,339 @@
+锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
+using Shared;
+namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice
+{
+    public class PirMain : FrameLayout
+    {
+        public PirMain()
+        {
+            Tag = "PirView";
+        }
+        public void Show()
+        {
+            #region 鐣岄潰甯冨眬
+            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
+            PirDevice.View.TopView topView = new View.TopView();
+            topView.topNameBtn.TextID = StringId.hongwaiyaokong;
+            this.AddChidren(topView.FLayoutView());
+            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); };
+            FrameLayout middFLayout = new FrameLayout();
+            middFLayout.Y = Application.GetRealHeight(64);
+            middFLayout.Height = Application.GetRealHeight(667 - 64);
+            this.AddChidren(middFLayout);
+
+            FrameLayout pirDeviceFLayout = new FrameLayout();
+            pirDeviceFLayout.Y = Application.GetRealHeight(12);
+            pirDeviceFLayout.X = Application.GetRealWidth(16);
+            pirDeviceFLayout.Width = Application.GetRealWidth(343);
+            pirDeviceFLayout.Height = Application.GetRealHeight(187);
+            pirDeviceFLayout.BackgroundColor = CSS.CSS_Color.view;
+            pirDeviceFLayout.Radius = (uint)Application.GetRealHeight(12);
+            middFLayout.AddChidren(pirDeviceFLayout);
+
+            //璁惧绠$悊
+            Button text1Btn = new Button
+            {
+                Y = Application.GetRealHeight(11),
+                X = Application.GetRealWidth(16),
+                Width = Application.GetRealWidth(120),
+                Height = Application.GetRealHeight(20),
+                TextSize = TextSize.text14,
+                TextColor = CSS.CSS_Color.textConfirmColor,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextID = StringId.shebeigaunli,
+                IsBold=true,
+            };
+            pirDeviceFLayout.AddChidren(text1Btn); 
+
+
+            Button pirIcon = new Button
+            {
+                Y = Application.GetRealHeight(47),
+                X = Application.GetRealWidth(28),
+                Width = Application.GetRealWidth(66),
+                Height = Application.GetRealWidth(66),
+                UnSelectedImagePath = "PirIcon/Infraredtreasure.png",
+            };
+            pirDeviceFLayout.AddChidren(pirIcon);
+
+            //mini鏅鸿兘閬ユ帶鍣�
+            Button text2Btn = new Button
+            {
+                Y = Application.GetRealHeight(70),
+                X = Application.GetRealWidth(112),
+                Width = Application.GetRealWidth(120),
+                Height = Application.GetRealHeight(20),
+                TextSize = TextSize.text14,
+                TextColor = CSS.CSS_Color.textTipColor,
+                TextAlignment = TextAlignment.CenterLeft,
+                Text = "mini鏅鸿兘閬ユ帶鍣�",
+            };
+            pirDeviceFLayout.AddChidren(text2Btn);
+
+            //
+            Button numberDeviceBtn = new Button
+            {
+                Y = Application.GetRealHeight(137),
+                X = Application.GetRealWidth(32),
+                Width = Application.GetRealWidth(100),
+                Height = Application.GetRealHeight(20),
+                TextSize = TextSize.text14,
+                TextColor = CSS.CSS_Color.textColor,
+                TextAlignment = TextAlignment.CenterLeft,
+                Text = "1" + Language.StringByID(StringId.ge),
+                IsBold = true,
+            };
+            pirDeviceFLayout.AddChidren(numberDeviceBtn);
+            //褰撳墠绾㈠閬ユ帶璁惧
+            Button numberDeviceTextBtn = new Button
+            {
+                Y = numberDeviceBtn.Bottom + Application.GetRealHeight(4),
+                X = Application.GetRealWidth(32),
+                Width = Application.GetRealWidth(100),
+                Height = Application.GetRealHeight(14),
+                TextSize = TextSize.text10,
+                TextColor = CSS.CSS_Color.textCancelColor,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextID = StringId.dangqianhongwaishebei,
+            };
+            pirDeviceFLayout.AddChidren(numberDeviceTextBtn);
+            //
+            Button currDeviceNumberControlBtn = new Button
+            {
+                Y = Application.GetRealHeight(137),
+                X = Application.GetRealWidth(198),
+                Width = Application.GetRealWidth(80),
+                Height = Application.GetRealHeight(20),
+                TextSize = TextSize.text14,
+                TextColor = CSS.CSS_Color.textColor,
+                TextAlignment = TextAlignment.CenterLeft,
+                Text = "1" + Language.StringByID(StringId.ge),
+                IsBold = true,
+            };
+            pirDeviceFLayout.AddChidren(currDeviceNumberControlBtn);
+            //宸叉坊鍔犻仴鎺у櫒
+            Button currDeviceNumberControlTextBtn = new Button
+            {
+                Y = currDeviceNumberControlBtn.Bottom + Application.GetRealHeight(4),
+                X = Application.GetRealWidth(198),
+                Width = Application.GetRealWidth(80),
+                Height = Application.GetRealHeight(14),
+                TextSize = TextSize.text10,
+                TextColor = CSS.CSS_Color.textCancelColor,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextID = StringId.yitianjiayaokongqi,
+            };
+            pirDeviceFLayout.AddChidren(currDeviceNumberControlTextBtn);
+            ///绾㈠瀹濈偣鍑讳簨浠�
+            FrameLayout clickFLayout = new FrameLayout();
+            pirDeviceFLayout.AddChidren(clickFLayout);
+            clickFLayout.MouseUpEventHandler += (sender,e) => {
+
+                DeviceSet deviceSet = new DeviceSet();
+                MainPage.BasePageView.AddChidren(deviceSet);
+                deviceSet.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+
+            FrameLayout deviceListFLayout = new FrameLayout();
+            deviceListFLayout.Y = pirDeviceFLayout.Bottom + Application.GetRealHeight(12);
+            deviceListFLayout.X = Application.GetRealWidth(16);
+            deviceListFLayout.Width = Application.GetRealWidth(343);
+            deviceListFLayout.Height = Application.GetRealHeight(328);
+            deviceListFLayout.BackgroundColor = CSS.CSS_Color.view;
+            deviceListFLayout.Radius = (uint)Application.GetRealHeight(12);
+            middFLayout.AddChidren(deviceListFLayout);
+            ///娣诲姞閬ユ帶鍣�
+            Button text3Btn = new Button
+            {
+                Y = Application.GetRealHeight(11),
+                X = Application.GetRealWidth(16),
+                Width = Application.GetRealWidth(100),
+                Height = Application.GetRealHeight(20),
+                TextSize = TextSize.text14,
+                TextColor = CSS.CSS_Color.textConfirmColor,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextID = StringId.tianjiayaokongqi,
+                IsBold = true,
+            };
+            deviceListFLayout.AddChidren(text3Btn);
+            ///绾㈠瀹濆悕绉�
+            Button deviceNameBtn= new Button
+            {
+                Y = Application.GetRealHeight(13),
+                X = Application.GetRealWidth(161),
+                Width = Application.GetRealWidth(150),
+                Height = Application.GetRealHeight(17),
+                TextSize = TextSize.text12,
+                TextColor = CSS.CSS_Color.textColor,
+                TextAlignment = TextAlignment.CenterRight,
+                Text = "mini鏅鸿兘閬ユ帶鍣�",
+            };
+            deviceListFLayout.AddChidren(deviceNameBtn);
+
+            //涓嬫媺鍥炬爣
+            var dropdownIconBtn = new Button
+            {
+                Y = Application.GetRealHeight(13),
+                X = Application.GetRealWidth(343-8-16),
+                Width = Application.GetRealWidth(16),
+                Height = Application.GetRealWidth(16),
+                UnSelectedImagePath = "PirIcon/dropdown.png",
+            };
+            deviceListFLayout.AddChidren(dropdownIconBtn);
+
+            #endregion
+            int line = 0;
+            for (int i = 1, j = 0; i <= 7; i++, j++)
+            {
+                var currpirdeviceFLayout = new FrameLayout
+                {
+                    Width = Application.GetRealWidth(80),
+                    Height = Application.GetRealWidth(80),
+                    X = Application.GetRealWidth(26 + (80 + 25) * j),
+                    Y = Application.GetRealHeight(52 + (80 + 12) * line),
+
+                };
+                deviceListFLayout.AddChidren(currpirdeviceFLayout);
+                var deviceIconBtn = new Button
+                {
+                    Y = Application.GetRealHeight(8),
+                    X = Application.GetRealWidth(20),
+                    Width = Application.GetRealWidth(40),
+                    Height = Application.GetRealWidth(40),
+                    UnSelectedImagePath = "PirIcon/Infraredtreasure.png",
+                };
+                currpirdeviceFLayout.AddChidren(deviceIconBtn);
+                var iconNameBtn = new Button  
+                {
+                    Y = deviceIconBtn.Bottom+Application.GetRealHeight(8),
+                    Width = Application.GetRealWidth(80),
+                    Height = Application.GetRealHeight(17),
+                    TextSize = TextSize.text12,
+                    TextColor = CSS.CSS_Color.TextualColor,
+                    TextAlignment = TextAlignment.Center,
+                };
+                currpirdeviceFLayout.AddChidren(iconNameBtn);
+                var clickBtn = new Button { Tag = i };
+                currpirdeviceFLayout.AddChidren(clickBtn);
+                if (i % 3 == 0)
+                {
+                    //婊′竴琛岄噸缃甹=0鍊�;
+                    j = -1;
+                    line += 1;
+                }
+                GetIconAndText(i, deviceIconBtn, iconNameBtn);
+                clickBtn.MouseUpEventHandler += (sender, e) =>
+                {
+                    //1=绌鸿皟;2=鐢佃;3=椋庢墖;4=鏈洪《鐩�;5=DVD/EVD/VCD;6=鎶曞奖浠�;7=鑷畾涔�;
+                    int if_value =int.Parse(clickBtn.Tag.ToString());
+                    var list11 = new List<string> {
+                       "鐖变綘", "鍝庡懄","鍩冨強","鍝堝紬鎹㈠3鍝堝紬", "鐖卞痉鍗庡v","淇哄嚑涓柉浜�",
+                        "鎷滀簡", "宸村+", "鐧惧か",  "鐧惧悎鍦扮悊璇句綘鎵撶畻", "涓嶅害鑰侀浼忔灔", "姣斿埌涔濈偣",
+                        "杞︾珯","娴嬭瘯","姝ゅ湴", "鎵嶇湅瑙佸ソ寰楀揩","鍚冭蒋楗�","浠庣湅瑙佷簩鍗佸",
+                       "绛夊緟鏈轰細鍚�","鐨勫鎴�", "澶氬枬鐐�", "鐧昏鍝︾劧鍚�", "鎵撶數璇�",
+                         "鎭╄偆闇滅湅灏辩湅浜�", "楗挎os","鎭堕瓟鍩�","鍎跨鑱斿姩", "鎭╁叚棰楀瓙寮规媺鎷夎¥娲楁尽浜�","鍙戝ぇ瀛︾敓鍙戝彂",
+                        "鐪熷帀瀹砳鍙戝灏�", "鐭ラ亾浣犱粯娆句簡鍙�", "灏厭鍥炲",  "鏀硅繘鐨勮瘽", "澶╁ぉ閫熷害鍥炵瓟", "澶ソ浜嗗紑杞�",
+                        "鍑忚偉鐨勭湅杩�","妗″嚭鍙e閭�","濡傛灉瑙夊緱", "寰堣垝鏈嶇殑","鍚冭蒋楗�","浠庣湅瑙佷簩鍗佸",
+                       "榫欏嵎椋庝簭澶у彂","鍘诲ソ鐪�", "澶氬枬鐐�", "濂芥氮璐瑰ソ", "鎵撶數璇�"};
+                    System.Threading.Tasks.Task.Run(() =>
+                    {
+                        Application.RunOnMainThread(() =>
+                        {
+                            switch (if_value)
+                            {
+                                case 1:
+                                    {
+                                    }
+                                    break;
+                                case 2:
+                                    {
+                                    }
+                                    break;
+                                case 3:
+                                    {
+                                    }
+                                    break;
+                                case 4:
+                                    {
+                                    }
+                                    break;
+                                case 5:
+                                    {
+                                    }
+                                    break;
+                                case 6:
+                                    {
+                                    }
+                                    break;
+                                case 7:
+                                    {
+                                        Method method = new Method();
+                                        method.AddControl();
+                                       
+                                    }
+                                    break;
+
+                            }
+                            
+
+                            //BrandList brandList = new BrandList();
+                            //MainPage.BasePageView.AddChidren(brandList);
+                            //brandList.Show(list11, null);
+                            //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        });
+                    });
+                };
+
+            }
+
+        }
+        /// <summary>
+        /// 璁剧疆鍥剧墖鍜屽娉�
+        /// </summary>
+        /// <param name="index">绱㈠紩鍊�</param>
+        /// <param name="deviceIconBtn">鍥炬爣Btn</param>
+        /// <param name="deviceNameBtn">璁惧澶囨敞Btn</param>
+        private void GetIconAndText(int index,Button deviceIconBtn, Button deviceNameBtn) {
+            string iconPath = "";  
+            int deviceNameIndex=0;
+            switch (index)
+            {
+                case 1: {
+                        iconPath = "PirIcon/air.png";
+                        deviceNameIndex = StringId.kongtiao;
+                    } break;
+                case 2: {
+                        iconPath = "PirIcon/tv.png";
+                        deviceNameIndex = StringId.dianshi;
+                    } break;
+                case 3: {
+                        iconPath = "PirIcon/fan.png";
+                        deviceNameIndex = StringId.fengshan;
+                    } break;
+                case 4: {
+                        iconPath = "PirIcon/stb.png";
+                        deviceNameIndex = StringId.jidinghe;
+                    } break;
+                case 5: {
+                        iconPath = "PirIcon/dvd.png";
+                        deviceNameIndex = StringId.dvd;
+                    } break;
+                case 6: {
+                        iconPath = "PirIcon/projector.png";
+                        deviceNameIndex = StringId.touyingyi;
+                    } break;
+                case 7: {
+                        iconPath = "PirIcon/custom.png";
+                        deviceNameIndex = StringId.zidingyi;
+                    } break;
+
+            }
+            deviceIconBtn.UnSelectedImagePath = iconPath;
+            deviceNameBtn.TextID = deviceNameIndex;
+        }
+        
+    }
+}

--
Gitblit v1.8.0