Merge branch 'Dev-Wxr' into Dev-Branch
| | |
| | | 584=Deployment status |
| | | 585=Failed to obtain third-party platform information |
| | | 586=Sort |
| | | 587=Face management |
| | | 588=Tip |
| | | 589=Disagree |
| | | 590=Residential delivery |
| | | 591=*Member name |
| | | 592=Member account |
| | | 593=Face photo |
| | | 594=Please enter member name |
| | | 595=Delete |
| | | |
| | | |
| | | 2532=Visitor Invitation Record |
| | |
| | | 584=布防状态 |
| | | 585=获取第三方平台信息失败 |
| | | 586=排序 |
| | | 587=人脸管理 |
| | | 588=人脸信息采集协议提示 |
| | | 589=不同意 |
| | | 590=住宅交付 |
| | | 591=*成员名称 |
| | | 592=成员账号 |
| | | 593=人脸照片 |
| | | 594=请输入成员名称 |
| | | 595=删除人脸数据 |
| | | |
| | | |
| | | |
| | | 2532=访客邀请记录 |
| | |
| | | 584=Deployment status |
| | | 585=Failed to obtain third-party platform information |
| | | 586=Sort |
| | | 587=Face management |
| | | 588=Tip |
| | | 589=Disagree |
| | | 590=Residential delivery |
| | | 591=*Member name |
| | | 592=Member account |
| | | 593=Face photo |
| | | 594=Please enter member name |
| | | 595=Delete |
| | | |
| | | |
| | | |
| | | 2532=Visitor Invitation Record |
| | |
| | | 584=Deployment status |
| | | 585=Failed to obtain third-party platform information |
| | | 586=Sort |
| | | 587=Face management |
| | | 588=Tip |
| | | 589=Disagree |
| | | 590=Residential delivery |
| | | 591=*Member name |
| | | 592=Member account |
| | | 593=Face photo |
| | | 594=Please enter member name |
| | | 595=Delete |
| | | |
| | | |
| | | |
| | |
| | | 584=Deployment status |
| | | 585=Failed to obtain third-party platform information |
| | | 586=Sort |
| | | 587=Face management |
| | | 588=Tip |
| | | 589=Disagree |
| | | 590=Residential delivery |
| | | 591=*Member name |
| | | 592=Member account |
| | | 593=Face photo |
| | | 594=Please enter member name |
| | | 595=Delete |
| | | |
| | | |
| | | 1000=Влажност в стаята |
| | |
| | | <AndroidAsset Include="Assets\h5\static\img\coal-save-ic.6c5fd125.png" /> |
| | | <AndroidAsset Include="Assets\h5\static\font\SourceHanSansCN-Normal.otf" /> |
| | | <AndroidAsset Include="Assets\Phone\MusicIcon\currentPlayList.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\FaceManagementIcon.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidResource Include="Resources\values\colors.xml" /> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.42" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202302271"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.7" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202303061"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <!--友盟--> |
| | | <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> |
| | |
| | | <resources > |
| | | <!-- 其中parent可以为 android:Theme 或 android:Theme.NoTitleBar; android:windowBackground可以为背景图 --> |
| | | <style name="MyTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen"> |
| | | <item name="android:windowBackground">@drawable/launchimage</item> |
| | | <item name="android:windowBackground">@drawable/loading</item> |
| | | <!-- 隐藏状态栏 --> |
| | | <item name="android:windowFullscreen">false</item> |
| | | <!-- 隐藏标题栏 --> |
| | |
| | | |
| | | </style> |
| | | <style name="SplashTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen"> |
| | | <item name="android:windowBackground">@drawable/launchimage</item> |
| | | <item name="android:windowBackground">@drawable/loading</item> |
| | | <!-- 隐藏状态栏 --> |
| | | <item name="android:windowFullscreen">true</item> |
| | | <!-- 隐藏标题栏 --> |
| | |
| | | 584=Deployment status |
| | | 585=Failed to obtain third-party platform information |
| | | 586=Sort |
| | | 587=Face management |
| | | 588=Tip |
| | | 589=Disagree |
| | | 590=Residential delivery |
| | | |
| | | |
| | | 2532=Visitor Invitation Record |
| | |
| | | 584=布防状态 |
| | | 585=获取第三方平台信息失败 |
| | | 586=排序 |
| | | |
| | | 587=人脸管理 |
| | | 588=人脸信息采集协议提示 |
| | | 589=不同意 |
| | | 590=住宅交付 |
| | | |
| | | 2532=访客邀请记录 |
| | | 2533=访客管理 |
| | |
| | | 584=Deployment status |
| | | 585=Failed to obtain third-party platform information |
| | | 586=Sort |
| | | 587=Face management |
| | | 588=Tip |
| | | 589=Disagree |
| | | 590=Residential delivery |
| | | |
| | | |
| | | |
| | | 2532=Visitor Invitation Record |
| | |
| | | 584=Deployment status |
| | | 585=Failed to obtain third-party platform information |
| | | 586=Sort |
| | | 587=Face management |
| | | 588=Tip |
| | | 589=Disagree |
| | | 590=Residential delivery |
| | | |
| | | |
| | | |
| | |
| | | 584=Deployment status |
| | | 585=Failed to obtain third-party platform information |
| | | 586=Sort |
| | | 587=Face management |
| | | 588=Tip |
| | | 589=Disagree |
| | | 590=Residential delivery |
| | | |
| | | |
| | | 1000=Влажност в стаята |
| | |
| | | if (imageView != null) |
| | | { |
| | | imageView.ImageBytes = imageBytes; |
| | | //Utlis.WriteLine("imageKey 加载云端下载图片成功"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | /// 第一次启动app |
| | | /// </summary> |
| | | public bool FirstRunApp = true; |
| | | /// <summary> |
| | | /// 是否同意人脸采集协议 |
| | | /// </summary> |
| | | public bool FaceManagementTip = false; |
| | | |
| | | /// <summary> |
| | | /// 忽略更新的版本号 |
| | |
| | | public static class StringId |
| | | { |
| | | /// <summary> |
| | | /// 删除人脸数据 |
| | | /// </summary> |
| | | public const int DeleteMemberFace = 595; |
| | | /// <summary> |
| | | /// 请输入成员备注 |
| | | /// </summary> |
| | | public const int PlsEntrySubAccountRemark = 594; |
| | | /// <summary> |
| | | /// 人脸照片 |
| | | /// </summary> |
| | | public const int MemberFace = 593; |
| | | /// <summary> |
| | | /// 成员账号 |
| | | /// </summary> |
| | | public const int MemberAccount = 592; |
| | | /// <summary> |
| | | /// 成员名称 |
| | | /// </summary> |
| | | public const int MemberName = 591; |
| | | /// <summary> |
| | | /// 住宅交付 |
| | | /// </summary> |
| | | public const int ResidentialDelivery = 590; |
| | | /// <summary> |
| | | /// 不同意 |
| | | /// </summary> |
| | | public const int Disagree = 589; |
| | | /// <summary> |
| | | /// 人脸信息采集协议提示 |
| | | /// </summary> |
| | | public const int FaceProtocolPrompt = 588; |
| | | /// <summary> |
| | | /// 人脸管理 |
| | | /// </summary> |
| | | public const int FaceManagemant = 587; |
| | | /// <summary> |
| | | /// 排序 |
| | | /// </summary> |
| | | public const int Sort = 586; |
| | |
| | | // return; |
| | | // } |
| | | //} |
| | | MainPage.Log($"音乐收到数据:{revString}"); |
| | | MainPage.Log($"收到数据:{revString}"); |
| | | foreach (var attr in updateTemp.status) |
| | | { |
| | | localFunction.time_stamp = temp.time_stamp; |
| | | localFunction.SetAttrState(attr.key, attr.value); |
| | | Console.WriteLine("音乐播放器添加缓存数据=======" + revString); |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | var requestObj = new ChildDeleteObj() |
| | | { |
| | | childAccountId = subaccount.childAccountId, |
| | | childId = subaccount.id, |
| | | homeId = subaccount.homeId |
| | | }; |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | |
| | | /// <returns></returns> |
| | | public ResponsePackNew EditSubAccountNickName(string nickName, string childAccountId) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj() |
| | | { |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | childAccountId = childAccountId, |
| | | nickName = nickName, |
| | | }); |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("childId", childAccountId); |
| | | d.Add("nickName", nickName); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson); |
| | | |
| | | } |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj() |
| | | { |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | childAccountId = childAccountId, |
| | | childId = childAccountId, |
| | | isAllowCreateScene = isAllow, |
| | | }); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson); |
| | |
| | | public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName) |
| | | { |
| | | //添加子账号 |
| | | var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id, account = subAccount, nickName = nickName }; |
| | | var requestObj = new ChildAddObj() |
| | | { |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | account = subAccount, |
| | | nickName = nickName |
| | | }; |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson); |
| | | } |
| | | //v1.7更新接口 |
| | | public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName,string faceUrl) |
| | | { |
| | | //添加子账号 |
| | | |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("nickName", nickName); |
| | | if (!string.IsNullOrEmpty(subAccount)) |
| | | { |
| | | d.Add("account", subAccount); |
| | | } |
| | | if (!string.IsNullOrEmpty(faceUrl)) |
| | | { |
| | | d.Add("faceUrl", @"data:image/jpg;base64," + faceUrl); |
| | | } |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 删除成员账号人脸数据 |
| | | /// </summary> |
| | | /// <param name="subAccount"></param> |
| | | /// <param name="nickName"></param> |
| | | /// <param name="faceUrl"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteMemberFace( string childId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("childId", childId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_RemoveFace, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 更新成员账号人脸数据 |
| | | /// </summary> |
| | | public ResponsePackNew UpdataMemberFace(string childId, string faceUrl) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("childId", childId); |
| | | d.Add("userFace", @"data:image/jpg;base64," + faceUrl); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_UpdateFace, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |
| | | //const string APP_KEY = "CPEVRLRT"; |
| | | //const string SECRET_KEY = "CPEVRLSJCPEVRLSZ"; |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | } |
| | | else |
| | | { |
| | | HDL_ON.Utlis.WriteLine(response.Content); |
| | | HDL_ON.Utlis.WriteLine($"接口异常:{requestFullUrl} \r\n"+response.ErrorMessage); |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | } |
| | | |
| | |
| | | #endregion |
| | | |
| | | #region **********签名校验********** |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | |
| | | /// <summary> |
| | | /// 获取当前时间戳值 |
| | |
| | | /// </summary> |
| | | public const string API_POST_Child_Update = "/home-wisdom/app/child/account/update"; |
| | | /// <summary> |
| | | /// 更新成员账号人脸信息 |
| | | /// </summary> |
| | | public const string API_POST_Child_UpdateFace = "/home-wisdom/app/child/account/updateFace"; |
| | | /// <summary> |
| | | /// 删除成员账号人脸信息 |
| | | /// </summary> |
| | | public const string API_POST_Child_RemoveFace = "/home-wisdom/app/child/account/removeFace"; |
| | | /// <summary> |
| | | /// 子账号管理员获取主账号授权Token |
| | | /// </summary> |
| | | public const string API_POST_Child_GetMasterToken = "/home-wisdom/app/child/account/masterToken/get"; |
| | |
| | | /// <summary> |
| | | /// 子账号ID childAccountId |
| | | /// </summary> |
| | | public string childAccountId; |
| | | public string childId; |
| | | /// <summary> |
| | | /// 住宅 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 子账户类型 ORDINARY、DEBUG、ADMIN |
| | | /// </summary> |
| | | public string childAccountType; |
| | | //public string childAccountType; |
| | | ///// <summary> |
| | | ///// 是否允许远程控制 0:允许 1:不允许 |
| | | ///// </summary> |
| | |
| | | /// <summary> |
| | | /// 交付状态 |
| | | /// </summary> |
| | | public string deliverstatus; |
| | | public string deliverStatus; |
| | | /// <summary> |
| | | /// 住宅类型 Zigbee, Buspro, A |
| | | /// </summary> |
| | |
| | | /// 网关本地通信加密Key,同一个住宅 密钥创建后就不变 |
| | | /// </summary> |
| | | public string localSecret; |
| | | |
| | | /// <summary> |
| | | /// 交付链接 |
| | | /// </summary> |
| | | public string deliverUrl; |
| | | }
|
| | |
|
| | | }
|
| | |
| | | public ResidenceMemberInfo() |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// 是否虚拟账号 |
| | | /// </summary> |
| | | public bool isVirtualAccount |
| | | { |
| | | get |
| | | { |
| | | return string.IsNullOrEmpty(childAccountId); |
| | | } |
| | | } |
| | | //public string Account = ""; |
| | | |
| | | //public string UserName = ""; |
| | |
| | | /// </summary> |
| | | public string memberHeadIcon; |
| | | /// <summary> |
| | | /// 人脸照片 |
| | | /// </summary> |
| | | public string userFaceUrl; |
| | | /// <summary> |
| | | /// 用户账号 |
| | | /// 优先显示手机号,如果手机号为空则显示邮箱地址 |
| | | /// </summary> |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\CommonMethod.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31FlieList.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\OrderFunctionPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Face\FaceManagementPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\DeliveryQrCodePage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\MemberManagement\MemberFaceManagementPage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\LightScene\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Acst\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Face\" />
|
| | | </ItemGroup>
|
| | | </Project> |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.6.42"; |
| | | public static string VersionString = "1.7"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | |
| | | /// <param name="title"></param> |
| | | /// <param name="msg"></param> |
| | | /// <param name="action"></param> |
| | | public void TipMsg(string title, string msg, Action action = null) |
| | | public void TipMsg(string title, string msg, Action action = null,bool again = true) |
| | | { |
| | | |
| | | Dialog dialog = new Dialog() |
| | | try |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | |
| | | FrameLayout contentView = new FrameLayout() |
| | | FrameLayout contentView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(140), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | Radius = (uint)Application.GetMinRealAverage(10), |
| | | }; |
| | | dialog.AddChidren(contentView); |
| | | |
| | | Button btnTitle = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(16), |
| | | Height = Application.GetRealHeight(30), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | Text = title |
| | | }; |
| | | contentView.AddChidren(btnTitle); |
| | | |
| | | Button btnMsg = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(35), |
| | | Y = btnTitle.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = msg, |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg); |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(96), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS.CSS_Color.DividingLineColor, |
| | | }; |
| | | contentView.AddChidren(btnLine); |
| | | |
| | | Button btnConfirm = new Button() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Height = Application.GetRealHeight(43), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | }; |
| | | contentView.AddChidren(btnConfirm); |
| | | |
| | | dialog.Show(); |
| | | |
| | | btnConfirm.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | btnConfirm.IsSelected = true; |
| | | }; |
| | | btnConfirm.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnConfirm.IsSelected = false; |
| | | action?.Invoke(); |
| | | dialog.Close(); |
| | | }; |
| | | }catch(Exception ex) |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(140), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | Radius = (uint)Application.GetMinRealAverage(10), |
| | | }; |
| | | dialog.AddChidren(contentView); |
| | | |
| | | Button btnTitle = new Button() |
| | | MainPage.Log($"lc add fail:{ex.Message}"); |
| | | if (again) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(500); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | TipMsg(title, msg, action, false); |
| | | }); |
| | | }).Start() ; |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | Y = Application.GetRealHeight(16), |
| | | Height = Application.GetRealHeight(30), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | Text = title |
| | | }; |
| | | contentView.AddChidren(btnTitle); |
| | | |
| | | Button btnMsg = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(35), |
| | | Y = btnTitle.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = msg, |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg); |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(96), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS.CSS_Color.DividingLineColor, |
| | | }; |
| | | contentView.AddChidren(btnLine); |
| | | |
| | | Button btnConfirm = new Button() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Height = Application.GetRealHeight(43), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | }; |
| | | contentView.AddChidren(btnConfirm); |
| | | |
| | | dialog.Show(); |
| | | |
| | | btnConfirm.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | btnConfirm.IsSelected = true; |
| | | }; |
| | | btnConfirm.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnConfirm.IsSelected = false; |
| | | action?.Invoke(); |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | base.RemoveFromParent(); |
| | | |
| | | ////2020-12-22 增加点击隐藏键盘事件 |
| | | //2020-12-22 增加点击隐藏键盘事件 |
| | | //Application.HideSoftInput(); |
| | | } |
| | | |
| | |
| | | //etAccount.Text = "tf@smarttech.com.ua"; |
| | | //etAccount.Text = "455740454@qq.com"; |
| | | //etAccount.Text = "18688565449"; |
| | | //etAccount.Text = "support7@hdlautomation.com"; |
| | | etAccount.Text = "support7@hdlautomation.com"; |
| | | //etAccount.Text = "18570064522"; |
| | | //etAccount.Text = "18718417827"; |
| | | etAccount.Text = "18188019284"; |
| | | //etAccount.Text = "18188019284"; |
| | | //etAccount.Text = "13143792049"; |
| | | //etAccount.Text = "13288623489";//罗晓东 |
| | | //etAccount.Text = "18244942707"; |
| | |
| | | //etAccount.Text = "18244942707"; |
| | | //etAccount.Text = "12345678904"; |
| | | //etAccount.Text = "13418062953"; |
| | | etAccount.Text = "13138683659"; |
| | | //etAccount.Text = "13138683659"; |
| | | //etAccount.Text = "15217626103"; |
| | | etAccount.Text = "18100573477"; |
| | | //etAccount.Text = "18100573477"; |
| | | //etAccount.Text = "18321091245"; |
| | | etAccount.Text = "13751916353"; |
| | | } |
| | | else |
| | | { |
| | | //etAccount.Text = "15018447586";//音乐数量刷新问题 |
| | | //etAccount.Text = "464027401@qq.com";// |
| | | //etAccount.Text = "15217626103";// |
| | | //etAccount.Text = "13682244600";//波哥 |
| | | etAccount.Text = "13168123446";//昆明金茂项目,新风问题 |
| | | //etAccount.Text = "2949126848@qq.com";//陈琳 |
| | | etAccount.Text = "15014291819 "; |
| | |
| | | else if (etAccount.Text == "18100573477") |
| | | { |
| | | etPassword.Text = "huang12345"; |
| | | }else if(etAccount.Text == "13751916353") |
| | | { |
| | | etPassword.Text = "hdl1985"; |
| | | } |
| | | //etPassword.Text = "Hdl85521566"; |
| | | btnLogin.IsSelected = true; |
| | |
| | | Height = Application.GetRealHeight(40), |
| | | TextID = StringId.LoginByEmail, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | bodyView.AddChidren(btnEmailLogin); |
| | |
| | | bool isFrist = true; |
| | | foreach (var brand in brandList) |
| | | { |
| | | if(brand.productPlatform == "HaiLin")//子晴需要隐藏这个入口,由调试软件上传数据 2023-03-09 17:20:33 |
| | | { |
| | | continue; |
| | | } |
| | | var row = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(87), |
| | |
| | | //下载第三方品牌icon |
| | | ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.brandIcon, btnIcon); |
| | | |
| | | btnName.MouseUpEventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | |
| | | var page = new DeviceListPage(brand); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnName.MouseUpEventHandler = eventHandler; |
| | | btnIcon.MouseUpEventHandler = eventHandler; |
| | | btnRight.MouseUpEventHandler = eventHandler; |
| | | row.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class FaceManagementPage |
| | | { |
| | | public FaceManagementPage() |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Threading; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | |
| | | Button btnAddMember; |
| | | Button btnScan; |
| | | EditText etMemberAccount; |
| | | EditText etMemberName; |
| | | /// <summary> |
| | | /// 人脸照片数据 |
| | | /// </summary> |
| | | string base64string; |
| | | |
| | | Action backAction; |
| | | |
| | |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.AddMember)).LoadTopView(); |
| | | |
| | | var btnTitle = new Button() |
| | | if (Entity.DB_ResidenceData.Instance.SupportFacePass) |
| | | { |
| | | Y = Application.GetRealHeight(70), |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(32), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.NewMemberAccount, |
| | | }; |
| | | bodyView.AddChidren(btnTitle); |
| | | var btnMemberName = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(70), |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(32), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.MemberName, |
| | | }; |
| | | bodyView.AddChidren(btnMemberName); |
| | | |
| | | etMemberAccount = new EditText() |
| | | etMemberName = new EditText() |
| | | { |
| | | Y = btnMemberName.Bottom, |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(356), |
| | | Height = Application.GetRealHeight(40), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | PlaceholderText = Language.StringByID(StringId.PleaseEnterContent), |
| | | PlaceholderTextColor = CSS_Color.PromptingColor2 |
| | | }; |
| | | bodyView.AddChidren(etMemberName); |
| | | |
| | | var btnLine = new Button() |
| | | { |
| | | Y = etMemberName.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | bodyView.AddChidren(btnLine); |
| | | |
| | | |
| | | var btnTitle = new Button() |
| | | { |
| | | Y = btnLine.Bottom + Application.GetRealHeight(20), |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(32), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.MemberAccount, |
| | | }; |
| | | bodyView.AddChidren(btnTitle); |
| | | |
| | | etMemberAccount = new EditText() |
| | | { |
| | | Y = btnTitle.Bottom, |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(356), |
| | | Height = Application.GetRealHeight(40), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | PlaceholderText = Language.StringByID(StringId.PleaseEnterContent), |
| | | PlaceholderTextColor = CSS_Color.PromptingColor2 |
| | | }; |
| | | bodyView.AddChidren(etMemberAccount); |
| | | |
| | | var btnLine1 = new Button() |
| | | { |
| | | Y = etMemberAccount.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | bodyView.AddChidren(btnLine1); |
| | | |
| | | #region 人脸管理 |
| | | var btnMemberFaceTitle = new Button() |
| | | { |
| | | Y = btnLine1.Bottom + Application.GetRealHeight(20), |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(32), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.MemberFace, |
| | | }; |
| | | bodyView.AddChidren(btnMemberFaceTitle); |
| | | |
| | | var btnAddFace = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = btnMemberFaceTitle.Bottom, |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealWidth(120), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BorderWidth = 0, |
| | | UnSelectedImagePath = "PersonalCenter/FacePassage/FaceIcon.png", |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bodyView.AddChidren(btnAddFace); |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eFaceHandler = (sender, e) => |
| | | { |
| | | Application.HideSoftInput(); |
| | | if (OnAppConfig.Instance.FaceManagementTip) |
| | | { |
| | | OnAppConfig.Instance.FaceManagementTip = true; |
| | | OnAppConfig.Instance.SaveConfig(); |
| | | LoadPictureOptionView(btnAddFace); |
| | | return; |
| | | } |
| | | |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | |
| | | FrameLayout contentView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(192), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | Radius = (uint)Application.GetMinRealAverage(10), |
| | | }; |
| | | dialog.AddChidren(contentView); |
| | | |
| | | Button btnTitle = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(16), |
| | | Height = Application.GetRealHeight(30), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | TextID = StringId.FaceProtocolPrompt, |
| | | }; |
| | | contentView.AddChidren(btnTitle); |
| | | |
| | | Button btnMsg = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(35), |
| | | Y = btnTitle.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = " 为保护您的个人隐私权益,特向您通知并申请明确同意授权。请你仔细阅读", |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg); |
| | | |
| | | Button btnMsg1 = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(15), |
| | | Y = btnMsg.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = " 《On Pro人脸信息采集协议》", |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg1); |
| | | |
| | | Button btnMsg2 = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(35), |
| | | Y = btnMsg1.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = " 若同意该协议,请点击【同意】按键,表示您已经理解并同意人脸信息采集协议。", |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg2); |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(149), |
| | | Height = Application.GetRealHeight(1), |
| | | Width = Application.GetRealWidth(270 / 2), |
| | | BackgroundColor = CSS.CSS_Color.DividingLineColor, |
| | | }; |
| | | contentView.AddChidren(btnLine); |
| | | |
| | | Button btnCancel = new Button() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Width = Application.GetRealWidth(135), |
| | | Height = Application.GetRealHeight(43), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | //SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | //SelectedBackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Disagree, |
| | | }; |
| | | contentView.AddChidren(btnCancel); |
| | | |
| | | Button btnConfirm = new Button() |
| | | { |
| | | X = btnCancel.Right, |
| | | Y = btnLine.Y, |
| | | Width = Application.GetRealWidth(135), |
| | | Height = Application.GetRealHeight(45), |
| | | TextAlignment = TextAlignment.Center, |
| | | //TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Agree, |
| | | }; |
| | | contentView.AddChidren(btnConfirm); |
| | | //例:右下圆角 大小为50 |
| | | int mRectCornerID = HDLUtils.RectCornerBottomRight; |
| | | btnConfirm.SetCornerWithSameRadius((uint)Application.GetMinRealAverage(10), mRectCornerID); |
| | | dialog.Show(); |
| | | |
| | | btnCancel.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnMsg1.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | string url = "https://developer.hdlcontrol.com/人脸信息采集协议.html"; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | url = "https://developer.hdlcontrol.com/Face information collection protocol.html"; |
| | | } |
| | | new WebViewDialog().LoadPage("人脸信息采集协议", url); |
| | | |
| | | dialog.Close(); |
| | | }; |
| | | btnConfirm.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | OnAppConfig.Instance.FaceManagementTip = true; |
| | | OnAppConfig.Instance.SaveConfig(); |
| | | LoadPictureOptionView(btnAddFace); |
| | | }; |
| | | |
| | | }; |
| | | btnAddFace.MouseUpEventHandler = eFaceHandler; |
| | | #endregion |
| | | |
| | | |
| | | btnAddMember = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = btnAddFace.Bottom + Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BorderWidth = 0, |
| | | BorderColor = 0x00000000, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.Confirm, |
| | | }; |
| | | bodyView.AddChidren(btnAddMember); |
| | | |
| | | |
| | | btnScan = new Button() |
| | | { |
| | | Y = btnTitle.Bottom, |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | X = Application.GetRealWidth(310), |
| | | UnSelectedImagePath = "Public/Scan.png" |
| | | }; |
| | | bodyView.AddChidren(btnScan); |
| | | |
| | | } |
| | | else |
| | | { |
| | | Y = btnTitle.Bottom, |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(356), |
| | | Height = Application.GetRealHeight(40), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | PlaceholderText = Language.StringByID(StringId.PleaseEnterContent), |
| | | PlaceholderTextColor = CSS_Color.PromptingColor2 |
| | | }; |
| | | bodyView.AddChidren(etMemberAccount); |
| | | var btnTitle = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(70), |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(32), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.NewMemberAccount, |
| | | }; |
| | | bodyView.AddChidren(btnTitle); |
| | | |
| | | var btnLine = new Button() |
| | | { |
| | | Y = etMemberAccount.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | bodyView.AddChidren(btnLine); |
| | | etMemberAccount = new EditText() |
| | | { |
| | | Y = btnTitle.Bottom, |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(356), |
| | | Height = Application.GetRealHeight(40), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | PlaceholderText = Language.StringByID(StringId.PleaseEnterContent), |
| | | PlaceholderTextColor = CSS_Color.PromptingColor2 |
| | | }; |
| | | bodyView.AddChidren(etMemberAccount); |
| | | |
| | | btnAddMember = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(244), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BorderWidth = 0, |
| | | BorderColor = 0x00000000, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.ConfirmInvitation, |
| | | }; |
| | | bodyView.AddChidren(btnAddMember); |
| | | var btnLine = new Button() |
| | | { |
| | | Y = etMemberAccount.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | bodyView.AddChidren(btnLine); |
| | | |
| | | btnScan = new Button() |
| | | { |
| | | Y = btnAddMember.Bottom, |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.ScanQRCoden, |
| | | }; |
| | | bodyView.AddChidren(btnScan); |
| | | btnAddMember = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(244), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BorderWidth = 0, |
| | | BorderColor = 0x00000000, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.Confirm, |
| | | }; |
| | | bodyView.AddChidren(btnAddMember); |
| | | |
| | | btnScan = new Button() |
| | | { |
| | | Y = btnAddMember.Bottom, |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.ScanQRCoden, |
| | | }; |
| | | bodyView.AddChidren(btnScan); |
| | | } |
| | | LoadEventList(); |
| | | } |
| | | |
| | |
| | | }) { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | const int imageHeight = 400; |
| | | |
| | | /// <summary> |
| | | /// 加载图标选择选项 |
| | | /// </summary> |
| | | void LoadPictureOptionView(Button btnAddFace) |
| | | { |
| | | var pView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | bodyView.AddChidren(pView); |
| | | |
| | | var pictureOptionView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(445 + 50), |
| | | Height = Application.GetRealHeight(250), |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | | }; |
| | | pView.AddChidren(pictureOptionView); |
| | | |
| | | var optionView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | pictureOptionView.AddChidren(optionView); |
| | | |
| | | var btnTakePicture = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.TakePicture, |
| | | }; |
| | | optionView.AddChidren(btnTakePicture); |
| | | |
| | | optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnAlbum = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Album, |
| | | }; |
| | | optionView.AddChidren(btnAlbum); |
| | | |
| | | optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnCancel = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(8) + optionView.Bottom, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | pictureOptionView.AddChidren(btnCancel); |
| | | |
| | | |
| | | |
| | | pictureOptionView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = true; |
| | | }; |
| | | btnTakePicture.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = false; |
| | | var imageName = Guid.NewGuid().ToString(); |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | var imageBytes = getFaceImageBytes(imagePath); |
| | | btnAddFace.ImageBytes = imageBytes; |
| | | base64string = Convert.ToBase64String(imageBytes); |
| | | } |
| | | |
| | | }, imageName, 6, 6, imageHeight); |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = true; |
| | | }; |
| | | |
| | | btnAlbum.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = false; |
| | | //从相册选择图片裁剪 |
| | | var imageName = Guid.NewGuid().ToString(); |
| | | //var imageName = scene.sid; |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | var imageBytes = getFaceImageBytes(imagePath); |
| | | btnAddFace.ImageBytes = imageBytes; |
| | | base64string = Convert.ToBase64String(imageBytes); |
| | | } |
| | | }, imageName, 6, 6, imageHeight); |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取本地选取的人脸数据 |
| | | /// </summary> |
| | | /// <param name="selectImagePath"></param> |
| | | /// <returns></returns> |
| | | byte[] getFaceImageBytes(string selectImagePath) |
| | | { |
| | | var imageBytes = Shared.IO.FileUtils.ReadFile(selectImagePath); |
| | | System.IO.File.Delete(selectImagePath); |
| | | return imageBytes; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | btnAddMember.MouseUpEventHandler = (sender, e) => { |
| | | var memberAccount = etMemberAccount.Text.Trim(); |
| | | if(string.IsNullOrEmpty(memberAccount)) |
| | | var name = etMemberName.Text.Trim(); |
| | | if(string.IsNullOrEmpty(name)) |
| | | { |
| | | TipDivMsg(Language.StringByID(StringId.PlsEntryAccount)); |
| | | TipDivMsg(Language.StringByID(StringId.PlsEntrySubAccountRemark)); |
| | | return; |
| | | } |
| | | BindMember(memberAccount); |
| | | |
| | | BindMember(memberAccount, name, base64string); |
| | | }; |
| | | } |
| | | |
| | |
| | | /// 绑定账号 |
| | | /// </summary> |
| | | /// <param name="memberAccount"></param> |
| | | void BindMember(string memberAccount) |
| | | void BindMember(string memberAccount,string nickName,string faceUrl) |
| | | { |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | |
| | | { |
| | | try |
| | | { |
| | | var result = new HttpServerRequest().BindResidenceMemberAccount(memberAccount, memberAccount); |
| | | var result = new HttpServerRequest().BindResidenceMemberAccount(memberAccount, nickName,faceUrl); |
| | | if (result.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
New file |
| | |
| | | using System; |
| | | using System.Threading; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 增加子账号界面 |
| | | /// </summary> |
| | | public partial class MemberFaceManagementPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | /// <summary> |
| | | /// 人脸照片数据 |
| | | /// </summary> |
| | | string base64string; |
| | | ResidenceMemberInfo memberInfo; |
| | | public MemberFaceManagementPage(ResidenceMemberInfo memberInfo) |
| | | { |
| | | bodyView = this; |
| | | this.memberInfo = memberInfo; |
| | | } |
| | | |
| | | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | new TopViewDiv(bodyView, memberInfo.nickName).LoadTopView(); |
| | | |
| | | #region 人脸管理 |
| | | var btnMemberFaceTitle = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(80), |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(32), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.MemberFace, |
| | | }; |
| | | bodyView.AddChidren(btnMemberFaceTitle); |
| | | |
| | | var btnAddFace = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = btnMemberFaceTitle.Bottom, |
| | | Width = Application.GetRealWidth(230), |
| | | Height = Application.GetRealWidth(230), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BorderWidth = 0, |
| | | UnSelectedImagePath = "PersonalCenter/FacePassage/FaceIcon.png", |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bodyView.AddChidren(btnAddFace); |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eFaceHandler = (sender, e) => |
| | | { |
| | | if (OnAppConfig.Instance.FaceManagementTip) |
| | | { |
| | | OnAppConfig.Instance.FaceManagementTip = true; |
| | | OnAppConfig.Instance.SaveConfig(); |
| | | LoadPictureOptionView(btnAddFace); |
| | | return; |
| | | } |
| | | |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | |
| | | FrameLayout contentView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(192), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | Radius = (uint)Application.GetMinRealAverage(10), |
| | | }; |
| | | dialog.AddChidren(contentView); |
| | | |
| | | Button btnTitle = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(16), |
| | | Height = Application.GetRealHeight(30), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | TextID = StringId.FaceProtocolPrompt, |
| | | }; |
| | | contentView.AddChidren(btnTitle); |
| | | |
| | | Button btnMsg = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(35), |
| | | Y = btnTitle.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = " 为保护您的个人隐私权益,特向您通知并申请明确同意授权。请你仔细阅读", |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg); |
| | | |
| | | Button btnMsg1 = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(15), |
| | | Y = btnMsg.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = " 《On Pro人脸信息采集协议》", |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg1); |
| | | |
| | | Button btnMsg2 = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(35), |
| | | Y = btnMsg1.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = " 若同意该协议,请点击【同意】按键,表示您已经理解并同意人脸信息采集协议。", |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg2); |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(149), |
| | | Height = Application.GetRealHeight(1), |
| | | Width = Application.GetRealWidth(270 / 2), |
| | | BackgroundColor = CSS.CSS_Color.DividingLineColor, |
| | | }; |
| | | contentView.AddChidren(btnLine); |
| | | |
| | | Button btnCancel = new Button() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Width = Application.GetRealWidth(135), |
| | | Height = Application.GetRealHeight(43), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | //SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | //SelectedBackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Disagree, |
| | | }; |
| | | contentView.AddChidren(btnCancel); |
| | | |
| | | Button btnConfirm = new Button() |
| | | { |
| | | X = btnCancel.Right, |
| | | Y = btnLine.Y, |
| | | Width = Application.GetRealWidth(135), |
| | | Height = Application.GetRealHeight(45), |
| | | TextAlignment = TextAlignment.Center, |
| | | //TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Agree, |
| | | }; |
| | | contentView.AddChidren(btnConfirm); |
| | | //例:右下圆角 大小为50 |
| | | int mRectCornerID = HDLUtils.RectCornerBottomRight; |
| | | btnConfirm.SetCornerWithSameRadius((uint)Application.GetMinRealAverage(10), mRectCornerID); |
| | | dialog.Show(); |
| | | |
| | | btnCancel.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnMsg1.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | string url = "https://developer.hdlcontrol.com/人脸信息采集协议.html"; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | url = "https://developer.hdlcontrol.com/Face information collection protocol.html"; |
| | | } |
| | | new WebViewDialog().LoadPage("人脸信息采集协议", url); |
| | | |
| | | dialog.Close(); |
| | | }; |
| | | btnConfirm.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | OnAppConfig.Instance.FaceManagementTip = true; |
| | | OnAppConfig.Instance.SaveConfig(); |
| | | LoadPictureOptionView(btnAddFace); |
| | | }; |
| | | |
| | | }; |
| | | btnAddFace.MouseUpEventHandler = eFaceHandler; |
| | | #endregion |
| | | |
| | | var btnDeleteFaceDate = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = btnAddFace.Bottom + Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BorderWidth = 0, |
| | | BorderColor = 0x00000000, |
| | | BackgroundColor = 0xFFFF7272, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.DeleteMemberFace, |
| | | }; |
| | | bodyView.AddChidren(btnDeleteFaceDate); |
| | | |
| | | btnDeleteFaceDate.MouseUpEventHandler = (sender, e) => { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(""); |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var pack = new HttpServerRequest().DeleteMemberFace(memberInfo.id); |
| | | if (pack != null) |
| | | { |
| | | if(pack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnAddFace.ImageBytes = null; |
| | | btnAddFace.UnSelectedImagePath = "PersonalCenter/FacePassage/FaceIcon.png"; |
| | | btnDeleteFaceDate.Enable = btnDeleteFaceDate.Visible = false; |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | TipDivMsg(Language.StringByID(StringId.delFail)); |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | }; |
| | | |
| | | if (!string.IsNullOrEmpty(memberInfo.userFaceUrl)) |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(""); |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var bytes = downloadImageBytes(memberInfo.userFaceUrl); |
| | | if (bytes != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnAddFace.ImageBytes = bytes; |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | btnDeleteFaceDate.Enable = btnDeleteFaceDate.Visible = false; |
| | | } |
| | | } |
| | | |
| | | void TipDivMsg(string msg) |
| | | { |
| | | var tipBodyView = new FrameLayout(); |
| | | bodyView.AddChidren(tipBodyView); |
| | | |
| | | var msgView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(167), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(62), |
| | | Radius = (uint)Application.GetRealWidth(8), |
| | | BorderWidth = 0, |
| | | BorderColor = 0x00000000, |
| | | BackgroundColor = 0xFF333333, |
| | | }; |
| | | tipBodyView.AddChidren(msgView); |
| | | |
| | | var btnMsg = new Button() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(186), |
| | | Height = Application.GetRealHeight(42), |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = msg, |
| | | IsMoreLines = true, |
| | | }; |
| | | msgView.AddChidren(btnMsg); |
| | | |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(1200); |
| | | Application.RunOnMainThread(() => { |
| | | tipBodyView.RemoveAll(); |
| | | tipBodyView.RemoveFromParent(); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | const int imageHeight = 400; |
| | | |
| | | /// <summary> |
| | | /// 加载图标选择选项 |
| | | /// </summary> |
| | | void LoadPictureOptionView(Button btnAddFace) |
| | | { |
| | | var pView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | bodyView.AddChidren(pView); |
| | | |
| | | var pictureOptionView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(445 + 50), |
| | | Height = Application.GetRealHeight(250), |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | | }; |
| | | pView.AddChidren(pictureOptionView); |
| | | |
| | | var optionView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | pictureOptionView.AddChidren(optionView); |
| | | |
| | | var btnTakePicture = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.TakePicture, |
| | | }; |
| | | optionView.AddChidren(btnTakePicture); |
| | | |
| | | optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnAlbum = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Album, |
| | | }; |
| | | optionView.AddChidren(btnAlbum); |
| | | |
| | | optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnCancel = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(8) + optionView.Bottom, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | pictureOptionView.AddChidren(btnCancel); |
| | | |
| | | |
| | | |
| | | pictureOptionView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = true; |
| | | }; |
| | | btnTakePicture.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = false; |
| | | var imageName = Guid.NewGuid().ToString(); |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 1, imageName); |
| | | }, imageName, 6, 6, imageHeight); |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = true; |
| | | }; |
| | | |
| | | btnAlbum.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = false; |
| | | //从相册选择图片裁剪 |
| | | var imageName = Guid.NewGuid().ToString(); |
| | | //var imageName = scene.sid; |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 2, imageName); |
| | | }, imageName, 6, 6, imageHeight); |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 下载云端人脸图片 |
| | | /// </summary> |
| | | /// <param name="imageUrl"></param> |
| | | /// <returns></returns> |
| | | byte[] downloadImageBytes(string imageUrl) |
| | | { |
| | | var imageBytes = ImageUtlis.Current.GetImageDownloadUrl(imageUrl); |
| | | |
| | | return imageBytes; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 裁剪完照片回调,统一处理 |
| | | /// </summary> |
| | | /// <param name="imagePath">裁剪后的真实路径</param> |
| | | /// <param name="imageSource">照片来源;1:拍照;2:图库</param> |
| | | void CropImageCallBack(string selectImagePath, int imageSource, string imageName) |
| | | { |
| | | if (string.IsNullOrEmpty(selectImagePath) == true) |
| | | { |
| | | return; |
| | | } |
| | | //上传成功到回调 |
| | | Action<bool> uploadSuccessAction = (isSuccess) => |
| | | { |
| | | //点击重新录入事件 |
| | | Action action = () => |
| | | { |
| | | if (!isSuccess) |
| | | { |
| | | if (imageSource == 1) |
| | | { |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 1, imageName); |
| | | }, imageName, 6, 6, imageHeight); |
| | | } |
| | | else |
| | | { |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 2, imageName); |
| | | }, imageName, 6, 6, imageHeight); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | //if (isSuccess) |
| | | //{ |
| | | //} |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var page = new FaceSettingResultPage(action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(isSuccess); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }); |
| | | }; |
| | | //上传图片到云端 |
| | | UploadImage(selectImagePath, uploadSuccessAction); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 上传图片方法 |
| | | /// </summary> |
| | | /// <param name="selectImagePath">裁剪后的图片路径</param> |
| | | /// <param name="imageView"></param> |
| | | /// <param name="uploadResultAction"></param> |
| | | void UploadImage(string selectImagePath, Action<bool> uploadResultAction) |
| | | { |
| | | try |
| | | { |
| | | //1.读取裁剪后的图片,然后删除 |
| | | var imageBytes = Shared.IO.FileUtils.ReadFile(selectImagePath); |
| | | System.IO.File.Delete(selectImagePath); |
| | | |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | //开始上传 |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | string base64string = Convert.ToBase64String(imageBytes); |
| | | var pack = new HttpServerRequest().UpdataMemberFace(memberInfo.id, base64string); |
| | | if (pack != null) |
| | | { |
| | | var data = Newtonsoft.Json.JsonConvert.DeserializeObject<System.Collections.Generic.Dictionary<string,string>>(pack.Data.ToString()); |
| | | if(data!= null) |
| | | { |
| | | data.TryGetValue("userFace",out memberInfo.userFaceUrl); |
| | | } |
| | | Utlis.WriteLine("上传结果:" + pack.message); |
| | | if(pack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | uploadResultAction?.Invoke(pack.Code == StateCode.SUCCESS); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log(ex.Message); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using System.Collections.Generic; |
| | | using System.Threading; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | |
| | | public void LoadPage() |
| | | { |
| | | #if DEBUG |
| | | Entity.DB_ResidenceData.Instance.SupportFacePass = true; |
| | | #endif |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | //创建读取成员账号线程 |
| | | var thread = LoadThread_GetResidenceMemberAccount(); |
| | |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | //Height = Application.GetRealWidth(230), |
| | | Height = Application.GetRealWidth(180), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | |
| | | ScrollEnabled = false, |
| | | VerticalScrollBarEnabled = false,//隐藏滚动条 |
| | | }; |
| | | if (Entity.DB_ResidenceData.Instance.SupportFacePass) |
| | | { |
| | | sView.Height = Application.GetRealWidth(180 + 50); |
| | | } |
| | | contentView.AddChidren(sView); |
| | | #region 头像信息 |
| | | var view1 = new FrameLayout() |
| | |
| | | TextID = StringId.Member |
| | | }; |
| | | userTypeView.AddChidren(btnUserTypeName); |
| | | if(Language.CurrentLanguage == "English") |
| | | if (Language.CurrentLanguage == "English") |
| | | { |
| | | userTypeView.X = Application.GetRealWidth(260); |
| | | } |
| | |
| | | Text = HDLCommon.Current.GetUserName(memberInfo.memberName) |
| | | }; |
| | | view1.AddChidren(btnMemberName); |
| | | if (memberInfo.isVirtualAccount) |
| | | { |
| | | btnMemberName.Text = memberInfo.nickName; |
| | | |
| | | } |
| | | var btnMemberEmail = new Button() |
| | | { |
| | | X = Application.GetRealWidth(88), |
| | |
| | | Width = Application.GetRealWidth(311), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | LoadView_EidtNickname(btnNickname, btnNicknameRight, memberInfo); |
| | | LoadView_EidtNickname(btnNickname, btnNicknameRight, memberInfo, memberInfo.isVirtualAccount ? btnMemberName : null); |
| | | #endregion |
| | | |
| | | #region 使用权限 |
| | |
| | | }; |
| | | view3.AddChidren(btnPermissionRight); |
| | | |
| | | //sView.AddChidren(new Button() |
| | | //{ |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Height = Application.GetRealWidth(1), |
| | | // Width = Application.GetRealWidth(311), |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | //}); |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | action = () => { |
| | | action = () => |
| | | { |
| | | residenceMemberInfos.Remove(memberInfo); |
| | | LoadMemberRow(); |
| | | }; |
| | |
| | | mmp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | sView.MouseUpEventHandler = eHandler; |
| | | view3.MouseUpEventHandler = eHandler; |
| | | btnPermissionTitle.MouseUpEventHandler = eHandler; |
| | | btnPermissionRight.MouseUpEventHandler = eHandler; |
| | | |
| | | #endregion |
| | | |
| | | //#region 创建场景 2020-12-23 隐藏创建场景按钮 |
| | | //var view4 = new FrameLayout() |
| | | //{ |
| | | // Height = Application.GetRealWidth(50), |
| | | //}; |
| | | //sView.AddChidren(view4); |
| | | |
| | | //var btnCreateSceneTitle = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(16), |
| | | // Width = Application.GetRealWidth(200), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.CreateScene, |
| | | //}; |
| | | //view4.AddChidren(btnCreateSceneTitle); |
| | | #region 人脸管理 |
| | | if (Entity.DB_ResidenceData.Instance.SupportFacePass) |
| | | { |
| | | sView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealWidth(1), |
| | | Width = Application.GetRealWidth(311), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | //var btnCreateSceneRight = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(287), |
| | | // Y = Application.GetRealHeight(4), |
| | | // Width = Application.GetMinRealAverage(38), |
| | | // Height = Application.GetMinRealAverage(38), |
| | | // UnSelectedImagePath = "Public/Switch_2.png", |
| | | // SelectedImagePath = "Public/SwitchOn_2.png", |
| | | // IsSelected = memberInfo.isAllowCreateScene |
| | | //}; |
| | | //view4.AddChidren(btnCreateSceneRight); |
| | | var view4 = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(49), |
| | | }; |
| | | sView.AddChidren(view4); |
| | | |
| | | //LoadView_ChangeCreateSceneState(btnCreateSceneRight, btnCreateSceneTitle, memberInfo); |
| | | //#endregion |
| | | var btnFaceManagementTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(330), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.FaceManagemant, |
| | | }; |
| | | view4.AddChidren(btnFaceManagementTitle); |
| | | |
| | | var btnFaceManagementRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(311), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | view4.AddChidren(btnFaceManagementRight); |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eFaceHandler = (sender, e) => |
| | | { |
| | | var page = new MemberFaceManagementPage(memberInfo); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | view4.MouseUpEventHandler = eFaceHandler; |
| | | btnFaceManagementRight.MouseUpEventHandler = eFaceHandler; |
| | | btnFaceManagementTitle.MouseUpEventHandler = eFaceHandler; |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 修改昵称窗口 |
| | | /// </summary> |
| | | void LoadView_EidtNickname(Button btn1, Button btn2, ResidenceMemberInfo mInfo) |
| | | void LoadView_EidtNickname(Button btn1, Button btn2, ResidenceMemberInfo mInfo,Button btnMemberName) |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | var responsePack = new HttpServerRequest().EditSubAccountNickName(str, mInfo.childAccountId); |
| | | var responsePack = new HttpServerRequest().EditSubAccountNickName(str, mInfo.id); |
| | | if (responsePack.Code.ToUpper() == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btn1.Text = str; |
| | | if (btnMemberName != null) |
| | | { |
| | | btnMemberName.Text = str; |
| | | } |
| | | }); |
| | | mInfo.nickName = str; |
| | | } |
| | |
| | | }; |
| | | headPortraitView.AddChidren(btnMemberName); |
| | | string username = HDLCommon.Current.GetUserName(memberInfo.memberName); |
| | | btnMemberName.Text = memberInfo.nickName + "(" + username + ")"; |
| | | btnMemberName.Text = memberInfo.nickName; |
| | | |
| | | #region RoomList |
| | | roomListView = new VerticalScrolViewLayout() |
| | | if (!memberInfo.isVirtualAccount) |
| | | { |
| | | Y = Application.GetRealHeight(138), |
| | | Height = Application.GetRealHeight(471), |
| | | //BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(roomListView); |
| | | #endregion |
| | | |
| | | btnMemberName.Text = memberInfo.nickName + "(" + username + ")"; |
| | | #region RoomList |
| | | roomListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(138), |
| | | Height = Application.GetRealHeight(471), |
| | | //BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(roomListView); |
| | | #endregion |
| | | } |
| | | btnDelMember = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(617), |
| | | //Height = MainPage.Increase ? Application.GetRealHeight(70) : Application.GetRealHeight(50), |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.WarningColor, |
| | | //Height = Application.GetRealHeight(50), |
| | | //TextAlignment = TextAlignment.Center, |
| | | //TextSize = CSS_FontSize.SubheadingFontSize, |
| | | //TextColor = CSS_Color.WarningColor, |
| | | TextID = StringId.RemoveTheMember, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | //BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BorderWidth = 0, |
| | | BorderColor = 0x00000000, |
| | | BackgroundColor = 0xFFFF7272, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | |
| | | }; |
| | | bodyView.AddChidren(btnDelMember); |
| | | |
| | | LoadEventList(); |
| | | |
| | | GetShareDataByAccount(); |
| | | if (!memberInfo.isVirtualAccount) |
| | | { |
| | | GetShareDataByAccount(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | contentView.RemoveAll(); |
| | | |
| | | var residenceFunctionCount = 0; |
| | | |
| | | #region 住宅信息区域 |
| | | //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && DB_ResidenceData.Instance.GatewayType == 1) |
| | | //{ |
| | | // residenceInfoView = new FrameLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(213), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealHeight(12), |
| | | // BorderColor = 0x00FFFFFF, |
| | | // BorderWidth = 0, |
| | | // }; |
| | | // contentView.AddChidren(residenceInfoView); |
| | | //} |
| | | //else |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | residenceInfoView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(213), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(residenceInfoView); |
| | | } |
| | | else |
| | | { |
| | | residenceInfoView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | { |
| | | residenceFunctionCount++; |
| | | #region ---住宅管理区域 |
| | | residenceManageView = new FrameLayout() |
| | | { |
| | |
| | | residenceManageView.AddChidren(btnResidenceManageText); |
| | | #endregion |
| | | |
| | | residenceFunctionCount++; |
| | | #region ---成员区域 |
| | | residenceMemberView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | residenceFunctionCount++; |
| | | #region ---添加功能区域 |
| | | residenceAddFunctionView = new FrameLayout() |
| | | { |
| | |
| | | }; |
| | | residenceAddFunctionView.AddChidren(btnResidenceAddFunctionText); |
| | | #endregion |
| | | |
| | | residenceFunctionCount++; |
| | | #region ---人脸管理 |
| | | var faceManagementView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(28 - 24), |
| | | Y = residenceManageView.Bottom, |
| | | Width = Application.GetRealWidth(64 + 48), |
| | | Height = Application.GetRealWidth(64), |
| | | }; |
| | | residenceInfoView.AddChidren(faceManagementView); |
| | | |
| | | var btnFaceManagementIcon = new Button |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(5), |
| | | Width = Application.GetMinRealAverage(30), |
| | | Height = Application.GetMinRealAverage(30), |
| | | UnSelectedImagePath = "PersonalCenter/FaceManagementIcon.png", |
| | | }; |
| | | faceManagementView.AddChidren(btnFaceManagementIcon); |
| | | var btnFaceManagementText = new Button() |
| | | { |
| | | Y = btnResidenceManageIcon.Bottom, |
| | | Height = Application.GetRealHeight(29), |
| | | TextID = StringId.FaceManagemant, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel |
| | | }; |
| | | faceManagementView.AddChidren(btnFaceManagementText); |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | | else |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 我的二维码页面 |
| | | /// </summary> |
| | | public class DeliveryQrCodePage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | public DeliveryQrCodePage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="isStartCheckResidenceThread">是否开启住宅监听线程,没有住宅的时候别人扫码添加你为成员的时候调用</param> |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.ResidentialDelivery)).LoadTopView(); |
| | | |
| | | int backViewHeight = Application.GetRealHeight(132) + Application.GetRealWidth(266); |
| | | FrameLayout backView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(144), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealWidth(288), |
| | | Width = Application.GetRealWidth(288), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(8), |
| | | }; |
| | | bodyView.AddChidren(backView); |
| | | |
| | | |
| | | |
| | | var btnHomeName = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = backView.Bottom + Application.GetRealWidth(12), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(60), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = Entity.DB_ResidenceData.Instance.CurrentRegion.homeName, |
| | | IsBold = true, |
| | | IsMoreLines = true, |
| | | |
| | | }; |
| | | bodyView.AddChidren(btnHomeName); |
| | | |
| | | |
| | | |
| | | //二维码 |
| | | int codeWidth = Application.GetRealWidth(266); |
| | | ImageView codeImage = new ImageView() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Height = codeWidth, |
| | | Width = codeWidth, |
| | | ImageBytes = Scan.BytesFromText(Entity.DB_ResidenceData.Instance.CurrentRegion.deliverUrl,codeWidth, codeWidth), |
| | | }; |
| | | backView.AddChidren(codeImage); |
| | | |
| | | ////二维码中心头像 |
| | | //int imageWidth = Application.GetMinRealAverage(60); |
| | | //int imageX = codeImage.X + (codeWidth - imageWidth) / 2; |
| | | //int imageY = codeImage.Y + (codeWidth - imageWidth) / 2; |
| | | //ImageView headImage2 = new ImageView() |
| | | //{ |
| | | // X = imageX, |
| | | // Y = imageY, |
| | | // Width = imageWidth, |
| | | // Height = imageWidth, |
| | | // ImagePath = UserInfo.Current.headImagePagePath, |
| | | // BorderColor = CSS_Color.MainBackgroundColor, |
| | | // BorderWidth = (uint)Application.GetRealWidth(2), |
| | | // Radius = (uint)Application.GetMinRealAverage(30), |
| | | //}; |
| | | //backView.AddChidren(headImage2); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开启检测住宅是否已经添加了的线程 |
| | | /// </summary> |
| | | private void StartCheckResidenceThread() |
| | | { |
| | | //获取住宅列表的参数 |
| | | var requestJson = DAL.Server.HttpUtil.GetSignRequestJson(new DAL.Server.GetHomeListObj() { homeType = HomeTypeEnum.ALL.ToString() }); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | while (this.Parent != null) |
| | | { |
| | | System.Threading.Thread.Sleep(4000); |
| | | if (this.Parent == null) |
| | | { |
| | | break; |
| | | } |
| | | //访问云端获取列表 |
| | | var resultObj = DAL.Server.HttpUtil.RequestHttpsPost(DAL.Server.NewAPI.API_POST_Gethomepager, requestJson); |
| | | if (resultObj.Code == DAL.Server.StateCode.SUCCESS) |
| | | { |
| | | var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoRes>>(resultObj.Data.ToString()); |
| | | if (homeList == null || homeList.Count == 0) |
| | | { |
| | | //如果还没有住宅的话,继续下一次检测 |
| | | continue; |
| | | } |
| | | //调用On原来的方法,刷新住宅列表及其缓存 |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | pm.GetHomePager(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (this.Parent == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //跳转页面---- |
| | | MainPage.GoUserPage(true, false, () => |
| | | { |
| | | //显示欢迎回家的弹窗界面 |
| | | var form = new WellcomToHomeForm(); |
| | | form.ShowForm(); |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | } |
| | | } |
| | |
| | | roomManagementRow.AddChidren(btnRoomManagementSkinIcon); |
| | | #endregion |
| | | |
| | | #region 管理员权限迁移 |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) }); |
| | | administratorPermissionMigrationRow = new FrameLayout() |
| | | if (DB_ResidenceData.Instance.CurrentRegion.deliverStatus == "PAID") |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | if (DB_ResidenceData.Instance.CurrentRegion.isOtherShare == false) |
| | | { |
| | | //是主账号本人才能显示这个菜单 |
| | | contentView.AddChidren(administratorPermissionMigrationRow); |
| | | } |
| | | |
| | | btnAdministratorPermissionMigrationTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(24), |
| | | TextID = StringId.AdministratorPermissionMigration, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | }; |
| | | administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationTitle); |
| | | |
| | | btnAdministratorPermissionMigrationExplan = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnAdministratorPermissionMigrationTitle.Bottom, |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(21), |
| | | TextID = StringId.AdministratorPermissionMigrationExPlan, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationExplan); |
| | | |
| | | |
| | | btnAdministratorPermissionMigrationSkinIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationSkinIcon); |
| | | |
| | | administratorPermissionMigrationRow.AddChidren( |
| | | new Button() |
| | | #region 管理员权限迁移 |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) }); |
| | | administratorPermissionMigrationRow = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(1), |
| | | Width = Application.GetRealWidth(343), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | #endregion |
| | | |
| | | #region 过户 |
| | | transferRow = new FrameLayout() |
| | | { |
| | | Y = administratorPermissionMigrationRow.Bottom, |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | //有网关才能过户 |
| | | if (DB_ResidenceData.Instance.HomeGateway != null && string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId) == false |
| | | && DB_ResidenceData.Instance.CurrentRegion.isOtherShare == false) |
| | | { |
| | | contentView.AddChidren(transferRow); |
| | | } |
| | | |
| | | btnTransferTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(24), |
| | | TextID = StringId.Transfer, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | }; |
| | | transferRow.AddChidren(btnTransferTitle); |
| | | |
| | | btnTrasferExplan = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnTransferTitle.Bottom, |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(21), |
| | | TextID = StringId.TransferExPlan, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | transferRow.AddChidren(btnTrasferExplan); |
| | | |
| | | btnTrasferSkinIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | transferRow.AddChidren(btnTrasferSkinIcon); |
| | | #endregion |
| | | |
| | | #region 调试权限 |
| | | |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) }); |
| | | FrameLayout commissioningAuthorityRow; |
| | | commissioningAuthorityRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(commissioningAuthorityRow); |
| | | |
| | | |
| | | var btnCommissioningAuthorityTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(24), |
| | | TextID = StringId.CommissioningAuthority, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | }; |
| | | commissioningAuthorityRow.AddChidren(btnCommissioningAuthorityTitle); |
| | | |
| | | var btnCommissioningAuthorityExplan = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnCommissioningAuthorityTitle.Bottom, |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(21), |
| | | TextID = StringId.CommissioningAuthorityExPlan, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | commissioningAuthorityRow.AddChidren(btnCommissioningAuthorityExplan); |
| | | |
| | | btnCommissioningAuthoritySwitchIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(314), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(48), |
| | | Height = Application.GetMinRealAverage(36), |
| | | UnSelectedImagePath = "Public/Switch.png", |
| | | SelectedImagePath = "Public/SwitchOn.png", |
| | | IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm |
| | | }; |
| | | commissioningAuthorityRow.AddChidren(btnCommissioningAuthoritySwitchIcon); |
| | | |
| | | btnCommissioningAuthoritySwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | DB_ResidenceData.Instance.CurrentRegion.debugPerm = !DB_ResidenceData.Instance.CurrentRegion.debugPerm; |
| | | btnCommissioningAuthoritySwitchIcon.IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm; |
| | | new System.Threading.Thread(() => |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | if (DB_ResidenceData.Instance.CurrentRegion.isOtherShare == false) |
| | | { |
| | | new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | //是主账号本人才能显示这个菜单 |
| | | contentView.AddChidren(administratorPermissionMigrationRow); |
| | | } |
| | | |
| | | #endregion |
| | | btnAdministratorPermissionMigrationTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(24), |
| | | TextID = StringId.AdministratorPermissionMigration, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | }; |
| | | administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationTitle); |
| | | |
| | | btnAdministratorPermissionMigrationExplan = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnAdministratorPermissionMigrationTitle.Bottom, |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(21), |
| | | TextID = StringId.AdministratorPermissionMigrationExPlan, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationExplan); |
| | | |
| | | |
| | | btnAdministratorPermissionMigrationSkinIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | administratorPermissionMigrationRow.AddChidren(btnAdministratorPermissionMigrationSkinIcon); |
| | | |
| | | administratorPermissionMigrationRow.AddChidren( |
| | | new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(1), |
| | | Width = Application.GetRealWidth(343), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | #endregion |
| | | |
| | | #region 过户 |
| | | transferRow = new FrameLayout() |
| | | { |
| | | Y = administratorPermissionMigrationRow.Bottom, |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | //有网关才能过户 |
| | | if (DB_ResidenceData.Instance.HomeGateway != null && string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId) == false |
| | | && DB_ResidenceData.Instance.CurrentRegion.isOtherShare == false) |
| | | { |
| | | contentView.AddChidren(transferRow); |
| | | } |
| | | |
| | | btnTransferTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(24), |
| | | TextID = StringId.Transfer, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | }; |
| | | transferRow.AddChidren(btnTransferTitle); |
| | | |
| | | btnTrasferExplan = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnTransferTitle.Bottom, |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(21), |
| | | TextID = StringId.TransferExPlan, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | transferRow.AddChidren(btnTrasferExplan); |
| | | |
| | | btnTrasferSkinIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | transferRow.AddChidren(btnTrasferSkinIcon); |
| | | #endregion |
| | | |
| | | #region 调试权限 |
| | | |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) }); |
| | | FrameLayout commissioningAuthorityRow; |
| | | commissioningAuthorityRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(commissioningAuthorityRow); |
| | | |
| | | |
| | | var btnCommissioningAuthorityTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(24), |
| | | TextID = StringId.CommissioningAuthority, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | }; |
| | | commissioningAuthorityRow.AddChidren(btnCommissioningAuthorityTitle); |
| | | |
| | | var btnCommissioningAuthorityExplan = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnCommissioningAuthorityTitle.Bottom, |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(21), |
| | | TextID = StringId.CommissioningAuthorityExPlan, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | commissioningAuthorityRow.AddChidren(btnCommissioningAuthorityExplan); |
| | | |
| | | btnCommissioningAuthoritySwitchIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(314), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(48), |
| | | Height = Application.GetMinRealAverage(36), |
| | | UnSelectedImagePath = "Public/Switch.png", |
| | | SelectedImagePath = "Public/SwitchOn.png", |
| | | IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm |
| | | }; |
| | | commissioningAuthorityRow.AddChidren(btnCommissioningAuthoritySwitchIcon); |
| | | |
| | | btnCommissioningAuthoritySwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | DB_ResidenceData.Instance.CurrentRegion.debugPerm = !DB_ResidenceData.Instance.CurrentRegion.debugPerm; |
| | | btnCommissioningAuthoritySwitchIcon.IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | LoadEvent_SkipAdminMigrationConfirmPage(); |
| | | LoadEvent_SkipTransferConfirmPage(); |
| | | } |
| | | else |
| | | { |
| | | #region 交付二维码 |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) }); |
| | | var deliveryQRcodeRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(deliveryQRcodeRow); |
| | | |
| | | var btnDeliveryQRcodeTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(308), |
| | | TextID = StringId.ResidentialDelivery, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | }; |
| | | deliveryQRcodeRow.AddChidren(btnDeliveryQRcodeTitle); |
| | | |
| | | |
| | | var btnDeliveryQRcodeRightIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | deliveryQRcodeRow.AddChidren(btnDeliveryQRcodeRightIcon); |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var skipPage = new DeliveryQrCodePage(); |
| | | MainPage.BasePageView.AddChidren(skipPage); |
| | | skipPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | deliveryQRcodeRow.MouseUpEventHandler = eventHandler; |
| | | btnDeliveryQRcodeTitle.MouseUpEventHandler = eventHandler; |
| | | btnDeliveryQRcodeRightIcon.MouseUpEventHandler = eventHandler; |
| | | #endregion |
| | | } |
| | | LoadEventList(); |
| | | } |
| | | } |
| | |
| | | LoadEvent_SkipRoomsPage(); |
| | | LoadEvent_EditResidencName(); |
| | | LoadEvent_EditResidencAddress(); |
| | | LoadEvent_SkipAdminMigrationConfirmPage(); |
| | | LoadEvent_SkipTransferConfirmPage(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | List<uint> levelColorList = new List<uint>(); |
| | | List<int> levelTextList = new List<int>(); |
| | | List<string> levelText = new List<string>(); |
| | | List<string> intervalList = new List<string>(); |
| | | var configs = sensor.GetAttrKeyConfigs(sensor.SpkClassification); |
| | | |
| | | |
| | |
| | | { |
| | | levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | foreach(var iii in levelTextList) |
| | | intervalList = sensorTemp.GetIntervalValue(sensor.spk); |
| | | |
| | | foreach (var iii in levelTextList) |
| | | { |
| | | levelText.Add(Language.StringByID(iii)); |
| | | } |
| | |
| | | IsBold = true, |
| | | TextID = StringId.ColorValue, |
| | | }); |
| | | for (int index = 0; index < levelText.Count; index++) |
| | | try |
| | | { |
| | | infoView.AddChidren(new Button() |
| | | for (int index = 0; index < levelText.Count; index++) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(303), |
| | | Height = Application.GetRealWidth(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | //if(sensorTemp.GetIntervalValue(sensor.spk).Count >= index) |
| | | //{ |
| | | // return; |
| | | //} |
| | | infoView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(303), |
| | | Height = Application.GetRealWidth(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | FrameLayout subInfoView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | infoView.AddChidren(subInfoView); |
| | | FrameLayout subInfoView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | infoView.AddChidren(subInfoView); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | Text = sensorTemp.GetIntervalValue(sensor.spk)[index] |
| | | }); |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | Text = sensorTemp.GetIntervalValue(sensor.spk)[index] |
| | | }); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | Text = levelText[index] |
| | | }); |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | Text = levelText[index] |
| | | }); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(285), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(38), |
| | | Height = Application.GetRealHeight(18), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | BackgroundColor = levelColorList[index] |
| | | }); |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(285), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(38), |
| | | Height = Application.GetRealHeight(18), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | BackgroundColor = levelColorList[index] |
| | | }); |
| | | } |
| | | } |
| | | |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"环境等级信息表加载异常:{ex.Message}"); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(600), |
| | | ScrollEnabled = false |
| | | ScrollEnabled = sensorList.Count > 6 |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | |
| | | bool initTitleButton = true; |
| | | |
| | | int index = 1; |
| | | foreach (var tempSensor in sensorList) |
| | | try |
| | | { |
| | | if(index > 6) |
| | | new System.Threading.Thread(() => |
| | | { |
| | | break; |
| | | } |
| | | if (tempSensor.sid == function.sid) |
| | | { |
| | | continue; |
| | | } |
| | | if (tempSensor.spk != function.spk) |
| | | { |
| | | continue; |
| | | } |
| | | contentView.ScrollEnabled = true; |
| | | |
| | | if (initTitleButton) |
| | | { |
| | | Button btnOthreTitle = new Button() |
| | | foreach (var tempSensor in sensorList) |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealWidth(38), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.OtherArea, |
| | | }; |
| | | contentView.AddChidren(btnOthreTitle); |
| | | initTitleButton = false; |
| | | } |
| | | if (index >= 6) |
| | | { |
| | | break; |
| | | } |
| | | if (tempSensor.sid == function.sid) |
| | | { |
| | | continue; |
| | | } |
| | | if (tempSensor.spk != function.spk) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | #region 其它传感器信息栏 |
| | | FrameLayout otherInfoView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(otherInfoView); |
| | | |
| | | Button btnTipColor1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8), |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(12), |
| | | Height = Application.GetRealWidth(12), |
| | | BackgroundColor = tipColorList[index++], |
| | | Radius = (uint)Application.GetRealWidth(2), |
| | | BorderWidth = 0, |
| | | BorderColor = 0x00000000, |
| | | }; |
| | | otherInfoView.AddChidren(btnTipColor1); |
| | | |
| | | Button btnSensorName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealWidth(10), |
| | | Width = Application.GetRealWidth(250), |
| | | Height = Application.GetRealWidth(24), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = function.name, |
| | | IsBold = true, |
| | | }; |
| | | otherInfoView.AddChidren(btnSensorName); |
| | | |
| | | Button btnFromFoorAndRoom1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnSeltSensorName.Bottom, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(21), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = tempSensor.GetRoomListName() |
| | | }; |
| | | otherInfoView.AddChidren(btnFromFoorAndRoom1); |
| | | |
| | | var btnSetting1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(291), |
| | | Y = Application.GetRealWidth(6), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/FuncInfoSetIcon.png", |
| | | }; |
| | | otherInfoView.AddChidren(btnSetting1); |
| | | |
| | | btnSetting1.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action backAction = () => |
| | | { |
| | | MainPage.Log("45678i"); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnSeltSensorName.Text = tempSensor.name; |
| | | if (initTitleButton) |
| | | { |
| | | Button btnOthreTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealWidth(38), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.OtherArea, |
| | | }; |
| | | contentView.AddChidren(btnOthreTitle); |
| | | initTitleButton = false; |
| | | } |
| | | |
| | | #region 其它传感器信息栏 |
| | | FrameLayout otherInfoView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(otherInfoView); |
| | | |
| | | Button btnTipColor1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8), |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(12), |
| | | Height = Application.GetRealWidth(12), |
| | | BackgroundColor = tipColorList[index++], |
| | | Radius = (uint)Application.GetRealWidth(2), |
| | | BorderWidth = 0, |
| | | BorderColor = 0x00000000, |
| | | }; |
| | | otherInfoView.AddChidren(btnTipColor1); |
| | | |
| | | Button btnSensorName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealWidth(10), |
| | | Width = Application.GetRealWidth(250), |
| | | Height = Application.GetRealWidth(24), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = function.name, |
| | | IsBold = true, |
| | | }; |
| | | otherInfoView.AddChidren(btnSensorName); |
| | | |
| | | Button btnFromFoorAndRoom1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnSeltSensorName.Bottom, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(21), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = tempSensor.GetRoomListName() |
| | | }; |
| | | otherInfoView.AddChidren(btnFromFoorAndRoom1); |
| | | |
| | | var btnSetting1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(291), |
| | | Y = Application.GetRealWidth(6), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/FuncInfoSetIcon.png", |
| | | }; |
| | | otherInfoView.AddChidren(btnSetting1); |
| | | |
| | | btnSetting1.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action backAction = () => |
| | | { |
| | | MainPage.Log("45678i"); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnSeltSensorName.Text = tempSensor.name; |
| | | }); |
| | | }; |
| | | var infoView = new FunctionBaseInfoSetPage(tempSensor, backAction); |
| | | MainPage.BasePageView.AddChidren(infoView); |
| | | infoView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | Button btnSensorValue = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(47), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealWidth(43), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | }; |
| | | otherInfoView.AddChidren(btnSensorValue); |
| | | |
| | | var btnShowData1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(291), |
| | | Y = Application.GetRealWidth(62), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png", |
| | | SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png", |
| | | }; |
| | | otherInfoView.AddChidren(btnShowData1); |
| | | btnShowData1.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnShowData1.IsSelected = !btnShowData1.IsSelected; |
| | | if (btnShowData1.IsSelected) |
| | | { |
| | | if (!showFunctions.Contains(tempSensor)) |
| | | { |
| | | showFunctions.Add(tempSensor); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (showFunctions.Contains(tempSensor)) |
| | | { |
| | | showFunctions.Remove(tempSensor); |
| | | } |
| | | } |
| | | LoadMothed_GetSensorHistoryData(); |
| | | }; |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(12), |
| | | }); |
| | | }); |
| | | }; |
| | | var infoView = new FunctionBaseInfoSetPage(tempSensor, backAction); |
| | | MainPage.BasePageView.AddChidren(infoView); |
| | | infoView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | Button btnSensorValue = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(47), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealWidth(43), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | }; |
| | | otherInfoView.AddChidren(btnSensorValue); |
| | | |
| | | var btnShowData1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(291), |
| | | Y = Application.GetRealWidth(62), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png", |
| | | SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png", |
| | | }; |
| | | otherInfoView.AddChidren(btnShowData1); |
| | | btnShowData1.MouseUpEventHandler = (sender, e) => { |
| | | btnShowData1.IsSelected = !btnShowData1.IsSelected; |
| | | if (btnShowData1.IsSelected) |
| | | { |
| | | if (!showFunctions.Contains(tempSensor)) |
| | | { |
| | | showFunctions.Add(tempSensor); |
| | | } |
| | | System.Threading.Thread.Sleep(50); |
| | | } |
| | | else |
| | | { |
| | | if (showFunctions.Contains(tempSensor)) |
| | | { |
| | | showFunctions.Remove(tempSensor); |
| | | } |
| | | } |
| | | LoadMothed_GetSensorHistoryData(); |
| | | }; |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(12), |
| | | }); |
| | | |
| | | }).Start(); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | MainPage.Log($"加载传感器异常xx:{ex.Message}"); |
| | | } |
| | | #endregion |
| | | new TopViewDiv(bodyView, Language.StringByID(sensorTemp.GetFunctionTypeNameId(function.spk))).LoadTopView(); |
| | |
| | | public void LoadPage(bool locationSetting = true) |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(actionRefresh); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | //const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |
| | | const string APP_KEY = "CPEVRLRT"; |
| | | const string SECRET_KEY = "CPEVRLSJCPEVRLSZ"; |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | #endregion |
| | | |
| | | #region **********签名校验********** |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | |
| | | /// <summary> |
| | | /// 获取当前时间戳值 |