Просмотр исходного кода

ios13 考勤打卡打不开的bug

fancy 5 лет назад
Родитель
Сommit
fa92a30b8e

+ 2 - 0
o2ios/O2Platform/App/Applications/c/O2AppViewController.swift

@@ -75,6 +75,7 @@ class O2AppViewController: UIViewController{
     
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
         if segue.identifier == "showMailSegue" {
+            segue.destination.modalPresentationStyle = .fullScreen
             if let nav = segue.destination as? ZLNavigationController {
                 nav.viewControllers.forEach { (vc) in
                     if vc is MailViewController {
@@ -164,6 +165,7 @@ extension O2AppViewController:ZLCollectionViewDelegate{
                             AppConfigSettings.shared.taskIndex = 0
                         }
                     }
+                    destVC.modalPresentationStyle = .fullScreen
                     if destVC.isKind(of: ZLNavigationController.self) {
                         DDLogInfo("cloudFIle 进来了?")
                         self.show(destVC, sender: nil)

+ 2 - 2
o2ios/O2Platform/App/NewAttance-考勤打卡/c/OOAttanceCheckInController.swift

@@ -58,9 +58,9 @@ class OOAttanceCheckInController: UITableViewController {
    
     override func viewDidLoad() {
         super.viewDidLoad()
-        title = "打卡"
+//        title = "打卡"
         headerView.startBMKMapViewService()
-        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "关闭", style: .plain, target: self, action: #selector(closeWindow))
+//        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "关闭", style: .plain, target: self, action: #selector(closeWindow))
         //tableView.tableHeaderView = headerView
         //tableView.contentInset = UIEdgeInsets(top: 230, left: 0, bottom: 0, right: 0)
         //register Cell

+ 33 - 21
o2ios/O2Platform/App/NewAttance-考勤打卡/c/OOAttanceSettingController.swift

@@ -37,13 +37,13 @@ class OOAttanceSettingController: UIViewController {
     
     override func viewDidLoad() {
         super.viewDidLoad()
-        title = "设置"
-        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "关闭", style: .plain, target: self, action: #selector(closeWindow))
-        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "地点管理", style: .plain, target: self, action: #selector(navWorkPlaceManager(_:)))
+//        title = "设置"
+//        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "关闭", style: .plain, target: self, action: #selector(closeWindow))
+//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "地点管理", style: .plain, target: self, action: #selector(navWorkPlaceManager(_:)))
         loadAdmin()
         //增加mapView
-        commonDataView()
         commonMapView()
+        commonDataView()
         
     }
     
@@ -204,7 +204,7 @@ extension OOAttanceSettingController:BMKMapViewDelegate {
         let re = BMKReverseGeoCodeSearchOption()
         re.location = coordinate
         let flag = searchAddress.reverseGeoCode(re)
-        DDLogDebug("searchAddress \(flag)")
+        DDLogDebug("coordinate searchAddress \(flag)")
     }
     
     
@@ -213,7 +213,7 @@ extension OOAttanceSettingController:BMKMapViewDelegate {
         let coordinate = mapPoi.pt
         re.location = coordinate
         let flag = searchAddress.reverseGeoCode(re)
-        DDLogDebug("searchAddress \(flag)")
+        DDLogDebug("mapPoi searchAddress \(flag)")
         
     }
     
@@ -224,23 +224,35 @@ extension OOAttanceSettingController:BMKMapViewDelegate {
 
 extension OOAttanceSettingController:BMKLocationManagerDelegate {
     
-    func willStartLocatingUser() {
-        DDLogDebug("willStartLocatingUser")
-        MBProgressHUD_JChat.showMessage(message:"正在定位中,请稍候", toView: self.mapView)
-    }
-    
-    func didUpdate(_ userLocation: BMKUserLocation!) {
-        DDLogDebug("当前位置,\(userLocation.location.coordinate.latitude),\(userLocation.location.coordinate.longitude)")
-        mapView.updateLocationData(userLocation)
-        mapView.centerCoordinate = userLocation.location.coordinate
-        //定位完成停止定位
-        locService.stopUpdatingLocation()
+//    func willStartLocatingUser() {
+//        DDLogDebug("willStartLocatingUser")
+//        MBProgressHUD_JChat.showMessage(message:"正在定位中,请稍候", toView: self.mapView)
+//    }
+    func bmkLocationManager(_ manager: BMKLocationManager, didUpdate location: BMKLocation?, orError error: Error?) {
+        if let loc = location?.location {
+           DDLogDebug("设置 当前位置,\(loc.coordinate.latitude),\(loc.coordinate.longitude)")
+           let user = BMKUserLocation()
+           user.location = loc
+           mapView.updateLocationData(user)
+           mapView.centerCoordinate = CLLocationCoordinate2D(latitude: loc.coordinate.latitude, longitude: loc.coordinate.longitude)
+            
+           //定位完成停止定位
+           locService.stopUpdatingLocation()
+        }
     }
     
-    func didStopLocatingUser() {
-        
-        MBProgressHUD_JChat.hide(forView: self.mapView, animated: true)
-    }
+//    func didUpdate(_ userLocation: BMKUserLocation!) {
+//        DDLogDebug("当前位置,\(userLocation.location.coordinate.latitude),\(userLocation.location.coordinate.longitude)")
+//        mapView.updateLocationData(userLocation)
+//        mapView.centerCoordinate = userLocation.location.coordinate
+//        //定位完成停止定位
+//        locService.stopUpdatingLocation()
+//    }
+//
+//    func didStopLocatingUser() {
+//
+//        MBProgressHUD_JChat.hide(forView: self.mapView, animated: true)
+//    }
 }
 
 extension OOAttanceSettingController:BMKGeoCodeSearchDelegate {

+ 2 - 2
o2ios/O2Platform/App/NewAttance-考勤打卡/c/OOAttanceTotalController.swift

@@ -25,10 +25,10 @@ class OOAttanceTotalController: UITableViewController {
         
     override func viewDidLoad() {
         super.viewDidLoad()
-        title = "统计"
+//        title = "统计"
         NotificationCenter.default.addObserver(self, selector: #selector(showDatePicker(_:)), name: OONotification.staticsTotal.notificationName, object: nil)
         tableView.register(UINib.init(nibName: "OOAttandanceTotalItemCell", bundle: nil), forCellReuseIdentifier: "OOAttandanceTotalItemCell")
-        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "关闭", style: .plain, target: self, action: #selector(closeWindow))
+//        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "关闭", style: .plain, target: self, action: #selector(closeWindow))
         let currentDate = Date()
         let year = String(currentDate.year)
         let month = currentDate.month > 9 ? "\(currentDate.month)" : "0\(currentDate.month)"

+ 7 - 7
o2ios/O2Platform/App/NewAttance-考勤打卡/c/OONewAttanceController.swift

@@ -44,17 +44,17 @@ public class OONewAttanceController: UITabBarController, UITabBarControllerDeleg
    private static let myViewControllers: [UIViewController] = {
         //打卡
         let vc1 = OOAttanceCheckInController(nibName: "OOAttanceCheckInController", bundle: nil)
-        let nav1 = ZLNavigationController(rootViewController: vc1)
-        nav1.tabBarItem = UITabBarItem(title: "打卡", image: UIImage(named: "icon_daka_nor"), selectedImage: O2ThemeManager.image(for: "Icon.at_daka")!)
+//        let nav1 = ZLNavigationController(rootViewController: vc1)
+        vc1.tabBarItem = UITabBarItem(title: "打卡", image: UIImage(named: "icon_daka_nor"), selectedImage: O2ThemeManager.image(for: "Icon.at_daka")!)
         //统计
         let vc2 = OOAttanceTotalController(nibName: "OOAttanceTotalController", bundle: nil)
-        let nav2 = ZLNavigationController(rootViewController: vc2)
-        nav2.tabBarItem = UITabBarItem(title: "统计", image: UIImage(named: "icon_tongji_nor"), selectedImage: O2ThemeManager.image(for: "Icon.at_tongji")!)
+//        let nav2 = ZLNavigationController(rootViewController: vc2)
+        vc2.tabBarItem = UITabBarItem(title: "统计", image: UIImage(named: "icon_tongji_nor"), selectedImage: O2ThemeManager.image(for: "Icon.at_tongji")!)
         //设置
         let vc3 = OOAttanceSettingController(nibName: "OOAttanceSettingController", bundle: nil)
-        let nav3 = ZLNavigationController(rootViewController: vc3)
-        nav3.tabBarItem = UITabBarItem(title: "设置", image: UIImage(named: "icon_setup_nor"), selectedImage: O2ThemeManager.image(for: "Icon.at_setting")!)
-        return [nav1,nav2,nav3]
+//        let nav3 = ZLNavigationController(rootViewController: vc3)
+        vc3.tabBarItem = UITabBarItem(title: "设置", image: UIImage(named: "icon_setup_nor"), selectedImage: O2ThemeManager.image(for: "Icon.at_setting")!)
+        return [vc1,vc2,vc3]
     }()
 
     

+ 3 - 20
o2ios/O2Platform/App/NewAttance-考勤打卡/checkin.storyboard

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="a7I-UG-59Q">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="4UB-xR-X6P">
+    <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
@@ -24,20 +22,5 @@
             </objects>
             <point key="canvasLocation" x="212" y="-76"/>
         </scene>
-        <!--Navigation Controller-->
-        <scene sceneID="Lkw-De-GDw">
-            <objects>
-                <navigationController hidesBottomBarWhenPushed="YES" navigationBarHidden="YES" id="a7I-UG-59Q" customClass="ZLNavigationController" customModule="O2Platform" customModuleProvider="target" sceneMemberID="viewController">
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Tvf-11-wiX">
-                        <autoresizingMask key="autoresizingMask"/>
-                    </navigationBar>
-                    <connections>
-                        <segue destination="4UB-xR-X6P" kind="relationship" relationship="rootViewController" id="ZUt-ji-9Ee"/>
-                    </connections>
-                </navigationController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="pHm-MZ-Xva" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="-646" y="-76"/>
-        </scene>
     </scenes>
 </document>

+ 1 - 1
o2ios/O2Platform/App/NewAttance-考勤打卡/v/OOAttanceHeaderView.swift

@@ -107,7 +107,7 @@ class OOAttanceHeaderView: UIView {
         let annotation = BMKPointAnnotation()
         let longitude  = Double((workPlace.longitude)!)
         let latitude  = Double((workPlace.latitude)!)
-        DDLogDebug("placeAlias=\(workPlace.placeAlias ?? ""),longitude=\(longitude),latitude=\(latitude)")
+        DDLogDebug("placeAlias=\(workPlace.placeAlias ?? ""),longitude=\(String(describing: longitude)),latitude=\(latitude)")
         annotation.coordinate = CLLocationCoordinate2DMake(latitude!,longitude!);
         annotation.title = workPlace.placeAlias ?? ""
         annotation.subtitle = workPlace.placeName ?? ""