新增活动详情页相关功能,包括事件模型、API接口、UI组件及相关资源文件。更新版本号至20.20.60。
This commit is contained in:
@@ -332,8 +332,13 @@
|
||||
// 创建 GCD 定时器
|
||||
self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
|
||||
|
||||
// 设置定时器时间间隔:每 0.3 秒执行一次
|
||||
//#if DEBUG
|
||||
// dispatch_source_set_timer(self.timer, DISPATCH_TIME_NOW, 0.01 * NSEC_PER_SEC, 0.01 * NSEC_PER_SEC);
|
||||
//#else
|
||||
// 设置定时器时间间隔:每 0.25 秒执行一次
|
||||
dispatch_source_set_timer(self.timer, DISPATCH_TIME_NOW, 0.25 * NSEC_PER_SEC, 0.01 * NSEC_PER_SEC);
|
||||
//#endif
|
||||
|
||||
|
||||
// 定时器触发的事件处理
|
||||
dispatch_source_set_event_handler(self.timer, ^{
|
||||
@@ -502,15 +507,20 @@
|
||||
@"Price": @(receive.gift.goldPrice * receive.giftNum * array.count),
|
||||
@"isFromWinning":@(NO)}];
|
||||
} else {
|
||||
if (code > 500) {
|
||||
self.errorMessage = @"Over Heat!";
|
||||
if (code >= 500 && code < 600) {
|
||||
NSLog(@" ----------------------------------------------------------- error here");
|
||||
#if DEBUG
|
||||
self.errorMessage = [NSString stringWithFormat:@"Over Heat! - %@ ", msg];
|
||||
#else
|
||||
self.errorMessage = @"Over Heat & try later";
|
||||
#endif
|
||||
} else {
|
||||
self.errorMessage = msg;
|
||||
[self forceRemove];
|
||||
}
|
||||
if (self.actionCallback) {
|
||||
self.actionCallback(ComboAction_Error);
|
||||
}
|
||||
// [self forceRemove];
|
||||
}
|
||||
}
|
||||
targetUids:allUIDs
|
||||
|
@@ -28,6 +28,8 @@
|
||||
|
||||
@property(nonatomic, strong) UIImpactFeedbackGenerator *feedbackGenerator;
|
||||
|
||||
@property (nonatomic, strong) NSTimer *longPressTimer;
|
||||
|
||||
//@property (nonatomic, strong) dispatch_queue_t animationQueue; // 串行队列,确保线程安全
|
||||
|
||||
|
||||
@@ -44,6 +46,8 @@
|
||||
[self.playImageView clear];
|
||||
self.playImageView.delegate = nil;
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[self.longPressTimer invalidate];
|
||||
self.longPressTimer = nil;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
@@ -214,7 +218,9 @@
|
||||
// NSLog(@"点击间隔过短,忽略此次点击");
|
||||
return;
|
||||
}
|
||||
#if RELEASE
|
||||
isHandlingTap = YES;
|
||||
#endif
|
||||
[self.feedbackGenerator impactOccurred];
|
||||
|
||||
[[GiftComboManager sharedManager] sendGift];
|
||||
@@ -432,8 +438,8 @@
|
||||
duration:5];
|
||||
_countdownRingView.userInteractionEnabled = YES;
|
||||
//#if DEBUG
|
||||
// UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap)];
|
||||
// longPress.minimumPressDuration = 0.2;
|
||||
// UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
// longPress.minimumPressDuration = 0.1;
|
||||
// [_countdownRingView addGestureRecognizer:longPress];
|
||||
//#else
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap)];
|
||||
@@ -443,4 +449,23 @@
|
||||
return _countdownRingView;
|
||||
}
|
||||
|
||||
- (void)handleLongPress:(UILongPressGestureRecognizer *)gesture {
|
||||
if (gesture.state == UIGestureRecognizerStateBegan) {
|
||||
// 开始长按时创建定时器
|
||||
[self.longPressTimer invalidate];
|
||||
self.longPressTimer = [NSTimer scheduledTimerWithTimeInterval:0.1
|
||||
target:self
|
||||
selector:@selector(handleTap)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
[self handleTap];
|
||||
} else if (gesture.state == UIGestureRecognizerStateEnded ||
|
||||
gesture.state == UIGestureRecognizerStateCancelled ||
|
||||
gesture.state == UIGestureRecognizerStateFailed) {
|
||||
// 长按结束时销毁定时器
|
||||
[self.longPressTimer invalidate];
|
||||
self.longPressTimer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -206,7 +206,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
if (![NSString isEmpty:message]) {
|
||||
[self showErrorToast:message];
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case ComboAction_Update_After_Send_Success: {
|
||||
|
Reference in New Issue
Block a user