ComDealVC.m 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //
  2. // ComDealVC.m
  3. // LNManager
  4. //
  5. // Created by EchoShacolee on 2017/6/6.
  6. // Copyright © 2017年 lee. All rights reserved.
  7. //
  8. #import "ComDealVC.h"
  9. @interface ComDealVC ()<UITextViewDelegate,UIScrollViewDelegate>
  10. {
  11. UITextView * _tx;
  12. }
  13. @end
  14. @implementation ComDealVC
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. //
  18. // UIButton * btn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 60, 25)];
  19. // btn.backgroundColor = COLOR_THEME;
  20. // [btn setTitle:@"发送" textColor:[UIColor whiteColor] font:15 fotState:0];
  21. // [btn addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside];
  22. //
  23. // self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:btn];
  24. //
  25. UIScrollView * scrV = [[UIScrollView alloc]initWithFrame:kFrame];
  26. scrV.contentSize = CGSizeMake(0, kSize.height);
  27. scrV.showsVerticalScrollIndicator = NO;
  28. scrV.delegate = self;
  29. [self.view addSubview:scrV];
  30. UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapHandle)];
  31. [scrV addGestureRecognizer:tap];
  32. UILabel *lab = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, kSize.width, 30)];
  33. lab.text = @"请输入处理意见:";
  34. lab.font = [UIFont systemFontOfSize:17];
  35. [scrV addSubview:lab];
  36. _tx = [[UITextView alloc]initWithFrame:CGRectMake(20, 60, kSize.width-40, 180)];
  37. _tx.delegate = self;
  38. _tx.font = [UIFont systemFontOfSize:15];
  39. [scrV addSubview:_tx];
  40. UIButton * btn = [[UIButton alloc]initWithFrame:CGRectMake(10, 320, kSize.width-20, 50)];
  41. btn.backgroundColor = COLOR_THEME;
  42. btn.clipsToBounds = YES;
  43. btn.layer.cornerRadius = 5;
  44. [btn setTitle:@"确定处理" textColor:[UIColor whiteColor] font:15 fotState:0];
  45. [btn addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside];
  46. [scrV addSubview:btn];
  47. }
  48. -(void)rightBtnClick{
  49. [self.view endEditing:YES];
  50. if (_tx.text.length == 0) {
  51. [self showMsgByAlertVCWithString:@"请输入处理意见"];
  52. return;
  53. }
  54. NSMutableDictionary * mdic = [NSMutableDictionary new];
  55. [mdic setValue:_theId forKey:@"id"];
  56. [mdic setValue:_tx.text forKey:@"content"];
  57. [mdic setValue:MYAPPDELEGATE.userDic[@"id"] forKey:@"userId"];
  58. [self getDataWithDic:mdic method:@"dealCompOpinion" block:^(NSDictionary *successdic) {
  59. [self showMsgByMBWithString:@"发送成功"];
  60. [self.navigationController popViewControllerAnimated:YES];
  61. if (self.block) {
  62. self.block();
  63. }
  64. }];
  65. }
  66. -(void)tapHandle{
  67. [self.view endEditing:YES];
  68. }
  69. -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
  70. [self.view endEditing:YES];
  71. }
  72. - (void)didReceiveMemoryWarning {
  73. [super didReceiveMemoryWarning];
  74. // Dispose of any resources that can be recreated.
  75. }
  76. /*
  77. #pragma mark - Navigation
  78. // In a storyboard-based application, you will often want to do a little preparation before navigation
  79. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  80. // Get the new view controller using [segue destinationViewController].
  81. // Pass the selected object to the new view controller.
  82. }
  83. */
  84. @end