Merge branch 'CJL' into NewFilePath
| | |
| | | 9059=暂无分享 |
| | | 9060=使用权限 |
| | | 9061=请通过忘记密码找回密码或次日0点后再登陆. |
| | | 9062=查看 |
| | | |
| | | 10000=无效登录密钥,请重新登录! |
| | | 10001=请求服务器失败,请稍后再试! |
| | |
| | | 9059=暂无分享 |
| | | 9060=使用权限 |
| | | 9061=请通过忘记密码找回密码或次日0点后再登陆. |
| | | 9062=查看 |
| | | |
| | | 10000=无效登录密钥,请重新登录! |
| | | 10001=请求服务器失败,请稍后再试! |
| | |
| | | { |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | GetPushMessageAction?.Invoke(); |
| | | //报警推送才弹窗提示(messageType包含Alarm关键字的) |
| | | if (jpushMessageInfo.messageType != null && jpushMessageInfo.messageType.Contains("Alarm")) |
| | | { |
| | | new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show(); |
| | | //报警推送弹窗提示 |
| | | ShowAlarmPushMessage(jpushMessageInfo); |
| | | //new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show(); |
| | | } |
| | | GetPushMessageAction?.Invoke(); |
| | | |
| | | }); |
| | | return; |
| | | } |
| | |
| | | } |
| | | }).Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | ConfirmDialog alarmPushConfirmDialog; |
| | | /// <summary> |
| | | /// 报警推送弹窗提示,点击查看跳转信息中心 |
| | | /// </summary> |
| | | /// <param name="jpushMessageInfo"></param> |
| | | public void ShowAlarmPushMessage(JPushMessageInfo jpushMessageInfo) |
| | | { |
| | | //没登录不处理 |
| | | if (UserInfo.Current == null || !UserInfo.Current.IsLogin || MainPage.BasePageView == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //跳转信息中心页面 |
| | | Action goAction = () => |
| | | { |
| | | //Dialog |
| | | alarmPushConfirmDialog = null; |
| | | Action backAction = () => { |
| | | |
| | | }; |
| | | var skipPage = new MessageCenterPage(); |
| | | MainPage.BasePageView.AddChidren(skipPage); |
| | | skipPage.LoadPage(backAction); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | //取消事件 |
| | | Action cancelAction = () => |
| | | { |
| | | alarmPushConfirmDialog = null; |
| | | }; |
| | | |
| | | //防止多次弹窗处理 |
| | | if (alarmPushConfirmDialog == null) |
| | | { |
| | | alarmPushConfirmDialog = new ConfirmDialog(); |
| | | alarmPushConfirmDialog.ShowDialog(Language.StringByID(StringId.Tip), jpushMessageInfo.Content, goAction, cancelAction, StringId.Cancel, StringId.LookOver); |
| | | } |
| | | else |
| | | { |
| | | alarmPushConfirmDialog.RefreshDialog(Language.StringByID(StringId.Tip), jpushMessageInfo.Content, goAction, cancelAction, StringId.Cancel, StringId.LookOver); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 常用方法_______________________ |
| | |
| | | /// 使用权限 |
| | | /// </summary> |
| | | public const int PleaseTryToForgetPassword = 9061; |
| | | |
| | | /// <summary> |
| | | /// 查看 |
| | | /// </summary> |
| | | public const int LookOver = 9062; |
| | | |
| | | #region 网络请求响应错误提示信息 |
| | | /// <summary> |
| | |
| | | |
| | | namespace HDL_ON |
| | | { |
| | | /// <summary> |
| | | /// 房间楼层选择弹窗 |
| | | /// </summary> |
| | | public class FloorSelectPopupDialog |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public FloorSelectPopupDialog() |
| | | { |
| | | } |
| | |
| | | List<List<RoomCellInfo>> mSecondList = new List<List<RoomCellInfo>>(); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// 读取本地楼层和房间数据,弹窗显示 |
| | | /// </summary> |
| | | /// <param name="selectAction">回调选中事件,回调选中的uid</param> |
| | | /// <param name="selectTag">设置选中的tga标记</param> |
| | | public void ShowView(Action<string> selectAction, string selectTag = DiySelectPopupDialog.ALLSELECT) |
| | | { |
| | | |
| | | //楼层集合数据 |
| | | var floorList = SpatialInfo.CurrentSpatial.FloorList; |
| | | //房间集合数据 |
| | | var roomList = SpatialInfo.CurrentSpatial.RoomList; |
| | | |
| | | //根据楼层和房间数据结情况加载对于效果弹窗 |
| | | if (floorList == null || floorList.Count == 0) |
| | | { |
| | | //没有楼层只加载房间 |
| | | if (roomList == null) |
| | | { |
| | | Utlis.WriteLine("roomList null"); |
| | | return; |
| | | Utlis.WriteLine("floorList and roomList null"); |
| | | roomList = new List<Room>(); |
| | | } |
| | | |
| | | mFirstList.Clear(); |
| | | //遍历所有房间列表 |
| | | foreach (var room in roomList) |
| | | { |
| | | mFirstList.Add(new RoomCellInfo() { Title = room.roomName, TagId = room.uid }); |
| | | } |
| | | //弹窗一级联动选择窗口 |
| | | var roomSelectPopupDialog = new DiySelectPopupDialog(); |
| | | roomSelectPopupDialog.ShowView(mFirstList, null, selectAction, selectTag); |
| | | } |
| | |
| | | //一级数组为楼层 |
| | | foreach (var floor in floorList) |
| | | { |
| | | //遍历所有楼层列表以及楼层所关联房间的列表 |
| | | mFirstList.Add(new RoomCellInfo() { Title = floor.roomName, TagId = floor.uid }); |
| | | var mList = new List<RoomCellInfo>(); |
| | | var allRoom = roomList.FindAll((room) => room.parentId == floor.uid); |
| | |
| | | } |
| | | mSecondList.Add(mList); |
| | | } |
| | | |
| | | //弹窗二级联动选择窗口 |
| | | var roomSelectPopupDialog = new DiySelectPopupDialog(); |
| | | roomSelectPopupDialog.ShowView(mFirstList, mSecondList, selectAction, selectTag); |
| | | |
old mode 100755
new mode 100644
| | |
| | | //*****一些判空处理***************** |
| | | if (revertObj.Code == null) |
| | | { |
| | | revertObj.Code = "DATA_EXCEPTION"; |
| | | revertObj.Code = StateCode.DATA_EXCEPTION; |
| | | } |
| | | |
| | | if (revertObj.Data == null) |
| | |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = "DATA_EXCEPTION" }; |
| | | return new ResponsePackNew() { Code = StateCode.DATA_EXCEPTION }; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | HDL_ON.Utlis.WriteLine(response.Content); |
| | | return new ResponsePackNew() { Code = "NETWORK_ERROR" }; |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = "NETWORK_ERROR" }; |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePackNew>(response.Content); |
| | | if (revertObj.Code == null) |
| | | { |
| | | revertObj.Code = "DATA_EXCEPTION"; |
| | | revertObj.Code = StateCode.DATA_EXCEPTION; |
| | | } |
| | | ////统一转成大写 |
| | | //revertObj.StateCode = revertObj.StateCode.ToUpper (); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = "DATA_EXCEPTION" }; |
| | | return new ResponsePackNew() { Code = StateCode.DATA_EXCEPTION }; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | HDL_ON.Utlis.WriteLine(response.Content); |
| | | return new ResponsePackNew() { Code = "NETWORK_ERROR" }; |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = "NETWORK_ERROR" }; |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | stateCodeDic["NETWORK_ERROR"] = StringId.FailedRequestServer; |
| | | //数据异常 |
| | | stateCodeDic["DATA_EXCEPTION"] = StringId.DataExceptionPleaseTryAgain; |
| | | |
| | | //与服务器通讯失败 |
| | | stateCodeDic[StateCode.NETWORK_ERROR] = StringId.FailedRequestServer; |
| | | //数据异常 |
| | | stateCodeDic[StateCode.DATA_EXCEPTION] = StringId.DataExceptionPleaseTryAgain; |
| | | #region 基础服务 新错误码 2020-12-07 |
| | | //系统繁忙~请稍后再试~ |
| | | stateCodeDic["1"] = StringId.SystemIsBusy; |
| | |
| | | public class StateCode |
| | | { |
| | | /// <summary> |
| | | /// 网络请求异常 |
| | | /// APP自定义错误码 |
| | | /// </summary> |
| | | public const string NETWORK_ERROR = "-1"; |
| | | /// <summary> |
| | | /// 数据解析错误 |
| | | /// APP自定义错误码 |
| | | /// </summary> |
| | | public const string DATA_EXCEPTION = "-2"; |
| | | /// <summary> |
| | | /// 请求成功的状态码 |
| | | /// </summary> |
| | | public const string SUCCESS = "0"; |
old mode 100755
new mode 100644
| | |
| | | /// </summary> |
| | | public class ConfirmDialog : Dialog |
| | | { |
| | | /// bodyView |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | { |
| | | this.BackgroundColor = CSS_Color.DialogTransparentColor1; |
| | | |
| | | if (bodyView != null && bodyView.Parent != null) |
| | | { |
| | | bodyView.RemoveFromParent(); |
| | | } |
| | | |
| | | bodyView = new FrameLayout(); |
| | | this.AddChidren(bodyView); |
| | | |
| | | FrameLayout contentView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.Center, |
| | |
| | | BorderWidth = 0, |
| | | Radius = (uint)Application.GetMinRealAverage(10), |
| | | }; |
| | | this.AddChidren(contentView); |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | Button btnTitle = new Button() |
| | | { |
| | |
| | | okAction?.Invoke(); |
| | | }; |
| | | |
| | | this.Show(); |
| | | //this.Show(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public void ShowDialog(int titleId, int msgId, Action okAction, Action cancelAction = null) |
| | | { |
| | | this.ShowDialogBase(Language.StringByID(titleId), Language.StringByID(msgId), okAction, cancelAction); |
| | | this.Show(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public void ShowDialog(int titleId, int msgId, Action okAction, Action cancelAction, int cancelID, int confirmID) |
| | | { |
| | | this.ShowDialogBase(Language.StringByID(titleId), Language.StringByID(msgId), okAction, cancelAction, cancelID, confirmID); |
| | | this.Show(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public void ShowDialog(string titleStr, string msgStr, Action okAction, Action cancelAction = null) |
| | | { |
| | | this.ShowDialogBase(titleStr, msgStr, okAction, cancelAction); |
| | | this.Show(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public void ShowDialog(string titleStr, string msgStr, Action okAction, Action cancelAction, int cancelID, int confirmID) |
| | | { |
| | | this.ShowDialogBase(titleStr, msgStr, okAction, cancelAction, cancelID, confirmID); |
| | | this.Show(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// RefreshDialog 在Dialog没关闭情况下调用 |
| | | /// 可以自定义按钮文字 |
| | | /// </summary> |
| | | /// <param name="titleStr"></param> |
| | | /// <param name="msgStr"></param> |
| | | /// <param name="okAction"></param> |
| | | /// <param name="cancelAction"></param> |
| | | /// <param name="cancelID"></param> |
| | | /// <param name="confirmID"></param> |
| | | public void RefreshDialog(string titleStr, string msgStr, Action okAction, Action cancelAction, int cancelID, int confirmID) |
| | | { |
| | | this.ShowDialogBase(titleStr, msgStr, okAction, cancelAction, cancelID, confirmID); |
| | | //this.Show();不需要show |
| | | } |
| | | } |
| | | } |
| | |
| | | public class DiySelectPopupDialog : Dialog |
| | | { |
| | | /// <summary> |
| | | /// ALLSELECT |
| | | /// ALLSELECT,标识 |
| | | /// </summary> |
| | | public const string ALLSELECT = "ALLSELECT"; |
| | | |
| | |
| | | /// </summary> |
| | | public FrameLayout BackView; |
| | | /// <summary> |
| | | /// |
| | | /// 全部按钮 |
| | | /// </summary> |
| | | Button leftAllButton; |
| | | /// <summary> |
| | |
| | | List<RoomCellInfo> mSecondAllList = new List<RoomCellInfo>(); |
| | | |
| | | /// <summary> |
| | | /// RoomSelectPopupDialog |
| | | /// DiySelectPopupDialog |
| | | /// </summary> |
| | | /// <param name="SelectAction"></param> |
| | | public DiySelectPopupDialog() |
| | | { |
| | | bodyView = new FrameLayout(); |
| | |
| | | /// mFirstList、mSecondList不合法都不会显示View |
| | | /// mSecondList 不传为默认一级 |
| | | /// </summary> |
| | | /// <param name="mFirstList"></param> |
| | | /// <param name="mSecondList"></param> |
| | | /// <param name="mFirstList">一级数据集合</param> |
| | | /// <param name="mSecondList">二级数据集合</param> |
| | | /// <param name="SelectAction">选择回调事件</param> |
| | | /// <param name="selectTagId"></param> |
| | | public void ShowView(List<RoomCellInfo> mFirstList, List<List<RoomCellInfo>> mSecondList, Action<string> SelectAction, string selectTagId = ALLSELECT) |
| | | { |
| | | if (mFirstList == null) |
| | |
| | | ShowDoubleBaseView(); |
| | | //数据内容填充 |
| | | RefreshDoubleBaseView(); |
| | | // |
| | | //选中效果 |
| | | SetSelectTagId(selectTagId); |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// 刷新UI,选择全部 |
| | | /// </summary> |
| | | void SelectAll() |
| | | { |
| | |
| | | /// </summary> |
| | | void SetSelectTagId(string tagId) |
| | | { |
| | | if (string.IsNullOrEmpty(tagId) || tagId == ALLSELECT) |
| | | if (string.IsNullOrEmpty(tagId) || tagId == ALLSELECT || mFirstList == null) |
| | | { |
| | | SelectAll(); |
| | | } |
| | | else |
| | | { |
| | | |
| | | //一级楼层匹配成功 |
| | | var tagInfo = mFirstList.Find((m) => m.TagId == tagId); |
| | | if (tagInfo != null) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | //SelectAll(); |
| | | //一级的楼层匹配失败,尝试匹配二级 |
| | | if (mSecondList == null || mFirstList.Count != mSecondList.Count) |
| | | { |
| | | SelectAll(); |
| | | } |
| | | else |
| | | { |
| | | //是否匹配到房间 |
| | | bool isFind = false; |
| | | //1.遍历二级房间数据 |
| | | for(var i = 0; i < mSecondList.Count; i++) |
| | | { |
| | | foreach (var room in mSecondList[i]) |
| | | { |
| | | if(tagId == room.TagId) |
| | | { |
| | | //匹配房间成功,选中对于的楼层 |
| | | var tagFirstInfo = mFirstList[i]; |
| | | isFind = true; |
| | | RefreshSelectButton(leftScrolView, tagFirstInfo.TagId); |
| | | LoadRightScrolView(tagFirstInfo, mSecondList[i]); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //没有匹配到房间 |
| | | if (!isFind) |
| | | { |
| | | SelectAll(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | |