Commit 092fe4e469374ecbf024bce339b849ef2f0ea834

Authored by 左丞
1 parent e10ed80e
Exists in newLive

no message

YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard
1 -<?xml version="1.0" encoding="UTF-8" standalone="no"?>  
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="fhe-aI-EYq"> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="fhe-aI-EYq">
3 <device id="retina4_7" orientation="portrait"> 3 <device id="retina4_7" orientation="portrait">
4 <adaptation id="fullscreen"/> 4 <adaptation id="fullscreen"/>
5 </device> 5 </device>
@@ -882,29 +882,29 @@ @@ -882,29 +882,29 @@
882 <nil key="textColor"/> 882 <nil key="textColor"/>
883 <nil key="highlightedColor"/> 883 <nil key="highlightedColor"/>
884 </label> 884 </label>
885 - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yK0-QJ-bRM">  
886 - <rect key="frame" x="337" y="30" width="30" height="30"/> 885 + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="arrow" translatesAutoresizingMaskIntoConstraints="NO" id="KJf-Wq-MZK">
  886 + <rect key="frame" x="350" y="37.5" width="9" height="15"/>
887 <constraints> 887 <constraints>
888 - <constraint firstAttribute="width" secondItem="yK0-QJ-bRM" secondAttribute="height" multiplier="1:1" id="3YU-P4-ctC"/>  
889 - <constraint firstAttribute="height" constant="30" id="HhD-eg-tVW"/> 888 + <constraint firstAttribute="width" secondItem="KJf-Wq-MZK" secondAttribute="height" multiplier="3:5" id="DmA-cs-Esw"/>
  889 + <constraint firstAttribute="height" constant="15" id="dNM-h3-8ef"/>
890 </constraints> 890 </constraints>
891 - <state key="normal" image="arrow"/>  
892 - <connections>  
893 - <action selector="userEditClcik:" destination="BZx-0y-T5Q" eventType="touchUpInside" id="KOe-u4-Y7x"/>  
894 - </connections>  
895 - </button> 891 + </imageView>
896 </subviews> 892 </subviews>
897 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> 893 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
  894 + <gestureRecognizers/>
898 <constraints> 895 <constraints>
899 - <constraint firstItem="yK0-QJ-bRM" firstAttribute="centerY" secondItem="bvl-OP-Mho" secondAttribute="centerY" id="8rD-kC-wG0"/> 896 + <constraint firstItem="KJf-Wq-MZK" firstAttribute="width" secondItem="KJf-Wq-MZK" secondAttribute="height" multiplier="3:5" id="2Hu-jz-CZx"/>
900 <constraint firstAttribute="height" constant="90" id="OgG-Ww-2w0"/> 897 <constraint firstAttribute="height" constant="90" id="OgG-Ww-2w0"/>
901 <constraint firstItem="brI-5l-hmz" firstAttribute="centerY" secondItem="bvl-OP-Mho" secondAttribute="centerY" id="YFV-yt-DAA"/> 898 <constraint firstItem="brI-5l-hmz" firstAttribute="centerY" secondItem="bvl-OP-Mho" secondAttribute="centerY" id="YFV-yt-DAA"/>
902 - <constraint firstAttribute="trailing" secondItem="yK0-QJ-bRM" secondAttribute="trailing" constant="8" id="hGo-7T-muV"/> 899 + <constraint firstItem="KJf-Wq-MZK" firstAttribute="centerY" secondItem="bvl-OP-Mho" secondAttribute="centerY" id="kP0-NM-qmk"/>
903 <constraint firstItem="Nqw-kl-w72" firstAttribute="centerY" secondItem="bvl-OP-Mho" secondAttribute="centerY" id="lw6-Jl-KC5"/> 900 <constraint firstItem="Nqw-kl-w72" firstAttribute="centerY" secondItem="bvl-OP-Mho" secondAttribute="centerY" id="lw6-Jl-KC5"/>
904 <constraint firstItem="Nqw-kl-w72" firstAttribute="leading" secondItem="brI-5l-hmz" secondAttribute="trailing" constant="16" id="unR-ks-0nT"/> 901 <constraint firstItem="Nqw-kl-w72" firstAttribute="leading" secondItem="brI-5l-hmz" secondAttribute="trailing" constant="16" id="unR-ks-0nT"/>
905 - <constraint firstItem="yK0-QJ-bRM" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Nqw-kl-w72" secondAttribute="trailing" constant="8" id="vhw-0q-WYU"/>  
906 <constraint firstItem="brI-5l-hmz" firstAttribute="leading" secondItem="bvl-OP-Mho" secondAttribute="leading" constant="16" id="xXW-xf-5Ra"/> 902 <constraint firstItem="brI-5l-hmz" firstAttribute="leading" secondItem="bvl-OP-Mho" secondAttribute="leading" constant="16" id="xXW-xf-5Ra"/>
  903 + <constraint firstAttribute="trailing" secondItem="KJf-Wq-MZK" secondAttribute="trailing" constant="16" id="zSb-gj-ga7"/>
907 </constraints> 904 </constraints>
  905 + <connections>
  906 + <outletCollection property="gestureRecognizers" destination="i8h-9p-4Aq" appends="YES" id="kqd-2i-ljL"/>
  907 + </connections>
908 </view> 908 </view>
909 </subviews> 909 </subviews>
910 <color key="backgroundColor" red="0.89713114500000002" green="0.89431768659999999" blue="0.90413767099999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> 910 <color key="backgroundColor" red="0.89713114500000002" green="0.89431768659999999" blue="0.90413767099999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -926,6 +926,11 @@ @@ -926,6 +926,11 @@
926 </connections> 926 </connections>
927 </viewController> 927 </viewController>
928 <placeholder placeholderIdentifier="IBFirstResponder" id="yJD-YG-4bQ" userLabel="First Responder" sceneMemberID="firstResponder"/> 928 <placeholder placeholderIdentifier="IBFirstResponder" id="yJD-YG-4bQ" userLabel="First Responder" sceneMemberID="firstResponder"/>
  929 + <tapGestureRecognizer id="i8h-9p-4Aq">
  930 + <connections>
  931 + <action selector="userEditClcik:" destination="BZx-0y-T5Q" id="ezQ-I2-0ca"/>
  932 + </connections>
  933 + </tapGestureRecognizer>
929 </objects> 934 </objects>
930 <point key="canvasLocation" x="1205.5999999999999" y="2112.5937031484259"/> 935 <point key="canvasLocation" x="1205.5999999999999" y="2112.5937031484259"/>
931 </scene> 936 </scene>
YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift
@@ -19,6 +19,7 @@ class UserViewController: UIViewController { @@ -19,6 +19,7 @@ class UserViewController: UIViewController {
19 var sectionList:[String] = ["历史记录","我的"] 19 var sectionList:[String] = ["历史记录","我的"]
20 var isCloseHistoryList:Bool = false 20 var isCloseHistoryList:Bool = false
21 var isCloseMyResource:Bool = false 21 var isCloseMyResource:Bool = false
  22 + var user = AppDelegate.instance().accountManager
22 override func viewDidLoad() { 23 override func viewDidLoad() {
23 super.viewDidLoad() 24 super.viewDidLoad()
24 self.configTheme() 25 self.configTheme()
@@ -32,8 +33,8 @@ class UserViewController: UIViewController { @@ -32,8 +33,8 @@ class UserViewController: UIViewController {
32 func setUserInfor(){ 33 func setUserInfor(){
33 userPhoto.layer.cornerRadius = userPhoto.frame.size.height/2 34 userPhoto.layer.cornerRadius = userPhoto.frame.size.height/2
34 userPhoto.layer.masksToBounds = true 35 userPhoto.layer.masksToBounds = true
35 - userName.text = AppDelegate.instance().accountManager.name()  
36 - userPhoto.sd_setImage(with: URL(string: AppDelegate.instance().accountManager.photo()), placeholderImage: #imageLiteral(resourceName: "defphoto.png")) 36 + userName.text = user.name()
  37 + userPhoto.sd_setImage(with: URL(string: user.photo()), placeholderImage: #imageLiteral(resourceName: "defphoto.png"))
37 38
38 } 39 }
39 40
@@ -41,11 +42,16 @@ class UserViewController: UIViewController { @@ -41,11 +42,16 @@ class UserViewController: UIViewController {
41 super.didReceiveMemoryWarning() 42 super.didReceiveMemoryWarning()
42 // Dispose of any resources that can be recreated. 43 // Dispose of any resources that can be recreated.
43 } 44 }
44 -  
45 @IBAction func userEditClcik(_ sender: Any) { 45 @IBAction func userEditClcik(_ sender: Any) {
46 - let vc = Story.instantiateViewControllerWithIdentifier("UserEditViewControllerVC", storyName: "User") as! UserEditViewController  
47 - vc.title = "个人信息"  
48 - self.navigationController?.pushViewController(vc, animated: true) 46 + if user.isOnline(){
  47 + let vc = Story.instantiateViewControllerWithIdentifier("UserEditViewControllerVC", storyName: "User") as! UserEditViewController
  48 + vc.title = "个人信息"
  49 + self.navigationController?.pushViewController(vc, animated: true)
  50 + }else{
  51 + let vc=Story.instantiateViewControllerWithIdentifier("NewLoginViewControllerVC", storyName: "Login") as! NewLoginViewController
  52 + self.present(vc, animated: true, completion: nil)
  53 + }
  54 +
49 } 55 }
50 56
51 func editBtnClick(){ 57 func editBtnClick(){
@@ -102,7 +108,9 @@ extension UserViewController:UITableViewDelegate,UITableViewDataSource{ @@ -102,7 +108,9 @@ extension UserViewController:UITableViewDelegate,UITableViewDataSource{
102 } 108 }
103 109
104 func numberOfSections(in tableView: UITableView) -> Int { 110 func numberOfSections(in tableView: UITableView) -> Int {
105 - 111 + if user.roletype() == 3 || user.roletype() == 4 || user.roletype() == 5{
  112 + return 1
  113 + }
106 return sectionList.count 114 return sectionList.count
107 } 115 }
108 116