From da40946e8cf2ffb41157f5c388c525ccccaca692 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 29 七月 2022 15:44:58 +0800
Subject: [PATCH] 备份
---
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs | 43 +
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_AuthorizedPage.cs | 44 ++
HDL-ON_Android/Assets/Phone/Public/Iot_agreement_icon.png | 0
HDL-ON_Android/Properties/AndroidManifest.xml | 2
HDL-ON_Android/Assets/Language.ini | 9
HDL_ON/Entity/Integratedbrand/IntegratedBrand.cs | 60 +++
HDL-ON_iOS/HDL-ON_iOS.csproj | 3
HDL_ON/Common/ApiUtlis.cs | 1
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs | 1
HDL-ON_Android/Assets/Phone/Public/LinkIotIcon.png | 0
HDL_ON/DAL/Mqtt/MqttClient.cs | 30 +
HDL_ON/HDL_ON.projitems | 4
HDL_ON/UI/UI0-Public/TopViewDiv.cs | 65 +-
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandListPage.cs | 251 +++++++++++++
HDL-ON_Android/HDL-ON_Android.csproj | 2
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandFunctionListPage.cs | 250 +++++++++++++
HDL_ON/DAL/Server/NewAPI.cs | 20 +
HDL-ON_iOS/Resources/Phone/Public/Iot_agreement_icon.png | 0
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/iot_BindTipPage.cs | 265 +++++++++++++
HDL_ON/Common/R.cs | 8
HDL_ON/DAL/Server/HttpServerRequest.cs | 73 +++
HDL_ON/DAL/DriverLayer/Control.cs | 8
22 files changed, 1,079 insertions(+), 60 deletions(-)
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index c4deb26..18e26c5 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -544,6 +544,8 @@
556=Someone is running
557=Someone is standing
558=Someone is sitting
+559=Bind a third-party account
+560=Bound
@@ -1747,6 +1749,8 @@
556=鏈変汉鍦ㄨ窇
557=鏈変汉绔欑潃
558=鏈変汉鍧愮潃
+559=缁戝畾绗笁鏂硅处鍙�
+560=宸茬粦瀹�
@@ -2929,6 +2933,8 @@
556=Someone is running
557=Someone is standing
558=Someone is sitting
+559=Bind a third-party account
+560=Bound
2532=Visitor Invitation Record
@@ -4122,6 +4128,9 @@
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
diff --git a/HDL-ON_Android/Assets/Phone/Public/Iot_agreement_icon.png b/HDL-ON_Android/Assets/Phone/Public/Iot_agreement_icon.png
new file mode 100644
index 0000000..a2c5b96
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/Public/Iot_agreement_icon.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/Public/LinkIotIcon.png b/HDL-ON_Android/Assets/Phone/Public/LinkIotIcon.png
new file mode 100644
index 0000000..eb33281
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/Public/LinkIotIcon.png
Binary files differ
diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj
index 5bf954c..b8f8906 100644
--- a/HDL-ON_Android/HDL-ON_Android.csproj
+++ b/HDL-ON_Android/HDL-ON_Android.csproj
@@ -258,6 +258,8 @@
<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" />
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index b353484..0af7d69 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
锘�<?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="202207251">
+<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="202207291">
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
<!--鍙嬬洘-->
<!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj
index b40f28c..f197eec 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1418,8 +1418,7 @@
<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" />
diff --git a/HDL-ON_iOS/Resources/Phone/Public/Iot_agreement_icon.png b/HDL-ON_iOS/Resources/Phone/Public/Iot_agreement_icon.png
new file mode 100644
index 0000000..a2c5b96
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/Public/Iot_agreement_icon.png
Binary files differ
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 544f3d8..c618e15 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -480,6 +480,7 @@
FileUtlis.Files.DeleteFile(file);
}
}
+ FunctionList.List.securities.Clear();
foreach (var function in infoList)
{
function.SaveFile();
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 115ea7f..9cf7833 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -5,6 +5,14 @@
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;
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 08092a6..e93e6a7 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -1044,11 +1044,15 @@
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;
}
}
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index f5abbf2..b0c260f 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -515,12 +515,30 @@
//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 (Control.Ins.GatewayOnline_Local)//鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�
+ {
+ if (FunctionList.List.OtherBrandFunction.Count == 0)
+ {
+ MainPage.Log($"A鍗忚鏇存柊鐘舵��:鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�...");
+ return;
+ }
+ else
+ {
+ 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;
+ //}
+ }
+ }
+
+
}
//涓�绔彛鏁版嵁瑙f瀽
else
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 242ae06..02d3aaf 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -2623,6 +2623,79 @@
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 Set3tyIotFunctionToHouse(string deviceId,string homeId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("deviceId", deviceId);
+ d.Add("homeId", homeId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Setting3tyIotFunctionToHouse, requestJson);
+ return pack;
+ }
+
+ /// <summary>
+ /// 瑙g粦绗笁鏂瑰钩鍙拌处鍙�
+ /// </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>
diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs
index 6e52668..e153373 100644
--- a/HDL_ON/DAL/Server/NewAPI.cs
+++ b/HDL_ON/DAL/Server/NewAPI.cs
@@ -609,6 +609,26 @@
/// 鑾峰彇鍝佺墝鍒楄〃
/// </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>
+ /// 鍙戠幇绗笁鏂筰ot骞冲彴璁惧
+ /// </summary>
+ public const string Api_Post_Search3tyIotDevice = "/home-wisdom/app/open/discoveryDevice";
+ /// <summary>
+ /// 鑾峰彇绗笁鏂筰ot骞冲彴璁惧鍔熻兘鍒楄〃
+ /// </summary>
+ public const string Api_Post_Get3tyIotFunction = "/home-wisdom/app/open/discoveryDevice";
+ /// <summary>
+ /// 閰嶇疆绗笁鏂筰ot骞冲彴璁惧鍔熻兘鍒颁綇瀹�
+ /// </summary>
+ public const string Api_Post_Setting3tyIotFunctionToHouse = "/home-wisdom/app/open/assignDeviceToHouse";
+ /// <summary>
+ /// 瑙g粦绗笁鏂筰ot骞冲彴璐﹀彿
+ /// </summary>
+ public const string Api_Post_Unbound3tyIotAccount = "/open-platform/tripartite/userUnbind";
#region 鈻� -- 绾㈠瀹濇帴鍙__________________________
/// <summary>
diff --git a/HDL_ON/Entity/Integratedbrand/IntegratedBrand.cs b/HDL_ON/Entity/Integratedbrand/IntegratedBrand.cs
index b4f5d8b..a430895 100644
--- a/HDL_ON/Entity/Integratedbrand/IntegratedBrand.cs
+++ b/HDL_ON/Entity/Integratedbrand/IntegratedBrand.cs
@@ -28,6 +28,66 @@
/// </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;
+ }
/// <summary>
/// 绗笁鏂硅澶囦俊鎭�
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index f2da282..a40633a 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -507,6 +507,10 @@
<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" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
index e20fdc3..63e8ba3 100644
--- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs
+++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -79,12 +79,12 @@
/// </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);
@@ -334,9 +334,9 @@
/// </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()
{
@@ -344,39 +344,40 @@
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>
+ /// 鍚慺ramelayout娣诲姞椤堕儴鍖哄煙,绗笁鏂瑰钩鍙�
+ /// </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();
};
}
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs
index b9406c7..55b8dc9 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs
@@ -26,13 +26,20 @@
};
- 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);
@@ -102,22 +109,23 @@
{
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,
};
@@ -128,9 +136,9 @@
{
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);
@@ -146,11 +154,11 @@
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);
@@ -158,6 +166,7 @@
ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.brandIcon, btnIcon);
btnName.MouseUpEventHandler = (sender, e) => {
+
var page = new DeviceListPage(brand);
MainPage.BasePageView.AddChidren(page);
page.LoadPage();
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_AuthorizedPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_AuthorizedPage.cs
new file mode 100644
index 0000000..366aa1d
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_AuthorizedPage.cs
@@ -0,0 +1,44 @@
+锘縰sing 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;
+
+ public Iot_AuthorizedPage(IntegratedBrand_Iot brand)
+ {
+ brand_Iot = brand;
+ }
+
+ /// <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)
+ {
+
+ }
+ }
+
+ }
+}
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandFunctionListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandFunctionListPage.cs
new file mode 100644
index 0000000..986a5d1
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandFunctionListPage.cs
@@ -0,0 +1,250 @@
+锘縰sing 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;
+
+
+ IntegratedBrand_Iot brand_Iot;
+ /// <summary>
+ /// 瑙g粦鍥炶皟
+ /// </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, "鍝佺墝鍚嶇О").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);
+
+ var contentView = new VerticalRefreshLayout()
+ {
+ Y = Application.GetRealHeight(150),
+ Height = Application.GetRealHeight(573),
+ };
+ bodyView.AddChidren(contentView);
+
+ LoadDeviceFunctionControlZone(contentView);
+
+
+
+ }
+
+
+ /// <summary>
+ /// 鍔犺浇璁惧鍔熻兘鏄剧ず鍖哄煙
+ /// </summary>
+ void LoadDeviceFunctionControlZone(VerticalRefreshLayout deviceFunctionView)
+ {
+ #region ContextView
+ var rowView = new FrameLayout();
+ try
+ {
+ int index = 0;
+ var list = new List<Function>();
+ list.Add(new Function
+ {
+ spk = SPK.AcStandard,
+ name = "绌鸿皟"
+ });
+ list.Add(new Function
+ {
+ spk = SPK.LightDimming,
+ name = "鐏厜"
+ });
+ foreach (var function in list)
+ {
+ 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 btnNoCollectionBg = new Button()
+ {
+ Y = Application.GetRealHeight(20),
+ Gravity = Gravity.CenterHorizontal,
+ Width = Application.GetRealWidth(180),
+ Height = Application.GetRealWidth(180),
+ Text = "娌℃湁浠讳綍璁惧"
+ };
+ view.AddChidren(btnNoCollectionBg);
+
+ var btnNoCollectionTip = new Button()
+ {
+ Height = Application.GetRealHeight(42),
+ Y = btnNoCollectionBg.Bottom,
+ TextAlignment = TextAlignment.Center,
+ TextColor = CSS_Color.PromptingColor1,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ TextID = StringId.TipNoFunctionCollcetion,
+ };
+ 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)
+ {
+ btnName.IsSelected = btnIcon.IsSelected = btnBg.IsSelected = true;
+ var pack = http.Set3tyIotFunctionToHouse(function.deviceId, DB_ResidenceData.Instance.CurrentRegion.id);
+ if (pack != null)
+ {
+
+ }
+ }
+ else
+ {
+ btnName.IsSelected = btnIcon.IsSelected = btnBg.IsSelected = false;
+ var pack = http.Set3tyIotFunctionToHouse(function.deviceId, "0");
+ if (pack != null)
+ {
+
+ }
+ }
+
+ };
+
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log("homepage LoadControlView error : " + ex.Message);
+ }
+ }
+
+
+
+ HttpServerRequest http = new HttpServerRequest();
+
+
+ }
+}
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandListPage.cs
new file mode 100644
index 0000000..f1091a7
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/Iot_BrandListPage.cs
@@ -0,0 +1,251 @@
+锘縰sing 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;
+
+ VerticalRefreshLayout contentView;
+
+ 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 VerticalRefreshLayout()
+ {
+ Y = Application.GetRealHeight(150),
+ Height = Application.GetRealHeight(573),
+ };
+ bodyView.AddChidren(contentView);
+
+
+
+
+ GetBindList();
+
+ contentView.BeginHeaderRefreshingAction = () =>
+ {
+ contentView.EndHeaderRefreshing();
+ GetBindList();
+ };
+
+ LoadRow();
+
+
+ }
+ /// <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();
+ bool isFrist = true;
+
+ 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);
+
+ //if (isFrist)
+ //{
+ // isFrist = false;
+ //}
+ //else
+ {
+ 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);
+ //涓嬭浇绗笁鏂瑰搧鐗宨con
+ //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;
+ }
+ };
+ }
+
+ }
+
+ }
+}
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/iot_BindTipPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/iot_BindTipPage.cs
new file mode 100644
index 0000000..668e511
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/iot_BindTipPage.cs
@@ -0,0 +1,265 @@
+锘縰sing 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>
+ /// 瑙g粦鍥炶皟
+ /// </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 = "鍏充簬璐﹀彿缁戝畾鐨勫0鏄�"
+ };
+ 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" +
+"鎮ㄧ粦瀹氱涓夋柟鍝佺墝鐨勮处鍙峰悗锛屽皢鎺堟潈鈥淥n Pro鈥濅娇鐢ㄦ偍鍦ㄧ涓夋柟璐﹀彿锛屽崗鍚岀鐞嗚澶囷紝On Pro涔熷皢鑷姩鍚屾鎮ㄥ湪绗笁鏂瑰搧鐗屼腑娣诲姞鐨勮澶囥��" + "\r\n" + "\r\n" +
+
+"涓哄疄鐜拌澶囨帶鍒跺姛鑳斤紝鏈簲鐢ㄥ皢浠庣涓夋柟涓幏鍙栦互涓嬫暟鎹細" + "\r\n" + "\r\n" +
+
+"1.绗笁鏂瑰搧鐗屼笂娣诲姞鐨勯儴鍒嗚澶囧垪琛紝鐢ㄤ簬鍦∣n Pro涓繘琛屾櫤鑳藉寲鎺у埗锛�" + "\r\n" + "\r\n" +
+
+"2.璁惧鍙婄綉缁滀俊鎭紝鍖呮嫭璁惧鏍囧織绗︺�丮AC鍦板潃銆佽澶囧簭鍒楀彿锛岀敤浜庤瘑鍒綋鍓嶅伐浣滅殑璁惧浠ュ強杩涜璁惧鎺у埗鍔熻兘銆�" + "\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) =>
+ {
+ 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;
+ };
+ }
+ else
+ {
+ btnComfirm.Text = "瑙i櫎鎺堟潈";
+ 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涓殑璁惧灏嗗叏閮ㄨ瑙g粦锛岀浉鍏充娇鐢ㄤ俊鎭悎璁惧鍊间篃灏嗗け鏁�",
+ 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();
+ });
+ }
+ }
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() => {
+ waitPage.Hide();
+ waitPage.RemoveFromParent();
+ });
+
+ }
+ })
+ { IsBackground = true }.Start();
+ };
+
+ };
+ }
+
+
+
+
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
index 84f44bd..8c6bab8 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
@@ -161,6 +161,7 @@
colorPicker = new ColorPicker()
{
+ Gravity = Gravity.Center,
ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
};
framePickerBack.AddChidren(colorPicker);
--
Gitblit v1.8.0