Files
keyboard/CustomKeyboard/Model/KBKeyboardSubscriptionProduct.h

44 lines
1.3 KiB
C
Raw Normal View History

2025-12-17 16:22:41 +08:00
//
// KBKeyboardSubscriptionProduct.h
// CustomKeyboard
//
// 订阅商品模型(键盘扩展专用),用于展示与主 App 相同的订阅列表。
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface KBKeyboardSubscriptionProduct : NSObject
/// 主键 id
@property (nonatomic, assign) NSInteger identifier;
/// Apple 商品编号
@property (nonatomic, copy, nullable) NSString *productId;
/// 商品名称,如 Monthly
@property (nonatomic, copy, nullable) NSString *name;
/// 单位,如 Subscription
@property (nonatomic, copy, nullable) NSString *unit;
/// 商品描述
@property (nonatomic, copy, nullable) NSString *productDescription;
/// 货币符号
@property (nonatomic, copy, nullable) NSString *currency;
/// 现价
@property (nonatomic, assign) double price;
/// 原价(如接口未返回,则回退为 price 的 1.25 倍)
@property (nonatomic, assign) double originPrice;
/// 有效期数值
@property (nonatomic, assign) NSInteger durationValue;
/// 有效期单位
@property (nonatomic, copy, nullable) NSString *durationUnit;
/// 标题(描述 > name+unit > name > unit
- (NSString *)displayTitle;
/// 当前价格文本
- (NSString *)priceDisplayText;
/// 划线价文本
- (nullable NSString *)strikePriceDisplayText;
@end
NS_ASSUME_NONNULL_END