// // RQErrorAndCollectHeaderView.m // jiaPei // // Created by 张嵘 on 2022/8/3. // Copyright © 2022 JCZ. All rights reserved. // #import "RQErrorAndCollectHeaderView.h" @interface RQErrorAndCollectHeaderView () @property (weak, nonatomic) IBOutlet UISwitch *isAntoRemoveError; @end @implementation RQErrorAndCollectHeaderView + (instancetype)errorAndCollectHeaderView { return [super rq_viewFromXib]; } - (void)awakeFromNib { [super awakeFromNib]; _todayErrorBtn.layer.borderColor = RQ_MAIN_COLOR.CGColor; _todayErrorBtn.layer.cornerRadius = RQ_FIT_HORIZONTAL(40.f) / 2.f; _allErrorBtn.layer.borderColor = RQ_MAIN_COLOR.CGColor; _allErrorBtn.layer.cornerRadius = RQ_FIT_HORIZONTAL(40.f) / 2.f; [_toLookBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) { graColor.fromColor = RQColorFromHexString(@"#FF4C52"); graColor.toColor = RQColorFromHexString(@"#FC8269"); graColor.type = QQGradualChangeTypeLeftToRight; } size:CGSizeMake(RQ_FIT_HORIZONTAL(76.f), RQ_FIT_HORIZONTAL(30.f)) cornerRadius:QQRadiusMakeSame(RQ_FIT_HORIZONTAL(30.f) / 2.f)] forState:UIControlStateNormal]; _isAntoRemoveError.on = RQ_Exercise_Module.isRightAutoRemoveError; } - (IBAction)toLookBtnAction:(id)sender { [RQ_VIP_Module isVipWithSubject:0 complete:^(BOOL isVip) { if (RQ_VIP_Module.isVip) { [RQ_VIP_Module gotoVipCenter]; } else { [RQ_VIP_Module gotoBuyVipWithVipPageType:RQVIPPageType_Full]; } }]; } - (IBAction)clearAllErrorAction:(id)sender { [MBProgressHUD rq_showProgressHUD:@"删除中..."]; [[RQ_HTTP_Service deleteQuestionFavAllWithType:RQSaveFavQuestionType_Wrong] subscribeNext:^(id _Nullable x) { [MBProgressHUD rq_hideHUD]; [MBProgressHUD rq_showTips:@"删除成功!"]; [RQ_YDT_USER_Question_Module deleteWrongRecordithCarType:RQ_YDTQuestion_Module.carType subject:RQ_YDTQuestion_Module.subject]; [RQNotificationCenter postNotificationName:RQCancelWrongNotification object:nil]; } error:^(NSError * _Nullable error) { [MBProgressHUD rq_hideHUD]; [MBProgressHUD rq_showErrorTips:error]; }]; } - (IBAction)isAutoRemoveErrorAction:(id)sender { RQ_Exercise_Module.isRightAutoRemoveError = _isAntoRemoveError.isOn; } @end