// // JXGoldMangVc.h // shiku_im // // Created by 123 on 2020/6/14. // Copyright © 2020 Reese. All rights reserved. // #import #import "XMGMyBaseVC.h" NS_ASSUME_NONNULL_BEGIN @interface JXGoldMangVc : XMGMyBaseVC @property (nonatomic,copy) NSString *nameStr; @end NS_ASSUME_NONNULL_END /** - (void)foundSwipe2:(UISwipeGestureRecognizer *)sender { if (JX_SCREEN_WIDTH<414){ UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(foundSwipe:)]; //设置识别滑动方向 recognizer.direction =UISwipeGestureRecognizerDirectionUp; //Swipe手势识别器关联到View [self.view addGestureRecognizer:recognizer]; UISwipeGestureRecognizer *recognizer2 = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(foundSwipe2:)]; //设置识别滑动方向 recognizer2.direction =UISwipeGestureRecognizerDirectionDown; //Swipe手势识别器关联到View [self.view addGestureRecognizer:recognizer2]; } CGRect bounds=self.view.bounds; bounds.origin.y=0; self.view.bounds=bounds; } - (void)foundSwipe:(UISwipeGestureRecognizer *)sender { CGRect bounds=self.view.bounds; bounds.origin.y=110; self.view.bounds=bounds; } #import "JXGoldMangVc.h" @interface JXGoldMangVc () @property (nonatomic,weak) UIImageView *titleIMG; @property (nonatomic,weak) UIImageView *headIMG; @property (nonatomic,weak) UILabel *titleName; @property (nonatomic,weak) UILabel *accountL; @property (nonatomic,weak) UILabel *weekMoney; @property (nonatomic,weak) UILabel *monthMoney; @property (nonatomic,weak) UILabel *levelLeft; @property (nonatomic,weak) UILabel *levelright; //还差多少大妈 @property (nonatomic,weak) UILabel *chaRightL; @property (nonatomic,weak) UILabel *touzhuL; @property (nonatomic,weak) UILabel *lv2kelinQu; @property (nonatomic,weak) UIView *pressView; @property (nonatomic,strong) UIImageView *pressIMG; @property (nonatomic,weak) UIButton *lingBtn; @property (nonatomic,weak) UIView *scrolView; @end @implementation JXGoldMangVc - (void)viewDidLoad { [super viewDidLoad]; // self.topViewHHH.constant=JX_SCREEN_TOP; // // self.pressView.layer.cornerRadius=2.5; // self.pressView.layer.masksToBounds=YES; [self CreateUIUI]; [self defineNavBar:@"金管家" andRinghtBtnImg:@""]; } - (void)CreateUIUI{ UIView *scrollView=[[UIView alloc]init]; scrollView.backgroundColor=[UIColor whiteColor]; scrollView.userInteractionEnabled=YES; [self.view addSubview:scrollView]; self.scrolView=scrollView; [scrollView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(JX_SCREEN_TOP); make.left.right.mas_equalTo(0); make.bottom.mas_equalTo(0); }]; UIImageView *topIMG=[[UIImageView alloc]init]; topIMG.backgroundColor=[UIColor greenColor]; topIMG.contentMode=UIViewContentModeScaleAspectFill; [scrollView addSubview:topIMG]; topIMG.image=[UIImage imageNamed:@"上半边"]; [topIMG mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(0); make.left.mas_equalTo(0); make.right.mas_equalTo(0); }]; UIImageView *topLeftIMG=[[UIImageView alloc]init]; topLeftIMG.image=[UIImage imageNamed:@"上半边文字"]; [topIMG addSubview:topLeftIMG]; [topLeftIMG mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(30); make.centerY.mas_equalTo(topIMG.mas_centerY); }]; UIImageView *headIMG=[[UIImageView alloc]init]; headIMG.contentMode=UIViewContentModeScaleToFill; headIMG.image=[UIImage imageNamed:@"ALOGO_1200"]; headIMG.layer.cornerRadius=25; headIMG.layer.masksToBounds=YES; [scrollView addSubview:headIMG]; self.headIMG=headIMG; [g_server delHeadImage:g_server.myself.userId]; [g_server getHeadImageSmall:g_server.myself.userId userName:g_server.myself.userNickname imageView:headIMG]; [headIMG mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(20); make.top.mas_equalTo(topIMG.mas_bottom).mas_offset(JX_SCREEN_WIDTH>=414?44:30); make.width.mas_equalTo(50); make.height.mas_equalTo(50); }]; UILabel *titleName=[[UILabel alloc]init]; titleName.font=[UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; titleName.text=@"小明"; [scrollView addSubview:titleName]; self.titleName=titleName; [titleName mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(headIMG.mas_right).mas_offset(10); make.top.mas_equalTo(headIMG.mas_top).mas_offset(0); }]; UILabel *accountL=[[UILabel alloc]init]; accountL.font=[UIFont systemFontOfSize:11 weight:UIFontWeightRegular]; accountL.textColor=[UIColor grayColor]; accountL.text=@"账号:jixin111"; accountL.text=[NSString stringWithFormat:@"账号:%@",membershipAccount]; [scrollView addSubview:accountL]; [accountL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(headIMG.mas_right).mas_offset(10); make.top.mas_equalTo(titleName.mas_bottom).mas_offset(10); }]; UILabel *weekMoneyL=[[UILabel alloc]init]; weekMoneyL.font=[UIFont systemFontOfSize:11 weight:UIFontWeightRegular]; weekMoneyL.textColor=[UIColor grayColor]; weekMoneyL.text=@"周彩金:0"; [scrollView addSubview:weekMoneyL]; self.weekMoney=weekMoneyL; [weekMoneyL mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-20); make.centerY.mas_equalTo(titleName.mas_centerY); }]; UILabel *monthMoneyL=[[UILabel alloc]init]; monthMoneyL.font=[UIFont systemFontOfSize:11 weight:UIFontWeightRegular]; monthMoneyL.textColor=[UIColor grayColor]; monthMoneyL.text=@"月彩金:5元"; [scrollView addSubview:monthMoneyL]; self.monthMoney=monthMoneyL; [monthMoneyL mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-20); make.centerY.mas_equalTo(accountL.mas_centerY); }]; UILabel *myLevel=[[UILabel alloc]init]; myLevel.font=[UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; myLevel.textColor=[UIColor grayColor]; myLevel.text=@"我的等级"; [scrollView addSubview:myLevel]; [myLevel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(30); make.top.mas_equalTo(headIMG.mas_bottom).mas_offset(30); }]; UILabel *leftLevel=[[UILabel alloc]init]; leftLevel.font=[UIFont systemFontOfSize:11 weight:UIFontWeightRegular]; leftLevel.textColor=[UIColor grayColor]; leftLevel.text=@"LV1"; [scrollView addSubview:leftLevel]; self.levelLeft=leftLevel; [leftLevel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(30); make.top.mas_equalTo(myLevel.mas_bottom).mas_offset(20); }]; UILabel *rightLevel=[[UILabel alloc]init]; rightLevel.font=[UIFont systemFontOfSize:11 weight:UIFontWeightRegular]; rightLevel.textColor=[UIColor grayColor]; rightLevel.text=@"还差10K打码到达LV2 "; [scrollView addSubview:rightLevel]; self.levelright=rightLevel; [rightLevel mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-20); make.centerY.mas_equalTo(leftLevel.mas_centerY); }]; UIView *pressView=[[UIView alloc]init]; pressView.backgroundColor=[UIColor grayColor]; pressView.layer.cornerRadius=2.5; pressView.layer.masksToBounds=YES; [scrollView addSubview:pressView]; self.pressView=pressView; [pressView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(leftLevel.mas_bottom).mas_offset(8); make.left.mas_equalTo(30); make.right.mas_equalTo(-20); make.height.mas_equalTo(5); }]; _pressIMG=[[UIImageView alloc]init]; _pressIMG.image=[UIImage imageNamed:@"进度条"]; [pressView addSubview:_pressIMG]; _pressIMG.hidden=YES; [_pressIMG mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(0); make.left.mas_equalTo(0); make.height.mas_equalTo(5); }]; UILabel *touzhuL=[[UILabel alloc]init]; touzhuL.font=[UIFont systemFontOfSize:11 weight:UIFontWeightRegular]; touzhuL.textColor=[UIColor grayColor]; touzhuL.text=@"有效投注:30000 "; [scrollView addSubview:touzhuL]; self.touzhuL=touzhuL; [touzhuL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(30); make.top.mas_equalTo(pressView.mas_bottom).mas_offset(8); }]; UILabel *linQuL=[[UILabel alloc]init]; linQuL.font=[UIFont systemFontOfSize:11 weight:UIFontWeightRegular]; linQuL.textColor=[UIColor grayColor]; linQuL.text=@"LV2可领取30元 "; [scrollView addSubview:linQuL]; self.lv2kelinQu=linQuL; [linQuL mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-20); make.top.mas_equalTo(pressView.mas_bottom).mas_offset(8); }]; UIButton *nowBtn=[[UIButton alloc]init]; [nowBtn setTitle:@"立即领取彩金" forState:UIControlStateNormal]; [nowBtn setBackgroundImage:[UIImage imageNamed:@"领取按钮"] forState:UIControlStateNormal]; [self.view addSubview:nowBtn]; self.lingBtn=nowBtn; [nowBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.mas_equalTo(0); make.right.left.mas_equalTo(0); make.height.mas_equalTo(JX_SCREEN_BOTTOM); }]; [nowBtn addTarget:self action:@selector(nowBtn) forControlEvents:UIControlEventTouchUpInside]; [SVProgressHUD show]; long time = (long)[[NSDate date] timeIntervalSince1970]; time = (time *1000 + g_server.timeDifference); NSString *salt = [NSString stringWithFormat:@"%ld", time]; [g_server Useract_act_VipConfigGoldMag:salt andToView:self]; //[g_server getUserVipact_GainUserGoldMang:salt andToView:self]; [g_server getUserVipInformation:salt andToView:self]; if (JX_SCREEN_WIDTH<414){ UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(foundSwipe:)]; //设置识别滑动方向 recognizer.direction =UISwipeGestureRecognizerDirectionUp; //Swipe手势识别器关联到View [scrollView addGestureRecognizer:recognizer]; UISwipeGestureRecognizer *recognizer2 = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(foundSwipe2:)]; //设置识别滑动方向 recognizer2.direction =UISwipeGestureRecognizerDirectionDown; //Swipe手势识别器关联到View [scrollView addGestureRecognizer:recognizer2]; } } - (void)foundSwipe2:(UISwipeGestureRecognizer *)sender { CGRect bounds=self.scrolView.bounds; bounds.origin.y=0; self.scrolView.bounds=bounds; } - (void)foundSwipe:(UISwipeGestureRecognizer *)sender { CGRect bounds=self.scrolView.bounds; bounds.origin.y=110; self.scrolView.bounds=bounds; } - (void)nowBtn { long time = (long)[[NSDate date] timeIntervalSince1970]; time = (time *1000 + g_server.timeDifference); NSString *salt = [NSString stringWithFormat:@"%ld", time]; [g_server vipGainCoin:salt andToView:self]; // _pressIMG.hidden=NO; // [_pressIMG mas_makeConstraints:^(MASConstraintMaker *make) { // make.width.mas_equalTo(120); // }]; } -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{ [SVProgressHUD dismiss]; if([aDownload.action isEqualToString:act_GetUserVipInformation]) { NSDictionary * currentDictionary = [dict objectForKey:@"current"]; NSString * currentLevel = [NSString stringWithFormat:@"%@",[currentDictionary objectForKey:@"name"]]; self.levelLeft.text=[NSString stringWithFormat:@"LV%@",currentLevel]; self.titleName.text=@"sss"; self.accountL.text= [NSString stringWithFormat:@"账号:%@", dict[@"membershipAccount"]]; NSDictionary * weekAwardDictionary = [dict objectForKey:@"weekAward"]; if ([weekAwardDictionary[@"isAllow"] intValue]==0) { self.lingBtn.userInteractionEnabled=NO; //控件不能点 self.lingBtn.alpha=0.5; } NSDictionary * curretDictionary = [dict objectForKey:@"current"]; NSDictionary * nextDictionary = [dict objectForKey:@"next"]; self.levelLeft.text = [NSString stringWithFormat:@"LV:%@",[curretDictionary objectForKey:@"level"]]; self.lv2kelinQu.text=[NSString stringWithFormat:@"LV%@可领取:%@", [nextDictionary objectForKey:@"level"],nextDictionary[@"upgradeCoin"]]; CGFloat aaaaMoney= [dict[@"totalRecharge"] intValue]*1.0; self.touzhuL.text=[NSString stringWithFormat:@"有效投注:%@",dict[@"totalRecharge"]]; //当前用户的等级 int aaaa= ([curretDictionary[@"money"] intValue])*1.0; int nextaaa= [nextDictionary[@"money"] intValue]; CGFloat baifenbi=aaaaMoney/(nextaaa-aaaa)*1.0; _pressIMG.hidden=NO; if (baifenbi>1) { baifenbi=1; [_pressIMG mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(0); }]; }else{ [_pressIMG mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo((JX_SCREEN_WIDTH-50)*baifenbi); }]; } CGFloat nextMoney=[nextDictionary[@"money"] floatValue]; self.levelright.text = [NSString stringWithFormat:@"还差%.f打码到达LV:%@",nextMoney-aaaaMoney,[nextDictionary objectForKey:@"level"]]; NSString * nextweekRedPackageCoin = [NSString stringWithFormat:@"%@",[currentDictionary objectForKey:@"weekRedPackageCoin"]]; self.weekMoney.text = [NSString stringWithFormat:@"周俸禄:%@",nextweekRedPackageCoin]; NSString * nextMonth = [NSString stringWithFormat:@"%@",[currentDictionary objectForKey:@"monthRedPackageCoin"]]; self.monthMoney.text = [NSString stringWithFormat:@"月俸禄:%@",nextMonth]; } else if([aDownload.action isEqualToString:act_GainUserCoin]) { [SVProgressHUD dismiss]; UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"提示" message:@"领取成功" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [alert show]; long time = (long)[[NSDate date] timeIntervalSince1970]; time = (time *1000 + g_server.timeDifference); NSString *salt = [NSString stringWithFormat:@"%ld", time]; [g_server getUserVipInformation:salt andToView:self]; } } -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{ NSString * errorCode = [NSString stringWithFormat:@"%@",[dict objectForKey:@"resultMsg"]]; if([errorCode isEqualToString:@"权限验证失败"]) { if([aDownload.action isEqualToString:act_GetUserVipInformation]) { long time = (long)[[NSDate date] timeIntervalSince1970]; time = (time *1000 + g_server.timeDifference); NSString *salt = [NSString stringWithFormat:@"%ld", time]; [g_server getUserVipInformation:salt andToView:self]; } else if([aDownload.action isEqualToString:act_GainUserCoin]) { long time = (long)[[NSDate date] timeIntervalSince1970]; time = (time *1000 + g_server.timeDifference); NSString *salt = [NSString stringWithFormat:@"%ld", time]; [g_server vipGainCoin:salt andToView:self]; } } else { [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"%@",[dict objectForKey:@"resultMsg"]]]; } if( [aDownload.action isEqualToString:act_UserLogout] ){ [self performSelector:@selector(doSwitch) withObject:nil afterDelay:1]; } return hide_error; } @end */