JXVipLevelView.m 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. //
  2. // JXVipLevelView.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/6/14.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXVipLevelView.h"
  9. @interface JXVipLevelView()<UIAlertViewDelegate>
  10. @end
  11. @implementation JXVipLevelView
  12. -(instancetype)initWithFrame:(CGRect)frame{
  13. if (self=[super initWithFrame:frame]) {
  14. self.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.5];
  15. UIView *backView=[[UIView alloc]init];
  16. backView.backgroundColor=[UIColor whiteColor];
  17. backView.layer.cornerRadius=10;
  18. backView.layer.masksToBounds=YES;
  19. [self addSubview:backView];
  20. [backView mas_makeConstraints:^(MASConstraintMaker *make) {
  21. make.centerX.mas_equalTo(self.mas_centerX);
  22. make.centerY.mas_equalTo(self.mas_centerY);
  23. make.height.mas_equalTo(200);
  24. make.left.mas_equalTo(30);
  25. make.right.mas_equalTo(-30);
  26. }];
  27. UIButton *closeBtn=[[UIButton alloc]init];
  28. [closeBtn setTitle:@"x" forState:UIControlStateNormal];
  29. [closeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  30. closeBtn.layer.cornerRadius=22;
  31. closeBtn.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.1];
  32. closeBtn.layer.masksToBounds=YES;
  33. [backView addSubview:closeBtn];
  34. [closeBtn addTarget:self action:@selector(closeBtnclick) forControlEvents:UIControlEventTouchUpInside];
  35. [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  36. make.top.mas_equalTo(backView.mas_top).mas_offset(0);
  37. make.right.mas_equalTo(0);
  38. make.height.mas_equalTo(44);
  39. make.width.mas_equalTo(44);
  40. }];
  41. UILabel *titleLabel=[[UILabel alloc]init];
  42. titleLabel.text=@"温馨提示";
  43. titleLabel.textAlignment=NSTextAlignmentCenter;
  44. titleLabel.font=[UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
  45. titleLabel.textColor=kRGBColor51;
  46. [backView addSubview:titleLabel];
  47. [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  48. make.top.mas_equalTo(20);
  49. make.centerX.mas_equalTo(self.mas_centerX);
  50. make.left.mas_equalTo(30);
  51. make.right.mas_equalTo(-30);
  52. }];
  53. UILabel *subTitle=[[UILabel alloc]init];
  54. subTitle.text=@"清添加即信号:8888888,联系视频客服!";
  55. subTitle.textAlignment=NSTextAlignmentCenter;
  56. subTitle.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
  57. subTitle.numberOfLines=0;
  58. subTitle.textColor=kRGBColor51;
  59. [backView addSubview:subTitle];
  60. self.subTitle=subTitle;
  61. [subTitle mas_makeConstraints:^(MASConstraintMaker *make) {
  62. make.centerX.mas_equalTo(self.mas_centerX);
  63. make.top.mas_equalTo(titleLabel.mas_bottom).mas_equalTo(20);
  64. make.left.mas_equalTo(30);
  65. make.right.mas_equalTo(-30);
  66. }];
  67. UIButton *knowBtn=[[UIButton alloc]init];
  68. knowBtn.backgroundColor=kRGBColor(222, 29, 1);
  69. knowBtn.titleLabel.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
  70. [knowBtn setTitle:@"复制微信号" forState:UIControlStateNormal];
  71. knowBtn.layer.cornerRadius=5;
  72. knowBtn.backgroundColor=[UIColor redColor];
  73. knowBtn.layer.masksToBounds=YES;
  74. [backView addSubview:knowBtn];
  75. self.vipVideoBtn=knowBtn;
  76. [knowBtn addTarget:self action:@selector(knowBtnclick) forControlEvents:UIControlEventTouchUpInside];
  77. [knowBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  78. make.centerX.mas_equalTo(self.mas_centerX);
  79. make.bottom.mas_equalTo(-15);
  80. make.width.mas_equalTo(160);
  81. make.height.mas_equalTo(44);
  82. }];
  83. //long time = (long)[[NSDate date] timeIntervalSince1970];
  84. //time = (time *1000 + g_server.timeDifference);
  85. // NSString *salt = [NSString stringWithFormat:@"%ld", time];
  86. // [g_server get_act_userServeWXget:@"" salt:salt Wx:@"" toView:self];
  87. }
  88. return self;
  89. }
  90. - (void)closeBtnclick{
  91. [self removeFromSuperview];
  92. }
  93. -(void)setStrURL:(NSString *)strURL{
  94. self.subTitle.text=[NSString stringWithFormat:@"请添加微信号:%@,联系视频客服!",strURL];
  95. }
  96. - (void)knowBtnclick{
  97. UIPasteboard *paseBoard=[UIPasteboard generalPasteboard];
  98. paseBoard.string=_strURL;
  99. [SVProgressHUD showWithStatus:@"复制成功"];
  100. [SVProgressHUD dismissWithDelay:1.0];
  101. }
  102. //服务端返回数据
  103. -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
  104. if([aDownload.action isEqualToString:act_GetSerServeWxget]){
  105. NSString * currentDictionary = [dict objectForKey:@"wx"];
  106. _strURL=currentDictionary;
  107. self.subTitle.text=[NSString stringWithFormat:@"请添加微信号:%@,联系视频客服!",currentDictionary];
  108. }
  109. }
  110. - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
  111. }
  112. -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{
  113. if( [aDownload.action isEqualToString:act_GetSerServeWxget] ){
  114. }
  115. return hide_error;
  116. }
  117. @end