修改vip

This commit is contained in:
2026-02-12 20:06:44 +08:00
parent cbe0a53cac
commit 635ad932c7
5 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "my_svip_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "my_svip_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -28,6 +28,9 @@ typedef NS_ENUM(NSInteger, UserSex) {
/// 是否是 VIP
@property (nonatomic, assign) BOOL isVip;
/// 1: vip 2svip
@property (nonatomic, assign) NSInteger vipLevel;
// token
@property (nonatomic, copy, nullable) NSString *token; // token/access_token/accessToken

View File

@@ -136,9 +136,17 @@
[self kb_applyVipLayout:isVip];
self.vipIconView.hidden = !isVip;
self.vipExpiryLabel.hidden = !isVip;
if (isVip) {
self.vipIconView.image = [UIImage imageNamed:[self kb_vipIconNameFromVipLevel:user.vipLevel]];
}
self.vipExpiryLabel.text = isVip ? [self vipExpiryDisplayTextFrom:user.vipExpiry] : nil;
}
- (NSString *)kb_vipIconNameFromVipLevel:(NSInteger)vipLevel {
if (vipLevel == 2) { return @"my_svip_icon"; }
return @"my_vip_icon";
}
- (void)kb_applyVipLayout:(BOOL)isVip {
NSInteger state = isVip ? 1 : 0;
if (self.kb_vipLayoutState == state) { return; }