最后调整

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

@@ -108,6 +108,11 @@ static NSInteger toSlowCount = 4;
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(663))];
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
//
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc]
initWithTarget:self
action:@selector(handlePanGesture:)];
[self.bgView addGestureRecognizer:panGesture];
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"active_age_castle_bg"]];
self.bgImageView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(663));
@@ -299,7 +304,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) {