JXShareShowView.m 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // JXFeedShowView.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/26.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXShareShowView.h"
  9. @interface JXShareShowView()
  10. @property (weak, nonatomic) IBOutlet UIView *backView;
  11. @property (weak, nonatomic) IBOutlet UIView *whiteView;
  12. @end
  13. @implementation JXShareShowView
  14. +(instancetype)XIBJXShareShowView{
  15. return [[NSBundle mainBundle]loadNibNamed:@"JXShareShowView" owner:self options:nil].firstObject;
  16. }
  17. -(void)awakeFromNib{
  18. [super awakeFromNib];
  19. self.konwBtn.layer.cornerRadius=12;
  20. self.konwBtn.layer.masksToBounds=YES;
  21. self.backView.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.6];
  22. self.whiteView.layer.cornerRadius=12;
  23. self.whiteView.layer.masksToBounds=YES;
  24. self.yaoqinTF.layer.cornerRadius=15;
  25. self.yaoqinTF.layer.masksToBounds=YES;
  26. self.yaoqinTF.layer.borderColor=[UIColor grayColor].CGColor;
  27. self.yaoqinTF.layer.borderWidth=1;
  28. UIView *leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 12, 30)];
  29. UIImageView *imageV=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 22, 30)];
  30. [leftView addSubview:imageV];
  31. self.yaoqinTF.leftViewMode = UITextFieldViewModeAlways;
  32. self.yaoqinTF.leftView=leftView;
  33. [self.backView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(closeView)]];
  34. long time = (long)[[NSDate date] timeIntervalSince1970];
  35. time = (time *1000 + g_server.timeDifference);
  36. NSString *salt = [NSString stringWithFormat:@"%ld", time];
  37. [g_server getact_getinviteget:salt andUserId:g_server.myself.userId andToView:self];
  38. }
  39. #pragma mark --- 请求成功
  40. -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
  41. [SVProgressHUD dismiss];
  42. //N g(@"dict: %@ --- arry: %@",dict ,array1 );
  43. if([aDownload.action isEqualToString:act_getinviteget])
  44. {
  45. NSDictionary *dictM=dict;
  46. NSString *str=[NSString stringWithFormat:@"%@",dictM[@"invite"]];
  47. self.yaoqinTF.text=str;
  48. }
  49. }
  50. -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{
  51. [SVProgressHUD dismiss];
  52. NSString * errorCode = [NSString stringWithFormat:@"%@",[dict objectForKey:@"resultMsg"]];
  53. if([errorCode isEqualToString:@"权限验证失败"])
  54. {
  55. if ([aDownload.action isEqualToString:act_getinviteget])
  56. {
  57. }else{
  58. }
  59. }
  60. return [errorCode intValue];
  61. }
  62. +(void)showView{
  63. JXShareShowView *show=[JXShareShowView XIBJXShareShowView];
  64. show.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.6];
  65. show.frame=[UIScreen mainScreen].bounds;
  66. [[UIApplication sharedApplication].keyWindow addSubview:show];
  67. }
  68. - (void)closeView{
  69. [self setHidden:YES];
  70. }
  71. -(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
  72. [self endEditing:YES];
  73. }
  74. @end