From dce6c3481a37216292724013ff9d2b75ceb82f86 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 10 六月 2020 15:47:28 +0800
Subject: [PATCH] 添加小度的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs |   75 +++++++++++++++++++++++++++++++++++--
 1 files changed, 70 insertions(+), 5 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
index 187bdb5..a4417a0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -1,4 +1,5 @@
 锘縰sing Shared.Common;
+using Shared.Phone.UserCenter.SmartSound;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -12,7 +13,10 @@
     public class DeviceListMainForm : EditorCommonForm
     {
         #region 鈻� 鍙橀噺澹版槑___________________________
-
+        /// <summary>
+        /// 鏅鸿兘闊崇
+        /// </summary>
+        private MySmartSoundControl smmartSoundView = null;
         /// <summary>
         /// 缃戝叧鎺т欢
         /// </summary>
@@ -86,6 +90,18 @@
             //娓呯┖bodyFrame
             this.ClearBodyFrame();
 
+            smmartSoundView = new MySmartSoundControl();
+            bodyFrameLayout.AddChidren(smmartSoundView);
+            smmartSoundView.InitControl();
+            //褰撳墠涓嶆槸铏氭嫙浣忓畢鐨勮瘽
+            if (Config.Instance.Home.IsVirtually == false)
+            {
+                smmartSoundView.ButtonClickEvent += (sernder, e) =>
+                {
+                    var form = new SmartSoundListForm();
+                    form.AddForm();
+                };
+            }
             //鍒濆鍖栫綉鍏宠鎺т欢
             GatewayResourse.NowSelectGatewayId = GatewayResourse.AppOldSelectGatewayId;
             var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId);
@@ -232,7 +248,7 @@
             //鎻愮ず鏂扮増鏈�
             var btnNew = new InformationTipView(rowMenu.btnIcon);
             btnNew.Visible = false;
-            rowMenu.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEventOnly);
+            rowMenu.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEvent);
             rowMenu.AddTag("btnNew", btnNew);
 
             //妫�娴嬭澶囨槸鍚︽嫢鏈夊畾浣嶇殑鍔熻兘
@@ -643,7 +659,7 @@
                 if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, nowGateway) == true)
                 {
                     //閲嶆柊璁剧疆浣忓畢ID(杩欎釜搴旇鏄笉缁忚繃APP,鐩存帴鎶婄綉鍏虫仮澶嶄簡鍑哄巶璁剧疆)
-                    if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.getGatewayBaseInfo.HomeId) == true)
+                    if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.HomeId) == true)
                     {
                         //鏄剧ず杩涘害鏉�
                         ProgressBar.Show();
@@ -726,7 +742,7 @@
             {
                 return;
             }
-            if (HdlGatewayLogic.Current.GetGatewayId(gateWay) == this.gatewayViewRow.zbGatewayId)
+            if (gateWay.GwId == this.gatewayViewRow.zbGatewayId)
             {
                 Application.RunOnMainThread(() =>
                 {
@@ -1145,9 +1161,10 @@
                 this.UseClickStatu = false;
                 if (i_zbGateway != null)
                 {
-                    this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(i_zbGateway);
+                    this.zbGatewayId = i_zbGateway.GwId;
                 }
                 this.BackgroundColor = UserCenterColor.Current.White;
+                this.Y = Application.GetRealHeight(174);
                 this.Height = Application.GetRealHeight(173);
             }
 
@@ -1262,7 +1279,55 @@
                 }
             }
         }
+        #endregion
 
+        #region 鈻� 鑷畾涔夋櫤鑳介煶绠辨帶浠禵____________________
+
+        /// <summary>
+        /// 鑷畾涔夌綉鍏虫帶浠�
+        /// </summary>
+        private class MySmartSoundControl : FrameRowControl
+        {
+
+            /// <summary>
+            /// 缃戝叧鍚嶅瓧鎺т欢
+            /// </summary>
+            private NormalViewControl btnName = null;
+
+            /// <summary>
+            /// 鑷畾闊崇鍏虫帶浠�
+            /// </summary>
+            public MySmartSoundControl()
+            {
+                this.UseClickStatu = false;
+                this.BackgroundColor = UserCenterColor.Current.White;
+                this.Height = Application.GetRealHeight(173);
+
+                //this.InitControl();
+            }
+
+
+            /// <summary>
+            /// 鍒濆鍖栨帶浠�
+            /// </summary>
+            public void InitControl()
+            {
+                //鍥炬爣
+                var btnIcon = this.AddLeftIcon(81);
+                btnIcon.UnSelectedImagePath = "SmartSound/SoundIcon.png";
+
+                //鏄剧ず鏂囨湰
+                btnName = this.AddLeftCaption(string.Empty, 700);
+                btnName.Height = Application.GetRealHeight(60);
+                btnName.TextSize = 15;
+                btnName.Y = Application.GetRealHeight(57);
+                btnName.Text = "灏忓害灏忓害";
+
+                this.AddRightArrow();
+                this.AddMostRightView("", 300, false).Name = "smartSoundLayout";
+                this.AddBottomLine();
+            }
+        }
         #endregion
     }
 }

--
Gitblit v1.8.0