修改vip
This commit is contained in:
22
keyBoard/Assets.xcassets/My/my_svip_icon.imageset/Contents.json
vendored
Normal file
22
keyBoard/Assets.xcassets/My/my_svip_icon.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_svip_icon.imageset/my_svip_icon@2x.png
vendored
Normal file
BIN
keyBoard/Assets.xcassets/My/my_svip_icon.imageset/my_svip_icon@2x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
BIN
keyBoard/Assets.xcassets/My/my_svip_icon.imageset/my_svip_icon@3x.png
vendored
Normal file
BIN
keyBoard/Assets.xcassets/My/my_svip_icon.imageset/my_svip_icon@3x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -28,6 +28,9 @@ typedef NS_ENUM(NSInteger, UserSex) {
|
||||
/// 是否是 VIP
|
||||
@property (nonatomic, assign) BOOL isVip;
|
||||
|
||||
/// 1: vip 2:svip
|
||||
@property (nonatomic, assign) NSInteger vipLevel;
|
||||
|
||||
// token
|
||||
@property (nonatomic, copy, nullable) NSString *token; // token/access_token/accessToken
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user