From 536bc8fecd45139bba59d1bafcbe7d4f4e1f4d34 Mon Sep 17 00:00:00 2001 From: tzy <hxb@hdlchina.com.cn> Date: 星期四, 01 七月 2021 11:06:44 +0800 Subject: [PATCH] 完成管理员权限迁移的功能 --- HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs | 10 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationMemberListPage.cs | 180 ++++++++++ HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationMemberConfirmPage.cs | 210 ++++++++++++ HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs | 19 + HDL-ON_Android/Assets/Language.ini | 27 + HDL_ON/HDL_ON.projitems | 4 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs | 185 ++++------ HDL_ON/UI/UI0-Stan/Logic/HdlCheckLogic.cs | 12 /dev/null | 150 -------- HDL-ON_iOS/Resources/Language.ini | 28 + HDL_ON/DAL/Server/NewAPI.cs | 4 HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddThirdPartyDeviceMenuListPage.cs | 2 HDL_ON/Common/R.cs | 39 ++ HDL_ON/DAL/Server/HttpServerRequest.cs | 18 + HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs | 6 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationResultPage.cs | 105 ++++++ 16 files changed, 698 insertions(+), 301 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index a0ef7c8..b720f1b 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -616,13 +616,17 @@ 1154=Transferring to User, Please Wait鈥� 1155={0} has become a residential administrator 1156=The residence data will be deleted from your account -1157=Fail to transfer +1157=Fail to migrate 1158=Please try again - - - - - +1159=Admin authority migration +1160=Your admin authority is being migrated to other members +1161=1.Your data (cloud data) of the residence will be{0}migratedto the new administrator{0}2.Your data will be exchanged with the target member{0}and your permission will be changed to the target{0}member +1162=Confirm +1163=No members to choose +1164=Confirm admin authority migration from {0} to {1} +1165=Migrate successfully +1166=Fail to migrate +1167=Migrate successfully, And your permissions will become normal members 4000=Video intercom 4001=Call record @@ -1676,8 +1680,15 @@ 1156=璇ヤ綇瀹呯殑淇℃伅灏嗗湪鎮ㄧ殑璐﹀彿涓垹闄� 1157=杩囨埛澶辫触 1158=璇烽噸鏂板皾璇� - - +1159=绠$悊鍛樻潈闄愯浆绉� +1160=鎮ㄥ皢杞Щ鎮ㄧ殑绠$悊鍛樻潈闄愮粰鍏朵粬鎴愬憳 +1161=1.璇ヤ綇瀹呮偍鐨勭鐞嗗憳鏁版嵁锛堜簯绔暟鎹級灏嗗叏閮ㄨ浆绉荤粰鏂扮殑{0}绠$悊鍛榹0}2.鎮ㄧ殑鏁版嵁灏嗕細涓庣洰鏍囨垚鍛樹簰鎹紝鎮ㄧ殑鏉冮檺灏嗗彉鏇翠负鐩爣{0}鎴愬憳鐨勬潈闄� +1162=纭杞Щ +1163=妫�娴嬩笉鍒板彲渚涢�夋嫨鐨勬垚鍛� +1164=纭杞Щ{0}鐨勭鐞嗗憳鏉冮檺缁欒处鍙穥1} +1165=杩佺Щ鎴愬姛 +1166=杩佺Щ澶辫触 +1167=杩佺Щ鎴愬姛锛屾偍鐨勬潈闄愬皢鍙樹负鏅�氭垚鍛� 4000=鍙瀵硅 4001=閫氳瘽璁板綍 diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index a253aa0..b720f1b 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -439,7 +439,6 @@ 453=Alarm mute 454=Deployment information 455=The name can not be blank. - 456=Canvas 457=Energy consumption 458=Date @@ -617,13 +616,17 @@ 1154=Transferring to User, Please Wait鈥� 1155={0} has become a residential administrator 1156=The residence data will be deleted from your account -1157=Fail to transfer +1157=Fail to migrate 1158=Please try again - - - - - +1159=Admin authority migration +1160=Your admin authority is being migrated to other members +1161=1.Your data (cloud data) of the residence will be{0}migratedto the new administrator{0}2.Your data will be exchanged with the target member{0}and your permission will be changed to the target{0}member +1162=Confirm +1163=No members to choose +1164=Confirm admin authority migration from {0} to {1} +1165=Migrate successfully +1166=Fail to migrate +1167=Migrate successfully, And your permissions will become normal members 4000=Video intercom 4001=Call record @@ -1677,8 +1680,15 @@ 1156=璇ヤ綇瀹呯殑淇℃伅灏嗗湪鎮ㄧ殑璐﹀彿涓垹闄� 1157=杩囨埛澶辫触 1158=璇烽噸鏂板皾璇� - - +1159=绠$悊鍛樻潈闄愯浆绉� +1160=鎮ㄥ皢杞Щ鎮ㄧ殑绠$悊鍛樻潈闄愮粰鍏朵粬鎴愬憳 +1161=1.璇ヤ綇瀹呮偍鐨勭鐞嗗憳鏁版嵁锛堜簯绔暟鎹級灏嗗叏閮ㄨ浆绉荤粰鏂扮殑{0}绠$悊鍛榹0}2.鎮ㄧ殑鏁版嵁灏嗕細涓庣洰鏍囨垚鍛樹簰鎹紝鎮ㄧ殑鏉冮檺灏嗗彉鏇翠负鐩爣{0}鎴愬憳鐨勬潈闄� +1162=纭杞Щ +1163=妫�娴嬩笉鍒板彲渚涢�夋嫨鐨勬垚鍛� +1164=纭杞Щ{0}鐨勭鐞嗗憳鏉冮檺缁欒处鍙穥1} +1165=杩佺Щ鎴愬姛 +1166=杩佺Щ澶辫触 +1167=杩佺Щ鎴愬姛锛屾偍鐨勬潈闄愬皢鍙樹负鏅�氭垚鍛� 4000=鍙瀵硅 4001=閫氳瘽璁板綍 diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index be0041a..94799d4 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -1169,8 +1169,43 @@ /// <summary> /// 璇烽噸鏂板皾璇� /// </summary> - public const int PleaseTryAgain = 1158; - + public const int PleaseTryAgain = 1158; + /// <summary> + /// 绠$悊鍛樻潈闄愯浆绉� + /// </summary> + public const int AdminAuthorityTransfer = 1159; + /// <summary> + /// 鎮ㄥ皢杞Щ鎮ㄧ殑绠$悊鍛樻潈闄愮粰鍏朵粬鎴愬憳 + /// </summary> + public const int AdminAuthorityTransferMag1 = 1160; + /// <summary> + /// 1.璇ヤ綇瀹呮偍鐨勭鐞嗗憳鏁版嵁锛堜簯绔暟鎹級灏嗗叏閮ㄨ浆绉荤粰鏂扮殑绠$悊鍛榹0}2.鎮ㄧ殑鏁版嵁灏嗕細涓庣洰鏍囨垚鍛樹簰鎹紝鎮ㄧ殑鏉冮檺灏嗗彉鏇翠负鐩爣鎴愬憳鐨勬潈闄� + /// </summary> + public const int AdminAuthorityTransferMag2 = 1161; + /// <summary> + /// 纭杞Щ + /// </summary> + public const int ConfirmTransfer2 = 1162; + /// <summary> + /// 妫�娴嬩笉鍒板彲渚涢�夋嫨鐨勬垚鍛� + /// </summary> + public const int NotHadMemberToSelect = 1163; + /// <summary> + /// 纭杞Щ{0}鐨勭鐞嗗憳鏉冮檺缁欒处鍙穥1} + /// </summary> + public const int TransferreConfirmMsg3 = 1164; + /// <summary> + /// 杩佺Щ鎴愬姛 + /// </summary> + public const int TransferreSuccess1 = 1165; + /// <summary> + /// 杩佺Щ澶辫触 + /// </summary> + public const int TransferreFail1 = 1166; + /// <summary> + /// 杩佺Щ鎴愬姛锛屾偍鐨勬潈闄愬皢鍙樹负鏅�氭垚鍛� + /// </summary> + public const int TransferreSuccessMsg1 = 1167; public const int keshiduijiang = 4000; public const int tonghuajilu = 4001; diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index b059398..4ad531b 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -738,6 +738,24 @@ return result != null && result.Code == StateCode.SUCCESS; } + /// <summary> + /// 绠$悊鍛樻潈闄愯縼绉� + /// </summary> + /// <param name="i_childAccountId">鎴愬憳璐﹀彿id</param> + /// <returns></returns> + public bool AdminAuthorityMigration(string i_childAccountId) + { + var pra2 = new + { + homeId = DB_ResidenceData.Instance.CurrentRegion.id, + childAccountId = i_childAccountId + }; + var requestJson = HttpUtil.GetSignRequestJson(pra2); + var result = HttpUtil.RequestHttpsPost(NewAPI.API_Post_AdminAuthorityMigration, requestJson); + + return result != null && result.Code == StateCode.SUCCESS; + } + #region 鏂版暟鎹垎浜� /// <summary> /// 娣诲姞鍒嗕韩 diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs index 07179a1..577a028 100644 --- a/HDL_ON/DAL/Server/NewAPI.cs +++ b/HDL_ON/DAL/Server/NewAPI.cs @@ -115,6 +115,10 @@ /// 杩囨埛 /// </summary> public const string API_Post_TransferResidence = "/home-wisdom/app/home/transfer"; + /// <summary> + /// 绠$悊鍛樻潈闄愯縼绉� + /// </summary> + public const string API_Post_AdminAuthorityMigration = "/home-wisdom/app/home/ownerConvert"; #endregion diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 4649930..5c7d4dd 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -37,6 +37,9 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Logic\HdlBluetoothIOSLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Logic\HdlCheckLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Logic\HdlCommonLogic.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\AdminMigrationMemberConfirmPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\AdminMigrationMemberListPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\AdminMigrationResultPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferingResidencePage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferResidenceResultPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\DoorLock\DoorLockAlwaysOnManagerPage.cs" /> @@ -233,7 +236,6 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\ConfirmButton.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\AdminMigrationConfirmPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferInputPage.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\AdminMigrationInputPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\Transfer\TransferUserConfirmPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\1-HomePage\MessageCenterPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\MenuButton.cs" /> diff --git a/HDL_ON/UI/UI0-Stan/Logic/HdlCheckLogic.cs b/HDL_ON/UI/UI0-Stan/Logic/HdlCheckLogic.cs index fcc986b..53f920a 100644 --- a/HDL_ON/UI/UI0-Stan/Logic/HdlCheckLogic.cs +++ b/HDL_ON/UI/UI0-Stan/Logic/HdlCheckLogic.cs @@ -46,7 +46,7 @@ /// <param name="addTopFrame">楠岃瘉鐣岄潰鏄惁娣诲姞澶撮儴Frame(鍙鎵嬪娍瀵嗙爜鍜屾暟瀛楀瘑鐮佹湁鏁�)</param> /// <param name="successEvent">楠岃瘉鎴愬姛涔嬪悗鐨勫洖璋冨嚱鏁�,澶辫触涓嶄細鍥炶皟(0:娌℃湁璁剧疆鏈夐獙璇� 1:楠岃瘉鎴愬姛锛�</param> /// <param name="loadPageBeforEvent">鍔犺浇鎸囧畾瑙i攣璁よ瘉鐣岄潰涔嬪墠鐨勪簨浠�,0:鍙栨秷褰撳墠楠岃瘉骞跺垏鎹㈠埌鍏朵粬鏂瑰紡,1:鏁板瓧瀵嗙爜,2:鎵嬪娍瀵嗙爜,3:鎸囩汗瀵嗙爜,4:闈㈠ID</param> - public void CheckUnlockSecurity(bool addTopFrame, Action<int> successEvent, Action<string> loadPageBeforEvent = null) + public void CheckUnlockSecurity(bool addTopFrame, Action<int> successEvent, Action<int> loadPageBeforEvent = null) { //楠岃瘉鎸囩汗鍜岄潰瀹筰d閮戒娇鐢ㄦ寚绾归獙璇� if (UserInfo.Current.appUnlockType.Contains("3") || UserInfo.Current.appUnlockType.Contains("4")) @@ -58,7 +58,7 @@ if (type == TouchIDUtils.TouchIDSupperType.TouchID) { //閫氱煡浣跨敤鎸囩汗楠岃瘉 - loadPageBeforEvent?.Invoke("3"); + loadPageBeforEvent?.Invoke(3); //Touch ID楠岃瘉 TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent += (sender2, e2) => @@ -77,7 +77,7 @@ else if (e2 == TouchIDUtils.TouchIDState.InputPassword) { //閫氱煡鍙栨秷浜嗛獙璇�,鍒囨崲涓哄叾浠栭獙璇� - loadPageBeforEvent?.Invoke("0"); + loadPageBeforEvent?.Invoke(0); //浣跨敤瀵嗙爜鎴栬�呮墜鍔垮瘑鐮佽В閿佽璇� this.CheckUnlockSecurityByPassword(addTopFrame, successEvent, loadPageBeforEvent); @@ -108,12 +108,12 @@ /// <param name="addTopFrame">楠岃瘉鐣岄潰鏄惁娣诲姞澶撮儴Frame(鍙鎵嬪娍瀵嗙爜鍜屾暟瀛楀瘑鐮佹湁鏁�)</param> /// <param name="successEvent">楠岃瘉鎴愬姛涔嬪悗鐨勫洖璋冨嚱鏁�,澶辫触涓嶄細鍥炶皟(0:娌℃湁璁剧疆鏈夐獙璇� 1:楠岃瘉鎴愬姛锛�</param> /// <param name="loadPageBeforEvent">鍔犺浇鎸囧畾瑙i攣璁よ瘉鐣岄潰涔嬪墠鐨勪簨浠�,1:鏁板瓧瀵嗙爜,2:鎵嬪娍瀵嗙爜,3:鎸囩汗瀵嗙爜,4:闈㈠ID</param> - private void CheckUnlockSecurityByPassword(bool addTopFrame, Action<int> successEvent, Action<string> loadPageBeforEvent = null) + private void CheckUnlockSecurityByPassword(bool addTopFrame, Action<int> successEvent, Action<int> loadPageBeforEvent = null) { if (UserInfo.Current.appUnlockType.Contains("1")) { //閫氱煡浣跨敤鏁板瓧瀵嗙爜楠岃瘉 - loadPageBeforEvent?.Invoke("1"); + loadPageBeforEvent?.Invoke(1); //鏄剧ず鏁板瓧瀵嗙爜瑙i攣璁よ瘉鐣岄潰 this.ShowAppNumPasswordSecurityForm(addTopFrame, successEvent); @@ -121,7 +121,7 @@ else if (UserInfo.Current.appUnlockType.Contains("2")) { //閫氱煡浣跨敤鎵嬪娍瀵嗙爜楠岃瘉 - loadPageBeforEvent?.Invoke("2"); + loadPageBeforEvent?.Invoke(2); //鏄剧ず鎵嬪娍瀵嗙爜瑙i攣璁よ瘉鐣岄潰 this.ShowAppGestureSecurityForm(addTopFrame, successEvent); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddThirdPartyDeviceMenuListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddThirdPartyDeviceMenuListPage.cs index 58b0c30..278a056 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddThirdPartyDeviceMenuListPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/MiniRemoteControl/AddThirdPartyDeviceMenuListPage.cs @@ -7,7 +7,7 @@ namespace HDL_ON.UI { /// <summary> - /// 娣诲姞绗笁鏂硅澶囩殑鑿滃崟鍒楄〃鐣岄潰 + /// 娣诲姞绗笁鏂硅澶囩殑鑿滃崟鍒楄〃鐣岄潰(宸插簾寮�) /// </summary> public class AddThirdPartyDeviceMenuListPage : EditorCommonForm { diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs index ee17871..849be74 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs @@ -282,7 +282,11 @@ Height = Application.GetRealHeight(65), BackgroundColor = CSS_Color.MainBackgroundColor, }; - //contentView.AddChidren(administratorPermissionMigrationRow); + if (DB_ResidenceData.Instance.CurrentRegion.isOtherShare == false) + { + //鏄富璐﹀彿鏈汉鎵嶈兘鏄剧ず杩欎釜鑿滃崟 + contentView.AddChidren(administratorPermissionMigrationRow); + } btnAdministratorPermissionMigrationTitle = new Button() { diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs index 9faddfc..f62265b 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs @@ -157,10 +157,8 @@ { EventHandler<MouseEventArgs> eventHandler = (sender, e) => { - var skipPage = new AdminMigrationConfirmPage(); - MainPage.BasePageView.AddChidren(skipPage); - skipPage.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + var form = new AdminMigrationConfirmPage(); + form.AddForm(); }; administratorPermissionMigrationRow.MouseUpEventHandler = eventHandler; @@ -176,8 +174,8 @@ { EventHandler<MouseEventArgs> eventHandler = (sender, e) => { - var from = new TransferConfirmPage(); - from.AddForm(); + var form = new TransferConfirmPage(); + form.AddForm(); }; transferRow.MouseUpEventHandler = eventHandler; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs index 0b29974..ae82ebe 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationConfirmPage.cs @@ -1,140 +1,95 @@ 锘縰sing System; using Shared; using HDL_ON.UI.CSS; +using HDL_ON.Stan; namespace HDL_ON.UI { /// <summary> /// 绠$悊鍛樻潈闄愯縼绉荤‘璁ゆ彁閱掔晫闈� /// </summary> - public class AdminMigrationConfirmPage : FrameLayout + public class AdminMigrationConfirmPage : EditorCommonForm { - /// <summary> - /// - /// </summary> - FrameLayout bodyView; + #region 鈻� 鍙橀噺澹版槑___________________________ - public AdminMigrationConfirmPage() + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() { - bodyView = this; + //绠$悊鍛樻潈闄愯浆绉� + base.SetTitleText(Language.StringByID(StringId.AdminAuthorityTransfer)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); } /// <summary> - /// + /// 鍒濆鍖栦腑閮ㄤ俊鎭� /// </summary> - public void LoadPage() + private void InitMiddleFrame() { - BackgroundColor = CSS_Color.MainBackgroundColor; + //娓呯┖bodyFrame + this.ClearBodyFrame(); - new TopViewDiv(bodyView, Language.StringByID(StringId.AdministratorPermissionMigration)).LoadTopView(); + //璐﹀彿鑷繁鐨勫ご鍍� + var btnHeadImage = new ImageView(); + btnHeadImage.X = Application.GetRealWidth(48); + btnHeadImage.Y = Application.GetRealHeight(32); + btnHeadImage.Width = Application.GetRealWidth(84); + btnHeadImage.Height = Application.GetRealWidth(84); + btnHeadImage.Radius = (uint)Application.GetRealWidth(42); + btnHeadImage.ImagePath = UserInfo.Current.headImagePagePath; + bodyFrameLayout.AddChidren(btnHeadImage); - #region 澶村儚 - FrameLayout headView = new FrameLayout() + //绠ご + var btnArrow = new PicViewControl(84, 32); + btnArrow.X = btnHeadImage.Right + Application.GetRealWidth(12); + btnArrow.Y = Application.GetRealHeight(58); + btnArrow.UnSelectedImagePath = "PersonalCenter/Transfer.png"; + bodyFrameLayout.AddChidren(btnArrow); + + //涓�涓粯璁ゅご鍍� + var btnHead2 = new IconViewControl(102); + btnHead2.X = btnArrow.Right + Application.GetRealWidth(3); + btnHead2.Y = Application.GetRealHeight(26); + btnHead2.UnSelectedImagePath = "PersonalCenter/Head.png"; + bodyFrameLayout.AddChidren(btnHead2); + + //鎮ㄥ皢杞Щ鎮ㄧ殑绠$悊鍛樻潈闄愮粰鍏朵粬鎴愬憳 + this.AddListMsgControls(bodyFrameLayout, Language.StringByID(StringId.AdminAuthorityTransferMag1), CSS_FontSize.SubheadingFontSize, + CSS_Color.FirstLevelTitleColor, Application.GetRealHeight(23), btnHead2.Bottom + Application.GetRealHeight(12)); + + //璇锋敞鎰�: + var btnAttention = new NormalViewControl(200, 18, true); + btnAttention.X = HdlControlResourse.XXLeft; + btnAttention.Y = btnHeadImage.Bottom + Application.GetRealHeight(84); + btnAttention.TextID = StringId.Attention; + btnAttention.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + btnAttention.TextColor = CSS_Color.FirstLevelTitleColor; + bodyFrameLayout.AddChidren(btnAttention); + + //1.璇ヤ綇瀹呮偍鐨勭鐞嗗憳鏁版嵁锛堜簯绔暟鎹級灏嗗叏閮ㄨ浆绉荤粰鏂扮殑绠$悊鍛� + //2.鎮ㄧ殑鏁版嵁灏嗕細涓庣洰鏍囨垚鍛樹簰鎹紝鎮ㄧ殑鏉冮檺灏嗗彉鏇翠负鐩爣鎴愬憳鐨勬潈闄� + var listContr = this.AddListMsgControls(bodyFrameLayout, Language.StringByID(StringId.AdminAuthorityTransferMag2), CSS_FontSize.PromptFontSize_FirstLevel, + CSS_Color.TextualColor, Application.GetRealHeight(18), btnAttention.Bottom + Application.GetRealHeight(8), TextAlignment.CenterLeft); + + //纭杞Щ + var btnConfirm = new BottomClickButton(220); + btnConfirm.Y = listContr[listContr.Count - 1].Bottom + Application.GetRealHeight(75); + btnConfirm.TextID = StringId.ConfirmTransfer2; + bodyFrameLayout.AddChidren(btnConfirm); + btnConfirm.ButtonClickEvent += (sender, e) => { - Y = Application.GetRealHeight(72), - Height = Application.GetRealHeight(132), + var form = new AdminMigrationMemberListPage(); + form.AddForm(); }; - bodyView.AddChidren(headView); - - - ImageView myHeadImage = new ImageView() - { - X = Application.GetRealWidth(48), - Y = Application.GetRealHeight(96), - Width = Application.GetRealWidth(84), - Height = Application.GetRealWidth(84), - Radius = (uint)Application.GetRealWidth(42), - ImagePath = UserInfo.Current.headImagePagePath, - Gravity = Gravity.CenterVertical, - }; - headView.AddChidren(myHeadImage); - - ImageView transferImage = new ImageView() - { - X = Application.GetRealWidth(144), - Y = Application.GetRealHeight(96), - Width = Application.GetRealWidth(84), - Height = Application.GetRealWidth(32), - ImagePath = "PersonalCenter/Transfer.png", - Gravity = Gravity.Center, - }; - headView.AddChidren(transferImage); - - ImageView otherHeadImage = new ImageView() - { - X = Application.GetRealWidth(231), - Y = Application.GetRealHeight(96), - Width = Application.GetRealWidth(101), - Height = Application.GetRealWidth(101), - ImagePath = "PersonalCenter/Head.png", - Gravity = Gravity.CenterVertical, - }; - headView.AddChidren(otherHeadImage); - - #endregion - - var btnTip = new Button() - { - Y = headView.Bottom, - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(22), - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - Text = "鎮ㄥ皢杞Щ鎮ㄧ殑绠$悊鍛樻潈闄愮粰鍏朵粬HDL璐﹀彿", - }; - bodyView.AddChidren(btnTip); - - - //璇锋敞鎰� - var btnPleaseNote = new Button() - { - Y = btnTip.Bottom + Application.GetRealHeight(38), - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(17), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = "璇锋敞鎰忥細", - }; - bodyView.AddChidren(btnPleaseNote); - - //璇锋敞鎰忕殑鍐呭 - var btnPleaseNoteStr = new Button() - { - Y = btnPleaseNote.Bottom + Application.GetRealHeight(8), - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(170), - TextAlignment = TextAlignment.TopLeft, - TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - IsMoreLines = true, - Text = "1.璇ヤ綇瀹呮偍鐨勭鐞嗗憳鏁版嵁锛堜簯绔暟鎹級灏嗗叏閮ㄨ浆绉荤粰鏂扮殑绠$悊鍛� \n\n2.鏂扮殑绠$悊鍛樺彲浠ラ�夋嫨涓嶄繚鐣欏師鏈変綇瀹呮垚鍛樼殑鏁版嵁,鍏朵粬鎴愬憳灏嗕細涓嶈兘浣跨敤 \n\n3.鍦ㄨ浆绉诲悗锛屾偍鑻ラ渶瑕佹垚涓哄搴垚鍛橈紝鐢辨柊鐨勭鐞嗗憳璁剧疆 \n\n4.鎺ユ敹鏂硅处鍙蜂负鏈夋晥鐨凥DL璐﹀彿 \n\n5.鎺ユ敹鏂硅处鍙蜂笌杞Щ鏂硅处鍙蜂笉鍙负鍚屼竴涓处鍙� (缁戝畾鐨勫叾浠栫櫥褰�)", - }; - bodyView.AddChidren(btnPleaseNoteStr); - - // - var btnConfirm = new ConfirmButton() - { - Y = Application.GetRealHeight(583), - Text = "纭杞Щ", - }; - bodyView.AddChidren(btnConfirm); - - btnConfirm.MouseUpEventHandler = (sender, e) => { - //Utlis.ShowTip("鏆備笉鏀寔"); - var skipPage = new AdminMigrationInputPage(); - MainPage.BasePageView.AddChidren(skipPage); - skipPage.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - - } + #endregion } - } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationInputPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationInputPage.cs deleted file mode 100644 index 8f4c011..0000000 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationInputPage.cs +++ /dev/null @@ -1,150 +0,0 @@ -锘縰sing System; -using Shared; -using HDL_ON.UI.CSS; - -namespace HDL_ON.UI -{ - /// <summary> - /// 绠$悊鍛樿浆绉昏緭鍏ヨ处鍙风晫闈� - /// </summary> - public class AdminMigrationInputPage : FrameLayout - { - /// <summary> - /// - /// </summary> - FrameLayout bodyView; - - public AdminMigrationInputPage() - { - bodyView = this; - } - - /// <summary> - /// - /// </summary> - public void LoadPage() - { - BackgroundColor = CSS_Color.BackgroundColor; - - new TopViewDiv(bodyView, Language.StringByID(StringId.AdministratorPermissionMigration)).LoadTopView(); - - #region 璐﹀彿濉啓 - var accountView = new FrameLayout() - { - Y = Application.GetRealHeight(72), - Height = Application.GetRealHeight(50), - BackgroundColor = CSS_Color.MainBackgroundColor - }; - bodyView.AddChidren(accountView); - - var btnAccountIcon = new Button() - { - X = Application.GetRealWidth(16), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(24), - Height = Application.GetMinRealAverage(24), - UnSelectedImagePath = "LoginIcon/AccountIcon.png", - }; - accountView.AddChidren(btnAccountIcon); - - var etAccount = new EditText() - { - X = Application.GetRealWidth(52), - Width = Application.GetRealWidth(307), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - PlaceholderTextColor = CSS_Color.PromptingColor1, - PlaceholderText = "璇疯緭鍏ユ帴鏀舵柟璐﹀彿", - }; - accountView.AddChidren(etAccount); - - var btnLine = new Button() - { - BackgroundColor = CSS_Color.DividingLineColor, - Height = Application.GetRealHeight(1), - Y = accountView.Height - Application.GetRealHeight(1), - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(343), - }; - accountView.AddChidren(btnLine); - #endregion - - #region 璐﹀彿濉啓 - var accountConfirmView = new FrameLayout() - { - Y = accountView.Bottom, - Height = Application.GetRealHeight(50), - BackgroundColor = CSS_Color.MainBackgroundColor - }; - bodyView.AddChidren(accountConfirmView); - - var btnAccountConfirmIcon = new Button() - { - X = Application.GetRealWidth(16), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(24), - Height = Application.GetMinRealAverage(24), - UnSelectedImagePath = "LoginIcon/AccountIcon.png", - }; - accountConfirmView.AddChidren(btnAccountConfirmIcon); - - var etAccountConfirm = new EditText() - { - X = Application.GetRealWidth(52), - Width = Application.GetRealWidth(307), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - PlaceholderTextColor = CSS_Color.PromptingColor1, - PlaceholderText = "璇峰啀娆¤緭鍏ユ帴鏀舵柟璐﹀彿", - }; - accountConfirmView.AddChidren(etAccountConfirm); - - //var btnLine2 = new Button() - //{ - // BackgroundColor = CSS_Color.DividingLineColor, - // Height = Application.GetRealHeight(1), - // Y = accountConfirmView.Height - Application.GetRealHeight(1), - //}; - //accountConfirmView.AddChidren(btnLine2); - #endregion - - var btnTip = new Button() - { - Y = accountConfirmView.Bottom + Application.GetRealHeight(12), - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(343), - TextAlignment = TextAlignment.TopLeft, - TextColor = CSS_Color.AuxiliaryColor2, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = "*璇风‘璁よ处鍙锋棤璇紝鍦ㄦ暟鎹浆绉昏繃绋嬩腑涓嶅彲鍙栨秷鎿嶄綔", - IsMoreLines = true - - }; - bodyView.AddChidren(btnTip); - - var btnConfirm = new ConfirmButton() - { - Y = Application.GetRealHeight(251), - Text = "杞Щ", - }; - bodyView.AddChidren(btnConfirm); - - Button btnEmailOption = new Button() - { - Y = btnConfirm.Bottom + Application.GetRealWidth(6), - Width = Application.GetRealWidth(220), - Height = Application.GetRealWidth(32), - TextSize = CSS_FontSize.TextFontSize, - TextColor = CSS_Color.MainColor, - Gravity = Gravity.CenterHorizontal, - TextAlignment = TextAlignment.Center, - Text = "鎵弿浜岀淮鐮佽縼绉�" - }; - bodyView.AddChidren(btnEmailOption); - } - - } - -} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationMemberConfirmPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationMemberConfirmPage.cs new file mode 100644 index 0000000..1312dd4 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationMemberConfirmPage.cs @@ -0,0 +1,210 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.CSS; +using HDL_ON.Stan; +using HDL_ON.Entity; + +namespace HDL_ON.UI +{ + /// <summary> + /// 绠$悊鍛樻潈闄愯縼绉绘垚鍛樿祫鏂欑‘璁ょ晫闈� + /// </summary> + public class AdminMigrationMemberConfirmPage : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鎴愬憳淇℃伅 + /// </summary> + private ResidenceMemberInfo memberInfo = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_memberInfo">鎴愬憳淇℃伅</param> + public void ShowForm(ResidenceMemberInfo i_memberInfo) + { + this.memberInfo = i_memberInfo; + + //涓汉璧勬枡 + base.SetTitleText(Language.StringByID(StringId.Profile)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + //涓婇儴鐨勭櫧鑹茶儗鏅� + var frameBack1 = new FrameLayout(); + frameBack1.BackgroundColor = CSS_Color.MainBackgroundColor; + frameBack1.Height = Application.GetRealHeight(204); + bodyFrameLayout.AddChidren(frameBack1); + + //澶村儚 + var btnHeadImage = new ImageView(); + btnHeadImage.Y = Application.GetRealHeight(32); + btnHeadImage.Gravity = Gravity.CenterHorizontal; + btnHeadImage.Width = Application.GetRealWidth(84); + btnHeadImage.Height = Application.GetRealWidth(84); + btnHeadImage.Radius = (uint)Application.GetRealWidth(42); + btnHeadImage.ImagePath = "LoginIcon/2.png"; + frameBack1.AddChidren(btnHeadImage); + + //鏄电О + var btnName = new NormalViewControl(frameBack1.Width - HdlControlResourse.XXLeft * 2, Application.GetRealHeight(24), false); + btnName.Y = btnHeadImage.Bottom + Application.GetRealHeight(11); + btnName.Gravity = Gravity.CenterHorizontal; + btnName.IsBold = true; + btnName.TextSize = CSS_FontSize.SubheadingFontSize; + btnName.TextColor = CSS_Color.FirstLevelTitleColor; + btnName.Text = string.IsNullOrEmpty(memberInfo.nickName) == true ? memberInfo.memberName : memberInfo.nickName; + btnName.TextAlignment = TextAlignment.Center; + frameBack1.AddChidren(btnName); + + //璐﹀彿 + var btnAccount = new NormalViewControl(frameBack1.Width - HdlControlResourse.XXLeft * 2, Application.GetRealHeight(16), false); + btnAccount.Y = btnName.Bottom + Application.GetRealHeight(7); + btnAccount.Gravity = Gravity.CenterHorizontal; + btnAccount.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + btnAccount.TextAlignment = TextAlignment.Center; + btnAccount.Text = memberInfo.Account; + frameBack1.AddChidren(btnAccount); + + //纭鐨勭櫧鑹茶儗鏅� + var frameBack2 = new FrameLayout(); + frameBack2.Y = frameBack1.Bottom + Application.GetRealHeight(8); + frameBack2.Height = Application.GetRealHeight(50); + frameBack2.BackgroundColor = CSS_Color.MainBackgroundColor; + bodyFrameLayout.AddChidren(frameBack2); + //纭杞Щ + var btnConform = new NormalViewControl(200, 24, true); + btnConform.Gravity = Gravity.Center; + btnConform.TextSize = CSS_FontSize.SubheadingFontSize; + btnConform.TextAlignment = TextAlignment.Center; + btnConform.TextColor = CSS_Color.MainColor; + btnConform.TextID = StringId.ConfirmTransfer2; + frameBack2.AddChidren(btnConform); + btnConform.ButtonClickEvent += (sender, e) => + { + //濡傛灉璁剧疆鏈夊畨鍏ㄩ獙璇�,鍒欓渶瑕侀獙璇� + HdlCheckLogic.Current.CheckUnlockSecurity(true, (div) => + { + //濡傛灉娌℃湁璁剧疆鏈夊畨鍏ㄩ獙璇� + if (div == 0) + { + //纭杞Щ{0}鐨勭鐞嗗憳鏉冮檺缁欒处鍙穥1} + string msg = Language.StringByID(StringId.TransferreConfirmMsg3).Replace("{0}", DB_ResidenceData.Instance.CurrentRegion.homeName); + msg = msg.Replace("{1}", btnName.Text); + HdlMessageLogic.Current.ShowMassage(ShowMsgType.Confirm, msg, () => + { + //鎵ц杩佺Щ绠$悊鍛樻潈闄� + this.DoAdminAuthorityMigration(); + }); + } + else + { + //鎵ц杩佺Щ绠$悊鍛樻潈闄� + this.DoAdminAuthorityMigration(); + } + }); + }; + + HdlThreadLogic.Current.RunThread(() => + { + //鐢ㄧ嚎绋嬪幓涓嬭浇澶村儚 + var headImageBytes = ImageUtlis.Current.DownHeadImageByImageKey(this.memberInfo.memberHeadIcon, true); + if (headImageBytes != null && headImageBytes.Length > 0) + { + HdlThreadLogic.Current.RunMain(() => + { + btnHeadImage.ImageBytes = headImageBytes; + }, ShowErrorMode.NO); + } + }); + } + + #endregion + + #region 鈻� 鎵ц杩佺Щ绠$悊鍛樻潈闄恄________________ + + /// <summary> + /// 鎵ц杩佺Щ绠$悊鍛樻潈闄� + /// </summary> + private void DoAdminAuthorityMigration() + { + this.ShowProgressBar(); + HdlThreadLogic.Current.RunThread(() => + { + //鐬庣帺鐨勪竴涓壒鏁堣�屽凡 + System.Threading.Thread.Sleep(1000); + //鎵ц鏉冮檺杩佺Щ + var result = new DAL.Server.HttpServerRequest().AdminAuthorityMigration(this.memberInfo.childAccountId); + this.CloseProgressBar(); + + HdlThreadLogic.Current.RunMain(() => + { + var form = new AdminMigrationResultPage(); + form.AddForm(result); + + form.FinishEvent += () => + { + if (result == false) + { + //閲嶈瘯 + this.DoAdminAuthorityMigration(); + } + else + { + //鎴愬姛 -> 鍒锋柊App缂撳瓨鍙婄晫闈� + this.RefreshAppMemoryAndForm(); + } + }; + }); + }); + } + + /// <summary> + /// 鍒锋柊App缂撳瓨鍙婄晫闈� + /// </summary> + private void RefreshAppMemoryAndForm() + { + //鍒锋柊缂撳瓨(娉ㄦ剰,閲岄潰鏃㈡湁ui,涔熸湁http,涔熸湁杞湀鐨勯偅涓笢瑗�) + Common.ApiUtlis.Ins.DownloadData(); + + HdlThreadLogic.Current.RunThread(() => + { + while (Common.ApiUtlis.Ins.DownloadDataComplete == false) + { + //绛夊緟DownloadData鍑芥暟缁撴潫 + System.Threading.Thread.Sleep(300); + } + HdlThreadLogic.Current.RunMain(() => + { + //鍏抽棴鎵�鏈夌晫闈� + HdlFormLogic.Current.CloseAllOpenForm(); + //鑾峰彇涓婚〉鐨勯偅涓鍣� + var userPage = MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1) as UserPage; + if (userPage != null) + { + //鍒锋柊涓汉涓績鐣岄潰 + MainPage.CurPageIndex = 1; + userPage.ChoosePersonalCenter(); + } + }); + }); + } + + #endregion + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationMemberListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationMemberListPage.cs new file mode 100644 index 0000000..cd751f3 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationMemberListPage.cs @@ -0,0 +1,180 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.CSS; +using HDL_ON.Stan; +using HDL_ON.Entity; +using System.Collections.Generic; + +namespace HDL_ON.UI +{ + /// <summary> + /// 绠$悊鍛樻潈闄愯縼绉荤殑鎴愬憳鍒楄〃鐣岄潰 + /// </summary> + public class AdminMigrationMemberListPage : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鎴愬憳鍒楄〃 + /// </summary> + private List<ResidenceMemberInfo> listMember = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //绠$悊鍛樻潈闄愯浆绉� + base.SetTitleText(Language.StringByID(StringId.AdminAuthorityTransfer)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + HdlThreadLogic.Current.RunThread(() => + { + this.ShowProgressBar(); + //鑾峰彇鎴愬憳鍒楄〃 + var responePack = new DAL.Server.HttpServerRequest().GetResidenceMemberAccount(); + if (responePack.Code != DAL.Server.StateCode.SUCCESS) + { + //鎻愮ず + DAL.Server.IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code); + this.CloseProgressBar(ShowReLoadMode.YES); + return; + } + this.CloseProgressBar(); + + this.listMember = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ResidenceMemberInfo>>(responePack.Data.ToString()); + if (listMember.Count == 0) + { + //妫�娴嬩笉鍒板彲渚涢�夋嫨鐨勬垚鍛� + HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, Language.StringByID(StringId.NotHadMemberToSelect)); + return; + } + HdlThreadLogic.Current.RunMain(() => + { + //鍒楄〃鎺т欢 + var listView = new VerticalListControl(); + listView.Height = bodyFrameLayout.Height; + listView.BackgroundColor = CSS_Color.MainBackgroundColor; + bodyFrameLayout.AddChidren(listView); + + var listIcon = new List<ImageView>(); + for (int i = 0; i < listMember.Count; i++) + { + //娣诲姞鎴愬憳琛屾帶浠� + var btnIcon = this.AddMemberRowcontrol(listView, listMember[i], i != listMember.Count - 1); + listIcon.Add(btnIcon); + } + //璋冩暣妗屽竷楂樺害 + listView.AdjustRealHeight(0); + //鑾峰彇鎴愬憳澶村儚 + this.DownLoadUserIcon(listIcon); + }); + }); + } + + #endregion + + #region 鈻� 娣诲姞鎴愬憳琛屾帶浠禵____________________ + + /// <summary> + /// 娣诲姞鎴愬憳琛屾帶浠� + /// </summary> + /// <param name="listView">鍒楄〃鎺т欢</param> + /// <param name="memberInfo">鎴愬憳淇℃伅</param> + /// <param name="addLine">鏄惁娣诲姞搴曠嚎</param> + private ImageView AddMemberRowcontrol(VerticalListControl listView, ResidenceMemberInfo memberInfo, bool addLine) + { + //琛屾帶浠� + var rowContr = new FrameRowControl(); + rowContr.Height = Application.GetRealHeight(65); + listView.AddChidren(rowContr); + + //澶村儚(鍒濆) + var btnIcon = new ImageView(); + btnIcon.X = HdlControlResourse.XXLeft; + btnIcon.Width = this.GetPictrueRealSize(36); + btnIcon.Height = this.GetPictrueRealSize(36); + btnIcon.Gravity = Gravity.CenterVertical; + btnIcon.Radius = (uint)this.GetPictrueRealSize(36) / 2; + btnIcon.ImagePath = "LoginIcon/2.png"; + rowContr.AddChidren(btnIcon); + + //鏄电О + var nickName = string.IsNullOrEmpty(memberInfo.nickName) == true ? memberInfo.memberName : memberInfo.nickName; + var btnName = rowContr.AddTopView(nickName, 200); + btnName.TextColor = CSS_Color.textColor; + btnName.X = btnIcon.Right + Application.GetRealWidth(12); + btnName.Y = Application.GetRealHeight(12); + //閭鎴栬�呮墜鏈哄彿 + var strPhone = string.IsNullOrEmpty(memberInfo.childAccountPhone) == true ? memberInfo.childAccountEmail : memberInfo.childAccountPhone; + var btnPhone = rowContr.AddBottomView(strPhone, 200); + btnPhone.X = btnName.X; + btnPhone.Y = btnName.Bottom + Application.GetRealHeight(4); + + //鍙崇澶� + rowContr.AddRightArrow(); + + //搴曠嚎 + if (addLine == true) + { + rowContr.AddBottomLine(); + } + + rowContr.ButtonClickEvent += (sender, e) => + { + var form = new AdminMigrationMemberConfirmPage(); + form.AddForm(memberInfo); + }; + + return btnIcon; + } + + #endregion + + #region 鈻� 鑾峰彇鎴愬憳澶村儚_______________________ + + /// <summary> + /// 鑾峰彇鎴愬憳澶村儚 + /// </summary> + /// <param name="listIcon">澶村儚鎺т欢鍒楄〃,瀹冪殑绱㈠紩鍜宼his.listMember涓�鑷�</param> + private void DownLoadUserIcon(List<ImageView> listIcon) + { + HdlThreadLogic.Current.RunThread(() => + { + for (int i = 0; i < this.listMember.Count; i++) + { + var resultData = ImageUtlis.Current.DownHeadImageByImageKey(this.listMember[i].memberHeadIcon, false, this.listMember[i].childAccountRegionUrl); + if (this.Parent == null) + { + //鐣岄潰宸茬粡鍏抽棴 + return; + } + if (resultData != null && resultData.Length > 0) + { + int nowIndex = i; + HdlThreadLogic.Current.RunMain(() => + { + listIcon[nowIndex].ImageBytes = resultData; + }, ShowErrorMode.NO); + } + System.Threading.Thread.Sleep(200); + } + + }, ShowErrorMode.NO); + } + + #endregion + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationResultPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationResultPage.cs new file mode 100644 index 0000000..9b87709 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/AdminMigrationResultPage.cs @@ -0,0 +1,105 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.CSS; +using HDL_ON.Stan; +using System.Collections.Generic; +using HDL_ON.Entity; + +namespace HDL_ON.UI +{ + /// <summary> + /// 绠$悊鍛樻潈闄愯縼绉荤粨鏋滅晫闈� + /// </summary> + public class AdminMigrationResultPage : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 缁撴潫浜嬩欢 + /// </summary> + public Action FinishEvent = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_memberInfo">鎴愬憳淇℃伅</param> + /// <param name="i_success">鏄惁鎴愬姛</param> + public void ShowForm(bool i_success) + { + this.ScrollLeftEnabled = false; + //绠$悊鍛樻潈闄愯浆绉� + base.SetTitleText(Language.StringByID(StringId.AdminAuthorityTransfer)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(i_success); + + //绉婚櫎杩斿洖閿� + base.RemoveBackButton(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + /// <param name="i_success">鏄惁鎴愬姛</param> + private void InitMiddleFrame(bool i_success) + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + //鍥剧墖 + var btnPictrue = new PicViewControl(180, 180); + btnPictrue.Y = Application.GetRealHeight(32); + btnPictrue.Gravity = Gravity.CenterHorizontal; + btnPictrue.UnSelectedImagePath = i_success == true ? "Public/TipIcon_Successfully.png" : "Public/TipIcon_Failed.png"; + bodyFrameLayout.AddChidren(btnPictrue); + + List<NormalViewControl> listContr = null; + if (i_success == true) + { + //杩佺Щ鎴愬姛 + string strMsg = Language.StringByID(StringId.TransferreSuccess1); + listContr = this.AddListMsgControls(bodyFrameLayout, strMsg, CSS_FontSize.SubheadingFontSize, CSS_Color.MainColor, Application.GetRealHeight(24), + btnPictrue.Bottom + Application.GetRealHeight(16)); + + //杩佺Щ鎴愬姛锛屾偍鐨勬潈闄愬皢鍙樹负鏅�氭垚鍛� + strMsg = Language.StringByID(StringId.TransferreSuccessMsg1); + this.AddListMsgControls(bodyFrameLayout, strMsg, CSS_FontSize.PromptFontSize_FirstLevel, CSS_Color.TextualColor, Application.GetRealHeight(18), + listContr[listContr.Count - 1].Bottom + Application.GetRealHeight(8)); + } + else + { + //杩佺Щ澶辫触 + string strMsg = Language.StringByID(StringId.TransferreFail1); + listContr = this.AddListMsgControls(bodyFrameLayout, strMsg, CSS_FontSize.SubheadingFontSize, CSS_Color.AuxiliaryColor2, Application.GetRealHeight(24), + btnPictrue.Bottom + Application.GetRealHeight(16)); + //璇烽噸鏂板皾璇� + var btnMsg2 = new NormalViewControl(bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2, Application.GetRealHeight(18), false); + btnMsg2.Y = listContr[listContr.Count - 1].Bottom + Application.GetRealHeight(8); + btnMsg2.TextAlignment = TextAlignment.Center; + btnMsg2.Gravity = Gravity.CenterHorizontal; + btnMsg2.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + btnMsg2.TextID = StringId.PleaseTryAgain; + bodyFrameLayout.AddChidren(btnMsg2); + } + + //瀹屾垚 + var btnConfirm = new BottomClickButton(220); + btnConfirm.Y = Application.GetRealHeight(337); + btnConfirm.TextID = i_success == true ? StringId.Complete : StringId.Retry; + bodyFrameLayout.AddChidren(btnConfirm); + btnConfirm.ButtonClickEvent += (sender, e) => + { + this.CloseForm(); + //鍥炶皟鍑芥暟 + this.FinishEvent?.Invoke(); + this.FinishEvent = null; + }; + } + + #endregion + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs index 4a5c393..4c40acb 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs @@ -99,8 +99,23 @@ //濡傛灉璁剧疆鏈夊畨鍏ㄩ獙璇�,鍒欓渶瑕侀獙璇� HdlCheckLogic.Current.CheckUnlockSecurity(true, (div) => { - var form = new TransferingResidenceForm(); - form.AddForm(this.accountInfo); + //濡傛灉娌℃湁璁剧疆鏈夊畨鍏ㄩ獙璇� + if (div == 0) + { + //纭杩囨埛{0}鐨勭鐞嗗憳璐﹀彿缁欒处鍙穥1} + string msg = Language.StringByID(StringId.TransferreConfirmMsg2).Replace("{0}", Entity.DB_ResidenceData.Instance.CurrentRegion.homeName); + msg = msg.Replace("{1}", btnName.Text); + HdlMessageLogic.Current.ShowMassage(ShowMsgType.Confirm, Language.StringByID(StringId.TransferreConfirmMsg2), () => + { + var form = new TransferingResidenceForm(); + form.AddForm(this.accountInfo); + }); + } + else + { + var form = new TransferingResidenceForm(); + form.AddForm(this.accountInfo); + } }); }; -- Gitblit v1.8.0