ComDealVC.m 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 = RQMianColor;
  20. [btn setTitle:@"发送" textColor:[UIColor whiteColor] font:15 fotState:0];
  21. [btn addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside];
  22. self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:btn];
  23. //
  24. UIScrollView * scrV = [[UIScrollView alloc]initWithFrame:kFrame];
  25. scrV.contentSize = CGSizeMake(0, kSize.height);
  26. scrV.showsVerticalScrollIndicator = NO;
  27. scrV.delegate = self;
  28. [self.view addSubview:scrV];
  29. UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapHandle)];
  30. [scrV addGestureRecognizer:tap];
  31. UILabel *lab = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, kSize.width, 30)];
  32. lab.text = @"请输入意见:";
  33. lab.font = [UIFont systemFontOfSize:17];
  34. [scrV addSubview:lab];
  35. _tx = [[UITextView alloc]initWithFrame:CGRectMake(20, 60, kSize.width-40, 180)];
  36. _tx.delegate = self;
  37. _tx.font = [UIFont systemFontOfSize:15];
  38. [scrV addSubview:_tx];
  39. }
  40. -(void)rightBtnClick{
  41. [self.view endEditing:YES];
  42. if (_tx.text.length == 0) {
  43. [self showMsgByAlertVCWithString:@"请输入意见"];
  44. return;
  45. }
  46. NSMutableDictionary * mdic = [NSMutableDictionary new];
  47. [mdic setValue:_theId forKey:@"objectId"];
  48. [mdic setValue:_tx.text forKey:@"content"];
  49. [mdic setValue:defUser.userDict[@"id"] forKey:@"userId"];
  50. [self getDataWithDic:mdic method:@"dealCompl" block:^(NSDictionary *successdic) {
  51. ShowMsg(@"发送成功");
  52. [self.navigationController popViewControllerAnimated:YES];
  53. if (self.block) {
  54. self.block();
  55. }
  56. }];
  57. }
  58. -(void)tapHandle{
  59. [self.view endEditing:YES];
  60. }
  61. -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
  62. [self.view endEditing:YES];
  63. }
  64. - (void)didReceiveMemoryWarning {
  65. [super didReceiveMemoryWarning];
  66. // Dispose of any resources that can be recreated.
  67. }
  68. /*
  69. #pragma mark - Navigation
  70. // In a storyboard-based application, you will often want to do a little preparation before navigation
  71. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  72. // Get the new view controller using [segue destinationViewController].
  73. // Pass the selected object to the new view controller.
  74. }
  75. */
  76. @end