// // YYXQPickTimeAlert.m // YaYin // // Created by bj_szd on 2023/7/12. // Copyright © 2023 YaYin. All rights reserved. // #import "YYXQPickTimeAlert.h" @interface YYXQPickTimeAlert () @property (nonatomic, copy) NSString *timeStr; @property (weak, nonatomic) IBOutlet UIView *containerView; @end @implementation YYXQPickTimeAlert - (void)awakeFromNib { [super awakeFromNib]; [self createUI]; } - (void)createUI { self.containerView.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(APPW-30, 200) direction:FXGradientChangeDirectionVertical startColor:HEXCOLOR(0xDFFFF6) endColor:HEXCOLOR(0xFFFFFF)]; [self.agreeBtn setJianBianWithCGSize:CGSizeMake(ScreenWidth-35*2, 44)]; WEAK_SELF [self.touchImgV dg_Tapped:^{ [weakSelf removeFromSuperview]; }]; } - (IBAction)onTimeBtn_1:(id)sender { self.timeStr = @"5"; self.timeBtn_1.selected = YES; self.timeBtn_2.selected = NO; self.timeBtn_3.selected = NO; [self.timeBtn_1 styleGradiBlueColor]; self.timeBtn_2.backgroundColor = HEXCOLORA(0x000000, 0.2); self.timeBtn_3.backgroundColor = HEXCOLORA(0x000000, 0.2); } - (IBAction)onTimeBtn_2:(id)sender { self.timeStr = @"30"; self.timeBtn_1.selected = NO; self.timeBtn_2.selected = YES; self.timeBtn_3.selected = NO; self.timeBtn_1.backgroundColor = HEXCOLORA(0x000000, 0.2); self.timeBtn_3.backgroundColor = HEXCOLORA(0x000000, 0.2); [self.timeBtn_2 styleGradiBlueColor]; } - (IBAction)onTimeBtn_3:(UIButton *)sender { self.timeStr = @"15"; self.timeBtn_1.selected = NO; self.timeBtn_2.selected = NO; self.timeBtn_3.selected = YES; self.timeBtn_1.backgroundColor = HEXCOLORA(0x000000, 0.2); self.timeBtn_2.backgroundColor = HEXCOLORA(0x000000, 0.2); [self.timeBtn_3 styleGradiBlueColor]; } - (IBAction)onAgree:(id)sender { if (self.timeStr.length <= 0) { [HelpPageDefine showMessage:@"请选择时间"]; return; } if (self.onConfirmBlock) { self.onConfirmBlock(self.timeStr); } [self removeFromSuperview]; } @end