修改完成
This commit is contained in:
@@ -11,9 +11,9 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// 抽一次
|
||||
QXTimeDrawBtnTypeOne = 1,
|
||||
/// 抽10次
|
||||
QXTimeDrawBtnTypeTen = 10,
|
||||
QXTimeDrawBtnTypeTen = 6,
|
||||
/// 抽100次
|
||||
QXTimeDrawBtnTypeHundred = 100,
|
||||
QXTimeDrawBtnTypeHundred = 9,
|
||||
}QXTimeDrawBtnType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)QXGiftModel *giftModel;
|
||||
@property (nonatomic,strong)QXGiftActivityModel *model;
|
||||
@property (nonatomic,strong)NSString* userIds;
|
||||
@property (nonatomic,strong)NSString* heartId;
|
||||
@property (nonatomic,copy)void(^startBlock)(void);
|
||||
-(void)showInView:(UIView *)view;
|
||||
-(void)hide;
|
||||
@@ -54,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIButton *giftCoin;
|
||||
@property (nonatomic,assign)BOOL isDisable;
|
||||
@property (nonatomic,assign)QXTimeDrawBtnType btnType;
|
||||
@end
|
||||
|
||||
|
||||
@@ -84,6 +84,8 @@ static NSInteger toSlowCount = 4;
|
||||
@property (nonatomic,strong)QXTimePraizeRecordView *recordView;
|
||||
|
||||
@property (nonatomic,strong)QXDrawGiftCenterView * centerView;
|
||||
|
||||
@property (nonatomic,assign)double coin;
|
||||
@end
|
||||
|
||||
@implementation QXTimePraizeView
|
||||
@@ -215,6 +217,7 @@ static NSInteger toSlowCount = 4;
|
||||
CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4;
|
||||
QXTimeDrawBtn *oneBtn = [[QXTimeDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))];
|
||||
oneBtn.btnType = QXTimeDrawBtnTypeOne;
|
||||
oneBtn.isDisable = YES;
|
||||
self.oneBtn = oneBtn;
|
||||
self.oneBtn.hidden = YES;
|
||||
[oneBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
@@ -222,6 +225,7 @@ static NSInteger toSlowCount = 4;
|
||||
|
||||
QXTimeDrawBtn *tenBtn = [[QXTimeDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
|
||||
tenBtn.btnType = QXTimeDrawBtnTypeTen;
|
||||
tenBtn.isDisable = YES;
|
||||
self.tenBtn = tenBtn;
|
||||
self.tenBtn.hidden = YES;
|
||||
[tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
@@ -229,6 +233,7 @@ static NSInteger toSlowCount = 4;
|
||||
|
||||
QXTimeDrawBtn *hundredBtn = [[QXTimeDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
|
||||
hundredBtn.btnType = QXTimeDrawBtnTypeHundred;
|
||||
hundredBtn.isDisable = YES;
|
||||
self.hundredBtn = hundredBtn;
|
||||
self.hundredBtn.hidden = YES;
|
||||
[hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
@@ -307,6 +312,8 @@ static NSInteger toSlowCount = 4;
|
||||
weakSelf.coinView.x = (weakSelf.bgView.width-allWidth)/2;
|
||||
weakSelf.coinBtn.frame = CGRectMake(10, 0, weakSelf.coinBtn.width, weakSelf.coinView.height);
|
||||
weakSelf.exchangeBtn.frame = CGRectMake(allWidth-weakSelf.exchangeBtn.width, 0, weakSelf.exchangeBtn.width, weakSelf.coinView.height);
|
||||
weakSelf.coin = coin;
|
||||
[weakSelf configBtnStatus];
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
|
||||
}];
|
||||
@@ -342,22 +349,49 @@ static NSInteger toSlowCount = 4;
|
||||
subview.giftModel = model.gift_list[i];
|
||||
}
|
||||
[weakSelf.oneBtn.giftCoin setTitle:[NSString stringWithFormat:@"%@币一次",model.box_price] forState:(UIControlStateNormal)];
|
||||
[weakSelf.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*10] forState:(UIControlStateNormal)];
|
||||
[weakSelf.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*100] forState:(UIControlStateNormal)];
|
||||
[weakSelf.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*6] forState:(UIControlStateNormal)];
|
||||
[weakSelf.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*9] forState:(UIControlStateNormal)];
|
||||
weakSelf.oneBtn.hidden = NO;
|
||||
weakSelf.tenBtn.hidden = NO;
|
||||
weakSelf.hundredBtn.hidden = NO;
|
||||
[weakSelf configBtnStatus];
|
||||
} 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) {
|
||||
self.oneBtn.isDisable = NO;
|
||||
}else{
|
||||
self.oneBtn.isDisable = YES;
|
||||
}
|
||||
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)) {
|
||||
self.hundredBtn.isDisable = NO;
|
||||
}else{
|
||||
self.hundredBtn.isDisable = YES;
|
||||
}
|
||||
}else{
|
||||
self.oneBtn.isDisable = YES;
|
||||
self.tenBtn.isDisable = YES;
|
||||
self.hundredBtn.isDisable = YES;
|
||||
}
|
||||
}
|
||||
-(void)setHeartId:(NSString *)heartId{
|
||||
_heartId = heartId;
|
||||
}
|
||||
-(void)drawGiftWithNum:(NSString*)num{
|
||||
NSDictionary *parameters = @{
|
||||
@"gift_bag_id":self.giftModel.gift_bag,
|
||||
@"gift_user_ids":self.userIds,
|
||||
@"room_id":self.roomId,
|
||||
@"num":num
|
||||
@"num":num,
|
||||
@"heart_id":[self.heartId isExist]?self.heartId:@""
|
||||
};
|
||||
self.isDrawing = YES;
|
||||
MJWeakSelf
|
||||
@@ -365,7 +399,7 @@ static NSInteger toSlowCount = 4;
|
||||
QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]];
|
||||
weakSelf.drawResultModel = model;
|
||||
[weakSelf.targetArrayIndex removeAllObjects];
|
||||
// [weakSelf resetViews];
|
||||
[weakSelf getMyWallet];
|
||||
for (int i = 0; i < model.reslut_list.count; i++) {
|
||||
QXDrawGiftModel *md = model.reslut_list[i];
|
||||
for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
|
||||
@@ -425,6 +459,10 @@ static NSInteger toSlowCount = 4;
|
||||
}
|
||||
}
|
||||
-(void)startAction:(QXTimeDrawBtn*)sender{
|
||||
if (sender.isDisable) {
|
||||
showToast(@"金币不足");
|
||||
return;
|
||||
}
|
||||
if (self.isDrawing) {
|
||||
showToast(@"正在抽奖中");
|
||||
return;
|
||||
@@ -823,6 +861,10 @@ static NSInteger toSlowCount = 4;
|
||||
[self addSubview:self.giftCoin];
|
||||
|
||||
}
|
||||
-(void)setIsDisable:(BOOL)isDisable{
|
||||
_isDisable = isDisable;
|
||||
self.bgImageView.image = [UIImage imageNamed:isDisable?@"time_touch_dis_bg":@"time_touch_bg"];
|
||||
}
|
||||
-(void)setBtnType:(QXTimeDrawBtnType)btnType{
|
||||
// /// 抽一次
|
||||
// QXTimeDrawBtnTypeOne = 0,
|
||||
@@ -840,13 +882,13 @@ static NSInteger toSlowCount = 4;
|
||||
break;
|
||||
case QXTimeDrawBtnTypeTen:
|
||||
{
|
||||
self.titleLabel.text = @"抽十次";
|
||||
self.titleLabel.text = @"抽六次";
|
||||
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
|
||||
}
|
||||
break;
|
||||
case QXTimeDrawBtnTypeHundred:
|
||||
{
|
||||
self.titleLabel.text = @"抽百次";
|
||||
self.titleLabel.text = @"抽九次";
|
||||
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
|
||||
}
|
||||
break;
|
||||
|
||||
BIN
QXLive/活动/时空之巅/Resource/time_touch_dis_bg@2x.png
Normal file
BIN
QXLive/活动/时空之巅/Resource/time_touch_dis_bg@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
QXLive/活动/时空之巅/Resource/time_touch_dis_bg@3x.png
Normal file
BIN
QXLive/活动/时空之巅/Resource/time_touch_dis_bg@3x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
Reference in New Issue
Block a user