// // RQVipCenterCell.m // jiaPei // // Created by 张嵘 on 2022/8/11. // Copyright © 2022 JCZ. All rights reserved. // #import "RQVipCenterCell.h" @interface RQVipCenterCell () @property (nonatomic, readwrite, strong) RQVipCenterItemViewModel *viewModel; @end @implementation RQVipCenterCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"RQVipCenterCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; RQVipCenterCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; return cell; } - (void)bindViewModel:(RQVipCenterItemViewModel *)viewModel { _viewModel = viewModel; } - (void)awakeFromNib { [super awakeFromNib]; [self.leftVipBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) { graColor.fromColor = [UIColor qmui_colorWithHexString:@"#ABAEB1"]; graColor.toColor = [UIColor qmui_colorWithHexString:@"#F5F5F6"]; graColor.type = QQGradualChangeTypeLeftToRight; } size:CGSizeMake(RQ_FIT_HORIZONTAL(52.f), RQ_FIT_HORIZONTAL(20.f)) cornerRadius:QQRadiusMake(0, RQ_FIT_HORIZONTAL(20.f) / 2.f, 0, RQ_FIT_HORIZONTAL(20.f) / 2.f)] forState:UIControlStateNormal]; [self.leftVipBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) { graColor.fromColor = [UIColor qmui_colorWithHexString:@"#FFA316"]; graColor.toColor = [UIColor qmui_colorWithHexString:@"#FFC610"]; graColor.type = QQGradualChangeTypeLeftToRight; } size:CGSizeMake(RQ_FIT_HORIZONTAL(52.f), RQ_FIT_HORIZONTAL(20.f)) cornerRadius:QQRadiusMake(0, RQ_FIT_HORIZONTAL(20.f) / 2.f, 0, RQ_FIT_HORIZONTAL(20.f) / 2.f)] forState:UIControlStateSelected]; [self.rightVipBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) { graColor.fromColor = [UIColor qmui_colorWithHexString:@"#ABAEB1"]; graColor.toColor = [UIColor qmui_colorWithHexString:@"#F5F5F6"]; graColor.type = QQGradualChangeTypeLeftToRight; } size:CGSizeMake(RQ_FIT_HORIZONTAL(53.f), RQ_FIT_HORIZONTAL(18.f)) cornerRadius:QQRadiusMake(0, 10.f, 5.f, 0.f)] forState:UIControlStateNormal]; [self.rightVipBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) { graColor.fromColor = [UIColor qmui_colorWithHexString:@"#DBA05C"]; graColor.toColor = [UIColor qmui_colorWithHexString:@"#F3C085"]; graColor.type = QQGradualChangeTypeLeftToRight; } size:CGSizeMake(RQ_FIT_HORIZONTAL(53.f), RQ_FIT_HORIZONTAL(18.f)) cornerRadius:QQRadiusMake(0, 10.f, 5.f, 0.f)] forState:UIControlStateSelected]; [self.openVipBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) { graColor.fromColor = [UIColor qmui_colorWithHexString:@"#EBF1F9"]; graColor.toColor = [UIColor qmui_colorWithHexString:@"#9AC2FF"]; graColor.type = QQGradualChangeTypeLeftToRight; } size:CGSizeMake(RQ_FIT_HORIZONTAL(137.f), RQ_FIT_HORIZONTAL(25.f)) cornerRadius:QQRadiusMakeSame(RQ_FIT_HORIZONTAL(25.f) / 2.f)] forState:UIControlStateNormal]; [self.dateVipBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) { graColor.fromColor = [UIColor qmui_colorWithHexString:@"#DBA05C"]; graColor.toColor = [UIColor qmui_colorWithHexString:@"#F3C085"]; graColor.type = QQGradualChangeTypeLeftToRight; } size:CGSizeMake(RQ_FIT_HORIZONTAL(112.f), RQ_FIT_HORIZONTAL(20.f)) cornerRadius:QQRadiusMake(RQ_FIT_HORIZONTAL(20.f) / 2.f, 0.f, RQ_FIT_HORIZONTAL(20.f) / 2.f, 0.f)] forState:UIControlStateNormal]; } @end