Merge branch 'release0123'
| | |
| | | 556=Someone is running |
| | | 557=Someone is standing |
| | | 558=Someone is sitting |
| | | 559=Bind a third-party account |
| | | 560=Bound |
| | | |
| | | |
| | | |
| | |
| | | 408=确认添加 |
| | | |
| | | 409=功能品牌 |
| | | 410=你当前还未添加任何平台设备 |
| | | 410=没有您的设备 |
| | | 411=其他平台设备均由第三方服务商提供支持 |
| | | 412=添加 |
| | | 413=控制器未开启 |
| | |
| | | 428=负离子时间 |
| | | 429=小时 |
| | | 430=分钟 |
| | | 431=你当前还为添加任何平台设备 |
| | | 431=您当前还未添加任何平台设备 |
| | | 432=其他平台设备均由第三方服务商提供支持 |
| | | 433=水阀 |
| | | 434=定时开关 |
| | |
| | | 556=有人在跑 |
| | | 557=有人站着 |
| | | 558=有人坐着 |
| | | 559=绑定第三方账号 |
| | | 560=已绑定 |
| | | |
| | | |
| | | |
| | |
| | | 556=Someone is running |
| | | 557=Someone is standing |
| | | 558=Someone is sitting |
| | | 559=Bind a third-party account |
| | | 560=Bound |
| | | |
| | | |
| | | 2532=Visitor Invitation Record |
| | |
| | | 556=Someone is running |
| | | 557=Someone is standing |
| | | 558=Someone is sitting |
| | | 559=Bind a third-party account |
| | | 560=Bound |
| | | |
| | | |
| | | 2532=Visitor Invitation Record |
| | | 2533=Visitor management |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmSensor\SomeoneStandBgIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\FunctionArmOnbg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\sensormegahealth.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Public\Iot_agreement_icon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Public\LinkIotIcon.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.5.9" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202207261"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202208031"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <!--友盟--> |
| | | <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\SomeoneRunBgIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\SomeoneSitBgIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\SomeoneStandBgIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\FunctionArmOnbg.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\sensormegahealth.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\Iot_agreement_icon.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | 408=确认添加 |
| | | |
| | | 409=功能品牌 |
| | | 410=你当前还未添加任何平台设备 |
| | | 410=没有您的设备 |
| | | 411=其他平台设备均由第三方服务商提供支持 |
| | | 412=添加 |
| | | 413=控制器未开启 |
| | |
| | | 428=负离子时间 |
| | | 429=小时 |
| | | 430=分钟 |
| | | 431=你当前还为添加任何平台设备 |
| | | 431=您当前还未添加任何平台设备 |
| | | 432=其他平台设备均由第三方服务商提供支持 |
| | | 433=水阀 |
| | | 434=定时开关 |
| | |
| | | FileUtlis.Files.DeleteFile(file); |
| | | } |
| | | } |
| | | FunctionList.List.securities.Clear(); |
| | | foreach (var function in infoList) |
| | | { |
| | | function.SaveFile(); |
| | |
| | | public static class StringId |
| | | { |
| | | /// <summary> |
| | | /// 已绑定 |
| | | /// </summary> |
| | | public const int Bound = 560; |
| | | /// <summary> |
| | | /// 绑定第三方账号 |
| | | /// </summary> |
| | | public const int Bind3thIotAccount = 559; |
| | | /// <summary> |
| | | /// 有人坐着 |
| | | /// </summary> |
| | | public const int SomeoneSitting = 558; |
| | |
| | | /// <param name="updateBytes"></param> |
| | | public void UpdataFunctionStatus(string revString, byte[] usefulBytes,bool isCloudData = false) |
| | | { |
| | | ////test 云端连接成功时,不适用本地数据更新 |
| | | //if (Ins.GatewayOnline_Cloud && !isCloudData) |
| | | //{ |
| | | // return; |
| | | //} |
| | | |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString); |
| | | if (temp != null) |
| | | { |
| | |
| | | |
| | | if (Ins.GatewayOnline_Local && isCloudData)//本地链接,除了涂鸦设备数据之外的云端数据不处理 |
| | | { |
| | | if (FunctionList.List.OtherBrandFunction.Count != 0) |
| | | if (FunctionList.List.OtherBrandFunction.Count == 0) |
| | | { |
| | | MainPage.Log($"A协议更新状态:本地链接,除了涂鸦设备数据之外的云端数据不处理..."); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (FunctionList.List.OtherBrandFunction.Find((obj) => obj.sid == updateTemp.sid) == null) |
| | | { |
| | | //MainPage.Log($"A协议更新状态:本地链接,除了涂鸦设备数据之外的云端数据不处理..."); |
| | | return; |
| | | } |
| | | } |
| | |
| | | case SPK.HvacAirFresh: |
| | | case SPK.SensorGas: |
| | | case SPK.HvacCac: |
| | | case SPK.SensorHelp: |
| | | //设备状态推送 |
| | | //状态更新 |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status); |
| | |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | |
| | | |
| | | #region 数据更新推送主题 |
| | | //appHomeRefresh:住宅数据刷新通知--杨涛 |
| | | var appHomeRefresh = new MqttTopicFilter() |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 订阅绑定第三方iot账号结果 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static async Task<bool> SubscribeAsync3tyIotbind() |
| | | { |
| | | var topicFilter = new MqttTopicFilter() |
| | | { |
| | | Topic = $"/user/{UserInfo.Current.ID}/app/third/bind/send", |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | var result = await RemoteMqttClient.SubscribeAsync(topicFilter); |
| | | if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0) |
| | | { |
| | | Utlis.WriteLine("订阅绑定第三方iot账号结果成功!"); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | /// <summary> |
| | | /// 取消订阅绑定第三方iot账号结果 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static async Task<bool> UnsubscribeAsync3tyIotbind() |
| | | { |
| | | string[] strs = new string[] { |
| | | $"/user/{UserInfo.Current.ID}/app/third/bind/send" |
| | | }; |
| | | |
| | | var result = await RemoteMqttClient.UnsubscribeAsync(strs); |
| | | |
| | | if (result.Items[0].ReasonCode == MQTTnet.Client.Unsubscribing.MqttClientUnsubscribeResultCode.Success) |
| | | { |
| | | Utlis.WriteLine("取消订阅绑定第三方iot账号结果成功!"); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | /// <summary> |
| | | /// 绑定第三方平台接收回调事件 |
| | | /// </summary> |
| | | public static Action Bind3tyIotAction; |
| | | |
| | | /// <summary> |
| | | /// 启动远程Mqtt |
| | |
| | | //新挤下线主题方案 收到挤下线主题 |
| | | ReceiveNotifySqueezeAsync(mMes); |
| | | } |
| | | //绑定第三方平台结果通知 |
| | | else if(topic == $"/user/{UserInfo.Current.ID}/app/third/bind/send") |
| | | { |
| | | var revString = Encoding.UTF8.GetString(e.ApplicationMessage.Payload); |
| | | Bind3tyIotAction?.Invoke(); |
| | | } |
| | | //设备在线离线状态推送 |
| | | else if(topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/son/session/online") |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/son/session/online") |
| | | { |
| | | try |
| | | { |
| | |
| | | //} |
| | | |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | |
| | | } |
| | | HomePage.LoadEvent_RefreshSecurityStatus(); |
| | | } |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"安防远程信息异常:{ex.Message}"); |
| | | } |
| | |
| | | //Tag 网络状态解析 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/property/send") |
| | | { |
| | | |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); |
| | | var revString = Encoding.UTF8.GetString(bytes); |
| | | MainPage.Log($"mqtt 状态更新:{revString}"); |
| | | Control.Ins.UpdataFunctionStatus(revString, null, true); |
| | | //Control.Ins.MsgInfoList.Add($"mqtt 状态更新:{revString}"); |
| | | //Control.Ins.MsgInfoList.Add(revString + "\r\n"); |
| | | //if (FunctionList.List.OtherBrandFunction.Find((obj) => obj.sid == updateTemp.sid) == null) |
| | | //{ |
| | | // return; |
| | | //} |
| | | } |
| | | //一端口数据解析 |
| | | else |
| | |
| | | |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取第三方品牌列表_Iot |
| | | /// </summary> |
| | | public ResponsePackNew Get3tyIotBrandList() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBrandList_Iot, requestJson); |
| | | |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 搜索第三方设备_iot |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Search3tyIotDevice(string companyId) |
| | | { |
| | | |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Search3tyIotDevice, requestJson); |
| | | |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 搜索第三方设备功能列表_iot |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Get3tyIotDeviceFunctionList(string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 获取第三方平台支持的设备类型列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Get3tyIotSupportSpkList(string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置第三方设备绑定的住宅 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Set3tyIotFunctionToHouse(string deviceId,string homeId, string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("homeId", homeId); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Setting3tyIotFunctionToHouse, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解绑第三方平台账号 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Unbound3tyIotAccount(string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Unbound3tyIotAccount, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取绑定的第三方品牌列表 |
| | | /// </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";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | /// 获取品牌列表 |
| | | /// </summary> |
| | | public const string Api_Post_GetBrandList = "/home-wisdom/app/product/brand/list"; |
| | | /// <summary> |
| | | /// 获取品牌列表_iot 平台 |
| | | /// </summary> |
| | | public const string Api_Post_GetBrandList_Iot = "/smart-open/platform/auth/brand/list"; |
| | | /// <summary> |
| | | /// 发现第三方iot平台设备 |
| | | /// </summary> |
| | | public const string Api_Post_Search3tyIotDevice = "/home-wisdom/app/open/discoveryDevice"; |
| | | /// <summary> |
| | | /// 获取第三方iot平台设备功能列表 |
| | | /// </summary> |
| | | public const string Api_Post_Get3tyIotFunction = "/home-wisdom/app/open/extDeviceList"; |
| | | /// <summary> |
| | | /// 配置第三方iot平台设备功能到住宅 |
| | | /// </summary> |
| | | public const string Api_Post_Setting3tyIotFunctionToHouse = "/home-wisdom/app/open/assignDeviceToHouse"; |
| | | /// <summary> |
| | | /// 解绑第三方iot平台账号 |
| | | /// </summary> |
| | | public const string Api_Post_Unbound3tyIotAccount = "/smart-open/open-platform/tripartite/userUnbind"; |
| | | |
| | | #region ■ -- 红外宝接口___________________________ |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 备注 |
| | | /// </summary> |
| | | public string name; |
| | | public string name = ""; |
| | | /// <summary> |
| | | /// 设备绑定的homeId |
| | | /// </summary> |
| | | private string _homeId = ""; |
| | | public string homeId |
| | | { |
| | | get |
| | | { |
| | | if (string.IsNullOrEmpty(_homeId)) |
| | | { |
| | | return DB_ResidenceData.Instance.CurrentRegion.id; |
| | | } |
| | | else |
| | | { |
| | | return _homeId; |
| | | } |
| | | } |
| | | set |
| | | { |
| | | _homeId = value; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设备ID |
| | | /// 云端负责生成 |
| | |
| | | var spkList = new List<string>(); |
| | | //spkList.Add(SensorLight); |
| | | spkList.Add(SensorPir); |
| | | spkList.Add(SensorHelp); |
| | | spkList.Add(SensorDoorWindow); |
| | | spkList.Add(SensorSmoke); |
| | | spkList.Add(SensorWater); |
| | |
| | | { |
| | | get |
| | | { |
| | | if(_ScenePack == null) |
| | | if (_ScenePack == null) |
| | | { |
| | | _ScenePack = new SceneApiPack(); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | public class Scene |
| | | public class Scene |
| | | { |
| | | public Scene() |
| | | { |
| | |
| | | /// 网关ID |
| | | /// </summary> |
| | | public string gatewayId = ""; |
| | | /// <summary> |
| | | /// 云端oss存储图片的路径 |
| | | /// </summary> |
| | | public string image = ""; |
| | | /// <summary> |
| | | /// 所属房间列表 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public string userId = UserInfo.Current.ID; |
| | | |
| | | /// <summary> |
| | | /// 云端oss存储图片的路径 |
| | | /// </summary> |
| | | public string image = ""; |
| | | |
| | | ///// <summary> |
| | | ///// 场景背景 |
| | | ///// </summary> |
| | |
| | | { |
| | | get |
| | | { |
| | | if (string.IsNullOrEmpty(image)) |
| | | //if (string.IsNullOrEmpty(image)) |
| | | //{ |
| | | // return "Intelligence/Gallery/scenebg1.png"; |
| | | //} |
| | | //else |
| | | //{ |
| | | // return image; |
| | | //} |
| | | |
| | | if (image.Contains("Intelligence/Gallery/scenebg")) |
| | | { |
| | | return "Intelligence/Gallery/scenebg1.png"; |
| | | return image; |
| | | } |
| | | else |
| | | { |
| | | return image; |
| | | var sceneImageInfo = OssSceneImages.Find((obj) => obj.defaultIconName == image); |
| | | if (sceneImageInfo != null) |
| | | { |
| | | return sceneImageInfo.defaultIconName; |
| | | } |
| | | else |
| | | { |
| | | return "Intelligence/Gallery/scenebg1.png"; |
| | | } |
| | | } |
| | | } |
| | | set |
| | | { |
| | | image = value; |
| | | var sceneImageInfo = OssSceneImages.Find((obj) => "Intelligence/Gallery/" + obj.defaultIconName + ".png" == value); |
| | | if (sceneImageInfo != null) |
| | | { |
| | | image = sceneImageInfo.defaultIconUrl; |
| | | } |
| | | else |
| | | { |
| | | image = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 云端场景默认图库数据 |
| | | /// 2022-08-03 10:57:31 wxr |
| | | /// 配合豆豆修改云端数据 |
| | | /// 调试宝、on pro和平台对应 |
| | | /// </summary> |
| | | public List<SceneImageInfo> OssSceneImages = new List<SceneImageInfo>() |
| | | { |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg1", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/781c397f-611a-48a2-a3ed-2520ffb971bb.png" |
| | | }, |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg2", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/be2a7c63-a6c0-427a-bb6d-f5c06f5b2f05.png" |
| | | }, |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg3", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/5d801aca-03fb-4ef3-88ec-75ade3aa1c94.png" |
| | | }, |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg4", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/a205306c-4fcd-4ea1-8e88-e84282dc0d54.png" |
| | | }, |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg5", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/93a0acdc-14be-4776-a9fd-e0fc6f13c909.png" |
| | | }, |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg6", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/45074923-2227-422a-be33-e37e6c3f9d23.png" |
| | | }, |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg7", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/28b3e459-041e-4ea1-9ff9-57053c5357f4.png" |
| | | }, |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg8", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/d470b979-cc06-4701-a2bd-7301856c9195.png" |
| | | }, |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg9", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/1a130d03-86b2-4174-b986-6f6c312a959f.png" |
| | | }, |
| | | new SceneImageInfo |
| | | { |
| | | defaultIconName = "scenebg10", |
| | | defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/54c1c7ab-9b63-4487-a77d-d5d3dadd9801.png" |
| | | } |
| | | }; |
| | | |
| | | /// <summary> |
| | | /// 场景功能列表 |
| | |
| | | } |
| | | roomNameList += findRoom.floorName + findRoom.roomName; |
| | | } |
| | | if (roomNameList == "" ) |
| | | if (roomNameList == "") |
| | | { |
| | | roomNameList = Shared.Language.StringByID(StringId.WholeZone); |
| | | } |
| | |
| | | { |
| | | //重置执行倒计时 |
| | | this.countdownTime = 0; |
| | | if(MainPage.NoLoginMode) |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | | Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd); |
| | |
| | | /// </summary> |
| | | public string UpdateScene() |
| | | { |
| | | if(MainPage.NoLoginMode) |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | | Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd); |
| | |
| | | public string GetDelayText() |
| | | { |
| | | var delayInt = 0; |
| | | int.TryParse(delay,out delayInt); |
| | | if(delayInt == 0) |
| | | int.TryParse(delay, out delayInt); |
| | | if (delayInt == 0) |
| | | { |
| | | return Language.StringByID(StringId.NoDelay); |
| | | } |
| | |
| | | if (delayInt > 60) |
| | | { |
| | | text = (delayInt / 60) + Language.StringByID(StringId.m) + (delayInt % 60) + Language.StringByID(StringId.s); |
| | | }else |
| | | } |
| | | else |
| | | { |
| | | text = delayInt + Language.StringByID(StringId.s); |
| | | } |
| | |
| | | sceneFunctionInfo += perState.value + "%" + " "; |
| | | } |
| | | var cctState = status.Find((obj) => obj.key == FunctionAttributeKey.CCT); |
| | | if(cctState != null) |
| | | if (cctState != null) |
| | | { |
| | | sceneFunctionInfo += cctState.value + "K" + " "; |
| | | } |
| | | var rgbState = status.Find((obj) => obj.key == FunctionAttributeKey.RGB); |
| | | if(rgbState!=null) |
| | | if (rgbState != null) |
| | | { |
| | | //sceneFunctionInfo += new cctState.value + "%" + " "; |
| | | } |
| | | |
| | | |
| | | |
| | | var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle); |
| | | if (perAngle != null) |
| | | { |
| | |
| | | { |
| | | var us = ""; |
| | | var swithchString = key; |
| | | if(!string.IsNullOrEmpty(inputKey)) |
| | | if (!string.IsNullOrEmpty(inputKey)) |
| | | { |
| | | swithchString = inputKey; |
| | | } |
| | |
| | | public string GetValueText(string temp = "") |
| | | { |
| | | string catchString = value; |
| | | if(temp!= "") |
| | | if (temp != "") |
| | | { |
| | | catchString = temp; |
| | | } |
| | |
| | | case FunctionAttributeKey.Percent: |
| | | case FunctionAttributeKey.Angle: |
| | | int outT = 0; |
| | | int.TryParse(catchString,out outT); |
| | | int.TryParse(catchString, out outT); |
| | | if (outT < 0) |
| | | catchString = "0"; |
| | | if (catchString == "") |
| | |
| | | public List<string> pushTarget = new List<string>(); |
| | | } |
| | | |
| | | } |
| | | public class SceneImageInfoList |
| | | { |
| | | //public Dictionary<string, string> Dic_SceneImages; |
| | | |
| | | //public SceneImageInfoList() |
| | | //{ |
| | | // Dic_SceneImages = new Dictionary<string, string>(); |
| | | // foreach(var sceneImage in sceneImages) |
| | | // { |
| | | // Dic_SceneImages.Add(sceneImage.defaultIconName, sceneImage.defaultIconUrl); |
| | | // } |
| | | //} |
| | | |
| | | |
| | | } |
| | | |
| | | public class SceneImageInfo |
| | | { |
| | | public string defaultIconName; |
| | | public string defaultIconUrl; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | public string productPlatform; |
| | | } |
| | | /// <summary> |
| | | /// 第三方集成品牌对象类 |
| | | /// </summary> |
| | | public class IntegratedBrand_Iot |
| | | { |
| | | public IntegratedBrand_Iot() |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// id |
| | | /// </summary> |
| | | public string authBrandId; |
| | | |
| | | public string brandName |
| | | { |
| | | get |
| | | { |
| | | if(Language.CurrentLanguage == "Chinese") |
| | | { |
| | | return authBrandNameCn; |
| | | } |
| | | else |
| | | { |
| | | return authBrandNameEn; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 品牌名称中文 |
| | | /// </summary> |
| | | public string authBrandNameCn; |
| | | /// <summary> |
| | | /// 品牌名称英文 |
| | | /// </summary> |
| | | public string authBrandNameEn; |
| | | /// <summary> |
| | | /// 品牌副标题(中文) |
| | | /// </summary> |
| | | public string authBrandSubheadCn; |
| | | /// <summary> |
| | | /// 品牌副标题(英文) |
| | | /// </summary> |
| | | public string authBrandSubheadEn; |
| | | /// <summary> |
| | | /// 图片url |
| | | /// </summary> |
| | | public string authrBandIconUrl; |
| | | /// <summary> |
| | | /// 认证授权地址 |
| | | /// </summary> |
| | | public string authorizationUrl; |
| | | /// <summary> |
| | | /// 是否已经授权 |
| | | /// </summary> |
| | | public bool hasAuthorization; |
| | | /// <summary> |
| | | /// 公司id |
| | | /// </summary> |
| | | public string companyId; |
| | | |
| | | public string clientId; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 第三方设备信息 |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Visitor\LpTimeDialogCallBak.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Visitor\LpTipDialogCallBack.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\SensorMegahealth_AlarmDataStatisticsPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\Iot_BrandListPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\iot_BindTipPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\Iot_BrandFunctionListPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\Iot_AuthorizedPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\Iot_SupportSpkListPage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.5.9"; |
| | | public static string VersionString = "1.6.0"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | pirPage.ShowColltionButton = false; |
| | | pirPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.SensorHelp: |
| | | var helpPage = new PanelHelpPage(); |
| | | helpPage.ShowColltionButton = false; |
| | | helpPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.SensorWater: |
| | | var waterPage = new SensorWaterImmersionPage(); |
| | | waterPage.ShowColltionButton = false; |
| | |
| | | /// </summary> |
| | | /// <param name="frame"></param> |
| | | /// <param name="tilte"></param> |
| | | public void LoadTopView() |
| | | public void LoadTopView(uint color = CSS_Color.TopViewColor) |
| | | { |
| | | contentView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(64), |
| | | BackgroundColor = CSS_Color.TopViewColor, |
| | | BackgroundColor = color, |
| | | }; |
| | | baseView.AddChidren(contentView); |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="frame"></param> |
| | | /// <param name="tilte"></param> |
| | | public void LoadTopView_Add3tyIot(string type, Action<string, string> callBack) |
| | | public void LoadTopView_Add3tyIot( Action<string, string> callBack) |
| | | { |
| | | LoadTopView(); |
| | | LoadTopView(CSS_Color.MainBackgroundColor); |
| | | |
| | | var btnAddIcon = new Button() |
| | | { |
| | |
| | | Y = Application.GetRealHeight(29), |
| | | Width = Application.GetMinRealAverage(28), |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "Public/AddIcon.png", |
| | | UnSelectedImagePath = "Public/LinkIotIcon.png", |
| | | }; |
| | | contentView.AddChidren(btnAddIcon); |
| | | |
| | | btnAddIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (type == "floors") |
| | | { |
| | | Action<string> callBackAction = (floorName) => |
| | | { |
| | | callBack("add", floorName); |
| | | }; |
| | | string newFloorName = "1F"; |
| | | for (int i = 0; i < SpatialInfo.CurrentSpatial.FloorList.Count + 1;) |
| | | { |
| | | newFloorName = ++i + "F"; |
| | | if (null == SpatialInfo.CurrentSpatial.FloorList.Find((obj) => obj.roomName == newFloorName)) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | var fs = new List<string>(); |
| | | foreach (var f in SpatialInfo.CurrentSpatial.FloorList) |
| | | { |
| | | fs.Add(f.roomName); |
| | | } |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors, newFloorName, callBackAction, StringId.FloorNameCannotBeEmpty, |
| | | StringId.AddFloorFailed_FloorAlreadyExist, fs); |
| | | } |
| | | else |
| | | { |
| | | callBack("", ""); |
| | | } |
| | | var page = new Iot_BrandListPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 向framelayout添加顶部区域,第三方平台 |
| | | /// </summary> |
| | | public void LoadTopView_3tyIot(Action action) |
| | | { |
| | | LoadTopView(CSS_Color.MainBackgroundColor); |
| | | |
| | | var btnAddIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(337), |
| | | Y = Application.GetRealHeight(29), |
| | | Width = Application.GetMinRealAverage(28), |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "Public/Iot_agreement_icon.png", |
| | | }; |
| | | contentView.AddChidren(btnAddIcon); |
| | | |
| | | btnAddIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | action(); |
| | | }; |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public WebView mWebView; |
| | | |
| | | private Action closeAction; |
| | | |
| | | |
| | | /// <summary> |
| | | /// WebViewDialog |
| | | /// </summary> |
| | |
| | | { |
| | | bodyView = new FrameLayout(); |
| | | } |
| | | public WebViewDialog(Action action) |
| | | { |
| | | closeAction = action; |
| | | bodyView = new FrameLayout(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载页面 |
| | |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | this.AddChidren(bodyView); |
| | | new TopViewDiv(this, bodyView, titleStr).LoadTopView(); |
| | | new TopViewDiv(this, bodyView, titleStr).LoadTopView(closeAction); |
| | | //WebView |
| | | mWebView = new WebView() |
| | | { |
| | |
| | | btnbg.SelectedImagePath = "Collection/FunctionArmOnbg.png"; |
| | | } |
| | | |
| | | if (!function.online) |
| | | { |
| | | btnbg.UnSelectedImagePath = "Collection/FunctionOfflineBg.png"; |
| | | } |
| | | //if (!function.online) |
| | | //{ |
| | | // btnbg.UnSelectedImagePath = "Collection/FunctionOfflineBg.png"; |
| | | //} |
| | | } |
| | | |
| | | if (index == 0) |
| | |
| | | btnState.SelectedTextColor = CSS_Color.MainBackgroundColor; |
| | | btnState.TextColor = CSS_Color.MainColor;//PromptingColor1 |
| | | } |
| | | |
| | | //紧急求助 |
| | | else if (function.spk == SPK.SensorHelp) |
| | | { |
| | | btnName.TextColor = CSS_Color.MainBackgroundColor; |
| | | btnName.SelectedTextColor = CSS_Color.MainBackgroundColor; |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_white.png"; |
| | | btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_white.png"; |
| | | } |
| | | |
| | | else |
| | | { |
| | | Button btnSwitch; |
| | |
| | | } |
| | | } |
| | | } |
| | | else if(function.spk == SPK.SensorHelp) |
| | | { |
| | | var tempStatus = function.attributes.Find((sta) => sta.key == FunctionAttributeKey.AlarmStatus); |
| | | if(tempStatus != null) |
| | | { |
| | | state = tempStatus.curValue.ToString() == "alarm"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | state = function.trait_on_off.curValue.ToString() == "on"; |
| | |
| | | { |
| | | if (function.spk != SPK.LightSwitch) |
| | | { |
| | | btn.Text = function.lastState; |
| | | if (function.spk == SPK.SensorHelp) |
| | | { |
| | | btn.TextID = StringId.InAlarming; |
| | | } |
| | | else |
| | | { |
| | | btn.Text = function.lastState; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | }; |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionBrand)).LoadTopView();//.LoadTopView_AddIcon("3ty",action);//.LoadTopView();// |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionBrand)).LoadTopView_Add3tyIot(action); |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | bodyView.AddChidren(new Button |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | contentView = new VerticalRefreshLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Y = Application.GetRealHeight(65), |
| | | Height = Application.GetRealHeight(603), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | |
| | | { |
| | | var row = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | Height = Application.GetRealHeight(87), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | LineColor = 0x00000000, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | |
| | | if (isFrist) |
| | | { |
| | | isFrist = false; |
| | | } |
| | | else |
| | | //if (isFrist) |
| | | //{ |
| | | // isFrist = false; |
| | | //} |
| | | //else |
| | | { |
| | | Button btnLine = new Button() |
| | | { |
| | | X = Application.GetRealWidth(56), |
| | | Width = Application.GetRealWidth(303), |
| | | Y = Application.GetRealHeight(86), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(47), |
| | | Height = Application.GetRealWidth(47), |
| | | Radius = (uint)Application.GetRealWidth(9), |
| | | BackgroundColor = CSS_Color.PromptingColor1 |
| | | }; |
| | | row.AddChidren(btnIcon); |
| | |
| | | |
| | | Button btnName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(56), |
| | | Width = Application.GetRealWidth(303), |
| | | X = Application.GetRealWidth(83), |
| | | Width = Application.GetRealWidth(210), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = brand.brandName, |
| | | }; |
| | | row.AddChidren(btnName); |
| | |
| | | ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.brandIcon, btnIcon); |
| | | |
| | | btnName.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | var page = new DeviceListPage(brand); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class Iot_AuthorizedPage |
| | | { |
| | | HttpServerRequest http = new HttpServerRequest(); |
| | | |
| | | IntegratedBrand_Iot brand_Iot; |
| | | |
| | | Action boudedAction; |
| | | |
| | | public Iot_AuthorizedPage(IntegratedBrand_Iot brand,Action action) |
| | | { |
| | | brand_Iot = brand; |
| | | boudedAction = action; |
| | | } |
| | | |
| | | |
| | | |
| | | public void LoadView() |
| | | { |
| | | string url = brand_Iot.authorizationUrl + $"?companyId={brand_Iot.companyId}&openUId={UserInfo.Current.ID}&client_id={brand_Iot.clientId}"; |
| | | var dd = new WebViewDialog(()=> { |
| | | UnsubscribeAsync3tyIotbind(); |
| | | }); |
| | | dd.LoadPage("", url); |
| | | DAL.Mqtt.MqttClient.Bind3tyIotAction = () => { |
| | | UnsubscribeAsync3tyIotbind(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | http.Search3tyIotDevice(brand_Iot.companyId); |
| | | boudedAction?.Invoke(); |
| | | dd.Close(); |
| | | }); |
| | | }; |
| | | SubscribeAsync3tyIotbind(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 订阅绑定第三方iot账号结果 |
| | | /// </summary> |
| | | private void SubscribeAsync3tyIotbind() |
| | | { |
| | | new System.Threading.Thread(async () => |
| | | { |
| | | try |
| | | { |
| | | var result = await DAL.Mqtt.MqttClient.SubscribeAsync3tyIotbind(); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 取消订阅绑定第三方iot账号结果 |
| | | /// </summary> |
| | | private void UnsubscribeAsync3tyIotbind() |
| | | { |
| | | new System.Threading.Thread(async () => |
| | | { |
| | | try |
| | | { |
| | | var result = await DAL.Mqtt.MqttClient.UnsubscribeAsync3tyIotbind(); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | /// <summary> |
| | | /// 搜索第三方设备 |
| | | /// </summary> |
| | | private void SearchDevice() |
| | | { |
| | | var pack = http.Search3tyIotDevice(brand_Iot.companyId); |
| | | if(pack!= null) |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取第三方功能列表 |
| | | /// </summary> |
| | | private void GetFunction() |
| | | { |
| | | var pack = http.Get3tyIotDeviceFunctionList(brand_Iot.companyId); |
| | | if(pack != null) |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class Iot_BrandFunctionListPage :FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | FrameLayout contentView; |
| | | |
| | | |
| | | |
| | | IntegratedBrand_Iot brand_Iot; |
| | | /// <summary> |
| | | /// 解绑回调 |
| | | /// </summary> |
| | | public Action unboundAction; |
| | | |
| | | public Iot_BrandFunctionListPage(IntegratedBrand_Iot brand_Iot) |
| | | { |
| | | bodyView = this; |
| | | this.brand_Iot = brand_Iot; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | Action action = () => { |
| | | var page = new iot_BindTipPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.unboundAction = () => { |
| | | this.RemoveFromParent(); |
| | | unboundAction?.Invoke(); |
| | | }; |
| | | page.LoadPage(brand_Iot); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | new TopViewDiv(bodyView, brand_Iot.brandName).LoadTopView_3tyIot(action); |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | |
| | | bodyView.AddChidren(new Button |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | Button btnTipText = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(80), |
| | | Width = Application.GetRealWidth(347), |
| | | Height = Application.GetRealHeight(65), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealWidth(5), |
| | | BackgroundColor = 0x194484F4, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Padding = new Padding(12, Application.GetRealWidth(16), 12, Application.GetRealWidth(16)), |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = "默认将第三方品牌的设备全部关联到On Pro上,您也可以通过下方的开关按键,进行选择性关联。", |
| | | IsMoreLines = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | bodyView.AddChidren(btnTipText); |
| | | |
| | | contentView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(150), |
| | | Height = Application.GetRealHeight(573), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | |
| | | var waitPage = new Loading(); |
| | | contentView.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var pack = http.Get3tyIotDeviceFunctionList(brand_Iot.companyId); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Function>>(pack.Data.ToString()); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | LoadDeviceFunctionControlZone(list); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | }); |
| | | } |
| | | }) { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载设备功能显示区域 |
| | | /// </summary> |
| | | void LoadDeviceFunctionControlZone(List<Function> list) |
| | | { |
| | | contentView.RemoveAll(); |
| | | |
| | | if (list.Count == 0) |
| | | { |
| | | NotListTipView(); |
| | | return; |
| | | } |
| | | |
| | | VerticalScrolViewLayout deviceFunctionView = new VerticalScrolViewLayout(); |
| | | contentView.AddChidren(deviceFunctionView); |
| | | |
| | | #region ContextView |
| | | var rowView = new FrameLayout(); |
| | | try |
| | | { |
| | | int index = 0; |
| | | |
| | | foreach (var function in list) |
| | | { |
| | | if(function.homeId != DB_ResidenceData.Instance.CurrentRegion.id && function.homeId != "0") |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (index % 2 == 0) |
| | | { |
| | | rowView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(140), |
| | | }; |
| | | deviceFunctionView.AddChidren(rowView); |
| | | } |
| | | var functionView_X = Application.GetRealWidth((182 + 7) * (index % 2)); |
| | | if (index % 2 == 0) |
| | | { |
| | | functionView_X += Application.GetRealWidth(7); |
| | | } |
| | | var functionView = new FrameLayout() |
| | | { |
| | | X = functionView_X, |
| | | Width = Application.GetRealWidth(182), |
| | | Height = Application.GetRealWidth(140), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Tag = function.sid |
| | | }; |
| | | rowView.AddChidren(functionView); |
| | | |
| | | var btnbg = new Button() |
| | | { |
| | | UnSelectedImagePath = "Collection/Functionbg.png", |
| | | SelectedImagePath = "Collection/FunctionOnbg.png", |
| | | Tag = function.sid |
| | | }; |
| | | functionView.AddChidren(btnbg); |
| | | LoadDeviceFunctionDiv(functionView, function,btnbg); |
| | | index++; |
| | | |
| | | |
| | | } |
| | | |
| | | if (index == 0) |
| | | { |
| | | var view = new FrameLayout(); |
| | | deviceFunctionView.AddChidren(view); |
| | | |
| | | var btnNoCollectionTip = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(42), |
| | | Y = Application.GetRealHeight(100), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = "没有任何设备" |
| | | }; |
| | | view.AddChidren(btnNoCollectionTip); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | deviceFunctionView.AddChidren(new Button { Height = Application.GetRealHeight(30) }); |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载功能控制卡片 |
| | | /// </summary> |
| | | void LoadDeviceFunctionDiv(FrameLayout view, Function function,Button btnBg) |
| | | { |
| | | try |
| | | { |
| | | Button btnIcon; |
| | | btnIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(24), |
| | | Width = Application.GetMinRealAverage(54), |
| | | Height = Application.GetMinRealAverage(54), |
| | | }; |
| | | view.AddChidren(btnIcon); |
| | | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_white.png"; |
| | | |
| | | Button btnName; |
| | | btnName = new Button() |
| | | { |
| | | Y = btnIcon.Bottom, |
| | | Text = function.name, |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Height = Application.GetRealWidth(24), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | view.AddChidren(btnName); |
| | | |
| | | |
| | | Button btnClick = new Button(); |
| | | view.AddChidren(btnClick); |
| | | btnClick.MouseUpEventHandler = (sender, e) => { |
| | | function.collect = !function.collect; |
| | | if (function.collect) |
| | | { |
| | | var pack = http.Set3tyIotFunctionToHouse(function.deviceId, DB_ResidenceData.Instance.CurrentRegion.id,brand_Iot.companyId); |
| | | if (pack != null) |
| | | { |
| | | if(pack.Code == StateCode.SUCCESS) |
| | | { |
| | | btnName.IsSelected = btnIcon.IsSelected = btnBg.IsSelected = true; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | btnName.IsSelected = btnIcon.IsSelected = btnBg.IsSelected = false; |
| | | var pack = http.Set3tyIotFunctionToHouse(function.deviceId, "0", brand_Iot.companyId); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | btnName.IsSelected = btnIcon.IsSelected = btnBg.IsSelected = false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | }; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("homepage LoadControlView error : " + ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | void NotListTipView() |
| | | { |
| | | contentView.RemoveAll(); |
| | | var btnTip = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(88), |
| | | Width = Application.GetRealWidth(180), |
| | | Height = Application.GetRealWidth(180), |
| | | UnSelectedImagePath = "TipNot.png", |
| | | }; |
| | | contentView.AddChidren(btnTip); |
| | | |
| | | var btnTipText = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(252), |
| | | Height = Application.GetRealHeight(52), |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.TipNotThirdPartyDevice, |
| | | }; |
| | | contentView.AddChidren(btnTipText); |
| | | |
| | | var btnAdd = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(400), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsBold = true, |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | Text = "查看设备支持范围" |
| | | }; |
| | | contentView.AddChidren(btnAdd); |
| | | btnAdd.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //var page = new AddThirdPartyBrandListpage(brandList); |
| | | //MainPage.BasePageView.AddChidren(page); |
| | | //page.LoadPage(); |
| | | //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | HttpServerRequest http = new HttpServerRequest(); |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 第三方品牌列表界面 |
| | | /// </summary> |
| | | public class Iot_BrandListPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | VerticalScrolViewLayout contentView;//VerticalRefreshLayout |
| | | |
| | | List<IntegratedBrand_Iot> brandList; |
| | | |
| | | public Iot_BrandListPage() |
| | | { |
| | | bodyView = this; |
| | | brandList = new List<IntegratedBrand_Iot>(); |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Bind3thIotAccount)).LoadTopView(CSS_Color.MainBackgroundColor); |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | bodyView.AddChidren(new Button |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | Button btnTipText = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(80), |
| | | Width = Application.GetRealWidth(347), |
| | | Height = Application.GetRealHeight(65), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealWidth(5), |
| | | BackgroundColor = 0x194484F4, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Padding = new Padding(12, Application.GetRealWidth(16), 12, Application.GetRealWidth(16)), |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = "通过绑定第三方平台账号寄哪里云端连接,将您在三方平台的设备同步到On Pro进行控制", |
| | | IsMoreLines = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | bodyView.AddChidren(btnTipText); |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(150), |
| | | Height = Application.GetRealHeight(573), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | |
| | | |
| | | |
| | | GetBindList(); |
| | | |
| | | //contentView.BeginHeaderRefreshingAction = () => |
| | | //{ |
| | | // contentView.EndHeaderRefreshing(); |
| | | // GetBindList(); |
| | | //}; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获取绑定列表 |
| | | /// </summary> |
| | | void GetBindList() |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var pack = pm.Get3tyIotBrandList(); |
| | | if (pack.Code == DAL.Server.StateCode.SUCCESS) |
| | | { |
| | | brandList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrand_Iot>>(pack.Data.ToString()); |
| | | if (brandList.Count > 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | LoadRow(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //NotListTipView(); |
| | | LoadRow(); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("2--::" + ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { waitPage.Hide(); }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | |
| | | void LoadRow() |
| | | { |
| | | contentView.RemoveAll(); |
| | | //brandList.Add(new IntegratedBrand_Iot |
| | | //{ |
| | | // authBrandNameCn = "Test Hdl", |
| | | // authBrandNameEn = "Test Hdl", |
| | | // hasAuthorization = false |
| | | //}); |
| | | |
| | | foreach (var brand in brandList) |
| | | { |
| | | var row = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(87), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | LineColor = 0x00000000, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(86), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | row.AddChidren(btnLine); |
| | | |
| | | ImageView btnIcon = new ImageView() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(47), |
| | | Height = Application.GetRealWidth(47), |
| | | Radius = (uint)Application.GetRealWidth(9), |
| | | BackgroundColor = CSS_Color.PromptingColor1 |
| | | }; |
| | | row.AddChidren(btnIcon); |
| | | |
| | | Button btnBindTip = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(326), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = brand.hasAuthorization ? StringId.Bound : StringId.Unbound, |
| | | }; |
| | | row.AddChidren(btnBindTip); |
| | | |
| | | |
| | | Button btnRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | row.AddChidren(btnRight); |
| | | |
| | | Button btnName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(83), |
| | | Width = Application.GetRealWidth(310), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = brand.authBrandNameCn, |
| | | }; |
| | | row.AddChidren(btnName); |
| | | //下载第三方品牌icon |
| | | ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.authrBandIconUrl, btnIcon); |
| | | |
| | | btnName.MouseUpEventHandler = (sender, e) => { |
| | | if (brand.hasAuthorization) |
| | | { |
| | | Action unboundAction = () => |
| | | { |
| | | brand.hasAuthorization = false; |
| | | btnBindTip.TextID = StringId.Unbound; |
| | | }; |
| | | var page = new Iot_BrandFunctionListPage(brand); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.unboundAction = unboundAction; |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | else |
| | | { |
| | | Action action = () => { |
| | | brand.hasAuthorization = true; |
| | | btnBindTip.TextID = StringId.Bound; |
| | | }; |
| | | Action action2 = () => { |
| | | brand.hasAuthorization = false; |
| | | btnBindTip.TextID = StringId.Unbound; |
| | | }; |
| | | var page = new iot_BindTipPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.boundAction = action; |
| | | page.unboundAction = action2; |
| | | page.LoadPage(brand); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | }; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 支持的第三方平台设备列表界面 |
| | | /// </summary> |
| | | public class Iot_SupportSpkListPage : FrameLayout |
| | | { |
| | | private FrameLayout bodyView; |
| | | |
| | | IntegratedBrand_Iot brand_Iot; |
| | | |
| | | public Iot_SupportSpkListPage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class iot_BindTipPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | /// <summary> |
| | | /// 解绑回调 |
| | | /// </summary> |
| | | public Action unboundAction; |
| | | /// <summary> |
| | | /// 绑定回调 |
| | | /// </summary> |
| | | public Action boundAction; |
| | | |
| | | public iot_BindTipPage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | |
| | | public void LoadPage(IntegratedBrand_Iot brand_Iot) |
| | | { |
| | | |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Bind3thIotAccount)).LoadTopView(CSS_Color.MainBackgroundColor); |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | Height = Application.GetRealHeight(667 - 124) |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | var btnIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(25), |
| | | Width = Application.GetRealWidth(106), |
| | | Height = Application.GetRealWidth(106), |
| | | UnSelectedImagePath = "Public/Logo.png", |
| | | }; |
| | | contentView.AddChidren(btnIcon); |
| | | |
| | | var btnTipTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(140), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(60), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 21, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | IsBold = true, |
| | | Text = "关于账号绑定的声明" |
| | | }; |
| | | contentView.AddChidren(btnTipTitle); |
| | | |
| | | var btnTipText = new Button() |
| | | { |
| | | Padding =new Padding(0, Application.GetRealWidth(16), 0, Application.GetRealWidth(16)), |
| | | Y = Application.GetRealHeight(140), |
| | | Height = Application.GetRealHeight(340), |
| | | IsMoreLines = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = $"账户绑定品牌:{brand_Iot.brandName} (以下简称第三方品牌)" + "\r\n" + "\r\n" + |
| | | "您绑定第三方品牌的账号后,将授权“On Pro”使用您在第三方账号,协同管理设备,On Pro也将自动同步您在第三方品牌中添加的设备。" + "\r\n" + "\r\n" + |
| | | |
| | | "为实现设备控制功能,本应用将从第三方中获取以下数据:" + "\r\n" + "\r\n" + |
| | | |
| | | "1.第三方品牌上添加的部分设备列表,用于在On Pro中进行智能化控制;" + "\r\n" + "\r\n" + |
| | | |
| | | "2.设备及网络信息,包括设备标志符、MAC地址、设备序列号,用于识别当前工作的设备以及进行设备控制功能。" + "\r\n" + "\r\n" + |
| | | |
| | | "如果您不同意我们收集以上信息,将无法管理第三方品牌的设备。" + "\r\n" + "\r\n" + |
| | | |
| | | "如需终止以上信息的收集与处理,您可以在“我的”> “绑定第三方账户”>“解除”" |
| | | }; |
| | | contentView.AddChidren(btnTipText); |
| | | |
| | | |
| | | var optionView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(667 - 80), |
| | | Height = Application.GetRealHeight(90), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(optionView); |
| | | |
| | | var btnCannel = new Button() |
| | | { |
| | | X = Application.GetRealWidth(17), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(164), |
| | | Height = Application.GetRealHeight(44), |
| | | BorderColor = CSS_Color.MainColor, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | BorderWidth = (uint)Application.GetRealWidth(1), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = "返回", |
| | | Radius = (uint)Application.GetRealHeight(22) |
| | | }; |
| | | optionView.AddChidren(btnCannel); |
| | | btnCannel.MouseUpEventHandler = (sender, e) => { |
| | | this.RemoveFromParent(); |
| | | }; |
| | | |
| | | |
| | | var btnComfirm = new Button() |
| | | { |
| | | X = Application.GetRealWidth(196), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(164), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | BackgroundColor= CSS_Color.MainColor, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = "同意授权", |
| | | Radius = (uint)Application.GetRealHeight(22) |
| | | }; |
| | | optionView.AddChidren(btnComfirm); |
| | | |
| | | |
| | | if (!brand_Iot.hasAuthorization) |
| | | { |
| | | btnComfirm.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | |
| | | Action action = () => { |
| | | brand_Iot.hasAuthorization = true; |
| | | boundAction?.Invoke(); |
| | | this.RemoveFromParent(); |
| | | var page = new Iot_BrandFunctionListPage(brand_Iot); |
| | | page.unboundAction = unboundAction; |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | var page = new Iot_AuthorizedPage(brand_Iot,action); |
| | | page.LoadView(); |
| | | |
| | | |
| | | |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | btnComfirm.Text = "解除授权"; |
| | | btnComfirm.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | |
| | | FrameLayout contentView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(305), |
| | | Height = Application.GetRealHeight(180), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | Radius = (uint)Application.GetMinRealAverage(10), |
| | | }; |
| | | dialog.AddChidren(contentView); |
| | | |
| | | Button btnMsg = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(70), |
| | | Y = Application.GetRealHeight(30), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Padding = new Padding(0,Application.GetRealWidth(16),0,Application.GetRealWidth(16)), |
| | | Text = "撤销授权后,该品牌关联在On Pro中的设备将全部被解绑,相关使用信息合设备值也将失效", |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg); |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(125), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS.CSS_Color.DividingLineColor, |
| | | }; |
| | | contentView.AddChidren(btnLine); |
| | | |
| | | Button btnConfirm = new Button() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Height = Application.GetRealHeight(55), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | Text = "确定撤回授权", |
| | | }; |
| | | btnConfirm.SetCornerWithSameRadius(Application.GetMinRealAverage(10), HDLUtils.RectCornerBottomLeft); |
| | | btnConfirm.SetCornerWithSameRadius(Application.GetMinRealAverage(10), HDLUtils.RectCornerBottomRight); |
| | | contentView.AddChidren(btnConfirm); |
| | | |
| | | dialog.Show(); |
| | | |
| | | btnConfirm.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | btnConfirm.IsSelected = true; |
| | | }; |
| | | btnConfirm.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var http = new HttpServerRequest(); |
| | | var waitPage = new Loading(); |
| | | this.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var pack = http.Unbound3tyIotAccount(brand_Iot.companyId); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnConfirm.IsSelected = false; |
| | | dialog.Close(); |
| | | this.RemoveFromParent(); |
| | | brand_Iot.hasAuthorization = false; |
| | | unboundAction?.Invoke(); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | dialog.Close(); |
| | | new Alert("", "操作失败", "").Show(); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | }); |
| | | |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | var btnHumidityIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(55), |
| | | X = Application.GetRealWidth(194), |
| | | Y = Application.GetRealHeight(101), |
| | | Width = Application.GetMinRealAverage(28), |
| | | Height = Application.GetMinRealAverage(28), |
| | |
| | | FrameWhiteCentet1.AddChidren(btnHumidityIcon); |
| | | btnHumidityValues = new TextButton() |
| | | { |
| | | X = Application.GetRealWidth(83), |
| | | X = Application.GetRealWidth(222), |
| | | Y = Application.GetRealHeight(96), |
| | | Height = Application.GetRealHeight(33), |
| | | Width = Application.GetRealWidth(100), |
| | |
| | | |
| | | Button btnTempIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(194), |
| | | X = Application.GetRealWidth(55), |
| | | Y = Application.GetRealHeight(101), |
| | | Width = Application.GetMinRealAverage(28), |
| | | Height = Application.GetMinRealAverage(28), |
| | |
| | | |
| | | btnTempValues = new TextButton() |
| | | { |
| | | X = Application.GetRealWidth(222), |
| | | X = Application.GetRealWidth(83), |
| | | Y = Application.GetRealHeight(96), |
| | | Height = Application.GetRealHeight(33), |
| | | Width = Application.GetRealWidth(100), |
| | |
| | | btnSuctionView.IsSelected = false; |
| | | } |
| | | } |
| | | |
| | | |
| | | else |
| | | { |
| | | temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.AlarmStatus); |
| | | if (temp.state == "true") |
| | | { |
| | | btnIcon.IsSelected = true; |
| | | btnSuctionView.TextID = StringId.InAlarming; |
| | | btnSuctionView.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.SensorNormalState; |
| | | btnSuctionView.IsSelected = false; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | echartsView.AddChidren(myEchartsView_Pie); |
| | | |
| | | Dictionary<string, string> list = new Dictionary<string, string>(); |
| | | |
| | | int count = 0; |
| | | foreach(var ene in energyList) |
| | | { |
| | | if (count > 10) |
| | | { |
| | | break; |
| | | } |
| | | double tt = 0; |
| | | double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out tt); |
| | | tt *= 100;//乘以100,小于1无法加载echart |
| | | tt = Math.Round(tt, 2); |
| | | if (list.ContainsKey(ene.name)) |
| | | string key = ene.name; |
| | | if (list.ContainsKey(key)) |
| | | { |
| | | list.Add(ene.name + "1", tt.ToString()); |
| | | list.Add(ene.name + DateTime.Now.ToLongTimeString(), tt.ToString()); |
| | | } |
| | | else |
| | | { |
| | | list.Add(ene.name, tt.ToString()); |
| | | } |
| | | count++; |
| | | } |
| | | myEchartsView_Pie.ShowWithOption(new EchartsOption_Pie().InitDateJson(list)); |
| | | |
| | |
| | | int index = 0; |
| | | foreach (var energy in energyList) |
| | | { |
| | | if (index > 10) |
| | | { |
| | | break; |
| | | } |
| | | EnergyRow(energy, energyListView, index); |
| | | index++; |
| | | new System.Threading.Thread(() => |
| | |
| | | double totalValue = 0; |
| | | double realtimeValue = 0; |
| | | Dictionary<string, string> list = new Dictionary<string, string>();//饼图数据 |
| | | int count = 0; |
| | | foreach (var ene in bodyView.energyList) |
| | | { |
| | | if (count > 10) |
| | | { |
| | | break; |
| | | } |
| | | count++; |
| | | double power = 0.00; |
| | | double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out power); |
| | | power = Math.Round(power, 2); |
| | |
| | | framePickerBack.Y = btnFromFoorAndRoom.Bottom + Application.GetRealHeight(1); |
| | | framePickerBack.Width = Application.GetMinRealAverage(216); |
| | | framePickerBack.Height = Application.GetMinRealAverage(216); |
| | | //framePickerBack.BackgroundColor = 0xFFFF0000; |
| | | controlView.AddChidren(framePickerBack); |
| | | |
| | | colorPicker = new ColorPicker() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | ColorImagePath = "FunctionIcon/Light/ColorWheel.png", |
| | | }; |
| | | framePickerBack.AddChidren(colorPicker); |
| | |
| | | //}; |
| | | |
| | | //白点控件 |
| | | this.btnWhiteRound = new Button(); |
| | | btnWhiteRound.Width = Application.GetRealWidth(24); |
| | | btnWhiteRound.Height = Application.GetRealWidth(24); |
| | | btnWhiteRound.UnSelectedImagePath = "FunctionIcon/Light/ColorWheelTip.png"; |
| | | var diameter = Application.GetRealWidth(12); |
| | | this.btnWhiteRound = new Button() |
| | | { |
| | | Width = diameter, |
| | | Height = diameter, |
| | | Radius = (uint)Application.GetRealWidth(6), |
| | | BorderWidth = (uint)Application.GetRealWidth(1), |
| | | BorderColor = CSS_Color.MainBackgroundColor, |
| | | Enable = false, |
| | | }; |
| | | //btnWhiteRound.UnSelectedImagePath = "FunctionIcon/Light/ColorWheelTip.png"; |
| | | btnWhiteRound.Visible = false; |
| | | framePickerBack.AddChidren(btnWhiteRound); |
| | | |
| | |
| | | //当前点击的【点】是否正确 |
| | | bool pointIsRight = false; |
| | | //圆的半径(考虑边界,需要设置它的半径比较小一点) |
| | | int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12); |
| | | int circleR = colorPicker.Width / 2 - Application.GetRealWidth(2); |
| | | |
| | | colorPicker.ColorChaged += (sender2, e2) => { |
| | | if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false) |
| | |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.Panel |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class PanelHelpPage : DeviceFunctionCardCommonForm |
| | | { |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </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";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |