增加换肤功能
This commit is contained in:
16
QXLive/Mine(音域)/Controller/QXMineViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/QXMineViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXMineViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/4/24.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXMineViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
281
QXLive/Mine(音域)/Controller/QXMineViewController.m
Normal file
281
QXLive/Mine(音域)/Controller/QXMineViewController.m
Normal file
@@ -0,0 +1,281 @@
|
||||
//
|
||||
// QXMineViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/4/24.
|
||||
//
|
||||
|
||||
#import "QXMineViewController.h"
|
||||
#import "QXMainHeaderView.h"
|
||||
#import "QXMineServiceCell.h"
|
||||
#import "QXSettingViewController.h"
|
||||
#import "QXPropShopViewController.h"
|
||||
#import "QXLevelViewController.h"
|
||||
#import "QXGuildViewController.h"
|
||||
#import "QXWalletViewController.h"
|
||||
#import "QXTaskViewController.h"
|
||||
#import "QXDressViewController.h"
|
||||
#import "QXBackpackViewController.h"
|
||||
#import "QXUserInfoEidtViewController.h"
|
||||
#import "QXUserHomePageViewController.h"
|
||||
#import "QXBlackListlViewController.h"
|
||||
#import "QXMyRoomViewController.h"
|
||||
|
||||
#import "QXRealNamePopView.h" //实名认证提示
|
||||
#import "QXRealNameViewController.h"
|
||||
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXHelpViewController.h"
|
||||
#import "QXInviteViewController.h"
|
||||
|
||||
@interface QXMineViewController ()<UITableViewDelegate,UITableViewDataSource,QXMineServiceCellDelegate,QXMainHeaderViewDelegate>
|
||||
@property (nonatomic,strong)QXMainHeaderView *tableHeaderView;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)UIButton *redbagBtn;
|
||||
@property (nonatomic,strong)UIButton *serviceBtn;
|
||||
@property (nonatomic,strong)UIButton *settingBtn;
|
||||
@property (nonatomic,strong)QXUserModel *userModel;
|
||||
@end
|
||||
|
||||
@implementation QXMineViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
[self getUserInfo];
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
self.tableView.tableHeaderView = self.tableHeaderView;
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.view addSubview:self.settingBtn];
|
||||
[self.view addSubview:self.serviceBtn];
|
||||
[self.view addSubview:self.redbagBtn];
|
||||
[self.settingBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kSafeAreaTop +10);
|
||||
make.right.mas_equalTo(-10);
|
||||
make.width.height.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
[self.serviceBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(30);
|
||||
make.centerY.equalTo(self.settingBtn);
|
||||
make.right.equalTo(self.settingBtn.mas_left).offset(-10);
|
||||
}];
|
||||
[self.redbagBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.serviceBtn.mas_left).offset(-10);
|
||||
make.centerY.width.height.equalTo(self.settingBtn);
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(passwordDidChanged) name:noticeChangePassword object:nil];
|
||||
}
|
||||
-(void)getUserInfo{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getMineInfoSuccessBlock:^(QXUserModel * _Nonnull userModel) {
|
||||
weakSelf.userModel = userModel;
|
||||
weakSelf.tableHeaderView.userModel = userModel;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - QXMineServiceCellDelegate
|
||||
-(void)didClickServiceWithBtn:(UIButton *)button title:(NSString *)title{
|
||||
UIViewController *vc;
|
||||
if ([title isEqualToString:QXText(@"道具商城")]) {
|
||||
vc = [[QXPropShopViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"段位")]){
|
||||
vc = [[QXLevelViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"公会中心")]){
|
||||
vc = [[QXGuildViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"个性装扮")]){
|
||||
vc = [[QXDressViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"我的背包")]){
|
||||
vc = [[QXBackpackViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"每日任务")]){
|
||||
vc = [[QXTaskViewController alloc] init];
|
||||
}else if([title isEqualToString:QXText(@"钱包")]){
|
||||
vc = [[QXWalletViewController alloc] init];
|
||||
}
|
||||
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
QXLOG(@"点击了%@",title);
|
||||
}
|
||||
-(void)didClickOptionType:(QXMainHeaderOptionType)type{
|
||||
MJWeakSelf
|
||||
switch (type) {
|
||||
case QXMainHeaderOptionTypeGotoHome:{
|
||||
QXLOG(@"跳转个人主页");
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
vc.user_id = [QXGlobal shareGlobal].loginModel.user_id;
|
||||
// vc.user_id = @"13";
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeGotoEdit:{
|
||||
QXLOG(@"跳转个人编辑");
|
||||
QXUserInfoEidtViewController *vc = [[QXUserInfoEidtViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeRealName:{
|
||||
QXLOG(@"跳转实名认证");
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeAnchorCenter:{
|
||||
QXLOG(@"跳转主播中心");
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeRoom:{
|
||||
|
||||
if (![QXGlobal shareGlobal].isRealName) {
|
||||
QXLOG(@"未实名,弹出实名认证");
|
||||
QXRealNamePopView *v = [[QXRealNamePopView alloc] init];
|
||||
v.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{}];
|
||||
};
|
||||
v.authActionBlock = ^{
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
QXRealNameViewController *vc = [[QXRealNameViewController alloc] init];
|
||||
[weakSelf.navigationController pushViewController:vc animated:YES];
|
||||
}];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:v popType:(PopViewTypePopFromCenter) tapDismiss:NO finishBlock:^{}];
|
||||
}else{
|
||||
QXMyRoomViewController *vc = [[QXMyRoomViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeFocus:{
|
||||
QXLOG(@"跳转关注");
|
||||
QXBlackListlViewController *vc = [[QXBlackListlViewController alloc] init];
|
||||
vc.type = 2;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeFans:{
|
||||
QXLOG(@"跳转粉丝");
|
||||
QXBlackListlViewController *vc = [[QXBlackListlViewController alloc] init];
|
||||
vc.type = 1;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case QXMainHeaderOptionTypeVisitor:{
|
||||
QXLOG(@"跳转访客");
|
||||
QXBlackListlViewController *vc = [[QXBlackListlViewController alloc] init];
|
||||
vc.type = 3;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate,UITableViewDataSource
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return 1;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXMineServiceCell *cell = [QXMineServiceCell cellWithTableView:tableView];
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
||||
-(void)gotoSetting{
|
||||
QXSettingViewController *vc = [[QXSettingViewController alloc] init];
|
||||
MJWeakSelf
|
||||
vc.logOutBlock = ^(BOOL isCancel) {
|
||||
if (isCancel) {
|
||||
[weakSelf performSelector:@selector(cancelAccount) afterDelay:0.5];
|
||||
}else{
|
||||
[weakSelf performSelector:@selector(logout) afterDelay:0.5];
|
||||
}
|
||||
};
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(void)gotoRedbag{
|
||||
QXInviteViewController *vc = [[QXInviteViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(void)gotoService{
|
||||
QXHelpViewController *webvc = [[QXHelpViewController alloc] init];
|
||||
[self.navigationController pushViewController:webvc animated:YES];
|
||||
}
|
||||
|
||||
|
||||
-(void)passwordDidChanged{
|
||||
[self performSelector:@selector(logout) afterDelay:0.5];
|
||||
}
|
||||
|
||||
-(void)logout{
|
||||
[QXMineNetwork logoutSuccessBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
}
|
||||
|
||||
-(void)cancelAccount{
|
||||
[QXMineNetwork cancelAccountSuccessBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
-(QXMainHeaderView *)tableHeaderView{
|
||||
if (!_tableHeaderView) {
|
||||
_tableHeaderView = [[QXMainHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 230+12-67+ScaleWidth(67))];
|
||||
_tableHeaderView.delegate = self;
|
||||
}
|
||||
return _tableHeaderView;
|
||||
}
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-TabbarContentHeight-kSafeAreaTop) style:UITableViewStylePlain];
|
||||
self.tableView.backgroundColor = [UIColor clearColor];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
|
||||
self.tableView.rowHeight = 164;
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
-(UIButton *)settingBtn{
|
||||
if (!_settingBtn) {
|
||||
_settingBtn = [[UIButton alloc] init];
|
||||
[_settingBtn setImage:[UIImage imageNamed:@"mine_setting"] forState:UIControlStateNormal];
|
||||
[_settingBtn setImage:[UIImage imageNamed:@"mine_setting"] forState:UIControlStateHighlighted];
|
||||
[_settingBtn addTarget:self action:@selector(gotoSetting) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _settingBtn;
|
||||
}
|
||||
- (UIButton *)redbagBtn {
|
||||
if (!_redbagBtn) {
|
||||
_redbagBtn = [[UIButton alloc] init];
|
||||
[_redbagBtn setImage:[UIImage imageNamed:@"mine_redbag"] forState:UIControlStateNormal];
|
||||
[_redbagBtn setImage:[UIImage imageNamed:@"mine_redbag"] forState:UIControlStateHighlighted];
|
||||
[_redbagBtn addTarget:self action:@selector(gotoRedbag) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _redbagBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)serviceBtn {
|
||||
if (!_serviceBtn) {
|
||||
_serviceBtn = [[UIButton alloc] init];
|
||||
[_serviceBtn setImage:[UIImage imageNamed:@"mine_service"] forState:UIControlStateNormal];
|
||||
[_serviceBtn setImage:[UIImage imageNamed:@"mine_service"] forState:UIControlStateHighlighted];
|
||||
[_serviceBtn addTarget:self action:@selector(gotoService) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _serviceBtn;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXCreatPhotosViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "QXPhotoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXCreatPhotosViewController : QXBaseViewController
|
||||
@property (nonatomic,copy)void(^createSuccessBlock)(void);
|
||||
@property (nonatomic,strong)QXPhotoDetailModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
288
QXLive/Mine(音域)/Controller/个人主页/QXCreatPhotosViewController.m
Normal file
288
QXLive/Mine(音域)/Controller/个人主页/QXCreatPhotosViewController.m
Normal file
@@ -0,0 +1,288 @@
|
||||
//
|
||||
// QXCreatPhotosViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import "QXCreatPhotosViewController.h"
|
||||
#import "QXUserInfoEditFooterView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXPhotosDetailVC.h"
|
||||
#import <TZImagePickerController/TZImageManager.h>
|
||||
#import <TZImagePickerController/TZImagePickerController.h>
|
||||
#import "QXOSSManager.h"
|
||||
#import "UIImage+QX.h"
|
||||
|
||||
@interface QXCreatPhotosViewController ()<QXUserInfoImageCellDelegate,UITextFieldDelegate>
|
||||
@property (nonatomic,strong)UIView *topBgView;
|
||||
@property (nonatomic,strong)UITextField *textField;
|
||||
@property (nonatomic,strong)UIButton *selectedBtn;
|
||||
@property (nonatomic,strong)UILabel *messageLabel;
|
||||
|
||||
@property (nonatomic,strong)UILabel *priviteLabel;
|
||||
@property (nonatomic,strong)UIButton *priviteBtn;
|
||||
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@property (nonatomic,strong)UIButton *deleteBtn;
|
||||
@property (nonatomic,strong)NSString *avartar;
|
||||
|
||||
@property (nonatomic,strong)UIView *bottomBgView;
|
||||
@property (nonatomic,strong)UITextField *passwordTextField;
|
||||
@end
|
||||
|
||||
@implementation QXCreatPhotosViewController
|
||||
|
||||
- (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.selectedBtn = [[UIButton alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-150)/2, NavContentHeight+12, 150, 150)];
|
||||
[self.selectedBtn setBackgroundImage:[UIImage imageNamed:@"mine_room_cover_add"] forState:(UIControlStateNormal)];
|
||||
self.selectedBtn.imageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.selectedBtn addTarget:self action:@selector(selectAlbumPhoto) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.selectedBtn addRoundedCornersWithRadius:6];
|
||||
[self.view addSubview:self.selectedBtn];
|
||||
|
||||
self.messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, self.selectedBtn.bottom+8, SCREEN_WIDTH-16-16, 20)];
|
||||
self.messageLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.messageLabel.textColor = QXConfig.textColor;
|
||||
self.messageLabel.font = [UIFont systemFontOfSize:12];
|
||||
self.messageLabel.text = QXText(@"相册封面");
|
||||
[self.view addSubview:self.messageLabel];
|
||||
|
||||
|
||||
self.topBgView = [[UIView alloc] initWithFrame:CGRectMake(16, self.messageLabel.bottom+24, SCREEN_WIDTH-32, 44)];
|
||||
[self.topBgView addRoundedCornersWithRadius:11];
|
||||
self.topBgView.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.view addSubview:self.topBgView];
|
||||
|
||||
self.textField = [[UITextField alloc] initWithFrame:CGRectMake(12, 0, self.topBgView.width-34, 44)];
|
||||
self.textField.placeholder = QXText(@"请输入相册名称");
|
||||
self.textField.font = [UIFont systemFontOfSize:16];
|
||||
self.textField.delegate = self;
|
||||
[self.topBgView addSubview:self.textField];
|
||||
|
||||
self.priviteBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-16-40, self.topBgView.bottom+2, 40, 35)];
|
||||
[self.priviteBtn setImage:[UIImage imageNamed:@"home_switch_off"] forState:(UIControlStateNormal)];
|
||||
[self.priviteBtn setImage:[UIImage imageNamed:@"home_switch_on"] forState:(UIControlStateSelected)];
|
||||
[self.priviteBtn addTarget:self action:@selector(priviteAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.priviteBtn];
|
||||
|
||||
self.priviteLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, self.priviteBtn.top, SCREEN_WIDTH-16-40-5-16, 35)];
|
||||
self.priviteLabel.textAlignment = NSTextAlignmentRight;
|
||||
self.priviteLabel.textColor = QXConfig.textColor;
|
||||
self.priviteLabel.font = [UIFont systemFontOfSize:13];
|
||||
self.priviteLabel.text = QXText(@"是否设置密码");
|
||||
[self.view addSubview:self.priviteLabel];
|
||||
|
||||
|
||||
|
||||
self.bottomBgView = [[UIView alloc] initWithFrame:CGRectMake(16, self.priviteBtn.bottom+2, SCREEN_WIDTH-32, 44)];
|
||||
[self.bottomBgView addRoundedCornersWithRadius:11];
|
||||
self.bottomBgView.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.view addSubview:self.bottomBgView];
|
||||
self.passwordTextField = [[UITextField alloc] initWithFrame:CGRectMake(12, 0, self.bottomBgView.width-34, 44)];
|
||||
self.passwordTextField.placeholder = QXText(@"请输入相册密码");
|
||||
self.passwordTextField.font = [UIFont systemFontOfSize:16];
|
||||
self.passwordTextField.secureTextEntry = YES;
|
||||
self.passwordTextField.delegate = self;
|
||||
[self.bottomBgView addSubview:self.passwordTextField];
|
||||
self.bottomBgView.hidden = YES;
|
||||
|
||||
|
||||
|
||||
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.view.height-kSafeAreaBottom-10-42, SCREEN_WIDTH-38*2, 42)];
|
||||
[self.commitBtn setTitle:QXText(@"确认") forState:(UIControlStateNormal)];
|
||||
[self.commitBtn addRoundedCornersWithRadius:21];
|
||||
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
self.commitBtn.needEventInterval = 0.5;
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.commitBtn];
|
||||
if (self.model != nil) {
|
||||
self.avartar = self.model.image;
|
||||
[self.selectedBtn sd_setImageWithURL:[NSURL URLWithString:self.model.image] forState:(UIControlStateNormal)];
|
||||
self.textField.text = self.model.name;
|
||||
if (self.model.pwd.length > 0) {
|
||||
self.priviteBtn.selected = YES;
|
||||
self.bottomBgView.hidden = NO;
|
||||
self.passwordTextField.text = self.model.pwd;
|
||||
}else{
|
||||
self.priviteBtn.selected = NO;
|
||||
self.bottomBgView.hidden = YES;
|
||||
self.passwordTextField.text = @"";
|
||||
}
|
||||
self.deleteBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.view.height-kSafeAreaBottom-10-42-12-42, SCREEN_WIDTH-38*2, 42)];
|
||||
[self.deleteBtn setTitle:QXText(@"删除") forState:(UIControlStateNormal)];
|
||||
[self.deleteBtn addRoundedCornersWithRadius:21];
|
||||
[self.deleteBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
|
||||
self.deleteBtn.backgroundColor = QXConfig.btnTextColor;
|
||||
self.deleteBtn.needEventInterval = 0.5;
|
||||
self.deleteBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.deleteBtn addTarget:self action:@selector(deleteAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.deleteBtn];
|
||||
}
|
||||
}
|
||||
-(void)setModel:(QXPhotoDetailModel *)model{
|
||||
_model = model;
|
||||
}
|
||||
|
||||
-(void)deleteAction{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork delePhotosWithAlbum_id:self.model.id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
for (UIViewController*vc in weakSelf.navigationController.viewControllers) {
|
||||
if ([vc isKindOfClass:[NSClassFromString(@"QXPhotosDetailVC") class]]) {
|
||||
[vc removeFromParentViewController];
|
||||
}
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:noticePhotosStatusChange object:nil];
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)priviteAction{
|
||||
self.priviteBtn.selected = !self.priviteBtn.selected;
|
||||
if (self.priviteBtn.selected) {
|
||||
self.bottomBgView.hidden = NO;
|
||||
}else{
|
||||
self.bottomBgView.hidden = YES;
|
||||
self.passwordTextField.text = @"";
|
||||
}
|
||||
}
|
||||
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
|
||||
if (textField.text.length == 8) {
|
||||
if ([string isEqualToString:@""]) {
|
||||
return YES;
|
||||
}else{
|
||||
return NO;
|
||||
}
|
||||
}else{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)selectAlbumPhoto {
|
||||
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:nil];
|
||||
imagePickerVc.maxImagesCount = 1;
|
||||
imagePickerVc.allowCameraLocation = NO;
|
||||
imagePickerVc.allowPickingOriginalPhoto = NO;
|
||||
|
||||
imagePickerVc.allowTakeVideo = NO;
|
||||
imagePickerVc.allowPickingVideo = NO;
|
||||
imagePickerVc.showSelectBtn = NO;
|
||||
imagePickerVc.allowCrop = NO;
|
||||
MJWeakSelf
|
||||
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
|
||||
if (photos.count) {
|
||||
NSData *imageData = [photos.firstObject qx_compressImageQualityWithToByte:(SCREEN_WIDTH*SCREEN_HEIGHT*2)];
|
||||
|
||||
[weakSelf OSSUploadPhotoWithFileData:imageData contentType:[NSString contentTypeWithImageData:imageData]];
|
||||
}
|
||||
}];
|
||||
imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[imagePickerVc.navigationBar setBackgroundImage:[UIImage qx_imageWithColor:RGB16(0x333333)] forBarMetrics:UIBarMetricsDefault];
|
||||
[self presentViewController:imagePickerVc animated:YES completion:nil];
|
||||
}
|
||||
- (void)OSSUploadPhotoWithFileData:(NSData *)fileData contentType:(NSString *)contentType {
|
||||
[self OSSUploadPhotoWithFileData:fileData contentType:contentType isVideoCover:NO];
|
||||
}
|
||||
- (void)OSSUploadPhotoWithFileData:(NSData *)fileData contentType:(NSString *)contentType isVideoCover:(BOOL)isVideoCover {
|
||||
if (!fileData || !contentType) {
|
||||
showToastInView(QXText(@"资源加载错误"), self.view);
|
||||
return;
|
||||
}
|
||||
if (fileData.length > 1024*1024 && [contentType isEqualToString:IMG_FILE_BASE_PATH]) {
|
||||
showToastInView(QXText(@"请不要上传超过1M的头像"), self.view);
|
||||
return;
|
||||
}
|
||||
NSMutableArray *files = [[NSMutableArray alloc] initWithObjects:fileData, nil];
|
||||
|
||||
NSString *fileBasePath = IMG_FILE_BASE_PATH;// 默认图片上传
|
||||
NSString *fileName = [NSString stringWithFormat:@"%@%@/%@.%@",fileBasePath,[[QXOSSManager sharedInstance] currentDate],[NSUUID UUID].UUIDString,contentType];
|
||||
NSMutableArray *fileNames = [[NSMutableArray alloc] initWithObjects:fileName, nil];
|
||||
__weak typeof(self)weakSelf = self;
|
||||
showLoadingInView(self.view);
|
||||
[[QXOSSManager sharedInstance] uploadFile:files withObjectKey:fileNames isAsync:YES complete:^(NSArray<NSString *> *names, UploadImageState state) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
hideLoadingInView(weakSelf.view);
|
||||
});
|
||||
if (state == UploadImageSuccess) {
|
||||
NSString *fileName = [names lastObject];
|
||||
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,fileName];
|
||||
weakSelf.avartar = fileUrl;
|
||||
[weakSelf.selectedBtn sd_setImageWithURL:[NSURL URLWithString:fileUrl] forState:(UIControlStateNormal)];
|
||||
}else{
|
||||
showToastInView(QXText(@"文件上传失败,请重新尝试"), weakSelf.view);
|
||||
}
|
||||
}];
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-(void)commitAction{
|
||||
if (self.textField.text.length == 0) {
|
||||
showToast(@"请输入相册名称");
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.avartar.length == 0) {
|
||||
showToast(@"您还未上传封面");
|
||||
return;
|
||||
}
|
||||
if (self.priviteBtn.selected) {
|
||||
if (self.passwordTextField.text.length < 4) {
|
||||
showToast(@"密码至少需要4位");
|
||||
return;
|
||||
}
|
||||
}
|
||||
MJWeakSelf
|
||||
if (self.model != nil) {
|
||||
[QXMineNetwork photosEditWithNewAlbumId:self.model.id name:self.textField.text pwd:self.passwordTextField.text image:self.avartar successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
if (weakSelf.createSuccessBlock) {
|
||||
weakSelf.createSuccessBlock();
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:noticePhotosStatusChange object:nil];
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}else{
|
||||
[QXMineNetwork createPhotosWithName:self.textField.text
|
||||
pwd:self.passwordTextField.text
|
||||
image:self.avartar
|
||||
successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
if (weakSelf.createSuccessBlock) {
|
||||
weakSelf.createSuccessBlock();
|
||||
}
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
// QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
|
||||
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
@end
|
||||
20
QXLive/Mine(音域)/Controller/个人主页/QXPhotosDetailVC.h
Normal file
20
QXLive/Mine(音域)/Controller/个人主页/QXPhotosDetailVC.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// QXPhotosDetailVC.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by dangkai on 2025/5/31.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXPhotosDetailVC : QXBaseViewController
|
||||
@property (nonatomic,strong)NSString*userId;
|
||||
@property (nonatomic,strong)NSString*albumId;
|
||||
@property (nonatomic,strong)NSString*name;
|
||||
@property (nonatomic,strong)NSString* pwd;
|
||||
@property (nonatomic,strong)NSArray* photoList;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
489
QXLive/Mine(音域)/Controller/个人主页/QXPhotosDetailVC.m
Normal file
489
QXLive/Mine(音域)/Controller/个人主页/QXPhotosDetailVC.m
Normal file
@@ -0,0 +1,489 @@
|
||||
//
|
||||
// QXPhotosDetailVC.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by dangkai on 2025/5/31.
|
||||
//
|
||||
|
||||
#import "QXPhotosDetailVC.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXImageCollectionViewCell.h"
|
||||
#import "QXPhotosDetailTopView.h"
|
||||
#import <TZImagePickerController/TZImageManager.h>
|
||||
#import <TZImagePickerController/TZImagePickerController.h>
|
||||
#import "UIImage+QX.h"
|
||||
#import "NSString+QX.h"
|
||||
#import "QXOSSManager.h"
|
||||
#import "YBImageBrowser/YBImageBrowser.h"
|
||||
#import "QXPhotosSectionView.h"
|
||||
#import "QXPhotosToolsView.h"
|
||||
#import "QXCreatPhotosViewController.h"
|
||||
#import "QXPhotosMoveListView.h"
|
||||
|
||||
@interface QXPhotosDetailVC ()<UICollectionViewDelegate,UICollectionViewDataSource,QXPhotosToolsViewDelegate,QXPhotosDetailTopViewDelegate>
|
||||
@property(nonatomic,strong)QXPhotosDetailTopView *topView;
|
||||
@property(nonatomic,strong)UICollectionView *collectionView;
|
||||
@property(nonatomic,strong)UIButton *uploadBtn;
|
||||
@property(nonatomic,strong)QXPhotoDetailModel*model;
|
||||
|
||||
/// 处理列表数组
|
||||
@property(nonatomic,strong)NSMutableDictionary *photoDict;
|
||||
@property(nonatomic,strong)NSMutableArray *valueArray;
|
||||
|
||||
|
||||
// 上传相关数组
|
||||
@property (nonatomic,strong)NSMutableArray *keyArray;
|
||||
@property (nonatomic,strong)NSMutableArray *uploadArray;
|
||||
@property (nonatomic,strong)NSMutableArray *urlArray;
|
||||
|
||||
// 查看数组
|
||||
@property (nonatomic,strong)NSMutableArray *selectedArray;
|
||||
|
||||
// 选择处理
|
||||
@property (nonatomic,strong)NSMutableArray *browserArray;
|
||||
@property (nonatomic,assign)BOOL isSelectedState;
|
||||
@property (nonatomic,assign)BOOL isMe;
|
||||
|
||||
@property (nonatomic,strong)QXPhotosToolsView *toolsView;
|
||||
@end
|
||||
|
||||
@implementation QXPhotosDetailVC
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
}
|
||||
|
||||
-(void)viewDidAppear:(BOOL)animated{
|
||||
[super viewDidAppear:animated];
|
||||
for (UIViewController*vc in self.navigationController.viewControllers) {
|
||||
if ([vc isKindOfClass:[NSClassFromString(@"QXCreatPhotosViewController") class]]) {
|
||||
[vc removeFromParentViewController];
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
// self.navigationItem.title = self.name;
|
||||
|
||||
}
|
||||
-(void)selectedAction:(UIButton*)sender{
|
||||
sender.selected = !sender.selected;
|
||||
self.isSelectedState = sender.selected;
|
||||
if (!self.isSelectedState) {
|
||||
for (QXPhotoModel*md in self.selectedArray) {
|
||||
md.isSelected = NO;
|
||||
}
|
||||
[self.selectedArray removeAllObjects];
|
||||
[UIView animateWithDuration:0.15 animations:^{
|
||||
self.toolsView.y = SCREEN_HEIGHT;
|
||||
} completion:^(BOOL finished) {
|
||||
[self.toolsView removeFromSuperview];
|
||||
}];
|
||||
self.collectionView.contentInset = UIEdgeInsetsZero;
|
||||
}else{
|
||||
MJWeakSelf
|
||||
[self.view addSubview:self.toolsView];
|
||||
[UIView animateWithDuration:0.15 animations:^{
|
||||
weakSelf.toolsView.y = SCREEN_HEIGHT-TabbarContentHeight;
|
||||
}];
|
||||
self.collectionView.contentInset = UIEdgeInsetsMake(0, 0, TabbarContentHeight, 0);
|
||||
}
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
-(void)getData{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork photosDetailWithAlbumId:self.albumId pwd:self.pwd?self.pwd:@"" successBlock:^(QXPhotoDetailModel*model) {
|
||||
weakSelf.topView.model = model;
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.valueArray removeAllObjects];
|
||||
[weakSelf.photoDict removeAllObjects];
|
||||
[weakSelf.selectedArray removeAllObjects];
|
||||
weakSelf.model = model;
|
||||
}else{
|
||||
NSMutableArray *arr = [NSMutableArray arrayWithArray:weakSelf.model.image_list];
|
||||
[arr addObjectsFromArray:model.image_list];
|
||||
model.image_list = arr;
|
||||
weakSelf.model = model;
|
||||
}
|
||||
for (QXPhotoModel*md in model.image_list) {
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSince1970:md.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
|
||||
formatter.dateFormat = @"yyyy-MM-dd";
|
||||
NSString*time = [formatter stringFromDate:date];
|
||||
NSArray *keyArray = weakSelf.photoDict.allKeys;
|
||||
if ([keyArray containsObject:time]) {
|
||||
weakSelf.valueArray = [NSMutableArray arrayWithArray:[weakSelf.photoDict objectForKey:time]];
|
||||
[weakSelf.valueArray addObject:md];
|
||||
[weakSelf.photoDict setObject:[NSArray arrayWithArray:self.valueArray] forKey:time];
|
||||
}else{
|
||||
[weakSelf.valueArray removeAllObjects];
|
||||
[weakSelf.valueArray addObject:md];
|
||||
[weakSelf.photoDict setObject:[NSArray arrayWithArray:self.valueArray] forKey:time];
|
||||
[weakSelf.dataArray addObject:time];
|
||||
}
|
||||
}
|
||||
[weakSelf.collectionView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)getPhotoList{
|
||||
if (self.userId.length == 0) {
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXMineNetwork photosListWithUserId:self.userId page:0 successBlock:^(NSArray<QXPhotoModel *> * _Nonnull hotos) {
|
||||
weakSelf.photoList = hotos;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
self.page = 1;
|
||||
self.topView = [[QXPhotosDetailTopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 216)];
|
||||
self.topView.delegate = self;
|
||||
[self.view addSubview:self.topView];
|
||||
_isMe = [self.userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id];
|
||||
self.topView.isMe = _isMe;
|
||||
if (!_isMe) {
|
||||
self.navigationItem.rightBarButtonItem = nil;
|
||||
self.uploadBtn.hidden = YES;
|
||||
}else{
|
||||
UIButton*selectedBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 80, 44)];
|
||||
// [selectedBtn setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
|
||||
selectedBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentTrailing;
|
||||
[selectedBtn setTitle:QXText(@"选择") forState:(UIControlStateNormal)];
|
||||
[selectedBtn setTitle:QXText(@"取消选择") forState:(UIControlStateSelected)];
|
||||
selectedBtn.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[selectedBtn setTitleColor:RGB16(0xFF8ACC) forState:UIControlStateNormal];
|
||||
[selectedBtn addTarget:self action:@selector(selectedAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:selectedBtn];
|
||||
}
|
||||
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 8;
|
||||
layout.minimumInteritemSpacing = 17;
|
||||
int itemWidth = (SCREEN_WIDTH-16*2-17*2)/3;
|
||||
layout.itemSize = CGSizeMake(itemWidth, itemWidth);
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
|
||||
layout.headerReferenceSize = CGSizeMake(SCREEN_WIDTH, 40);
|
||||
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.topView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.topView.bottom) collectionViewLayout:layout];
|
||||
self.collectionView.backgroundColor = [UIColor clearColor];
|
||||
self.collectionView.delegate = self;
|
||||
self.collectionView.dataSource = self;
|
||||
[self.collectionView registerClass:[QXImageCollectionViewCell class] forCellWithReuseIdentifier:@"QXImageCollectionViewCell"];
|
||||
[self.collectionView registerClass:[QXPhotosSectionView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXPhotosSectionView"];
|
||||
[self.view addSubview:self.collectionView];
|
||||
[self.view addSubview:self.uploadBtn];
|
||||
}
|
||||
#pragma mark - QXPhotosToolsViewDelegate
|
||||
-(void)didClickActionType:(QXPhotosToolsActionType)type{
|
||||
switch (type) {
|
||||
case QXPhotosToolsActionShare:
|
||||
[self sharePhoto];
|
||||
break;
|
||||
case QXPhotosToolsActionMove:
|
||||
[self movePhotoToOther];
|
||||
break;
|
||||
case QXPhotosToolsActionDelete:
|
||||
[self deletePhoto];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
-(void)sharePhoto{
|
||||
if (self.selectedArray.count == 0) {
|
||||
showToast(@"请选择图片");
|
||||
return;
|
||||
}
|
||||
if (self.selectedArray.count > 1) {
|
||||
showToast(@"分享图片不得超过1张");
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
QXPhotoModel*md = self.selectedArray[0];
|
||||
UIImageView *imgV = [[UIImageView alloc] init];
|
||||
[imgV sd_setImageWithURL:[NSURL URLWithString:md.image] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
|
||||
QXShareView *share = [[QXShareView alloc] init];
|
||||
share.shareType = QXShareViewTypeSharePhoto;
|
||||
share.imageData = UIImageJPEGRepresentation(image, 0.7);
|
||||
[share showInView:weakSelf.view];
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)movePhotoToOther{
|
||||
MJWeakSelf
|
||||
if (self.selectedArray.count == 0) {
|
||||
showToast(@"请选择图片");
|
||||
return;
|
||||
}
|
||||
NSString *Id = @"";
|
||||
for (QXPhotoModel*md in self.selectedArray) {
|
||||
if (Id.length == 0) {
|
||||
Id = md.id;
|
||||
}else{
|
||||
Id = [Id stringByAppendingFormat:@",%@",md.id];
|
||||
}
|
||||
}
|
||||
QXPhotosMoveListView *listView = [[QXPhotosMoveListView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(400))];
|
||||
listView.selecctedModelBlock = ^(QXPhotoModel * _Nonnull model) {
|
||||
[QXMineNetwork photosMoveWithNewAlbumId:model.id Id:Id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:listView popType:(PopViewTypeBottomToUpActionSheet) tapDismiss:YES finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)deletePhoto{
|
||||
if (self.selectedArray.count == 0) {
|
||||
showToast(@"请选择图片");
|
||||
return;
|
||||
}
|
||||
NSString *Id = @"";
|
||||
for (QXPhotoModel*md in self.selectedArray) {
|
||||
if (Id.length == 0) {
|
||||
Id = md.id;
|
||||
}else{
|
||||
Id = [Id stringByAppendingFormat:@",%@",md.id];
|
||||
}
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXMineNetwork photosDeletePictureWithId:Id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)didClickEditWith:(QXPhotoDetailModel *)model{
|
||||
MJWeakSelf
|
||||
QXCreatPhotosViewController *vc = [[QXCreatPhotosViewController alloc] init];
|
||||
vc.createSuccessBlock = ^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getData];
|
||||
};
|
||||
vc.model = self.model;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
NSString *key = self.dataArray[section];
|
||||
NSArray *arr = self.photoDict[key];
|
||||
return arr.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXImageCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXImageCollectionViewCell" forIndexPath:indexPath];
|
||||
NSString *key = self.dataArray[indexPath.section];
|
||||
NSArray *arr = self.photoDict[key];
|
||||
QXPhotoModel*md = arr[indexPath.row];
|
||||
cell.model = md;
|
||||
cell.selectedState = self.isSelectedState;
|
||||
return cell;
|
||||
}
|
||||
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{
|
||||
if ([kind isEqualToString:UICollectionElementKindSectionHeader]) {
|
||||
QXPhotosSectionView *sectionView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXPhotosSectionView" forIndexPath:indexPath];
|
||||
NSString *key = self.dataArray[indexPath.section];
|
||||
sectionView.titleLabel.text = key;
|
||||
return sectionView;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.isSelectedState) {
|
||||
NSString *key = self.dataArray[indexPath.section];
|
||||
NSArray *arr = self.photoDict[key];
|
||||
QXPhotoModel*md = arr[indexPath.row];
|
||||
md.isSelected = !md.isSelected;
|
||||
if (md.isSelected) {
|
||||
[self.selectedArray addObject:md];
|
||||
}else{
|
||||
[self.selectedArray removeObject:md];
|
||||
}
|
||||
QXImageCollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
|
||||
cell.model = md;
|
||||
}else{
|
||||
YBImageBrowser *browser = [YBImageBrowser new];
|
||||
[self.browserArray removeAllObjects];
|
||||
NSString *key = self.dataArray[indexPath.section];
|
||||
NSArray *arr = self.photoDict[key];
|
||||
QXPhotoModel*model = arr[indexPath.row];
|
||||
NSInteger currentPage = 0;
|
||||
for (int i = 0 ;i < self.model.image_list.count ; i++) {
|
||||
QXPhotoModel*md = self.model.image_list[i];
|
||||
YBIBImageData *data = [[YBIBImageData alloc] init];
|
||||
data.imageURL = [NSURL URLWithString:md.image];
|
||||
QXImageCollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
|
||||
data.projectiveView = cell.imageView;
|
||||
[self.browserArray addObject:data];
|
||||
if ([md.id isEqualToString:model.id]) {
|
||||
currentPage = i;
|
||||
}
|
||||
}
|
||||
browser.dataSourceArray = self.browserArray;
|
||||
browser.currentPage = currentPage;
|
||||
[browser show];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)uploadAction{
|
||||
[self selectAlbumPhoto];
|
||||
}
|
||||
-(void)selectAlbumPhoto {
|
||||
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:9 columnNumber:4 delegate:nil pushPhotoPickerVc:YES];
|
||||
imagePickerVc.allowCameraLocation = NO;
|
||||
imagePickerVc.allowPickingOriginalPhoto = NO;
|
||||
imagePickerVc.showSelectedIndex = YES;
|
||||
imagePickerVc.allowTakeVideo = NO;
|
||||
imagePickerVc.allowPickingVideo = NO;
|
||||
imagePickerVc.showSelectBtn = NO;
|
||||
imagePickerVc.allowCrop = NO;
|
||||
imagePickerVc.allowPickingGif = NO;
|
||||
MJWeakSelf
|
||||
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
|
||||
[weakSelf.uploadArray removeAllObjects];
|
||||
[weakSelf.keyArray removeAllObjects];
|
||||
for (int i = 0 ;i < assets.count ;i ++) {
|
||||
PHAsset*asset = assets[i];
|
||||
[[TZImageManager manager] getOriginalPhotoDataWithAsset:asset completion:^(NSData *data, NSDictionary *info, BOOL isDegraded) {
|
||||
// NSString *imageType = [NSString contentTypeWithImageData:data];
|
||||
// NSData *imgData = data;
|
||||
// if ([imageType isEqualToString:@"HEIC"] || [imageType isEqualToString:@"HEIF"] || [imageType isEqualToString:@"tiff"] || [imageType isEqualToString:@"webp"]) {
|
||||
UIImage *dataImg = [UIImage imageWithData:data];
|
||||
NSData *imgData = UIImageJPEGRepresentation(dataImg, 0.5);
|
||||
// }
|
||||
[weakSelf.uploadArray addObject:imgData];
|
||||
[weakSelf.keyArray addObject:[weakSelf imagePathWithKey:[NSString contentTypeWithImageData:imgData]]];
|
||||
if (weakSelf.uploadArray.count == assets.count) {
|
||||
[weakSelf OSSUploadPhoto];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
}];
|
||||
imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[imagePickerVc.navigationBar setBackgroundImage:[UIImage qx_imageWithColor:RGB16(0x333333)] forBarMetrics:UIBarMetricsDefault];
|
||||
[self presentViewController:imagePickerVc animated:YES completion:nil];
|
||||
}
|
||||
- (void)OSSUploadPhoto{
|
||||
__weak typeof(self)weakSelf = self;
|
||||
showLoadingInView(self.view);
|
||||
[[QXOSSManager sharedInstance] activityUploadFile:self.uploadArray withObjectKey:self.keyArray isAsync:YES complete:^(NSArray<NSString *> *names, UploadImageState state) {
|
||||
dispatch_async_and_wait(dispatch_get_main_queue(), ^{
|
||||
[weakSelf.urlArray removeAllObjects];
|
||||
hideLoadingInView(weakSelf.view);
|
||||
if (state == UploadImageSuccess) {
|
||||
showToast(QXText(@"上传成功"));
|
||||
for (int i = 0; i < names.count; i++) {
|
||||
NSString *name = names[i];
|
||||
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,name];
|
||||
[weakSelf.urlArray addObject:fileUrl];
|
||||
}
|
||||
[weakSelf uploadImages];
|
||||
}else{
|
||||
showToast(QXText(@"上传失败"));
|
||||
}
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)uploadImages{
|
||||
if (self.urlArray.count == 0) {
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
showLoadingInView(self.view);
|
||||
NSString *images = [self.urlArray componentsJoinedByString:@","];
|
||||
[QXMineNetwork addPhotosWithAlbumId:self.albumId images:images successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
hideLoadingInView(weakSelf.view);
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
hideLoadingInView(weakSelf.view);
|
||||
}];
|
||||
}
|
||||
- (NSString *)imagePathWithKey:(NSString *)keyPath {
|
||||
NSString *fileBasePath = IMG_FILE_BASE_PATH;
|
||||
return [NSString stringWithFormat:@"%@%@/%@.%@",fileBasePath,[[QXOSSManager sharedInstance] currentDate],[NSUUID UUID].UUIDString,keyPath];
|
||||
}
|
||||
|
||||
-(NSMutableArray *)valueArray{
|
||||
if (!_valueArray) {
|
||||
_valueArray = [NSMutableArray array];
|
||||
}
|
||||
return _valueArray;
|
||||
}
|
||||
-(NSMutableArray *)uploadArray{
|
||||
if (!_uploadArray) {
|
||||
_uploadArray = [NSMutableArray array];
|
||||
}
|
||||
return _uploadArray;
|
||||
}
|
||||
-(NSMutableArray *)keyArray{
|
||||
if (!_keyArray) {
|
||||
_keyArray = [NSMutableArray array];
|
||||
}
|
||||
return _keyArray;
|
||||
}
|
||||
-(NSMutableArray *)urlArray{
|
||||
if (!_urlArray) {
|
||||
_urlArray = [NSMutableArray array];
|
||||
}
|
||||
return _urlArray;
|
||||
}
|
||||
-(NSMutableDictionary *)photoDict{
|
||||
if (!_photoDict) {
|
||||
_photoDict = [NSMutableDictionary dictionary];
|
||||
}
|
||||
return _photoDict;
|
||||
}
|
||||
-(NSMutableArray *)selectedArray{
|
||||
if (!_selectedArray) {
|
||||
_selectedArray = [NSMutableArray array];
|
||||
}
|
||||
return _selectedArray;
|
||||
}
|
||||
-(NSMutableArray *)browserArray{
|
||||
if (!_browserArray) {
|
||||
_browserArray = [NSMutableArray array];
|
||||
}
|
||||
return _browserArray;
|
||||
}
|
||||
-(UIButton *)uploadBtn{
|
||||
if (!_uploadBtn) {
|
||||
_uploadBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-48-16, SCREEN_HEIGHT-86-48, 48, 48)];
|
||||
[_uploadBtn setImage:[UIImage imageNamed:@"photos_upload"] forState:(UIControlStateNormal)];
|
||||
[_uploadBtn addTarget:self action:@selector(uploadAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
}
|
||||
return _uploadBtn;
|
||||
}
|
||||
|
||||
-(QXPhotosToolsView *)toolsView{
|
||||
if (!_toolsView) {
|
||||
_toolsView = [[QXPhotosToolsView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, TabbarContentHeight)];
|
||||
_toolsView.backgroundColor = [UIColor whiteColor];
|
||||
_toolsView.delegate = self;
|
||||
}
|
||||
return _toolsView;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXUserHomePageViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXUserHomePageViewController : QXBaseViewController
|
||||
@property (nonatomic,strong)NSString *user_id;
|
||||
@property (nonatomic,assign)BOOL isGiftWall;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
186
QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m
Normal file
186
QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m
Normal file
@@ -0,0 +1,186 @@
|
||||
//
|
||||
// QXUserHomePageViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXUserHomePageViewController.h"
|
||||
#import "QXUserHomeHeaderView.h"
|
||||
#import <JXPagingView/JXPagerView.h>
|
||||
#import <JXCategoryView/JXCategoryView.h>
|
||||
#import "QXUserDynamicView.h"
|
||||
#import "QXUserGiftWallView.h"
|
||||
#import "QXUserPhotosView.h"
|
||||
#import <SDCycleScrollView/SDCycleScrollView.h>
|
||||
#import "QXCreatPhotosViewController.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXPhotosDetailVC.h"
|
||||
|
||||
@interface QXUserHomePageViewController ()<JXCategoryViewDelegate,JXPagerViewDelegate,SDCycleScrollViewDelegate>
|
||||
@property (nonatomic,strong)UIImageView * backgourdImageView;
|
||||
@property (nonatomic,strong)SDCycleScrollView * cycleScrollView;
|
||||
@property (nonatomic,strong)UIButton *backBtn;
|
||||
@property (nonatomic,strong)QXUserHomeHeaderView *headerView;
|
||||
@property (nonatomic, strong) JXPagerView *pagingView;
|
||||
@property (nonatomic, strong) UIView *sectionView;
|
||||
@property (nonatomic, strong) JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic, strong) NSArray <NSString *> *titles;
|
||||
@property (nonatomic, assign)CGRect cycleScrollViewFrame;
|
||||
@end
|
||||
|
||||
@implementation QXUserHomePageViewController
|
||||
|
||||
- (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.navigationController.navigationBar.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
- (void)initSubViews{
|
||||
self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, self.view.width, 121+NavContentHeight+16) delegate:self placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
|
||||
self.cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
|
||||
self.cycleScrollView.imageURLStringsGroup = @[@"user_header_placehoulder"];
|
||||
self.cycleScrollView.backgroundColor = QXConfig.themeColor;
|
||||
[self.view addSubview:self.cycleScrollView];
|
||||
|
||||
self.backgourdImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.backgourdImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.backgourdImageView.frame = CGRectMake(0, 0, self.view.width, 121+NavContentHeight+16);
|
||||
self.cycleScrollViewFrame = self.backgourdImageView.frame;
|
||||
[self.view addSubview:self.backgourdImageView];
|
||||
|
||||
self.titles = @[QXText(@"动态"),QXText(@"礼物墙"),QXText(@"我的相册")];
|
||||
_categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(0, 0, 200, 48);
|
||||
self.categoryView.titles = self.titles;
|
||||
self.categoryView.delegate = self;
|
||||
self.categoryView.titleSelectedColor = QXConfig.textColor;
|
||||
self.categoryView.titleColor = RGB16(0x666666);
|
||||
self.categoryView.titleFont = [UIFont boldSystemFontOfSize:12];
|
||||
self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:16];
|
||||
self.categoryView.titleColorGradientEnabled = YES;
|
||||
self.categoryView.titleLabelZoomEnabled = YES;
|
||||
self.categoryView.cellWidth = JXCategoryViewAutomaticDimension;
|
||||
self.categoryView.cellSpacing = 12;
|
||||
if (self.isGiftWall) {
|
||||
self.categoryView.defaultSelectedIndex = 1;
|
||||
}
|
||||
self.categoryView.backgroundColor = [UIColor clearColor];
|
||||
JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init];
|
||||
indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
|
||||
indicatorView.indicatorImageViewSize = CGSizeMake(30, 8);
|
||||
indicatorView.verticalMargin = 11;
|
||||
self.categoryView.indicators = @[indicatorView];
|
||||
self.sectionView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 48)];
|
||||
self.sectionView.backgroundColor = RGB16(0xf6f6f6);
|
||||
[self.sectionView addSubview:self.categoryView];
|
||||
_pagingView = [[JXPagerView alloc] initWithDelegate:self];
|
||||
_pagingView.mainTableView.backgroundColor = [UIColor clearColor];
|
||||
self.pagingView.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.pagingView];
|
||||
|
||||
self.categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
|
||||
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0);
|
||||
|
||||
|
||||
// self.backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kSafeAreaTop, 40, 40)];
|
||||
// [self.backBtn setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
|
||||
// [self.backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
// [self.view addSubview:self.backBtn];
|
||||
[self getUserInfo];
|
||||
}
|
||||
- (void)viewDidLayoutSubviews {
|
||||
[super viewDidLayoutSubviews];
|
||||
|
||||
self.pagingView.frame = CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight);
|
||||
}
|
||||
-(void)getUserInfo{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork userHomePageWithUserId:self.user_id successBlock:^(QXUserHomeModel * _Nonnull userModel) {
|
||||
weakSelf.headerView.model = userModel;
|
||||
NSArray *imgs;
|
||||
if (userModel.home_bgimages.length > 0) {
|
||||
imgs = [userModel.home_bgimages componentsSeparatedByString:@","];
|
||||
}
|
||||
if (imgs.count == 0) {
|
||||
weakSelf.backgourdImageView.hidden = NO;
|
||||
[weakSelf.backgourdImageView sd_setImageWithURL:[NSURL URLWithString:userModel.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
weakSelf.cycleScrollView.hidden = YES;
|
||||
}else if(imgs.count == 1){
|
||||
weakSelf.backgourdImageView.hidden = NO;
|
||||
[weakSelf.backgourdImageView sd_setImageWithURL:[NSURL URLWithString:imgs.firstObject] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
weakSelf.cycleScrollView.hidden = YES;
|
||||
}else{
|
||||
weakSelf.cycleScrollView.hidden = NO;
|
||||
weakSelf.backgourdImageView.hidden = YES;
|
||||
weakSelf.cycleScrollView.imageURLStringsGroup = imgs;
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - JXPagingViewDelegate
|
||||
|
||||
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
||||
return self.headerView;
|
||||
}
|
||||
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
|
||||
return 215;
|
||||
}
|
||||
|
||||
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
return 48;
|
||||
}
|
||||
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
return self.sectionView;
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView {
|
||||
return self.titles.count;
|
||||
}
|
||||
|
||||
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
|
||||
if (index == 0) {
|
||||
QXUserDynamicView *dynamicView = [[QXUserDynamicView alloc] init];
|
||||
dynamicView.user_id = self.user_id;
|
||||
dynamicView.backgroundColor = RGB16(0xf6f6f6);
|
||||
return dynamicView;
|
||||
}else if(index == 1){
|
||||
QXUserGiftWallView *giftWallView = [[QXUserGiftWallView alloc] init];
|
||||
giftWallView.backgroundColor = RGB16(0xf6f6f6);
|
||||
giftWallView.user_id = self.user_id;
|
||||
return giftWallView;
|
||||
}else{
|
||||
QXUserPhotosView *photosView = [[QXUserPhotosView alloc] init];
|
||||
photosView.user_id = self.user_id;
|
||||
photosView.backgroundColor = RGB16(0xf6f6f6);
|
||||
return photosView;
|
||||
}
|
||||
}
|
||||
-(void)pagerView:(JXPagerView *)pagerView mainTableViewDidScroll:(UIScrollView *)scrollView{
|
||||
CGFloat contentOffsetY = scrollView.contentOffset.y;
|
||||
if (contentOffsetY > 0) {
|
||||
return;
|
||||
}
|
||||
CGRect frame = self.cycleScrollViewFrame;
|
||||
frame.size.height -= contentOffsetY;
|
||||
// frame.origin.y = contentOffsetY;
|
||||
self.backgourdImageView.frame = frame;
|
||||
}
|
||||
-(QXUserHomeHeaderView *)headerView{
|
||||
if (!_headerView) {
|
||||
_headerView = [[QXUserHomeHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 215)];
|
||||
}
|
||||
return _headerView;
|
||||
}
|
||||
|
||||
@end
|
||||
18
QXLive/Mine(音域)/Controller/个性装扮/QXDressSubViewController.h
Normal file
18
QXLive/Mine(音域)/Controller/个性装扮/QXDressSubViewController.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// QXDressSubViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/16.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "JXCategoryView.h"
|
||||
#import "QXUserDressModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXDressSubViewController : QXBaseViewController<JXCategoryListContentViewDelegate>
|
||||
@property (nonatomic,strong)QXUserDressTypeModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
144
QXLive/Mine(音域)/Controller/个性装扮/QXDressSubViewController.m
Normal file
144
QXLive/Mine(音域)/Controller/个性装扮/QXDressSubViewController.m
Normal file
@@ -0,0 +1,144 @@
|
||||
//
|
||||
// QXDressSubViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/16.
|
||||
//
|
||||
|
||||
#import "QXDressSubViewController.h"
|
||||
#import "QXDressCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXSeatHeaderView.h"
|
||||
|
||||
@interface QXDressSubViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
||||
@property (nonatomic,strong)QXSeatHeaderView *headerImageView;
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@property (nonatomic,assign)NSInteger selectedIndex;
|
||||
@end
|
||||
|
||||
@implementation QXDressSubViewController
|
||||
-(UIView *)listView{
|
||||
return self.view;
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.bgImageHidden = YES;
|
||||
self.selectedIndex = -1;
|
||||
if (self.model.id.intValue == 1) {
|
||||
// 头像
|
||||
[self.view addSubview:self.headerImageView];
|
||||
self.collectionView.frame = CGRectMake(0, self.headerImageView.bottom+25, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-44-self.headerImageView.bottom-25);
|
||||
}else{
|
||||
self.collectionView.frame = CGRectMake(0, 12, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-44);
|
||||
}
|
||||
[self.view addSubview:self.collectionView];
|
||||
[self.view addSubview:self.commitBtn];
|
||||
}
|
||||
|
||||
-(void)getData{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork userDressListWithType:self.model.id successBlock:^(NSArray<QXUserDressModel *> * _Nonnull list) {
|
||||
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
if (list.count > 0 ) {
|
||||
QXUserDressModel *model = [[QXUserDressModel alloc] init];
|
||||
model.title = QXText(@"无");
|
||||
model.udid = @"-1";
|
||||
[weakSelf.dataArray insertObject:model atIndex:0];
|
||||
}
|
||||
[weakSelf.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{
|
||||
QXDressCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXDressCell" forIndexPath:indexPath];
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
if (indexPath.row == self.selectedIndex) {
|
||||
cell.selecteBtn.selected = YES;
|
||||
}else{
|
||||
cell.selecteBtn.selected = NO;
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
CGFloat width = (SCREEN_WIDTH-15*2-22*2)/3;
|
||||
return CGSizeMake(width, width/100*120);
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.row == self.selectedIndex) {
|
||||
return;
|
||||
}
|
||||
QXUserDressModel *model = self.dataArray[indexPath.row];
|
||||
self.selectedIndex = indexPath.row;
|
||||
[collectionView reloadData];
|
||||
// MJWeakSelf
|
||||
|
||||
[self.headerImageView setHeadIcon:[QXGlobal shareGlobal].loginModel.avatar dress:model.play_image];
|
||||
|
||||
}
|
||||
|
||||
-(void)commitAction{
|
||||
QXUserDressModel *model = self.dataArray[self.selectedIndex];
|
||||
BOOL isCancel = NO;
|
||||
if ([model.udid isEqualToString:@"-1"]) {
|
||||
isCancel = YES;
|
||||
}else{
|
||||
isCancel = NO;
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXMineNetwork setUserDressIsCancel:isCancel udid:model.udid type:self.model.id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
if (weakSelf.model.id.intValue == 1) {
|
||||
[QXGlobal shareGlobal].loginModel.dress = model.play_image;
|
||||
[[QXGlobal shareGlobal] updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
|
||||
}
|
||||
showToast(@"设置成功");
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
-(UIButton *)commitBtn{
|
||||
if (!_commitBtn) {
|
||||
_commitBtn = [[UIButton alloc] init];
|
||||
_commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.view.height-NavContentHeight-44-kSafeAreaBottom-42-10, SCREEN_WIDTH-38*2, 42)];
|
||||
[_commitBtn setTitle:QXText(@"确认装扮") forState:(UIControlStateNormal)];
|
||||
[_commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[_commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[_commitBtn addRoundedCornersWithRadius:21];
|
||||
_commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
_commitBtn.needEventInterval = 0.3;
|
||||
_commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
}
|
||||
return _commitBtn;
|
||||
}
|
||||
-(UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 22;
|
||||
layout.minimumInteritemSpacing = 22;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15);
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.headerImageView.bottom+12+12, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) collectionViewLayout:layout];
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXDressCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXDressCell"];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
-(QXSeatHeaderView *)headerImageView{
|
||||
if (!_headerImageView) {
|
||||
_headerImageView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-104)/2, 24, 104, 104)];
|
||||
[_headerImageView setHeadIcon:[QXGlobal shareGlobal].loginModel.avatar dress:[QXGlobal shareGlobal].loginModel.dress];
|
||||
}
|
||||
return _headerImageView;
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/个性装扮/QXDressViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/个性装扮/QXDressViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXDressViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXDressViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
98
QXLive/Mine(音域)/Controller/个性装扮/QXDressViewController.m
Normal file
98
QXLive/Mine(音域)/Controller/个性装扮/QXDressViewController.m
Normal file
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// QXDressViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXDressViewController.h"
|
||||
#import "JXCategoryView.h"
|
||||
#import "QXDressSubViewController.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXDressViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
|
||||
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
|
||||
@property (nonatomic,strong)NSMutableArray <UIViewController*>*listVCArray;
|
||||
@property (nonatomic,strong)NSMutableArray *titles;
|
||||
@end
|
||||
|
||||
@implementation QXDressViewController
|
||||
|
||||
- (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.categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(15, kSafeAreaTop+44, 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<QXUserDressTypeModel *> * _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) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
QXDressSubViewController *vc = [[QXDressSubViewController 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
|
||||
16
QXLive/Mine(音域)/Controller/公会中心/QXGuildViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/公会中心/QXGuildViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXGuildViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXGuildViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
241
QXLive/Mine(音域)/Controller/公会中心/QXGuildViewController.m
Normal file
241
QXLive/Mine(音域)/Controller/公会中心/QXGuildViewController.m
Normal file
@@ -0,0 +1,241 @@
|
||||
//
|
||||
// QXLevelViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXGuildViewController.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
#import "QXUserHomePageViewController.h"
|
||||
|
||||
|
||||
static void *WKWebBrowserContext = &WKWebBrowserContext;
|
||||
@interface QXGuildViewController ()<WKScriptMessageHandler>
|
||||
@property(nonatomic,strong)WKWebView *contentWebView;
|
||||
@property(nonatomic,strong)UIProgressView *progressView;
|
||||
@end
|
||||
|
||||
@implementation QXGuildViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[self.view addSubview:self.contentWebView];
|
||||
[self.view addSubview:self.progressView];
|
||||
|
||||
[self layoutConstraints];
|
||||
[self loadData];
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
}
|
||||
//-(void)setNavgationItems{
|
||||
// [super setNavgationItems];
|
||||
// self.navigationItem.title = @"段位";
|
||||
//}
|
||||
|
||||
- (void)layoutConstraints {
|
||||
[self.contentWebView setFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
|
||||
[self.progressView setFrame:CGRectMake(0, 0, SCREEN_WIDTH
|
||||
, 2)];
|
||||
}
|
||||
- (void)loadData {
|
||||
NSInteger safeTop = kSafeAreaTop;
|
||||
NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/union/index?id=%@&h=%ld",H5ServerUrl,[QXGlobal shareGlobal].loginModel.token,safeTop]];
|
||||
NSURLRequest *request =[NSURLRequest requestWithURL:url];
|
||||
[self.contentWebView loadRequest:request];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - WKNavigationDelegate
|
||||
//开始加载
|
||||
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|
||||
//开始加载的时候,让加载进度条显示
|
||||
self.progressView.hidden = NO;
|
||||
}
|
||||
|
||||
//网页加载完成
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
|
||||
// 获取加载网页的标题
|
||||
// if (self.title.length == 0) {
|
||||
// self.navigationItem.title = self.contentWebView.title;
|
||||
// }
|
||||
// if ([self.titleString containsString:@"转账"]) {
|
||||
// // 设置字体
|
||||
// NSString *fontFamilyStr = @"document.getElementsByTagName('body')[0].style.fontFamily='Arial';";
|
||||
// [webView evaluateJavaScript:fontFamilyStr completionHandler:nil];
|
||||
// //设置颜色
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= '#333333'" completionHandler:nil];
|
||||
// //修改字体大小
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '150%'"completionHandler:nil];
|
||||
// }
|
||||
}
|
||||
//内容返回时调用
|
||||
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
//服务器请求跳转的时候调用
|
||||
- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
// 内容加载失败时候调用
|
||||
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error{
|
||||
|
||||
}
|
||||
-(void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
|
||||
NSLog(@"message.name====%@ body=%@",message.name,message.body);
|
||||
if([message.name isEqualToString:@"nativeHandler"]){
|
||||
NSDictionary *dict = message.body;
|
||||
if ([dict[@"action"] isEqualToString:@"closeWeb"]) {
|
||||
if (self.contentWebView.canGoBack) {
|
||||
[self.contentWebView goBack];
|
||||
}else{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
}else if ([dict[@"action"] isEqualToString:@"enterGroupChat"]) {
|
||||
NSString *groupId = [NSString stringWithFormat:@"%@",dict[@"data"][@"group_id"]];
|
||||
NSString *cover = [NSString stringWithFormat:@"%@",dict[@"data"][@"cover"]];
|
||||
NSString *guild_name = [NSString stringWithFormat:@"%@",dict[@"data"][@"guild_name"]];
|
||||
if (groupId.length == 0) {
|
||||
return;
|
||||
}
|
||||
[[QXGlobal shareGlobal] chatWithGroupId:groupId cover:cover name:guild_name navagationController:self.navigationController];
|
||||
}else if ([dict[@"action"] isEqualToString:@"jumpWebPage"]) {
|
||||
NSString *userId = [NSString stringWithFormat:@"%@",dict[@"data"][@"userId"]];
|
||||
if (userId.longLongValue == 0) {
|
||||
return;
|
||||
}
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
vc.user_id = userId;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else if ([dict[@"action"] isEqualToString:@"jumpRoomPage"]) {
|
||||
NSString *room_id = [NSString stringWithFormat:@"%@",dict[@"data"][@"room_id"]];
|
||||
if (room_id.longLongValue == 0) {
|
||||
return;
|
||||
}
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
||||
//如果是跳转一个新页面
|
||||
if (navigationAction.targetFrame == nil) {
|
||||
[webView loadRequest:navigationAction.request];
|
||||
}
|
||||
NSURL *URL = navigationAction.request.URL;
|
||||
[self dealSomeThing:URL];
|
||||
decisionHandler(WKNavigationActionPolicyAllow);
|
||||
}
|
||||
|
||||
- (void)dealSomeThing:(NSURL *)url{
|
||||
NSString *scheme = [url scheme];
|
||||
NSString *resourceSpecifier = [url resourceSpecifier];
|
||||
if ([scheme isEqualToString:@"tel"]) {
|
||||
NSString *callPhone = [NSString stringWithFormat:@"tel://%@", resourceSpecifier];
|
||||
/// 防止iOS 10及其之后,拨打电话系统弹出框延迟出现
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//进度条
|
||||
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView {
|
||||
}
|
||||
|
||||
//KVO监听进度条
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
|
||||
if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.contentWebView) {
|
||||
[self.progressView setAlpha:1.0f];
|
||||
BOOL animated = self.contentWebView.estimatedProgress > self.progressView.progress;
|
||||
[self.progressView setProgress:self.contentWebView.estimatedProgress animated:animated];
|
||||
|
||||
// Once complete, fade out UIProgressView
|
||||
if(self.contentWebView.estimatedProgress >= 1.0f) {
|
||||
[UIView animateWithDuration:0.3f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
|
||||
[self.progressView setAlpha:0.0f];
|
||||
} completion:^(BOOL finished) {
|
||||
[self.progressView setProgress:0.0f animated:NO];
|
||||
}];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
- (WKWebView *)contentWebView {
|
||||
if (!_contentWebView) {
|
||||
//设置网页的配置文件
|
||||
WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];
|
||||
// 允许可以与网页交互,选择视图
|
||||
configuration.selectionGranularity = YES;
|
||||
// web内容处理池pr
|
||||
configuration.processPool = [[WKProcessPool alloc] init];
|
||||
//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
|
||||
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
|
||||
// 是否支持记忆读取
|
||||
configuration.suppressesIncrementalRendering = NO;
|
||||
// 允许用户更改网页的设置
|
||||
[UserContentController addScriptMessageHandler:self name:@"nativeHandler"];
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.userContentController = UserContentController;
|
||||
// 此处一定要做判断,因为是iOS9之后才有的方法,否则在iOS8下会崩溃
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
|
||||
//允许视频播放
|
||||
configuration.allowsAirPlayForMediaPlayback = YES;
|
||||
// 允许在线播放
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
//开启手势触摸 默认设置就是NO。在ios8系统中会导致手势问题,程序崩溃
|
||||
_contentWebView.allowsBackForwardNavigationGestures = YES;
|
||||
}
|
||||
_contentWebView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration];
|
||||
_contentWebView.backgroundColor = [UIColor clearColor];
|
||||
_contentWebView.opaque = YES;
|
||||
//适应你设定的尺寸
|
||||
[_contentWebView sizeToFit];
|
||||
_contentWebView.scrollView.showsVerticalScrollIndicator = NO;
|
||||
// 设置代理
|
||||
_contentWebView.navigationDelegate = self;
|
||||
//kvo 添加进度监控
|
||||
[_contentWebView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:WKWebBrowserContext];
|
||||
}
|
||||
return _contentWebView;
|
||||
}
|
||||
|
||||
- (UIProgressView *)progressView {
|
||||
if (!_progressView) {
|
||||
_progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
|
||||
[_progressView setTrackTintColor:[UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0]];
|
||||
_progressView.progressTintColor = QXConfig.themeColor;
|
||||
}
|
||||
return _progressView;
|
||||
}
|
||||
|
||||
-(void)setProgressColor:(UIColor *)progressColor{
|
||||
_progressView.progressTintColor = progressColor;
|
||||
}
|
||||
// 记得dealloc
|
||||
- (void)dealloc {
|
||||
if (self) {
|
||||
[self.contentWebView removeObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress))];
|
||||
}
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/帮助反馈/QXHelpViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/帮助反馈/QXHelpViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXHelpViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/10.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHelpViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
244
QXLive/Mine(音域)/Controller/帮助反馈/QXHelpViewController.m
Normal file
244
QXLive/Mine(音域)/Controller/帮助反馈/QXHelpViewController.m
Normal file
@@ -0,0 +1,244 @@
|
||||
//
|
||||
// QXHelpViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXHelpViewController.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
#import <WXApi.h>
|
||||
|
||||
static void *WKWebBrowserContext = &WKWebBrowserContext;
|
||||
@interface QXHelpViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>
|
||||
@property(nonatomic,strong)WKWebView *contentWebView;
|
||||
@property(nonatomic,strong)UIProgressView *progressView;
|
||||
//@property (nonatomic,strong)TitleView *titleView;
|
||||
@end
|
||||
|
||||
@implementation QXHelpViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
// if (@available(iOS 11.0, *)) {
|
||||
// self.contentWebView.scrollView.contentInsetAdjustmentBehavior = UIScrollQXHelpViewControllerViewContentInsetAdjustmentNever;
|
||||
// } else {
|
||||
// self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
// }
|
||||
|
||||
[self.view addSubview:self.contentWebView];
|
||||
[self.view addSubview:self.progressView];
|
||||
|
||||
[self layoutConstraints];
|
||||
[self loadData];
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
// self.navigationItem.title = @"道具商城";
|
||||
// UIButton*backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
|
||||
// [backBtn setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
|
||||
// backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
|
||||
// [backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
|
||||
}
|
||||
|
||||
//-(void)backAction{
|
||||
// if (self.contentWebView.canGoBack) {
|
||||
// [self.contentWebView goBack];
|
||||
// }else{
|
||||
// [self.navigationController popViewControllerAnimated:YES];
|
||||
// }
|
||||
//}
|
||||
- (void)layoutConstraints {
|
||||
[self.contentWebView setFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
|
||||
[self.progressView setFrame:CGRectMake(0, 0, SCREEN_WIDTH
|
||||
, 2)];
|
||||
}
|
||||
- (void)loadData {
|
||||
NSInteger safeTop = kSafeAreaTop;
|
||||
NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/feedback/help?id=%@&h=%ld",H5ServerUrl,[QXGlobal shareGlobal].loginModel.token,safeTop]];
|
||||
NSURLRequest *request =[NSURLRequest requestWithURL:url];
|
||||
[self.contentWebView loadRequest:request];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - WKNavigationDelegate
|
||||
//开始加载
|
||||
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|
||||
//开始加载的时候,让加载进度条显示
|
||||
self.progressView.hidden = NO;
|
||||
}
|
||||
|
||||
//网页加载完成
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
|
||||
// 获取加载网页的标题
|
||||
// if (self.title.length == 0) {
|
||||
// self.navigationItem.title = self.contentWebView.title;
|
||||
// }
|
||||
// if ([self.titleString containsString:@"转账"]) {
|
||||
// // 设置字体
|
||||
// NSString *fontFamilyStr = @"document.getElementsByTagName('body')[0].style.fontFamily='Arial';";
|
||||
// [webView evaluateJavaScript:fontFamilyStr completionHandler:nil];
|
||||
// //设置颜色
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= '#333333'" completionHandler:nil];
|
||||
// //修改字体大小
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '150%'"completionHandler:nil];
|
||||
// }
|
||||
}
|
||||
//内容返回时调用
|
||||
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
//服务器请求跳转的时候调用
|
||||
- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
// 内容加载失败时候调用
|
||||
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error{
|
||||
|
||||
}
|
||||
-(void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
|
||||
NSLog(@"message.name====%@ body=%@",message.name,message.body);
|
||||
if([message.name isEqualToString:@"nativeHandler"]){
|
||||
NSDictionary *dict = message.body;
|
||||
if ([dict[@"action"] isEqualToString:@"customerService"]) {
|
||||
WXOpenCustomerServiceReq *req = [[WXOpenCustomerServiceReq alloc] init];
|
||||
req.corpid = @"ww1de4300858c0b461";
|
||||
req.url = @"https://work.weixin.qq.com/kfid/kfcb3d23a59c188a0e7";
|
||||
[WXApi sendReq:req completion:nil];
|
||||
}else if ([dict[@"action"] isEqualToString:@"closeWeb"]) {
|
||||
if (self.contentWebView.canGoBack) {
|
||||
[self.contentWebView goBack];
|
||||
}else{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
||||
//如果是跳转一个新页面
|
||||
if (navigationAction.targetFrame == nil) {
|
||||
[webView loadRequest:navigationAction.request];
|
||||
}
|
||||
NSURL *URL = navigationAction.request.URL;
|
||||
[self dealSomeThing:URL];
|
||||
decisionHandler(WKNavigationActionPolicyAllow);
|
||||
}
|
||||
|
||||
- (void)dealSomeThing:(NSURL *)url{
|
||||
NSString *scheme = [url scheme];
|
||||
NSString *resourceSpecifier = [url resourceSpecifier];
|
||||
if ([scheme isEqualToString:@"tel"]) {
|
||||
NSString *callPhone = [NSString stringWithFormat:@"tel://%@", resourceSpecifier];
|
||||
/// 防止iOS 10及其之后,拨打电话系统弹出框延迟出现
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//进度条
|
||||
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView {
|
||||
}
|
||||
|
||||
//KVO监听进度条
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
|
||||
if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.contentWebView) {
|
||||
[self.progressView setAlpha:1.0f];
|
||||
BOOL animated = self.contentWebView.estimatedProgress > self.progressView.progress;
|
||||
[self.progressView setProgress:self.contentWebView.estimatedProgress animated:animated];
|
||||
|
||||
// Once complete, fade out UIProgressView
|
||||
if(self.contentWebView.estimatedProgress >= 1.0f) {
|
||||
[UIView animateWithDuration:0.3f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
|
||||
[self.progressView setAlpha:0.0f];
|
||||
} completion:^(BOOL finished) {
|
||||
[self.progressView setProgress:0.0f animated:NO];
|
||||
}];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
- (WKWebView *)contentWebView {
|
||||
if (!_contentWebView) {
|
||||
//设置网页的配置文件
|
||||
WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];
|
||||
// 允许可以与网页交互,选择视图
|
||||
configuration.selectionGranularity = YES;
|
||||
// web内容处理池pr
|
||||
configuration.processPool = [[WKProcessPool alloc] init];
|
||||
//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
|
||||
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
|
||||
// 是否支持记忆读取
|
||||
configuration.suppressesIncrementalRendering = NO;
|
||||
// 允许用户更改网页的设置
|
||||
[UserContentController addScriptMessageHandler:self name:@"nativeHandler"];
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.userContentController = UserContentController;
|
||||
// 此处一定要做判断,因为是iOS9之后才有的方法,否则在iOS8下会崩溃
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
|
||||
//允许视频播放
|
||||
configuration.allowsAirPlayForMediaPlayback = YES;
|
||||
// 允许在线播放
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
//开启手势触摸 默认设置就是NO。在ios8系统中会导致手势问题,程序崩溃
|
||||
_contentWebView.allowsBackForwardNavigationGestures = YES;
|
||||
}
|
||||
_contentWebView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration];
|
||||
_contentWebView.backgroundColor = [UIColor clearColor];
|
||||
_contentWebView.opaque = YES;
|
||||
//适应你设定的尺寸
|
||||
[_contentWebView sizeToFit];
|
||||
_contentWebView.scrollView.showsVerticalScrollIndicator = NO;
|
||||
// 设置代理
|
||||
_contentWebView.navigationDelegate = self;
|
||||
//kvo 添加进度监控
|
||||
[_contentWebView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:WKWebBrowserContext];
|
||||
}
|
||||
return _contentWebView;
|
||||
}
|
||||
|
||||
- (UIProgressView *)progressView {
|
||||
if (!_progressView) {
|
||||
_progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
|
||||
[_progressView setTrackTintColor:[UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0]];
|
||||
_progressView.progressTintColor = QXConfig.themeColor;
|
||||
}
|
||||
return _progressView;
|
||||
}
|
||||
|
||||
-(void)setProgressColor:(UIColor *)progressColor{
|
||||
_progressView.progressTintColor = progressColor;
|
||||
}
|
||||
// 记得dealloc
|
||||
- (void)dealloc {
|
||||
if (self) {
|
||||
[self.contentWebView removeObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress))];
|
||||
}
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
19
QXLive/Mine(音域)/Controller/我的房间/QXCreateRoomViewController.h
Executable file
19
QXLive/Mine(音域)/Controller/我的房间/QXCreateRoomViewController.h
Executable file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// QXMyRoomViewController.h
|
||||
// SoundRiver
|
||||
//
|
||||
// Created by mac on 2020/7/17.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "QXRoomModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXCreateRoomViewController : QXBaseViewController
|
||||
@property (nonatomic,copy)void(^createSucceessBlock)(void);
|
||||
@property (nonatomic,copy)void(^editSucceessBlock)(QXRoomModel *roomModel);
|
||||
@property (nonatomic,strong)QXRoomModel *roomModel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
461
QXLive/Mine(音域)/Controller/我的房间/QXCreateRoomViewController.m
Executable file
461
QXLive/Mine(音域)/Controller/我的房间/QXCreateRoomViewController.m
Executable file
@@ -0,0 +1,461 @@
|
||||
|
||||
//
|
||||
// QXMyRoomViewController.m
|
||||
// SoundRiver
|
||||
//
|
||||
// Created by mac on 2020/7/17.
|
||||
//
|
||||
|
||||
#import "QXCreateRoomViewController.h"
|
||||
#import "TZImagePickerController/TZImagePickerController.h"
|
||||
#import "QXTextView.h"
|
||||
#import "QXOSSManager.h"
|
||||
#import "UIImage+QX.h"
|
||||
#import "QXTimer.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXCreateRoomViewController ()<UITextFieldDelegate>
|
||||
@property (nonatomic,strong) UILabel *roomCoverLabel;
|
||||
@property (nonatomic,strong) UIImageView *roomImageView;
|
||||
@property (nonatomic,strong) UIButton *roomImageBtn;
|
||||
@property (nonatomic,strong) NSString* roomCoverUrl;
|
||||
|
||||
@property (nonatomic,strong) UILabel *roomNameLabel;
|
||||
@property (nonatomic,strong) UIView *textFieldbgView;
|
||||
@property (nonatomic,strong) UITextField *textField;
|
||||
@property (nonatomic,strong) UIButton *deleteBtn;
|
||||
@property (nonatomic,strong) UIButton *randomBtn;
|
||||
|
||||
|
||||
@property (nonatomic,strong) UILabel *roomNoticeLabel;
|
||||
@property (nonatomic,strong) UIView *noticeBgView;
|
||||
@property (nonatomic,strong) QXTextView *textView;
|
||||
|
||||
@property (nonatomic,strong) UILabel *warningLabel;
|
||||
@property (nonatomic,strong) UIButton *submitBtn; ///< 提交
|
||||
@property (nonatomic,assign)NSInteger selectedIndex;
|
||||
|
||||
@property (nonatomic,strong) QXTimer *timer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXCreateRoomViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"创建房间");
|
||||
}
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
|
||||
- (void)initSubViews {
|
||||
self.selectedIndex = -1;
|
||||
[self.view addSubview:self.roomImageView];
|
||||
[self.view addSubview:self.roomImageBtn];
|
||||
[self.view addSubview:self.roomCoverLabel];
|
||||
[self.roomImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.size.mas_equalTo(CGSizeMake(120, 120));
|
||||
make.top.mas_equalTo(NavContentHeight+20);
|
||||
}];
|
||||
[self.roomImageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.top.equalTo(self.roomImageView);
|
||||
}];
|
||||
[self.roomCoverLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.roomImageView.mas_bottom).offset(10);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(24);
|
||||
}];
|
||||
|
||||
|
||||
[self.view addSubview:self.roomNameLabel];
|
||||
[self.view addSubview:self.textFieldbgView];
|
||||
[self.view addSubview:self.randomBtn];
|
||||
[self.textFieldbgView addSubview:self.textField];
|
||||
[self.textFieldbgView addSubview:self.deleteBtn];
|
||||
[self.roomNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.roomCoverLabel.mas_bottom).offset(12);
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
make.height.mas_equalTo(24);
|
||||
}];
|
||||
|
||||
[self.randomBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-16);
|
||||
make.height.mas_equalTo(44);
|
||||
make.top.equalTo(self.roomNameLabel.mas_bottom).offset(12);
|
||||
make.width.mas_equalTo(65);
|
||||
}];
|
||||
[self.textFieldbgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.roomNameLabel.mas_bottom).offset(12);
|
||||
make.left.equalTo(self.roomNameLabel);
|
||||
make.right.equalTo(self.randomBtn.mas_left).offset(-8);
|
||||
make.height.mas_equalTo(44);
|
||||
}];
|
||||
|
||||
[self.deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.equalTo(self.textFieldbgView);
|
||||
make.right.equalTo(self.textFieldbgView).offset(-12);
|
||||
make.width.mas_equalTo(44);
|
||||
}];
|
||||
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.equalTo(self.textFieldbgView);
|
||||
make.left.equalTo(self.textFieldbgView).offset(12);
|
||||
make.right.equalTo(self.deleteBtn.mas_left).offset(-4);
|
||||
}];
|
||||
|
||||
|
||||
|
||||
[self.view addSubview:self.roomNoticeLabel];
|
||||
[self.view addSubview:self.noticeBgView];
|
||||
[self.noticeBgView addSubview:self.textView];
|
||||
[self.roomNoticeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.textFieldbgView.mas_bottom).offset(12);
|
||||
make.left.equalTo(self.roomNameLabel);
|
||||
make.height.mas_equalTo(24);
|
||||
}];
|
||||
[self.noticeBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.roomNoticeLabel.mas_bottom).offset(12);
|
||||
make.left.equalTo(self.roomNameLabel);
|
||||
make.right.mas_equalTo(-16);
|
||||
make.height.mas_equalTo(150);
|
||||
}];
|
||||
|
||||
[self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.mas_equalTo(5);
|
||||
make.right.mas_equalTo(-5);
|
||||
make.bottom.mas_equalTo(-5);
|
||||
}];
|
||||
|
||||
|
||||
|
||||
[self.view addSubview:self.submitBtn];
|
||||
[self.submitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.view).offset(38);
|
||||
make.right.equalTo(self.view).offset(-38);
|
||||
make.height.mas_equalTo(42);
|
||||
make.bottom.equalTo(self.view).offset(-kSafeAreaBottom);
|
||||
}];
|
||||
|
||||
|
||||
[self.warningLabel sizeToFit];
|
||||
self.warningLabel.frame = CGRectMake((SCREEN_WIDTH-self.warningLabel.width)/2.0-8, SCREEN_HEIGHT-kSafeAreaBottom-42-8-21, self.warningLabel.width+16, 21);
|
||||
[self.view addSubview:self.warningLabel];
|
||||
|
||||
_timer = [QXTimer scheduledTimerWithTimeInterval:3 repeats:YES queue:dispatch_get_main_queue() block:^{
|
||||
|
||||
[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
|
||||
self->_warningLabel.y = SCREEN_HEIGHT-kSafeAreaBottom-42-8-21+5;
|
||||
} completion:^(BOOL finished) {
|
||||
[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
|
||||
self->_warningLabel.y = SCREEN_HEIGHT-kSafeAreaBottom-42-8-21-5;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}];
|
||||
}];
|
||||
if (self.roomModel) {
|
||||
[self.roomImageView sd_setImageWithURL:[NSURL URLWithString:self.roomModel.room_info.room_cover]];
|
||||
self.textField.text = self.roomModel.room_info.room_name;
|
||||
self.textView.text = self.roomModel.room_info.room_intro;
|
||||
if ([self.roomModel.room_info.room_intro isExist]) {
|
||||
self.textView.placehoulderLabel.hidden = YES;
|
||||
}
|
||||
self.roomCoverUrl = self.roomModel.room_info.room_cover;
|
||||
[self.submitBtn setTitle:QXText(@"确认修改") forState:UIControlStateNormal];
|
||||
self.warningLabel.hidden = YES;
|
||||
self.navigationItem.title = QXText(@"编辑房间");
|
||||
}else{
|
||||
[self.submitBtn setTitle:QXText(@"提交审核") forState:UIControlStateNormal];
|
||||
self.warningLabel.hidden = NO;
|
||||
[self getRandomName];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(void)getRandomName{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getRoomRandomNameSuccessBlock:^(NSString * _Nonnull name) {
|
||||
weakSelf.textField.text = name;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - Request Data
|
||||
- (void)requestCreateMineRoomData {
|
||||
if (self.textField.text.length == 0) {
|
||||
showToast(@"请输入房间名称");
|
||||
return;
|
||||
}
|
||||
if (self.roomCoverUrl.length == 0) {
|
||||
showToast(@"请上传房间封面");
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
if (self.roomModel) {
|
||||
[QXMineNetwork roomInfoEditWithRoomId:self.roomModel.room_info.room_id room_name:self.textField.text room_cover:self.roomCoverUrl room_intro:self.textView.text room_background:@"" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
if (weakSelf.editSucceessBlock) {
|
||||
weakSelf.roomModel.room_info.room_name = weakSelf.textField.text;
|
||||
weakSelf.roomModel.room_info.room_cover = weakSelf.roomCoverUrl;
|
||||
weakSelf.roomModel.room_info.room_intro = weakSelf.textView.text;
|
||||
weakSelf.editSucceessBlock(weakSelf.roomModel);
|
||||
}
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
}else{
|
||||
[QXMineNetwork createRoomWithName:self.textField.text room_cover:self.roomCoverUrl room_intro:self.textView.text successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
if (weakSelf.createSucceessBlock) {
|
||||
weakSelf.createSucceessBlock();
|
||||
}
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)selectAlbumPhoto {
|
||||
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:nil];
|
||||
imagePickerVc.maxImagesCount = 1;
|
||||
imagePickerVc.allowCameraLocation = NO;
|
||||
imagePickerVc.allowPickingOriginalPhoto = NO;
|
||||
|
||||
imagePickerVc.allowTakeVideo = NO;
|
||||
imagePickerVc.allowPickingVideo = NO;
|
||||
imagePickerVc.showSelectBtn = NO;
|
||||
imagePickerVc.allowCrop = YES;
|
||||
imagePickerVc.cropRect = CGRectMake(0, (SCREEN_HEIGHT-SCREEN_WIDTH)/2, SCREEN_WIDTH, SCREEN_WIDTH);
|
||||
MJWeakSelf
|
||||
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
|
||||
if (photos.count) {
|
||||
NSData *imageData = [photos.firstObject qx_compressImageQualityWithToByte:(SCREEN_WIDTH*SCREEN_HEIGHT*2)];
|
||||
|
||||
[weakSelf OSSUploadPhotoWithFileData:imageData contentType:[NSString contentTypeWithImageData:imageData]];
|
||||
}
|
||||
}];
|
||||
imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[imagePickerVc.navigationBar setBackgroundImage:[UIImage imageWithColor:RGB16(0x333333)] forBarMetrics:UIBarMetricsDefault];
|
||||
[self presentViewController:imagePickerVc animated:YES completion:nil];
|
||||
}
|
||||
- (void)OSSUploadPhotoWithFileData:(NSData *)fileData contentType:(NSString *)contentType {
|
||||
[self OSSUploadPhotoWithFileData:fileData contentType:contentType isVideoCover:NO];
|
||||
}
|
||||
- (void)OSSUploadPhotoWithFileData:(NSData *)fileData contentType:(NSString *)contentType isVideoCover:(BOOL)isVideoCover {
|
||||
if (!fileData || !contentType) {
|
||||
QXLOG(@"资源加载错误");
|
||||
return;
|
||||
}
|
||||
if (fileData.length > 1024*1024 && [contentType isEqualToString:IMG_FILE_BASE_PATH]) {
|
||||
QXLOG(@"请不要上传超过1M的头像");
|
||||
return;
|
||||
}
|
||||
NSMutableArray *files = [[NSMutableArray alloc] initWithObjects:fileData, nil];
|
||||
|
||||
NSString *fileBasePath = IMG_FILE_BASE_PATH;// 默认图片上传
|
||||
NSString *fileName = [NSString stringWithFormat:@"%@%@/%@.%@",fileBasePath,[[QXOSSManager sharedInstance] currentDate],[NSUUID UUID].UUIDString,contentType];
|
||||
NSMutableArray *fileNames = [[NSMutableArray alloc] initWithObjects:fileName, nil];
|
||||
__weak typeof(self)weakSelf = self;
|
||||
[QXProjectTools showLoadingInView:self.view];
|
||||
[[QXOSSManager sharedInstance] uploadFile:files withObjectKey:fileNames isAsync:YES complete:^(NSArray<NSString *> *names, UploadImageState state) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[QXProjectTools hideLoadingInView:self.view];
|
||||
});
|
||||
if (state == UploadImageSuccess) {
|
||||
NSString *fileName = [names lastObject];
|
||||
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,fileName];
|
||||
weakSelf.roomCoverUrl = fileUrl;
|
||||
[weakSelf.roomImageView sd_setImageWithURL:[NSURL URLWithString:fileUrl] placeholderImage:[UIImage imageNamed:@"mine_room_cover_add"]];
|
||||
}else{
|
||||
QXLOG(@"文件上传失败,请重新尝试");
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
/// 跳转到我的直播间
|
||||
- (void)jumpMineLivingRoomWith:(int64_t)roomId {
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - UITextFieldDelegate
|
||||
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
||||
return [self.textField resignFirstResponder];
|
||||
}
|
||||
- (void)textFieldDidChanged:(UITextField *)textField {
|
||||
if (textField.text.length > 20) {
|
||||
[textField deleteBackward];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Btn Click
|
||||
//- (void)onChatBtnClick:(UIButton *)btn {
|
||||
// [MineAnalyticsManager DataBuryingClickInitRoomSelectTag:@{@"tag":@"chat"}];
|
||||
// btn.selected = !btn.selected;
|
||||
// self.gameBtn.selected = NO;
|
||||
//}
|
||||
//- (void)onKSongBtnClick:(UIButton *)btn {
|
||||
// [MineAnalyticsManager DataBuryingClickInitRoomSelectTag:@{@"tag":@"song"}];
|
||||
// btn.selected = !btn.selected;
|
||||
// self.chatBtn.selected = NO;
|
||||
//}
|
||||
//-(void)typeBtnClick:(UIButton*)sender{
|
||||
// self.typeBtn.selected = !self.typeBtn.selected;
|
||||
// sender.selected = !sender.selected;
|
||||
// self.typeBtn = sender;
|
||||
//}
|
||||
- (void)onSubmitBtnClick:(UIButton *)btn {
|
||||
|
||||
[self requestCreateMineRoomData];
|
||||
}
|
||||
-(void)clearAllAction{
|
||||
self.textField.text = @"";
|
||||
}
|
||||
|
||||
#pragma mark - Getter
|
||||
- (UILabel *)roomNameLabel {
|
||||
if (!_roomNameLabel) {
|
||||
_roomNameLabel = [[UILabel alloc] init];
|
||||
_roomNameLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
_roomNameLabel.textColor = QXConfig.textColor;
|
||||
_roomNameLabel.text = QXText(@"房间标题");
|
||||
}
|
||||
return _roomNameLabel;
|
||||
}
|
||||
-(UIView *)textFieldbgView{
|
||||
if (!_textFieldbgView) {
|
||||
_textFieldbgView = [[UIView alloc] init];
|
||||
_textFieldbgView.layer.masksToBounds = YES;
|
||||
_textFieldbgView.layer.cornerRadius = 11;
|
||||
_textFieldbgView.backgroundColor = [UIColor colorWithHexString:@"#EFF2F8"];
|
||||
}
|
||||
return _textFieldbgView;
|
||||
}
|
||||
-(UIButton *)deleteBtn{
|
||||
if (!_deleteBtn) {
|
||||
_deleteBtn = [[UIButton alloc] init];
|
||||
[_deleteBtn setImage:[UIImage imageNamed:@"Plus Circle"] forState:(UIControlStateNormal)];
|
||||
[_deleteBtn addTarget:self action:@selector(clearAllAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
}
|
||||
return _deleteBtn;
|
||||
}
|
||||
- (UITextField *)textField {
|
||||
if (!_textField) {
|
||||
_textField = [[UITextField alloc] init];
|
||||
_textField.layer.cornerRadius = 5;
|
||||
_textField.layer.masksToBounds = YES;
|
||||
_textField.font = [UIFont boldSystemFontOfSize:16];
|
||||
_textField.textColor = QXConfig.textColor;
|
||||
_textField.placeholder = QXText(@"请输入房间标题");
|
||||
_textField.textAlignment = NSTextAlignmentLeft;
|
||||
_textField.delegate = self;
|
||||
_textField.returnKeyType = UIReturnKeyDone;
|
||||
[_textField addTarget:self action:@selector(textFieldDidChanged:) forControlEvents:UIControlEventEditingChanged];
|
||||
}
|
||||
return _textField;
|
||||
}
|
||||
|
||||
- (UILabel *)roomNoticeLabel {
|
||||
if (!_roomNoticeLabel) {
|
||||
_roomNoticeLabel = [[UILabel alloc] init];
|
||||
_roomNoticeLabel.font = [UIFont boldSystemFontOfSize:15];
|
||||
_roomNoticeLabel.textColor = QXConfig.textColor;
|
||||
_roomNoticeLabel.text = QXText(@"房间公告");
|
||||
}
|
||||
return _roomNoticeLabel;
|
||||
}
|
||||
|
||||
-(UILabel *)roomCoverLabel{
|
||||
if (!_roomCoverLabel) {
|
||||
_roomCoverLabel = [[UILabel alloc] init];
|
||||
_roomCoverLabel.font = [UIFont systemFontOfSize:14];
|
||||
_roomCoverLabel.textColor = QXConfig.textColor;
|
||||
_roomCoverLabel.text = QXText(@"房间封面");
|
||||
}
|
||||
return _roomCoverLabel;
|
||||
}
|
||||
-(UIImageView *)roomImageView{
|
||||
if (!_roomImageView) {
|
||||
_roomImageView = [[UIImageView alloc] init];
|
||||
_roomImageView.image = [UIImage imageNamed:@"mine_room_cover_add"];
|
||||
_roomImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_roomImageView.clipsToBounds = YES;
|
||||
}
|
||||
return _roomImageView;
|
||||
}
|
||||
-(UIView *)noticeBgView{
|
||||
if (!_noticeBgView) {
|
||||
_noticeBgView = [[UIView alloc] init];
|
||||
_noticeBgView.backgroundColor = RGB16(0xEFF2F8);
|
||||
[_noticeBgView addRoundedCornersWithRadius:11];
|
||||
}
|
||||
return _noticeBgView;
|
||||
}
|
||||
-(QXTextView *)textView{
|
||||
if (!_textView) {
|
||||
_textView = [[QXTextView alloc] init];
|
||||
_textView.font = [UIFont systemFontOfSize:12];
|
||||
_textView.textColor = QXConfig.textColor;
|
||||
_textView.placehoulder = QXText(@"本房间严禁刷屏,禁止非法广告宣传,禁止引战地域黑,语言攻击等");
|
||||
_textView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _textView;
|
||||
}
|
||||
|
||||
-(UIButton *)roomImageBtn{
|
||||
if (!_roomImageBtn) {
|
||||
_roomImageBtn = [[UIButton alloc] init];
|
||||
[_roomImageBtn addTarget:self action:@selector(selectAlbumPhoto) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
}
|
||||
return _roomImageBtn;
|
||||
}
|
||||
-(UIButton *)randomBtn{
|
||||
if (!_randomBtn) {
|
||||
_randomBtn = [[UIButton alloc] init];
|
||||
[_randomBtn setTitle:QXText(@"随机名称") forState:(UIControlStateNormal)];
|
||||
_randomBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[_randomBtn setTitleColor:RGB16(0xFF8ACC) forState:(UIControlStateNormal)];
|
||||
[_randomBtn addTarget:self action:@selector(getRandomName) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _randomBtn;
|
||||
}
|
||||
- (UIButton *)submitBtn {
|
||||
if (!_submitBtn) {
|
||||
_submitBtn = [[UIButton alloc] init];
|
||||
[_submitBtn setTitle:QXText(@"提交审核") forState:UIControlStateNormal];
|
||||
_submitBtn.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[_submitBtn setTitleColor:QXConfig.textColor forState:UIControlStateNormal];
|
||||
_submitBtn.backgroundColor = QXConfig.themeColor;
|
||||
_submitBtn.layer.masksToBounds = YES;
|
||||
_submitBtn.layer.cornerRadius = 21;
|
||||
[_submitBtn addTarget:self action:@selector(onSubmitBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _submitBtn;
|
||||
}
|
||||
|
||||
-(UILabel *)warningLabel{
|
||||
if (!_warningLabel) {
|
||||
_warningLabel = [[UILabel alloc] init];
|
||||
_warningLabel.backgroundColor = RGB16(0x333333);
|
||||
[_warningLabel addRoundedCornersWithRadius:3];
|
||||
_warningLabel.textColor = UIColor.whiteColor;
|
||||
_warningLabel.font = [UIFont systemFontOfSize:11];
|
||||
_warningLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_warningLabel.text = QXText(@"创建房间需要审核,通过后可开启直播");
|
||||
}
|
||||
return _warningLabel;
|
||||
}
|
||||
@end
|
||||
17
QXLive/Mine(音域)/Controller/我的房间/QXMyRoomSubViewController.h
Normal file
17
QXLive/Mine(音域)/Controller/我的房间/QXMyRoomSubViewController.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXMyRoomSubViewController.h
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "JXCategoryView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@interface QXMyRoomSubViewController : UIViewController<JXCategoryListContentViewDelegate>
|
||||
/// 0 我创建的 1 我主持的 2我管理的 3 我关注的
|
||||
@property(nonatomic,assign)NSInteger type;
|
||||
-(void)refreshRoom;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
285
QXLive/Mine(音域)/Controller/我的房间/QXMyRoomSubViewController.m
Normal file
285
QXLive/Mine(音域)/Controller/我的房间/QXMyRoomSubViewController.m
Normal file
@@ -0,0 +1,285 @@
|
||||
//
|
||||
// QXMyRoomSubViewController.m
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/5.
|
||||
//
|
||||
|
||||
#import "QXMyRoomSubViewController.h"
|
||||
#import "QXHomeRoomCell.h"
|
||||
#import "QXMyRoomListCell.h"
|
||||
#import "QXMyHistoryHeaderView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXMyRoomViewController.h"
|
||||
#import "QXMyCpRoomListCell.h"
|
||||
|
||||
@interface QXMyRoomSubViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,QXMyHistoryHeaderViewDelegate>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@property (nonatomic,strong)NSMutableArray *historyArray;
|
||||
@property (nonatomic,strong)NSMutableArray *cpRoomArray;
|
||||
|
||||
|
||||
@property (nonatomic,strong) QXMyHistoryHeaderView *headerView;
|
||||
@property (nonatomic,assign)NSInteger page;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXMyRoomSubViewController
|
||||
-(UIView *)listView{
|
||||
return self.view;
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[self initSubview];
|
||||
}
|
||||
-(void)initSubview{
|
||||
self.page = 1;
|
||||
[self.view addSubview:self.collectionView];
|
||||
[self getRoomList];
|
||||
}
|
||||
-(void)refreshRoom{
|
||||
self.page = 1;
|
||||
[self getRoomList];
|
||||
}
|
||||
-(void) getRoomList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork myRoomListWithType:[NSString stringWithFormat:@"%ld",self.type] page:self.page successBlock:^(NSArray<QXRoomListModel *> * _Nonnull list) {
|
||||
|
||||
if (self.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
if (list.count == 0) {
|
||||
if (weakSelf.type == 0) {
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}else{
|
||||
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}
|
||||
}else{
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
if (self.type == 0) {
|
||||
[QXMineNetwork myHistoryRoomWithPage:self.page successBlock:^(NSArray<QXMyRoomHistory *> * _Nonnull list) {
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.historyArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.historyArray addObjectsFromArray:list];
|
||||
if (list.count == 0) {
|
||||
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
|
||||
[QXMineNetwork getMyCpRoomListSuccessBlock:^(NSArray<QXRoomListCpModel *> * _Nonnull list) {
|
||||
[weakSelf.cpRoomArray removeAllObjects];
|
||||
[weakSelf.cpRoomArray addObjectsFromArray:list];
|
||||
[weakSelf.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
// [self.dataArray addObject:@""];
|
||||
// [self.dataArray addObject:@""];
|
||||
// [self.dataArray addObject:@""];
|
||||
// [self.dataArray addObject:@""];
|
||||
// [self.historyArray addObject:@""];
|
||||
}
|
||||
#pragma mark - QXMyHistoryHeaderViewDelegate
|
||||
-(void)didClickClearBtn{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork clearRoomHistorySuccessBlock:^(NSArray<QXRoomListCpModel *> * _Nonnull list) {
|
||||
[self.historyArray removeAllObjects];
|
||||
[self.collectionView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
- (void)requestDeleteAllFootprintData {
|
||||
|
||||
}
|
||||
#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout
|
||||
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
|
||||
if (self.type == 0) {
|
||||
return 3;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
if (self.type == 0) {
|
||||
if (section == 0) {
|
||||
return self.dataArray.count;;
|
||||
}else if (section == 1) {
|
||||
return self.cpRoomArray.count;;
|
||||
}else{
|
||||
return self.historyArray.count;
|
||||
}
|
||||
}
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.type == 0) {
|
||||
if (indexPath.section == 0) {
|
||||
QXMyRoomListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXMyRoomListCell" forIndexPath:indexPath];
|
||||
cell.type = self.type;
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}else if (indexPath.section == 1) {
|
||||
QXMyCpRoomListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXMyCpRoomListCell" forIndexPath:indexPath];
|
||||
cell.type = self.type;
|
||||
cell.cpModel = self.cpRoomArray[indexPath.row];
|
||||
return cell;
|
||||
}else{
|
||||
QXHomeRoomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXHomeRoomCell" forIndexPath:indexPath];
|
||||
cell.historyModel = self.historyArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
}else if (self.type == 1){
|
||||
QXMyRoomListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXMyRoomListCell" forIndexPath:indexPath];
|
||||
cell.type = self.type;
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}else{
|
||||
QXHomeRoomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXHomeRoomCell" forIndexPath:indexPath];
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.type == 0) {
|
||||
if (indexPath.section == 0 || indexPath.section == 1) {
|
||||
return CGSizeMake(SCREEN_WIDTH, 143);
|
||||
}else{
|
||||
return CGSizeMake((SCREEN_WIDTH-15*3-1)/2.0, (SCREEN_WIDTH-15*3-1)/2.0);
|
||||
}
|
||||
}else if (self.type == 1){
|
||||
return CGSizeMake(SCREEN_WIDTH, 143);
|
||||
}else{
|
||||
return CGSizeMake((SCREEN_WIDTH-15*3-1)/2.0, (SCREEN_WIDTH-15*3-1)/2.0);
|
||||
}
|
||||
}
|
||||
-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.type == 0) {
|
||||
if (indexPath.section == 2) {
|
||||
if ([kind isEqualToString:UICollectionElementKindSectionHeader]) {
|
||||
UICollectionReusableView *header = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXMyHistoryHeaderView" forIndexPath:indexPath];
|
||||
[header addSubview:self.headerView];
|
||||
return header;
|
||||
}else{
|
||||
return nil;
|
||||
}
|
||||
}else{
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
|
||||
if (self.type == 0) {
|
||||
if (section == 2) {
|
||||
return CGSizeMake(SCREEN_WIDTH, 46);
|
||||
}else{
|
||||
return CGSizeZero;
|
||||
}
|
||||
}else{
|
||||
return CGSizeZero;
|
||||
}
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
if (self.type == 0) {
|
||||
if (indexPath.section == 0) {
|
||||
QXRoomListModel *model = self.dataArray[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}else if (indexPath.section == 1) {
|
||||
QXRoomListCpModel *cpRoom = self.cpRoomArray[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:cpRoom.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}else{
|
||||
QXMyRoomHistory *model = self.historyArray[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}
|
||||
}else if (self.type == 1){
|
||||
QXRoomListModel *model = self.dataArray[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}else{
|
||||
QXRoomListModel *model = self.dataArray[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
}
|
||||
|
||||
-(UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 15;
|
||||
layout.minimumInteritemSpacing = 15;
|
||||
layout.sectionInset = UIEdgeInsetsMake(8, 15, 8, 15);
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-kSafeAreaTop-kSafeAreaBottom-44*2) collectionViewLayout:layout];
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXHomeRoomCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXHomeRoomCell"];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXMyRoomListCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXMyRoomListCell"];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXMyCpRoomListCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXMyCpRoomListCell"];
|
||||
[_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXMyHistoryHeaderView"];
|
||||
MJWeakSelf
|
||||
_collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
[weakSelf getRoomList];
|
||||
}];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
-(NSMutableArray *)historyArray{
|
||||
if (!_historyArray) {
|
||||
_historyArray = [NSMutableArray array];
|
||||
}
|
||||
return _historyArray;
|
||||
}
|
||||
-(NSMutableArray *)cpRoomArray{
|
||||
if (!_cpRoomArray) {
|
||||
_cpRoomArray = [NSMutableArray array];
|
||||
}
|
||||
return _cpRoomArray;
|
||||
}
|
||||
|
||||
-(QXMyHistoryHeaderView *)headerView{
|
||||
if (!_headerView) {
|
||||
_headerView = [[QXMyHistoryHeaderView alloc] init];
|
||||
_headerView.delegate = self;
|
||||
}
|
||||
return _headerView;
|
||||
}
|
||||
/*
|
||||
#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
|
||||
17
QXLive/Mine(音域)/Controller/我的房间/QXMyRoomViewController.h
Normal file
17
QXLive/Mine(音域)/Controller/我的房间/QXMyRoomViewController.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXMyRoomViewController.h
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/5.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXMyRoomViewController : QXBaseViewController
|
||||
/// 1已实名 0 未实名
|
||||
@property (nonatomic,assign)BOOL auth_status;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
116
QXLive/Mine(音域)/Controller/我的房间/QXMyRoomViewController.m
Normal file
116
QXLive/Mine(音域)/Controller/我的房间/QXMyRoomViewController.m
Normal file
@@ -0,0 +1,116 @@
|
||||
//
|
||||
// QXMyRoomViewController.m
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/5.
|
||||
//
|
||||
|
||||
#import "QXMyRoomViewController.h"
|
||||
#import "JXCategoryView.h"
|
||||
#import "QXMyRoomSubViewController.h"
|
||||
#import "QXCreateRoomViewController.h"
|
||||
|
||||
@interface QXMyRoomViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
|
||||
|
||||
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
|
||||
@property (nonatomic,strong)NSMutableArray <UIViewController*>*listVCArray;
|
||||
@property (nonatomic,strong)NSArray *titles;
|
||||
@property (nonatomic,strong)QXMyRoomSubViewController *myRoomVC;
|
||||
@end
|
||||
|
||||
@implementation QXMyRoomViewController
|
||||
|
||||
- (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)viewDidAppear:(BOOL)animated{
|
||||
[super viewDidAppear:animated];
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0);
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = @"我的房间";
|
||||
UIButton*createBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
|
||||
[createBtn setImage:[UIImage imageNamed:@"mine_add"] forState:(UIControlStateNormal)];
|
||||
createBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentTrailing;
|
||||
[createBtn addTarget:self action:@selector(createAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:createBtn];
|
||||
}
|
||||
|
||||
-(void)createAction{
|
||||
MJWeakSelf
|
||||
QXCreateRoomViewController *vc = [[QXCreateRoomViewController alloc] init];
|
||||
vc.createSucceessBlock = ^{
|
||||
[weakSelf.myRoomVC refreshRoom];
|
||||
};
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)initSubViews{
|
||||
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
self.titles = @[@"我创建的",@"我主持的",@"我管理的",@"我关注的"];
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
self.categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(15, kSafeAreaTop+44, 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 = 70;
|
||||
self.categoryView.contentEdgeInsetLeft = 0;
|
||||
self.categoryView.cellSpacing = 0;
|
||||
// self.categoryView.titleLabelZoomScale = 1.1;
|
||||
self.categoryView.titleLabelZoomEnabled = YES;
|
||||
self.categoryView.titleFont = [UIFont systemFontOfSize:12];
|
||||
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(58, 8);
|
||||
indicatorView.verticalMargin = 11;
|
||||
self.categoryView.indicators = @[indicatorView];
|
||||
self.containerView = [[JXCategoryListContainerView alloc] initWithType:(JXCategoryListContainerType_ScrollView) delegate:self];
|
||||
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom);
|
||||
[self.view addSubview:self.categoryView];
|
||||
[self.view addSubview:self.containerView];
|
||||
self.categoryView.listContainer = self.containerView;
|
||||
[self requestMineUserInfoData];
|
||||
}
|
||||
- (void)requestMineUserInfoData {
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
|
||||
return self.titles.count;
|
||||
}
|
||||
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
QXMyRoomSubViewController *vc = [[QXMyRoomSubViewController alloc] init];
|
||||
vc.type = index;
|
||||
if (index == 0) {
|
||||
self.myRoomVC = vc;
|
||||
}
|
||||
return vc;
|
||||
}
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
|
||||
}
|
||||
/*
|
||||
#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
|
||||
18
QXLive/Mine(音域)/Controller/我的房间/QXRoomDetailViewController.h
Normal file
18
QXLive/Mine(音域)/Controller/我的房间/QXRoomDetailViewController.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// QXRoomDetailViewController.h
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/5.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomDetailViewController : QXBaseViewController
|
||||
/// 0我创建的 1我主持的
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
@property (nonatomic,strong)NSString* room_id;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
243
QXLive/Mine(音域)/Controller/我的房间/QXRoomDetailViewController.m
Normal file
243
QXLive/Mine(音域)/Controller/我的房间/QXRoomDetailViewController.m
Normal file
@@ -0,0 +1,243 @@
|
||||
//
|
||||
// QXRoomDetailViewController.m
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/5.
|
||||
//
|
||||
|
||||
#import "QXRoomDetailViewController.h"
|
||||
#import "QXRoomDetailHeaderView.h"
|
||||
#import "QXRoomWaterListCell.h"
|
||||
#import "NSArray+YYAdd.h"
|
||||
#import "NSString+YYAdd.h"
|
||||
#import "QXRoomSubsidyViewController.h"
|
||||
#import "QXRoomWaterModel.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXRoomDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)NSMutableDictionary *dict;
|
||||
@property (nonatomic,strong)NSMutableArray *allDateArray;
|
||||
@property (nonatomic,strong)QXRoomDetailHeaderView *headerView;
|
||||
@property (nonatomic,strong)NSString* startTime;
|
||||
@property (nonatomic,strong)NSString* endTime;
|
||||
@end
|
||||
|
||||
@implementation QXRoomDetailViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
}
|
||||
-(void)viewDidAppear:(BOOL)animated{
|
||||
[super viewDidAppear:animated];
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = @"房间明细";
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.page = 1;
|
||||
UIButton *rightBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 55, 44)];
|
||||
[rightBtn setTitle:@"补贴明细" forState:(UIControlStateNormal)];
|
||||
rightBtn.titleLabel.font = [UIFont systemFontOfSize:13];
|
||||
[rightBtn setTitleColor:[UIColor colorWithHexString:@"#FF8ACC"] forState:(UIControlStateNormal)];
|
||||
[rightBtn addTarget:self action:@selector(detailAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
|
||||
[self.view addSubview:self.headerView];
|
||||
[self.view addSubview:self.tableView];
|
||||
self.dict = [NSMutableDictionary dictionary];
|
||||
[self getPriceData];
|
||||
}
|
||||
-(void)detailAction{
|
||||
QXRoomSubsidyViewController *vc = [[QXRoomSubsidyViewController alloc] init];
|
||||
vc.room_id = self.room_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(void)getPriceData{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork roomWaterDetailWithRoomId:self.room_id start_time:self.startTime end_time:self.endTime page:self.page type:self.type successBlock:^(QXRoomDetailModel * _Nonnull model) {
|
||||
weakSelf.headerView.model = model;
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dict removeAllObjects];
|
||||
}
|
||||
|
||||
NSArray *arr = [weakSelf.dict allKeys];
|
||||
for (QXRoomWaterModel*md in model.list) {
|
||||
BOOL haveKey = NO;
|
||||
for (NSString *s in arr) {
|
||||
if ([s isEqualToString:md.time]) {
|
||||
haveKey = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!haveKey) {
|
||||
// key没有包含某个日期,设置日期的流水json
|
||||
[weakSelf.dict setObject:[md yy_modelToJSONString] forKey:md.time];
|
||||
}else{
|
||||
//有包含某个日期,先取出之前已有的数据
|
||||
NSString *json = [weakSelf.dict objectForKey:md.time];
|
||||
//转换为模型
|
||||
QXRoomWaterModel *m = [QXRoomWaterModel yy_modelWithJSON:json];
|
||||
//旧数据
|
||||
NSMutableArray *newArr = [NSMutableArray arrayWithArray:m.list];
|
||||
//添加新数据
|
||||
[newArr addObjectsFromArray:md.list];
|
||||
//赋值于历史数据
|
||||
m.list = newArr;
|
||||
// 重新设置键值对
|
||||
[weakSelf.dict setObject:[m yy_modelToJSONString] forKey:md.time];
|
||||
}
|
||||
}
|
||||
NSArray *keys = [weakSelf.dict.allKeys sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
|
||||
// NSString *s1 = obj1;
|
||||
// NSString *s2 = obj2;
|
||||
NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter1 setDateFormat:@"yyyy-MM-dd"];
|
||||
NSDate *date1 = [dateFormatter1 dateFromString:obj1];
|
||||
|
||||
NSDateFormatter *dateFormatter2 = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter2 setDateFormat:@"yyyy-MM-dd"];
|
||||
NSDate *date2 = [dateFormatter2 dateFromString:obj2];
|
||||
NSComparisonResult result = [date1 compare:date2];
|
||||
if (result == NSOrderedAscending) {
|
||||
return NSOrderedDescending;
|
||||
}else if (result == NSOrderedDescending){
|
||||
return NSOrderedAscending;
|
||||
}else{
|
||||
return NSOrderedSame;
|
||||
}
|
||||
}];
|
||||
self.allDateArray = [NSMutableArray arrayWithArray:keys];
|
||||
[weakSelf.tableView reloadData];
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
if (model.list.count == 0) {
|
||||
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return self.allDateArray.count;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
NSString *json = [self.dict objectForKey:self.allDateArray[section]];
|
||||
QXRoomWaterModel*model = [QXRoomWaterModel yy_modelWithJSON:json];
|
||||
return model.list.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRoomWaterListCell *cell = [QXRoomWaterListCell cellWithTableView:tableView];
|
||||
NSString *json = [self.dict objectForKey:self.allDateArray[indexPath.section]];
|
||||
//转换为数组
|
||||
QXRoomWaterModel*m = [QXRoomWaterModel yy_modelWithJSON:json];
|
||||
QXRoomWaterDetailModel *model = m.list[indexPath.row];
|
||||
cell.model = model;
|
||||
return cell;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
NSString *time = [self.allDateArray objectAtIndex:section];
|
||||
NSString *json = [self.dict objectForKey:time];
|
||||
//转换为数组
|
||||
QXRoomWaterModel*model = [QXRoomWaterModel yy_modelWithJSON:json];
|
||||
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 25)];
|
||||
header.backgroundColor = [UIColor whiteColor];
|
||||
UILabel *timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, 130, 25)];
|
||||
timeLabel.font = [UIFont systemFontOfSize:13];
|
||||
timeLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
timeLabel.text = time;
|
||||
[header addSubview:timeLabel];
|
||||
|
||||
UILabel *waterLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-16-130, 0, SCREEN_WIDTH-130-32, 25)];
|
||||
waterLabel.font = [UIFont systemFontOfSize:13];
|
||||
waterLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
NSString *total_earning = [NSString stringWithFormat:@"%.2f",model.total_earning];
|
||||
NSString *total_price = [NSString stringWithFormat:@"%.2f",model.total_price];
|
||||
NSString *s = [NSString stringWithFormat:@"收益 %@ 流水 %@",total_earning,total_price];
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:s];
|
||||
[attr yy_setColor:[UIColor colorWithHexString:@"#FF8ACC"] range:[s rangeOfString:total_earning]];
|
||||
[attr yy_setColor:[UIColor colorWithHexString:@"#FF8ACC"] range:[s rangeOfString:total_price]];
|
||||
// waterLabel.text = [NSString stringWithFormat:@"收益 %@ 流水 %@",model.total_earning,model.total_price];
|
||||
waterLabel.attributedText = attr;
|
||||
waterLabel.textAlignment = NSTextAlignmentRight;
|
||||
[waterLabel sizeToFit];
|
||||
waterLabel.frame = CGRectMake(SCREEN_WIDTH-16-waterLabel.size.width, 0, waterLabel.size.width, 25);
|
||||
[header addSubview:waterLabel];
|
||||
return header;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
return 25;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
||||
return [UIView new];
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 0.01;
|
||||
}
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.headerView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.headerView.bottom) style:(UITableViewStylePlain)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.tableFooterView = [UIView new];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.rowHeight = 65;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
_tableView.sectionHeaderTopPadding = 0;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getPriceData];
|
||||
}];
|
||||
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getPriceData];
|
||||
}];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
-(NSMutableArray *)allDateArray{
|
||||
if (!_allDateArray) {
|
||||
_allDateArray = [NSMutableArray array];
|
||||
}
|
||||
return _allDateArray;
|
||||
}
|
||||
-(QXRoomDetailHeaderView *)headerView{
|
||||
if (!_headerView) {
|
||||
UIImage*img = [UIImage imageNamed:@"mine_room_water_bg"];
|
||||
CGFloat height = (SCREEN_WIDTH-32)/img.size.width*img.size.height;
|
||||
_headerView = [[QXRoomDetailHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 11+ kSafeAreaTop+44 + height)];
|
||||
MJWeakSelf
|
||||
_headerView.chooseDateBlock = ^(NSString * _Nonnull startTime, NSString * _Nonnull endTime) {
|
||||
weakSelf.startTime = startTime;
|
||||
weakSelf.endTime = endTime;
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getPriceData];
|
||||
};
|
||||
}
|
||||
return _headerView;
|
||||
}
|
||||
/*
|
||||
#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
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXRoomHistoryViewController.h
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/4/23.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomHistoryViewController : QXBaseViewController
|
||||
@property (nonatomic,strong)NSString *room_id;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
128
QXLive/Mine(音域)/Controller/我的房间/QXRoomHistoryViewController.m
Normal file
128
QXLive/Mine(音域)/Controller/我的房间/QXRoomHistoryViewController.m
Normal file
@@ -0,0 +1,128 @@
|
||||
//
|
||||
// QXRoomHistoryViewController.m
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/4/23.
|
||||
//
|
||||
|
||||
#import "QXRoomHistoryViewController.h"
|
||||
#import "QXSubsidyModel.h"
|
||||
#import "QXRoomSubsidyHistoryCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXRoomHistoryViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)UIView *headerView;
|
||||
@end
|
||||
|
||||
@implementation QXRoomHistoryViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
self.navigationItem.title = @"历史记录";
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.view addSubview:self.headerView];
|
||||
self.page = 1;
|
||||
[self getHistorySubsidy];
|
||||
}
|
||||
-(void)getHistorySubsidy{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork roomSubsidyHisoryWithWithRoomId:self.room_id page:self.page successBlock:^(NSArray<QXSubsidyHistoryModel *> * _Nonnull list) {
|
||||
if (self.page == 1) {
|
||||
[self.dataArray removeAllObjects];
|
||||
}
|
||||
if (list.count == 0) {
|
||||
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[weakSelf.tableView reloadData];
|
||||
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
showToast(msg)
|
||||
}];
|
||||
}
|
||||
- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRoomSubsidyHistoryCell *cell = [QXRoomSubsidyHistoryCell cellWithTableView:tableView];
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
//-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
// return self.headerView;
|
||||
//}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
return 44;
|
||||
}
|
||||
//-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
// return 44;
|
||||
//}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.headerView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.headerView.bottom) style:(UITableViewStylePlain)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor whiteColor];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
_tableView.sectionHeaderTopPadding = 0;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getHistorySubsidy];
|
||||
}];
|
||||
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getHistorySubsidy];
|
||||
}];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
-(UIView *)headerView{
|
||||
if (!_headerView) {
|
||||
_headerView = [[UIView alloc] initWithFrame:CGRectMake(0,NavContentHeight+18 , SCREEN_WIDTH, 44)];
|
||||
[_headerView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
|
||||
_headerView.backgroundColor = [UIColor whiteColor];
|
||||
UILabel *timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 145, 44)];
|
||||
timeLabel.text = @"时间";
|
||||
timeLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
timeLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
timeLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[_headerView addSubview:timeLabel];
|
||||
|
||||
UILabel *statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-16-50, 0, 50, 44)];
|
||||
statusLabel.text = @"状态";
|
||||
statusLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
statusLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
statusLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[_headerView addSubview:statusLabel];
|
||||
|
||||
UILabel *subsidyLabel = [[UILabel alloc] initWithFrame:CGRectMake(statusLabel.left-75, 0, 65, 44)];
|
||||
subsidyLabel.text = @"获得补贴";
|
||||
subsidyLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
subsidyLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
subsidyLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[_headerView addSubview:subsidyLabel];
|
||||
|
||||
UILabel *allWaterLabel = [[UILabel alloc] initWithFrame:CGRectMake(timeLabel.right+10, 0, subsidyLabel.left-20-timeLabel.right, 44)];
|
||||
allWaterLabel.text = @"累计流水";
|
||||
allWaterLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
allWaterLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
allWaterLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[_headerView addSubview:allWaterLabel];
|
||||
}
|
||||
return _headerView;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXRoomSubsidyViewController.h
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/4/23.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomSubsidyViewController : QXBaseViewController
|
||||
@property (nonatomic,strong)NSString *room_id;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
110
QXLive/Mine(音域)/Controller/我的房间/QXRoomSubsidyViewController.m
Normal file
110
QXLive/Mine(音域)/Controller/我的房间/QXRoomSubsidyViewController.m
Normal file
@@ -0,0 +1,110 @@
|
||||
//
|
||||
// QXRoomSubsidyViewController.m
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/4/23.
|
||||
//
|
||||
|
||||
#import "QXRoomSubsidyViewController.h"
|
||||
#import "QXRoomHistoryViewController.h"
|
||||
#import "QXRoomSubsidyCell.h"
|
||||
#import "QXSubsidyModel.h"
|
||||
#import <WebKit/WKWebView.h>
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXRoomSubsidyViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)QXSubsidyModel *model;
|
||||
@property (nonatomic,strong)WKWebView *webView;
|
||||
@end
|
||||
|
||||
@implementation QXRoomSubsidyViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
self.navigationItem.title = @"房间补贴";
|
||||
UIButton *rightBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 55, 44)];
|
||||
[rightBtn setTitle:@"历史记录" forState:(UIControlStateNormal)];
|
||||
rightBtn.titleLabel.font = [UIFont systemFontOfSize:13];
|
||||
[rightBtn setTitleColor:[UIColor colorWithHexString:@"#FF8ACC"] forState:(UIControlStateNormal)];
|
||||
[rightBtn addTarget:self action:@selector(detailAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.view addSubview:self.webView];
|
||||
[self getSubsidy];
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
}
|
||||
-(void)detailAction{
|
||||
QXRoomHistoryViewController *vc = [[QXRoomHistoryViewController alloc] init];
|
||||
vc.room_id = self.room_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)getSubsidy{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork roomSubsidyWithRoomId:self.room_id successBlock:^(QXSubsidyModel * _Nonnull model) {
|
||||
weakSelf.model = model;
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@",model.explain]];
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL:url];
|
||||
[weakSelf.webView loadRequest:request];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
if (self.model) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRoomSubsidyCell *cell = [QXRoomSubsidyCell cellWithTableView:tableView];
|
||||
if (indexPath.row == 0) {
|
||||
cell.titleLabel.text = @"上周补贴";
|
||||
cell.model = self.model.lastweek;
|
||||
}else{
|
||||
cell.titleLabel.text = @"本周补贴";
|
||||
cell.model = self.model.thisweek;
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
return 90;
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight+18, SCREEN_WIDTH, 190) style:(UITableViewStylePlain)];
|
||||
[_tableView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor whiteColor];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.scrollEnabled = NO;
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
-(WKWebView *)webView{
|
||||
if (!_webView) {
|
||||
_webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, self.tableView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.tableView.bottom)];
|
||||
}
|
||||
return _webView;
|
||||
}
|
||||
|
||||
/*
|
||||
#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
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// QXBackpackSubViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/16.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "JXCategoryView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXBackpackSubViewController : QXBaseViewController<JXCategoryListContentViewDelegate>
|
||||
/// 0背包道具 1背包收入 2背包支出
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
167
QXLive/Mine(音域)/Controller/我的背包/QXBackpackSubViewController.m
Normal file
167
QXLive/Mine(音域)/Controller/我的背包/QXBackpackSubViewController.m
Normal file
@@ -0,0 +1,167 @@
|
||||
//
|
||||
// QXBackpackSubViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/16.
|
||||
//
|
||||
|
||||
#import "QXBackpackSubViewController.h"
|
||||
#import "QXGiftCell.h"
|
||||
#import "QXBackpackRecordCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXBackpackSubViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@end
|
||||
|
||||
@implementation QXBackpackSubViewController
|
||||
-(UIView *)listView{
|
||||
return self.view;
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
- (void)initSubViews{
|
||||
self.page = 1;
|
||||
self.bgImageHidden = YES;
|
||||
if (self.type == 0) {
|
||||
[self getBagList];
|
||||
self.collectionView.frame = CGRectMake(0, 12, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-44-10);
|
||||
}else{
|
||||
[self getGiftRecordListIsIncome:self.type == 1];
|
||||
[self.collectionView addRoundedCornersWithRadius:16];
|
||||
self.collectionView.backgroundColor = [UIColor whiteColor];
|
||||
self.collectionView.frame = CGRectMake(16, 12, SCREEN_WIDTH-32, SCREEN_HEIGHT-NavContentHeight-44-10);
|
||||
}
|
||||
[self.view addSubview:self.collectionView];
|
||||
}
|
||||
-(void)getBagList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getBagListSuccessBlock:^(NSArray * _Nonnull list) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[weakSelf.collectionView reloadData];
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)getGiftRecordListIsIncome:(BOOL)isIncom{
|
||||
MJWeakSelf
|
||||
if (isIncom) {
|
||||
[QXMineNetwork getBagIncomeListWithPage:self.page successBlock:^(NSArray * _Nonnull list) {
|
||||
if (self.page == 1) {
|
||||
[self.dataArray removeAllObjects];
|
||||
}
|
||||
if (list.count == 0) {
|
||||
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[weakSelf.collectionView reloadData];
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}else{
|
||||
[QXMineNetwork getBagOutcomeListWithPage:self.page successBlock:^(NSArray * _Nonnull list) {
|
||||
if (self.page == 1) {
|
||||
[self.dataArray removeAllObjects];
|
||||
}
|
||||
if (list.count == 0) {
|
||||
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[weakSelf.collectionView reloadData];
|
||||
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.type == 0) {
|
||||
QXGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftCell" forIndexPath:indexPath];
|
||||
cell.cellType = QXGiftCellTypeBackpack;
|
||||
cell.roomGiftModel = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}else{
|
||||
QXBackpackRecordCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXBackpackRecordCell" forIndexPath:indexPath];
|
||||
if (indexPath.row == (self.dataArray.count - 1)) {
|
||||
cell.lineView.hidden = YES;
|
||||
}else{
|
||||
cell.lineView.hidden = NO;
|
||||
}
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.type == 0) {
|
||||
CGFloat width = (SCREEN_WIDTH-15*2-22*2)/3;
|
||||
return CGSizeMake(width, width/100*136);
|
||||
}else{
|
||||
return CGSizeMake(SCREEN_WIDTH-32, 67);
|
||||
}
|
||||
}
|
||||
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
|
||||
if (self.type == 0) {
|
||||
return 22;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{
|
||||
if (self.type == 0) {
|
||||
return 22;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
-(UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 22;
|
||||
layout.minimumInteritemSpacing = 22;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15);
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 12, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-44-10) collectionViewLayout:layout];
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXGiftCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXGiftCell"];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXBackpackRecordCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXBackpackRecordCell"];
|
||||
MJWeakSelf
|
||||
_collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
if (weakSelf.type == 0) {
|
||||
[weakSelf getBagList];
|
||||
}else{
|
||||
[weakSelf getGiftRecordListIsIncome:self.type == 1];
|
||||
}
|
||||
}];
|
||||
_collectionView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
if (weakSelf.type == 0) {
|
||||
[weakSelf getBagList];
|
||||
}else{
|
||||
[weakSelf getGiftRecordListIsIncome:self.type == 1];
|
||||
}
|
||||
}];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/我的背包/QXBackpackViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/我的背包/QXBackpackViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXBackpackViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXBackpackViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
77
QXLive/Mine(音域)/Controller/我的背包/QXBackpackViewController.m
Normal file
77
QXLive/Mine(音域)/Controller/我的背包/QXBackpackViewController.m
Normal file
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// QXBackpackViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBackpackViewController.h"
|
||||
#import "JXCategoryView.h"
|
||||
#import "QXBackpackSubViewController.h"
|
||||
|
||||
@interface QXBackpackViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
|
||||
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
|
||||
@property (nonatomic,strong)NSMutableArray <UIViewController*>*listVCArray;
|
||||
@property (nonatomic,strong)NSArray *titles;
|
||||
@end
|
||||
|
||||
@implementation QXBackpackViewController
|
||||
|
||||
- (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.view.backgroundColor = [UIColor whiteColor];
|
||||
self.titles = @[QXText(@"背包道具"),QXText(@"背包收入"),QXText(@"背包支出")];
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
self.categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(15, kSafeAreaTop+44, 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_ScrollView) delegate:self];
|
||||
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom);
|
||||
[self.view addSubview:self.categoryView];
|
||||
[self.view addSubview:self.containerView];
|
||||
self.categoryView.listContainer = self.containerView;
|
||||
|
||||
}
|
||||
-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
|
||||
return self.titles.count;
|
||||
}
|
||||
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
QXBackpackSubViewController *vc = [[QXBackpackSubViewController alloc] init];
|
||||
vc.type = index;
|
||||
return vc;
|
||||
}
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/段位/QXLevelViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/段位/QXLevelViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXLevelViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXLevelViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
213
QXLive/Mine(音域)/Controller/段位/QXLevelViewController.m
Normal file
213
QXLive/Mine(音域)/Controller/段位/QXLevelViewController.m
Normal file
@@ -0,0 +1,213 @@
|
||||
//
|
||||
// QXLevelViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXLevelViewController.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
static void *WKWebBrowserContext = &WKWebBrowserContext;
|
||||
@interface QXLevelViewController ()<WKScriptMessageHandler>
|
||||
@property(nonatomic,strong)WKWebView *contentWebView;
|
||||
@property(nonatomic,strong)UIProgressView *progressView;
|
||||
@end
|
||||
|
||||
@implementation QXLevelViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[self.view addSubview:self.contentWebView];
|
||||
[self.view addSubview:self.progressView];
|
||||
|
||||
[self layoutConstraints];
|
||||
[self loadData];
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
}
|
||||
//-(void)setNavgationItems{
|
||||
// [super setNavgationItems];
|
||||
// self.navigationItem.title = @"段位";
|
||||
//}
|
||||
|
||||
- (void)layoutConstraints {
|
||||
[self.contentWebView setFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
|
||||
[self.progressView setFrame:CGRectMake(0, 0, SCREEN_WIDTH
|
||||
, 2)];
|
||||
}
|
||||
- (void)loadData {
|
||||
NSInteger safeTop = kSafeAreaTop;
|
||||
NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/other/grade?id=%@&type=%d&h=%ld",H5ServerUrl,[QXGlobal shareGlobal].loginModel.token,0,safeTop]];
|
||||
NSURLRequest *request =[NSURLRequest requestWithURL:url];
|
||||
[self.contentWebView loadRequest:request];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - WKNavigationDelegate
|
||||
//开始加载
|
||||
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|
||||
//开始加载的时候,让加载进度条显示
|
||||
self.progressView.hidden = NO;
|
||||
}
|
||||
|
||||
//网页加载完成
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
|
||||
// 获取加载网页的标题
|
||||
// if (self.title.length == 0) {
|
||||
// self.navigationItem.title = self.contentWebView.title;
|
||||
// }
|
||||
// if ([self.titleString containsString:@"转账"]) {
|
||||
// // 设置字体
|
||||
// NSString *fontFamilyStr = @"document.getElementsByTagName('body')[0].style.fontFamily='Arial';";
|
||||
// [webView evaluateJavaScript:fontFamilyStr completionHandler:nil];
|
||||
// //设置颜色
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= '#333333'" completionHandler:nil];
|
||||
// //修改字体大小
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '150%'"completionHandler:nil];
|
||||
// }
|
||||
}
|
||||
//内容返回时调用
|
||||
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
//服务器请求跳转的时候调用
|
||||
- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
// 内容加载失败时候调用
|
||||
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error{
|
||||
|
||||
}
|
||||
-(void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
|
||||
NSLog(@"message.name====%@ body=%@",message.name,message.body);
|
||||
if([message.name isEqualToString:@"nativeHandler"]){
|
||||
NSDictionary *dict = message.body;
|
||||
if ([dict[@"action"] isEqualToString:@"closeWeb"]) {
|
||||
if (self.contentWebView.canGoBack) {
|
||||
[self.contentWebView goBack];
|
||||
}else{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
||||
//如果是跳转一个新页面
|
||||
if (navigationAction.targetFrame == nil) {
|
||||
[webView loadRequest:navigationAction.request];
|
||||
}
|
||||
NSURL *URL = navigationAction.request.URL;
|
||||
[self dealSomeThing:URL];
|
||||
decisionHandler(WKNavigationActionPolicyAllow);
|
||||
}
|
||||
|
||||
- (void)dealSomeThing:(NSURL *)url{
|
||||
NSString *scheme = [url scheme];
|
||||
NSString *resourceSpecifier = [url resourceSpecifier];
|
||||
if ([scheme isEqualToString:@"tel"]) {
|
||||
NSString *callPhone = [NSString stringWithFormat:@"tel://%@", resourceSpecifier];
|
||||
/// 防止iOS 10及其之后,拨打电话系统弹出框延迟出现
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//进度条
|
||||
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView {
|
||||
}
|
||||
|
||||
//KVO监听进度条
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
|
||||
if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.contentWebView) {
|
||||
[self.progressView setAlpha:1.0f];
|
||||
BOOL animated = self.contentWebView.estimatedProgress > self.progressView.progress;
|
||||
[self.progressView setProgress:self.contentWebView.estimatedProgress animated:animated];
|
||||
|
||||
// Once complete, fade out UIProgressView
|
||||
if(self.contentWebView.estimatedProgress >= 1.0f) {
|
||||
[UIView animateWithDuration:0.3f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
|
||||
[self.progressView setAlpha:0.0f];
|
||||
} completion:^(BOOL finished) {
|
||||
[self.progressView setProgress:0.0f animated:NO];
|
||||
}];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
- (WKWebView *)contentWebView {
|
||||
if (!_contentWebView) {
|
||||
//设置网页的配置文件
|
||||
WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];
|
||||
// 允许可以与网页交互,选择视图
|
||||
configuration.selectionGranularity = YES;
|
||||
// web内容处理池pr
|
||||
configuration.processPool = [[WKProcessPool alloc] init];
|
||||
//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
|
||||
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
|
||||
// 是否支持记忆读取
|
||||
configuration.suppressesIncrementalRendering = NO;
|
||||
// 允许用户更改网页的设置
|
||||
[UserContentController addScriptMessageHandler:self name:@"nativeHandler"];
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.userContentController = UserContentController;
|
||||
// 此处一定要做判断,因为是iOS9之后才有的方法,否则在iOS8下会崩溃
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
|
||||
//允许视频播放
|
||||
configuration.allowsAirPlayForMediaPlayback = YES;
|
||||
// 允许在线播放
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
//开启手势触摸 默认设置就是NO。在ios8系统中会导致手势问题,程序崩溃
|
||||
_contentWebView.allowsBackForwardNavigationGestures = YES;
|
||||
}
|
||||
_contentWebView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration];
|
||||
_contentWebView.backgroundColor = [UIColor clearColor];
|
||||
_contentWebView.opaque = YES;
|
||||
//适应你设定的尺寸
|
||||
[_contentWebView sizeToFit];
|
||||
_contentWebView.scrollView.showsVerticalScrollIndicator = NO;
|
||||
// 设置代理
|
||||
_contentWebView.navigationDelegate = self;
|
||||
//kvo 添加进度监控
|
||||
[_contentWebView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:WKWebBrowserContext];
|
||||
}
|
||||
return _contentWebView;
|
||||
}
|
||||
|
||||
- (UIProgressView *)progressView {
|
||||
if (!_progressView) {
|
||||
_progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
|
||||
[_progressView setTrackTintColor:[UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0]];
|
||||
_progressView.progressTintColor = QXConfig.themeColor;
|
||||
}
|
||||
return _progressView;
|
||||
}
|
||||
|
||||
-(void)setProgressColor:(UIColor *)progressColor{
|
||||
_progressView.progressTintColor = progressColor;
|
||||
}
|
||||
// 记得dealloc
|
||||
- (void)dealloc {
|
||||
if (self) {
|
||||
[self.contentWebView removeObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress))];
|
||||
}
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/每日任务/QXTaskGiftRecordVC.h
Normal file
16
QXLive/Mine(音域)/Controller/每日任务/QXTaskGiftRecordVC.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXTaskGiftRecordVC.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/11.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXTaskGiftRecordVC : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
127
QXLive/Mine(音域)/Controller/每日任务/QXTaskGiftRecordVC.m
Normal file
127
QXLive/Mine(音域)/Controller/每日任务/QXTaskGiftRecordVC.m
Normal file
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// QXTaskGiftRecordVC.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/11.
|
||||
//
|
||||
|
||||
#import "QXTaskGiftRecordVC.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXTaskGiftRecordCell.h"
|
||||
|
||||
@interface QXTaskGiftRecordVC ()<UITableViewDataSource,UITableViewDelegate>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)UIView *headerView;
|
||||
@end
|
||||
|
||||
@implementation QXTaskGiftRecordVC
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
self.navigationItem.title = @"礼盒";
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.view addSubview:self.headerView];
|
||||
self.page = 1;
|
||||
[self getHistorySubsidy];
|
||||
}
|
||||
-(void)getHistorySubsidy{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork dayTaskGiftBoxRecordSuccessBlock:^(NSArray<QXTaskGiftBoxRecordModel *> * _Nonnull list) {
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
if (list.count == 0) {
|
||||
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[weakSelf.tableView reloadData];
|
||||
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
showToast(msg)
|
||||
}];
|
||||
}
|
||||
- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXTaskGiftRecordCell *cell = [QXTaskGiftRecordCell cellWithTableView:tableView];
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
//-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
// return self.headerView;
|
||||
//}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
return 44;
|
||||
}
|
||||
//-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
// return 44;
|
||||
//}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.headerView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.headerView.bottom) style:(UITableViewStylePlain)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor whiteColor];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
_tableView.sectionHeaderTopPadding = 0;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getHistorySubsidy];
|
||||
}];
|
||||
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getHistorySubsidy];
|
||||
}];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
-(UIView *)headerView{
|
||||
if (!_headerView) {
|
||||
_headerView = [[UIView alloc] initWithFrame:CGRectMake(0,NavContentHeight+18 , SCREEN_WIDTH, 44)];
|
||||
[_headerView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
|
||||
_headerView.backgroundColor = [UIColor whiteColor];
|
||||
UILabel *timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, 145, 44)];
|
||||
timeLabel.text = @"时间";
|
||||
timeLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
timeLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
timeLabel.textAlignment = NSTextAlignmentLeft;
|
||||
[_headerView addSubview:timeLabel];
|
||||
|
||||
UILabel *statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(timeLabel.right+15, 0, 75, 44)];
|
||||
statusLabel.text = @"礼盒名称";
|
||||
statusLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
statusLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
statusLabel.textAlignment = NSTextAlignmentLeft;
|
||||
[_headerView addSubview:statusLabel];
|
||||
|
||||
UILabel *subsidyLabel = [[UILabel alloc] initWithFrame:CGRectMake(statusLabel.right+15, 0, SCREEN_WIDTH-statusLabel.right-15-16, 44)];
|
||||
subsidyLabel.text = @"获取";
|
||||
subsidyLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
subsidyLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
subsidyLabel.textAlignment = NSTextAlignmentLeft;
|
||||
[_headerView addSubview:subsidyLabel];
|
||||
|
||||
// UILabel *allWaterLabel = [[UILabel alloc] initWithFrame:CGRectMake(timeLabel.right+10, 0, subsidyLabel.left-20-timeLabel.right, 44)];
|
||||
// allWaterLabel.text = @"累计流水";
|
||||
// allWaterLabel.textColor = [UIColor colorWithHexString:@"#333333"];
|
||||
// allWaterLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
// allWaterLabel.textAlignment = NSTextAlignmentCenter;
|
||||
// [_headerView addSubview:allWaterLabel];
|
||||
}
|
||||
return _headerView;
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXTaskViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXTaskViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
150
QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m
Normal file
150
QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m
Normal file
@@ -0,0 +1,150 @@
|
||||
//
|
||||
// QXTaskViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXTaskViewController.h"
|
||||
#import "QXDayTaskTopView.h"
|
||||
#import "QXDayTaskCell.h"
|
||||
#import "QXDayTaskRuleView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXTaskGiftRecordVC.h"
|
||||
|
||||
@interface QXTaskViewController ()<UITableViewDataSource,UITableViewDelegate>
|
||||
@property (nonatomic,strong)QXDayTaskTopView *topView;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)QXDayTaskModel *model;
|
||||
@end
|
||||
|
||||
@implementation QXTaskViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
[self getDayTask];
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"每日任务");
|
||||
UIButton*recordBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
|
||||
[recordBtn setTitle:QXText(@"礼盒记录") forState:(UIControlStateNormal)];
|
||||
[recordBtn setTitleColor:RGB16(0xFF8ACC) forState:(UIControlStateNormal)];
|
||||
recordBtn.titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
[recordBtn addTarget:self action:@selector(recordAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:recordBtn];
|
||||
}
|
||||
- (void)initSubViews{
|
||||
self.bgImageHidden = YES;
|
||||
self.view.backgroundColor = RGB16(0xF8E3C8);
|
||||
self.tableView.tableHeaderView = self.topView;
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
|
||||
-(void)getDayTask{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getDayTaskListSuccessBlock:^(QXDayTaskModel * _Nonnull model) {
|
||||
weakSelf.model = model;
|
||||
weakSelf.topView.model = model;
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)recordAction{
|
||||
QXTaskGiftRecordVC *vc = [[QXTaskGiftRecordVC alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(QXDayTaskTopView *)topView{
|
||||
if (!_topView) {
|
||||
_topView = [[QXDayTaskTopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-32, ScaleWidth(285)+12)];
|
||||
}
|
||||
return _topView;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDataSource,UITableViewDelegate
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
if (self.model == nil) {
|
||||
return 0;
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
if (section == 0) {
|
||||
return self.model.tasks.daily_tasks.count;
|
||||
}else if(section == 1){
|
||||
return self.model.tasks.daily_tasks_special.count;
|
||||
}else{
|
||||
return self.model.tasks.usual_tasks.count;
|
||||
}
|
||||
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXDayTaskCell *cell = [QXDayTaskCell cellWithTableView:tableView];
|
||||
QXDayTaskListModel *model;
|
||||
if (indexPath.section == 0) {
|
||||
model = self.model.tasks.daily_tasks[indexPath.row];
|
||||
}else if(indexPath.section == 1){
|
||||
model = self.model.tasks.daily_tasks_special[indexPath.row];
|
||||
}else{
|
||||
model = self.model.tasks.usual_tasks[indexPath.row];
|
||||
}
|
||||
cell.model = model;
|
||||
return cell;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-32, 35)];
|
||||
header.backgroundColor = [UIColor whiteColor];
|
||||
[header addRoundedCornersWithRadius:17.5 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
|
||||
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 12, SCREEN_WIDTH-32*2, 23)];
|
||||
titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
titleLabel.textColor = QXConfig.textColor;
|
||||
if (section == 0) {
|
||||
titleLabel.text = QXText(@"每日任务");
|
||||
}else if(section == 1){
|
||||
titleLabel.text = QXText(@"特殊任务");
|
||||
}else{
|
||||
titleLabel.text = QXText(@"平台任务");
|
||||
}
|
||||
[header addSubview:titleLabel];
|
||||
return header;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
return 35;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
||||
UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-32, 35)];
|
||||
footer.backgroundColor = [UIColor clearColor];
|
||||
UIView *roundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-32, 25)];
|
||||
roundView.backgroundColor = [UIColor whiteColor];
|
||||
[roundView addRoundedCornersWithRadius:17.5 byRoundingCorners:(UIRectCornerBottomLeft|UIRectCornerBottomRight)];
|
||||
[footer addSubview:roundView];
|
||||
return footer;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 35;
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(16, NavContentHeight, SCREEN_WIDTH-32, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStyleGrouped)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.rowHeight = 60;
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
_tableView.sectionHeaderTopPadding = 0;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXChangeIntroduceViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/21.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXChangeIntroduceViewController : QXBaseViewController
|
||||
@property (nonatomic,strong)NSString*introduce;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
136
QXLive/Mine(音域)/Controller/编辑/QXChangeIntroduceViewController.m
Normal file
136
QXLive/Mine(音域)/Controller/编辑/QXChangeIntroduceViewController.m
Normal file
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// QXChangeIntroduceViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/21.
|
||||
//
|
||||
|
||||
#import "QXChangeIntroduceViewController.h"
|
||||
#import "QXTextView.h"
|
||||
#import "QXSearchCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXChangeIntroduceViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
@property (nonatomic,strong)QXTextView *textView;
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@property (nonatomic,strong)NSString *tag_id;
|
||||
@end
|
||||
|
||||
@implementation QXChangeIntroduceViewController
|
||||
|
||||
- (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(@"修改简介");
|
||||
UIButton *btn = [[UIButton alloc] init];
|
||||
[btn setTitle:QXText(@"保存") forState:(UIControlStateNormal)];
|
||||
btn.titleLabel.font = [UIFont systemFontOfSize:14.f];
|
||||
[btn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
|
||||
[btn addTarget:self action:@selector(saveAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
|
||||
}
|
||||
- (void)initSubViews{
|
||||
self.tag_id = @"";
|
||||
self.textView = [[QXTextView alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 180)];
|
||||
if (self.introduce.length > 0) {
|
||||
self.textView.placehoulder = QXText(@"介绍喜好、个性,让大家认识你");
|
||||
self.textView.text = self.introduce;
|
||||
}else{
|
||||
self.textView.placehoulder = QXText(@"介绍喜好、个性,让大家认识你");
|
||||
}
|
||||
[self.textView becomeFirstResponder];
|
||||
self.textView.backgroundColor = UIColor.whiteColor;
|
||||
[self.textView addRoundedCornersWithRadius:7];
|
||||
self.textView.font = [UIFont systemFontOfSize:13];
|
||||
[self.view addSubview:self.textView];
|
||||
[self.view addSubview:self.collectionView];
|
||||
}
|
||||
-(void)getData{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getUserTagListSuccessBlock:^(NSArray<QXUserTag *> * _Nonnull users) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.dataArray addObjectsFromArray:users];
|
||||
[weakSelf.collectionView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
- (void)saveAction{
|
||||
[self.view endEditing:YES];
|
||||
NSString *introduce = self.textView.text;
|
||||
QXLOG(@"修改简介%@",introduce);
|
||||
MJWeakSelf
|
||||
[QXMineNetwork editUserInfoWithNickname:@""
|
||||
birthday:@""
|
||||
sex:@""
|
||||
avatar:@""
|
||||
images:@""
|
||||
profile:introduce
|
||||
tag_id:self.tag_id
|
||||
successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
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{
|
||||
QXSearchCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:[QXSearchCell cellIdentifier] forIndexPath:indexPath];
|
||||
cell.cellType = QXSearchCellTypeChangeIntroduce;
|
||||
cell.userTag = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXUserTag *model = self.dataArray[indexPath.row];
|
||||
model.isSelected = !model.isSelected;
|
||||
if (model.isSelected) {
|
||||
if (self.tag_id.length == 0) {
|
||||
self.tag_id = model.id;
|
||||
}else{
|
||||
self.tag_id = [self.tag_id stringByAppendingFormat:@",%@",model.id];
|
||||
}
|
||||
}
|
||||
[collectionView reloadData];
|
||||
}
|
||||
-(UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
|
||||
flowLayout.minimumLineSpacing = 12;
|
||||
flowLayout.minimumInteritemSpacing = 12;
|
||||
flowLayout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
|
||||
flowLayout.itemSize = CGSizeMake((SCREEN_WIDTH-16*2-12*3)/4, 22);
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.textView.bottom+12, SCREEN_WIDTH, SCREEN_HEIGHT-self.textView.bottom-12) collectionViewLayout:flowLayout];
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[QXSearchCell class] forCellWithReuseIdentifier:[QXSearchCell cellIdentifier]];
|
||||
_collectionView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
/*
|
||||
#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
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXChangeNickViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/21.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXChangeNicknameViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// QXChangeNickViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/21.
|
||||
//
|
||||
|
||||
#import "QXChangeNicknameViewController.h"
|
||||
#import <ImSDK_Plus/ImSDK_Plus.h>
|
||||
#import "QXMineNetwork.h"
|
||||
@interface QXChangeNicknameViewController ()
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UITextField *textField;
|
||||
@property (nonatomic,strong)UIButton *deleteBtn;
|
||||
@end
|
||||
|
||||
@implementation QXChangeNicknameViewController
|
||||
|
||||
- (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(@"修改昵称");
|
||||
UIButton *btn = [[UIButton alloc] init];
|
||||
[btn setTitle:QXText(@"保存") forState:(UIControlStateNormal)];
|
||||
btn.titleLabel.font = [UIFont systemFontOfSize:14.f];
|
||||
[btn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
|
||||
[btn addTarget:self action:@selector(saveAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44)];
|
||||
self.bgView.backgroundColor = [UIColor whiteColor];
|
||||
[self.bgView addRoundedCornersWithRadius:7];
|
||||
[self.view addSubview:self.bgView];
|
||||
|
||||
self.textField = [[UITextField alloc] initWithFrame:CGRectMake(12, 0, self.bgView.width-24-44, 44)];
|
||||
self.textField.placeholder = QXText(@"请输入昵称");
|
||||
self.textField.font = [UIFont systemFontOfSize:14];
|
||||
self.textField.textColor = QXConfig.textColor;
|
||||
[self.bgView addSubview:self.textField];
|
||||
|
||||
self.deleteBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.bgView.width-44, 0, 44, 44)];
|
||||
[self.deleteBtn setImage:[UIImage imageNamed:@"Plus Circle"] forState:(UIControlStateNormal)];
|
||||
[self.deleteBtn addTarget:self action:@selector(deleteAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.bgView addSubview:self.deleteBtn];
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
-(void)deleteAction{
|
||||
self.textField.text = @"";
|
||||
}
|
||||
-(void)saveAction{
|
||||
[self.view endEditing:YES];
|
||||
__block NSString *nickName = self.textField.text;
|
||||
__block NSString *avatar = [QXGlobal shareGlobal].loginModel.avatar;
|
||||
QXLOG(@"修改昵称%@",nickName);
|
||||
MJWeakSelf
|
||||
[QXMineNetwork editUserInfoWithNickname:nickName
|
||||
birthday:@""
|
||||
sex:@""
|
||||
avatar:@""
|
||||
images:@""
|
||||
profile:@""
|
||||
tag_id:@""
|
||||
successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
/// 更新存储信息
|
||||
[QXGlobal shareGlobal].loginModel.nickname = nickName;
|
||||
[[QXGlobal shareGlobal] updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
|
||||
|
||||
/// 同步修改腾讯个人信息
|
||||
V2TIMUserFullInfo *info = [[V2TIMUserFullInfo alloc] init];
|
||||
info.faceURL = avatar;
|
||||
info.nickName = nickName;
|
||||
[[V2TIMManager sharedInstance] setSelfInfo:info succ:^{
|
||||
QXLOG(@"腾讯IM同步个人信息成功");
|
||||
} fail:^(int code, NSString * _Nullable desc) {
|
||||
QXLOG(@"腾讯IM同步个人信息失败");
|
||||
}];
|
||||
showToast(QXText(@"修改成功"));
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/编辑/QXUserInfoEidtViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/编辑/QXUserInfoEidtViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXUserInfoEidtViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXUserInfoEidtViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
252
QXLive/Mine(音域)/Controller/编辑/QXUserInfoEidtViewController.m
Normal file
252
QXLive/Mine(音域)/Controller/编辑/QXUserInfoEidtViewController.m
Normal file
@@ -0,0 +1,252 @@
|
||||
//
|
||||
// QXUserInfoEidtViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXUserInfoEidtViewController.h"
|
||||
#import "QXUserInfoEditCell.h"
|
||||
#import "QXUserInfoEditFooterView.h"
|
||||
#import "QXUserInfoEditHeaderView.h"
|
||||
#import "QXChangeNicknameViewController.h"
|
||||
#import "QXChangeIntroduceViewController.h"
|
||||
#import "BRDatePickerView.h"
|
||||
#import "BRTextPickerView.h"
|
||||
#import "NSDate+BRPickerView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXUserInfoEidtViewController ()<UITableViewDelegate,UITableViewDataSource,QXUserInfoEditHeaderViewDelegate,QXUserInfoImageCellDelegate>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)QXUserInfoEditFooterView *tableFooterView;
|
||||
@property (nonatomic,strong)QXUserInfoEditHeaderView *tableHeaderView;
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)NSMutableDictionary *valueDict;
|
||||
@property (nonatomic,strong)UILabel* titleLabel;
|
||||
@property (nonatomic,strong)UIButton* backBtn;
|
||||
@property (nonatomic,strong)NSMutableArray* imgsArray;
|
||||
@property (nonatomic,strong)QXUserHomeModel * userModel;
|
||||
@end
|
||||
|
||||
@implementation QXUserInfoEidtViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
[self getUserInfo];
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
|
||||
// [self.view addSubview:self.bgView];
|
||||
self.dataArray = [NSMutableArray arrayWithArray:@[
|
||||
QXText(@"昵称"),QXText(@"性别"),QXText(@"出生日期"),QXText(@"简介")
|
||||
]];
|
||||
self.valueDict = [NSMutableDictionary dictionaryWithDictionary:@{
|
||||
QXText(@"昵称"):[QXGlobal shareGlobal].loginModel.nickname?[QXGlobal shareGlobal].loginModel.nickname:@"",
|
||||
QXText(@"性别"):[QXGlobal shareGlobal].loginModel.sex.integerValue== 1?QXText(@"男"):QXText(@"女"),
|
||||
QXText(@"出生日期"):[QXGlobal shareGlobal].loginModel.birthday?[QXGlobal shareGlobal].loginModel.birthday:@"",
|
||||
QXText(@"简介"):[QXGlobal shareGlobal].loginModel.profile?[QXGlobal shareGlobal].loginModel.profile:@"",
|
||||
}];
|
||||
self.tableView.tableHeaderView = self.tableHeaderView;
|
||||
self.tableView.tableFooterView = self.tableFooterView;
|
||||
[self.view addSubview:self.tableView];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, kSafeAreaTop, SCREEN_WIDTH-140, 40)];
|
||||
self.titleLabel.text = QXText(@"编辑资料");
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
|
||||
self.titleLabel.textColor = RGB16(0x333333);
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self.view addSubview:self.titleLabel];
|
||||
|
||||
self.backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kSafeAreaTop, 40, 40)];
|
||||
[self.backBtn setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
|
||||
[self.backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.backBtn];
|
||||
}
|
||||
|
||||
-(void)getUserInfo{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork userHomePageWithUserId:[QXGlobal shareGlobal].loginModel.user_id successBlock:^(QXUserHomeModel * _Nonnull userModel) {
|
||||
weakSelf.userModel = userModel;
|
||||
weakSelf.valueDict = [NSMutableDictionary dictionaryWithDictionary:@{
|
||||
QXText(@"昵称"):userModel.nickname?userModel.nickname:@"",
|
||||
QXText(@"性别"):userModel.sex.integerValue== 1?QXText(@"男"):QXText(@"女"),
|
||||
QXText(@"出生日期"):userModel.birthday?userModel.birthday:@"",
|
||||
QXText(@"简介"):userModel.profile?userModel.profile:@"",
|
||||
}];
|
||||
NSArray *imgs;
|
||||
if (userModel.home_bgimages.length > 0) {
|
||||
imgs = [userModel.home_bgimages componentsSeparatedByString:@","];
|
||||
}
|
||||
[weakSelf.imgsArray removeAllObjects];
|
||||
if (imgs != nil) {
|
||||
[weakSelf.imgsArray addObjectsFromArray:imgs];
|
||||
}
|
||||
weakSelf.tableHeaderView.imgs = weakSelf.imgsArray;
|
||||
weakSelf.tableFooterView.imgs = weakSelf.imgsArray;
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate,UITableViewDataSource
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXUserInfoEditCell *cell = [QXUserInfoEditCell cellWithTableView:tableView];
|
||||
NSString *title = self.dataArray[indexPath.row];
|
||||
cell.titleLabel.text = title;
|
||||
cell.textField.text = self.valueDict[title];
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
NSString *title = self.dataArray[indexPath.row];
|
||||
if ([title isEqualToString:QXText(@"昵称")]) {
|
||||
QXChangeNicknameViewController *vc = [[QXChangeNicknameViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else if ([title isEqualToString:QXText(@"简介")]){
|
||||
QXChangeIntroduceViewController *vc= [[QXChangeIntroduceViewController alloc] init];
|
||||
vc.introduce = self.userModel.profile;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else if ([title isEqualToString:QXText(@"出生日期")]){
|
||||
BRDatePickerView *piker = [[BRDatePickerView alloc] initWithPickerMode:(BRDatePickerModeYMD)];
|
||||
NSDate *minDate = [NSDate br_setYear:1900 month:1 day:1];
|
||||
piker.minDate = minDate;
|
||||
piker.maxDate = [NSDate date];
|
||||
piker.selectValue = [QXGlobal shareGlobal].loginModel.birthday;
|
||||
piker.isAutoSelect = NO;
|
||||
MJWeakSelf
|
||||
piker.resultBlock = ^(NSDate * _Nullable selectDate, NSString * _Nullable selectValue) {
|
||||
[weakSelf editBirthday:selectValue];
|
||||
};
|
||||
[piker show];
|
||||
}else if ([title isEqualToString:QXText(@"性别")]){
|
||||
MJWeakSelf
|
||||
// BRTextPickerView *piker = [[BRTextPickerView alloc] initWithPickerMode:BRTextPickerComponentSingle];
|
||||
// piker.dataSourceArr = @[QXText(@"男"),QXText(@"女")];
|
||||
// piker.singleResultBlock = ^(BRTextModel * _Nullable model, NSInteger index) {
|
||||
// if (index == 1) {
|
||||
// [weakSelf editSex:@"2"];
|
||||
// }else{
|
||||
// [weakSelf editSex:@"1"];
|
||||
// }
|
||||
// };
|
||||
// [piker show];
|
||||
}
|
||||
}
|
||||
-(void)didClickDelete:(NSString *)imageUrl index:(NSInteger)index{
|
||||
[self.imgsArray removeObjectAtIndex:index];
|
||||
[self uploadImageWithUlrList:self.imgsArray];
|
||||
}
|
||||
-(void)didUploadFinishedWithImageUrlList:(NSArray *)urlList{
|
||||
[self.imgsArray addObjectsFromArray:urlList];
|
||||
[self uploadImageWithUlrList:self.imgsArray];
|
||||
}
|
||||
|
||||
-(void)uploadImageWithUlrList:(NSArray*)urlList{
|
||||
MJWeakSelf
|
||||
NSString *images = @"";
|
||||
if (urlList.count > 0) {
|
||||
images = [urlList componentsJoinedByString:@","];
|
||||
}
|
||||
[QXMineNetwork editUserHomeBgWithImages:images successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[weakSelf getUserInfo];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)editBirthday:(NSString*)birthday{
|
||||
MJWeakSelf
|
||||
__block NSString *saveBirthday = birthday;
|
||||
[QXMineNetwork editUserInfoWithNickname:@""
|
||||
birthday:birthday
|
||||
sex:@""
|
||||
avatar:@""
|
||||
images:@""
|
||||
profile:@""
|
||||
tag_id:@""
|
||||
successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
showToast(QXText(@"修改成功"));
|
||||
[weakSelf getUserInfo];
|
||||
[QXGlobal shareGlobal].loginModel.birthday = saveBirthday;
|
||||
[[QXGlobal shareGlobal] updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
|
||||
[weakSelf.valueDict setObject:saveBirthday forKey:QXText(@"出生日期")];
|
||||
[weakSelf.tableView reloadRow:2 inSection:0 withRowAnimation:(UITableViewRowAnimationAutomatic)];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)editSex:(NSString*)sex{
|
||||
MJWeakSelf
|
||||
__block NSString *saveSex = sex;
|
||||
[QXMineNetwork editUserInfoWithNickname:@""
|
||||
birthday:@""
|
||||
sex:sex
|
||||
avatar:@""
|
||||
images:@""
|
||||
profile:@""
|
||||
tag_id:@""
|
||||
successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
showToast(QXText(@"修改成功"));
|
||||
[weakSelf getUserInfo];
|
||||
[QXGlobal shareGlobal].loginModel.sex = saveSex;
|
||||
[[QXGlobal shareGlobal] updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
|
||||
[weakSelf.valueDict setObject:saveSex.integerValue== 1?QXText(@"男"):QXText(@"女") forKey:QXText(@"性别")];
|
||||
[weakSelf.tableView reloadRow:1 inSection:0 withRowAnimation:(UITableViewRowAnimationAutomatic)];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) style:UITableViewStylePlain];
|
||||
self.tableView.backgroundColor = [UIColor whiteColor];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
self.tableView.rowHeight = 48;
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
-(UIView *)bgView{
|
||||
if (!_bgView) {
|
||||
_bgView = [[UIView alloc] initWithFrame:CGRectMake(0, self.tableHeaderView.height, SCREEN_WIDTH,SCREEN_HEIGHT-self.tableHeaderView.height )];
|
||||
_bgView.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
-(QXUserInfoEditHeaderView *)tableHeaderView{
|
||||
if (!_tableHeaderView) {
|
||||
_tableHeaderView = [[QXUserInfoEditHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 263+kSafeAreaTop)];
|
||||
}
|
||||
return _tableHeaderView;
|
||||
}
|
||||
-(QXUserInfoEditFooterView *)tableFooterView{
|
||||
if (!_tableFooterView) {
|
||||
CGFloat itemWidth = (SCREEN_WIDTH-16*2-20*2)/3;
|
||||
_tableFooterView = [[QXUserInfoEditFooterView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, itemWidth*2+20+40)];
|
||||
_tableFooterView.delegate = self;
|
||||
}
|
||||
return _tableFooterView;
|
||||
}
|
||||
-(NSMutableArray *)imgsArray{
|
||||
if (!_imgsArray) {
|
||||
_imgsArray = [NSMutableArray array];
|
||||
}
|
||||
return _imgsArray;
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/设置/QXAboutViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/设置/QXAboutViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXAboutViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXAboutViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
214
QXLive/Mine(音域)/Controller/设置/QXAboutViewController.m
Normal file
214
QXLive/Mine(音域)/Controller/设置/QXAboutViewController.m
Normal file
@@ -0,0 +1,214 @@
|
||||
//
|
||||
// QXLevelViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXAboutViewController.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
static void *WKWebBrowserContext = &WKWebBrowserContext;
|
||||
@interface QXAboutViewController ()<WKScriptMessageHandler>
|
||||
@property(nonatomic,strong)WKWebView *contentWebView;
|
||||
@property(nonatomic,strong)UIProgressView *progressView;
|
||||
@end
|
||||
|
||||
@implementation QXAboutViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[self.view addSubview:self.contentWebView];
|
||||
[self.view addSubview:self.progressView];
|
||||
|
||||
[self layoutConstraints];
|
||||
[self loadData];
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
}
|
||||
//-(void)setNavgationItems{
|
||||
// [super setNavgationItems];
|
||||
// self.navigationItem.title = @"段位";
|
||||
//}
|
||||
|
||||
- (void)layoutConstraints {
|
||||
[self.contentWebView setFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
|
||||
[self.progressView setFrame:CGRectMake(0, 0, SCREEN_WIDTH
|
||||
, 2)];
|
||||
}
|
||||
- (void)loadData {
|
||||
// H5ServerUrl
|
||||
NSString *urlStr = [NSString stringWithFormat:@"%@web/index.html#/pages/other/aboutUs",H5ServerUrl];
|
||||
NSURL* url=[NSURL URLWithString:urlStr];
|
||||
NSURLRequest *request =[NSURLRequest requestWithURL:url];
|
||||
[self.contentWebView loadRequest:request];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - WKNavigationDelegate
|
||||
//开始加载
|
||||
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|
||||
//开始加载的时候,让加载进度条显示
|
||||
self.progressView.hidden = NO;
|
||||
}
|
||||
|
||||
//网页加载完成
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
|
||||
// 获取加载网页的标题
|
||||
// if (self.title.length == 0) {
|
||||
// self.navigationItem.title = self.contentWebView.title;
|
||||
// }
|
||||
// if ([self.titleString containsString:@"转账"]) {
|
||||
// // 设置字体
|
||||
// NSString *fontFamilyStr = @"document.getElementsByTagName('body')[0].style.fontFamily='Arial';";
|
||||
// [webView evaluateJavaScript:fontFamilyStr completionHandler:nil];
|
||||
// //设置颜色
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= '#333333'" completionHandler:nil];
|
||||
// //修改字体大小
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '150%'"completionHandler:nil];
|
||||
// }
|
||||
}
|
||||
//内容返回时调用
|
||||
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
//服务器请求跳转的时候调用
|
||||
- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
// 内容加载失败时候调用
|
||||
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error{
|
||||
|
||||
}
|
||||
-(void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
|
||||
NSLog(@"message.name====%@ body=%@",message.name,message.body);
|
||||
if([message.name isEqualToString:@"nativeHandler"]){
|
||||
NSDictionary *dict = message.body;
|
||||
if ([dict[@"action"] isEqualToString:@"closeWeb"]) {
|
||||
if (self.contentWebView.canGoBack) {
|
||||
[self.contentWebView goBack];
|
||||
}else{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
||||
//如果是跳转一个新页面
|
||||
if (navigationAction.targetFrame == nil) {
|
||||
[webView loadRequest:navigationAction.request];
|
||||
}
|
||||
NSURL *URL = navigationAction.request.URL;
|
||||
[self dealSomeThing:URL];
|
||||
decisionHandler(WKNavigationActionPolicyAllow);
|
||||
}
|
||||
|
||||
- (void)dealSomeThing:(NSURL *)url{
|
||||
NSString *scheme = [url scheme];
|
||||
NSString *resourceSpecifier = [url resourceSpecifier];
|
||||
if ([scheme isEqualToString:@"tel"]) {
|
||||
NSString *callPhone = [NSString stringWithFormat:@"tel://%@", resourceSpecifier];
|
||||
/// 防止iOS 10及其之后,拨打电话系统弹出框延迟出现
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//进度条
|
||||
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView {
|
||||
}
|
||||
|
||||
//KVO监听进度条
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
|
||||
if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.contentWebView) {
|
||||
[self.progressView setAlpha:1.0f];
|
||||
BOOL animated = self.contentWebView.estimatedProgress > self.progressView.progress;
|
||||
[self.progressView setProgress:self.contentWebView.estimatedProgress animated:animated];
|
||||
|
||||
// Once complete, fade out UIProgressView
|
||||
if(self.contentWebView.estimatedProgress >= 1.0f) {
|
||||
[UIView animateWithDuration:0.3f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
|
||||
[self.progressView setAlpha:0.0f];
|
||||
} completion:^(BOOL finished) {
|
||||
[self.progressView setProgress:0.0f animated:NO];
|
||||
}];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
- (WKWebView *)contentWebView {
|
||||
if (!_contentWebView) {
|
||||
//设置网页的配置文件
|
||||
WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];
|
||||
// 允许可以与网页交互,选择视图
|
||||
configuration.selectionGranularity = YES;
|
||||
// web内容处理池pr
|
||||
configuration.processPool = [[WKProcessPool alloc] init];
|
||||
//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
|
||||
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
|
||||
// 是否支持记忆读取
|
||||
configuration.suppressesIncrementalRendering = NO;
|
||||
// 允许用户更改网页的设置
|
||||
[UserContentController addScriptMessageHandler:self name:@"nativeHandler"];
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.userContentController = UserContentController;
|
||||
// 此处一定要做判断,因为是iOS9之后才有的方法,否则在iOS8下会崩溃
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
|
||||
//允许视频播放
|
||||
configuration.allowsAirPlayForMediaPlayback = YES;
|
||||
// 允许在线播放
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
//开启手势触摸 默认设置就是NO。在ios8系统中会导致手势问题,程序崩溃
|
||||
_contentWebView.allowsBackForwardNavigationGestures = YES;
|
||||
}
|
||||
_contentWebView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration];
|
||||
_contentWebView.backgroundColor = [UIColor clearColor];
|
||||
_contentWebView.opaque = YES;
|
||||
//适应你设定的尺寸
|
||||
[_contentWebView sizeToFit];
|
||||
_contentWebView.scrollView.showsVerticalScrollIndicator = NO;
|
||||
// 设置代理
|
||||
_contentWebView.navigationDelegate = self;
|
||||
//kvo 添加进度监控
|
||||
[_contentWebView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:WKWebBrowserContext];
|
||||
}
|
||||
return _contentWebView;
|
||||
}
|
||||
|
||||
- (UIProgressView *)progressView {
|
||||
if (!_progressView) {
|
||||
_progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
|
||||
[_progressView setTrackTintColor:[UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0]];
|
||||
_progressView.progressTintColor = QXConfig.themeColor;
|
||||
}
|
||||
return _progressView;
|
||||
}
|
||||
|
||||
-(void)setProgressColor:(UIColor *)progressColor{
|
||||
_progressView.progressTintColor = progressColor;
|
||||
}
|
||||
// 记得dealloc
|
||||
- (void)dealloc {
|
||||
if (self) {
|
||||
[self.contentWebView removeObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress))];
|
||||
}
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/设置/QXBindMobileViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/设置/QXBindMobileViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXBindMobileViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXBindMobileViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
98
QXLive/Mine(音域)/Controller/设置/QXBindMobileViewController.m
Normal file
98
QXLive/Mine(音域)/Controller/设置/QXBindMobileViewController.m
Normal file
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// QXBindMobileViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXBindMobileViewController.h"
|
||||
#import "QXLoginTextField.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXLoginNetwork.h"
|
||||
|
||||
@interface QXBindMobileViewController ()<QXLoginTextFieldDelegate>
|
||||
@property (nonatomic,strong)QXLoginTextField *accountTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *codeTextField;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@end
|
||||
|
||||
@implementation QXBindMobileViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"手机绑定");
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.accountTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeAccount)];
|
||||
self.accountTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.accountTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.accountTextField];
|
||||
|
||||
self.codeTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.accountTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeCode)];
|
||||
self.codeTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.codeTextField addRoundedCornersWithRadius:11];
|
||||
self.codeTextField.delegate = self;
|
||||
[self.view addSubview:self.codeTextField];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.codeTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
|
||||
self.commitBtn.needEventInterval = 1;
|
||||
[self.commitBtn setTitle:QXText(@"立即绑定") forState:(UIControlStateNormal)];
|
||||
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.commitBtn addRoundedCornersWithRadius:21];
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.view addSubview:self.commitBtn];
|
||||
}
|
||||
-(void)didClickSendCode:(UIButton *)sender{
|
||||
if (self.accountTextField.textField.text.length < 11) {
|
||||
showToast(QXText(@"请输入正确的手机号码"));
|
||||
return;
|
||||
}
|
||||
GetSmscodeType type = GetSmscodeTypeFindBindMobile;
|
||||
NSString *oldMobile = [QXGlobal shareGlobal].loginModel.mobile;
|
||||
if (oldMobile.length > 0) {
|
||||
type = GetSmscodeTypeFindChangeMobile;
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork getSmscodeWithMobile:self.accountTextField.textField.text
|
||||
type:type
|
||||
successBlock:^(id _Nonnull responseObject) {
|
||||
[weakSelf.codeTextField startTimeDown];
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)commitAction{
|
||||
NSString *oldMobile = [QXGlobal shareGlobal].loginModel.mobile;
|
||||
NSString *mobile = self.accountTextField.textField.text;
|
||||
NSString *sms_code = self.codeTextField.textField.text;
|
||||
[QXMineNetwork changeMobileWithOldMobile:oldMobile
|
||||
new_mobile:mobile
|
||||
sms_code:sms_code
|
||||
successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
showToast(QXText(@"绑定成功"));
|
||||
[QXGlobal shareGlobal].loginModel.mobile = mobile;
|
||||
[[QXGlobal shareGlobal]updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
}
|
||||
/*
|
||||
#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
|
||||
17
QXLive/Mine(音域)/Controller/设置/QXBlackListlViewController.h
Normal file
17
QXLive/Mine(音域)/Controller/设置/QXBlackListlViewController.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXBlackListlViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXBlackListlViewController : QXBaseViewController
|
||||
/// 0 黑名单 1粉丝 2 关注 3访客
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
150
QXLive/Mine(音域)/Controller/设置/QXBlackListlViewController.m
Normal file
150
QXLive/Mine(音域)/Controller/设置/QXBlackListlViewController.m
Normal file
@@ -0,0 +1,150 @@
|
||||
//
|
||||
// QXBlackListlViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXBlackListlViewController.h"
|
||||
#import "QXBlackListCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXDynamicNetwork.h"
|
||||
#import "QXUserHomePageViewController.h"
|
||||
|
||||
@interface QXBlackListlViewController ()<UITableViewDelegate,UITableViewDataSource,QXBlackListCellDelegate>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@end
|
||||
|
||||
@implementation QXBlackListlViewController
|
||||
|
||||
- (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];
|
||||
if (self.type == 0) {
|
||||
self.navigationItem.title = QXText(@"黑名单");
|
||||
}else if (self.type == 1) {
|
||||
self.navigationItem.title = QXText(@"粉丝");
|
||||
}else if (self.type == 2) {
|
||||
self.navigationItem.title = QXText(@"关注");
|
||||
}else if (self.type == 3) {
|
||||
self.navigationItem.title = QXText(@"访客");
|
||||
}
|
||||
}
|
||||
|
||||
-(void)initSubViews{
|
||||
self.page = 1;
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
|
||||
-(void)getData{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork focusListWithPage:self.page
|
||||
type:self.type
|
||||
successBlock:^(NSArray<QXUserHomeModel *> * _Nonnull users) {
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:users];
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
if (users.count > 0) {
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
}else{
|
||||
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}
|
||||
[weakSelf.tableView reloadData];
|
||||
}failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
if (weakSelf.type == 3) {
|
||||
showToast(msg);
|
||||
[self performSelector:@selector(backAction) afterDelay:1];
|
||||
}
|
||||
}];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate,UITableViewDataSource
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXBlackListCell *cell = [QXBlackListCell cellWithTableView:tableView];
|
||||
if (self.type == 0) {
|
||||
cell.cellType = QXBlackListCellTypeBlack;
|
||||
}else if (self.type == 1) {
|
||||
cell.cellType = QXBlackListCellTypeFans;
|
||||
}else if (self.type == 2) {
|
||||
cell.cellType = QXBlackListCellTypeFocus;
|
||||
}else if (self.type == 3) {
|
||||
cell.cellType = QXBlackListCellTypeVisit;
|
||||
}
|
||||
cell.delegate = self;
|
||||
cell.userModel = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
|
||||
QXUserHomeModel *model = self.dataArray[indexPath.row];
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
vc.user_id = model.user_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - QXBlackListCellDelegate
|
||||
-(void)didRemoveSuccess:(QXUserHomeModel *)userModel{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork addOrRemoveBlackListIsAdd:NO userId:userModel.user_id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[weakSelf getData];
|
||||
showToast(@"移除成功");
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
-(void)didFocus:(UIButton *)sender userModel:(nonnull QXUserHomeModel *)userModel{
|
||||
[QXDynamicNetwork followWithUserId:userModel.user_id type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
sender.selected = !sender.selected;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStylePlain)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.rowHeight = 62;
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getData];
|
||||
}];
|
||||
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getData];
|
||||
}];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
/*
|
||||
#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
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXChangeAccountViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXChangeAccountViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// QXChangeAccountViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXChangeAccountViewController.h"
|
||||
|
||||
@interface QXChangeAccountViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXChangeAccountViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
/*
|
||||
#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
|
||||
16
QXLive/Mine(音域)/Controller/设置/QXChirldModeViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/设置/QXChirldModeViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXChirldModeViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXChirldModeViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
56
QXLive/Mine(音域)/Controller/设置/QXChirldModeViewController.m
Normal file
56
QXLive/Mine(音域)/Controller/设置/QXChirldModeViewController.m
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// QXChirldModeViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXChirldModeViewController.h"
|
||||
#import "QXPasswordView.h"
|
||||
@interface QXChirldModeViewController ()<QXPasswordViewDelegate>
|
||||
@property (nonatomic,strong)QXPasswordView * passwordView;
|
||||
@end
|
||||
|
||||
@implementation QXChirldModeViewController
|
||||
|
||||
- (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.passwordView = [[QXPasswordView alloc] init];
|
||||
self.passwordView.type = QXPasswordViewTypeChirldMode;
|
||||
self.passwordView.delegate = self;
|
||||
[self.view addSubview:self.passwordView];
|
||||
[self.passwordView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(NavContentHeight+80);
|
||||
make.height.mas_equalTo(190);
|
||||
make.left.right.equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)inputFinished:(NSString *)password{
|
||||
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
/*
|
||||
#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
|
||||
17
QXLive/Mine(音域)/Controller/设置/QXNoticeSwitchViewController.h
Normal file
17
QXLive/Mine(音域)/Controller/设置/QXNoticeSwitchViewController.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXNoticeSwitchViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/14.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXNoticeSwitchViewController : QXBaseViewController
|
||||
// 0 主页 1 开播提醒 2 屏蔽私信
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
138
QXLive/Mine(音域)/Controller/设置/QXNoticeSwitchViewController.m
Normal file
138
QXLive/Mine(音域)/Controller/设置/QXNoticeSwitchViewController.m
Normal file
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// QXNoticeSwitchViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/14.
|
||||
//
|
||||
|
||||
#import "QXNoticeSwitchViewController.h"
|
||||
#import "QXSettingCell.h"
|
||||
#import "QXNoticeAnchorCell.h"
|
||||
|
||||
@interface QXNoticeSwitchViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)NSDictionary *valueDict;
|
||||
@property (nonatomic,strong)NSDictionary *cellTypeDict;
|
||||
@end
|
||||
|
||||
@implementation QXNoticeSwitchViewController
|
||||
|
||||
- (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];
|
||||
if (self.type == 0) {
|
||||
self.navigationItem.title = QXText(@"消息提醒");
|
||||
}else if (self.type == 1){
|
||||
self.navigationItem.title = QXText(@"开播提醒");
|
||||
}else if (self.type == 2){
|
||||
self.navigationItem.title = QXText(@"屏蔽私信");
|
||||
}
|
||||
|
||||
}
|
||||
- (void)initSubViews{
|
||||
[self configData];
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT) style:(UITableViewStyleGrouped)];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tableView.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
-(void)configData{
|
||||
if (self.type == 0) {
|
||||
self.valueDict = @{
|
||||
QXText(@"开播提醒"):@"",
|
||||
QXText(@"屏蔽私信"):@""
|
||||
};
|
||||
self.cellTypeDict = @{
|
||||
QXText(@"开播提醒"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"屏蔽私信"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow]
|
||||
};
|
||||
[self.dataArray addObjectsFromArray:@[QXText(@"开播提醒"),QXText(@"屏蔽私信")]];
|
||||
}else if (self.type == 1){
|
||||
self.valueDict = @{
|
||||
QXText(@"直播消息提醒"):[NSNumber numberWithBool:YES],
|
||||
};
|
||||
self.cellTypeDict = @{
|
||||
QXText(@"直播消息提醒"):[NSNumber numberWithInteger:QXSettingCellTypeSwitch],
|
||||
};
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
}else if (self.type == 2){
|
||||
self.valueDict = @{
|
||||
QXText(@"屏蔽私信消息"):[NSNumber numberWithBool:YES],
|
||||
QXText(@"屏蔽非互关好友私信"):[NSNumber numberWithBool:YES]
|
||||
};
|
||||
self.cellTypeDict = @{
|
||||
QXText(@"屏蔽私信消息"):[NSNumber numberWithInteger:QXSettingCellTypeSwitch],
|
||||
QXText(@"屏蔽非互关好友私信"):[NSNumber numberWithInteger:QXSettingCellTypeSwitch]
|
||||
};
|
||||
[self.dataArray addObjectsFromArray:@[QXText(@"屏蔽私信消息"),QXText(@"屏蔽私信消息")]];
|
||||
}
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
if (self.type == 1) {
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
if (self.type == 1 && section == 0) {
|
||||
/// 直播消息
|
||||
return 1;
|
||||
}
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 1 && self.type == 1) {
|
||||
QXNoticeAnchorCell *cell = [QXNoticeAnchorCell cellWithTableView:tableView];
|
||||
return cell;
|
||||
}else{
|
||||
QXSettingCell *cell = [QXSettingCell cellWithTableView:tableView];
|
||||
NSString *title = @"";
|
||||
if (self.type != 1) {
|
||||
title = self.dataArray[indexPath.row];
|
||||
cell.needLine = (indexPath.row>=0) && (indexPath.row < self.dataArray.count-1);
|
||||
}else{
|
||||
title = QXText(@"直播消息提醒");
|
||||
cell.needLine = NO;
|
||||
}
|
||||
cell.titleLabel.text = title;
|
||||
cell.cellType = [[self.cellTypeDict objectForKey:title] integerValue];
|
||||
cell.detailLabel.text = [NSString stringWithFormat:@"%@",[self.valueDict objectForKey:title]];
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 1 && self.type == 1) {
|
||||
return 62;
|
||||
}
|
||||
return 50;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
return [UIView new];
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
if (self.type == 0) {
|
||||
return 8;
|
||||
}
|
||||
return 0.01;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (self.type == 0) {
|
||||
QXNoticeSwitchViewController *vc = [[QXNoticeSwitchViewController alloc] init];
|
||||
vc.type = indexPath.row+1;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXRealNameFinishedViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/14.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRealNameFinishedViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
178
QXLive/Mine(音域)/Controller/设置/QXRealNameFinishedViewController.m
Normal file
178
QXLive/Mine(音域)/Controller/设置/QXRealNameFinishedViewController.m
Normal file
@@ -0,0 +1,178 @@
|
||||
//
|
||||
// QXRealNameFinishedViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/14.
|
||||
//
|
||||
|
||||
#import "QXRealNameFinishedViewController.h"
|
||||
#import "QXSettingCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXRealNameFinishedViewController ()<UITableViewDataSource,UITableViewDelegate>
|
||||
@property (nonatomic,strong)UIImageView *headerImageView;
|
||||
@property (nonatomic,strong)UILabel *statusLabel;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)NSDictionary *cellTypeDict;
|
||||
@property (nonatomic,strong)NSDictionary *valueDict;
|
||||
@property (nonatomic,strong)NSDictionary *controllerDict;
|
||||
@end
|
||||
|
||||
@implementation QXRealNameFinishedViewController
|
||||
|
||||
- (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)getRealInfo{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getRealNameInfoSuccessBlock:^(NSDictionary * _Nonnull dict) {
|
||||
NSString *real_name = [NSString stringWithFormat:@"%@",dict[@"real_name"]];
|
||||
NSString *card_id = [NSString stringWithFormat:@"%@",dict[@"card_id"]];
|
||||
weakSelf.valueDict = @{
|
||||
QXText(@"真实姓名"):real_name,
|
||||
QXText(@"证件类型"):@"身份证",
|
||||
QXText(@"身份证号"):card_id,
|
||||
};
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.headerImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_realname_finished_icon"]];
|
||||
[self.view addSubview:self.headerImageView];
|
||||
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(NavContentHeight+16);
|
||||
make.size.mas_equalTo(CGSizeMake(195, 195));
|
||||
make.centerX.equalTo(self.view);
|
||||
}];
|
||||
|
||||
self.statusLabel = [[UILabel alloc] init];
|
||||
self.statusLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.statusLabel.textColor = RGB16(0x333333);
|
||||
self.statusLabel.text = QXText(@"您已实名认证");
|
||||
[self.view addSubview:self.statusLabel];
|
||||
[self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.headerImageView.mas_bottom).offset(25);
|
||||
make.height.mas_equalTo(21);
|
||||
make.centerX.equalTo(self.view);
|
||||
}];
|
||||
|
||||
NSArray *section1 = @[
|
||||
QXText(@"真实姓名"),
|
||||
QXText(@"证件类型"),
|
||||
QXText(@"身份证号")
|
||||
];
|
||||
|
||||
// NSArray *section2 = @[
|
||||
// QXText(@"更新本人实名信息"),
|
||||
// ];
|
||||
//
|
||||
// NSArray *section3 = @[
|
||||
// QXText(@"更正实名人"),
|
||||
// ];
|
||||
self.cellTypeDict = @{
|
||||
QXText(@"真实姓名"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyDetail],
|
||||
QXText(@"证件类型"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyDetail],
|
||||
QXText(@"身份证号"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyDetail],
|
||||
// QXText(@"更新本人实名信息"):[NSNumber numberWithInteger:QXSettingCellTypeTitleTopAndArrow],
|
||||
// QXText(@"更正实名人"):[NSNumber numberWithInteger:QXSettingCellTypeTitleTopAndArrow],
|
||||
};
|
||||
|
||||
self.controllerDict = @{
|
||||
QXText(@"真实姓名"):@"",
|
||||
QXText(@"证件类型"):@"",
|
||||
QXText(@"身份证号"):@"",
|
||||
// QXText(@"更新本人实名信息"):@"",
|
||||
// QXText(@"更正实名人"):@"",
|
||||
};
|
||||
|
||||
self.valueDict = @{
|
||||
QXText(@"真实姓名"):@"",
|
||||
QXText(@"证件类型"):@"",
|
||||
QXText(@"身份证号"):@"",
|
||||
// QXText(@"更新本人实名信息"):QXText(@"若您在公安机关变更了姓名,可点击此处更新"),
|
||||
// QXText(@"更正实名人"):QXText(@"若账号实名人非账号实际使用人,可点击此处进行更正"),
|
||||
};
|
||||
[self.dataArray addObject:section1];
|
||||
// [self.dataArray addObject:section2];
|
||||
// [self.dataArray addObject:section3];
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.statusLabel.mas_bottom).offset(12);
|
||||
make.bottom.equalTo(self.view);
|
||||
make.left.right.equalTo(self.view);
|
||||
}];
|
||||
[self getRealInfo];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate,UITableViewDataSource
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
NSArray *arr = self.dataArray[section];
|
||||
return arr.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXSettingCell *cell = [QXSettingCell cellWithTableView:tableView];
|
||||
NSArray *arr = self.dataArray[indexPath.section];
|
||||
NSString *text = arr[indexPath.row];
|
||||
NSString *value = self.valueDict[text];
|
||||
cell.titleLabel.text = text;
|
||||
cell.detailLabel.text = value;
|
||||
cell.cellType = [self.cellTypeDict[text] integerValue];
|
||||
cell.needLine = NO;
|
||||
return cell;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 0) {
|
||||
return 50;
|
||||
}
|
||||
return 57;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
return [UIView new];
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
return 12;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
||||
return [UIView new];
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 0.01;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
NSArray *arr = self.dataArray[indexPath.section];
|
||||
NSString *text = arr[indexPath.row];
|
||||
NSString *controller = self.controllerDict[text];
|
||||
if (controller.length == 0) {
|
||||
return;
|
||||
}
|
||||
UIViewController *vc = [[NSClassFromString(controller) alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStyleGrouped)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/设置/QXRealNameViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/设置/QXRealNameViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXRealNameViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/14.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRealNameViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
316
QXLive/Mine(音域)/Controller/设置/QXRealNameViewController.m
Normal file
316
QXLive/Mine(音域)/Controller/设置/QXRealNameViewController.m
Normal file
@@ -0,0 +1,316 @@
|
||||
//
|
||||
// QXRealNameViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/14.
|
||||
//
|
||||
|
||||
#import "QXRealNameViewController.h"
|
||||
#import "QXLoginTextField.h"
|
||||
#import "UIButton+QX.h"
|
||||
#import <TencentCloudHuiyanSDKFace/WBFaceVerifyCustomerService.h>
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXRealNameFinishedViewController.h"
|
||||
|
||||
@interface QXRealNameViewController ()<WBFaceVerifyCustomerServiceDelegate>
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
|
||||
@property (nonatomic,strong)QXLoginTextField *realTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *idNumberTextField;
|
||||
|
||||
@property (nonatomic,strong)UIView *topView;
|
||||
@property (nonatomic,strong)UIButton *firstBtn;
|
||||
@property (nonatomic,strong)UIButton *secondBtn;
|
||||
@property (nonatomic,strong)UIScrollView *scrollView;
|
||||
@property (nonatomic,strong)UIButton *firstCommitBtn;
|
||||
|
||||
|
||||
@property (nonatomic,strong)UILabel *secondTitleLabel;
|
||||
@property (nonatomic,strong)UIButton *secondCommitBtn;
|
||||
@property (nonatomic,strong)UIImageView *headerImageView;
|
||||
@property (nonatomic,strong)UILabel *messageLabel;
|
||||
|
||||
@property (nonatomic,strong)NSString* access_token;
|
||||
|
||||
@property (nonatomic,strong)NSDictionary*realNamedict;
|
||||
@end
|
||||
|
||||
@implementation QXRealNameViewController
|
||||
|
||||
- (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{
|
||||
|
||||
if ([QXGlobal shareGlobal].loginModel.auth == 1) {
|
||||
QXRealNameFinishedViewController*vc = [[QXRealNameFinishedViewController alloc] init];
|
||||
[self.view addSubview:vc.view];
|
||||
[self addChildViewController:vc];
|
||||
return;
|
||||
}
|
||||
// self.topView = [[UIView alloc] initWithFrame:CGRectMake(16, NavContentHeight+5, SCREEN_WIDTH-32, 70)];
|
||||
// self.topView.backgroundColor = [UIColor whiteColor];
|
||||
// [self.topView addRoundedCornersWithRadius:9];
|
||||
// [self.view addSubview:self.topView];
|
||||
//
|
||||
// self.firstBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.topView.width/2, self.topView.height)];
|
||||
// [self.firstBtn setImage:[UIImage imageNamed:@"forgot_first_nor"] forState:(UIControlStateNormal)];
|
||||
// [self.firstBtn setImage:[UIImage imageNamed:@"forgot_first_sel"] forState:(UIControlStateSelected)];
|
||||
// [self.firstBtn setTitle:QXText(@"填写身份信息") forState:(UIControlStateNormal)];
|
||||
// self.firstBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
// [self.firstBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateSelected)];
|
||||
// [self.firstBtn setTitleColor:RGB16(0x949494) forState:(UIControlStateNormal)];
|
||||
// self.firstBtn.userInteractionEnabled = NO;
|
||||
// [self.firstBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleTop) imageTitleSpace:9];
|
||||
// self.firstBtn.selected = YES;
|
||||
// [self.topView addSubview:self.firstBtn];
|
||||
//
|
||||
// UIView *line = [[UIView alloc] initWithFrame:CGRectMake((self.topView.width-74)/2, 19, 74, 1.5)];
|
||||
// line.backgroundColor = RGB16(0x949494);
|
||||
// [self.topView addSubview:line];
|
||||
//
|
||||
// self.secondBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.firstBtn.right, 0, self.topView.width/2, self.topView.height)];
|
||||
// [self.secondBtn setImage:[UIImage imageNamed:@"forgot_second_nor"] forState:(UIControlStateNormal)];
|
||||
// [self.secondBtn setImage:[UIImage imageNamed:@"forgot_second_sel"] forState:(UIControlStateSelected)];
|
||||
// [self.secondBtn setTitle:QXText(@"人脸识别") forState:(UIControlStateNormal)];
|
||||
// self.secondBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
// [self.secondBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateSelected)];
|
||||
// [self.secondBtn setTitleColor:RGB16(0x949494) forState:(UIControlStateNormal)];
|
||||
// self.secondBtn.userInteractionEnabled = NO;
|
||||
// [self.secondBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleTop) imageTitleSpace:9];
|
||||
// [self.topView addSubview:self.secondBtn];
|
||||
|
||||
|
||||
// self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, self.topView.bottom+8, SCREEN_WIDTH, SCREEN_HEIGHT-self.topView.bottom)];
|
||||
// self.scrollView.contentSize = CGSizeMake(SCREEN_WIDTH*2, self.scrollView.height);
|
||||
// self.scrollView.scrollEnabled = NO;
|
||||
// self.scrollView.backgroundColor = [UIColor clearColor];
|
||||
// [self.view addSubview:self.scrollView];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||
self.titleLabel.textColor = RGB16(0x999999);
|
||||
self.titleLabel.numberOfLines = 0;
|
||||
self.titleLabel.text = QXText(@"根据国家相关法律法规,用户需要进行实名认证,请输人您本人真实有效的信息,一旦认证完成后不可随意更改,请慎重填写,我们承诺将严格保护您的个人信息,不会对外泄漏");
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.width.mas_equalTo(SCREEN_WIDTH-32);
|
||||
make.top.mas_equalTo(NavContentHeight+12);
|
||||
}];
|
||||
|
||||
self.realTextField = [[QXLoginTextField alloc] init];
|
||||
self.realTextField.type = LoginTextTypeRealName;
|
||||
self.realTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.view addSubview:self.realTextField];
|
||||
[self.realTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.width.mas_equalTo(SCREEN_WIDTH-32);
|
||||
make.top.equalTo(self.titleLabel.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(44);
|
||||
}];
|
||||
|
||||
self.idNumberTextField = [[QXLoginTextField alloc] init];
|
||||
self.idNumberTextField.type = LoginTextTypeIdNumber;
|
||||
self.idNumberTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.view addSubview:self.idNumberTextField];
|
||||
[self.idNumberTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.width.mas_equalTo(SCREEN_WIDTH-32);
|
||||
make.top.equalTo(self.realTextField.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(44);
|
||||
}];
|
||||
|
||||
// self.firstCommitBtn = [[UIButton alloc] init];
|
||||
// [self.firstCommitBtn setTitle:QXText(@"下一步") forState:(UIControlStateNormal)];
|
||||
// self.firstCommitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
// self.firstCommitBtn.backgroundColor = QXConfig.themeColor;
|
||||
// [self.firstCommitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
// [self.firstCommitBtn addRoundedCornersWithRadius:21];
|
||||
// [self.firstCommitBtn addTarget:self action:@selector(nextAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
// [self.scrollView addSubview:self.firstCommitBtn];
|
||||
// [self.firstCommitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.left.mas_equalTo(38);
|
||||
// make.width.mas_equalTo(SCREEN_WIDTH-38*2);
|
||||
// make.top.equalTo(self.idNumberTextField.mas_bottom).offset(20);
|
||||
// make.height.mas_equalTo(43);
|
||||
// }];
|
||||
|
||||
|
||||
// self.secondTitleLabel = [[UILabel alloc] init];
|
||||
// self.secondTitleLabel.font = [UIFont systemFontOfSize:16];
|
||||
// self.secondTitleLabel.textColor = RGB16(0x333333);
|
||||
// self.secondTitleLabel.numberOfLines = 0;
|
||||
// self.secondTitleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
// self.secondTitleLabel.text = QXText(@"为了保证本人操作,请进行人脸验证");
|
||||
// [self.scrollView addSubview:self.secondTitleLabel];
|
||||
// [self.secondTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.left.mas_equalTo(SCREEN_WIDTH);
|
||||
// make.width.mas_equalTo(SCREEN_WIDTH);
|
||||
// make.top.equalTo(self.scrollView);
|
||||
// make.height.mas_equalTo(24);
|
||||
// }];
|
||||
//
|
||||
// self.headerImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_realname_user"]];
|
||||
// [self.scrollView addSubview:self.headerImageView];
|
||||
// [self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.left.mas_equalTo((SCREEN_WIDTH-223)/2+SCREEN_WIDTH);
|
||||
// make.width.height.mas_equalTo(223);
|
||||
// make.top.equalTo(self.secondTitleLabel.mas_bottom).offset(9);
|
||||
// }];
|
||||
//
|
||||
// self.messageLabel = [[UILabel alloc] init];
|
||||
// NSString *str = @"您知悉并同意应用提供者 \n· 收集、使用您本人的身份信息和人脸图像 \n· 向合法数据持有者核实您的身份信息 \n· 本操作数据仅用于身份核实,安全可靠";
|
||||
// self.messageLabel.numberOfLines = 0;
|
||||
// self.messageLabel.font = [UIFont systemFontOfSize:14];
|
||||
// self.messageLabel.textColor = RGB16(0x666666);
|
||||
// NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
|
||||
// [attr yy_setFont:[UIFont boldSystemFontOfSize:16] range:[str rangeOfString:@"您知悉并同意应用提供者"] ];
|
||||
// [attr yy_setColor:RGB16(0x333333) range:[str rangeOfString:@"您知悉并同意应用提供者"] ];
|
||||
// NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
|
||||
// style.lineSpacing = 5;
|
||||
// [attr yy_setParagraphStyle:style range:NSMakeRange(0, str.length)];
|
||||
// self.messageLabel.attributedText = attr;
|
||||
// [self.scrollView addSubview:self.messageLabel];
|
||||
// [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.left.mas_equalTo(40+SCREEN_WIDTH);
|
||||
// make.width.mas_equalTo(SCREEN_WIDTH-80);
|
||||
// make.top.equalTo(self.headerImageView.mas_bottom).offset(12);
|
||||
// }];
|
||||
|
||||
|
||||
self.secondCommitBtn = [[UIButton alloc] init];
|
||||
self.secondCommitBtn.needEventInterval = 1;
|
||||
[self.secondCommitBtn setTitle:QXText(@"立即开始验证") forState:(UIControlStateNormal)];
|
||||
self.secondCommitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.secondCommitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.secondCommitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[self.secondCommitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.secondCommitBtn addRoundedCornersWithRadius:21];
|
||||
[self.view addSubview:self.secondCommitBtn];
|
||||
[self.secondCommitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(38);
|
||||
make.width.mas_equalTo(SCREEN_WIDTH-38*2);
|
||||
make.top.equalTo(self.idNumberTextField.mas_bottom).offset(20);
|
||||
make.height.mas_equalTo(43);
|
||||
}];
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
-(void)nextAction{
|
||||
NSString *realName = self.realTextField.textField.text;
|
||||
NSString *idNumber = self.idNumberTextField.textField.text;
|
||||
if (realName.length == 0) {
|
||||
showToast(QXText(@"请输入真实姓名"));
|
||||
return;
|
||||
}
|
||||
if (idNumber.length == 0) {
|
||||
showToast(QXText(@"请输入身份证号码"));
|
||||
return;
|
||||
}
|
||||
if (idNumber.length != 18) {
|
||||
showToast(QXText(@"请输入正确的身份证号码"));
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXMineNetwork postRealNameInfoWithRealName:realName card_number:idNumber successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
weakSelf.realNamedict = dict;
|
||||
// weakSelf.firstBtn.selected = NO;
|
||||
// weakSelf.secondBtn.selected = YES;
|
||||
// [weakSelf.scrollView setContentOffset:CGPointMake(SCREEN_WIDTH, 0) animated:YES];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)commitAction{
|
||||
NSString *realName = self.realTextField.textField.text;
|
||||
NSString *idNumber = self.idNumberTextField.textField.text;
|
||||
if (realName.length == 0) {
|
||||
showToast(QXText(@"请输入真实姓名"));
|
||||
return;
|
||||
}
|
||||
if (idNumber.length == 0) {
|
||||
showToast(QXText(@"请输入身份证号码"));
|
||||
return;
|
||||
}
|
||||
if (idNumber.length != 18) {
|
||||
showToast(QXText(@"请输入正确的身份证号码"));
|
||||
return;
|
||||
}
|
||||
[self.view endEditing:YES];
|
||||
MJWeakSelf
|
||||
showLoadingInView(self.view);
|
||||
[QXMineNetwork postRealNameInfoWithRealName:realName card_number:idNumber successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
hideLoadingInView(self.view);
|
||||
weakSelf.realNamedict = dict;
|
||||
[weakSelf startFace];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
// [QXGlobal shareGlobal].isRealName = YES;
|
||||
// [self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
-(void)startFace{
|
||||
WBFaceVerifySDKConfig *config = [[WBFaceVerifySDKConfig alloc] init];
|
||||
// config.theme = WBFaceVerifyThemeCustom;
|
||||
config.useAdvanceCompare = YES;
|
||||
config.recordVideo = YES;
|
||||
NSString *nonce = [NSString stringWithFormat:@"%@",self.realNamedict[@"nonce"]];
|
||||
NSString *sign = [NSString stringWithFormat:@"%@",self.realNamedict[@"sign"]];
|
||||
NSString *appid = [NSString stringWithFormat:@"%@",self.realNamedict[@"appid"]];
|
||||
NSString *orderNo = [NSString stringWithFormat:@"%@",self.realNamedict[@"orderNo"]];
|
||||
NSString *licence = [NSString stringWithFormat:@"%@",self.realNamedict[@"licence"]];
|
||||
NSString *faceId = [NSString stringWithFormat:@"%@",self.realNamedict[@"faceId"]];
|
||||
NSString *user_id = [NSString stringWithFormat:@"%@",self.realNamedict[@"userid"]];
|
||||
[WBFaceVerifyCustomerService sharedInstance].delegate = self;
|
||||
[[WBFaceVerifyCustomerService sharedInstance] initAdvanceSDKWithUserId:user_id
|
||||
nonce:nonce
|
||||
sign:sign
|
||||
appid:appid
|
||||
orderNo:orderNo
|
||||
apiVersion:@"1.0.0"
|
||||
licence:licence
|
||||
faceId:faceId
|
||||
sdkConfig:config
|
||||
success:^{
|
||||
QXLOG(@"拉起成功");
|
||||
[[WBFaceVerifyCustomerService sharedInstance] startWbFaceVeirifySdk];
|
||||
}
|
||||
failure:^(WBFaceError * _Nonnull error) {
|
||||
QXLOG(@"拉起失败%@",error);
|
||||
}];
|
||||
}
|
||||
-(void)authSuccess{
|
||||
QXRealNameFinishedViewController*vc = [[QXRealNameFinishedViewController alloc] init];
|
||||
[self.view addSubview:vc.view];
|
||||
[self addChildViewController:vc];
|
||||
[QXGlobal shareGlobal].loginModel.auth = 1;
|
||||
[[QXGlobal shareGlobal]updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
|
||||
}
|
||||
-(void)wbfaceVerifyCustomerServiceDidFinishedWithFaceVerifyResult:(WBFaceVerifyResult *)faceVerifyResult{
|
||||
if (faceVerifyResult.isSuccess) {
|
||||
QXLOG(@"人脸核验通过");
|
||||
[self authSuccess];
|
||||
/// 通知服务端实名验证结果
|
||||
[QXMineNetwork postRealNameResultWithOrderNo:faceVerifyResult.orderNo successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/设置/QXSetPwdViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/设置/QXSetPwdViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXSetPwdViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXSetPwdViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
103
QXLive/Mine(音域)/Controller/设置/QXSetPwdViewController.m
Normal file
103
QXLive/Mine(音域)/Controller/设置/QXSetPwdViewController.m
Normal file
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// QXSetPwdViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/12.
|
||||
//
|
||||
|
||||
#import "QXSetPwdViewController.h"
|
||||
#import "QXLoginTextField.h"
|
||||
#import "QXLoginNetwork.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXSetPwdViewController ()<QXLoginTextFieldDelegate>
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UILabel *mobileLabel;
|
||||
@property (nonatomic,strong)QXLoginTextField *codeTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *pwdTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *repwdTextField;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@end
|
||||
|
||||
@implementation QXSetPwdViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"设置密码");
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.text = QXText(@"当前手机号");
|
||||
self.titleLabel.textColor = RGB16(0x999999);
|
||||
self.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.top.mas_equalTo(NavContentHeight+17);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
|
||||
self.mobileLabel = [[UILabel alloc] init];
|
||||
self.mobileLabel.text = [QXGlobal shareGlobal].loginModel.mobile;
|
||||
self.mobileLabel.textColor = QXConfig.textColor;
|
||||
self.mobileLabel.font = [UIFont boldSystemFontOfSize:17];
|
||||
[self.view addSubview:self.mobileLabel];
|
||||
[self.mobileLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.titleLabel.mas_right).offset(4);
|
||||
make.centerY.equalTo(self.titleLabel);
|
||||
make.height.mas_equalTo(28);
|
||||
}];
|
||||
|
||||
self.codeTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+56, SCREEN_WIDTH-32, 44) type:(LoginTextTypeCode)];
|
||||
self.codeTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.codeTextField addRoundedCornersWithRadius:11];
|
||||
self.codeTextField.delegate = self;
|
||||
[self.view addSubview:self.codeTextField];
|
||||
|
||||
self.pwdTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.codeTextField.bottom+16, SCREEN_WIDTH-32, 44) type:(LoginTextTypePassword)];
|
||||
self.pwdTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.view addSubview:self.pwdTextField];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.pwdTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
|
||||
[self.commitBtn setTitle:QXText(@"提交") forState:(UIControlStateNormal)];
|
||||
self.commitBtn.needEventInterval = 0.6;
|
||||
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.commitBtn addRoundedCornersWithRadius:21];
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.view addSubview:self.commitBtn];
|
||||
}
|
||||
|
||||
-(void)didClickSendCode:(UIButton *)sender{
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork getSmscodeWithMobile:[QXGlobal shareGlobal].loginModel.mobile
|
||||
type:GetSmscodeTypeSetPassword
|
||||
successBlock:^(id _Nonnull responseObject) {
|
||||
[weakSelf.codeTextField startTimeDown];
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)commitAction{
|
||||
QXLOG(@"提交密码");
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork changPasswordWithMobile:self.mobileLabel.text
|
||||
new_password:self.pwdTextField.textField.text
|
||||
sms_code:self.codeTextField.textField.text
|
||||
user_id:[QXGlobal shareGlobal].loginModel.user_id
|
||||
successBlock:^(id _Nonnull responseObject) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:noticeChangePassword object:nil];
|
||||
[weakSelf.navigationController popToRootViewControllerAnimated:YES];
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/设置/QXSettingViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/设置/QXSettingViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXSettingViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXSettingViewController : QXBaseViewController
|
||||
@property (nonatomic,copy)void(^logOutBlock)(BOOL isCancel);
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
205
QXLive/Mine(音域)/Controller/设置/QXSettingViewController.m
Normal file
205
QXLive/Mine(音域)/Controller/设置/QXSettingViewController.m
Normal file
@@ -0,0 +1,205 @@
|
||||
//
|
||||
// QXSettingViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXSettingViewController.h"
|
||||
#import "QXSettingCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXAlertView.h"
|
||||
#import "QXTimer.h"
|
||||
static NSInteger maxClickCount = 6;
|
||||
@interface QXSettingViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)NSDictionary *cellTypeDict;
|
||||
@property (nonatomic,strong)NSDictionary *valueDict;
|
||||
@property (nonatomic,strong)NSDictionary *controllerDict;
|
||||
@property (nonatomic,strong)QXAlertView *alertView;
|
||||
@property (nonatomic,strong)QXTimer *timer;
|
||||
@property (nonatomic,assign)NSInteger clickCount;
|
||||
@end
|
||||
|
||||
@implementation QXSettingViewController
|
||||
|
||||
- (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{
|
||||
NSArray *section1 = @[
|
||||
// QXText(@"消息通知"),
|
||||
QXText(@"未成年人模式"),
|
||||
QXText(@"黑名单"),
|
||||
QXText(@"设置密码"),
|
||||
QXText(@"手机绑定"),
|
||||
QXText(@"关于我们"),
|
||||
QXText(@"版本号")
|
||||
];
|
||||
|
||||
NSArray *section2 = @[
|
||||
QXText(@"切换账号"),
|
||||
QXText(@"实名认证"),
|
||||
QXText(@"账号注销"),
|
||||
QXText(@"退出登录"),
|
||||
];
|
||||
self.cellTypeDict = @{
|
||||
// QXText(@"消息通知"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"未成年人模式"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"黑名单"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"设置密码"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"手机绑定"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"版本号"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyDetail],
|
||||
QXText(@"切换账号"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"实名认证"):[NSNumber numberWithInteger:QXSettingCellTypeNormal],
|
||||
QXText(@"账号注销"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
|
||||
QXText(@"退出登录"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow]
|
||||
};
|
||||
|
||||
self.controllerDict = @{
|
||||
QXText(@"消息通知"):@"QXNoticeSwitchViewController",
|
||||
QXText(@"未成年人模式"):@"QXChirldModeViewController",
|
||||
QXText(@"黑名单"):@"QXBlackListlViewController",
|
||||
QXText(@"设置密码"):@"QXSetPwdViewController",
|
||||
QXText(@"手机绑定"):@"QXBindMobileViewController",
|
||||
QXText(@"版本号"):@"",
|
||||
QXText(@"切换账号"):@"QXChangeAccountViewController",
|
||||
QXText(@"实名认证"):[QXGlobal shareGlobal].isRealName?@"QXRealNameFinishedViewController":@"QXRealNameViewController",
|
||||
QXText(@"账号注销"):@"",
|
||||
QXText(@"退出登录"):@"",
|
||||
QXText(@"关于我们"):@"QXAboutViewController"
|
||||
};
|
||||
NSString*appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
||||
self.valueDict = @{
|
||||
// QXText(@"消息通知"):@"",
|
||||
QXText(@"未成年人模式"):@"",
|
||||
QXText(@"黑名单"):@"",
|
||||
QXText(@"设置密码"):@"",
|
||||
QXText(@"手机绑定"):@"",
|
||||
QXText(@"版本号"):appVersion,
|
||||
QXText(@"切换账号"):@"",
|
||||
QXText(@"实名认证"):@"",
|
||||
QXText(@"账号注销"):@"",
|
||||
QXText(@"退出登录"):@""
|
||||
};
|
||||
[self.dataArray addObject:section1];
|
||||
[self.dataArray addObject:section2];
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate,UITableViewDataSource
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
NSArray *arr = self.dataArray[section];
|
||||
return arr.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXSettingCell *cell = [QXSettingCell cellWithTableView:tableView];
|
||||
NSArray *arr = self.dataArray[indexPath.section];
|
||||
NSString *text = arr[indexPath.row];
|
||||
NSString *value = self.valueDict[text];
|
||||
cell.titleLabel.text = text;
|
||||
cell.detailLabel.text = value;
|
||||
cell.cellType = [self.cellTypeDict[text] integerValue];
|
||||
cell.needLine = (indexPath.row>=0) && (indexPath.row < arr.count-1);
|
||||
return cell;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
return [UIView new];
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
return 12;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
||||
return [UIView new];
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 0.01;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
NSArray *arr = self.dataArray[indexPath.section];
|
||||
NSString *text = arr[indexPath.row];
|
||||
if ([text isEqualToString:QXText(@"版本号")]) {
|
||||
self.clickCount++;
|
||||
if (self.clickCount>=maxClickCount) {
|
||||
showToast(@"已获取充值权限");
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kIsOpenRecharge];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
}else{
|
||||
self.clickCount = 0;
|
||||
}
|
||||
|
||||
if ([text isEqualToString:QXText(@"账号注销")]) {
|
||||
[[QXGlobal shareGlobal] showView:self.alertView controller:self popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if ([text isEqualToString:QXText(@"退出登录")]) {
|
||||
if (self.logOutBlock) {
|
||||
self.logOutBlock(NO);
|
||||
}
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *controller = self.controllerDict[text];
|
||||
if (controller.length == 0) {
|
||||
return;
|
||||
}
|
||||
UIViewController *vc = [[NSClassFromString(controller) alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStyleGrouped)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.rowHeight = 42;
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
-(QXAlertView *)alertView{
|
||||
if (!_alertView) {
|
||||
_alertView = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(230))];
|
||||
_alertView.title = @"您确定要注销账号吗?";
|
||||
_alertView.message = @"注销后您当前的账户金币及钻石将无法找回\n30天内本账号将无法登录,请谨慎操作!";
|
||||
MJWeakSelf
|
||||
_alertView.commitBlock = ^{
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
if (weakSelf.logOutBlock) {
|
||||
weakSelf.logOutBlock(YES);
|
||||
}
|
||||
};
|
||||
}
|
||||
return _alertView;
|
||||
}
|
||||
|
||||
/*
|
||||
#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
|
||||
16
QXLive/Mine(音域)/Controller/道具商城/QXPropShopViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/道具商城/QXPropShopViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXPropShopViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXPropShopViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
230
QXLive/Mine(音域)/Controller/道具商城/QXPropShopViewController.m
Normal file
230
QXLive/Mine(音域)/Controller/道具商城/QXPropShopViewController.m
Normal file
@@ -0,0 +1,230 @@
|
||||
//
|
||||
// QXPropShopViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXPropShopViewController.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
#import "QXRechargeViewcController.h"
|
||||
|
||||
static void *WKWebBrowserContext = &WKWebBrowserContext;
|
||||
@interface QXPropShopViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>
|
||||
@property(nonatomic,strong)WKWebView *contentWebView;
|
||||
@property(nonatomic,strong)UIProgressView *progressView;
|
||||
//@property (nonatomic,strong)TitleView *titleView;
|
||||
@end
|
||||
|
||||
@implementation QXPropShopViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
// if (@available(iOS 11.0, *)) {
|
||||
// self.contentWebView.scrollView.contentInsetAdjustmentBehavior = UIScrollQXPropShopViewControllerViewContentInsetAdjustmentNever;
|
||||
// } else {
|
||||
// self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
// }
|
||||
|
||||
[self.view addSubview:self.contentWebView];
|
||||
[self.view addSubview:self.progressView];
|
||||
|
||||
[self layoutConstraints];
|
||||
[self loadData];
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
self.navigationItem.title = @"道具商城";
|
||||
UIButton*backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
|
||||
[backBtn setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
|
||||
backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
|
||||
[backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
|
||||
}
|
||||
|
||||
-(void)backAction{
|
||||
if (self.contentWebView.canGoBack) {
|
||||
[self.contentWebView goBack];
|
||||
}else{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
}
|
||||
- (void)layoutConstraints {
|
||||
[self.contentWebView setFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-(NavContentHeight))];
|
||||
[self.progressView setFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH
|
||||
, 2)];
|
||||
}
|
||||
- (void)loadData {
|
||||
NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/prop/propMall?id=%@",H5ServerUrl,[QXGlobal shareGlobal].loginModel.token]];
|
||||
NSURLRequest *request =[NSURLRequest requestWithURL:url];
|
||||
[self.contentWebView loadRequest:request];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - WKNavigationDelegate
|
||||
//开始加载
|
||||
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|
||||
//开始加载的时候,让加载进度条显示
|
||||
self.progressView.hidden = NO;
|
||||
}
|
||||
|
||||
//网页加载完成
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
|
||||
// 获取加载网页的标题
|
||||
// if (self.title.length == 0) {
|
||||
// self.navigationItem.title = self.contentWebView.title;
|
||||
// }
|
||||
// if ([self.titleString containsString:@"转账"]) {
|
||||
// // 设置字体
|
||||
// NSString *fontFamilyStr = @"document.getElementsByTagName('body')[0].style.fontFamily='Arial';";
|
||||
// [webView evaluateJavaScript:fontFamilyStr completionHandler:nil];
|
||||
// //设置颜色
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= '#333333'" completionHandler:nil];
|
||||
// //修改字体大小
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '150%'"completionHandler:nil];
|
||||
// }
|
||||
}
|
||||
//内容返回时调用
|
||||
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
//服务器请求跳转的时候调用
|
||||
- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
// 内容加载失败时候调用
|
||||
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error{
|
||||
|
||||
}
|
||||
-(void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
|
||||
NSLog(@"message.name====%@ body=%@",message.name,message.body);
|
||||
if([message.name isEqualToString:@"nativeHandler"]){
|
||||
NSDictionary *dict = message.body;
|
||||
if ([dict[@"action"] isEqualToString:@"Recharge"]) {
|
||||
QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
||||
//如果是跳转一个新页面
|
||||
if (navigationAction.targetFrame == nil) {
|
||||
[webView loadRequest:navigationAction.request];
|
||||
}
|
||||
NSURL *URL = navigationAction.request.URL;
|
||||
[self dealSomeThing:URL];
|
||||
decisionHandler(WKNavigationActionPolicyAllow);
|
||||
}
|
||||
|
||||
- (void)dealSomeThing:(NSURL *)url{
|
||||
NSString *scheme = [url scheme];
|
||||
NSString *resourceSpecifier = [url resourceSpecifier];
|
||||
if ([scheme isEqualToString:@"tel"]) {
|
||||
NSString *callPhone = [NSString stringWithFormat:@"tel://%@", resourceSpecifier];
|
||||
/// 防止iOS 10及其之后,拨打电话系统弹出框延迟出现
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//进度条
|
||||
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView {
|
||||
}
|
||||
|
||||
//KVO监听进度条
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
|
||||
if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.contentWebView) {
|
||||
[self.progressView setAlpha:1.0f];
|
||||
BOOL animated = self.contentWebView.estimatedProgress > self.progressView.progress;
|
||||
[self.progressView setProgress:self.contentWebView.estimatedProgress animated:animated];
|
||||
|
||||
// Once complete, fade out UIProgressView
|
||||
if(self.contentWebView.estimatedProgress >= 1.0f) {
|
||||
[UIView animateWithDuration:0.3f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
|
||||
[self.progressView setAlpha:0.0f];
|
||||
} completion:^(BOOL finished) {
|
||||
[self.progressView setProgress:0.0f animated:NO];
|
||||
}];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
- (WKWebView *)contentWebView {
|
||||
if (!_contentWebView) {
|
||||
//设置网页的配置文件
|
||||
WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];
|
||||
// 允许可以与网页交互,选择视图
|
||||
configuration.selectionGranularity = YES;
|
||||
// web内容处理池pr
|
||||
configuration.processPool = [[WKProcessPool alloc] init];
|
||||
//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
|
||||
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
|
||||
// 是否支持记忆读取
|
||||
configuration.suppressesIncrementalRendering = YES;
|
||||
// 允许用户更改网页的设置
|
||||
[UserContentController addScriptMessageHandler:self name:@"login"];
|
||||
[UserContentController addScriptMessageHandler:self name:@"nativeHandler"];
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.userContentController = UserContentController;
|
||||
// 此处一定要做判断,因为是iOS9之后才有的方法,否则在iOS8下会崩溃
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
|
||||
//允许视频播放
|
||||
configuration.allowsAirPlayForMediaPlayback = YES;
|
||||
// 允许在线播放
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
//开启手势触摸 默认设置就是NO。在ios8系统中会导致手势问题,程序崩溃
|
||||
_contentWebView.allowsBackForwardNavigationGestures = YES;
|
||||
}
|
||||
_contentWebView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration];
|
||||
_contentWebView.backgroundColor = [UIColor clearColor];
|
||||
_contentWebView.opaque = YES;
|
||||
//适应你设定的尺寸
|
||||
[_contentWebView sizeToFit];
|
||||
_contentWebView.scrollView.showsVerticalScrollIndicator = NO;
|
||||
// 设置代理
|
||||
_contentWebView.navigationDelegate = self;
|
||||
//kvo 添加进度监控
|
||||
[_contentWebView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:WKWebBrowserContext];
|
||||
}
|
||||
return _contentWebView;
|
||||
}
|
||||
|
||||
- (UIProgressView *)progressView {
|
||||
if (!_progressView) {
|
||||
_progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
|
||||
[_progressView setTrackTintColor:[UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0]];
|
||||
_progressView.progressTintColor = QXConfig.themeColor;
|
||||
}
|
||||
return _progressView;
|
||||
}
|
||||
|
||||
-(void)setProgressColor:(UIColor *)progressColor{
|
||||
_progressView.progressTintColor = progressColor;
|
||||
}
|
||||
// 记得dealloc
|
||||
- (void)dealloc {
|
||||
if (self) {
|
||||
[self.contentWebView removeObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress))];
|
||||
}
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/邀请/QXInviteViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/邀请/QXInviteViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXInviteViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/10.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXInviteViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
253
QXLive/Mine(音域)/Controller/邀请/QXInviteViewController.m
Normal file
253
QXLive/Mine(音域)/Controller/邀请/QXInviteViewController.m
Normal file
@@ -0,0 +1,253 @@
|
||||
//
|
||||
// QXInviteViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXInviteViewController.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
#import <WXApi.h>
|
||||
#import "QXDiamondViewController.h"
|
||||
#import "QXWalletViewController.h"
|
||||
|
||||
static void *WKWebBrowserContext = &WKWebBrowserContext;
|
||||
@interface QXInviteViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>
|
||||
@property(nonatomic,strong)WKWebView *contentWebView;
|
||||
@property(nonatomic,strong)UIProgressView *progressView;
|
||||
//@property (nonatomic,strong)TitleView *titleView;
|
||||
@end
|
||||
|
||||
@implementation QXInviteViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
// if (@available(iOS 11.0, *)) {
|
||||
// self.contentWebView.scrollView.contentInsetAdjustmentBehavior = UIScrollQXInviteViewControllerViewContentInsetAdjustmentNever;
|
||||
// } else {
|
||||
// self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
// }
|
||||
|
||||
[self.view addSubview:self.contentWebView];
|
||||
[self.view addSubview:self.progressView];
|
||||
|
||||
[self layoutConstraints];
|
||||
[self loadData];
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
// self.navigationItem.title = @"道具商城";
|
||||
// UIButton*backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
|
||||
// [backBtn setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
|
||||
// backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
|
||||
// [backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
|
||||
}
|
||||
|
||||
//-(void)backAction{
|
||||
// if (self.contentWebView.canGoBack) {
|
||||
// [self.contentWebView goBack];
|
||||
// }else{
|
||||
// [self.navigationController popViewControllerAnimated:YES];
|
||||
// }
|
||||
//}
|
||||
- (void)layoutConstraints {
|
||||
[self.contentWebView setFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
|
||||
[self.progressView setFrame:CGRectMake(0, 0, SCREEN_WIDTH
|
||||
, 2)];
|
||||
}
|
||||
- (void)loadData {
|
||||
NSInteger safeTop = kSafeAreaTop;
|
||||
NSURL* url=[NSURL URLWithString:[NSString stringWithFormat:@"%@web/index.html#/pages/other/income??id=%@&h=%ld",H5ServerUrl,[QXGlobal shareGlobal].loginModel.token,safeTop]];
|
||||
NSURLRequest *request =[NSURLRequest requestWithURL:url];
|
||||
[self.contentWebView loadRequest:request];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - WKNavigationDelegate
|
||||
//开始加载
|
||||
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|
||||
//开始加载的时候,让加载进度条显示
|
||||
self.progressView.hidden = NO;
|
||||
}
|
||||
|
||||
//网页加载完成
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
|
||||
// 获取加载网页的标题
|
||||
// if (self.title.length == 0) {
|
||||
// self.navigationItem.title = self.contentWebView.title;
|
||||
// }
|
||||
// if ([self.titleString containsString:@"转账"]) {
|
||||
// // 设置字体
|
||||
// NSString *fontFamilyStr = @"document.getElementsByTagName('body')[0].style.fontFamily='Arial';";
|
||||
// [webView evaluateJavaScript:fontFamilyStr completionHandler:nil];
|
||||
// //设置颜色
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= '#333333'" completionHandler:nil];
|
||||
// //修改字体大小
|
||||
// [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '150%'"completionHandler:nil];
|
||||
// }
|
||||
}
|
||||
//内容返回时调用
|
||||
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
//服务器请求跳转的时候调用
|
||||
- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation {
|
||||
|
||||
}
|
||||
|
||||
// 内容加载失败时候调用
|
||||
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error{
|
||||
|
||||
}
|
||||
-(void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
|
||||
NSLog(@"message.name====%@ body=%@",message.name,message.body);
|
||||
if([message.name isEqualToString:@"nativeHandler"]){
|
||||
NSDictionary *dict = message.body;
|
||||
if ([dict[@"action"] isEqualToString:@"exchange"]) {
|
||||
// WXOpenCustomerServiceReq *req = [[WXOpenCustomerServiceReq alloc] init];
|
||||
// req.corpid = @"wwc7c37fd1d9dbb41c";
|
||||
// req.url = @"https://work.weixin.qq.com/kfid/kfc35116f540115ba47";
|
||||
// [WXApi sendReq:req completion:nil];
|
||||
QXDiamondViewController *vc = [[QXDiamondViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else if ([dict[@"action"] isEqualToString:@"closeWeb"]) {
|
||||
if (self.contentWebView.canGoBack) {
|
||||
[self.contentWebView goBack];
|
||||
}else{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
}else if ([dict[@"action"] isEqualToString:@"inviteUser"]) {
|
||||
|
||||
}else if ([dict[@"action"] isEqualToString:@"Withdrawal"]) {
|
||||
QXWalletViewController *vc = [[QXWalletViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
||||
//如果是跳转一个新页面
|
||||
if (navigationAction.targetFrame == nil) {
|
||||
[webView loadRequest:navigationAction.request];
|
||||
}
|
||||
NSURL *URL = navigationAction.request.URL;
|
||||
[self dealSomeThing:URL];
|
||||
decisionHandler(WKNavigationActionPolicyAllow);
|
||||
}
|
||||
|
||||
- (void)dealSomeThing:(NSURL *)url{
|
||||
NSString *scheme = [url scheme];
|
||||
NSString *resourceSpecifier = [url resourceSpecifier];
|
||||
if ([scheme isEqualToString:@"tel"]) {
|
||||
NSString *callPhone = [NSString stringWithFormat:@"tel://%@", resourceSpecifier];
|
||||
/// 防止iOS 10及其之后,拨打电话系统弹出框延迟出现
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//进度条
|
||||
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView {
|
||||
}
|
||||
|
||||
//KVO监听进度条
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
|
||||
if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.contentWebView) {
|
||||
[self.progressView setAlpha:1.0f];
|
||||
BOOL animated = self.contentWebView.estimatedProgress > self.progressView.progress;
|
||||
[self.progressView setProgress:self.contentWebView.estimatedProgress animated:animated];
|
||||
|
||||
// Once complete, fade out UIProgressView
|
||||
if(self.contentWebView.estimatedProgress >= 1.0f) {
|
||||
[UIView animateWithDuration:0.3f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
|
||||
[self.progressView setAlpha:0.0f];
|
||||
} completion:^(BOOL finished) {
|
||||
[self.progressView setProgress:0.0f animated:NO];
|
||||
}];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
- (WKWebView *)contentWebView {
|
||||
if (!_contentWebView) {
|
||||
//设置网页的配置文件
|
||||
WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];
|
||||
// 允许可以与网页交互,选择视图
|
||||
configuration.selectionGranularity = YES;
|
||||
// web内容处理池pr
|
||||
configuration.processPool = [[WKProcessPool alloc] init];
|
||||
//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
|
||||
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
|
||||
// 是否支持记忆读取
|
||||
configuration.suppressesIncrementalRendering = YES;
|
||||
// 允许用户更改网页的设置
|
||||
[UserContentController addScriptMessageHandler:self name:@"nativeHandler"];
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.userContentController = UserContentController;
|
||||
// 此处一定要做判断,因为是iOS9之后才有的方法,否则在iOS8下会崩溃
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
|
||||
//允许视频播放
|
||||
configuration.allowsAirPlayForMediaPlayback = YES;
|
||||
// 允许在线播放
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
//开启手势触摸 默认设置就是NO。在ios8系统中会导致手势问题,程序崩溃
|
||||
_contentWebView.allowsBackForwardNavigationGestures = YES;
|
||||
}
|
||||
_contentWebView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration];
|
||||
_contentWebView.backgroundColor = [UIColor clearColor];
|
||||
_contentWebView.opaque = YES;
|
||||
//适应你设定的尺寸
|
||||
[_contentWebView sizeToFit];
|
||||
_contentWebView.scrollView.showsVerticalScrollIndicator = NO;
|
||||
// 设置代理
|
||||
_contentWebView.navigationDelegate = self;
|
||||
//kvo 添加进度监控
|
||||
[_contentWebView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:WKWebBrowserContext];
|
||||
}
|
||||
return _contentWebView;
|
||||
}
|
||||
|
||||
- (UIProgressView *)progressView {
|
||||
if (!_progressView) {
|
||||
_progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
|
||||
[_progressView setTrackTintColor:[UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0]];
|
||||
_progressView.progressTintColor = QXConfig.themeColor;
|
||||
}
|
||||
return _progressView;
|
||||
}
|
||||
|
||||
-(void)setProgressColor:(UIColor *)progressColor{
|
||||
_progressView.progressTintColor = progressColor;
|
||||
}
|
||||
// 记得dealloc
|
||||
- (void)dealloc {
|
||||
if (self) {
|
||||
[self.contentWebView removeObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress))];
|
||||
}
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
18
QXLive/Mine(音域)/Controller/钱包/QXAliBindViewController.h
Normal file
18
QXLive/Mine(音域)/Controller/钱包/QXAliBindViewController.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// QXAliBindViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "QXPayTypeModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXAliBindViewController : QXBaseViewController
|
||||
@property (nonatomic,assign)BOOL isAli;
|
||||
|
||||
@property (nonatomic,strong)QXPayTypeModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
82
QXLive/Mine(音域)/Controller/钱包/QXAliBindViewController.m
Normal file
82
QXLive/Mine(音域)/Controller/钱包/QXAliBindViewController.m
Normal file
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// QXAliBindViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/9.
|
||||
//
|
||||
|
||||
#import "QXAliBindViewController.h"
|
||||
#import "QXLoginTextField.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXAliBindViewController ()<QXLoginTextFieldDelegate>
|
||||
@property (nonatomic,strong)QXLoginTextField *aliTextField;
|
||||
|
||||
@property (nonatomic,strong)QXLoginTextField *bankNumberTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *bankNameTextField;
|
||||
@property (nonatomic,strong)QXLoginTextField *bankAddressTextField;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@end
|
||||
|
||||
@implementation QXAliBindViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = self.isAli?@"绑定支付宝":@"绑定银行卡";
|
||||
}
|
||||
|
||||
-(void)initSubViews{
|
||||
if (self.isAli) {
|
||||
self.aliTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeAliPay)];
|
||||
self.aliTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.aliTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.aliTextField];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.aliTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
|
||||
}else{
|
||||
self.bankNumberTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeBankNumber)];
|
||||
self.bankNumberTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.bankNumberTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.bankNumberTextField];
|
||||
|
||||
self.bankNameTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.bankNumberTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeBankName)];
|
||||
self.bankNameTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.bankNameTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.bankNameTextField];
|
||||
|
||||
self.bankNumberTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.bankNameTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeBankAddress)];
|
||||
self.bankNumberTextField.backgroundColor = RGB16(0xEFF2F8);
|
||||
[self.bankNumberTextField addRoundedCornersWithRadius:11];
|
||||
[self.view addSubview:self.bankNumberTextField];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.bankNumberTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
|
||||
}
|
||||
|
||||
|
||||
|
||||
self.commitBtn.needEventInterval = 1;
|
||||
[self.commitBtn setTitle:QXText(@"立即绑定") forState:(UIControlStateNormal)];
|
||||
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.commitBtn addRoundedCornersWithRadius:21];
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.view addSubview:self.commitBtn];
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
-(void)commitAction{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork walletBindWithUserId:QXGlobal.shareGlobal.loginModel.user_id type:self.model.type alipay_account:self.aliTextField.textField.text bank_card_number:self.bankNumberTextField.textField.text bank_card:self.bankNameTextField.textField.text open_bank:self.bankAddressTextField.textField.text successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// QXCornRecordSubViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/26.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "JXCategoryView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@interface QXCornRecordSubViewController : QXBaseViewController<JXCategoryListContentViewDelegate>
|
||||
|
||||
/// 0 收入 1 支出
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
/// 流水类型
|
||||
@property (nonatomic,assign)NSInteger waterType;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
108
QXLive/Mine(音域)/Controller/钱包/QXCornRecordSubViewController.m
Normal file
108
QXLive/Mine(音域)/Controller/钱包/QXCornRecordSubViewController.m
Normal file
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// QXCornRecordSubViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/26.
|
||||
//
|
||||
|
||||
#import "QXCornRecordSubViewController.h"
|
||||
#import "QXCornRecordCell.h"
|
||||
#import "QXWalletDateView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXCornRecordSubViewController ()<UITableViewDelegate,UITableViewDataSource,QXWalletDateViewDelegate>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)QXWalletDateView *dateView;
|
||||
|
||||
@property (nonatomic,strong)NSString* startTime;
|
||||
@property (nonatomic,strong)NSString* endTime;
|
||||
@end
|
||||
|
||||
@implementation QXCornRecordSubViewController
|
||||
-(UIView *)listView{
|
||||
return self.view;
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)initSubViews{
|
||||
UIView *dateBg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 48)];
|
||||
dateBg.backgroundColor = [UIColor whiteColor];
|
||||
[dateBg addSubview:self.dateView];
|
||||
[self.view addSubview:dateBg];
|
||||
[self.view addSubview:self.tableView];
|
||||
self.page = 1;
|
||||
}
|
||||
-(void)getData{
|
||||
// [self.dataArray addObject:@""];
|
||||
// [self.dataArray addObject:@""];
|
||||
// [self.dataArray addObject:@""];
|
||||
// [self.tableView reloadData];
|
||||
//
|
||||
MJWeakSelf
|
||||
[QXMineNetwork roomCoinOrDiamondDetailWithPage:self.page in_out_type:[NSString stringWithFormat:@"%ld",self.type+1] start_time:self.startTime end_time:self.endTime gift_type:[NSString stringWithFormat:@"%ld",self.waterType+1] successBlock:^(NSArray<QXCoinDetailModel *> * _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];
|
||||
}];
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXCornRecordCell *cell = [QXCornRecordCell cellWithTableView:tableView];
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
#pragma mark - QXWalletDateViewDelegate
|
||||
-(void)didSelectedStartDate:(NSString *)startDateString startDate:(NSDate *)startDate endDateString:(NSString *)endDateString endDate:(NSDate *)endDate{
|
||||
QXLOG(@"开始时间-%@ 结束时间-%@",startDateString,endDateString);
|
||||
self.startTime = startDateString;
|
||||
self.endTime = endDateString;
|
||||
self.page = 1;
|
||||
[self getData];
|
||||
}
|
||||
|
||||
-(QXWalletDateView *)dateView{
|
||||
if (!_dateView) {
|
||||
_dateView = [[QXWalletDateView alloc] initWithFrame:CGRectMake(16, 0, SCREEN_WIDTH-32, 38)];
|
||||
_dateView.delegate = self;
|
||||
}
|
||||
return _dateView;
|
||||
}
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.dateView.bottom+10, SCREEN_WIDTH, SCREEN_HEIGHT - self.dateView.bottom-NavContentHeight-44) style:(UITableViewStylePlain)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor whiteColor];
|
||||
_tableView.tableFooterView = [UIView new];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.rowHeight = 66;
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getData];
|
||||
}];
|
||||
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getData];
|
||||
}];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
17
QXLive/Mine(音域)/Controller/钱包/QXCornRecordViewController.h
Normal file
17
QXLive/Mine(音域)/Controller/钱包/QXCornRecordViewController.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXCornRecordViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/26.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXCornRecordViewController : QXBaseViewController
|
||||
/// 0 金币 1 钻石
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
84
QXLive/Mine(音域)/Controller/钱包/QXCornRecordViewController.m
Normal file
84
QXLive/Mine(音域)/Controller/钱包/QXCornRecordViewController.m
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// QXCornRecordViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/26.
|
||||
//
|
||||
|
||||
#import "QXCornRecordViewController.h"
|
||||
#import "JXCategoryView.h"
|
||||
#import "QXCornRecordSubViewController.h"
|
||||
|
||||
@interface QXCornRecordViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
|
||||
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
|
||||
@property (nonatomic,strong)NSMutableArray <UIViewController*>*listVCArray;
|
||||
@property (nonatomic,strong)NSArray *titles;
|
||||
@end
|
||||
|
||||
@implementation QXCornRecordViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
if (self.type == 0) {
|
||||
self.navigationItem.title = QXText(@"金币收支");
|
||||
}else{
|
||||
self.navigationItem.title = QXText(@"钻石收支");
|
||||
}
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
if (self.type == 0) {
|
||||
self.titles = @[QXText(@"金币收入"),QXText(@"金币支出")];
|
||||
}else{
|
||||
self.titles = @[QXText(@"钻石收入"),QXText(@"钻石支出")];
|
||||
}
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
self.categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(0, kSafeAreaTop+44, SCREEN_WIDTH, 44);
|
||||
self.categoryView.delegate = self;
|
||||
self.categoryView.titles = self.titles;
|
||||
self.categoryView.backgroundColor = [UIColor whiteColor];
|
||||
self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#333333"];
|
||||
self.categoryView.titleColor = [UIColor colorWithHexString:@"#666666"];
|
||||
self.categoryView.cellWidth = 70;
|
||||
self.categoryView.contentEdgeInsetLeft = 16;
|
||||
self.categoryView.cellSpacing = 12;
|
||||
// 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(58, 8);
|
||||
indicatorView.verticalMargin = 11;
|
||||
self.categoryView.indicators = @[indicatorView];
|
||||
self.containerView = [[JXCategoryListContainerView alloc] initWithType:(JXCategoryListContainerType_ScrollView) delegate:self];
|
||||
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom);
|
||||
[self.view addSubview:self.categoryView];
|
||||
[self.view addSubview:self.containerView];
|
||||
self.categoryView.listContainer = self.containerView;
|
||||
[self requestMineUserInfoData];
|
||||
}
|
||||
- (void)requestMineUserInfoData {
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
|
||||
return self.titles.count;
|
||||
}
|
||||
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
QXCornRecordSubViewController *vc = [[QXCornRecordSubViewController alloc] init];
|
||||
vc.waterType = self.type;
|
||||
vc.type = index;
|
||||
return vc;
|
||||
}
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/钱包/QXDiamondViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/钱包/QXDiamondViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXDiamondViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/26.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXDiamondViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
120
QXLive/Mine(音域)/Controller/钱包/QXDiamondViewController.m
Normal file
120
QXLive/Mine(音域)/Controller/钱包/QXDiamondViewController.m
Normal file
@@ -0,0 +1,120 @@
|
||||
//
|
||||
// QXDiamondViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/26.
|
||||
//
|
||||
|
||||
#import "QXDiamondViewController.h"
|
||||
#import "QXWalletTopView.h"
|
||||
#import "QXWithDrawInputView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXDiamondViewController ()<QXWithDrawInputViewDelegate>
|
||||
@property (nonatomic,strong)QXWalletTopView *topView;
|
||||
@property (nonatomic,strong)QXWithDrawInputView *withDrawInputView;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@end
|
||||
|
||||
@implementation QXDiamondViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"钻石兑币");
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
[self getPrice];
|
||||
}
|
||||
- (void)initSubViews{
|
||||
[self.view addSubview:self.topView];
|
||||
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
make.top.mas_equalTo(NavContentHeight+12);
|
||||
make.height.mas_equalTo(ScaleWidth(112));
|
||||
}];
|
||||
|
||||
[self.view addSubview:self.withDrawInputView];
|
||||
[self.withDrawInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
make.top.equalTo(self.topView.mas_bottom).offset(12);
|
||||
make.height.mas_equalTo(95);
|
||||
}];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] init];
|
||||
[self.commitBtn setTitle:QXText(@"确认兑换") forState:(UIControlStateNormal)];
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];;
|
||||
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[self.commitBtn addRoundedCornersWithRadius:21];
|
||||
self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.commitBtn addTarget:self action:@selector(commitAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.commitBtn];
|
||||
[self.commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(38);
|
||||
make.right.mas_equalTo(-38);
|
||||
make.height.mas_equalTo(42);
|
||||
make.bottom.mas_equalTo(-(kSafeAreaBottom));
|
||||
}];
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
-(void)getPrice{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
|
||||
weakSelf.topView.coin = earnings;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
[QXMineNetwork getWalletConfigSuccessBlock:^(NSString * _Nonnull coin_exchange_rate, NSString * _Nonnull withdrawal_service_fee, NSString * _Nonnull rmb_coin_ratio) {
|
||||
weakSelf.withDrawInputView.fee = coin_exchange_rate;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - QXWithDrawInputViewDelegate
|
||||
-(void)didClickAll{
|
||||
if (self.topView.coin.intValue == 0) {
|
||||
self.withDrawInputView.textField.text = @"0";
|
||||
}else{
|
||||
self.withDrawInputView.textField.text = [NSString stringWithFormat:@"%ld",self.topView.coin.longValue];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)commitAction:(UIButton*)sender{
|
||||
MJWeakSelf
|
||||
showLoadingInView(self.view);
|
||||
[QXMineNetwork roomCoinExchangeWithEarningsNum:self.withDrawInputView.textField.text successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
hideLoadingInView(self.view);
|
||||
showToast(@"兑换成功");
|
||||
[weakSelf getPrice];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
hideLoadingInView(self.view);
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
-(QXWalletTopView *)topView{
|
||||
if (!_topView) {
|
||||
_topView = [[QXWalletTopView alloc] init];
|
||||
_topView.type = QXWalletTopViewTypeDiamond;
|
||||
}
|
||||
return _topView;
|
||||
}
|
||||
-(QXWithDrawInputView *)withDrawInputView{
|
||||
if (!_withDrawInputView) {
|
||||
_withDrawInputView = [[QXWithDrawInputView alloc] init];
|
||||
_withDrawInputView.delegate = self;
|
||||
_withDrawInputView.type = QXWithDrawInputViewTypeExchangeCorn;
|
||||
}
|
||||
return _withDrawInputView;
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/钱包/QXRechargeViewcController.h
Normal file
16
QXLive/Mine(音域)/Controller/钱包/QXRechargeViewcController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXRechargeViewcController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/16.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRechargeViewcController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
82
QXLive/Mine(音域)/Controller/钱包/QXRechargeViewcController.m
Normal file
82
QXLive/Mine(音域)/Controller/钱包/QXRechargeViewcController.m
Normal file
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// QXRechargeViewcController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/16.
|
||||
//
|
||||
|
||||
#import "QXRechargeViewcController.h"
|
||||
#import "QXRechargeView.h"
|
||||
#import "QXWalletTopView.h"
|
||||
#import "QXPayTypeModel.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXRechargeViewcController ()
|
||||
@property (nonatomic,strong)QXWalletTopView *topView;
|
||||
@property (nonatomic,strong)QXRechargeView *rechargeView;
|
||||
@end
|
||||
|
||||
@implementation QXRechargeViewcController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
[self getPrice];
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(rechargeSuccess) name:noticeAlipayResult object:nil];
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"充值");
|
||||
}
|
||||
-(void)rechargeSuccess{
|
||||
[self getPrice];
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
[self.view addSubview:self.topView];
|
||||
[self.view addSubview:self.rechargeView];
|
||||
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
make.top.mas_equalTo(NavContentHeight+12);
|
||||
make.height.mas_equalTo(ScaleWidth(112));
|
||||
}];
|
||||
[self.rechargeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(0);
|
||||
make.right.mas_equalTo(0);
|
||||
make.top.equalTo(self.topView.mas_bottom).offset(12);
|
||||
make.bottom.mas_equalTo(-10);
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
-(void)getPrice{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
|
||||
weakSelf.topView.coin = coin;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(QXWalletTopView *)topView{
|
||||
if (!_topView) {
|
||||
_topView = [[QXWalletTopView alloc] init];
|
||||
}
|
||||
return _topView;
|
||||
}
|
||||
-(QXRechargeView *)rechargeView{
|
||||
if (!_rechargeView) {
|
||||
_rechargeView = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, ScaleWidth(112)+12, SCREEN_WIDTH, SCREEN_HEIGHT-ScaleWidth(112)-12-NavContentHeight-12)];
|
||||
}
|
||||
return _rechargeView;
|
||||
}
|
||||
-(void)dealloc{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/钱包/QXWalletViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/钱包/QXWalletViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXWalletViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXWalletViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
183
QXLive/Mine(音域)/Controller/钱包/QXWalletViewController.m
Normal file
183
QXLive/Mine(音域)/Controller/钱包/QXWalletViewController.m
Normal file
@@ -0,0 +1,183 @@
|
||||
//
|
||||
// QXWalletViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXWalletViewController.h"
|
||||
#import "QXRechargeViewcController.h"
|
||||
#import "QXWalletHomeTopView.h"
|
||||
#import "QXWalletHomeCell.h"
|
||||
#import "QXWithDrawViewController.h"
|
||||
#import "QXDiamondViewController.h"
|
||||
#import "QXCornRecordViewController.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXWithDrawBindViewController.h"
|
||||
#import "QXRealNameViewController.h"
|
||||
#import "QXBindMobileViewController.h"
|
||||
#import "QXAliBindViewController.h"
|
||||
|
||||
@interface QXWalletViewController ()<UITableViewDelegate,UITableViewDataSource,QXWalletHomeTopViewDelegate>
|
||||
@property (nonatomic,strong)QXWalletHomeTopView *topView;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,assign)BOOL isBind;
|
||||
@end
|
||||
|
||||
@implementation QXWalletViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
[self getPrice];
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"钱包");
|
||||
}
|
||||
- (void)initSubViews{
|
||||
NSArray *section1 = @[
|
||||
QXText(@"金币收支"),
|
||||
QXText(@"钻石收支"),
|
||||
];
|
||||
NSArray *section2 = @[
|
||||
QXText(@"钻石换币"),
|
||||
QXText(@"绑定管理"),
|
||||
];
|
||||
[self.dataArray addObject:section1];
|
||||
[self.dataArray addObject:section2];
|
||||
self.tableView.tableHeaderView = self.topView;
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate,UITableViewDataSource
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
NSArray *arr = self.dataArray[section];
|
||||
return arr.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXWalletHomeCell *cell = [QXWalletHomeCell cellWithTableView:tableView];
|
||||
NSArray *arr = self.dataArray[indexPath.section];
|
||||
cell.titleLabel.text = arr[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
|
||||
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, SCREEN_WIDTH-32, 36)];
|
||||
titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
titleLabel.textColor = RGB16(0x000000);
|
||||
if (section == 0) {
|
||||
titleLabel.text = QXText(@"我的账单");
|
||||
}else{
|
||||
titleLabel.text = QXText(@"其他功能");
|
||||
}
|
||||
[header addSubview:titleLabel];
|
||||
return header;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
return 36;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
return 50;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 1) {
|
||||
if (indexPath.row == 0) {
|
||||
QXDiamondViewController *vc = [[QXDiamondViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
QXWithDrawBindViewController *vc = [[QXWithDrawBindViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}else{
|
||||
QXCornRecordViewController *vc = [[QXCornRecordViewController alloc] init];
|
||||
vc.type = indexPath.row;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
-(void)didClickButtonIsRecharge:(BOOL)isRecharge{
|
||||
if (isRecharge) {
|
||||
QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
if (QXGlobal.shareGlobal.loginModel.auth == 0) {
|
||||
showToast(@"请先完成实名认证");
|
||||
QXRealNameViewController *vc = [[QXRealNameViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
return;
|
||||
}
|
||||
if (QXGlobal.shareGlobal.loginModel.mobile.length == 0) {
|
||||
showToast(@"请先绑定手机号");
|
||||
QXBindMobileViewController *vc = [[QXBindMobileViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
return;
|
||||
}
|
||||
if (!self.isBind) {
|
||||
showToast(@"请先绑定提现账号");
|
||||
QXAliBindViewController *vc = [[QXAliBindViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
return;
|
||||
}
|
||||
QXWithDrawViewController *vc = [[QXWithDrawViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)getPrice{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
|
||||
weakSelf.topView.coin = coin;
|
||||
weakSelf.topView.earnings = earnings;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
[QXMineNetwork walletPayTypeWithUserId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(QXPayTypeStatusModel * _Nonnull model) {
|
||||
if (model.wx.is_with_draw_open.intValue == 1 && model.wx.is_bind.intValue == 1) {
|
||||
weakSelf.isBind = YES;
|
||||
return;
|
||||
}
|
||||
if (model.ali.is_pay_open.intValue == 1 && model.ali.is_bind.intValue == 1) {
|
||||
weakSelf.isBind = YES;
|
||||
return;
|
||||
}
|
||||
if (model.bank.is_pay_open.intValue == 1 && model.bank.is_bind.intValue == 1) {
|
||||
weakSelf.isBind = YES;
|
||||
return;
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStylePlain)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
_tableView.sectionHeaderTopPadding = 0;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
-(QXWalletHomeTopView *)topView{
|
||||
if (!_topView) {
|
||||
_topView = [[QXWalletHomeTopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(110))];
|
||||
_topView.delegate = self;
|
||||
}
|
||||
return _topView;
|
||||
}
|
||||
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/钱包/QXWithDrawBindViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/钱包/QXWithDrawBindViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXWithDrawBindViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/9.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXWithDrawBindViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
103
QXLive/Mine(音域)/Controller/钱包/QXWithDrawBindViewController.m
Normal file
103
QXLive/Mine(音域)/Controller/钱包/QXWithDrawBindViewController.m
Normal file
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// QXWithDrawBindViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/9.
|
||||
//
|
||||
|
||||
#import "QXWithDrawBindViewController.h"
|
||||
#import "QXSettingCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXAliBindViewController.h"
|
||||
|
||||
@interface QXWithDrawBindViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong)UITableView *tableView;;
|
||||
@end
|
||||
|
||||
@implementation QXWithDrawBindViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
[self getPayType];
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"绑定管理");
|
||||
}
|
||||
-(void)initSubViews{
|
||||
[self.view addSubview:self.tableView];
|
||||
[self getPayType];
|
||||
}
|
||||
-(void)getPayType{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork walletPayTypeWithUserId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(QXPayTypeStatusModel * _Nonnull model) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
if (model.wx.is_with_draw_open.intValue == 1) {
|
||||
[weakSelf.dataArray addObject:model.wx];
|
||||
}
|
||||
if (model.ali.is_with_draw_open.intValue == 1) {
|
||||
[weakSelf.dataArray addObject:model.ali];
|
||||
}
|
||||
if (model.bank.is_with_draw_open.intValue == 1) {
|
||||
[weakSelf.dataArray addObject:model.bank];
|
||||
}
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXSettingCell *cell = [QXSettingCell cellWithTableView:tableView];
|
||||
cell.cellType = QXSettingCellTypeNormal;
|
||||
QXPayTypeModel *model = self.dataArray[indexPath.row];
|
||||
cell.titleLabel.text = model.name;
|
||||
cell.detailLabel.text = model.is_bind.intValue==1?@"已绑定":@"未绑定";
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXPayTypeModel *model = self.dataArray[indexPath.row];
|
||||
if ([model.name containsString:@"支付宝"]) {
|
||||
QXAliBindViewController *aliVC = [[QXAliBindViewController alloc] init];
|
||||
aliVC.isAli = YES;
|
||||
aliVC.model = model;
|
||||
[self.navigationController pushViewController:aliVC animated:YES];
|
||||
return;
|
||||
}
|
||||
if ([model.name containsString:@"银行卡"]) {
|
||||
QXAliBindViewController *aliVC = [[QXAliBindViewController alloc] init];
|
||||
aliVC.isAli = NO;
|
||||
aliVC.model = model;
|
||||
[self.navigationController pushViewController:aliVC animated:YES];
|
||||
}
|
||||
|
||||
}
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStyleGrouped)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.rowHeight = 42;
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
/*
|
||||
#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
|
||||
16
QXLive/Mine(音域)/Controller/钱包/QXWithDrawRecordVC.h
Normal file
16
QXLive/Mine(音域)/Controller/钱包/QXWithDrawRecordVC.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXWithDrawRecordVC.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/12.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXWithDrawRecordVC : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
110
QXLive/Mine(音域)/Controller/钱包/QXWithDrawRecordVC.m
Normal file
110
QXLive/Mine(音域)/Controller/钱包/QXWithDrawRecordVC.m
Normal file
@@ -0,0 +1,110 @@
|
||||
//
|
||||
// QXWithDrawRecordVC.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/12.
|
||||
//
|
||||
|
||||
#import "QXWithDrawRecordVC.h"
|
||||
#import "QXWalletDateView.h"
|
||||
#import "QXWithDrawRecordCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
|
||||
@interface QXWithDrawRecordVC ()<UITableViewDelegate,UITableViewDataSource,QXWalletDateViewDelegate>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)QXWalletDateView *dateView;
|
||||
|
||||
@property (nonatomic,strong)NSString* startTime;
|
||||
@property (nonatomic,strong)NSString* endTime;
|
||||
@end
|
||||
|
||||
@implementation QXWithDrawRecordVC
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = @"提现记录";
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
}
|
||||
|
||||
-(void)initSubViews{
|
||||
UIView *dateBg = [[UIView alloc] initWithFrame:CGRectMake(0, NavContentHeight+8, SCREEN_WIDTH, 48)];
|
||||
dateBg.backgroundColor = [UIColor clearColor];
|
||||
[dateBg addSubview:self.dateView];
|
||||
[self.view addSubview:dateBg];
|
||||
[self.view addSubview:self.tableView];
|
||||
self.page = 1;
|
||||
}
|
||||
-(void)getData{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork walletWithDrawRecordWithPage:self.page start_time:self.startTime end_time:self.endTime SuccessBlock:^(NSArray<QXWithDrawRecordModel *> * _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];
|
||||
}];
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXWithDrawRecordCell *cell = [QXWithDrawRecordCell cellWithTableView:tableView];
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
#pragma mark - QXWalletDateViewDelegate
|
||||
-(void)didSelectedStartDate:(NSString *)startDateString startDate:(NSDate *)startDate endDateString:(NSString *)endDateString endDate:(NSDate *)endDate{
|
||||
QXLOG(@"开始时间-%@ 结束时间-%@",startDateString,endDateString);
|
||||
self.startTime = startDateString;
|
||||
self.endTime = endDateString;
|
||||
self.page = 1;
|
||||
[self getData];
|
||||
}
|
||||
|
||||
-(QXWalletDateView *)dateView{
|
||||
if (!_dateView) {
|
||||
_dateView = [[QXWalletDateView alloc] initWithFrame:CGRectMake(16, 0, SCREEN_WIDTH-32, 38)];
|
||||
_dateView.delegate = self;
|
||||
}
|
||||
return _dateView;
|
||||
}
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight+48, SCREEN_WIDTH, SCREEN_HEIGHT -NavContentHeight-48) style:(UITableViewStylePlain)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.tableFooterView = [UIView new];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.rowHeight = 66;
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getData];
|
||||
}];
|
||||
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getData];
|
||||
}];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/Controller/钱包/QXWithDrawViewController.h
Normal file
16
QXLive/Mine(音域)/Controller/钱包/QXWithDrawViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXWithDrawViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/26.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXWithDrawViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
295
QXLive/Mine(音域)/Controller/钱包/QXWithDrawViewController.m
Normal file
295
QXLive/Mine(音域)/Controller/钱包/QXWithDrawViewController.m
Normal file
@@ -0,0 +1,295 @@
|
||||
//
|
||||
// QXWithDrawViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/26.
|
||||
//
|
||||
|
||||
#import "QXWithDrawViewController.h"
|
||||
#import "QXWalletTopView.h"
|
||||
#import "QXWithDrawInputView.h"
|
||||
#import "QXWithDrawTypeCell.h"
|
||||
#import "QXReVerificationPopView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXWithDrawRecordVC.h"
|
||||
|
||||
@interface QXWithDrawViewController ()<UITableViewDelegate,UITableViewDataSource,QXWithDrawInputViewDelegate>
|
||||
@property (nonatomic,strong)QXWalletTopView *topView;
|
||||
@property (nonatomic,strong)QXWithDrawInputView *withDrawInputView;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)QXPayTypeModel *selectedPayTypeModel;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@property (nonatomic,strong)UIButton *agreeBtn;
|
||||
@property (nonatomic,strong)YYLabel *textLabel;
|
||||
@property (nonatomic,strong)NSString *protocolTitle;
|
||||
@property (nonatomic,strong)NSString *protocolUrl;
|
||||
@end
|
||||
|
||||
@implementation QXWithDrawViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
[self getPrice];
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = QXText(@"提现");
|
||||
UIButton*recordBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
|
||||
[recordBtn setTitle:QXText(@"提现记录") forState:(UIControlStateNormal)];
|
||||
[recordBtn setTitleColor:RGB16(0xFF8ACC) forState:(UIControlStateNormal)];
|
||||
recordBtn.titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
[recordBtn addTarget:self action:@selector(recordAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:recordBtn];
|
||||
}
|
||||
- (void)initSubViews{
|
||||
self.protocolTitle = @"《灵活就业合作伙伴协议》";
|
||||
QXPayTypeModel *model1 = [[QXPayTypeModel alloc] init];
|
||||
model1.type = @"1";
|
||||
model1.name = @"微信";
|
||||
model1.icon = @"recharge_wechat";
|
||||
QXPayTypeModel *model2 = [[QXPayTypeModel alloc] init];
|
||||
model2.type = @"2";
|
||||
model2.name = @"支付宝";
|
||||
model2.icon = @"recharge_alipay";
|
||||
[self.dataArray addObject:model1];
|
||||
[self.dataArray addObject:model2];
|
||||
[self.view addSubview:self.topView];
|
||||
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
make.top.mas_equalTo(NavContentHeight+12);
|
||||
make.height.mas_equalTo(ScaleWidth(112));
|
||||
}];
|
||||
|
||||
[self.view addSubview:self.withDrawInputView];
|
||||
[self.withDrawInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
make.top.equalTo(self.topView.mas_bottom).offset(12);
|
||||
make.height.mas_equalTo(95);
|
||||
}];
|
||||
|
||||
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
make.top.equalTo(self.withDrawInputView.mas_bottom).offset(20);
|
||||
make.bottom.equalTo(self.view).offset(-kSafeAreaBottom);
|
||||
}];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] init];
|
||||
[self.commitBtn setTitle:QXText(@"立即提现") forState:(UIControlStateNormal)];
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];;
|
||||
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
[self.commitBtn addRoundedCornersWithRadius:21];
|
||||
self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.commitBtn addTarget:self action:@selector(withDrawAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.commitBtn];
|
||||
[self.commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(38);
|
||||
make.right.mas_equalTo(-38);
|
||||
make.height.mas_equalTo(42);
|
||||
make.bottom.mas_equalTo(-(kSafeAreaBottom));
|
||||
}];
|
||||
[self getPrice];
|
||||
|
||||
NSString *str = [NSString stringWithFormat:@"%@%@",QXText(@"我已阅读并同意"),self.protocolTitle];
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
|
||||
MJWeakSelf
|
||||
[attr yy_setTextHighlightRange:[str rangeOfString:self.protocolTitle] color:RGB16(0xFF8ACC) backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
QXLOG(@"点击灵活就业协议");
|
||||
QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init];
|
||||
vc.urlStr = weakSelf.protocolUrl;
|
||||
[weakSelf.navigationController pushViewController:vc animated:YES];
|
||||
}];
|
||||
[attr yy_setFont:[UIFont systemFontOfSize:12] range:NSMakeRange(0, str.length)];
|
||||
[attr yy_setColor:RGB16(0x333333) range:NSMakeRange(0, str.length)];
|
||||
[attr yy_setColor:RGB16(0xFF8ACC) range:[str rangeOfString:self.protocolTitle]];
|
||||
_textLabel = [[YYLabel alloc] init];
|
||||
_textLabel.attributedText = attr;
|
||||
_textLabel.userInteractionEnabled = YES;
|
||||
[self.view addSubview:self.textLabel];
|
||||
[self.textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(42);
|
||||
make.centerX.equalTo(self.view).offset(17);
|
||||
make.bottom.equalTo(self.commitBtn.mas_top).offset(-10);
|
||||
}];
|
||||
|
||||
|
||||
self.agreeBtn = [[UIButton alloc] init];
|
||||
[self.agreeBtn setImage:[UIImage imageNamed:@"login_agreement_nor"] forState:(UIControlStateNormal)];
|
||||
[self.agreeBtn setImage:[UIImage imageNamed:@"login_agreement_sel"] forState:(UIControlStateSelected)];
|
||||
[self.view addSubview:self.agreeBtn];
|
||||
[self.agreeBtn addTarget:self action:@selector(agreeAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.agreeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.textLabel.mas_left);
|
||||
make.width.height.mas_equalTo(40);
|
||||
make.centerY.equalTo(self.textLabel);
|
||||
}];
|
||||
}
|
||||
-(void)recordAction{
|
||||
QXWithDrawRecordVC *vc = [[QXWithDrawRecordVC alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)getPrice{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
|
||||
weakSelf.topView.coin = earnings;
|
||||
weakSelf.protocolUrl = url;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
[QXMineNetwork getWalletConfigSuccessBlock:^(NSString * _Nonnull coin_exchange_rate, NSString * _Nonnull withdrawal_service_fee, NSString * _Nonnull rmb_coin_ratio) {
|
||||
weakSelf.withDrawInputView.fee = withdrawal_service_fee;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
[QXMineNetwork walletPayTypeWithUserId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(QXPayTypeStatusModel * _Nonnull model) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
if (model.wx.is_with_draw_open.intValue == 1 && model.wx.is_bind.intValue == 1) {
|
||||
[weakSelf.dataArray addObject:model.wx];
|
||||
}
|
||||
if (model.ali.is_pay_open.intValue == 1 && model.ali.is_bind.intValue == 1) {
|
||||
[weakSelf.dataArray addObject:model.ali];
|
||||
}
|
||||
if (model.bank.is_pay_open.intValue == 1 && model.bank.is_bind.intValue == 1) {
|
||||
[weakSelf.dataArray addObject:model.bank];
|
||||
}
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
-(void)withDrawAction:(UIButton*)sender{
|
||||
if (self.agreeBtn.selected == NO) {
|
||||
showToast(@"请先阅读并同意灵活就业协议");
|
||||
return;
|
||||
}
|
||||
if (self.withDrawInputView.textField.text.longValue == 0) {
|
||||
showToast(@"请输入提现金额");
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
QXReVerificationPopView *popView = [[QXReVerificationPopView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(200))];
|
||||
popView.commitBlock = ^(NSString * _Nonnull code) {
|
||||
QXLOG(@"验证码为%@",code);
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
[weakSelf withDrawNetworkWithCode:code];
|
||||
}];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:popView popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)withDrawNetworkWithCode:(NSString*)code{
|
||||
MJWeakSelf
|
||||
showLoadingInView(self.view);
|
||||
[QXMineNetwork walletWithDrawWithNumber:self.withDrawInputView.textField.text type:self.selectedPayTypeModel.type sms_code:code successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
hideLoadingInView(weakSelf.view);
|
||||
showToast(@"提现成功");
|
||||
[self getPrice];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
hideLoadingInView(weakSelf.view);
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate,UITableViewDataSource
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXWithDrawTypeCell *cell = [QXWithDrawTypeCell cellWithTableView:tableView];
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 35)];
|
||||
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, SCREEN_WIDTH-32, 35)];
|
||||
titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
titleLabel.textColor = QXConfig.textColor;
|
||||
titleLabel.text = QXText(@"提现方式");
|
||||
[header addSubview:titleLabel];
|
||||
return header;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
return 35;
|
||||
}
|
||||
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXPayTypeModel *model = self.dataArray[indexPath.row];
|
||||
if (model == self.selectedPayTypeModel) {
|
||||
return;
|
||||
}
|
||||
if (self.selectedPayTypeModel) {
|
||||
self.selectedPayTypeModel.isSelected = NO;
|
||||
}
|
||||
model.isSelected = YES;
|
||||
self.selectedPayTypeModel = model;
|
||||
[tableView reloadData];
|
||||
}
|
||||
#pragma mark - QXWithDrawInputViewDelegate 提现
|
||||
-(void)didClickAll{
|
||||
if (self.topView.coin.intValue == 0) {
|
||||
self.withDrawInputView.textField.text = @"0";
|
||||
}else{
|
||||
// self.withDrawInputView.textField.text = self.topView.coin;
|
||||
self.withDrawInputView.textField.text = [NSString stringWithFormat:@"%ld",self.topView.coin.longValue];
|
||||
}
|
||||
}
|
||||
|
||||
-(QXWalletTopView *)topView{
|
||||
if (!_topView) {
|
||||
_topView = [[QXWalletTopView alloc] init];
|
||||
_topView.type = QXWalletTopViewTypeWithDraw;
|
||||
}
|
||||
return _topView;
|
||||
}
|
||||
-(QXWithDrawInputView *)withDrawInputView{
|
||||
if (!_withDrawInputView) {
|
||||
_withDrawInputView = [[QXWithDrawInputView alloc] init];
|
||||
_withDrawInputView.delegate = self;
|
||||
_withDrawInputView.type = QXWithDrawInputViewTypeWithDraw;
|
||||
}
|
||||
return _withDrawInputView;
|
||||
}
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStyleGrouped)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.rowHeight = 40;
|
||||
_tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
/*
|
||||
#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.
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
-(void)agreeAction:(UIButton*)sender{
|
||||
self.agreeBtn.selected = !self.agreeBtn.selected;
|
||||
}
|
||||
@end
|
||||
41
QXLive/Mine(音域)/Model/QXCoinDetailModel.h
Normal file
41
QXLive/Mine(音域)/Model/QXCoinDetailModel.h
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// QXCoinDetailModel.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/8.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXCoinDetailModel : NSObject
|
||||
/// 用户id
|
||||
@property (nonatomic,strong)NSString *user_id;
|
||||
/// 变动类型
|
||||
@property (nonatomic,strong)NSString *change_type;
|
||||
/// 变动类型
|
||||
@property (nonatomic,strong)NSString *change_type_name;
|
||||
/// 变动金额
|
||||
@property (nonatomic,strong)NSString *change_value;
|
||||
/// 备注
|
||||
@property (nonatomic,strong)NSString *remarks;
|
||||
/// 时间
|
||||
@property (nonatomic,strong)NSString *createtime;
|
||||
|
||||
@end
|
||||
|
||||
@interface QXWithDrawRecordModel :NSObject
|
||||
/// 用户id
|
||||
@property (nonatomic,strong)NSString *name;
|
||||
/// 变动类型
|
||||
@property (nonatomic,strong)NSString *money;
|
||||
/// 1待处理2已通过3已拒绝 4打款中[云账户]5打款失败[云账户]6已打款[云账户]
|
||||
@property (nonatomic,strong)NSString *status;
|
||||
/// 变动金额
|
||||
@property (nonatomic,strong)NSString *status_str;
|
||||
/// 时间
|
||||
@property (nonatomic,strong)NSString *createtime;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
18
QXLive/Mine(音域)/Model/QXCoinDetailModel.m
Normal file
18
QXLive/Mine(音域)/Model/QXCoinDetailModel.m
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// QXCoinDetailModel.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/8.
|
||||
//
|
||||
|
||||
#import "QXCoinDetailModel.h"
|
||||
|
||||
@implementation QXCoinDetailModel
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXWithDrawRecordModel
|
||||
|
||||
|
||||
|
||||
@end
|
||||
89
QXLive/Mine(音域)/Model/QXDayTaskModel.h
Normal file
89
QXLive/Mine(音域)/Model/QXDayTaskModel.h
Normal file
@@ -0,0 +1,89 @@
|
||||
//
|
||||
// QXDayTaskModel.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/10.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class QXGiftBoxModel,QXDayTaskListModel,QXDayTaskTypeModel;
|
||||
@interface QXDayTaskModel : NSObject
|
||||
/// 今日累计获得金币
|
||||
@property(nonatomic,strong)NSString *user_gold;
|
||||
/// 盲盒信息
|
||||
@property(nonatomic,strong)NSArray <QXGiftBoxModel*>*gift_box_list;
|
||||
|
||||
@property(nonatomic,strong)QXDayTaskTypeModel*tasks;
|
||||
|
||||
@end
|
||||
|
||||
@interface QXGiftBoxModel : NSObject
|
||||
@property(nonatomic,strong)NSString *id;
|
||||
/// 名称
|
||||
@property(nonatomic,strong)NSString *name;
|
||||
/// 最高可获得1000金币
|
||||
@property(nonatomic,strong)NSString *title;
|
||||
/// icon
|
||||
@property(nonatomic,strong)NSString *icon;
|
||||
/// 满 多少
|
||||
@property(nonatomic,strong)NSString *highest_gain;
|
||||
|
||||
@property(nonatomic,strong)NSString *meet;
|
||||
@property(nonatomic,strong)NSString *unlock_progress;
|
||||
@property(nonatomic,strong)NSString *all_number;
|
||||
@property(nonatomic,strong)NSString *taday_number;
|
||||
@property(nonatomic,strong)NSString *taday_number_left;
|
||||
/// 状态:0 '未解锁 1已解锁 2抽奖次数已用完
|
||||
@property(nonatomic,strong)NSString *status;
|
||||
@property(nonatomic,strong)NSString *status_str;
|
||||
@end
|
||||
|
||||
@interface QXDayTaskTypeModel : NSObject
|
||||
/// 每日特殊任务2
|
||||
@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*daily_tasks_special;
|
||||
/// 每日常规任务
|
||||
@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*daily_tasks;
|
||||
/// 平台任务列表
|
||||
@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*usual_tasks;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@interface QXDayTaskListModel : NSObject
|
||||
/// 任务id
|
||||
@property(nonatomic,strong)NSString *task_id;
|
||||
/// 名称
|
||||
@property(nonatomic,strong)NSString *task_name;
|
||||
/// 图标
|
||||
@property(nonatomic,strong)NSString *icon;
|
||||
/// 奖励金币
|
||||
@property(nonatomic,strong)NSString *gold_reward;
|
||||
/// 目标完成数量
|
||||
@property(nonatomic,strong)NSString *target_quantity;
|
||||
/// 任务类型 1每日任务 2每日特殊任务 3平台常规任务
|
||||
@property(nonatomic,strong)NSString *task_type;
|
||||
/// 任务状态:1完成 2去领取 3已领取
|
||||
@property(nonatomic,strong)NSString *task_status;
|
||||
/// 任务状态
|
||||
@property(nonatomic,strong)NSString *task_type_str;
|
||||
/// 2 观看直播
|
||||
@property(nonatomic,strong)NSString *processing_type;
|
||||
/// 目标id
|
||||
@property(nonatomic,strong)NSString *from_id;
|
||||
/// 0 记录次数 1 计时
|
||||
@property(nonatomic,strong)NSString *is_time;
|
||||
@end
|
||||
|
||||
|
||||
@interface QXTaskGiftBoxRecordModel : NSObject
|
||||
/// 初级礼盒
|
||||
@property(nonatomic,strong)NSString *gift_bag_name;
|
||||
/// 初级礼盒
|
||||
@property(nonatomic,strong)NSString *gift_name;
|
||||
/// 初级礼盒
|
||||
@property(nonatomic,strong)NSString *createtime;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
45
QXLive/Mine(音域)/Model/QXDayTaskModel.m
Normal file
45
QXLive/Mine(音域)/Model/QXDayTaskModel.m
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// QXDayTaskModel.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/10.
|
||||
//
|
||||
|
||||
#import "QXDayTaskModel.h"
|
||||
|
||||
@implementation QXDayTaskModel
|
||||
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
|
||||
return @{
|
||||
@"tasks" : @"QXDayTaskTypeModel",
|
||||
@"gift_box_list" : @"QXGiftBoxModel",
|
||||
};
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXGiftBoxModel
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXDayTaskTypeModel
|
||||
|
||||
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
|
||||
return @{
|
||||
@"daily_tasks" : @"QXDayTaskListModel",
|
||||
@"usual_tasks" : @"QXDayTaskListModel",
|
||||
@"daily_tasks_special": @"QXDayTaskListModel",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXDayTaskListModel
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXTaskGiftBoxRecordModel
|
||||
|
||||
|
||||
|
||||
@end
|
||||
67
QXLive/Mine(音域)/Model/QXGiftModel.h
Normal file
67
QXLive/Mine(音域)/Model/QXGiftModel.h
Normal file
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// QXGiftModel.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXGiftModel : NSObject
|
||||
/// 背包num
|
||||
@property (nonatomic,strong)NSString *num;
|
||||
/// 礼物名称
|
||||
@property (nonatomic,strong)NSString *gift_name;
|
||||
/// 礼物图片
|
||||
@property (nonatomic,strong)NSString *base_image;
|
||||
/// 礼物特效
|
||||
@property (nonatomic,strong)NSString *play_image;
|
||||
/// 礼物价格
|
||||
@property (nonatomic,strong)NSString *gift_price;
|
||||
/// 礼物ID
|
||||
@property (nonatomic,strong)NSString *gift_id;
|
||||
|
||||
@property (nonatomic,strong)NSString *rule;
|
||||
@property (nonatomic,strong)NSString *gift_bag_name;
|
||||
@property (nonatomic,strong)NSString *rule_url;
|
||||
|
||||
@property (nonatomic,assign)BOOL isSelected;
|
||||
@end
|
||||
|
||||
@interface QXGiftLabelModel :NSObject
|
||||
/// id
|
||||
@property (nonatomic,strong)NSString *id;
|
||||
/// 标签名称
|
||||
@property (nonatomic,strong)NSString *name;
|
||||
@end
|
||||
|
||||
@interface QXBagRecordModel :NSObject
|
||||
/// 收入|支出说明
|
||||
@property (nonatomic,strong)NSString *remarks;
|
||||
/// 礼物数量
|
||||
@property (nonatomic,strong)NSString *gift_num;
|
||||
/// 礼物名称
|
||||
@property (nonatomic,strong)NSString *gift_name;
|
||||
/// 礼物图片
|
||||
@property (nonatomic,strong)NSString *gift_image;
|
||||
/// 时间
|
||||
@property (nonatomic,strong)NSString *time;
|
||||
@end
|
||||
|
||||
@interface QXFirstRechargeModel : NSObject
|
||||
/// 9|30元
|
||||
@property (nonatomic,strong)NSString *name;
|
||||
/// 9元限时抢
|
||||
@property (nonatomic,strong)NSString *title1;
|
||||
/// 88元礼包
|
||||
@property (nonatomic,strong)NSString *title2;
|
||||
/// 充值金额
|
||||
@property (nonatomic,strong)NSString *money;
|
||||
/// 时间
|
||||
@property (nonatomic,strong)NSString *time;
|
||||
/// 礼物列表
|
||||
@property (nonatomic,strong)NSArray <QXGiftModel*>*gift_list;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
35
QXLive/Mine(音域)/Model/QXGiftModel.m
Normal file
35
QXLive/Mine(音域)/Model/QXGiftModel.m
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// QXGiftModel.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/11.
|
||||
//
|
||||
|
||||
#import "QXGiftModel.h"
|
||||
|
||||
@implementation QXGiftModel
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXGiftLabelModel
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXBagRecordModel
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXFirstRechargeModel
|
||||
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
|
||||
return @{
|
||||
@"gift_list" : @"QXGiftModel"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
43
QXLive/Mine(音域)/Model/QXPayTypeModel.h
Normal file
43
QXLive/Mine(音域)/Model/QXPayTypeModel.h
Normal file
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// QXPayTypeModel.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/16.
|
||||
//
|
||||
|
||||
#import "QXBaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXPayTypeModel : QXBaseModel
|
||||
/// 支付id
|
||||
@property (nonatomic,strong)NSString *type;
|
||||
/// 支付icon
|
||||
@property (nonatomic,strong)NSString *icon;
|
||||
/// 支付名称
|
||||
@property (nonatomic,strong)NSString *name;
|
||||
/// 提现状态是否开启,1-开启,0-隐藏
|
||||
@property (nonatomic,strong)NSString *is_with_draw_open;
|
||||
/// 支付状态是否开启
|
||||
@property (nonatomic,strong)NSString *is_pay_open;
|
||||
/// 是否绑定,1-绑定,0-未绑定
|
||||
@property (nonatomic,strong)NSString *is_bind;
|
||||
|
||||
@property (nonatomic,assign)BOOL isSelected;
|
||||
@end
|
||||
|
||||
@interface QXPayTypeStatusModel : NSObject
|
||||
|
||||
@property (nonatomic,strong)QXPayTypeModel *ali;
|
||||
|
||||
@property (nonatomic,strong)QXPayTypeModel *wx;
|
||||
|
||||
@property (nonatomic,strong)QXPayTypeModel *bank;
|
||||
|
||||
@property (nonatomic,strong)QXPayTypeModel *wx_tl;
|
||||
|
||||
@property (nonatomic,strong)QXPayTypeModel *ali_tl;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
27
QXLive/Mine(音域)/Model/QXPayTypeModel.m
Normal file
27
QXLive/Mine(音域)/Model/QXPayTypeModel.m
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// QXPayTypeModel.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/16.
|
||||
//
|
||||
|
||||
#import "QXPayTypeModel.h"
|
||||
|
||||
@implementation QXPayTypeModel
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXPayTypeStatusModel
|
||||
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
|
||||
return @{
|
||||
@"ali" : @"QXPayTypeModel",
|
||||
@"wx" : @"QXPayTypeModel",
|
||||
@"bank" : @"QXPayTypeModel",
|
||||
@"wx_tl" : @"QXPayTypeModel",
|
||||
@"ali_tl" : @"QXPayTypeModel",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
53
QXLive/Mine(音域)/Model/QXPhotoModel.h
Normal file
53
QXLive/Mine(音域)/Model/QXPhotoModel.h
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// QXPhotoModel.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXPhotoModel : NSObject
|
||||
/// id
|
||||
@property (nonatomic,strong)NSString*id;
|
||||
/// 相册名称
|
||||
@property (nonatomic,strong)NSString*name;
|
||||
/// 封面图
|
||||
@property (nonatomic,strong)NSString*image;
|
||||
/// 密码 0 不需要密码 1 需要密码
|
||||
@property (nonatomic,strong)NSString*is_pwd;
|
||||
/// 密码
|
||||
@property (nonatomic,strong)NSString*pwd;
|
||||
/// 浏览数
|
||||
@property (nonatomic,strong)NSString*read_num;
|
||||
/// 图片上传时间
|
||||
@property (nonatomic,strong)NSString*createtime;
|
||||
|
||||
/// 选择状态
|
||||
@property (nonatomic,assign)BOOL isSelected;
|
||||
@end
|
||||
|
||||
@interface QXPhotoDetailModel : NSObject
|
||||
/// 相册id
|
||||
@property (nonatomic,strong)NSString *id;
|
||||
/// 相册名称
|
||||
@property (nonatomic,strong)NSString*name;
|
||||
/// 封面图
|
||||
@property (nonatomic,strong)NSString *image;
|
||||
/// 浏览树
|
||||
@property (nonatomic,strong)NSString *read_num;
|
||||
/// 点赞数
|
||||
@property (nonatomic,strong)NSString*like_num;
|
||||
/// 图片数量
|
||||
@property (nonatomic,strong)NSString*count;
|
||||
/// 密码
|
||||
@property (nonatomic,strong)NSString*pwd;
|
||||
/// 是否已点赞 0未点赞 1已点赞
|
||||
@property (nonatomic,strong)NSString*is_like;
|
||||
/// 图片数组
|
||||
@property (nonatomic,strong)NSArray<QXPhotoModel*> *image_list;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
20
QXLive/Mine(音域)/Model/QXPhotoModel.m
Normal file
20
QXLive/Mine(音域)/Model/QXPhotoModel.m
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// QXPhotoModel.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import "QXPhotoModel.h"
|
||||
|
||||
@implementation QXPhotoModel
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXPhotoDetailModel
|
||||
|
||||
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
|
||||
return @{@"image_list" : @"QXPhotoModel"};
|
||||
}
|
||||
|
||||
@end
|
||||
18
QXLive/Mine(音域)/Model/QXRechargeListModel.h
Normal file
18
QXLive/Mine(音域)/Model/QXRechargeListModel.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// QXRechargeListModel.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRechargeListModel : NSObject
|
||||
@property (nonatomic,strong)NSString *money;
|
||||
@property (nonatomic,strong)NSString *coins;
|
||||
@property (nonatomic,assign)BOOL isSelected;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
12
QXLive/Mine(音域)/Model/QXRechargeListModel.m
Normal file
12
QXLive/Mine(音域)/Model/QXRechargeListModel.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// QXRechargeListModel.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/9.
|
||||
//
|
||||
|
||||
#import "QXRechargeListModel.h"
|
||||
|
||||
@implementation QXRechargeListModel
|
||||
|
||||
@end
|
||||
109
QXLive/Mine(音域)/Model/QXRoomListModel.h
Normal file
109
QXLive/Mine(音域)/Model/QXRoomListModel.h
Normal file
@@ -0,0 +1,109 @@
|
||||
//
|
||||
// QXRoomListModel.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/10.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "QXUserModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class QXRoomListCpModel;
|
||||
@interface QXRoomListModel : NSObject
|
||||
/// 房间ID
|
||||
@property (nonatomic,strong)NSString*room_id;
|
||||
/// 房间编码
|
||||
@property (nonatomic,strong)NSString*room_number;
|
||||
/// 用户ID
|
||||
@property (nonatomic,strong)NSString*user_id;
|
||||
/// 昵称
|
||||
@property (nonatomic,strong)NSString*nickname;
|
||||
/// 房间名称
|
||||
@property (nonatomic,strong)NSString*room_name;
|
||||
/// 房间封面图
|
||||
@property (nonatomic,strong)NSString*room_cover;
|
||||
/// 房间状态 1待审核 2审核通过 3审核失败
|
||||
@property (nonatomic,strong)NSString*apply_status;
|
||||
/// 1正常2封禁3关闭
|
||||
@property (nonatomic,strong)NSString*room_status;
|
||||
/// 房间密码
|
||||
@property (nonatomic,strong)NSString*room_password;
|
||||
/// 房间类型ID
|
||||
@property (nonatomic,strong)NSString*type_id;
|
||||
/// 类型名称
|
||||
@property (nonatomic,strong)NSString*type_name;
|
||||
/// 类型图片
|
||||
@property (nonatomic,strong)NSString*label_icon;
|
||||
/// 是否使用靓号
|
||||
@property (nonatomic,strong)NSString*is_use_code;
|
||||
/// 今日收益
|
||||
@property (nonatomic,strong)NSString*today_profit;
|
||||
/// 在线人数
|
||||
@property (nonatomic,strong)NSString*online_num;
|
||||
/// 收益比例
|
||||
@property (nonatomic,strong)NSString*ratio;
|
||||
|
||||
/// 访问人数
|
||||
@property (nonatomic,strong)NSString*visit_num;
|
||||
/// 房间关注数
|
||||
@property (nonatomic,strong)NSString*follow_num;
|
||||
/// 我的cp房
|
||||
@property (nonatomic,strong)NSArray<QXRoomListCpModel*>*cp_room;
|
||||
/// 列表
|
||||
@property (nonatomic,strong)NSArray<QXUserHomeModel*>*user_list;
|
||||
/// 火热值
|
||||
@property (nonatomic,strong)NSString*hot_value;
|
||||
@end
|
||||
|
||||
|
||||
@interface QXRoomListCpModel : NSObject
|
||||
/// cp列表id
|
||||
@property (nonatomic,strong)NSString*room_id;
|
||||
/// 是否使用靓号
|
||||
@property (nonatomic,strong)NSString*room_name;
|
||||
/// 今日收益
|
||||
@property (nonatomic,strong)NSString*room_number;
|
||||
/// 在线人数
|
||||
@property (nonatomic,strong)NSString*end_time;
|
||||
/// 访问人数
|
||||
@property (nonatomic,strong)NSString*earnings;
|
||||
/// 头像1
|
||||
@property (nonatomic,strong)NSString*user1_avatar;
|
||||
/// 头像2
|
||||
@property (nonatomic,strong)NSString*user2_avatar;
|
||||
/// 关系
|
||||
@property (nonatomic,strong)NSString*relation;
|
||||
@end
|
||||
|
||||
|
||||
@interface QXMyRoomHistory : NSObject
|
||||
/// cp列表id
|
||||
@property (nonatomic,strong)NSString*room_id;
|
||||
/// 房间名称
|
||||
@property (nonatomic,strong)NSString*room_name;
|
||||
/// 房间号
|
||||
@property (nonatomic,strong)NSString*room_number;
|
||||
///封面图
|
||||
@property (nonatomic,strong)NSString*room_cover;
|
||||
/// 简介
|
||||
@property (nonatomic,strong)NSString*room_intro;
|
||||
/// 标签图
|
||||
@property (nonatomic,strong)NSString*label_icon;
|
||||
/// label_id
|
||||
@property (nonatomic,strong)NSString*label_id;
|
||||
/// 房间人数
|
||||
@property (nonatomic,strong)NSString*user_count;
|
||||
///
|
||||
@property (nonatomic,strong)NSString*hot_value;
|
||||
/// 房间密码
|
||||
@property (nonatomic,strong)NSString*room_password;
|
||||
@end
|
||||
|
||||
@interface QXMyRoomType : NSObject
|
||||
/// 房间人数
|
||||
@property (nonatomic,strong)NSString*id;
|
||||
/// 房间密码
|
||||
@property (nonatomic,strong)NSString*label_name;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
35
QXLive/Mine(音域)/Model/QXRoomListModel.m
Normal file
35
QXLive/Mine(音域)/Model/QXRoomListModel.m
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// QXRoomListModel.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/10.
|
||||
//
|
||||
|
||||
#import "QXRoomListModel.h"
|
||||
|
||||
@implementation QXRoomListModel
|
||||
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
|
||||
return @{@"cp_room" : @"QXRoomListCpModel",@"user_list":@"QXUserHomeModel"};
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXRoomListCpModel
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXMyRoomHistory
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXMyRoomType
|
||||
|
||||
|
||||
|
||||
@end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user