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

v5.1.1版本 修复打卡按钮不出现等问题

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

+ 14 - 4
o2ios/O2Platform/App/Applications/c/MailViewController.swift

@@ -51,14 +51,24 @@ class MailViewController: BaseWebViewUIViewController {
     }
     }
 
 
     override func viewWillAppear(_ animated: Bool) {
     override func viewWillAppear(_ animated: Bool) {
+        
         if self.isIndexShow || self.hasInnerBar {
         if self.isIndexShow || self.hasInnerBar {
-            let statusBarWindow : UIView = UIApplication.shared.value(forKey: "statusBarWindow") as! UIView
-            let statusBar : UIView = statusBarWindow.value(forKey: "statusBar") as! UIView
-            if statusBar.responds(to:#selector(setter: UIView.backgroundColor)) {
-                statusBar.backgroundColor = base_color
+            if #available(iOS 13.0, *) {
+                if let frame = UIApplication.shared.keyWindow?.windowScene?.statusBarManager?.statusBarFrame {
+                    let statusBar = UIView(frame: frame)
+                   statusBar.backgroundColor = base_color
+                   UIApplication.shared.keyWindow?.addSubview(statusBar)
+                }
+            }else {
+              let statusBarWindow : UIView = UIApplication.shared.value(forKey: "statusBarWindow") as! UIView
+                let statusBar : UIView = statusBarWindow.value(forKey: "statusBar") as! UIView
+                if statusBar.responds(to:#selector(setter: UIView.backgroundColor)) {
+                    statusBar.backgroundColor = base_color
+                }
             }
             }
             self.navigationController?.setNavigationBarHidden(true, animated: true)
             self.navigationController?.setNavigationBarHidden(true, animated: true)
         }
         }
+        
     }
     }
     
     
     override func viewWillDisappear(_ animated: Bool) {
     override func viewWillDisappear(_ animated: Bool) {

+ 1 - 1
o2ios/O2Platform/App/IM-聊天/IMConversationListViewController.swift

@@ -77,7 +77,7 @@ class IMConversationListViewController: UIViewController {
                 }
                 }
             }
             }
             DispatchQueue.main.async {
             DispatchQueue.main.async {
-                if self.conversationList.count > 0 {
+                if self.conversationList.count > 0 || self.instantMsgList.count > 0{
                     self.emptyView.isHidden = true
                     self.emptyView.isHidden = true
                 } else {
                 } else {
                     self.emptyView.isHidden = false
                     self.emptyView.isHidden = false

+ 6 - 6
o2ios/O2Platform/App/IM-聊天/View/IMConversationItemCell.xib

@@ -29,14 +29,14 @@
                             </userDefinedRuntimeAttribute>
                             </userDefinedRuntimeAttribute>
                         </userDefinedRuntimeAttributes>
                         </userDefinedRuntimeAttributes>
                     </imageView>
                     </imageView>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="姓名" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bOp-mm-qCN">
-                        <rect key="frame" x="66" y="10" width="153" height="21"/>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bOp-mm-qCN">
+                        <rect key="frame" x="66" y="10" width="153" height="0.0"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     </label>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2020-10-23" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="URQ-HD-MDc">
-                        <rect key="frame" x="231" y="10" width="84" height="17"/>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="URQ-HD-MDc">
+                        <rect key="frame" x="231" y="10" width="84" height="0.0"/>
                         <constraints>
                         <constraints>
                             <constraint firstAttribute="width" constant="84" id="jM2-ye-nzP"/>
                             <constraint firstAttribute="width" constant="84" id="jM2-ye-nzP"/>
                         </constraints>
                         </constraints>
@@ -44,8 +44,8 @@
                         <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <nil key="highlightedColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     </label>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="这里是消息" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="I3j-lM-VtV">
-                        <rect key="frame" x="70" y="37" width="245" height="17"/>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="I3j-lM-VtV">
+                        <rect key="frame" x="70" y="54" width="245" height="0.0"/>
                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
                         <color key="textColor" systemColor="systemGrayColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <color key="textColor" systemColor="systemGrayColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                         <nil key="highlightedColor"/>

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

@@ -72,7 +72,7 @@ class OOAttanceCheckInController: UITableViewController {
         
         
         getCurrentCheckinList()
         getCurrentCheckinList()
         getMyRecords()
         getMyRecords()
-//        self.perform(#selector(createButton), with: nil, afterDelay: 0)
+        self.perform(#selector(createButton), with: nil, afterDelay: 0)
     }
     }
     
     
     
     
@@ -81,7 +81,7 @@ class OOAttanceCheckInController: UITableViewController {
 //    }
 //    }
     
     
     //创建打卡按钮
     //创建打卡按钮
-    @objc private func createButton(feature: OOAttandanceFeature) {
+    @objc private func createButton() {
         let window = UIApplication.shared.windows[0]
         let window = UIApplication.shared.windows[0]
         myButton = UIButton(type: .custom)
         myButton = UIButton(type: .custom)
         myButton?.frame = CGRect(x: kScreenW - 90, y: kScreenH - 150, width: 70, height: 70)
         myButton?.frame = CGRect(x: kScreenW - 90, y: kScreenH - 150, width: 70, height: 70)
@@ -129,6 +129,13 @@ class OOAttanceCheckInController: UITableViewController {
     }
     }
     
     
     @objc private func postCheckinButton(_ sender:UIButton){
     @objc private func postCheckinButton(_ sender:UIButton){
+        if self.feature != nil {
+            if self.feature?.signSeq ?? -1 < 1 {
+                self.showError(title: "当前不需要打卡!")
+                return
+            }
+        }
+        
         MBProgressHUD_JChat.showMessage(message: "打卡中...", toView: self.view)
         MBProgressHUD_JChat.showMessage(message: "打卡中...", toView: self.view)
         checkinForm.checkin_type = self.feature?.checkinType ?? ""
         checkinForm.checkin_type = self.feature?.checkinType ?? ""
         viewModel.postMyCheckin(checkinForm) { (result) in
         viewModel.postMyCheckin(checkinForm) { (result) in
@@ -179,11 +186,8 @@ class OOAttanceCheckInController: UITableViewController {
             switch result {
             switch result {
             case .ok(let record):
             case .ok(let record):
                 let model = record as? OOMyAttandanceRecords
                 let model = record as? OOMyAttandanceRecords
-                if let feature = model?.feature, feature.signSeq ?? -1 > 0 {
+                if let feature = model?.feature {
                     self.feature = feature
                     self.feature = feature
-                    self.createButton(feature: feature)
-                }else {
-                    self.removeButton()
                 }
                 }
                 break
                 break
             case .fail(let err):
             case .fail(let err):

+ 22 - 48
o2ios/O2Platform/Extension/UIViewController+Extension.swift

@@ -341,6 +341,7 @@ extension UIViewController {
     //照片选择器
     //照片选择器
     func choosePhotoWithImagePicker(callback: @escaping (String, Data)-> Void) {
     func choosePhotoWithImagePicker(callback: @escaping (String, Data)-> Void) {
         let vc = FileBSImagePickerViewController().bsImagePicker()
         let vc = FileBSImagePickerViewController().bsImagePicker()
+        vc.settings.fetch.assets.supportedMediaTypes = [.image]
         presentImagePicker(vc, select: nil, deselect: nil, cancel: nil, finish: {
         presentImagePicker(vc, select: nil, deselect: nil, cancel: nil, finish: {
             (arr) in
             (arr) in
             let count = arr.count
             let count = arr.count
@@ -351,58 +352,31 @@ extension UIViewController {
                 switch asset.mediaType {
                 switch asset.mediaType {
                 case .image:
                 case .image:
                     let options = PHImageRequestOptions()
                     let options = PHImageRequestOptions()
-//                    options.isSynchronous = true
+                    options.isSynchronous = true
                     options.deliveryMode = .fastFormat
                     options.deliveryMode = .fastFormat
-                    options.isNetworkAccessAllowed = true
                     options.resizeMode = .none
                     options.resizeMode = .none
-                    options.progressHandler = { progress, error, p, d in
-                            print("下载进度。。。\(progress)")
-                        print("下载错误。。。\(String(describing: error))")
-                    }
-                    PHImageManager.default().requestImage(for: asset, targetSize: PHImageManagerMaximumSize, contentMode: .aspectFill, options: options, resultHandler: { (image, dict) in
-                        if image == nil {
-                            print("选择照片出错 is nil")
-                        } else {
-                            //处理图片旋转的问题
-                            let newImage = image?.fixOrientation()
-                            let newData = newImage!.hnk_data()
-                            if newData == nil {
-                                print("照片旋转出错")
-                            }else {
-                                var fileName = "unkownFile"
-                                if let fileURL = dict?["PHImageFileURLKey"] as? URL {
-                                    fileName = fileURL.lastPathComponent
-                                }
-                                callback(fileName, newData!)
+                    PHImageManager.default().requestImageData(for: asset, options: options) { (imageData, result, imageOrientation, dict) in
+                        guard let data = imageData else {
+                            return
+                        }
+                        var newData = data
+                        //处理图片旋转的问题
+                        if imageOrientation != UIImage.Orientation.up {
+                            let newImage = UIImage(data: data)?.fixOrientation()
+                            if newImage != nil {
+                                newData = newImage!.pngData()!
                             }
                             }
                         }
                         }
-                    })
-                    
-                    
-                    //选择iCloud上的照片获取不到data
-//                    PHImageManager.default().requestImageData(for: asset, options: options, resultHandler: { (imageData, result, imageOrientation, dict) in
-//                        if imageData == nil {
-//                            print("选择照片出错")
-//                        }else {
-//                            var newData = imageData
-//                            //处理图片旋转的问题
-//                            if imageOrientation != UIImage.Orientation.up && imageData != nil {
-//                                let newImage = UIImage(data: imageData!)?.fixOrientation()
-//                                if newImage != nil {
-//                                    newData = newImage?.pngData()
-//                                }
-//                            }
-//                            if newData == nil {
-//                                print("照片旋转出错")
-//                            }else {
-//                                var fileName = "unkownFile"
-//                                if let fileURL = dict?["PHImageFileURLKey"] as? URL {
-//                                    fileName = fileURL.lastPathComponent
-//                                }
-//                                callback(fileName, newData!)
-//                            }
-//                        }
-//                    })
+                        var fileName = ""
+                        if dict?["PHImageFileURLKey"] != nil {
+                            let fileURL = dict?["PHImageFileURLKey"] as! URL
+                            fileName = fileURL.lastPathComponent
+                        } else {
+                            fileName = "\(UUID().uuidString).png"
+                        }
+                        callback(fileName, newData)
+                    }
+                     
                     break
                     break
                 case .video:
                 case .video:
                      print("视频文件。还不支持。。。。。")
                      print("视频文件。还不支持。。。。。")

+ 6 - 6
o2ios/O2Platform/Info.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
-	<string>5.1.0</string>
+	<string>5.1.1</string>
 	<key>CFBundleURLTypes</key>
 	<key>CFBundleURLTypes</key>
 	<array>
 	<array>
 		<dict>
 		<dict>
@@ -32,7 +32,7 @@
 		</dict>
 		</dict>
 	</array>
 	</array>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>69</string>
+	<string>71</string>
 	<key>LSRequiresIPhoneOS</key>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<true/>
 	<key>NSAppTransportSecurity</key>
 	<key>NSAppTransportSecurity</key>
@@ -163,15 +163,15 @@
 		<key>centerContext</key>
 		<key>centerContext</key>
 		<string>/x_program_center</string>
 		<string>/x_program_center</string>
 		<key>centerHost</key>
 		<key>centerHost</key>
-		<string>dd.o2oa.net</string>
+		<string>sample.o2oa.net</string>
 		<key>centerPort</key>
 		<key>centerPort</key>
-		<integer>20030</integer>
+		<integer>40030</integer>
 		<key>httpProtocol</key>
 		<key>httpProtocol</key>
-		<string>http</string>
+		<string>https</string>
 		<key>id</key>
 		<key>id</key>
 		<string>o2CenterServer</string>
 		<string>o2CenterServer</string>
 		<key>name</key>
 		<key>name</key>
-		<string>dd</string>
+		<string>sample</string>
 	</dict>
 	</dict>
 </dict>
 </dict>
 </plist>
 </plist>