From aeb4af0cadfaca52c9bfbe5257df285ad0cc2f39 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期三, 04 十二月 2019 15:34:09 +0800
Subject: [PATCH] 2019-12-04-1
---
ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 37 +++++++++++++++++++++++--------------
1 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
index 6f68a33..d1e2ed5 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -59,23 +59,33 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ //鎴块棿鍥剧墖
+ var framePic = new FrameLayout();
+ framePic.Y = Application.GetRealHeight(60);
+ framePic.Width = Application.GetMinRealAverage(887);
+ framePic.Height = Application.GetMinRealAverage(444);
+ framePic.Gravity = Gravity.CenterHorizontal;
+ framePic.Radius = 8;
+ framePic.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
+ bodyFrameLayout.AddChidren(framePic);
var btnPic = new ImageView();
- btnPic.Y = Application.GetRealHeight(60);
- btnPic.Width = Application.GetMinRealAverage(887);
- btnPic.Height = Application.GetMinRealAverage(444);
- btnPic.Gravity = Gravity.CenterHorizontal;
btnPic.Radius = 8;
- btnPic.ImagePath = this.editorRoom.BackgroundImage;
- bodyFrameLayout.AddChidren(btnPic);
+ framePic.AddChidren(btnPic);
+ if (this.editorRoom.BackgroundImageType == 0)
+ {
+ btnPic.ImagePath = this.editorRoom.BackgroundImage;
+ }
+ else
+ {
+ btnPic.ImageBytes = Common.Global.ReadFileByHomeId(this.editorRoom.BackgroundImage);
+ }
btnPic.MouseUpEventHandler += (sender, e) =>
{
//鎴块棿鍥剧墖閫夋嫨
this.RoomPictrueSelect(btnPic);
};
//娣诲姞闃村奖鐗规晥
- var btnTemp = new ButtonBase();
- btnTemp.AddBottomShadow(btnPic, true);
- btnTemp = null;
+ framePic.SetViewShadow(true);
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
@@ -181,13 +191,12 @@
if (editorRoom.BackgroundImageType == 1 || editorRoom.BackgroundImageType == 2)
{
//鍒犻櫎鎺夊師鏉ョ殑鑷畾涔夊浘鐗�
- if (System.IO.File.Exists(editorRoom.BackgroundImage) == true)
+ if (Common.Global.IsExistsByHomeId(editorRoom.BackgroundImage) == true)
{
- System.IO.File.Delete(editorRoom.BackgroundImage);
+ Common.Global.DeleteFilebyHomeId(editorRoom.BackgroundImage);
}
//澶囦唤
- string[] MyArry = editorRoom.BackgroundImage.Split(new string[] { "/", @"\" }, StringSplitOptions.RemoveEmptyEntries);
- HdlAutoBackupLogic.DeleteFile(MyArry[MyArry.Length - 1]);
+ HdlAutoBackupLogic.DeleteFile(editorRoom.BackgroundImage);
}
//鑷畾涔夊浘鐗�
if (cloneRoom.BackgroundImageType == 1 || cloneRoom.BackgroundImageType == 2)
@@ -196,7 +205,7 @@
string picName = $"RoomIcon_{DateTime.Now.ToString("yyyyMMddHHmmss")}.png";
string picFullName = System.IO.Path.Combine(Common.Config.Instance.FullPath, picName);
Shared.IO.FileUtils.WriteFileByBytes(picFullName, btnPic.ImageBytes);
- cloneRoom.BackgroundImage = picFullName;
+ cloneRoom.BackgroundImage = picName;
//澶囦唤
HdlAutoBackupLogic.AddOrEditorFile(picName);
}
--
Gitblit v1.8.0