diff --git a/QXLive.xcodeproj/project.pbxproj b/QXLive.xcodeproj/project.pbxproj index efc808c..abd0656 100644 --- a/QXLive.xcodeproj/project.pbxproj +++ b/QXLive.xcodeproj/project.pbxproj @@ -754,7 +754,7 @@ CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 8798G5VMH9; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -793,7 +793,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.1.15; + MARKETING_VERSION = 1.1.16; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -820,7 +820,7 @@ CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 8798G5VMH9; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -859,7 +859,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.1.15; + MARKETING_VERSION = 1.1.16; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/QXLive/Base/QXAppStartViewController.m b/QXLive/Base/QXAppStartViewController.m index f2174bd..d841509 100644 --- a/QXLive/Base/QXAppStartViewController.m +++ b/QXLive/Base/QXAppStartViewController.m @@ -50,10 +50,7 @@ @property (nonatomic,strong)NSString *icon_wd_notselect; */ -(void)getAppTheme{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *themeUrl = [NSString stringWithFormat:@"%@%@",server,QXAppTheme]; [[QXRequset shareInstance] getWithUrl:themeUrl parameters:@{} needCache:NO success:^(id responseObject) { [QXConfig defaultConfig]; @@ -158,6 +155,8 @@ } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { NSLog(@"请求失败"); [self alertNetworkError]; + QXGlobal.shareGlobal.currentServer = RServerUrl; + QXGlobal.shareGlobal.currentH5Server = RH5ServerUrl; QXGlobal.shareGlobal.isNeedChangeServer = YES; }]; } diff --git a/QXLive/Base/QXGlobal.h b/QXLive/Base/QXGlobal.h index 1117736..d77b798 100644 --- a/QXLive/Base/QXGlobal.h +++ b/QXLive/Base/QXGlobal.h @@ -21,6 +21,8 @@ typedef void (^showFinishBlock)(void); +(instancetype)shareGlobal; @property (nonatomic,assign)BOOL isNeedUpdate; @property (nonatomic,assign)BOOL isNeedChangeServer; +@property (nonatomic,strong)NSString *currentServer; +@property (nonatomic,strong)NSString *currentH5Server; // 是否登录 @property (nonatomic,readonly,assign)BOOL isLogin; @property (nonatomic,assign)BOOL isShowLoginVC; diff --git a/QXLive/Base/QXGlobal.m b/QXLive/Base/QXGlobal.m index 500f16e..5095b05 100644 --- a/QXLive/Base/QXGlobal.m +++ b/QXLive/Base/QXGlobal.m @@ -49,6 +49,8 @@ dispatch_once(&onceToken, ^{ global = [[self alloc] init]; global.isShowLoginVC = NO; + global.currentServer = ServerUrl; + global.currentH5Server = H5ServerUrl; }); return global; } diff --git a/QXLive/Dynamic(语圈)/Controller/QXReportViewController.m b/QXLive/Dynamic(语圈)/Controller/QXReportViewController.m index cbd4a50..2c0059c 100644 --- a/QXLive/Dynamic(语圈)/Controller/QXReportViewController.m +++ b/QXLive/Dynamic(语圈)/Controller/QXReportViewController.m @@ -41,10 +41,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; } - (void)loadData { // 1-用户,2房间,3动态&fromId=对应id - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSInteger safeTop = kSafeAreaTop; NSURL* url= [NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/feedback/report?id=%@&fromType=%@&fromId=%@&h=%ld",server,[QXGlobal shareGlobal].loginModel.token ,self.reportType,self.fromId,safeTop]]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; diff --git a/QXLive/HomePage(声播)/Services/QXHomePageNetwork.h b/QXLive/HomePage(声播)/Services/QXHomePageNetwork.h index ce96945..4b7f12c 100644 --- a/QXLive/HomePage(声播)/Services/QXHomePageNetwork.h +++ b/QXLive/HomePage(声播)/Services/QXHomePageNetwork.h @@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN /** 首页banner + 1 引导 2启动 3首页轮播 4 房间首页轮播 5 公会列表 6 我的主页 7 道具商城 */ +(void)homeBannerWithType:(NSString*)type successBlock:(void (^)(NSArray* list))successBlock diff --git a/QXLive/HomePage(声播)/View/首页/QXGiftScrollView.m b/QXLive/HomePage(声播)/View/首页/QXGiftScrollView.m index a3a14e6..75c9816 100644 --- a/QXLive/HomePage(声播)/View/首页/QXGiftScrollView.m +++ b/QXLive/HomePage(声播)/View/首页/QXGiftScrollView.m @@ -134,9 +134,9 @@ static NSInteger maxCount = 5; self.gotoRoomImageView = [[UIImageView alloc] init]; if (QXConfig.shared.model) { - self.bgImageView.image = [UIImage imageNamed:QXConfig.shared.model.button_qwg]; + self.gotoRoomImageView.image = [UIImage imageNamed:QXConfig.shared.model.button_qwg]; }else{ - self.bgImageView.image = [UIImage imageNamed:@"home_goto_room"]; + self.gotoRoomImageView.image = [UIImage imageNamed:@"home_goto_room"]; } self.gotoRoomImageView.contentMode = UIViewContentModeScaleAspectFit; [self.contentView addSubview:self.gotoRoomImageView]; diff --git a/QXLive/Login(登录)/Controlller/QXLoginProtocolViewController.m b/QXLive/Login(登录)/Controlller/QXLoginProtocolViewController.m index 8217b8d..4d1b76c 100644 --- a/QXLive/Login(登录)/Controlller/QXLoginProtocolViewController.m +++ b/QXLive/Login(登录)/Controlller/QXLoginProtocolViewController.m @@ -39,10 +39,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; [self.view addSubview:self.contentWebView]; [self.view addSubview:self.progressView]; [self layoutConstraints]; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@%@?id=%ld",server,QXAppProtocol,self.type]]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; [self.contentWebView loadRequest:request]; diff --git a/QXLive/Login(登录)/Controlller/QXLoginViewController.m b/QXLive/Login(登录)/Controlller/QXLoginViewController.m index f2f9dc8..b899964 100644 --- a/QXLive/Login(登录)/Controlller/QXLoginViewController.m +++ b/QXLive/Login(登录)/Controlller/QXLoginViewController.m @@ -287,10 +287,7 @@ return frame; }; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; model.checkBoxImages = @[[UIImage imageNamed:@"login_agreement_nor"],[UIImage imageNamed:@"login_agreement_sel"]]; model.checkBoxWH = 30; model.privacyNavBackImage = [UIImage imageNamed:@"back"]; diff --git a/QXLive/Manager/QXManagerMqtt.m b/QXLive/Manager/QXManagerMqtt.m index 3bfd64d..763b311 100755 --- a/QXLive/Manager/QXManagerMqtt.m +++ b/QXLive/Manager/QXManagerMqtt.m @@ -36,6 +36,7 @@ if (QXGlobal.shareGlobal.isNeedChangeServer) { server = RAddressOfMQTTServer; } + QXLOG(@"当前mqtt-server%@",server); self.username = username; self.password = password; self.cliendId = cliendId; diff --git a/QXLive/Message(音信)/Controller/QXChatViewController.m b/QXLive/Message(音信)/Controller/QXChatViewController.m index 758da74..5858d8b 100644 --- a/QXLive/Message(音信)/Controller/QXChatViewController.m +++ b/QXLive/Message(音信)/Controller/QXChatViewController.m @@ -14,6 +14,7 @@ #import "QXMenuPopView.h" #import "QXReportViewController.h" #import "QXMineNetwork.h" +#import "QXIMGroupSettingVC.h" @interface QXChatViewController () @property (nonatomic,strong)QXChatTitleView *titleView; @end @@ -54,6 +55,8 @@ return YES; } //-(BOOL)onUserAvatarLongPressed:(UIView *)view messageCellData:(TUIMessageCellData *)celldata{ +//// QXLOG(@"%@被长按了",celldata.senderName); +// UIAlertController *al = [UIAlertController alertControllerWithTitle:@"" message:<#(nullable NSString *)#> preferredStyle:<#(UIAlertControllerStyle)#>]; // return YES; //} // @@ -76,7 +79,7 @@ } -(void)moreAction{ if (self.data.groupID.length>0) { - QXGuildGroupSettingVC *vc = [[QXGuildGroupSettingVC alloc] init]; + QXIMGroupSettingVC *vc = [[QXIMGroupSettingVC alloc] init]; vc.groupId = self.data.groupID; [self.navigationController pushViewController:vc animated:YES]; }else{ diff --git a/QXLive/Message(音信)/Controller/群聊/QXGroupMemberViewController.h b/QXLive/Message(音信)/Controller/群聊/QXGroupMemberViewController.h new file mode 100644 index 0000000..d4ece0e --- /dev/null +++ b/QXLive/Message(音信)/Controller/群聊/QXGroupMemberViewController.h @@ -0,0 +1,18 @@ +// +// QXGroupMemberViewController.h +// QXLive +// +// Created by 启星 on 2026/1/2. +// + +#import "QXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface QXGroupMemberViewController : QXBaseViewController +@property (nonatomic,strong)NSString *groupId; +/// 是否为群主 1 是群主 2不是群主 +@property (nonatomic,strong)NSString*isOwner; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Message(音信)/Controller/群聊/QXGroupMemberViewController.m b/QXLive/Message(音信)/Controller/群聊/QXGroupMemberViewController.m new file mode 100644 index 0000000..633b210 --- /dev/null +++ b/QXLive/Message(音信)/Controller/群聊/QXGroupMemberViewController.m @@ -0,0 +1,185 @@ +// +// QXGroupMemberViewController.m +// QXLive +// +// Created by 启星 on 2026/1/2. +// + +#import "QXGroupMemberViewController.h" +#import "QXMessageServices.h" +#import "QXBlackListCell.h" +#import "QXUserHomePageViewController.h" +#import "ImSDK_Plus/V2TIMManager+Group.h" +@interface QXGroupMemberViewController () +@property (nonatomic,strong)UITableView *tableView; +@property (nonatomic,strong)UIView *seachBgView; +@property (nonatomic,strong)UIImageView *searchImageView; +@property (nonatomic,strong)UITextField *textField; +@property (nonatomic,strong)UIButton *searchBtn; +@property (nonatomic,assign)BOOL isSearch; +@end + +@implementation QXGroupMemberViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} +-(void)setNavgationItems{ + [super setNavgationItems]; + self.navigationItem.title = @"群聊成员"; +} + +-(void)initSubViews{ + self.page = 1; + + self.seachBgView = [[UIView alloc] initWithFrame:CGRectMake(16, NavContentHeight, SCREEN_WIDTH-16*2, 35)]; + self.seachBgView.backgroundColor = [UIColor colorWithHexString:@"#ffffff"]; + self.seachBgView.layer.masksToBounds = YES; + self.seachBgView.layer.cornerRadius = 17.5; + [self.view addSubview:self.seachBgView]; + + self.searchImageView = [[UIImageView alloc] initWithFrame:CGRectMake(8, 5.5, 24, 24)]; + self.searchImageView.image = [UIImage imageNamed:@"room_song_search"]; + [self.seachBgView addSubview:self.searchImageView]; + + self.textField = [[UITextField alloc] initWithFrame:CGRectMake(self.searchImageView.right+6, 0, self.seachBgView.width-self.searchImageView.right-6-8, 35)]; + self.textField.placeholder = @"请输入ID/用户名搜索"; + self.textField.font = [UIFont systemFontOfSize:14]; + [self.textField addTarget:self action:@selector(textDidChange:) forControlEvents:(UIControlEventEditingChanged)]; + self.textField.returnKeyType = UIReturnKeyDone; + self.textField.delegate = self; + self.textField.textColor = [UIColor colorWithHexString:@"#333333"]; + [self.seachBgView addSubview:self.textField]; + self.searchBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.seachBgView.width-60-10, 0, 60, 35)]; + [self.searchBtn setTitle:@"搜索" forState:(UIControlStateNormal)]; + self.searchBtn.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.searchBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)]; + [self.searchBtn addTarget:self action:@selector(searchAction:) forControlEvents:(UIControlEventTouchUpInside)]; + [self.seachBgView addSubview:self.searchBtn]; + [self.view addSubview:self.tableView]; + [self getMemberListWithSearch:@""]; +} + +-(void)getMemberListWithSearch:(NSString*)search{ + MJWeakSelf + [QXMessageServices getGroupMemberListWithPage:self.page search:search guildId:self.groupId successBlock:^(NSArray * _Nonnull list) { + if (weakSelf.page == 1) { + [weakSelf.dataArray removeAllObjects]; + } + [weakSelf.dataArray addObjectsFromArray:list]; + [weakSelf.tableView reloadData]; + if (list.count == 0) { + weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; + }else{ + [weakSelf.tableView.mj_footer endRefreshing]; + } + [weakSelf.tableView.mj_header endRefreshing]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + [weakSelf.tableView.mj_header endRefreshing]; + [weakSelf.tableView.mj_footer endRefreshing]; + }]; +} + +-(void)searchAction:(UIButton*)sender{ + self.isSearch = YES; + [self getMemberListWithSearch:self.textField.text]; +} + +-(void)textDidChange:(UITextField*)textField{ + if (textField.text.length == 0) { + self.isSearch = NO; + [self getMemberListWithSearch:@""]; + } +} + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return self.dataArray.count; +} +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + QXBlackListCell *cell = [QXBlackListCell cellWithTableView:tableView]; + cell.isNoIcon = YES; + cell.cellType = QXBlackListCellTypeGroupMember; + cell.groupMemberModel = self.dataArray[indexPath.row]; + cell.delegate = self; + cell.removeBtn.hidden = !(self.isOwner.intValue==1); + return cell; +} +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init]; + QXUserHomeModel *model = self.dataArray[indexPath.row]; + vc.user_id = model.user_id; + [self.navigationController pushViewController:vc animated:YES]; +} +-(void)didClickGroupMemberMoreBtnWithGroupMemberModel:(QXUserHomeModel *)groupMemberModel{ + UIAlertController*al =[UIAlertController alertControllerWithTitle:@"禁言" message:@"" preferredStyle:(UIAlertControllerStyleActionSheet)]; + if (groupMemberModel.is_mute.intValue == 1) { + [al addAction:[UIAlertAction actionWithTitle:@"解禁" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { + [self muteMemberWithTime:0 groupMemberModel:groupMemberModel]; + }]]; + }else{ + [al addAction:[UIAlertAction actionWithTitle:@"禁言1天" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { + [self muteMemberWithTime:86400 groupMemberModel:groupMemberModel]; + }]]; + [al addAction:[UIAlertAction actionWithTitle:@"禁言5天" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { + [self muteMemberWithTime:86400*5 groupMemberModel:groupMemberModel]; + }]]; + [al addAction:[UIAlertAction actionWithTitle:@"禁言10天" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { + [self muteMemberWithTime:86400*10 groupMemberModel:groupMemberModel]; + }]]; + [al addAction:[UIAlertAction actionWithTitle:@"禁言30天" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { + [self muteMemberWithTime:86400*30 groupMemberModel:groupMemberModel]; + }]]; + } + [al addAction:[UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) { + + }]]; + [self presentViewController:al animated:YES completion:nil]; +} +-(void)muteMemberWithTime:(uint32_t)time groupMemberModel:(QXUserHomeModel*)groupMemberModel{ + [[V2TIMManager sharedInstance] muteGroupMember:self.groupId member:[NSString stringWithFormat:@"u%@",groupMemberModel.user_id] muteTime:time succ:^{ + if (time == 0) { + showToast(@"解禁成功"); + }else{ + showToast(@"禁言成功"); + } + self.page = 1; + if (self.isSearch) { + [self getMemberListWithSearch:self.textField.text]; + }else{ + [self getMemberListWithSearch:@""]; + } + } fail:^(int code, NSString * _Nullable desc) { + showToast(desc); + }]; +} +-(UITableView *)tableView{ + if (!_tableView) { + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.seachBgView.bottom+10, SCREEN_WIDTH, SCREEN_HEIGHT-self.seachBgView.bottom-10) style:(UITableViewStylePlain)]; + _tableView.dataSource = self; + _tableView.delegate = self; + _tableView.backgroundColor = [UIColor clearColor]; + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + _tableView.rowHeight = 60; + MJWeakSelf + _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + weakSelf.page = 1; + if (self.isSearch) { + [self getMemberListWithSearch:self.textField.text]; + }else{ + [self getMemberListWithSearch:@""]; + } + }]; + _tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ + weakSelf.page++; + if (self.isSearch) { + [self getMemberListWithSearch:self.textField.text]; + }else{ + [self getMemberListWithSearch:@""]; + } + }]; + } + return _tableView; +} + +@end diff --git a/QXLive/Message(音信)/Controller/群聊/QXGuildGroupSettingVC.m b/QXLive/Message(音信)/Controller/群聊/QXGuildGroupSettingVC.m index 31661c7..e335e91 100644 --- a/QXLive/Message(音信)/Controller/群聊/QXGuildGroupSettingVC.m +++ b/QXLive/Message(音信)/Controller/群聊/QXGuildGroupSettingVC.m @@ -41,10 +41,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; , 2)]; } - (void)loadData { - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/union/setGroup?id=%@&guildId=%@",server,QXGlobal.shareGlobal.loginModel.token,self.groupId]]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; [self.contentWebView loadRequest:request]; diff --git a/QXLive/Message(音信)/Controller/群聊/QXIMGroupSettingVC.h b/QXLive/Message(音信)/Controller/群聊/QXIMGroupSettingVC.h new file mode 100644 index 0000000..326d33a --- /dev/null +++ b/QXLive/Message(音信)/Controller/群聊/QXIMGroupSettingVC.h @@ -0,0 +1,16 @@ +// +// QXIMGroupSettingVC.h +// QXLive +// +// Created by 启星 on 2026/1/2. +// + +#import "QXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface QXIMGroupSettingVC : QXBaseViewController +@property (nonatomic,strong)NSString *groupId; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Message(音信)/Controller/群聊/QXIMGroupSettingVC.m b/QXLive/Message(音信)/Controller/群聊/QXIMGroupSettingVC.m new file mode 100644 index 0000000..6f05397 --- /dev/null +++ b/QXLive/Message(音信)/Controller/群聊/QXIMGroupSettingVC.m @@ -0,0 +1,80 @@ +// +// QXIMGroupSettingVC.m +// QXLive +// +// Created by 启星 on 2026/1/2. +// + +#import "QXIMGroupSettingVC.h" +#import "QXIMGroupSettingView.h" +#import "QXMessageServices.h" +#import "QXGroupMemberViewController.h" +#import "ImSDK_Plus/V2TIMManager+Group.h" +@interface QXIMGroupSettingVC () +@property (nonatomic,strong)UIScrollView *scrollView; +@property (nonatomic,strong)QXIMGroupSettingView *settingView; +@property (nonatomic,strong)QXGroupSettingInfoModel *model; +@end + +@implementation QXIMGroupSettingVC + +- (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]; +} +-(void)setNavgationItems{ + [super setNavgationItems]; + self.navigationItem.title = @"群聊设置"; +} + +-(void)initSubViews{ + self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight)]; + self.settingView = [[QXIMGroupSettingView alloc] initWithFrame:self.scrollView.bounds]; + self.settingView.delegate = self; + [self.scrollView addSubview:self.settingView]; + [self.view addSubview:self.scrollView]; + [self getGroupInfo]; +} + +-(void)previewMemberList{ + QXGroupMemberViewController *vc = [[QXGroupMemberViewController alloc] init]; + vc.groupId = self.groupId; + vc.isOwner = self.model.is_deacon; + [self.navigationController pushViewController:vc animated:YES]; +} +-(void)saveGroupInfoWithGroupId:(NSString *)groupId notice:(NSString *)notice name:(NSString *)name{ + MJWeakSelf + [QXMessageServices setGroupInfoWithGuildId:groupId name:name avatar:@"" notice:notice successBlock:^(NSDictionary * _Nonnull dict) { + showToast(@"修改成功"); + [weakSelf getGroupInfo]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} + +-(void)groupSetMute:(BOOL)isMute muteSwitch:(UISwitch *)muteSwitch{ + [[V2TIMManager sharedInstance] muteAllGroupMembers:self.groupId isMute:isMute succ:^{ + + } fail:^(int code, NSString * _Nullable desc) { + if (isMute) { + muteSwitch.on = NO; + }else{ + muteSwitch.on = YES; + } + }]; +} + +-(void)getGroupInfo{ + MJWeakSelf + [QXMessageServices getGroupSettingWithGuildId:self.groupId successBlock:^(QXGroupSettingInfoModel * _Nonnull model) { + weakSelf.model = model; + weakSelf.settingView.model = model; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; +} +@end diff --git a/QXLive/Message(音信)/Model/QXGroupSettingInfoModel.h b/QXLive/Message(音信)/Model/QXGroupSettingInfoModel.h new file mode 100644 index 0000000..07323fe --- /dev/null +++ b/QXLive/Message(音信)/Model/QXGroupSettingInfoModel.h @@ -0,0 +1,29 @@ +// +// QXGroupSettingInfoModel.h +// QXLive +// +// Created by 启星 on 2026/1/2. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface QXGroupSettingInfoModel : NSObject +/// 群聊id +@property (strong,nonatomic)NSString *guild_id; +/// 群聊id +@property (strong,nonatomic)NSString *name; +/// 群公告 +@property (strong,nonatomic)NSString *notification; +/// 群聊头像 +@property (strong,nonatomic)NSString *guild_cover; +/// 是否为群主 1 是群主 2不是群主 +@property (strong,nonatomic)NSString *is_deacon; +/// 群成员列表 +@property (strong,nonatomic)NSArray *user_list; +/// 是否被全员禁言 1 禁言 0未禁言 +@property (strong,nonatomic)NSString *mute_all_member; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Message(音信)/Model/QXGroupSettingInfoModel.m b/QXLive/Message(音信)/Model/QXGroupSettingInfoModel.m new file mode 100644 index 0000000..fc4f724 --- /dev/null +++ b/QXLive/Message(音信)/Model/QXGroupSettingInfoModel.m @@ -0,0 +1,16 @@ +// +// QXGroupSettingInfoModel.m +// QXLive +// +// Created by 启星 on 2026/1/2. +// + +#import "QXGroupSettingInfoModel.h" + +@implementation QXGroupSettingInfoModel ++(NSDictionary *)modelContainerPropertyGenericClass{ + return @{ + @"user_list" : @"QXUserModel", + }; +} +@end diff --git a/QXLive/Message(音信)/Services/QXMessageServices.h b/QXLive/Message(音信)/Services/QXMessageServices.h index 90623ab..52c19d6 100644 --- a/QXLive/Message(音信)/Services/QXMessageServices.h +++ b/QXLive/Message(音信)/Services/QXMessageServices.h @@ -7,6 +7,7 @@ #import #import "QXMessageModel.h" +#import "QXGroupSettingInfoModel.h" NS_ASSUME_NONNULL_BEGIN @interface QXMessageServices : NSObject @@ -38,6 +39,34 @@ NS_ASSUME_NONNULL_BEGIN type:(NSString*)type successBlock:(void (^)(NSDictionary* dict))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + + +/** + 群聊设置信息 + */ ++(void)getGroupSettingWithGuildId:(NSString*)guild_id + successBlock:(void (^)(QXGroupSettingInfoModel *model))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + + +/** + 群聊成员 + */ ++(void)getGroupMemberListWithPage:(NSInteger)page + search:(NSString*)search + guildId:(NSString*)guild_id + successBlock:(void (^)(NSArray *list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 设置群聊信息 + */ ++(void)setGroupInfoWithGuildId:(NSString*)guild_id + name:(NSString*)name + avatar:(NSString*)avatar + notice:(NSString*)notice + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Message(音信)/Services/QXMessageServices.m b/QXLive/Message(音信)/Services/QXMessageServices.m index 6a694cf..22da3d7 100644 --- a/QXLive/Message(音信)/Services/QXMessageServices.m +++ b/QXLive/Message(音信)/Services/QXMessageServices.m @@ -68,4 +68,48 @@ failBlock(error,msg); }]; } + ++(void)getGroupSettingWithGuildId:(NSString*)guild_id + successBlock:(void (^)(QXGroupSettingInfoModel *model))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + [[QXRequset shareInstance] getWithUrl:QXGroupSettingInfo parameters:@{@"guild_id":guild_id?:@""} needCache:NO success:^(id responseObject) { + if (successBlock) { + QXGroupSettingInfoModel *model = [QXGroupSettingInfoModel yy_modelWithJSON:responseObject[@"data"]]; + successBlock(model); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + + ++(void)getGroupMemberListWithPage:(NSInteger)page + search:(NSString*)search + guildId:(NSString*)guild_id + successBlock:(void (^)(NSArray *list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + [[QXRequset shareInstance] getWithUrl:QXGroupMemberList parameters:@{@"page":[NSNumber numberWithInteger:page],@"guild_id":guild_id?:@"",@"search":search?:@""} needCache:NO success:^(id responseObject) { + if (successBlock) { + NSArray *list = [NSArray yy_modelArrayWithClass:[QXUserHomeModel class] json:responseObject[@"data"][@"list"]]; + successBlock(list); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} ++(void)setGroupInfoWithGuildId:(NSString *)guild_id name:(NSString *)name avatar:(NSString *)avatar notice:(NSString *)notice successBlock:(void (^)(NSDictionary * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{ + NSDictionary *parameters =@{ + @"guild_id":guild_id?:@"", + @"name":name?name:@"", + @"avatar":avatar?:@"", + @"notice":notice?:@"" + }; + [[QXRequset shareInstance] postWithUrl:QXSetGroupInfo parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} @end diff --git a/QXLive/Message(音信)/View/QXSystemMessageCell.m b/QXLive/Message(音信)/View/QXSystemMessageCell.m index 866dca7..db44971 100644 --- a/QXLive/Message(音信)/View/QXSystemMessageCell.m +++ b/QXLive/Message(音信)/View/QXSystemMessageCell.m @@ -20,7 +20,24 @@ -(void)setModel:(QXMessageListModel *)model{ _model = model; - self.contentLabel.text = model.content; + NSData *data = [model.content dataUsingEncoding:NSUnicodeStringEncoding]; + // 创建段落样式来设置行间距 + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + [paragraphStyle setLineSpacing:8]; // 设置行间距为8磅,可根据需要调整 + + // 创建options字典,包含文档类型和默认属性 + NSDictionary *options = @{ + NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, + NSDefaultAttributesDocumentAttribute: @{ + NSParagraphStyleAttributeName: paragraphStyle + } + }; + // 转换为富文本 + NSAttributedString *html = [[NSAttributedString alloc] initWithData:data + options:options + documentAttributes:nil + error:nil]; + self.contentLabel.attributedText = html; NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000 NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; diff --git a/QXLive/Message(音信)/View/QXSystemNoticeCell.m b/QXLive/Message(音信)/View/QXSystemNoticeCell.m index 8fe8619..72dcbd1 100644 --- a/QXLive/Message(音信)/View/QXSystemNoticeCell.m +++ b/QXLive/Message(音信)/View/QXSystemNoticeCell.m @@ -20,7 +20,10 @@ -(void)setModel:(QXMessageListModel *)model{ _model = model; - self.contentLabel.text = model.content; + NSData *data = [model.content dataUsingEncoding:NSUnicodeStringEncoding]; + NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType}; + NSAttributedString *html = [[NSAttributedString alloc]initWithData:data options:options documentAttributes:nil error:nil]; + self.contentLabel.attributedText = html; [self.noticeImageView sd_setImageWithURL:[NSURL URLWithString:model.image]]; NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000 NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; diff --git a/QXLive/Message(音信)/View/群聊设置/QXIMGroupSettingView.h b/QXLive/Message(音信)/View/群聊设置/QXIMGroupSettingView.h new file mode 100644 index 0000000..18cd092 --- /dev/null +++ b/QXLive/Message(音信)/View/群聊设置/QXIMGroupSettingView.h @@ -0,0 +1,31 @@ +// +// QXIMGroupSettingView.h +// QXLive +// +// Created by 启星 on 2026/1/2. +// + +#import +#import "QXGroupSettingInfoModel.h" +NS_ASSUME_NONNULL_BEGIN +@protocol QXIMGroupSettingViewDelegate + +@optional +-(void)previewMemberList; +-(void)groupSetMute:(BOOL)isMute muteSwitch:(UISwitch*)muteSwitch; +-(void)saveGroupInfoWithGroupId:(NSString*)groupId notice:(NSString*)notice name:(NSString*)name; +@end +@interface QXIMGroupSettingView : UIView +@property (nonatomic,strong)QXGroupSettingInfoModel*model; +@property (nonatomic,weak)iddelegate; +@end + +@interface QXIMGroupMemberCell :UICollectionViewCell +@property (nonatomic,strong)UIImageView *headerImageView; +@property (nonatomic,strong)UILabel *nameLabel; +@property (nonatomic,strong)QXUserModel *model; + +@end + + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Message(音信)/View/群聊设置/QXIMGroupSettingView.m b/QXLive/Message(音信)/View/群聊设置/QXIMGroupSettingView.m new file mode 100644 index 0000000..085f189 --- /dev/null +++ b/QXLive/Message(音信)/View/群聊设置/QXIMGroupSettingView.m @@ -0,0 +1,224 @@ +// +// QXIMGroupSettingView.m +// QXLive +// +// Created by 启星 on 2026/1/2. +// + +#import "QXIMGroupSettingView.h" +#import "QXTextView.h" +@interface QXIMGroupSettingView() +@property (nonatomic,strong)UIImageView *guildImageView; +@property (nonatomic,strong)UILabel *guildLabel; + +@property (nonatomic,strong)UILabel *groupMemberTitleLabel; +@property (nonatomic,strong)UIButton *moreMemberBtn; +@property (nonatomic,strong)UICollectionView *collectionView; + +@property (nonatomic,strong)UIView *editGroupNameView; +@property (nonatomic,strong)UITextField *editGroupTextField; + +@property (nonatomic,strong)UILabel *noticeTitleLabel; +@property (nonatomic,strong)QXTextView *textView; + +@property (nonatomic,strong)UILabel *muteLabel; +@property (nonatomic,strong)UISwitch *muteSwitch; +@property (nonatomic,strong)NSMutableArray *dataArray; + +@property (nonatomic,strong)UIButton *saveBtn; +@end +@implementation QXIMGroupSettingView + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + [self initSubviews]; + } + return self; +} + +-(void)initSubviews{ + + self.guildImageView = [[UIImageView alloc] initWithFrame:CGRectMake(16, 0, 60, 60)]; + self.guildImageView.contentMode = UIViewContentModeScaleAspectFill; + [self.guildImageView addRoundedCornersWithRadius:30]; + [self addSubview:self.guildImageView]; + + self.guildLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.guildImageView.right+10, self.guildLabel.top, self.width-self.guildImageView.right-10-16, self.guildImageView.height)]; + self.guildLabel.textColor = [UIColor colorWithHexString:@"#333333"]; + self.guildLabel.font = [UIFont systemFontOfSize:14]; + [self addSubview:self.guildLabel]; + + + self.groupMemberTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.guildImageView.left, self.guildImageView.bottom+15, 100, 20)]; + self.groupMemberTitleLabel.textColor = RGB16(0x000000); + self.groupMemberTitleLabel.font = [UIFont boldSystemFontOfSize:16]; + self.groupMemberTitleLabel.text = @"群组成员"; + [self addSubview:self.groupMemberTitleLabel]; + + self.moreMemberBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width-100-16, self.groupMemberTitleLabel.top, 100, 20)]; + [self.moreMemberBtn setTitle:@"查看成员>" forState:(UIControlStateNormal)]; + [self.moreMemberBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)]; + self.moreMemberBtn.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.moreMemberBtn addTarget:self action:@selector(moreAction:) forControlEvents:(UIControlEventTouchUpInside)]; + [self addSubview:self.moreMemberBtn]; + + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + int itemWidth = 60; + layout.itemSize = CGSizeMake(itemWidth, itemWidth+20); + layout.minimumLineSpacing = 12; + layout.minimumInteritemSpacing = 12; +// layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16); + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(self.guildImageView.left, self.groupMemberTitleLabel.bottom+15, self.width-32, itemWidth+20) collectionViewLayout:layout]; + [self.collectionView registerClass:[QXIMGroupMemberCell class] forCellWithReuseIdentifier:@"QXIMGroupMemberCell"]; + 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 addSubview:self.collectionView]; + + self.editGroupNameView = [[UIView alloc] initWithFrame:CGRectMake(16, self.collectionView.bottom+10, self.width-32, 44)]; + self.editGroupNameView.backgroundColor = RGB(236, 240, 246); + [self.editGroupNameView addRoundedCornersWithRadius:8]; + [self addSubview:self.editGroupNameView]; + + self.editGroupTextField = [[UITextField alloc] initWithFrame:CGRectMake(16, 0, self.editGroupNameView.width-32, 44)]; + self.editGroupTextField.font = [UIFont systemFontOfSize:14]; + self.editGroupTextField.textColor = RGB16(0x333333); + self.editGroupTextField.placeholder = @"请输入群聊名称"; + [self.editGroupNameView addSubview:self.editGroupTextField]; + + self.noticeTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.guildImageView.left, self.editGroupNameView.bottom+10, self.width-32, 30)]; + self.noticeTitleLabel.text = @"群聊公告"; + self.noticeTitleLabel.font = [UIFont boldSystemFontOfSize:16]; + self.noticeTitleLabel.textColor = RGB16(0x000000); + [self addSubview:self.noticeTitleLabel]; + + self.textView = [[QXTextView alloc] initWithFrame:CGRectMake(self.guildImageView.left, self.noticeTitleLabel.bottom+10, self.width-32, 120)]; + self.textView.placehoulder = @"请输入群聊公告"; + self.textView.placehoulderFont = [UIFont systemFontOfSize:14]; + self.textView.font = [UIFont systemFontOfSize:14]; + self.textView.backgroundColor = RGB(236, 240, 246); + [self.textView addRoundedCornersWithRadius:8]; + self.textView.maxLength = 300; + [self addSubview:self.textView]; + + + self.muteLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.guildImageView.left, self.textView.bottom+10, 200, 40)]; + self.muteLabel.text = @"全员禁言"; + self.muteLabel.textColor = RGB16(0x000000); + self.muteLabel.font = [UIFont boldSystemFontOfSize:16]; + self.muteLabel.hidden = YES; + [self addSubview:self.muteLabel]; + + self.muteSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(self.width-60-16, self.muteLabel.top+5, 60, 40)]; + [self.muteSwitch addTarget:self action:@selector(muteAction) forControlEvents:(UIControlEventValueChanged)]; + self.muteSwitch.hidden = YES; + [self addSubview:self.muteSwitch]; + + self.saveBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.width-300)/2, self.muteLabel.bottom+10, 300, 40)]; + [self.saveBtn setTitle:@"确认保存" forState:(UIControlStateNormal)]; + [self.saveBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)]; + self.saveBtn.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.saveBtn addRoundedCornersWithRadius:20]; + self.saveBtn.backgroundColor = QXConfig.themeColor; + [self.saveBtn addTarget:self action:@selector(saveAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self addSubview:self.saveBtn]; + self.saveBtn.hidden = YES; +} +-(void)setModel:(QXGroupSettingInfoModel *)model{ + _model = model; + [self.guildImageView sd_setImageWithURL:[NSURL URLWithString:model.guild_cover]]; + self.guildLabel.text = model.name; + self.editGroupTextField.text = model.name; + self.textView.text = model.notification; + [self.muteSwitch setOn:model.mute_all_member.intValue==1]; + [self.collectionView reloadData]; + if (model.is_deacon.intValue == 2) { + self.muteSwitch.hidden = YES; + self.muteLabel.hidden = YES; + self.saveBtn.hidden = YES; + self.editGroupTextField.userInteractionEnabled = NO; + self.textView.userInteractionEnabled = NO; + }else{ + self.muteSwitch.hidden = NO; + self.muteLabel.hidden = NO; + self.saveBtn.hidden = NO; + self.editGroupTextField.userInteractionEnabled = YES; + self.textView.userInteractionEnabled = YES; + } +} +-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + return self.model.user_list.count; +} +-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + QXIMGroupMemberCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXIMGroupMemberCell" forIndexPath:indexPath]; + QXUserModel *model = self.model.user_list[indexPath.row]; + cell.model = model; + return cell; +} + +-(void)moreAction:(UIButton*)sender{ + if (self.delegate && [self.delegate respondsToSelector:@selector(previewMemberList)]) { + [self.delegate previewMemberList]; + } +} + +-(void)saveAction{ + if (self.delegate && [self.delegate respondsToSelector:@selector(saveGroupInfoWithGroupId:notice:name:)]) { + [self.delegate saveGroupInfoWithGroupId:self.model.guild_id notice:self.textView.text name:self.editGroupTextField.text]; + } +} + +-(void)muteAction{ + if (self.muteSwitch.isOn) { + QXLOG(@"打开全局禁言"); + }else{ + QXLOG(@"关闭全局禁言"); + } + if (self.delegate && [self.delegate respondsToSelector:@selector(groupSetMute:muteSwitch:)]) { + [self.delegate groupSetMute:self.muteSwitch.isOn muteSwitch:self.muteSwitch]; + } +} + +-(NSMutableArray *)dataArray{ + if (!_dataArray) { + _dataArray = [NSMutableArray array]; + } + return _dataArray; +} +@end + + +@implementation QXIMGroupMemberCell + +-(instancetype)initWithFrame:(CGRect)frame{ + if (self = [super initWithFrame:frame]) { + [self initSubviews]; + } + return self; +} +-(void)setModel:(QXUserModel *)model{ + _model = model; + [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar]]; + self.nameLabel.text = model.nickname; +} +-(void)initSubviews{ + self.headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.width)]; + self.headerImageView.contentMode = UIViewContentModeScaleAspectFill; + self.headerImageView.image = [UIImage imageNamed:@"user_header_placehoulder"]; + [self.headerImageView addRoundedCornersWithRadius:self.width/2]; + [self.contentView addSubview:self.headerImageView]; + + self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.headerImageView.bottom, self.width, 20)]; + self.nameLabel.textColor = RGB16(0x666666); + self.nameLabel.font = [UIFont systemFontOfSize:14]; + self.nameLabel.textAlignment = NSTextAlignmentCenter; + self.nameLabel.text = @"夏末"; + [self.contentView addSubview:self.nameLabel]; +} +@end diff --git a/QXLive/Mine(音域)/Controller/QXMineViewController.m b/QXLive/Mine(音域)/Controller/QXMineViewController.m index 926da06..8c1a0c1 100644 --- a/QXLive/Mine(音域)/Controller/QXMineViewController.m +++ b/QXLive/Mine(音域)/Controller/QXMineViewController.m @@ -39,6 +39,7 @@ #import "QXBodyPriceRuleView.h" #import "QXFamilyViewController.h" #import "QXNobilityDetailViewController.h" +#import "QXPropShopVC.h" #import @interface QXMineViewController () @@ -246,7 +247,8 @@ break; case QXMainHeaderOptionTypeShop:{ QXLOG(@"跳转商城"); - QXPropShopViewController *vc = [[QXPropShopViewController alloc] init]; +// QXPropShopViewController *vc = [[QXPropShopViewController alloc] init]; + QXPropShopVC *vc = [[QXPropShopVC alloc] init]; [self.navigationController pushViewController:vc animated:YES]; } break; diff --git a/QXLive/Mine(音域)/Controller/个性装扮/QXDressViewController.m b/QXLive/Mine(音域)/Controller/个性装扮/QXDressViewController.m index a01f93a..d4cadef 100644 --- a/QXLive/Mine(音域)/Controller/个性装扮/QXDressViewController.m +++ b/QXLive/Mine(音域)/Controller/个性装扮/QXDressViewController.m @@ -9,7 +9,7 @@ #import "JXCategoryView.h" #import "QXDressSubViewController.h" #import "QXMineNetwork.h" -#import "QXPropShopViewController.h" +#import "QXPropShopVC.h" @interface QXDressViewController () @property (nonatomic,strong)JXCategoryTitleView *categoryView; @@ -40,7 +40,7 @@ } -(void)recordAction{ - QXPropShopViewController *vc = [[QXPropShopViewController alloc] init]; + QXPropShopVC *vc = [[QXPropShopVC alloc] init]; [self.navigationController pushViewController:vc animated:YES]; } diff --git a/QXLive/Mine(音域)/Controller/亲密关系/QXHeartBeatSpaceViewController.m b/QXLive/Mine(音域)/Controller/亲密关系/QXHeartBeatSpaceViewController.m index 56fe76c..1f5af11 100644 --- a/QXLive/Mine(音域)/Controller/亲密关系/QXHeartBeatSpaceViewController.m +++ b/QXLive/Mine(音域)/Controller/亲密关系/QXHeartBeatSpaceViewController.m @@ -138,10 +138,7 @@ } -(void)helpAction{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; QXHeartBeatLevelRuleView *view = [[QXHeartBeatLevelRuleView alloc] init]; NSString *urlStr = [NSString stringWithFormat:@"%@api/Page/page_show?id=31",server]; view.rule = urlStr; diff --git a/QXLive/Mine(音域)/Controller/公会中心/QXGuildViewController.m b/QXLive/Mine(音域)/Controller/公会中心/QXGuildViewController.m index 0035f83..cde5bb4 100644 --- a/QXLive/Mine(音域)/Controller/公会中心/QXGuildViewController.m +++ b/QXLive/Mine(音域)/Controller/公会中心/QXGuildViewController.m @@ -43,10 +43,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; , 2)]; } - (void)loadData { - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSInteger safeTop = kSafeAreaTop; NSString *urlString = [NSString stringWithFormat:@"%@web/index.html#/pages/union/index?id=%@&h=%ld",server,[QXGlobal shareGlobal].loginModel.token,safeTop]; diff --git a/QXLive/Mine(音域)/Controller/帮助反馈/QXHelpViewController.m b/QXLive/Mine(音域)/Controller/帮助反馈/QXHelpViewController.m index 6ff43b5..7630a7f 100644 --- a/QXLive/Mine(音域)/Controller/帮助反馈/QXHelpViewController.m +++ b/QXLive/Mine(音域)/Controller/帮助反馈/QXHelpViewController.m @@ -60,10 +60,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; , 2)]; } - (void)loadData { - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSInteger safeTop = kSafeAreaTop; NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/feedback/help?id=%@&h=%ld",server,[QXGlobal shareGlobal].loginModel.token,safeTop]]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; diff --git a/QXLive/Mine(音域)/Controller/歌单列表/QXMineSongListViewController.m b/QXLive/Mine(音域)/Controller/歌单列表/QXMineSongListViewController.m index 44b7635..dabd9bd 100644 --- a/QXLive/Mine(音域)/Controller/歌单列表/QXMineSongListViewController.m +++ b/QXLive/Mine(音域)/Controller/歌单列表/QXMineSongListViewController.m @@ -82,10 +82,7 @@ }]; } -(void)helpAction{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",server,@"34"]; QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; vc.urlStr = urlString; diff --git a/QXLive/Mine(音域)/Controller/歌手认证/QXRoomSingerAuthViewController.m b/QXLive/Mine(音域)/Controller/歌手认证/QXRoomSingerAuthViewController.m index 4afebf9..1e7127c 100644 --- a/QXLive/Mine(音域)/Controller/歌手认证/QXRoomSingerAuthViewController.m +++ b/QXLive/Mine(音域)/Controller/歌手认证/QXRoomSingerAuthViewController.m @@ -99,10 +99,7 @@ } } -(void)helpAction{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",server,@"33"]; QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; vc.urlStr = urlString; diff --git a/QXLive/Mine(音域)/Controller/段位/QXLevelViewController.m b/QXLive/Mine(音域)/Controller/段位/QXLevelViewController.m index 18e1b65..fa9e16c 100644 --- a/QXLive/Mine(音域)/Controller/段位/QXLevelViewController.m +++ b/QXLive/Mine(音域)/Controller/段位/QXLevelViewController.m @@ -40,10 +40,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; , 2)]; } - (void)loadData { - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSInteger safeTop = kSafeAreaTop; NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/other/grade?id=%@&type=%d&h=%ld",server,[QXGlobal shareGlobal].loginModel.token,0,safeTop]]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; diff --git a/QXLive/Mine(音域)/Controller/爵位/QXNobilityBuyViewController.m b/QXLive/Mine(音域)/Controller/爵位/QXNobilityBuyViewController.m index 4c9a5ed..06cd4db 100644 --- a/QXLive/Mine(音域)/Controller/爵位/QXNobilityBuyViewController.m +++ b/QXLive/Mine(音域)/Controller/爵位/QXNobilityBuyViewController.m @@ -176,10 +176,7 @@ } -(void)agreementAction{ // id = 30; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",server,@"30"]; QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; vc.urlStr = urlString; diff --git a/QXLive/Mine(音域)/Controller/爵位/QXNobilityDetailViewController.m b/QXLive/Mine(音域)/Controller/爵位/QXNobilityDetailViewController.m index c08fbbb..4626839 100644 --- a/QXLive/Mine(音域)/Controller/爵位/QXNobilityDetailViewController.m +++ b/QXLive/Mine(音域)/Controller/爵位/QXNobilityDetailViewController.m @@ -56,10 +56,7 @@ } -(void)helpAction{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",server,@"29"]; QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; vc.urlStr = urlString; diff --git a/QXLive/Mine(音域)/Controller/爵位/QXNobilityViewController.m b/QXLive/Mine(音域)/Controller/爵位/QXNobilityViewController.m index 39eaa28..da55f60 100644 --- a/QXLive/Mine(音域)/Controller/爵位/QXNobilityViewController.m +++ b/QXLive/Mine(音域)/Controller/爵位/QXNobilityViewController.m @@ -108,10 +108,7 @@ -(void)helpAction{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",server,@"29"]; QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; vc.urlStr = urlString; diff --git a/QXLive/Mine(音域)/Controller/设置/QXAboutViewController.m b/QXLive/Mine(音域)/Controller/设置/QXAboutViewController.m index e164232..930f48f 100644 --- a/QXLive/Mine(音域)/Controller/设置/QXAboutViewController.m +++ b/QXLive/Mine(音域)/Controller/设置/QXAboutViewController.m @@ -41,10 +41,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; } - (void)loadData { // H5ServerUrl - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSInteger safeTop = kSafeAreaTop; NSString *urlStr = [NSString stringWithFormat:@"%@web/index.html#/pages/other/aboutUs?h=%ld",server,safeTop]; NSURL* url=[NSURL URLWithString:urlStr]; diff --git a/QXLive/Mine(音域)/Controller/道具商城/QXPropShopSubVC.h b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopSubVC.h new file mode 100644 index 0000000..c22057a --- /dev/null +++ b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopSubVC.h @@ -0,0 +1,18 @@ +// +// QXPropShopSubVC.h +// QXLive +// +// Created by 启星 on 2026/1/3. +// + +#import "QXBaseViewController.h" +#import "JXCategoryView.h" +#import "QXUserDressModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface QXPropShopSubVC : QXBaseViewController +@property (nonatomic,strong)QXUserDressTypeModel *model; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Controller/道具商城/QXPropShopSubVC.m b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopSubVC.m new file mode 100644 index 0000000..6d09c18 --- /dev/null +++ b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopSubVC.m @@ -0,0 +1,110 @@ +// +// QXPropShopSubVC.m +// QXLive +// +// Created by 启星 on 2026/1/3. +// + +#import "QXPropShopSubVC.h" +#import "QXGiftPlayerManager.h" +#import "QXDressShopCell.h" +#import "QXMineNetwork.h" +#import "QXDressShopBuyView.h" +#import "QXRechargeViewcController.h" +@interface QXPropShopSubVC () +@property (nonatomic,strong)UICollectionView *collectionView; +@property (nonatomic,strong)QXEffectContentView *fullEffectView; +@end + +@implementation QXPropShopSubVC +-(UIView *)listView{ + return self.view; +} +-(void)listWillAppear{ + [self getDressList]; +} +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} +-(void)initSubViews{ + self.bgImageHidden = YES; + + [self.view addSubview:self.collectionView]; + [self.view addSubview:self.fullEffectView]; +} +-(void)viewDidLayoutSubviews{ + [super viewDidLayoutSubviews]; + self.collectionView.frame = CGRectMake(0, 12, SCREEN_WIDTH, self.view.height); +} +-(void)getDressList{ + @weakify(self) + [QXMineNetwork shopDressListWithType:self.model.id successBlock:^(NSArray * _Nonnull list) { + @strongify(self); + [self.dataArray removeAllObjects]; + [self.dataArray addObjectsFromArray:list]; + [self.collectionView reloadData]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; +} + +-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + return self.dataArray.count; +} +-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + QXDressShopCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXDressShopCell" forIndexPath:indexPath]; + cell.model = self.dataArray[indexPath.row]; + return cell; +} +-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ + int width = (SCREEN_WIDTH-15*2-15*2-1)/3; + return CGSizeMake((int)width, (int)width-20+87); +} +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ + QXShopDressModel *model = self.dataArray[indexPath.row]; + QXDressShopBuyView *buyView = [[QXDressShopBuyView alloc] init]; + buyView.typeId = self.model.id; + buyView.model = model; + buyView.delegate = self; + [buyView showInView:KEYWINDOW]; +} + +-(void)didClickRecharge{ + QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init]; + [self.navigationController pushViewController:vc animated:YES]; +} +-(UICollectionView *)collectionView{ + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 15; + layout.minimumInteritemSpacing = 15; + layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15); + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.delegate = self; + _collectionView.dataSource = self; + _collectionView.backgroundColor = [UIColor clearColor]; + [_collectionView registerNib:[UINib nibWithNibName:@"QXDressShopCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXDressShopCell"]; + } + return _collectionView; +} + +- (QXEffectContentView *)fullEffectView { + if (!_fullEffectView) { + _fullEffectView = [[QXEffectContentView alloc] initWithFrame:[UIScreen mainScreen].bounds]; + _fullEffectView.queue = dispatch_queue_create("qx_room_full_preview_message.com", NULL); + _fullEffectView.hidden = YES; + } + return _fullEffectView; +} +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/QXLive/Mine(音域)/Controller/道具商城/QXPropShopVC.h b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopVC.h new file mode 100644 index 0000000..a10f246 --- /dev/null +++ b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopVC.h @@ -0,0 +1,16 @@ +// +// QXPropShopVC.h +// QXLive +// +// Created by 启星 on 2026/1/3. +// + +#import "QXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface QXPropShopVC : QXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Controller/道具商城/QXPropShopVC.m b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopVC.m new file mode 100644 index 0000000..cd26a27 --- /dev/null +++ b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopVC.m @@ -0,0 +1,120 @@ +// +// QXPropShopVC.m +// QXLive +// +// Created by 启星 on 2026/1/3. +// + +#import "QXPropShopVC.h" +#import "QXMineNetwork.h" +#import "QXPropShopSubVC.h" +#import +#import "QXHomePageNetwork.h" +@interface QXPropShopVC () +@property (nonatomic,strong)JXCategoryTitleView *categoryView; +@property (nonatomic,strong)JXCategoryListContainerView *containerView; +@property (nonatomic,strong)NSMutableArray *listVCArray; +@property (nonatomic,strong)NSMutableArray *titles; +@property (nonatomic,strong)SDCycleScrollView *cycleScrollView; +@end + +@implementation QXPropShopVC + +- (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]; +} +-(void)setNavgationItems{ + [super setNavgationItems]; + self.navigationItem.title = QXText(@"道具商城"); +} +- (void)initSubViews{ + self.view.backgroundColor = [UIColor whiteColor]; +// self.titles = @[QXText(@"头像框"),QXText(@"座驾"),QXText(@"气泡"),QXText(@"个人靓号"),QXText(@"房间靓号"),QXText(@"工会靓号")]; + self.listVCArray = [NSMutableArray array]; + self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(15, kSafeAreaTop+44, SCREEN_WIDTH-30, 100) delegate:self placeholderImage:nil]; + self.cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill; + self.cycleScrollView.backgroundColor = UIColor.clearColor; + [self.cycleScrollView addRoundedCornersWithRadius:8]; + [self.view addSubview:self.cycleScrollView]; + self.categoryView = [[JXCategoryTitleView alloc] init]; + self.categoryView.frame = CGRectMake(15, self.cycleScrollView.bottom, SCREEN_WIDTH-30, 44); + self.categoryView.delegate = self; +// self.categoryView.titles = self.titles; + self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#333333"]; + self.categoryView.titleColor = [UIColor colorWithHexString:@"#666666"]; + self.categoryView.cellWidth = JXCategoryViewAutomaticDimension; + self.categoryView.contentEdgeInsetLeft = 0; + self.categoryView.cellSpacing = 18; + self.categoryView.contentEdgeInsetLeft = 8; +// self.categoryView.titleLabelZoomScale = 1.1; + self.categoryView.titleLabelZoomEnabled = YES; + self.categoryView.titleFont = [UIFont boldSystemFontOfSize:14]; + self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:16]; + self.categoryView.averageCellSpacingEnabled = NO; + JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init]; + indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"]; + indicatorView.indicatorImageViewSize = CGSizeMake(40, 8); + indicatorView.verticalMargin = 11; + self.categoryView.indicators = @[indicatorView]; + self.containerView = [[JXCategoryListContainerView alloc] initWithType:(JXCategoryListContainerType_CollectionView) 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; +} +-(void)getData{ + MJWeakSelf + [QXMineNetwork getDressTypeListSuccessBlock:^(NSArray * _Nonnull list) { + [weakSelf.dataArray removeAllObjects]; + [weakSelf.dataArray addObjectsFromArray:list]; + for (QXUserDressTypeModel*model in list) { + [weakSelf.titles addObject:model.name]; + } + weakSelf.categoryView.titles = weakSelf.titles; + [weakSelf.categoryView reloadData]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; + [self getBanner]; +} + +-(void)getBanner{ + @weakify(self) + [QXHomePageNetwork homeBannerWithType:@"7" successBlock:^(NSArray * _Nonnull list) { + @strongify(self) + NSMutableArray *arr = [NSMutableArray array]; + for (QXBanner *banner in list) { + [arr addObject:banner.image]; + } +// [self.bannerArry removeAllObjects]; +// [self.bannerArry addObjectsFromArray:list]; +// self.appStoreView.bannerArray = list; + self.cycleScrollView.imageURLStringsGroup = arr; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; +} +-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{ + return self.dataArray.count; +} +-(id)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{ + QXPropShopSubVC *vc = [[QXPropShopSubVC alloc] init]; + QXUserDressTypeModel *model = self.dataArray[index]; + vc.model = model; + return vc; +} +- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { +// self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0); +} +-(NSMutableArray *)titles{ + if (!_titles) { + _titles = [NSMutableArray array]; + } + return _titles; +} +@end diff --git a/QXLive/Mine(音域)/Controller/道具商城/QXPropShopViewController.m b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopViewController.m index c074d77..bb06e23 100644 --- a/QXLive/Mine(音域)/Controller/道具商城/QXPropShopViewController.m +++ b/QXLive/Mine(音域)/Controller/道具商城/QXPropShopViewController.m @@ -60,10 +60,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; , 2)]; } - (void)loadData { - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/prop/propMall?id=%@&is_show=%@",server,[QXGlobal shareGlobal].loginModel.token,QXGlobal.shareGlobal.isAppStore?@"0":@"1"]]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; [self.contentWebView loadRequest:request]; diff --git a/QXLive/Mine(音域)/Controller/邀请/QXInviteViewController.m b/QXLive/Mine(音域)/Controller/邀请/QXInviteViewController.m index e538a4f..c848372 100644 --- a/QXLive/Mine(音域)/Controller/邀请/QXInviteViewController.m +++ b/QXLive/Mine(音域)/Controller/邀请/QXInviteViewController.m @@ -62,10 +62,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; , 2)]; } - (void)loadData { - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSInteger safeTop = kSafeAreaTop; NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/other/income??id=%@&h=%ld&is_show=%@",server,[QXGlobal shareGlobal].loginModel.token,safeTop,QXGlobal.shareGlobal.isAppStore?@"0":@"1"]]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; diff --git a/QXLive/Mine(音域)/Model/QXSongListModel.h b/QXLive/Mine(音域)/Model/QXSongListModel.h index 735d762..a8ec2c4 100644 --- a/QXLive/Mine(音域)/Model/QXSongListModel.h +++ b/QXLive/Mine(音域)/Model/QXSongListModel.h @@ -30,6 +30,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, copy)NSString *user_id; /// 点唱用户昵称 @property(nonatomic, copy)NSString *nickname; +/// 用户code +@property(nonatomic, copy)NSString *user_code; /// 点唱用户头像 @property(nonatomic, copy)NSString *avatar; /// 点唱用户装扮 diff --git a/QXLive/Mine(音域)/Model/QXUserDressModel.h b/QXLive/Mine(音域)/Model/QXUserDressModel.h index 24b6ffc..78846e7 100644 --- a/QXLive/Mine(音域)/Model/QXUserDressModel.h +++ b/QXLive/Mine(音域)/Model/QXUserDressModel.h @@ -45,4 +45,57 @@ NS_ASSUME_NONNULL_BEGIN /// 类型name @property (nonatomic,strong)NSString *name; @end + +@interface QXShopDressModel : NSObject +/// 装扮名称 +@property (nonatomic,strong)NSString *title; +/// 装扮id +@property (nonatomic,strong)NSString *did; +/// 类型:1头像框 2坐骑 3资料展示特效 4光圈 5气泡 6个人靓号 7房间靓号 8工会靓号 100热门 +@property (nonatomic,strong)NSString *type; +/// 展示图片 +@property (nonatomic,strong)NSString *base_image; +/// 播放图像 +@property (nonatomic,strong)NSString *play_image; +/// 实际价格(金币) +@property (nonatomic,strong)NSString *price; +/// 靓号 +@property (nonatomic,strong)NSString *special_num; +/// 原价 +@property (nonatomic,strong)NSString *original_price; +/// 折扣 +@property (nonatomic,strong)NSString *discount; +/// 折扣字段 +@property (nonatomic,strong)NSString *discount_str; + +@end + +@class QXShopUserModel,QXShopDressInfoModel,QXShopDressPriceModel; +@interface QXShopDressDetailModel : NSObject +@property (nonatomic,strong)QXShopUserModel *user_info; +@property (nonatomic,strong)QXShopDressInfoModel *decorate; +@end + +@interface QXShopUserModel :NSObject +@property (nonatomic,strong)NSString *user_id; +@property (nonatomic,strong)NSString *user_coin; +@end + +@interface QXShopDressInfoModel :NSObject +@property (nonatomic,strong)NSString *title; +@property (nonatomic,strong)NSArray *price_list; +@property (nonatomic,strong)NSString *price; +@property (nonatomic,strong)NSString *base_image; +@end + + +@interface QXShopDressPriceModel : NSObject +@property (nonatomic,strong)NSString*price; +@property (nonatomic,strong)NSString*discount; +@property (nonatomic,strong)NSString*day; +@property (nonatomic,strong)NSString*month; +@property (nonatomic,strong)NSString*end_time; +@property (nonatomic,assign)BOOL isSelected; +@end + NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Model/QXUserDressModel.m b/QXLive/Mine(音域)/Model/QXUserDressModel.m index 5f94c53..0d3d2f5 100644 --- a/QXLive/Mine(音域)/Model/QXUserDressModel.m +++ b/QXLive/Mine(音域)/Model/QXUserDressModel.m @@ -16,3 +16,39 @@ @end + +@implementation QXShopDressModel + + + +@end + + +@implementation QXShopDressDetailModel ++ (NSDictionary *)modelContainerPropertyGenericClass { + return @{@"user_info" : [QXShopUserModel class], + @"decorate" : [QXShopDressInfoModel class] + }; +} + + +@end +@implementation QXShopUserModel + + + +@end +@implementation QXShopDressInfoModel + ++ (NSDictionary *)modelContainerPropertyGenericClass { + return @{@"price_list" : [QXShopDressPriceModel class], + }; +} + +@end +@implementation QXShopDressPriceModel + + + +@end + diff --git a/QXLive/Mine(音域)/Model/QXUserModel.h b/QXLive/Mine(音域)/Model/QXUserModel.h index 22604ec..7d3ec7e 100644 --- a/QXLive/Mine(音域)/Model/QXUserModel.h +++ b/QXLive/Mine(音域)/Model/QXUserModel.h @@ -132,6 +132,10 @@ NS_ASSUME_NONNULL_BEGIN /// 是否使用靓号 0未使用 1 已使用 @property (nonatomic,strong)NSString *is_use_code; +@property (nonatomic,strong)NSString *in_room_id; + +@property (nonatomic,strong)NSString *is_mute; + @property (nonatomic,strong)QXUserCpInfoModel *cp_info; @property (nonatomic,strong)QXUserHomeModel *master; diff --git a/QXLive/Mine(音域)/Services/QXMineNetwork.h b/QXLive/Mine(音域)/Services/QXMineNetwork.h index 227a42b..52f4377 100644 --- a/QXLive/Mine(音域)/Services/QXMineNetwork.h +++ b/QXLive/Mine(音域)/Services/QXMineNetwork.h @@ -1471,6 +1471,28 @@ NS_ASSUME_NONNULL_BEGIN +(void)getAppConfigSuccessBlock:(void (^)(QXConfigModel* config))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock; +/** + 道具商城装饰列表 + */ ++(void)shopDressListWithType:(NSString*)type + successBlock:(void (^)(NSArray< QXShopDressModel*>* list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 道具商城装饰详情 + */ ++(void)shopDressDetailWithDid:(NSString*)did + successBlock:(void (^)(QXShopDressDetailModel*model))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 购买道具 + */ ++(void)shopDressBuyWithDid:(NSString*)did + day:(NSString*)day + num:(NSString*)num + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; @end diff --git a/QXLive/Mine(音域)/Services/QXMineNetwork.m b/QXLive/Mine(音域)/Services/QXMineNetwork.m index 75f6025..d3d0bcb 100644 --- a/QXLive/Mine(音域)/Services/QXMineNetwork.m +++ b/QXLive/Mine(音域)/Services/QXMineNetwork.m @@ -2975,4 +2975,64 @@ failBlock(error,msg); }]; } + +/** + 道具商城装饰列表 + */ ++(void)shopDressListWithType:(NSString*)type + successBlock:(void (^)(NSArray< QXShopDressModel*>* list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"type":type?:@"", + }; + [[QXRequset shareInstance] postWithUrl:QXShopDressList parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + NSArray*list = [NSArray yy_modelArrayWithClass:[QXShopDressModel class] json:responseObject[@"data"]]; + successBlock(list); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 道具商城装饰详情 + */ ++(void)shopDressDetailWithDid:(NSString*)did + successBlock:(void (^)(QXShopDressDetailModel*model))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"did":did?:@"", + }; + [[QXRequset shareInstance] postWithUrl:QXShopDressDetail parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + QXShopDressDetailModel *model = [QXShopDressDetailModel yy_modelWithJSON:responseObject[@"data"]]; + successBlock(model); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 购买道具 + */ ++(void)shopDressBuyWithDid:(NSString*)did + day:(NSString*)day + num:(NSString*)num + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"did":did?:@"", + @"day":day?:@"", + @"num":num?:@"" + }; + [[QXRequset shareInstance] postWithUrl:QXShopBuyDress parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} @end diff --git a/QXLive/Mine(音域)/View/个性装扮/QXDressShopBuyView.h b/QXLive/Mine(音域)/View/个性装扮/QXDressShopBuyView.h new file mode 100644 index 0000000..e941fc7 --- /dev/null +++ b/QXLive/Mine(音域)/View/个性装扮/QXDressShopBuyView.h @@ -0,0 +1,25 @@ +// +// QXDressShopBuyView.h +// QXLive +// +// Created by 启星 on 2026/1/3. +// + +#import +#import "QXUserDressModel.h" +NS_ASSUME_NONNULL_BEGIN +@protocol QXDressShopBuyViewDelegate + +@optional +-(void)didClickRecharge; + +@end +@interface QXDressShopBuyView : UIView +@property (nonatomic,strong)NSString *typeId; +@property (nonatomic,strong)QXShopDressModel *model; +@property (nonatomic,weak)iddelegate; +-(void)showInView:(UIView *)view; +-(void)hide; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/View/个性装扮/QXDressShopBuyView.m b/QXLive/Mine(音域)/View/个性装扮/QXDressShopBuyView.m new file mode 100644 index 0000000..bcb0a6f --- /dev/null +++ b/QXLive/Mine(音域)/View/个性装扮/QXDressShopBuyView.m @@ -0,0 +1,329 @@ +// +// QXDressShopBuyView.m +// QXLive +// +// Created by 启星 on 2026/1/3. +// + +#import "QXDressShopBuyView.h" +#import "QXSettingCell.h" +#import "QXMineNetwork.h" +#import "QXSelectAuctionInfoView.h" +#import "QXGiftPlayerManager.h" + +@interface QXDressShopBuyView() +@property (nonatomic,strong)UIView *bgView; +@property (nonatomic,strong)UITableView *tableView; +@property (nonatomic,strong)QXSeatHeaderView *headerView; +@property (nonatomic,strong)UIImageView *dressImageView; +@property (nonatomic,strong)NSArray *titleArray; +@property (nonatomic,strong)NSDictionary *cellValueDict; +@property (nonatomic,strong)NSDictionary *cellTypeDict; +@property (nonatomic,strong)UICollectionView *collectionView; + +@property (nonatomic,strong)QXShopDressDetailModel *infoModel; +@property (nonatomic,strong)QXShopDressPriceModel* selectedPriceModel; + +@property (nonatomic,strong)QXEffectContentView *fullEffectView; + + +@property (nonatomic,strong)UIButton* coinBtn; +@property (nonatomic,strong)UIButton* rechargeBtn; +@property (nonatomic,strong)UIButton* payBtn; + +@property (nonatomic,strong)NSString* num; +@end + +@implementation QXDressShopBuyView + +- (instancetype)init +{ + self = [super init]; + if (self) { + self.frame = [UIScreen mainScreen].bounds; + [self initSubviews]; + } + return self; +} + +-(void)initSubviews{ + self.num = @"1"; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)]; + tap.delegate = self; + [self addGestureRecognizer:tap]; + self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3]; + + self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, ScaleWidth(144), SCREEN_WIDTH, kSafeAreaBottom+ScaleWidth(429))]; + self.bgView.backgroundColor = UIColor.whiteColor; + [self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)]; + [self addSubview:self.bgView]; + + self.headerView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake((self.width-80)/2, 10, 80, 80)]; + self.headerView.hidden = YES; + [self.bgView addSubview:self.headerView]; + + self.dressImageView = [[UIImageView alloc] initWithFrame:CGRectMake((self.width-80)/2, 10, 80, 80)]; + self.dressImageView.contentMode = UIViewContentModeScaleAspectFit; + self.dressImageView.hidden = YES; + [self.bgView addSubview:self.dressImageView]; + + + self.cellValueDict = [NSMutableDictionary dictionaryWithDictionary:@{ + @"商品名称":@"", + @"商品价格":@"", + @"有效期至":@"", + @"购买时长":@"", + @"购买次数":self.num, + @"商品总价":@"", + @"商品单价":@"" + }]; + + self.cellTypeDict = [NSMutableDictionary dictionaryWithDictionary:@{ + @"商品名称":[NSNumber numberWithInteger:QXSettingCellTypeOnlyDetail], + @"商品价格":[NSNumber numberWithInteger:QXSettingCellTypeNormal], + @"有效期至":[NSNumber numberWithInteger:QXSettingCellTypeOnlyDetail], + @"购买时长":[NSNumber numberWithInteger:QXSettingCellTypeOnlyDetail], + @"购买次数":[NSNumber numberWithInteger:QXSettingCellTypeBuyCount], + @"商品总价":[NSNumber numberWithInteger:QXSettingCellTypeNormal], + @"商品单价":[NSNumber numberWithInteger:QXSettingCellTypeNormal], + }]; + [self.bgView addSubview:self.tableView]; + + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 12; + layout.minimumInteritemSpacing = 12; + layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15); + NSInteger itemWidth = (SCREEN_WIDTH-15*2-12*3)/4; + layout.itemSize = CGSizeMake(itemWidth, 44); + layout.scrollDirection = UICollectionViewScrollDirectionVertical; + self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.tableView.bottom+5, self.bgView.width, 60) collectionViewLayout:layout]; + [self.collectionView registerClass:[QXSelectAuctionInfoCell class] forCellWithReuseIdentifier:@"QXSelectAuctionInfoCell"]; + self.collectionView.delegate = self; + self.collectionView.dataSource = self; + self.collectionView.showsHorizontalScrollIndicator = NO; + self.collectionView.showsVerticalScrollIndicator = NO; + self.collectionView.bounces = NO; + self.collectionView.backgroundColor = [UIColor clearColor]; + [self.bgView addSubview:self.collectionView]; + + self.coinBtn = [[UIButton alloc] initWithFrame:CGRectMake(16, self.collectionView.bottom+15, (self.width-32)/2-6, 25)]; + self.coinBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight; + [self.coinBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)]; + self.coinBtn.titleLabel.font = [UIFont systemFontOfSize:13]; + [self.coinBtn setImage:[UIImage imageNamed:@"mine_recharge_corn"] forState:(UIControlStateNormal)]; + [self.bgView addSubview:self.coinBtn]; + + self.rechargeBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.width)/2+3, self.collectionView.bottom+15, (self.width-32)/2-6, 25)]; + self.rechargeBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; + [self.rechargeBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)]; + self.rechargeBtn.titleLabel.font = [UIFont systemFontOfSize:13]; + [self.rechargeBtn addTarget:self action:@selector(rechargeAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.rechargeBtn setTitle:@"去充值" forState:(UIControlStateNormal)]; + [self.bgView addSubview:self.rechargeBtn]; + + self.payBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.width-280)/2, self.coinBtn.bottom+10, 280, 40)]; + self.payBtn.backgroundColor = QXConfig.themeColor; + [self.payBtn addRoundedCornersWithRadius:20]; + [self.payBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)]; + self.payBtn.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.payBtn addTarget:self action:@selector(payAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.payBtn setTitle:@"确认支付" forState:(UIControlStateNormal)]; + [self.bgView addSubview:self.payBtn]; + + [self addSubview:self.fullEffectView]; +} +-(void)rechargeAction{ + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickRecharge)]) { + [self.delegate didClickRecharge]; + } + [self hide]; +} + +-(void)payAction{ + MJWeakSelf + [QXMineNetwork shopDressBuyWithDid:self.model.did day:self.selectedPriceModel.day num:self.num successBlock:^(NSDictionary * _Nonnull dict) { + showToast(@"购买成功"); + [weakSelf hide]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} + +-(void)setModel:(QXShopDressModel *)model{ + _model = model; + [self.cellValueDict setValue:model.title forKey:@"商品名称"]; + if ([self.typeId isEqualToString:@"2"]) { + /// 预览座驾 + self.fullEffectView.hidden = NO; + [self.fullEffectView previewEffectWith:self.model.play_image]; + } + if ([self.typeId isEqualToString:@"12"]) { + self.titleArray = @[@"商品名称",@"商品单价",@"购买次数",@"商品总价"]; + }else{ + self.titleArray = @[@"商品名称",@"商品价格",@"有效期至",@"购买时长"]; + } + [self getDressInfo]; +} +-(void)setTypeId:(NSString *)typeId{ + _typeId = typeId; + +} +-(void)getDressInfo{ + MJWeakSelf + [QXMineNetwork shopDressDetailWithDid:self.model.did successBlock:^(QXShopDressDetailModel * _Nonnull model) { + weakSelf.infoModel = model; + if ([weakSelf.typeId isEqualToString:@"1"]) { + weakSelf.headerView.hidden = NO; + [weakSelf.headerView setHeadIcon:QXGlobal.shareGlobal.loginModel.avatar dress:weakSelf.model.play_image]; + }else{ + weakSelf.dressImageView.hidden = NO; + [weakSelf.dressImageView sd_setImageWithURL:[NSURL URLWithString:weakSelf.model.base_image]]; + } + QXShopDressPriceModel *price = model.decorate.price_list.firstObject; + if (price) { + weakSelf.selectedPriceModel = price; + weakSelf.selectedPriceModel.isSelected = YES; + [weakSelf.cellValueDict setValue:price.price forKey:@"商品价格"]; + [weakSelf.cellValueDict setValue:price.end_time forKey:@"有效期至"]; + }else{ + [weakSelf.cellValueDict setValue:model.decorate.price forKey:@"商品单价"]; + [weakSelf.cellValueDict setValue:model.decorate.price forKey:@"商品总价"]; + } + [weakSelf.coinBtn setTitle:model.user_info.user_coin forState:(UIControlStateNormal)]; + [weakSelf.tableView reloadData]; + [weakSelf.collectionView reloadData]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} +-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ + return touch.view == self; +} + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return self.titleArray.count; +} +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + QXSettingCell *cell = [QXSettingCell cellWithTableView:tableView]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + cell.needLine = NO; + cell.delegate = self; + NSString *title = self.titleArray[indexPath.row]; + cell.titleLabel.text = title; + NSNumber *type = self.cellTypeDict[title];; + cell.cellType = type.integerValue; + NSString *value = self.cellValueDict[title];; + if (type.integerValue == QXSettingCellTypeBuyCount) { + cell.textField.text = value; + }else{ + cell.detailLabel.text = value; + } + if ([title isEqualToString:@"商品价格"] || [title isEqualToString:@"商品单价"] || [title isEqualToString:@"商品总价"]) { + cell.rightArrow.image = [UIImage imageNamed:@"mine_recharge_corn"]; + }else{ + cell.rightArrow.image = [UIImage imageNamed:@"arrowRight"]; + } + return cell; +} +//-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ +// QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init]; +// QXUserHomeModel *model = self.dataArray[indexPath.row]; +// vc.user_id = model.user_id; +// [self.navigationController pushViewController:vc animated:YES]; +//} + + +-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + return self.infoModel.decorate.price_list.count; +} + +-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + QXSelectAuctionInfoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXSelectAuctionInfoCell" forIndexPath:indexPath]; + cell.priceModel = self.infoModel.decorate.price_list[indexPath.row]; + return cell; +} +-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ + int width = (SCREEN_WIDTH-15*2-15*3-1)/4; + return CGSizeMake((int)width, 60); +} +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ + QXShopDressPriceModel *model = self.infoModel.decorate.price_list[indexPath.row]; + if (model.isSelected) { + return; + } + self.selectedPriceModel.isSelected = NO; + model.isSelected = YES; + self.selectedPriceModel = model; + [self.cellValueDict setValue:model.price forKey:@"商品价格"]; + [self.cellValueDict setValue:model.end_time forKey:@"有效期至"]; + [collectionView reloadData]; + [self.tableView reloadData]; +} + +-(void)reductionDidClickWithTotalNum:(NSString *)totalNum{ + self.num = totalNum; + [self.cellValueDict setValue:[NSString stringWithFormat:@"%ld",self.infoModel.decorate.price.integerValue*totalNum.integerValue] forKey:@"商品总价"]; + [self.cellValueDict setValue:totalNum forKey:@"购买次数"]; + [self.tableView reloadData]; +} +-(void)addDidClickWithTotalNum:(NSString *)totalNum{ + self.num = totalNum; + [self.cellValueDict setValue:[NSString stringWithFormat:@"%ld",self.infoModel.decorate.price.integerValue*totalNum.integerValue] forKey:@"商品总价"]; + [self.cellValueDict setValue:totalNum forKey:@"购买次数"]; + [self.tableView reloadData]; +} + +-(UITableView *)tableView{ + if (!_tableView) { + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 100, SCREEN_WIDTH, 44*4) style:(UITableViewStylePlain)]; + _tableView.dataSource = self; + _tableView.delegate = self; + _tableView.backgroundColor = [UIColor clearColor]; + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + _tableView.rowHeight = 44; + _tableView.scrollEnabled = NO; + +// MJWeakSelf +// _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ +// weakSelf.page = 1; +// if (self.isSearch) { +// [self getMemberListWithSearch:self.textField.text]; +// }else{ +// [self getMemberListWithSearch:@""]; +// } +// }]; +// _tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ +// weakSelf.page++; +// if (self.isSearch) { +// [self getMemberListWithSearch:self.textField.text]; +// }else{ +// [self getMemberListWithSearch:@""]; +// } +// }]; + } + return _tableView; +} +- (QXEffectContentView *)fullEffectView { + if (!_fullEffectView) { + _fullEffectView = [[QXEffectContentView alloc] initWithFrame:[UIScreen mainScreen].bounds]; + _fullEffectView.queue = dispatch_queue_create("qx_room_full_preview_dress.com", NULL); + _fullEffectView.hidden = YES; + } + return _fullEffectView; +} + +-(void)showInView:(UIView *)view{ + self.bgView.y = SCREEN_HEIGHT; + [view addSubview:self]; + [UIView animateWithDuration:0.3 animations:^{ + self.bgView.y = SCREEN_HEIGHT- ScaleWidth(429)-kSafeAreaBottom; + }]; +} +-(void)hide{ + [UIView animateWithDuration:0.3 animations:^{ + self.bgView.y = SCREEN_HEIGHT; + } completion:^(BOOL finished) { + [self removeFromSuperview]; + }]; +} +@end diff --git a/QXLive/Mine(音域)/View/个性装扮/QXDressShopCell.h b/QXLive/Mine(音域)/View/个性装扮/QXDressShopCell.h new file mode 100644 index 0000000..8651f01 --- /dev/null +++ b/QXLive/Mine(音域)/View/个性装扮/QXDressShopCell.h @@ -0,0 +1,21 @@ +// +// QXDressShopCell.h +// QXLive +// +// Created by 启星 on 2026/1/3. +// + +#import +#import "QXUserDressModel.h" +NS_ASSUME_NONNULL_BEGIN + +@interface QXDressShopCell : UICollectionViewCell +@property (weak, nonatomic) IBOutlet UIView *discountView; +@property (weak, nonatomic) IBOutlet UILabel *discountLabel; +@property (weak, nonatomic) IBOutlet UIButton *coinBtn; +@property (weak, nonatomic) IBOutlet UIImageView *dressImageView; +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (nonatomic,strong)QXShopDressModel *model; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/View/个性装扮/QXDressShopCell.m b/QXLive/Mine(音域)/View/个性装扮/QXDressShopCell.m new file mode 100644 index 0000000..8df775e --- /dev/null +++ b/QXLive/Mine(音域)/View/个性装扮/QXDressShopCell.m @@ -0,0 +1,34 @@ +// +// QXDressShopCell.m +// QXLive +// +// Created by 启星 on 2026/1/3. +// + +#import "QXDressShopCell.h" +#import "NSString+QX.h" +@implementation QXDressShopCell +-(void)setModel:(QXShopDressModel *)model{ + _model = model; + [self.dressImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]]; + if (model.discount.intValue == 0) { + self.discountView.hidden = YES; + NSString *coin = [NSString stringWithFormat:@"%@",model.price]; + NSAttributedString *str = [[NSAttributedString alloc] initWithString:coin]; + [self.coinBtn setAttributedTitle:str forState:(UIControlStateNormal)]; + }else{ + self.discountView.hidden = NO; + self.discountLabel.text = model.discount_str; + NSString *coin = [NSString stringWithFormat:@"%@ %@",model.price,model.original_price]; + NSAttributedString *str = [coin deleteLineWithTextColor:RGB16(0xAAAAAA) lineColor:RGB16(0xAAAAAA) range:[coin rangeOfString:model.original_price]]; + [self.coinBtn setAttributedTitle:str forState:(UIControlStateNormal)]; + } + self.nameLabel.text = model.title; + +} +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +@end diff --git a/QXLive/Mine(音域)/View/个性装扮/QXDressShopCell.xib b/QXLive/Mine(音域)/View/个性装扮/QXDressShopCell.xib new file mode 100644 index 0000000..296eebe --- /dev/null +++ b/QXLive/Mine(音域)/View/个性装扮/QXDressShopCell.xib @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QXLive/Mine(音域)/View/每日任务/QXDayTaskRuleView.m b/QXLive/Mine(音域)/View/每日任务/QXDayTaskRuleView.m index 654c97b..6062759 100644 --- a/QXLive/Mine(音域)/View/每日任务/QXDayTaskRuleView.m +++ b/QXLive/Mine(音域)/View/每日任务/QXDayTaskRuleView.m @@ -38,10 +38,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; [self removeFromSuperview]; } - (void)loadData { - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSString *urlStr = [NSString stringWithFormat:@"%@web/index.html#/pages/other/taskDesc",server]; NSURL* url=[NSURL URLWithString:urlStr]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; diff --git a/QXLive/Mine(音域)/View/设置/QXBlackListCell.h b/QXLive/Mine(音域)/View/设置/QXBlackListCell.h index 7bcde8f..e84db26 100644 --- a/QXLive/Mine(音域)/View/设置/QXBlackListCell.h +++ b/QXLive/Mine(音域)/View/设置/QXBlackListCell.h @@ -27,6 +27,8 @@ typedef NS_ENUM(NSInteger) { QXBlackListCellTypeRank, /// 访客 QXBlackListCellTypeVisit, + /// 群聊成员 + QXBlackListCellTypeGroupMember, }QXBlackListCellType; NS_ASSUME_NONNULL_BEGIN @protocol QXBlackListCellDelegate @@ -40,6 +42,8 @@ NS_ASSUME_NONNULL_BEGIN -(void)didHugSeatWithModel:(QXRoomUserInfoModel*)model isUpSeat:(BOOL)isUpSeat; +-(void)didClickGroupMemberMoreBtnWithGroupMemberModel:(QXUserHomeModel*)groupMemberModel; + @end @interface QXBlackListCell : UITableViewCell @property (weak, nonatomic) IBOutlet UIImageView *headerImageView; @@ -62,6 +66,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong)QXRoomUserInfoModel *onlineUser; @property (nonatomic,strong)QXRoomOnlineList *rankModel; + +@property (nonatomic,strong)QXUserHomeModel *groupMemberModel; +(instancetype)cellWithTableView:(UITableView *)tableView; @end diff --git a/QXLive/Mine(音域)/View/设置/QXBlackListCell.m b/QXLive/Mine(音域)/View/设置/QXBlackListCell.m index ab2a9fe..c61a44b 100644 --- a/QXLive/Mine(音域)/View/设置/QXBlackListCell.m +++ b/QXLive/Mine(音域)/View/设置/QXBlackListCell.m @@ -46,6 +46,12 @@ } } break; + case QXBlackListCellTypeGroupMember:{ + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickGroupMemberMoreBtnWithGroupMemberModel:)]) { + [self.delegate didClickGroupMemberMoreBtnWithGroupMemberModel:self.groupMemberModel]; + } + } + break; default: break; @@ -270,10 +276,32 @@ self.removeBtn.hidden = YES; } break; + + case QXBlackListCellTypeGroupMember:{ + self.removeBtn.hidden = NO; + } + break; default: break; } } + +-(void)setGroupMemberModel:(QXUserHomeModel *)groupMemberModel{ + _groupMemberModel = groupMemberModel; + [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:groupMemberModel.avatar]]; + self.nameLabel.text = groupMemberModel.nickname; + if (groupMemberModel.sex.intValue == 1) { + self.sexImageView.image = [UIImage imageNamed:@"user_sex_boy"]; + self.sexImageView.hidden = NO; + }else if(groupMemberModel.sex.intValue == 2){ + self.sexImageView.image = [UIImage imageNamed:@"user_sex_girl"]; + self.sexImageView.hidden = NO; + }else{ + self.sexImageView.hidden = YES; + } + BOOL isMute = groupMemberModel.is_mute.intValue == 1; + [self.removeBtn setTitle:isMute?@"解禁":@"禁言" forState:(UIControlStateNormal)]; +} -(void)setIsNoIcon:(BOOL)isNoIcon{ _isNoIcon = isNoIcon; } diff --git a/QXLive/Mine(音域)/View/设置/QXBlackListCell.xib b/QXLive/Mine(音域)/View/设置/QXBlackListCell.xib index dfbf8da..48397a7 100644 --- a/QXLive/Mine(音域)/View/设置/QXBlackListCell.xib +++ b/QXLive/Mine(音域)/View/设置/QXBlackListCell.xib @@ -10,7 +10,7 @@ - + diff --git a/QXLive/Mine(音域)/View/设置/QXSettingCell.h b/QXLive/Mine(音域)/View/设置/QXSettingCell.h index db8ce38..c6c1712 100644 --- a/QXLive/Mine(音域)/View/设置/QXSettingCell.h +++ b/QXLive/Mine(音域)/View/设置/QXSettingCell.h @@ -18,10 +18,20 @@ typedef NS_ENUM(NSInteger) { /// 标题在上 详情在下 带箭头 QXSettingCellTypeTitleTopAndArrow, /// 标题在上 详情在下 不带箭头 - QXSettingCellTypeTitleTopNoArrow + QXSettingCellTypeTitleTopNoArrow, + /// 购买数量 + QXSettingCellTypeBuyCount }QXSettingCellType; NS_ASSUME_NONNULL_BEGIN +@protocol QXSettingCellDelegate +@optional + +-(void)reductionDidClickWithTotalNum:(NSString*)totalNum; + +-(void)addDidClickWithTotalNum:(NSString*)totalNum; + +@end @interface QXSettingCell : UITableViewCell @property (strong, nonatomic) UILabel *titleLabel; @property (strong, nonatomic) UILabel *detailLabel; @@ -31,6 +41,14 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic) UIView *lineView; @property (assign, nonatomic) QXSettingCellType cellType; @property (assign, nonatomic) BOOL needLine; + +@property (strong, nonatomic) UIView *buyCountView; +@property (strong, nonatomic) UIButton *reductionBtn; +@property (strong, nonatomic) UITextField *textField; +@property (strong, nonatomic) UIButton *addBtn; + +@property (weak, nonatomic) id delegate; + +(instancetype)cellWithTableView:(UITableView *)tableView; @end diff --git a/QXLive/Mine(音域)/View/设置/QXSettingCell.m b/QXLive/Mine(音域)/View/设置/QXSettingCell.m index f07094a..f54e26a 100644 --- a/QXLive/Mine(音域)/View/设置/QXSettingCell.m +++ b/QXLive/Mine(音域)/View/设置/QXSettingCell.m @@ -27,6 +27,7 @@ _cellType = cellType; switch (cellType) { case QXSettingCellTypeNormal:{ + self.buyCountView.hidden = YES; self.detailLabel.hidden = NO; self.rightArrow.hidden = NO; self.btnSwitch.hidden = YES; @@ -49,6 +50,7 @@ } break; case QXSettingCellTypeOnlyArrow:{ + self.buyCountView.hidden = YES; self.detailLabel.hidden = YES; self.rightArrow.hidden = NO; self.rightConstraint.constant = 16; @@ -66,6 +68,7 @@ } break; case QXSettingCellTypeOnlyDetail:{ + self.buyCountView.hidden = YES; self.detailLabel.hidden = NO; self.rightArrow.hidden = YES; self.btnSwitch.hidden = YES; @@ -83,6 +86,7 @@ } break; case QXSettingCellTypeSwitch:{ + self.buyCountView.hidden = YES; self.detailLabel.hidden = YES; self.rightArrow.hidden = YES; self.btnSwitch.hidden = NO; @@ -99,6 +103,7 @@ } break; case QXSettingCellTypeTitleTopAndArrow:{ + self.buyCountView.hidden = YES; self.detailLabel.hidden = NO; self.rightArrow.hidden = NO; self.btnSwitch.hidden = YES; @@ -118,6 +123,7 @@ } break; case QXSettingCellTypeTitleTopNoArrow:{ + self.buyCountView.hidden = YES; self.detailLabel.hidden = NO; self.rightArrow.hidden = YES; self.btnSwitch.hidden = YES; @@ -136,6 +142,19 @@ }]; } break; + case QXSettingCellTypeBuyCount:{ + self.detailLabel.hidden = YES; + self.rightArrow.hidden = YES; + self.btnSwitch.hidden = YES; + self.buyCountView.hidden = NO; + [self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(16); + make.top.mas_equalTo(9); + make.height.mas_equalTo(21); + make.right.equalTo(self.contentView).offset(-10); + }]; + } + break; default: break; } @@ -193,6 +212,56 @@ make.height.mas_equalTo(0.5); make.bottom.equalTo(self.contentView); }]; + + self.buyCountView = [[UIView alloc] init]; + self.buyCountView.hidden = YES; + [self.contentView addSubview:self.buyCountView]; + [self.buyCountView mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-16); + make.height.mas_equalTo(30); + make.centerY.equalTo(self.contentView); + make.width.mas_equalTo(110); + }]; + + self.reductionBtn = [[UIButton alloc] init]; + [self.reductionBtn setTitle:@"-" forState:(UIControlStateNormal)]; + self.reductionBtn.titleLabel.font = [UIFont boldSystemFontOfSize:18]; + [self.reductionBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)]; + self.reductionBtn.backgroundColor = RGB(236, 240, 246); + [self.reductionBtn addTarget:self action:@selector(reductionAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.buyCountView addSubview:self.reductionBtn]; + [self.reductionBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.bottom.equalTo(self.buyCountView); + make.width.mas_equalTo(30); + }]; + + self.addBtn = [[UIButton alloc] init]; + [self.addBtn setTitle:@"+" forState:(UIControlStateNormal)]; + self.addBtn.titleLabel.font = [UIFont boldSystemFontOfSize:18]; + self.addBtn.backgroundColor = RGB(236, 240, 246); + [self.addBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)]; + [self.addBtn addTarget:self action:@selector(addAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.buyCountView addSubview:self.addBtn]; + [self.addBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.top.bottom.equalTo(self.buyCountView); + make.width.mas_equalTo(30); + }]; + + self.textField = [[UITextField alloc] init]; + self.textField.font = [UIFont systemFontOfSize:14]; + self.textField.textColor = RGB16(0x333333); + self.textField.textAlignment = NSTextAlignmentCenter; + self.textField.backgroundColor = RGB(236, 240, 246); + self.textField.userInteractionEnabled = NO; + self.textField.text = @"1"; + [self.buyCountView addSubview:self.textField]; + [self.textField mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.reductionBtn.mas_right).offset(3); + make.right.equalTo(self.addBtn.mas_left).offset(-3); + make.top.bottom.equalTo(self.buyCountView); + }]; + + } -(void)setNeedLine:(BOOL)needLine{ _needLine = needLine; @@ -201,6 +270,26 @@ //- (void)btnSwitchAction:(UIButton *)sender { //// sender.selected = !sender.selected; //} + +-(void)addAction{ + NSInteger number = self.textField.text.integerValue; + self.textField.text = [NSString stringWithFormat:@"%ld",number+=1]; + if (self.delegate && [self.delegate respondsToSelector:@selector(addDidClickWithTotalNum:)]) { + [self.delegate addDidClickWithTotalNum:self.textField.text]; + } +} + +-(void)reductionAction{ + NSInteger number = self.textField.text.integerValue; + if (number <= 1) { + showToast(@"商品数量不能少于1个"); + return; + } + self.textField.text = [NSString stringWithFormat:@"%ld",number-=1]; + if (self.delegate && [self.delegate respondsToSelector:@selector(reductionDidClickWithTotalNum:)]) { + [self.delegate reductionDidClickWithTotalNum:self.textField.text]; + } +} - (void)awakeFromNib { [super awakeFromNib]; // Initialization code diff --git a/QXLive/Mine(音域)/View/钱包/QXWalletRuleView.m b/QXLive/Mine(音域)/View/钱包/QXWalletRuleView.m index 07acece..41b27fc 100644 --- a/QXLive/Mine(音域)/View/钱包/QXWalletRuleView.m +++ b/QXLive/Mine(音域)/View/钱包/QXWalletRuleView.m @@ -83,10 +83,7 @@ [self hide]; } - (void)loadData { - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *urlStr = [NSString stringWithFormat:@"%@api/Page/page_show?id=28",server]; NSURL* url=[NSURL URLWithString:urlStr]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; diff --git a/QXLive/Network/QXRequest.m b/QXLive/Network/QXRequest.m index f374785..f7ded1b 100644 --- a/QXLive/Network/QXRequest.m +++ b/QXLive/Network/QXRequest.m @@ -209,10 +209,7 @@ static NSInteger HTTP_ERROR_CODE = 0; return nil; } if (!([urlString hasPrefix:@"http"] || [urlString hasPrefix:@"https"])) { - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; urlString = [NSString stringWithFormat:@"%@%@",server,urlString]; } NSLog(@"发起请求 --- URL : %@",urlString); diff --git a/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Contents.json index 581b2fc..76ad6b5 100644 --- a/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Contents.json +++ b/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Contents.json @@ -5,12 +5,12 @@ "scale" : "1x" }, { - "filename" : "Frame 1321316289@2x.png", + "filename" : "room_sound_sel@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Frame 1321316289@3x.png", + "filename" : "room_sound_sel@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Frame 1321316289@2x.png b/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Frame 1321316289@2x.png deleted file mode 100644 index a6787fd..0000000 Binary files a/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Frame 1321316289@2x.png and /dev/null differ diff --git a/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Frame 1321316289@3x.png b/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Frame 1321316289@3x.png deleted file mode 100644 index 534aa67..0000000 Binary files a/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/Frame 1321316289@3x.png and /dev/null differ diff --git a/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/room_sound_sel@2x.png b/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/room_sound_sel@2x.png new file mode 100644 index 0000000..2a01a7c Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/room_sound_sel@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/room_sound_sel@3x.png b/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/room_sound_sel@3x.png new file mode 100644 index 0000000..2564bb3 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/room_sound_sel.imageset/room_sound_sel@3x.png differ diff --git a/QXLive/Other/QXApi.h b/QXLive/Other/QXApi.h index b5f24ec..ea669de 100644 --- a/QXLive/Other/QXApi.h +++ b/QXLive/Other/QXApi.h @@ -27,8 +27,8 @@ static NSString* RH5ServerUrl = @"https://test.vespa.qxyushen.top/h5/"; //static NSString* H5ServerUrl = @"https://vespa.qxyushen.top/h5/"; static NSString* ServerUrl = @"https://yushengapi.qxyushen.top/"; static NSString* H5ServerUrl = @"https://yushengapi.qxyushen.top/h5/"; -static NSString* RServerUrl = @"https://qixinghuishen.qxhs.xyz/"; -static NSString* RH5ServerUrl = @"https://qixinghuishen.qxhs.xyz/h5/"; +static NSString* RServerUrl = @"https://details.qxhs.xyz/"; +static NSString* RH5ServerUrl = @"https://details.qxhs.xyz/h5/"; #endif #pragma mark - 引导页 /// 引导页 @@ -578,4 +578,19 @@ static NSString * QXActivityStatus = @"api/BlindBoxTurntable/blind_box_status"; static NSString * QXBeforeJoinRoom = @"api/Room/before_join_room_check"; /// APP配置 static NSString * QXRedpacketConfig = @"api/Redpacket/appConfig"; + + +/// 群聊相关 +/// 群聊设置详情 +static NSString * QXGroupSettingInfo = @"api/Guild/get_guild_info"; +/// 群聊成员 +static NSString * QXGroupMemberList = @"api/Guild/member_list"; +/// 设置群聊信息 +static NSString * QXSetGroupInfo = @"api/Guild/set_guild_info"; +/// 道具商城列表 +static NSString * QXShopDressList = @"api/Decorate/get_decorate_list"; +/// 道具商城商品详情 +static NSString * QXShopDressDetail = @"api/Decorate/get_decorate_detail"; +/// 购买装扮 +static NSString * QXShopBuyDress = @"api/Decorate/pay_decorate"; #endif /* Api_h */ diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController+Friend.m b/QXLive/Room(房间)/Controller/QXRoomViewController+Friend.m index c9a3116..16dbe65 100644 --- a/QXLive/Room(房间)/Controller/QXRoomViewController+Friend.m +++ b/QXLive/Room(房间)/Controller/QXRoomViewController+Friend.m @@ -44,9 +44,11 @@ } } if (haveMe == NO) { + self.upSeatBtn.selected = NO; self.bottomView.status = 1; [[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:NO]; }else{ + self.upSeatBtn.selected = YES; self.bottomView.status = 2; if ([QXAgoraEngine sharedEngine].isOpenMic) { [self.bottomView setMuteAudioStatus:1]; diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController.h b/QXLive/Room(房间)/Controller/QXRoomViewController.h index a880eff..3797f56 100644 --- a/QXLive/Room(房间)/Controller/QXRoomViewController.h +++ b/QXLive/Room(房间)/Controller/QXRoomViewController.h @@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN /// 是否为最小化房间进来 @property (nonatomic,assign)BOOL isReJoin; +@property (nonatomic,strong)UIButton *upSeatBtn; + @property (nonatomic,strong)QXRoomModel* roomModel; /// 麦位视图 @property (nonatomic,strong)QXRoomSeatView *seatContentView; diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController.m b/QXLive/Room(房间)/Controller/QXRoomViewController.m index a9c65fb..e67a475 100644 --- a/QXLive/Room(房间)/Controller/QXRoomViewController.m +++ b/QXLive/Room(房间)/Controller/QXRoomViewController.m @@ -59,7 +59,6 @@ QXRoomUserInfoViewDelegate @property (nonatomic,strong)UIButton *soundBtn; -@property (nonatomic,strong)UIButton *upSeatBtn; /// 排麦按钮 @property (nonatomic,strong)QXUpSeatCountView *micTeamView; diff --git a/QXLive/Room(房间)/View/QXAllRoomHourRankView.m b/QXLive/Room(房间)/View/QXAllRoomHourRankView.m index 8c5e4ad..4d0dd32 100644 --- a/QXLive/Room(房间)/View/QXAllRoomHourRankView.m +++ b/QXLive/Room(房间)/View/QXAllRoomHourRankView.m @@ -182,10 +182,7 @@ -(void)helpAction{ QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",server,@"24"]; vc.urlStr = urlString; [self.viewController.navigationController pushViewController:vc animated:YES]; diff --git a/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.h b/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.h index 4a551cc..dbcdf2c 100644 --- a/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.h +++ b/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.h @@ -7,6 +7,7 @@ #import #import "QXRoomRelationModel.h" +#import "QXUserDressModel.h" NS_ASSUME_NONNULL_BEGIN @interface QXSelectAuctionInfoView : UIView @@ -26,6 +27,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong) QXRoomRelationModel *model; @property (nonatomic,strong) QXRoomRelationModel *timeModel; +@property (nonatomic,strong) QXShopDressPriceModel *priceModel; @property (nonatomic,strong) UIButton *selectedBtn; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.m b/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.m index a70a23b..f8752cf 100644 --- a/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.m +++ b/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.m @@ -428,6 +428,15 @@ self.selectedBtn.layer.borderWidth = 1; self.selectedBtn.selected = timeModel.isSelected; } +-(void)setPriceModel:(QXShopDressPriceModel *)priceModel{ + _priceModel = priceModel; + [self.selectedBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateSelected)]; + [self.selectedBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)]; + [self.selectedBtn setTitle:priceModel.day forState:(UIControlStateNormal)]; + self.selectedBtn.layer.borderColor = RGB16(0xF1F2F3).CGColor; + self.selectedBtn.layer.borderWidth = 1; + self.selectedBtn.selected = priceModel.isSelected; +} -(void)initSubviews{ self.selectedBtn = [[UIButton alloc] init]; [self.selectedBtn setBackgroundImage:[UIImage imageNamed:@"room_sound_sel"] forState:(UIControlStateSelected)]; diff --git a/QXLive/Room(房间)/View/红包/QXRedBagSendView.m b/QXLive/Room(房间)/View/红包/QXRedBagSendView.m index 20b0088..0b6d06b 100644 --- a/QXLive/Room(房间)/View/红包/QXRedBagSendView.m +++ b/QXLive/Room(房间)/View/红包/QXRedBagSendView.m @@ -798,10 +798,7 @@ -(void)helpAction{ self.isFromRule = YES; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@api/Page/page_show?id=25",server]]]; [self.webView loadRequest:request]; self.backBtn.hidden = NO; diff --git a/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.h b/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.h index 57350cc..e9aea03 100644 --- a/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.h +++ b/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.h @@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN @property (weak, nonatomic) IBOutlet UIButton *endBtn; @property (weak, nonatomic) IBOutlet UIButton *upBtn; @property (weak, nonatomic) IBOutlet UILabel *userNameLabel; +@property (weak, nonatomic) IBOutlet UILabel *userCodeLabel; @property (nonatomic,copy)void(^moveSuccessBlock)(void); +(instancetype)cellWithTableView:(UITableView *)tableView; @end diff --git a/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.m b/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.m index 21db8ff..0957661 100644 --- a/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.m +++ b/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.m @@ -96,7 +96,12 @@ NSString *time = [NSString stringWithFormat:@"%02ld:%02ld",model.duration/60,model.duration%60]; self.posterLabel.text = [NSString stringWithFormat:@"%@ %@",time,model.singer]; self.songNameLabel.text = model.song_name; - self.userNameLabel.text = model.nickname; + if (self.isSearch) { + + }else{ + self.userNameLabel.text = model.nickname; + self.userCodeLabel.text = [NSString stringWithFormat:@"ID:%@",model.user_code]; + } } - (void)awakeFromNib { [super awakeFromNib]; diff --git a/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.xib b/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.xib index 5409da6..74effec 100644 --- a/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.xib +++ b/QXLive/Room(房间)/View/练歌房/QXRoomSongListCell.xib @@ -11,17 +11,17 @@ - + - + - - + + @@ -31,30 +31,31 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - + - + diff --git a/QXLive/Room(房间)/View/练歌房/QXRoomSongListSubView.m b/QXLive/Room(房间)/View/练歌房/QXRoomSongListSubView.m index 5684077..ac99f8b 100644 --- a/QXLive/Room(房间)/View/练歌房/QXRoomSongListSubView.m +++ b/QXLive/Room(房间)/View/练歌房/QXRoomSongListSubView.m @@ -9,7 +9,7 @@ #import "QXRoomSongListCell.h" #import "QXAgoraEngine.h" #import "QXMineNetwork.h" - +#import "QXCustomAlertView.h" @interface QXRoomSongListSubView() @property (nonatomic,strong)UIView *searchBgView; @property (nonatomic,strong)UIImageView *searchIcon; @@ -196,10 +196,49 @@ }; return cell; } +//-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ +// +//} +//-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ +// if (self.isCompere && !self.isSearch) { +// return YES; +// } +// return NO; +//} +//-(UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath{ +// QXSongListModel *model = self.dataArray[indexPath.row]; +// MJWeakSelf +// UIContextualAction *deletAction = [UIContextualAction contextualActionWithStyle:(UIContextualActionStyleDestructive) title:@"删除" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) { +// [weakSelf deleteSongWithModel:model]; +// completionHandler(YES); +// }]; +// UISwipeActionsConfiguration *config = [UISwipeActionsConfiguration configurationWithActions:@[deletAction]]; +// return config; +//} +-(void)deleteSongWithModel:(QXSongListModel*)model{ + QXCustomAlertView *alertView = [[QXCustomAlertView alloc] init]; + [alertView showInView:self title:@"您确定要删除歌曲吗" message:[NSString stringWithFormat:@"歌曲名称:%@\n演唱者:%@ ",model.song_name,model.nickname] cancleTitle:@"取消" commitTitle:@"确定"]; + MJWeakSelf + alertView.commitBlock = ^{ +// [QXMineNetwork mineUserAddAndDeleteAndEditWithType:2 Id:model.id songName:model.song_name giftId:model.gift_id giftNum:model.gift_num successBlock:^(NSDictionary * _Nonnull dict) { +// showToast(@"删除成功"); +// weakSelf.page = 1; +// [weakSelf getSongList]; +// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { +// showToast(@"删除失败"); +// }]; + }; +} + -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ // QXSongListModel *model = self.dataArray[indexPath.row]; // [[QXAgoraEngine sharedEngine] ktv_EndSing]; // [[QXAgoraEngine sharedEngine] ktv_StartSing:YES withSong:model]; + if (self.isCompere && !self.isSearch) { + QXSongListModel *model = self.dataArray[indexPath.row]; + [self deleteSongWithModel:model]; + } + } -(NSMutableArray *)dataArray{ if (!_dataArray) { diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeAuctionView.m b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeAuctionView.m index ec0dc74..e84dae2 100644 --- a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeAuctionView.m +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeAuctionView.m @@ -1082,10 +1082,7 @@ /// 亲密 Id = @"22"; } - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",server,Id]; QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; vc.urlStr = urlString; diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m index 365ea6c..b64c34f 100644 --- a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m @@ -497,10 +497,7 @@ } -(void)helpAction{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",server,@"32"]; QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; vc.urlStr = urlString; @@ -760,7 +757,7 @@ } } } - +// 签约开始 -(void)signDidStartWithEndTime:(NSString *)endTime signId:(NSString *)signId signDay:(NSString*)signDay signValue:(NSString*)signValue{ QXSignAlertView *startView = [[QXSignAlertView alloc] initWithType:(QXSignAlerTypeStart)]; [startView showInView:self.viewController.view]; diff --git a/QXLive/Tabbar/QXTabbarController.m b/QXLive/Tabbar/QXTabbarController.m index 24f372f..cc59eb2 100644 --- a/QXLive/Tabbar/QXTabbarController.m +++ b/QXLive/Tabbar/QXTabbarController.m @@ -44,6 +44,7 @@ @property(nonatomic,assign) BOOL isAlreadyShowChirld; @property(nonatomic,strong) QXAppVersionView *appUpdateView; @property (nonatomic,strong)NSString* signStatus; +@property (nonatomic,assign)BOOL isShowSign; @end @implementation QXTabbarController @@ -55,7 +56,8 @@ [self setupTabbar]; [self configChildVC]; [self getSignStatus]; - [self performSelector:@selector(signAction) afterDelay:60]; + [self needShowSign]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(needShowSign) name:noticeTencentLogin object:nil]; [self getAppConfig]; } @@ -163,6 +165,9 @@ // // }]; } +-(void)needShowSign{ + [self performSelector:@selector(signAction) afterDelay:60]; +} -(void)getSignStatus{ MJWeakSelf [QXMineNetwork appSignTaskStatusSuccessBlock:^(NSString * _Nonnull status) { @@ -175,10 +180,14 @@ if (!QXGlobal.shareGlobal.isLogin) { return; } + if (self.isShowSign) { + return; + } if (self.signStatus.intValue == 1) { return; }else{ [self popSignTask]; + self.isShowSign = YES; } } diff --git a/QXLive/Tools/COS/QXCOSUploadManager.m b/QXLive/Tools/COS/QXCOSUploadManager.m index eaf890f..afc89a6 100644 --- a/QXLive/Tools/COS/QXCOSUploadManager.m +++ b/QXLive/Tools/COS/QXCOSUploadManager.m @@ -28,10 +28,7 @@ return self; } -(void)uploadFile:(id)file withObjectKey:(NSString *)key path:(NSString *)path complete:(void (^)(NSString * _Nonnull, QXCOSUploadImageState))complete { - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] getWithUrl:[NSString stringWithFormat:@"%@%@",server,QXGetCosTempKeys] parameters:@{} needCache:NO success:^(id responseObject) { QXCOSUploadModel *model = [QXCOSUploadModel yy_modelWithJSON:responseObject[@"data"]]; if (![model.region isExist] || ![model.bucket isExist] || ![model.credentials.sessionToken isExist] || ![model.credentials.tmpSecretId isExist] || ![model.credentials.tmpSecretKey isExist]) { @@ -102,10 +99,7 @@ } -(void)audioUploadFile:(id)file withObjectKey:(NSString *)key complete:(void (^)(NSString * fileUrl, QXCOSUploadImageState state))complete{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] getWithUrl:[NSString stringWithFormat:@"%@%@",server,QXGetCosTempKeys] parameters:@{} needCache:NO success:^(id responseObject) { QXCOSUploadModel *model = [QXCOSUploadModel yy_modelWithJSON:responseObject[@"data"]]; if (![model.region isExist] || ![model.bucket isExist] || ![model.credentials.sessionToken isExist] || ![model.credentials.tmpSecretId isExist] || ![model.credentials.tmpSecretKey isExist]) { @@ -176,10 +170,7 @@ } -(void)uploadFile:(NSArray *)files withObjectKey:(NSArray *)objectKeys isAsync:(BOOL)isAsync complete:(void (^)(NSArray * _Nullable, QXCOSUploadImageState))complete{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] getWithUrl:[NSString stringWithFormat:@"%@%@",server,QXGetCosTempKeys] parameters:@{} needCache:NO success:^(id responseObject) { QXCOSUploadModel *model = [QXCOSUploadModel yy_modelWithJSON:responseObject[@"data"]]; if (![model.region isExist] || ![model.bucket isExist] || ![model.credentials.sessionToken isExist] || ![model.credentials.tmpSecretId isExist] || ![model.credentials.tmpSecretKey isExist]) { @@ -276,10 +267,7 @@ } -(void)activityUploadFile:(NSArray *)files withObjectKey:(NSArray *)objectKeys isAsync:(BOOL)isAsync complete:(void (^)(NSArray * _Nonnull, QXCOSUploadImageState))complete{ - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] getWithUrl:[NSString stringWithFormat:@"%@%@",server,QXGetCosTempKeys] parameters:@{} needCache:NO success:^(id responseObject) { QXCOSUploadModel *model = [QXCOSUploadModel yy_modelWithJSON:responseObject[@"data"]]; if (![model.region isExist] || ![model.bucket isExist] || ![model.credentials.sessionToken isExist] || ![model.credentials.tmpSecretId isExist] || ![model.credentials.tmpSecretKey isExist]) { diff --git a/QXLive/Tools/QXTextView.m b/QXLive/Tools/QXTextView.m index 6323d2c..a063e62 100644 --- a/QXLive/Tools/QXTextView.m +++ b/QXLive/Tools/QXTextView.m @@ -88,7 +88,14 @@ [attr yy_setColor:self.lengthColor range:[str rangeOfString:length]]; self.maxCountLabel.attributedText = attr; } - +-(void)setText:(NSString *)text{ + [super setText:text]; + if (self.text.length == 0) { + self.placehoulderLabel.hidden = NO; + }else{ + self.placehoulderLabel.hidden = YES; + } +} -(void)setMaxLength:(NSInteger)maxLength{ _maxLength = maxLength; NSString *length = [NSString stringWithFormat:@"%ld",self.maxLength - self.text.length]; diff --git a/QXLive/chirld(青少年)/QXChirldViewController.m b/QXLive/chirld(青少年)/QXChirldViewController.m index 85f6c6f..2c58e92 100644 --- a/QXLive/chirld(青少年)/QXChirldViewController.m +++ b/QXLive/chirld(青少年)/QXChirldViewController.m @@ -41,10 +41,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext; , 2)]; } - (void)loadData { - NSString *server = H5ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RH5ServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentH5Server; NSInteger safeTop = kSafeAreaTop; NSURL* url= [NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/feedback/teenage?id=%@&h=%ld",server,[QXGlobal shareGlobal].loginModel.token,safeTop]]; NSURLRequest *request =[NSURLRequest requestWithURL:url]; diff --git a/QXLive/活动/天空之境/QXSkyPraizePoolView.m b/QXLive/活动/天空之境/QXSkyPraizePoolView.m index 2149c48..1bad44d 100644 --- a/QXLive/活动/天空之境/QXSkyPraizePoolView.m +++ b/QXLive/活动/天空之境/QXSkyPraizePoolView.m @@ -71,14 +71,11 @@ return; } MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":self.giftModel.gift_bag?self.giftModel.gift_bag:@"",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; - [self.collectionView reloadData]; + [weakSelf.collectionView reloadData]; } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { }]; diff --git a/QXLive/活动/天空之境/QXSkyPraizeRecordView.m b/QXLive/活动/天空之境/QXSkyPraizeRecordView.m index 8bd5d99..e0df5fc 100644 --- a/QXLive/活动/天空之境/QXSkyPraizeRecordView.m +++ b/QXLive/活动/天空之境/QXSkyPraizeRecordView.m @@ -125,10 +125,7 @@ @"gift_bag_id":self.giftModel.gift_bag, @"page":[NSNumber numberWithInteger:self.page] }; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_my_record"]; if (self.myRecordBtn.selected) { url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_my_record"]; diff --git a/QXLive/活动/天空之境/QXSkyPraizeView.m b/QXLive/活动/天空之境/QXSkyPraizeView.m index d16ccf6..a1da8a8 100644 --- a/QXLive/活动/天空之境/QXSkyPraizeView.m +++ b/QXLive/活动/天空之境/QXSkyPraizeView.m @@ -348,10 +348,7 @@ static NSInteger toSlowCount = 4; // return; // } MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":self.giftModel.gift_bag?self.giftModel.gift_bag:@"",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; @@ -409,10 +406,7 @@ static NSInteger toSlowCount = 4; }; self.isDrawing = YES; MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/draw_gift"] parameters:parameters needCache:NO success:^(id responseObject) { QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.drawResultModel = model; @@ -521,11 +515,21 @@ static NSInteger toSlowCount = 4; } -(void)startFastAnimate{ + [self stopFastAnimate]; self.currentGiftView = self.allViewsArray.firstObject; self.currentGiftView.isSelected = YES; - [self stopFastAnimate]; - if (_fastTimer == nil) { - _fastTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)); + + // 修复2:创建一个新的定时器 + // 建议使用串行队列,避免多线程问题 + static dispatch_queue_t fastTimerQueue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + fastTimerQueue = dispatch_queue_create("com.yourcompany.fastTimerQueue", DISPATCH_QUEUE_SERIAL); + }); + + _fastTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, fastTimerQueue); + if (!_fastTimer) { + return; // 创建失败处理 } // dispatch_source_set_timer(_fastTimer, // dispatch_time(DISPATCH_TIME_NOW, 0), @@ -556,7 +560,10 @@ static NSInteger toSlowCount = 4; dispatch_async(dispatch_get_main_queue(), ^{ // 再次检查 strongSelf 是否存在 __strong typeof(weakSelf) strongSelfInMain = weakSelf; - if (!strongSelfInMain) return; + if (!strongSelfInMain) { + QXLOG(@"不在主线程"); + return; + } // 使用局部变量进行计算,避免频繁访问属性 roundCount++; @@ -642,10 +649,7 @@ static NSInteger toSlowCount = 4; NSDictionary *parameters = @{ @"send_id":self.drawResultModel.blind_box_turntable_id?self.drawResultModel.blind_box_turntable_id:@"" }; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/gift_send"] parameters:parameters needCache:NO success:^(id responseObject) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { @@ -654,10 +658,18 @@ static NSInteger toSlowCount = 4; }]; } --(void)stopFastAnimate{ - if (_fastTimer != nil) { - dispatch_source_cancel(_fastTimer); - _fastTimer = nil; +- (void)stopFastAnimate { + // 1. 使用局部变量捕获,防止后续被修改 + dispatch_source_t timer = _fastTimer; + _fastTimer = nil; // 2. 先立即置空实例变量 + + if (timer) { + // 3. 在定时器自己的队列上同步执行取消操作 + // 如果创建时用的全局队列,这里也用全局队列,但建议用串行队列 + dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + dispatch_sync(queue, ^{ + dispatch_source_cancel(timer); + }); } } @@ -761,10 +773,7 @@ static NSInteger toSlowCount = 4; [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (void)dealloc { - if (_fastTimer) { - dispatch_source_cancel(_fastTimer); - _fastTimer = nil; - } + [self stopFastAnimate]; NSLog(@"%@ dealloc", NSStringFromClass([self class])); } @end @@ -862,7 +871,15 @@ static NSInteger toSlowCount = 4; } -(void)setIsSelected:(BOOL)isSelected{ _isSelected = isSelected; - self.bgImageView.image = [UIImage imageNamed:isSelected?@"sky_item_sel":@"sky_item_nor"]; + if (isSelected) { + QXLOG(@"礼物%@设置了选中",self.giftModel.gift_name); + }else{ + QXLOG(@"礼物%@设置了未选中",self.giftModel.gift_name); + } + dispatch_async(dispatch_get_main_queue(), ^{ + self.bgImageView.image = [UIImage imageNamed:isSelected?@"sky_item_sel":@"sky_item_nor"]; + }); + } - (void)startPulseAnimationWithLayer { CABasicAnimation *pulseAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; diff --git a/QXLive/活动/岁月之城/QXAgePraizePoolView.m b/QXLive/活动/岁月之城/QXAgePraizePoolView.m index 83eaffc..e0df5b3 100644 --- a/QXLive/活动/岁月之城/QXAgePraizePoolView.m +++ b/QXLive/活动/岁月之城/QXAgePraizePoolView.m @@ -65,10 +65,7 @@ return; } MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"11",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; diff --git a/QXLive/活动/岁月之城/QXAgePraizeRecordView.m b/QXLive/活动/岁月之城/QXAgePraizeRecordView.m index 1a528dc..4bcabbf 100644 --- a/QXLive/活动/岁月之城/QXAgePraizeRecordView.m +++ b/QXLive/活动/岁月之城/QXAgePraizeRecordView.m @@ -118,10 +118,7 @@ @"gift_bag_id":@"11", @"page":[NSNumber numberWithInteger:self.page] }; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_my_record"]; if (self.myRecordBtn.selected) { url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_my_record"]; diff --git a/QXLive/活动/岁月之城/QXAgePraizeView.m b/QXLive/活动/岁月之城/QXAgePraizeView.m index eb9e437..6f4cd95 100644 --- a/QXLive/活动/岁月之城/QXAgePraizeView.m +++ b/QXLive/活动/岁月之城/QXAgePraizeView.m @@ -368,10 +368,7 @@ static NSInteger toSlowCount = 4; // return; // } MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"11",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; @@ -423,10 +420,7 @@ static NSInteger toSlowCount = 4; }; self.isDrawing = YES; MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/draw_gift"] parameters:parameters needCache:NO success:^(id responseObject) { QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.drawResultModel = model; @@ -656,10 +650,7 @@ static NSInteger toSlowCount = 4; NSDictionary *parameters = @{ @"send_id":self.drawResultModel.blind_box_turntable_id?self.drawResultModel.blind_box_turntable_id:@"" }; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/gift_send"] parameters:parameters needCache:NO success:^(id responseObject) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { diff --git a/QXLive/活动/巡乐会/QXMeetActivityPoolView.m b/QXLive/活动/巡乐会/QXMeetActivityPoolView.m index c7bd116..17afb98 100644 --- a/QXLive/活动/巡乐会/QXMeetActivityPoolView.m +++ b/QXLive/活动/巡乐会/QXMeetActivityPoolView.m @@ -63,10 +63,7 @@ return; } MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/xlh"] parameters:@{@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXActivityXLHModel *model = [QXActivityXLHModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; diff --git a/QXLive/活动/巡乐会/QXMeetActivityRankView.m b/QXLive/活动/巡乐会/QXMeetActivityRankView.m index 9e80cf7..a2d11d8 100644 --- a/QXLive/活动/巡乐会/QXMeetActivityRankView.m +++ b/QXLive/活动/巡乐会/QXMeetActivityRankView.m @@ -105,10 +105,7 @@ @"room_id":self.roomId?self.roomId:@"", @"page":[NSNumber numberWithInteger:self.page] }; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; if ([type isEqualToString:@"1"]) { NSString *url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_xlh_all_record"]; [[QXRequset shareInstance] postWithUrl:url parameters:parameters needCache:NO success:^(id responseObject) { diff --git a/QXLive/活动/巡乐会/QXMeetActivityRecordView.m b/QXLive/活动/巡乐会/QXMeetActivityRecordView.m index 6b4a177..6147063 100644 --- a/QXLive/活动/巡乐会/QXMeetActivityRecordView.m +++ b/QXLive/活动/巡乐会/QXMeetActivityRecordView.m @@ -79,10 +79,7 @@ @"room_id":self.roomId?self.roomId:@"", @"page":[NSNumber numberWithInteger:self.page] }; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_xlh_my_record"]; [[QXRequset shareInstance] postWithUrl:url parameters:parameters needCache:NO success:^(id responseObject) { if (weakSelf.page == 1) { diff --git a/QXLive/活动/巡乐会/QXMeetActivityView.m b/QXLive/活动/巡乐会/QXMeetActivityView.m index f143f68..a0e7160 100644 --- a/QXLive/活动/巡乐会/QXMeetActivityView.m +++ b/QXLive/活动/巡乐会/QXMeetActivityView.m @@ -354,10 +354,7 @@ // return; // } MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/xlh"] parameters:@{@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXActivityXLHModel *model = [QXActivityXLHModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; @@ -405,10 +402,7 @@ self.isDrawing = YES; self.resultView.times = num; MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/xlh_draw_gift"] parameters:parameters needCache:NO success:^(id responseObject) { weakSelf.resultArray = [NSArray yy_modelArrayWithClass:[QXDrawGiftModel class] json:responseObject[@"data"]]; [weakSelf getMyWallet]; diff --git a/QXLive/活动/时空之巅/QXTimePraizePoolView.m b/QXLive/活动/时空之巅/QXTimePraizePoolView.m index 01a2c74..a8ba836 100644 --- a/QXLive/活动/时空之巅/QXTimePraizePoolView.m +++ b/QXLive/活动/时空之巅/QXTimePraizePoolView.m @@ -66,10 +66,7 @@ return; } MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"12",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; diff --git a/QXLive/活动/时空之巅/QXTimePraizeRecordView.m b/QXLive/活动/时空之巅/QXTimePraizeRecordView.m index f38b92a..afec656 100644 --- a/QXLive/活动/时空之巅/QXTimePraizeRecordView.m +++ b/QXLive/活动/时空之巅/QXTimePraizeRecordView.m @@ -118,10 +118,7 @@ @"gift_bag_id":@"12", @"page":[NSNumber numberWithInteger:self.page] }; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; NSString *url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_my_record"]; if (self.myRecordBtn.selected) { url = [NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_my_record"]; diff --git a/QXLive/活动/时空之巅/QXTimePraizeView.m b/QXLive/活动/时空之巅/QXTimePraizeView.m index dad2dce..9160597 100644 --- a/QXLive/活动/时空之巅/QXTimePraizeView.m +++ b/QXLive/活动/时空之巅/QXTimePraizeView.m @@ -375,10 +375,7 @@ static NSInteger toSlowCount = 4; // return; // } MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"12",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) { QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.model = model; @@ -430,10 +427,7 @@ static NSInteger toSlowCount = 4; }; self.isDrawing = YES; MJWeakSelf - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/draw_gift"] parameters:parameters needCache:NO success:^(id responseObject) { QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]]; weakSelf.drawResultModel = model; @@ -663,10 +657,7 @@ static NSInteger toSlowCount = 4; NSDictionary *parameters = @{ @"send_id":self.drawResultModel.blind_box_turntable_id?self.drawResultModel.blind_box_turntable_id:@"" }; - NSString *server = ServerUrl; - if (QXGlobal.shareGlobal.isNeedChangeServer) { - server = RServerUrl; - } + NSString *server = QXGlobal.shareGlobal.currentServer; [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",server,@"api/BlindBoxTurntable/gift_send"] parameters:parameters needCache:NO success:^(id responseObject) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {