GroupGonggaoController.m 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // GroupGonggaoController.m
  3. // AIIM
  4. //
  5. // Created by gan on 2025/5/2.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "GroupGonggaoController.h"
  9. #import "GroupNetApi.h"
  10. @interface GroupGonggaoController()
  11. @property (weak, nonatomic) IBOutlet UILabel *titleLb;
  12. @property (weak, nonatomic) IBOutlet UITextView *gonggaoT;
  13. @property (weak, nonatomic) IBOutlet UIButton *baocunBt;
  14. @end
  15. @implementation GroupGonggaoController
  16. -(void)viewDidLoad{
  17. [super viewDidLoad];
  18. [self.navigationController setNavigationBarHidden:YES animated:NO];
  19. if(self.editType==1){
  20. _gonggaoT.editable = YES;
  21. _baocunBt.alpha = 1;
  22. }
  23. else{
  24. _gonggaoT.editable = NO;
  25. _baocunBt.alpha = 0;
  26. }
  27. _gonggaoT.text = ![self.gonggao isKindOfClass:NSNull.class]?self.gonggao:@"";
  28. }
  29. - (IBAction)gotoback:(id)sender {
  30. [self dismissViewControllerAnimated:YES completion:nil];
  31. }
  32. - (IBAction)saveAct:(id)sender {
  33. if(self.editType ==1){
  34. NSString *str = _gonggaoT.text;
  35. if([str isKindOfClass:[NSString class]]&&str.length>0){
  36. NSDictionary *dic=@{
  37. @"announcement":str
  38. };
  39. [GroupNetApi updateGroup:dic groupId:self.groupId succ:^(int code, NSDictionary * res) {
  40. NSLog(@"res:%@",res);
  41. [self dismissViewControllerAnimated:YES completion:nil];
  42. } fail:^(NSError * _Nonnull error) {
  43. ;
  44. }];
  45. }
  46. }
  47. }
  48. #pragma mark statusBar
  49. - (UIStatusBarStyle)preferredStatusBarStyle{
  50. return UIStatusBarStyleLightContent;
  51. }
  52. @end