Commit 0321081483033f5d1569c7120c0838fa438370ac

Authored by 王军波
1 parent 9d9e5128

直播前先判断是否已登录

LiveVideoCloud/AppCustoms/Base/BaseViewController.m
... ... @@ -67,7 +67,7 @@
67 67 negativeSpacer.width = -8;//默认leftItemX == 18,要求距左边10
68 68 [self.navigationItem setLeftBarButtonItems:[NSArray arrayWithObjects:negativeSpacer,backItem, nil]];
69 69  
70   - if (self.navigationController.viewControllers[0] == self) {
  70 + if ((self.navigationController.viewControllers[0] == self) && (self.isModalButton == NO)) {
71 71 _btnLeft.hidden = YES;
72 72 }
73 73 }
... ...
LiveVideoCloud/AppCustoms/Main/ZXTabBarController.m
... ... @@ -12,6 +12,7 @@
12 12 #import "LVCLiveViewController.h"
13 13 #import "LVCMineViewController.h"
14 14 #import "LVCTabBar.h"
  15 +#import "LoginViewController.h"
15 16  
16 17 #import "LVCMineViewController.h"//
17 18  
... ... @@ -81,16 +82,23 @@
81 82  
82 83 -(void)liveBtnClick:(LVCTabBar *)tabBar
83 84 {
84   -// if ([UserTools isLogin]) {
  85 +
  86 + // 判断用户是否登录
  87 + if ([UserTools isLogin]) {
  88 +
85 89 LVCLiveViewController *liveCtrl = [[LVCLiveViewController alloc] init];
86 90 ZXNavigationController *nav = [[ZXNavigationController alloc] initWithRootViewController:liveCtrl];
87 91 [self presentViewController:nav animated:YES completion:nil];
88   -// }else {
89   -// LoginViewController *loginCtrl = [[LoginViewController alloc] init];
  92 +
  93 + } else {
  94 +
  95 + LoginViewController *loginCtrl = [[LoginViewController alloc] init];
90 96 // ZXNavigationController *navCtrl = [[ZXNavigationController alloc] initWithRootViewController:loginCtrl];
91   -// loginCtrl.isModalButton = YES;
92   -// [self presentViewController:navCtrl animated:YES completion:NULL];
93   -// }
  97 + UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:loginCtrl];
  98 + loginCtrl.isModalButton = YES;
  99 + [self presentViewController:navCtrl animated:YES completion:NULL];
  100 +
  101 + }
94 102  
95 103 }
96 104  
... ...
LiveVideoCloud/Classes/Sections/LiveSections/Controller/LVCLiveViewController.m
... ... @@ -15,6 +15,7 @@
15 15 #import "LVCUGCLiveEndView.h"
16 16 #import "LVCVerifyLiveAuthService.h"
17 17 #import "LVCVerifyViewController.h"
  18 +#import "LoginViewController.h"
18 19  
19 20 @interface LVCLiveViewController ()<UIGestureRecognizerDelegate, UIAlertViewDelegate, UINavigationControllerDelegate> {
20 21  
... ... @@ -50,6 +51,7 @@
50 51  
51 52 self.navigationController.delegate = self;
52 53 self.view.backgroundColor = [UIColor whiteColor];
  54 +
53 55 [self verifyLiveAuthority];
54 56 }
55 57  
... ...
LiveVideoCloud/Classes/Sections/Mine/Login/Controller/LoginViewController.m
... ... @@ -96,7 +96,11 @@
96 96 }
97 97 [SVProgressHUD dismiss];
98 98 [UserTools setLocalUserInfo:chinaCoin withKey:count];
99   - [self.navigationController popViewControllerAnimated:YES];
  99 + if(self.isModalButton) {
  100 + [self dismissViewControllerAnimated:YES completion:NULL];
  101 + } else {
  102 + [self.navigationController popViewControllerAnimated:YES];
  103 + }
100 104 }];
101 105  
102 106 } else {
... ... @@ -141,6 +145,7 @@
141 145 }
142 146  
143 147  
  148 +
144 149 #pragma mark - touchesBegan
145 150 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
146 151 {
... ...