接入新首页-我的 api
This commit is contained in:
@@ -38,13 +38,13 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
|
||||
/// 初始化一些第三方配置
|
||||
- (void)initThirdConfig{
|
||||
[self setLanguage];
|
||||
[self configShareSDK];
|
||||
[self configNIMSDK];
|
||||
[self configAdjust];
|
||||
[self configBugly];
|
||||
[self registerNot];
|
||||
[self initEmojiData];
|
||||
[self setLanguage];
|
||||
}
|
||||
|
||||
-(void)setLanguage{
|
||||
|
@@ -50,6 +50,7 @@
|
||||
if ([language isEqualToString:@"ar"]) {
|
||||
[UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
|
||||
[UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
|
||||
|
||||
} else {
|
||||
[UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
|
||||
[UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
|
||||
|
@@ -126,6 +126,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+(void)requsetFriendListComplection:(HttpRequestHelperCompletion)complection;
|
||||
///ip检测
|
||||
+(void)checkIpRegionComplection:(HttpRequestHelperCompletion)complection;
|
||||
|
||||
+(void)getMyRoomCompletion:(HttpRequestHelperCompletion)completion;
|
||||
|
||||
+(void)getMyCollectRoomsCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSNumber *)num pageSize:(NSNumber *)size;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -162,4 +162,12 @@
|
||||
+(void)checkIpRegionComplection:(HttpRequestHelperCompletion)complection{
|
||||
[self makeRequest:@"ipRegion/check" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
+(void)getMyRoomCompletion:(HttpRequestHelperCompletion)completion {
|
||||
[self makeRequest:@"home/getMyRoom" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
+(void)getMyCollectRoomsCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSNumber *)num pageSize:(NSNumber *)size
|
||||
{
|
||||
[self makeRequest:@"home/collect/pageRoom" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, num, size, nil];
|
||||
}
|
||||
@end
|
||||
|
@@ -11,7 +11,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPHomeMinePresenter : BaseMvpPresenter
|
||||
|
||||
//- (void)getMy
|
||||
- (void)getMyRoom;
|
||||
|
||||
- (void)getMyCollectRooms;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -7,6 +7,33 @@
|
||||
|
||||
#import "XPHomeMinePresenter.h"
|
||||
|
||||
#import "Api+Home.h"
|
||||
#import "HomeCollectRoomModel.h"
|
||||
|
||||
@implementation XPHomeMinePresenter
|
||||
|
||||
- (void)getMyRoom {
|
||||
// NSString * uid = [/*AccountInfoStorage*/ instance].getUid;
|
||||
// [Api homeTagComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
// NSArray * array = [PIHomeCategoryTitleModel modelsWithArray:data.data];
|
||||
// for (PIHomeCategoryTitleModel *model in array) {
|
||||
// model.checkedWidth = [UILabel getWidthWithText:model.name height:kGetScaleWidth(44) font:kFontSemibold(16)];
|
||||
// model.noCheckedWidth = [UILabel getWidthWithText:model.name height:kGetScaleWidth(44) font:kFontRegular(14)];
|
||||
// }
|
||||
// [[self getView] getHomeTagListSuccess:array];
|
||||
//
|
||||
// }] uid:uid];
|
||||
[Api getMyRoomCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
// TODO: 确认 model
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)getMyCollectRooms {
|
||||
[Api getMyCollectRoomsCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
// TODO: 确认 model
|
||||
}
|
||||
pageNum:@1
|
||||
pageSize:@20];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -150,7 +150,7 @@
|
||||
- (SDCycleScrollView *)pi_BannerView {
|
||||
if (!_pi_BannerView) {
|
||||
_pi_BannerView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:[UIImageConstant defalutBannerPlaceholder]];
|
||||
_pi_BannerView.backgroundColor = [UIColor clearColor];
|
||||
_pi_BannerView.backgroundColor = [UIColor redColor];
|
||||
_pi_BannerView.layer.cornerRadius = 10;
|
||||
_pi_BannerView.layer.masksToBounds = YES;
|
||||
_pi_BannerView.showPageControl = NO;
|
||||
|
@@ -7,18 +7,30 @@
|
||||
|
||||
#import "XPHomeMineViewController.h"
|
||||
|
||||
#import <JXPagingView/JXPagerView.h>
|
||||
#import <JXCategoryView/JXCategoryView.h>
|
||||
#import <JXPagingView/JXPagerListRefreshView.h>
|
||||
|
||||
#import "XPHomeMinePresenter.h"
|
||||
#import "XPHomePartyViewController.h"
|
||||
#import "PIHomeCategoryTitleModel.h"
|
||||
|
||||
@interface XPHomeMineViewController ()
|
||||
|
||||
@interface XPHomeMineViewController () <JXPagerViewDelegate, JXPagerMainTableViewGestureDelegate>
|
||||
|
||||
@property (nonatomic, strong) UIView *myRoomCard;
|
||||
|
||||
@property (nonatomic, strong) JXPagerView *pagingView;
|
||||
@property (nonatomic, strong) JXCategoryTitleView *titleView;
|
||||
@property (nonatomic, strong) NSMutableArray<PIHomeCategoryTitleModel *> *tagModelList;
|
||||
@end
|
||||
|
||||
@implementation XPHomeMineViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[self.presenter getMyRoom];
|
||||
[self.presenter getMyCollectRooms];
|
||||
}
|
||||
|
||||
- (BOOL)isHiddenNavBar {
|
||||
@@ -29,4 +41,72 @@
|
||||
return [[XPHomeMinePresenter alloc] init];
|
||||
}
|
||||
|
||||
#pragma mark - JXPagerMainTableViewGestureDelegate
|
||||
- (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
|
||||
//禁止categoryView左右滑动的时候,上下和左右都可以滚动
|
||||
if (otherGestureRecognizer.view == self.pagingView.listContainerView) {
|
||||
return NO;
|
||||
}
|
||||
// if(otherGestureRecognizer.view.tag == 9000001){
|
||||
// return NO;
|
||||
// }
|
||||
// if(otherGestureRecognizer.view.tag == 9000002){
|
||||
// return NO;
|
||||
// }
|
||||
//
|
||||
// if(otherGestureRecognizer.view.tag == 98777){
|
||||
// return NO;
|
||||
// }
|
||||
|
||||
return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]];
|
||||
}
|
||||
|
||||
#pragma mark - JXCategoryViewDelegate
|
||||
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
|
||||
|
||||
return kGetScaleWidth(170);
|
||||
}
|
||||
|
||||
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
||||
return self.myRoomCard;
|
||||
}
|
||||
|
||||
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
return kGetScaleWidth(50);
|
||||
}
|
||||
|
||||
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
return self.titleView;
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView {
|
||||
return self.tagModelList.count;
|
||||
}
|
||||
|
||||
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
|
||||
// id homeV = [self.validListDict objectForKey:[NSNumber numberWithInteger:index]];
|
||||
// if (homeV) {
|
||||
// return homeV;
|
||||
// }
|
||||
XPHomePartyViewController *homeVC = [[XPHomePartyViewController alloc] init];
|
||||
homeVC.tagModel = [self.tagModelList xpSafeObjectAtIndex:index];
|
||||
// [self.validListDict setObject:homeVC forKey:@(index)];
|
||||
return homeVC;
|
||||
}
|
||||
|
||||
- (UIView *)myRoomCard {
|
||||
return [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 94)];
|
||||
}
|
||||
|
||||
- (JXPagerView *)pagingView {
|
||||
if (!_pagingView) {
|
||||
_pagingView = [[JXPagerView alloc] initWithDelegate:self listContainerType:0];
|
||||
_pagingView.mainTableView.gestureDelegate = self;
|
||||
_pagingView.backgroundColor = [UIColor clearColor];
|
||||
_pagingView.listContainerView.backgroundColor = [UIColor clearColor];
|
||||
_pagingView.listContainerView.listCellBackgroundColor = [UIColor clearColor];
|
||||
_pagingView.mainTableView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _pagingView;
|
||||
}
|
||||
@end
|
||||
|
Reference in New Issue
Block a user