wei
2021-03-17 7083d7dd627f2094827f7088e5646b0309b02d2d
2.优化调整第三方设备列表接口
13个文件已修改
3569 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Resources/Resource.designer.cs 3197 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Info.plist 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/FunctionList.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddThirdPartyBrandListpage.cs 282 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,34 +1,38 @@
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs">
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="81" Column="14" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs" Line="37" Column="16" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="18" Column="23" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs" Line="142" Column="53" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs" Line="210" Column="54" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs" Line="212" Column="1" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs" Line="125" Column="27" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" Line="32" Column="1" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs" Line="50" Column="30" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs" Line="58" Column="60" />
      <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="1785" Column="23" />
      <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="188" Column="10" />
      <File FileName="HDL_ON/UI/MainPage.cs" Line="29" Column="55" />
      <File FileName="HDL-ON_iOS/Info.plist" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="21" Column="25" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL_ON" expanded="True">
              <Node name="DAL" expanded="True">
                <Node name="Server" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI1-Login" expanded="True" />
                <Node name="UI2" expanded="True">
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="AddFunction" expanded="True" />
                    <Node name="PirDevice" expanded="True">
                      <Node name="Matching.cs" selected="True" />
                      <Node name="PirMain.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_iOS" expanded="True">
              <Node name="Resources" expanded="True">
                <Node name="Phone" expanded="True" />
              </Node>
            </Node>
            <Node name="HDL-ON_iOS" expanded="True" />
            <Node name="ys" expanded="True" />
          </Node>
        </State>
      </Pad>
@@ -40,8 +44,7 @@
    <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.4b65c4650918" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore />
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
HDL-ON_Android/Resources/Resource.designer.cs
Diff too large
HDL-ON_iOS/Info.plist
@@ -46,7 +46,7 @@
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>MinimumOSVersion</key>
    <string>13.0</string>
    <string>9.0</string>
    <key>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
@@ -104,9 +104,9 @@
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>CFBundleShortVersionString</key>
    <string>1.1.202103101</string>
    <string>1.1.202103171</string>
    <key>CFBundleVersion</key>
    <string>202103101</string>
    <string>202103171</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Use geographic location to provide services such as weather</string>
    <key>NSAppleMusicUsageDescription</key>
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -1792,6 +1792,7 @@
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("productPlatform", productPlatform);
            d.Add("productBrand", productBrand);
            d.Add("networkConfig", true);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieList, requestJson);
HDL_ON/Entity/FunctionList.cs
@@ -34,6 +34,12 @@
        /// 功能列表
        /// </summary>
        public List<Function> Functions = new List<Function>();
        /// <summary>
        /// 设备spk列表
        /// </summary>
        public List<string> DeviceSpk = new List<string>() {
            SPK.IrModule
        };
        /// <summary>
        /// 空调列表
HDL_ON/UI/MainPage.cs
@@ -26,7 +26,7 @@
        /// <summary>
        /// 版本号
        /// </summary>
        public static string VersionString = "1.1.0310";
        public static string VersionString = "1.1.0317";
        ///// <summary>
        ///// 客户端类型
        ///// </summary>
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -192,13 +192,13 @@
                //return;
                if (b)
                {
                    etAccount.Text = "18316672920";//"18316120654";//lcg "18316672920";//hzx;// "13415629083"//cf;//tujie"18316120654";
                    etAccount.Text = "274116637@qq.com";//"18316120654";//lcg "18316672920";//hzx;// "13415629083"//cf;//tujie"18316120654";
                    // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 
                }
                else
                {
                    etAccount.Text = "15622703419";//凉霸"18666455392";//13375012446//13602944661//tzy 18778381374
                    //15971583093 gs
                    //15971583093 gs//tzy 274116637@qq.com
                }
                b = !b;
                etPassword.Text = "123456";
HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs
@@ -240,7 +240,7 @@
                        {
                            var page = new UI2.PersonalCenter.PirDevice.PirMain();
                            MainPage.BasePageView.AddChidren(page);
                            page.Show();
                            page.Show(newDevice);
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        });
                    });
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
@@ -34,6 +34,11 @@
            Load3tyBrandDeviceList();
            contentView.BeginHeaderRefreshingAction = () =>
            {
                contentView.EndHeaderRefreshing();
                Load3tyBrandDeviceList();
            };
        }
        void Load3tyBrandDeviceList()
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddThirdPartyBrandListpage.cs
@@ -1,153 +1,159 @@
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
//using System;
//using System.Collections.Generic;
//using HDL_ON.Entity;
//using HDL_ON.UI.CSS;
//using Shared;
namespace HDL_ON.UI
{
    public class AddThirdPartyBrandListpage : FrameLayout
    {
        FrameLayout bodyView;
        VerticalRefreshLayout contentView;
        List<IntegratedBrand> brandList;
        public AddThirdPartyBrandListpage(List<IntegratedBrand> list)
        {
            bodyView = this;
            brandList = list;
        }
//namespace HDL_ON.UI
//{
//    public class AddThirdPartyBrandListpage : FrameLayout
//    {
//        FrameLayout bodyView;
//        VerticalRefreshLayout contentView;
//        List<IntegratedBrand> brandList;
//        public AddThirdPartyBrandListpage(List<IntegratedBrand> list)
//        {
//            bodyView = this;
//            brandList = list;
//        }
        public void LoadPage()
        {
            new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionBrand)).LoadTopView();
//        public void LoadPage()
//        {
//            new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionBrand)).LoadTopView();
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
//            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            contentView = new VerticalRefreshLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(667 - 64),
                VerticalScrollBarEnabled = false,
            };
            bodyView.AddChidren(contentView);
//            contentView = new VerticalRefreshLayout()
//            {
//                Y = Application.GetRealHeight(64),
//                Height = Application.GetRealHeight(667 - 64),
//                VerticalScrollBarEnabled = false,
//            };
//            bodyView.AddChidren(contentView);
            contentView.BeginHeaderRefreshingAction = () =>
            {
                contentView.EndHeaderRefreshing();
                Load3tyBrandList();
            };
//            contentView.BeginHeaderRefreshingAction = () =>
//            {
//                contentView.EndHeaderRefreshing();
//                Load3tyBrandList();
//            };
            Load3tyBrandList();
        }
//            Load3tyBrandList();
        void LoadRow(List<IntegratedBrand> brandList)
        {
            contentView.RemoveAll();
            bool isFrist = true;
            foreach(var brand in brandList)
            {
                FrameLayout row = new FrameLayout() {
                    Height = Application.GetRealHeight(50),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                };
                contentView.AddChidren(row);
//            contentView.BeginHeaderRefreshingAction = () =>
//            {
//                contentView.EndHeaderRefreshing();
//                Load3tyBrandList();
//            };
//        }
                if(isFrist)
                {
                    isFrist = false;
                }
                else
                {
                    Button btnLine = new Button()
                    {
                        X = Application.GetRealWidth(56),
                        Width = Application.GetRealWidth(303),
                        Height = 1,
                        BackgroundColor = CSS_Color.DividingLineColor,
                    };
                    row.AddChidren(btnLine);
                }
//        void LoadRow(List<IntegratedBrand> brandList)
//        {
//            contentView.RemoveAll();
//            bool isFrist = true;
//            foreach(var brand in brandList)
//            {
//                FrameLayout row = new FrameLayout() {
//                    Height = Application.GetRealHeight(50),
//                    BackgroundColor = CSS_Color.MainBackgroundColor,
//                };
//                contentView.AddChidren(row);
                ImageView btnIcon = new ImageView()
                {
                    X = Application.GetRealWidth(12),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetRealWidth(32),
                    Height = Application.GetRealWidth(32),
                    Radius = (uint)Application.GetRealWidth(4),
                    BackgroundColor = CSS_Color.PromptingColor1
                    //ImagePath = "tuya_logo.png"
                };
                row.AddChidren(btnIcon);
                Button btnRight = new Button()
                {
                    X = Application.GetRealWidth(339),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetMinRealAverage(16),
                    Height = Application.GetMinRealAverage(16),
                    UnSelectedImagePath = "Public/Right.png",
                };
                row.AddChidren(btnRight);
//                if(isFrist)
//                {
//                    isFrist = false;
//                }
//                else
//                {
//                    Button btnLine = new Button()
//                    {
//                        X = Application.GetRealWidth(56),
//                        Width = Application.GetRealWidth(303),
//                        Height = 1,
//                        BackgroundColor = CSS_Color.DividingLineColor,
//                    };
//                    row.AddChidren(btnLine);
//                }
                Button btnName = new Button()
                {
                    X = Application.GetRealWidth(56),
                    Width = Application.GetRealWidth(303),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.TextFontSize,
                    Text = brand.brandName,
                };
                row.AddChidren(btnName);
                //下载第三方品牌icon
                ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.brandIcon, btnIcon);
//                ImageView btnIcon = new ImageView()
//                {
//                    X = Application.GetRealWidth(12),
//                    Gravity = Gravity.CenterVertical,
//                    Width = Application.GetRealWidth(32),
//                    Height = Application.GetRealWidth(32),
//                    Radius = (uint)Application.GetRealWidth(4),
//                    BackgroundColor = CSS_Color.PromptingColor1
//                    //ImagePath = "tuya_logo.png"
//                };
//                row.AddChidren(btnIcon);
//                Button btnRight = new Button()
//                {
//                    X = Application.GetRealWidth(339),
//                    Gravity = Gravity.CenterVertical,
//                    Width = Application.GetMinRealAverage(16),
//                    Height = Application.GetMinRealAverage(16),
//                    UnSelectedImagePath = "Public/Right.png",
//                };
//                row.AddChidren(btnRight);
                btnName.MouseUpEventHandler = (sender, e) => {
                    var page = new AddDevciePage(brand);
                    MainPage.BasePageView.AddChidren(page);
                    page.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                };
            }
//                Button btnName = new Button()
//                {
//                    X = Application.GetRealWidth(56),
//                    Width = Application.GetRealWidth(303),
//                    TextAlignment = TextAlignment.CenterLeft,
//                    TextColor = CSS_Color.FirstLevelTitleColor,
//                    TextSize = CSS_FontSize.TextFontSize,
//                    Text = brand.brandName,
//                };
//                row.AddChidren(btnName);
//                //下载第三方品牌icon
//                ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.brandIcon, btnIcon);
        }
//                btnName.MouseUpEventHandler = (sender, e) => {
//                    var page = new AddDevciePage(brand);
//                    MainPage.BasePageView.AddChidren(page);
//                    page.LoadPage();
//                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
//                };
//            }
        void Load3tyBrandList()
        {
            var waitPage = new Loading();
            waitPage.Start();
            new System.Threading.Thread(() => {
                try
                {
                    var pm = new DAL.Server.HttpServerRequest();
                    var pack = pm.Get3tyBrandList();
                    if(pack.Code == DAL.Server.StateCode.SUCCESS)
                    {
                        var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrand>>(pack.Data.ToString());
                        Application.RunOnMainThread(() =>
                        {
                            LoadRow(revData);
                        });
                    }
                }
                catch (Exception ex)
                {
                    MainPage.Log("1--::"+ex.Message);
                }
                finally
                {
                    Application.RunOnMainThread(() => { waitPage.Hide(); });
                }
            }) { IsBackground = true }.Start();
        }
        /// <summary>
        /// 跳转添加设备界面
        /// </summary>
        /// <param name="bandType">品牌类型</param>
        void SkipPage_AddDevice()
        {
//        }
//        void Load3tyBrandList()
//        {
//            var waitPage = new Loading();
//            waitPage.Start();
//            new System.Threading.Thread(() => {
//                try
//                {
//                    var pm = new DAL.Server.HttpServerRequest();
//                    var pack = pm.Get3tyBrandList();
//                    if(pack.Code == DAL.Server.StateCode.SUCCESS)
//                    {
//                        var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrand>>(pack.Data.ToString());
//                        Application.RunOnMainThread(() =>
//                        {
//                            LoadRow(revData);
//                        });
//                    }
//                }
//                catch (Exception ex)
//                {
//                    MainPage.Log("1--::"+ex.Message);
//                }
//                finally
//                {
//                    Application.RunOnMainThread(() => { waitPage.Hide(); });
//                }
//            }) { IsBackground = true }.Start();
//        }
//        /// <summary>
//        /// 跳转添加设备界面
//        /// </summary>
//        /// <param name="bandType">品牌类型</param>
//        void SkipPage_AddDevice()
//        {
        
        }
    }
}
//        }
//    }
//}
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs
@@ -9,7 +9,7 @@
    {
        FrameLayout bodyView;
        VerticalScrolViewLayout contentView;
        VerticalRefreshLayout contentView;
        List<IntegratedBrand> brandList;
@@ -25,7 +25,7 @@
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            contentView = new  VerticalScrolViewLayout()
            contentView = new VerticalRefreshLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(603),
@@ -34,6 +34,12 @@
            GetBindList();
            contentView.BeginHeaderRefreshingAction = () =>
            {
                contentView.EndHeaderRefreshing();
                GetBindList();
            };
        }
        /// <summary>
        /// 获取绑定列表
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
@@ -20,13 +20,14 @@
        public void LoadPage()
        {
            Action<string,string> action = (s,a) => {
            Action<string, string> action = (s, a) =>
            {
                var page = new AddDevciePage(brand);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            new TopViewDiv(bodyView, Language.StringByID(StringId.Devices)).LoadTopView_AddIcon("3ty",action);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Devices)).LoadTopView_AddIcon("3ty", action);
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            contentView = new VerticalRefreshLayout()
@@ -37,10 +38,13 @@
            };
            bodyView.AddChidren(contentView);
            Load3tyBrandDeviceList();
            contentView.BeginHeaderRefreshingAction = () =>
            {
                contentView.EndHeaderRefreshing();
                Load3tyBrandDeviceList();
            };
        }
        void Load3tyBrandDeviceList()
@@ -79,6 +83,10 @@
            bool isFrist = true;
            foreach (var device in deviceList)
            {
                //if (!FunctionList.List.DeviceSpk.Contains(device.spk))
                //{
                //    continue;
                //}
                FrameLayout row = new FrameLayout()
                {
                    Height = Application.GetRealHeight(50),
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -94,6 +94,7 @@
                //}
                //默认第一个红外宝
                int sum = 0;
                Pir.currPir = Pir.pirDeviceList[0];
                for (int i = 0; i < Pir.pirDeviceList.Count; i++)
                {
                    //查找