From a1b0ab7044100daaa7e0f1da2d2ca45e38098963 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:13:25 +0800
Subject: [PATCH] 2021-3-29-2
---
HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPage.cs | 457 ++++++++++++++++++++------------------------------------
1 files changed, 166 insertions(+), 291 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPage.cs
index e586f15..99001ef 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPage.cs
@@ -1,311 +1,186 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using HDL_ON.DAL.Server;
-using HDL_ON.Entity;
-using HDL_ON.UI.CSS;
-using Newtonsoft.Json.Linq;
-using Shared;
-namespace HDL_ON.UI
-{
- public class ChooseShareMemberTargetListPage : FrameLayout
- {
- ChooseShareMemberTargetListPage bodyView;
- VerticalScrolViewLayout contentView;
- Loading waitPage;
- byte[] sharedBytes;
- List<ResidenceMemberInfo> residenceMemberInfos;
- public ChooseShareMemberTargetListPage(byte[] sd)
- {
- residenceMemberInfos = new List<ResidenceMemberInfo>();
- sharedBytes = sd;
- bodyView = this;
- }
+锘�//using System.Collections.Generic;
+//using HDL_ON.DAL.Server;
+//using HDL_ON.Entity;
+//using HDL_ON.UI.CSS;
+//using Shared;
- /// <summary>
- /// 璋冪敤鑾峰彇浣忓畢瀛愯处鍙蜂俊鎭�
- /// </summary>
- bool LoadMethod_GetResidenceMemberAccount()
- {
- var result = false;
- ResponsePack responePack = new HttpServerRequest().GetResidenceMemberAccount();
- if (responePack.StateCode.ToUpper() == "SUCCESS")
- {
- var responeObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ResidenceMemberInfo>>(responePack.ResponseData.ToString());
- foreach (var mInfo in responeObj)
- {
- ResponsePack memberInfoResponePack = new HttpServerRequest().GetResidenceMemberAccountInfo(mInfo.Account);
- var dataStr = JObject.FromObject(memberInfoResponePack.ResponseData);
- FileStream fs = null;
- try
- {
- var headImageString = dataStr.GetValue("HeadImage").ToString();
- var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(headImageString);
- var headImageBytes = Newtonsoft.Json.JsonConvert.DeserializeObject<byte[]>(jsonString);
- var filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/", mInfo.DistributedMark + ".png");
- fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
- fs.Write(headImageBytes, 0, headImageBytes.Length);
- fs.Flush();
- mInfo.headImagePagePath = filePath;
- }
- catch (Exception ex)
- {
- MainPage.Log($"download headImage error : {ex.Message}");
- }
- finally
- {
- if (fs != null)
- {
- fs.Close();
- }
- }
- residenceMemberInfos.Add(mInfo);
- }
- result = true;
- }
- //澶辫触
- else
- {
- string tipStr = "Sever erorr";
- switch (responePack.StateCode)
- {
- case "ValidCodeAndPhoneNoEqual":
- tipStr = Language.StringByID(StringId.VerificationCodeError);
- break;
- case "USERNAMEORPWDERROR":
- tipStr = Language.StringByID(StringId.LoginFailed_AccountOrPasswordError);
- break;
- case "ACCOUNTNOEXISTS":
- tipStr = Language.StringByID(StringId.ACCOUNTNOEXISTS);
- break;
- case "NoRecord":
- tipStr = Language.StringByID(StringId.PlsGetTheVerificationCode);
- break;
- case "Self:Net_Error":
- tipStr = Language.StringByID(StringId.NetworkAnomaly);
- break;
- }
- //璐﹀彿鎴栬�呭瘑鐮侀敊璇�
- Application.RunOnMainThread(() =>
- {
- waitPage.Hide();
- //鎻愮ず鍘熷洜
- var tip = new Tip()
- {
- Text = tipStr,
- CloseTime = 3,
- Direction = AMPopTipDirection.None
- };
- tip.Show(bodyView);
- });
- }
- Application.RunOnMainThread(() =>
- {
- waitPage?.Hide();
- });
- return result;
- }
+//namespace HDL_ON.UI
+//{
+// /// <summary>
+// /// 鍔犺浇闇�瑕佸垎浜埌瀛愯处鍙风殑閫夋嫨鐣岄潰
+// /// </summary>
+// public partial class ChooseShareMemberTargetListPage : FrameLayout
+// {
+// ChooseShareMemberTargetListPage bodyView;
+// VerticalScrolViewLayout contentView;
+// Button btnOption;
+// Loading waitPage;
+// List<ShareData> addFuns;
+// List<ResidenceMemberInfo> memberList;
+// ResidenceMemberInfo memberInfo;
- /// <summary>
- /// 鍔犺浇鑾峰彇浣忓畢瀛愯处鍙蜂俊鎭嚎绋�
- /// </summary>
- Thread LoadThread_GetResidenceMemberAccount()
- {
- var thread = new Thread(() =>
- {
- try
- {
- residenceMemberInfos.Clear();
- var loginResult = LoadMethod_GetResidenceMemberAccount();
- if (loginResult)
- {
- Application.RunOnMainThread(() =>
- {
- LoadMemberRow();
- });
- }
- }
- catch (Exception ex)
- {
- MainPage.Log($"LoadThread_GetResidenceMemberAccount : {ex.Message}");
- }
- finally
- {
- Application.RunOnMainThread(() =>
- {
- if (waitPage != null)
- {
- waitPage.RemoveFromParent();
- waitPage = null;
- }
- });
- }
- })
- { IsBackground = true };
- return thread;
- }
+// public ChooseShareMemberTargetListPage(List<ShareData> funs, ResidenceMemberInfo mInfo)
+// {
+// memberList = new List<ResidenceMemberInfo>();
+// addFuns = funs;
+// bodyView = this;
+// memberInfo = mInfo;
+// }
- public void LoadPage()
- {
- //鍒涘缓璇诲彇鎴愬憳璐﹀彿绾跨▼
- var thread = LoadThread_GetResidenceMemberAccount();
- waitPage = new Loading();
- new PublicAssmebly().LoadPage_WaitPage(thread, bodyView, waitPage);
+// public void LoadPage()
+// {
+// //鍒涘缓璇诲彇鎴愬憳璐﹀彿绾跨▼
+// var thread = LoadThread_GetResidenceMemberAccount();
+// waitPage = new Loading();
+// new PublicAssmebly().LoadPage_WaitPage(thread, bodyView, waitPage);
+// bodyView.BackgroundColor = CSS_Color.BackgroundColor;
+// new TopViewDiv(bodyView, Language.StringByID(StringId.Shared)).LoadTopView();
- bodyView.BackgroundColor = CSS_Color.BackgroundColor;
- new TopViewDiv(bodyView, Language.StringByID(StringId.Shared)).LoadTopView();
+// #region title view
+// FrameLayout titleView = new FrameLayout()
+// {
+// Y = Application.GetRealHeight(72),
+// Height = Application.GetRealHeight(44),
+// BackgroundColor = CSS_Color.MainBackgroundColor,
+// };
+// bodyView.AddChidren(titleView);
- #region title view
- FrameLayout titleView = new FrameLayout()
- {
- Y = Application.GetRealHeight(72),
- Height = Application.GetRealHeight(44),
- BackgroundColor = CSS_Color.MainBackgroundColor,
- };
- bodyView.AddChidren(titleView);
+// Button btnTitle = new Button()
+// {
+// X = Application.GetRealWidth(16),
+// TextColor = CSS_Color.FirstLevelTitleColor,
+// TextID = StringId.SharedTo,
+// TextSize = CSS_FontSize.SubheadingFontSize,
+// TextAlignment = TextAlignment.CenterLeft,
+// IsBold = true,
+// };
+// titleView.AddChidren(btnTitle);
- Button btnTitle = new Button()
- {
- X = Application.GetRealWidth(16),
- TextColor = CSS_Color.FirstLevelTitleColor,
- TextID = StringId.SharedTo,
- TextSize = CSS_FontSize.SubheadingFontSize,
- TextAlignment = TextAlignment.CenterLeft,
- IsBold = true,
- };
- titleView.AddChidren(btnTitle);
+// titleView.AddChidren(new Button() {
+// X = Application.GetRealWidth(16),
+// Y = Application.GetRealHeight(43),
+// Height = Application.GetRealHeight(1),
+// BackgroundColor = CSS_Color.DividingLineColor,
+// });
+// #endregion
- titleView.AddChidren(new Button() {
- X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(43),
- Height = Application.GetRealHeight(1),
- BackgroundColor = CSS_Color.DividingLineColor,
- });
- #endregion
+// contentView = new VerticalScrolViewLayout()
+// {
+// Y = titleView.Bottom,
+// Height = Application.GetRealHeight(420),
+// //BackgroundColor = CSS_Color.MainBackgroundColor,
+// };
+// bodyView.AddChidren(contentView);
- contentView = new VerticalScrolViewLayout()
- {
- Y = titleView.Bottom,
- Height = Application.GetRealHeight(420),
- //BackgroundColor = CSS_Color.MainBackgroundColor,
- };
- bodyView.AddChidren(contentView);
+// LoadMemberRow();
- LoadMemberRow();
+// btnOption = new Button()
+// {
+// Y = Application.GetRealHeight(519 + 64),
+// Gravity = Gravity.CenterHorizontal,
+// Width = Application.GetRealWidth(220),
+// Height = Application.GetRealWidth(44),
+// BackgroundColor = CSS_Color.MainColor,
+// TextAlignment = TextAlignment.Center,
+// TextColor = CSS_Color.MainBackgroundColor,
+// TextID = StringId.ConfirmShared,
+// TextSize = CSS_FontSize.SubheadingFontSize,
+// IsBold = true,
+// Radius = (uint)Application.GetRealWidth(22),
+// BorderColor = 0x00000000,
+// BorderWidth = 0,
+// };
+// bodyView.AddChidren(btnOption);
- btnOption = new Button()
- {
- Y = Application.GetRealHeight(519 + 64),
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(220),
- Height = Application.GetRealHeight(44),
- BackgroundColor = CSS_Color.MainColor,
- TextAlignment = TextAlignment.Center,
- TextColor = CSS_Color.MainBackgroundColor,
- TextID = StringId.ConfirmShared,
- TextSize = CSS_FontSize.SubheadingFontSize,
- IsBold = true,
- Radius = (uint)Application.GetRealWidth(22),
- BorderColor = 0x00000000,
- BorderWidth = 0,
- };
- bodyView.AddChidren(btnOption);
+// LoadEvent_SharedData();
+// }
- }
- Button btnOption;
+// /// <summary>
+// /// 鍔犺浇鎴愬憳鍒楄〃鍖哄煙
+// /// </summary>
+// void LoadMemberRow()
+// {
+// contentView.RemoveAll();
+// int index = 1;
+// foreach (var mInfo in memberList)
+// {
+// FrameLayout memberRow = new FrameLayout()
+// {
+// Height = Application.GetRealWidth(65),
+// BackgroundColor = CSS_Color.MainBackgroundColor,
+// };
+// contentView.AddChidren(memberRow);
- /// <summary>
- /// 鍔犺浇鎴愬憳鍒楄〃鍖哄煙
- /// </summary>
- void LoadMemberRow()
- {
- contentView.RemoveAll();
+// var memberHeadImageView = new ImageView()
+// {
+// X = Application.GetRealWidth(16),
+// Gravity = Gravity.CenterVertical,
+// Width = Application.GetMinRealAverage(36),
+// Height = Application.GetMinRealAverage(36),
+// Radius = (uint)Application.GetMinRealAverage(24),
+// ImagePath = mInfo.headImagePagePath,
+// };
+// memberRow.AddChidren(memberHeadImageView);
- //List<ResidenceMemberInfo> residenceMemberInfos = new List<ResidenceMemberInfo>();
- int index = 1;
- foreach (var mInfo in residenceMemberInfos)
- {
- FrameLayout memberRow = new FrameLayout()
- {
- Height = Application.GetRealWidth(65),
- BackgroundColor = CSS_Color.MainBackgroundColor,
- };
- contentView.AddChidren(memberRow);
+// Button btnMemberName = new Button()
+// {
+// X = Application.GetRealWidth(64),
+// Y = Application.GetRealWidth(10),
+// //Width = Application.GetRealWidth(300),
+// Height = Application.GetRealWidth(24),
+// TextAlignment = TextAlignment.CenterLeft,
+// TextColor = CSS_Color.FirstLevelTitleColor,
+// TextSize = CSS_FontSize.TextFontSize,
+// Text = mInfo.UserName,
+// };
+// memberRow.AddChidren(btnMemberName);
- var memberHeadImageView = new ImageView()
- {
- X = Application.GetRealWidth(16),
- Gravity = Gravity.CenterVertical,
- Width = Application.GetMinRealAverage(36),
- Height = Application.GetMinRealAverage(36),
- Radius = (uint)Application.GetMinRealAverage(24),
- ImagePath = mInfo.headImagePagePath,
- };
- memberRow.AddChidren(memberHeadImageView);
+// Button btnMemberMail = new Button()
+// {
+// X = Application.GetRealWidth(64),
+// Y = btnMemberName.Bottom,
+// //Width = Application.GetRealWidth(300),
+// Height = Application.GetRealWidth(21),
+// TextAlignment = TextAlignment.CenterLeft,
+// TextColor = CSS_Color.PromptingColor1,
+// TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+// Text = mInfo.Account,
+// };
+// memberRow.AddChidren(btnMemberMail);
- Button btnMemberName = new Button()
- {
- X = Application.GetRealWidth(64),
- Y = Application.GetRealWidth(10),
- Width = Application.GetRealWidth(300),
- Height = Application.GetRealWidth(24),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.FirstLevelTitleColor,
- TextSize = CSS_FontSize.TextFontSize,
- Text = mInfo.UserName,
- };
- memberRow.AddChidren(btnMemberName);
+// Button btnChoose = new Button()
+// {
+// X = Application.GetRealWidth(331),
+// Gravity = Gravity.CenterVertical,
+// Width = Application.GetMinRealAverage(28),
+// Height = Application.GetMinRealAverage(28),
+// UnSelectedImagePath = "Public/ChooseIcon.png",
+// SelectedImagePath = "Public/ChooseOnIcon.png",
+// IsSelected = true,
+// };
+// memberRow.AddChidren(btnChoose);
- Button btnMemberMail = new Button()
- {
- X = Application.GetRealWidth(64),
- Y = btnMemberName.Bottom,
- Width = Application.GetRealWidth(300),
- Height = Application.GetRealWidth(21),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.PromptingColor1,
- TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Text = mInfo.Account,
- };
- memberRow.AddChidren(btnMemberMail);
+// if (memberList.Count > index)
+// {
+// memberRow.AddChidren(new Button()
+// {
+// Y = Application.GetRealHeight(64),
+// Gravity = Gravity.CenterHorizontal,
+// Width = Application.GetRealWidth(343),
+// Height = Application.GetRealHeight(1),
+// BackgroundColor = CSS_Color.DividingLineColor,
+// });
+// }
+// index++;
- Button btnChoose = new Button()
- {
- X = Application.GetRealWidth(331),
- Gravity = Gravity.CenterVertical,
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
- UnSelectedImagePath = "Public/ChooseIcon.png",
- SelectedImagePath = "Public/ChooseOnIcon.png",
- IsSelected = true,
- };
- memberRow.AddChidren(btnChoose);
-
- if (residenceMemberInfos.Count > index)
- {
- memberRow.AddChidren(new Button()
- {
- Y = Application.GetRealHeight(64),
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(343),
- Height = Application.GetRealHeight(1),
- BackgroundColor = CSS_Color.DividingLineColor,
- });
- }
- index++;
-
- }
-
- }
-
-
- void LoadEvent_SharedFunction()
- {
- //btnOption
- }
- }
-}
+// var eventHandler = LoadEvent_ChangeSharedList(btnChoose, mInfo);
+// btnChoose.MouseUpEventHandler = eventHandler;
+// btnMemberName.MouseUpEventHandler = eventHandler;
+// btnMemberMail.MouseUpEventHandler = eventHandler;
+// }
+// }
+// }
+//}
--
Gitblit v1.8.0