|
@@ -0,0 +1,121 @@
|
|
|
+//
|
|
|
+// NYChooseTypeAlertViewController.m
|
|
|
+// jiaPei
|
|
|
+//
|
|
|
+// Created by Ning.ge on 2023/7/6.
|
|
|
+// Copyright © 2023 JCZ. All rights reserved.
|
|
|
+//
|
|
|
+
|
|
|
+#import "NYChooseTypeAlertViewController.h"
|
|
|
+
|
|
|
+@interface NYChooseTypeAlertViewController ()
|
|
|
+
|
|
|
+@property (nonatomic,weak) QMUIButton *cancel_button;
|
|
|
+
|
|
|
+@property (nonatomic,weak) QMUIButton *finish_button;
|
|
|
+
|
|
|
+@end
|
|
|
+
|
|
|
+@implementation NYChooseTypeAlertViewController
|
|
|
+
|
|
|
+- (void)dealloc{
|
|
|
+ NSLog(@"NYChooseTypeAlertViewController");
|
|
|
+}
|
|
|
+
|
|
|
+- (void)viewDidLoad {
|
|
|
+ [super viewDidLoad];
|
|
|
+ [self loadBasicUI];
|
|
|
+}
|
|
|
+#pragma mark - UI
|
|
|
+-(void)loadBasicUI{
|
|
|
+ self.view.backgroundColor = UIColorWhite;
|
|
|
+ self.view.layer.cornerRadius = 12.f;
|
|
|
+ self.view.layer.masksToBounds = YES;
|
|
|
+
|
|
|
+ UILabel *title_label = [[UILabel alloc] init];
|
|
|
+ title_label.textColor = UIColorMakeWithHex(@"#0A1A33");
|
|
|
+ title_label.text = @"提示";
|
|
|
+ title_label.textAlignment = NSTextAlignmentCenter;
|
|
|
+ title_label.font = [UIFont boldSystemFontOfSize:21.f];
|
|
|
+ [self.view addSubview:title_label];
|
|
|
+ self.title_label = title_label;
|
|
|
+ [title_label mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(self.view).offset(25.f);
|
|
|
+ make.left.right.equalTo(self.view);
|
|
|
+ make.height.mas_equalTo(29.f);
|
|
|
+ }];
|
|
|
+
|
|
|
+ UIImageView *icon_imageview = [[UIImageView alloc] init];
|
|
|
+ icon_imageview.image = [UIImage imageNamed:@"铃铛"];
|
|
|
+ icon_imageview.contentMode = UIViewContentModeScaleToFill;
|
|
|
+ [self.view addSubview:icon_imageview];
|
|
|
+ self.icon_imageview = icon_imageview;
|
|
|
+ [icon_imageview mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(title_label.mas_bottom).offset(22.f);
|
|
|
+ make.size.mas_equalTo(CGSizeMake(62, 70));
|
|
|
+ make.centerX.mas_equalTo(self.view);
|
|
|
+ }];
|
|
|
+
|
|
|
+ UILabel *content_label = [[UILabel alloc] init];
|
|
|
+ content_label.textColor = UIColorMakeWithHex(@"#0A1A33");
|
|
|
+ content_label.text = @"确定选择该科目吗?";
|
|
|
+ content_label.textAlignment = NSTextAlignmentCenter;
|
|
|
+ content_label.font = [UIFont systemFontOfSize:14.f];
|
|
|
+ [self.view addSubview:content_label];
|
|
|
+ self.content_label = content_label;
|
|
|
+ [content_label mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(icon_imageview.mas_bottom).offset(22.f);
|
|
|
+ make.left.right.equalTo(self.view);
|
|
|
+ make.height.mas_equalTo(20.f);
|
|
|
+ }];
|
|
|
+
|
|
|
+ QMUIButton *cancel_button = [QMUIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ cancel_button.cornerRadius = 20.f;
|
|
|
+ cancel_button.layer.borderWidth = 1.f;
|
|
|
+ cancel_button.layer.borderColor = [UIColorMakeWithHex(@"#707070") CGColor];
|
|
|
+ cancel_button.backgroundColor = UIColor.whiteColor;
|
|
|
+ [cancel_button setTitleColor:UIColorMakeWithHex(@"#707070") forState:UIControlStateNormal];
|
|
|
+ [cancel_button setTitleNormal:@"关闭"];
|
|
|
+ [cancel_button addTarget:self action:@selector(buttonActionClosedo:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [self.view addSubview:cancel_button];
|
|
|
+ self.cancel_button = cancel_button;
|
|
|
+ [cancel_button mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(content_label.mas_bottom).offset(35.f);
|
|
|
+ make.left.equalTo(self.view).offset(15);
|
|
|
+ make.size.mas_equalTo(CGSizeMake(125, 40));
|
|
|
+ }];
|
|
|
+
|
|
|
+ QMUIButton *finish_button = [QMUIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ finish_button.cornerRadius = 20.f;
|
|
|
+ finish_button.backgroundColor = UIColorMakeWithHex(@"#498EF5");
|
|
|
+ [finish_button setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
|
|
+ [finish_button setTitleNormal:@"确认"];
|
|
|
+ [finish_button addTarget:self action:@selector(buttonActionFinishdo:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [self.view addSubview:finish_button];
|
|
|
+ self.finish_button = finish_button;
|
|
|
+ [finish_button mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(content_label.mas_bottom).offset(35.f);
|
|
|
+ make.right.equalTo(self.view).offset(-15);
|
|
|
+ make.size.mas_equalTo(CGSizeMake(125, 40));
|
|
|
+ }];
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//关闭
|
|
|
+- (void)buttonActionClosedo:(UIButton *)btn
|
|
|
+{
|
|
|
+ if(self.chooseCancelBlock){
|
|
|
+ self.chooseCancelBlock();
|
|
|
+ }
|
|
|
+}
|
|
|
+//确认
|
|
|
+- (void)buttonActionFinishdo:(UIButton *)btn
|
|
|
+{
|
|
|
+ if(self.chooseFinishBlock){
|
|
|
+ self.chooseFinishBlock(self.type);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+@end
|