nanxinlin 6 rokov pred
rodič
commit
4a376ce883
18 zmenil súbory, kde vykonal 823 pridanie a 36 odobranie
  1. 6 1
      RainbowPlanet/Podfile
  2. 9 1
      RainbowPlanet/Podfile.lock
  3. 55 3
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  4. 2 2
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift
  5. 1 1
      RainbowPlanet/RainbowPlanet/Define/HTMLURLMacro.swift
  6. 4 0
      RainbowPlanet/RainbowPlanet/Define/RainbowPlanet-Bridging-Header.h
  7. 11 8
      RainbowPlanet/RainbowPlanet/Define/ThirdPartyMacro.swift
  8. 157 0
      RainbowPlanet/RainbowPlanet/Manager/MapManager/AMapManager.swift
  9. 0 0
      RainbowPlanet/RainbowPlanet/Manager/MapManager/BaiduMapManager.swift
  10. 0 0
      RainbowPlanet/RainbowPlanet/Manager/MapManager/LocationModel.swift
  11. 10 15
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/BindPhoneNumber/ViewController/BindPhoneNumberViewController.swift
  12. 106 0
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/PasswordLogin/ViewController/PasswordLoginViewController.swift
  13. 132 0
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/PasswordLogin/ViewController/PasswordLoginViewController.xib
  14. 5 2
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/ThirdPartyLogin/ViewController/ThirdPartyLoginViewController.swift
  15. 132 0
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/VerificationPhone/ViewController/VerificationPhoneViewController.swift
  16. 160 0
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/VerificationPhone/ViewController/VerificationPhoneViewController.xib
  17. 3 3
      RainbowPlanet/RainbowPlanet/Supporting Files/Info.plist
  18. 30 0
      RainbowPlanet/RainbowPlanet/Tools/WRNavigationBar/WRCustomNavigationBar.swift

+ 6 - 1
RainbowPlanet/Podfile

@@ -69,7 +69,12 @@ target 'RainbowPlanet' do
   pod 'UMCShare/Social/ReducedSina'
 
   #=====================百度地图===========
-#  #百度地图定位SDK
+  #百度地图定位SDK
   pod 'BMKLocationKit'
 
+  #=====================高德地图===========
+  #  #百度地图定位SDK
+  pod 'AMapLocation'
+
+
 end

+ 9 - 1
RainbowPlanet/Podfile.lock

@@ -1,5 +1,8 @@
 PODS:
   - Alamofire (4.8.1)
+  - AMapFoundation (1.5.6)
+  - AMapLocation (2.6.1):
+    - AMapFoundation (~> 1.4)
   - BMKLocationKit (1.5.0)
   - DeviceKit (1.12.0)
   - EFQRCode (4.5.0):
@@ -88,6 +91,7 @@ PODS:
 
 DEPENDENCIES:
   - Alamofire
+  - AMapLocation
   - BMKLocationKit
   - DeviceKit
   - EFQRCode
@@ -125,6 +129,8 @@ DEPENDENCIES:
 SPEC REPOS:
   https://github.com/cocoapods/specs.git:
     - Alamofire
+    - AMapFoundation
+    - AMapLocation
     - BMKLocationKit
     - DeviceKit
     - EFQRCode
@@ -163,6 +169,8 @@ SPEC REPOS:
 
 SPEC CHECKSUMS:
   Alamofire: 16ce2c353fb72865124ddae8a57c5942388f4f11
+  AMapFoundation: 20fce2a12cd152e1092afdd04379cdac21932185
+  AMapLocation: cf024b53dc03663efb4ea4bcce27d4cce58bb97a
   BMKLocationKit: 40d267478acd8704ddebd0e9deaddc727b13df9f
   DeviceKit: f5dbd2e70cafd420d6a09379b8800cdf5fe92ba5
   EFQRCode: 842f431e660da841f518993af8f4cbd275601d84
@@ -199,6 +207,6 @@ SPEC CHECKSUMS:
   UMCSecurityPlugins: 0831a08f3988f3cea9f1d3a7626cd9bee4fef150
   UMCShare: 552b29753f1b4da87b51d96545ed19e6263df397
 
-PODFILE CHECKSUM: 338a17450a35e9f9265a15f08e15830aab4ddc09
+PODFILE CHECKSUM: e96950f67b21f44b7b089f915b956870a944526c
 
 COCOAPODS: 1.5.3

+ 55 - 3
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -75,6 +75,11 @@
 		A72A7386223396CB00B21995 /* SwiftMoyaNetWorkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A7382223396CB00B21995 /* SwiftMoyaNetWorkManager.swift */; };
 		A72A7387223396CB00B21995 /* SwiftMoyaServiceAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A7383223396CB00B21995 /* SwiftMoyaServiceAPI.swift */; };
 		A72A7388223396CB00B21995 /* ApiMacro.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72A7384223396CB00B21995 /* ApiMacro.swift */; };
+		A75414F7224B4C1B002480B5 /* VerificationPhoneViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75414F5224B4C1B002480B5 /* VerificationPhoneViewController.swift */; };
+		A75414F8224B4C1B002480B5 /* VerificationPhoneViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A75414F6224B4C1B002480B5 /* VerificationPhoneViewController.xib */; };
+		A75414FD224B5F28002480B5 /* PasswordLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75414FB224B5F28002480B5 /* PasswordLoginViewController.swift */; };
+		A75414FE224B5F28002480B5 /* PasswordLoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A75414FC224B5F28002480B5 /* PasswordLoginViewController.xib */; };
+		A7541500224BC02F002480B5 /* AMapManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75414FF224BC02F002480B5 /* AMapManager.swift */; };
 		A76390EB2248E27A0067EEE0 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A76390EA2248E27A0067EEE0 /* UserNotifications.framework */; };
 		A775CBFE2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A775CBFD2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift */; };
 		A775CC00223774A300EBDCF8 /* ShoppingMallView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A775CBFF223774A300EBDCF8 /* ShoppingMallView.swift */; };
@@ -212,6 +217,11 @@
 		A72A7382223396CB00B21995 /* SwiftMoyaNetWorkManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftMoyaNetWorkManager.swift; sourceTree = "<group>"; };
 		A72A7383223396CB00B21995 /* SwiftMoyaServiceAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftMoyaServiceAPI.swift; sourceTree = "<group>"; };
 		A72A7384223396CB00B21995 /* ApiMacro.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiMacro.swift; sourceTree = "<group>"; };
+		A75414F5224B4C1B002480B5 /* VerificationPhoneViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerificationPhoneViewController.swift; sourceTree = "<group>"; };
+		A75414F6224B4C1B002480B5 /* VerificationPhoneViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VerificationPhoneViewController.xib; sourceTree = "<group>"; };
+		A75414FB224B5F28002480B5 /* PasswordLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordLoginViewController.swift; sourceTree = "<group>"; };
+		A75414FC224B5F28002480B5 /* PasswordLoginViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PasswordLoginViewController.xib; sourceTree = "<group>"; };
+		A75414FF224BC02F002480B5 /* AMapManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AMapManager.swift; sourceTree = "<group>"; };
 		A76390EA2248E27A0067EEE0 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
 		A775CBFD2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallNavigationBarView.swift; sourceTree = "<group>"; };
 		A775CBFF223774A300EBDCF8 /* ShoppingMallView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallView.swift; sourceTree = "<group>"; };
@@ -344,7 +354,7 @@
 			children = (
 				A7778CA52243A03400C7C47A /* IQKeyboardManagerSwiftManager */,
 				A72A730522321F1D00B21995 /* PayManager */,
-				A72A726122321DBD00B21995 /* BaiduMapManager */,
+				A72A726122321DBD00B21995 /* MapManager */,
 				A72A726422321DBD00B21995 /* UMManager */,
 			);
 			path = Manager;
@@ -366,13 +376,14 @@
 			path = Define;
 			sourceTree = "<group>";
 		};
-		A72A726122321DBD00B21995 /* BaiduMapManager */ = {
+		A72A726122321DBD00B21995 /* MapManager */ = {
 			isa = PBXGroup;
 			children = (
 				A72A726222321DBD00B21995 /* BaiduMapManager.swift */,
+				A75414FF224BC02F002480B5 /* AMapManager.swift */,
 				A72A726322321DBD00B21995 /* LocationModel.swift */,
 			);
-			path = BaiduMapManager;
+			path = MapManager;
 			sourceTree = "<group>";
 		};
 		A72A726422321DBD00B21995 /* UMManager */ = {
@@ -553,6 +564,40 @@
 			path = SwiftMoyaService;
 			sourceTree = "<group>";
 		};
+		A75414F1224B4B9D002480B5 /* VerificationPhone */ = {
+			isa = PBXGroup;
+			children = (
+				A75414F2224B4BE7002480B5 /* ViewController */,
+			);
+			path = VerificationPhone;
+			sourceTree = "<group>";
+		};
+		A75414F2224B4BE7002480B5 /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A75414F5224B4C1B002480B5 /* VerificationPhoneViewController.swift */,
+				A75414F6224B4C1B002480B5 /* VerificationPhoneViewController.xib */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A75414F9224B5EFC002480B5 /* PasswordLogin */ = {
+			isa = PBXGroup;
+			children = (
+				A75414FA224B5F17002480B5 /* ViewController */,
+			);
+			path = PasswordLogin;
+			sourceTree = "<group>";
+		};
+		A75414FA224B5F17002480B5 /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A75414FB224B5F28002480B5 /* PasswordLoginViewController.swift */,
+				A75414FC224B5F28002480B5 /* PasswordLoginViewController.xib */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
 		A775CBFC2237483E00EBDCF8 /* View */ = {
 			isa = PBXGroup;
 			children = (
@@ -870,6 +915,8 @@
 		A77F2CAE2232010F001BD3F6 /* RegisterLoginModule */ = {
 			isa = PBXGroup;
 			children = (
+				A75414F9224B5EFC002480B5 /* PasswordLogin */,
+				A75414F1224B4B9D002480B5 /* VerificationPhone */,
 				A7778CC32246030200C7C47A /* PhoneCountryArea */,
 				A7778CB52244E93E00C7C47A /* BindPhoneNumber */,
 				A7778CAC2244BC2600C7C47A /* ThirdPartyLogin */,
@@ -1091,12 +1138,14 @@
 				A7778C9E2243937300C7C47A /* RegisterLoginModule.xcassets in Resources */,
 				A77F2CB62232010F001BD3F6 /* MineViewController.xib in Resources */,
 				A7778C9722438F5D00C7C47A /* AlipaySDK.bundle in Resources */,
+				A75414F8224B4C1B002480B5 /* VerificationPhoneViewController.xib in Resources */,
 				A7778CA4224393A900C7C47A /* CommonModule.xcassets in Resources */,
 				A77F2C682231FB4A001BD3F6 /* Assets.xcassets in Resources */,
 				A7778C9C2243934A00C7C47A /* MineModule.xcassets in Resources */,
 				A7778C9922438F5D00C7C47A /* README.txt in Resources */,
 				A7778CA22243939100C7C47A /* ShoppingMallModule.xcassets in Resources */,
 				A7778CA02243938200C7C47A /* ShoppingCartModule.xcassets in Resources */,
+				A75414FE224B5F28002480B5 /* PasswordLoginViewController.xib in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1274,6 +1323,7 @@
 				A72A72D322321E2700B21995 /* CacheMacro.swift in Sources */,
 				A72A72A422321DE000B21995 /* LBXScanViewController.swift in Sources */,
 				A77F2CB52232010F001BD3F6 /* ShoppingMallViewController.swift in Sources */,
+				A75414F7224B4C1B002480B5 /* VerificationPhoneViewController.swift in Sources */,
 				A77F2CC3223203BA001BD3F6 /* AppDelegate+Window.swift in Sources */,
 				A72A72B022321DE000B21995 /* CGView.swift in Sources */,
 				A72A73142232475E00B21995 /* AlipayManager.swift in Sources */,
@@ -1292,6 +1342,8 @@
 				A72A72A922321DE000B21995 /* NumberKeyboard.swift in Sources */,
 				A72A72AA22321DE000B21995 /* Log.swift in Sources */,
 				A72A72B622321DE000B21995 /* Extension+NSRange.swift in Sources */,
+				A75414FD224B5F28002480B5 /* PasswordLoginViewController.swift in Sources */,
+				A7541500224BC02F002480B5 /* AMapManager.swift in Sources */,
 				A72A72A722321DE000B21995 /* LBXPermissions.swift in Sources */,
 				A72A72AE22321DE000B21995 /* CountdownButton.swift in Sources */,
 				A77F2CB72232010F001BD3F6 /* MineViewController.swift in Sources */,

+ 2 - 2
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift

@@ -15,8 +15,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
 
 
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
-        //初始化地图
-        BaiduMapManager.shared().initBaiduMap()
+        //初始化高德定位
+        AMapManager.shared().initAMap()
         //初始化窗口
         initWindow()
         //初始化友盟

+ 1 - 1
RainbowPlanet/RainbowPlanet/Define/HTMLURLMacro.swift

@@ -9,6 +9,6 @@
 import Foundation
 
 /// 给我们我们评分
-let kAppStoreReview = "https://itunes.apple.com/cn/app/1166892045?action=write-review"
+let kAppStoreReview = "https://itunes.apple.com/cn/app/1455804911?action=write-review"
 
 

+ 4 - 0
RainbowPlanet/RainbowPlanet/Define/RainbowPlanet-Bridging-Header.h

@@ -34,5 +34,9 @@
 //百度定位
 #import <BMKLocationkit/BMKLocationComponent.h>
 
+//高德定位
+#import <AMapFoundationKit/AMapFoundationKit.h>
+#import <AMapLocationKit/AMapLocationKit.h>
+
 
 #endif /* RainbowPlanet_Bridging_Header_h */

+ 11 - 8
RainbowPlanet/RainbowPlanet/Define/ThirdPartyMacro.swift

@@ -8,20 +8,17 @@
 
 import Foundation
 
-//MARK: -  bugly
-let kBuglyAppId  = ""
-let kBuglyAppKey  = ""
 
 //MARK: - UMeng
 let kUMengAppKey  = "5c984a7f0cafb2332300000f"
 let kUMengAppSecret  = "lpx7kstlnlrxmimo5gfyzvtscrtguhw8"
 
 //MARK: - QQ跟安卓用同一个
-let kQQAppKey =  "1105803948"
-let kQQAppSecret = "aUosPQs1khVAcmB7"
+let kQQAppKey =  "101565722"
+let kQQAppSecret = "dfe6f96762ed0dbc3ad52dc06d0eda9b"
 
 //MARK: - 微信
-let kWeiXinAppKey  = "wx647d93490caf548f"
+let kWeiXinAppKey  = "wx163e76382d53654b"
 let kWeiXinAppSecret = "c5dc884f79a1bb00e96d76a3e16da39a"
 
 //MARK: - 微博
@@ -31,7 +28,13 @@ let kWeiboAppSecret  = "79d36bfe6b75638ece14d5d852e785c4"
 //MARK: - 百度地图
 let kBaiduMapAppKey  = "v7wFjrAQdlaBVC50CjwuRESC3Lu0xkhj"
 
-//MARK: - 百度地图
-let kAppKey  = "v7wFjrAQdlaBVC50CjwuRESC3Lu0xkhj"
+//MARK: - 高德地图
+let kAMapAppKey  = ""
+
+
+//MARK: - aliPay
+
+let kAliPayManagerAppKey  = "2019032763726287"
+
 
 

+ 157 - 0
RainbowPlanet/RainbowPlanet/Manager/MapManager/AMapManager.swift

@@ -0,0 +1,157 @@
+//
+//  AMapManager.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/27.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+
+class AMapManager: NSObject {
+    private static let _sharedInstance = AMapManager()
+
+    private override init() {} // 私有化init方法
+
+    private lazy var locationManager: AMapLocationManager = {
+        // 注意: locationManager为该类的属性
+        let locationManager = AMapLocationManager()
+        locationManager.locatingWithReGeocode = true
+        return locationManager
+    }()
+
+    /// 粗单次定位
+    private func soughSingleLocation() {
+        //   带逆地理信息的一次定位(返回坐标和地址信息)
+        locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters
+        //   定位超时时间,最低2s,此处设置为2s
+        locationManager.locationTimeout = 2
+        //   逆地理请求超时时间,最低2s,此处设置为2s
+        locationManager.reGeocodeTimeout = 2
+    }
+
+    /// 精准单次定位
+    private func accurateSingleLocation() {
+        //   带逆地理信息的一次定位(返回坐标和地址信息)
+        locationManager.desiredAccuracy = kCLLocationAccuracyBest
+        //   定位超时时间,最低2s,此处设置为10s
+        locationManager.locationTimeout = 10
+        //   逆地理请求超时时间,最低2s,此处设置为10s
+        locationManager.reGeocodeTimeout = 10
+    }
+
+
+    typealias LocationModelBlock = (_ locationModel: LocationModel) -> Void
+
+    class func shared() -> AMapManager {
+        return _sharedInstance
+    }
+
+    public func initAMap() -> Void {
+        AMapServices.shared().apiKey = kAMapAppKey
+        requestLocation(isSoughSingleLocation: true) { (locationModel) in
+
+        }
+    }
+
+    /// 请求单次定位
+    ///
+    /// - Parameters:
+    ///   - isSoughSingleLocation:
+    ///   - isAccurateSingleLocation: 粗单次定位 默认不调用
+    ///   - locationModelBlock: 精准单次定位 默认不调用
+    public func requestLocation(isSoughSingleLocation:Bool = false, isAccurateSingleLocation:Bool = false, locationModelBlock:LocationModelBlock) {
+
+
+        //粗单次定位
+        if isSoughSingleLocation {
+            soughSingleLocation()
+        }
+
+        //精准单次定位
+        if isAccurateSingleLocation {
+            soughSingleLocation()
+        }
+
+        locationManager.requestLocation(withReGeocode: true, completionBlock: {(location: CLLocation?, reGeocode: AMapLocationReGeocode?, error: Error?) in
+
+            if let error = error {
+                let error = error as NSError
+
+                if error.code == AMapLocationErrorCode.locateFailed.rawValue {
+                    //定位错误:此时location和regeocode没有返回值,不进行annotation的添加
+                    NXLLog("定位错误:{\(error.code) - \(error.localizedDescription)};")
+                    return
+                } else if error.code == AMapLocationErrorCode.reGeocodeFailed.rawValue
+                    || error.code == AMapLocationErrorCode.timeOut.rawValue
+                    || error.code == AMapLocationErrorCode.cannotFindHost.rawValue
+                    || error.code == AMapLocationErrorCode.badURL.rawValue
+                    || error.code == AMapLocationErrorCode.notConnectedToInternet.rawValue
+                    || error.code == AMapLocationErrorCode.cannotConnectToHost.rawValue {
+                    //逆地理错误:在带逆地理的单次定位中,逆地理过程可能发生错误,此时location有返回值,regeocode无返回值,进行annotation的添加
+                    NXLLog("逆地理错误:{\(error.code) - \(error.localizedDescription)};")
+                } else {
+                    //没有错误:location有返回值,regeocode是否有返回值取决于是否进行逆地理操作,进行annotation的添加
+                }
+            }
+
+            if let location = location {
+                NXLLog("location:\(location)")
+            }
+
+            if let reGeocode = reGeocode {
+                NXLLog("reGeocode:\(reGeocode)")
+            }
+        })
+    }
+
+    /// 后台定位
+    public func backgroundLocation()  {
+
+        locationManager.delegate = self
+        locationManager.distanceFilter = 100
+        //iOS 9(不包含iOS 9) 之前设置允许后台定位参数,保持不会被系统挂起
+        locationManager.pausesLocationUpdatesAutomatically = false
+
+        //iOS 9(包含iOS 9)之后新特性:将允许出现这种场景,同一app中多个locationmanager:一些只能在前台定位,另一些可在后台定位,并可随时禁止其后台定位。
+        if UIDevice.current.systemVersion._bridgeToObjectiveC().doubleValue >= 9.0 {
+            locationManager.pausesLocationUpdatesAutomatically = true
+        }
+
+        //开始持续定位
+        locationManager.startUpdatingLocation()
+    }
+
+    /// 持续定位
+    public func continuedLocation()  {
+
+        locationManager.delegate = self
+        locationManager.distanceFilter = 100
+        //iOS 9(包含iOS 9)之后新特性:将允许出现这种场景,同一app中多个locationmanager:一些只能在前台定位,另一些可在后台定位,并可随时禁止其后台定位。
+        if UIDevice.current.systemVersion._bridgeToObjectiveC().doubleValue >= 9.0 {
+            locationManager.pausesLocationUpdatesAutomatically = true
+        }
+
+        //开始持续定位
+        locationManager.startUpdatingLocation()
+    }
+
+    /// 停止定位
+    public func stopUpdatingLocation()  {
+        locationManager.stopUpdatingLocation()
+    }
+
+}
+
+// MARK: - 持续定位/后台定位
+extension AMapManager: AMapLocationManagerDelegate {
+
+    func amapLocationManager(_ manager: AMapLocationManager!, didUpdate location: CLLocation!, reGeocode: AMapLocationReGeocode?) {
+        NXLLog("location:{lat:\(location.coordinate.latitude); lon:\(location.coordinate.longitude); accuracy:\(location.horizontalAccuracy);};");
+
+        if let reGeocode = reGeocode {
+            NXLLog("reGeocode:\(reGeocode)")
+        }
+    }
+
+}

RainbowPlanet/RainbowPlanet/Manager/BaiduMapManager/BaiduMapManager.swift → RainbowPlanet/RainbowPlanet/Manager/MapManager/BaiduMapManager.swift


RainbowPlanet/RainbowPlanet/Manager/BaiduMapManager/LocationModel.swift → RainbowPlanet/RainbowPlanet/Manager/MapManager/LocationModel.swift


+ 10 - 15
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/BindPhoneNumber/ViewController/BindPhoneNumberViewController.swift

@@ -28,16 +28,6 @@ class BindPhoneNumberViewController: BaseViewController {
         MobClick.endLogPageView("BindPhoneNumberViewController:绑定手机号页面")
     }
 
-    override func viewDidAppear(_ animated: Bool) {
-        super.viewDidAppear(animated)
-        phoneNumberTextField.snp.updateConstraints { (make) in
-            make.width.equalTo(kScreenWidth - 76 - 35 - phoneAreaCodeLabel.width)
-        }
-        smsTextField.snp.updateConstraints { (make) in
-            make.width.equalTo(kScreenWidth - 76 - 10 - smsButton.width)
-        }
-    }
-
     override func viewDidLoad() {
         super.viewDidLoad()
         navigationBar.onClickLeftButton = { [weak self] in
@@ -88,7 +78,7 @@ class BindPhoneNumberViewController: BaseViewController {
 
         phoneAreaCodeLabel.snp.makeConstraints { (make) in
             make.top.equalToSuperview().offset(6)
-            make.leading.equalToSuperview().offset(4)
+            make.left.equalToSuperview().offset(4)
             make.bottom.equalToSuperview()
         }
 
@@ -101,7 +91,7 @@ class BindPhoneNumberViewController: BaseViewController {
         phoneNumberTextField.snp.makeConstraints { (make) in
             make.left.equalTo(phoneAreaCodeIconImageView.snp.right).offset(15)
             make.top.bottom.equalTo(phoneAreaCodeLabel)
-            make.width.equalTo(kScreenWidth-76-65)
+            make.width.equalTo(kScreenWidth-76-35-phoneAreaCodeLabel.width)
         }
 
         smsBgView.snp.makeConstraints { (make) in
@@ -121,7 +111,7 @@ class BindPhoneNumberViewController: BaseViewController {
         smsTextField.snp.makeConstraints { (make) in
             make.bottom.top.equalTo(smsButton)
             make.left.equalTo(phoneAreaCodeLabel)
-            make.width.equalTo(0)
+            make.width.equalTo(kScreenWidth-76-30-smsButton.width)
         }
 
         bindPhoneNumberButton.snp.makeConstraints { (make) in
@@ -164,6 +154,7 @@ class BindPhoneNumberViewController: BaseViewController {
         phoneAreaCodeLabel.text = "+86"
         phoneAreaCodeLabel.textColor = k333333Color
         phoneAreaCodeLabel.font = kRegularFont16
+        phoneAreaCodeLabel.sizeToFit()
         phoneAreaCodeLabel.addTapGesture(1, target: self, action: #selector(phoneAreaCodeAction))
         return phoneAreaCodeLabel
     }()
@@ -182,6 +173,8 @@ class BindPhoneNumberViewController: BaseViewController {
         phoneNumberTextField.textColor = k666666Color
         phoneNumberTextField.font = kRegularFont16
         phoneNumberTextField.clearButtonMode = .whileEditing
+        phoneNumberTextField.sizeToFit()
+        phoneNumberTextField.keyboardType = .numberPad
         phoneNumberTextField.rx.text.changed.subscribe(onNext: { [weak self] (text) in
             self?.phoneNumberTextField.text = String(text?.prefix(11) ?? "") as String
             self?.phoneNumber = self?.phoneNumberTextField.text ?? ""
@@ -211,6 +204,7 @@ class BindPhoneNumberViewController: BaseViewController {
         smsButton.setTitleColor(k333333Color, for: UIControl.State.disabled)
         smsButton.titleLabel?.font = kRegularFont12
         smsButton.contentHorizontalAlignment = UIControl.ContentHorizontalAlignment.center
+        smsButton.sizeToFit()
         smsButton.normalBorderColor = kED3934Color
         smsButton.normalBorderWidth = 0.5
         smsButton.normalCornerRadius = 15
@@ -231,7 +225,8 @@ class BindPhoneNumberViewController: BaseViewController {
         smsTextField.borderStyle = .none
         smsTextField.textColor = k666666Color
         smsTextField.font = kRegularFont16
-        smsTextField.clearButtonMode = .whileEditing
+        smsTextField.sizeToFit()
+        smsTextField.keyboardType = .numberPad
         smsTextField.rx.text.changed.subscribe(onNext: { [weak self] (text) in
             self?.smsTextField.text = String(text?.prefix(6) ?? "") as String
             self?.sms = self?.smsTextField.text ?? ""
@@ -280,8 +275,8 @@ extension BindPhoneNumberViewController {
 
     /// 立即绑定
     @objc func bindPhoneNumberAction() {
+//        SwiftProgressHUD.shared().showText("手机号绑定成功")
         self.dismissToRootViewController(animated: true) {
-            SwiftProgressHUD.shared().showText("手机号绑定成功")
         }
     }
 

+ 106 - 0
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/PasswordLogin/ViewController/PasswordLoginViewController.swift

@@ -0,0 +1,106 @@
+//
+//  PasswordLoginViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/27.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+import RxCocoa
+
+class PasswordLoginViewController: BaseViewController {
+
+    @IBOutlet weak var phoneAreaCodeButton: UIButton!
+
+    @IBOutlet weak var phoneNumberTextField: UITextField!
+
+    @IBOutlet weak var passwordField: UITextField!
+
+    @IBOutlet weak var passwordLoginPhoneButton: UIButton!
+
+
+    /// 手机号
+    var phoneNumber : String = ""
+
+    ///
+    var password : String = ""
+
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        MobClick.beginLogPageView("PasswordLoginViewController:手机密码登录")
+    }
+
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+        MobClick.endLogPageView("PasswordLoginViewController:手机密码登录")
+    }
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+    }
+
+    override func setupViews() {
+
+        navigationBar.wr_setRightButton(title: "验证码登录", titleColor: k333333Color)
+        navigationBar.onClickRightButton = { [weak self] in
+            self?.present(VerificationPhoneViewController(), animated: true, completion: {
+
+            })
+        }
+        
+        passwordLoginPhoneButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+        passwordLoginPhoneButton.setTitleColor(k666666Color, for: UIControl.State.disabled)
+        passwordLoginPhoneButton.setBackgroundImage(UIImage.imageWithColor(color: kDisabledButtonColor), for: UIControl.State.disabled)
+        passwordLoginPhoneButton.setBackgroundImage(UIImage.imageWithColor(color: kEnabledButtonColor), for: UIControl.State.normal)
+        passwordLoginPhoneButton.titleLabel?.font = kRegularFont18
+        passwordLoginPhoneButton.cornerRadius = 22
+        passwordLoginPhoneButton.masksToBounds = true
+        passwordLoginPhoneButton.isEnabled = false
+
+        phoneNumberTextField.rx.text.changed.subscribe(onNext: { [weak self] (text) in
+            self?.phoneNumberTextField.text = String(text?.prefix(11) ?? "") as String
+            self?.phoneNumber = self?.phoneNumberTextField.text ?? ""
+            self?.observableString()
+        }).disposed(by: disposeBag)
+
+        passwordField.rx.text.changed.subscribe(onNext: { [weak self] (text) in
+            self?.passwordField.text = String(text?.prefix(6) ?? "") as String
+            self?.password = self?.passwordField.text ?? ""
+            self?.observableString()
+        }).disposed(by: disposeBag)
+    }
+
+    func observableString() {
+        Observable.combineLatest(Observable.just(phoneNumber), Observable.just(password)) { (textValue1, textValue2) -> Bool in
+            let textValue1 = String(textValue1.prefix(11)) as String
+            let textValue2 = String(textValue2.prefix(6)) as String
+            let isSuccess = (textValue1.count == 11) && (textValue2.count == 6)
+            return isSuccess
+            }.subscribe(onNext: {
+                [weak self] isEmpty in
+                self?.passwordLoginPhoneButton.isEnabled = isEmpty
+            }).disposed(by: self.disposeBag)
+    }
+
+    @IBAction func phoneAreaCodeAction(_ sender: UIButton) {
+        let vc = PhoneCountryAreaViewController()
+        vc.phoneCountryAreaVCCloSure = { [weak self] (phoneCountryAreaMdoel:PhoneCountryAreaMdoel) in
+            self?.phoneAreaCodeButton.setTitle(phoneCountryAreaMdoel.countryCode, for: UIControl.State.normal)
+        }
+        self.present(vc, animated: true) {
+
+        }
+    }
+
+    /// 登录
+    @IBAction  func verificationPhoneNumberAction() {
+        SwiftProgressHUD.shared().showText("手机号绑定成功")
+
+        self.dismissToRootViewController(animated: true) {
+        }
+    }
+
+}

+ 132 - 0
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/PasswordLogin/ViewController/PasswordLoginViewController.xib

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_1" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PasswordLoginViewController" customModule="RainbowPlanet" customModuleProvider="target">
+            <connections>
+                <outlet property="passwordField" destination="Rnr-8g-3v3" id="yq7-oN-KpK"/>
+                <outlet property="passwordLoginPhoneButton" destination="h0N-yi-WZR" id="AH6-31-QKN"/>
+                <outlet property="phoneAreaCodeButton" destination="OQA-ID-bcU" id="OfC-DA-09c"/>
+                <outlet property="phoneNumberTextField" destination="MDi-IA-MsI" id="C5h-fC-yp0"/>
+                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
+            <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="手机密码登录" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GbB-x9-TI1">
+                    <rect key="frame" x="40" y="174" width="134" height="26.5"/>
+                    <fontDescription key="fontDescription" type="boldSystem" pointSize="22"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OQA-ID-bcU">
+                    <rect key="frame" x="40" y="255.5" width="30" height="23"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="23" id="LZV-4G-O6h"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                    <state key="normal" title="+86">
+                        <color key="titleColor" red="0.1529239714" green="0.1529521942" blue="0.15291777249999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </state>
+                    <connections>
+                        <action selector="phoneAreaCodeAction:" destination="-1" eventType="touchUpInside" id="bsi-lt-2t3"/>
+                    </connections>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AXC-eT-swR">
+                    <rect key="frame" x="74" y="256" width="9" height="22"/>
+                    <state key="normal" image="navigaitionbar_back_black"/>
+                </button>
+                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="手机号" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="MDi-IA-MsI">
+                    <rect key="frame" x="96" y="257" width="278" height="20"/>
+                    <constraints>
+                        <constraint firstAttribute="width" relation="greaterThanOrEqual" id="bg6-oq-PrE"/>
+                    </constraints>
+                    <nil key="textColor"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                    <textInputTraits key="textInputTraits" keyboardType="numberPad"/>
+                </textField>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="exQ-CF-oWP">
+                    <rect key="frame" x="38" y="287" width="338" height="1"/>
+                    <color key="backgroundColor" red="0.96070033310000003" green="0.96083813910000004" blue="0.96067017320000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="1" id="lih-lw-uxO"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入密码" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="Rnr-8g-3v3">
+                    <rect key="frame" x="40" y="301" width="332" height="30"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="30" id="pMg-Cq-a8e"/>
+                    </constraints>
+                    <nil key="textColor"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                    <textInputTraits key="textInputTraits" keyboardType="numberPad"/>
+                </textField>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aWg-xg-QGQ">
+                    <rect key="frame" x="38" y="341" width="338" height="1"/>
+                    <color key="backgroundColor" red="0.96070033310000003" green="0.96083813910000004" blue="0.96067017320000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="1" id="hew-BM-VMD"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="h0N-yi-WZR">
+                    <rect key="frame" x="38" y="377" width="338" height="44"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="aib-bd-jwC"/>
+                    </constraints>
+                    <state key="normal" title="登录"/>
+                    <state key="disabled" title="登录">
+                        <color key="titleColor" red="0.4078049064" green="0.4078676403" blue="0.40779113769999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </state>
+                    <connections>
+                        <action selector="verificationPhoneNumberAction" destination="-1" eventType="touchUpInside" id="zc0-b1-kb8"/>
+                    </connections>
+                </button>
+            </subviews>
+            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="h0N-yi-WZR" firstAttribute="trailing" secondItem="aWg-xg-QGQ" secondAttribute="trailing" id="1jZ-Qm-yVi"/>
+                <constraint firstItem="aWg-xg-QGQ" firstAttribute="top" secondItem="Rnr-8g-3v3" secondAttribute="bottom" constant="10" id="778-qx-cZ4"/>
+                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Rnr-8g-3v3" secondAttribute="trailing" constant="42" id="94g-Kl-QCN"/>
+                <constraint firstItem="h0N-yi-WZR" firstAttribute="top" secondItem="aWg-xg-QGQ" secondAttribute="bottom" constant="35" id="E4f-A0-WrM"/>
+                <constraint firstItem="Rnr-8g-3v3" firstAttribute="top" secondItem="exQ-CF-oWP" secondAttribute="bottom" constant="13" id="EaJ-o6-C8O"/>
+                <constraint firstItem="h0N-yi-WZR" firstAttribute="leading" secondItem="aWg-xg-QGQ" secondAttribute="leading" id="Noq-H2-q2f"/>
+                <constraint firstItem="AXC-eT-swR" firstAttribute="leading" secondItem="OQA-ID-bcU" secondAttribute="trailing" constant="4" id="Q1l-fI-vx0"/>
+                <constraint firstItem="Rnr-8g-3v3" firstAttribute="leading" secondItem="OQA-ID-bcU" secondAttribute="leading" id="S6D-Vw-1Hc"/>
+                <constraint firstItem="aWg-xg-QGQ" firstAttribute="trailing" secondItem="exQ-CF-oWP" secondAttribute="trailing" id="Sh8-kU-lSZ"/>
+                <constraint firstItem="MDi-IA-MsI" firstAttribute="centerY" secondItem="OQA-ID-bcU" secondAttribute="centerY" id="TL8-Uf-Kcd"/>
+                <constraint firstItem="AXC-eT-swR" firstAttribute="centerY" secondItem="OQA-ID-bcU" secondAttribute="centerY" id="ViO-so-Whh"/>
+                <constraint firstItem="exQ-CF-oWP" firstAttribute="trailing" secondItem="MDi-IA-MsI" secondAttribute="trailing" constant="2" id="bJG-lm-gVN"/>
+                <constraint firstItem="exQ-CF-oWP" firstAttribute="top" secondItem="MDi-IA-MsI" secondAttribute="bottom" constant="10" id="cFX-e1-XH7"/>
+                <constraint firstItem="GbB-x9-TI1" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="130" id="eVF-IZ-Ild"/>
+                <constraint firstItem="aWg-xg-QGQ" firstAttribute="leading" secondItem="exQ-CF-oWP" secondAttribute="leading" id="ei7-KZ-tpz"/>
+                <constraint firstItem="OQA-ID-bcU" firstAttribute="top" secondItem="GbB-x9-TI1" secondAttribute="bottom" constant="55" id="gVG-EI-lBG"/>
+                <constraint firstItem="exQ-CF-oWP" firstAttribute="leading" secondItem="OQA-ID-bcU" secondAttribute="leading" constant="-2" id="lG3-vP-aeb"/>
+                <constraint firstAttribute="trailing" secondItem="exQ-CF-oWP" secondAttribute="trailing" constant="38" id="lbF-Oa-ubT"/>
+                <constraint firstItem="GbB-x9-TI1" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="40" id="qjN-sk-EPu"/>
+                <constraint firstItem="OQA-ID-bcU" firstAttribute="leading" secondItem="GbB-x9-TI1" secondAttribute="leading" id="r9K-a9-49y"/>
+                <constraint firstItem="MDi-IA-MsI" firstAttribute="leading" secondItem="AXC-eT-swR" secondAttribute="trailing" constant="13" id="uTH-r9-h3y"/>
+            </constraints>
+            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="navigaitionbar_back_black" width="9" height="17"/>
+    </resources>
+</document>

+ 5 - 2
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/ThirdPartyLogin/ViewController/ThirdPartyLoginViewController.swift

@@ -95,11 +95,14 @@ extension ThirdPartyLoginViewController {
 
         // 没有绑定手机号
         self.present(BindPhoneNumberViewController(), animated: true) {
-            SwiftProgressHUD.shared().showText("登录成功")
+
+//            SwiftProgressHUD.shared().showText("登录成功")
         }
     }
 
     @objc private func phoneNumberAction()  {
-
+        self.present(VerificationPhoneViewController(), animated: true) {
+            
+        }
     }
 }

+ 132 - 0
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/VerificationPhone/ViewController/VerificationPhoneViewController.swift

@@ -0,0 +1,132 @@
+//
+//  VerificationPhoneViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/3/27.
+//  Copyright © 2019 南鑫林. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+import RxCocoa
+
+class VerificationPhoneViewController: BaseViewController {
+
+    @IBOutlet weak var phoneAreaCodeButton: UIButton!
+
+    @IBOutlet weak var smsButton: CountdownButton!
+
+    @IBOutlet weak var verificationPhoneButton: UIButton!
+
+    @IBOutlet weak var phoneNumberTextField: UITextField!
+
+    @IBOutlet weak var smsTextField: UITextField!
+
+    /// 手机号
+    var phoneNumber : String = ""
+
+    ///
+    var sms : String = ""
+
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        MobClick.beginLogPageView("VerificationPhoneViewController:验证手机页面")
+    }
+
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+        MobClick.endLogPageView("VerificationPhoneViewController:验证手机页面")
+    }
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+    }
+
+    override func setupViews() {
+
+        navigationBar.wr_setRightButton(title: "手机密码登录", titleColor: k333333Color)
+        navigationBar.onClickRightButton = {[weak self] in
+            self?.present(PasswordLoginViewController(), animated: true, completion: {
+                
+            })
+        }
+
+        smsButton.normalText = "  获取验证码  "
+        smsButton.disabledText = "  seconds后重新获取  "
+        smsButton.setTitle(smsButton.normalText, for: UIControl.State.normal)
+        smsButton.setTitle(smsButton.disabledText, for: UIControl.State.disabled)
+        smsButton.setTitleColor(kED3934Color, for: UIControl.State.normal)
+        smsButton.setTitleColor(k333333Color, for: UIControl.State.disabled)
+        smsButton.titleLabel?.font = kRegularFont12
+        smsButton.contentHorizontalAlignment = UIControl.ContentHorizontalAlignment.center
+        smsButton.sizeToFit()
+        smsButton.normalBorderColor = kED3934Color
+        smsButton.normalBorderWidth = 0.5
+        smsButton.normalCornerRadius = 15
+        smsButton.normalBackgroundColor = UIColor.white
+        smsButton.disabledBorderColor = ke6e6e6Color
+        smsButton.disabledBorderWidth = 0.5
+        smsButton.disabledCornerRadius = 15
+        smsButton.disabledBackgroundColor = ke6e6e6Color
+        smsButton.maxSecond = 60
+        smsButton.updateNormal()
+
+        verificationPhoneButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+        verificationPhoneButton.setTitleColor(k666666Color, for: UIControl.State.disabled)
+        verificationPhoneButton.setBackgroundImage(UIImage.imageWithColor(color: kDisabledButtonColor), for: UIControl.State.disabled)
+        verificationPhoneButton.setBackgroundImage(UIImage.imageWithColor(color: kEnabledButtonColor), for: UIControl.State.normal)
+        verificationPhoneButton.titleLabel?.font = kRegularFont18
+        verificationPhoneButton.cornerRadius = 22
+        verificationPhoneButton.masksToBounds = true
+        verificationPhoneButton.isEnabled = false
+
+        phoneNumberTextField.rx.text.changed.subscribe(onNext: { [weak self] (text) in
+            self?.phoneNumberTextField.text = String(text?.prefix(11) ?? "") as String
+            self?.phoneNumber = self?.phoneNumberTextField.text ?? ""
+            self?.observableString()
+        }).disposed(by: disposeBag)
+
+        smsTextField.rx.text.changed.subscribe(onNext: { [weak self] (text) in
+            self?.smsTextField.text = String(text?.prefix(6) ?? "") as String
+            self?.sms = self?.smsTextField.text ?? ""
+            self?.observableString()
+        }).disposed(by: disposeBag)
+    }
+
+    func observableString() {
+        Observable.combineLatest(Observable.just(phoneNumber), Observable.just(sms)) { (textValue1, textValue2) -> Bool in
+            let textValue1 = String(textValue1.prefix(11)) as String
+            let textValue2 = String(textValue2.prefix(6)) as String
+            let isSuccess = (textValue1.count == 11) && (textValue2.count == 6)
+            return isSuccess
+            }.subscribe(onNext: {
+                [weak self] isEmpty in
+                self?.verificationPhoneButton.isEnabled = isEmpty
+            }).disposed(by: self.disposeBag)
+    }
+
+
+    @IBAction func phoneAreaCodeAction(_ sender: UIButton) {
+        let vc = PhoneCountryAreaViewController()
+        vc.phoneCountryAreaVCCloSure = { [weak self] (phoneCountryAreaMdoel:PhoneCountryAreaMdoel) in
+            self?.phoneAreaCodeButton.setTitle(phoneCountryAreaMdoel.countryCode, for: UIControl.State.normal)
+        }
+        self.present(vc, animated: true) {
+
+        }
+    }
+
+    @IBAction func smsAction(_ sender: CountdownButton) {
+        smsButton.countdown = true
+    }
+
+    /// 立即验证
+    @IBAction  func verificationPhoneNumberAction() {
+
+        self.dismissToRootViewController(animated: true) {
+
+        }
+    }
+
+}

+ 160 - 0
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/VerificationPhone/ViewController/VerificationPhoneViewController.xib

@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_1" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VerificationPhoneViewController" customModule="RainbowPlanet" customModuleProvider="target">
+            <connections>
+                <outlet property="phoneAreaCodeButton" destination="IOo-UT-Wma" id="DqP-7u-scX"/>
+                <outlet property="phoneNumberTextField" destination="hok-U6-Jpp" id="xPM-cW-2ET"/>
+                <outlet property="smsButton" destination="3hc-O5-000" id="aeh-ze-CuL"/>
+                <outlet property="smsTextField" destination="4bp-Bn-Pg2" id="Nan-o3-2rd"/>
+                <outlet property="verificationPhoneButton" destination="gwS-rH-oAP" id="9Pz-40-bzD"/>
+                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
+            <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="验证手机" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RVj-0q-UUy">
+                    <rect key="frame" x="40" y="164" width="89.5" height="26.5"/>
+                    <fontDescription key="fontDescription" type="boldSystem" pointSize="22"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="为了账号安全,请验证手机" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CWG-xW-WkB">
+                    <rect key="frame" x="40" y="196.5" width="138.5" height="14.5"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                    <color key="textColor" red="0.52544218301773071" green="0.52552098035812378" blue="0.52542495727539062" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IOo-UT-Wma">
+                    <rect key="frame" x="40" y="254" width="30" height="23"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="23" id="KeH-GN-gZa"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                    <state key="normal" title="+86">
+                        <color key="titleColor" red="0.15292397141456604" green="0.15295219421386719" blue="0.1529177725315094" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </state>
+                    <connections>
+                        <action selector="phoneAreaCodeAction:" destination="-1" eventType="touchUpInside" id="5Dr-bU-k3T"/>
+                    </connections>
+                </button>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pqj-XU-gBa">
+                    <rect key="frame" x="74" y="254.5" width="9" height="22"/>
+                    <state key="normal" image="navigaitionbar_back_black"/>
+                    <connections>
+                        <action selector="phoneAreaCodeAction:" destination="-1" eventType="touchUpInside" id="z3d-bP-hH4"/>
+                    </connections>
+                </button>
+                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="手机号" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hok-U6-Jpp">
+                    <rect key="frame" x="96" y="255.5" width="280" height="20"/>
+                    <constraints>
+                        <constraint firstAttribute="width" relation="greaterThanOrEqual" id="LQm-b8-Gks"/>
+                    </constraints>
+                    <nil key="textColor"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                    <textInputTraits key="textInputTraits" keyboardType="numberPad"/>
+                </textField>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6ZA-jb-dcL">
+                    <rect key="frame" x="38" y="285.5" width="340" height="1"/>
+                    <color key="backgroundColor" red="0.96070033311843872" green="0.96083813905715942" blue="0.96067017316818237" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="1" id="rmF-nQ-4ra"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3hc-O5-000" customClass="CountdownButton" customModule="RainbowPlanet" customModuleProvider="target">
+                    <rect key="frame" x="280" y="299.5" width="92" height="30"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="30" id="fbN-gR-CKn"/>
+                        <constraint firstAttribute="width" relation="greaterThanOrEqual" id="xIQ-4L-d3G"/>
+                    </constraints>
+                    <state key="normal" title="获取验证码">
+                        <color key="titleColor" red="0.94900625944137573" green="0.42618435621261597" blue="0.41407948732376099" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </state>
+                    <connections>
+                        <action selector="smsAction:" destination="-1" eventType="touchUpInside" id="SKh-eq-YyC"/>
+                    </connections>
+                </button>
+                <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="验证码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="4bp-Bn-Pg2">
+                    <rect key="frame" x="40" y="299.5" width="230" height="30"/>
+                    <nil key="textColor"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                    <textInputTraits key="textInputTraits" keyboardType="numberPad"/>
+                </textField>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="baU-2G-k7g">
+                    <rect key="frame" x="38" y="339.5" width="340" height="1"/>
+                    <color key="backgroundColor" red="0.96070033310000003" green="0.96083813910000004" blue="0.96067017320000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="1" id="l1O-Wr-e3D"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gwS-rH-oAP">
+                    <rect key="frame" x="38" y="375.5" width="340" height="44"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="PKv-Lc-VaO"/>
+                    </constraints>
+                    <state key="normal" title="立即验证">
+                        <color key="titleColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </state>
+                    <state key="disabled" title="立即验证">
+                        <color key="titleColor" red="0.40780490636825562" green="0.40786764025688171" blue="0.4077911376953125" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </state>
+                    <connections>
+                        <action selector="verificationPhoneNumberAction" destination="-1" eventType="touchUpInside" id="gUg-Rk-GL6"/>
+                    </connections>
+                </button>
+            </subviews>
+            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="gwS-rH-oAP" firstAttribute="trailing" secondItem="baU-2G-k7g" secondAttribute="trailing" id="0cg-I6-XTh"/>
+                <constraint firstItem="baU-2G-k7g" firstAttribute="leading" secondItem="6ZA-jb-dcL" secondAttribute="leading" id="0nt-qu-Qwb"/>
+                <constraint firstItem="4bp-Bn-Pg2" firstAttribute="centerY" secondItem="3hc-O5-000" secondAttribute="centerY" id="2xX-cw-F5R"/>
+                <constraint firstItem="gwS-rH-oAP" firstAttribute="leading" secondItem="baU-2G-k7g" secondAttribute="leading" id="6R7-UO-qWT"/>
+                <constraint firstItem="IOo-UT-Wma" firstAttribute="top" secondItem="CWG-xW-WkB" secondAttribute="bottom" constant="43" id="7qV-La-yWE"/>
+                <constraint firstItem="IOo-UT-Wma" firstAttribute="leading" secondItem="CWG-xW-WkB" secondAttribute="leading" id="8UG-A8-rWc"/>
+                <constraint firstItem="RVj-0q-UUy" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="40" id="8by-Jk-bHB"/>
+                <constraint firstItem="pqj-XU-gBa" firstAttribute="leading" secondItem="IOo-UT-Wma" secondAttribute="trailing" constant="4" id="Ayn-Fx-82Q"/>
+                <constraint firstItem="baU-2G-k7g" firstAttribute="top" secondItem="3hc-O5-000" secondAttribute="bottom" constant="10" id="EoG-qx-mPV"/>
+                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="3hc-O5-000" secondAttribute="trailing" constant="42" id="IOf-bJ-uQU"/>
+                <constraint firstItem="CWG-xW-WkB" firstAttribute="leading" secondItem="RVj-0q-UUy" secondAttribute="leading" id="ORj-bn-i8M"/>
+                <constraint firstItem="hok-U6-Jpp" firstAttribute="centerY" secondItem="IOo-UT-Wma" secondAttribute="centerY" id="S6A-zY-CIb"/>
+                <constraint firstItem="6ZA-jb-dcL" firstAttribute="leading" secondItem="IOo-UT-Wma" secondAttribute="leading" constant="-2" id="WZ1-MZ-u2s"/>
+                <constraint firstItem="hok-U6-Jpp" firstAttribute="leading" secondItem="pqj-XU-gBa" secondAttribute="trailing" constant="13" id="X84-L3-iPS"/>
+                <constraint firstItem="baU-2G-k7g" firstAttribute="trailing" secondItem="6ZA-jb-dcL" secondAttribute="trailing" id="azb-Qd-CQu"/>
+                <constraint firstItem="6ZA-jb-dcL" firstAttribute="top" secondItem="hok-U6-Jpp" secondAttribute="bottom" constant="10" id="bEa-Ce-A7m"/>
+                <constraint firstItem="4bp-Bn-Pg2" firstAttribute="height" secondItem="3hc-O5-000" secondAttribute="height" id="eHb-mv-uMb"/>
+                <constraint firstItem="gwS-rH-oAP" firstAttribute="top" secondItem="baU-2G-k7g" secondAttribute="bottom" constant="35" id="fCl-it-zlI"/>
+                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="hok-U6-Jpp" secondAttribute="trailing" constant="38" id="fGk-ro-dz3"/>
+                <constraint firstItem="pqj-XU-gBa" firstAttribute="centerY" secondItem="IOo-UT-Wma" secondAttribute="centerY" id="hg4-hm-Q8E"/>
+                <constraint firstItem="CWG-xW-WkB" firstAttribute="top" secondItem="RVj-0q-UUy" secondAttribute="bottom" constant="6" id="im9-YW-sRV"/>
+                <constraint firstItem="RVj-0q-UUy" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="120" id="n0M-J5-xrN"/>
+                <constraint firstItem="6ZA-jb-dcL" firstAttribute="trailing" secondItem="hok-U6-Jpp" secondAttribute="trailing" constant="2" id="rVw-ZK-91G"/>
+                <constraint firstItem="3hc-O5-000" firstAttribute="leading" secondItem="4bp-Bn-Pg2" secondAttribute="trailing" constant="10" id="vQy-sH-Z0j"/>
+                <constraint firstItem="3hc-O5-000" firstAttribute="top" secondItem="6ZA-jb-dcL" secondAttribute="bottom" constant="13" id="xA5-W9-EQv"/>
+                <constraint firstItem="4bp-Bn-Pg2" firstAttribute="leading" secondItem="IOo-UT-Wma" secondAttribute="leading" id="zUo-Wo-gk2"/>
+            </constraints>
+            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
+            <point key="canvasLocation" x="147.82608695652175" y="35.491071428571423"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="navigaitionbar_back_black" width="9" height="17"/>
+    </resources>
+</document>

+ 3 - 3
RainbowPlanet/RainbowPlanet/Supporting Files/Info.plist

@@ -37,7 +37,7 @@
 			<string>tencent</string>
 			<key>CFBundleURLSchemes</key>
 			<array>
-				<string>tencent1105803948</string>
+				<string>tencent101565722</string>
 			</array>
 		</dict>
 		<dict>
@@ -47,7 +47,7 @@
 			<string>QQ</string>
 			<key>CFBundleURLSchemes</key>
 			<array>
-				<string>QQ41e93aac</string>
+				<string>QQ060dc51a</string>
 			</array>
 		</dict>
 		<dict>
@@ -57,7 +57,7 @@
 			<string>weixin</string>
 			<key>CFBundleURLSchemes</key>
 			<array>
-				<string>wx647d93490caf548f</string>
+				<string>wx163e76382d53654b</string>
 			</array>
 		</dict>
 	</array>

+ 30 - 0
RainbowPlanet/RainbowPlanet/Tools/WRNavigationBar/WRCustomNavigationBar.swift

@@ -228,22 +228,52 @@ extension WRCustomNavigationBar
     // 左右按钮共有方法
     func wr_setLeftButton(normal:UIImage, highlighted:UIImage) {
         wr_setLeftButton(normal: normal, highlighted: highlighted, title: nil, titleColor: nil)
+        leftButton.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kSafeStatusBarHeight)
+            make.left.equalToSuperview()
+            make.size.equalTo(44)
+        }
     }
     func wr_setLeftButton(image:UIImage) {
         wr_setLeftButton(normal: image, highlighted: image, title: nil, titleColor: nil)
+        leftButton.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kSafeStatusBarHeight)
+            make.left.equalToSuperview()
+            make.size.equalTo(44)
+        }
     }
     func wr_setLeftButton(title:String, titleColor:UIColor) {
         wr_setLeftButton(normal: nil, highlighted: nil, title: title, titleColor: titleColor)
+        leftButton.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kSafeStatusBarHeight)
+            make.left.equalToSuperview()
+            make.height.equalTo(44)
+        }
     }
     
     func wr_setRightButton(normal:UIImage, highlighted:UIImage) {
         wr_setRightButton(normal: normal, highlighted: highlighted, title: nil, titleColor: nil)
+        rightButton.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kSafeStatusBarHeight)
+            make.right.equalToSuperview()
+            make.size.equalTo(44)
+        }
     }
     func wr_setRightButton(image:UIImage) {
         wr_setRightButton(normal: image, highlighted: image, title: nil, titleColor: nil)
+        rightButton.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kSafeStatusBarHeight)
+            make.right.equalToSuperview()
+            make.size.equalTo(44)
+        }
     }
     func wr_setRightButton(title:String, titleColor:UIColor) {
         wr_setRightButton(normal: nil, highlighted: nil, title: title, titleColor: titleColor)
+        rightButton.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kSafeStatusBarHeight)
+            make.right.equalToSuperview().offset(-16)
+            make.height.equalTo(44)
+        }
     }