// // YOUPAILZProfileVC.m // VQU // // Created by CY on 2021/6/30. // Copyright © 2021 leo. All rights reserved. // #import "YOUPAILZProfileVC.h" #import "YOUPAILZProfileHeaderView.h" #import "YOUPAILZProfileMenuItemCell.h" #import "YOUPAILZUnionsPopularizeVC.h" #import "YOUPAILCIMSessionVC.h" #import "YOUPAILCVerifyBigCastVC.h" #import "YOUPAILCBigCastSetVC.h" #import "LPBeautySetVC.h" #import "YOUPAILZVipVC.h" #import "YOUPAILPYoungSettingVC.h" #import "YOUPAILCSettingVC.h" #import "YOUPAILZGameListVC.h" #import "YOUPAILZGameAccompanyListVC.h" #import #import "YOUPAIXRWalletVC.h" #import "YOUPAILZPersonalizedDressVC.h" #import "YOUPAILZBaseBackpackVC.h" #import "YOUPAILZBadgeVC.h" #import "YOUPAIHRsendRankVC.h" #import "YOUPAIHRReddotModel.h" #import "YOUPAIHRGuildCenterSearchVC.h" #import "YOUPAIHRGuildCenterDetailVC.h" #import "YOUPAIRealPersonFaceVC.h" #import #import "YOUPAILZLiveVerifyResultVC.h" #import "YOUPAIProfileContentCell.h" #import "YOUPAIBigCastSettingVC.h" #import "YOUPAIMyNetworkVC.h" #import "YOUPAILCBigCastProtocolVC.h" #import "YOUPAIHRRechargePayWindow.h" #import "UIViewController+TFPresent.h" #import "YOUPAILCUploadCameraAuditVC.h" #import "WHVipDropView.h" #import "WHMineSwitchView.h" #import "WHMineBottomView.h" #import "YOUPAIBBSettingVC.h" #define kHeaderViewHeight (45 + 251.0f + StatusBarHeight) @interface YOUPAILZProfileVC () //@property (nonatomic, weak) UITableView* youpaiptableView; @property (nonatomic, strong) NSMutableArray *youpaipdataSource;//一级 @property (nonatomic, strong) NSMutableArray *youpaipdataSourceTableView;//二级 @property (nonatomic, strong) NSMutableArray *switchArr; //开关 视频勿扰 私信勿扰 私信音效 @property (nonatomic, strong) YOUPAILZProfileHeaderView *youpaipheaderView; @property (nonatomic, strong) YOUPAIProfileContentCell *functionView; //功能模块 @property (nonatomic, weak) UIImageView *youpaipavatarImgV; @property (nonatomic, strong) NSString *youpaipweiguiUrl; ///违规公布 @property (nonatomic, strong) NSString *youpaiphelpURL; ///在线客服 @property (nonatomic, strong) NSString *youpaipinviteUrl; ///邀请 @property (nonatomic, strong) NSString *youpaiptaskCenterUrl; ///任务中心 @property (nonatomic,strong) YOUPAIHRReddotModel *youpaipdotModel; @property (nonatomic,assign) NSInteger youpaipguild;//0:未加入公会;1:已加入公会;2:已加入公会会长 @property (nonatomic,assign) NSInteger is_complete_info;//1展示 0隐藏 @property (nonatomic, strong) UIScrollView *scrollView; @property (nonatomic, strong) UIStackView *stackView; @property (nonatomic, strong) WHMineBottomView *bottomView; @end @implementation YOUPAILZProfileVC - (void)dealloc{ [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.navigationController setNavigationBarHidden:YES animated:animated]; } - (void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; if ([LCSaveData getIsspecial]== NO && [LCSaveModel getUserModel].youpaipuserinfo.youpaipgender ==1){ [self youpaifcheckSetting]; } [self youpaifrefreshData]; } - (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; [self.navigationController setNavigationBarHidden:NO animated:animated]; } - (void)viewDidLoad { [super viewDidLoad]; self.youpaipdataSource = [NSMutableArray array]; self.youpaipdataSourceTableView = [NSMutableArray array]; self.switchArr = [NSMutableArray array]; [[YMGlobalUtils shared] getConfig]; [self youpaifinitUI]; /// 线上版本状态改变,接收通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youpaifreloadDataSource) name:@"OnlineVersion" object:nil]; [self.switchArr addObject:@{ @"image":[UIImage imageNamed:@"mine_video_wurao"], @"title":@"视频勿扰", @"type":@"videoSwitch", }]; [self.switchArr addObject:@{ @"image":[UIImage imageNamed:@"mine_sixin_chat"], @"title":@"私信聊天", @"type":@"messageSwitch", }]; [self.switchArr addObject:@{ @"image":[UIImage imageNamed:@"mine_sixin_yinxiao"], @"title":@"私信音效", @"type":@"msgSoundSwitch", }]; for (NSDictionary *dict in self.switchArr) { WHMineSwitchView *view = [[WHMineSwitchView alloc] init]; view.dict = dict; [self.stackView addArrangedSubview:view]; } } - (void)youpaifreloadDataSource{ [self.youpaipdataSource removeAllObjects]; [self.youpaipdataSourceTableView removeAllObjects]; [self.switchArr removeAllObjects]; YOUPAILCBaseInfo *userinfo = [LCSaveModel getUserModel].youpaipuserinfo; NSString *vip_des = userinfo.youpaipvip_des; //糖豆抽盲盒 // [self.dataSource addObject:@{ // @"type":@"MangHe", // @"image":[UIImage imageNamed:@"vqu_images_ic_manghe"], // @"title":@"糖豆抽盲盒", // @"accessoryType":@(LZTableViewCellAccessoryRightTitle), // @"rightText":@"更多任务赚金币", // }]; // NSString *badgeCount ; // if (userinfo.youpaipbadge_all.count>0) { // badgeCount = [NSString stringWithFormat:@"我的勋章(%ld)",userinfo.youpaipbadge_all.count]; // }else{ // badgeCount = [NSString stringWithFormat:@"我的勋章"]; // } // YOUPAIHRReddotModel *dotModel = self.youpaipdotModel; // // 邀请有奖 // if ([LCSaveData getOnlineVersion]) { [self.youpaipdataSource addObject:@{ @"type":@"invite", @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_invite"], @"title":@"邀请有奖",//邀请有奖 @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), @"rightText":@"", }]; // 美颜设置 [self.youpaipdataSource addObject:@{ @"type":@"beauty_set", @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_beauty_set"], @"title":@"美颜设置", @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), @"rightText":@"", }]; // 女神认证 if (userinfo.youpaipgender == 1) { //女 // 女神认证 NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:@"big_cast" forKey:@"type"]; NSString *title = @""; if (userinfo.youpaipis_anchor == 0) { title = @"真人认证"; [dict setObject:[UIImage imageNamed:@"vqu_images_Host_settings_nonra"] forKey:@"image"]; }else{ title = @"聊天价格"; [dict setObject:[UIImage imageNamed:@"vqu_images_Host_settings_auth"] forKey:@"image"]; } [dict setObject:title forKey:@"title"]; [dict setObject:@(LZTableViewCellAccessoryDisclosureIndicator) forKey:@"accessoryType"]; [dict setObject:@"" forKey:@"rightText"]; [self.youpaipdataSource addObject:dict]; } // 我的账单 [self.youpaipdataSource addObject:@{ @"type":@"zhangdan", @"image":[UIImage imageNamed:@"vqu_images_Host_settings_zhangdan"], @"title":@"我的账单", @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), @"rightText":@"", }]; // } // //任务中心 // [self.youpaipdataSource addObject:@{ // @"type":@"Task", // @"image":[UIImage imageNamed:@"vqu_images_D_task"], // @"title":@"任务中心", // @"accessoryType":@(LZTableViewCellAccessoryRightTitle), // @"rightText":@"", // }]; // // 贵族中心 // [self.youpaipdataSource addObject:@{ // @"type":@"vip", // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_vip"], // @"title":@"贵族中心", // @"accessoryType":@(LZTableViewCellAccessoryRightTitle), // @"rightText":vip_des, // }]; // //我的背包 // [self.youpaipdataSource addObject:@{ // @"type":@"mine_beibao", // @"image":[UIImage imageNamed:@"vqu_images_my_backpack"], // @"title":@"我的背包", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // @"rightText":@"", // @"redView":[NSString stringWithFormat:@"%ld",(long)dotModel.youpaippackage_watch] // }]; // //我的人脉 // [self.youpaipdataSource addObject:@{ // @"type":@"my_network", // @"image":[UIImage imageNamed:@"vqu_images_my_network"], // @"title":@"我的人脉", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // @"rightText":@"" // // }]; // if (userinfo.youpaipis_anchor == 1) { // //女神设置 // [self.youpaipdataSource addObject:@{ // @"type":@"Host_settings", // @"image":[UIImage imageNamed:@"vqu_images_Host_settings"], // @"title":@"女神设置", // @"accessoryType":@(LZTableViewCellAccessoryNone), // @"rightText":@"" // // }]; // } //送礼榜 // if (userinfo.youpaipis_anchor == 1) { // [self.youpaipdataSource addObject:@{ // @"type":@"sendRank", // @"image":[UIImage imageNamed:@"vqu_images_sendRank"], // @"title":@"送礼榜", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // @"rightText":@"", // // }]; // } // //我的认证 // [self.youpaipdataSource addObject:@{ // @"type":@"my_face", // @"image":[UIImage imageNamed:@"vqu_images_my_face"], // @"title":@"我的认证", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // @"rightText":@"", // }]; // 在线客服 [self.youpaipdataSourceTableView addObject:@{ @"type":@"im_service", @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_im_service"], @"title":@"在线客服", @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), @"rightText":@"", }]; // 违规公布 [self.youpaipdataSourceTableView addObject:@{ @"type":@"weiguigongbu", @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_weiguigongbu"], @"title":@"违规公布", @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), @"rightText":@"", }]; //系统设置 [self.youpaipdataSourceTableView addObject:@{ @"type":@"vqu_images_P_mine_Set", @"image":[UIImage imageNamed:@"vqu_images_P_mine_Set"], @"title":@"系统设置", @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), @"rightText":@"", }]; // // 勿扰模式 // [self.youpaipdataSource addObject:@{ // @"type":@"mine_darao", // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_mine_darao"], // @"title":@"勿扰模式", // @"accessoryType":@(LZTableViewCellAccessorySwitch), // @"rightText":@"", // @"subTitle":[LCSaveModel getUserModel].youpaipuserinfo.youpaipis_anchor == 1 ? @"(开启后男用户将无法给你拨打视频)" : @"(开启后女神不可群发打招呼给你)", // }]; // // 我的勋章 // [self.youpaipdataSource addObject:@{ // @"type":@"my_badge", // @"image":[UIImage imageNamed:@"vqu_images_ic_profile_bedge"], // @"title":badgeCount, // @"accessoryType":@(LZTableViewCellAccessoryRightImage), // @"rightText":@"", // @"redView":[NSString stringWithFormat:@"%ld",(long)dotModel.youpaipbadges_watch] // }]; // //公会中心 // [self.youpaipdataSource addObject:@{ // @"type":@"guild", // @"image":[UIImage imageNamed:@"vqu_images_mine_guild"], // @"title":@"公会中心", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // @"rightText":@"", // }]; // // 个性装扮 // [self.youpaipdataSource addObject:@{ // @"type":@"personalizedDress", // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_personalized_dress"], // @"title":@"个性装扮", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // @"rightText":@"", // @"redView":[NSString stringWithFormat:@"%ld",(long)dotModel.youpaipdress_watch] // }]; // if (userinfo.youpaipis_anchor == 1) { // [self.youpaipdataSource addObject:@{ // @"type":@"sendRank", // @"image":[UIImage imageNamed:@"vqu_images_sendRank"], // @"title":@"送礼榜", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // @"rightText":@"", // // }]; // } // // // // // // 推广制度 // [self.youpaipdataSource addObject:@{ // @"type":@"unions", // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_unions"], // @"title":@"推广制度", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // @"rightText":@"", // }]; //// 使用帮助 // if (userinfo.youpaipgender==1) { //女 // [self.youpaipdataSource addObject:@{ // @"type":@"help", // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_beauty_set"], // @"title":@"使用帮助", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // }]; // } // // 青少年模式 if (userinfo.youpaipgender != 1) { //男 [self.youpaipdataSource addObject:@{ @"type":@"vqu_images_ic_my_young", @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_Young"], @"title":@"青少年模式", @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), @"rightText":@"", }]; } //// 设置 // [self.youpaipdataSource addObject:@{ // @"type":@"set", // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_set"], // @"title":@"设置", // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator), // @"rightText":@"", // }]; // [self.youpaiptableView reloadData]; self.functionView.vqupaipdataArr = self.youpaipdataSource; } - (void)youpaifinitUI{ // UIView *bgView = [UIView new]; [self.view addSubview:self.scrollView]; [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(0); make.right.mas_equalTo(0); make.top.mas_equalTo(0); make.bottom.mas_equalTo(0); }]; UIImageView *topImageView = [UIImageView new]; [self.scrollView addSubview:topImageView]; [topImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.view); make.left.mas_equalTo(0); make.right.mas_equalTo(0); make.height.mas_greaterThanOrEqualTo(WHScreenEqualWidth(497)); }]; // UIImage *bgImage = [LCTools imageForSize:CGSizeMake(KScreenWidth, KScreenEqualWidth(497)) colors:@[HexColorFromRGB(0xDF84C7),HexColorFromRGB(0xDF84C8),HexColorFromRGB(0x4C26AC )] locations:@[@0, @0, @1] ByGradientType:GradientupleftTolowRight]; topImageView.image = [UIImage imageNamed:@"mine_bg"]; // UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0,0, KScreenWidth, KScreenHeight-TabbarHeight) style:UITableViewStyleGrouped]; // tableView.showsVerticalScrollIndicator = NO; // tableView.separatorStyle = UITableViewCellSeparatorStyleNone; // tableView.backgroundColor = [UIColor clearColor]; // // tableView.estimatedSectionHeaderHeight = 0; // tableView.estimatedSectionFooterHeight = 0; // tableView.dataSource = self; // tableView.delegate = self; // [self.view addSubview:tableView]; // self.youpaiptableView = tableView; YOUPAILZProfileHeaderView *headerView = [[YOUPAILZProfileHeaderView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeaderViewHeight)]; headerView.is_complete_info = self.is_complete_info; headerView.youpaipinfoModel = [LCSaveModel getUserModel].youpaipuserinfo; [self.scrollView addSubview:headerView]; self.youpaipheaderView = headerView; YOUPAIProfileContentCell *cell = [[YOUPAIProfileContentCell alloc] init]; [self.scrollView addSubview:cell.contentView]; [cell.contentView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(headerView.mas_bottom).offset(WHScreenEqualWidth(16)); make.left.mas_equalTo(0); make.right.mas_equalTo(0); make.height.mas_equalTo(WHScreenEqualWidth(93)); }]; self.functionView = cell; [self.scrollView addSubview:self.stackView]; [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(WHScreenEqualWidth(12)); make.right.mas_equalTo(WHScreenEqualWidth(-12)); make.top.equalTo(self.functionView.contentView.mas_bottom).offset(WHScreenEqualWidth(16)); }]; [self.scrollView addSubview:self.bottomView]; [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(WHScreenEqualWidth(12)); make.right.mas_equalTo(WHScreenEqualWidth(-12)); make.top.equalTo(self.stackView.mas_bottom).offset(WHScreenEqualWidth(16)); make.bottom.equalTo(self.scrollView).offset(-(TabbarHeight + WHScreenEqualWidth(20))); }]; } - (UIScrollView *)scrollView{ if(!_scrollView){ _scrollView = [[UIScrollView alloc] init]; // _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; //不考虑安全区域边缘 [_scrollView setShowsVerticalScrollIndicator:NO]; [_scrollView setShowsHorizontalScrollIndicator:NO]; [_scrollView setBackgroundColor:HexColorFromRGB(0xF8F9FE)]; _scrollView.alwaysBounceVertical = YES; //垂直 - 弹簧效果 } return _scrollView; } - (UIStackView *)stackView{ if(!_stackView){ _stackView = [[UIStackView alloc] init]; [_stackView setAxis:(UILayoutConstraintAxisVertical)]; //垂直布局 [_stackView setSpacing:0]; [_stackView setBackgroundColor:[UIColor whiteColor]]; [_stackView.layer setCornerRadius:WHScreenEqualWidth(8)]; [_stackView.layer setMasksToBounds:YES]; _stackView.layer.shadowColor = [UIColor colorWithWhite:0 alpha:0.6f].CGColor; // [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.0600].CGColor; _stackView.layer.shadowOffset = CGSizeMake(0,2); _stackView.layer.shadowOpacity = 1; _stackView.layer.shadowRadius = 4; } return _stackView; } - (WHMineBottomView *)bottomView{ if(!_bottomView){ _bottomView = [[WHMineBottomView alloc] init]; __weak typeof(self) weakSelf = self; _bottomView.actionBlock = ^(NSDictionary * _Nonnull sourceDict) { if(sourceDict){ if([sourceDict[@"type"] isEqualToString:@"home"]){ // 个人主页 }else if([sourceDict[@"type"] isEqualToString:@"server"]){ // 在线客服 }else if([sourceDict[@"type"] isEqualToString:@"cooperate"]){ // 合作洽谈 }else if([sourceDict[@"type"] isEqualToString:@"setting"]){ // 系统设置 YOUPAIBBSettingVC* setting = [[YOUPAIBBSettingVC alloc]init]; setting.youpaipinfoModel = [LCSaveModel getUserModel].youpaipuserinfo; [weakSelf.navigationController pushViewController:setting animated:YES]; } } }; } return _bottomView; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.section == 0) { NSInteger count = self.youpaipdataSource.count; NSInteger rowCount = count%4 == 0? count/4:count/4+1; if ((self.youpaipdataSource.count%4) != 0) { rowCount+=1; } return rowCount*WHScreenEqualWidth(93); }else{ return self.youpaipdataSourceTableView.count*71+20; } } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return 1; } -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ return 2; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.section == 0) { NSString *cellID = @"YOUPAIProfileContentCell"; YOUPAIProfileContentCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; cell = [[YOUPAIProfileContentCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; cell.vqupaipdataArr = self.youpaipdataSource; @weakify(self) [cell setVqupaipDidSelectBlock:^(NSString * _Nonnull title) { @strongify(self) [self youpaifgoPageWithType:title]; }]; [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; return cell; }else{ // 最底部的cell NSMutableDictionary *cellData = self.youpaipdataSourceTableView[indexPath.row]; NSString *cellID = @"YOUPAILZProfileMenuItemCell"; YOUPAILZProfileMenuItemCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; cell = [[YOUPAILZProfileMenuItemCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; cell.youpaipimgV.image = [cellData valueForKey:@"image"]; cell.youpaiptextL.text = [cellData valueForKey:@"title"]; cell.youpaiplz_accessoryType = [[cellData valueForKey:@"accessoryType"] integerValue]; cell.youpaiprightLabel.text = [cellData valueForKey:@"rightText"]; cell.youpaipsubTextL.text = @""; cell.youpaipisShow = cellData[@"redView"]; if ([cellData.allKeys containsObject:@"subTitle"]) { cell.youpaipsubTextL.text = cellData[@"subTitle"]; } @weakify(self) [cell setVqupaipDidSelectBlock:^(NSString * _Nonnull title) { @strongify(self) [self youpaifgoPageWithType:title]; }]; cell.countArr = self.youpaipdataSourceTableView; return cell; } return nil; } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return CGFLOAT_MIN; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ return CGFLOAT_MIN; } - (void)youpaifgoPageWithType:(NSString *)type{ if ([type isEqualToString:@"unions"]) { YOUPAILZUnionsPopularizeVC *unions = [[YOUPAILZUnionsPopularizeVC alloc]init]; [self.navigationController pushViewController:unions animated:YES]; }else if ([type isEqualToString:@"wallet"]) { YOUPAIXRWalletVC *wallet = [[YOUPAIXRWalletVC alloc]init]; [self.navigationController pushViewController:wallet animated:YES]; }else if ([type isEqualToString:@"invite"]){ // YOUPAILCInviteVC *invite = [[YOUPAILCInviteVC alloc]init]; // [self.navigationController pushViewController:invite animated:YES]; ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init]; vc.contentUrl = self.youpaipinviteUrl; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"mine_beibao"]){ YOUPAILZBaseBackpackVC *invite = [[YOUPAILZBaseBackpackVC alloc]init]; [self.navigationController pushViewController:invite animated:YES]; }else if ([type isEqualToString:@"my_face"]){ YOUPAILCBaseInfo *userinfo = [LCSaveModel getUserModel].youpaipuserinfo; if (userinfo.youpaipgender == 1){//女 if (userinfo.youpaipis_auth ==1) {//成功 YOUPAILZLiveVerifyResultVC *vc = [[YOUPAILZLiveVerifyResultVC alloc] init]; vc.youpaipstate = LZLiveVerifyStateWithSuccess; [self.navigationController pushViewController:vc animated:YES]; }else if (userinfo.youpaipis_auth ==2){//失败 YOUPAILZLiveVerifyResultVC *vc = [[YOUPAILZLiveVerifyResultVC alloc] init]; vc.youpaipstate = LZLiveVerifyStateWithInError; [self.navigationController pushViewController:vc animated:YES]; @weakify(self) [vc setDidReviewClickBlock:^{ @strongify(self) [self youpaifrealNameAuthentication]; }]; } else{ @weakify(self); YOUPAILCBigCastProtocolVC* vc = [[YOUPAILCBigCastProtocolVC alloc]init]; [vc setAgreeProtocolBlock:^{ @strongify(self); [self youpaifrealNameAuthentication]; }]; [self.navigationController pushViewController:vc animated:YES]; } }else{//男 if (userinfo.youpaipis_auth == 1) { YOUPAILZLiveVerifyResultVC *vc = [[YOUPAILZLiveVerifyResultVC alloc] init]; vc.youpaipstate = LZLiveVerifyStateWithSuccess; [self.navigationController pushViewController:vc animated:YES]; }else{ YOUPAIRealPersonFaceVC *vc = [YOUPAIRealPersonFaceVC new]; [self.navigationController pushViewController:vc animated:YES]; } } }else if ([type isEqualToString:@"my_network"]){ YOUPAIMyNetworkVC *vc = [YOUPAIMyNetworkVC new]; vc.youpaipinviteUrl = self.youpaipinviteUrl; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"help"]){ NSString *urlStr; if ([LCSaveModel getUserModel].youpaipuserinfo.youpaipgender==1) { urlStr = [NSString stringWithFormat:@"%@%@",[LCSaveData getBaseURL]?[LCSaveData getBaseURL]:BaseURL,HelpBigCastH5]; }else{ urlStr = [NSString stringWithFormat:@"%@%@",[LCSaveData getBaseURL]?[LCSaveData getBaseURL]:BaseURL,HelpNormalH5]; } if([LCSaveData getIsspecial]){ urlStr = [NSString stringWithFormat:@"%@%@",[LCSaveData getBaseURL]?[LCSaveData getBaseURL]:BaseURL,HelpSpecialH5]; } ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init]; vc.contentUrl = urlStr; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"im_service"]){ ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init]; vc.contentUrl = self.youpaiphelpURL; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"big_cast"]){ if ([LCSaveModel getUserModel].youpaipuserinfo.youpaipis_anchor == 0) { YOUPAILCVerifyBigCastVC* verifyBigCast = [[YOUPAILCVerifyBigCastVC alloc]init]; [self.navigationController pushViewController:verifyBigCast animated:YES]; }else{ YOUPAILCBigCastSetVC* bigCast = [[YOUPAILCBigCastSetVC alloc]init]; [self.navigationController pushViewController:bigCast animated:YES]; } }else if([type isEqualToString:@"beauty_set"]){ LPBeautySetVC* beautySet = [[LPBeautySetVC alloc]init]; //modify by leo fix ios13 bug beautySet.modalPresentationStyle =0; [self.navigationController presentViewController:beautySet animated:YES completion:^{ }]; }else if([type isEqualToString:@"set"]){ YOUPAILCSettingVC* setting = [[YOUPAILCSettingVC alloc]init]; [self.navigationController pushViewController:setting animated:YES]; }else if([type isEqualToString:@"vip"]){ YOUPAILZVipVC* setting = [[YOUPAILZVipVC alloc]init]; [self.navigationController pushViewController:setting animated:YES]; }else if([type isEqualToString:@"personalizedDress"]){ YOUPAILZPersonalizedDressVC* vc = [[YOUPAILZPersonalizedDressVC alloc]init]; [self.navigationController pushViewController:vc animated:YES]; }else if([type isEqualToString:@"my_badge"]){ YOUPAILZBadgeVC *vc = [[YOUPAILZBadgeVC alloc] init]; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"guild"]){//公会中心 if (self.youpaipguild ==0) {//0:未加入公会;1:已加入公会;2:已加入公会会长 YOUPAIHRGuildCenterSearchVC *vc = [YOUPAIHRGuildCenterSearchVC new]; [self.navigationController pushViewController:vc animated:YES]; }else{ YOUPAIHRGuildCenterDetailVC *vc = [YOUPAIHRGuildCenterDetailVC new]; vc.youpaipguild = self.youpaipguild; [self.navigationController pushViewController:vc animated:YES]; } } else if([type isEqualToString:@"vqu_images_ic_my_young"]){ YOUPAILPYoungSettingVC* setting = [[YOUPAILPYoungSettingVC alloc]init]; [self.navigationController pushViewController:setting animated:YES]; }else if ([type isEqualToString:@"weiguigongbu"]){ ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init]; vc.contentUrl = self.youpaipweiguiUrl; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"gameCertification"]) { YOUPAILZGameListVC *vc = [[YOUPAILZGameListVC alloc] init]; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"gameAccompany"]){ YOUPAILZGameAccompanyListVC *vc = [[YOUPAILZGameAccompanyListVC alloc] init]; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"vqu_images_P_mine_Set"]){ YOUPAILCSettingVC* setting = [[YOUPAILCSettingVC alloc]init]; setting.youpaipinfoModel = [LCSaveModel getUserModel].youpaipuserinfo; [self.navigationController pushViewController:setting animated:YES]; }else if ([type isEqualToString:@"sendRank"]){ YOUPAIHRsendRankVC *vc = [YOUPAIHRsendRankVC new]; [self.navigationController pushViewController:vc animated:YES ]; }else if([type isEqualToString:@"Host_settings"]){ YOUPAIBigCastSettingVC *vc = [[YOUPAIBigCastSettingVC alloc] init]; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"Task"]){ [UMengRecordTool umengEventCountWithId:TaskCenter]; ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init]; vc.contentUrl = self.youpaiptaskCenterUrl; [self.navigationController pushViewController:vc animated:YES]; }else if ([type isEqualToString:@"zhangdan"]){ // 我的账单 NSLog(@"asdasdads"); } } /// 阿里实名认证 - (void)youpaifrealNameAuthentication{ [UCAuthorityManager cameraAuthority:^{ YMCustomCameraViewModel *customCameraVM = [[YMCustomCameraViewModel alloc]initWithParams:@{}]; [YMRouter openURL:stringFormat(@"%@%@",YM_ROUTER_URL_PREFIX,YM_ROUTER_CUSTOM_CAMERA) withUserInfo:@{ RouterViewModel:customCameraVM } completion:nil]; } denied:^{ YMTipsPopupView *customView = [[YMTipsPopupView alloc]init]; [customView configutationWithTips:@"请在iphone的“设置-隐私-相机”选项中,允许APP访问您的相机。" TipsAlignment:NSTextAlignmentCenter IsHideTitle:NO IsHideSingleButton:NO]; YMPopupView *popupView = [YMPopupView initWithCustomView:customView parentView:[YMGlobalUtils getCurrentVC].view popStyle:YMPopupStyleFade dismissStyle:YMDismissStyleFade]; popupView.priority = 999; popupView.cornerRadius = adapt(10); popupView.rectCorners = UIRectCornerAllCorners; popupView.positionStyle = YMPositionStyleCenter; popupView.isHideBg = NO; popupView.bgAlpha = 0.3; @weakify(popupView) customView.buttonBlock = ^(BOOL isConfirm) { @strongify(popupView) if (isConfirm) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil]; } [popupView dismissWithStyle:YMDismissStyleFade duration:2.0]; }; [popupView pop]; }]; // [LCHttpHelper requestWithURLString:GetLiveVerifyToken parameters:@{} needToken:YES type:HttpRequestTypePost success:^(id responseObject) { // NSDictionary* dict = (NSDictionary*)responseObject; // NSInteger code = [[dict objectForKey:@"code"] integerValue]; // if (code == 0) { // NSString *token = dict[@"data"][@"VerifyToken"]; // NSString *BizId = dict[@"data"][@"BizId"]; // [weakSelf youpaifpushToAliSdk:token BizId:BizId]; // // }else{ // // [ZCHUDHelper showTitle:[dict objectForKey:@"message"]]; // } // // // // } failure:^(NSError *error) { // [ZCHUDHelper showTitle:error.localizedDescription]; // // }]; } -(void)youpaifpushToAliSdk:(NSString*)token BizId:(NSString*)bizIdStr{ RPConfiguration *configuration = [RPConfiguration configuration]; NSString *filePath1 = [[NSBundle mainBundle] pathForResource:@"RPCustomUI" ofType:@"bundle"]; configuration.customUIPath = filePath1; [RPSDK startWithVerifyToken:token viewController:self configuration:configuration completion:^(RPResult * _Nonnull result) { NSLog(@"实人认证结果:%@==%@", result,result.message); switch (result.state) { case RPStatePass: // 认证通过。 [self youpaifpostBizId:bizIdStr]; break; case RPStateFail: // 认证不通过。 [ZCHUDHelper showTitle:@"认证失败,请重新认证"]; break; case RPStateNotVerify: // 未认证。 // 通常是用户主动退出或者姓名身份证号实名校验不匹配等原因导致。 // 具体原因可通过result.errorCode来区分(详见文末错误码说明表格)。 break; } }]; } -(void)youpaifpostBizId:(NSString*)ID{ NSMutableDictionary *dict = [NSMutableDictionary new]; [dict setObject:ID forKey:@"BizId"]; WeakSelf; [LCHttpHelper requestWithURLString:LiveVerifyTokenSuccess parameters:dict needToken:YES type:HttpRequestTypePost success:^(id responseObject) { NSDictionary* dict = (NSDictionary*)responseObject; NSInteger code = [[dict objectForKey:@"code"] integerValue]; if (code == 0) { YOUPAILZLiveVerifyResultVC *vc = [[YOUPAILZLiveVerifyResultVC alloc] init]; vc.youpaipstate = LZLiveVerifyStateWithInReview; vc.youpaipcontent_str = [dict objectForKey:@"message"]; [weakSelf.navigationController pushViewController:vc animated:YES]; }else{ [ZCHUDHelper showTitle:[dict objectForKey:@"message"]]; } } failure:^(NSError *error) { [ZCHUDHelper showTitle:error.localizedDescription]; }]; } - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ CGFloat y = scrollView.contentOffset.y; if(y > 0){ self.youpaipavatarImgV.mj_y = 0; self.youpaipavatarImgV.transform = CGAffineTransformMakeScale(1.0f, 1.0f); }else{ y = -y; CGFloat scale = y / kHeaderViewHeight; self.youpaipavatarImgV.mj_y = -y; self.youpaipavatarImgV.transform = CGAffineTransformMakeScale(1.0f + scale, 1.0f + scale); } } - (void)youpaifcheckSetting{ if ([LCTools canShowNoticationTip]) { UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings]; if (UIUserNotificationTypeNone == setting.types) { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:@"您的系统关闭了相语欢颜的通知提醒,会导致您错过重要的视频通话,需要您前往打开通知" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action){ }]; UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action){ NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; if ([[UIApplication sharedApplication] canOpenURL:url]) { [[UIApplication sharedApplication] openURL:url]; } }]; [alertController addAction:cancelAction]; [alertController addAction:okAction]; [self presentViewController:alertController animated:YES completion:nil]; } } } - (void)youpaifcheckAppraise{//盈利大于1000提示 if (@available(iOS 10.3, *)) { if ([LCTools canShowAppraise]) {//判断时间 一个月只弹一次 if([SKStoreReviewController respondsToSelector:@selector(requestReview)]){ [SKStoreReviewController requestReview]; } } } } - (void)youpaifrefreshData{ [LCHttpHelper requestWithURLString:UserCenter parameters:nil needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) { NSDictionary* dict = (NSDictionary*)responseObject; NSInteger code = [[dict objectForKey:@"code"] integerValue]; if (code==0) {//成功 NSDictionary *anchor = [[dict objectForKey:@"data"]objectForKey:@"anchor"]; NSDictionary *info = [[dict objectForKey:@"data"]objectForKey:@"userinfo"]; if ([[anchor allKeys] containsObject:@"open_video_status"]) { if ([[anchor objectForKey:@"open_video_status"] integerValue] == 0) {//0 未开启 1 已开启 [LCSaveData saveVideoOpenStatu:NO]; }else{ [LCSaveData saveVideoOpenStatu:YES]; } } NSInteger guild = [[[dict objectForKey:@"data"]objectForKey:@"guild"] integerValue]; self.youpaipguild = guild; if ([[anchor allKeys] containsObject:@"order_switch"]) { if ([[anchor objectForKey:@"order_switch"] integerValue] == 1) {//1隐藏 2不隐藏 [LCSaveData saveOrderOpenStatu:YES]; }else{ [LCSaveData saveOrderOpenStatu:NO]; } } if ([[info allKeys] containsObject:@"is_msg_refuse"]) { if ([[info objectForKey:@"is_msg_refuse"] integerValue] == 1) {//1开启 0关闭 [LCSaveData saveProfileWuraoStatus:YES]; }else{ [LCSaveData saveProfileWuraoStatus:NO]; } } if ([[[dict objectForKey:@"data"] allKeys] containsObject:@"webUrl"]) { self.youpaipweiguiUrl = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"publish"]]; self.youpaipinviteUrl = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"share"]]; self.youpaiphelpURL = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"help"]]; self.youpaiptaskCenterUrl = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"taskCenter"]]; NSString *myGrade = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"myGrade"]]; self.youpaipheaderView.youpaipmyGrade = myGrade; } YOUPAILCBaseInfo* userinfo = [YOUPAILCBaseInfo mj_objectWithKeyValues:[[dict objectForKey:@"data"]objectForKey:@"userinfo"]]; self.is_complete_info = [dict[@"data"][@"is_complete_info"] intValue]; if (userinfo.youpaipalbum_list_new.count>0) { NSMutableArray *arrm = [NSMutableArray new]; [userinfo.youpaipalbum_list_new enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { album_list_newModel *model = [album_list_newModel mj_objectWithKeyValues:obj]; [arrm addObject:model]; }]; userinfo.youpaipalbum_list_new = arrm; } YOUPAIHRReddotModel *dotModel = [YOUPAIHRReddotModel mj_objectWithKeyValues:[[dict objectForKey:@"data"]objectForKey:@"red_dot"]]; self.youpaipdotModel = dotModel; YOUPAILCUserModel* userModel = [LCSaveModel getUserModel]; userModel.youpaipuserinfo = userinfo; [LCSaveModel saveUserModel:userModel]; [self.youpaipheaderView youpaifreloadUserInfoWithModel:userModel]; [self.youpaipavatarImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:[LCSaveModel getUserModel].youpaipuserinfo.youpaipavatar]]; YOUPAILCUserCountModel* userCount = [YOUPAILCUserCountModel mj_objectWithKeyValues:[[dict objectForKey:@"data"]objectForKey:@"usercount"]]; [self.youpaipheaderView youpaifreloadUserRedDotModel:dotModel]; [self.youpaipheaderView youpaifreloadCountWithModel:userCount]; [self.youpaipheaderView youpaifreloadUserLevelModel:[YOUPAILZLiveCardModel mj_objectWithKeyValues:[[dict objectForKey:@"data"]objectForKey:@"gr"]]]; [self youpaifreloadDataSource]; } } failure:^(NSError *error) { }]; [LCHttpHelper requestWithURLString:WalletInit parameters:nil needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) { NSDictionary* dict = (NSDictionary*)responseObject; NSInteger code = [[dict objectForKey:@"code"] integerValue]; if (code==0) {//成功 CGFloat coin = [[[[dict objectForKey:@"data"]objectForKey:@"account"]objectForKey:@"coin"]integerValue]; NSString *income_coin = [[[dict objectForKey:@"data"]objectForKey:@"account"]objectForKey:@"income_coin_money"]; [self.youpaipheaderView youpaifreloadAccountWithBalance:coin profit:income_coin]; } } failure:^(NSError *error) { }]; } - (void)youpaifopenDontDisturb{ NSString *status = [LCSaveData getProfileWuraoStatus] ? @"0" : @"1"; [LCHttpHelper requestWithURLString:SetWuRaoStatus parameters:@{@"is_msg_refuse":status} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) { NSDictionary* dict = (NSDictionary*)responseObject; NSInteger code = [[dict objectForKey:@"code"] integerValue]; if (code==0) { if ([status isEqualToString:@"1"]) { [ZCHUDHelper showTitle:@"打开勿打扰"]; [LCSaveData saveProfileWuraoStatus:YES]; // [self.youpaiptableView reloadData]; }else{ [ZCHUDHelper showTitle:@"关闭勿打扰"]; [LCSaveData saveProfileWuraoStatus:NO]; // [self.youpaiptableView reloadData]; } } } failure:^(NSError *error) { }]; } - (void)youpaifvideoSwitchValueChange:(UIButton*)switchView{ NSInteger status = 0; if (switchView.selected == NO) {//将状态置为1空闲 status = 0; }else{ status = 1; } [LCHttpHelper requestWithURLString:BigCastSetVideoStatus parameters:@{@"status":@(status)} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) { NSDictionary* dict = (NSDictionary*)responseObject; NSInteger code = [[dict objectForKey:@"code"] integerValue]; if (code==0) { if (status==0) { [ZCHUDHelper showTitle:@"关闭视频"]; [LCSaveData saveVideoOpenStatu:NO]; }else{ [ZCHUDHelper showTitle:@"打开视频"]; [LCSaveData saveVideoOpenStatu:YES]; } } // [self.youpaiptableView reloadData]; } failure:^(NSError *error) { }]; } @end