// // NYGetjobStartRuleCell.m // jiaPei // // Created by Ning.ge on 2023/6/9. // Copyright © 2023 JCZ. All rights reserved. // #import "NYGetjobStartRuleCell.h" #import "NYChooseTypeAlertViewController.h" @interface NYGetjobStartRuleCell () @property (nonatomic, readwrite, strong) NYGetjobStartRuleViewModel *viewModel; @property (nonatomic, readwrite, strong) NSArray *btnList; @property (nonatomic, readwrite, strong) NSArray *layList; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *k1_layW; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *k2_layW; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *k3_layW; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *k4_layW; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *k1_layView_L; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *k4_layView_R; @end @implementation NYGetjobStartRuleCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"NYGetjobStartRuleCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; NYGetjobStartRuleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; cell.btnList = @[cell.k1_button,cell.k2_button,cell.k3_button,cell.k4_button]; cell.layList = @[cell.k1_layW,cell.k2_layW,cell.k3_layW,cell.k4_layW]; if(RQ_USER_MANAGER.cykhPxkmStr.length>0){ switch (RQ_USER_MANAGER.cykhPxkmStr.intValue) { case 5:{ cell.current_Button = cell.k1_button; cell.k1_button.selected = YES; }break; case 6:{ cell.current_Button = cell.k2_button; cell.k2_button.selected = YES; }break; case 7:{ cell.current_Button = cell.k3_button; cell.k3_button.selected = YES; }break; case 8:{ cell.current_Button = cell.k4_button; cell.k4_button.selected = YES; }break; default: cell.current_Button = cell.k1_button; cell.k1_button.selected = YES; break; } }else { cell.current_Button = cell.k1_button; cell.k1_button.selected = YES; RQ_USER_MANAGER.cykhPxkmStr = @"5"; } return cell; } - (void)bindViewModel:(NYGetjobStartRuleViewModel *)viewModel { self.viewModel = viewModel; } - (void)cellUpdateView:(NSArray *)subject_array { if(subject_array.count>0){ //判断 array self.k1_layView_L.constant = 90.f; self.k4_layView_R.constant = 90.f; self.k1_button.tag = 1; self.k3_button.tag = 4; RQ_USER_MANAGER.cykhPxkmStr = @"1"; for (int i=0; i