From 5a590aaf3fd9ed5f9cfd2d54e72c904ce4918e7f Mon Sep 17 00:00:00 2001
From: younger_times <841720330@qq.com>
Date: 星期三, 12 七月 2023 18:56:43 +0800
Subject: [PATCH] 完善“课程详情”

---
 WanPai/Network/Services.swift |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/WanPai/Network/Services.swift b/WanPai/Network/Services.swift
index 37a512b..d9d11d4 100644
--- a/WanPai/Network/Services.swift
+++ b/WanPai/Network/Services.swift
@@ -23,8 +23,8 @@
     class func homeInfo()->Observable<BaseResponse<HomeStoreModel>>{
         let params = ParamsAppender.build(url: All_Url)
             .interface(url: "/account/api/appUser/queryJoinPlayPai")
-            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude)
-            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude)
+            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
+            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
         return NetworkRequest.request(params: params, method: .post, progress: false)
     }
 
@@ -94,8 +94,8 @@
     class func queryCourseList(typeId:Int? = nil,distanceSort:SortType? = nil,salesRanking:SortType? = nil,search:String? = nil,storeId:Int? = nil)->Observable<BaseResponse<[CourseItemModel]>>{
         let params = ParamsAppender.build(url: All_Url)
             .interface(url: "/course/api/course/queryCourseList")
-            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude)
-            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude)
+            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
+            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
             .append(key: "coursePackageTypeId", value: typeId)
             .append(key: "distanceSort", value: distanceSort?.rawValue)
             .append(key: "salesRanking", value: salesRanking?.rawValue)
@@ -113,8 +113,8 @@
     class func queryStoreList()->Observable<BaseResponse<[NormalSimpleModel]>>{
         let params = ParamsAppender.build(url: All_Url)
             .interface(url: "/other/base/store/queryStoreLists")
-            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude)
-            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude)
+            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
+            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
         return NetworkRequest.request(params: params, method: .post, progress: false)
     }
 
@@ -122,10 +122,20 @@
         let params = ParamsAppender.build(url: All_Url)
             .interface(url: "/course/api/course/queryCourseInfo")
             .append(key: "id", value: id)
-            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude)
-            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude)
+            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
+            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
         return NetworkRequest.request(params: params, method: .post, progress: true)
     }
+
+    class func queryAvaiableCopons(id:Int,price:Double)->Observable<BaseResponse<[CouponInfoModel]>>{
+        let params = ParamsAppender.build(url: All_Url)
+            .interface(url: "/activity/api/coupon/queryAvailableCouponList")
+            .append(key: "coursePackageId", value: id)
+            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
+            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
+            .append(key: "price", value: "\(price)")
+        return NetworkRequest.request(params: params, method: .post, progress: false)
+    }
 }
 
     // MARK: -- 其他

--
Gitblit v1.7.1