| | |
| | | namespace Shared.Phone.UserCenter.DeviceBind |
| | | { |
| | | /// <summary> |
| | | /// 按键管理 |
| | | /// 普通面板的绑定界面【可绑定多个目标】 |
| | | /// </summary> |
| | | public class BindTargetsPage : BindCommonLayout |
| | | { |
| | |
| | | localDeviceList.Clear(); |
| | | scList.Clear(); |
| | | //获取本地设备列表 |
| | | foreach (var dev in Shared.Common.LocalDevice.Current.listAllDevice) |
| | | foreach (var dev in HdlDeviceCommonLogic.Current.listAllDevice) |
| | | { |
| | | localDeviceList.Add(dev); |
| | | } |
| | |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | midVerticalRefreshLayout.EndHeaderRefreshing(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5007" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | return; |
| | | }); |
| | | } |
| | |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | midVerticalRefreshLayout.EndHeaderRefreshing(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "108_ 6533" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | return; |
| | | } |
| | |
| | | } |
| | | if (isExistScene) |
| | | { |
| | | curSceneUI = HdlSceneLogic.Current.GetSceneUIBySceneId(bindDevice.BindScenesId);
|
| | | curSceneUI = HdlSceneLogic.Current.GetSceneUIBySceneId(bindDevice.BindScenesId); |
| | | devicePic.UnSelectedImagePath = "Scene/SceneIcon.png"; |
| | | if (curSceneUI == null) |
| | | { |
| | | if (string.IsNullOrEmpty(bindDevice.ESName)) |
| | | { |
| | | btnBindNameText = Language.StringByID(R.MyInternationalizationString.OffLineScene) + "_" + "ID" + "_" + bindDevice.BindScenesId.ToString(); |
| | | } |
| | | else |
| | | { |
| | | btnBindNameText = Language.StringByID(R.MyInternationalizationString.OffLineScene) + "_" + bindDevice.ESName; |
| | | } |
| | | btnBindNameText = Language.StringByID(R.MyInternationalizationString.OffLineScene) + "_" + "ID" + "_" + bindDevice.BindScenesId.ToString(); |
| | | } |
| | | else |
| | | { |
| | |
| | | btnFloorRoomNameText = tempDevFloorName + "," + tempDevRoomName; |
| | | } |
| | | } |
| | | }
|
| | |
|
| | | devicePic.UnSelectedImagePath = tempDev.IconPath;
|
| | | } |
| | | else |
| | | { |
| | | btnFloorRoomNameText = Language.StringByID(R.MyInternationalizationString.Undistributed); |
| | | } |
| | | |
| | | devicePic.UnSelectedImagePath = tempDev.IconPath; |
| | | devicePic.Text = ""; |
| | | |
| | | if (string.IsNullOrEmpty(tempDev.DeviceEpointName)) |
| | |
| | | rowLayout.frameTable.AddBottomLine(); |
| | | var btnDel = rowLayout.AddDeleteControl(); |
| | | btnDel.ButtonClickEvent += (sender, e) => |
| | | {
|
| | | RemoveTargets(bindDevice, btnDel);
|
| | | { |
| | | RemoveTargets(bindDevice, btnDel); |
| | | }; |
| | | #endregion |
| | | } |
| | |
| | | btnDel.ButtonClickEvent += async (sender, e) => |
| | | { |
| | | string msg = Language.StringByID(R.MyInternationalizationString.ClearAllTargets).Replace("{0}", "\r\n"); |
| | | var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm)); |
| | | var alert = new ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm)); |
| | | alert.Show(); |
| | | //使用确认型弹框时,的回调函数 |
| | | alert.ConfirmClickEvent += () => |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5006" + ")", Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); |
| | | }); |
| | | } |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "0003" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | dialog.Close(); |
| | |
| | | /// <param name="btnDel"></param> |
| | | /// <returns></returns> |
| | | private int RemoveTargets(BindListResponseObj bindDevice, Button btnDel) |
| | | {
|
| | | { |
| | | int result = -1; |
| | | var delDevice = new DelDeviceBindData(); |
| | | delDevice.DeviceAddr = currentKey.DeviceAddr; |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5003" + ")", Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); |
| | | }); |
| | | } |
| | | } |