南鑫林 6 lat temu
rodzic
commit
8e52c3a64c

+ 4 - 4
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -215,6 +215,7 @@
 		A79057062276EA3D0037F823 /* OpenCityListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A79057052276EA3D0037F823 /* OpenCityListModel.swift */; };
 		A7A17E5F22A0CEF200B7A77E /* SwiftMoyaNetWorkManagerTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A17E5E22A0CEF200B7A77E /* SwiftMoyaNetWorkManagerTools.swift */; };
 		A7A17E6322A102B700B7A77E /* BaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A17E6222A102B700B7A77E /* BaseModel.swift */; };
+		A7A17E6522A1307900B7A77E /* ConfigModel1.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A17E6422A1307800B7A77E /* ConfigModel1.swift */; };
 		A7A98DFD227E84F4005306E9 /* SwiftMoyaServiceProductApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98DFC227E84F4005306E9 /* SwiftMoyaServiceProductApi.swift */; };
 		A7A98DFF227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98DFE227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift */; };
 		A7A98E02227E8900005306E9 /* ProductSearchListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A98E01227E8900005306E9 /* ProductSearchListModel.swift */; };
@@ -296,7 +297,6 @@
 		A7D4608E227616F800A5A54E /* SQLiteManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D4608D227616F800A5A54E /* SQLiteManager.swift */; };
 		A7D46090227617D200A5A54E /* SQLModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D4608F227617D200A5A54E /* SQLModel.swift */; };
 		A7D46092227619CD00A5A54E /* BaiduToCityFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D46091227619CC00A5A54E /* BaiduToCityFactory.swift */; };
-		A7D460942276854500A5A54E /* BaiduToCity2Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D460932276854500A5A54E /* BaiduToCity2Model.swift */; };
 		A7DC467F22783A47001F3EFC /* EditExpressAddressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DC467E22783A47001F3EFC /* EditExpressAddressTableViewCell.swift */; };
 		A7FF1555228AC27600A85748 /* ProductAllCommentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1554228AC27600A85748 /* ProductAllCommentView.swift */; };
 		A7FF1557228AC3E800A85748 /* ProductAllCommentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1556228AC3E800A85748 /* ProductAllCommentViewController.swift */; };
@@ -617,6 +617,7 @@
 		A79057052276EA3D0037F823 /* OpenCityListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenCityListModel.swift; sourceTree = "<group>"; };
 		A7A17E5E22A0CEF200B7A77E /* SwiftMoyaNetWorkManagerTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaNetWorkManagerTools.swift; sourceTree = "<group>"; };
 		A7A17E6222A102B700B7A77E /* BaseModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseModel.swift; sourceTree = "<group>"; };
+		A7A17E6422A1307800B7A77E /* ConfigModel1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigModel1.swift; sourceTree = "<group>"; };
 		A7A59A7722363CCB00417FA4 /* RainbowPlanet.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RainbowPlanet.entitlements; sourceTree = "<group>"; };
 		A7A98DFC227E84F4005306E9 /* SwiftMoyaServiceProductApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaServiceProductApi.swift; sourceTree = "<group>"; };
 		A7A98DFE227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMoyaNetWorkServiceProduct.swift; sourceTree = "<group>"; };
@@ -699,7 +700,6 @@
 		A7D4608D227616F800A5A54E /* SQLiteManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SQLiteManager.swift; sourceTree = "<group>"; };
 		A7D4608F227617D200A5A54E /* SQLModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SQLModel.swift; sourceTree = "<group>"; };
 		A7D46091227619CC00A5A54E /* BaiduToCityFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaiduToCityFactory.swift; sourceTree = "<group>"; };
-		A7D460932276854500A5A54E /* BaiduToCity2Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaiduToCity2Model.swift; sourceTree = "<group>"; };
 		A7DC467E22783A47001F3EFC /* EditExpressAddressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditExpressAddressTableViewCell.swift; sourceTree = "<group>"; };
 		A7E03A30F40582782EC5DA89 /* Pods_RainbowPlanetTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RainbowPlanetTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		A7FF1554228AC27600A85748 /* ProductAllCommentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAllCommentView.swift; sourceTree = "<group>"; };
@@ -1174,7 +1174,6 @@
 		A71901712275F56C00104A50 /* BaiduToCityFactory */ = {
 			isa = PBXGroup;
 			children = (
-				A7D460932276854500A5A54E /* BaiduToCity2Model.swift */,
 				A7D46091227619CC00A5A54E /* BaiduToCityFactory.swift */,
 				A71901742275F71F00104A50 /* BaiduToCityModel.swift */,
 			);
@@ -2276,6 +2275,7 @@
 			isa = PBXGroup;
 			children = (
 				A715333D22980CC60017C861 /* ConfigModel.swift */,
+				A7A17E6422A1307800B7A77E /* ConfigModel1.swift */,
 				A79057052276EA3D0037F823 /* OpenCityListModel.swift */,
 				A757C92F2274839900226355 /* SelfMentionAddressListModel.swift */,
 				BDD22F0A228FAA5B00D43BFB /* ImageUrlModel.swift */,
@@ -3427,6 +3427,7 @@
 				A70B2C532288584500B2449F /* ShareView.swift in Sources */,
 				A71AF0AE226EF0A3001730FE /* SearchHeaderCollectionReusableView.swift in Sources */,
 				A7636AC52268139C00374F9E /* LocationViewController.swift in Sources */,
+				A7A17E6522A1307900B7A77E /* ConfigModel1.swift in Sources */,
 				A7D46090227617D200A5A54E /* SQLModel.swift in Sources */,
 				A72C01222275404A0065E0C3 /* ProvinceCityAreaModel.swift in Sources */,
 				A7FF1579228C82CE00A85748 /* OrderDetailViewController.swift in Sources */,
@@ -3524,7 +3525,6 @@
 				A7BB68552268DE8600AB07A2 /* SelfRecommendationView.swift in Sources */,
 				A72A72AF22321DE000B21995 /* AppInfo.swift in Sources */,
 				A70B843422911AF600882BC5 /* ProductDetailView.swift in Sources */,
-				A7D460942276854500A5A54E /* BaiduToCity2Model.swift in Sources */,
 				A7FF1598228D092A00A85748 /* OrderListModel.swift in Sources */,
 				A7FF157D228C837100A85748 /* OrderDetailStatusTableViewCell.swift in Sources */,
 				A7A98E41228046C5005306E9 /* ShoppingMallSepcialTableViewCell.swift in Sources */,

+ 2 - 0
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift

@@ -24,6 +24,8 @@ extension AppDelegate {
             self?.setNavBarAppearence()
         }
         // 获取默认配置
+//        SwiftMoyaNetWorkServiceConfig.shared().configPickupNodeIndexApi1 { (data) -> (Void) in
+//        }
         if (UserModel.shared().getModel()?.token) != nil && (DeliveryMethodTypeModel.shared().getModel()?.deliveryMethodType) != nil {
             /// 设置Tabbar
             /// 刷新token

+ 3 - 17
RainbowPlanet/RainbowPlanet/Service/Model/CMSModel/CMSTemplateModel.swift

@@ -8,7 +8,7 @@ import Realm
 import RealmSwift
 
 
-class CMSTemplateModel : Object, Mappable{
+class CMSTemplateModel :NSObject, Mappable{
 
 	dynamic var applyType : Int?
 	dynamic var title : String?
@@ -16,10 +16,8 @@ class CMSTemplateModel : Object, Mappable{
 	class func newInstance(map: Map) -> Mappable?{
         return CMSTemplateModel(map: map)
 	}
-    required convenience init?(map: Map){
-        self.init()
-//        mapping(map: map)
-    }
+    required init?(map: Map){}
+    private override init(){}
     
     func mapping(map: Map)
     {
@@ -27,16 +25,4 @@ class CMSTemplateModel : Object, Mappable{
         title <- map["title"]
         
     }
-    
-    required init() {
-        super.init()
-    }
-    
-    required init(realm: RLMRealm, schema: RLMObjectSchema) {
-        fatalError("init(realm:schema:) has not been implemented")
-    }
-    
-    required init(value: Any, schema: RLMSchema) {
-        fatalError("init(value:schema:) has not been implemented")
-    }
 }

+ 23 - 0
RainbowPlanet/RainbowPlanet/Service/Model/ConfigModel/ConfigModel1.swift

@@ -0,0 +1,23 @@
+//
+//	ConfigModel1.swift
+//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
+
+import RealmSwift
+
+class ConfigModel1: Object {
+
+	dynamic var orderExpiredTime: String!
+
+
+	/**
+	 * Instantiate the instance using the passed dictionary values to set the properties values
+	 */
+	class func fromDictionary(dictionary: [String:Any]) -> ConfigModel1	{
+		let this = ConfigModel1()
+		if let orderExpiredTimeValue = dictionary["order_expired_time"] as? String{
+			this.orderExpiredTime = orderExpiredTimeValue
+		}
+		return this
+	}
+
+}

+ 2 - 2
RainbowPlanet/RainbowPlanet/Service/Model/RootModel/BaseModel.swift

@@ -7,7 +7,7 @@ import RealmSwift
 class BaseModel: Object {
     
     dynamic var code: Int = 0
-    dynamic var data: String!
+    dynamic var data: Any!
     dynamic var msg: String!
     
     
@@ -19,7 +19,7 @@ class BaseModel: Object {
         if let codeValue = dictionary["code"] as? Int{
             this.code = codeValue
         }
-        if let dataValue = dictionary["data"] as? String{
+        if let dataValue = dictionary["data"]  {
             this.data = dataValue
         }
         if let msgValue = dictionary["msg"] as? String{

+ 14 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaNetWorkServiceConfig.swift

@@ -35,6 +35,20 @@ class SwiftMoyaNetWorkServiceConfig: NSObject {
         }
     }
     
+    /// 前端config配置
+    ///
+    /// - Parameter completion: 回调
+    func configPickupNodeIndexApi1(completion: @escaping apiCallBack) {
+        let parameters = Dictionary<String,Any>()
+        
+        SwiftProgressHUD.shared().showWait()
+        SwiftRXMoyaReamlObjectSwiftJsonNetWorkManager.shared.requestObject(ConfigModel1.self, target: MultiTarget(SwiftMoyaServiceConfigApi.configConfig(parameters: parameters))) { (configModel) in
+            SwiftProgressHUD.shared().hide()
+            completion(configModel)
+        }
+
+    }
+    
     /// 自提点列表
     ///
     /// - Parameters:

+ 1 - 2
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/SwiftRXMoyaReamlObjectSwiftJsonNetWorkManager.swift

@@ -223,7 +223,6 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
             }
         }
     }
-    
     // MARK: 泛型返回对象
     func mapObject<T: Object>(_ type: T.Type) -> Single<T?> {
         return flatMap { response -> Single<T?> in
@@ -234,7 +233,7 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
                     
                     let baseModel = BaseModel.fromDictionary(dictionary: json.dictionary ?? Dictionary())
                     if baseModel.code  == 0 {
-//                        let object = try JSON(data: baseModel.data).object as! T
+//                        let object =
                         return Single<T?>.just(nil)
                     }else if baseModel.code  == 1 {
                         SwiftProgressHUD.shared().showText(baseModel.msg ?? "信息有误!!!")

+ 0 - 38
RainbowPlanet/RainbowPlanet/Tools/BaiduToCityFactory/BaiduToCity2Model.swift

@@ -1,38 +0,0 @@
-//
-//	BaiduToCity2Model.swift
-//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
-
-import RealmSwift
-import Realm
-
-class BaiduToCity2Model: Object {
-
-	dynamic var areaCode: String!
-	dynamic var areaName: String!
-	dynamic var bjcityId: String!
-
-
-	/**
-	 * Instantiate the instance using the passed dictionary values to set the properties values
-	 */
-	class func fromDictionary(dictionary: [String:Any]) -> BaiduToCity2Model	{
-		let this = BaiduToCity2Model()
-		if let areaCodeValue = dictionary["area_code"] as? String{
-			this.areaCode = areaCodeValue
-		}
-		if let areaNameValue = dictionary["area_name"] as? String{
-			this.areaName = areaNameValue
-		}
-		if let bjcityIdValue = dictionary["bjcity_id"] as? String{
-			this.bjcityId = bjcityIdValue
-		}
-		return this
-	}
-    
-    //设置主键
-    override static func primaryKey() -> String? {
-        return "bjcityId"
-    }
-    
-    
-}