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

Merge branch 'feature/ios_ws_im_location' into 'develop'

ios聊天消息增加位置消息功能

See merge request o2oa/o2oa!768
楼国栋 5 лет назад
Родитель
Сommit
8ebb7b3b51
19 измененных файлов с 494 добавлено и 61 удалено
  1. 24 4
      o2ios/O2Platform.xcodeproj/project.pbxproj
  2. 30 4
      o2ios/O2Platform/App/IM-聊天/IMChatViewController.swift
  3. 141 0
      o2ios/O2Platform/App/IM-聊天/IMLocationChooseController.swift
  4. 60 0
      o2ios/O2Platform/App/IM-聊天/IMLocationChooseController.xib
  5. 51 0
      o2ios/O2Platform/App/IM-聊天/IMShowLocationViewController.swift
  6. 9 0
      o2ios/O2Platform/App/IM-聊天/Model/IMConversationInfo.swift
  7. 2 0
      o2ios/O2Platform/App/IM-聊天/O2IM.swift
  8. 3 8
      o2ios/O2Platform/App/IM-聊天/View/IMAudioView.swift
  9. 4 4
      o2ios/O2Platform/App/IM-聊天/View/IMAudioView.xib
  10. 26 11
      o2ios/O2Platform/App/IM-聊天/View/IMChatMessageSendViewCell.swift
  11. 32 17
      o2ios/O2Platform/App/IM-聊天/View/IMChatMessageViewCell.swift
  12. 2 4
      o2ios/O2Platform/App/IM-聊天/View/IMConversationItemCell.swift
  13. 26 0
      o2ios/O2Platform/App/IM-聊天/View/IMLocationView.swift
  14. 59 0
      o2ios/O2Platform/App/IM-聊天/View/IMLocationView.xib
  15. 1 9
      o2ios/O2Platform/App/NewAttance-考勤打卡/c/OOAttanceSettingController.swift
  16. 2 0
      o2ios/O2Platform/App/O2MainController.swift
  17. 22 0
      o2ios/O2Platform/Assets.xcassets/im/chat_list_poi_background.imageset/Contents.json
  18. BIN
      o2ios/O2Platform/Assets.xcassets/im/chat_list_poi_background.imageset/chat_list_poi_background@2x.png
  19. BIN
      o2ios/O2Platform/Assets.xcassets/im/chat_list_poi_background.imageset/chat_list_poi_background@3x.png

+ 24 - 4
o2ios/O2Platform.xcodeproj/project.pbxproj

@@ -199,6 +199,11 @@
 		B1750087233C937E003DA7B9 /* IntExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1750086233C937E003DA7B9 /* IntExtensions.swift */; };
 		B1750089233C9B2C003DA7B9 /* Stack.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1750088233C9B2C003DA7B9 /* Stack.swift */; };
 		B17BF43022B23758009E36E0 /* SkinViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B17BF42F22B23758009E36E0 /* SkinViewController.swift */; };
+		B183987D249AFF64001C6FAA /* IMLocationView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B183987C249AFF64001C6FAA /* IMLocationView.xib */; };
+		B18398AD249B00AA001C6FAA /* IMLocationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B18398AC249B00AA001C6FAA /* IMLocationView.swift */; };
+		B18398B0249B079B001C6FAA /* IMLocationChooseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B18398AE249B079B001C6FAA /* IMLocationChooseController.swift */; };
+		B18398B1249B079B001C6FAA /* IMLocationChooseController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B18398AF249B079B001C6FAA /* IMLocationChooseController.xib */; };
+		B18398B3249B4154001C6FAA /* IMShowLocationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B18398B2249B4154001C6FAA /* IMShowLocationViewController.swift */; };
 		B18FFF5F23756B6C001B2887 /* JPushAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = B18FFF5E23756B6C001B2887 /* JPushAPI.swift */; };
 		B1908E1422685E8F00D75632 /* O2WebViewModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1908E1322685E8F00D75632 /* O2WebViewModels.swift */; };
 		B1908E4C22687B1A00D75632 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B1908E4E22687B1A00D75632 /* Localizable.strings */; };
@@ -1527,6 +1532,11 @@
 		B1750086233C937E003DA7B9 /* IntExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntExtensions.swift; sourceTree = "<group>"; };
 		B1750088233C9B2C003DA7B9 /* Stack.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Stack.swift; sourceTree = "<group>"; };
 		B17BF42F22B23758009E36E0 /* SkinViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkinViewController.swift; sourceTree = "<group>"; };
+		B183987C249AFF64001C6FAA /* IMLocationView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = IMLocationView.xib; sourceTree = "<group>"; };
+		B18398AC249B00AA001C6FAA /* IMLocationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMLocationView.swift; sourceTree = "<group>"; };
+		B18398AE249B079B001C6FAA /* IMLocationChooseController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMLocationChooseController.swift; sourceTree = "<group>"; };
+		B18398AF249B079B001C6FAA /* IMLocationChooseController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = IMLocationChooseController.xib; sourceTree = "<group>"; };
+		B18398B2249B4154001C6FAA /* IMShowLocationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMShowLocationViewController.swift; sourceTree = "<group>"; };
 		B18FFF5E23756B6C001B2887 /* JPushAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JPushAPI.swift; sourceTree = "<group>"; };
 		B1908E1322685E8F00D75632 /* O2WebViewModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = O2WebViewModels.swift; sourceTree = "<group>"; };
 		B1908E4D22687B1A00D75632 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
@@ -2598,6 +2608,9 @@
 				B1489B1B248E0F4D009EE9FD /* IMChatViewController.xib */,
 				B1489CB424935104009EE9FD /* IMInstantMessageViewController.swift */,
 				B1489CB524935104009EE9FD /* IMInstantMessageViewController.xib */,
+				B18398AE249B079B001C6FAA /* IMLocationChooseController.swift */,
+				B18398AF249B079B001C6FAA /* IMLocationChooseController.xib */,
+				B18398B2249B4154001C6FAA /* IMShowLocationViewController.swift */,
 			);
 			path = "IM-聊天";
 			sourceTree = "<group>";
@@ -2635,6 +2648,8 @@
 				B15BE0EF2499DD90008CD1DB /* IMChatAudioView.xib */,
 				B15BE10B249A0EFE008CD1DB /* IMAudioView.xib */,
 				B15BE10D249A107C008CD1DB /* IMAudioView.swift */,
+				B183987C249AFF64001C6FAA /* IMLocationView.xib */,
+				B18398AC249B00AA001C6FAA /* IMLocationView.swift */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -5678,6 +5693,7 @@
 				E46E6C6D1DD41F5D00AB7561 /* ZSScenterjustify.png in Resources */,
 				E40E24BE20B7DA3C009F8BE7 /* OOMeetingRoomDeviceListView.xib in Resources */,
 				E4D2312B20A29E2700837868 /* OOAppMainCollectionHeaderView.xib in Resources */,
+				B18398B1249B079B001C6FAA /* IMLocationChooseController.xib in Resources */,
 				E45755A31E0BA72E00EC44F4 /* qrcode_scan_btn_scan_off@2x.png in Resources */,
 				E46E6CA71DD41F5D00AB7561 /* ZSStable.png in Resources */,
 				E4C24BC120844F3C00E426B0 /* jiantou2@2x.png in Resources */,
@@ -5729,6 +5745,7 @@
 				E46E6CC31DD41F5D00AB7561 /* ZSSRichTextEditor.js in Resources */,
 				E4C24BC220844F3C00E426B0 /* icon_baidu_marker.png in Resources */,
 				B12FD1872283CE1D00E636BA /* red.plist in Resources */,
+				B183987D249AFF64001C6FAA /* IMLocationView.xib in Resources */,
 				E4B888E21D9D48F1002E1A46 /* cloudStorage.storyboard in Resources */,
 				E46E6C8E1DD41F5D00AB7561 /* ZSSkeyboard@2x.png in Resources */,
 				E4C24C49208D7EDE00E426B0 /* OOContactSearchSectionHeaderView.xib in Resources */,
@@ -6254,6 +6271,7 @@
 				E46E6CBF1DD41F5D00AB7561 /* HRColorPickerViewController.m in Sources */,
 				E4C24B6E20844F3C00E426B0 /* JCFileManager.swift in Sources */,
 				09E02E0E1F16001B00579887 /* Head.swift in Sources */,
+				B18398AD249B00AA001C6FAA /* IMLocationView.swift in Sources */,
 				E4D2313020A29E9F00837868 /* OOAppMainCollectionReusableView.swift in Sources */,
 				B165CD5B2242093500373B66 /* PresentrShadow.swift in Sources */,
 				B107453C21A52FA00015F1B2 /* O2PersonInfo.swift in Sources */,
@@ -6364,6 +6382,7 @@
 				09E02E971F16319600579887 /* UIImageView+Haneke.swift in Sources */,
 				E4B8887D1D9D48F1002E1A46 /* FileMyDownloadViewController.swift in Sources */,
 				E4C24B6620844F3C00E426B0 /* DLFixedTabbarView.m in Sources */,
+				B18398B3249B4154001C6FAA /* IMShowLocationViewController.swift in Sources */,
 				E4C24B3520844F3C00E426B0 /* NSLayoutConstraint+JChat.swift in Sources */,
 				E45DA9121DAF7EBE00E0735D /* SZKCleanCache.m in Sources */,
 				090253DE1F0E8BA6006B1609 /* O2LoadingView.swift in Sources */,
@@ -6613,6 +6632,7 @@
 				E4C24B5720844F3C00E426B0 /* SAIToolboxInputViewLayout.swift in Sources */,
 				B1FD027021FAE00E000E9817 /* O2MainController.swift in Sources */,
 				E4B697092075FA560062F6E8 /* BaseModel.swift in Sources */,
+				B18398B0249B079B001C6FAA /* IMLocationChooseController.swift in Sources */,
 				E4B888621D9D48F1002E1A46 /* ZLCollectionView.swift in Sources */,
 				B1298E812366B2E7006E9236 /* CFImageViewCell.swift in Sources */,
 				E40E24B220B7DA3C009F8BE7 /* OOMeetingCreateViewController.swift in Sources */,
@@ -6831,7 +6851,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 67;
+				CURRENT_PROJECT_VERSION = 68;
 				DEVELOPMENT_TEAM = NTDRU2P6T4;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -6866,7 +6886,7 @@
 					"$(PROJECT_DIR)/O2Platform/Framework/lame",
 					"$(PROJECT_DIR)/O2Platform/Framework/lame/opencore-amr/lib",
 				);
-				MARKETING_VERSION = 5.0.7;
+				MARKETING_VERSION = 5.0.8;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -6947,7 +6967,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Distribution";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 67;
+				CURRENT_PROJECT_VERSION = 68;
 				DEVELOPMENT_TEAM = NTDRU2P6T4;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -6982,7 +7002,7 @@
 					"$(PROJECT_DIR)/O2Platform/Framework/lame",
 					"$(PROJECT_DIR)/O2Platform/Framework/lame/opencore-amr/lib",
 				);
-				MARKETING_VERSION = 5.0.7;
+				MARKETING_VERSION = 5.0.8;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",

+ 30 - 4
o2ios/O2Platform/App/IM-聊天/IMChatViewController.swift

@@ -160,6 +160,18 @@ class IMChatViewController: UIViewController {
         sendMessage(body: body)
     }
 
+    //发送地图消息消息
+    private func sendLocationMessage(loc: O2LocationData) {
+        let body = IMMessageBodyInfo()
+        body.type = o2_im_msg_type_location
+        body.body = o2_im_msg_body_location
+        body.address = loc.address
+        body.addressDetail = loc.addressDetail
+        body.longitude = loc.longitude
+        body.latitude = loc.latitude
+        sendMessage(body: body)
+    }
+
     //发送消息到服务器
     private func sendMessage(body: IMMessageBodyInfo) {
         let message = IMMessageInfo()
@@ -264,7 +276,7 @@ class IMChatViewController: UIViewController {
         self.scrollMessageToBottom()
         return msgId
     }
-    
+
     //发送消息前 先载入界面
     private func prepareForSendFileMsg(tempMessage: IMMessageBodyInfo) -> String {
         let message = IMMessageInfo()
@@ -310,7 +322,7 @@ class IMChatViewController: UIViewController {
             self.showError(title: "上传错误,\(err.localizedDescription)")
         }
     }
-    
+
     //上传图片 音频 等文件到服务器并发送消息
     private func uploadFileAndSendMsg(messageId: String, data: Data, fileName: String, type: String) {
         guard let cId = self.conversation?.id else {
@@ -384,7 +396,7 @@ class IMChatViewController: UIViewController {
             let width = NSLayoutConstraint(item: self.audioBtnView, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: SCREEN_WIDTH)
             let height = NSLayoutConstraint(item: self.audioBtnView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: self.emojiBarHeight.toCGFloat)
             NSLayoutConstraint.activate([top, width, height])
-        }else {
+        } else {
             self.bottomBarHeightConstraint.constant = self.bottomBarHeight.toCGFloat
             self.audioBtnView.removeFromSuperview()
         }
@@ -401,6 +413,10 @@ class IMChatViewController: UIViewController {
     }
     @IBAction func locationBtnClick(_ sender: UIButton) {
         DDLogDebug("点击了位置按钮")
+        let vc = IMLocationChooseController.openChooseLocation { (data) in
+            self.sendLocationMessage(loc: data)
+        }
+        self.navigationController?.pushViewController(vc, animated: false)
     }
 
 
@@ -456,6 +472,16 @@ extension IMChatViewController: UIImagePickerControllerDelegate & UINavigationCo
 
 // MARK: - 图片消息点击 delegate
 extension IMChatViewController: IMChatMessageDelegate {
+    
+    func openLocatinMap(info: IMMessageBodyInfo) {
+        let map = IMShowLocationViewController()
+        map.address = info.address
+        map.addressDetail = info.addressDetail
+        map.latitude = info.latitude
+        map.longitude = info.longitude
+        self.navigationController?.pushViewController(map, animated: false)
+    }
+    
     func clickImageMessage(fileId: String?, tempPath: String?) {
         if let id = fileId {
             self.showLoading()
@@ -480,7 +506,7 @@ extension IMChatViewController: IMChatMessageDelegate {
                     DDLogError(error.localizedDescription)
                     self.showError(title: "获取文件异常!")
             }
-        }else if let temp = tempPath {
+        } else if let temp = tempPath {
             let currentURL = NSURL(fileURLWithPath: temp)
             DDLogDebug(currentURL.description)
             DDLogDebug(temp)

+ 141 - 0
o2ios/O2Platform/App/IM-聊天/IMLocationChooseController.swift

@@ -0,0 +1,141 @@
+//
+//  IMLocationChooseController.swift
+//  O2Platform
+//
+//  Created by FancyLou on 2020/6/18.
+//  Copyright © 2020 zoneland. All rights reserved.
+//
+
+import UIKit
+import CocoaLumberjack
+
+typealias O2LocationChooseCallback = (_ result: O2LocationData) -> Void ///< 定义确认回调
+
+class IMLocationChooseController: UIViewController {
+    
+    static func openChooseLocation(callback: @escaping O2LocationChooseCallback) -> IMLocationChooseController {
+        let vc = IMLocationChooseController()
+        vc.callback = callback
+        return vc
+    }
+    
+    
+
+    @IBOutlet weak var mapContainerView: UIView!
+    @IBOutlet weak var addressLabel: UILabel!
+
+    var callback: O2LocationChooseCallback?
+
+    private var mapView: BMKMapView!
+    private var locService: BMKLocationManager!
+    private var searchAddress: BMKGeoCodeSearch!
+    private var annotation: BMKPointAnnotation!
+    private var result: O2LocationData?
+    
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        self.title = "选择位置"
+        self.navigationItem.backBarButtonItem = UIBarButtonItem(image: UIImage(named: "icon_fanhui"), style: .plain, target: nil, action: nil)
+        //发送按钮
+        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "发送", style: .plain, target: self, action: #selector(sendLocation))
+        self.showLoading()
+        self.addressLabel.text = "点击地图选择位置"
+        //初始化地图和定位
+        let containerFrame = self.mapContainerView.frame
+        mapView = BMKMapView(frame: CGRect(x: 0, y: 0, width: containerFrame.width, height: containerFrame.height))
+        mapView.zoomLevel = 17
+        mapView.showMapPoi = true
+        mapView.showIndoorMapPoi = true
+        self.mapContainerView.addSubview(mapView)
+        mapView.delegate = self
+        locService = BMKLocationManager()
+        locService.delegate = self
+        locService.startUpdatingLocation()
+        searchAddress = BMKGeoCodeSearch()
+        searchAddress.delegate = self
+
+
+    }
+
+    @objc private func sendLocation() {
+        guard let r =  self.result else {
+            self.showError(title: "请选择一个位置!")
+            return
+        }
+        self.callback?(r)
+        self.navigationController?.popViewController(animated: false)
+    }
+
+    deinit {
+        mapView.delegate = nil
+        locService.delegate = nil
+        locService.stopUpdatingLocation()
+        searchAddress.delegate = nil
+    }
+
+}
+
+extension IMLocationChooseController: BMKMapViewDelegate, BMKLocationManagerDelegate, BMKGeoCodeSearchDelegate {
+    //定位
+    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()
+            self.hideLoading()
+        }
+    }
+
+    //位置搜索
+    func onGetReverseGeoCodeResult(_ searcher: BMKGeoCodeSearch!, result: BMKReverseGeoCodeSearchResult!, errorCode error: BMKSearchErrorCode) {
+        DDLogDebug("获取到地址: \(String(describing: result.address))")
+        self.addressLabel.text = result.address
+        //todo 地址和位置经纬度要保存起来
+        if self.result == nil {
+            self.result = O2LocationData()
+        }
+        self.result?.address = result.address
+        self.result?.addressDetail = result.sematicDescription
+        self.result?.latitude = result.location.latitude
+        self.result?.longitude = result.location.longitude
+    }
+
+    //地图
+    func mapView(_ mapView: BMKMapView!, onClickedMapPoi mapPoi: BMKMapPoi!) {
+        if annotation == nil {
+            annotation = BMKPointAnnotation()
+            annotation.coordinate = mapPoi.pt
+            mapView.addAnnotation(annotation)
+        } else {
+            annotation.coordinate = mapPoi.pt
+        }
+        //反向查询具体地址名称
+        let re = BMKReverseGeoCodeSearchOption()
+        re.location = mapPoi.pt
+        let flag = searchAddress.reverseGeoCode(re)
+        DDLogDebug("根据位置坐标,查询地址信息 \(flag)")
+    }
+
+    func mapView(_ mapView: BMKMapView!, onClickedMapBlank coordinate: CLLocationCoordinate2D) {
+        //单击
+        if annotation == nil {
+            annotation = BMKPointAnnotation()
+            annotation.coordinate = coordinate
+            mapView.addAnnotation(annotation)
+        } else {
+            annotation.coordinate = coordinate
+        }
+
+        //反向查询具体地址名称
+        let re = BMKReverseGeoCodeSearchOption()
+        re.location = coordinate
+        let flag = searchAddress.reverseGeoCode(re)
+        DDLogDebug("根据位置坐标,查询地址信息 \(flag)")
+    }
+}

+ 60 - 0
o2ios/O2Platform/App/IM-聊天/IMLocationChooseController.xib

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_1" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <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="IMLocationChooseController" customModule="O2Platform" customModuleProvider="target">
+            <connections>
+                <outlet property="addressLabel" destination="Bse-Vb-OgC" id="t4D-if-zQn"/>
+                <outlet property="mapContainerView" destination="ov2-dx-k4M" id="Dxk-4I-raa"/>
+                <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>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ov2-dx-k4M">
+                    <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
+                    <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Oab-w2-V0B">
+                    <rect key="frame" x="0.0" y="44" width="414" height="42"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bse-Vb-OgC">
+                            <rect key="frame" x="14" y="21" width="386" height="0.0"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <nil key="textColor"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" white="1" alpha="0.75321061639999998" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstItem="Bse-Vb-OgC" firstAttribute="leading" secondItem="Oab-w2-V0B" secondAttribute="leading" constant="14" id="UBV-MO-ane"/>
+                        <constraint firstAttribute="height" constant="42" id="Zpa-ic-A6h"/>
+                        <constraint firstAttribute="trailing" secondItem="Bse-Vb-OgC" secondAttribute="trailing" constant="14" id="qVr-Gq-nPT"/>
+                        <constraint firstItem="Bse-Vb-OgC" firstAttribute="centerY" secondItem="Oab-w2-V0B" secondAttribute="centerY" id="yT8-VV-L2g"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+            <constraints>
+                <constraint firstAttribute="bottom" secondItem="ov2-dx-k4M" secondAttribute="bottom" id="7JR-gm-naE"/>
+                <constraint firstItem="Oab-w2-V0B" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="9a1-DQ-JtV"/>
+                <constraint firstItem="ov2-dx-k4M" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="9tl-vM-Gzr"/>
+                <constraint firstItem="Oab-w2-V0B" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="VRS-7z-Ptd"/>
+                <constraint firstItem="ov2-dx-k4M" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="Wud-kq-CTF"/>
+                <constraint firstItem="Oab-w2-V0B" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="ZbU-x0-CbA"/>
+                <constraint firstItem="ov2-dx-k4M" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="d67-Y1-hbq"/>
+            </constraints>
+            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
+            <point key="canvasLocation" x="124.6376811594203" y="137.94642857142856"/>
+        </view>
+    </objects>
+</document>

+ 51 - 0
o2ios/O2Platform/App/IM-聊天/IMShowLocationViewController.swift

@@ -0,0 +1,51 @@
+//
+//  IMShowLocationViewController.swift
+//  O2Platform
+//
+//  Created by FancyLou on 2020/6/18.
+//  Copyright © 2020 zoneland. All rights reserved.
+//
+
+import UIKit
+
+class IMShowLocationViewController: UIViewController {
+
+    private var mapView: BMKMapView!
+    private var annotation: BMKPointAnnotation!
+    
+    var address: String?
+    var addressDetail: String?
+    var latitude: Double?
+    var longitude: Double?
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        self.title = address
+        mapView = BMKMapView(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH ,height: SCREEN_HEIGHT))
+        mapView.zoomLevel = 17
+        mapView.showMapPoi = true
+        mapView.showIndoorMapPoi = true
+        self.view.addSubview(mapView)
+       
+        guard let lat = latitude, let lo = longitude else {
+            self.showError(title: "没有传入正确的地址参数!")
+            return
+        }
+        //更新地图位置
+        let user = BMKUserLocation()
+        let loc = CLLocation(latitude: lat, longitude: lo)
+        user.location = loc
+        mapView.updateLocationData(user)
+        mapView.centerCoordinate = CLLocationCoordinate2D(latitude: loc.coordinate.latitude, longitude: loc.coordinate.longitude)
+        //设置位置点
+        annotation = BMKPointAnnotation()
+        annotation.coordinate = loc.coordinate
+        annotation.title = address
+        annotation.subtitle = addressDetail
+        mapView.addAnnotation(annotation)
+        
+        
+    }
+    
+ 
+}

+ 9 - 0
o2ios/O2Platform/App/IM-聊天/Model/IMConversationInfo.swift

@@ -66,6 +66,7 @@ class IMMessageBodyInfo: NSObject, DataModel {
     @objc var fileTempPath: String? //本地临时文件地址
     @objc var audioDuration: String? // 音频文件时长
     @objc var address: String? //type=location的时候位置信息
+    @objc var addressDetail: String?
     var latitude: Double?//type=location的时候位置信息
     var longitude: Double?//type=location的时候位置信息
 
@@ -107,3 +108,11 @@ class InstantMessage: NSObject, DataModel {
     }
 
 }
+
+
+struct  O2LocationData {
+    var address: String?
+    var addressDetail: String?
+    var latitude: Double?
+    var longitude: Double?
+}

+ 2 - 0
o2ios/O2Platform/App/IM-聊天/O2IM.swift

@@ -22,11 +22,13 @@ let o2_im_msg_type_text = "text"
 let o2_im_msg_type_emoji = "emoji"
 let o2_im_msg_type_image = "image"
 let o2_im_msg_type_audio = "audio"
+let o2_im_msg_type_location = "location"
 
 //消息body
 let o2_im_msg_body_image = "[图片]"
 let o2_im_msg_body_audio = "[语音]"
 let o2_im_msg_body_video = "[视频]"
+let o2_im_msg_body_location = "[位置]"
 
 
 //表情的字符串转化为O2Emoji.bundle里面的图片路径 [01] -> im_emotion_01

+ 3 - 8
o2ios/O2Platform/App/IM-聊天/View/IMAudioView.swift

@@ -10,21 +10,16 @@ import UIKit
 
 class IMAudioView: UIView {
     
-    static let IMAudioView_width: CGFloat = 76
+    static let IMAudioView_width: CGFloat = 92
     static let IMAudioView_height: CGFloat = 36
     
     @IBOutlet weak var playImageView: UIImageView!
     @IBOutlet weak var durationLabel: UILabel!
     
-    private var playUrl: String? = nil
     
-    override func awakeFromNib() {
-        
-    }
+    override func awakeFromNib() { }
+    
     
-    func setPlayUrl(url: String?) {
-        self.playUrl = url
-    }
     func setDuration(duration: String) {
         self.durationLabel.text = "\(duration)\""
     }

+ 4 - 4
o2ios/O2Platform/App/IM-聊天/View/IMAudioView.xib

@@ -11,7 +11,7 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="IMAudioView" customModule="O2Platform" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="76" height="36"/>
+            <rect key="frame" x="0.0" y="0.0" width="92" height="36"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chat_audio_play_Normal" translatesAutoresizingMaskIntoConstraints="NO" id="a6h-yn-SMe">
@@ -21,8 +21,8 @@
                         <constraint firstAttribute="width" constant="28" id="kKV-bU-3mr"/>
                     </constraints>
                 </imageView>
-                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="9“" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Pe3-7R-eCP">
-                    <rect key="frame" x="43" y="9.5" width="23" height="17"/>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="60“" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Pe3-7R-eCP">
+                    <rect key="frame" x="53" y="9.5" width="29" height="17"/>
                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                     <color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <nil key="highlightedColor"/>
@@ -30,7 +30,7 @@
             </subviews>
             <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
             <constraints>
-                <constraint firstItem="Pe3-7R-eCP" firstAttribute="leading" secondItem="a6h-yn-SMe" secondAttribute="trailing" constant="10" id="6nk-nX-y34"/>
+                <constraint firstItem="Pe3-7R-eCP" firstAttribute="leading" secondItem="a6h-yn-SMe" secondAttribute="trailing" constant="20" id="6nk-nX-y34"/>
                 <constraint firstItem="a6h-yn-SMe" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="5" id="A7P-7Y-jsE"/>
                 <constraint firstItem="Pe3-7R-eCP" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="f3M-cW-QZa"/>
                 <constraint firstAttribute="trailing" secondItem="Pe3-7R-eCP" secondAttribute="trailing" constant="10" id="oO3-qw-7Xl"/>

+ 26 - 11
o2ios/O2Platform/App/IM-聊天/View/IMChatMessageSendViewCell.swift

@@ -17,12 +17,20 @@ class IMChatMessageSendViewCell: UITableViewCell {
     @IBOutlet weak var messageBgWidth: NSLayoutConstraint!
     @IBOutlet weak var messageBgHeight: NSLayoutConstraint!
     
+    //音频消息 主体view
     private lazy var audioView: IMAudioView = {
         let view = Bundle.main.loadNibNamed("IMAudioView", owner: self, options: nil)?.first as! IMAudioView
         view.frame = CGRect(x: 0, y: 0, width: IMAudioView.IMAudioView_width, height: IMAudioView.IMAudioView_height)
         return view
     }()
     
+    //位置消息 主体view
+    private lazy var locationView: IMLocationView = {
+        let view = Bundle.main.loadNibNamed("IMLocationView", owner: self, options: nil)?.first as! IMLocationView
+        view.frame = CGRect(x: 0, y: 0, width: IMLocationView.IMLocationViewWidth, height: IMLocationView.IMLocationViewHeight)
+        return view
+    }()
+    
     var delegate: IMChatMessageDelegate?
     
     override func awakeFromNib() {
@@ -61,12 +69,29 @@ class IMChatMessageSendViewCell: UITableViewCell {
                 imageMsgRender(info: body)
             }else if o2_im_msg_type_audio == body.type {
                 audioMsgRender(info: body)
-            } else {
+            } else if o2_im_msg_type_location == body.type {
+                locationMsgRender(info: body)
+            }  else {
                 textMsgRender(msg: body.body!)
             }
         }
     }
     
+    //位置消息
+    private func locationMsgRender(info: IMMessageBodyInfo) {
+        self.messageBgWidth.constant = IMLocationView.IMLocationViewWidth + 20
+        self.messageBgHeight.constant = IMLocationView.IMLocationViewHeight + 20
+        self.locationView.translatesAutoresizingMaskIntoConstraints = false
+        self.messageBackgroundView.addSubview(self.locationView)
+        self.locationView.setLocationAddress(address: info.address ?? "")
+        //点击打开地址
+        self.locationView.addTapGesture { (tap) in
+            //open map view//open map view
+            self.delegate?.openLocatinMap(info: info)
+        }
+        self.constraintWithContent(contentView: self.locationView)
+    }
+    
     //音频消息
     private func audioMsgRender(info: IMMessageBodyInfo) {
         self.messageBgWidth.constant = IMAudioView.IMAudioView_width + 20
@@ -74,16 +99,6 @@ class IMChatMessageSendViewCell: UITableViewCell {
         self.audioView.translatesAutoresizingMaskIntoConstraints = false
         self.messageBackgroundView.addSubview(self.audioView)
         self.audioView.setDuration(duration: info.audioDuration ?? "0")
-        //音频文件
-        if let fileId = info.fileId {
-            let urlStr = AppDelegate.o2Collect.generateURLWithAppContextKey(
-            CommunicateContext.communicateContextKey,
-            query: CommunicateContext.imDownloadFileQuery,
-            parameter: ["##id##": fileId as AnyObject], generateTime: false)
-            self.audioView.setPlayUrl(url: urlStr)
-        } else if let filePath = info.fileTempPath {
-            self.audioView.setPlayUrl(url: filePath)
-        }
         self.audioView.addTapGesture { (tap) in
             self.playAudio(info: info)
         }

+ 32 - 17
o2ios/O2Platform/App/IM-聊天/View/IMChatMessageViewCell.swift

@@ -11,6 +11,7 @@ import CocoaLumberjack
 
 protocol IMChatMessageDelegate {
     func clickImageMessage(fileId: String?, tempPath: String?)
+    func openLocatinMap(info: IMMessageBodyInfo)
 }
 
 class IMChatMessageViewCell: UITableViewCell {
@@ -22,13 +23,20 @@ class IMChatMessageViewCell: UITableViewCell {
     @IBOutlet weak var messageBackgroundWidth: NSLayoutConstraint!
     @IBOutlet weak var messageBackgroundHeight: NSLayoutConstraint!
     private let messageWidth = 176
-    
+
     private lazy var audioView: IMAudioView = {
         let view = Bundle.main.loadNibNamed("IMAudioView", owner: self, options: nil)?.first as! IMAudioView
         view.frame = CGRect(x: 0, y: 0, width: IMAudioView.IMAudioView_width, height: IMAudioView.IMAudioView_height)
         return view
     }()
-    
+
+    //位置消息 主体view
+    private lazy var locationView: IMLocationView = {
+        let view = Bundle.main.loadNibNamed("IMLocationView", owner: self, options: nil)?.first as! IMLocationView
+        view.frame = CGRect(x: 0, y: 0, width: IMLocationView.IMLocationViewWidth, height: IMLocationView.IMLocationViewHeight)
+        return view
+    }()
+
     var delegate: IMChatMessageDelegate?
 
     override func awakeFromNib() {
@@ -119,12 +127,29 @@ class IMChatMessageViewCell: UITableViewCell {
                 imageMsgRender(info: body)
             } else if o2_im_msg_type_audio == body.type {
                 audioMsgRender(info: body)
+            } else if o2_im_msg_type_location == body.type {
+                locationMsgRender(info: body)
             } else {
                 textMsgRender(msg: body.body!)
             }
         }
     }
-    
+
+    //位置消息
+    private func locationMsgRender(info: IMMessageBodyInfo) {
+        self.messageBackgroundWidth.constant = IMLocationView.IMLocationViewWidth + 20
+        self.messageBackgroundHeight.constant = IMLocationView.IMLocationViewHeight + 20
+        self.locationView.translatesAutoresizingMaskIntoConstraints = false
+        self.messageBackgroundView.addSubview(self.locationView)
+        self.locationView.setLocationAddress(address: info.address ?? "")
+        //点击打开地址
+        self.locationView.addTapGesture { (tap) in
+            //open map view
+            self.delegate?.openLocatinMap(info: info)
+        }
+        self.constraintWithContent(contentView: self.locationView)
+    }
+
     //音频消息
     private func audioMsgRender(info: IMMessageBodyInfo) {
         self.messageBackgroundWidth.constant = IMAudioView.IMAudioView_width + 20
@@ -132,22 +157,12 @@ class IMChatMessageViewCell: UITableViewCell {
         self.audioView.translatesAutoresizingMaskIntoConstraints = false
         self.messageBackgroundView.addSubview(self.audioView)
         self.audioView.setDuration(duration: info.audioDuration ?? "0")
-        //音频文件
-        if let fileId = info.fileId {
-            let urlStr = AppDelegate.o2Collect.generateURLWithAppContextKey(
-            CommunicateContext.communicateContextKey,
-            query: CommunicateContext.imDownloadFileQuery,
-            parameter: ["##id##": fileId as AnyObject], generateTime: false)
-            self.audioView.setPlayUrl(url: urlStr)
-        } else if let filePath = info.fileTempPath {
-            self.audioView.setPlayUrl(url: filePath)
-        }
         self.audioView.addTapGesture { (tap) in
             self.playAudio(info: info)
         }
         self.constraintWithContent(contentView: self.audioView)
     }
-    
+
     private func playAudio(info: IMMessageBodyInfo) {
         if let fileId = info.fileId {
             O2IMFileManager.shared.getFileLocalUrl(fileId: fileId)
@@ -158,8 +173,8 @@ class IMChatMessageViewCell: UITableViewCell {
                     } catch {
                         DDLogError(error.localizedDescription)
                     }
-            }.catch { (e) in
-                DDLogError(e.localizedDescription)
+                }.catch { (e) in
+                    DDLogError(e.localizedDescription)
             }
         } else if let filePath = info.fileTempPath {
             do {
@@ -170,7 +185,7 @@ class IMChatMessageViewCell: UITableViewCell {
             }
         }
     }
-    
+
     private func constraintWithContent(contentView: UIView) {
         let top = NSLayoutConstraint(item: contentView, attribute: .top, relatedBy: .equal, toItem: contentView.superview!, attribute: .top, multiplier: 1, constant: 10)
         let bottom = NSLayoutConstraint(item: contentView.superview!, attribute: .bottom, relatedBy: .equal, toItem: contentView, attribute: .bottom, multiplier: 1, constant: 10)

+ 2 - 4
o2ios/O2Platform/App/IM-聊天/View/IMConversationItemCell.swift

@@ -55,7 +55,6 @@ class IMConversationItemCell: UITableViewCell {
             if person != "" {
                 //头像
                 let urlstr = AppDelegate.o2Collect.generateURLWithAppContextKey(ContactContext.contactsContextKeyV2, query: ContactContext.personIconByNameQueryV2, parameter: ["##name##":person as AnyObject], generateTime: false)
-                DDLogDebug("头像url \(String(describing: urlstr))")
                 if let u = URL(string: urlstr!) {
                     self.avatarImg.hnk_setImageFromURL(u)
                 }else {
@@ -74,15 +73,14 @@ class IMConversationItemCell: UITableViewCell {
         }
         //time
         if let time = conversation.lastMessage?.createTime {
-            DDLogDebug("time: \(time)")
             let date = time.toDate(formatter: "yyyy-MM-dd HH:mm:ss")
-            DDLogDebug("date \(date.description)")
             self.timeLabel.text = date.friendlyTime()
         }
         // message
         if let msgBody = conversation.lastMessage?.body, let body = parseJson(msg: msgBody) {
             
-            if body.type == o2_im_msg_type_text || body.type == o2_im_msg_type_image || body.type == o2_im_msg_type_audio {
+            if body.type == o2_im_msg_type_text || body.type == o2_im_msg_type_image
+                || body.type == o2_im_msg_type_audio || body.type == o2_im_msg_type_location {
                 self.messageLabel.text = body.body
                 self.messageLabel.isHidden = false
                 self.emojiImg.isHidden = true

+ 26 - 0
o2ios/O2Platform/App/IM-聊天/View/IMLocationView.swift

@@ -0,0 +1,26 @@
+//
+//  IMLocationView.swift
+//  O2Platform
+//
+//  Created by FancyLou on 2020/6/18.
+//  Copyright © 2020 zoneland. All rights reserved.
+//
+
+import UIKit
+
+class IMLocationView: UIView {
+    
+    static let IMLocationViewWidth: CGFloat = 175
+    static let IMLocationViewHeight: CGFloat = 100
+    
+    @IBOutlet weak var locationLabel: UILabel!
+    
+    
+    override func awakeFromNib() {
+    }
+    
+    func setLocationAddress(address: String) {
+        self.locationLabel.text = address
+    }
+    
+}

+ 59 - 0
o2ios/O2Platform/App/IM-聊天/View/IMLocationView.xib

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_1" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <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"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="IMLocationView" customModule="O2Platform" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="175" height="100"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chat_list_poi_background" translatesAutoresizingMaskIntoConstraints="NO" id="Wnb-9p-mB9">
+                    <rect key="frame" x="0.0" y="0.0" width="175" height="100"/>
+                </imageView>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RFx-ki-VdW">
+                    <rect key="frame" x="0.0" y="0.0" width="175" height="32"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zrA-xl-ZpU">
+                            <rect key="frame" x="5" y="16" width="165" height="0.0"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" white="1" alpha="0.75321061639999998" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstItem="zrA-xl-ZpU" firstAttribute="centerY" secondItem="RFx-ki-VdW" secondAttribute="centerY" id="PjU-x3-Yhs"/>
+                        <constraint firstItem="zrA-xl-ZpU" firstAttribute="leading" secondItem="RFx-ki-VdW" secondAttribute="leading" constant="5" id="drp-9P-liN"/>
+                        <constraint firstAttribute="trailing" secondItem="zrA-xl-ZpU" secondAttribute="trailing" constant="5" id="qg0-WC-PDN"/>
+                        <constraint firstAttribute="height" constant="32" id="yQb-fr-wUS"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+            <constraints>
+                <constraint firstItem="RFx-ki-VdW" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="0at-tV-wNL"/>
+                <constraint firstAttribute="trailing" secondItem="RFx-ki-VdW" secondAttribute="trailing" id="6IR-GH-3bN"/>
+                <constraint firstItem="Wnb-9p-mB9" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="6hd-WP-j5N"/>
+                <constraint firstItem="RFx-ki-VdW" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="ChW-2V-vNZ"/>
+                <constraint firstItem="Wnb-9p-mB9" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" id="Lll-Wv-407"/>
+                <constraint firstItem="Wnb-9p-mB9" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="gq9-Ps-ERI"/>
+                <constraint firstItem="Wnb-9p-mB9" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="lGa-tf-rGe"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <connections>
+                <outlet property="locationLabel" destination="zrA-xl-ZpU" id="oQZ-ub-EBW"/>
+            </connections>
+            <point key="canvasLocation" x="131.15942028985509" y="195.53571428571428"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="chat_list_poi_background" width="225" height="130"/>
+    </resources>
+</document>

+ 1 - 9
o2ios/O2Platform/App/NewAttance-考勤打卡/c/OOAttanceSettingController.swift

@@ -258,15 +258,7 @@ extension OOAttanceSettingController:BMKGeoCodeSearchDelegate {
     func onGetReverseGeoCodeResult(_ searcher: BMKGeoCodeSearch!, result: BMKReverseGeoCodeSearchResult!, errorCode error: BMKSearchErrorCode) {
         dataView.workPlaceNameTextField.text = result.address
         dataView.workAliasNameTextField.text = result.sematicDescription
-//        for item in result.poiList {
-//            let m = item as! BMKPoiInfo
-//            print(m.name)            ///<POI名称
-//            print(m.uid)
-//            print(m.address)      ///<POI地址
-//            print(m.city)        ///<POI所在城市
-//            print(m.phone)        ///<POI电话号码
-//            print(m.pt.longitude,m.pt.latitude)    ///<POI坐标
-//        }
+
         //设置settingBean
         settingBean.placeName = result.address
         settingBean.placeAlias = result.sematicDescription

+ 2 - 0
o2ios/O2Platform/App/O2MainController.swift

@@ -10,6 +10,7 @@ import UIKit
 import CocoaLumberjack
 import O2OA_Auth_SDK
 import Starscream
+import AudioToolbox
 
 class O2MainController: UITabBarController, UITabBarControllerDelegate {
 
@@ -299,6 +300,7 @@ extension O2MainController: WebSocketDelegate {
                                 NotificationCenter.post(customeNotification: OONotification.websocket, object: messageInfo.body)
                             }
                             self.addUnreadNumber()
+                            AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
                         }
                     }
                 } catch { }

+ 22 - 0
o2ios/O2Platform/Assets.xcassets/im/chat_list_poi_background.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "chat_list_poi_background@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "chat_list_poi_background@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
o2ios/O2Platform/Assets.xcassets/im/chat_list_poi_background.imageset/chat_list_poi_background@2x.png


BIN
o2ios/O2Platform/Assets.xcassets/im/chat_list_poi_background.imageset/chat_list_poi_background@3x.png