NYTimeRuleCell.m 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // NYTimeRuleCell.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2023/6/8.
  6. // Copyright © 2023 JCZ. All rights reserved.
  7. //
  8. #import "NYTimeRuleCell.h"
  9. @interface NYTimeRuleCell ()
  10. @property (nonatomic, readwrite, strong) NYTimeRuleItemViewModel *viewModel;
  11. @end
  12. @implementation NYTimeRuleCell
  13. #pragma mark - PublicMethods
  14. + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
  15. static NSString *ID = @"NYTimeRuleCell";
  16. [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
  17. NYTimeRuleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
  18. if (!cell) cell = [self rq_viewFromXib];
  19. return cell;
  20. }
  21. - (void)bindViewModel:(NYTimeRuleItemViewModel *)viewModel {
  22. self.viewModel = viewModel;
  23. [self setIsCykh:viewModel.isCykh];
  24. }
  25. - (void)setIsCykh:(BOOL)isCykh
  26. {
  27. if(isCykh){
  28. self.backgroundColor = UIColor.clearColor;
  29. self.contentView.backgroundColor = UIColor.clearColor;
  30. self.bgBootomImg.hidden = YES;
  31. }
  32. else
  33. {
  34. self.contentView.backgroundColor = UIColorHex(0x498EF5);
  35. self.bgBootomImg.hidden = YES;
  36. }
  37. }
  38. #pragma mark - SystemMethods
  39. - (void)awakeFromNib {
  40. [super awakeFromNib];
  41. self.ruleOne.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  42. self.ruleOne.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  43. self.ruleTwo.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  44. self.ruleTwo.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  45. self.ruleThree.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  46. self.ruleThree.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  47. self.ruleFour.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  48. self.ruleFour.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  49. self.ruleMsg.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  50. self.ruleMsg.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  51. NSString *citystr = @"yntms,hztms";
  52. if([RQ_USER_MANAGER.currentUser.city containsString:@"350"]||
  53. [RQ_USER_MANAGER.currentUser.city containsString:@"351"]||
  54. [RQ_USER_MANAGER.currentUser.city containsString:@"210"]||
  55. [citystr rangeOfString:RQ_USER_MANAGER.currentUser.city].location != NSNotFound)//增加辽宁 2025.03.31
  56. {
  57. self.ruleTwo_label.text = [self.ruleTwo_label.text stringByReplacingOccurrencesOfString:@"4学时" withString:@"6学时"];
  58. }
  59. }
  60. @end