RQVipAuthorityNewItemViewModel.m 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // RQVipAuthorityNewItemViewModel.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/11/14.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQVipAuthorityNewItemViewModel.h"
  9. @interface RQVipAuthorityNewItemViewModel ()
  10. @property (nonatomic, readwrite, strong) RQTypeModel *chooseTypeModel;
  11. @property (nonatomic, readwrite, strong) NSString *bgImageName;
  12. @property (nonatomic, readwrite, strong) NSString *authorityTitle;
  13. @end
  14. @implementation RQVipAuthorityNewItemViewModel
  15. - (instancetype)initWithChooseTypeModel:(RQTypeModel *)chooseTypeModel {
  16. if (self = [super init]) {
  17. self.chooseTypeModel = chooseTypeModel;
  18. CGFloat RQVipAuthorityCellWidth = RQ_SCREEN_WIDTH;
  19. CGFloat RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (145.f / 375.f) + 10;
  20. if ([chooseTypeModel.dictLabel containsString:@"科一专项VIP"]) {
  21. self.bgImageName = @"权益背景左";
  22. self.authorityTitle = @"尊享科一专项权益";
  23. RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
  24. } else if ([chooseTypeModel.dictLabel containsString:@"科二专项VIP"]) {
  25. self.bgImageName = @"权益背景左";
  26. self.authorityTitle = @"尊享科二专项权益";
  27. RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
  28. } else if ([chooseTypeModel.dictLabel containsString:@"科三专项VIP"]) {
  29. self.bgImageName = @"权益背景左大";
  30. self.authorityTitle = @"尊享科三专项权益";
  31. RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
  32. } else if ([chooseTypeModel.dictLabel containsString:@"科四专项VIP"]) {
  33. self.bgImageName = @"权益背景中";
  34. self.authorityTitle = @"尊享科四专项权益";
  35. RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
  36. } else if ([chooseTypeModel.dictLabel containsString:@"科一+科四VIP"]) {
  37. self.bgImageName = @"权益背景中";
  38. self.authorityTitle = @"尊享科一科四专项权益";
  39. RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
  40. } else if ([chooseTypeModel.dictLabel containsString:@"科二+科三VIP"]) {
  41. self.bgImageName = @"权益背景中";
  42. self.authorityTitle = @"尊享科二科三专项权益";
  43. RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (163.f / 363.f) + 10;
  44. } else if ([chooseTypeModel.dictLabel containsString:@"科三+科四VIP"]) {
  45. self.bgImageName = @"权益背景右大";
  46. self.authorityTitle = @"尊享科三科四专项权益";
  47. RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (340.f / 363.f) + 10;
  48. } else if ([chooseTypeModel.dictLabel containsString:@"科二+科三+科四"]) {
  49. self.bgImageName = @"权益背景右宽";
  50. self.authorityTitle = @"尊享科二科三科四专项权益";
  51. RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (340.f / 363.f) + 10;
  52. } else {
  53. self.bgImageName = @"权益背景右";
  54. self.authorityTitle = @"尊享科目一二三四专项权益";
  55. RQVipAuthorityCellHeight = RQVipAuthorityCellWidth * (149.f / 363.f) + 10;
  56. }
  57. self.itemSize = CGSizeMake(RQVipAuthorityCellWidth, RQVipAuthorityCellHeight);
  58. }
  59. return self;
  60. }
  61. - (NSString *)itemClassName {
  62. return @"RQVipAuthorityNewCell";
  63. }
  64. @end