Quellcode durchsuchen

百度定位更改

南鑫林 vor 5 Jahren
Ursprung
Commit
fa2935b6b2
23 geänderte Dateien mit 56 neuen und 72 gelöschten Zeilen
  1. 5 3
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift
  2. 0 8
      RainbowPlanet/RainbowPlanet/Manager/MapManager/BaiduMapManager/LocationModel.swift
  3. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/AddressPOI/View/AddressPOITableViewCell.swift
  4. 6 6
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/AddressPOI/View/AddressPOIView.swift
  5. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/AddressPOI/ViewController/AddressPOIViewController.swift
  6. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/SelfRecommendation/View/SelfRecommendationView.swift
  7. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/SelfRecommendation/ViewController/SelfRecommendationViewController.swift
  8. 2 3
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift
  9. 2 3
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFindFriends/ViewController/CommunityFindFriendsViewController.swift
  10. 2 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddAddressController.swift
  11. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddressPOICell.swift
  12. 5 5
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddressPOIView.swift
  13. 5 8
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/Search/View/SearchNavigationbarView.swift
  14. 1 3
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/Search/ViewController/SearchViewController.swift
  15. 2 3
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift
  16. 1 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/MainView/ShoppingMallNavigationBarView.swift
  17. 2 3
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallViewController.swift
  18. 2 3
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/ViewController/SpecialViewController.swift
  19. 2 2
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCMS/SwiftMoyaNetWorkServiceCMS.swift
  20. 2 2
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaNetWorkServiceConfig.swift
  21. 1 1
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceOrder/SwiftMoyaNetWorkServiceOrder.swift
  22. 8 8
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaNetWorkServiceProduct.swift
  23. 1 1
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceUser/SwiftMoyaNetWorkServiceUser.swift

+ 5 - 3
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift

@@ -18,10 +18,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         initWindow()
         //版本更新
 //        _ = UpdateVersionManager.shared
-        
+
+        //初始化百度地图
+        BaiduMapManager.shared.initBaiduMap()
+        BaiduMapManager.shared.startLocation()
         DispatchQueue.global(qos: .default).async {
-            //初始化百度地图
-            BaiduMapManager.shared.initBaiduMap()
+
             //初始化键盘
             DispatchQueue.main.async {
                 //初始化友盟

+ 0 - 8
RainbowPlanet/RainbowPlanet/Manager/MapManager/BaiduMapManager/LocationModel.swift

@@ -86,14 +86,6 @@ class LocationModel: NSObject,Mappable {
         return LocationModel(JSONString: json?.description ?? "")
     }
 
-    
-    /// 获取定位信息
-    ///
-    /// - Returns: 定位模型
-    func getLocationModel() -> LocationModel? {
-        return object()
-    }
-
     func toString() -> String {
         let str = self.country +
             self.province +

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/AddressPOI/View/AddressPOITableViewCell.swift

@@ -64,7 +64,7 @@ class AddressPOITableViewCell: UITableViewCell {
             if locationAddress != "" || locationAddress != nil {
                 titleLabel.text = locationAddress
             }else {
-                let locationModel = LocationModel.shared().getLocationModel()
+                let locationModel = LocationModel.shared().object()
                 titleLabel.text = locationModel?.toString()
             }
         }

+ 6 - 6
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/AddressPOI/View/AddressPOIView.swift

@@ -23,9 +23,9 @@ class AddressPOIView: BaseView {
         }
     }
     /// 纬度
-    var latitude : String = LocationModel.shared().getLocationModel()?.latitude ?? "34.20840377740726"
+    var latitude : String = LocationModel.shared().object()?.latitude ?? "34.20840377740726"
     /// 经度
-    var longitude : String = LocationModel.shared().getLocationModel()?.longitude ?? "108.96265686107972"
+    var longitude : String = LocationModel.shared().object()?.longitude ?? "108.96265686107972"
     
     
     
@@ -105,7 +105,7 @@ class AddressPOIView: BaseView {
     
     private lazy var addressLabel: UILabel = {
         let addressLabel = UILabel()
-        addressLabel.text = LocationModel.shared().getLocationModel()?.city ?? "西安市"
+        addressLabel.text = LocationModel.shared().object()?.city ?? "西安市"
         addressLabel.textColor = k999999Color
         addressLabel.font = kScaleRegularFont14
         return addressLabel
@@ -135,7 +135,7 @@ class AddressPOIView: BaseView {
         searchTextField.borderStyle = .none
         searchTextField.rx.text.orEmpty.changed.subscribe(onNext: { (text) in
             
-                BaiduMapManager.shared.suggestionSearchPoi(cityname:LocationModel.shared().getLocationModel()?.city ?? "西安市", keyword: text)
+                BaiduMapManager.shared.suggestionSearchPoi(cityname:LocationModel.shared().object()?.city ?? "西安市", keyword: text)
                 BaiduMapManager.shared.suggestionSearchSuccessBlock = {
                     [weak self] (suggestionList:Array<BMKSuggestionInfo>) in
                     self?.suggestionList = suggestionList
@@ -194,7 +194,7 @@ extension AddressPOIView:UITableViewDataSource,UITableViewDelegate {
                 BaiduMapManager.shared.startLocation()
                 BaiduMapManager.shared.locationSuccessBlock = {
                     [weak self] in
-                    let locationModel = LocationModel.shared().getLocationModel()
+                    let locationModel = LocationModel.shared().object()
                     self?.locationAddress = locationModel?.toString()
                 }
                 BaiduMapManager.shared.locationFalseBlock = {
@@ -217,7 +217,7 @@ extension AddressPOIView:UITableViewDataSource,UITableViewDelegate {
                 didSelectBlock(self.latitude,self.longitude,self.locationAddress ?? "")
                 break
             default:
-                let locationModel = LocationModel.shared().getLocationModel()
+                let locationModel = LocationModel.shared().object()
                 let suggestionList = self.suggestionList?[indexPath.row]
                 let city = suggestionList?.city ?? ""
                 let district = suggestionList?.district ?? ""

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/AddressPOI/ViewController/AddressPOIViewController.swift

@@ -14,9 +14,9 @@ class AddressPOIViewController: BaseViewController {
     var didSelectBlock : DidSelectBlock?
     var locationAddress: String?
     /// 纬度
-    var latitude : String = LocationModel.shared().getLocationModel()?.latitude ?? "34.20840377740726"
+    var latitude : String = LocationModel.shared().object()?.latitude ?? "34.20840377740726"
     /// 经度
-    var longitude : String = LocationModel.shared().getLocationModel()?.longitude ?? "108.96265686107972"
+    var longitude : String = LocationModel.shared().object()?.longitude ?? "108.96265686107972"
     
     override func viewDidLoad() {
         super.viewDidLoad()

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/SelfRecommendation/View/SelfRecommendationView.swift

@@ -109,7 +109,7 @@ class SelfRecommendationView: BaseView {
     
     private lazy var locationAddressLable: UILabel = {
         let locationAddressLable = UILabel()
-        let locationModel = LocationModel.shared().getLocationModel()
+        let locationModel = LocationModel.shared().object()
         locationAddressLable.text = locationModel!.toString()
         locationAddressLable.textColor = kffffffColor
         locationAddressLable.font = kScaleBoldFont16

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/SelfRecommendation/ViewController/SelfRecommendationViewController.swift

@@ -11,9 +11,9 @@ import UIKit
 class SelfRecommendationViewController: BaseViewController {
 
     /// 纬度
-    var latitude : String = LocationModel.shared().getLocationModel()?.latitude ?? "34.20840377740726"
+    var latitude : String = LocationModel.shared().object()?.latitude ?? "34.20840377740726"
     /// 经度
-    var longitude : String = LocationModel.shared().getLocationModel()?.longitude ?? "108.96265686107972"
+    var longitude : String = LocationModel.shared().object()?.longitude ?? "108.96265686107972"
     
     var selfMentionAddressArray = Array<SelfMentionAddressModel>()
     

+ 2 - 3
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift

@@ -65,9 +65,8 @@ class CommunityViewController: BaseViewController {
             let vc = SearchViewController()
             vc.searchType = .content
             let nav = BaseNavigationViewController(rootViewController: vc)
-            self?.navigationController?.present(nav, animated: true, completion: {
-                
-            })
+            self?.navigationController?.pushViewController(vc, animated: true)
+
         }
         //彩虹豆
         communityNavigationBarView.rightButton.rx.tap.subscribe(onNext: { (data) in

+ 2 - 3
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFindFriends/ViewController/CommunityFindFriendsViewController.swift

@@ -47,9 +47,8 @@ class CommunityFindFriendsViewController: BaseViewController {
             let vc = SearchViewController()
             vc.searchType = .user
             let nav = BaseNavigationViewController(rootViewController: vc)
-            self?.navigationController?.present(nav, animated: true, completion: {
-                
-            })
+            self?.navigationController?.pushViewController(vc, animated: true)
+
         }
         tableView.tableHeaderView = communityFindFriendsView
         tableView.addHeaderWithHeader(withBeginRefresh: true, animation: false) { [weak self] (page) in

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddAddressController.swift

@@ -15,9 +15,9 @@ class PublishAddAddressController: BaseViewController {
     
     var locationAddress: String?
     /// 纬度
-    var latitude : String = LocationModel.shared().getLocationModel()?.latitude ?? "34.20840377740726"
+    var latitude : String = LocationModel.shared().object()?.latitude ?? "34.20840377740726"
     /// 经度
-    var longitude : String = LocationModel.shared().getLocationModel()?.longitude ?? "108.96265686107972"
+    var longitude : String = LocationModel.shared().object()?.longitude ?? "108.96265686107972"
     /// poiList
     var poiList: Array<SwiftLocationPOIModel> = LocationModel.shared().object()?.poiList ?? []
     

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddressPOICell.swift

@@ -67,7 +67,7 @@ class PublishAddressPOICell: UITableViewCell {
             if locationAddress != "" && locationAddress != nil {
                 titleLabel.text = locationAddress
             }else {
-                titleLabel.text = LocationModel.shared().getLocationModel()?.city ?? "西安市"
+                titleLabel.text = LocationModel.shared().object()?.city ?? "西安市"
             }
         }
     }

+ 5 - 5
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddressPOIView.swift

@@ -23,9 +23,9 @@ class PublishAddressPOIView: BaseView {
         }
     }
     /// 纬度
-    var latitude : String = LocationModel.shared().getLocationModel()?.latitude ?? "34.20840377740726"
+    var latitude : String = LocationModel.shared().object()?.latitude ?? "34.20840377740726"
     /// 经度
-    var longitude : String = LocationModel.shared().getLocationModel()?.longitude ?? "108.96265686107972"
+    var longitude : String = LocationModel.shared().object()?.longitude ?? "108.96265686107972"
     /// poiList
     var poiList: Array<SwiftLocationPOIModel>? {
         didSet {
@@ -78,7 +78,7 @@ class PublishAddressPOIView: BaseView {
     }
     
     func searchPOI(_ searchText: String) {
-        BaiduMapManager.shared.suggestionSearchPoi(cityname:LocationModel.shared().getLocationModel()?.city ?? "西安市", keyword: searchText)
+        BaiduMapManager.shared.suggestionSearchPoi(cityname:LocationModel.shared().object()?.city ?? "西安市", keyword: searchText)
         BaiduMapManager.shared.suggestionSearchSuccessBlock = {
             [weak self] (suggestionList:Array<BMKSuggestionInfo>) in
             self?.suggestionList = suggestionList
@@ -181,7 +181,7 @@ extension PublishAddressPOIView:UITableViewDataSource,UITableViewDelegate {
                 break
             default:
                 if self.suggestionList != nil {
-                    let locationModel = LocationModel.shared().getLocationModel()
+                    let locationModel = LocationModel.shared().object()
                     let suggestionList = self.suggestionList?[indexPath.row]
                     let city = suggestionList?.city ?? ""
                     let district = suggestionList?.district ?? ""
@@ -192,7 +192,7 @@ extension PublishAddressPOIView:UITableViewDataSource,UITableViewDelegate {
                     didSelectBlock(latitude,longitude,toString)
                 }else {
                     let selPoiName = self.poiList?[indexPath.row].name
-                    let locationModel = LocationModel.shared().getLocationModel()
+                    let locationModel = LocationModel.shared().object()
                     didSelectBlock(locationModel!.latitude, locationModel!.longitude, selPoiName ?? "")
                 }
                 break

+ 5 - 8
RainbowPlanet/RainbowPlanet/Modules/SearchModule/Search/View/SearchNavigationbarView.swift

@@ -27,14 +27,13 @@ class SearchNavigationbarView: BaseView {
     override func setupLayouts() {
         cancelButton.snp.makeConstraints { (make) in
             make.centerY.equalToSuperview()
-            make.right.equalToSuperview().offset(-14)
-            make.width.equalTo(30)
-            make.height.equalTo(21)
+            make.left.equalToSuperview().offset(14)
+            make.size.equalTo(22)
         }
         searchbgView.snp.makeConstraints { (make) in
             make.centerY.equalToSuperview()
-            make.left.equalTo(14)
-            make.right.equalTo(cancelButton.snp.left).offset(-14)
+            make.right.equalTo(-14)
+            make.left.equalTo(cancelButton.snp.right).offset(10)
             make.height.equalTo(30)
         }
         searchIconImageView.snp.makeConstraints { (make) in
@@ -107,9 +106,7 @@ class SearchNavigationbarView: BaseView {
     
     private lazy var cancelButton: UIButton = {
         let cancelButton = UIButton(type: UIButton.ButtonType.custom)
-        cancelButton.setTitle("取消", for: UIControl.State.normal)
-        cancelButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        cancelButton.titleLabel?.font = kRegularFont15
+        cancelButton.setImage(kImage(name: "navbar_back_black"), for: UIControl.State.normal)
         cancelButton.rx.tap.subscribe(onNext: { [weak self] (data) in
             if let cancelBlock = self?.cancelBlock {
                 cancelBlock()

+ 1 - 3
RainbowPlanet/RainbowPlanet/Modules/SearchModule/Search/ViewController/SearchViewController.swift

@@ -40,9 +40,7 @@ class SearchViewController: BaseViewController {
         let navigationBarView = SearchNavigationbarView()
         navigationBarView.cancelBlock = {
             [weak self] in
-            self?.dismiss(animated: true, completion: {
-                
-            })
+            self?.navigationController?.popViewController(animated: true)
         }
         navigationBarView.searchBlock = {
             [weak self] keyword in

+ 2 - 3
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift

@@ -52,9 +52,8 @@ class CategoryViewController: BaseViewController {
             let vc = SearchViewController()
             vc.searchType = .product
             let nav = BaseNavigationViewController(rootViewController: vc)
-            self?.navigationController?.present(nav, animated: true, completion: {
-                
-            })
+            self?.navigationController?.pushViewController(vc, animated: true)
+
         }).disposed(by: disposeBag)
         categorySearchView.shoppingCarBlock = {
             [weak self] in

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/MainView/ShoppingMallNavigationBarView.swift

@@ -80,7 +80,7 @@ class ShoppingMallNavigationBarView: BaseView {
     
     private lazy var addressLabel: UILabel = {
         let addressLabel = UILabel()
-        addressLabel.text = LocationModel.shared().getLocationModel()?.city ?? "西安市"
+        addressLabel.text = LocationModel.shared().object()?.city ?? "西安市"
         addressLabel.textColor = k999999Color
         addressLabel.font = kScaleRegularFont14
         let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapGesClick(tap:)))

+ 2 - 3
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallViewController.swift

@@ -74,9 +74,8 @@ class ShoppingMallViewController: BaseViewController {
             let vc = SearchViewController()
             vc.searchType = .product
             let nav = BaseNavigationViewController(rootViewController: vc)
-            self?.navigationController?.present(nav, animated: true, completion: {
-                
-            })
+            self?.navigationController?.pushViewController(vc, animated: true)
+
         }
         //分类
         navigationBarView.categoryButton.rx.tap.subscribe(onNext: {

+ 2 - 3
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Special/ViewController/SpecialViewController.swift

@@ -58,9 +58,8 @@ class SpecialViewController: BaseViewController {
             let vc = SearchViewController()
             vc.searchType = .product
             let nav = BaseNavigationViewController(rootViewController: vc)
-            self?.navigationController?.present(nav, animated: true, completion: {
-                
-            })
+            self?.navigationController?.pushViewController(vc, animated: true)
+
         }).disposed(by: disposeBag)
         categorySearchView.shoppingCarBlock = {
             [weak self] in

+ 2 - 2
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCMS/SwiftMoyaNetWorkServiceCMS.swift

@@ -31,7 +31,7 @@ class SwiftMoyaNetWorkServiceCMS: NSObject {
     /// - Parameter completion: 完成
     func cmsTemplateSetTemplateNameApi(completion: @escaping apiCallBack) {
         var parameters = Dictionary<String,Any>()
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         SwiftProgressHUD.shared().showWait()
@@ -48,7 +48,7 @@ class SwiftMoyaNetWorkServiceCMS: NSObject {
     func cmsTemplateSetPreviewApi(type:Int,completion: @escaping apiCallBack) {
         var parameters = Dictionary<String,Any>()
         SwiftProgressHUD.shared().showWait()
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         parameters.updateValue(type, forKey: "type")

+ 2 - 2
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaNetWorkServiceConfig.swift

@@ -44,7 +44,7 @@ class SwiftMoyaNetWorkServiceConfig: NSObject {
     ///   - completion: 完成
     func configPickupNodeIndexApi(longitude:String?,latitude:String?, page:Int = 1,completion: @escaping apiCallBack) {
         var parameters = Dictionary<String,Any>()
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         parameters.updateValue(longitude ?? "", forKey: "longitude")
@@ -66,7 +66,7 @@ class SwiftMoyaNetWorkServiceConfig: NSObject {
     ///   - completion: 完成
     func configCityManagementIndexApi(page:Int = 1,completion: @escaping apiCallBack) {
         var parameters = Dictionary<String,Any>()
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         parameters.updateValue(page, forKey: "page")

+ 1 - 1
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceOrder/SwiftMoyaNetWorkServiceOrder.swift

@@ -31,7 +31,7 @@ class SwiftMoyaNetWorkServiceOrder: NSObject {
         var parameters = Dictionary<String,Any>()
         
         // 本地获取city_id/city_name
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         parameters.updateValue(baiduToCityModel.areaName, forKey: "city_name")

+ 8 - 8
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaNetWorkServiceProduct.swift

@@ -34,7 +34,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
     func productListApi(page:Int = 1,shopId:Int  = 0, keyword:String = "",categoryId:Int = 0,desc:Int = 0,fieldOrder:Int = 0,completion: @escaping apiCallBack) {
         var parameters = Dictionary<String,Any>()
         // 本地获取city_id
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         
@@ -135,7 +135,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
         var parameters = Dictionary<String,Any>()
         parameters.updateValue(page, forKey: "page")
         // 本地获取city_id
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         
@@ -173,7 +173,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
     func productCartListApi(completion: @escaping apiCallBack) {
         var parameters = Dictionary<String,Any>()
         // 本地获取city_id
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         
@@ -209,7 +209,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
         parameters.updateValue(productMdl.skuName  ?? "", forKey: "sku_name")
         
         // 本地获取city_id/city_name
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         parameters.updateValue(baiduToCityModel.areaName, forKey: "city_name")
@@ -247,7 +247,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
         parameters.updateValue(productSearchModel.skuName  ?? "", forKey: "sku_name")
         
         // 本地获取city_id/city_name
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         parameters.updateValue(baiduToCityModel.areaName, forKey: "city_name")
@@ -284,7 +284,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
         parameters.updateValue(productDetailSkuModel.skuName  ?? "", forKey: "sku_name")
         
         // 本地获取city_id/city_name
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         parameters.updateValue(baiduToCityModel.areaName, forKey: "city_name")
@@ -376,7 +376,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
         var parameters = Dictionary<String,Any>()
         parameters.updateValue(isSelect, forKey: "is_select")
         // 本地获取city_id
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         // 本地获取deliver_type
@@ -457,7 +457,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
         var parameters = Dictionary<String,Any>()
         
         // 本地获取city_id
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         // 本地获取deliver_type

+ 1 - 1
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceUser/SwiftMoyaNetWorkServiceUser.swift

@@ -283,7 +283,7 @@ public class SwiftMoyaNetWorkServiceUser: NSObject {
     ///   - completion: 回调
     func userSelfAndExpressAddressListApi(type:Int,completion: @escaping apiCallBack) {
         var parameters = Dictionary<String,Any>()
-        let loacationModel = LocationModel.shared().getLocationModel()
+        let loacationModel = LocationModel.shared().object()
         let baiduToCityModel = BaiduToCityFactory.shared.query(bjcityId: loacationModel!.cityCode)
         parameters.updateValue(baiduToCityModel.areaCode, forKey: "city_id")
         parameters.updateValue(type, forKey: "type")