From 673a93f4ed742a10a879a67b616e6646b03ef0fb Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 15 九月 2020 17:14:27 +0800
Subject: [PATCH] 202009151
---
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs | 191 ++++++++++++++++++++++++-----------------------
1 files changed, 99 insertions(+), 92 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
index 77e9d49..599a367 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
@@ -31,77 +31,11 @@
/// </summary>
void LoadEvent_SwitchHome()
{
-#if DEBUG
- btnUserTypeName.MouseUpEventHandler = (sender, e) =>
- {
- var pm = new HDL_ON.DAL.Server.HttpServerRequest();
- var iddd = pm.GetRegionLastBackupId();
- Dialog dialog = new Dialog();
- FrameLayout bodyView = new FrameLayout();
- dialog.AddChidren(bodyView);
- bodyView.MouseUpEventHandler = (sender3, e3) => {
- dialog.Close();
- };
-
- FrameLayout frame = new FrameLayout()
- {
- Gravity = Gravity.Center,
- Width = Application.GetRealWidth(280),
- Height =Application.GetRealHeight(300),
- BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
- Radius = (uint)Application.GetRealWidth(16),
- };
- dialog.AddChidren(frame);
-
- Button btnTitleDialog = new Button()
- {
- Height = Application.GetRealHeight(60),
- TextAlignment = TextAlignment.Center,
- Text = "鏁版嵁鎭㈠",
- TextSize = CSS.CSS_FontSize.SubheadingFontSize,
- TextColor = CSS.CSS_Color.SecondLevelTitleColor,
- BackgroundColor = CSS.CSS_Color.PromptingColor2,
- };
- frame.AddChidren(btnTitleDialog);
-
- VerticalScrolViewLayout view = new VerticalScrolViewLayout()
- {
- Y = Application.GetRealHeight(60),
- Height = Application.GetRealHeight(240),
- };
- frame.AddChidren(view);
-
- foreach(var dd in iddd)
- {
- Button btn = new Button()
- {
- Height = Application.GetRealHeight(50),
- TextAlignment = TextAlignment.Center,
- TextSize = CSS.CSS_FontSize.TextFontSize,
- TextColor = CSS.CSS_Color.TextualColor,
- Text = dd.Value,
- };
- view.AddChidren(btn);
-
- btn.MouseUpEventHandler = (sender1, e1) =>
- {
- dialog.Close();
- pm.GetBackupFileList(dd.Key);
- };
-
- view.AddChidren(new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Height = Application.GetRealHeight(1),
- BackgroundColor = CSS.CSS_Color.BackgroundColor
- });
- }
-
- dialog.Show();
-
+ btnAboutOnText.MouseUpEventHandler = (sender, e) => {
+ DAL.Net.Mqtt_Cloud.StartCloudMqtt();
};
-#endif
+
EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
var dialog = new Dialog();
var dialogBody = new FrameLayout();
@@ -112,27 +46,80 @@
var dispalyView = new FrameLayout()
{
- X = Application.GetRealWidth(22),
+ X = Application.GetRealWidth(10),
Y = Application.GetRealHeight(268),
Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(198),
- BackgroundImagePath = "PersonalCenter/HomeListbg.png",
+ Height = Application.GetRealHeight(110),
+ BackgroundImagePath = "PersonalCenter/HomeList1bg.png",
};
dialogBody.AddChidren(dispalyView);
- var contentView = new VerticalScrolViewLayout() {
- X = Application.GetRealWidth(8),
+ var contentView = new VerticalScrolViewLayout()
+ {
+ X = Application.GetRealWidth(22),
Y = Application.GetRealHeight(15),
Width = Application.GetRealWidth(150),
- Height = Application.GetRealHeight(45*4),
+ Height = Application.GetRealHeight(45 ),
+ ScrollEnabled = false
};
dispalyView.AddChidren(contentView);
- foreach(var home in MainPage.LoginUser.regionList)
+ if (MainPage.LoginUser.regionList.Count < 3)
+ {
+ }
+ else if (MainPage.LoginUser.regionList.Count < 4)
+ {
+ dispalyView = new FrameLayout()
+ {
+ X = Application.GetRealWidth(10),
+ Y = Application.GetRealHeight(268),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(155),
+ BackgroundImagePath = "PersonalCenter/HomeList2bg.png",
+ };
+ dialogBody.AddChidren(dispalyView);
+
+ contentView.Height = Application.GetRealHeight(45 * 3);
+ dispalyView.AddChidren(contentView);
+ }
+ else if (MainPage.LoginUser.regionList.Count < 5)
+ {
+ dispalyView = new FrameLayout()
+ {
+ X = Application.GetRealWidth(10),
+ Y = Application.GetRealHeight(268),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(200),
+ BackgroundImagePath = "PersonalCenter/HomeList3bg.png",
+ };
+ dialogBody.AddChidren(dispalyView);
+
+ contentView.Height = Application.GetRealHeight(45 * 4);
+ dispalyView.AddChidren(contentView);
+ }
+ else
+ {
+ dispalyView = new FrameLayout()
+ {
+ X = Application.GetRealWidth(10),
+ Y = Application.GetRealHeight(268),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(245),
+ BackgroundImagePath = "PersonalCenter/HomeList4bg.png",
+ };
+ dialogBody.AddChidren(dispalyView);
+
+ contentView.Height = Application.GetRealHeight(45 * 5);
+ contentView.ScrollEnabled = true;
+ dispalyView.AddChidren(contentView);
+ }
+
+
+
+ foreach (var home in MainPage.LoginUser.regionList)
{
var btnHomeName = new Button()
{
- Gravity = Gravity.CenterHorizontal,
Width = Application.GetRealWidth(112),
Height = Application.GetRealHeight(44),
TextAlignment = TextAlignment.CenterLeft,
@@ -145,13 +132,11 @@
Tag = home.RegionID
};
contentView.AddChidren(btnHomeName);
- //if(btnHomeName)
if (MainPage.LoginUser.regionList.IndexOf(home) < MainPage.LoginUser.regionList.Count - 1)
{
contentView.AddChidren(new Button()
{
- Gravity = Gravity.CenterHorizontal,
Width = Application.GetRealWidth(112),
Height = Application.GetRealHeight(1),
BackgroundColor = CSS.CSS_Color.BackgroundColor
@@ -162,24 +147,31 @@
{
var regionId = (string)btnHomeName.Tag;
dialog.Close();
+ //DB_ResidenceData.residenceData.CurReginID = regionId;
LoadEvent_ChangeCurHome(MainPage.LoginUser.regionList.Find((obj) => obj.RegionID == regionId));
-
+ LoadContentView();
};
}
-
dialog.Show();
};
btnResidenceDownIcon.MouseUpEventHandler = eventHandler;
btnCurResidenceName.MouseUpEventHandler = eventHandler;
}
-
+ /// <summary>
+ /// 鏇存崲褰撳墠閫変腑浣忓畢
+ /// </summary>
+ /// <param name="homeTemp"></param>
void LoadEvent_ChangeCurHome(RegionInfoRes homeTemp)
{
if (DB_ResidenceData.residenceData.CurReginID == homeTemp.RegionID)
{
return;
}
+ string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString());
+ string newRegionRootPath = FileUtils.CreateRegionBackup(homeTemp.RegionID.ToString());
+ DB_ResidenceData.residenceData.CurReginID = homeTemp.RegionID;
+ DB_ResidenceData.residenceData.SaveResidenceData();
var waitPage = new Loading();
new System.Threading.Thread(() =>
{
@@ -187,11 +179,15 @@
{
var backuplist = FileUtils.ReadFiles();
int index = 0;
- string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString());
FileUtils.DeleteRegionFiles(oldRegionRootPath);
+ //绉诲姩鏂囦欢
foreach (var fileName in backuplist)
{
System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName);
+ if(fileName == "headImage.png")
+ {
+ continue;
+ }
if (fileInfo.Exists)
{
fileInfo.MoveTo(oldRegionRootPath + fileName);
@@ -204,9 +200,16 @@
waitPage.Text = pro.ToString() + "%";
});
}
- FileUtils.DeleteAllFile();
+ //鍒犻櫎鏈湴鏂囦欢
+ foreach (var fileName in backuplist)
+ {
+ if (fileName == "headImage.png")
+ {
+ continue;
+ }
+ FileUtils.DeleteFile(fileName);
+ }
//鍊掑嚭鏂颁綇瀹呮暟鎹�
- string newRegionRootPath = FileUtils.CreateRegionBackup(homeTemp.RegionID.ToString());
FileUtils.RestoreRegionFiles(newRegionRootPath);
MainPage.LoginUser.SaveUserInfo();
DB_ResidenceData.residenceData.EixtAccount();
@@ -217,8 +220,6 @@
Application.RunOnMainThread(() =>
{
btnCurResidenceName.Text = DB_ResidenceData.residenceData.residecenInfo.Name;
- //new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.SwitchRegionSuccessfully),
- // Language.StringByID(StringId.Close)).Show();
});
}
catch (Exception ex)
@@ -241,7 +242,6 @@
})
{ IsBackground = true }.Start();
}
-
#endregion
#region 浣忓畢绠$悊
@@ -268,19 +268,26 @@
#region 涓汉涓績
void LoadEvent_GoPersonalDataPage()
{
- userHeadImageView.MouseUpEventHandler += (sender, e) => {
- Action updataHeadImage = () => {
+ EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+ {
+ Action updataHeadImage = () =>
+ {
userHeadImageView.ImagePath = MainPage.LoginUser.headImagePagePath;
};
- Action updataUserName = () => {
+ Action updataUserName = () =>
+ {
btnUserName.Text = MainPage.LoginUser.userName;
};
- var personalDataView = new PersonalDataPage(updataHeadImage,updataUserName);
+ var personalDataView = new PersonalDataPage(updataHeadImage, updataUserName);
MainPage.BasePageView.AddChidren(personalDataView);
personalDataView.LoadView();
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
+ userHeadImageView.MouseUpEventHandler = eventHandler;
+ btnUserName.MouseUpEventHandler = eventHandler;
+ btnEmail.MouseUpEventHandler = eventHandler;
+
}
#endregion
--
Gitblit v1.8.0