修改完成

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

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