优化提交

This commit is contained in:
启星
2025-09-19 11:38:43 +08:00
parent a3a7bfdf22
commit 231d3d8625
153 changed files with 20460 additions and 11929 deletions

View File

@@ -7,6 +7,7 @@
#import "QXHeadlineView.h"
#import "QXUserHomePageViewController.h"
#import "QXTimer.h"
@interface QXHeadlineView()
@@ -23,6 +24,9 @@
@property (nonatomic,strong)UIButton *trampleBtn;
@property (nonatomic,strong)UIButton *closeBtn;
@property (nonatomic,assign)BOOL isSmall;
@property (nonatomic,assign)long startTime;
@property (nonatomic,strong)QXTimer *timer;
@end
@implementation QXHeadlineView
@@ -166,6 +170,7 @@
self.nameLabel.text = model.nickname;
[self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
self.contentLabel.text = model.content;
[self startTimer];
if (self.isSmall) {
[UIView animateWithDuration:0.15 animations:^{
// self.headLineBgView.width = self.width-self.iconImageView.right-6;
@@ -178,8 +183,34 @@
}];
}
}
-(void)startTimer{
MJWeakSelf
NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
//
long long milliseconds = (long long)(timeInterval);
self.startTime = self.model.end_time.longLongValue - milliseconds;
if (self.startTime <= 0) {
//
[self removeFromSuperview];
return;
}
[self stopTimer];
_timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{
dispatch_async(dispatch_get_main_queue(), ^{
weakSelf.startTime--;
if (weakSelf.startTime<=0) {
[weakSelf stopTimer];
[weakSelf removeFromSuperview];
}
});
}];
}
-(void)stopTimer{
if (_timer) {
[self->_timer invalidate];
self->_timer= nil;
}
}
-(void)handlePan:(UIPanGestureRecognizer*)recognizer{
if (recognizer.state == UIGestureRecognizerStateEnded) {
NSLog(@"拖动结束");