123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- //
- // JXVipLevelView.m
- // shiku_im
- //
- // Created by 123 on 2020/6/14.
- // Copyright © 2020 Reese. All rights reserved.
- //
- #import "JXVipLevelView.h"
-
- @interface JXVipLevelView()<UIAlertViewDelegate>
- @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
|