我的
This commit is contained in:
@@ -29,19 +29,23 @@
|
||||
#import "QXInviteViewController.h"
|
||||
#import "QXChatViewController.h"
|
||||
#import "QXWalletRuleView.h"
|
||||
#import "QXRechargeViewcController.h"
|
||||
#import "QXGiftWallViewController.h"
|
||||
#import <WXApi.h>
|
||||
|
||||
@interface QXMineViewController ()<UITableViewDelegate,UITableViewDataSource,QXMineServiceCellDelegate,QXMainHeaderViewDelegate>
|
||||
@property (nonatomic,strong)QXMainHeaderView *tableHeaderView;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)UIButton *redbagBtn;
|
||||
@property (nonatomic,strong)UIButton *serviceBtn;
|
||||
@property (nonatomic,strong)UIButton *settingBtn;
|
||||
//@property (nonatomic,strong)UIButton *redbagBtn;
|
||||
//@property (nonatomic,strong)UIButton *serviceBtn;
|
||||
//@property (nonatomic,strong)UIButton *settingBtn;
|
||||
@property (nonatomic,strong)QXUserModel *userModel;
|
||||
@end
|
||||
|
||||
@implementation QXMineViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.isNoChangeBgImage = YES;
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
@@ -51,34 +55,31 @@
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
[self getUserInfo];
|
||||
[self.tableView reloadData];
|
||||
if (QXGlobal.shareGlobal.isOpenRecharge) {
|
||||
self.redbagBtn.hidden = NO;
|
||||
}else{
|
||||
self.redbagBtn.hidden = YES;
|
||||
}
|
||||
[self.tableHeaderView reloadData];
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
[self updateBgImage:@"app_home_bg"];
|
||||
self.tableView.tableHeaderView = self.tableHeaderView;
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.view addSubview:self.settingBtn];
|
||||
[self.view addSubview:self.serviceBtn];
|
||||
[self.view addSubview:self.redbagBtn];
|
||||
[self.settingBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kSafeAreaTop +10);
|
||||
make.right.mas_equalTo(-10);
|
||||
make.width.height.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
[self.serviceBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(30);
|
||||
make.centerY.equalTo(self.settingBtn);
|
||||
make.right.equalTo(self.settingBtn.mas_left).offset(-10);
|
||||
}];
|
||||
[self.redbagBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.serviceBtn.mas_left).offset(-10);
|
||||
make.centerY.width.height.equalTo(self.settingBtn);
|
||||
}];
|
||||
// [self.view addSubview:self.settingBtn];
|
||||
// [self.view addSubview:self.serviceBtn];
|
||||
// [self.view addSubview:self.redbagBtn];
|
||||
// [self.settingBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.top.mas_equalTo(kSafeAreaTop +10);
|
||||
// make.right.mas_equalTo(-10);
|
||||
// make.width.height.mas_equalTo(30);
|
||||
// }];
|
||||
//
|
||||
// [self.serviceBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.width.height.mas_equalTo(30);
|
||||
// make.centerY.equalTo(self.settingBtn);
|
||||
// make.right.equalTo(self.settingBtn.mas_left).offset(-10);
|
||||
// }];
|
||||
// [self.redbagBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.right.equalTo(self.serviceBtn.mas_left).offset(-10);
|
||||
// make.centerY.width.height.equalTo(self.settingBtn);
|
||||
// }];
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(passwordDidChanged) name:noticeChangePassword object:nil];
|
||||
}
|
||||
-(void)getUserInfo{
|
||||
@@ -89,39 +90,63 @@
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
|
||||
weakSelf.tableHeaderView.coin = coin;
|
||||
weakSelf.tableHeaderView.earnings = earnings;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - QXMineServiceCellDelegate
|
||||
-(void)didClickServiceWithBtn:(UIButton *)button title:(NSString *)title{
|
||||
UIViewController *vc;
|
||||
if ([title isEqualToString:QXText(@"道具商城")]) {
|
||||
vc = [[QXPropShopViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"段位")]){
|
||||
vc = [[QXLevelViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"公会中心")]){
|
||||
vc = [[QXGuildViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"个性装扮")]){
|
||||
vc = [[QXDressViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"我的背包")]){
|
||||
vc = [[QXBackpackViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"每日任务")]){
|
||||
vc = [[QXTaskViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"钱包")]){
|
||||
BOOL result = [[NSUserDefaults standardUserDefaults] boolForKey:kWalletRuleHide];
|
||||
if (result) {
|
||||
vc = [[QXWalletViewController alloc] init];
|
||||
}else{
|
||||
QXWalletRuleView *ruleView = [[QXWalletRuleView alloc] init];
|
||||
MJWeakSelf
|
||||
ruleView.toWalletBlock = ^{
|
||||
QXWalletViewController*vc = [[QXWalletViewController alloc] init];
|
||||
[weakSelf.navigationController pushViewController:vc animated:YES];
|
||||
};
|
||||
[ruleView showInView:self.view];
|
||||
return;
|
||||
-(void)didClickServiceWithType:(QXMineServiceType)type{
|
||||
switch (type) {
|
||||
case QXMineServiceTypeLevel:{
|
||||
QXLevelViewController *vc = [[QXLevelViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMineServiceTypeDress:{
|
||||
QXDressViewController *vc = [[QXDressViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMineServiceTypeBackpack:{
|
||||
QXBackpackViewController *vc = [[QXBackpackViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMineServiceTypeSetting:{
|
||||
[self gotoSetting];
|
||||
}
|
||||
break;
|
||||
case QXMineServiceTypeHelp:{
|
||||
[self gotoService];
|
||||
}
|
||||
break;
|
||||
case QXMineServiceTypeInvite:{
|
||||
[self gotoInvite];
|
||||
}
|
||||
break;
|
||||
case QXMineServiceTypeDayTask:{
|
||||
QXTaskViewController *vc = [[QXTaskViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMineServiceTypeReport:{
|
||||
[self gotoService];
|
||||
}
|
||||
break;
|
||||
case QXMineServiceTypeCustomerService:{
|
||||
WXOpenCustomerServiceReq *req = [[WXOpenCustomerServiceReq alloc] init];
|
||||
req.corpid = @"ww1de4300858c0b461";
|
||||
req.url = @"https://work.weixin.qq.com/kfid/kfcb3d23a59c188a0e7";
|
||||
[WXApi sendReq:req completion:nil];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
QXLOG(@"点击了%@",title);
|
||||
}
|
||||
-(void)didClickOptionType:(QXMainHeaderOptionType)type{
|
||||
MJWeakSelf
|
||||
@@ -140,12 +165,56 @@
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeRealName:{
|
||||
QXLOG(@"跳转实名认证");
|
||||
case QXMainHeaderOptionTypeNobility:{
|
||||
QXLOG(@"跳转贵族");
|
||||
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeAnchorCenter:{
|
||||
QXLOG(@"跳转主播中心");
|
||||
case QXMainHeaderOptionTypeRecharge:{
|
||||
QXLOG(@"跳转充值");
|
||||
QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeShop:{
|
||||
QXLOG(@"跳转商城");
|
||||
QXPropShopViewController *vc = [[QXPropShopViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeGuild:{
|
||||
QXLOG(@"跳转公会");
|
||||
QXGuildViewController *vc = [[QXGuildViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeFriend:{
|
||||
QXLOG(@"跳转挚友");
|
||||
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeGiftWall:{
|
||||
QXLOG(@"跳转礼物墙");
|
||||
QXGiftWallViewController *vc = [[QXGiftWallViewController alloc] init];
|
||||
vc.userId = [QXGlobal shareGlobal].loginModel.user_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeWallet:{
|
||||
QXLOG(@"跳转钱包");
|
||||
BOOL result = [[NSUserDefaults standardUserDefaults] boolForKey:kWalletRuleHide];
|
||||
if (result) {
|
||||
QXWalletViewController * vc = [[QXWalletViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
QXWalletRuleView *ruleView = [[QXWalletRuleView alloc] init];
|
||||
MJWeakSelf
|
||||
ruleView.toWalletBlock = ^{
|
||||
QXWalletViewController*vc = [[QXWalletViewController alloc] init];
|
||||
[weakSelf.navigationController pushViewController:vc animated:YES];
|
||||
};
|
||||
[ruleView showInView:self.view];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeRoom:{
|
||||
@@ -198,15 +267,29 @@
|
||||
|
||||
#pragma mark - UITableViewDelegate,UITableViewDataSource
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXMineServiceCell *cell = [QXMineServiceCell cellWithTableView:tableView];
|
||||
cell.delegate = self;
|
||||
[cell cellReload];
|
||||
if (indexPath.row == 0) {
|
||||
cell.isMore = NO;
|
||||
}else{
|
||||
cell.isMore = YES;
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.row == 0) {
|
||||
return ScaleWidth(110);
|
||||
}else{
|
||||
if (QXGlobal.shareGlobal.isOpenRecharge) {
|
||||
return ScaleWidth(168);
|
||||
}else{
|
||||
return ScaleWidth(110);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-(void)gotoSetting{
|
||||
QXSettingViewController *vc = [[QXSettingViewController alloc] init];
|
||||
@@ -220,7 +303,7 @@
|
||||
};
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(void)gotoRedbag{
|
||||
-(void)gotoInvite{
|
||||
QXInviteViewController *vc = [[QXInviteViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
@@ -262,49 +345,48 @@
|
||||
|
||||
-(QXMainHeaderView *)tableHeaderView{
|
||||
if (!_tableHeaderView) {
|
||||
_tableHeaderView = [[QXMainHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 230+12-67+ScaleWidth(67))];
|
||||
_tableHeaderView = [[QXMainHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 0)];
|
||||
_tableHeaderView.height = _tableHeaderView.getHeight;
|
||||
_tableHeaderView.delegate = self;
|
||||
}
|
||||
return _tableHeaderView;
|
||||
}
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-TabbarContentHeight-kSafeAreaTop) style:UITableViewStylePlain];
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-TabbarContentHeight) style:UITableViewStylePlain];
|
||||
self.tableView.backgroundColor = [UIColor clearColor];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
|
||||
self.tableView.rowHeight = 164;
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
-(UIButton *)settingBtn{
|
||||
if (!_settingBtn) {
|
||||
_settingBtn = [[UIButton alloc] init];
|
||||
[_settingBtn setImage:[UIImage imageNamed:@"mine_setting"] forState:UIControlStateNormal];
|
||||
[_settingBtn setImage:[UIImage imageNamed:@"mine_setting"] forState:UIControlStateHighlighted];
|
||||
[_settingBtn addTarget:self action:@selector(gotoSetting) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _settingBtn;
|
||||
}
|
||||
- (UIButton *)redbagBtn {
|
||||
if (!_redbagBtn) {
|
||||
_redbagBtn = [[UIButton alloc] init];
|
||||
[_redbagBtn setImage:[UIImage imageNamed:@"mine_redbag"] forState:UIControlStateNormal];
|
||||
[_redbagBtn setImage:[UIImage imageNamed:@"mine_redbag"] forState:UIControlStateHighlighted];
|
||||
[_redbagBtn addTarget:self action:@selector(gotoRedbag) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _redbagBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)serviceBtn {
|
||||
if (!_serviceBtn) {
|
||||
_serviceBtn = [[UIButton alloc] init];
|
||||
[_serviceBtn setImage:[UIImage imageNamed:@"mine_service"] forState:UIControlStateNormal];
|
||||
[_serviceBtn setImage:[UIImage imageNamed:@"mine_service"] forState:UIControlStateHighlighted];
|
||||
[_serviceBtn addTarget:self action:@selector(gotoService) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _serviceBtn;
|
||||
}
|
||||
//-(UIButton *)settingBtn{
|
||||
// if (!_settingBtn) {
|
||||
// _settingBtn = [[UIButton alloc] init];
|
||||
// [_settingBtn setImage:[UIImage imageNamed:@"mine_setting"] forState:UIControlStateNormal];
|
||||
// [_settingBtn setImage:[UIImage imageNamed:@"mine_setting"] forState:UIControlStateHighlighted];
|
||||
// [_settingBtn addTarget:self action:@selector(gotoSetting) forControlEvents:UIControlEventTouchUpInside];
|
||||
// }
|
||||
// return _settingBtn;
|
||||
//}
|
||||
//- (UIButton *)redbagBtn {
|
||||
// if (!_redbagBtn) {
|
||||
// _redbagBtn = [[UIButton alloc] init];
|
||||
// [_redbagBtn setImage:[UIImage imageNamed:@"mine_redbag"] forState:UIControlStateNormal];
|
||||
// [_redbagBtn setImage:[UIImage imageNamed:@"mine_redbag"] forState:UIControlStateHighlighted];
|
||||
// [_redbagBtn addTarget:self action:@selector(gotoRedbag) forControlEvents:UIControlEventTouchUpInside];
|
||||
// }
|
||||
// return _redbagBtn;
|
||||
//}
|
||||
//
|
||||
//- (UIButton *)serviceBtn {
|
||||
// if (!_serviceBtn) {
|
||||
// _serviceBtn = [[UIButton alloc] init];
|
||||
// [_serviceBtn setImage:[UIImage imageNamed:@"mine_service"] forState:UIControlStateNormal];
|
||||
// [_serviceBtn setImage:[UIImage imageNamed:@"mine_service"] forState:UIControlStateHighlighted];
|
||||
// [_serviceBtn addTarget:self action:@selector(gotoService) forControlEvents:UIControlEventTouchUpInside];
|
||||
// }
|
||||
// return _serviceBtn;
|
||||
//}
|
||||
@end
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
self.categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
|
||||
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0);
|
||||
// self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0);
|
||||
|
||||
|
||||
// self.backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kSafeAreaTop, 40, 40)];
|
||||
|
||||
19
QXLive/Mine(音域)/Controller/礼物墙/QXGiftWallSubViewController.h
Normal file
19
QXLive/Mine(音域)/Controller/礼物墙/QXGiftWallSubViewController.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// QXGiftWallSubViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/5.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXGiftWallSubViewController : QXBaseViewController<JXCategoryListContentViewDelegate>
|
||||
/// 是否为已点亮
|
||||
@property(nonatomic,assign)BOOL isLight;
|
||||
/// 数据源
|
||||
@property(nonatomic,strong)NSArray<QXUserGiftWallModel*> *giftArray;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
62
QXLive/Mine(音域)/Controller/礼物墙/QXGiftWallSubViewController.m
Normal file
62
QXLive/Mine(音域)/Controller/礼物墙/QXGiftWallSubViewController.m
Normal file
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// QXGiftWallSubViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/5.
|
||||
//
|
||||
|
||||
#import "QXGiftWallSubViewController.h"
|
||||
#import "QXMineGiftWallCell.h"
|
||||
|
||||
@interface QXGiftWallSubViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@end
|
||||
|
||||
@implementation QXGiftWallSubViewController
|
||||
-(UIView *)listView{
|
||||
return self.view;
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
- (void)initSubViews{
|
||||
self.bgImageHidden = YES;
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
int itemWidth = (SCREEN_WIDTH-16*2-12*2)/3;
|
||||
layout.itemSize = CGSizeMake(itemWidth, ScaleWidth(143));
|
||||
layout.minimumLineSpacing = 12;
|
||||
layout.minimumInteritemSpacing = 12;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
[self.collectionView registerNib:[UINib nibWithNibName:@"QXMineGiftWallCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXMineGiftWallCell"];
|
||||
self.collectionView.delegate = self;
|
||||
self.collectionView.dataSource = self;
|
||||
self.collectionView.showsHorizontalScrollIndicator = NO;
|
||||
self.collectionView.bounces = NO;
|
||||
self.collectionView.pagingEnabled = NO;
|
||||
self.collectionView.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.collectionView];
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(0);
|
||||
make.top.mas_equalTo(0);
|
||||
make.bottom.mas_equalTo(0);
|
||||
make.right.mas_equalTo(0);
|
||||
}];
|
||||
}
|
||||
-(void)setGiftArray:(NSArray<QXUserGiftWallModel *> *)giftArray{
|
||||
_giftArray = giftArray;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.giftArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXMineGiftWallCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXMineGiftWallCell" forIndexPath:indexPath];
|
||||
cell.isLight = self.isLight;
|
||||
cell.model = self.giftArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/礼物墙/QXGiftWallViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/礼物墙/QXGiftWallViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXGiftWallViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/5.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXGiftWallViewController : QXBaseViewController
|
||||
@property (nonatomic,strong)NSString*userId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
118
QXLive/Mine(音域)/Controller/礼物墙/QXGiftWallViewController.m
Normal file
118
QXLive/Mine(音域)/Controller/礼物墙/QXGiftWallViewController.m
Normal file
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// QXGiftWallViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/5.
|
||||
//
|
||||
|
||||
#import "QXGiftWallViewController.h"
|
||||
#import "QXGiftWallSubViewController.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXGiftWallViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
|
||||
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
|
||||
@property (nonatomic,strong)NSMutableArray <UIViewController*>*listVCArray;
|
||||
@property (nonatomic,strong)NSArray*titles;
|
||||
@property (nonatomic,strong)QXGiftWallSubViewController *lightVC;
|
||||
@property (nonatomic,strong)QXGiftWallSubViewController *grayVC;
|
||||
@end
|
||||
|
||||
@implementation QXGiftWallViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:RGB16(0xffffff)};
|
||||
}
|
||||
-(void)viewWillDisappear:(BOOL)animated{
|
||||
[super viewWillDisappear:animated];
|
||||
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:RGB16(0x000000)};
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = @"礼物墙";
|
||||
|
||||
}
|
||||
|
||||
-(void)initSubViews{
|
||||
// if ([QXConfig.backgroundImage hasPrefix:@"http"] || [QXConfig.backgroundImage hasPrefix:@"https"]) {
|
||||
// [self updateBgImage:QXConfig.backgroundImage];
|
||||
// }else{
|
||||
[self updateBgImage:@"home_rank_vc_bg"];
|
||||
// }
|
||||
self.navigationTintColor = RGB16(0xffffff);
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
// self.titles = @[@"房间榜", @"财富榜", @"魅力榜",@"公会榜",@"真爱榜"];
|
||||
self.titles = @[@"已点亮", @"未点亮"];
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
self.categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(16, NavContentHeight, SCREEN_WIDTH, 44);
|
||||
self.categoryView.delegate = self;
|
||||
self.categoryView.titles = self.titles;
|
||||
self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#ffffff"];
|
||||
self.categoryView.titleColor = [UIColor colorWithHexString:@"#ffffff"];
|
||||
JXCategoryIndicatorImageView *indicatorImageView = [[JXCategoryIndicatorImageView alloc] init];
|
||||
indicatorImageView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
|
||||
indicatorImageView.indicatorWidth = (SCREEN_WIDTH-100)/self.titles.count;
|
||||
indicatorImageView.indicatorHeight = 5;
|
||||
self.categoryView.indicators = @[indicatorImageView];
|
||||
self.categoryView.cellWidth = JXCategoryViewAutomaticDimension;
|
||||
self.categoryView.contentEdgeInsetLeft = 5;
|
||||
self.categoryView.cellSpacing = 20;
|
||||
self.categoryView.titleLabelZoomScale = 1.1;
|
||||
self.categoryView.titleLabelZoomEnabled = YES;
|
||||
self.categoryView.titleFont = [UIFont systemFontOfSize:14];
|
||||
self.categoryView.averageCellSpacingEnabled = NO;
|
||||
|
||||
self.containerView = [[JXCategoryListContainerView alloc] initWithType:(JXCategoryListContainerType_ScrollView) delegate:self];
|
||||
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom);
|
||||
[self.view addSubview: self.categoryView];
|
||||
[self.view addSubview:self.containerView];
|
||||
self.categoryView.listContainer = self.containerView;
|
||||
[self getGiftWall];
|
||||
}
|
||||
|
||||
-(void)getGiftWall{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork userGiftWallithUserId:self.userId successBlock:^(NSArray<QXUserGiftWallModel *> * _Nonnull lightList, NSArray<QXUserGiftWallModel *> * _Nonnull grayList) {
|
||||
weakSelf.lightVC.giftArray = lightList;
|
||||
weakSelf.grayVC.giftArray = grayList;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
|
||||
return self.titles.count;
|
||||
}
|
||||
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
if (index == 0) {
|
||||
return self.lightVC;
|
||||
}else{
|
||||
return self.grayVC;
|
||||
}
|
||||
}
|
||||
-(QXGiftWallSubViewController *)lightVC{
|
||||
if (!_lightVC) {
|
||||
_lightVC = [[QXGiftWallSubViewController alloc] init];
|
||||
_lightVC.isLight = YES;
|
||||
}
|
||||
return _lightVC;
|
||||
}
|
||||
|
||||
-(QXGiftWallSubViewController *)grayVC{
|
||||
if (!_grayVC) {
|
||||
_grayVC = [[QXGiftWallSubViewController alloc] init];
|
||||
_grayVC.isLight = NO;
|
||||
}
|
||||
return _grayVC;
|
||||
}
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user