暂时提交
This commit is contained in:
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXFirstRechargeView : UIView
|
||||
@property (nonatomic,copy)void(^closeActionBlock)(void);
|
||||
@property (nonatomic,copy)void(^getActionBlock)(void);
|
||||
@property (nonatomic,copy)void(^rechargeActionBlock)(NSString*money,NSString*gift_bag_id);
|
||||
@property (nonatomic,copy)void(^refreshBlcock)(void);
|
||||
@end
|
||||
|
||||
|
||||
@@ -149,8 +149,8 @@
|
||||
|
||||
// 立即领取
|
||||
-(void)getAction{
|
||||
if (self.getActionBlock) {
|
||||
self.getActionBlock();
|
||||
if (self.rechargeActionBlock) {
|
||||
self.rechargeActionBlock(self.model.money,self.model.gift_bag_id);
|
||||
}
|
||||
}
|
||||
-(void)closeAction{
|
||||
|
||||
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXNewPeoplePopView : UIView
|
||||
@property (nonatomic,copy)void(^closeActionBlock)(void);
|
||||
@property (nonatomic,copy)void(^rechargeActionBlock)(NSString*money);
|
||||
@property (nonatomic,copy)void(^rechargeActionBlock)(NSString*money,NSString*gift_bag_id);
|
||||
@property (nonatomic,copy)void(^refreshBlcock)(void);
|
||||
@property (nonatomic,strong)NSArray *giftArray;
|
||||
-(void)reloadData;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
@property (nonatomic,strong)UIButton *firstBtn;
|
||||
@property (nonatomic,strong)UIButton *secondBtn;
|
||||
@property (nonatomic,strong)UIButton *thirdBtn;
|
||||
@property (nonatomic,strong)UIButton *oneMouthBtn;
|
||||
@property (nonatomic,strong)UIButton *selectedBtn;
|
||||
|
||||
@property (nonatomic,strong)UIView *giftBgView;
|
||||
@@ -29,7 +30,9 @@
|
||||
@property (nonatomic,strong)QXNiceGiftRechargeModel *md1;
|
||||
@property (nonatomic,strong)QXNiceGiftRechargeModel *md2;
|
||||
@property (nonatomic,strong)QXNiceGiftRechargeModel *md3;
|
||||
@property (nonatomic,strong)QXNiceGiftRechargeModel *md4;
|
||||
@property (nonatomic,strong)QXNiceGiftRechargeModel *smd;
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXNewPeoplePopView
|
||||
@@ -71,9 +74,11 @@
|
||||
self.firstBtn.hidden = YES;
|
||||
UIImage *firstNorImage = [UIImage imageWithColor:RGB16(0xFFFFFF)];
|
||||
UIImage *firstSelImage = [UIImage imageWithColor:RGB16(0xF4DF39)];
|
||||
UIImage *firstDisImage = [UIImage imageWithColor:RGB16(0xE9E9E9)];
|
||||
[self.firstBtn setBackgroundImage:firstNorImage forState:(UIControlStateNormal)];
|
||||
[self.firstBtn setBackgroundImage:firstSelImage forState:(UIControlStateSelected)];
|
||||
self.firstBtn.selected = YES;
|
||||
[self.firstBtn setBackgroundImage:firstDisImage forState:(UIControlStateDisabled)];
|
||||
// self.firstBtn.selected = YES;
|
||||
// [self.firstBtn setTitle:@"9元" forState:(UIControlStateNormal)];
|
||||
[self.firstBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
|
||||
[self.firstBtn addRoundedCornersWithRadius:ScaleWidth(13)];
|
||||
@@ -92,8 +97,10 @@
|
||||
self.secondBtn.hidden = YES;
|
||||
UIImage *secondNorImage = [UIImage imageWithColor:RGB16(0xFFFFFF)];
|
||||
UIImage *secondSelImage = [UIImage imageWithColor:RGB16(0xF4DF39)];
|
||||
UIImage *secondDisImage = [UIImage imageWithColor:RGB16(0xE9E9E9)];
|
||||
[self.secondBtn setBackgroundImage:secondNorImage forState:(UIControlStateNormal)];
|
||||
[self.secondBtn setBackgroundImage:secondSelImage forState:(UIControlStateSelected)];
|
||||
[self.secondBtn setBackgroundImage:secondDisImage forState:(UIControlStateDisabled)];
|
||||
// [self.secondBtn setTitle:@"30元" forState:(UIControlStateNormal)];
|
||||
[self.secondBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
|
||||
[self.secondBtn addRoundedCornersWithRadius:ScaleWidth(13)];
|
||||
@@ -104,7 +111,7 @@
|
||||
make.left.equalTo(self.firstBtn.mas_right).offset(12);
|
||||
make.top.equalTo(self.firstBtn);
|
||||
make.height.mas_equalTo(ScaleWidth(26));
|
||||
make.width.mas_equalTo(ScaleWidth(42));
|
||||
make.width.mas_equalTo(ScaleWidth(50));
|
||||
}];
|
||||
|
||||
|
||||
@@ -112,8 +119,10 @@
|
||||
self.thirdBtn.hidden = YES;
|
||||
UIImage *thirdNorImage = [UIImage imageWithColor:RGB16(0xFFFFFF)];
|
||||
UIImage *thirdSelImage = [UIImage imageWithColor:RGB16(0xF4DF39)];
|
||||
UIImage *thirdDisImage = [UIImage imageWithColor:RGB16(0xE9E9E9)];
|
||||
[self.thirdBtn setBackgroundImage:thirdNorImage forState:(UIControlStateNormal)];
|
||||
[self.thirdBtn setBackgroundImage:thirdSelImage forState:(UIControlStateSelected)];
|
||||
[self.thirdBtn setBackgroundImage:thirdDisImage forState:(UIControlStateSelected)];
|
||||
// [self.thirdBtn setTitle:@"60元" forState:(UIControlStateNormal)];
|
||||
[self.thirdBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
|
||||
[self.thirdBtn addRoundedCornersWithRadius:ScaleWidth(13)];
|
||||
@@ -124,9 +133,28 @@
|
||||
make.left.equalTo(self.secondBtn.mas_right).offset(12);
|
||||
make.top.equalTo(self.firstBtn);
|
||||
make.height.mas_equalTo(ScaleWidth(26));
|
||||
make.width.mas_equalTo(ScaleWidth(42));
|
||||
make.width.mas_equalTo(ScaleWidth(50));
|
||||
}];
|
||||
|
||||
self.oneMouthBtn = [[UIButton alloc] init];
|
||||
self.oneMouthBtn.hidden = YES;
|
||||
UIImage *one_mouth_norImage = [UIImage imageNamed:@"one_mouth_money"];
|
||||
UIImage *one_mouth_selImage = [UIImage imageNamed:@"one_mouth_money"];
|
||||
[self.oneMouthBtn setBackgroundImage:one_mouth_norImage forState:(UIControlStateNormal)];
|
||||
[self.oneMouthBtn setBackgroundImage:one_mouth_selImage forState:(UIControlStateSelected)];
|
||||
[self.oneMouthBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
|
||||
[self.oneMouthBtn addRoundedCornersWithRadius:ScaleWidth(13)];
|
||||
self.oneMouthBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.oneMouthBtn addTarget:self action:@selector(rechargeSelectedAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.oneMouthBtn];
|
||||
[self.oneMouthBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.bgImageView.mas_right).offset(-27);
|
||||
make.centerY.equalTo(self.firstBtn);
|
||||
make.height.mas_equalTo(ScaleWidth(24));
|
||||
make.width.mas_equalTo(ScaleWidth(66));
|
||||
}];
|
||||
|
||||
|
||||
self.giftBgView = [[UIView alloc] init];
|
||||
self.giftBgView.backgroundColor = [UIColor whiteColor];
|
||||
[self.giftBgView addRoundedCornersWithRadius:13];
|
||||
@@ -204,30 +232,55 @@
|
||||
}
|
||||
-(void)getFirstRechargeGiftList{
|
||||
MJWeakSelf
|
||||
[QXHomePageNetwork getNewUserGiftListSuccessBlock:^(NSArray<QXFirstRechargeModel *> * _Nonnull list) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
[QXHomePageNetwork getNewUserGiftListSuccessBlock:^(NSArray<QXNiceGiftRechargeModel *> * _Nonnull list) {
|
||||
for (int i = 0; i<list.count; i++) {
|
||||
if (i == 0) {
|
||||
weakSelf.md1 = list[i];
|
||||
weakSelf.firstBtn.hidden = NO;
|
||||
[weakSelf.firstBtn setTitle:weakSelf.md1.name forState:(UIControlStateNormal)];
|
||||
if (weakSelf.md1.status.intValue == 1) {
|
||||
weakSelf.firstBtn.enabled = YES;
|
||||
weakSelf.firstBtn.selected = YES;
|
||||
weakSelf.selectedBtn = weakSelf.firstBtn;
|
||||
}else{
|
||||
weakSelf.firstBtn.enabled = NO;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (i == 1) {
|
||||
weakSelf.md2 = list[i];
|
||||
weakSelf.secondBtn.hidden = NO;
|
||||
[weakSelf.secondBtn setTitle:weakSelf.md2.name forState:(UIControlStateNormal)];
|
||||
if (weakSelf.md2.status.intValue == 1) {
|
||||
weakSelf.secondBtn.enabled = YES;
|
||||
if (!weakSelf.selectedBtn.selected) {
|
||||
weakSelf.secondBtn.selected = YES;
|
||||
weakSelf.selectedBtn = weakSelf.secondBtn;
|
||||
}
|
||||
}else{
|
||||
weakSelf.secondBtn.enabled = NO;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (i == 2) {
|
||||
weakSelf.md3 = list[i];
|
||||
weakSelf.thirdBtn.hidden = NO;
|
||||
[weakSelf.thirdBtn setTitle:weakSelf.md3.name forState:(UIControlStateNormal)];
|
||||
if (weakSelf.md3.status.intValue == 1) {
|
||||
weakSelf.thirdBtn.enabled = YES;
|
||||
if (!weakSelf.selectedBtn.selected) {
|
||||
weakSelf.thirdBtn.selected = YES;
|
||||
weakSelf.selectedBtn = weakSelf.thirdBtn;
|
||||
}
|
||||
}else{
|
||||
weakSelf.thirdBtn.enabled = NO;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (i == 3) {
|
||||
weakSelf.md4 = list[i];
|
||||
[weakSelf.oneMouthBtn setTitle:weakSelf.md4.name forState:(UIControlStateNormal)];
|
||||
weakSelf.oneMouthBtn.hidden = NO;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -285,6 +338,9 @@
|
||||
}else if (sender == self.thirdBtn){
|
||||
self.giftArray = self.md3.gift_list;
|
||||
md = self.md3;
|
||||
}else if (sender == self.oneMouthBtn){
|
||||
self.giftArray = self.md4.gift_list;
|
||||
md = self.md4;
|
||||
}
|
||||
self.smd = md;
|
||||
if (md == nil) {
|
||||
@@ -308,7 +364,7 @@
|
||||
}
|
||||
-(void)rechargeAction{
|
||||
if (self.rechargeActionBlock) {
|
||||
self.rechargeActionBlock(self.smd.money);
|
||||
self.rechargeActionBlock(self.smd.money,self.smd.gift_bag_id);
|
||||
}
|
||||
}
|
||||
-(void)closeAction{
|
||||
|
||||
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXNiceGiftPopView : UIView
|
||||
@property (nonatomic,copy)void(^closeActionBlock)(void);
|
||||
@property (nonatomic,copy)void(^getActionBlock)(void);
|
||||
@property (nonatomic,copy)void(^rechargeActionBlock)(NSString*money,NSString*gift_bag_id);
|
||||
@property (nonatomic,copy)void(^refreshBlcock)(void);
|
||||
@end
|
||||
|
||||
|
||||
@@ -54,7 +54,9 @@
|
||||
[self.timeDownbgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.bgImageView).offset(ScaleWidth(117));
|
||||
make.left.equalTo(self.bgImageView).offset(9);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(179), ScaleWidth(20)));
|
||||
make.right.equalTo(self.bgImageView).offset(-9);
|
||||
make.width.mas_equalTo(ScaleWidth(20));
|
||||
|
||||
}];
|
||||
|
||||
self.timeDownLabel = [[UILabel alloc] init];
|
||||
@@ -172,7 +174,7 @@
|
||||
MJWeakSelf
|
||||
[QXHomePageNetwork getSkyDropGiftListSuccessBlock:^(QXNiceGiftRechargeModel * _Nonnull model) {
|
||||
weakSelf.model = model;
|
||||
weakSelf.timeDownLabel.text = model.effective_time;
|
||||
weakSelf.timeDownLabel.text = [NSString stringWithFormat:@"结束时间:%@",model.effective_time];
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:model.counter];
|
||||
[attr yy_setColor:QXConfig.themeColor range:[model.counter rangeOfString:model.money]];
|
||||
[attr yy_setColor:QXConfig.themeColor range:[model.counter rangeOfString:model.diamond]];
|
||||
@@ -191,15 +193,15 @@
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftCell" forIndexPath:indexPath];
|
||||
cell.cellType = QXGiftCellTypeNiceGift;
|
||||
cell.roomGiftModel = self.model.gift_list[indexPath.row];
|
||||
cell.niceGiftModel = self.model.gift_list[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
||||
// 立即领取
|
||||
-(void)getAction{
|
||||
if (self.getActionBlock) {
|
||||
self.getActionBlock();
|
||||
if (self.rechargeActionBlock) {
|
||||
self.rechargeActionBlock(self.model.money,self.model.gift_bag_id);
|
||||
}
|
||||
}
|
||||
-(void)closeAction{
|
||||
|
||||
Reference in New Issue
Block a user