// // ComDealVC.m // LNManager // // Created by EchoShacolee on 2017/6/6. // Copyright © 2017年 lee. All rights reserved. // #import "ComDealVC.h" @interface ComDealVC () { UITextView * _tx; } @end @implementation ComDealVC - (void)viewDidLoad { [super viewDidLoad]; // // UIButton * btn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 60, 25)]; // btn.backgroundColor = COLOR_THEME; // [btn setTitle:@"发送" textColor:[UIColor whiteColor] font:15 fotState:0]; // [btn addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside]; // // self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:btn]; // UIScrollView * scrV = [[UIScrollView alloc]initWithFrame:kFrame]; scrV.contentSize = CGSizeMake(0, kSize.height); scrV.showsVerticalScrollIndicator = NO; scrV.delegate = self; [self.view addSubview:scrV]; UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapHandle)]; [scrV addGestureRecognizer:tap]; UILabel *lab = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, kSize.width, 30)]; lab.text = @"请输入处理意见:"; lab.font = [UIFont systemFontOfSize:17]; [scrV addSubview:lab]; _tx = [[UITextView alloc]initWithFrame:CGRectMake(20, 60, kSize.width-40, 180)]; _tx.delegate = self; _tx.font = [UIFont systemFontOfSize:15]; [scrV addSubview:_tx]; UIButton * btn = [[UIButton alloc]initWithFrame:CGRectMake(10, 320, kSize.width-20, 50)]; btn.backgroundColor = COLOR_THEME; btn.clipsToBounds = YES; btn.layer.cornerRadius = 5; [btn setTitle:@"确定处理" textColor:[UIColor whiteColor] font:15 fotState:0]; [btn addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside]; [scrV addSubview:btn]; } -(void)rightBtnClick{ [self.view endEditing:YES]; if (_tx.text.length == 0) { [self showMsgByAlertVCWithString:@"请输入处理意见"]; return; } NSMutableDictionary * mdic = [NSMutableDictionary new]; [mdic setValue:_theId forKey:@"id"]; [mdic setValue:_tx.text forKey:@"content"]; [mdic setValue:MYAPPDELEGATE.userDic[@"id"] forKey:@"userId"]; [self getDataWithDic:mdic method:@"dealCompOpinion" block:^(NSDictionary *successdic) { [self showMsgByMBWithString:@"发送成功"]; [self.navigationController popViewControllerAnimated:YES]; if (self.block) { self.block(); } }]; } -(void)tapHandle{ [self.view endEditing:YES]; } -(void)scrollViewDidScroll:(UIScrollView *)scrollView{ [self.view endEditing:YES]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end