24 lines
484 B
Mathematica
24 lines
484 B
Mathematica
|
|
//
|
||
|
|
// QXRedPacketModel.m
|
||
|
|
// QXLive
|
||
|
|
//
|
||
|
|
// Created by 启星 on 2025/10/11.
|
||
|
|
//
|
||
|
|
|
||
|
|
#import "QXRedPacketModel.h"
|
||
|
|
|
||
|
|
@implementation QXRedPacketModel
|
||
|
|
- (long)remainingTime {
|
||
|
|
long needTime = 0;
|
||
|
|
NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
|
||
|
|
// 将秒转换为毫秒
|
||
|
|
long long milliseconds = (long long)(timeInterval);
|
||
|
|
needTime = self.end_time - milliseconds;
|
||
|
|
return needTime;
|
||
|
|
}
|
||
|
|
|
||
|
|
- (BOOL)canOpenNow {
|
||
|
|
return [self remainingTime] <= 0;
|
||
|
|
}
|
||
|
|
@end
|