二卡八不显示离线,背包礼物一键全送增加提示

This commit is contained in:
启星
2025-10-10 09:29:26 +08:00
parent b0bab1f1be
commit 5adf8e8412
16 changed files with 577 additions and 349 deletions

View File

@@ -38,6 +38,10 @@
// Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
QXLOG(@"========首页子控制器即将展示========");
}
-(void)initSubViews{
self.page = 1;
[self.view addSubview:self.collectionView];
@@ -48,24 +52,28 @@
[super viewDidAppear:animated];
[self.collectionView reloadData];
}
-(void)setRoomType:(QXMyRoomType *)roomType{
_roomType = roomType;
[self getRoomList];
}
- (void)getRoomList {
__weak typeof(self)weakSelf = self;
// __weak typeof(self)weakSelf = self;
@weakify(self)
[QXHomePageNetwork homeRoomListWithPage:self.page is_top:NO label_id:self.roomType.id successBlock:^(NSArray<QXRoomListModel *> * _Nonnull list, BOOL isAppStore) {
if (weakSelf.page == 1) {
[weakSelf.dataArray removeAllObjects];
@strongify(self)
if (self.page == 1) {
[self.dataArray removeAllObjects];
}
[weakSelf.dataArray addObjectsFromArray:list];
[weakSelf.collectionView reloadData];
[self.dataArray addObjectsFromArray:list];
[self.collectionView reloadData];
if (list.count == 0) {
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
self.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
[weakSelf.collectionView.mj_footer endRefreshing];
[self.collectionView.mj_footer endRefreshing];
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
@strongify(self)
[self.collectionView.mj_footer endRefreshing];
}];
}
@@ -113,10 +121,12 @@
_collectionView.dataSource = self;
_collectionView.backgroundColor = [UIColor clearColor];
[_collectionView registerNib:[UINib nibWithNibName:@"QXHomeRoomCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXHomeRoomCell"];
MJWeakSelf
// MJWeakSelf
@weakify(self)
_collectionView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf getRoomList];
@strongify(self)
self.page++;
[self getRoomList];
}];
}
return _collectionView;

View File

@@ -121,11 +121,13 @@
self.categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
self.pagingView.listContainerView.listCellBackgroundColor = [UIColor clearColor];
// [self performSelector:@selector(giftScrollViewShow) afterDelay:5];
MJWeakSelf
// MJWeakSelf
@weakify(self)
self.pagingView.mainTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
[weakSelf requestSlideToolData];
[weakSelf getTopRoomList];
[weakSelf getBanner];
@strongify(self)
[self requestSlideToolData];
[self getTopRoomList];
[self getBanner];
}];
self.firstRechargeBtn.hidden = YES;
@@ -151,26 +153,28 @@
[self getBanner];
}
- (void)requestSlideToolData {
__weak typeof(self) weakSelf = self;
@weakify(self)
[QXHomePageNetwork homeRoomLabelListsuccessBlock:^(NSArray<QXMyRoomType *> * _Nonnull list) {
[weakSelf.titles removeAllObjects];
@strongify(self)
[self.titles removeAllObjects];
NSMutableArray *arr = [NSMutableArray array];
[weakSelf.titles addObjectsFromArray:list];
[self.titles addObjectsFromArray:list];
for (QXMyRoomType *md in list) {
[arr addObject:md.label_name];
}
weakSelf.categoryView.titles = arr;
[weakSelf.categoryView reloadData];
[weakSelf.pagingView.mainTableView.mj_header endRefreshing];
self.categoryView.titles = arr;
[self.categoryView reloadData];
[self.pagingView.mainTableView.mj_header endRefreshing];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
[weakSelf.pagingView.mainTableView.mj_header endRefreshing];
[self.pagingView.mainTableView.mj_header endRefreshing];
}];
}
-(void)getFirstRechargePermission{
MJWeakSelf
@weakify(self)
[QXHomePageNetwork getFirstRechargePermissionSuccessBlock:^(BOOL isShow) {
weakSelf.firstRechargeBtn.hidden = !isShow;
@strongify(self)
self.firstRechargeBtn.hidden = !isShow;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
@@ -183,7 +187,7 @@
// [v showInView:self.view];
}
-(void)popFirstRechargeView{
MJWeakSelf
// MJWeakSelf
// view.giftArray = @[@"",@"",@"",@"",@"",@""];
self.firstRechargeView.closeActionBlock = ^{
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
@@ -267,33 +271,35 @@
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.roomId isRejoin:NO navagationController:self.navigationController];
}
- (void)getTopRoomList {
__weak typeof(self)weakSelf = self;
@weakify(self)
[QXHomePageNetwork homeRoomListWithPage:0 is_top:YES label_id:@"" successBlock:^(NSArray<QXRoomListModel *> * _Nonnull list, BOOL isAppStore) {
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:list];
@strongify(self)
[self.dataArray removeAllObjects];
[self.dataArray addObjectsFromArray:list];
if (isAppStore) {
self.appStoreView.hidden = NO;
}else{
self.appStoreView.hidden = YES;
}
// weakSelf.appStoreView.dataArray = list;
[weakSelf.cycleScrollView reloadData];
[self.cycleScrollView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)getBanner{
MJWeakSelf
@weakify(self)
[QXHomePageNetwork homeBannerSuccessBlock:^(NSArray<QXBanner *> * _Nonnull list) {
@strongify(self)
NSMutableArray *arr = [NSMutableArray array];
for (QXBanner *banner in list) {
[arr addObject:banner.image];
}
[weakSelf.bannerArry removeAllObjects];
[weakSelf.bannerArry addObjectsFromArray:list];
weakSelf.appStoreView.bannerArray = list;
weakSelf.bannerScrollView.imageURLStringsGroup = arr;
[self.bannerArry removeAllObjects];
[self.bannerArry addObjectsFromArray:list];
self.appStoreView.bannerArray = list;
self.bannerScrollView.imageURLStringsGroup = arr;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
@@ -505,4 +511,7 @@
}
return _appStoreView;
}
-(void)dealloc{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
@end

View File

@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXDirectSetScaleView : UIView
@property (nonatomic,strong)NSString *userId;
@property (nonatomic,strong)NSString *roomId;
/// 转币
@property (nonatomic,assign)BOOL isGiveCoin;
/// 头条

View File

@@ -39,6 +39,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 麦位视图类型
@property (nonatomic,assign)QXRoomSeatContentViewType type;
/// 是否展示离线状态 需求暂定二卡八不展示离线状态
@property (nonatomic,assign)BOOL noOffLine;
//@property (nonatomic,strong)QXRoomOwnerModel *userModel ;
-(void)updateUserCharm:(NSString*)charm;

View File

@@ -197,6 +197,9 @@
}
-(void)onlineStatusDidChanged:(NSNotification*)notice{
if (self.noOffLine) {
return;
}
NSDictionary *parm = notice.object;
NSString *uid = [NSString stringWithFormat:@"%@",[parm objectForKey:@"user_id"]];
BOOL isOnline = [[parm objectForKey:@"is_online"] boolValue];
@@ -232,6 +235,9 @@
[self stopAudioAnimation];
}
}
-(void)setNoOffLine:(BOOL)noOffLine{
_noOffLine = noOffLine;
}
-(void)setIsPK:(BOOL)isPK{
_isPK = isPK;
self.nameLabel.font = [UIFont systemFontOfSize:10];
@@ -365,7 +371,11 @@
if (pitModel.user_id.longValue > 0) {
BOOL is_offline = [[[QXGlobal shareGlobal].offLineDict objectForKey:pitModel.user_id?pitModel.user_id:@"0"] boolValue];
if (is_offline) {
self.offlineImageView.hidden = NO;
if (self.noOffLine) {
self.offlineImageView.hidden = YES;
}else{
self.offlineImageView.hidden = NO;
}
}else{
self.offlineImageView.hidden = YES;
}

View File

@@ -74,6 +74,7 @@ static NSInteger maxSeat = 8;
for (int i = 0 ; i < maxSeat ; i++) {
QXRoomSeatContentView *contentView = [[QXRoomSeatContentView alloc] init];
contentView.number = i+1;
contentView.noOffLine = YES;
// [contentView addTapBlock:^(id _Nonnull obj) {
// [weakSelf didClickSeatView:obj];
// }];
@@ -88,6 +89,8 @@ static NSInteger maxSeat = 8;
}
[self.seatArray addObject:self.compereView];
[self.seatArray addObject:self.guestView];
self.compereView.noOffLine = YES;
self.guestView.noOffLine = YES;
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

View File

@@ -39,7 +39,7 @@
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fzl-QL-ad0">
<rect key="frame" x="101" y="40" width="244" height="17"/>
<rect key="frame" x="101" y="40" width="35.333333333333343" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
@@ -47,13 +47,13 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="33" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="M4J-MV-C6I">
<rect key="frame" x="383" y="40" width="55" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="55" id="Y5D-hq-2Hl"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="55" id="Y5D-hq-2Hl"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Vector" translatesAutoresizingMaskIntoConstraints="NO" id="6vu-N8-8uU">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="room_hot_icon" translatesAutoresizingMaskIntoConstraints="NO" id="6vu-N8-8uU">
<rect key="frame" x="355" y="38.666666666666664" width="20" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="20" id="RPP-W2-uG7"/>
@@ -66,7 +66,6 @@
<constraint firstItem="fzl-QL-ad0" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="6qM-F0-kaU"/>
<constraint firstItem="A6u-gx-qxe" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="KTD-SJ-b98"/>
<constraint firstItem="fzl-QL-ad0" firstAttribute="leading" secondItem="HlF-Pn-DKh" secondAttribute="trailing" constant="16" id="KTy-bw-0M9"/>
<constraint firstItem="6vu-N8-8uU" firstAttribute="leading" secondItem="fzl-QL-ad0" secondAttribute="trailing" constant="10" id="KfJ-GU-xhc"/>
<constraint firstItem="HlF-Pn-DKh" firstAttribute="leading" secondItem="A6u-gx-qxe" secondAttribute="trailing" constant="10" id="QEi-Df-wpG"/>
<constraint firstItem="HlF-Pn-DKh" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="UMC-XC-UHT"/>
<constraint firstItem="6vu-N8-8uU" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="Wg4-GR-Vo4"/>
@@ -86,7 +85,7 @@
</tableViewCell>
</objects>
<resources>
<image name="Vector" width="14" height="14"/>
<image name="user_header_placehoulder" width="128" height="128"/>
<image name="room_hot_icon" width="16" height="16"/>
<image name="user_header_placehoulder" width="60" height="60"/>
</resources>
</document>