From 404cdc88627f942df7944af04ee05b9d527752d6 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 30 九月 2019 13:22:40 +0800 Subject: [PATCH] 合并了徐梅的按键面板绑定 --- ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePasswordMainForm.cs | 295 ++++++++++++++++++++++++++++++---------------------------- 1 files changed, 154 insertions(+), 141 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePasswordMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePasswordMainForm.cs index 82a6564..9cb20de 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePasswordMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePasswordMainForm.cs @@ -7,152 +7,165 @@ /// <summary> /// 鑳佽揩瀵嗙爜璁剧疆鐨勮彍鍗曠晫闈⑩槄 /// </summary> - public class CoercePasswordMainForm : UserCenterCommonForm + public class CoercePasswordMainForm : EditorCommonForm { - /// <summary> - /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) - /// </summary> - public void ShowForm() - { - //璁剧疆澶撮儴淇℃伅 - base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uCoercePasswordSettion)); - - //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(); - } - - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - public void InitMiddleFrame() - { - bodyFrameLayout.RemoveAll(); - - //瀵嗙爜璁剧疆 - string text = Language.StringByID(R.MyInternationalizationString.uPasswordSettion); - var rowPsw = new OnlyCenterViewRow(text); - //灏嗗浘鏍囨帶浠堕�傞厤涓恒�愮偣鍙枫�戞帶浠� - rowPsw.ChangedIconInPointMode(); - bodyFrameLayout.AddChidren(rowPsw); - rowPsw.InitControl(); - //鐐瑰彿鍥剧墖鏈夌偣鐗规畩锛岄渶瑕佽皟鏁村亸绉婚噺 - rowPsw.btnName.X -= ControlCommonResourse.PointXXLeft; - - //娣诲姞鍚戝彸鐨勫浘鏍� - rowPsw.AddRightIconControl(); - //鐘舵�� - var btnStatuPsw = new RowSecondRightTextView(); - rowPsw.AddChidren(btnStatuPsw); - - rowPsw.MouseUpEvent += (sender, e) => - { - var form = new EdtiorCoercePasswordForm(); - this.AddForm(form, btnStatuPsw.TextColor != UserCenterColor.Current.Green); - }; - - //鑱旂郴浜鸿缃� - text = Language.StringByID(R.MyInternationalizationString.uContactSettion); - var rowContact = new OnlyCenterViewRow(text); - rowContact.Y = rowPsw.Bottom; - //灏嗗浘鏍囨帶浠堕�傞厤涓恒�愮偣鍙枫�戞帶浠� - rowContact.ChangedIconInPointMode(); - bodyFrameLayout.AddChidren(rowContact); - rowContact.InitControl(); - //鐐瑰彿鍥剧墖鏈夌偣鐗规畩锛岄渶瑕佽皟鏁村亸绉婚噺 - rowContact.btnName.X -= ControlCommonResourse.PointXXLeft; - - //娣诲姞鍚戝彸鐨勫浘鏍� - rowContact.AddRightIconControl(); - //鐘舵�� - var btnStaturowContact = new RowSecondRightTextView(); - rowContact.AddChidren(btnStaturowContact); - - rowContact.MouseUpEvent += (sender, e) => - { - var form = new CoerceContactSettionForm(); - this.AddForm(form, btnStaturowContact.Tag); - }; - - //璁剧疆琛岀殑鐘舵�� - this.SetRowStatu(btnStatuPsw, btnStaturowContact); - } - /// <summary> - /// 璁剧疆琛岀殑鐘舵�� + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) /// </summary> - /// <param name="btnStatuPsw"></param> - /// <param name="btnStaturowContact"></param> - private async void SetRowStatu(RowSecondRightTextView btnStatuPsw, RowSecondRightTextView btnStaturowContact) + public void ShowForm() { - //寮�鍚繘搴︽潯 - this.ShowProgressBar(); + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uCoercePasswordSettion)); - //鍒ゆ柇鏄惁璁剧疆鏈夎儊杩瘑鐮� - var listData = await Common.LocalSafeguard.Current.GetAllUserPassword(); - bool isEsixt = false; - if (listData != null) - { - foreach (var data in listData) - { - if (data.UserId == 5) - { - isEsixt = true; - break; - } - } - } - else - { - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(ShowReLoadMode.YES); - return; - } - - if (isEsixt == true) - { - Application.RunOnMainThread(() => - { - //宸茶缃� - btnStatuPsw.TextID = R.MyInternationalizationString.uAlreadySettion; - btnStatuPsw.TextColor = UserCenterColor.Current.Green; - }); - } - else - { - Application.RunOnMainThread(() => - { - //鏈缃� - btnStatuPsw.TextID = R.MyInternationalizationString.uNotHadSettion; - btnStatuPsw.TextColor = UserCenterColor.Current.Gray; - }); - } - - //鑾峰彇鑱旂郴鏂瑰紡 - var result = await Common.LocalSafeguard.Current.GetCoercePhoneNumber(); - if (result == null || result.Actions.Count == 0 || result.Actions[0].PushTarget.Count == 0) - { - Application.RunOnMainThread(() => - { - //鏈缃� - btnStaturowContact.TextID = R.MyInternationalizationString.uNotHadSettion; - btnStaturowContact.TextColor = UserCenterColor.Current.Gray; - var data = new List<ZigBee.Device.Safeguard.PushTargetInfo>(); - btnStaturowContact.Tag = data; - }); - } - else - { - Application.RunOnMainThread(() => - { - //宸茶缃� - btnStaturowContact.TextID = R.MyInternationalizationString.uAlreadySettion; - btnStaturowContact.TextColor = UserCenterColor.Current.Green; - btnStaturowContact.Tag = result.Actions[0].PushTarget; - }); - } - - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); + //鍒濆鍖栦腑閮ㄤ俊鎭� + //this.InitMiddleFrame(); } + + ///// <summary> + ///// 鍒濆鍖栦腑閮ㄤ俊鎭� + ///// </summary> + //public void InitMiddleFrame() + //{ + // //娓呯┖bodyFrame + // this.ClearBodyFrame(); + + // //瀵嗙爜璁剧疆 + // string text = Language.StringByID(R.MyInternationalizationString.uPasswordSettion); + // var rowPsw = new OnlyCenterViewRow(text); + // //灏嗗浘鏍囨帶浠堕�傞厤涓恒�愮偣鍙枫�戞帶浠� + // rowPsw.ChangedIconInPointMode(); + // bodyFrameLayout.AddChidren(rowPsw); + // rowPsw.InitControl(); + // //鐐瑰彿鍥剧墖鏈夌偣鐗规畩锛岄渶瑕佽皟鏁村亸绉婚噺 + // rowPsw.btnName.X -= ControlCommonResourse.PointXXLeft; + + // //娣诲姞鍚戝彸鐨勫浘鏍� + // rowPsw.AddRightArrow(); + // //鐘舵�� + // var btnStatuPsw = new RowSecondRightTextView(); + // rowPsw.AddChidren(btnStatuPsw); + + // rowPsw.MouseUpEvent += (sender, e) => + // { + // var form = new EdtiorCoercePasswordForm(); + // form.AddForm(btnStatuPsw.TextColor != UserCenterColor.Current.Green); + // }; + + // //鑱旂郴浜鸿缃� + // text = Language.StringByID(R.MyInternationalizationString.uContactSettion); + // var rowContact = new OnlyCenterViewRow(text); + // rowContact.Y = rowPsw.Bottom; + // //灏嗗浘鏍囨帶浠堕�傞厤涓恒�愮偣鍙枫�戞帶浠� + // rowContact.ChangedIconInPointMode(); + // bodyFrameLayout.AddChidren(rowContact); + // rowContact.InitControl(); + // //鐐瑰彿鍥剧墖鏈夌偣鐗规畩锛岄渶瑕佽皟鏁村亸绉婚噺 + // rowContact.btnName.X -= ControlCommonResourse.PointXXLeft; + + // //娣诲姞鍚戝彸鐨勫浘鏍� + // rowContact.AddRightArrow(); + // //鐘舵�� + // var btnStaturowContact = new RowSecondRightTextView(); + // rowContact.AddChidren(btnStaturowContact); + + // rowContact.MouseUpEvent += (sender, e) => + // { + // var form = new CoerceContactSettionForm(); + // form.AddForm(btnStaturowContact.Tag); + // }; + + // //璁剧疆琛岀殑鐘舵�� + // this.SetRowStatu(btnStatuPsw, btnStaturowContact); + //} + + ///// <summary> + ///// 璁剧疆琛岀殑鐘舵�� + ///// </summary> + ///// <param name="btnStatuPsw"></param> + ///// <param name="btnStaturowContact"></param> + //private async void SetRowStatu(RowSecondRightTextView btnStatuPsw, RowSecondRightTextView btnStaturowContact) + //{ + // //寮�鍚繘搴︽潯 + // this.ShowProgressBar(); + + // //鍒ゆ柇鏄惁璁剧疆鏈夎儊杩瘑鐮� + // var listData = await Common.LocalSafeguard.Current.GetAllUserPassword(); + // bool isEsixt = false; + // if (listData != null) + // { + // foreach (var data in listData) + // { + // if (data.UserId == 5) + // { + // isEsixt = true; + // break; + // } + // } + // } + // else + // { + // //鍏抽棴杩涘害鏉� + // this.CloseProgressBar(ShowReLoadMode.YES); + // return; + // } + + // if (isEsixt == true) + // { + // Application.RunOnMainThread(() => + // { + // if (btnStatuPsw != null) + // { + // //宸茶缃� + // btnStatuPsw.TextID = R.MyInternationalizationString.uAlreadySettion; + // btnStatuPsw.TextColor = UserCenterColor.Current.Green; + // } + // }); + // } + // else + // { + // Application.RunOnMainThread(() => + // { + // if (btnStatuPsw != null) + // { + // //鏈缃� + // btnStatuPsw.TextID = R.MyInternationalizationString.uNotHadSettion; + // btnStatuPsw.TextColor = UserCenterColor.Current.Gray; + // } + // }); + // } + + // //鑾峰彇鑱旂郴鏂瑰紡 + // var result = await Common.LocalSafeguard.Current.GetCoercePhoneNumber(); + // if (result == null || result.Actions.Count == 0 || result.Actions[0].PushTarget.Count == 0) + // { + // Application.RunOnMainThread(() => + // { + // if (btnStaturowContact != null) + // { + // //鏈缃� + // btnStaturowContact.TextID = R.MyInternationalizationString.uNotHadSettion; + // btnStaturowContact.TextColor = UserCenterColor.Current.Gray; + // var data = new List<ZigBee.Device.Safeguard.PushTargetInfo>(); + // btnStaturowContact.Tag = data; + // } + // }); + // } + // else + // { + // Application.RunOnMainThread(() => + // { + // if (btnStaturowContact != null) + // { + // //宸茶缃� + // btnStaturowContact.TextID = R.MyInternationalizationString.uAlreadySettion; + // btnStaturowContact.TextColor = UserCenterColor.Current.Green; + // btnStaturowContact.Tag = result.Actions[0].PushTarget; + // } + // }); + // } + + // //鍏抽棴杩涘害鏉� + // this.CloseProgressBar(); + //} } } -- Gitblit v1.8.0