wei
2020-12-23 bdb67e76871e6ad47c353cd0350a1ac04d913823
20201223-5
10个文件已修改
185 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/DB_ResidenceData.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/BindingResidence/BindingResidencePage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPageBLL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/MyQRCodePage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,16 +1,23 @@
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.94B44E9C-E1BC-4BF7-812E-FC71E9B623B2" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/DriverLayer/Control.cs">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/Server/NewAPI.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="273" Column="88" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" Line="147" Column="24" />
      <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="270" Column="22" />
      <File FileName="HDL_ON/Entity/Room.cs" Line="449" Column="47" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs" Line="62" Column="51" />
      <File FileName="HDL_ON/UI/MainPage.cs" Line="212" Column="42" />
      <File FileName="HDL_ON/UI/UI2/UserPage.cs" Line="129" Column="50" />
      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="354" Column="62" />
      <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="1" Column="1" />
      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="364" Column="47" />
      <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="248" Column="49" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="191" Column="21" />
      <File FileName="HDL_ON/UI/MainPage.cs" Line="120" Column="57" />
      <File FileName="HDL_ON/UI/BindingResidence/BindingResidencePage.cs" Line="129" Column="42" />
      <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="2016" Column="87" />
      <File FileName="HDL_ON/UI/UI1-Login/LoginPageBLL.cs" Line="633" Column="57" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/MyQRCodePage.cs" Line="159" Column="48" />
      <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="136" Column="37" />
      <File FileName="HDL_ON/Entity/Function/Scene.cs" Line="294" Column="73" />
      <File FileName="HDL_ON/DAL/Server/NewAPI.cs" Line="394" Column="90" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
@@ -19,17 +26,19 @@
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="DriverLayer" expanded="True">
                  <Node name="Control.cs" selected="True" />
                </Node>
                <Node name="DriverLayer" expanded="True" />
                <Node name="Mqtt" expanded="True" />
                <Node name="Server" expanded="True" />
                <Node name="Server" expanded="True">
                  <Node name="NewAPI.cs" selected="True" />
                </Node>
              </Node>
              <Node name="Entity" expanded="True">
                <Node name="Function" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="BindingResidence" expanded="True" />
                <Node name="UI0-Public" expanded="True" />
                <Node name="UI1-Login" expanded="True" />
                <Node name="UI2" expanded="True">
                  <Node name="1-HomePage" expanded="True" />
                  <Node name="2-Classification" expanded="True" />
@@ -60,12 +69,13 @@
    <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI0-Public/PublicAssmebly.cs" relfile="HDL_ON/UI/UI0-Public/PublicAssmebly.cs" line="730" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs" line="315" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="288" column="1" />
    </BreakpointStore>
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
HDL_ON/Common/ApiUtlis.cs
@@ -64,18 +64,21 @@
            if (MainPage.InternetStatus == 0)
                return;
            //线程开始时间
            var beginTime = DateTime.Now.AddSeconds(6);
            var endTime = DateTime.Now.AddSeconds(6);
            MainPage.Log($"开始同步云端数据");
            DownloadDataComplete = false;
            var waitPage = new Loading();
            MainPage.BaseView.AddChidren(waitPage);
            waitPage.Start();
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            string code = StateCode.SUCCESS;
            var downloadDataThread = new System.Threading.Thread(() =>
            {
                MainPage.Log($"进入读取云端数据线程");
                //===================刷新Token=======================
                code = Ins.HttpRequest.RefreshToken();
                if (code != StateCode.SUCCESS)
@@ -249,7 +252,8 @@
                {
                    Application.RunOnMainThread(() =>
                    {
                        beginTime = DateTime.MinValue;
                        MainPage.Log($"结束读取云端数据线程");
                        endTime = DateTime.MinValue;
                        DownloadDataComplete = true;
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
@@ -257,33 +261,46 @@
                }
            });
            downloadDataThread.IsBackground = true;
            downloadDataThread.Priority = System.Threading.ThreadPriority.Highest;
            downloadDataThread.Start();
            //网络卡顿,终止下载线程
            new System.Threading.Thread(() =>
            {
                while (beginTime < DateTime.Now)
                try
                {
                    if (DownloadDataComplete)
                    while (endTime > DateTime.Now)
                    {
                        break;
                        if (DownloadDataComplete)
                        {
                            break;
                        }
                        System.Threading.Thread.Sleep(100);
                    }
                    System.Threading.Thread.Sleep(100);
                }
                if (!DownloadDataComplete)
                {
                    downloadDataThread.Abort();
                }
                DownloadDataComplete = true;
                Application.RunOnMainThread(() =>
                {
                    waitPage.Hide();
                    waitPage.RemoveFromParent();
                });
                //初始化数据
                //SpatialInfo.CurrentSpatial.Clear();
                    if (!DownloadDataComplete)
                    {
                        //downloadDataThread.Abort();
                    }
                    DownloadDataComplete = true;
                    Application.RunOnMainThread(() =>
                    {
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                    });
                    //初始化数据
                    //SpatialInfo.CurrentSpatial.Clear();
                }
                catch { }
                finally
                {
                    #region 读取本地数据
                    //读取音乐信息
                    UI.Music.A31MusicModel.ReadMusicStates();
                    //搜索网关
                    DriverLayer.Control.Ins.SearchLoaclGateway();
                    #endregion
                }
            })
            { IsBackground = true }.Start();
        }
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -503,7 +503,7 @@
                                UserInfo.Current.SaveUserInfo();
                                Action action = () =>
                                {
                                    MainPage.GoUserPage();
                                    MainPage.GoUserPage(true);
                                };
                                new UI.PublicAssmebly().TipMsg(StringId.Tip, StringId.ResidenceDeletedSwitchToAnotherResidence, action);
                            });
@@ -553,11 +553,11 @@
        /// <summary>
        /// 获取刷新当前住宅的网关列表
        /// </summary>
        public void GetHomeGatewayList()
        public string GetHomeGatewayList()
        {
            try
            {
                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return;
                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return "";
                var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.RegionID;
                var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = nowhomeId });
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson);
@@ -571,7 +571,7 @@
                            if (mHomeGatewayRes.Count > 0)
                            {
                                DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
                                if(mHomeGatewayRes[0].gatewayStatus)
                                if (mHomeGatewayRes[0].gatewayStatus)
                                {
                                    //DriverLayer.Control.Ins.IsRemote = true;
                                    DriverLayer.Control.Ins.GatewayOnline = true;
@@ -581,7 +581,7 @@
                                    DriverLayer.Control.Ins.GatewayOnline = false;
                                }
                                DB_ResidenceData.Instance.SaveResidenceData();
                                return;
                                return revertObj.Code;
                            }
                        }
                        //其余情况清空网关信息
@@ -593,10 +593,11 @@
                {
                    //提示错误
                }
                return revertObj.Code;
            }
            catch
            {
                return "";
            }
        }
        /// <summary>
HDL_ON/DAL/Server/NewAPI.cs
@@ -391,7 +391,7 @@
        /// <summary>
        /// 取消收藏场景
        /// </summary>
        public const string Api_Post_CancelCollectScene = "/home-wisdom/app/scene/cancelcollect";
        public const string Api_Post_CancelCollectScene = "/home-wisdom/app/scene/cancelCollect";
        #endregion
        #region Kaede -- 房间接口____________________________
HDL_ON/Entity/DB_ResidenceData.cs
@@ -121,6 +121,8 @@
            instance = null;
            ins_OidList = null;
            HomeGateway = null;
            //重置网关状态
            DriverLayer.Control.Ins.GatewayOnline = false;
            SpatialInfo.CurrentSpatial.Clear();
            FunctionList.List.Clear();
            
HDL_ON/UI/BindingResidence/BindingResidencePage.cs
@@ -126,7 +126,7 @@
                //调用On原来的方法,刷新住宅列表及其缓存
                pm.GetHomePager();
                //跳转页面----
                MainPage.GoUserPage(false, () =>
                MainPage.GoUserPage(true, false, () =>
                {
                    //显示欢迎回家的弹窗界面
                    var form = new WellcomToHomeForm();
HDL_ON/UI/MainPage.cs
@@ -119,7 +119,7 @@
                        //{ IsBackground = true }.Start();
                        Common.ApiUtlis.Ins.DownloadData();
                        GoUserPage(true);
                        GoUserPage(false,true);
                    }
                }
            }
@@ -153,12 +153,12 @@
        /// </summary>
        /// <param name="isFirstOpen">如果是第一次启动 检测校验密码</param>
        /// <param name="pageShowEvent">主页显示之后触发的事件(没有住宅的话,则不会触发)</param>
        public static void GoUserPage(bool isFirstOpen = false, Action pageShowEvent = null)
        public static void GoUserPage(bool downloadData , bool isFirstOpen = false, Action pageShowEvent = null)
        {
            //加载Loading效果
            var waitPage = new Loading();
            BaseView.AddChidren(waitPage);
            waitPage.Start("sdfghjkl");// (Language.StringByID(StringId.PleaseWait));
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            //当没有住宅时,不能让它往下走
            if (UserInfo.Current.regionList.Count == 0)
@@ -227,11 +227,11 @@
                    MainPage.Log($"GoUserPage : {ex.Message}");
                }finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        ///初始化app数据
                        InitializationData();
                    });
                    //Application.RunOnMainThread(() =>
                    //{
                    //    ///初始化app数据
                    //    Common.ApiUtlis.Ins.DownloadData();
                    //});
                }
            }).Start();
        }
@@ -239,7 +239,7 @@
        /// <summary>
        /// 初始化app所需要的数据
        /// </summary>
        public static void InitializationData()
        public static void InitializationData1()
        {
            //new System.Threading.Thread(() =>
            //{
@@ -276,12 +276,6 @@
            //})
            //{ IsBackground = true }.Start();
            #region 读取本地数据
            //读取音乐信息
            UI.Music.A31MusicModel.ReadMusicStates();
            //搜索网关
            DriverLayer.Control.Ins.SearchLoaclGateway();
            #endregion
        }
        /// <summary>
HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -598,7 +598,7 @@
                            if (verAccount == etPassword.Text.Trim())
                            {
                                //跳转页面----
                                MainPage.GoUserPage();
                                MainPage.GoUserPage(true);
                                return;
                            }
                        });
@@ -630,7 +630,7 @@
                            Application.RunOnMainThread(() =>
                            {
                                //跳转页面----
                                MainPage.GoUserPage();
                                MainPage.GoUserPage(true);
                            });
                        }
                        else
HDL_ON/UI/UI2/4-PersonalCenter/MyQRCodePage.cs
@@ -156,7 +156,7 @@
                        Application.RunOnMainThread(() =>
                        {
                            //跳转页面----
                            MainPage.GoUserPage(false, () =>
                            MainPage.GoUserPage(true, false, () =>
                            {
                                //显示欢迎回家的弹窗界面
                                var form = new WellcomToHomeForm();
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
old mode 100755 new mode 100644
@@ -186,47 +186,10 @@
            }
            DB_ResidenceData.Instance.CurrentRegion = homeTemp;
            DB_ResidenceData.Instance.SaveResidenceData();
            var waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            new System.Threading.Thread(() =>
            {
                try
                {
                    DB_ResidenceData.Instance.EixtAccount();
                    //刷新一次住宅网关
                    new HttpServerRequest().GetHomeGatewayList();
                    Application.RunOnMainThread(() =>
                    {
                        btnCurResidenceName.Text = DB_ResidenceData.Instance.CurrentRegion.Name;
                        //重置网关状态
                        DriverLayer.Control.Ins.GatewayOnline = false;
                    });
                    //搜索网关
                    DriverLayer.Control.Ins.SearchLoaclGateway();
                }
                catch (Exception ex)
                {
                    Application.RunOnMainThread(() =>
                    {
                        new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.OperationFailed),
                                   Language.StringByID(StringId.Close)).Show();
                    });
                    MainPage.Log(ex.Message);
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                        MainPage.InitializationData();
                    });
                }
            })
            { IsBackground = true }.Start();
            btnCurResidenceName.Text = DB_ResidenceData.Instance.CurrentRegion.Name;
            DB_ResidenceData.Instance.EixtAccount();
            //刷新住宅数据
            Common.ApiUtlis.Ins.DownloadData();
        }
        #endregion