最后调整

This commit is contained in:
启星
2025-09-15 18:20:22 +08:00
parent 35709d4e8e
commit a3a7bfdf22
31 changed files with 707 additions and 366 deletions

View File

@@ -114,6 +114,12 @@ static NSInteger toSlowCount = 4;
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
[self.bgView addSubview:self.bgImageView];
//
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc]
initWithTarget:self
action:@selector(handlePanGesture:)];
[self.bgView addGestureRecognizer:panGesture];
self.poolBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, ScaleWidth(48), ScaleWidth(48), ScaleWidth(24))];
[self.poolBtn setBackgroundImage:[UIImage imageNamed:@"time_right_bg"] forState:(UIControlStateNormal)];
[self.poolBtn setTitle:@"奖池" forState:(UIControlStateNormal)];
@@ -299,7 +305,43 @@ static NSInteger toSlowCount = 4;
[self.bgView addSubview:self.centerView];
}
- (void)handlePanGesture:(UIPanGestureRecognizer *)gesture {
static CGPoint originalCenter;
if (gesture.state == UIGestureRecognizerStateBegan) {
//
originalCenter = gesture.view.center;
}else if (gesture.state == UIGestureRecognizerStateChanged) {
//
CGPoint translation = [gesture translationInView:self];
//
if (translation.y > 0) {
gesture.view.center = CGPointMake(originalCenter.x, originalCenter.y + translation.y);
// //
// CGFloat progress = translation.y / (self.view.bounds.size.height / 2);
// gesture.view.alpha = 1.0 - MIN(progress, 0.8);
}
}
else if (gesture.state == UIGestureRecognizerStateEnded ||
gesture.state == UIGestureRecognizerStateCancelled) {
CGPoint translation = [gesture translationInView:self];
CGPoint velocity = [gesture velocityInView:self];
//
BOOL shouldDismiss = translation.y > self.bgView.height/2.0 || velocity.y > 1000;
if (shouldDismiss) {
[self hide];
} else {
//
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(663);
}];
}
}
}
-(void)getMyWallet{
MJWeakSelf
[[QXRequset shareInstance] getWithUrl:QXWallet parameters:@{@"token":[QXGlobal shareGlobal].loginModel.token?[QXGlobal shareGlobal].loginModel.token:@""} needCache:NO success:^(id responseObject) {