宽窄优行-由【嘉易行】项目成品而来
无故事王国
2023-05-25 dc1998fc1ac124f6b9a0e434ccf91103dd936409
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
//  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)
    }
}