123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595 |
- //
- // ChatHomeVC.m
- // smartRhino
- //
- // Created by niuzhen on 2020/10/14.
- // Copyright © 2020 tederen. All rights reserved.
- //
- #import "ChatHomeVC.h"
- #import "GHRefreshCollectionView.h"
- #import "MyTDGroupView.h"
- #import "WorkNumberModel.h"
- #import "ChatMsgCollectionCell.h"
- #import "YCMenuView.h"
- #import "ShowNewGroupAlert.h"
- #import "ChatMsgListVC.h"
- #import "SWQRCodeViewController.h"
- #import "ChatNewGroupVC.h"
- #import "MailListDetailVC.h"
- #import "ChatJoinGroupVC.h"
- #import "TDGroupInfoListVC.h"
- #import "TDQrJoinVC.h"
- #import "LoginPCVC.h"
- #import "ChatMsgTopSearchVC.h"
- #import "TDInterLeterHomeViewController.h"
- #import "ReplayMeVC.h"
- #import "ChatTestingVC.h"
- #import "MailListVC.h"
- #import "ChatMsgEditVC.h"
- @interface ChatHomeVC ()<UICollectionViewDelegate,UICollectionViewDataSource,SWQRCodeViewControllerDelegate>
- @property (nonatomic, strong) UILabel *titleL;
- @property (nonatomic, strong) UIButton *addBtn;
- @property (nonatomic, strong) UIView *headView;
- @property (nonatomic, strong) GHRefreshCollectionView *collectionView;
- @property (assign, nonatomic) NSInteger unReadCount;
- @property (strong, nonatomic) MyTDGroupView *SearchView;
- @property (strong, nonatomic) WorkNumberModel *numModel;
- @property (strong, nonatomic) NSMutableArray *collectionDataSource;
- @property (strong, nonatomic) NSMutableArray *ImArray;
- @property (strong, nonatomic) NSMutableArray *taskActionArray;
- @property (strong, nonatomic) ChatMsgListVC *chatVC;
- @end
- @implementation ChatHomeVC
- - (void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
- [self getUnreadCount];
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.fd_prefersNavigationBarHidden = YES;
- [self loadStatusBarColor:[UIColor whiteColor]];
- [self.view addSubview:self.titleL];
- [self.view addSubview:self.addBtn];
- [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.statusBar.mas_bottom);
- make.left.right.equalTo(self.view);
- make.height.equalTo(@44);
- }];
- [self.addBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(self.statusBar.mas_bottom);
- make.right.mas_offset(-10);
- make.size.mas_offset(CGSizeMake(44, 44));
- }];
- WS(weakSelf);
- [self.addBtn setAction:^{
- NSMutableArray *menuDataSourceArray = [weakSelf getMenuDataSource:weakSelf.taskActionArray];
- YCMenuView *view = [YCMenuView menuWithActions:menuDataSourceArray width:106 relyonView:weakSelf.addBtn];
- view.menuColor = RGB(255, 255, 255);
- view.separatorColor = RGB(234, 234, 234);
- view.textColor = RGB(102, 102, 102);
- view.textFont = [UIFont systemFontOfSize:16.0];
- view.menuCellHeight = 43.5;
- view.maxDisplayCount = 10;
- view.offset = - 6;
- [view show];
- }];
- [self addHeadView];
- [self setCusPageVC];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moveAction) name:CHATMOVESUCCESS object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PushSettingVC:) name:DRAWERPUSHVC object:nil];
- }
- - (void)PushSettingVC:(NSNotification *)notification
- {
- NSInteger index = [[notification.userInfo objectForKey:VCINDEX] integerValue];
- if (index == 0) {
- TDInterLeterHomeViewController *vc = [TDInterLeterHomeViewController initChatMsgNoticeVC];
- vc.hidesBottomBarWhenPushed = YES;
- vc.interLeterFolderId = 0;
- vc.isHome = YES;
- [self.navigationController pushViewController:vc animated:NO];
- }
- }
- - (BOOL)hidesBottomBarWhenPushed
- {
- [self.tabBarController.tabBar setHidden:NO];
- return NO;
- }
- - (void)moveAction
- {
- [self.chatVC headRefresh];
- }
- - (void)dealloc
- {
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- }
- - (void)addHeadView
- {
- UIView * lineV = [UIView new];
- lineV.backgroundColor = UIColorHex(0xEAEAEA);
- [self.headView addSubview:lineV];
- [self.headView addSubview:self.SearchView];
- [self.headView addSubview:self.collectionView];
- [lineV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.bottom.mas_equalTo(self.headView);
- make.height.mas_offset(0.5);
- }];
- [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.mas_equalTo(self.headView);
- make.bottom.mas_equalTo(lineV.mas_top);
- make.height.mas_offset(69);
- }];
- [self.SearchView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_offset(5);
- make.left.right.mas_equalTo(self.headView);
- make.bottom.mas_equalTo(self.collectionView.mas_top);
- }];
- WS(weakSelf);
- [self.SearchView.button setAction:^{
- ChatMsgTopSearchVC *vc = [[ChatMsgTopSearchVC alloc] init];
- vc.hidesBottomBarWhenPushed = YES;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- }
- -(NSMutableArray *)collectionDataSource{
- if(!_collectionDataSource){
- _collectionDataSource = [[NSMutableArray alloc] init];
- }
- return _collectionDataSource;
- }
- -(NSMutableArray *)ImArray{
- if(!_ImArray){
- _ImArray = [[NSMutableArray alloc] init];
- }
- return _ImArray;
- }
- -(NSMutableArray *)taskActionArray{
- if(!_taskActionArray){
- _taskActionArray = [[NSMutableArray alloc] initWithObjects:@"建文件夹",@"批量编辑",@"新建群聊",@"扫一扫", nil];
- }
- return _taskActionArray;
- }
- - (UILabel *)titleL
- {
- if (!_titleL) {
- _titleL = [UILabel new];
- _titleL.text = @"消息";
- _titleL.font = [UIFont systemFontOfSize:16.f];
- _titleL.textColor = UIColorHex(1A1A1A);
- _titleL.textAlignment = NSTextAlignmentCenter;
- }
- return _titleL;
- }
- - (UIButton *)addBtn
- {
- if (!_addBtn) {
- _addBtn = [UIButton new];
- [_addBtn setImage:IMG(@"chatmsg_right_add_icon") forState:UIControlStateNormal];
- }
- return _addBtn;
- }
- - (UIView *)headView
- {
- if (!_headView) {
- _headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 115.5)];
- _headView.backgroundColor = [UIColor whiteColor];
- }
- return _headView;
- }
- - (MyTDGroupView *)SearchView
- {
- if (!_SearchView) {
- _SearchView = [[MyTDGroupView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
- }
- return _SearchView;
- }
- - (void)setCusPageVC
- {
- CGFloat height = SCREEN_HEIGHT - NAVH - self.tabBarController.tabBar.frame.size.height;
- WS(weakSelf);
- NSMutableArray * data = [NSMutableArray array];
- NSMutableArray * vcArr = [NSMutableArray array];
- self.chatVC = [[ChatMsgListVC alloc] init];
- [data addObject:@""];
- [vcArr addObject:self.chatVC];
- WMZPageParam *param = PageParam()
- .wTitleArrSet(data)
- .wControllersSet(vcArr)
- //固定在所有子控制器底部 需要放在第一个控制器里 例如此例子
- .wFixFirstSet(YES)
- //悬浮开启
- .wTopSuspensionSet(YES)
- //等分
- .wTopOffsetSet(NAVH)
- .wFromNaviSet(YES)
- .wMenuAnimalSet(PageTitleMenuNone)
- .wMenuTitleFontSet(15.f)
- .wMenuTitleSelectColorSet(UIColorHex(0x3979D3))
- .wMenuIndicatorYSet(0.f)
- .wMenuIndicatorColorSet(UIColorHex(0x3979D3))
- .wMenuTitleColorSet(UIColorHex(0x666666))
- .wMenuTitleSelectFontSet(15.f)
- .wMenuFixShadowSet(NO)
- .wMenuFixRightDataSet(@" ")
- .wMenuFixWidthSet(0)
- .wNoMenuSet(YES)
- .wScrollCanTransferSet(NO)
- //头部
- .wMenuHeadViewSet(^UIView *{
- return self.headView;
- });
- self.param = param;
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- dispatch_async(dispatch_get_main_queue(), ^{
- for (UIView * view in weakSelf.view.subviews) {
- if ([view isKindOfClass:[WMZPageScroller class]]) {
- [view setFrame:CGRectMake(0, NAVH, SCREEN_WIDTH, height)];
- }
- if ([view isKindOfClass:[UIScrollView class]]) {
- UIScrollView * sView = (UIScrollView *)view;
- sView.showsVerticalScrollIndicator = NO;
- }
- }
- });
- });
- }
- -(NSMutableArray *)getMenuDataSource:(NSMutableArray *)titleArray{
- NSMutableArray *menuDataSourceArray = [[NSMutableArray alloc] init];
- for(int i=0;i<titleArray.count;i++){
- NSString *titleStr = [titleArray objectAtIndex:i];
- WS(weakSelf);
- YCMenuAction *actionMenu = [YCMenuAction actionWithTitle:titleStr image:nil handler:^(YCMenuAction *action) {
- if([@"建文件夹" isEqualToString:action.title]){
- [[ShowNewGroupAlert initShowNewGroupAlertWithTitle:@"建文件夹" placeholder:@"请输入文件夹名称" confirm:^(NSString * _Nonnull groupName) {
- NSLog(@"%@",groupName);
- NSDictionary * paraDict = @{@"FolderName":groupName,
- @"UserId":@([AppUserModel sharedAppUserModel].Id),
- @"ParentId":@(0),
- @"TypeId":@(10)
- };
- [[HttpManager sharedHttpManager] PUTUrl:Host(APP_Middle_Add_Folder) parameters:paraDict responseStyle:JOSN success:^(id _Nonnull responseObject) {
- [weakSelf.chatVC headRefresh];
- } failure:^(NSError * _Nonnull error) {
- NSLog(@"%@",error);
- SHOWERROR([ZYCTool handerResultData:error])
- }];
- } cancle:^{
- }] show];
- }
- else if ([@"批量编辑" isEqualToString:action.title]){
- [weakSelf.chatVC pushEditVC];
- }
- else if ([@"新建群聊" isEqualToString:action.title]){
- ChatNewGroupVC *vc = [ChatNewGroupVC initChatNewGroupVC];
- vc.upDataBlock = ^{
- [weakSelf.chatVC headRefresh];
- };
- vc.hidesBottomBarWhenPushed = YES;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }else if ([@"扫一扫" isEqualToString:action.title]){
- [weakSelf scanAction];
- }
- }];
- [menuDataSourceArray addObject:actionMenu];
- }
- return menuDataSourceArray;
- }
- - (GHRefreshCollectionView *)collectionView {
- if (!_collectionView) {
- UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
- layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
- layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
- _collectionView = [[GHRefreshCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
- _collectionView.delegate = self;
- _collectionView.dataSource = self;
- _collectionView.showsHorizontalScrollIndicator = NO;
- [_collectionView registerNib:[UINib nibWithNibName:@"ChatMsgCollectionCell" bundle:nil] forCellWithReuseIdentifier:@"ChatMsgCollectionCell"];
- _collectionView.backgroundColor = [UIColor whiteColor];
- }
- return _collectionView;
- }
- - (void)getUnreadCount
- {
- WS(weakSelf);
- [[HttpManager sharedHttpManager] GETUrl:Host(API_APP_User_User_Uread_Count) parameters:@{} responseStyle:JOSN success:^(id _Nonnull responseObject) {
- NSDictionary *dic = responseObject;
- weakSelf.numModel = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
- dispatch_async(dispatch_get_main_queue(), ^{
- weakSelf.numModel.UReadChatCount = weakSelf.numModel.UReadChatCount + weakSelf.unReadCount;
- NSInteger count = weakSelf.numModel.allNumber + weakSelf.numModel.UReadChatCount;
- // weakSelf.tabBarController.tabBar.items[2].badgeValue = count > 0 ? [NSString stringWithFormat:@"%ld",(long)count] : nil;
- [weakSelf initCollectionData:weakSelf.numModel];
- });
- } failure:^(NSError * _Nonnull error) {
- }];
- }
- -(void)initCollectionData:(WorkNumberModel *)numModel{
- [self.collectionDataSource removeAllObjects];
- NSMutableArray * array = [NSMutableArray array];
- for (int i= 0;i < 4; i++) {
- MoreAppInfoModel *model = [[MoreAppInfoModel alloc] init];
- switch (i) {
- case 0:{
- model.title = @"收件箱";
- model.imgName = @"chat_shou_icon";
- model.notImgName = @"chat_shou_icon";
- model.type = ChatMenuZhanXinType;
- model.readNum = numModel.FlowAuditUReadCount + numModel.FlowSendUReadCount + numModel.FlowCcUReadCount + numModel.noticeCount + numModel.missiveCount;
- model.showEditFlag = YES;
- }break;
- case 1:{
- model.title = @"回复我的";
- model.imgName = @"chat_replay_icon";
- model.notImgName = @"chat_replay_icon";
- model.type = ChatMenuReplayType;
- model.readNum = 0;
- model.showEditFlag = YES;
- }break;
- case 2:{
- model.title = @"验证消息";
- model.imgName = @"chat_verify_icon";
- model.notImgName = @"chat_verify_icon";
- model.type = ChatMenuVerifyType;
- model.readNum = 0;
- model.showEditFlag = YES;
- }break;
- default:{
- model.title = @"通讯录";
- model.imgName = @"chat_maillist_icon";
- model.notImgName = @"chat_maillist_icon";
- model.type = ChatMenuTeleListType;
- model.readNum = 0;
- model.showEditFlag = YES;
- }break;
- }
- [array addObject:model];
- }
- self.collectionDataSource = array;
- [self.collectionView reloadData];
- }
- #pragma mark -UICollectionViewDataSource
- /**********************************************************************/
- - (NSInteger)collectionView:(GHRefreshCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
- return self.collectionDataSource.count;
- }
- - (UICollectionViewCell *)collectionView:(GHRefreshCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
- {
- MoreAppInfoModel *bean = [self.collectionDataSource objectAtIndex:indexPath.item];
- ChatMsgCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ChatMsgCollectionCell" forIndexPath:indexPath];
- cell.cell0IconImg.image = [UIImage imageNamed:bean.imgName];
- cell.cell0TitleLabel.text = bean.title;
- cell.imagH.constant = 25.f;
- cell.imagW.constant = 25.f;
- switch (bean.type) {
- case ChatMenuNoticeType:
- {
- NSString * count = [NSString stringWithFormat:@"%ld",bean.readNum];
- cell.cell0ReadNumLabel.text = count;
- cell.cell0ReadNumLabel.hidden = bean.readNum > 0 ? NO : YES;
- UILabel * label = [UILabel new];
- label.font = [UIFont systemFontOfSize:12];
- label.text = count;
- CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
- if ((width + 5) < 16) {
- cell.constant.constant = 16;
- }else{
- cell.constant.constant = width + 8;
- }
- }
- break;
- case ChatMenuZhanXinType:
- {
- NSString * count = [NSString stringWithFormat:@"%ld",bean.readNum];
- cell.cell0ReadNumLabel.text = count;
- cell.cell0ReadNumLabel.hidden = bean.readNum > 0 ? NO : YES;
- UILabel * label = [UILabel new];
- label.font = [UIFont systemFontOfSize:12];
- label.text = count;
- CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
- if ((width + 5) < 16) {
- cell.constant.constant = 16;
- }else{
- cell.constant.constant = width + 8;
- }
- }
- break;
- case ChatMenuWaitType:
- {
- NSString * count = [NSString stringWithFormat:@"%ld",bean.readNum];
- cell.cell0ReadNumLabel.text = count;
- cell.cell0ReadNumLabel.hidden = bean.readNum > 0 ? NO : YES;
- UILabel * label = [UILabel new];
- label.font = [UIFont systemFontOfSize:12];
- label.text = count;
- CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
- if ((width + 5) < 16) {
- cell.constant.constant = 16;
- }else{
- cell.constant.constant = width + 8;
- }
- }
- break;
- default:
- {
- NSString * count = [NSString stringWithFormat:@"%ld",bean.readNum];
- cell.cell0ReadNumLabel.text = count;
- cell.cell0ReadNumLabel.hidden = bean.readNum > 0 ? NO : YES;
- }
- break;
- }
- cell.cell0MengCengView.hidden = YES;
- return cell;
- }
- /****************************************************/
- #pragma mark --UICollectionViewDelegateFlowLayout
- /****************************************************/
- - (CGSize)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
- {
- CGFloat width = (SCREEN_WIDTH - 20) / self.collectionDataSource.count;
- CGFloat height = 69;
- return CGSizeMake(width, height);
- }
- -(UIEdgeInsets)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
- {
- CGFloat W = 10;
- return UIEdgeInsetsMake(0,W,0,W);
- }
- - (CGFloat)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
- return 0;
- }
- - (CGFloat)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{
- return 0;
- }
- - (void)collectionView:(GHRefreshCollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
- [collectionView deselectItemAtIndexPath:indexPath animated:YES];
- MoreAppInfoModel * model = [self.collectionDataSource objectAtIndex:indexPath.item];
- switch (model.type) {
- case ChatMenuZhanXinType:{
- TDInterLeterHomeViewController *vc = [TDInterLeterHomeViewController initChatMsgNoticeVC];
- vc.hidesBottomBarWhenPushed = YES;
- vc.interLeterFolderId = 0;
- vc.isHome = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case ChatMenuReplayType:{
- ReplayMeVC *vc = [ReplayMeVC initReplayMeVC];
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case ChatMenuVerifyType:{
- ChatTestingVC *vc = [ChatTestingVC initChatTestingVC];
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case ChatMenuTeleListType:{
- MailListVC * vc = [MailListVC initMailListVC];
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- default:
- break;
- }
- }
- #pragma mark - buttonAction
- - (void)scanAction{
- SWQRCodeConfig *config = [[SWQRCodeConfig alloc]init];
- config.scannerType = SWScannerTypeBoth;
- SWQRCodeViewController *qrcodeVC = [[SWQRCodeViewController alloc]init];
- qrcodeVC.codeConfig = config;
- qrcodeVC.delegate = self;
- qrcodeVC.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:qrcodeVC animated:YES];
- }
- #pragma mark - 扫一扫结果
- - (void)scanResult:(NSString *)scanStr{
- ScanResultModel *model = [[ScanResultModel alloc]initWithString:scanStr error:nil];
- NSLog(@"%@",model);
- WEAKSELF
- switch (model.key) {
- case 1:// 用户
- {
- [self scanNetWork:model.value urlStrong:SaoYiSao_Post ScanKey:@"Guid" success:^(id responseObject) {
- NSDictionary *dic = responseObject;
- AddressUserModel *model = [[AddressUserModel alloc] initWithDictionary:dic error:nil];
- dispatch_async(dispatch_get_main_queue(), ^{
- MailListDetailVC *vc = [MailListDetailVC initMailListDetailVC];
- vc.indexId = model.Id;
- vc.isAdd = YES;
- vc.hidesBottomBarWhenPushed = YES;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- });
- } failure:^(NSError *error) {
- SHOWERROR([ZYCTool handerResultData:error]);
- }];
- }
- break;
- case 2:// 群聊
- {
- [self scanToNetWork:model.value urlStrong:SaoYiSao2_Post success:^(id responseObject) {
- ChatJoinGroupVC * vc = [ChatJoinGroupVC initChatJoinGroupVC];
- vc.dict = responseObject;
- vc.hidesBottomBarWhenPushed = YES;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- } failure:^(NSError *error) {
- SHOWERROR([ZYCTool handerResultData:error]);
- }];
- }
- break;
- case 3://小组
- {
- [self scanToNetWork:model.value urlStrong:SaoYiSao3_Post success:^(id responseObject) {
- if ([responseObject[@"IsUser"] boolValue]) {
- TDGroupInfoListVC * vc = [TDGroupInfoListVC initTDGroupInfoListVC];
- vc.GroupId = [responseObject[@"Id"] integerValue];
- vc.titleStr = responseObject[@"Name"];
- vc.hidesBottomBarWhenPushed = YES;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }else{
- dispatch_async(dispatch_get_main_queue(), ^{
- TDQrJoinVC * vc = [TDQrJoinVC initTDQrJoinVC];
- vc.dict = responseObject;
- vc.hidesBottomBarWhenPushed = YES;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- });
- }
- } failure:^(NSError *error) {
- SHOWERROR([ZYCTool handerResultData:error]);
- }];
- }
- break;
- case 4://扫码登录
- {
- LoginPCVC * vc = [LoginPCVC initLoginPCVC];
- vc.key = model.value;
- vc.modalPresentationStyle = UIModalPresentationFullScreen;
- [self presentViewController:vc animated:YES completion:^{
-
- }];
- }
- break;
- default:
- break;
- }
- }
- - (void)scanNetWork:(NSString *)scanStr urlStrong:(NSString *)urlstring ScanKey:(NSString*)key success:(void (^) (id responseObject))successful failure:(void (^) (NSError *error))failure{
- SHOWLOADING
- [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,urlstring] parameters:@{key:scanStr} responseStyle:JOSN success:^(id _Nonnull responseObject) {
- successful(responseObject);
- REMOVESHOW
- } failure:^(NSError * _Nonnull error) {
- REMOVESHOW
- failure(error);
- }];
- }
- - (void)scanToNetWork:(NSString *)scanStr urlStrong:(NSString *)urlstring success:(void (^) (id responseObject))successful failure:(void (^) (NSError *error))failure{
- SHOWLOADING
- NSString * url = [NSString stringWithFormat:@"%@%@",Host(urlstring),scanStr];
- [[HttpManager sharedHttpManager] GETUrl:url parameters:@{} success:^(id _Nonnull responseObject) {
- REMOVESHOW
- successful(responseObject);
- } failure:^(NSError * _Nonnull error) {
- REMOVESHOW
- }];
- }
- @end
|