From 8060dedbec31cc9dbc33adae91b94b8a977c7163 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 30 十一月 2020 21:22:55 +0800
Subject: [PATCH] 2020-11-30 1.增加极光推送。2.住宅相关接口增加签名校验。 3.增加消息中心页面。4.UI优化。5.裁剪选取图片优化。

---
 HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs |  134 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 104 insertions(+), 30 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
index ee4a9d6..0b08af1 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
@@ -19,6 +19,7 @@
             LoadEvent_ChangeBindEmail();
             LoadEvent_ChangeBindPhone();
             LoadEvent_SkipModifyPassword();
+            LoadEvent_MyQRcode();
             GetUserInfo();
         }
 
@@ -68,6 +69,9 @@
             }).Start();
             #endregion
 
+            //2.娉ㄩ攢鎺ㄩ��
+            new HttpServerRequest().SignOutPush();
+            //3.璺宠浆鐧诲綍椤甸潰
             UserInfo.Current.LastTime = DateTime.MinValue;
             UserInfo.Current.SaveUserInfo();
             MainPage.GoLoginPage(UserInfo.Current);
@@ -114,23 +118,32 @@
             btnTakePicture.MouseUpEventHandler = (sender, e) =>
             {
                 btnTakePicture.IsSelected = false;
-                var pid = Guid.NewGuid();
-                CropImage.TakePicture((Action<string>)((imagePath) =>
+                //var pid = Guid.NewGuid();
+                //CropImage.TakePicture((Action<string>)((imagePath) =>
+                //{
+                //    if (imagePath != null)
+                //    {
+                //        UserInfo.Current.headImagePagePath = imagePath.ToString();
+                //        userHeadImageView.ImagePath = imagePath.ToString();
+                //        updataHeadImage();
+                //        new System.Threading.Thread(() =>
+                //        {
+                //            new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath);
+                //        })
+                //        { IsBackground = true }.Start();
+                //        UserInfo.Current.SaveUserInfo();
+                //        MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
+                //    }
+                //}), pid.ToString(), 1, 1);
+
+                //鎷嶇収瑁佸壀
+                var imageName = Guid.NewGuid().ToString() + ".png";
+                CropImage.TakePicture((imagePath) =>
                 {
-                    if (imagePath != null)
-                    {
-                        UserInfo.Current.headImagePagePath = imagePath.ToString();
-                        userHeadImageView.ImagePath = imagePath.ToString();
-                        updataHeadImage();
-                        new System.Threading.Thread(() =>
-                        {
-                            new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath);
-                        })
-                        { IsBackground = true }.Start();
-                        UserInfo.Current.SaveUserInfo();
-                        MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
-                    }
-                }), pid.ToString(), 1, 1);
+                    CropImageCallBack(imagePath, imageName);
+
+                }, imageName, 1, 1);
+
                 pictureOptionView.RemoveFromParent();
                 baseView.RemoveFromParent();
             };
@@ -143,26 +156,67 @@
             btnAlbum.MouseUpEventHandler = (sender, e) =>
             {
                 btnAlbum.IsSelected = false;
-                var pid = Guid.NewGuid();
+                //var pid = Guid.NewGuid();
+                //CropImage.SelectPicture((imagePath) =>
+                //{
+                //    if (imagePath != null)
+                //    {
+                //        UserInfo.Current.headImagePagePath = imagePath.ToString();
+                //        userHeadImageView.ImagePath = imagePath.ToString();
+                //        updataHeadImage();
+
+                //        new System.Threading.Thread(() =>
+                //        {
+                //            new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath);
+                //        })
+                //        { IsBackground = true }.Start(); UserInfo.Current.SaveUserInfo();
+                //        MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
+                //    }
+                //}, pid.ToString(), 1, 1);
+
+                //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
+                var imageName = Guid.NewGuid().ToString() + ".png";
                 CropImage.SelectPicture((imagePath) =>
                 {
-                    if (imagePath != null)
-                    {
-                        UserInfo.Current.headImagePagePath = imagePath.ToString();
-                        userHeadImageView.ImagePath = imagePath.ToString();
-                        updataHeadImage();
+                    CropImageCallBack(imagePath, imageName);
+                }, imageName, 1, 1);
 
-                        new System.Threading.Thread(() =>
-                        {
-                            new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath);
-                        })
-                        { IsBackground = true }.Start(); UserInfo.Current.SaveUserInfo();
-                        MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
-                    }
-                }, pid.ToString(), 1, 1);
                 pictureOptionView.RemoveFromParent();
                 baseView.RemoveFromParent();
             };
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="imagePath"></param>
+        /// <param name="imageName"></param>
+        void CropImageCallBack(string imagePath, string imageName)
+        {
+            if (string.IsNullOrEmpty(imagePath) == true)
+            {
+                return;
+            }
+            //鍒犻櫎鍘熸潵鏈湴澶村儚
+            System.IO.File.Delete(userHeadImageView.ImagePath);
+            Utlis.WriteLine("鍒犻櫎: " + userHeadImageView.ImagePath);
+
+            MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
+            //userHeadImageView.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
+            FileUtils.FileCopyToRootPath(imagePath, imageName);
+            System.IO.File.Delete(imagePath);
+            //鐢熸垚鍥剧墖
+            //Shared.IO.FileUtils.WriteFileByBytes(imageName, userHeadImageView.ImageBytes);
+            UserInfo.Current.headImagePagePath = imageName;
+            userHeadImageView.ImagePath = imageName;
+            updataHeadImage();
+
+            new System.Threading.Thread(() =>
+            {
+                new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imageName);
+            })
+            { IsBackground = true }.Start(); UserInfo.Current.SaveUserInfo();
+
         }
 
         /// <summary>
@@ -231,6 +285,26 @@
             btnEditUserNameIcon.MouseUpEventHandler = eventHandler;
         }
 
+        /// <summary>
+        /// 鍔犺浇鎴戠殑浜岀淮鐮佷簨浠�
+        /// </summary>
+        void LoadEvent_MyQRcode()
+        {
+            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+            {
+                //鎴戠殑浜岀淮鐮�
+                var aep = new MyQRCodePage();
+                MainPage.BasePageView.AddChidren(aep);
+                aep.LoadPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+            };
+            _QRcodeView.MouseUpEventHandler = eventHandler;
+            btnQRcode.MouseUpEventHandler = eventHandler;
+            btnQRcodeIcon.MouseUpEventHandler = eventHandler;
+            btnQRcodeRight.MouseUpEventHandler = eventHandler;
+        }
+
         #region 淇敼缁戝畾閭
         /// <summary>
         /// 淇敼缁戝畾閭

--
Gitblit v1.8.0