diff --git a/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard b/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard index c900993..d7b114a 100644 --- a/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard @@ -1,5 +1,5 @@ - - + + @@ -882,29 +882,29 @@ - + + - + - + - + + + + @@ -926,6 +926,11 @@ + + + + + diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift index ed26a5a..5db8cd1 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift @@ -19,6 +19,7 @@ class UserViewController: UIViewController { var sectionList:[String] = ["历史记录","我的"] var isCloseHistoryList:Bool = false var isCloseMyResource:Bool = false + var user = AppDelegate.instance().accountManager override func viewDidLoad() { super.viewDidLoad() self.configTheme() @@ -32,8 +33,8 @@ class UserViewController: UIViewController { func setUserInfor(){ userPhoto.layer.cornerRadius = userPhoto.frame.size.height/2 userPhoto.layer.masksToBounds = true - userName.text = AppDelegate.instance().accountManager.name() - userPhoto.sd_setImage(with: URL(string: AppDelegate.instance().accountManager.photo()), placeholderImage: #imageLiteral(resourceName: "defphoto.png")) + userName.text = user.name() + userPhoto.sd_setImage(with: URL(string: user.photo()), placeholderImage: #imageLiteral(resourceName: "defphoto.png")) } @@ -41,11 +42,16 @@ class UserViewController: UIViewController { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } - @IBAction func userEditClcik(_ sender: Any) { - let vc = Story.instantiateViewControllerWithIdentifier("UserEditViewControllerVC", storyName: "User") as! UserEditViewController - vc.title = "个人信息" - self.navigationController?.pushViewController(vc, animated: true) + if user.isOnline(){ + let vc = Story.instantiateViewControllerWithIdentifier("UserEditViewControllerVC", storyName: "User") as! UserEditViewController + vc.title = "个人信息" + self.navigationController?.pushViewController(vc, animated: true) + }else{ + let vc=Story.instantiateViewControllerWithIdentifier("NewLoginViewControllerVC", storyName: "Login") as! NewLoginViewController + self.present(vc, animated: true, completion: nil) + } + } func editBtnClick(){ @@ -102,7 +108,9 @@ extension UserViewController:UITableViewDelegate,UITableViewDataSource{ } func numberOfSections(in tableView: UITableView) -> Int { - + if user.roletype() == 3 || user.roletype() == 4 || user.roletype() == 5{ + return 1 + } return sectionList.count } -- libgit2 0.21.0