From 4c40f503acf2bcf90d294cc439ef46ba259b9c60 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 02 十二月 2019 09:27:46 +0800
Subject: [PATCH] 新版本,如果 IOS 编译报错,先注释掉

---
 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