51 lines
1.1 KiB
Objective-C
51 lines
1.1 KiB
Objective-C
//
|
|
// CustomRoomBGItemModel.m
|
|
// YuMi
|
|
//
|
|
// Created by P on 2024/10/30.
|
|
//
|
|
|
|
#import "CustomRoomBGItemModel.h"
|
|
|
|
@implementation CustomRoomBGItemModel
|
|
|
|
- (NSString *)remainDays {
|
|
if ([NSString isEmpty:self.remainHour]) {
|
|
return @"";
|
|
} else {
|
|
NSInteger hour = self.remainHour.integerValue;
|
|
if (hour<24) {
|
|
return [NSString stringWithFormat:@"<1%@", YMLocalizedString(@"1.0.18_8")];
|
|
} else {
|
|
return [NSString stringWithFormat:@"%@%@", @(hour/24), YMLocalizedString(@"1.0.18_8")];
|
|
}
|
|
}
|
|
}
|
|
|
|
- (NSString *)pricePerDays {
|
|
NSString *content =[NSString stringWithFormat:@"%@/%@",
|
|
@(self.goldPrice),
|
|
@(self.buyHour/24)];
|
|
return [NSString stringWithFormat:YMLocalizedString(@"1.0.18_8"), content];
|
|
}
|
|
|
|
- (BOOL)isAlreadyPay {
|
|
if (self.status == RoomBGStatus_Pass) {
|
|
return ![NSString isEmpty:self.remainHour];
|
|
}
|
|
return NO;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation CustomRoomBGModel
|
|
|
|
+ (NSDictionary *)objectClassInArray {
|
|
return @{
|
|
@"itemList": CustomRoomBGItemModel.class
|
|
};
|
|
}
|
|
|
|
|
|
@end
|