Commit 57fd0481eeb7601fc2cfdb681ded58027880c59f
Exists in
newLive
Merge branch 'newLive' of http://git.shunzhi.net/iosgroup/newlive into newLive
Showing
7 changed files
with
85 additions
and
30 deletions
Show diff stats
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 | 3 | <device id="retina4_7" orientation="portrait"> |
4 | 4 | <adaptation id="fullscreen"/> |
5 | 5 | </device> |
... | ... | @@ -882,29 +882,29 @@ |
882 | 882 | <nil key="textColor"/> |
883 | 883 | <nil key="highlightedColor"/> |
884 | 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 | 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 | 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 | 892 | </subviews> |
897 | 893 | <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> |
894 | + <gestureRecognizers/> | |
898 | 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 | 897 | <constraint firstAttribute="height" constant="90" id="OgG-Ww-2w0"/> |
901 | 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 | 900 | <constraint firstItem="Nqw-kl-w72" firstAttribute="centerY" secondItem="bvl-OP-Mho" secondAttribute="centerY" id="lw6-Jl-KC5"/> |
904 | 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 | 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 | 904 | </constraints> |
905 | + <connections> | |
906 | + <outletCollection property="gestureRecognizers" destination="i8h-9p-4Aq" appends="YES" id="kqd-2i-ljL"/> | |
907 | + </connections> | |
908 | 908 | </view> |
909 | 909 | </subviews> |
910 | 910 | <color key="backgroundColor" red="0.89713114500000002" green="0.89431768659999999" blue="0.90413767099999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
... | ... | @@ -926,6 +926,11 @@ |
926 | 926 | </connections> |
927 | 927 | </viewController> |
928 | 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 | 934 | </objects> |
930 | 935 | <point key="canvasLocation" x="1205.5999999999999" y="2112.5937031484259"/> |
931 | 936 | </scene> | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/TVStation/SearchTVStationListViewController.swift
... | ... | @@ -133,6 +133,13 @@ extension SearchTVStationListViewController:UITableViewDataSource,UITableViewDel |
133 | 133 | gradName.text = grad[indexPath.row] |
134 | 134 | sortDataSet(arr: dataSet,type: grad[indexPath.row]) |
135 | 135 | } |
136 | + if tableView == self.tableView{ | |
137 | + let item = dataDic[allKeys[indexPath.section]]![indexPath.row] | |
138 | + let vc = Story.instantiateViewControllerWithIdentifier("TVStationInforViewControllerVC", storyName: "TVStation") as! TVStationInforViewController | |
139 | + vc.TVStationProgram = item | |
140 | + vc.title = item.f_SchoolName | |
141 | + self.navigationController?.pushViewController(vc, animated: true) | |
142 | + } | |
136 | 143 | } |
137 | 144 | |
138 | 145 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard
... | ... | @@ -323,7 +323,7 @@ |
323 | 323 | <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> |
324 | 324 | </view> |
325 | 325 | <prototypes> |
326 | - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" rowHeight="84" id="MMn-tR-I0v" customClass="SearchTVStationListCell" customModule="YouerLiveVideo" customModuleProvider="target"> | |
326 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="cell" rowHeight="84" id="MMn-tR-I0v" customClass="SearchTVStationListCell" customModule="YouerLiveVideo" customModuleProvider="target"> | |
327 | 327 | <rect key="frame" x="0.0" y="28" width="375" height="84"/> |
328 | 328 | <autoresizingMask key="autoresizingMask"/> |
329 | 329 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="MMn-tR-I0v" id="H7d-Zz-WAS"> | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/User/Setting/ChangePassWordViewController.swift
... | ... | @@ -23,7 +23,7 @@ class ChangePassWordViewController: UIViewController { |
23 | 23 | @IBOutlet weak var userCodeTextFiled: UITextField! |
24 | 24 | |
25 | 25 | @IBOutlet var cancleItem: UIBarButtonItem! |
26 | - | |
26 | + var timer:Timer! | |
27 | 27 | var scrollViewH:CGFloat = 200 |
28 | 28 | var user = AppDelegate.instance().accountManager |
29 | 29 | @IBAction func editKeyboard(_ sender: Any) { |
... | ... | @@ -111,6 +111,24 @@ class ChangePassWordViewController: UIViewController { |
111 | 111 | |
112 | 112 | @IBAction func sendUserCodeBtnClick(_ sender: UIButton) { |
113 | 113 | self.view.endEditing(true) |
114 | + var num = 0 | |
115 | + if #available(iOS 10.0, *) { | |
116 | + self.timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true, block: { (timers) in | |
117 | + if num == 60{ | |
118 | + sender.titleLabel?.text = "获取验证码" | |
119 | + sender.isUserInteractionEnabled = true | |
120 | + sender.backgroundColor = UIColorFromRGB(0x007aff) | |
121 | + self.timer.invalidate() | |
122 | + return | |
123 | + } | |
124 | + sender.setTitle("重新获取(\(60-num))", for: .normal) | |
125 | + sender.isUserInteractionEnabled = false | |
126 | + sender.backgroundColor = UIColor.lightGray | |
127 | + num += 1 | |
128 | + }) | |
129 | + } else { | |
130 | + // Fallback on earlier versions | |
131 | + } | |
114 | 132 | var phone = "" |
115 | 133 | if user.isOnline(){ |
116 | 134 | phone = user.phone() |
... | ... | @@ -159,6 +177,11 @@ class ChangePassWordViewController: UIViewController { |
159 | 177 | } |
160 | 178 | } |
161 | 179 | } |
180 | + | |
181 | + override func viewWillDisappear(_ animated: Bool) { | |
182 | + timer.invalidate() | |
183 | + timer = nil | |
184 | + } | |
162 | 185 | // MARK: - 销毁通知 |
163 | 186 | deinit { |
164 | 187 | NotificationCenter.default.removeObserver(self) | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/User/User.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"> | |
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"> | |
3 | 3 | <device id="retina4_7" orientation="portrait"> |
4 | 4 | <adaptation id="fullscreen"/> |
5 | 5 | </device> |
... | ... | @@ -315,8 +315,8 @@ |
315 | 315 | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YjI-UW-Ova"> |
316 | 316 | <rect key="frame" x="0.0" y="150" width="375" height="50"/> |
317 | 317 | <subviews> |
318 | - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入您收到的验证码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="dtg-hq-Nhp"> | |
319 | - <rect key="frame" x="20" y="16" width="246" height="19"/> | |
318 | + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入您收到的验证码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="dtg-hq-Nhp"> | |
319 | + <rect key="frame" x="20" y="16" width="241" height="19"/> | |
320 | 320 | <nil key="textColor"/> |
321 | 321 | <fontDescription key="fontDescription" type="system" pointSize="14"/> |
322 | 322 | <textInputTraits key="textInputTraits" keyboardType="numberPad"/> |
... | ... | @@ -334,10 +334,14 @@ |
334 | 334 | <nil key="textColor"/> |
335 | 335 | <nil key="highlightedColor"/> |
336 | 336 | </label> |
337 | - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="i2a-hL-oad"> | |
338 | - <rect key="frame" x="274" y="10" width="85" height="30"/> | |
337 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="i2a-hL-oad"> | |
338 | + <rect key="frame" x="269" y="11" width="90" height="28"/> | |
339 | 339 | <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/> |
340 | - <state key="normal" title=" 获取验证码 "> | |
340 | + <constraints> | |
341 | + <constraint firstAttribute="width" constant="90" id="8cP-zC-Gtl"/> | |
342 | + </constraints> | |
343 | + <fontDescription key="fontDescription" type="system" pointSize="13"/> | |
344 | + <state key="normal" title="获取验证码"> | |
341 | 345 | <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> |
342 | 346 | </state> |
343 | 347 | <userDefinedRuntimeAttributes> |
... | ... | @@ -356,7 +360,7 @@ |
356 | 360 | <constraint firstAttribute="height" constant="50" id="FXG-ec-5Cr"/> |
357 | 361 | <constraint firstAttribute="trailing" secondItem="i2a-hL-oad" secondAttribute="trailing" constant="16" id="G4t-LR-wkT"/> |
358 | 362 | <constraint firstItem="i2a-hL-oad" firstAttribute="centerY" secondItem="YjI-UW-Ova" secondAttribute="centerY" id="Qy3-FK-b2B"/> |
359 | - <constraint firstItem="i2a-hL-oad" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="dtg-hq-Nhp" secondAttribute="trailing" constant="8" id="Wxn-1V-gz8"/> | |
363 | + <constraint firstItem="i2a-hL-oad" firstAttribute="leading" secondItem="dtg-hq-Nhp" secondAttribute="trailing" constant="8" id="Wxn-1V-gz8"/> | |
360 | 364 | <constraint firstItem="dtg-hq-Nhp" firstAttribute="centerY" secondItem="YjI-UW-Ova" secondAttribute="centerY" id="a8d-eK-VXu"/> |
361 | 365 | <constraint firstItem="dtg-hq-Nhp" firstAttribute="leading" secondItem="YjI-UW-Ova" secondAttribute="leading" constant="20" id="bpj-hN-bZ1"/> |
362 | 366 | <constraint firstAttribute="trailing" secondItem="lFa-PY-Lg1" secondAttribute="trailing" constant="16" id="lvB-uj-jjc"/> | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift
... | ... | @@ -19,6 +19,7 @@ class UserViewController: UIViewController { |
19 | 19 | var sectionList:[String] = ["历史记录","我的"] |
20 | 20 | var isCloseHistoryList:Bool = false |
21 | 21 | var isCloseMyResource:Bool = false |
22 | + var user = AppDelegate.instance().accountManager | |
22 | 23 | override func viewDidLoad() { |
23 | 24 | super.viewDidLoad() |
24 | 25 | self.configTheme() |
... | ... | @@ -32,8 +33,8 @@ class UserViewController: UIViewController { |
32 | 33 | func setUserInfor(){ |
33 | 34 | userPhoto.layer.cornerRadius = userPhoto.frame.size.height/2 |
34 | 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 | 42 | super.didReceiveMemoryWarning() |
42 | 43 | // Dispose of any resources that can be recreated. |
43 | 44 | } |
44 | - | |
45 | 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 | 57 | func editBtnClick(){ |
... | ... | @@ -102,6 +108,9 @@ extension UserViewController:UITableViewDelegate,UITableViewDataSource{ |
102 | 108 | } |
103 | 109 | |
104 | 110 | func numberOfSections(in tableView: UITableView) -> Int { |
111 | + if user.roletype() == 3 || user.roletype() == 4 || user.roletype() == 5{ | |
112 | + return 1 | |
113 | + } | |
105 | 114 | return sectionList.count |
106 | 115 | } |
107 | 116 | ... | ... |
YouerLiveVideo/YouerLiveVideo/util/account.swift