nanxinlin vor 6 Jahren
Ursprung
Commit
79a5949159

+ 6 - 1
RainbowPlanet/Podfile

@@ -22,6 +22,8 @@ target 'RainbowPlanet' do
   pod 'Kingfisher'
   # 自动布局
   pod 'SnapKit'
+  # 自动布局
+  pod 'TangramKit'
   # 键盘
   pod 'IQKeyboardManagerSwift'
   # 加密
@@ -78,8 +80,11 @@ target 'RainbowPlanet' do
 #  pod 'Bugly'
 
   #=====================百度地图===========
-  #百度地图定位SDK
+#  #百度地图定位SDK
   pod 'BMKLocationKit'
+#
+#  #百度地图
+#  pod 'BaiduMapKit'
 
 
   target 'RainbowPlanetTests' do

+ 13 - 9
RainbowPlanet/Podfile.lock

@@ -23,13 +23,14 @@ PODS:
   - RealmSwift (3.13.1):
     - Realm (= 3.13.1)
   - Result (4.1.0)
-  - RxAtomic (4.4.1)
-  - RxCocoa (4.4.1):
-    - RxSwift (~> 4.0)
-  - RxSwift (4.4.1):
-    - RxAtomic (~> 4.4)
+  - RxAtomic (4.4.2)
+  - RxCocoa (4.4.2):
+    - RxSwift (>= 4.4.2, ~> 4.4)
+  - RxSwift (4.4.2):
+    - RxAtomic (>= 4.4.2, ~> 4.4)
   - SnapKit (4.2.0)
   - SwiftyJSON (4.2.0)
+  - TangramKit (1.3.1)
   - UMCAnalytics (6.0.2):
     - UMCCommon
   - UMCCommon (2.0.0)
@@ -69,6 +70,7 @@ DEPENDENCIES:
   - RxSwift
   - SnapKit
   - SwiftyJSON
+  - TangramKit
   - UMCAnalytics
   - UMCCommon
   - UMCCommonLog
@@ -101,6 +103,7 @@ SPEC REPOS:
     - RxSwift
     - SnapKit
     - SwiftyJSON
+    - TangramKit
     - UMCAnalytics
     - UMCCommon
     - UMCCommonLog
@@ -124,11 +127,12 @@ SPEC CHECKSUMS:
   Realm: 50071da38fe079e0735e47c9f2eae738c68c5996
   RealmSwift: 8a1e6a02b7a08cd17a31e3115143fb69fe5f3fb9
   Result: bd966fac789cc6c1563440b348ab2598cc24d5c7
-  RxAtomic: f8d6adc1ccb87a767811269e4875887bc74dbf19
-  RxCocoa: 2f35a76bf8887872e28a1914112395b11b8e0e64
-  RxSwift: 92fcf68dfef21f3e2ab1965363d9e7b3d787597e
+  RxAtomic: d00e97c10db88c6f08540e0bf2752fc5a2404167
+  RxCocoa: 477990dc3b4c3ff55fb0ac77e1cc06244e0aaec8
+  RxSwift: 74c29b693c8e42b0f64400e8b06564575742d649
   SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a
   SwiftyJSON: c4bcba26dd9ec7a027fc8eade48e2c911f229e96
+  TangramKit: 1b4ee065845919057bdbe930ba39deecbbff181e
   UMCAnalytics: 901960ede5a8a85f208bd37689ad3e607b433930
   UMCCommon: 79b5a614c958db367113eed5740109d9a98e1223
   UMCCommonLog: 05a2d5de21858e3d870551562cff405c1366d244
@@ -136,6 +140,6 @@ SPEC CHECKSUMS:
   UMCSecurityPlugins: 0831a08f3988f3cea9f1d3a7626cd9bee4fef150
   UMCShare: 552b29753f1b4da87b51d96545ed19e6263df397
 
-PODFILE CHECKSUM: 20a783d7be0dea6d41d9b43290b02df1af373ad5
+PODFILE CHECKSUM: 05251c9a8b8212b41a266957c2e10072ff6f5b64
 
 COCOAPODS: 1.5.3

+ 18 - 4
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -275,6 +275,7 @@
 		A77F2CC522320627001BD3F6 /* WRNavigationBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WRNavigationBar.swift; sourceTree = "<group>"; };
 		A77F2CC622320627001BD3F6 /* WRCustomNavigationBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WRCustomNavigationBar.swift; sourceTree = "<group>"; };
 		A77F2CC9223209F2001BD3F6 /* BaseTabbarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTabbarViewController.swift; sourceTree = "<group>"; };
+		A7A59A7722363CCB00417FA4 /* RainbowPlanet.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RainbowPlanet.entitlements; sourceTree = "<group>"; };
 		A7E03A30F40582782EC5DA89 /* Pods_RainbowPlanetTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RainbowPlanetTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		B1B8205A06E3602D2CF199C8 /* Pods-RainbowPlanetTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RainbowPlanetTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RainbowPlanetTests/Pods-RainbowPlanetTests.release.xcconfig"; sourceTree = "<group>"; };
 		BD9052C044FD3AE4E62D3929 /* Pods-RainbowPlanet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RainbowPlanet.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RainbowPlanet/Pods-RainbowPlanet.debug.xcconfig"; sourceTree = "<group>"; };
@@ -679,6 +680,7 @@
 		A77F2C5F2231FB49001BD3F6 /* RainbowPlanet */ = {
 			isa = PBXGroup;
 			children = (
+				A7A59A7722363CCB00417FA4 /* RainbowPlanet.entitlements */,
 				A77F2C8E2231FC5C001BD3F6 /* AppDelegate */,
 				A77F2C8F2231FC65001BD3F6 /* Base */,
 				A77F2CA22232010F001BD3F6 /* Modules */,
@@ -1013,6 +1015,14 @@
 					A77F2C5C2231FB49001BD3F6 = {
 						CreatedOnToolsVersion = 10.1;
 						LastSwiftMigration = 1010;
+						SystemCapabilities = {
+							com.apple.BackgroundModes = {
+								enabled = 1;
+							};
+							com.apple.Push = {
+								enabled = 1;
+							};
+						};
 					};
 					A77F2C702231FB4A001BD3F6 = {
 						CreatedOnToolsVersion = 10.1;
@@ -1152,6 +1162,7 @@
 				"${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework",
 				"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
 				"${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework",
+				"${BUILT_PRODUCTS_DIR}/TangramKit/TangramKit.framework",
 			);
 			name = "[CP] Embed Pods Frameworks";
 			outputFileListPaths = (
@@ -1176,6 +1187,7 @@
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TangramKit.framework",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
@@ -1473,8 +1485,9 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
 				CLANG_ENABLE_MODULES = YES;
+				CODE_SIGN_ENTITLEMENTS = RainbowPlanet/RainbowPlanet.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				DEVELOPMENT_TEAM = 3DG4J39B63;
+				DEVELOPMENT_TEAM = B4UG6NNMLL;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -1584,7 +1597,7 @@
 					"-force_load",
 					"\"$(SRCROOT)/RainbowPlanet/Lib/ShanYanSDK/CL_ShanYanSDK.framework/CL_ShanYanSDK\"",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = "com.chxq.rainbow-planet";
+				PRODUCT_BUNDLE_IDENTIFIER = com.chxq.rainbowplanet;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "RainbowPlanet/Define/RainbowPlanet-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -1600,8 +1613,9 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
 				CLANG_ENABLE_MODULES = YES;
+				CODE_SIGN_ENTITLEMENTS = RainbowPlanet/RainbowPlanet.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				DEVELOPMENT_TEAM = 3DG4J39B63;
+				DEVELOPMENT_TEAM = B4UG6NNMLL;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -1711,7 +1725,7 @@
 					"-force_load",
 					"\"$(SRCROOT)/RainbowPlanet/Lib/ShanYanSDK/CL_ShanYanSDK.framework/CL_ShanYanSDK\"",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = "com.chxq.rainbow-planet";
+				PRODUCT_BUNDLE_IDENTIFIER = com.chxq.rainbowplanet;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "RainbowPlanet/Define/RainbowPlanet-Bridging-Header.h";
 				SWIFT_VERSION = 4.2;

+ 14 - 1
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+BaiduMap.swift

@@ -11,9 +11,22 @@ import Foundation
 
 extension AppDelegate {
     func initBaiduMap() -> Void {
-        BMKLocationAuth.sharedInstance()?.checkPermision(withKey: kBaiduMapAppKey, authDelegate: BaiduMapManager.getSharedInstance())
+        BMKLocationAuth.sharedInstance()?.checkPermision(withKey: kBaiduMapAppKey, authDelegate: self)
         //定位
         BaiduMapManager.getSharedInstance().initLocation()
     }
 }
 
+extension AppDelegate: BMKLocationAuthDelegate {
+
+    func onCheckPermissionState(_ iError: BMKLocationAuthErrorCode) {
+        if (0 == iError.rawValue) {
+            NXLLog("授权成功");
+        } else {
+            NXLLog("授权失败 \(iError)");
+            LocationModel.setLocationModel(locationModel: LocationModel.getLocationModel()!)
+
+        }
+    }
+}
+

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

@@ -21,8 +21,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         initWindow()
         //初始化友盟
         initUM(launchOptions: launchOptions)
-        //闪验
-        initShanYan()
         //初始化键盘
         initIQKeyboard()
         return true

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

@@ -36,7 +36,7 @@ func kScaleValue(value:CGFloat) -> CGFloat {
 ///状态栏高度
 let kStatusBarHeight = UIApplication.shared.statusBarFrame.size.height
 ///navigation高度
-let kNavBarHeight = 44.0;
+let kNavBarHeight = 44.0
 ///状态栏顶部的高度
 let kStatusBarTopHeight = statusBarTopHeight()
 ///kNavBar高度

+ 2 - 1
RainbowPlanet/RainbowPlanet/Define/ThirdPartyMacro.swift

@@ -26,8 +26,9 @@ let kWeiXinAppSecret = "c5dc884f79a1bb00e96d76a3e16da39a"
 //MARK: - 微博
 let kWeiboAppKey  = "2824278574"
 let kWeiboAppSecret  = "0be988a21b045ecf948ba5838b72f689"
+
 //MARK: - 百度地图
-let kBaiduMapAppKey  = ""
+let kBaiduMapAppKey  = "6Z2pUPW3b8mmCbMs9D0RWN6LeUa4jyyv"
 
 //MARK: - 闪验
 let kShanYanAppId  = ""

+ 9 - 17
RainbowPlanet/RainbowPlanet/Manager/BaiduMapManager/BaiduMapManager.swift

@@ -17,17 +17,21 @@ class BaiduMapManager: NSObject {
         return _sharedInstance
     }
 
-    private override init() {} // 私有化init方法
+    private override init() {
 
+    } // 私有化init方法
+    
     func initLocation() -> Void {
         initBlock()
-        self.locationManager.requestLocation(withReGeocode: true, withNetworkState: true, completionBlock: self.completionBlock!)
+
+        locationManager.requestLocation(withReGeocode: true, withNetworkState: true, completionBlock: self.completionBlock!)
 
     }
 
     func initBlock() -> Void {
         completionBlock = { location, state, error in
-            if error != nil {
+
+            if (error != nil)  {
                 LocationModel.setLocationModel(locationModel: LocationModel.getLocationModel()!)
             } else {
                 let locationModel = LocationModel.init(latitude: String(describing: location!.location!.coordinate.latitude), longitude: String(describing: location!.location!.coordinate.longitude), cityCode: location!.rgcData!.cityCode ?? "", province: location!.rgcData!.province ?? "", city: location!.rgcData!.city ?? "", district: location!.rgcData!.district ?? "", street: location!.rgcData!.street ?? "", locationDescribe: location!.rgcData!.locationDescribe ?? "")
@@ -37,7 +41,7 @@ class BaiduMapManager: NSObject {
         }
     }
 
-    lazy var locationManager: BMKLocationManager = {
+    private lazy var locationManager: BMKLocationManager = {
         let locationManager = BMKLocationManager.init()
         //设置delegate
         locationManager.delegate = self
@@ -61,6 +65,7 @@ class BaiduMapManager: NSObject {
     }()
 
 
+
 }
 
 extension BaiduMapManager:BMKLocationManagerDelegate {
@@ -77,16 +82,3 @@ extension BaiduMapManager:BMKLocationManagerDelegate {
         NXLLog("定位权限改变时候的回调");
     }
 }
-
-extension BaiduMapManager: BMKLocationAuthDelegate {
-
-    func onCheckPermissionState(_ iError: BMKLocationAuthErrorCode) {
-        if (0 == iError.rawValue) {
-            NXLLog("授权成功");
-        } else {
-            NXLLog("授权失败 \(iError)");
-            LocationModel.setLocationModel(locationModel: LocationModel.getLocationModel()!)
-
-        }
-    }
-}

+ 2 - 2
RainbowPlanet/RainbowPlanet/Manager/BaiduMapManager/LocationModel.swift

@@ -101,12 +101,12 @@ class LocationModel: NSObject,NSCoding {
         }else {
             locationModel = self.init(latitude: "36.20630464252636", longitude: "113.07274820385199", cityCode: "140411", province: "山西省", city: "长治市", district: "郊区", street: "西外环路", locationDescribe: "在暴马村新兴小区附近")
         }
-        NXLLog(locationModel?.toString()) 
+        NXLLog(locationModel!.toString())
          return locationModel
     }
 
     func toString() -> String {
-        return self.province!+self.city!+self.district!+self.street!+self.locationDescribe!
+        return (self.province!+self.city!+self.district!+self.street!+self.locationDescribe!)
     }
 
 }

Datei-Diff unterdrückt, da er zu groß ist
+ 62 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingViewController.swift


+ 8 - 0
RainbowPlanet/RainbowPlanet/RainbowPlanet.entitlements

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>aps-environment</key>
+	<string>development</string>
+</dict>
+</plist>

+ 36 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Info.plist

@@ -180,6 +180,42 @@
 			</dict>
 		</dict>
 	</dict>
+	<key>NSAppleMusicUsageDescription</key>
+	<string>App需要您的同意,才能访问媒体资料库</string>
+	<key>NSBluetoothPeripheralUsageDescription</key>
+	<string>App需要您的同意,才能访问蓝牙</string>
+	<key>NSCalendarsUsageDescription</key>
+	<string>App需要您的同意,才能访问日历</string>
+	<key>NSCameraUsageDescription</key>
+	<string>App需要您的同意,才能访问相册</string>
+	<key>NSContactsUsageDescription</key>
+	<string>App需要您的同意,才能访问通信录</string>
+	<key>NSHealthShareUsageDescription</key>
+	<string>App需要您的同意,才能访问健康分享</string>
+	<key>NSHealthUpdateUsageDescription</key>
+	<string>App需要您的同意,才能访问健康更新 </string>
+	<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
+	<string>App需要您的同意,才能始终访问位置</string>
+	<key>NSLocationAlwaysUsageDescription</key>
+	<string>App需要您的同意,才能始终访问位置</string>
+	<key>NSLocationUsageDescription</key>
+	<string>App需要您的同意,才能访问位置</string>
+	<key>NSLocationWhenInUseUsageDescription</key>
+	<string>App需要您的同意,才能在使用期间访问位置</string>
+	<key>NSMicrophoneUsageDescription</key>
+	<string>App需要您的同意,才能访问麦克风</string>
+	<key>NSMotionUsageDescription</key>
+	<string>App需要您的同意,才能访问运动与健身</string>
+	<key>NSPhotoLibraryAddUsageDescription</key>
+	<string>App需要您的同意,才能保存图像和视频到您的相册</string>
+	<key>NSPhotoLibraryUsageDescription</key>
+	<string>App需要您的同意,才能访问相机</string>
+	<key>NSRemindersUsageDescription</key>
+	<string>App需要您的同意,才能访问提醒事项</string>
+	<key>UIBackgroundModes</key>
+	<array>
+		<string>location</string>
+	</array>
 	<key>UIRequiredDeviceCapabilities</key>
 	<array>
 		<string>armv7</string>