This commit is contained in:
启星
2025-09-29 17:21:49 +08:00
parent 9307d88177
commit 2a44a06630
138 changed files with 2802 additions and 439 deletions

View File

@@ -32,6 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
///状态 1:巡乐会开始 2:即将开始开始 0:等待开始
@property (nonatomic,strong)NSString *status;
@property (nonatomic,assign)long end_time;
@end
@interface QXDrawGiftModel : NSObject
@@ -80,6 +81,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 礼物图标
@property (nonatomic,strong)NSString *base_image;
/// 期数
@property (nonatomic,strong)NSString *periods;
@end
@interface QXActivityXLHModel : NSObject
@@ -91,6 +95,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QXDrawGiftModel* locking_gift;
@property (nonatomic,strong)QXUserModel* xlh_user;
@property (nonatomic,strong)QXUserModel* homeowner_user;
@property (nonatomic,strong)NSArray<QXDrawGiftModel*>* gift_list;
@end

View File

@@ -53,6 +53,7 @@
@"give_homeowner_gift" : @"QXDrawGiftModel",
@"locking_gift":@"QXDrawGiftModel",
@"xlh_user":@"QXUserModel",
@"homeowner_user":@"QXUserModel",
@"gift_list":@"QXDrawGiftModel"
};
}

View File

@@ -369,17 +369,17 @@ static NSInteger toSlowCount = 4;
}
-(void)conifgBtnStatus{
if (self.coin > 0 && self.model.box_price.integerValue > 0) {
if (self.coin>self.model.box_price.integerValue) {
if (self.coin>=self.model.box_price.integerValue) {
self.oneBtn.isDisable = NO;
}else{
self.oneBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*6)) {
if (self.coin>=(self.model.box_price.integerValue*6)) {
self.tenBtn.isDisable = NO;
}else{
self.tenBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*9)) {
if (self.coin>=(self.model.box_price.integerValue*9)) {
self.hundredBtn.isDisable = NO;
}else{
self.hundredBtn.isDisable = YES;

View File

@@ -402,17 +402,17 @@ static NSInteger toSlowCount = 4;
}
-(void)configBtnStatus{
if (self.coin > 0 && self.model.box_price.integerValue > 0) {
if (self.coin>self.model.box_price.integerValue) {
if (self.coin>=self.model.box_price.integerValue) {
self.oneBtn.isDisable = NO;
}else{
self.oneBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*6)) {
if (self.coin>=(self.model.box_price.integerValue*6)) {
self.tenBtn.isDisable = NO;
}else{
self.tenBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*9)) {
if (self.coin>=(self.model.box_price.integerValue*9)) {
self.hundredBtn.isDisable = NO;
}else{
self.hundredBtn.isDisable = YES;

View File

@@ -0,0 +1,18 @@
//
// QXActivityTagView.h
// QXLive
//
// Created by 启星 on 2025/9/24.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXActivityTagView : UIView
@property (nonatomic,copy)void(^startBlock)(void);
@property (nonatomic,assign)long end_time;
-(void)stopTimer;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,108 @@
//
// QXActivityTagView.m
// QXLive
//
// Created by on 2025/9/24.
//
#import "QXActivityTagView.h"
#import "QXTimer.h"
@interface QXActivityTagView()
@property (nonatomic,strong)UIImageView *imageView;
@property (nonatomic,strong)UILabel *timeLabel;
@property (nonatomic,strong)QXTimer *timer;
@property (nonatomic,assign)NSInteger startTime;
@property (nonatomic,strong)UIButton *btn;
@end
@implementation QXActivityTagView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = CGRectMake(SCREEN_WIDTH-80, SCREEN_HEIGHT-250, 80, 100);
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_tag_icon"]];
self.imageView.frame = CGRectMake(0, 0, 80, 80);
[self addSubview:self.imageView];
self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.imageView.bottom, self.width, 20)];
self.timeLabel.textAlignment = NSTextAlignmentCenter;
self.timeLabel.font = [UIFont systemFontOfSize:12];
self.timeLabel.textColor = RGB16(0xFFEBBD);
[self addSubview:self.timeLabel];
self.btn = [[UIButton alloc] initWithFrame:self.bounds];
[self.btn addTarget:self action:@selector(btnClick) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.btn];
UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
[self addGestureRecognizer:panRecognizer];
}
-(void)btnClick{
if (self.startBlock) {
self.startBlock();
}
}
-(void)setEnd_time:(long)end_time{
_end_time = end_time;
if (end_time == 0) {
return;
}
NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
//
long long milliseconds = (long long)(timeInterval);
self.startTime = end_time - milliseconds;
if (self.startTime <= 0) {
//
self.timeLabel.text = @"倒计时 00:00";
[self removeFromSuperview];
return;
}
MJWeakSelf
[self stopTimer];
_timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{
dispatch_async(dispatch_get_main_queue(), ^{
weakSelf.startTime--;
NSInteger min = (self.startTime % 3600) / 60;
NSInteger second = self.startTime % 60;
weakSelf.timeLabel.text = [NSString stringWithFormat:@"倒计时 %02ld:%02ld",min,second];
if (weakSelf.startTime<=0) {
[weakSelf stopTimer];
weakSelf.timeLabel.text = @"倒计时 00:00";
[weakSelf removeFromSuperview];
}
});
}];
}
-(void)stopTimer{
if (_timer) {
[self->_timer invalidate];
self->_timer= nil;
}
}
-(void)handlePan:(UIPanGestureRecognizer*)recognizer{
if (recognizer.state == UIGestureRecognizerStateEnded) {
NSLog(@"拖动结束");
}
CGPoint translation = [recognizer translationInView:self.viewController.view];
CGPoint panCenter = CGPointMake(recognizer.view.center.x + translation.x,
recognizer.view.center.y + translation.y);
if (panCenter.y < kSafeAreaTop || panCenter.y> SCREEN_HEIGHT-kSafeAreaBottom) {
return;
}
recognizer.view.center = CGPointMake(SCREEN_WIDTH-ScaleWidth(80)/2,
recognizer.view.center.y + translation.y);
[recognizer setTranslation:CGPointZero inView:self.viewController.view];
}
@end

View File

@@ -23,4 +23,15 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QXActivityRecordModel *model;
+(instancetype)cellWithTableView:(UITableView*)tableView;
@end
@interface QXMeetRankLuckCell : UITableViewCell
@property (nonatomic,strong)UIImageView *giftImageView;
@property (nonatomic,strong)UILabel *giftInfoLabel;
@property (nonatomic,strong)UILabel *recieveInfoLabel;
@property (nonatomic,strong)UILabel *timeLabel;
@property (nonatomic,strong)UILabel *numberLabel;
@property (nonatomic,strong)UIView *bottomLine;
@property (nonatomic,strong)QXActivityRecordModel *model;
+(instancetype)cellWithTableView:(UITableView*)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -15,6 +15,9 @@
@property(nonatomic,strong)UITableView* tableView;
@property(nonatomic,strong)NSMutableArray* allRecordArray;
@property(nonatomic,assign)NSInteger page;
@property(nonatomic,strong)UIButton* drawRankBtn;
@property(nonatomic,strong)UIButton* luckRankBtn;
@end
@implementation QXMeetActivityRankView
@@ -53,8 +56,32 @@
self.bgCoverView.backgroundColor = RGB16A(0x000000, 0.5);
[self.bgView addSubview:self.bgCoverView];
self.drawRankBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.bgCoverView.width)/2-88-8, 20, 88, 32)];
[self.drawRankBtn setTitle:@"抽奖榜单" forState:(UIControlStateNormal)];
[self.drawRankBtn setTitleColor:RGB16(0xE8E8E8) forState:(UIControlStateNormal)];
self.drawRankBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
[self.drawRankBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xD0C2FF)] forState:(UIControlStateNormal)];
[self.drawRankBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x7C57FB)] forState:(UIControlStateSelected)];
[self.drawRankBtn addTarget:self action:@selector(drawRankAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgCoverView addSubview:self.drawRankBtn];
self.drawRankBtn.selected = YES;
self.luckRankBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.drawRankBtn.right+16, 20, 88, 32)];
[self.luckRankBtn setTitle:@"幸运榜单" forState:(UIControlStateNormal)];
[self.luckRankBtn setTitleColor:RGB16(0xE8E8E8) forState:(UIControlStateNormal)];
self.luckRankBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
[self.luckRankBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xD0C2FF)] forState:(UIControlStateNormal)];
[self.luckRankBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x7C57FB)] forState:(UIControlStateSelected)];
[self.luckRankBtn addTarget:self action:@selector(luckRankAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgCoverView addSubview:self.luckRankBtn];
[self.drawRankBtn addRoundedCornersWithRadius:16];
[self.luckRankBtn addRoundedCornersWithRadius:16];
[self.bgCoverView addSubview:self.tableView];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
@@ -64,9 +91,9 @@
-(void)setRoomId:(NSString *)roomId{
_roomId = roomId;
self.page = 1;
[self getRecordList];
[self getRecordListWithType:@"1"];
}
-(void)getRecordList{
-(void)getRecordListWithType:(NSString*)type{
if (![self.roomId isExist]) {
return;
}
@@ -75,29 +102,65 @@
@"room_id":self.roomId?self.roomId:@"",
@"page":[NSNumber numberWithInteger:self.page]
};
NSString *url = [NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_xlh_all_record"];
[[QXRequset shareInstance] postWithUrl:url parameters:parameters needCache:NO success:^(id responseObject) {
if (weakSelf.page == 1) {
[weakSelf.allRecordArray removeAllObjects];
}
NSArray *arr = [NSArray yy_modelArrayWithClass:[QXActivityRecordModel class] json:responseObject[@"data"]];
[weakSelf.allRecordArray addObjectsFromArray:arr];
[weakSelf.tableView reloadData];
if (arr.count == 0) {
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
if ([type isEqualToString:@"1"]) {
NSString *url = [NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_xlh_all_record"];
[[QXRequset shareInstance] postWithUrl:url parameters:parameters needCache:NO success:^(id responseObject) {
if (weakSelf.page == 1) {
[weakSelf.allRecordArray removeAllObjects];
}
NSArray *arr = [NSArray yy_modelArrayWithClass:[QXActivityRecordModel class] json:responseObject[@"data"]];
[weakSelf.allRecordArray addObjectsFromArray:arr];
[weakSelf.tableView reloadData];
if (arr.count == 0) {
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView.mj_header endRefreshing];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView.mj_header endRefreshing];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
[weakSelf.tableView.mj_footer endRefreshing];
[weakSelf.tableView.mj_header endRefreshing];
}];
[weakSelf.tableView.mj_header endRefreshing];
}];
}else{
NSString *url = [NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_xlh_ranking"];
[[QXRequset shareInstance] postWithUrl:url parameters:parameters needCache:NO success:^(id responseObject) {
if (weakSelf.page == 1) {
[weakSelf.allRecordArray removeAllObjects];
}
NSArray *arr = [NSArray yy_modelArrayWithClass:[QXActivityRecordModel class] json:responseObject[@"data"]];
[weakSelf.allRecordArray addObjectsFromArray:arr];
[weakSelf.tableView reloadData];
if (arr.count == 0) {
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView.mj_header endRefreshing];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
[weakSelf.tableView.mj_footer endRefreshing];
[weakSelf.tableView.mj_header endRefreshing];
}];
}
}
-(void)drawRankAction{
self.drawRankBtn.selected = YES;
self.luckRankBtn.selected = NO;
self.page = 1;
[self getRecordListWithType:@"1"];
}
-(void)luckRankAction{
self.drawRankBtn.selected = NO;
self.luckRankBtn.selected = YES;
self.page = 1;
[self getRecordListWithType:@"2"];
}
-(UITableView *)tableView{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 10, self.bgCoverView.width, self.bgCoverView.height-10) style:(UITableViewStylePlain)];
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.drawRankBtn.bottom+10, self.bgCoverView.width, self.bgCoverView.height-self.drawRankBtn.bottom-10) style:(UITableViewStylePlain)];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.rowHeight = 70;
@@ -105,11 +168,19 @@
MJWeakSelf
_tableView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf getRecordList];
if (self.drawRankBtn.selected) {
[weakSelf getRecordListWithType:@"1"];
}else{
[weakSelf getRecordListWithType:@"2"];
}
}];
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 1;
[weakSelf getRecordList];
if (self.drawRankBtn.selected) {
[weakSelf getRecordListWithType:@"1"];
}else{
[weakSelf getRecordListWithType:@"2"];
}
}];
}
return _tableView;
@@ -119,9 +190,15 @@
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
QXMeetRankCell *cell = [QXMeetRankCell cellWithTableView:tableView];
cell.model = self.allRecordArray[indexPath.row];
return cell;
if (self.drawRankBtn.selected) {
QXMeetRankCell *cell = [QXMeetRankCell cellWithTableView:tableView];
cell.model = self.allRecordArray[indexPath.row];
return cell;
}else{
QXMeetRankLuckCell *cell = [QXMeetRankLuckCell cellWithTableView:tableView];
cell.model = self.allRecordArray[indexPath.row];
return cell;
}
}
@@ -229,3 +306,95 @@
}
@end
@implementation QXMeetRankLuckCell
+(instancetype)cellWithTableView:(UITableView*)tableView{
static NSString *cellId = @"QXMeetRankLuckCell";
QXMeetRankLuckCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[QXMeetRankLuckCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
cell.backgroundColor = [UIColor clearColor];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
return cell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initSubviews];
}
return self;
}
-(void)setModel:(QXActivityRecordModel *)model{
_model = model;
self.numberLabel.text = model.periods;
self.giftInfoLabel.text = [NSString stringWithFormat:@"%@",model.gift_name];
self.recieveInfoLabel.text = [NSString stringWithFormat:@"%@",model.nickname];
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
self.timeLabel.text = model.createtime;
}
-(void)initSubviews{
self.contentView.backgroundColor = [UIColor clearColor];
self.numberLabel = [[UILabel alloc] init];
self.numberLabel.textColor = RGB16(0xA085FF);
self.numberLabel.font = [UIFont systemFontOfSize:14];
[self.contentView addSubview:self.numberLabel];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(12);
make.left.mas_equalTo(12);
make.height.mas_equalTo(21);
}];
self.timeLabel = [[UILabel alloc] init];
self.timeLabel.textColor = RGB16(0x5B5B5B);
self.timeLabel.font = [UIFont systemFontOfSize:10];
[self.contentView addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-12);
make.centerY.equalTo(self.numberLabel);
}];
self.recieveInfoLabel = [[UILabel alloc] init];
self.recieveInfoLabel.textColor = RGB16(0xffffff);
self.recieveInfoLabel.font = [UIFont systemFontOfSize:14];
[self.contentView addSubview:self.recieveInfoLabel];
[self.recieveInfoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-12);
make.left.mas_equalTo(12);
make.height.mas_equalTo(21);
}];
self.giftImageView = [[UIImageView alloc] init];
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
[self.contentView addSubview:self.giftImageView];
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView).offset(-12);
make.height.width.mas_equalTo(21);
make.centerY.equalTo(self.recieveInfoLabel);
}];
self.giftInfoLabel = [[UILabel alloc] init];
self.giftInfoLabel.textColor = RGB16(0xffffff);
self.giftInfoLabel.font = [UIFont systemFontOfSize:16];
[self.contentView addSubview:self.giftInfoLabel];
[self.giftInfoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.giftImageView.mas_left);
make.centerY.equalTo(self.recieveInfoLabel);
}];
self.bottomLine = [[UIView alloc] init];
self.bottomLine.backgroundColor = RGB16(0xffffff);
[self.contentView addSubview:self.bottomLine];
[self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.contentView);
make.left.mas_equalTo(12);
make.right.mas_equalTo(-12);
make.height.mas_equalTo(1);
}];
}
@end

View File

@@ -23,6 +23,12 @@ typedef NS_ENUM(NSInteger) {
@optional
-(void)timeDownDidFinished;
-(void)timeDownStartAnimation;
-(void)timeDownStopAnimation;
-(void)timeDownUpdateAnimationWithTime:(NSInteger)time;
@end
@interface QXMeetActivityView : UIView
-(void)showInView:(UIView *)view;
@@ -33,17 +39,13 @@ typedef NS_ENUM(NSInteger) {
@end
@interface QXMeetTimeDownView :UIView
@property (nonatomic,strong)UIImageView *timeBgView1;
@property (nonatomic,strong)UIImageView *timeBgView2;
@property (nonatomic,strong)UIImageView *timeBgView3;
@property (nonatomic,strong)UIImageView *timeBgView4;
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *centerLabel;
@property (nonatomic,strong)UILabel *bigTimeLabel;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *timeLabel;
@property (nonatomic,strong)UILabel *timeLabel1;
@property (nonatomic,strong)UILabel *timeLabel2;
@property (nonatomic,strong)UILabel *timeLabel3;
@property (nonatomic,strong)UILabel *timeLabel4;
@property (nonatomic,assign)long long endTime;
@property (nonatomic,assign)long long startTime;
@@ -62,6 +64,32 @@ typedef NS_ENUM(NSInteger) {
@property (nonatomic,assign)QXMeetDrawBtnType btnType;
@end
@interface QXMeetUserView : UIView
@property (nonatomic,strong)UIImageView *headerImageView;
@property (nonatomic,strong)UIImageView *dressImageView;
@property (nonatomic,strong)UILabel *tagLabel;
@property (nonatomic,strong)UILabel *nameLabel;
@property (nonatomic,assign)BOOL isLuckUser;
@property (nonatomic,strong)QXUserModel *model;
-(void)resetView;
@end
@interface QXMeetGiftView : UIView
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UIImageView *giftBgImageView;
@property (nonatomic,strong)UIImageView *giftImageView;
@property (nonatomic,strong)UIImageView *giftPriceBgView;
@property (nonatomic,strong)UIButton *giftCoin;
@property (nonatomic,strong)UILabel *giftNameLabel;
@property (nonatomic,assign)BOOL isLockGift;
@property (nonatomic,strong)QXDrawGiftModel* model;
// 控制方法
- (void)startAnimation;
- (void)stopAnimation;
- (void)resetAnimation;
@end
//@interface QXMeetGiftCell : GKCycleScrollViewCell
//@property (nonatomic,strong)UIImageView *giftBgImageView;

View File

@@ -26,31 +26,50 @@
///
@property (nonatomic,strong)UIButton *rankBtn;
@property (nonatomic,strong)QXMeetTimeDownView *timeDownView;
///
@property (nonatomic,strong)UIImageView *centerGiftBgImageView;
@property (nonatomic,strong)UIImageView *giftImageView;
@property (nonatomic,strong)UIImageView *giftNameBgImageView;
@property (nonatomic,strong)UILabel *giftNameLabel;
@property (nonatomic,strong)UIButton *giftCoinBtn;
@property (nonatomic,strong)UIImageView *giftHeartImageView;
@property (nonatomic,strong)UILabel *heartLabel;
///
@property (nonatomic,strong)UIImageView *userBgImageView;
@property (nonatomic,strong)UIImageView *userHeader;
@property (nonatomic,strong)UIImageView *userHeaderDress;
@property (nonatomic,strong)UILabel *userNameLabel;
///
@property (nonatomic,strong)UIImageView *leftGiftBgImageView;
@property (nonatomic,strong)UIImageView *leftGiftImageView;
//@property (nonatomic,strong)QXMeetTimeDownView *timeDownView;
/////
//@property (nonatomic,strong)UIImageView *centerGiftBgImageView;
//@property (nonatomic,strong)UIImageView *giftImageView;
//@property (nonatomic,strong)UIImageView *giftNameBgImageView;
//@property (nonatomic,strong)UILabel *giftNameLabel;
//@property (nonatomic,strong)UIButton *giftCoinBtn;
//@property (nonatomic,strong)UIImageView *giftHeartImageView;
//@property (nonatomic,strong)UILabel *heartLabel;
//
/////
//@property (nonatomic,strong)UIImageView *userBgImageView;
//@property (nonatomic,strong)UIImageView *userHeader;
//@property (nonatomic,strong)UIImageView *userHeaderDress;
//@property (nonatomic,strong)UILabel *userNameLabel;
//
/////
//@property (nonatomic,strong)UIImageView *leftGiftBgImageView;
//@property (nonatomic,strong)UIImageView *leftGiftImageView;
//
//
@property (nonatomic,strong)QXMeetDrawBtn *oneBtn;
@property (nonatomic,strong)QXMeetDrawBtn *tenBtn;
@property (nonatomic,strong)QXMeetDrawBtn *hundredBtn;
@property (nonatomic,strong)UIImageView *leadToImageView1;
@property (nonatomic,strong)QXMeetUserView *roomOwenrView;
@property (nonatomic,strong)UIImageView *rightGiftBgImageView;
@property (nonatomic,strong)UIImageView *rightGiftImageView;
@property (nonatomic,strong)UIButton *rightGiftCoinBtn;
@property (nonatomic,strong)UILabel *rightGiftNameLabel;
@property (nonatomic,strong)QXMeetTimeDownView *timeDownView;
@property (nonatomic,strong)QXMeetUserView *roomLuckUserView;
@property (nonatomic,strong)QXMeetGiftView *topGiftView;
@property (nonatomic,strong)UIView *bottomGiftBgView;
@property (nonatomic,strong)UILabel *countLabel;
@property (nonatomic,strong)QXMeetGiftView *bottomGiftView;
@property (nonatomic,strong)UIImageView *lockImageView;
///
@property (nonatomic,strong)UIView* coinView;
@@ -145,85 +164,48 @@
[self.recordBtn addTarget:self action:@selector(recordAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.recordBtn];
self.timeDownView = [[QXMeetTimeDownView alloc] initWithFrame:CGRectMake((self.bgView.width-ScaleWidth(122))/2, self.rankBtn.top-4, ScaleWidth(122), ScaleWidth(29))];
self.leadToImageView1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_room_owner_lead"]];
self.leadToImageView1.frame = CGRectMake((self.width-90)/2, 108, 90, 12);
[self.bgView addSubview:self.leadToImageView1];
self.roomOwenrView = [[QXMeetUserView alloc] initWithFrame:CGRectMake(self.leadToImageView1.left-11-ScaleWidth(60), self.leadToImageView1.top-21, ScaleWidth(60), ScaleWidth(60)+23)];
self.roomOwenrView.isLuckUser = NO;
[self.bgView addSubview:self.roomOwenrView];
self.topGiftView = [[QXMeetGiftView alloc] initWithFrame:CGRectMake(self.leadToImageView1.right+5, self.roomOwenrView.top, ScaleWidth(48), ScaleWidth(60)+14+2)];
[self.bgView addSubview:self.topGiftView];
self.timeDownView = [[QXMeetTimeDownView alloc] initWithFrame:CGRectMake(self.roomOwenrView.right+10, self.leadToImageView1.bottom+10, ScaleWidth(88), ScaleWidth(88))];
self.timeDownView.delegate = self;
[self.bgView addSubview:self.timeDownView];
self.giftImageView = [[UIImageView alloc] initWithFrame:CGRectMake((self.bgView.width-ScaleWidth(118))/2, self.timeDownView.bottom+11, ScaleWidth(118), ScaleWidth(118))];
[self.bgView addSubview:self.giftImageView];
self.lockImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_lock_icon"]];
self.lockImageView.frame = CGRectMake(0, self.timeDownView.bottom, ScaleWidth(96), ScaleWidth(34));
self.lockImageView.centerX = self.bgView.centerX;
[self.bgView addSubview:self.lockImageView];
self.roomLuckUserView = [[QXMeetUserView alloc] initWithFrame:CGRectMake(self.leadToImageView1.left-11-60, self.roomOwenrView.bottom+21, ScaleWidth(94), ScaleWidth(94)+23)];
self.roomLuckUserView.isLuckUser = YES;
self.roomLuckUserView.centerX = self.roomOwenrView.centerX;
[self.bgView addSubview:self.roomLuckUserView];
self.bottomGiftBgView = [[UIView alloc] initWithFrame:CGRectMake(self.topGiftView.left-20, self.roomLuckUserView.bottom-14-ScaleWidth(118), ScaleWidth(118), 14+ScaleWidth(118))];
self.bottomGiftBgView.bottom = self.roomLuckUserView.bottom;
[self.bgView addSubview:self.bottomGiftBgView];
self.bottomGiftView = [[QXMeetGiftView alloc] initWithFrame:CGRectMake(0, 10, ScaleWidth(118), ScaleWidth(118)+14)];
self.bottomGiftView.isLockGift = YES;
[self.bottomGiftBgView addSubview:self.bottomGiftView];
self.countLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 18, self.bottomGiftBgView.width, 40)];
self.countLabel.textColor = RGB16(0xF6D780);
self.countLabel.textAlignment = NSTextAlignmentRight;
self.countLabel.font = [UIFont fontWithName:@"DIN Condensed" size:35];
[self.bottomGiftBgView addSubview:self.countLabel];
self.giftNameBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_gift_name_bg"]];
self.giftNameBgImageView.contentMode = UIViewContentModeScaleToFill;
self.giftNameBgImageView.frame = CGRectMake(self.giftImageView.left, self.giftImageView.bottom-30, self.giftImageView.width, 30);
[self.bgView addSubview:self.giftNameBgImageView];
self.giftNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.giftImageView.left, self.giftImageView.bottom-30, self.giftImageView.width, 15)];
self.giftNameLabel.textColor = RGB16(0xffffff);
self.giftNameLabel.font = [UIFont systemFontOfSize:12];
self.giftNameLabel.textAlignment = NSTextAlignmentCenter;
[self.bgView addSubview:self.giftNameLabel];
self.giftCoinBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.giftImageView.left, self.giftNameLabel.bottom, self.giftImageView.width, 15)];
[self.giftCoinBtn setTitleColor:RGB16(0xC7BF62) forState:(UIControlStateNormal)];
[self.giftCoinBtn setImage:[UIImage imageNamed:@"sky_item_coin"] forState:(UIControlStateNormal)];
self.giftCoinBtn.titleLabel.font = [UIFont systemFontOfSize:10];
[self.bgView addSubview:self.giftCoinBtn];
self.giftHeartImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_gift_heart"]];
self.giftHeartImageView.frame = CGRectMake((self.bgView.width-ScaleWidth(46))/2, self.giftCoinBtn.bottom, ScaleWidth(46), ScaleWidth(46));
[self.bgView addSubview:self.giftHeartImageView];
self.heartLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, 14)];
self.heartLabel.textAlignment = NSTextAlignmentCenter;
self.heartLabel.font = [UIFont boldSystemFontOfSize:14];
self.heartLabel.text = @"-";
self.heartLabel.centerY = self.giftHeartImageView.centerY;
[self.bgView addSubview:self.heartLabel];
self.centerGiftBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_center_gift_bg"]];
self.centerGiftBgImageView.frame = CGRectMake((self.bgView.width-ScaleWidth(320))/2, self.giftImageView.top, ScaleWidth(320), ScaleWidth(195));
[self.bgView insertSubview:self.centerGiftBgImageView belowSubview:self.giftImageView];
self.userBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_user_bg"]];
self.userBgImageView.contentMode = UIViewContentModeScaleToFill;
self.userBgImageView.frame = CGRectMake(self.bgView.width-25-ScaleWidth(56), 0, ScaleWidth(56), ScaleWidth(73));
self.userBgImageView.centerY = self.centerGiftBgImageView.centerY;
[self.bgView addSubview:self.userBgImageView];
self.userHeader = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.userBgImageView.top, ScaleWidth(36), ScaleWidth(36))];
self.userHeader.contentMode = UIViewContentModeScaleAspectFill;
self.userHeader.centerX = self.userBgImageView.centerX;
[self.userHeader addRoundedCornersWithRadius:ScaleWidth(18)];
[self.bgView addSubview:self.userHeader];
self.userHeaderDress = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(52), ScaleWidth(52))];
UIImage *dressImage = [UIImage imageNamed:@"ac_user_dress"];
self.userHeaderDress.image = dressImage;
self.userHeaderDress.hidden = YES;
self.userHeaderDress.contentMode = UIViewContentModeScaleAspectFill;
self.userHeaderDress.centerX = self.userHeader.centerX;
self.userHeaderDress.centerY = self.userHeader.centerY;
[self.bgView addSubview:self.userHeaderDress];
// @2x
self.userNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.userBgImageView.left, self.userBgImageView.bottom-7-14, self.userBgImageView.width, 14)];
self.userNameLabel.textColor = RGB16(0xffffff);
self.userNameLabel.font = [UIFont systemFontOfSize:12];
self.userNameLabel.text = @"虚位以待";
self.userNameLabel.textAlignment = NSTextAlignmentCenter;
[self.bgView addSubview:self.userNameLabel];
self.leftGiftBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_left_gift_bg"]];
self.leftGiftBgImageView.frame = CGRectMake(25, 0, ScaleWidth(94), ScaleWidth(105));
self.leftGiftBgImageView.centerY = self.centerGiftBgImageView.centerY;
[self.bgView addSubview:self.leftGiftBgImageView];
self.leftGiftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.leftGiftBgImageView.top+ScaleWidth(13), ScaleWidth(54), ScaleWidth(52))];
self.leftGiftImageView.centerX = self.leftGiftBgImageView.centerX;
// self.leftGiftImageView.backgroundColor = UIColor.redColor;
[self.bgView addSubview:self.leftGiftImageView];
CGFloat btnWidth = ScaleWidth(109);
CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4;
@@ -329,6 +311,19 @@
-(void)timeDownDidFinished{
[self hide];
}
//-(void)timeDownStopAnimation{
// [self.bottomGiftView stopAnimation];
//}
//-(void)timeDownStartAnimation{
// [self.bottomGiftView startAnimation];
//}
//-(void)timeDownUpdateAnimationWithTime:(NSInteger)time{
// NSInteger speed = 1 - (30 - time)*0.03;
// if (speed <= 0.3) {
// speed = 0.3;
// }
// [self.bottomGiftView updateAnimationSpeed:speed];
//}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
@@ -363,23 +358,25 @@
QXActivityXLHModel *model = [QXActivityXLHModel yy_modelWithJSON:responseObject[@"data"]];
weakSelf.model = model;
[weakSelf configData];
[weakSelf.bottomGiftView stopAnimation];
[weakSelf.bottomGiftView startAnimation];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}];
}
-(void)configBtnStatus{
if (self.coin > 0 && self.model.box_price.integerValue > 0) {
if (self.coin>self.model.box_price.integerValue) {
if (self.coin>=self.model.box_price.integerValue) {
self.oneBtn.isDisable = NO;
}else{
self.oneBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*10)) {
if (self.coin>=(self.model.box_price.integerValue*6)) {
self.tenBtn.isDisable = NO;
}else{
self.tenBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*100)) {
if (self.coin>=(self.model.box_price.integerValue*9)) {
self.hundredBtn.isDisable = NO;
}else{
self.hundredBtn.isDisable = YES;
@@ -476,27 +473,24 @@
[self configBtnStatus];
if (self.model.xlh_user) {
[self.userHeader sd_setImageWithURL:[NSURL URLWithString:self.model.xlh_user.avatar]];
self.userHeader.hidden = NO;
self.userNameLabel.text = self.model.xlh_user.nickname?self.model.xlh_user.nickname:@"虚位以待";
self.userHeaderDress.hidden = NO;
self.roomLuckUserView.model = self.model.xlh_user;
}else{
self.userHeaderDress.hidden = YES;
self.userHeader.hidden = YES;
self.userNameLabel.text = self.model.xlh_user.nickname?self.model.xlh_user.nickname:@"虚位以待";
[self.roomLuckUserView resetView];
}
if (self.model.homeowner_user) {
self.roomOwenrView.model = self.model.homeowner_user;
}else{
[self.roomOwenrView resetView];
}
if (self.model.locking_gift) {
NSString *encodedQuery = [self.model.locking_gift.base_image stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSURL *imageUrl = [NSURL URLWithString:encodedQuery];
[self.giftImageView sd_setImageWithURL:imageUrl];
self.giftNameLabel.text = self.model.locking_gift.gift_name;
[self.giftCoinBtn setTitle:[NSString stringWithFormat:@" %@",self.model.locking_gift.gift_price] forState:(UIControlStateNormal)];
self.heartLabel.text = self.model.locking_gift.gift_num?self.model.locking_gift.gift_num:@"0";
self.bottomGiftView.model = self.model.locking_gift;
self.countLabel.text = self.model.locking_gift.gift_num?[NSString stringWithFormat:@"x%@",self.model.locking_gift.gift_num]:@"x0";
}
if (self.model.give_homeowner_gift) {
[self.leftGiftImageView sd_setImageWithURL:[NSURL URLWithString:self.model.give_homeowner_gift.base_image]];
self.topGiftView.model = self.model.give_homeowner_gift;
}
self.cycleScrollView.prizes = self.model.gift_list;
self.timeDownView.endTime = self.model.xlh_end_time.longLongValue;
@@ -524,6 +518,7 @@
self.bgView.y = SCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self removeFromSuperview];
[self.bottomGiftView stopAnimation];
}];
}
-(void)poolAction{
@@ -583,7 +578,7 @@
}
-(QXMeetLotteryView *)cycleScrollView{
if (!_cycleScrollView) {
_cycleScrollView = [[QXMeetLotteryView alloc] initWithFrame:CGRectMake(0, self.giftHeartImageView.bottom+20, self.bgView.width, 220)];
_cycleScrollView = [[QXMeetLotteryView alloc] initWithFrame:CGRectMake(0, self.bottomGiftBgView.bottom+20, self.bgView.width, 220)];
_cycleScrollView.delegate = self;
}
return _cycleScrollView;
@@ -611,10 +606,10 @@
if (self.startTime <= 0) {
//
self.timeLabel1.text = @"0";
self.timeLabel2.text = @"0";
self.timeLabel3.text = @"0";
self.timeLabel4.text = @"0";
self.bigTimeLabel.hidden = NO;
self.timeLabel.hidden = YES;
self.titleLabel.hidden = YES;
self.bigTimeLabel.text = @"0";
return;
}
MJWeakSelf
@@ -623,26 +618,58 @@
dispatch_async(dispatch_get_main_queue(), ^{
weakSelf.startTime--;
// NSInteger hour = self.startTime/60/60;
NSInteger min = (self.startTime % 3600) / 60;
NSInteger second = self.startTime % 60;
NSString *time = [NSString stringWithFormat:@"%02ld%02ld",min,second];
if (time.length == 4) {
weakSelf.timeLabel1.text = [time substringWithRange:NSMakeRange(0, 1)];
weakSelf.timeLabel2.text = [time substringWithRange:NSMakeRange(1, 1)];
weakSelf.timeLabel3.text = [time substringWithRange:NSMakeRange(2, 1)];
weakSelf.timeLabel4.text = [time substringWithRange:NSMakeRange(3, 1)];
NSInteger min = (weakSelf.startTime % 3600) / 60;
NSInteger second = weakSelf.startTime % 60;
if (weakSelf.startTime<=30) {
weakSelf.bigTimeLabel.hidden = NO;
weakSelf.timeLabel.hidden = YES;
weakSelf.titleLabel.hidden = YES;
weakSelf.bigTimeLabel.text = [NSString stringWithFormat:@"%lld",weakSelf.startTime];
weakSelf.timeLabel.text = @"-";
if (weakSelf.startTime == 30) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(timeDownStartAnimation)]) {
[weakSelf.delegate timeDownStartAnimation];
}
}else{
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(timeDownUpdateAnimationWithTime:)]) {
[weakSelf.delegate timeDownUpdateAnimationWithTime:weakSelf.startTime];
}
}
//
[UIView animateWithDuration:0.6
delay:0
usingSpringWithDamping:0
initialSpringVelocity:0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
weakSelf.bigTimeLabel.transform = CGAffineTransformMakeScale(1.5, 1.5);
} completion:^(BOOL finished) {
weakSelf.bigTimeLabel.transform = CGAffineTransformIdentity;
}];
}else{
weakSelf.bigTimeLabel.hidden = YES;
weakSelf.timeLabel.hidden = NO;
weakSelf.titleLabel.hidden = NO;
weakSelf.timeLabel.text = [NSString stringWithFormat:@"%02ld:%02ld",min,second];
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(timeDownStopAnimation)]) {
[weakSelf.delegate timeDownStopAnimation];
}
}
if (weakSelf.startTime<=0) {
[weakSelf stopTimer];
weakSelf.timeLabel1.text = @"0";
weakSelf.timeLabel2.text = @"0";
weakSelf.timeLabel3.text = @"0";
weakSelf.timeLabel4.text = @"0";
weakSelf.bigTimeLabel.hidden = NO;
weakSelf.timeLabel.hidden = YES;
weakSelf.titleLabel.hidden = YES;
weakSelf.bigTimeLabel.text = @"0";
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(timeDownDidFinished)]) {
[weakSelf.delegate timeDownDidFinished];
}
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(timeDownStopAnimation)]) {
[weakSelf.delegate timeDownStopAnimation];
}
}
});
}];
}
@@ -653,92 +680,49 @@
}
}
-(void)initSubviews{
self.timeBgView1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_time_down_bg"]];
[self addSubview:self.timeBgView1];
[self.timeBgView1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(19));
make.height.mas_equalTo(ScaleWidth(29));
make.left.equalTo(self);
make.centerY.equalTo(self);
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_time_down_bg1"]];
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
self.timeLabel1 = [[UILabel alloc] init];
self.timeLabel1.font = [UIFont fontWithName:@"Didot" size:16];
self.timeLabel1.textColor = RGB16(0x00F3D3);
self.timeLabel1.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.timeLabel1];
[self.timeLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.timeBgView1);
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont systemFontOfSize:12];
self.titleLabel.textColor = RGB16(0xFFECA7);
self.titleLabel.text = @"倒计时";
self.titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self).offset(-ScaleWidth(24));
make.height.mas_equalTo(15);
make.centerX.equalTo(self);
}];
self.timeBgView2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_time_down_bg"]];
[self addSubview:self.timeBgView2];
[self.timeBgView2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(19));
make.height.mas_equalTo(ScaleWidth(29));
make.left.equalTo(self.timeBgView1.mas_right).offset(6);
make.centerY.equalTo(self);
}];
self.timeLabel2 = [[UILabel alloc] init];
self.timeLabel2.font = [UIFont fontWithName:@"Didot" size:16];
self.timeLabel2.textColor = RGB16(0x00F3D3);
self.timeLabel2.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.timeLabel2];
[self.timeLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.timeBgView2);
self.timeLabel = [[UILabel alloc] init];
self.timeLabel.font = [UIFont fontWithName:@"DIN Condensed" size:24];
self.timeLabel.textColor = RGB16(0xFFECA7);
self.timeLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.titleLabel.mas_top).offset(0);
make.height.mas_equalTo(25);
make.centerX.equalTo(self);
}];
self.centerLabel = [[UILabel alloc] init];
self.centerLabel.font = [UIFont fontWithName:@"Didot" size:16];
self.centerLabel.text = @":";
self.centerLabel.textAlignment = NSTextAlignmentCenter;
self.centerLabel.textColor = RGB16(0x00F3D3);
[self addSubview:self.centerLabel];
[self.centerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
self.bigTimeLabel = [[UILabel alloc] init];
self.bigTimeLabel.font = [UIFont fontWithName:@"DIN Condensed" size:32];
self.bigTimeLabel.text = @"-";
self.bigTimeLabel.textAlignment = NSTextAlignmentCenter;
self.bigTimeLabel.textColor = RGB16(0xFFECA7);
[self addSubview:self.bigTimeLabel];
[self.bigTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.centerY.equalTo(self);
}];
self.timeBgView4 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_time_down_bg"]];
[self addSubview:self.timeBgView4];
[self.timeBgView4 mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(19));
make.height.mas_equalTo(ScaleWidth(29));
make.right.equalTo(self);
make.centerY.equalTo(self);
}];
self.timeLabel4 = [[UILabel alloc] init];
self.timeLabel4.font = [UIFont fontWithName:@"Didot" size:16];
self.timeLabel4.textColor = RGB16(0x00F3D3);
self.timeLabel4.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.timeLabel4];
[self.timeLabel4 mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.timeBgView4);
}];
self.timeBgView3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_time_down_bg"]];
[self addSubview:self.timeBgView3];
[self.timeBgView3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(19));
make.height.mas_equalTo(ScaleWidth(29));
make.right.equalTo(self.timeBgView4.mas_left).offset(-6);
make.centerY.equalTo(self);
}];
self.timeLabel3 = [[UILabel alloc] init];
self.timeLabel3.textColor = RGB16(0x00F3D3);
self.timeLabel3.textAlignment = NSTextAlignmentCenter;
self.timeLabel3.font = [UIFont fontWithName:@"Didot" size:16];
[self addSubview:self.timeLabel3];
[self.timeLabel3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.timeBgView3);
}];
self.timeLabel1.text = @"0";
self.timeLabel2.text = @"0";
self.timeLabel3.text = @"0";
self.timeLabel4.text = @"0";
}
@@ -814,6 +798,187 @@
@end
@implementation QXMeetUserView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.clipsToBounds = NO;
self.headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(9, 9, self.width-9*2, self.width-9*2)];
self.headerImageView.image = [UIImage imageNamed:@"user_header_placehoulder"];
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.headerImageView addRoundedCornersWithRadius:self.headerImageView.height/2];
[self addSubview:self.headerImageView];
self.dressImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.width)];
self.dressImageView.image = [UIImage imageNamed:@"ac_user_dress"];
[self addSubview:self.dressImageView];
self.tagLabel = [[UILabel alloc] initWithFrame:CGRectMake((self.width-45)/2, self.headerImageView.bottom-8, 45, 16)];
self.tagLabel.textColor = RGB16(0xFFE554);
self.tagLabel.textAlignment = NSTextAlignmentCenter;
self.tagLabel.font = [UIFont systemFontOfSize:12];
[self.tagLabel addRoundedCornersWithRadius:8];
[self addSubview:self.tagLabel];
self.nameLabel = [[UILabel alloc] init] ;
self.nameLabel.textColor = RGB16(0xffffff);
self.nameLabel.font = [UIFont systemFontOfSize:12];
self.nameLabel.text = @"虚位以待";
[self addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.bottom.equalTo(self);
}];
}
-(void)setIsLuckUser:(BOOL)isLuckUser{
_isLuckUser = isLuckUser;
self.tagLabel.textColor = isLuckUser?RGB16(0xffffff):RGB16(0xFFE554);
self.tagLabel.backgroundColor = isLuckUser?RGB16(0x6C49E4):RGB16(0x8D6F28);
self.tagLabel.text = isLuckUser?@"幸运者":@"房主";
}
-(void)setModel:(QXUserModel *)model{
_model = model;
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar]];
self.nameLabel.text = model.nickname;
}
-(void)resetView{
self.headerImageView.image = [UIImage imageNamed:@"user_header_placehoulder"];
self.nameLabel.text = @"虚位以待";
}
@end
@implementation QXMeetGiftView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.giftNameLabel = [[UILabel alloc] init];
self.giftNameLabel.textColor = RGB16(0xffffff);
self.giftNameLabel.font = [UIFont systemFontOfSize:12];
self.giftNameLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.giftNameLabel];
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self);
make.centerX.equalTo(self);
make.height.mas_equalTo(15);
}];
self.giftPriceBgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_gift_name_bg"]];
[self addSubview:self.giftPriceBgView];
[self.giftPriceBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.giftNameLabel.mas_top);
make.left.right.equalTo(self);
make.height.mas_equalTo(15);
}];
self.giftCoin = [[UIButton alloc] init];
[self.giftCoin setTitleColor:RGB16(0xC7BF62) forState:(UIControlStateNormal)];
[self.giftCoin setImage:[UIImage imageNamed:@"sky_item_coin"] forState:(UIControlStateNormal)];
self.giftCoin.titleLabel.font = [UIFont systemFontOfSize:10];
[self addSubview:self.giftCoin];
[self.giftCoin mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(self.giftPriceBgView);
}];
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_left_gift_bg"]];
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self);
make.bottom.equalTo(self).offset(-19);
}];
self.giftBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_lock_gift_light_bg"]];
self.giftBgImageView.hidden = YES;
self.giftBgImageView.contentMode = UIViewContentModeScaleToFill;
[self addSubview:self.giftBgImageView];
[self.giftBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self);
make.bottom.equalTo(self).offset(-19);
}];
self.giftImageView = [[UIImageView alloc] init];
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:self.giftImageView];
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self).offset(6);
make.right.equalTo(self).offset(-6);
make.height.equalTo(self.giftImageView.mas_width);
}];
[self bringSubviewToFront:self.giftPriceBgView];
[self bringSubviewToFront:self.giftCoin];
}
-(void)setIsLockGift:(BOOL)isLockGift{
_isLockGift = isLockGift;
self.bgImageView.image = [UIImage imageNamed:isLockGift?@"ac_lock_gift_bg":@"ac_left_gift_bg"];
self.giftBgImageView.hidden = isLockGift?NO:YES;
if (isLockGift) {
[self.giftImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(self.bgImageView);
make.height.width.mas_equalTo(ScaleWidth(62));
}];
}
//
}
-(void)setModel:(QXDrawGiftModel *)model{
_model = model;
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
self.giftNameLabel.text = model.gift_name;
[self.giftCoin setTitle:model.gift_price forState:(UIControlStateNormal)];
}
- (void)startAnimation {
CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
//
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI];
//
rotationAnimation.duration = 3;
rotationAnimation.cumulative = YES;
rotationAnimation.removedOnCompletion = NO;
//MAXFLOAT
rotationAnimation.repeatCount = MAXFLOAT;
[self.giftImageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
CABasicAnimation *rotationAnimation1 = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
//
rotationAnimation1.toValue = [NSNumber numberWithFloat: -M_PI];
//
rotationAnimation1.duration = 3;
rotationAnimation1.cumulative = YES;
rotationAnimation1.removedOnCompletion = NO;
//MAXFLOAT
rotationAnimation1.repeatCount = MAXFLOAT;
[self.giftBgImageView.layer addAnimation:rotationAnimation1 forKey:@"rotationAnimation1"];
}
-(void)resetAnimation{
[self.giftImageView.layer removeAllAnimations];
[self.giftBgImageView.layer removeAllAnimations];
}
-(void)stopAnimation{
[self.giftImageView.layer removeAllAnimations];
[self.giftBgImageView.layer removeAllAnimations];
}
@end
//@implementation QXMeetGiftCell
//

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@@ -403,17 +403,17 @@ static NSInteger toSlowCount = 4;
}
-(void)configBtnStatus{
if (self.coin > 0 && self.model.box_price.integerValue > 0) {
if (self.coin>self.model.box_price.integerValue) {
if (self.coin>=self.model.box_price.integerValue) {
self.oneBtn.isDisable = NO;
}else{
self.oneBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*6)) {
if (self.coin>=(self.model.box_price.integerValue*6)) {
self.tenBtn.isDisable = NO;
}else{
self.tenBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*9)) {
if (self.coin>=(self.model.box_price.integerValue*9)) {
self.hundredBtn.isDisable = NO;
}else{
self.hundredBtn.isDisable = YES;