Commit 3348440c40dfe5504c45f88aec576fedd6ba42a5
Exists in
newLive
Merge branch 'newLive' of http://git.shunzhi.net/iosgroup/newlive into newLive
# Conflicts: # YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/Login.storyboard # YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/NewLoginViewController.swift
Showing
10 changed files
with
54 additions
and
61 deletions
Show diff stats
YouerLiveVideo/YouerLiveVideo/controllers/HomePage/HomePage.storyboard
@@ -48,10 +48,7 @@ | @@ -48,10 +48,7 @@ | ||
48 | </constraints> | 48 | </constraints> |
49 | </imageView> | 49 | </imageView> |
50 | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ss9-IN-p7o"> | 50 | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ss9-IN-p7o"> |
51 | - <rect key="frame" x="331" y="0.0" width="44" height="44"/> | ||
52 | - <constraints> | ||
53 | - <constraint firstAttribute="width" constant="44" id="i7f-rP-uMp"/> | ||
54 | - </constraints> | 51 | + <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> |
55 | <connections> | 52 | <connections> |
56 | <action selector="openOrCloseAction:" destination="cns-vb-pIQ" eventType="touchUpInside" id="pnJ-fx-YyR"/> | 53 | <action selector="openOrCloseAction:" destination="cns-vb-pIQ" eventType="touchUpInside" id="pnJ-fx-YyR"/> |
57 | </connections> | 54 | </connections> |
@@ -66,6 +63,7 @@ | @@ -66,6 +63,7 @@ | ||
66 | <constraint firstAttribute="trailing" secondItem="ss9-IN-p7o" secondAttribute="trailing" id="aAO-V3-sgD"/> | 63 | <constraint firstAttribute="trailing" secondItem="ss9-IN-p7o" secondAttribute="trailing" id="aAO-V3-sgD"/> |
67 | <constraint firstItem="ss9-IN-p7o" firstAttribute="top" secondItem="ckB-W3-VJE" secondAttribute="top" id="bxF-ra-1Fc"/> | 64 | <constraint firstItem="ss9-IN-p7o" firstAttribute="top" secondItem="ckB-W3-VJE" secondAttribute="top" id="bxF-ra-1Fc"/> |
68 | <constraint firstItem="SaW-7O-OkT" firstAttribute="centerY" secondItem="ckB-W3-VJE" secondAttribute="centerY" id="ne0-jg-T5L"/> | 65 | <constraint firstItem="SaW-7O-OkT" firstAttribute="centerY" secondItem="ckB-W3-VJE" secondAttribute="centerY" id="ne0-jg-T5L"/> |
66 | + <constraint firstItem="ss9-IN-p7o" firstAttribute="leading" secondItem="ckB-W3-VJE" secondAttribute="leading" id="paD-hI-EiW"/> | ||
69 | <constraint firstItem="SaW-7O-OkT" firstAttribute="leading" secondItem="ckB-W3-VJE" secondAttribute="leading" constant="18" id="wS7-H2-6Hb"/> | 67 | <constraint firstItem="SaW-7O-OkT" firstAttribute="leading" secondItem="ckB-W3-VJE" secondAttribute="leading" constant="18" id="wS7-H2-6Hb"/> |
70 | </constraints> | 68 | </constraints> |
71 | </view> | 69 | </view> |
YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift
@@ -108,6 +108,7 @@ class MainHomeTableViewController: UITableViewController { | @@ -108,6 +108,7 @@ class MainHomeTableViewController: UITableViewController { | ||
108 | } | 108 | } |
109 | */ | 109 | */ |
110 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | 110 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
111 | + let user=AppDelegate.instance().accountManager | ||
111 | if indexPath.row==0{ | 112 | if indexPath.row==0{ |
112 | //排行 | 113 | //排行 |
113 | let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController | 114 | let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController |
@@ -118,7 +119,11 @@ class MainHomeTableViewController: UITableViewController { | @@ -118,7 +119,11 @@ class MainHomeTableViewController: UITableViewController { | ||
118 | self.tabBarController?.selectedIndex=2 | 119 | self.tabBarController?.selectedIndex=2 |
119 | }else if indexPath.row==2{ | 120 | }else if indexPath.row==2{ |
120 | //资源 | 121 | //资源 |
121 | - self.tabBarController?.selectedIndex=1 | 122 | + if user.isOnline() && (user.roletype()==1 || user.roletype()==2 || user.roletype()==6){ |
123 | + self.tabBarController?.selectedIndex=1 | ||
124 | + }else{ | ||
125 | + AppDelegate.instance().window?.makeToast("无权限查看资源") | ||
126 | + } | ||
122 | }else{ | 127 | }else{ |
123 | //校园电视台 | 128 | //校园电视台 |
124 | self.tabBarController?.selectedIndex=3 | 129 | self.tabBarController?.selectedIndex=3 |
@@ -345,11 +350,15 @@ class HomeThirdTableViewCell: UITableViewCell,UICollectionViewDelegate,UICollect | @@ -345,11 +350,15 @@ class HomeThirdTableViewCell: UITableViewCell,UICollectionViewDelegate,UICollect | ||
345 | } | 350 | } |
346 | } | 351 | } |
347 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | 352 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
353 | + let user=AppDelegate.instance().accountManager | ||
348 | //点击下载并打开资源文档 | 354 | //点击下载并打开资源文档 |
349 | - let download = DownLoad.share | ||
350 | - download.superVC = ((appRootViewController().childViewControllers[0] as! MViewController).selectedViewController as! UINavigationController).viewControllers[0] | ||
351 | - download.downLoadWithUrl(url: dataSet[indexPath.row].f_ResourceUrl) | ||
352 | - | 355 | + if user.isOnline() && (user.roletype()==1 || user.roletype()==2 || user.roletype()==6){ |
356 | + let download = DownLoad.share | ||
357 | + download.superVC = ((appRootViewController().childViewControllers[0] as! MViewController).selectedViewController as! UINavigationController).viewControllers[0] | ||
358 | + download.downLoadWithUrl(url: dataSet[indexPath.row].f_ResourceUrl) | ||
359 | + }else{ | ||
360 | + AppDelegate.instance().window?.makeToast("无权限查看资源") | ||
361 | + } | ||
353 | } | 362 | } |
354 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { | 363 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { |
355 | return CGSize(width: (getScreenWidth()-40)/3, height: (getScreenWidth()-40)/3+105.5) | 364 | return CGSize(width: (getScreenWidth()-40)/3, height: (getScreenWidth()-40)/3+105.5) |
YouerLiveVideo/YouerLiveVideo/controllers/LeadViewController.swift
@@ -8,7 +8,8 @@ | @@ -8,7 +8,8 @@ | ||
8 | 8 | ||
9 | import UIKit | 9 | import UIKit |
10 | 10 | ||
11 | -class LeadViewController: UIViewController { | 11 | +class LeadViewController: UIViewController,UITabBarControllerDelegate { |
12 | + let user=AppDelegate.instance().accountManager | ||
12 | static var instance:LeadViewController! | 13 | static var instance:LeadViewController! |
13 | override func viewDidLoad() { | 14 | override func viewDidLoad() { |
14 | super.viewDidLoad() | 15 | super.viewDidLoad() |
@@ -20,9 +21,22 @@ class LeadViewController: UIViewController { | @@ -20,9 +21,22 @@ class LeadViewController: UIViewController { | ||
20 | // showLogin() | 21 | // showLogin() |
21 | // } | 22 | // } |
22 | } | 23 | } |
24 | + func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { | ||
25 | + if user.isOnline() && (user.roletype()==1 || user.roletype()==2 || user.roletype()==6){ | ||
26 | + return true | ||
27 | + }else{ | ||
28 | + if viewController.title=="资源"{ | ||
29 | + AppDelegate.instance().window?.makeToast("无权限查看资源") | ||
30 | + return false | ||
31 | + }else{ | ||
32 | + return true | ||
33 | + } | ||
34 | + } | ||
35 | + } | ||
23 | func showMain() { | 36 | func showMain() { |
24 | removeAll() | 37 | removeAll() |
25 | - let vc=Story.instantiateViewControllerWithIdentifier("MViewController", storyName: "Main")! | 38 | + let vc=Story.instantiateViewControllerWithIdentifier("MViewController", storyName: "Main") as! MViewController |
39 | + vc.delegate=self | ||
26 | displayContentController(content: vc) | 40 | displayContentController(content: vc) |
27 | } | 41 | } |
28 | func showLogin() { | 42 | func showLogin() { |
YouerLiveVideo/YouerLiveVideo/controllers/MViewController.swift
@@ -22,7 +22,6 @@ class MViewController: UITabBarController { | @@ -22,7 +22,6 @@ class MViewController: UITabBarController { | ||
22 | tabBar.barTintColor=UIColor.white | 22 | tabBar.barTintColor=UIColor.white |
23 | tabBarController?.tabBar.isHidden=true | 23 | tabBarController?.tabBar.isHidden=true |
24 | } | 24 | } |
25 | - | ||
26 | override func didReceiveMemoryWarning() { | 25 | override func didReceiveMemoryWarning() { |
27 | super.didReceiveMemoryWarning() | 26 | super.didReceiveMemoryWarning() |
28 | } | 27 | } |
YouerLiveVideo/YouerLiveVideo/controllers/User/Setting/ChangePassWordViewController.swift
@@ -22,29 +22,22 @@ class ChangePassWordViewController: UIViewController { | @@ -22,29 +22,22 @@ class ChangePassWordViewController: UIViewController { | ||
22 | @IBOutlet weak var agrenPasswordTextFiled: UITextField! | 22 | @IBOutlet weak var agrenPasswordTextFiled: UITextField! |
23 | @IBOutlet weak var userCodeTextFiled: UITextField! | 23 | @IBOutlet weak var userCodeTextFiled: UITextField! |
24 | 24 | ||
25 | - @IBOutlet var cancleItem: UIBarButtonItem! | ||
26 | var timer:Timer! | 25 | var timer:Timer! |
27 | var scrollViewH:CGFloat = 200 | 26 | var scrollViewH:CGFloat = 200 |
28 | var user = AppDelegate.instance().accountManager | 27 | var user = AppDelegate.instance().accountManager |
29 | @IBAction func editKeyboard(_ sender: Any) { | 28 | @IBAction func editKeyboard(_ sender: Any) { |
30 | self.view.endEditing(true) | 29 | self.view.endEditing(true) |
31 | } | 30 | } |
32 | - | ||
33 | - @IBAction func cancleAction(_ sender: UIBarButtonItem) { | ||
34 | - self.dismiss(animated: true, completion: nil) | ||
35 | - } | ||
36 | override func viewDidLoad() { | 31 | override func viewDidLoad() { |
37 | super.viewDidLoad() | 32 | super.viewDidLoad() |
38 | if user.isOnline() { | 33 | if user.isOnline() { |
39 | self.title="密码修改" | 34 | self.title="密码修改" |
40 | - self.navigationItem.rightBarButtonItem=nil | ||
41 | phonrView.isHidden=true | 35 | phonrView.isHidden=true |
42 | phoneViewHeight.constant=0 | 36 | phoneViewHeight.constant=0 |
43 | scrollViewH=150 | 37 | scrollViewH=150 |
44 | }else{ | 38 | }else{ |
45 | self.configTheme() | 39 | self.configTheme() |
46 | self.title="忘记密码" | 40 | self.title="忘记密码" |
47 | - self.navigationItem.rightBarButtonItem=cancleItem | ||
48 | phonrView.isHidden=false | 41 | phonrView.isHidden=false |
49 | phoneViewHeight.constant=50 | 42 | phoneViewHeight.constant=50 |
50 | scrollViewH=200 | 43 | scrollViewH=200 |
@@ -94,10 +87,8 @@ class ChangePassWordViewController: UIViewController { | @@ -94,10 +87,8 @@ class ChangePassWordViewController: UIViewController { | ||
94 | httpJsonResule(jsonString: str, error: error, successHandler: { (json) in | 87 | httpJsonResule(jsonString: str, error: error, successHandler: { (json) in |
95 | if !self.user.isOnline() { | 88 | if !self.user.isOnline() { |
96 | NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshLoginUser"), object: phone) | 89 | NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshLoginUser"), object: phone) |
97 | - self.dismiss(animated: true, completion: nil) | ||
98 | - }else{ | ||
99 | - self.navigationController!.popViewController(animated: true) | ||
100 | } | 90 | } |
91 | + self.navigationController!.popViewController(animated: true) | ||
101 | AppDelegate.instance().window?.makeToast("修改成功") | 92 | AppDelegate.instance().window?.makeToast("修改成功") |
102 | }, failHandler: { (error) in | 93 | }, failHandler: { (error) in |
103 | self.view.makeToast("修改失败") | 94 | self.view.makeToast("修改失败") |
@@ -111,7 +102,6 @@ class ChangePassWordViewController: UIViewController { | @@ -111,7 +102,6 @@ class ChangePassWordViewController: UIViewController { | ||
111 | 102 | ||
112 | @IBAction func sendUserCodeBtnClick(_ sender: UIButton) { | 103 | @IBAction func sendUserCodeBtnClick(_ sender: UIButton) { |
113 | self.view.endEditing(true) | 104 | self.view.endEditing(true) |
114 | - timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(ChangePassWordViewController.timerFire), userInfo: sender, repeats: true) | ||
115 | var phone = "" | 105 | var phone = "" |
116 | if user.isOnline(){ | 106 | if user.isOnline(){ |
117 | phone = user.phone() | 107 | phone = user.phone() |
@@ -130,6 +120,7 @@ class ChangePassWordViewController: UIViewController { | @@ -130,6 +120,7 @@ class ChangePassWordViewController: UIViewController { | ||
130 | if JSON.fromString(jsonString: str)!["status"].intValue == 1{ | 120 | if JSON.fromString(jsonString: str)!["status"].intValue == 1{ |
131 | httpJsonResule(jsonString: str, error: error, successHandler: { (json) in | 121 | httpJsonResule(jsonString: str, error: error, successHandler: { (json) in |
132 | self.view.makeToast("验证码发送成功") | 122 | self.view.makeToast("验证码发送成功") |
123 | + self.timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(ChangePassWordViewController.timerFire), userInfo: sender, repeats: true) | ||
133 | }, failHandler: { (error) in | 124 | }, failHandler: { (error) in |
134 | self.view.makeToast("验证码发送失败:\(error.localizedDescription)") | 125 | self.view.makeToast("验证码发送失败:\(error.localizedDescription)") |
135 | }) | 126 | }) |
YouerLiveVideo/YouerLiveVideo/controllers/User/User.storyboard
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"> | 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"> | ||
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> |
@@ -523,16 +523,9 @@ | @@ -523,16 +523,9 @@ | ||
523 | <action selector="editKeyboard:" destination="HIn-e8-Pzh" eventType="touchUpInside" id="Gqe-4a-Nym"/> | 523 | <action selector="editKeyboard:" destination="HIn-e8-Pzh" eventType="touchUpInside" id="Gqe-4a-Nym"/> |
524 | </connections> | 524 | </connections> |
525 | </view> | 525 | </view> |
526 | - <navigationItem key="navigationItem" title="忘记密码" id="kn3-BP-XrH"> | ||
527 | - <barButtonItem key="rightBarButtonItem" title="取消" id="Qjp-nS-fi2"> | ||
528 | - <connections> | ||
529 | - <action selector="cancleAction:" destination="HIn-e8-Pzh" id="TkS-G8-Iyw"/> | ||
530 | - </connections> | ||
531 | - </barButtonItem> | ||
532 | - </navigationItem> | 526 | + <navigationItem key="navigationItem" title="忘记密码" id="kn3-BP-XrH"/> |
533 | <connections> | 527 | <connections> |
534 | <outlet property="agrenPasswordTextFiled" destination="Qzh-5W-Fdl" id="NIs-ap-xHZ"/> | 528 | <outlet property="agrenPasswordTextFiled" destination="Qzh-5W-Fdl" id="NIs-ap-xHZ"/> |
535 | - <outlet property="cancleItem" destination="Qjp-nS-fi2" id="gIx-W1-0Kq"/> | ||
536 | <outlet property="contentSizeHeight" destination="lat-Tj-mho" id="3Ro-l4-uWu"/> | 529 | <outlet property="contentSizeHeight" destination="lat-Tj-mho" id="3Ro-l4-uWu"/> |
537 | <outlet property="passwordTextFiled" destination="KOX-8X-bEC" id="Rd7-u2-mLM"/> | 530 | <outlet property="passwordTextFiled" destination="KOX-8X-bEC" id="Rd7-u2-mLM"/> |
538 | <outlet property="phoneViewHeight" destination="xsq-cP-2jd" id="yza-R9-2EJ"/> | 531 | <outlet property="phoneViewHeight" destination="xsq-cP-2jd" id="yza-R9-2EJ"/> |
YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/Login.storyboard
@@ -729,13 +729,7 @@ | @@ -729,13 +729,7 @@ | ||
729 | <outletCollection property="gestureRecognizers" destination="ZEf-mm-u9e" appends="YES" id="Gmm-Kb-eQb"/> | 729 | <outletCollection property="gestureRecognizers" destination="ZEf-mm-u9e" appends="YES" id="Gmm-Kb-eQb"/> |
730 | </connections> | 730 | </connections> |
731 | </view> | 731 | </view> |
732 | - <navigationItem key="navigationItem" title="注册" id="VWP-v7-Qoc"> | ||
733 | - <barButtonItem key="rightBarButtonItem" title="取消" id="Okk-g0-Rwk"> | ||
734 | - <connections> | ||
735 | - <action selector="cancleAction:" destination="tCx-JF-YJm" id="ypG-ks-rG6"/> | ||
736 | - </connections> | ||
737 | - </barButtonItem> | ||
738 | - </navigationItem> | 732 | + <navigationItem key="navigationItem" title="注册" id="VWP-v7-Qoc"/> |
739 | <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | 733 | <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> |
740 | <size key="freeformSize" width="375" height="667"/> | 734 | <size key="freeformSize" width="375" height="667"/> |
741 | <connections> | 735 | <connections> |
@@ -787,10 +781,10 @@ | @@ -787,10 +781,10 @@ | ||
787 | </objects> | 781 | </objects> |
788 | <point key="canvasLocation" x="-2162.4000000000001" y="1533.2833583208396"/> | 782 | <point key="canvasLocation" x="-2162.4000000000001" y="1533.2833583208396"/> |
789 | </scene> | 783 | </scene> |
790 | - <!--New Login View Controller--> | 784 | + <!--登录--> |
791 | <scene sceneID="j0h-zV-7K8"> | 785 | <scene sceneID="j0h-zV-7K8"> |
792 | <objects> | 786 | <objects> |
793 | - <viewController storyboardIdentifier="NewLoginViewControllerVC" id="7YD-gA-dLJ" customClass="NewLoginViewController" customModule="YouerLiveVideo" customModuleProvider="target" sceneMemberID="viewController"> | 787 | + <viewController storyboardIdentifier="NewLoginViewControllerVC" hidesBottomBarWhenPushed="YES" id="7YD-gA-dLJ" customClass="NewLoginViewController" customModule="YouerLiveVideo" customModuleProvider="target" sceneMemberID="viewController"> |
794 | <layoutGuides> | 788 | <layoutGuides> |
795 | <viewControllerLayoutGuide type="top" id="Hx8-x7-gQe"/> | 789 | <viewControllerLayoutGuide type="top" id="Hx8-x7-gQe"/> |
796 | <viewControllerLayoutGuide type="bottom" id="eS2-l5-mzB"/> | 790 | <viewControllerLayoutGuide type="bottom" id="eS2-l5-mzB"/> |
@@ -956,7 +950,7 @@ | @@ -956,7 +950,7 @@ | ||
956 | <color key="titleColor" red="0.66666666669999997" green="0.66666666669999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | 950 | <color key="titleColor" red="0.66666666669999997" green="0.66666666669999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
957 | </state> | 951 | </state> |
958 | <connections> | 952 | <connections> |
959 | - <action selector="activatiAction:" destination="7YD-gA-dLJ" eventType="touchUpInside" id="U3q-J4-Ag3"/> | 953 | + <action selector="forgetPassword:" destination="7YD-gA-dLJ" eventType="touchUpInside" id="y4v-x3-3Yo"/> |
960 | </connections> | 954 | </connections> |
961 | </button> | 955 | </button> |
962 | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vmw-Ug-eCf"> | 956 | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vmw-Ug-eCf"> |
@@ -970,7 +964,7 @@ | @@ -970,7 +964,7 @@ | ||
970 | <color key="titleColor" red="0.66666666669999997" green="0.66666666669999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | 964 | <color key="titleColor" red="0.66666666669999997" green="0.66666666669999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
971 | </state> | 965 | </state> |
972 | <connections> | 966 | <connections> |
973 | - <action selector="returnAction:" destination="7YD-gA-dLJ" eventType="touchUpInside" id="OEZ-Z3-zKh"/> | 967 | + <action selector="registerAccount:" destination="7YD-gA-dLJ" eventType="touchUpInside" id="1N1-9k-yxY"/> |
974 | </connections> | 968 | </connections> |
975 | </button> | 969 | </button> |
976 | </subviews> | 970 | </subviews> |
@@ -1014,6 +1008,8 @@ | @@ -1014,6 +1008,8 @@ | ||
1014 | <constraint firstItem="eS2-l5-mzB" firstAttribute="top" secondItem="zyE-vu-SeI" secondAttribute="bottom" id="Uh1-h1-vQ4"/> | 1008 | <constraint firstItem="eS2-l5-mzB" firstAttribute="top" secondItem="zyE-vu-SeI" secondAttribute="bottom" id="Uh1-h1-vQ4"/> |
1015 | </constraints> | 1009 | </constraints> |
1016 | </view> | 1010 | </view> |
1011 | + <navigationItem key="navigationItem" title="登录" id="xGB-lk-WD2"/> | ||
1012 | + <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/> | ||
1017 | <connections> | 1013 | <connections> |
1018 | <outlet property="buttonLogin" destination="d0Y-Gl-m8Z" id="QDU-R3-RGe"/> | 1014 | <outlet property="buttonLogin" destination="d0Y-Gl-m8Z" id="QDU-R3-RGe"/> |
1019 | <outlet property="constraintContentOffset" destination="MqN-UP-SP0" id="dpa-vk-fx3"/> | 1015 | <outlet property="constraintContentOffset" destination="MqN-UP-SP0" id="dpa-vk-fx3"/> |
YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/NewLoginViewController.swift
@@ -19,8 +19,6 @@ class NewLoginViewController: UIViewController,UITextFieldDelegate { | @@ -19,8 +19,6 @@ class NewLoginViewController: UIViewController,UITextFieldDelegate { | ||
19 | constraintContentOffset.constant=20 | 19 | constraintContentOffset.constant=20 |
20 | view.backgroundColor=UIColorFromRGB(0xf7f7f7) | 20 | view.backgroundColor=UIColorFromRGB(0xf7f7f7) |
21 | Theme.configButton(buttonLogin) | 21 | Theme.configButton(buttonLogin) |
22 | - let lastAccount=Setting.getString("lastAccountNumber") | ||
23 | - fieldAccount.text=lastAccount | ||
24 | } | 22 | } |
25 | override func viewWillAppear(_ animated: Bool) { | 23 | override func viewWillAppear(_ animated: Bool) { |
26 | super.viewWillAppear(animated) | 24 | super.viewWillAppear(animated) |
@@ -116,15 +114,13 @@ class NewLoginViewController: UIViewController,UITextFieldDelegate { | @@ -116,15 +114,13 @@ class NewLoginViewController: UIViewController,UITextFieldDelegate { | ||
116 | return true | 114 | return true |
117 | } | 115 | } |
118 | 116 | ||
119 | - @IBAction func activatiAction(_ sender: UIButton) { | ||
120 | - let vc = Story.instantiateViewControllerWithIdentifier("ChangePassWordViewControllerVC", storyName: "User") as! ChangePassWordViewController | ||
121 | - self.present(vc.wrapWithNavigationController(), animated: true, completion: nil) | 117 | + @IBAction func forgetPassword(_ sender: UIButton) { |
118 | + let vc = Story.instantiateViewControllerWithIdentifier("ChangePassWordViewControllerVC", storyName: "User") as! ChangePassWordViewController | ||
119 | + self.navigationController?.pushViewController(vc, animated: true) | ||
122 | } | 120 | } |
123 | - | ||
124 | - @IBAction func returnAction(_ sender: UIButton) { | 121 | + @IBAction func registerAccount(_ sender: UIButton) { |
125 | let vc = UIStoryboard(name: "Login", bundle: nil).instantiateViewController(withIdentifier: "RegisterViewControllerVC") as! RegisterViewController | 122 | let vc = UIStoryboard(name: "Login", bundle: nil).instantiateViewController(withIdentifier: "RegisterViewControllerVC") as! RegisterViewController |
126 | - self.present(vc.wrapWithNavigationController(), animated: true, completion: nil) | ||
127 | - | 123 | + self.navigationController!.pushViewController(vc, animated: true) |
128 | } | 124 | } |
129 | 125 | ||
130 | func keyboardWillShow(){ | 126 | func keyboardWillShow(){ |
YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/RegisterViewController.swift
@@ -56,7 +56,6 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker | @@ -56,7 +56,6 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker | ||
56 | if (phoneNumber.text?.isMobilePhoneNumber())! { | 56 | if (phoneNumber.text?.isMobilePhoneNumber())! { |
57 | SVProgressHUD.show(withStatus: "获取验证码...") | 57 | SVProgressHUD.show(withStatus: "获取验证码...") |
58 | SVProgressHUD.setDefaultMaskType(.black) | 58 | SVProgressHUD.setDefaultMaskType(.black) |
59 | - timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(RegisterViewController.timerFire), userInfo: sender, repeats: true) | ||
60 | 59 | ||
61 | AppDelegate.instance().httpServer.getChangePhoneCaptcha(mobile: phoneNumber.text!, completionHandler: { (str, error) in | 60 | AppDelegate.instance().httpServer.getChangePhoneCaptcha(mobile: phoneNumber.text!, completionHandler: { (str, error) in |
62 | SVProgressHUD.dismiss() | 61 | SVProgressHUD.dismiss() |
@@ -64,6 +63,8 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker | @@ -64,6 +63,8 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker | ||
64 | if JSON.fromString(jsonString: str)!["status"].intValue == 1{ | 63 | if JSON.fromString(jsonString: str)!["status"].intValue == 1{ |
65 | httpJsonResule(jsonString: str, error: error, successHandler: { (json) in | 64 | httpJsonResule(jsonString: str, error: error, successHandler: { (json) in |
66 | self.view.makeToast("验证码发送成功") | 65 | self.view.makeToast("验证码发送成功") |
66 | + self.timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(RegisterViewController.timerFire), userInfo: sender, repeats: true) | ||
67 | + | ||
67 | self.nikeNameTextFiled.isUserInteractionEnabled=false | 68 | self.nikeNameTextFiled.isUserInteractionEnabled=false |
68 | self.phoneNumber.isUserInteractionEnabled=false | 69 | self.phoneNumber.isUserInteractionEnabled=false |
69 | self.passwordTextField.isUserInteractionEnabled=false | 70 | self.passwordTextField.isUserInteractionEnabled=false |
@@ -106,7 +107,7 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker | @@ -106,7 +107,7 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker | ||
106 | if error==nil { | 107 | if error==nil { |
107 | if JSON.fromString(jsonString: str)!["status"].intValue == 1{ | 108 | if JSON.fromString(jsonString: str)!["status"].intValue == 1{ |
108 | httpJsonResule(jsonString: str, error: error, successHandler: { (json) in | 109 | httpJsonResule(jsonString: str, error: error, successHandler: { (json) in |
109 | - self.navigationController!.dismiss(animated: true, completion: nil) | 110 | + self.navigationController!.popViewController(animated: true) |
110 | AppDelegate.instance().window?.makeToast("注册成功") | 111 | AppDelegate.instance().window?.makeToast("注册成功") |
111 | NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshLoginUser"), object: self.phoneNumber.text!) | 112 | NotificationCenter.default.post(name: NSNotification.Name(rawValue: "refreshLoginUser"), object: self.phoneNumber.text!) |
112 | //是否登录 | 113 | //是否登录 |
@@ -143,10 +144,7 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker | @@ -143,10 +144,7 @@ class RegisterViewController: UIViewController,UIAlertViewDelegate,UIImagePicker | ||
143 | } | 144 | } |
144 | 145 | ||
145 | @IBAction func loginBtnClickAction(_ sender: AnyObject) { | 146 | @IBAction func loginBtnClickAction(_ sender: AnyObject) { |
146 | - self.navigationController!.dismiss(animated: true, completion: nil) | ||
147 | - } | ||
148 | - @IBAction func cancleAction(_ sender: UIBarButtonItem) { | ||
149 | - self.navigationController!.dismiss(animated: true, completion: nil) | 147 | + self.navigationController!.popViewController(animated: true) |
150 | } | 148 | } |
151 | 149 | ||
152 | @IBAction func nickNameSetTapAction(_ sender: AnyObject) { | 150 | @IBAction func nickNameSetTapAction(_ sender: AnyObject) { |
YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift
@@ -49,9 +49,8 @@ class UserViewController: UIViewController { | @@ -49,9 +49,8 @@ class UserViewController: UIViewController { | ||
49 | self.navigationController?.pushViewController(vc, animated: true) | 49 | self.navigationController?.pushViewController(vc, animated: true) |
50 | }else{ | 50 | }else{ |
51 | let vc=Story.instantiateViewControllerWithIdentifier("NewLoginViewControllerVC", storyName: "Login") as! NewLoginViewController | 51 | let vc=Story.instantiateViewControllerWithIdentifier("NewLoginViewControllerVC", storyName: "Login") as! NewLoginViewController |
52 | - self.present(vc, animated: true, completion: nil) | 52 | + self.navigationController?.pushViewController(vc, animated: true) |
53 | } | 53 | } |
54 | - | ||
55 | } | 54 | } |
56 | 55 | ||
57 | func editBtnClick(){ | 56 | func editBtnClick(){ |