This commit is contained in:
启星
2025-12-13 00:43:57 +08:00
parent ad6cd82a05
commit 999bf3d804
41 changed files with 1017 additions and 168 deletions

View File

@@ -171,8 +171,7 @@
};
v.authActionBlock = ^{
[[QXGlobal shareGlobal] hideViewBlock:^{
QXRoomSingerAuthViewController *vc = [[QXRoomSingerAuthViewController alloc] init];
vc.singer_status = weakSelf.userModel.singer_status;
QXRealNameViewController *vc = [[QXRealNameViewController alloc] init];
[weakSelf.navigationController pushViewController:vc animated:YES];
}];
};

View File

@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXUserHomePageViewController : QXBaseViewController
@property (nonatomic,strong)NSString *user_id;
@property (nonatomic,assign)BOOL isGiftWall;
/// 是否是相册
@property (nonatomic,assign)BOOL isAlbum;
@end
NS_ASSUME_NONNULL_END

View File

@@ -79,6 +79,9 @@
if (self.isGiftWall) {
self.categoryView.defaultSelectedIndex = 1;
}
if (self.isAlbum) {
self.categoryView.defaultSelectedIndex = 2;
}
self.categoryView.backgroundColor = [UIColor clearColor];
JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init];
indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];

View File

@@ -11,8 +11,15 @@
#import "QXDayTaskRuleView.h"
#import "QXMineNetwork.h"
#import "QXTaskGiftRecordVC.h"
#import "QXRealNameViewController.h"
#import "QXUserHomePageViewController.h"
#import "QXGuildViewController.h"
#import "QXWithDrawBindViewController.h"
#import "QXRechargeViewcController.h"
#import "QXSignInAppView.h"
#import "QXCreatPhotosViewController.h"
@interface QXTaskViewController ()<UITableViewDataSource,UITableViewDelegate>
@interface QXTaskViewController ()<UITableViewDataSource,UITableViewDelegate,QXDayTaskCellDelegate>
@property (nonatomic,strong)QXDayTaskTopView *topView;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)QXDayTaskModel *model;
@@ -42,7 +49,7 @@
}
- (void)initSubViews{
self.bgImageHidden = YES;
self.view.backgroundColor = RGB16(0xD7CDFF);
self.view.backgroundColor = RGB16(0xE3FAE4);
self.tableView.tableHeaderView = self.topView;
[self.view addSubview:self.tableView];
}
@@ -51,6 +58,15 @@
MJWeakSelf
[QXMineNetwork getDayTaskListSuccessBlock:^(QXDayTaskModel * _Nonnull model) {
weakSelf.model = model;
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:model.tasks];
for (int i = 0 ; i < model.tasks.count; i++) {
QXDayTaskTypeModel*md = model.tasks[i];
if (md.task_list.count == 0) {
[weakSelf.dataArray removeObjectAtIndex:i];
}
}
weakSelf.model.tasks = weakSelf.dataArray;
weakSelf.topView.model = model;
[weakSelf.tableView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
@@ -69,43 +85,95 @@
return _topView;
}
-(void)didClickFinishTaskWithModel:(QXDayTaskListModel *)taskModel{
if ([taskModel.task_id isEqualToString:@"1"]) {
QXSignInAppView *signView = [[QXSignInAppView alloc] init];
[signView showInView:self.view];
return;
}
if (taskModel.task_status.intValue == 1) {
// if (taskModel.task_id.intValue == 9 || taskModel.task_id.intValue == 10) {
//// QXGlobal.shareGlobal.taskModel = self.model;
// if ([[QXGlobal shareGlobal].roomId isEqualToString:taskModel.from_id]) {
// [[QXGlobal shareGlobal] popToRoomViewController];
// }
// [[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.from_id isRejoin:NO navagationController:self.viewController.navigationController];
// }
if (taskModel.jump_type.intValue == 0) {
return;
}else if (taskModel.jump_type.intValue == 1) {
QXRealNameViewController *vc = [[QXRealNameViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 2) {
QXCreatPhotosViewController *vc = [[QXCreatPhotosViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 3) {
QXWithDrawBindViewController *vc = [[QXWithDrawBindViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 4) {
// if (taskModel.from_id.longLongValue > 0) {
showLoadingInView(self.view);
[QXMineNetwork getRoomTaskJumpRoomWithTaskId:taskModel.task_id successBlock:^(NSString * _Nonnull roomId) {
hideLoadingInView(self.view);
if (roomId.longLongValue > 0) {
NSDictionary *dict = @{@"status":@"1",@"room_id":taskModel.from_id?:@""};
NSString *jsonStr = [dict jsonStringEncoded];
[[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeMasterTask) userId:taskModel.student_id];
[QXGlobal.shareGlobal joinRoomWithRoomId:roomId isRejoin:NO navagationController:self.navigationController];
}else{
showToast(@"暂无此类型房间");
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
hideLoadingInView(self.view);
showToast(msg);
}];
// }else{
// showToast(@"暂无此类型房间");
// }
return;
}else if (taskModel.jump_type.intValue == 5) {
QXGuildViewController *vc = [[QXGuildViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 6) {
QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 7) {
}
}else if (taskModel.task_status.intValue == 2) {
MJWeakSelf
[QXMineNetwork dayTaskDrawWithTaskId:taskModel.task_id student_id:taskModel.student_id successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"领取成功");
[weakSelf getDayTask];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}
#pragma mark - UITableViewDataSource,UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
if (self.model == nil) {
return 0;
}
if (self.model.tasks.teacher_tasks.count > 0) {
return 4;
}else{
return 3;
}
return self.model.tasks.count;
}
-(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 if(section == 2){
return self.model.tasks.usual_tasks.count;
}else{
return self.model.tasks.teacher_tasks.count;
}
QXDayTaskTypeModel *model = self.model.tasks[section];
return model.task_list.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 if(indexPath.section == 2){
model = self.model.tasks.usual_tasks[indexPath.row];
}else{
model = self.model.tasks.teacher_tasks[indexPath.row];
}
cell.model = model;
QXDayTaskTypeModel *model = self.model.tasks[indexPath.section];
QXDayTaskListModel *taskModel = model.task_list[indexPath.row];
cell.model = taskModel;
cell.delegate = self;
return cell;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
@@ -115,15 +183,8 @@
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 if(section == 2){
titleLabel.text = QXText(@"平台任务");
}else{
titleLabel.text = QXText(@"师徒任务");
}
QXDayTaskTypeModel *model = self.model.tasks[section];
titleLabel.text = model.task_type_name;
[header addSubview:titleLabel];
return header;
}
@@ -142,6 +203,15 @@
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 35;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
QXDayTaskTypeModel *model = self.model.tasks[indexPath.section];
QXDayTaskListModel *taskModel = model.task_list[indexPath.row];
if ([taskModel.task_id isEqualToString:@"1"]) {
QXSignInAppView *signView = [[QXSignInAppView alloc] init];
[signView showInView:self.view];
return;
}
}
-(UITableView *)tableView{
if (!_tableView) {
@@ -149,7 +219,8 @@
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.backgroundColor = [UIColor clearColor];
_tableView.rowHeight = 60;
// _tableView.estimatedRowHeight = 60;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
if (@available(iOS 15.0, *)) {
_tableView.sectionHeaderTopPadding = 0;

View File

@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
/// 盲盒信息
@property(nonatomic,strong)NSArray <QXGiftBoxModel*>*gift_box_list;
@property(nonatomic,strong)QXDayTaskTypeModel*tasks;
@property(nonatomic,strong)NSArray<QXDayTaskTypeModel*>* tasks;
@end
@@ -41,15 +41,17 @@ NS_ASSUME_NONNULL_BEGIN
@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;
@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*teacher_tasks;
///// 每日特殊任务2
//@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*daily_tasks_special;
///// 每日常规任务
//@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*daily_tasks;
///// 平台任务列表
//@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*usual_tasks;
//
//@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*teacher_tasks;
@property(nonatomic,strong)NSString *task_type_name;
@property(nonatomic,strong)NSString *task_type_id;
@property(nonatomic,strong)NSArray<QXDayTaskListModel*>*task_list;
@end
@interface QXDayTaskListModel : NSObject
@@ -76,7 +78,23 @@ NS_ASSUME_NONNULL_BEGIN
/// 0 记录次数 1 计时
@property(nonatomic,strong)NSString *is_time;
/// 奖励类型 1金币 2钻石
@property(nonatomic,strong)NSString *reward_type;
//@property(nonatomic,strong)NSString *reward_type;
/// 任务奖励
@property(nonatomic,strong)NSString *reward_str;
/**
0 不跳转
1 跳转实名
2 跳转我的相册
3 跳转绑定管理
4 跳转房间
5 跳转申请加入公会
6 跳转充值
7 签到
*/
@property(nonatomic,strong)NSString *jump_type;
/// 徒弟user id
@property(nonatomic,strong)NSString *student_id;
@end
@@ -89,4 +107,26 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,strong)NSString *createtime;
@end
@interface QXSignAppModel : NSObject
/// 第几天
@property(nonatomic,strong)NSString *day;
/// 日期
@property(nonatomic,strong)NSString *sign_in_date;
/// 签到状态1已签到 0未签到
@property(nonatomic,strong)NSString *sign_in_status;
/// 初级礼盒
@property(nonatomic,strong)NSString *sign_in_status_str;
/// 是否是当天 0否 1是
@property(nonatomic,strong)NSString *is_today;
/// 礼物名称
@property(nonatomic,strong)NSString *gift_name;
/// 数量
@property(nonatomic,strong)NSString *num;
/// 价格
@property(nonatomic,strong)NSString *gift_price;
/// 1金币 2礼物 3装扮 4钻石
@property(nonatomic,strong)NSString *type;
/// 礼物
@property(nonatomic,strong)NSString *base_image;
@end
NS_ASSUME_NONNULL_END

View File

@@ -25,10 +25,10 @@
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
return @{
@"daily_tasks" : @"QXDayTaskListModel",
@"usual_tasks" : @"QXDayTaskListModel",
@"daily_tasks_special": @"QXDayTaskListModel",
@"teacher_tasks": @"QXDayTaskListModel",
@"task_list" : @"QXDayTaskListModel",
// @"usual_tasks" : @"QXDayTaskListModel",
// @"daily_tasks_special": @"QXDayTaskListModel",
// @"teacher_tasks": @"QXDayTaskListModel",
};
}
@@ -43,4 +43,10 @@
@end
@implementation QXSignAppModel
@end

View File

@@ -33,9 +33,12 @@ NS_ASSUME_NONNULL_BEGIN
/// 是否为爵位礼物 0 打开 1 锁住
@property (nonatomic,strong)NSString *is_lock;
/// 是否为爵位礼物 0 打开 1 锁住
/// 是否为cp礼物 0 打开 1 锁住
@property (nonatomic,strong)NSString *is_cp;
/// 是否为师徒标签
@property (nonatomic,strong)NSString *is_teacher;
@property (nonatomic,assign)BOOL isSelected;
@end

View File

@@ -947,6 +947,7 @@ NS_ASSUME_NONNULL_BEGIN
领取任务金币
*/
+(void)dayTaskDrawWithTaskId:(NSString*)task_id
student_id:(NSString*)student_id
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
@@ -1402,6 +1403,32 @@ NS_ASSUME_NONNULL_BEGIN
+(void)signRoomRefuseSignWithRoomId:(NSString*)roomId
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
每日任务跳转房间
*/
+(void)getRoomTaskJumpRoomWithTaskId:(NSString*)task_id
successBlock:(void (^)(NSString* roomId))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
每日签到状态
*/
+(void)getAppSignTaskListSuccessBlock:(void (^)(NSArray<QXSignAppModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
每日签到
*/
+(void)appSignTaskSuccessBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
每日签到状态
*/
+(void)appSignTaskStatusSuccessBlock:(void (^)(NSString* status))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@end

View File

@@ -1870,10 +1870,12 @@
*/
+(void)dayTaskDrawWithTaskId:(NSString*)task_id
student_id:(NSString*)student_id
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@"task_id":task_id?task_id:@""
@"task_id":task_id?task_id:@"",
@"student_id":student_id?:@""
};
[[QXRequset shareInstance] postWithUrl:QXDayDrawTaskCoin parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
@@ -2825,5 +2827,63 @@
}];
}
/**
*/
+(void)getRoomTaskJumpRoomWithTaskId:(NSString*)task_id
successBlock:(void (^)(NSString* roomId))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXRoomTaskJumpRoom parameters:@{@"task_id":task_id?:@""} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSString *roomId = [NSString stringWithFormat:@"%@",responseObject[@"data"]];
successBlock(roomId);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)getAppSignTaskListSuccessBlock:(void (^)(NSArray<QXSignAppModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXAppSignTask parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSArray *list = [NSArray yy_modelArrayWithClass:[QXSignAppModel class] json:responseObject[@"data"]];
successBlock(list);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)appSignTaskSuccessBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXAppSign parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
successBlock(responseObject[@"data"]);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)appSignTaskStatusSuccessBlock:(void (^)(NSString* status))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXAppSignStatus parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSString *status = [NSString stringWithFormat:@"%@",responseObject[@"data"]];
successBlock(status);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
@end

View File

@@ -8,7 +8,13 @@
#import <UIKit/UIKit.h>
#import "QXDayTaskModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol QXDayTaskCellDelegate <NSObject>
@optional
-(void)didClickFinishTaskWithModel:(QXDayTaskListModel *)taskModel;
@end
@interface QXDayTaskCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@@ -16,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UIButton *finishBtn;
@property (strong, nonatomic) QXDayTaskListModel *model;
@property (weak, nonatomic) id<QXDayTaskCellDelegate>delegate;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end

View File

@@ -21,15 +21,16 @@
-(void)setModel:(QXDayTaskListModel *)model{
_model = model;
self.titleLabel.text = model.task_name;
NSString*subTitle = @"";
if (model.reward_type.intValue == 1) {
subTitle = [NSString stringWithFormat:@"金币+%@",model.gold_reward];
}else{
subTitle = [NSString stringWithFormat:@"钻石+%@",model.gold_reward];
}
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:subTitle];
[attr yy_setColor:RGB16(0xFF8827) range:[subTitle rangeOfString:[NSString stringWithFormat:@"+%@",model.gold_reward]]];
self.subTitleLabel.attributedText = attr;
// NSString*subTitle = @"";
// if (model.reward_type.intValue == 1) {
// subTitle = [NSString stringWithFormat:@"金币+%@",model.gold_reward];
// }else{
// subTitle = [NSString stringWithFormat:@"钻石+%@",model.gold_reward];
// }
// NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:model.reward_str];
// [attr yy_setColor:RGB16(0xFF8827) range:[subTitle rangeOfString:[NSString stringWithFormat:@"+%@",model.gold_reward]]];
self.subTitleLabel.text = [model.reward_str isExist]?model.reward_str:@" ";
[self.finishBtn setTitle:model.task_type_str forState:(UIControlStateNormal)];
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.icon]];
if (model.task_status.intValue == 1) {
self.finishBtn.enabled = YES;
@@ -46,38 +47,21 @@
}
}
- (IBAction)finishAction:(id)sender {
if (self.model.task_status.intValue == 1) {
if (self.model.task_id.intValue == 9 || self.model.task_id.intValue == 10) {
QXGlobal.shareGlobal.taskModel = self.model;
if ([[QXGlobal shareGlobal].roomId isEqualToString:self.model.from_id]) {
[[QXGlobal shareGlobal] popToRoomViewController];
}
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.from_id isRejoin:NO navagationController:self.viewController.navigationController];
}
}else if (self.model.task_status.intValue == 2) {
MJWeakSelf
[QXMineNetwork dayTaskDrawWithTaskId:self.model.task_id successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"领取成功");
weakSelf.model.task_status = @"3";
weakSelf.finishBtn.selected = NO;
weakSelf.finishBtn.enabled = NO;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickFinishTaskWithModel:)]) {
[self.delegate didClickFinishTaskWithModel:self.model];
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
[self.finishBtn addRoundedCornersWithRadius:15];
[self.finishBtn setTitleColor:RGB16(0xC134EE) forState:(UIControlStateNormal)];
[self.finishBtn setTitleColor:RGB16(0x3ABC6D) forState:(UIControlStateNormal)];
[self.finishBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateSelected)];
[self.finishBtn setTitleColor:RGB16(0x666666) forState:(UIControlStateDisabled)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xC134EE)] forState:(UIControlStateSelected)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x3ABC6D)] forState:(UIControlStateSelected)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:UIColor.clearColor] forState:(UIControlStateNormal)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xF1F2F3)] forState:(UIControlStateDisabled)];
self.finishBtn.layer.borderColor = RGB16(0xC134EE).CGColor;
self.finishBtn.layer.borderColor = RGB16(0x3ABC6D).CGColor;
self.finishBtn.layer.borderWidth = 1;
}

View File

@@ -10,7 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="108" id="KGk-i7-Jjw" customClass="QXDayTaskCell">
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="108" id="KGk-i7-Jjw" customClass="QXDayTaskCell">
<rect key="frame" x="0.0" y="0.0" width="481" height="108"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
@@ -18,23 +18,23 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Zzf-Hx-7yu">
<rect key="frame" x="16" y="34" width="40" height="40"/>
<rect key="frame" x="16" y="9" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Xua-MB-4nn"/>
<constraint firstAttribute="width" constant="40" id="e6m-v0-EYD"/>
<constraint firstAttribute="width" constant="40" id="Nup-9v-MxR"/>
<constraint firstAttribute="height" constant="40" id="w2p-VE-pN3"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gZv-uE-Dy3">
<rect key="frame" x="62" y="34" width="333" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gZv-uE-Dy3">
<rect key="frame" x="62" y="9" width="333" height="69"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bni-4p-6Qt">
<rect key="frame" x="405" y="39" width="60" height="30"/>
<rect key="frame" x="405" y="14" width="60" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="NYX-5D-Uw8"/>
<constraint firstAttribute="width" constant="60" id="afU-OP-XMX"/>
<constraint firstAttribute="height" constant="30" id="AVT-S0-Yru"/>
<constraint firstAttribute="width" constant="60" id="UW1-Ri-uwx"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
@@ -47,30 +47,29 @@
<action selector="finishAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="O2a-NK-IEM"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eqP-bF-SEp">
<rect key="frame" x="62" y="57" width="333" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eqP-bF-SEp">
<rect key="frame" x="62" y="83" width="333" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.88627450980392153" green="0.25490196078431371" blue="0.44313725490196076" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="leading" secondItem="Zzf-Hx-7yu" secondAttribute="trailing" constant="6" id="0aO-hG-r1W"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="trailing" constant="10" id="83a-aB-YJD"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="bottom" secondItem="Zzf-Hx-7yu" secondAttribute="bottom" id="HP4-ka-VMG"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="leading" id="MeK-CK-V0P"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="aGe-7f-yAi"/>
<constraint firstAttribute="trailing" secondItem="bni-4p-6Qt" secondAttribute="trailing" constant="16" id="crV-1Z-BmV"/>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="top" secondItem="Zzf-Hx-7yu" secondAttribute="top" id="itH-bd-9ay"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="eqP-bF-SEp" secondAttribute="trailing" constant="10" id="poY-hN-bRh"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="y6a-e4-hfz"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="centerY" secondItem="Zzf-Hx-7yu" secondAttribute="centerY" id="0rH-Y7-jwf"/>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="leading" secondItem="Zzf-Hx-7yu" secondAttribute="trailing" constant="6" id="2nM-DG-Grg"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="eqP-bF-SEp" secondAttribute="trailing" constant="10" id="ANm-2o-d67"/>
<constraint firstAttribute="trailing" secondItem="bni-4p-6Qt" secondAttribute="trailing" constant="16" id="FGd-NP-Bud"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="top" secondItem="gZv-uE-Dy3" secondAttribute="bottom" constant="5" id="Ftb-vc-ugs"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="9" id="JNo-Ml-0Uf"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="LJ1-Ut-byU"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="trailing" constant="10" id="XUO-fj-17G"/>
<constraint firstAttribute="bottom" secondItem="eqP-bF-SEp" secondAttribute="bottom" constant="8" id="iSn-GZ-hix"/>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="top" secondItem="Zzf-Hx-7yu" secondAttribute="top" id="mgj-C7-FFs"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="leading" id="qVo-gN-l0W"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<constraints>
<constraint firstItem="bni-4p-6Qt" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="IM5-xV-Df6"/>
</constraints>
<connections>
<outlet property="finishBtn" destination="bni-4p-6Qt" id="K8I-ow-9Uv"/>
<outlet property="iconImageView" destination="Zzf-Hx-7yu" id="D8z-6l-i8N"/>

View File

@@ -0,0 +1,39 @@
//
// QXSignInAppView.h
// QXLive
//
// Created by 启星 on 2025/12/11.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXSignInAppView : UIView
@property (nonatomic,copy)void(^cancelBlock)(void);
-(void)showInView:(UIView *)view;
-(void)hide;
@end
@interface QXSignInAppSubView : UIView
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *dayLabel;
@property (nonatomic,strong)UILabel *dayTitleLabel;
@property (nonatomic,strong)UIImageView *statusImageView;
@property (nonatomic,strong)UIImageView *giftImageView;
@property (nonatomic,strong)UILabel *giftNameLabel;
@property (nonatomic,strong)QXSignAppModel *model;
@end
@interface QXSignInAppResultView : UIView
@property (nonatomic,strong)UIImageView *giftImageView;
@property (nonatomic,strong)UILabel *giftNameLabel;
@property (nonatomic,strong)QXSignAppModel *model;
@property (nonatomic,strong)UIButton *happyBtn;
@property (nonatomic,copy)void(^happyBlock)(void);
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,407 @@
//
// QXSignInAppView.m
// QXLive
//
// Created by on 2025/12/11.
//
#import "QXSignInAppView.h"
#import "QXMineNetwork.h"
@interface QXSignInAppView()
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)QXSignInAppSubView *signView1;
@property (nonatomic,strong)QXSignInAppSubView *signView2;
@property (nonatomic,strong)QXSignInAppSubView *signView3;
@property (nonatomic,strong)QXSignInAppSubView *signView4;
@property (nonatomic,strong)QXSignInAppSubView *signView5;
@property (nonatomic,strong)QXSignInAppSubView *signView6;
@property (nonatomic,strong)QXSignInAppSubView *signView7;
@property (nonatomic,strong)NSMutableArray *signViewArray;
@property (nonatomic,strong)UIButton *signBtn;
@property (nonatomic,strong)UIButton *closeBtn;
@property (nonatomic,strong)QXSignAppModel*todayModel;
@property (nonatomic,strong)QXSignInAppResultView *resultView;
@end
@implementation QXSignInAppView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-ScaleWidth(331))/2.0, -self.height, ScaleWidth(331), ScaleWidth(446)+50)];
// self.bgView.backgroundColor = [UIColor whiteColor];
self.bgView.layer.masksToBounds = YES;
self.bgView.layer.cornerRadius = 16;
[self addSubview:self.bgView];
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"app_sign_task_bg"]];
[self.bgView addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.bgView);
make.height.mas_equalTo(ScaleWidth(446));
}];
self.signView1 = [[QXSignInAppSubView alloc] init];
[self.signView1 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView1];
self.signView2 = [[QXSignInAppSubView alloc] init];
[self.signView2 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView2];
self.signView3 = [[QXSignInAppSubView alloc] init];
[self.signView3 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView3];
self.signView4 = [[QXSignInAppSubView alloc] init];
[self.signView4 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView4];
self.signView5 = [[QXSignInAppSubView alloc] init];
[self.signView5 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView5];
self.signView6 = [[QXSignInAppSubView alloc] init];
[self.signView6 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView6];
self.signView7 = [[QXSignInAppSubView alloc] init];
[self.signView7 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView7];
CGFloat leftMargin = ScaleWidth(22);
CGFloat itemSpace = ScaleWidth(6);
CGFloat itemWidth = (self.bgView.width - leftMargin*2 - itemSpace*3)/4;
CGFloat itemHeight = ScaleWidth(88);
[self.signView1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(leftMargin);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
make.top.mas_equalTo(ScaleWidth(168));
}];
[self.signView2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView1);
make.left.equalTo(self.signView1.mas_right).offset(itemSpace);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView1);
make.left.equalTo(self.signView2.mas_right).offset(itemSpace);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView4 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView1);
make.left.equalTo(self.signView3.mas_right).offset(itemSpace);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView5 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView1.mas_bottom).offset(ScaleWidth(10));
make.left.equalTo(self.signView1);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView6 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView5);
make.left.equalTo(self.signView5.mas_right).offset(itemSpace);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView7 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView5);
make.left.equalTo(self.signView6.mas_right).offset(itemSpace);
make.right.mas_equalTo(-leftMargin);
make.height.mas_equalTo(itemHeight);
}];
[self.signViewArray addObject:self.signView1];
[self.signViewArray addObject:self.signView2];
[self.signViewArray addObject:self.signView3];
[self.signViewArray addObject:self.signView4];
[self.signViewArray addObject:self.signView5];
[self.signViewArray addObject:self.signView6];
[self.signViewArray addObject:self.signView7];
self.signBtn = [[UIButton alloc] init];
[self.signBtn setBackgroundImage:[UIImage imageNamed:@"sign_app_btn_bg"] forState:(UIControlStateNormal)];
[self.signBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x999999)] forState:(UIControlStateDisabled)];
[self.signBtn setTitle:@"立即签到" forState:(UIControlStateNormal)];
[self.signBtn setTitle:@"已签到" forState:(UIControlStateDisabled)];
[self.signBtn addTarget:self action:@selector(signAction) forControlEvents:(UIControlEventTouchUpInside)];
self.signBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
[self.signBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.signBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateDisabled)];
[self.signBtn addRoundedCornersWithRadius:25];
[self.bgView addSubview:self.signBtn];
[self.signBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(257));
make.height.mas_equalTo(50);
make.centerX.equalTo(self.bgView);
make.bottom.equalTo(self.bgImageView.mas_bottom).offset(-ScaleWidth(20));
}];
self.closeBtn = [[UIButton alloc] init];
[self.closeBtn setBackgroundImage:[UIImage imageNamed:@"home_white_close"] forState:(UIControlStateNormal)];
[self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.closeBtn];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(35);
make.height.mas_equalTo(35);
make.centerX.equalTo(self.bgView);
make.bottom.equalTo(self.bgView);
}];
[self addSubview:self.resultView];
self.resultView.hidden = YES;
[self.resultView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self.signView1);
make.right.equalTo(self.signView4);
make.bottom.equalTo(self.signBtn);
}];
}
-(void)signAction{
MJWeakSelf
[QXMineNetwork appSignTaskSuccessBlock:^(NSDictionary * _Nonnull dict) {
weakSelf.resultView.hidden = NO;
[weakSelf getSignTaskList];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
-(void)getSignTaskList{
MJWeakSelf
[QXMineNetwork getAppSignTaskListSuccessBlock:^(NSArray<QXSignAppModel *> * _Nonnull list) {
if (list.count == weakSelf.signViewArray.count) {
for (int i = 0;i < list.count; i++) {
QXSignAppModel*md = list[i];
QXSignInAppSubView *signView = weakSelf.signViewArray[i];
signView.model = md;
if (md.is_today.intValue == 1) {
weakSelf.todayModel = md;
weakSelf.resultView.model = weakSelf.todayModel;
if (md.sign_in_status.intValue == 1) {
weakSelf.signBtn.enabled = NO;
}else{
weakSelf.signBtn.enabled = YES;
}
}
}
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)closeAction{
if (self.cancelBlock) {
self.cancelBlock();
}
[self hide];
}
-(void)showInView:(UIView *)view{
[self getSignTaskList];
[view addSubview:self];
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.bgView.y = (SCREEN_HEIGHT-ScaleWidth(446))/2.0-60;
} completion:^(BOOL finished) {
}];
}
-(void)hide{
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.bgView.y = SCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
-(NSMutableArray *)signViewArray{
if (!_signViewArray) {
_signViewArray = [NSMutableArray array];
}
return _signViewArray;
}
-(QXSignInAppResultView *)resultView{
if (!_resultView) {
_resultView = [[QXSignInAppResultView alloc] init];
MJWeakSelf
_resultView.happyBlock = ^{
[weakSelf closeAction];
};
}
return _resultView;
}
@end
@implementation QXSignInAppSubView
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setModel:(QXSignAppModel *)model{
_model = model;
self.dayLabel.text = model.day;
if (model.sign_in_status.intValue == 1) {
self.statusImageView.hidden = NO;
self.statusImageView.image = [UIImage imageNamed:@"app_sign_drawed"];
self.alpha = 0.5;
}else{
self.statusImageView.hidden = YES;
self.alpha = 1;
}
self.giftNameLabel.text = [NSString stringWithFormat:@"%@%@",model.gift_name,model.num];
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
}
-(void)initSubviews{
self.bgImageView = [[UIImageView alloc] init];
self.bgImageView.backgroundColor = RGB16(0xD3FFC8);
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
self.dayLabel = [[UILabel alloc] init];
self.dayLabel.textColor = RGB16(0xFFC273);
self.dayLabel.font = [UIFont fontWithName:@"YouSheBiaoTiHei" size:32];
[self addSubview:self.dayLabel];
[self.dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self).offset(-5);
make.left.mas_equalTo(5);
}];
self.dayTitleLabel = [[UILabel alloc] init];
self.dayTitleLabel.textColor = RGB16(0xFFC273);
self.dayTitleLabel.font = [UIFont systemFontOfSize:12];
self.dayTitleLabel.text = @"DAY";
[self addSubview:self.dayTitleLabel];
[self.dayTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self).offset(10);
make.left.equalTo(self.dayLabel.mas_right).offset(3);
}];
self.giftImageView = [[UIImageView alloc] init];
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:self.giftImageView];
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(38);
make.centerX.centerY.equalTo(self);
}];
self.giftNameLabel = [[UILabel alloc] init];
self.giftNameLabel.textColor = RGB16(0x999999);
self.giftNameLabel.textAlignment = NSTextAlignmentCenter;
self.giftNameLabel.font = [UIFont systemFontOfSize:12];
self.giftNameLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
[self addSubview:self.giftNameLabel];
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
make.bottom.mas_equalTo(-6);
}];
self.statusImageView = [[UIImageView alloc] init];
[self addSubview:self.statusImageView];
[self.statusImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(ScaleWidth(32));
make.centerX.centerY.equalTo(self);
}];
}
@end
@implementation QXSignInAppResultView
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setModel:(QXSignAppModel *)model{
_model = model;
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
self.giftNameLabel.text = [NSString stringWithFormat:@"签到成功 %@%@",model.gift_name,model.num];
}
-(void)initSubviews{
self.backgroundColor =RGB16(0xffffff);
self.giftImageView = [[UIImageView alloc] init];
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:self.giftImageView];
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(80);
make.centerX.equalTo(self);
make.top.mas_equalTo(40);
}];
self.giftNameLabel = [[UILabel alloc] init];
self.giftNameLabel.font = [UIFont systemFontOfSize:14.f];
self.giftNameLabel.textColor = QXConfig.themeColor;
[self addSubview:self.giftNameLabel];
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.top.equalTo(self.giftImageView.mas_bottom).offset(20);
}];
self.happyBtn = [[UIButton alloc] init];
[self.happyBtn setBackgroundImage:[UIImage imageNamed:@"sign_app_btn_bg"] forState:(UIControlStateNormal)];
[self.happyBtn setTitle:@"开心收下" forState:(UIControlStateNormal)];
[self.happyBtn addTarget:self action:@selector(happyAction) forControlEvents:(UIControlEventTouchUpInside)];
self.happyBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
[self.happyBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.happyBtn addRoundedCornersWithRadius:25];
[self addSubview:self.happyBtn];
[self.happyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(257));
make.height.mas_equalTo(50);
make.centerX.equalTo(self);
make.bottom.equalTo(self);
}];
}
-(void)happyAction{
if (self.happyBlock) {
self.happyBlock();
}
}
@end