| | |
| | | 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") |
| | |
| | | |
| | | } |
| | | |
| | | // MARK: -- 预约场地 |
| | | extension Services{ |
| | | |
| | | /// 获取场地类型 |
| | | static func querySiteType()->Observable<BaseResponse<[NormalSimpleModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteType") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 获取场地列表 |
| | | static func querySiteList(pageNum:Int,pageSize:Int,siteTypeId:Int?,cityCode:String?,storeId:Int?,startTime:String?,endTime:String?)->Observable<BaseResponse<[SiteItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteList") |
| | | .append(key: "pageNum", value: pageNum) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "siteTypeId", value: siteTypeId) |
| | | .append(key: "cityCode", value: cityCode) |
| | | .append(key: "storeId", value: storeId) |
| | | .append(key: "startTime", value: startTime) |
| | | .append(key: "endTime", value: endTime) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 获取场地详情 |
| | | static func querySiteDetail(id:Int)->Observable<BaseResponse<SiteDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteInfo") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取场地详情-时间表 |
| | | /// - Parameters: |
| | | /// - day: YYYY-MM-dd |
| | | static func querySiteTimes(id:Int,day:String)->Observable<BaseResponse<[SiteDetailDateTimeModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteTimes") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 预约场地支付 |
| | | static func reservationSite(booker:String,couponId:Int?,id:Int,payType:PayType,phone:String,times:String)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/reservationSite") |
| | | .append(key: "booker", value: booker) |
| | | .append(key: "couponId", value: couponId) |
| | | .append(key: "id", value: id) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "times", value: times) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取优惠券列表 |
| | | static func querySiteCouponList(price:Double,siteId:Int)->Observable<BaseResponse<[CouponInfoModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/querySiteCouponList") |
| | | .append(key: "price", value: price.string) |
| | | .append(key: "siteId", value: siteId) |
| | | .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 queryMySite(page:Int,pageSize:Int = 20,status:YardBookingType?)->Observable<BaseResponse<[YardBookingModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/queryMySite") |
| | | .append(key: "page", value: page) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "status", value: status?.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 获取继续支付场地金额 |
| | | class func continuePaymentPrice(id:Int)->Observable<BaseResponse<YardBookingContinuePriceModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/queryContinuePaymentMySitePrice") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 继续支付 |
| | | class func continuePayment(id:Int,payType:PayType)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/continuePaymentMySite") |
| | | .append(key: "id", value: id) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | |
| | | } |
| | | |
| | | /// 取消我的预约 |
| | | class func cancelMySite(id:Int)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/cancelMySite") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | // MARK: -- Activity |
| | | extension Services{ |