Commit 04fab79372e59b48f6d4cfa111619ffbb2831caf

Authored by 左丞
1 parent 63fbe41b
Exists in newLive

no message

YouerLiveVideo/YouerLiveVideo/controllers/TVStation/SearchTVStationListViewController.swift
@@ -133,6 +133,13 @@ extension SearchTVStationListViewController:UITableViewDataSource,UITableViewDel @@ -133,6 +133,13 @@ extension SearchTVStationListViewController:UITableViewDataSource,UITableViewDel
133 gradName.text = grad[indexPath.row] 133 gradName.text = grad[indexPath.row]
134 sortDataSet(arr: dataSet,type: grad[indexPath.row]) 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 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 145 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard
@@ -323,7 +323,7 @@ @@ -323,7 +323,7 @@
323 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> 323 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
324 </view> 324 </view>
325 <prototypes> 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 <rect key="frame" x="0.0" y="28" width="375" height="84"/> 327 <rect key="frame" x="0.0" y="28" width="375" height="84"/>
328 <autoresizingMask key="autoresizingMask"/> 328 <autoresizingMask key="autoresizingMask"/>
329 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="MMn-tR-I0v" id="H7d-Zz-WAS"> 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,7 +23,7 @@ class ChangePassWordViewController: UIViewController {
23 @IBOutlet weak var userCodeTextFiled: UITextField! 23 @IBOutlet weak var userCodeTextFiled: UITextField!
24 24
25 @IBOutlet var cancleItem: UIBarButtonItem! 25 @IBOutlet var cancleItem: UIBarButtonItem!
26 - 26 + var timer:Timer!
27 var scrollViewH:CGFloat = 200 27 var scrollViewH:CGFloat = 200
28 var user = AppDelegate.instance().accountManager 28 var user = AppDelegate.instance().accountManager
29 @IBAction func editKeyboard(_ sender: Any) { 29 @IBAction func editKeyboard(_ sender: Any) {
@@ -110,6 +110,24 @@ class ChangePassWordViewController: UIViewController { @@ -110,6 +110,24 @@ class ChangePassWordViewController: UIViewController {
110 110
111 @IBAction func sendUserCodeBtnClick(_ sender: UIButton) { 111 @IBAction func sendUserCodeBtnClick(_ sender: UIButton) {
112 self.view.endEditing(true) 112 self.view.endEditing(true)
  113 + var num = 0
  114 + if #available(iOS 10.0, *) {
  115 + self.timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true, block: { (timers) in
  116 + if num == 60{
  117 + sender.titleLabel?.text = "获取验证码"
  118 + sender.isUserInteractionEnabled = true
  119 + sender.backgroundColor = UIColorFromRGB(0x007aff)
  120 + self.timer.invalidate()
  121 + return
  122 + }
  123 + sender.setTitle("重新获取(\(60-num))", for: .normal)
  124 + sender.isUserInteractionEnabled = false
  125 + sender.backgroundColor = UIColor.lightGray
  126 + num += 1
  127 + })
  128 + } else {
  129 + // Fallback on earlier versions
  130 + }
113 var phone = "" 131 var phone = ""
114 if user.isOnline(){ 132 if user.isOnline(){
115 phone = user.phone() 133 phone = user.phone()
@@ -158,6 +176,11 @@ class ChangePassWordViewController: UIViewController { @@ -158,6 +176,11 @@ class ChangePassWordViewController: UIViewController {
158 } 176 }
159 } 177 }
160 } 178 }
  179 +
  180 + override func viewWillDisappear(_ animated: Bool) {
  181 + timer.invalidate()
  182 + timer = nil
  183 + }
161 // MARK: - 销毁通知 184 // MARK: - 销毁通知
162 deinit { 185 deinit {
163 NotificationCenter.default.removeObserver(self) 186 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 <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>
@@ -315,8 +315,8 @@ @@ -315,8 +315,8 @@
315 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YjI-UW-Ova"> 315 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YjI-UW-Ova">
316 <rect key="frame" x="0.0" y="150" width="375" height="50"/> 316 <rect key="frame" x="0.0" y="150" width="375" height="50"/>
317 <subviews> 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 <nil key="textColor"/> 320 <nil key="textColor"/>
321 <fontDescription key="fontDescription" type="system" pointSize="14"/> 321 <fontDescription key="fontDescription" type="system" pointSize="14"/>
322 <textInputTraits key="textInputTraits" keyboardType="numberPad"/> 322 <textInputTraits key="textInputTraits" keyboardType="numberPad"/>
@@ -334,10 +334,14 @@ @@ -334,10 +334,14 @@
334 <nil key="textColor"/> 334 <nil key="textColor"/>
335 <nil key="highlightedColor"/> 335 <nil key="highlightedColor"/>
336 </label> 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 <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/> 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 <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> 345 <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
342 </state> 346 </state>
343 <userDefinedRuntimeAttributes> 347 <userDefinedRuntimeAttributes>
@@ -356,7 +360,7 @@ @@ -356,7 +360,7 @@
356 <constraint firstAttribute="height" constant="50" id="FXG-ec-5Cr"/> 360 <constraint firstAttribute="height" constant="50" id="FXG-ec-5Cr"/>
357 <constraint firstAttribute="trailing" secondItem="i2a-hL-oad" secondAttribute="trailing" constant="16" id="G4t-LR-wkT"/> 361 <constraint firstAttribute="trailing" secondItem="i2a-hL-oad" secondAttribute="trailing" constant="16" id="G4t-LR-wkT"/>
358 <constraint firstItem="i2a-hL-oad" firstAttribute="centerY" secondItem="YjI-UW-Ova" secondAttribute="centerY" id="Qy3-FK-b2B"/> 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 <constraint firstItem="dtg-hq-Nhp" firstAttribute="centerY" secondItem="YjI-UW-Ova" secondAttribute="centerY" id="a8d-eK-VXu"/> 364 <constraint firstItem="dtg-hq-Nhp" firstAttribute="centerY" secondItem="YjI-UW-Ova" secondAttribute="centerY" id="a8d-eK-VXu"/>
361 <constraint firstItem="dtg-hq-Nhp" firstAttribute="leading" secondItem="YjI-UW-Ova" secondAttribute="leading" constant="20" id="bpj-hN-bZ1"/> 365 <constraint firstItem="dtg-hq-Nhp" firstAttribute="leading" secondItem="YjI-UW-Ova" secondAttribute="leading" constant="20" id="bpj-hN-bZ1"/>
362 <constraint firstAttribute="trailing" secondItem="lFa-PY-Lg1" secondAttribute="trailing" constant="16" id="lvB-uj-jjc"/> 366 <constraint firstAttribute="trailing" secondItem="lFa-PY-Lg1" secondAttribute="trailing" constant="16" id="lvB-uj-jjc"/>
YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift
@@ -102,6 +102,7 @@ extension UserViewController:UITableViewDelegate,UITableViewDataSource{ @@ -102,6 +102,7 @@ extension UserViewController:UITableViewDelegate,UITableViewDataSource{
102 } 102 }
103 103
104 func numberOfSections(in tableView: UITableView) -> Int { 104 func numberOfSections(in tableView: UITableView) -> Int {
  105 +
105 return sectionList.count 106 return sectionList.count
106 } 107 }
107 108
YouerLiveVideo/YouerLiveVideo/util/account.swift
@@ -90,6 +90,13 @@ class AccountManager{ @@ -90,6 +90,13 @@ class AccountManager{
90 } 90 }
91 return false 91 return false
92 } 92 }
  93 +
  94 + func roletype()->Int{
  95 + if let info=rawUserInfo{
  96 + return info.contentData()["roletype"].intValue
  97 + }
  98 + return 0
  99 + }
93 100
94 101
95 func logOut(){ 102 func logOut(){