// // JXVipLevelView.m // shiku_im // // Created by 123 on 2020/6/14. // Copyright © 2020 Reese. All rights reserved. // #import "JXVipLevelView.h" @interface JXVipLevelView() @end @implementation JXVipLevelView -(instancetype)initWithFrame:(CGRect)frame{ if (self=[super initWithFrame:frame]) { self.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.5]; UIView *backView=[[UIView alloc]init]; backView.backgroundColor=[UIColor whiteColor]; backView.layer.cornerRadius=10; backView.layer.masksToBounds=YES; [self addSubview:backView]; [backView mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(self.mas_centerX); make.centerY.mas_equalTo(self.mas_centerY); make.height.mas_equalTo(200); make.left.mas_equalTo(30); make.right.mas_equalTo(-30); }]; UIButton *closeBtn=[[UIButton alloc]init]; [closeBtn setTitle:@"x" forState:UIControlStateNormal]; [closeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; closeBtn.layer.cornerRadius=22; closeBtn.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.1]; closeBtn.layer.masksToBounds=YES; [backView addSubview:closeBtn]; [closeBtn addTarget:self action:@selector(closeBtnclick) forControlEvents:UIControlEventTouchUpInside]; [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(backView.mas_top).mas_offset(0); make.right.mas_equalTo(0); make.height.mas_equalTo(44); make.width.mas_equalTo(44); }]; UILabel *titleLabel=[[UILabel alloc]init]; titleLabel.text=@"温馨提示"; titleLabel.textAlignment=NSTextAlignmentCenter; titleLabel.font=[UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; titleLabel.textColor=kRGBColor51; [backView addSubview:titleLabel]; [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(20); make.centerX.mas_equalTo(self.mas_centerX); make.left.mas_equalTo(30); make.right.mas_equalTo(-30); }]; UILabel *subTitle=[[UILabel alloc]init]; subTitle.text=@"清添加即信号:8888888,联系视频客服!"; subTitle.textAlignment=NSTextAlignmentCenter; subTitle.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular]; subTitle.numberOfLines=0; subTitle.textColor=kRGBColor51; [backView addSubview:subTitle]; self.subTitle=subTitle; [subTitle mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(self.mas_centerX); make.top.mas_equalTo(titleLabel.mas_bottom).mas_equalTo(20); make.left.mas_equalTo(30); make.right.mas_equalTo(-30); }]; UIButton *knowBtn=[[UIButton alloc]init]; knowBtn.backgroundColor=kRGBColor(222, 29, 1); knowBtn.titleLabel.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular]; [knowBtn setTitle:@"复制微信号" forState:UIControlStateNormal]; knowBtn.layer.cornerRadius=5; knowBtn.backgroundColor=[UIColor redColor]; knowBtn.layer.masksToBounds=YES; [backView addSubview:knowBtn]; self.vipVideoBtn=knowBtn; [knowBtn addTarget:self action:@selector(knowBtnclick) forControlEvents:UIControlEventTouchUpInside]; [knowBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(self.mas_centerX); make.bottom.mas_equalTo(-15); make.width.mas_equalTo(160); make.height.mas_equalTo(44); }]; // long time = (long)[[NSDate date] timeIntervalSince1970]; // time = (time *1000 + g_server.timeDifference); // NSString *salt = [NSString stringWithFormat:@"%ld", time]; // // // NSString *membershipAccount=[[NSUserDefaults standardUserDefaults] objectForKey:@"membershipAccount_ID"]; // // [g_server get_act_GetshangXiaJi:membershipAccount salt:salt toView:self]; //long time = (long)[[NSDate date] timeIntervalSince1970]; //time = (time *1000 + g_server.timeDifference); // NSString *salt = [NSString stringWithFormat:@"%ld", time]; // [g_server get_act_userServeWXget:@"" salt:salt Wx:@"" toView:self]; } return self; } - (void)closeBtnclick{ [self removeFromSuperview]; } -(void)setStrURL:(NSString *)strURL{ self.subTitle.text=[NSString stringWithFormat:@"请添加微信号:%@,联系视频客服!",strURL]; } - (void)knowBtnclick{ if (_Block) { _Block(@""); } [self removeFromSuperview]; } //服务端返回数据 -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{ if([aDownload.action isEqualToString:act_GetshangXiaJi]){ NSDictionary * currentDictionary = [dict objectForKey:@"superior"]; _strURL = [currentDictionary objectForKey:@"wx"]; self.subTitle.text=[NSString stringWithFormat:@"请添加微信号:%@,联系视频客服!",currentDictionary]; } } - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ } -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{ if( [aDownload.action isEqualToString:act_GetSerServeWxget] ){ } return hide_error; } @end