1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- //
- // RQVipAuthorityNewItemViewModel.m
- // jiaPei
- //
- // Created by 张嵘 on 2022/11/14.
- // Copyright © 2022 JCZ. All rights reserved.
- //
- #import "RQVipAuthorityNewItemViewModel.h"
- @interface RQVipAuthorityNewItemViewModel ()
- @property (nonatomic, readwrite, strong) RQTypeModel *chooseTypeModel;
- @property (nonatomic, readwrite, strong) NSString *bgImageName;
- @property (nonatomic, readwrite, strong) NSString *authorityTitle;
- @end
- @implementation RQVipAuthorityNewItemViewModel
- - (instancetype)initWithChooseTypeModel:(RQTypeModel *)chooseTypeModel {
- if (self = [super init]) {
- self.chooseTypeModel = chooseTypeModel;
- CGFloat RQVipAuthorityCellWidth = RQ_SCREEN_WIDTH;
- CGFloat RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (145.f / 375.f) + 10;
- if ([chooseTypeModel.dictLabel containsString:@"科一专项VIP"]) {
- self.bgImageName = @"权益背景左";
- self.authorityTitle = @"尊享科一专项权益";
- RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
- } else if ([chooseTypeModel.dictLabel containsString:@"科二专项VIP"]) {
- self.bgImageName = @"权益背景左";
- self.authorityTitle = @"尊享科二专项权益";
- RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
- } else if ([chooseTypeModel.dictLabel containsString:@"科三专项VIP"]) {
- self.bgImageName = @"权益背景左大";
- self.authorityTitle = @"尊享科三专项权益";
- RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
- } else if ([chooseTypeModel.dictLabel containsString:@"科四专项VIP"]) {
- self.bgImageName = @"权益背景中";
- self.authorityTitle = @"尊享科四专项权益";
- RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
- } else if ([chooseTypeModel.dictLabel containsString:@"科一+科四VIP"]) {
- self.bgImageName = @"权益背景中";
- self.authorityTitle = @"尊享科一科四专项权益";
- RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
- } else if ([chooseTypeModel.dictLabel containsString:@"科二+科三VIP"]) {
- self.bgImageName = @"权益背景中";
- self.authorityTitle = @"尊享科二科三专项权益";
- RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
- } else if ([chooseTypeModel.dictLabel containsString:@"科三+科四VIP"]) {
- self.bgImageName = @"权益背景右大";
- self.authorityTitle = @"尊享科三科四专项权益";
- RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (340.f / 363.f) + 10;
- } else if ([chooseTypeModel.dictLabel containsString:@"科二+科三+科四"]) {
- self.bgImageName = @"权益背景右宽";
- self.authorityTitle = @"尊享科二科三科四专项权益";
- RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (340.f / 363.f) + 10;
- } else {
- self.bgImageName = @"权益背景右";
- self.authorityTitle = @"尊享科目一二三四专项权益";
- RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (149.f / 363.f) + 10;
- }
- self.itemSize = CGSizeMake(RQVipAuthorityCellWidth, RQVipAuthorityCellHeight);
- }
- return self;
- }
- - (NSString *)itemClassName {
- return @"RQVipAuthorityNewCell";
- }
- @end
|