Commit 04fab79372e59b48f6d4cfa111619ffbb2831caf
1 parent
63fbe41b
Exists in
newLive
no message
Showing
6 changed files
with
52 additions
and
10 deletions
Show diff stats
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) { |
... | ... | @@ -110,6 +110,24 @@ class ChangePassWordViewController: UIViewController { |
110 | 110 | |
111 | 111 | @IBAction func sendUserCodeBtnClick(_ sender: UIButton) { |
112 | 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 | 131 | var phone = "" |
114 | 132 | if user.isOnline(){ |
115 | 133 | phone = user.phone() |
... | ... | @@ -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 | 184 | // MARK: - 销毁通知 |
162 | 185 | deinit { |
163 | 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 | 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
YouerLiveVideo/YouerLiveVideo/util/account.swift