| | |
| | | import JQTools |
| | | |
| | | #if DEBUG |
| | | let All_Url = "https://console-mock.apipost.cn/mock/b5b2dee0-5564-40ae-f082-a352d502a153" |
| | | //let All_Url = "https://console-mock.apipost.cn/mock/b5b2dee0-5564-40ae-f082-a352d502a153" |
| | | let All_Url = "http://192.168.110.165:10393/mock/b5b2dee0-5564-40ae-f082-a352d502a153" |
| | | #else |
| | | let All_Url = "http://192.168.110.80:5209" |
| | | #endif |
| | |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "password", value: password.jq_md5String().uppercased()) |
| | | .append(key: "code", value: code) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 用户详情 |
| | | class func userDetails()->Observable<BaseResponse<UserInfoModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/userDetails") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | } |
| | | |
| | | // MARK: -- 福利相关 |
| | | extension Services{ |
| | | class func benefitHome()->Observable<BaseResponse<BenefitHomeModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/indexOfAppUser") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 账单 |
| | | /// - Parameters: |
| | | /// - recordType: 记录(1充值 2扣除) |
| | | class func billingList(recordType:Int?,yearMonth:String)->Observable<BaseResponse<[BillingModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/userBilling") |
| | | .append(key: "recordId", value: recordType) |
| | | .append(key: "yearMonth", value: yearMonth) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 优惠券 |
| | | class func myCouponList(type:Int?,useStatus:Int?)->Observable<BaseResponse<[CouponModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/queryCouponPackage") |
| | | .append(key: "couponType", value: type) |
| | | .append(key: "yearMonth", value: useStatus) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 充值明细 |
| | | /// - Parameters: |
| | | /// - yearMonth: 记录(1充值 2扣除) |
| | | class func voucherDetail(recordType:Int?,yearMonth:String)->Observable<BaseResponse<[BillingModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/voucherDetail") |
| | | .append(key: "recordId", value: recordType) |
| | | .append(key: "yearMonth", value: yearMonth) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 充值列表 |
| | | class func voucherCenter()->Observable<BaseResponse<[CoinExchangeModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/voucherCenter") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 支付 |
| | | class func useBenefitPayment(payAmount:Double,payType:PayType)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/payment") |
| | | .append(key: "payAmount", value: payAmount) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | } |
| | |
| | | .append(key: "stuId", value: stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | // static func |
| | | } |
| | | |
| | | // MARK: -- 探索玩湃 |
| | | extension Services{ |
| | | |
| | | /// 探索玩湃首页数据 |
| | | static func exploreHome()->Observable<BaseResponse<[StartClouseExploreModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/exploreWP/indexOfExl") |
| | | .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) |
| | | } |
| | | |
| | | /// 获取公告列表/常见问题列表 |
| | | static func exploreNoticeList(type:CustomerSubListVC.CustomerSubType)->Observable<BaseResponse<[NoticeItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | if type == .notice{ |
| | | params.interface(url: "/account/base/exploreWP/noticeList") |
| | | }else{ |
| | | params.interface(url: "/account/base/exploreWP/exceptionList") |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 查看详情 |
| | | static func exploreNoticeDetail(id:Int,type:CustomerSubListVC.CustomerSubType)->Observable<BaseResponse<NoticeItemModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | if type == .notice{ |
| | | params.interface(url: "/account/base/exploreWP/noticeDetail") |
| | | params.append(key: "noId", value: id) |
| | | }else{ |
| | | params.interface(url: "/account/base/exploreWP/exceptionDetail") |
| | | params.append(key: "quesId", value: id) |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 客服电话 |
| | | static func customerPhone()->Observable<BaseResponse<[String]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/account/base/exploreWP/customerList") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取门店详情 |
| | | static func exploreStoreDetail(storeId:Int)->Observable<BaseResponse<SearchStoreDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/exploreWP/storeDetail") |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 评价门店 |
| | | static func evaluationStore(id:Int,content:String,imgs:String,score:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/storeEvaluation/saveEvaluation") |
| | | .append(key: "storeId", value: id) |
| | | .append(key: "content", value: content) |
| | | .append(key: "imgs", value: imgs) |
| | | .append(key: "score", value: score) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | } |
| | | |
| | | // MARK: -- 预约场地 |