|
@@ -69,6 +69,21 @@ class WebViewJavascriptBridgeManager: NSObject {
|
|
|
bridge?.callHandler("h5", data: dictionary)
|
|
|
}
|
|
|
|
|
|
+ /// 返回地理位置
|
|
|
+ ///
|
|
|
+ /// - Parameter bridge: 交互对象
|
|
|
+ func callHandlerLocation(bridge: WebViewJavascriptBridge?,address:String? = "",latitude:String? = "",longitude:String? = "") {
|
|
|
+ var dictionary = Dictionary<String,Any>()
|
|
|
+ dictionary.updateValue("location", forKey: "type")
|
|
|
+ var locationDictionary = Dictionary<String,Any>()
|
|
|
+ locationDictionary.updateValue(address as Any, forKey: "address")
|
|
|
+ locationDictionary.updateValue(latitude as Any, forKey: "latitude")
|
|
|
+ locationDictionary.updateValue(longitude as Any, forKey: "longitude")
|
|
|
+ dictionary.updateValue(locationDictionary, forKey: "params")
|
|
|
+ NXLLog(JSON(dictionary))
|
|
|
+ bridge?.callHandler("h5", data: dictionary)
|
|
|
+ }
|
|
|
+
|
|
|
/// 发布
|
|
|
///
|
|
|
/// - Parameter bridge: 交互对象
|
|
@@ -166,6 +181,16 @@ class WebViewJavascriptBridgeManager: NSObject {
|
|
|
UIViewController.topMost?.navigationController?.pushViewController(vc, animated: true)
|
|
|
}
|
|
|
|
|
|
+ // 选择地理位置结果
|
|
|
+ if wvjbModel?.modelType == .location {
|
|
|
+ let vc = PublishAddAddressController()
|
|
|
+ vc.selectLocationClosure = {
|
|
|
+ [weak self] (address,latitude,longitude) in
|
|
|
+ self?.callHandlerLocation(bridge: bridge, address: address, latitude: latitude, longitude: longitude)
|
|
|
+ }
|
|
|
+ UIViewController.topMost?.navigationController?.pushViewController(vc, animated: true)
|
|
|
+ }
|
|
|
+
|
|
|
// 发布
|
|
|
if wvjbModel?.modelType == .publish {
|
|
|
NXLLog(wvjbModel?.params?.status)
|