提交
This commit is contained in:
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user