修改完成

This commit is contained in:
启星
2025-09-11 18:25:41 +08:00
parent 349cab1499
commit 35709d4e8e
67 changed files with 1344 additions and 223 deletions

View File

@@ -11,9 +11,9 @@ typedef NS_ENUM(NSInteger) {
/// 抽一次
QXSkyDrawBtnTypeOne = 1,
/// 抽10次
QXSkyDrawBtnTypeTen = 10,
QXSkyDrawBtnTypeTen = 6,
/// 抽100次
QXSkyDrawBtnTypeHundred = 100,
QXSkyDrawBtnTypeHundred = 9,
}QXSkyDrawBtnType;
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)QXSkyDrawBtnType btnType;
@end

View File

@@ -83,6 +83,8 @@ static NSInteger toSlowCount = 4;
@property (nonatomic,strong)QXSkyPraizeRecordView *recordView;
@property (nonatomic,strong)QXDrawGiftCenterView * centerView;
@property (nonatomic,assign)double coin;
@end
@implementation QXSkyPraizeView
@@ -183,6 +185,7 @@ static NSInteger toSlowCount = 4;
CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4;
QXSkyDrawBtn *oneBtn = [[QXSkyDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))];
oneBtn.btnType = QXSkyDrawBtnTypeOne;
oneBtn.isDisable = YES;
self.oneBtn = oneBtn;
self.oneBtn.hidden = YES;
[oneBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -190,6 +193,7 @@ static NSInteger toSlowCount = 4;
QXSkyDrawBtn *tenBtn = [[QXSkyDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
tenBtn.btnType = QXSkyDrawBtnTypeTen;
tenBtn.isDisable = YES;
self.tenBtn = tenBtn;
self.tenBtn.hidden = YES;
[tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -197,6 +201,7 @@ static NSInteger toSlowCount = 4;
QXSkyDrawBtn *hundredBtn = [[QXSkyDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
hundredBtn.btnType = QXSkyDrawBtnTypeHundred;
hundredBtn.isDisable = YES;
self.hundredBtn = hundredBtn;
self.hundredBtn.hidden = YES;
[hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -274,6 +279,8 @@ static NSInteger toSlowCount = 4;
weakSelf.coinView.x = (self.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 conifgBtnStatus];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}];
@@ -309,22 +316,50 @@ 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 conifgBtnStatus];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}];
}
-(void)conifgBtnStatus{
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
@@ -332,7 +367,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++) {
@@ -392,6 +427,10 @@ static NSInteger toSlowCount = 4;
}
}
-(void)startAction:(QXSkyDrawBtn*)sender{
if (sender.isDisable) {
showToast(@"金币不足");
return;
}
if (self.isDrawing) {
showToast(@"正在抽奖中");
return;
@@ -790,6 +829,10 @@ static NSInteger toSlowCount = 4;
[self addSubview:self.giftCoin];
}
-(void)setIsDisable:(BOOL)isDisable{
_isDisable = isDisable;
self.bgImageView.image = [UIImage imageNamed:isDisable?@"sky_touch_dis_bg":@"sky_touch_bg"];
}
-(void)setBtnType:(QXSkyDrawBtnType)btnType{
// ///
// QXSkyDrawBtnTypeOne = 0,
@@ -807,13 +850,13 @@ static NSInteger toSlowCount = 4;
break;
case QXSkyDrawBtnTypeTen:
{
self.titleLabel.text = @"抽次";
self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
}
break;
case QXSkyDrawBtnTypeHundred:
{
self.titleLabel.text = @"抽次";
self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
}
break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -11,9 +11,9 @@ typedef NS_ENUM(NSInteger) {
/// 抽一次
QXAgeDrawBtnTypeOne = 1,
/// 抽10次
QXAgeDrawBtnTypeTen = 10,
QXAgeDrawBtnTypeTen = 6,
/// 抽100次
QXAgeDrawBtnTypeHundred = 100,
QXAgeDrawBtnTypeHundred = 9,
}QXAgeDrawBtnType;
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)QXAgeDrawBtnType btnType;
@end

View File

@@ -84,6 +84,8 @@ static NSInteger toSlowCount = 4;
@property (nonatomic,strong)QXAgePraizeRecordView *recordView;
@property (nonatomic,strong)QXDrawGiftCenterView * centerView;
@property (nonatomic,assign)double coin;
@end
@implementation QXAgePraizeView
@@ -215,6 +217,7 @@ static NSInteger toSlowCount = 4;
CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4;
QXAgeDrawBtn *oneBtn = [[QXAgeDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))];
oneBtn.btnType = QXAgeDrawBtnTypeOne;
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;
QXAgeDrawBtn *tenBtn = [[QXAgeDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
tenBtn.btnType = QXAgeDrawBtnTypeTen;
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;
QXAgeDrawBtn *hundredBtn = [[QXAgeDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
hundredBtn.btnType = QXAgeDrawBtnTypeHundred;
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 = (self.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:(QXAgeDrawBtn*)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?@"age_touch_dis_bg":@"age_touch_bg"];
}
-(void)setBtnType:(QXAgeDrawBtnType)btnType{
// ///
// QXAgeDrawBtnTypeOne = 0,
@@ -840,13 +882,13 @@ static NSInteger toSlowCount = 4;
break;
case QXAgeDrawBtnTypeTen:
{
self.titleLabel.text = @"抽次";
self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
}
break;
case QXAgeDrawBtnTypeHundred:
{
self.titleLabel.text = @"抽次";
self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
}
break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -42,6 +42,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)QXSkyDrawBtnType btnType;
@end

View File

@@ -13,6 +13,7 @@
#import "QXMeetActivityResultView.h"
#import "QXMeetLotteryView.h"
#import "QXDiamondViewController.h"
@interface QXMeetActivityView()<UIGestureRecognizerDelegate,QXMeetLotteryViewDelegate>
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView;
@@ -77,6 +78,8 @@
@property (nonatomic,strong)QXMeetActivityResultView *resultView;
@property (nonatomic,assign)double coin;
@end
@implementation QXMeetActivityView
@@ -258,7 +261,8 @@
[self.exchangeBtn setTitle:@"去兑换" forState:(UIControlStateNormal)];
[self.exchangeBtn setTitleColor:RGB16(0xF8E837) forState:(UIControlStateNormal)];
self.exchangeBtn.titleLabel.font = [UIFont systemFontOfSize:10];
self.exchangeBtn.userInteractionEnabled = NO;
self.exchangeBtn.userInteractionEnabled = YES;
[self.exchangeBtn addTarget:self action:@selector(exchangeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.coinView addSubview:self.exchangeBtn];
@@ -283,6 +287,10 @@
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
-(void)exchangeAction{
QXDiamondViewController *vc = [[QXDiamondViewController alloc] init];
[self.viewController.navigationController pushViewController:vc animated:YES];
}
-(void)getMyWallet{
MJWeakSelf
[[QXRequset shareInstance] getWithUrl:QXWallet parameters:@{@"token":[QXGlobal shareGlobal].loginModel.token?[QXGlobal shareGlobal].loginModel.token:@""} needCache:NO success:^(id responseObject) {
@@ -295,6 +303,8 @@
weakSelf.coinView.x = (self.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) {
}];
@@ -312,6 +322,29 @@
}];
}
-(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*10)) {
self.tenBtn.isDisable = NO;
}else{
self.tenBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*100)) {
self.hundredBtn.isDisable = NO;
}else{
self.hundredBtn.isDisable = YES;
}
}else{
self.oneBtn.isDisable = YES;
self.tenBtn.isDisable = YES;
self.hundredBtn.isDisable = YES;
}
}
-(void)drawGiftWithNum:(NSString*)num{
if (self.isDrawing) {
showToast(@"正在抽奖中");
@@ -328,20 +361,19 @@
MJWeakSelf
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/xlh_draw_gift"] parameters:parameters needCache:NO success:^(id responseObject) {
weakSelf.resultArray = [NSArray yy_modelArrayWithClass:[QXDrawGiftModel class] json:responseObject[@"data"]];
[weakSelf getMyWallet];
if (weakSelf.jumpAnimateBtn.selected) {
weakSelf.resultView.resultArray = weakSelf.resultArray;
[weakSelf.resultView showInView:weakSelf];
weakSelf.isDrawing = NO;
}else{
NSInteger index = 0;
for (int i = 0; i < weakSelf.resultArray.count; i++) {
QXDrawGiftModel *md1 = weakSelf.resultArray[i];
for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
QXDrawGiftModel *md2 = weakSelf.model.gift_list[j];
if ([md1.gift_id isEqualToString:md2.gift_id]) {
index = j;
break;
}
QXDrawGiftModel *md1 = weakSelf.resultArray.firstObject;
for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
QXDrawGiftModel *md2 = weakSelf.model.gift_list[j];
if ([md1.gift_id isEqualToString:md2.gift_id]) {
index = j;
break;
}
}
weakSelf.cycleScrollView.finalPrizeIndex = index;
@@ -396,6 +428,7 @@
self.oneBtn.hidden = NO;
self.tenBtn.hidden = NO;
self.hundredBtn.hidden = NO;
[self configBtnStatus];
if (self.model.xlh_user) {
[self.userHeader sd_setImageWithURL:[NSURL URLWithString:self.model.xlh_user.avatar]];
@@ -693,6 +726,10 @@
[self addSubview:self.giftCoin];
}
-(void)setIsDisable:(BOOL)isDisable{
_isDisable = isDisable;
self.bgImageView.image = [UIImage imageNamed:isDisable?@"meet_touch_dis_bg":@"meet_touch_bg"];
}
-(void)setBtnType:(QXSkyDrawBtnType)btnType{
// ///
// QXSkyDrawBtnTypeOne = 0,

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -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

View File

@@ -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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB