From f71e74b5f0d2716fbf05da016cdaa18d64e09f80 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期四, 31 十二月 2020 17:01:18 +0800 Subject: [PATCH] 又换完成最新门锁。空气质量传感器完成数据和基本配置功能。开发图表和自动化的同事可下载此代码 --- ZigbeeApp/Shared/Phone/UserCenter/Safety/PasswordListUserForm.cs | 149 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 149 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/PasswordListUserForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/PasswordListUserForm.cs new file mode 100755 index 0000000..df9efb9 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/PasswordListUserForm.cs @@ -0,0 +1,149 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter.Safety +{ + /// <summary> + /// 鐢ㄦ埛瀵嗙爜鐨勫垪琛ㄧ晫闈� + /// </summary> + public class PasswordListUserForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uSafetyPassword)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + public void InitMiddleFrame() + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + HdlThreadLogic.Current.RunThread(async () => + { + //鎵撳紑杩涘害鏉� + this.ShowProgressBar(); + var listData = await HdlSafeguardLogic.Current.GetAllUserPassword(); + if (listData == null) + { + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(ShowReLoadMode.YES); + return; + } + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + + var dicEsixt = new Dictionary<int, ZigBee.Device.Safeguard.UserPasswordListObj>(); + foreach (var data in listData) + { + dicEsixt[data.UserId] = data; + } + + HdlThreadLogic.Current.RunMain(() => + { + var listView = new VerticalListControl(29); + listView.Y = Application.GetRealHeight(-6); + listView.Height = bodyFrameLayout.Height; + listView.BackgroundColor = UserCenterColor.Current.White; + bodyFrameLayout.AddChidren(listView); + + //4涓敤鎴峰瘑鐮� + for (int i = 1; i <= 4; i++) + { + //娣诲姞琛� + this.AddPassworRow(listView, dicEsixt, i); + } + listView.AdjustRealHeight(Application.GetRealHeight(23)); + }); + }); + } + + #endregion + + #region 鈻� 娣诲姞琛宊____________________________ + + /// <summary> + /// 娣诲姞琛� + /// </summary> + /// <param name="listView"></param> + /// <param name="dicEsixt"></param> + /// <param name="pswNo"></param> + private void AddPassworRow(VerticalListControl listView, Dictionary<int, ZigBee.Device.Safeguard.UserPasswordListObj> dicEsixt, int pswNo) + { + string text = Language.StringByID(R.MyInternationalizationString.uUserPassword) + pswNo; + if (dicEsixt.ContainsKey(pswNo) == true && string.IsNullOrEmpty(dicEsixt[pswNo].PassWordTips) == false) + { + text = dicEsixt[pswNo].PassWordTips; + } + + //娣诲姞銆愮敤鎴峰瘑鐮併�戣 + var rowUserPsw = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(rowUserPsw); + //鍥炬爣 + var btnUserPswIcon = rowUserPsw.AddLeftIcon(81); + btnUserPswIcon.UnSelectedImagePath = "Item/Point.png"; + //鐢ㄦ埛瀵嗙爜 + var btnUserPswText = rowUserPsw.AddLeftCaption(text, 700); + btnUserPswText.TextSize = 15; + //鍚戝彸鐨勫浘鏍� + rowUserPsw.AddRightArrow(); + if (dicEsixt.ContainsKey(pswNo) == false) + { + //鏈缃� + rowUserPsw.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNotHadSettion), 300); + } + if (pswNo != 4) + { + //搴曠嚎 + rowUserPsw.AddBottomLine(); + } + rowUserPsw.ButtonClickEvent += (sender, e) => + { + //鏂板缓 + if (dicEsixt.ContainsKey(pswNo) == false) + { + var form = new PasswordAddNewForm(); + form.AddForm(pswNo, text); + } + //缂栬緫 + else + { + var form = new PasswordUserEditorForm(); + form.AddForm(pswNo, dicEsixt[pswNo].Password, text); + } + }; + } + + #endregion + + #region 鈻� 鐣岄潰閲嶆柊婵�娲讳簨浠禵__________________ + + /// <summary> + /// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠� + /// </summary> + public override int FormActionAgainEvent() + { + //閲嶆柊鍒濆鍖� + this.InitMiddleFrame(); + return 1; + } + + #endregion + } +} -- Gitblit v1.8.0