From eb76239882830f3960b8800bb0f2c90ca7b3f378 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 04 八月 2022 09:19:10 +0800
Subject: [PATCH] Merge branch 'release0123'

---
 HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/iot_BindTipPage.cs |  279 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 279 insertions(+), 0 deletions(-)

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..601da76
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/iot_BindTipPage.cs
@@ -0,0 +1,279 @@
+锘縰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) =>
+                {
+
+                    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 = "瑙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();
+                                        });
+                                    }
+                                }
+                                else
+                                {
+                                    dialog.Close();
+                                    new Alert("", "鎿嶄綔澶辫触", "").Show();
+                                }
+                            }
+                            catch { }
+                            finally
+                            {
+                                Application.RunOnMainThread(() => {
+                                    waitPage.Hide();
+                                    waitPage.RemoveFromParent();
+                                });
+
+                            }
+                        })
+                        { IsBackground = true }.Start();
+                    };
+
+                };
+            }
+
+
+
+
+
+        }
+    }
+}
\ No newline at end of file

--
Gitblit v1.8.0