// // NYTimeRuleCell.m // jiaPei // // Created by Ning.ge on 2023/6/8. // Copyright © 2023 JCZ. All rights reserved. // #import "NYTimeRuleCell.h" @interface NYTimeRuleCell () @property (nonatomic, readwrite, strong) NYTimeRuleItemViewModel *viewModel; @end @implementation NYTimeRuleCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"NYTimeRuleCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; NYTimeRuleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; return cell; } - (void)bindViewModel:(NYTimeRuleItemViewModel *)viewModel { self.viewModel = viewModel; [self setIsCykh:viewModel.isCykh]; } - (void)setIsCykh:(BOOL)isCykh { if(isCykh){ self.backgroundColor = UIColor.clearColor; self.contentView.backgroundColor = UIColor.clearColor; self.bgBootomImg.hidden = YES; } else { self.contentView.backgroundColor = UIColorHex(0x498EF5); self.bgBootomImg.hidden = YES; } } #pragma mark - SystemMethods - (void)awakeFromNib { [super awakeFromNib]; self.ruleOne.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor; self.ruleOne.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor; self.ruleTwo.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor; self.ruleTwo.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor; self.ruleThree.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor; self.ruleThree.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor; self.ruleFour.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor; self.ruleFour.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor; self.ruleMsg.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor; self.ruleMsg.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor; NSString *citystr = @"yntms,hztms"; if([RQ_USER_MANAGER.currentUser.city containsString:@"350"]|| [RQ_USER_MANAGER.currentUser.city containsString:@"351"]|| [RQ_USER_MANAGER.currentUser.city containsString:@"210"]|| [citystr rangeOfString:RQ_USER_MANAGER.currentUser.city].location != NSNotFound)//增加辽宁 2025.03.31 { self.ruleTwo_label.text = [self.ruleTwo_label.text stringByReplacingOccurrencesOfString:@"4学时" withString:@"6学时"]; } } @end