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/RoomListManage/RoomEditPageBLL.cs | 74 +++++++++++++++++++++++++++++-------- 1 files changed, 58 insertions(+), 16 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs index d59d8c0..a74fd3e 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs @@ -228,16 +228,23 @@ btnTakePicture.MouseUpEventHandler = (sender, e) => { btnTakePicture.IsSelected = false; - var pid = Guid.NewGuid(); + //var pid = Guid.NewGuid(); + //CropImage.TakePicture((imagePath) => + //{ + // if (imagePath != null) + // { + // btnRoomBg.ImagePath = imagePath.ToString(); + // room.backgroundImage = btnRoomBg.ImagePath; + // MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + // } + //}, pid.ToString(), 16, 9); + + var imageName = Guid.NewGuid().ToString() + ".png"; CropImage.TakePicture((imagePath) => { - if (imagePath != null) - { - btnRoomBg.ImagePath = imagePath.ToString(); - room.backgroundImage = btnRoomBg.ImagePath; - MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); - } - }, pid.ToString(), 16, 9); + CropImageCallBack(imagePath, imageName); + }, imageName.ToString(), 17, 9); + if (pageTitleId == StringId.EditRoomInfo) { room.SaveRoomData(); @@ -251,22 +258,57 @@ btnAlbum.MouseUpEventHandler = (sender, e) => { btnAlbum.IsSelected = false; - var pid = Guid.NewGuid(); + //var pid = Guid.NewGuid(); + //CropImage.SelectPicture((imagePath) => + //{ + // if (imagePath != null) + // { + // btnRoomBg.ImagePath = imagePath.ToString(); + // room.backgroundImage = btnRoomBg.ImagePath; + // MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + // } + //}, pid.ToString(), 16, 9); + + //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀 + var imageName = Guid.NewGuid().ToString() + ".png"; CropImage.SelectPicture((imagePath) => { - if (imagePath != null) - { - btnRoomBg.ImagePath = imagePath.ToString(); - room.backgroundImage = btnRoomBg.ImagePath; - MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); - } - }, pid.ToString(), 16, 9); + CropImageCallBack(imagePath, imageName); + }, imageName, 17, 9); + + if (pageTitleId == StringId.EditRoomInfo) { room.SaveRoomData(); } baseView.RemoveFromParent(); + }; } + + /// <summary> + /// + /// </summary> + /// <param name="imagePath"></param> + /// <param name="imageName"></param> + void CropImageCallBack(string imagePath, string imageName) + { + if (string.IsNullOrEmpty(imagePath) == true) + { + return; + } + //濡傛灉鏄嚜瀹氫箟鍥剧墖鍒犻櫎涔嬪墠鐨� + if (!btnRoomBg.ImagePath.Contains("Room")) { + Utlis.WriteLine("鍒犻櫎: " + btnRoomBg.ImagePath); + System.IO.File.Delete(btnRoomBg.ImagePath); + } + + MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); + FileUtils.FileCopyToRootPath(imagePath, imageName); + System.IO.File.Delete(imagePath); + //鐢熸垚鍥剧墖 + room.backgroundImage = imageName; + btnRoomBg.ImagePath = imageName; + } } } \ No newline at end of file -- Gitblit v1.8.0