From 60a5983a9825b071cbef75a6c2ebc866ee67b6df Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Wed, 13 Dec 2023 19:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyInfo/CC/DDEditMyInfoViewController.h | 4 +- .../MyInfo/CC/DDEditMyInfoViewController.m | 74 ++++++++++++++----- .../MyInfo/CC/DDMyInfoSettingViewController.m | 2 +- .../MyInfo/CC/DDMyInformationViewController.m | 6 +- .../MyInfo/MM/DDFansFollowVisitModel.h | 14 ++++ .../CodeClass/SearchPage/DDSearchListVC.m | 26 +++++-- .../SearchPage/DDSearchPageViewController.m | 28 ++++++- .../DingDangApp/V2Versions/Mine/DDMineVC.m | 2 +- .../DDMain/DDHome/DDHomeApi/Api+DDHomeApi.h | 1 + .../DDMain/DDHome/DDHomeApi/Api+DDHomeApi.m | 3 + .../DDMain/DDMine/DDMineApi/Api+DDMineApi.h | 1 + .../DDMain/DDMine/DDMineApi/Api+DDMineApi.m | 2 + 12 files changed, 133 insertions(+), 30 deletions(-) diff --git a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDEditMyInfoViewController.h b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDEditMyInfoViewController.h index 48fe53e..2a78558 100644 --- a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDEditMyInfoViewController.h +++ b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDEditMyInfoViewController.h @@ -6,7 +6,7 @@ // #import "WLBaseViewController.h" - +#import "UserInfoModel.h" NS_ASSUME_NONNULL_BEGIN @interface DDEditMyInfoViewController : WLBaseViewController @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSString * avator;//头像 @property (nonatomic, copy) NSString * nickName;//昵称 @property (nonatomic, copy) NSString * singer;//签名 -@property (nonatomic, strong) AppUserModel * personModel; +@property (nonatomic, strong) UserInfoModel * personModel; @end NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDEditMyInfoViewController.m b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDEditMyInfoViewController.m index 53a39d1..d1b65e7 100644 --- a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDEditMyInfoViewController.m +++ b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDEditMyInfoViewController.m @@ -13,6 +13,7 @@ #import "FileToolsObject.h" #import #import "RoomUserManagementView.h" +#import "Api.h" @interface DDEditMyInfoViewController () /**按钮**/ @@ -27,14 +28,14 @@ // Do any additional setup after loading the view. [self defaultNavTitle:@"编辑资料" hideLine:YES]; self.view.backgroundColor = UIColor.whiteColor; - self.birthdayContent = self.personModel.birthday; + self.birthdayContent = @(self.personModel.birth).stringValue; self.avator = self.personModel.avatar; - self.sexStr = self.personModel.sex == 1 ? @"男":@"女"; - self.nickName = self.personModel.nickname; - if ([ToolsObject IsNullWithObject:self.personModel.signature]) { - self.personModel.signature = @"高冷的TA不喜欢留签名"; + self.sexStr = self.personModel.gender == 1 ? @"男":@"女"; + self.nickName = self.personModel.nick; + if ([ToolsObject IsNullWithObject:self.personModel.userDesc]) { + self.personModel.userDesc = @"高冷的TA不喜欢留签名"; } - self.singer = self.personModel.signature; + self.singer = self.personModel.userDesc; [self.customNavBar addSubview:self.rightBtn]; [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-16); @@ -107,13 +108,46 @@ //提交 - (void)rightBtnClick { + + WeakSelf(weakSelf); + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * ticket = [[AccountInfoStorage instance] getTicket]; + NSMutableDictionary * dic = [NSMutableDictionary dictionary]; + if (self.avator.length > 0) { + [dic setObject:self.avator forKey:@"avatar"]; + } + + if (self.nickName.length > 0) { + [dic setObject:self.nickName forKey:@"nick"]; + } + +// if (self.birthdayContent.length > 0) { +// [dic setObject:self.birthdayContent forKey:@"birth"]; +// } + + if (self.singer.length > 0) { + [dic setObject:self.singer forKey:@"userDesc"]; + } + + [dic setObject:uid forKey:@"uid"]; + [dic setObject:ticket forKey:@"ticket"]; + [Api completeUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if(code == 200){ + [ToolsObject addPopVieToText:@"修改完成"]; + [weakSelf.navigationController popViewControllerAnimated:YES]; + } + } userInfo:dic]; + return; + + + NSMutableDictionary *requestDict = [NSMutableDictionary dictionary]; [requestDict setObject:self.birthdayContent forKey:@"birthday"]; [requestDict setObject:self.avator forKey:@"avatar"]; [requestDict setObject:[self.sexStr isEqualToString:@"男"]?@"1":@"2" forKey:@"sex"]; [requestDict setObject:self.nickName forKey:@"nickname"]; [requestDict setObject:self.singer forKey:@"signature"]; - WeakSelf(weakSelf); + [NetworkRequest requestPOST:@"/my/edit/user" parameters:requestDict block:^(BaseResponse * _Nonnull response) { if (response.code == 200) { [ToolsObject addPopVieToText:@"修改完成"]; @@ -223,7 +257,7 @@ } -(void)uploadAvatarRequest{ WeakSelf(weakSelf) - [[ResourcePickerToolsObject shareIntance] getImageVideoWithIsVideo:NO WithIsImage:YES maxImagesCount:1 columnNumber:3 pushPhotoPickerVc:YES allowTakePicture:YES allowTakeVideo:NO allowPickingGif:YES imagePickerBlock:^(TZImagePickerController * _Nonnull picker, NSArray * _Nonnull photos, NSArray * _Nonnull assets, BOOL isSelectOriginalPhoto, BOOL isSelectGifPhoto) { + [[ResourcePickerToolsObject shareIntance] getImageVideoWithIsVideo:NO WithIsImage:YES maxImagesCount:1 columnNumber:3 pushPhotoPickerVc:YES allowTakePicture:YES allowTakeVideo:NO allowPickingGif:NO imagePickerBlock:^(TZImagePickerController * _Nonnull picker, NSArray * _Nonnull photos, NSArray * _Nonnull assets, BOOL isSelectOriginalPhoto, BOOL isSelectGifPhoto) { PHImageRequestOptions * options = [[PHImageRequestOptions alloc] init]; options.resizeMode = PHImageRequestOptionsResizeModeFast; options.synchronous = YES; @@ -244,16 +278,20 @@ [imageArr addObject:imageData]; [weakSelf uploadGIFImage:imageArr]; }else{ - NSString *path = [FileToolsObject libraryDir]; - NSMutableArray *imageArr = @[].mutableCopy; - for (UIImage * image in photos) { - NSString * imgUrl = [NSString stringWithFormat:@"source/personInfo/image/%@.jpg",[ToolsObject dateChangeRealtimestamp]]; - [FileToolsObject createFileAtPath:[path stringByAppendingPathComponent:imgUrl] overwrite:YES]; - NSData *thumbImageData = [ToolsObject compressWithMaxLength:1024 WithImage:image]; - [imageArr addObject:[path stringByAppendingPathComponent:imgUrl]]; - [FileToolsObject writeFileAtPath:[path stringByAppendingPathComponent:imgUrl] content:thumbImageData]; - } - [weakSelf uploadImage:imageArr]; + if(photos.count > 0){ + self.headerImgV.image = photos.firstObject; + } + +// NSString *path = [FileToolsObject libraryDir]; +// NSMutableArray *imageArr = @[].mutableCopy; +// for (UIImage * image in photos) { +// NSString * imgUrl = [NSString stringWithFormat:@"source/personInfo/image/%@.jpg",[ToolsObject dateChangeRealtimestamp]]; +// [FileToolsObject createFileAtPath:[path stringByAppendingPathComponent:imgUrl] overwrite:YES]; +// NSData *thumbImageData = [ToolsObject compressWithMaxLength:1024 WithImage:image]; +// [imageArr addObject:[path stringByAppendingPathComponent:imgUrl]]; +// [FileToolsObject writeFileAtPath:[path stringByAppendingPathComponent:imgUrl] content:thumbImageData]; +// } +// [weakSelf uploadImage:imageArr]; } }]; } videoPickerControllerBlock:^(TZImagePickerController * _Nonnull picker, UIImage * _Nonnull coverImage, PHAsset * _Nonnull asset) {}]; diff --git a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDMyInfoSettingViewController.m b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDMyInfoSettingViewController.m index 3ddf6c1..80f882b 100644 --- a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDMyInfoSettingViewController.m +++ b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDMyInfoSettingViewController.m @@ -72,7 +72,7 @@ [DDCellModel addDataWithName:@"清除缓存" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_ClearCache) content:[NSString stringWithFormat:@"%.2fM",[self getAppCacheSize]]], [DDCellModel addDataWithName:@"位置显示" icon:@"" cellType:DDCellModelType_Switch setType:(DDMyInfoModelType_Location) content:[NSString stringWithFormat:@"%d",[AppDelegate getAppdelegate].isLocation]], [DDCellModel addDataWithName:@"应用内通知" icon:@"" cellType:DDCellModelType_Switch setType:(DDMyInfoModelType_Notification) content:[NSString stringWithFormat:@"%d",[ToolsObject getUserModel].is_notification]], - [DDCellModel addDataWithName:@"" icon:@"" cellType:DDCellModelType_Copyright setType:(DDMyInfoModelType_Copyright) content:@"Copyright © 2022 - 2080\n奔梦科技 版权所有"], +// [DDCellModel addDat/*aWithName:@"" icon:@"" cellType:DDCellModelType_Copyright setType:(DDMyInfoModelType_Copyright) content:@"Copyright © 2022 - 2080\n奔梦科技 版权所有"],*/ ].mutableCopy; } return _listArr; diff --git a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDMyInformationViewController.m b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDMyInformationViewController.m index 03953d9..cf921fe 100644 --- a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDMyInformationViewController.m +++ b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/CC/DDMyInformationViewController.m @@ -125,11 +125,15 @@ -(void)getUserInfo { WeakSelf(weakSelf) - + NSString *uid = [[AccountInfoStorage instance]getUid]; [Api getUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if(code == 200){ UserInfoModel *userModel = [UserInfoModel DD_ModelWithDict:data.data]; + if ([self.user_id isEqualToString:uid]) { + self.moreButton.hidden = YES; + [weakSelf.view addSubview:weakSelf.editBtn]; + } self.userModel = userModel; weakSelf.profileVC.personModel = userModel; weakSelf.titLabel.text = userModel.nick; diff --git a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/MM/DDFansFollowVisitModel.h b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/MM/DDFansFollowVisitModel.h index 8e36675..6d16e8c 100644 --- a/yinmeng-ios/DingDangApp/CodeClass/MyInfo/MM/DDFansFollowVisitModel.h +++ b/yinmeng-ios/DingDangApp/CodeClass/MyInfo/MM/DDFansFollowVisitModel.h @@ -52,6 +52,20 @@ NS_ASSUME_NONNULL_BEGIN //@property (nonatomic, strong) UserVipInfoVo *userVipInfoVO; /////是否在房间中 本地字段 //@property (nonatomic,assign) ContactUseingType useingType; + + +///在线人数 +@property (nonatomic,assign) NSInteger onlineNum; + +///标题 +@property (nonatomic,copy) NSString *title; + + + + +///搜索用户的时候 如果用户在房间中的话 就有roomUid +@property (nonatomic,copy) NSString *roomUid; + @end NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/CodeClass/SearchPage/DDSearchListVC.m b/yinmeng-ios/DingDangApp/CodeClass/SearchPage/DDSearchListVC.m index 061a80d..37462df 100644 --- a/yinmeng-ios/DingDangApp/CodeClass/SearchPage/DDSearchListVC.m +++ b/yinmeng-ios/DingDangApp/CodeClass/SearchPage/DDSearchListVC.m @@ -11,7 +11,7 @@ #import "DDSearchRoomCell.h" #import "DDRoomPartyModel.h" #import "DDFansFollowVisitModel.h" - +#import "Api+DDHomeApi.h" @interface DDSearchListVC () @property (nonatomic, assign) NSInteger pageNum; @@ -50,6 +50,20 @@ } -(void)initRequest { + WeakSelf(weakSelf) + [Api searchComplection:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + [weakSelf endrefresh]; + if(code == 200){ + if (weakSelf.pageNum == 1) { + [weakSelf.userListArr removeAllObjects]; + } + NSArray *list = [DDFansFollowVisitModel DD_ModelsWithArray:data.data]; + [weakSelf.userListArr addObjectsFromArray:list]; + [self.searchTable reloadData]; + } + } key:self.searchStr type:@"2" page:@(self.pageNum).stringValue pageSize:@"20"]; + + return; NSMutableDictionary *dic = [NSMutableDictionary dictionary]; //综合 用户 聊天室 if ([self.typeStr isEqualToString:@"综合"]) { @@ -62,10 +76,10 @@ [dic setObject:self.searchStr ?: @"" forKey:@"keywords"]; [dic setObject:@(20) forKey:@"current_page"]; [dic setObject:@(self.pageNum) forKey:@"page_number"]; - @weakify(self) + [NetworkRequest requestPOST:@"/home/search" parameters:dic block:^(BaseResponse * _Nonnull response) { - @strongify(self); + if (response.isSuccess) { if ([ToolsObject IsNullWithObject:response.data]) { return; @@ -102,11 +116,11 @@ } } dispatch_async(dispatch_get_main_queue(), ^{ - @strongify(self); + [self.searchTable reloadData]; }); } else { - @strongify(self) + [self endrefresh]; } }]; @@ -358,7 +372,7 @@ } self.isClick = YES; DDFansFollowVisitModel *model = self.userListArr[indexPath.row]; - [ToolsObject pushMyInformationViewController:model.id]; + [ToolsObject pushMyInformationViewController:model.uid]; @weakify(self); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1*NSEC_PER_SEC), dispatch_get_main_queue(), ^{ @strongify(self); diff --git a/yinmeng-ios/DingDangApp/CodeClass/SearchPage/DDSearchPageViewController.m b/yinmeng-ios/DingDangApp/CodeClass/SearchPage/DDSearchPageViewController.m index 5767872..5996ed7 100644 --- a/yinmeng-ios/DingDangApp/CodeClass/SearchPage/DDSearchPageViewController.m +++ b/yinmeng-ios/DingDangApp/CodeClass/SearchPage/DDSearchPageViewController.m @@ -14,6 +14,7 @@ #import "DDRoomPartyModel.h" #import "DDFansFollowVisitModel.h" #import "DDSearchListVC.h" +#import "Api+DDHomeApi.h" @interface DDSearchPageViewController () /** 搜索*/ @property(nonatomic,strong) DDSearchBarView * searchBarView; @@ -160,12 +161,37 @@ } } - (void)requestUserHomeSearch{ + + WeakSelf(weakSelf) + [Api searchComplection:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if(code == 200){ + [weakSelf.userListArr removeAllObjects]; + NSArray *list = [DDFansFollowVisitModel DD_ModelsWithArray:data.data]; + [weakSelf.userListArr addObjectsFromArray:list]; + if (weakSelf.userListArr.count == 0 && weakSelf.roomListArr.count == 0) { + //显示占位图 + [weakSelf.titlesArray removeAllObjects]; + weakSelf.noDataView.hidden = NO; + }else{ + //隐藏占位图 + weakSelf.noDataView.hidden = YES; + [weakSelf.titlesArray removeAllObjects]; + if (weakSelf.userListArr.count>0) { + [weakSelf.titlesArray addObject:@"用户"]; + } + } + weakSelf.categoryView.titles = self.titlesArray; + [weakSelf.pagerView reloadData]; + [weakSelf.categoryView reloadData]; + } + } key:self.contentStr type:@"2" page:@"1" pageSize:@"20"]; + return; NSMutableDictionary * requestDict = [NSMutableDictionary dictionary]; [requestDict setObject:[ToolsObject IsNullWithObject:self.contentStr]?@"":self.contentStr forKey:@"keywords"]; [requestDict setObject:@"all" forKey:@"type"]; [requestDict setObject:@(20) forKey:@"current_page"]; [requestDict setObject:@(1) forKey:@"page_number"]; - WeakSelf(weakSelf) + [NetworkRequest requestPOST:@"/home/search" parameters:requestDict block:^(BaseResponse * _Nonnull response) { if (response.code == 200){ [weakSelf.userListArr removeAllObjects]; diff --git a/yinmeng-ios/DingDangApp/V2Versions/Mine/DDMineVC.m b/yinmeng-ios/DingDangApp/V2Versions/Mine/DDMineVC.m index fd91a9e..1ee501e 100644 --- a/yinmeng-ios/DingDangApp/V2Versions/Mine/DDMineVC.m +++ b/yinmeng-ios/DingDangApp/V2Versions/Mine/DDMineVC.m @@ -163,7 +163,7 @@ if ([type isEqualToString:@"主页"]) { NSString *uid = [[AccountInfoStorage instance]getUid]; - AppUserModel * myModel = [ToolsObject getUserModel]; + [ToolsObject pushMyInformationViewController:uid]; } else if ([type isEqualToString:@"粉丝"]) { DDFollowFansPVC * listVC = [[DDFollowFansPVC alloc] init]; diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDHome/DDHomeApi/Api+DDHomeApi.h b/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDHome/DDHomeApi/Api+DDHomeApi.h index b926397..ac2ece2 100644 --- a/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDHome/DDHomeApi/Api+DDHomeApi.h +++ b/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDHome/DDHomeApi/Api+DDHomeApi.h @@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN + (void)homeTagComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid; + (void)homeRecommendRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid; + (void)getRecommendListComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid tabId:(NSString *)tabId pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize; ++ (void)searchComplection:(HttpRequestHelperCompletion)complection key:(NSString *)key type:(NSString *)type page:(NSString *)page pageSize:(NSString *)pageSize; @end NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDHome/DDHomeApi/Api+DDHomeApi.m b/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDHome/DDHomeApi/Api+DDHomeApi.m index bc6cee8..e4d706f 100644 --- a/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDHome/DDHomeApi/Api+DDHomeApi.m +++ b/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDHome/DDHomeApi/Api+DDHomeApi.m @@ -29,4 +29,7 @@ + (void)getRecommendListComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid tabId:(NSString *)tabId pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize { [self makeRequest:@"home/tab/mapV2" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, uid, tabId, pageNum, pageSize, nil]; } ++ (void)searchComplection:(HttpRequestHelperCompletion)complection key:(NSString *)key type:(NSString *)type page:(NSString *)page pageSize:(NSString *)pageSize { + [self makeRequest:@"search/room" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, key, type, page, pageSize, nil]; +} @end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDMine/DDMineApi/Api+DDMineApi.h b/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDMine/DDMineApi/Api+DDMineApi.h index 801072c..040d9dd 100644 --- a/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDMine/DDMineApi/Api+DDMineApi.h +++ b/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDMine/DDMineApi/Api+DDMineApi.h @@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN + (void)dd_RequestIAPRecharge:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId uid:(NSString *)uid ticket:(NSString *)ticket deviceInfo:(NSString *)deviceInfo clientIp:(NSString *)clientIp; + (void)requestDressUpShopList:(HttpRequestHelperCompletion)completion dressType:(NSString *)dressType; + (void)getUserGiftWall:(HttpRequestHelperCompletion)comletion uid:(NSString *)uid giftType:(NSString *)giftType; + @end NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDMine/DDMineApi/Api+DDMineApi.m b/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDMine/DDMineApi/Api+DDMineApi.m index 564d86d..e9c9451 100644 --- a/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDMine/DDMineApi/Api+DDMineApi.m +++ b/yinmeng-ios/DingDangApp/YingMeng/DDMain/DDMine/DDMineApi/Api+DDMineApi.m @@ -41,4 +41,6 @@ + (void)getUserGiftWall:(HttpRequestHelperCompletion)comletion uid:(NSString *)uid giftType:(NSString *)giftType { [self makeRequest:@"giftwall/getByGiftType" method:HttpRequestHelperMethodGET completion:comletion, __FUNCTION__, uid, giftType, nil]; } + + @end