From 06696e6f225733a60b03eea4a7c6374053d92c1d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 14 四月 2020 14:15:35 +0800
Subject: [PATCH] 20200414

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

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
index 90e2a7e..0820be1 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
@@ -1,4 +1,6 @@
 锘縰sing System;
+using Shared;
+
 namespace HDL_ON.UI
 {
     public partial class PersonalDataPage
@@ -8,14 +10,93 @@
         /// </summary>
         void LoadEventList()
         {
+            LoadEvent_ChangeHeadImageView();
             LoadEvent_Logout();
         }
 
+        /// <summary>
+        /// 鍔犺浇閫夋嫨澶村儚閫夐」view
+        /// </summary>
+        void LoadEvent_ChangeHeadImageView()
+        {
+            userHeadImageView.MouseUpEventHandler = (sender, e) => {
+                LoadPictureOptionView();
+            };
+        }
+
+        /// <summary>
+        /// 閫�鍑鸿处鍙风櫥褰曚簨浠�
+        /// </summary>
         void LoadEvent_Logout()
         {
             btnLogout.MouseUpEventHandler += (sender, e) => {
-                MainPage.GoLoginPage(MainPage.LoginUser.AccountString);
+                MainPage.LoginUser.lastTime = DateTime.MinValue;
+                MainPage.LoginUser.SaveUserInfo();
+                MainPage.GoLoginPage(MainPage.LoginUser.accountString);
             };
         }
+
+
+        /// <summary>
+        /// 鍔犺浇鑳屾櫙鍥鹃�夋嫨鍖哄煙浜嬩欢鍒楄〃
+        /// </summary>
+        void LoadEvent_PictureOptionViewEventList()
+        {
+            pictureOptionView.MouseUpEventHandler = (sender, e) =>
+            {
+                pictureOptionView.RemoveFromParent();
+            };
+
+            btnCancel.MouseUpEventHandler = (sender, e) =>
+            {
+                pictureOptionView.RemoveFromParent();
+            };
+
+            btnTakePicture.MouseUpEventHandler = (sender, e) =>
+            {
+                var pid = Guid.NewGuid();
+                CropImage.TakePicture((Action<string>)((imagePath) =>
+                {
+                    if (imagePath != null)
+                    {
+                        MainPage.LoginUser.headImagePagePath = imagePath.ToString();
+                        userHeadImageView.ImagePath = imagePath.ToString();
+                        updataHeadImage();
+                        new System.Threading.Thread(() =>
+                        {
+                            new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath);
+                        })
+                        { IsBackground = true }.Start();
+                        MainPage.LoginUser.SaveUserInfo();
+                        MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
+                    }
+                }), pid.ToString(), 1, 1);
+                pictureOptionView.RemoveFromParent();
+            };
+
+            btnAlbum.MouseUpEventHandler = (sender, e) =>
+            {
+                var pid = Guid.NewGuid();
+                CropImage.SelectPicture((imagePath) =>
+                {
+                    if (imagePath != null)
+                    {
+                        MainPage.LoginUser.headImagePagePath = imagePath.ToString();
+                        userHeadImageView.ImagePath = imagePath.ToString();
+                        updataHeadImage();
+
+                        new System.Threading.Thread(() =>
+                        {
+                            new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath);
+                        })
+                        { IsBackground = true }.Start(); MainPage.LoginUser.SaveUserInfo();
+                        MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
+                    }
+                }, pid.ToString(), 1, 1);
+                pictureOptionView.RemoveFromParent();
+            };
+        }
+
+
     }
 }

--
Gitblit v1.8.0