//
|
// TaxiOrderViewModel.swift
|
// OKProject
|
//
|
// Created by alvin_y on 2020/6/8.
|
// Copyright © 2020 yangwang. All rights reserved.
|
//
|
|
import UIKit
|
import RxSwift
|
import RxCocoa
|
|
class TaxiOrderViewModel: YYRefreshViewModel<TaxiOrderModel> {
|
|
/// 订单类型(1=快车,2=出租车,3=跨城出行)
|
let type = BehaviorRelay<OrderType>(value: .taxi)
|
|
override func api() -> API! {
|
return .queryMyOrderList(type: type.value.rawValue, pageNum: currentPage, size: totalPages)
|
}
|
|
}
|
|
class TravelCardViewModel:YYRefreshViewModel<CouponListModel>{
|
/// 订单类型(1=快车,2=出租车,3=跨城出行)
|
let type = BehaviorRelay<Int>(value: 1)
|
|
override func api() -> API! {
|
let lat = "\(YYLocationManager.shared.location?.coordinate.latitude ?? 0)"
|
let lon = "\(YYLocationManager.shared.location?.coordinate.longitude ?? 0)"
|
return .getTaxiCardList(type: type.value, lat: lat, lon: lon)
|
}
|
}
|
|
class TravelMyCardViewModel:YYRefreshViewModel<CouponListModel> {
|
|
let type = BehaviorRelay<OrderType>(value: .special)
|
|
override func api() -> API! {
|
return .getMyTaxiCardList(orderType: type.value)
|
}
|
}
|
|
class MinePublishRentViewModel: YYRefreshViewModel<RentalModel> {
|
override func api() -> API! {
|
return .getMyCarRentalList(pageNum: currentPage)
|
}
|
}
|
|
class MinePublishSellViewModel: YYRefreshViewModel<CarSellModel> {
|
override func api() -> API! {
|
return .getMySellingCarList(pageNum: currentPage)
|
}
|
}
|