From 775da5fd0e250c4717076f9179fb1d69252516cd Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期六, 28 八月 2021 10:08:19 +0800
Subject: [PATCH] 2021-08-28 1.推送消息改为分页接口

---
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs                          |   10 +-
 HDL_ON/DAL/Server/NewAPI.cs                                      |    2 
 HDL_ON/DAL/Server/NewApiRes.cs                                   |   11 +++
 HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs |   92 ++++++++++++++++++------------
 HDL_ON/DAL/Server/HttpServerRequest.cs                           |    3 
 .vs/HDL_APP_Project/xs/UserPrefs.xml                             |   20 ++----
 HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs                    |   19 ++++++
 7 files changed, 99 insertions(+), 58 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index cf028d2..c467cc9 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,13 +1,6 @@
 锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
   <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs">
-    <Files>
-      <File FileName="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs" Line="202" Column="58" />
-      <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="2648" Column="43" />
-      <File FileName="HDL_ON/DAL/Server/NewApiRes.cs" Line="1077" Column="18" />
-      <File FileName="HDL_ON/DAL/Server/NewAPI.cs" Line="673" Column="51" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" Line="522" Column="60" />
-    </Files>
+  <MonoDevelop.Ide.Workbench>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
@@ -15,15 +8,18 @@
             <Node name="HDL_ON" expanded="True">
               <Node name="Common" expanded="True" />
               <Node name="DAL" expanded="True">
-                <Node name="Server" expanded="True" />
+                <Node name="Server" expanded="True">
+                  <Node name="NewApiRes.cs" selected="True" />
+                </Node>
+              </Node>
+              <Node name="Entity" expanded="True">
+                <Node name="Function" expanded="True" />
               </Node>
               <Node name="UI" expanded="True">
                 <Node name="UI2" expanded="True">
                   <Node name="1-HomePage" expanded="True" />
                   <Node name="4-PersonalCenter" expanded="True">
-                    <Node name="FaceManagement" expanded="True">
-                      <Node name="FacePassagePage.cs" selected="True" />
-                    </Node>
+                    <Node name="FaceManagement" expanded="True" />
                   </Node>
                 </Node>
               </Node>
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index a9e1eef..32868bd 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -1069,9 +1069,8 @@
                 pushType = pushType,
                 homeId = DB_ResidenceData.Instance.CurrentRegion.id,
             });
-            //鏀逛负鍒嗛〉鏌ヨ
+            //2021-08-28 鏀逛负鍒嗛〉鏌ヨ
             return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist_Paging, requestJson);
-
         }
 
         /// <summary>
diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs
index ddf6265..880d72e 100644
--- a/HDL_ON/DAL/Server/NewAPI.cs
+++ b/HDL_ON/DAL/Server/NewAPI.cs
@@ -291,7 +291,7 @@
         /// <summary>
         /// 鑾峰彇鎺ㄩ�佹秷鎭褰� 鍒嗛〉
         /// </summary>
-        public const string API_POST_PushSerivce_Getpushmessagelist_Paging = "/smart-footstone/app/message/list";
+        public const string API_POST_PushSerivce_Getpushmessagelist_Paging = "/smart-footstone/app/message/page";
         /// <summary>
         /// 娓呯┖鎺ㄩ�佺殑娑堟伅璁板綍
         /// </summary>
diff --git a/HDL_ON/DAL/Server/NewApiRes.cs b/HDL_ON/DAL/Server/NewApiRes.cs
index 766a70d..a5a3fc7 100644
--- a/HDL_ON/DAL/Server/NewApiRes.cs
+++ b/HDL_ON/DAL/Server/NewApiRes.cs
@@ -49,6 +49,17 @@
         public string regionUrl;
     }
 
+    /// <summary>
+    /// 鍒嗛〉
+    /// </summary>
+    public class BasePagingObj
+    {
+        public int totalCount = 0;
+        public int totalPage = 0;
+        public int pageNo = 0;
+        public int pageSize = 0;
+    }
+
     #endregion
 
     #region  鈻� 鐧诲綍 ____________________________
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index 52ba900..4922410 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -635,12 +635,12 @@
                     {
                         //鏈鐨勬秷鎭垪琛�
                         var unreadList = new List<PushMessageInfo>();
+                       
+                        var pushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<PushMessageInfoList>(result.Data.ToString());
 
-                        var pushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString());
-
-                        if (pushMessageInfoList != null && pushMessageInfoList.Count > 0)
+                        if (pushMessageInfoList != null && pushMessageInfoList.list != null && pushMessageInfoList.list.Count > 0)
                         {
-                            foreach (var info in pushMessageInfoList)
+                            foreach (var info in pushMessageInfoList.list)
                             {
                                 if (!info.isRead)
                                 {
@@ -660,7 +660,7 @@
                             {
                                 Application.RunOnMainThread(() =>
                                 {
-                                    ShowMesBtnState(pushMessageInfoList[0], true);
+                                    ShowMesBtnState(pushMessageInfoList.list[0], true);
                                 });
                             }
                         }
diff --git a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
index 96c0947..eb5f464 100644
--- a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
@@ -95,6 +95,7 @@
                 Y = Application.GetRealHeight(64),
                 Height = Application.GetRealWidth(117),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
+                HorizontalScrollBarEnabled = false//闅愯棌婊氬姩鏉�
             };
             bodyView.AddChidren(menuView);
 
@@ -538,7 +539,13 @@
                     var result = new HttpServerRequest().PushSerivceGetPushmessagelist(queryType);
                     if (result.Code == StateCode.SUCCESS)
                     {
-                        PushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString());
+                        //PushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString());
+                        //2021-08-28 鏀逛负鍒嗛〉鎺ュ彛
+                        var mPushMesList = Newtonsoft.Json.JsonConvert.DeserializeObject<PushMessageInfoList>(result.Data.ToString());
+                        if(mPushMesList != null) {
+                            PushMessageInfoList = mPushMesList.list;
+                        }
+
                         Application.RunOnMainThread(() =>
                         {
                             if (PushMessageInfoList != null && PushMessageInfoList.Count > 0)
@@ -789,4 +796,14 @@
         public long createTime;
     }
 
+
+    /// <summary>
+    // 鎺ㄩ�佹秷鎭垎椤靛璞�
+    /// </summary>
+    public class PushMessageInfoList : BasePagingObj
+    {
+        public List<PushMessageInfo> list = new List<PushMessageInfo>();
+
+    }
+
 }
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs
index 870c50b..2d86ddd 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs
@@ -63,7 +63,7 @@
             contentView = new FrameLayout()
             {
                 Y = Application.GetRealHeight(64),
-                Height = Application.GetRealHeight(667-64),
+                Height = Application.GetRealHeight(667 - 64),
             };
             bodyView.AddChidren(contentView);
 
@@ -96,7 +96,7 @@
             };
             topView.AddChidren(btnText1);
 
-            topView.AddChidren(new Button() { Height = 1,BackgroundColor = CSS_Color.DividingLineColor,Y = Application.GetRealHeight(188) ,X = Application.GetRealWidth(16),Width = Application.GetRealWidth(359)});
+            topView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(188), X = Application.GetRealWidth(16), Width = Application.GetRealWidth(359) });
 
             #region 绀惧尯闂ㄧ閫氳
             var communityRow = new FrameLayout()
@@ -130,19 +130,21 @@
             };
             communityRow.AddChidren(btnCommunityAccessControlIcon);
 
-            btnCommunityAccessControlIcon.MouseUpEventHandler = (sender, e) => {
-                if(customerObj.faceClose == 3)//娌℃湁浜鸿劯鏁版嵁涓嶈兘寮�鍚汉鑴搁�氳鍔熻兘
+            btnCommunityAccessControlIcon.MouseUpEventHandler = (sender, e) =>
+            {
+                if (customerObj.faceClose == 3)//娌℃湁浜鸿劯鏁版嵁涓嶈兘寮�鍚汉鑴搁�氳鍔熻兘
                 {
                     return;
                 }
                 btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected;
-                int switchStatus = btnCommunityAccessControlIcon.IsSelected == true ? 1 :2;
+                int switchStatus = btnCommunityAccessControlIcon.IsSelected == true ? 1 : 2;
 
-                //澶辫触鍥炶皟
-                Action action = () => {
-                    btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected;
+                //鍒锋柊鍥炶皟
+                Action action = () =>
+                {
+                    initButtonStatus();
                 };
-                editFaceInfo(switchStatus,action);
+                editFaceInfo(switchStatus, action);
             };
 
             #endregion
@@ -175,7 +177,8 @@
                 IsBold = true,
             };
             contentView.AddChidren(btnSetFaceId);
-            btnSetFaceId.MouseUpEventHandler = (sender, e) => {
+            btnSetFaceId.MouseUpEventHandler = (sender, e) =>
+            {
                 LoadPictureOptionView();
             };
 
@@ -193,11 +196,13 @@
                 TextAlignment = TextAlignment.Center,
                 IsBold = true,
             };
-            btnEraseData.MouseUpEventHandler = (sender,e) => {
-                Action action = () => {
+            btnEraseData.MouseUpEventHandler = (sender, e) =>
+            {
+                Action action = () =>
+                {
                     initButtonStatus();
                 };
-                editFaceInfo(3,action);
+                editFaceInfo(3, action);
             };
 
             ReadFaceInfo();
@@ -206,10 +211,15 @@
         /// <summary>
         /// 鑾峰彇浜鸿劯淇℃伅
         /// </summary>
-        void ReadFaceInfo()
+        void ReadFaceInfo(bool isLoading = true)
         {
-            var waitPage = new Loading();
-            waitPage.Start();
+            Loading waitPage = null;
+            if (isLoading)
+            {
+                waitPage = new Loading();
+                waitPage.Start();
+            }
+
             new Thread(() =>
             {
                 try
@@ -232,13 +242,15 @@
 
                         }
                     }
-                }catch(Exception ex)
+                }
+                catch (Exception ex)
                 {
                     MainPage.Log($"璇诲彇浜鸿劯淇℃伅寮傚父:{ex.Message}");
                 }
                 finally
                 {
-                    Application.RunOnMainThread(() => {
+                    Application.RunOnMainThread(() =>
+                    {
                         if (waitPage != null)
                         {
                             waitPage.RemoveFromParent();
@@ -252,7 +264,7 @@
         /// <summary>
         /// 娓呴櫎浜鸿劯鏁版嵁
         /// </summary>
-        void editFaceInfo(int status,Action action)
+        void editFaceInfo(int status, Action action)
         {
             var waitPage = new Loading();
             waitPage.Start();
@@ -283,7 +295,8 @@
                 }
                 finally
                 {
-                    Application.RunOnMainThread(() => {
+                    Application.RunOnMainThread(() =>
+                    {
                         if (waitPage != null)
                         {
                             waitPage.RemoveFromParent();
@@ -311,9 +324,9 @@
                     return;
                 }
             }
-                btnCommunityAccessControlIcon.IsSelected = false;
-                btnEraseData.RemoveFromParent();
-                btnSetFaceId.TextID = StringId.SetFace;
+            btnCommunityAccessControlIcon.IsSelected = false;
+            btnEraseData.RemoveFromParent();
+            btnSetFaceId.TextID = StringId.SetFace;
         }
 
 
@@ -332,7 +345,7 @@
 
             pictureOptionView = new FrameLayout()
             {
-                Y = Application.GetRealHeight(445+50),
+                Y = Application.GetRealHeight(445 + 50),
                 Height = Application.GetRealHeight(250),
                 AnimateSpeed = 0.3f,
                 Animate = Animate.DownToUp,
@@ -411,7 +424,8 @@
             {
                 pictureOptionView.Parent.RemoveFromParent();
             };
-            btnTakePicture.MouseDownEventHandler = (sender, e) => {
+            btnTakePicture.MouseDownEventHandler = (sender, e) =>
+            {
                 btnTakePicture.IsSelected = true;
             };
             btnTakePicture.MouseUpEventHandler = (sender, e) =>
@@ -420,12 +434,13 @@
                 var imageName = Guid.NewGuid().ToString();
                 CropImage.TakePicture((imagePath) =>
                 {
-                    CropImageCallBack(imagePath,1,imageName);
+                    CropImageCallBack(imagePath, 1, imageName);
                 }, imageName, 4, 6, 400);
 
                 pictureOptionView.Parent.RemoveFromParent();
             };
-            btnAlbum.MouseDownEventHandler = (sender, e) => {
+            btnAlbum.MouseDownEventHandler = (sender, e) =>
+            {
                 btnAlbum.IsSelected = true;
             };
 
@@ -437,8 +452,8 @@
                 //var imageName = scene.sid;
                 CropImage.SelectPicture((imagePath) =>
                 {
-                    CropImageCallBack(imagePath,2,imageName);
-                }, imageName, 4, 6, 400);
+                    CropImageCallBack(imagePath, 2, imageName);
+                }, imageName, 4, 6, 400);//OutputYSize鐩墠浠呭Android鏈変簺 400浠h〃Y鐨勬渶澶氬垎杈ㄧ巼锛屾墍浠ユ渶缁堝緱鍒板浘鐗囩殑鍒嗚鲸鐜囦负锛�266*400
 
                 pictureOptionView.Parent.RemoveFromParent();
             };
@@ -446,14 +461,12 @@
         }
 
 
-
-
         /// <summary>
         /// 瑁佸壀瀹岀収鐗囧洖璋冿紝缁熶竴澶勭悊
         /// </summary>
         /// <param name="imagePath">瑁佸壀鍚庣殑鐪熷疄璺緞</param>
         /// <param name="imageSource">鐓х墖鏉ユ簮锛�1锛氭媿鐓э紱2锛氬浘搴�</param>
-        void CropImageCallBack(string selectImagePath,int imageSource,string imageName)
+        void CropImageCallBack(string selectImagePath, int imageSource, string imageName)
         {
             if (string.IsNullOrEmpty(selectImagePath) == true)
             {
@@ -462,7 +475,9 @@
             //涓婁紶鎴愬姛鍒板洖璋�
             Action<bool> uploadSuccessAction = (isSuccess) =>
             {
-                Action action = () => {
+                //鐐瑰嚮閲嶆柊褰曞叆浜嬩欢
+                Action action = () =>
+                {
                     if (!isSuccess)
                     {
                         if (imageSource == 1)
@@ -476,14 +491,17 @@
                         {
                             CropImage.SelectPicture((imagePath) =>
                             {
-                                CropImageCallBack(imagePath, 1,imageName);
+                                CropImageCallBack(imagePath, 1, imageName);
                             }, imageName, 4, 6, 400);
                         }
-                    }else
-                    {
-                        ReadFaceInfo();
                     }
                 };
+
+                if (isSuccess)
+                {
+                    ReadFaceInfo(false);
+                }
+
                 Application.RunOnMainThread(() =>
                 {
                     var page = new FaceSettingResultPage(action);

--
Gitblit v1.8.0