首页-大家都在搜UI,搜索劫持的礼物弹窗
This commit is contained in:
@@ -334,6 +334,9 @@
|
|||||||
9BFB10162897AAB300B3985E /* XPNewUserRechargeSucessView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFB10152897AAB300B3985E /* XPNewUserRechargeSucessView.m */; };
|
9BFB10162897AAB300B3985E /* XPNewUserRechargeSucessView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFB10152897AAB300B3985E /* XPNewUserRechargeSucessView.m */; };
|
||||||
9BFB101F2897CC4300B3985E /* XPAnchorCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFB101E2897CC4300B3985E /* XPAnchorCardView.m */; };
|
9BFB101F2897CC4300B3985E /* XPAnchorCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFB101E2897CC4300B3985E /* XPAnchorCardView.m */; };
|
||||||
9BFB10222897D68400B3985E /* XPTabAnchorCardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFB10212897D68400B3985E /* XPTabAnchorCardModel.m */; };
|
9BFB10222897D68400B3985E /* XPTabAnchorCardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFB10212897D68400B3985E /* XPTabAnchorCardModel.m */; };
|
||||||
|
9BFC320A2924BD910002D5A4 /* XPHomeSearchRelateView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFC32092924BD910002D5A4 /* XPHomeSearchRelateView.m */; };
|
||||||
|
9BFC320E2924CC650002D5A4 /* XPRoomSearchRecommendHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFC320D2924CC650002D5A4 /* XPRoomSearchRecommendHeadView.m */; };
|
||||||
|
9BFC32152924DACC0002D5A4 /* XPHomeSearchAwardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFC32142924DACC0002D5A4 /* XPHomeSearchAwardView.m */; };
|
||||||
9BFE0D8E2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFE0D8D2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.m */; };
|
9BFE0D8E2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFE0D8D2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.m */; };
|
||||||
9BFE0D922899042600F53C24 /* XPTaskCompleteTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFE0D912899042600F53C24 /* XPTaskCompleteTipView.m */; };
|
9BFE0D922899042600F53C24 /* XPTaskCompleteTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFE0D912899042600F53C24 /* XPTaskCompleteTipView.m */; };
|
||||||
9BFE992E288142FD009DA429 /* RoomClassifyModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFE992D288142FD009DA429 /* RoomClassifyModel.m */; };
|
9BFE992E288142FD009DA429 /* RoomClassifyModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFE992D288142FD009DA429 /* RoomClassifyModel.m */; };
|
||||||
@@ -1888,6 +1891,12 @@
|
|||||||
9BFB101E2897CC4300B3985E /* XPAnchorCardView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorCardView.m; sourceTree = "<group>"; };
|
9BFB101E2897CC4300B3985E /* XPAnchorCardView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorCardView.m; sourceTree = "<group>"; };
|
||||||
9BFB10202897D68400B3985E /* XPTabAnchorCardModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPTabAnchorCardModel.h; sourceTree = "<group>"; };
|
9BFB10202897D68400B3985E /* XPTabAnchorCardModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPTabAnchorCardModel.h; sourceTree = "<group>"; };
|
||||||
9BFB10212897D68400B3985E /* XPTabAnchorCardModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPTabAnchorCardModel.m; sourceTree = "<group>"; };
|
9BFB10212897D68400B3985E /* XPTabAnchorCardModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPTabAnchorCardModel.m; sourceTree = "<group>"; };
|
||||||
|
9BFC32082924BD910002D5A4 /* XPHomeSearchRelateView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeSearchRelateView.h; sourceTree = "<group>"; };
|
||||||
|
9BFC32092924BD910002D5A4 /* XPHomeSearchRelateView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeSearchRelateView.m; sourceTree = "<group>"; };
|
||||||
|
9BFC320C2924CC650002D5A4 /* XPRoomSearchRecommendHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomSearchRecommendHeadView.h; sourceTree = "<group>"; };
|
||||||
|
9BFC320D2924CC650002D5A4 /* XPRoomSearchRecommendHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomSearchRecommendHeadView.m; sourceTree = "<group>"; };
|
||||||
|
9BFC32132924DACC0002D5A4 /* XPHomeSearchAwardView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeSearchAwardView.h; sourceTree = "<group>"; };
|
||||||
|
9BFC32142924DACC0002D5A4 /* XPHomeSearchAwardView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeSearchAwardView.m; sourceTree = "<group>"; };
|
||||||
9BFE0D8C2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorCardSkillCollectionViewCell.h; sourceTree = "<group>"; };
|
9BFE0D8C2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorCardSkillCollectionViewCell.h; sourceTree = "<group>"; };
|
||||||
9BFE0D8D2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorCardSkillCollectionViewCell.m; sourceTree = "<group>"; };
|
9BFE0D8D2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorCardSkillCollectionViewCell.m; sourceTree = "<group>"; };
|
||||||
9BFE0D902899042600F53C24 /* XPTaskCompleteTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPTaskCompleteTipView.h; sourceTree = "<group>"; };
|
9BFE0D902899042600F53C24 /* XPTaskCompleteTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPTaskCompleteTipView.h; sourceTree = "<group>"; };
|
||||||
@@ -5196,6 +5205,26 @@
|
|||||||
path = AnchorCard;
|
path = AnchorCard;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
9BFC320B2924C0410002D5A4 /* HomeSearchRelateView */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
9BFC32082924BD910002D5A4 /* XPHomeSearchRelateView.h */,
|
||||||
|
9BFC32092924BD910002D5A4 /* XPHomeSearchRelateView.m */,
|
||||||
|
9BFC320C2924CC650002D5A4 /* XPRoomSearchRecommendHeadView.h */,
|
||||||
|
9BFC320D2924CC650002D5A4 /* XPRoomSearchRecommendHeadView.m */,
|
||||||
|
);
|
||||||
|
path = HomeSearchRelateView;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
9BFC32122924DA930002D5A4 /* HomeSearchHijack */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
9BFC32132924DACC0002D5A4 /* XPHomeSearchAwardView.h */,
|
||||||
|
9BFC32142924DACC0002D5A4 /* XPHomeSearchAwardView.m */,
|
||||||
|
);
|
||||||
|
path = HomeSearchHijack;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
9BFE0D8F289903F600F53C24 /* TaskTip */ = {
|
9BFE0D8F289903F600F53C24 /* TaskTip */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -8270,6 +8299,8 @@
|
|||||||
E8C6FFD12754AA6A004DC9F0 /* SubViews */ = {
|
E8C6FFD12754AA6A004DC9F0 /* SubViews */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
9BFC32122924DA930002D5A4 /* HomeSearchHijack */,
|
||||||
|
9BFC320B2924C0410002D5A4 /* HomeSearchRelateView */,
|
||||||
E8C6FFD22754AA87004DC9F0 /* XPNoteView.h */,
|
E8C6FFD22754AA87004DC9F0 /* XPNoteView.h */,
|
||||||
E8C6FFD32754AA87004DC9F0 /* XPNoteView.m */,
|
E8C6FFD32754AA87004DC9F0 /* XPNoteView.m */,
|
||||||
E8C6FFD52754BC61004DC9F0 /* XPHomeNavView.h */,
|
E8C6FFD52754BC61004DC9F0 /* XPHomeNavView.h */,
|
||||||
@@ -9943,6 +9974,7 @@
|
|||||||
E8EEB90F26FC6AB8007C6EBA /* XPMineUserInfoEditPresenter.m in Sources */,
|
E8EEB90F26FC6AB8007C6EBA /* XPMineUserInfoEditPresenter.m in Sources */,
|
||||||
E873EB09280960990071030D /* XPMineUserInfoVoiceCardView.m in Sources */,
|
E873EB09280960990071030D /* XPMineUserInfoVoiceCardView.m in Sources */,
|
||||||
E8AC723A26F49AAE007D6E91 /* XPMineNotifyStatus.m in Sources */,
|
E8AC723A26F49AAE007D6E91 /* XPMineNotifyStatus.m in Sources */,
|
||||||
|
9BFC320E2924CC650002D5A4 /* XPRoomSearchRecommendHeadView.m in Sources */,
|
||||||
E8F6135F291E274E00E12650 /* NSArray+Safe.m in Sources */,
|
E8F6135F291E274E00E12650 /* NSArray+Safe.m in Sources */,
|
||||||
18E7B33226F317A20064BC9B /* XPWebViewController.m in Sources */,
|
18E7B33226F317A20064BC9B /* XPWebViewController.m in Sources */,
|
||||||
E8AEAEF927141CA30017FCE0 /* RoomHeaderView.m in Sources */,
|
E8AEAEF927141CA30017FCE0 /* RoomHeaderView.m in Sources */,
|
||||||
@@ -10076,6 +10108,7 @@
|
|||||||
E8A03DF62763367F0098D9EA /* XPCandyTreeEmptyableViewCell.m in Sources */,
|
E8A03DF62763367F0098D9EA /* XPCandyTreeEmptyableViewCell.m in Sources */,
|
||||||
E8AEAEED27141AE20017FCE0 /* XPRoomBackContainerView.m in Sources */,
|
E8AEAEED27141AE20017FCE0 /* XPRoomBackContainerView.m in Sources */,
|
||||||
E88B5CC126FB407B00DA9178 /* XPMineUserInfoViewController.m in Sources */,
|
E88B5CC126FB407B00DA9178 /* XPMineUserInfoViewController.m in Sources */,
|
||||||
|
9BFC32152924DACC0002D5A4 /* XPHomeSearchAwardView.m in Sources */,
|
||||||
E81E09CF290F750800A1F410 /* AdvertiseModel.m in Sources */,
|
E81E09CF290F750800A1F410 /* AdvertiseModel.m in Sources */,
|
||||||
E852D74428633A08001465ED /* MonentsCommentModel.m in Sources */,
|
E852D74428633A08001465ED /* MonentsCommentModel.m in Sources */,
|
||||||
E8C1CD6D27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.m in Sources */,
|
E8C1CD6D27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.m in Sources */,
|
||||||
@@ -10103,6 +10136,7 @@
|
|||||||
E80016422804228100D6D17A /* XPGuildIncomePresenter.m in Sources */,
|
E80016422804228100D6D17A /* XPGuildIncomePresenter.m in Sources */,
|
||||||
E8E5E1A927C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.m in Sources */,
|
E8E5E1A927C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.m in Sources */,
|
||||||
9B0997A327F19DE500EB8F14 /* QGHWDShaders.metal in Sources */,
|
9B0997A327F19DE500EB8F14 /* QGHWDShaders.metal in Sources */,
|
||||||
|
9BFC320A2924BD910002D5A4 /* XPHomeSearchRelateView.m in Sources */,
|
||||||
187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */,
|
187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */,
|
||||||
E87C54C22823CD6F0051AA11 /* XPMineResetLoginPwdViewController.m in Sources */,
|
E87C54C22823CD6F0051AA11 /* XPMineResetLoginPwdViewController.m in Sources */,
|
||||||
E8098CA7282E00920090B9F0 /* Api+Monents.m in Sources */,
|
E8098CA7282E00920090B9F0 /* Api+Monents.m in Sources */,
|
||||||
|
@@ -16,6 +16,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
/// @param type 类型 1 房间 2 用户
|
/// @param type 类型 1 房间 2 用户
|
||||||
- (void)searchRoomList:(NSString *)key type:(NSString *)type;
|
- (void)searchRoomList:(NSString *)key type:(NSString *)type;
|
||||||
|
|
||||||
|
/// 获取首页推荐列表
|
||||||
|
- (void)getHomeRecommendRoomList;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -8,7 +8,9 @@
|
|||||||
#import "XPHomeSearchPresenter.h"
|
#import "XPHomeSearchPresenter.h"
|
||||||
#import "Api+Home.h"
|
#import "Api+Home.h"
|
||||||
#import "XPHomeSearchProtocol.h"
|
#import "XPHomeSearchProtocol.h"
|
||||||
|
#import "AccountInfoStorage.h"
|
||||||
#import "HomeSearchResultModel.h"
|
#import "HomeSearchResultModel.h"
|
||||||
|
#import "HomeRecommendRoomModel.h"
|
||||||
|
|
||||||
@implementation XPHomeSearchPresenter
|
@implementation XPHomeSearchPresenter
|
||||||
|
|
||||||
@@ -19,8 +21,19 @@
|
|||||||
- (void)searchRoomList:(NSString *)key type:(NSString *)type {
|
- (void)searchRoomList:(NSString *)key type:(NSString *)type {
|
||||||
[Api searchComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
[Api searchComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
NSArray * array = [HomeSearchResultModel modelsWithArray:data.data];
|
NSArray * array = [HomeSearchResultModel modelsWithArray:data.data];
|
||||||
[[self getView] searchRoomSuccess:array];
|
[[self getView] searchRoomSuccess:array type:type];
|
||||||
} showLoading:YES] key:key type:type page:@"1" pageSize:@"50"];
|
} showLoading:YES] key:key type:type page:@"1" pageSize:@"50"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 获取首页推荐列表
|
||||||
|
- (void)getHomeRecommendRoomList {
|
||||||
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||||
|
[Api homeRecommendRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
|
NSArray<HomeRecommendRoomModel *> * array = [HomeRecommendRoomModel modelsWithArray:data.data];
|
||||||
|
[[self getView] searchRoomGetRecommendSuccess:array];
|
||||||
|
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||||
|
[[self getView] searchRoomGetRecommendFail];
|
||||||
|
}] uid:uid];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -17,6 +17,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
/// 清除进房记录
|
/// 清除进房记录
|
||||||
- (void)cleanInRoomRecord;
|
- (void)cleanInRoomRecord;
|
||||||
|
|
||||||
|
///大家都在搜
|
||||||
|
- (void)getEveryoneSearchList;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -31,4 +31,13 @@
|
|||||||
}] uid:uid roomUid:NULL];
|
}] uid:uid roomUid:NULL];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///大家都在搜
|
||||||
|
- (void)getEveryoneSearchList {
|
||||||
|
NSString *uid = [AccountInfoStorage instance].getUid;
|
||||||
|
[Api requestEveryoneSearch:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
|
NSArray *array = [XPMineFootPrintModel modelsWithArray:data.data];
|
||||||
|
[[self getView] getEveryoneSearchListSuccess:array];
|
||||||
|
}] uid:uid];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -11,8 +11,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@protocol XPHomeSearchProtocol <NSObject>
|
@protocol XPHomeSearchProtocol <NSObject>
|
||||||
|
|
||||||
///搜索房间成功
|
///搜索成功
|
||||||
- (void)searchRoomSuccess:(NSArray *)data;
|
- (void)searchRoomSuccess:(NSArray *)data type:(NSString *)type;
|
||||||
|
|
||||||
|
///搜索页获取推荐房间成功
|
||||||
|
- (void)searchRoomGetRecommendSuccess:(NSArray *)data;
|
||||||
|
///搜索页获取推荐房间失败
|
||||||
|
- (void)searchRoomGetRecommendFail;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@@ -27,4 +27,7 @@
|
|||||||
///清除进房记录成功
|
///清除进房记录成功
|
||||||
- (void)cleanInRoomRecordSuccess;
|
- (void)cleanInRoomRecordSuccess;
|
||||||
|
|
||||||
|
///获取大家都在搜列表成功
|
||||||
|
- (void)getEveryoneSearchListSuccess:(NSArray<XPMineFootPrintModel *> *)array;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// XPHomeSearchAwardView.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by GreenLand on 2022/11/16.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface XPHomeSearchAwardView : UIView
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,141 @@
|
|||||||
|
//
|
||||||
|
// XPHomeSearchAwardView.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by GreenLand on 2022/11/16.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "XPHomeSearchAwardView.h"
|
||||||
|
#import "Masonry/Masonry.h"
|
||||||
|
#import "ThemeColor.h"
|
||||||
|
#import "XPMacro.h"
|
||||||
|
#import "NetImageView.h"
|
||||||
|
#import "TTPopup.h"
|
||||||
|
|
||||||
|
@interface XPHomeSearchAwardView()
|
||||||
|
|
||||||
|
///奖励标题
|
||||||
|
@property (nonatomic, strong) UILabel *awardTitle;
|
||||||
|
///关闭
|
||||||
|
@property (nonatomic, strong) UIButton *closeBtn;
|
||||||
|
///奖励icon
|
||||||
|
@property (nonatomic, strong) NetImageView *awardImageView;
|
||||||
|
///礼物名称
|
||||||
|
@property (nonatomic, strong) UILabel *giftTitle;
|
||||||
|
///描述
|
||||||
|
@property (nonatomic, strong) UILabel *giftDes;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation XPHomeSearchAwardView
|
||||||
|
|
||||||
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
|
{
|
||||||
|
self = [super initWithFrame:frame];
|
||||||
|
if (self) {
|
||||||
|
[self initView];
|
||||||
|
[self initContraints];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initView {
|
||||||
|
self.backgroundColor = [UIColor whiteColor];
|
||||||
|
[self addSubview:self.awardTitle];
|
||||||
|
[self addSubview:self.closeBtn];
|
||||||
|
[self addSubview:self.awardImageView];
|
||||||
|
[self addSubview:self.giftTitle];
|
||||||
|
[self addSubview:self.giftDes];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initContraints {
|
||||||
|
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.size.mas_equalTo(CGSizeMake(300, 220));
|
||||||
|
}];
|
||||||
|
[self.awardTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.mas_equalTo(16);
|
||||||
|
make.height.mas_equalTo(22);
|
||||||
|
make.centerX.mas_equalTo(self);
|
||||||
|
make.right.mas_equalTo(self.closeBtn.mas_left).mas_offset(-5);
|
||||||
|
}];
|
||||||
|
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.mas_equalTo(13);
|
||||||
|
make.right.mas_equalTo(-15);
|
||||||
|
make.width.height.mas_equalTo(20);
|
||||||
|
}];
|
||||||
|
[self.awardImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.mas_equalTo(self.awardTitle.mas_bottom).mas_offset(17);
|
||||||
|
make.centerX.mas_equalTo(self);
|
||||||
|
make.size.mas_equalTo(CGSizeMake(112, 90));
|
||||||
|
}];
|
||||||
|
[self.giftTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.mas_equalTo(self.awardImageView.mas_bottom).mas_offset(11);
|
||||||
|
make.centerX.mas_equalTo(self);
|
||||||
|
make.height.mas_equalTo(20);
|
||||||
|
make.left.mas_equalTo(8);
|
||||||
|
}];
|
||||||
|
[self.giftDes mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.mas_equalTo(self.giftTitle.mas_bottom).mas_offset(4);
|
||||||
|
make.centerX.mas_equalTo(self);
|
||||||
|
make.height.mas_equalTo(17);
|
||||||
|
make.left.mas_equalTo(8);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)onCloseBtnClick:(UIButton *)sender {
|
||||||
|
[TTPopup dismiss];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - getter
|
||||||
|
- (UILabel *)awardTitle {
|
||||||
|
if (!_awardTitle) {
|
||||||
|
UILabel *label = [[UILabel alloc] init];
|
||||||
|
label.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||||
|
label.textColor = [ThemeColor mainTextColor];
|
||||||
|
_awardTitle = label;
|
||||||
|
}
|
||||||
|
return _awardTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UIButton *)closeBtn {
|
||||||
|
if (!_closeBtn) {
|
||||||
|
_closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
[_closeBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
|
||||||
|
[_closeBtn addTarget:self action:@selector(onCloseBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
}
|
||||||
|
return _closeBtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NetImageView *)awardImageView {
|
||||||
|
if (!_awardImageView) {
|
||||||
|
NetImageConfig *config = [[NetImageConfig alloc] init];
|
||||||
|
config.placeHolder = [UIImageConstant defaultEmptyAvatarPlaceholder];
|
||||||
|
_awardImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
|
_awardImageView.layer.masksToBounds = YES;
|
||||||
|
_awardImageView.layer.cornerRadius = 8;
|
||||||
|
}
|
||||||
|
return _awardImageView;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UILabel *)giftTitle {
|
||||||
|
if (!_giftTitle) {
|
||||||
|
UILabel *label = [[UILabel alloc] init];
|
||||||
|
label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||||
|
label.textColor = [ThemeColor mainTextColor];
|
||||||
|
_giftTitle = label;
|
||||||
|
}
|
||||||
|
return _giftTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UILabel *)giftDes {
|
||||||
|
if (!_giftDes) {
|
||||||
|
UILabel *label = [[UILabel alloc] init];
|
||||||
|
label.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
||||||
|
label.textColor = [ThemeColor secondTextColor];
|
||||||
|
label.text = @"奖励已自动发放";
|
||||||
|
_giftDes = label;
|
||||||
|
}
|
||||||
|
return _giftDes;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@@ -0,0 +1,28 @@
|
|||||||
|
//
|
||||||
|
// XPHomeSearchRelateView.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by GreenLand on 2022/11/16.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
@protocol XPHomeSearchRelateViewDelegate <NSObject>
|
||||||
|
|
||||||
|
///进入房间
|
||||||
|
- (void)xPHomeSearchRelateViewEnterRoom:(NSString *)roomUid;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface XPHomeSearchRelateView : UIView
|
||||||
|
|
||||||
|
@property (nonatomic, strong) NSArray *relateArray;
|
||||||
|
|
||||||
|
@property (nonatomic, strong) NSArray *recommendArray;
|
||||||
|
|
||||||
|
@property (nonatomic, weak) id<XPHomeSearchRelateViewDelegate> delegate;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,175 @@
|
|||||||
|
//
|
||||||
|
// XPHomeSearchRelateView.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by GreenLand on 2022/11/16.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "XPHomeSearchRelateView.h"
|
||||||
|
#import "Masonry/Masonry.h"
|
||||||
|
#import "NSArray+Safe.h"
|
||||||
|
#import "ThemeColor.h"
|
||||||
|
#import "XPMacro.h"
|
||||||
|
///view
|
||||||
|
#import "XPSearchListTableViewCell.h"
|
||||||
|
#import "XPHomeRedommendCollectionViewCell.h"
|
||||||
|
#import "XPRoomSearchRecommendHeadView.h"
|
||||||
|
///Model
|
||||||
|
#import "HomeSearchResultModel.h"
|
||||||
|
#import "HomeRecommendRoomModel.h"
|
||||||
|
|
||||||
|
@interface XPHomeSearchRelateView()<UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
|
||||||
|
|
||||||
|
@property (nonatomic, strong) UILabel *relateTitle;
|
||||||
|
@property (nonatomic, strong) UITableView *tableView;
|
||||||
|
@property (nonatomic, strong) UICollectionView *collectionView;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation XPHomeSearchRelateView
|
||||||
|
|
||||||
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
|
{
|
||||||
|
self = [super initWithFrame:frame];
|
||||||
|
if (self) {
|
||||||
|
[self initView];
|
||||||
|
[self initContraints];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initView {
|
||||||
|
self.backgroundColor = [ThemeColor appBackgroundColor];
|
||||||
|
[self addSubview:self.relateTitle];
|
||||||
|
[self addSubview:self.tableView];
|
||||||
|
[self addSubview:self.collectionView];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initContraints {
|
||||||
|
[self.relateTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.mas_equalTo(16);
|
||||||
|
make.left.mas_equalTo(15);
|
||||||
|
make.height.mas_equalTo(20);
|
||||||
|
}];
|
||||||
|
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.right.bottom.mas_equalTo(0);
|
||||||
|
make.top.mas_equalTo(self.relateTitle.mas_bottom).mas_offset(16);
|
||||||
|
}];
|
||||||
|
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.edges.mas_equalTo(0);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
#pragma mark - tableviewDelegate
|
||||||
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||||
|
return self.relateArray.count;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
XPSearchListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPSearchListTableViewCell class])];
|
||||||
|
if (cell == nil) {
|
||||||
|
cell = [[XPSearchListTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPSearchListTableViewCell class])];
|
||||||
|
}
|
||||||
|
HomeSearchResultModel * resultModel = [self.relateArray safeObjectAtIndex1:indexPath.row];
|
||||||
|
[cell configData:resultModel type:1];
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
HomeSearchResultModel * resultModel = [self.relateArray safeObjectAtIndex1:indexPath.row];
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeSearchRelateViewEnterRoom:)]) {
|
||||||
|
[self.delegate xPHomeSearchRelateViewEnterRoom:resultModel.uid];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - collectionViewDelegate
|
||||||
|
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||||
|
return self.recommendArray.count;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
XPHomeRedommendCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeRedommendCollectionViewCell class]) forIndexPath:indexPath];
|
||||||
|
HomeRecommendRoomModel * info = [self.recommendArray safeObjectAtIndex1:indexPath.row];
|
||||||
|
cell.recommendRoomInfo = info;
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
return CGSizeMake(100 * kScreenScale, 100 * kScreenScale);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
XPRoomSearchRecommendHeadView *headView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass([XPRoomSearchRecommendHeadView class]) forIndexPath:indexPath];
|
||||||
|
return headView;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
|
||||||
|
if (self.recommendArray.count > 0) {
|
||||||
|
HomeRecommendRoomModel * recommend = [self.recommendArray safeObjectAtIndex1:indexPath.row];
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeSearchRelateViewEnterRoom:)]) {
|
||||||
|
[self.delegate xPHomeSearchRelateViewEnterRoom:recommend.roomUid];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setRelateArray:(NSArray *)relateArray {
|
||||||
|
_relateArray = relateArray;
|
||||||
|
[self.tableView reloadData];
|
||||||
|
self.collectionView.hidden = YES;
|
||||||
|
self.relateTitle.hidden = NO;
|
||||||
|
self.tableView.hidden = NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setRecommendArray:(NSArray *)recommendArray {
|
||||||
|
_recommendArray = recommendArray;
|
||||||
|
[self.collectionView reloadData];
|
||||||
|
self.collectionView.hidden = NO;
|
||||||
|
self.relateTitle.hidden = YES;
|
||||||
|
self.tableView.hidden = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UILabel *)relateTitle {
|
||||||
|
if (!_relateTitle) {
|
||||||
|
UILabel *label = [[UILabel alloc] init];
|
||||||
|
label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||||
|
// label.textColor = [ThemeColor mainTextColor];
|
||||||
|
label.text = @"相关房间";
|
||||||
|
_relateTitle = label;
|
||||||
|
}
|
||||||
|
return _relateTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UITableView *)tableView {
|
||||||
|
if (!_tableView) {
|
||||||
|
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||||
|
_tableView.delegate = self;
|
||||||
|
_tableView.dataSource = self;
|
||||||
|
_tableView.tableHeaderView = [UIView new];
|
||||||
|
_tableView.tableFooterView = [UIView new];
|
||||||
|
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||||
|
_tableView.backgroundColor = [UIColor clearColor];
|
||||||
|
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||||
|
[_tableView registerClass:[XPSearchListTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPSearchListTableViewCell class])];
|
||||||
|
}
|
||||||
|
return _tableView;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UICollectionView *)collectionView{
|
||||||
|
if (!_collectionView) {
|
||||||
|
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||||
|
layout.headerReferenceSize = CGSizeMake(KScreenWidth, 200);
|
||||||
|
layout.minimumLineSpacing = 8;
|
||||||
|
layout.minimumInteritemSpacing = 0;
|
||||||
|
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||||
|
layout.sectionInset = UIEdgeInsetsMake(15, 15, 0, 15);
|
||||||
|
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||||
|
_collectionView.dataSource = self;
|
||||||
|
_collectionView.delegate = self;
|
||||||
|
_collectionView.backgroundColor = [UIColor clearColor];
|
||||||
|
[_collectionView registerClass:[XPHomeRedommendCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPHomeRedommendCollectionViewCell class])];
|
||||||
|
[_collectionView registerClass:[XPRoomSearchRecommendHeadView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass([XPRoomSearchRecommendHeadView class])];
|
||||||
|
}
|
||||||
|
return _collectionView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// XPRoomSearchRecommendHeadView.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by GreenLand on 2022/11/16.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface XPRoomSearchRecommendHeadView : UICollectionReusableView
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,68 @@
|
|||||||
|
//
|
||||||
|
// XPRoomSearchRecommendHeadView.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by GreenLand on 2022/11/16.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "XPRoomSearchRecommendHeadView.h"
|
||||||
|
#import "Masonry/Masonry.h"
|
||||||
|
#import "ThemeColor.h"
|
||||||
|
#import "XPMacro.h"
|
||||||
|
|
||||||
|
@interface XPRoomSearchRecommendHeadView()
|
||||||
|
|
||||||
|
@property (nonatomic, strong) UILabel *emptyTitle;
|
||||||
|
@property (nonatomic, strong) UILabel *recommentTitle;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation XPRoomSearchRecommendHeadView
|
||||||
|
|
||||||
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
|
{
|
||||||
|
self = [super initWithFrame:frame];
|
||||||
|
if (self) {
|
||||||
|
[self initView];
|
||||||
|
[self initContraints];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initView {
|
||||||
|
[self addSubview:self.emptyTitle];
|
||||||
|
[self addSubview:self.recommentTitle];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initContraints {
|
||||||
|
[self.emptyTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.center.mas_equalTo(self);
|
||||||
|
}];
|
||||||
|
[self.recommentTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.bottom.mas_equalTo(self);
|
||||||
|
make.left.mas_equalTo(16);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UILabel *)emptyTitle {
|
||||||
|
if (!_emptyTitle) {
|
||||||
|
UILabel *label = [[UILabel alloc] init];
|
||||||
|
label.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
||||||
|
label.textColor = [ThemeColor textThirdColor];
|
||||||
|
label.text = @"暂无开播厅房~";
|
||||||
|
_emptyTitle = label;
|
||||||
|
}
|
||||||
|
return _emptyTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UILabel *)recommentTitle {
|
||||||
|
if (!_recommentTitle) {
|
||||||
|
UILabel *label = [[UILabel alloc] init];
|
||||||
|
label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||||
|
label.textColor = [ThemeColor mainTextColor];
|
||||||
|
label.text = @"为你推荐";
|
||||||
|
_recommentTitle = label;
|
||||||
|
}
|
||||||
|
return _recommentTitle;
|
||||||
|
}
|
||||||
|
@end
|
@@ -111,9 +111,11 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - XPHomeSearchProtocol
|
#pragma mark - XPHomeSearchProtocol
|
||||||
- (void)searchRoomSuccess:(NSArray *)data {
|
- (void)searchRoomSuccess:(NSArray *)data type:(nonnull NSString *)type {
|
||||||
self.datasource = data;
|
if (type.integerValue == self.type) {
|
||||||
[self.tableView reloadData];
|
self.datasource = data;
|
||||||
|
[self.tableView reloadData];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - <JXCategoryListContentViewDelegate>
|
#pragma mark - <JXCategoryListContentViewDelegate>
|
||||||
|
@@ -5,11 +5,11 @@
|
|||||||
// Created by 冯硕 on 2021/12/2.
|
// Created by 冯硕 on 2021/12/2.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "BaseViewController.h"
|
#import "MvpViewController.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface XPRoomSearchContainerViewController : BaseViewController
|
@interface XPRoomSearchContainerViewController : MvpViewController
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@@ -17,11 +17,16 @@
|
|||||||
///View
|
///View
|
||||||
#import "XPHomeSearchViewController.h"
|
#import "XPHomeSearchViewController.h"
|
||||||
#import "XPRoomSearchRecordViewController.h"
|
#import "XPRoomSearchRecordViewController.h"
|
||||||
|
#import "XPHomeSearchRelateView.h"
|
||||||
|
#import "XPRoomViewController.h"
|
||||||
|
///P
|
||||||
|
#import "XPHomeSearchPresenter.h"
|
||||||
|
#import "XPHomeSearchProtocol.h"
|
||||||
|
|
||||||
UIKIT_EXTERN NSString *kFromSearchToHomeViewKey;
|
UIKIT_EXTERN NSString *kFromSearchToHomeViewKey;
|
||||||
UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||||
|
|
||||||
@interface XPRoomSearchContainerViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate, XPHomeSearchNavViewDelegate,UITextFieldDelegate, XPRoomSearchRecordViewControllerDelegate>
|
@interface XPRoomSearchContainerViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate, XPHomeSearchNavViewDelegate,UITextFieldDelegate, XPRoomSearchRecordViewControllerDelegate, XPHomeSearchProtocol, XPHomeSearchRelateViewDelegate>
|
||||||
///分页标题
|
///分页标题
|
||||||
@property (nonatomic, strong) NSArray<NSString *> *titles;
|
@property (nonatomic, strong) NSArray<NSString *> *titles;
|
||||||
///分页控件
|
///分页控件
|
||||||
@@ -36,11 +41,18 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
|||||||
@property (nonatomic,strong) XPHomeSearchViewController *userVC;
|
@property (nonatomic,strong) XPHomeSearchViewController *userVC;
|
||||||
///进房、搜索记录
|
///进房、搜索记录
|
||||||
@property (nonatomic, strong) XPRoomSearchRecordViewController *recordVc;
|
@property (nonatomic, strong) XPRoomSearchRecordViewController *recordVc;
|
||||||
|
///相关房间
|
||||||
|
@property (nonatomic, strong) XPHomeSearchRelateView *relateView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation XPRoomSearchContainerViewController
|
@implementation XPRoomSearchContainerViewController
|
||||||
|
|
||||||
|
|
||||||
|
- (XPHomeSearchPresenter *)createPresenter {
|
||||||
|
return [[XPHomeSearchPresenter alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL)isHiddenNavBar {
|
- (BOOL)isHiddenNavBar {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
@@ -141,6 +153,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
|||||||
- (void)xPHomeSearchNavViewClearTextField:(XPHomeSearchNavView *)view {
|
- (void)xPHomeSearchNavViewClearTextField:(XPHomeSearchNavView *)view {
|
||||||
self.recordVc.view.hidden = NO;
|
self.recordVc.view.hidden = NO;
|
||||||
[self.recordVc updateSearchRecord];
|
[self.recordVc updateSearchRecord];
|
||||||
|
[self.relateView removeFromSuperview];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - XPRoomSearchRecordViewControllerDelegate
|
#pragma mark - XPRoomSearchRecordViewControllerDelegate
|
||||||
@@ -155,6 +168,57 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///大家都在搜
|
||||||
|
- (void)xPRoomSearchRecordViewControllerEveryoneSearch:(NSString *)word {
|
||||||
|
self.searchView.searchTextField.text = word;
|
||||||
|
[self.recordVc storeSearchRecord:word];
|
||||||
|
[self.presenter searchRoomList:word type:@"3"];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - XPHomeSearchProtocol
|
||||||
|
- (void)searchRoomSuccess:(NSArray *)data type:(nonnull NSString *)type {
|
||||||
|
if (type.integerValue == 3) {
|
||||||
|
if (data.count) {//有值,显示列表
|
||||||
|
[self.view addSubview:self.relateView];
|
||||||
|
[self.relateView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.right.bottom.mas_equalTo(0);
|
||||||
|
make.top.mas_equalTo(self.searchView.mas_bottom);
|
||||||
|
}];
|
||||||
|
self.relateView.relateArray = data;
|
||||||
|
} else {//无数据,显示推荐房间
|
||||||
|
[self.presenter getHomeRecommendRoomList];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)searchRoomGetRecommendSuccess:(NSArray *)data {
|
||||||
|
if (data.count) {//有值,显示列表
|
||||||
|
[self.view addSubview:self.relateView];
|
||||||
|
[self.relateView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.right.bottom.mas_equalTo(0);
|
||||||
|
make.top.mas_equalTo(self.searchView.mas_bottom);
|
||||||
|
}];
|
||||||
|
self.relateView.recommendArray = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)searchRoomGetRecommendFail {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - XPHomeSearchRelateViewDelegate
|
||||||
|
///进入房间
|
||||||
|
- (void)xPHomeSearchRelateViewEnterRoom:(NSString *)roomUid {
|
||||||
|
BOOL result = [[NSUserDefaults standardUserDefaults] boolForKey:kFromSearchToHomeViewKey];
|
||||||
|
if (!result) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kFromSearchToHomeViewKey];
|
||||||
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||||
|
[[NSNotificationCenter defaultCenter] postNotificationName:kTabShowAnchorCardKey object:@{@"delayShow" : @(YES)}];
|
||||||
|
}
|
||||||
|
[self dismissViewControllerAnimated:YES completion:nil];
|
||||||
|
[XPRoomViewController openRoom:roomUid viewController:self.presentingViewController];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Getters And Setters
|
#pragma mark - Getters And Setters
|
||||||
- (JXCategoryTitleView *)titleView {
|
- (JXCategoryTitleView *)titleView {
|
||||||
if (!_titleView) {
|
if (!_titleView) {
|
||||||
@@ -225,4 +289,12 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
|||||||
return _recordVc;
|
return _recordVc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (XPHomeSearchRelateView *)relateView {
|
||||||
|
if (!_relateView) {
|
||||||
|
_relateView = [[XPHomeSearchRelateView alloc] init];
|
||||||
|
_relateView.delegate = self;
|
||||||
|
}
|
||||||
|
return _relateView;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -11,8 +11,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@protocol XPRoomSearchRecordViewControllerDelegate <NSObject>
|
@protocol XPRoomSearchRecordViewControllerDelegate <NSObject>
|
||||||
|
|
||||||
|
///搜索
|
||||||
- (void)xPRoomSearchRecordViewControllerSearchWithWord:(NSString *)word;
|
- (void)xPRoomSearchRecordViewControllerSearchWithWord:(NSString *)word;
|
||||||
|
|
||||||
|
///点击了大家都在搜
|
||||||
|
- (void)xPRoomSearchRecordViewControllerEveryoneSearch:(NSString *)word;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface XPRoomSearchRecordViewController : MvpViewController
|
@interface XPRoomSearchRecordViewController : MvpViewController
|
||||||
|
@@ -30,7 +30,7 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
|
|
||||||
@property (nonatomic, strong) UIStackView *contentStackView;
|
@property (nonatomic, strong) UIStackView *contentStackView;
|
||||||
///大家都在搜
|
///大家都在搜
|
||||||
@property (nonatomic, strong) UIView *everyoneSearchContentView;
|
@property (nonatomic, strong) UIView *allSearchContentView;
|
||||||
///大家都在搜标题
|
///大家都在搜标题
|
||||||
@property (nonatomic, strong) UILabel *everyOneTitle;
|
@property (nonatomic, strong) UILabel *everyOneTitle;
|
||||||
@property (nonatomic, strong) UICollectionView *everyOneCollectionView;
|
@property (nonatomic, strong) UICollectionView *everyOneCollectionView;
|
||||||
@@ -38,6 +38,8 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
@property (nonatomic, strong) UIView *searchContentView;
|
@property (nonatomic, strong) UIView *searchContentView;
|
||||||
///进房记录容器
|
///进房记录容器
|
||||||
@property (nonatomic, strong) UIView *roomContentView;
|
@property (nonatomic, strong) UIView *roomContentView;
|
||||||
|
///填充占位view
|
||||||
|
@property (nonatomic, strong) UIView *placeHolderView;
|
||||||
///搜索记录
|
///搜索记录
|
||||||
@property (nonatomic, strong) UILabel *recordTitle;
|
@property (nonatomic, strong) UILabel *recordTitle;
|
||||||
///清空搜索记录
|
///清空搜索记录
|
||||||
@@ -54,6 +56,8 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
@property (nonatomic, strong) NSMutableArray *searchList;
|
@property (nonatomic, strong) NSMutableArray *searchList;
|
||||||
///进房记录数据源
|
///进房记录数据源
|
||||||
@property (nonatomic, strong) NSMutableArray *inRoomList;
|
@property (nonatomic, strong) NSMutableArray *inRoomList;
|
||||||
|
///大家都在搜数据源
|
||||||
|
@property (nonatomic, strong) NSMutableArray *everyoneSearchList;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -69,27 +73,17 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
[self initSubViewConstraints];
|
[self initSubViewConstraints];
|
||||||
[self initSearchRecordData];
|
[self initSearchRecordData];
|
||||||
[self.presenter getInRoomRecordList];
|
[self.presenter getInRoomRecordList];
|
||||||
|
[self.presenter getEveryoneSearchList];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initSearchRecordData {
|
- (void)initSearchRecordData {
|
||||||
[self.searchList removeAllObjects];
|
[self.searchList removeAllObjects];
|
||||||
NSArray *array = [self searchRecordList];
|
NSArray *array = [self searchRecordList];
|
||||||
[self.searchList addObjectsFromArray:array];
|
[self.searchList addObjectsFromArray:array];
|
||||||
|
self.searchContentView.hidden = array.count == 0;
|
||||||
[self.searchCollectionView reloadData];
|
[self.searchCollectionView reloadData];
|
||||||
if (!array.count) {
|
|
||||||
[self.searchContentView mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.height.mas_equalTo(0);
|
|
||||||
}];
|
|
||||||
self.searchContentView.hidden = YES;
|
|
||||||
} else {
|
|
||||||
self.searchContentView.hidden = NO;
|
|
||||||
[self.searchContentView mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.height.mas_equalTo(30+26+8);
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||||
[self.view endEditing:YES];
|
[self.view endEditing:YES];
|
||||||
}
|
}
|
||||||
@@ -98,12 +92,13 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
- (void)initSubViews {
|
- (void)initSubViews {
|
||||||
[self.view addSubview:self.contentStackView];
|
[self.view addSubview:self.contentStackView];
|
||||||
|
|
||||||
[self.contentStackView addArrangedSubview:self.everyoneSearchContentView];
|
[self.contentStackView addArrangedSubview:self.allSearchContentView];
|
||||||
[self.contentStackView addArrangedSubview:self.searchContentView];
|
[self.contentStackView addArrangedSubview:self.searchContentView];
|
||||||
[self.contentStackView addArrangedSubview:self.roomContentView];
|
[self.contentStackView addArrangedSubview:self.roomContentView];
|
||||||
|
[self.contentStackView addArrangedSubview:self.placeHolderView];
|
||||||
|
|
||||||
[self.everyoneSearchContentView addSubview:self.everyOneTitle];
|
[self.allSearchContentView addSubview:self.everyOneTitle];
|
||||||
[self.everyoneSearchContentView addSubview:self.everyOneCollectionView];
|
[self.allSearchContentView addSubview:self.everyOneCollectionView];
|
||||||
|
|
||||||
[self.searchContentView addSubview:self.recordTitle];
|
[self.searchContentView addSubview:self.recordTitle];
|
||||||
[self.searchContentView addSubview:self.clearRecordBtn];
|
[self.searchContentView addSubview:self.clearRecordBtn];
|
||||||
@@ -115,32 +110,31 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
|
|
||||||
- (void)initSubViewConstraints {
|
- (void)initSubViewConstraints {
|
||||||
[self.contentStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.contentStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.right.left.bottom.mas_equalTo(0);
|
make.top.right.left.bottom.mas_equalTo(self.view);
|
||||||
}];
|
}];
|
||||||
[self.everyoneSearchContentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.allSearchContentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.edges.mas_equalTo(0);
|
make.left.right.top.mas_equalTo(0);
|
||||||
|
make.bottom.mas_equalTo(self.everyOneCollectionView);
|
||||||
}];
|
}];
|
||||||
[self.everyOneTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.everyOneTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.mas_equalTo(self.everyoneSearchContentView).mas_offset(16);
|
make.left.mas_equalTo(self.allSearchContentView).mas_offset(16);
|
||||||
make.top.mas_equalTo(self.everyoneSearchContentView).mas_offset(10);
|
make.top.mas_equalTo(self.allSearchContentView).mas_offset(16);
|
||||||
make.height.mas_equalTo(20);
|
make.height.mas_equalTo(20);
|
||||||
}];
|
}];
|
||||||
[self.everyOneCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.everyOneCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.right.mas_equalTo(self.everyoneSearchContentView);
|
make.left.right.mas_equalTo(self.allSearchContentView);
|
||||||
make.top.mas_equalTo(self.everyOneTitle.mas_bottom).mas_offset(8);
|
make.top.mas_equalTo(self.everyOneTitle.mas_bottom).mas_offset(8);
|
||||||
make.bottom.mas_equalTo(self.everyoneSearchContentView.mas_bottom).mas_offset(-8);
|
make.height.mas_equalTo(26);
|
||||||
make.height.mas_equalTo(75);
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.searchContentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.searchContentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.right.mas_equalTo(0);
|
make.left.right.mas_equalTo(0);
|
||||||
make.top.mas_equalTo(0);
|
make.bottom.mas_equalTo(self.searchCollectionView.mas_bottom);
|
||||||
make.height.mas_equalTo(30+26+8);
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.recordTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.recordTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.mas_equalTo(16);
|
make.left.mas_equalTo(16);
|
||||||
make.top.mas_equalTo(self.searchContentView).mas_offset(10);
|
make.top.mas_equalTo(self.searchContentView).mas_offset(20);
|
||||||
make.height.mas_equalTo(20);
|
make.height.mas_equalTo(20);
|
||||||
}];
|
}];
|
||||||
[self.clearRecordBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.clearRecordBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
@@ -156,13 +150,12 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
|
|
||||||
[self.roomContentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.roomContentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.right.mas_equalTo(0);
|
make.left.right.mas_equalTo(0);
|
||||||
make.top.mas_equalTo(self.searchContentView.mas_bottom).mas_offset(24);
|
|
||||||
make.bottom.mas_equalTo(self.roomCollectionView.mas_bottom);
|
make.bottom.mas_equalTo(self.roomCollectionView.mas_bottom);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.roomTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.roomTitle mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.mas_equalTo(16);
|
make.left.mas_equalTo(16);
|
||||||
make.top.mas_equalTo(self.roomContentView);
|
make.top.mas_equalTo(self.roomContentView).mas_offset(20);
|
||||||
make.height.mas_equalTo(20);
|
make.height.mas_equalTo(20);
|
||||||
}];
|
}];
|
||||||
[self.clearRoomBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.clearRoomBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
@@ -181,8 +174,10 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||||
if (collectionView == self.searchCollectionView) {
|
if (collectionView == self.searchCollectionView) {
|
||||||
return self.searchList.count;
|
return self.searchList.count;
|
||||||
} else {
|
} else if (collectionView == self.roomCollectionView) {
|
||||||
return self.inRoomList.count;
|
return self.inRoomList.count;
|
||||||
|
} else {
|
||||||
|
return self.everyoneSearchList.count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +188,7 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
return cell;
|
return cell;
|
||||||
} else if (collectionView == self.everyOneCollectionView) {
|
} else if (collectionView == self.everyOneCollectionView) {
|
||||||
XPHomeSearchRecordCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeSearchRecordCell class]) forIndexPath:indexPath];
|
XPHomeSearchRecordCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeSearchRecordCell class]) forIndexPath:indexPath];
|
||||||
cell.recordString = [self.searchList safeObjectAtIndex1:indexPath.row];
|
cell.recordString = [self.everyoneSearchList safeObjectAtIndex1:indexPath.row];
|
||||||
return cell;
|
return cell;
|
||||||
} else {
|
} else {
|
||||||
XPHomeAttentionCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeAttentionCollectionViewCell class]) forIndexPath:indexPath];
|
XPHomeAttentionCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeAttentionCollectionViewCell class]) forIndexPath:indexPath];
|
||||||
@@ -209,7 +204,10 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
[self.delegate xPRoomSearchRecordViewControllerSearchWithWord:str];
|
[self.delegate xPRoomSearchRecordViewControllerSearchWithWord:str];
|
||||||
}
|
}
|
||||||
} else if (collectionView == self.everyOneCollectionView) {
|
} else if (collectionView == self.everyOneCollectionView) {
|
||||||
|
NSString *str = self.searchList[indexPath.row];
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomSearchRecordViewControllerEveryoneSearch:)]) {
|
||||||
|
[self.delegate xPRoomSearchRecordViewControllerEveryoneSearch:str];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
XPMineFootPrintModel *resultModel = self.inRoomList[indexPath.row];
|
XPMineFootPrintModel *resultModel = self.inRoomList[indexPath.row];
|
||||||
[self dismissViewControllerAnimated:YES completion:nil];
|
[self dismissViewControllerAnimated:YES completion:nil];
|
||||||
@@ -228,6 +226,10 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
NSString *str = [self.searchList safeObjectAtIndex1:indexPath.row];
|
NSString *str = [self.searchList safeObjectAtIndex1:indexPath.row];
|
||||||
CGFloat width = [str boundingRectWithSize:CGSizeMake(200, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:12]} context:nil].size.width;
|
CGFloat width = [str boundingRectWithSize:CGSizeMake(200, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:12]} context:nil].size.width;
|
||||||
return CGSizeMake(width + 26, 26);
|
return CGSizeMake(width + 26, 26);
|
||||||
|
} else if(collectionView == self.everyOneCollectionView){
|
||||||
|
NSString *str = [self.everyoneSearchList safeObjectAtIndex1:indexPath.row];
|
||||||
|
CGFloat width = [str boundingRectWithSize:CGSizeMake(200, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:12]} context:nil].size.width;
|
||||||
|
return CGSizeMake(width + 26, 26);
|
||||||
} else {
|
} else {
|
||||||
return CGSizeMake(56, 75);
|
return CGSizeMake(56, 75);
|
||||||
}
|
}
|
||||||
@@ -275,6 +277,14 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
[self initSearchRecordData];
|
[self initSearchRecordData];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///获取大家都在搜列表成功
|
||||||
|
- (void)getEveryoneSearchListSuccess:(NSArray<XPMineFootPrintModel *> *)array {
|
||||||
|
[self.everyoneSearchList removeAllObjects];
|
||||||
|
[self.everyoneSearchList addObjectsFromArray:array];
|
||||||
|
self.allSearchContentView.hidden = array.count == 0;
|
||||||
|
[self.everyOneCollectionView reloadData];
|
||||||
|
}
|
||||||
|
|
||||||
///获取进房记录成功
|
///获取进房记录成功
|
||||||
- (void)getInRoomRecordSuccess:(NSArray<XPMineFootPrintModel *> *)array {
|
- (void)getInRoomRecordSuccess:(NSArray<XPMineFootPrintModel *> *)array {
|
||||||
[self.inRoomList removeAllObjects];
|
[self.inRoomList removeAllObjects];
|
||||||
@@ -302,9 +312,6 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
[self cleanSearchRecord];
|
[self cleanSearchRecord];
|
||||||
[self.searchList removeAllObjects];
|
[self.searchList removeAllObjects];
|
||||||
[self.searchCollectionView reloadData];
|
[self.searchCollectionView reloadData];
|
||||||
[self.searchContentView mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.height.mas_equalTo(0);
|
|
||||||
}];
|
|
||||||
self.searchContentView.hidden = YES;
|
self.searchContentView.hidden = YES;
|
||||||
} cancelHandler:^{
|
} cancelHandler:^{
|
||||||
}];
|
}];
|
||||||
@@ -326,18 +333,20 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
if (!_contentStackView) {
|
if (!_contentStackView) {
|
||||||
_contentStackView = [[UIStackView alloc] init];
|
_contentStackView = [[UIStackView alloc] init];
|
||||||
_contentStackView.axis = UILayoutConstraintAxisVertical;
|
_contentStackView.axis = UILayoutConstraintAxisVertical;
|
||||||
// _contentStackView.distribution = UIStackViewDistributionFill;
|
_contentStackView.distribution = UIStackViewDistributionFill;
|
||||||
// _contentStackView.alignment = UIStackViewAlignmentFill;
|
_contentStackView.alignment = UIStackViewAlignmentFill;
|
||||||
|
_contentStackView.alignment = UIStackViewAlignmentCenter;
|
||||||
_contentStackView.spacing = 0;
|
_contentStackView.spacing = 0;
|
||||||
}
|
}
|
||||||
return _contentStackView;
|
return _contentStackView;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIView *)everyoneSearchContentView {
|
- (UIView *)allSearchContentView {
|
||||||
if (!_everyoneSearchContentView) {
|
if (!_allSearchContentView) {
|
||||||
_everyoneSearchContentView = [[UIView alloc] init];
|
_allSearchContentView = [[UIView alloc] init];
|
||||||
|
_allSearchContentView.hidden = YES;
|
||||||
}
|
}
|
||||||
return _everyoneSearchContentView;
|
return _allSearchContentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -459,6 +468,13 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
return _inRoomList;
|
return _inRoomList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSMutableArray *)everyoneSearchList {
|
||||||
|
if (!_everyoneSearchList) {
|
||||||
|
_everyoneSearchList = [NSMutableArray array];
|
||||||
|
}
|
||||||
|
return _everyoneSearchList;
|
||||||
|
}
|
||||||
|
|
||||||
- (UIView *)searchContentView {
|
- (UIView *)searchContentView {
|
||||||
if (!_searchContentView) {
|
if (!_searchContentView) {
|
||||||
_searchContentView = [[UIView alloc] init];
|
_searchContentView = [[UIView alloc] init];
|
||||||
@@ -473,5 +489,14 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
|
|||||||
return _roomContentView;
|
return _roomContentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (UIView *)placeHolderView {
|
||||||
|
if (!_placeHolderView) {
|
||||||
|
_placeHolderView = [[UIView alloc] init];
|
||||||
|
_placeHolderView.backgroundColor = [UIColor clearColor];
|
||||||
|
[_placeHolderView setContentHuggingPriority:UILayoutPriorityDragThatCanResizeScene forAxis:UILayoutConstraintAxisHorizontal];
|
||||||
|
[_placeHolderView setContentCompressionResistancePriority:UILayoutPriorityFittingSizeLevel forAxis:UILayoutConstraintAxisHorizontal];
|
||||||
|
}
|
||||||
|
return _placeHolderView;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -271,6 +271,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
/// @param roomType 类型:4:个播房;其他:派对房;不传:所有房间
|
/// @param roomType 类型:4:个播房;其他:派对房;不传:所有房间
|
||||||
+ (void)requestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType;
|
+ (void)requestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType;
|
||||||
|
|
||||||
|
/// 请求大家都在搜列表
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param uid uid
|
||||||
|
+ (void)requestEveryoneSearch:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -302,4 +302,12 @@
|
|||||||
[self makeRequest:@"fans/fansRoomList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid , page, pageSize, roomType, nil];
|
[self makeRequest:@"fans/fansRoomList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid , page, pageSize, roomType, nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 请求大家都在搜列表
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param uid uid
|
||||||
|
+ (void)requestEveryoneSearch:(HttpRequestHelperCompletion)completion uid:(NSString *)uid {
|
||||||
|
#warning todo
|
||||||
|
[self makeRequest:@"" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -118,7 +118,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - XPHomeSearchProtocol
|
#pragma mark - XPHomeSearchProtocol
|
||||||
- (void)searchRoomSuccess:(NSArray *)data {
|
- (void)searchRoomSuccess:(NSArray *)data type:(nonnull NSString *)type {
|
||||||
self.datasource = data;
|
self.datasource = data;
|
||||||
[self.tableView reloadData];
|
[self.tableView reloadData];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user