修改完成

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

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