2025-10-12 15:48:35 +08:00
|
|
|
//
|
|
|
|
|
// 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);
|
2025-10-15 17:21:09 +08:00
|
|
|
needTime = self.start_time - milliseconds;
|
2025-10-12 15:48:35 +08:00
|
|
|
return needTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL)canOpenNow {
|
|
|
|
|
return [self remainingTime] <= 0;
|
|
|
|
|
}
|
|
|
|
|
@end
|
2025-10-15 17:21:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation QXDrawRedPacketModel
|
|
|
|
|
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
|
|
|
|
|
return @{
|
|
|
|
|
@"redpacket_info": @"QXRedPacketModel",
|
|
|
|
|
@"my_record": @"QXDrawRedpacketRecordModel",
|
|
|
|
|
@"records": @"QXDrawRedpacketRecordModel",
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation QXDrawRedpacketRecordModel
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|