From 1209d93632b447823caf371dea5ccf030ab20434 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 13 十一月 2020 17:11:55 +0800
Subject: [PATCH] 2020-11-13 1.更新
---
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs | 4
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs | 2
HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs | 6
HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs | 27
HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs | 2
HDL_ON/DAL/Server/IMessageCommon.cs | 23 +
HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs | 10
HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs | 2
HDL_ON/DAL/Server/NewApiRes.cs | 25
HDL_ON/UI/UI1-Login/RegisterPageBLL.cs | 128 ++++++-
.vs/HDL_APP_Project/xs/UserPrefs.xml | 18
HDL_ON/UI/MainPage.cs | 11
HDL_ON/UI/UI1-Login/LoginPage.cs | 23 +
HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs | 6
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs | 2
HDL_ON/UI/UI1-Login/LoginPageBLL.cs | 231 +++++++++-----
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs | 2
HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs | 2
HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs | 2
HDL_ON/UI/UI1-Login/RegisterPage.cs | 30
HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs | 10
HDL_ON/DAL/Server/HttpUtil.cs | 4
HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs | 2
HDL_ON/DAL/Server/HttpServerRequest.cs | 152 ++++++---
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs | 2
HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs | 227 +++++++++++--
26 files changed, 664 insertions(+), 289 deletions(-)
diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 145f297..77822e4 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,14 +1,10 @@
锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
<MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" />
- <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs">
+ <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI1-Login/LoginPageBLL.cs">
<Files>
- <File FileName="HDL_ON/UI/UI1-Login/RegisterPageBLL.cs" Line="405" Column="45" />
- <File FileName="HDL_ON/UI/UI1-Login/RegisterPage.cs" Line="1" Column="1" />
- <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="100" Column="50" />
- <File FileName="HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs" Line="419" Column="16" />
- <File FileName="HDL_ON/DAL/Server/IMessageCommon.cs" Line="223" Column="21" />
- <File FileName="HDL_ON/UI/UI0-Public/PublicAssmebly.cs" Line="477" Column="52" />
- <File FileName="HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs" Line="14" Column="17" />
+ <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="436" Column="1" IsPinned="True" />
+ <File FileName="HDL_ON/UI/UI1-Login/LoginPageBLL.cs" Line="1042" Column="1" />
+ <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="1" Column="1" />
</Files>
<Pads>
<Pad Id="ProjectPad">
@@ -20,9 +16,12 @@
</Node>
<Node name="UI" expanded="True">
<Node name="UI1-Login" expanded="True">
- <Node name="ForgetPasswordPageBLL.cs" selected="True" />
+ <Node name="LoginPageBLL.cs" selected="True" />
</Node>
</Node>
+ </Node>
+ <Node name="HDL-ON_iOS" expanded="True">
+ <Node name="References" expanded="True" />
</Node>
</Node>
</State>
@@ -46,7 +45,6 @@
<Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/DAL/Net/Mqtt_A_Protocol.cs" relfile="HDL_ON/DAL/Net/Mqtt_A_Protocol.cs" line="163" column="1" />
<Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/DriverLayer/Control_Udp_Bus.cs" relfile="HDL_ON/DriverLayer/Control_Udp_Bus.cs" line="694" column="1" />
<Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/DriverLayer/Control_TcpServer.cs" relfile="HDL_ON/DriverLayer/Control_TcpServer.cs" line="197" column="1" />
- <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/DAL/Server/HttpUtil.cs" relfile="HDL_ON/DAL/Server/HttpUtil.cs" line="225" column="1" />
</BreakpointStore>
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MultiItemStartupConfigurations />
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 376cf97..b8f4f5c 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -114,7 +114,7 @@
refreshToken = MainPage.LoginUser.refreshToken,
});
var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson);
- if (revertObj.Code.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (revertObj.Code.ToUpper() == StateCode.SUCCESS)
{
var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(revertObj.Data.ToString());
MainPage.LoginUser.loginTokenString = revertData.headerPrefix + revertData.accessToken;
@@ -140,7 +140,7 @@
/// <summary>
/// 閫氱敤 鍙戦�侀獙璇佺爜鏂规硶
/// </summary>
- /// <param name="verifyType">1:娉ㄥ唽 2锛氭壘鍥炲瘑鐮� 3锛氱櫥闄� 4:缁戝畾</param>
+ /// <param name="verifyType">1:娉ㄥ唽 2锛氭壘鍥炲瘑鐮� 3锛氱粦瀹�4:楠岃瘉鐮佺櫥闄� 5:鏁忔劅鏁版嵁</param>
/// <param name="account">閭鎴栬�呮墜鏈哄彿</param>
/// <param name="isPhone">鏄惁鎵嬫満</param>
/// <param name="phoneZoneCode">鎵嬫満鍥藉鍖哄彿</param>
@@ -326,7 +326,7 @@
var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(d);
var revertObj = RequestHttps($"{severAddress}/ZigbeeUsers/GetAccountInfo", requestJson, true);
- if (revertObj.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (revertObj.StateCode.ToUpper() == StateCode.SUCCESS)
{
var dataStr = JObject.FromObject(revertObj.ResponseData);
//"DistributedMark": "96439601-fd26-4768-8440-1d9dfa32c109", < !--甯愬彿Id-- >
@@ -424,63 +424,39 @@
/// <summary>
/// 鑾峰彇浣忓畢鍒楄〃
/// </summary>
- public string GetHomePager()
+ public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL)
{
- string jsonString = "{" +
- "\"RequestVersion\":" + "\"" + MainPage.VersionString + "\"" + "," +
- "\"RequestSource\":" + "\"" + "2" + "\"" + "," +
- "\"HomeType\":" + "\"" + "1" + "\"" + "," +
- "\"LoginAccessToken\":" + "\"" + MainPage.LoginUser.loginTokenString + "\"" +
- "}";
- var responsePack = RequestHttps($"{severAddress}/App/GetHomePager", jsonString, false);
-
- if (responsePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(new GetHomeListObj() { homeType = homeType.ToString() });
+ var resultObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Gethomepager, requestJson);
+ if(resultObj.Code == StateCode.SUCCESS)
{
- var dataStr = JObject.FromObject(responsePack.ResponseData);
- //娌℃湁浣忓畢
- if (dataStr.GetValue("PageData").ToString() == "[]")
- {
+ var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoResNew>>(resultObj.Data.ToString());
+ if (homeList == null || homeList.Count == 0) {
+
}
else
{
- //{
- // {
- // "Id": "1107487",
- // "HomeStatus": 2,
- // "UserGuid": "22980",
- // "Name": "鍟�",
- // "Address": null,
- // "Longitude": 0.0,
- // "Latitude": 0.0,
- // "RegionName": null,
- // "Company": null,
- // "ContactPerson": null,
- // "ContactPersonPhone": null,
- // "Remarks": null,
- // "ChangeDate": null,
- // "AccountType": 0,
- // "CreatedOnUtc": "2020-05-27T06:52:03",
- // "IsOthreShare": false,
- // "MainUserDistributedMark": null,
- // "HomeGateways": [
- // {
- // "GatewayUniqueId": "4E47323347591243"
- // }
- // ]
- //}}
MainPage.LoginUser.regionList = new List<RegionInfoRes>();
- foreach (var jsonData in dataStr.GetValue("PageData"))
+
+ foreach (var mHome in homeList)
{
- var homeJsonStr = JObject.FromObject(jsonData);
var home = new RegionInfoRes()
{
- RegionID = homeJsonStr.GetValue("Id").ToString(),
- RegionName = homeJsonStr.GetValue("RegionName").ToString(),
- Name = homeJsonStr.GetValue("Name").ToString(),
- Address = homeJsonStr.GetValue("Address").ToString(),
- IsOthreShare = (bool)homeJsonStr.GetValue("IsOthreShare"),
- homeGateways = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGateways>>(homeJsonStr.GetValue("HomeGateways").ToString()),
+ RegionID = mHome.Id,
+ Name = mHome.homeName,
+ IsOthreShare = mHome.IsOtherShare,
+ accountType = mHome.accountType,
+ isRemoteControl = mHome.isRemoteControl,
+ longitude = mHome.longitude,
+ latitude = mHome.latitude,
+ deliverstatus = mHome.deliverstatus,
+ homeType = mHome.homeType,
+ regionUrl = mHome.regionUrl,
+ emqUrl = mHome.emqUrl,
+ homeRegionName = mHome.homeRegionName,
+ homeRegionId = mHome.homeRegionId,
+ Address = mHome.homeAddress,
};
if (home.IsOthreShare)
{
@@ -495,8 +471,82 @@
DB_ResidenceData.residenceData.SaveResidenceData();
MainPage.LoginUser.SaveUserInfo();
}
+
}
- return responsePack.StateCode;
+
+ return resultObj.Code;
+
+ //string jsonString = "{" +
+ // "\"RequestVersion\":" + "\"" + MainPage.VersionString + "\"" + "," +
+ // "\"RequestSource\":" + "\"" + "2" + "\"" + "," +
+ // "\"HomeType\":" + "\"" + "1" + "\"" + "," +
+ // "\"LoginAccessToken\":" + "\"" + MainPage.LoginUser.loginTokenString + "\"" +
+ // "}";
+ //var responsePack = RequestHttps($"{severAddress}/App/GetHomePager", jsonString, false);
+
+ //if (responsePack.StateCode.ToUpper() == StateCode.SUCCESS_CODE)
+ //{
+ // var dataStr = JObject.FromObject(responsePack.ResponseData);
+ // //娌℃湁浣忓畢
+ // if (dataStr.GetValue("PageData").ToString() == "[]")
+ // {
+
+ // }
+ // else
+ // {
+ // //{
+ // // {
+ // // "Id": "1107487",
+ // // "HomeStatus": 2,
+ // // "UserGuid": "22980",
+ // // "Name": "鍟�",
+ // // "Address": null,
+ // // "Longitude": 0.0,
+ // // "Latitude": 0.0,
+ // // "RegionName": null,
+ // // "Company": null,
+ // // "ContactPerson": null,
+ // // "ContactPersonPhone": null,
+ // // "Remarks": null,
+ // // "ChangeDate": null,
+ // // "AccountType": 0,
+ // // "CreatedOnUtc": "2020-05-27T06:52:03",
+ // // "IsOthreShare": false,
+ // // "MainUserDistributedMark": null,
+ // // "HomeGateways": [
+ // // {
+ // // "GatewayUniqueId": "4E47323347591243"
+ // // }
+ // // ]
+ // //}}
+ // MainPage.LoginUser.regionList = new List<RegionInfoRes>();
+ // foreach (var jsonData in dataStr.GetValue("PageData"))
+ // {
+ // var homeJsonStr = JObject.FromObject(jsonData);
+ // var home = new RegionInfoRes()
+ // {
+ // RegionID = homeJsonStr.GetValue("Id").ToString(),
+ // RegionName = homeJsonStr.GetValue("RegionName").ToString(),
+ // Name = homeJsonStr.GetValue("Name").ToString(),
+ // Address = homeJsonStr.GetValue("Address").ToString(),
+ // IsOthreShare = (bool)homeJsonStr.GetValue("IsOthreShare"),
+ // homeGateways = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGateways>>(homeJsonStr.GetValue("HomeGateways").ToString()),
+ // };
+ // if (home.IsOthreShare)
+ // {
+ // continue;
+ // }
+ // MainPage.LoginUser.regionList.Add(home);
+ // if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.CurReginID))
+ // {
+ // DB_ResidenceData.residenceData.CurReginID = MainPage.LoginUser.regionList[0].RegionID;
+ // }
+ // }
+ // DB_ResidenceData.residenceData.SaveResidenceData();
+ // MainPage.LoginUser.SaveUserInfo();
+ // }
+ //}
+ //return responsePack.StateCode;
}
/// <summary>
/// 缂栬緫浣忓畢淇℃伅
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 1deb23f..8f6e8cd 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -12,10 +12,6 @@
public class HttpUtil
{
#region HttpUtil 鍏ㄥ眬甯搁噺
- /// <summary>
- /// 璇锋眰鎴愬姛鐨勭姸鎬佺爜
- /// </summary>
- public const string SUCCESS_CODE = "0";
///// <summary>
///// API_HTTPS
///// </summary>
diff --git a/HDL_ON/DAL/Server/IMessageCommon.cs b/HDL_ON/DAL/Server/IMessageCommon.cs
index 26e742c..c1912c7 100644
--- a/HDL_ON/DAL/Server/IMessageCommon.cs
+++ b/HDL_ON/DAL/Server/IMessageCommon.cs
@@ -9,6 +9,7 @@
/// </summary>
public class IMessageCommon
{
+
/// <summary>
/// 鎺ュ彛绫荤殑杩斿洖淇℃伅
/// </summary>
@@ -67,9 +68,9 @@
//stateCodeDic["10001"] = HDL_ON.StringId.uOperationFailed;
////鐧诲綍澶辫触锛岃处鍙锋垨鑰呭瘑鐮侀敊璇�
- //stateCodeDic["10008"] = HDL_ON.StringId.Accountorpassworderro;
- ////璐﹀彿涓嶅瓨鍦�
- //stateCodeDic["10010"] = HDL_ON.StringId.uNoLogin;
+ stateCodeDic["10008"] = HDL_ON.StringId.LoginFailed_AccountOrPasswordError;
+ //璐﹀彿涓嶅瓨鍦�
+ stateCodeDic[StateCode.ACCOUNT_NOT_EXIST] = HDL_ON.StringId.AccountNotExist;
//#endregion
////return;
@@ -244,4 +245,20 @@
catch { }
}
}
+
+ /// <summary>
+ /// 甯哥敤鐘舵�佺爜绠$悊
+ /// </summary>
+ public class StateCode
+ {
+ /// <summary>
+ /// 璇锋眰鎴愬姛鐨勭姸鎬佺爜
+ /// </summary>
+ public const string SUCCESS = "0";
+ /// <summary>
+ /// 璐﹀彿涓嶅瓨鍦ㄧ殑閿欒鐮�
+ /// </summary>
+ public const string ACCOUNT_NOT_EXIST = "10010";
+
+ }
}
diff --git a/HDL_ON/DAL/Server/NewApiRes.cs b/HDL_ON/DAL/Server/NewApiRes.cs
index c449f04..47056a3 100644
--- a/HDL_ON/DAL/Server/NewApiRes.cs
+++ b/HDL_ON/DAL/Server/NewApiRes.cs
@@ -1019,9 +1019,10 @@
/// </summary>
public enum HomeTypeEnum
{
- ZIGBEE,
+ ZIGBEE = 1,
BUSPRO,
- A
+ A,
+ ALL
}
/// <summary>
@@ -1034,26 +1035,30 @@
}
/// <summary>
- /// VerifyType
+ /// 鍙戦�侀獙璇佺爜鍔熻兘绫诲瀷
/// </summary>
public enum VerifyType
{
/// <summary>
- /// 娉ㄥ唽
+ /// 鐢ㄦ埛娉ㄥ唽
/// </summary>
- REGISTER = 1,
+ REGISTER_USER = 1,
/// <summary>
/// 蹇樿瀵嗙爜
/// </summary>
- FORGOTPASSWORD,
+ FIND_PASSWORD,
/// <summary>
- /// 鐧诲綍
+ /// 楠岃瘉鐮佺櫥闄�
/// </summary>
- LOGIN,
+ REGISTER_USER_SYSTEM,
/// <summary>
- /// 缁戝畾
+ /// 楠岃瘉鐮佺櫥闄�
/// </summary>
- BIND,
+ VERIFY_LOGIN,
+ /// <summary>
+ /// 鏁忔劅鏁版嵁楠岃瘉
+ /// </summary>
+ SENSITIVE_DATA,
}
/// <summary>
diff --git a/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
index fd73c8d..e55a923 100644
--- a/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
+++ b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
@@ -3,48 +3,201 @@
namespace HDL_ON
{
- [Serializable]
- public class RegionInfoRes
- {
- public string RegionID { get; set; }
+ //[Serializable]
+ //public class RegionInfoRes
+ //{
+ // public string RegionID { get; set; }
- /// <summary>
- /// 鍖哄煙鍚嶇О(濡�:骞垮窞銆佹繁鍦崇瓑)
- /// </summary>
- public string RegionName { get; set; }
- /// <summary>
- /// 浣忓畢鍚嶇О
- /// </summary>
- public string Name { get;set; }
- /// <summary>
- /// 浣忓畢鍦板潃
- /// </summary>
- public string Address { get; set; }
+ // /// <summary>
+ // /// 鍖哄煙鍚嶇О(濡�:骞垮窞銆佹繁鍦崇瓑)
+ // /// </summary>
+ // public string RegionName { get; set; }
+ // /// <summary>
+ // /// 浣忓畢鍚嶇О
+ // /// </summary>
+ // public string Name { get;set; }
+ // /// <summary>
+ // /// 浣忓畢鍦板潃
+ // /// </summary>
+ // public string Address { get; set; }
- //{
- // {
- // "Id": "1107487",
- // "HomeStatus": 2,
- // "UserGuid": "22980",
- // "Name": "鍟�",
- // "Address": null,
- // "Longitude": 0.0,
- // "Latitude": 0.0,
- // "RegionName": null,
- // "Company": null,
- // "ContactPerson": null,
- // "ContactPersonPhone": null,
- // "Remarks": null,
- // "ChangeDate": null,
- //"AccountType": 0,
- // "CreatedOnUtc": "2020-05-27T06:52:03",
- public bool IsOthreShare = false;
- // "MainUserDistributedMark": null,
- public List<HomeGateways> homeGateways = new List<HomeGateways>();
- }
+ // //{
+ // // {
+ // // "Id": "1107487",
+ // // "HomeStatus": 2,
+ // // "UserGuid": "22980",
+ // // "Name": "鍟�",
+ // // "Address": null,
+ // // "Longitude": 0.0,
+ // // "Latitude": 0.0,
+ // // "RegionName": null,
+ // // "Company": null,
+ // // "ContactPerson": null,
+ // // "ContactPersonPhone": null,
+ // // "Remarks": null,
+ // // "ChangeDate": null,
+ // //"AccountType": 0,
+ // // "CreatedOnUtc": "2020-05-27T06:52:03",
+ // public bool IsOthreShare = false;
+ // // "MainUserDistributedMark": null,
+ // public List<HomeGateways> homeGateways = new List<HomeGateways>();
+ //}
public class HomeGateways
{
public string GatewayUniqueId = "";
}
+
+ [Serializable]
+ public class RegionInfoRes
+ {
+ /// <summary>
+ /// 浣忓畢ID
+ /// </summary>
+ public string RegionID { get; set; }
+ /// <summary>
+ /// 浣忓畢鍚嶇О
+ /// </summary>
+ public string Name { get; set; }
+ /// <summary>
+ /// 浣忓畢鍦板潃
+ /// </summary>
+ public string Address { get; set; }
+ /// <summary>
+ /// 鏄惁涓哄叾浠栦富鐢ㄦ埛鍒嗕韩杩囨潵鐨勪綇瀹�
+ /// </summary>
+ public bool IsOthreShare = false;
+ /// <summary>
+ ///
+ /// </summary>
+ public List<HomeGateways> homeGateways = new List<HomeGateways>();
+
+ //2020-11-13 鏂板
+ /// <summary>
+ /// 浠呭瓙璐﹀彿鐧婚檰鐨勬椂鍊欎娇鐢�,褰撱�怚sOthreShare銆戜负"true"锛�
+ /// 瀛愯处鎴风被鍨� 1.ORDINARY 2.DEBUG 3.ADMIN
+ /// </summary>
+ public string accountType;
+ /// <summary>
+ /// 鏄惁鏀寔杩滅▼
+ /// </summary>
+ public bool isRemoteControl;
+ /// <summary>
+ /// 缁忓害
+ /// </summary>
+ public double longitude;
+ /// <summary>
+ /// 绾害
+ /// </summary>
+ public double latitude;
+ /// <summary>
+ /// 浜や粯鐘舵��
+ /// </summary>
+ public string deliverstatus;
+ /// <summary>
+ /// 浣忓畢绫诲瀷 Zigbee, Buspro, A
+ /// </summary>
+ public string homeType;
+ /// <summary>
+ ///
+ /// </summary>
+ public string createonutc;
+ /// <summary>
+ /// 鍖哄煙鏈嶅姟鍣�
+ /// </summary>
+ public string regionUrl;
+ /// <summary>
+ /// 鍖哄煙鏈嶅姟鍣�
+ /// </summary>
+ public string emqUrl;
+ /// <summary>
+ /// 浣忓畢鍖哄煙Id
+ /// </summary>
+ public string homeRegionId;
+ /// <summary>
+ /// 浣忓畢鍖哄煙鍚嶅瓧
+ /// </summary>
+ public string homeRegionName;
+ ///// <summary>
+ ///// 鏄惁缁戝畾缃戝叧
+ ///// </summary>
+ //public bool isBindGateway;
+ }
+
+ /// <summary>
+ /// 鏂颁簯绔綇瀹呭垪琛ㄨ繑鍥炲瓧娈�
+ /// </summary>
+ [Serializable]
+ public class RegionInfoResNew
+ {
+ /// <summary>
+ /// 浣忓畢ID
+ /// </summary>
+ public string Id;
+ /// <summary>
+ /// 浣忓畢鍚嶅瓧
+ /// </summary>
+ public string homeName;
+ /// <summary>
+ /// 鏄惁涓哄叾浠栦富鐢ㄦ埛鍒嗕韩杩囨潵鐨勪綇瀹�
+ /// </summary>
+ public bool IsOtherShare;
+ /// <summary>
+ /// 浠呭瓙璐﹀彿鐧婚檰鐨勬椂鍊欎娇鐢�,褰撱�怚sOthreShare銆戜负"true"锛�
+ /// 瀛愯处鎴风被鍨� 1.ORDINARY 2.DEBUG 3.ADMIN
+ /// </summary>
+ public string accountType;
+ /// <summary>
+ /// 鏄惁鏀寔杩滅▼
+ /// </summary>
+ public bool isRemoteControl;
+ /// <summary>
+ /// 浣忓畢绌洪棿缁撴瀯Id
+ /// </summary>
+ public string structId;
+ /// <summary>
+ /// 缁忓害
+ /// </summary>
+ public double longitude;
+ /// <summary>
+ /// 绾害
+ /// </summary>
+ public double latitude;
+ /// <summary>
+ /// 浜や粯鐘舵��
+ /// </summary>
+ public string deliverstatus;
+ /// <summary>
+ /// 浣忓畢绫诲瀷 Zigbee, Buspro, A
+ /// </summary>
+ public string homeType;
+ /// <summary>
+ ///
+ /// </summary>
+ public string createonutc;
+ /// <summary>
+ /// 鍖哄煙鏈嶅姟鍣�
+ /// </summary>
+ public string regionUrl;
+ /// <summary>
+ /// 鍖哄煙鏈嶅姟鍣�
+ /// </summary>
+ public string emqUrl;
+ /// <summary>
+ /// 浣忓畢鍖哄煙Id
+ /// </summary>
+ public string homeRegionId;
+ /// <summary>
+ /// 浣忓畢鍖哄煙鍚嶅瓧
+ /// </summary>
+ public string homeRegionName;
+ ///// <summary>
+ ///// 鏄惁缁戝畾缃戝叧
+ ///// </summary>
+ //public bool isBindGateway;
+ /// <summary>
+ /// 浣忓畢鍦板潃
+ /// </summary>
+ public string homeAddress;
+ }
}
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index 5f3ef66..4e86d9f 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -185,5 +185,16 @@
#endif
}
+ /// <summary>
+ /// 寮圭獥鎻愮ず
+ /// </summary>
+ /// <param name="mes"></param>
+ public static void ShowAlertOnMainThread(string mes)
+ {
+ Application.RunOnMainThread(() => {
+ new Alert("", mes, Language.StringByID(StringId.Close)).Show();
+ });
+ }
+
}
}
diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs
index b08c915..1d03af1 100644
--- a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs
+++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs
@@ -225,24 +225,25 @@
X = Application.GetRealWidth(9),
TextAlignment = TextAlignment.CenterLeft,
TextColor = CSS_Color.FirstLevelTitleColor,
- Text = "+86",
+ Text = "+" + phoneZoneCode,
TextSize = CSS_FontSize.TextFontSize,
};
+
+ //璺宠浆鍥藉鍖哄彿閫夋嫨鐣岄潰
+ EventHandler<MouseEventArgs> eHandler = (sender, e) => {
+ JLCountrycode.CountryCodeView.Current.Show((countryName, code) => {
+ if (!string.IsNullOrEmpty(code))
+ {
+ phoneZoneCode = code;
+ btnGlobalRoaming.Text = "+" + phoneZoneCode;
+ }
+ });
+ };
+ btnGlobalRoaming.MouseUpEventHandler += eHandler;
+
if (accountType == 0)
{
accountView.AddChidren(btnGlobalRoaming);
-
- EventHandler<MouseEventArgs> eHandler = (sender, e) => {
- JLCountrycode.CountryCodeView.Current.Show((countryName, code) => {
- if (!string.IsNullOrEmpty(code))
- {
- phoneZoneCode = code;
- btnGlobalRoaming.Text = "+" + phoneZoneCode;
-
- }
- });
- };
- btnGlobalRoaming.MouseUpEventHandler += eHandler;
}
etAccount = new EditText()
diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
index a923fff..7f1cb99 100644
--- a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
@@ -305,7 +305,7 @@
{
//1.鍏堟鏌ヨ处鍙锋槸鍚︽敞鍐岃繃
var result = pm.GetRegionByAccount(account);
- if (result.Code != HttpUtil.SUCCESS_CODE)
+ if (result.Code != StateCode.SUCCESS)
{
IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code);
return;
@@ -344,14 +344,14 @@
//2.1璇锋眰鑾峰彇楠岃瘉鐮�
if (registerType == 1)//閭
{
- resultObj = pm.VerificationCodeSend(VerifyType.FORGOTPASSWORD, account);
+ resultObj = pm.VerificationCodeSend(VerifyType.FIND_PASSWORD, account);
}
else
{
- resultObj = pm.VerificationCodeSend(VerifyType.FORGOTPASSWORD, account, true, phoneZoneCode);
+ resultObj = pm.VerificationCodeSend(VerifyType.FIND_PASSWORD, account, true, phoneZoneCode);
}
- if (resultObj.Code != HttpUtil.SUCCESS_CODE)
+ if (resultObj.Code != StateCode.SUCCESS)
{
// 鎻愮ず閿欒
IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code);
@@ -404,7 +404,7 @@
// 蹇樿瀵嗙爜
var isPhone = registerType == 0;
var resultObj = pm.ForgetPassword(account, password, verCode, isPhone);
- if (resultObj.Code == HttpUtil.SUCCESS_CODE)
+ if (resultObj.Code == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index fbd3b48..b8f1b69 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -150,6 +150,10 @@
/// </summary>
string registerPhone;
string registerEmail;
+ /// <summary>
+ /// 鎵嬫満鍖哄彿
+ /// </summary>
+ string phoneZoneCode = "86";
/// <summary>
/// 鍔犺浇瑙嗗浘
@@ -230,12 +234,27 @@
Width = Application.GetRealWidth(65),
TextAlignment = TextAlignment.Center,
TextColor = CSS_Color.FirstLevelTitleColor,
- Text = "+86",
+ Text = "+" + phoneZoneCode,
TextSize = CSS_FontSize.TextFontSize,
- Enable = false,
+ Enable = true,
};
+
+ //璺宠浆鍥藉鍖哄彿閫夋嫨鐣岄潰
+ EventHandler<MouseEventArgs> eHandler = (sender, e) => {
+ JLCountrycode.CountryCodeView.Current.Show((countryName, code) => {
+ if (!string.IsNullOrEmpty(code))
+ {
+ phoneZoneCode = code;
+ btnGlobalRoaming.Text = "+" + phoneZoneCode;
+ }
+ });
+ };
+ btnGlobalRoaming.MouseUpEventHandler += eHandler;
+
if (loginType == 0)
+ {
accountView.AddChidren(btnGlobalRoaming);
+ }
btnDividingLineVertical_AccountView = new Button()
{
diff --git a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
index 5e78b81..d91a9b9 100644
--- a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -65,82 +65,137 @@
btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
return;
}
- btnGetVerificationCode.IsSelected = false ;
- btnGetVerificationCode.TextColor = CSS_Color.PromptingColor1;
+
int time = 60;
new Thread(() =>
{
- while (time > 0)
+ //1.鍏堟鏌ヨ处鍙锋槸鍚︽敞鍐岃繃
+ var result = pm.GetRegionByAccount(account);
+ if (result.Code != StateCode.SUCCESS)
{
- time--;
- Application.RunOnMainThread(() =>
- {
- btnGetVerificationCode.Text = time.ToString() + "s";
- });
- Thread.Sleep(1000);
+ IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code);
+ return;
}
- Application.RunOnMainThread(() =>
- {
- btnGetVerificationCode.IsSelected = true;
- btnGetVerificationCode.TextID = StringId.GetVerificationCode;
- });
- })
- { IsBackground = true }.Start();
- new Thread(() =>
- {
- //鑾峰彇楠岃瘉鐮�
- var result = pm.GetLoginVerCode(phoneNumber);
- if (result.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
- {
- }
- //鐧诲綍澶辫触
else
{
- string tipStr = "Sever erorr";
- switch (result.StateCode.ToUpper())
- {
- case "USERNAMEORPWDERROR":
- tipStr = Language.StringByID(StringId.LoginFailed_AccountOrPasswordError);
- Application.RunOnMainThread(() =>
- {
- btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
- btnPasswordViewBottomLine.Height = Application.GetRealHeight(2);
- });
- break;
- case "ACCOUNTNOEXISTS":
- tipStr = Language.StringByID(StringId.ACCOUNTNOEXISTS);
- Application.RunOnMainThread(() =>
- {
- btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
- btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
- });
- break;
- case "SENDFAIL":
- tipStr = Language.StringByID(StringId.FailedToSendVerificationCode);
- Application.RunOnMainThread(() =>
- {
- btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
- btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
- });
- break;
- case "Self:Net_Error":
- tipStr = Language.StringByID(StringId.NetworkAnomaly);
- break;
- }
Application.RunOnMainThread(() =>
{
- //鎻愮ず鍘熷洜
- var tip = new Tip()
- {
- Text = tipStr,
- CloseTime = 1,
- Direction = AMPopTipDirection.None
- };
- tip.Show(bodyView);
+ btnGetVerificationCode.IsSelected = false;
+ btnGetVerificationCode.TextColor = CSS_Color.PromptingColor1;
});
+ new Thread(() =>
+ {
+ while (time > 0)
+ {
+ time--;
+ Application.RunOnMainThread(() =>
+ {
+ btnGetVerificationCode.Text = time.ToString() + "s";
+ });
+ Thread.Sleep(1000);
+ }
+ Application.RunOnMainThread(() =>
+ {
+ btnGetVerificationCode.IsSelected = true;
+ btnGetVerificationCode.TextID = StringId.GetVerificationCode;
+ });
+ })
+ { IsBackground = true }.Start();
+
+ //2.1璇锋眰鑾峰彇楠岃瘉鐮�
+ var resultObj = pm.VerificationCodeSend(VerifyType.VERIFY_LOGIN, account, true, phoneZoneCode);
+ if (resultObj.Code != StateCode.SUCCESS)
+ {
+ //2.2璇锋眰鑾峰彇楠岃瘉鐮佸け璐�
+ Application.RunOnMainThread(() =>
+ {
+ btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
+ btnPasswordViewBottomLine.Height = Application.GetRealHeight(2);
+ });
+ // 鎻愮ず閿欒
+ IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code);
+ }
}
+
})
{ IsBackground = true }.Start();
+
+ // btnGetVerificationCode.IsSelected = false ;
+ // btnGetVerificationCode.TextColor = CSS_Color.PromptingColor1;
+ // int time = 60;
+ // new Thread(() =>
+ // {
+ // while (time > 0)
+ // {
+ // time--;
+ // Application.RunOnMainThread(() =>
+ // {
+ // btnGetVerificationCode.Text = time.ToString() + "s";
+ // });
+ // Thread.Sleep(1000);
+ // }
+ // Application.RunOnMainThread(() =>
+ // {
+ // btnGetVerificationCode.IsSelected = true;
+ // btnGetVerificationCode.TextID = StringId.GetVerificationCode;
+ // });
+ // })
+ // { IsBackground = true }.Start();
+ // new Thread(() =>
+ // {
+ // //鑾峰彇楠岃瘉鐮�
+ // var result = pm.GetLoginVerCode(phoneNumber);
+ // if (result.StateCode.ToUpper() == StateCode.SUCCESS_CODE)
+ // {
+ // }
+ // //鐧诲綍澶辫触
+ // else
+ // {
+ // string tipStr = "Sever erorr";
+ // switch (result.StateCode.ToUpper())
+ // {
+ // case "USERNAMEORPWDERROR":
+ // tipStr = Language.StringByID(StringId.LoginFailed_AccountOrPasswordError);
+ // Application.RunOnMainThread(() =>
+ // {
+ // btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
+ // btnPasswordViewBottomLine.Height = Application.GetRealHeight(2);
+ // });
+ // break;
+ // case "ACCOUNTNOEXISTS":
+ // tipStr = Language.StringByID(StringId.ACCOUNTNOEXISTS);
+ // Application.RunOnMainThread(() =>
+ // {
+ // btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
+ // btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
+ // });
+ // break;
+ // case "SENDFAIL":
+ // tipStr = Language.StringByID(StringId.FailedToSendVerificationCode);
+ // Application.RunOnMainThread(() =>
+ // {
+ // btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
+ // btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
+ // });
+ // break;
+ // case "Self:Net_Error":
+ // tipStr = Language.StringByID(StringId.NetworkAnomaly);
+ // break;
+ // }
+ // Application.RunOnMainThread(() =>
+ // {
+ // //鎻愮ず鍘熷洜
+ // var tip = new Tip()
+ // {
+ // Text = tipStr,
+ // CloseTime = 1,
+ // Direction = AMPopTipDirection.None
+ // };
+ // tip.Show(bodyView);
+ // });
+ // }
+ // })
+ // { IsBackground = true }.Start();
}
};
}
@@ -522,6 +577,18 @@
{
try
{
+ //濡傛灉鏄处鍙峰瘑鐮佺櫥褰曪紝鍏堟鏌ヤ竴娆¤处鍙锋槸鍚︽敞鍐岃繃
+ if (logintMode == 0)
+ {
+ //1.鍏堟鏌ヨ处鍙锋槸鍚︽敞鍐岃繃
+ var result = pm.GetRegionByAccount(account);
+ if (result.Code != StateCode.SUCCESS)
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code);
+ return;
+ }
+ }
+
//鐧诲綍
var loginResult = LoadMethod_Login();
if( !string.IsNullOrEmpty (verAccount))//楠岃瘉鐧诲綍璐﹀彿
@@ -831,6 +898,11 @@
MainPage.GoUserPage();
});
}
+ else
+ {
+ //2020-11-13 寰呯‘璁�
+ MainPage.ShowAlertOnMainThread("鐧诲綍澶辫触锛岃鍏堟坊鍔犱綇瀹呫��");
+ }
}
}
catch (Exception ex)
@@ -870,7 +942,7 @@
//璋冪敤楠岃瘉鐮佺櫥褰曟帴鍙�
loginResult = pm.LoginValidCode(account, password);
}
- if (loginResult.Code == HttpUtil.SUCCESS_CODE)
+ if (loginResult.Code == StateCode.SUCCESS)
{
var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString());
MainPage.LoginUser = new UserInfo
@@ -897,7 +969,7 @@
//鐧诲綍澶辫触
else
{
- //2020-11-12 寰呬慨鏀�
+ //2020-11-13 寰呬慨鏀�
string tipStr = "Sever erorr";
switch (loginResult.Code)
{
@@ -956,31 +1028,18 @@
{
var result = false;
var responsePack = pm.GetHomePager();
-
- if (responsePack == HttpUtil.SUCCESS_CODE)
+ if (responsePack == StateCode.SUCCESS)
{
- result = true;
+ //2020-11-13 寰呯‘璁わ紝娌℃湁浣忓畢锛屼笉绠楃櫥褰曟垚鍔�
+ if (MainPage.LoginUser.regionList != null && MainPage.LoginUser.regionList.Count > 0){
+ result = true;
+ }
+ //result = true;
}
else
{
- var tipStr = "Server erorr";
- switch (responsePack)
- {
- case "NoLogin":
- tipStr = Language.StringByID(StringId.InvalidLoginCertificate);
- break;
- }
- Application.RunOnMainThread(() =>
- {
- //鎻愮ず鍘熷洜
- var tip = new Tip()
- {
- Text = tipStr,
- CloseTime = 1,
- Direction = AMPopTipDirection.None
- };
- tip.Show(bodyView);
- });
+ // 鎻愮ず閿欒
+ IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Gethomepager, responsePack);
}
return result;
}
diff --git a/HDL_ON/UI/UI1-Login/RegisterPage.cs b/HDL_ON/UI/UI1-Login/RegisterPage.cs
index b55a804..da291bd 100644
--- a/HDL_ON/UI/UI1-Login/RegisterPage.cs
+++ b/HDL_ON/UI/UI1-Login/RegisterPage.cs
@@ -246,22 +246,22 @@
Text = "+" + phoneZoneCode,
TextSize = CSS_FontSize.TextFontSize,
};
+
+ //璺宠浆鍥藉鍖哄彿閫夋嫨鐣岄潰
+ EventHandler<MouseEventArgs> eHandler = (sender, e) => {
+ JLCountrycode.CountryCodeView.Current.Show((countryName, code) => {
+ if (!string.IsNullOrEmpty(code))
+ {
+ phoneZoneCode = code;
+ btnGlobalRoaming.Text = "+" + phoneZoneCode;
+ }
+ });
+ };
+ btnGlobalRoaming.MouseUpEventHandler += eHandler;
+
if (accountType == 0)
{
accountView.AddChidren(btnGlobalRoaming);
-
- EventHandler<MouseEventArgs> eHandler = (sender, e) => {
- JLCountrycode.CountryCodeView.Current.Show((countryName, code) => {
- if (!string.IsNullOrEmpty(code))
- {
- phoneZoneCode = code;
- btnGlobalRoaming.Text = "+" + phoneZoneCode;
-
- }
- });
- };
- btnGlobalRoaming.MouseUpEventHandler += eHandler;
-
}
//btnDividingLineVertical_AccountView = new Button()
@@ -677,7 +677,7 @@
var result = false;
//璋冪敤鐧诲綍鎺ュ彛
var loginResult = pm.LoginByPassword(account, password);
- if (loginResult.Code == HttpUtil.SUCCESS_CODE)
+ if (loginResult.Code == StateCode.SUCCESS)
{
var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString());
MainPage.LoginUser = new UserInfo
@@ -715,7 +715,7 @@
{
var result = false;
var responsePack = pm.GetHomePager();
- if (responsePack == HttpUtil.SUCCESS_CODE)
+ if (responsePack == StateCode.SUCCESS)
{
}
else
diff --git a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
index 06d12ec..ce1f7a3 100644
--- a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
@@ -369,49 +369,115 @@
{
if ((sender as Button).IsSelected)
{
- (sender as Button).IsSelected = false;
string account = etAccount.Text.Trim();
- //鐭俊鍙戦�侀棿闅�60s
int time = 60;
new Thread(() =>
{
- while (time > 0)
+ //1.鍏堟鏌ヨ处鍙锋槸鍚︽敞鍐岃繃
+ var result = pm.GetRegionByAccount(account);
+ //2.璐﹀彿涓嶅瓨鍦紝鎵嶅厑璁哥户缁敞鍐�
+ if (result.Code == StateCode.ACCOUNT_NOT_EXIST)
{
- time--;
+ //璐﹀彿涓嶅瓨鍦� 鏈敞鍐屽厑璁稿彂閫侀獙璇佺爜娉ㄥ唽
Application.RunOnMainThread(() =>
{
- (sender as Button).Text = time.ToString() + "s";
+ //鐭俊鍙戦�侀棿闅�60s
+ (sender as Button).IsSelected = false;
+
});
- Thread.Sleep(1000);
- }
- Application.RunOnMainThread(() =>
- {
- //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢
- (sender as Button).IsSelected = true;
- (sender as Button).TextID = StringId.GetVerificationCode;
- });
- })
- { IsBackground = true }.Start();
- new Thread(() =>
- {
- ResponsePackNew resultObj;
- // 鑾峰彇楠岃瘉鐮�
- if (registerType == 1)//閭
- {
- resultObj = pm.VerificationCodeSend(VerifyType.REGISTER, account);
- }
- else
- {
- resultObj = pm.VerificationCodeSend(VerifyType.REGISTER, account, true, phoneZoneCode);
- }
+ //2.1 寮�濮嬪�掕鏃�
+ new Thread(() =>
+ {
+ while (time > 0)
+ {
+ time--;
+ Application.RunOnMainThread(() =>
+ {
+ (sender as Button).Text = time.ToString() + "s";
+ });
+ Thread.Sleep(1000);
+ }
+ Application.RunOnMainThread(() =>
+ {
+ //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢
+ (sender as Button).IsSelected = true;
+ (sender as Button).TextID = StringId.GetVerificationCode;
+ });
+ })
+ { IsBackground = true }.Start();
- if (resultObj.Code != HttpUtil.SUCCESS_CODE)
+ //2.2 鑾峰彇楠岃瘉鐮�
+ ResponsePackNew resultObj;
+ if (registerType == 1)//閭
+ {
+ resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account);
+ }
+ else
+ {
+ resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account, true, phoneZoneCode);
+ }
+
+ if (resultObj.Code != StateCode.SUCCESS)
+ {
+ // 鎻愮ず閿欒
+ IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code);
+ }
+
+ }else if (result.Code.ToUpper() == StateCode.SUCCESS)
{
- // 鎻愮ず閿欒
- IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code);
+ //3.鎻愮ず璐﹀彿宸插瓨鍦紝鏃犳硶閲嶅娉ㄥ唽
+ MainPage.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse));
+ } else
+ {
+ //4.鎻愮ず鍏跺畠寮傚父閿欒
+ IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code);
}
})
{ IsBackground = true }.Start();
+
+ //(sender as Button).IsSelected = false;
+ //string account = etAccount.Text.Trim();
+ ////鐭俊鍙戦�侀棿闅�60s
+ //int time = 60;
+ //new Thread(() =>
+ //{
+ // while (time > 0)
+ // {
+ // time--;
+ // Application.RunOnMainThread(() =>
+ // {
+ // (sender as Button).Text = time.ToString() + "s";
+ // });
+ // Thread.Sleep(1000);
+ // }
+ // Application.RunOnMainThread(() =>
+ // {
+ // //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢
+ // (sender as Button).IsSelected = true;
+ // (sender as Button).TextID = StringId.GetVerificationCode;
+ // });
+ //})
+ //{ IsBackground = true }.Start();
+ //new Thread(() =>
+ //{
+ // ResponsePackNew resultObj;
+ // // 鑾峰彇楠岃瘉鐮�
+ // if (registerType == 1)//閭
+ // {
+ // resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account);
+ // }
+ // else
+ // {
+ // resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account, true, phoneZoneCode);
+ // }
+
+ // if (resultObj.Code != StateCode.SUCCESS_CODE)
+ // {
+ // // 鎻愮ず閿欒
+ // IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code);
+ // }
+ //})
+ //{ IsBackground = true }.Start();
}
};
@@ -460,7 +526,7 @@
//鏍¢獙楠岃瘉鐮佸苟娉ㄥ唽璐﹀彿
var isPhone = registerType == 0;
var validateSmsResult = pm.ValidataCodeAndRegister(account, password, verCode, isPhone);
- if (validateSmsResult.Code == HttpUtil.SUCCESS_CODE)
+ if (validateSmsResult.Code == StateCode.SUCCESS)
{
//娉ㄥ唽鎴愬姛
//鎵ц鍥炶皟浜嬩欢
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs
index ee082c7..ad35668 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs
@@ -142,7 +142,7 @@
new System.Threading.Thread(() =>
{
var result = new HttpServerRequest().BindAccount(account);
- if (result.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (result.ToUpper() == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs
index 44aaebd..3f3c124 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs
@@ -492,7 +492,7 @@
});
var verAccount = optionType == 1 ? MainPage.LoginUser.userEmailInfo : MainPage.LoginUser.userMobileInfo;
var response = new HttpServerRequest().ValidatorCode(verAccount, etCode, MainPage.LoginUser.areaCode);
- if (response.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (response.StateCode.ToUpper() == StateCode.SUCCESS)
{
result = true;
}
@@ -550,7 +550,7 @@
new Thread(() =>
{
var result2 = new DAL.Server.HttpServerRequest().BindAccount(account);
- if (result2 == HttpUtil.SUCCESS_CODE)
+ if (result2 == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
@@ -587,7 +587,7 @@
new Thread(() =>
{
var result2 = new DAL.Server.HttpServerRequest().BindAccount(account);
- if (result2 == HttpUtil.SUCCESS_CODE)
+ if (result2 == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs
index 2e062aa..ada9433 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs
@@ -163,7 +163,7 @@
bool EditShareData(ShareData sd)
{
ResponsePack responePack = new HttpServerRequest().EditShareData(sd);
- if (responePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
return true;
}
@@ -180,7 +180,7 @@
void LoadMethod_GetMemberSharedDataList(ResidenceMemberInfo info)
{
ResponsePack responePack = new HttpServerRequest().GetShareDataByMemberAccount(info.SubAccountDistributedMark);
- if (responePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
var responeObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ShareData>>(responePack.ResponseData.ToString());
info.CurResidenceShareDate = responeObj;
@@ -194,7 +194,7 @@
{
var result = false;
ResponsePack responePack = new HttpServerRequest().GetResidenceMemberAccount();
- if (responePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
memberList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ResidenceMemberInfo>>(responePack.ResponseData.ToString());
foreach (var mInfo in memberList)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs
index 2b22e57..01ed815 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs
@@ -131,7 +131,7 @@
bool EditShareData(ShareData sd)
{
ResponsePack responePack = new HttpServerRequest().EditShareData(sd);
- if (responePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
return true;
}
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs
index d69be1e..e7e4e26 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs
@@ -64,7 +64,7 @@
{
var result = false;
ResponsePack responePack = new HttpServerRequest().GetResidenceMemberAccount();
- if (responePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
var responeObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ResidenceMemberInfo>>(responePack.ResponseData.ToString());
foreach (var mInfo in responeObj)
@@ -157,7 +157,7 @@
void LoadMethod_GetMemberSharedDataList(ResidenceMemberInfo info)
{
ResponsePack responePack = new HttpServerRequest().GetShareDataByMemberAccount(info.SubAccountDistributedMark);
- if (responePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
var responeObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ShareData>>(responePack.ResponseData.ToString());
info.CurResidenceShareDate = responeObj;
@@ -175,7 +175,7 @@
bool LoadMethod_GetMemberSharedData(ShareData sd)
{
ResponsePack responePack = new HttpServerRequest().GetShareData(sd.DistributedMark,sd.HouseDistributedMark);
- if (responePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
sd.ShareDataBytes = Newtonsoft.Json.JsonConvert.DeserializeObject<ShareData>(responePack.ResponseData.ToString()).ShareDataBytes;
return true;
@@ -210,7 +210,7 @@
try
{
var responsePack = new HttpServerRequest().EditSubAccountNickName(str,mInfo.SubAccountDistributedMark);
- if (responsePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responsePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
@@ -274,7 +274,7 @@
try
{
var responsePack = new HttpServerRequest().ChangeCreateSceneState(DB_ResidenceData.residenceData.residecenInfo.RegionID, mInfo.SubAccountDistributedMark);
- if (responsePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responsePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs
index 5c56958..e97c197 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs
@@ -18,7 +18,7 @@
Action action = () =>
{
ResponsePack responePack = new HttpServerRequest().DeleteResidenceMemberAccount(memberInfo.SubAccountDistributedMark);
- if (responePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
this.RemoveFromParent();
backAction();
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
index 84049af..68279d1 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
@@ -181,7 +181,7 @@
try
{
var responsePack = new HttpServerRequest().EditUserName(str);
- if (responsePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responsePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
MainPage.LoginUser.userName = str;
MainPage.LoginUser.SaveUserInfo();
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs
index c2d28b7..5597092 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs
@@ -30,7 +30,7 @@
var waitPage = new Loading();
waitPage.Start("Please wait...");
var resetResult = new HttpServerRequest().ResetPassword(MainPage.LoginUser.accountString, password, repeatPassword, 86);
- if (resetResult.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (resetResult.StateCode.ToUpper() == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs
index 57a514d..7415923 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs
@@ -476,7 +476,7 @@
act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait));
});
var response = new HttpServerRequest().ValidatorCode(MainPage.LoginUser.userEmailInfo, etCode, MainPage.LoginUser.areaCode);
- if (response.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (response.StateCode.ToUpper() == StateCode.SUCCESS)
{
result = true;
}
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs
index 889b9c0..534cb3a 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs
@@ -45,7 +45,7 @@
{
var responsePack = new HttpServerRequest().EditResidenceInfo();
- if (responsePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responsePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
Application.RunOnMainThread(() =>
{
@@ -113,7 +113,7 @@
DB_ResidenceData.residenceData.residecenInfo.Address = str;
var responsePack = new DAL.Server.HttpServerRequest().EditResidenceInfo();
- if (responsePack.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (responsePack.StateCode.ToUpper() == StateCode.SUCCESS)
{
btnResidenceAddress.Text = str;
OnAppConfig.Instance.SaveUserConfig();
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs
index 3fc11fc..73c2bd2 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs
@@ -285,7 +285,7 @@
{
Action<string> action = (pw) => {
var resultObj = new HttpServerRequest().LoginByPassword(MainPage.LoginUser.accountString, pw);
- if (resultObj.Code == HttpUtil.SUCCESS_CODE)
+ if (resultObj.Code == StateCode.SUCCESS)
{
OnAppConfig.Instance.appUnlockPasswrod = "";
OnAppConfig.Instance.appUnlockType = new System.Collections.Generic.List<string>();
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs
index 6d8625f..0aa9709 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs
@@ -369,7 +369,7 @@
{
Action<string> action = (pw) => {
var resultObj = new HttpServerRequest().LoginByPassword(MainPage.LoginUser.accountString, pw);
- if (resultObj.Code.ToUpper() == HttpUtil.SUCCESS_CODE)
+ if (resultObj.Code.ToUpper() == StateCode.SUCCESS)
{
OnAppConfig.Instance.appUnlockPasswrod = "";
OnAppConfig.Instance.appUnlockType = new System.Collections.Generic.List<string>();
diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
index 3f34f58..0cf683f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
@@ -910,7 +910,7 @@
if (revertObj != null)
{
- if (revertObj.StateCode == HttpUtil.SUCCESS_CODE)
+ if (revertObj.StateCode == StateCode.SUCCESS)
{
var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>>(revertObj.ResponseData.ToString());
--
Gitblit v1.8.0