| | |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="doorLock"></param> |
| | | public AddUnLockMethod(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj) |
| | | public AddUnLockMethod(ZigBee.Device.DoorLock doorLock, MemberInfoRes accountObj) |
| | | { |
| | | this.doorLock = doorLock; |
| | | this.curAccountObj = accountObj; |
| | |
| | | /// <summary> |
| | | /// 当前账户 |
| | | /// </summary> |
| | | Shared.Phone.UserCenter.MemberInfoRes curAccountObj; |
| | | MemberInfoRes curAccountObj; |
| | | #endregion |
| | | |
| | | /// <summary>
|
| | |
| | | |
| | | MidFrameLayoutContent(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 中部布局 |
| | | /// </summary> |
| | |
| | | }; |
| | | this.midFrameLayout.AddChidren(bodyView); |
| | | |
| | | int count = GetSupportType(doorLock); |
| | | for (int i = 0; i < count; i++) |
| | | for (int i = 0; i < 3; i++) |
| | | { |
| | | var RowView = new FrameLayout() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | Gravity = Gravity.CenterVertical, |
| | | TextSize = 14, |
| | | TextSize=14, |
| | | }; |
| | | RowView.AddChidren(btnText); |
| | | |
| | |
| | | }; |
| | | RowView.AddChidren(line2); |
| | | |
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(doorLock.DeviceAddr); |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice); |
| | | if (i == 0) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddPassword; |
| | | } |
| | | else if (i == 1) |
| | | { |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1F) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddDoorLockCalmFingerprint; |
| | | } |
| | | else if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_HAT1B) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddDoorLockCalmFingerprint; |
| | | } |
| | | else |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddFingerprint; |
| | | } |
| | | btnText.TextID = R.MyInternationalizationString.AddFingerprint; |
| | | } |
| | | else if (i == 2) |
| | | { |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1F) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddDoorLockFaceID; |
| | | } |
| | | else if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1TF) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddIcCard; |
| | | } |
| | | else |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddIcCard; |
| | | } |
| | | } |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1TF) |
| | | { |
| | | if (i == 3) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddDoorLockFaceID; |
| | | } |
| | | } |
| | | if (i == count - 1) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddIcCard; |
| | | line2.Visible = false; |
| | | } |
| | | |
| | | int currentIndex = i; |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | string unlockTypeStr = ""; |
| | | if (currentIndex == 0) |
| | | { |
| | | unlockTypeStr = "password"; |
| | | var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "password"); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethodTip.Show(); |
| | | } |
| | | else if (currentIndex == 1) |
| | | { |
| | | unlockTypeStr = "fingerprint"; |
| | | var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "fingerprint"); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethodTip.Show(); |
| | | } |
| | | else if (currentIndex == 2) |
| | | { |
| | | unlockTypeStr = "proximity"; |
| | | var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "proximity"); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethodTip.Show(); |
| | | } |
| | | else if (currentIndex == 3) |
| | | { |
| | | unlockTypeStr = "faceID"; |
| | | } |
| | | else if (currentIndex == 4) |
| | | { |
| | | unlockTypeStr = "calmFingerprint"; |
| | | } |
| | | var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, unlockTypeStr); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethodTip.Show(); |
| | | }; |
| | | btnRight.MouseUpEventHandler += eHandler; |
| | | RowView.MouseUpEventHandler += eHandler; |