From 7153e420d66bce0a06b7e972ac3a5c34197fa2e5 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 18 十一月 2020 20:02:13 +0800
Subject: [PATCH] 2020-11-18 1.修改完善手机绑定和解绑。
---
HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs | 113 ++++++++++++++++++--------------------------------------
1 files changed, 36 insertions(+), 77 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs
index c1bc3e6..ea5abde 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs
@@ -17,7 +17,6 @@
}
-
/// <summary>
/// 鍔犺浇鑾峰彇浣忓畢瀛愯处鍙蜂俊鎭嚎绋�
/// </summary>
@@ -52,24 +51,6 @@
waitPage = null;
}
});
-
-#if DEBUG
- residenceMemberInfos.Add(new ResidenceMemberInfo()
- {
- Account = "娴嬭瘯鏁版嵁-璐﹀彿",
- UserName = "娴嬭瘯鏁版嵁-鐢ㄦ埛鍚�",
- Nickname = "娴嬭瘯鏁版嵁-鏄电О",
- SubAccountDistributedMark = Guid.NewGuid().ToString(),
- DistributedMark = Guid.NewGuid().ToString(),
- AccountType = 0,
- IsAllowRemoteCtrl = false,
- });
- Application.RunOnMainThread(() =>
- {
- LoadMemberRow();
- });
-#endif
-
}
})
{ IsBackground = true };
@@ -82,10 +63,10 @@
bool LoadMethod_GetResidenceMemberAccount()
{
var result = false;
- ResponsePack responePack = new HttpServerRequest().GetResidenceMemberAccount();
- if (responePack.StateCode.ToUpper() == "SUCCESS")
+ var responePack = new HttpServerRequest().GetResidenceMemberAccount();
+ if (responePack.Code == StateCode.SUCCESS)
{
- var responeObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ResidenceMemberInfo>>(responePack.ResponseData.ToString());
+ var responeObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ResidenceMemberInfo>>(responePack.Data.ToString());
foreach (var mInfo in responeObj)
{
ResponsePack memberInfoResponePack = new HttpServerRequest().GetResidenceMemberAccountInfo(mInfo.Account);
@@ -94,13 +75,20 @@
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;
+ if (!string.IsNullOrEmpty(headImageString))
+ {
+ 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;
+ }
+ if(string.IsNullOrEmpty(mInfo.Nickname))
+ {
+ mInfo.Nickname = mInfo.UserName;
+ }
}
catch (Exception ex)
{
@@ -112,7 +100,7 @@
{
fs.Close();
}
- //-----------
+ //-----------鑾峰彇浣忓畢涓嬪瓙璐﹀彿鐨勫叡浜暟鎹垪琛�
LoadMethod_GetMemberSharedDataList(mInfo);
}
residenceMemberInfos.Add(mInfo);
@@ -122,42 +110,17 @@
//澶辫触
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;
- }
+ //鎻愮ず
+ IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Child_FindAll, responePack.Code);
//璐﹀彿鎴栬�呭瘑鐮侀敊璇�
Application.RunOnMainThread(() =>
{
waitPage.Hide();
- //鎻愮ず鍘熷洜
- var tip = new Tip()
- {
- Text = tipStr,
- CloseTime = 3,
- Direction = AMPopTipDirection.None
- };
- tip.Show(bodyView);
});
}
Application.RunOnMainThread(() =>
{
- waitPage.Hide();
+ waitPage?.Hide();
});
return result;
}
@@ -169,32 +132,30 @@
void LoadMethod_GetMemberSharedDataList(ResidenceMemberInfo info)
{
ResponsePack responePack = new HttpServerRequest().GetShareDataByMemberAccount(info.SubAccountDistributedMark);
- if (responePack.StateCode.ToUpper() == "SUCCESS")
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
var responeObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ShareData>>(responePack.ResponseData.ToString());
- info.sharedDatas = responeObj;
- var sd = responeObj.Find((obj) => obj.HouseDistributedMark == DB_ResidenceData.residenceData.residecenInfo.RegionID );
- if (sd != null)
+ info.CurResidenceShareDate = responeObj;
+ foreach (var sd in info.CurResidenceShareDate)
{
- LoadMethod_GetMemberSharedData(sd,info);
- }
- else
- {
- LoadMethod_GetMemberSharedData(new ShareData(),info);
+ LoadMethod_GetMemberSharedData(sd);
}
}
}
+
/// <summary>
/// 鑾峰彇浣忓畢涓嬪瓙璐﹀彿鐨勫叡浜暟鎹�
/// </summary>
/// <param name="info"></param>
- void LoadMethod_GetMemberSharedData(ShareData sd, ResidenceMemberInfo info)
+ bool LoadMethod_GetMemberSharedData(ShareData sd)
{
ResponsePack responePack = new HttpServerRequest().GetShareData(sd.DistributedMark,sd.HouseDistributedMark);
- if (responePack.StateCode.ToUpper() == "SUCCESS")
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
- info.CurShareData = Newtonsoft.Json.JsonConvert.DeserializeObject<ShareData>(responePack.ResponseData.ToString());
+ sd.ShareDataBytes = Newtonsoft.Json.JsonConvert.DeserializeObject<ShareData>(responePack.ResponseData.ToString()).ShareDataBytes;
+ return true;
}
+ return false;
}
/// <summary>
@@ -210,7 +171,7 @@
{
new Tip()
{
- CloseTime = 3,
+ CloseTime = 1,
Text = Language.StringByID(StringId.NicknameCannotBeEmpty),
Direction = AMPopTipDirection.None,
}.Show(bodyView);
@@ -224,7 +185,7 @@
try
{
var responsePack = new HttpServerRequest().EditSubAccountNickName(str,mInfo.SubAccountDistributedMark);
- if (responsePack.StateCode.ToUpper() == "SUCCESS")
+ if (responsePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
@@ -249,7 +210,7 @@
var tip = new Tip()
{
Text = tipStr,
- CloseTime = 3,
+ CloseTime = 1,
Direction = AMPopTipDirection.None
};
tip.Show(bodyView);
@@ -274,7 +235,6 @@
};
btn1.MouseUpEventHandler = eventHandler;
btn2.MouseUpEventHandler = eventHandler;
-
}
/// <summary>
@@ -289,7 +249,7 @@
try
{
var responsePack = new HttpServerRequest().ChangeCreateSceneState(DB_ResidenceData.residenceData.residecenInfo.RegionID, mInfo.SubAccountDistributedMark);
- if (responsePack.StateCode.ToUpper() == "SUCCESS")
+ if (responsePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
@@ -313,7 +273,7 @@
var tip = new Tip()
{
Text = tipStr,
- CloseTime = 3,
+ CloseTime = 1,
Direction = AMPopTipDirection.None
};
tip.Show(bodyView);
@@ -338,6 +298,5 @@
btn2.MouseUpEventHandler = eventHandler;
}
-
}
}
\ No newline at end of file
--
Gitblit v1.8.0