| | |
| | | UserInfo.Current.userEmailInfo = info.memberEmail; |
| | | UserInfo.Current.userMobileInfo = info.memberPhone; |
| | | UserInfo.Current.userName = info.memberName; |
| | | |
| | | if (!string.IsNullOrEmpty(info.memberPhonePrefix)) |
| | | { |
| | | UserInfo.Current.areaCode = info.memberPhonePrefix; |
| | |
| | | //是否需要获取头像 |
| | | if (bGetHeadImage) |
| | | { |
| | | var imageKey = ImageUtlis.Current.GetHeadImageKey(info.memberId); |
| | | |
| | | var headImageBytes = ImageUtlis.Current.DownHeadImage(info.memberId); |
| | | |
| | | if (headImageBytes != null && headImageBytes.Length > 0) |
| | | //2020-12-15 修改头像方案 |
| | | if (!string.IsNullOrEmpty(info.memberHeadIcon)) |
| | | { |
| | | //UserInfo.Current.headImagePageBytes = headImageBytes; |
| | | UserInfo.Current.headImagePagePath = imageKey; |
| | | var headImageBytes = ImageUtlis.Current.DownHeadImageByImageKey(info.memberHeadIcon); |
| | | |
| | | if (headImageBytes != null && headImageBytes.Length > 0) |
| | | { |
| | | UserInfo.Current.headImagePagePath = info.memberHeadIcon; |
| | | //UserInfo.Current.headImagePagePath = imageKey; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /// 获取用户头像 |
| | | /// </summary> |
| | | /// <param name="userId"></param> |
| | | public void GetUserHeadImage(string userId) |
| | | public void GetUserHeadImageByKey(string imageKey) |
| | | { |
| | | var imageKey = ImageUtlis.Current.GetHeadImageKey(userId); |
| | | |
| | | var headImageBytes = ImageUtlis.Current.DownHeadImage(userId); |
| | | var headImageBytes = ImageUtlis.Current.DownHeadImageByImageKey(imageKey); |
| | | |
| | | if (headImageBytes != null && headImageBytes.Length > 0) |
| | | { |
| | |
| | | }); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_UpdateMemberInfo, requestJson); |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 更新用户头像 |
| | | ///// </summary> |
| | | ///// <param name="userName"></param> |
| | | ///// <returns></returns> |
| | | //public ResponsePackNew UpdateMemberHeadIcon(string memberHeadIcon) |
| | | //{ |
| | | // var requestJson = HttpUtil.GetSignRequestJson(new UpdateMemberHeadIconRes() |
| | | // { |
| | | // memberHeadIcon = memberHeadIcon |
| | | // }); |
| | | // return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_UpdateMemberInfo, requestJson); |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// 更新用户头像 |
| | |
| | | homeRegionName = mHome.homeRegionName, |
| | | homeRegionId = mHome.homeRegionId, |
| | | Address = mHome.homeAddress, |
| | | isAllowCreateScene = mHome.isAllowCreateScene, |
| | | }; |
| | | UserInfo.Current.regionList.Add(home); |
| | | } |
| | | //住宅被删除 |
| | | if (UserInfo.Current.regionList.Find((obj) => obj.RegionID == DB_ResidenceData.Instance.CurrentRegion.RegionID) == null) |
| | | //-------如果账号是首次登录 |
| | | if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) |
| | | { |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0]; |
| | | GetHomeGatewayList(); |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | Action action = () => |
| | | { |
| | | MainPage.GoUserPage(); |
| | | }; |
| | | new UI.PublicAssmebly().TipMsg(StringId.Tip, StringId.ResidenceDeletedSwitchToAnotherResidence, action); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //刷新当前住宅 |
| | | DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0]; |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | //刷新一次住宅网关 |
| | | GetHomeGatewayList(); |
| | | } |
| | | else |
| | | { |
| | | //住宅被删除 |
| | | var findHome = UserInfo.Current.regionList.Find((obj) => obj.RegionID == DB_ResidenceData.Instance.CurrentRegion.RegionID); |
| | | if (findHome == null) |
| | | { |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0]; |
| | | GetHomeGatewayList(); |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | Action action = () => |
| | | { |
| | | MainPage.GoUserPage(); |
| | | }; |
| | | new UI.PublicAssmebly().TipMsg(StringId.Tip, StringId.ResidenceDeletedSwitchToAnotherResidence, action); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //刷新当前住宅 |
| | | DB_ResidenceData.Instance.CurrentRegion = findHome; |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | //刷新一次住宅网关 |
| | | GetHomeGatewayList(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | if (mHomeGatewayRes.Count > 0) |
| | | { |
| | | DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0]; |
| | | if(mHomeGatewayRes[0].gatewayStatus == "ON_LINE") |
| | | if(mHomeGatewayRes[0].gatewayStatus) |
| | | { |
| | | DriverLayer.Control.Ins.IsRemote = true; |
| | | //DriverLayer.Control.Ins.IsRemote = true; |
| | | DriverLayer.Control.Ins.GatewayOnline = true; |
| | | } |
| | | else |
| | | { |
| | | DriverLayer.Control.Ins.GatewayOnline = false; |
| | | } |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | return; |
| | |
| | | d.Add("userSceneIds",new List<string>() { seceneId }); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneList, requestJson); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneInfo, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 添加场景 |
| | |
| | | { |
| | | d.Add("roomType", GetType); |
| | | } |
| | | d.Add("pageSize", "1000"); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetRoomList, requestJson); |
| | | |