| | |
| | | |
| | | case .getMyTaxiCardList(orderType: let type): |
| | | let params = APIParamsAppender() |
| | | .append(key: "orderType", value: type.parame()) |
| | | .append(key: "orderType", value: type.rawValue) |
| | | return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString) |
| | | |
| | | case .getMyTaxiCardInfo(id: let id): |
| | |
| | | |
| | | case .giveAwayMerchantCoupon(orderType: let orderType, orderId: let orderId): |
| | | let params = APIParamsAppender() |
| | | .append(key: "orderType", value: orderType.parame()) |
| | | .append(key: "orderType", value: orderType.rawValue) |
| | | .append(key: "orderId", value: orderId) |
| | | return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString) |
| | | |
| | | case .queryCouponList(orderType: let orderType, orderId: let orderId, pageNum: let pageNum): |
| | | let params = APIParamsAppender() |
| | | .append(key: "orderType", value: orderType.parame()) |
| | | .append(key: "orderType", value: orderType.rawValue) |
| | | .append(key: "orderId", value: orderId) |
| | | .append(key: "pageNum", value: pageNum) |
| | | .append(key: "size", value: 100) |
| | |
| | | case fullMinus = 2 //满减 |
| | | } |
| | | |
| | | enum UserType:Int,HandyJSONEnum { |
| | | case usual = 0 //通用 |
| | | case special = 1 //快车 |
| | | case taxi = 2 //出租车 |
| | | case intercity = 3 //城际 |
| | | case expressSamecity = 4 //小件物流-同城 |
| | | case expressOthercity = 5 // 小件物流-跨城 |
| | | case charter = 6 //包车 |
| | | //enum UserType:Int,HandyJSONEnum { |
| | | // case usual = 0 //通用 |
| | | // case special = 1 //快车 |
| | | // case taxi = 2 //出租车 |
| | | // case intercity = 3 //城际 |
| | | // case expressSamecity = 4 //小件物流-同城 |
| | | // case expressOthercity = 5 // 小件物流-跨城 |
| | | // case charter = 6 //包车 |
| | | // case custom = 7 //95128电召 |
| | | // case scenic = 8 //景区直通车 |
| | | // case plane = 9 //机场专线 |
| | | // case offical = 10 //公务用车 |
| | | //} |
| | | |
| | | |
| | | /// 出行方式 /// 业务类型(1=快车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | enum OrderType: Int,HandyJSONEnum{ |
| | | // 出租车 |
| | | case taxi = 2 |
| | | /// 快车 |
| | | case special = 1 |
| | | /// 跨城 |
| | | case travel = 3 |
| | | /// 同城物流 |
| | | case cityLogistics = 4 |
| | | /// 跨城物流 |
| | | case acrossLogistics = 5 |
| | | /// 包车 |
| | | case charter = 6 |
| | | /// 95128电召 |
| | | case custom = 7 |
| | | /// 景区直通车 |
| | | case scenic = 8 |
| | | /// 机场专线 |
| | | case plane = 9 |
| | | ///公务用车 |
| | | case offical = 10 |
| | | } |
| | | |
| | | enum DiscountType:Int,HandyJSONEnum{ |
| | |
| | | vc.showCar = showCar |
| | | return vc |
| | | case "公务出行": |
| | | let vc = TravelVC.init(orderType: .business) |
| | | let vc = TravelVC.init(orderType: .offical) |
| | | vc.showCar = showCar |
| | | vc.officialCharterClouse = { [weak self] in |
| | | let officialCharterVC = OfficialCharterVC() |
| | |
| | | } |
| | | } |
| | | return vc |
| | | case "机场专线","景区直通车": |
| | | case "机场专线","景区直通车","跨城出行": |
| | | var vc: TravelCityHomeVC! = magicView.dequeueReusablePage(withIdentifier: String(describing: name)) as? TravelCityHomeVC |
| | | if vc == nil { |
| | | vc = TravelCityHomeVC() |
| | | if name == "机场专线"{ |
| | | vc.type = 3 |
| | | vc.type = .plane |
| | | }else if name == "景区直通车"{ |
| | | vc.type = .scenic |
| | | }else{ |
| | | vc.type = 7 |
| | | vc.type = .travel |
| | | } |
| | | } |
| | | vc.showCar = showCar |
| | |
| | | class TravelCardDetailVC: YYViewController { |
| | | |
| | | var id = 0 |
| | | var type = 0 |
| | | var type:OrderType = .taxi |
| | | @IBOutlet weak var titleL: UILabel! |
| | | @IBOutlet weak var nameL: UILabel! |
| | | @IBOutlet weak var infoL: UILabel! |
| | |
| | | tableView.register(cellName: "TravelCouponTCell", identifier: "_TravelCouponTCell") |
| | | |
| | | switch type { |
| | | case 1:titleL.text = "快车/专车" |
| | | case 2:titleL.text = "出租车" |
| | | case 3:titleL.text = "跨城出行" |
| | | case 4:titleL.text = "同城物流" |
| | | case 5:titleL.text = "跨城物流" |
| | | case .special:titleL.text = "快车/专车" |
| | | case .taxi:titleL.text = "出租车" |
| | | case .travel:titleL.text = "跨城出行" |
| | | case .cityLogistics:titleL.text = "同城物流" |
| | | case .acrossLogistics:titleL.text = "跨城物流" |
| | | default:break |
| | | } |
| | | |
| | |
| | | /// viewModel |
| | | let viewModel = TravelMyCardViewModel() |
| | | |
| | | init(orderType: Int) { |
| | | init(orderType: OrderType) { |
| | | viewModel.type.accept(orderType) |
| | | super.init(nibName: nil, bundle: nil) |
| | | } |
| | |
| | | cell.contentView.backgroundColor = UIColor(hexString: "#F3F4F5") |
| | | cell.couponListModel = m |
| | | switch viewModel.type.value { |
| | | case 1:cell.titleL.text = "快车/专车" |
| | | case 2:cell.titleL.text = "出租车" |
| | | case 3:cell.titleL.text = "跨城出行" |
| | | case 4: |
| | | case .special:cell.titleL.text = "快车/专车" |
| | | case .taxi:cell.titleL.text = "出租车" |
| | | case .travel:cell.titleL.text = "跨城出行" |
| | | case .cityLogistics: |
| | | cell.titleL.text = "同城物流" |
| | | if m.businessTypes.contains([4,5]){cell.titleL.text = "同城/跨城物流"} |
| | | case 5: |
| | | case .acrossLogistics: |
| | | cell.titleL.text = "跨城物流" |
| | | if m.businessTypes.contains([4,5]){cell.titleL.text = "同城/跨城物流"} |
| | | default:break |
| | |
| | | let name = menu[Int(pageIndex)] |
| | | switch name { |
| | | case "出租车": |
| | | let vc = TravelCardListVC.init(orderType: 2) |
| | | let vc = TravelCardListVC.init(orderType:.taxi) |
| | | return vc |
| | | case "快车": |
| | | let vc = TravelCardListVC.init(orderType: 1) |
| | | let vc = TravelCardListVC.init(orderType: .special) |
| | | return vc |
| | | case "跨城出行": |
| | | let vc = TravelCardListVC.init(orderType: 3) |
| | | let vc = TravelCardListVC.init(orderType: .travel) |
| | | return vc |
| | | case "同城小件物流": |
| | | let vc = TravelCardListVC.init(orderType: 4) |
| | | let vc = TravelCardListVC.init(orderType: .cityLogistics) |
| | | return vc |
| | | case "跨城小件物流": |
| | | let vc = TravelCardListVC.init(orderType: 5) |
| | | let vc = TravelCardListVC.init(orderType: .acrossLogistics) |
| | | return vc |
| | | case "包车": |
| | | let vc = TravelCardListVC.init(orderType: 6) |
| | | let vc = TravelCardListVC.init(orderType: .charter) |
| | | return vc |
| | | default: |
| | | break |
| | |
| | | import RxSwift |
| | | import HandyJSON |
| | | |
| | | /// 出行方式 /// 业务类型(1=快车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | enum OrderType: Int,HandyJSONEnum{ |
| | | // 出租车 |
| | | case taxi = 2 |
| | | /// 快车 |
| | | case special = 1 |
| | | /// 跨城 |
| | | case travel = 3 |
| | | /// 同城物流 |
| | | case cityLogistics = 4 |
| | | /// 跨城物流 |
| | | case acrossLogistics = 5 |
| | | /// 包车 |
| | | case charter = 6 |
| | | |
| | | //公务用车 |
| | | case business = 8 |
| | | |
| | | func parame() -> Int { |
| | | switch self { |
| | | case .taxi: |
| | | return 2 |
| | | case .travel : |
| | | return 3 |
| | | case .cityLogistics: |
| | | return 4 |
| | | case .acrossLogistics: |
| | | return 5 |
| | | case .charter: |
| | | return 6 |
| | | case .business: |
| | | return 8 |
| | | default: |
| | | return 1 |
| | | } |
| | | } |
| | | |
| | | static func type(id: Int) -> OrderType { |
| | | switch id { |
| | | case 2: |
| | | return .taxi |
| | | case 3: |
| | | return .travel |
| | | case 4: |
| | | return .cityLogistics |
| | | case 5: |
| | | return .acrossLogistics |
| | | case 6: |
| | | return .charter |
| | | case 8: |
| | | return .business |
| | | default: |
| | | return .special |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// 出行 |
| | | class TravelVC: YYViewController { |
| | | |
| | |
| | | |
| | | // 选择人数 |
| | | cell.appointment.delegate(on: self) { (self, _) in |
| | | if self.viewModel.orderType.value == .special{ |
| | | if self.viewModel.orderType.value == OrderType.special{ |
| | | let num = YYMapViewManager.share.passengerNum.value |
| | | SpecialSealAffirmView.show(defaultNum: num, affirmClouse: { num in |
| | | YYMapViewManager.share.passengerNum.accept(num) |
| | |
| | | return |
| | | } |
| | | |
| | | if self.viewModel.orderType.value == .business{ |
| | | if self.viewModel.orderType.value == OrderType.offical{ |
| | | let view = TaxiReservationView() |
| | | view.show(intervalMinute:20) |
| | | view.complete.delegate(on: self) { (self, timeStamp) in |
| | |
| | | cell.passenger.delegate(on: self) { (self, _) in |
| | | |
| | | //公务车出行事由 |
| | | if self.viewModel.orderType.value == .business{ |
| | | if self.viewModel.orderType.value == .offical{ |
| | | let vc = ReasonforTravelVC() |
| | | vc.view.backgroundColor = UIColor.black.withAlphaComponent(0) |
| | | vc.view.frame = CGRect(x: 0, y: screenH, width: ScreenWidth, height: ScreenHeight) |
| | |
| | | // 添加小费 |
| | | cell.tip.delegate(on: self) { (self, _) in |
| | | //公务车计费方式 |
| | | if self.viewModel.orderType.value == .business{ |
| | | if self.viewModel.orderType.value == .offical{ |
| | | MineInfoView.instance(data: ["单程计费","包车计费"]).show { (row) in |
| | | if row == 0{ |
| | | |
| | |
| | | super.init(nibName: nil, bundle: nil) |
| | | viewModel.orderType.accept(orderType) |
| | | |
| | | if orderType == .business{ |
| | | if orderType == .offical{ |
| | | YYMapViewManager.share.state.accept(.appointment) |
| | | } |
| | | } |
| | |
| | | let vc = YYSpecialCarViewController.init(orderId: self.viewModel.orderId.value) |
| | | self.yy_push(vc: vc) |
| | | break |
| | | case .business: |
| | | case .offical: |
| | | let vc = TravelServiceVC.init(orderId: self.viewModel.orderId.value, orderType: self.viewModel.orderType.value) |
| | | self.yy_push(vc: vc) |
| | | default:break |
| | |
| | | |
| | | viewModel.number.bind(to: view_carNum.label_content.rx.text).disposed(by: disposeBag) |
| | | |
| | | view_carNum.didPressTrip.delegate(on: self) { (self, _) in |
| | | view_carNum.didPressTrip.delegate(on: self) { (_, _) in |
| | | switch self.viewModel.orderType.value{ |
| | | case .taxi: |
| | | // 订单流程界面 |
| | |
| | | |
| | | let vc = YYSpecialCarViewController.init(orderId: self.viewModel.currentOrderId.value,isCarpool: isCarpool) |
| | | self.yy_push(vc: vc) |
| | | case .business: |
| | | case .offical: |
| | | break |
| | | case .travel: |
| | | break |
| | |
| | | self.offset = 0 |
| | | } |
| | | |
| | | if viewModel.orderType.value == .business{ |
| | | if viewModel.orderType.value == .offical{ |
| | | self.cellHeight = 280 |
| | | } |
| | | |
| | |
| | | var state:CouponStateType = .overdue |
| | | var time = "" |
| | | var type:CouponDiscountType = .discount |
| | | var userType:UserType = .usual |
| | | var userType:OrderType = .taxi |
| | | } |
| | |
| | | self.viewModel.payType.accept(self.payType.value.parame()) |
| | | if self.payType.value == .weChat{ |
| | | let content = (self.viewModel.cancelId.value) == 0 ? nil : "{cancelId:\(self.viewModel.cancelId.value)}" |
| | | let request = YYWeChatMiniProgramPayRequest.init(orderId: self.viewModel.orderId.value, orderType: self.viewModel.orderType.value.parame(), type: 2, uid: app.loginInfo.id, userType: 1, content: content) |
| | | let request = YYWeChatMiniProgramPayRequest.init(orderId: self.viewModel.orderId.value, orderType: self.viewModel.orderType.value.rawValue, type: 2, uid: app.loginInfo.id, userType: 1, content: content) |
| | | self.dismiss() |
| | | YYPaymentManager.shared.sendWXPaymentRequest(request) { (result) in |
| | | switch result { |
| | |
| | | self.button_tip.isHidden = false |
| | | if YYMapViewManager.share.orderType.value == .taxi{ |
| | | self.button_date.setTitle(YYMapViewManager.share.timeStamp.value == nil ? "选择时间" : "\(YYMapViewManager.share.timeStamp.value?.toFormat(format: "M月d日 HH:mm") ?? "选择时间")", for: .normal) |
| | | }else if YYMapViewManager.share.orderType.value == .business{ |
| | | }else if YYMapViewManager.share.orderType.value == .offical{ |
| | | self.button_date.setTitle(YYMapViewManager.share.timeStamp.value == nil ? "时间" : "\(YYMapViewManager.share.timeStamp.value?.toFormat(format: "M月d日 HH:mm") ?? "时间")", for: .normal) |
| | | self.button_passenger.setTitle(YYMapViewManager.share.passenger.value == nil ? "事由出行" : "\(YYMapViewManager.share.passenger.value?.name ?? "事由出行")", for: .normal) |
| | | }else{ |
| | |
| | | self.sitSingleView.isHidden = true |
| | | self.onePriceView.isHidden = true |
| | | |
| | | if YYMapViewManager.share.orderType.value == .business{ |
| | | if YYMapViewManager.share.orderType.value == .offical{ |
| | | self.view_now.isHidden = true |
| | | self.view_call.isHidden = false |
| | | self.view_taxi.isHidden = true |
| | |
| | | title = "呼叫出租车" |
| | | }else if YYMapViewManager.share.orderType.value == .special { |
| | | title = "呼叫快车/专车" |
| | | }else if YYMapViewManager.share.orderType.value == .business{ |
| | | }else if YYMapViewManager.share.orderType.value == .offical{ |
| | | title = "预约出行" |
| | | } |
| | | self.button_submit.setTitle(title, for: .normal) |
| | |
| | | YYMapViewManager.share.tip |
| | | .subscribeOn(MainScheduler.instance) |
| | | .subscribe(onNext: {[unowned self] (string) in |
| | | if YYMapViewManager.share.orderType.value == .business{ |
| | | if YYMapViewManager.share.orderType.value == .offical{ |
| | | self.button_tip.setTitle(string == nil ? "计费方式" : string, for: .normal) |
| | | }else{ |
| | | self.button_tip.setTitle(string == nil ? "小费" : string, for: .normal) |
| | |
| | | let orderId = BehaviorRelay<Int>(value: 0) |
| | | |
| | | override func api() -> API! { |
| | | return .queryCoupon(orderId: orderId.value, orderType: orderType.value.parame(), pageNum: currentPage, size: totalPages) |
| | | return .queryCoupon(orderId: orderId.value, orderType: orderType.value.rawValue, pageNum: currentPage, size: totalPages) |
| | | } |
| | | } |
| | |
| | | func queryBalance() { |
| | | queryBalanceSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.queryBalance(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryBalance(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .map(YYModel<QueryBalanceModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: { [unowned self] (model) in |
| | |
| | | func payTaxiOrder(type:PayTypeNormal? = nil) { |
| | | requestSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.payTaxiOrder(orderId: orderId.value, payType: payType.value,orderType: orderType.value.parame(), couponId: couponId.value,objectType:couponDataType.value)) |
| | | .request(.payTaxiOrder(orderId: orderId.value, payType: payType.value,orderType: orderType.value.rawValue, couponId: couponId.value,objectType:couponDataType.value)) |
| | | .map(YYModel<PayModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: { [unowned self] (model) in |
| | |
| | | func queryTrack() { |
| | | queryTrackSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.queryTrack(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryTrack(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .map(YYModel<[TrackModel]>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: { [unowned self] (model) in |
| | |
| | | /// 获取详情 |
| | | func queryOrderInfo() { |
| | | APIManager.shared.provider.rx |
| | | .request(.queryOrderInfo(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryOrderInfo(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .map(YYModel<TravelServiceModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: { (model) in |
| | |
| | | func cancleOrderTaxi() { |
| | | cancleOrderTaxiSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.cancleOrderTaxi(cancleId: cancelId.value, id: orderId.value,orderType: orderType.value.parame(), payType: payType.value)) |
| | | .request(.cancleOrderTaxi(cancleId: cancelId.value, id: orderId.value,orderType: orderType.value.rawValue, payType: payType.value)) |
| | | .map(YYModel<PayModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: { [unowned self] (model) in |
| | |
| | | func addCancle() { |
| | | addCancleSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.addCancle(id: orderId.value, orderType: orderType.value.parame(), reason: reason.value, remark: remark.value)) |
| | | .request(.addCancle(id: orderId.value, orderType: orderType.value.rawValue, reason: reason.value, remark: remark.value)) |
| | | .map(YYModel<SystemMessageModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: { [unowned self] (model) in |
| | |
| | | /// 获取司机位置 |
| | | func queryOrderServer() { |
| | | APIManager.shared.provider.rx |
| | | .request(.queryOrderServer(orderId: self.orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryOrderServer(orderId: self.orderId.value, orderType: orderType.value.rawValue)) |
| | | .map(YYModel<SocketInfoModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: { (model) in |
| | | guard let data = model.data else{return} |
| | | if data.orderType == self.orderType.value.parame(){ |
| | | if data.orderType == self.orderType.value.rawValue{ |
| | | self.driverInfo.accept(data) |
| | | } |
| | | }) { (error) in |
| | |
| | | func orderEvaluate() { |
| | | evaluateSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.orderEvaluate(orderId: self.orderId.value, orderType: orderType.value.parame(), fraction: fraction.value, content: content.value)) |
| | | .request(.orderEvaluate(orderId: self.orderId.value, orderType: orderType.value.rawValue, fraction: fraction.value, content: content.value)) |
| | | .map(YYModel<Nothing>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: {[unowned self] (model) in |
| | |
| | | func queryRedMoney() { |
| | | queryRedMoneySubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.queryRedMoney(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryRedMoney(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .map(YYModel<CancleAmountModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: {[unowned self] (model) in |
| | |
| | | func pushOrderTaxi() { |
| | | pushOrderTaxiTaxiSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.pushOrderTaxi(id: orderId.value,orderType: orderType.value.parame())) |
| | | .request(.pushOrderTaxi(id: orderId.value,orderType: orderType.value.rawValue)) |
| | | .map(YYModel<TravelServiceModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: { [unowned self] (model) in |
| | |
| | | func queryCancleAmount() { |
| | | queryCancleAmountSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.queryCancleAmount(id: orderId.value,orderType: orderType.value.parame())) |
| | | .request(.queryCancleAmount(id: orderId.value,orderType: orderType.value.rawValue)) |
| | | .map(YYModel<CancleAmountModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: { [unowned self] (model) in |
| | |
| | | func shareRedEnvelope() { |
| | | shareRedEnvelopeSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.shareRedEnvelope(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.shareRedEnvelope(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .map(YYModel<Nothing>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: {[unowned self] (model) in |
| | |
| | | func completeOrder() { |
| | | completeOrderSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.completeOrder(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.completeOrder(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .map(YYModel<Nothing>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: {[unowned self] (model) in |
| | |
| | | func queryEndPush() { |
| | | queryEndPushSubject.onNext(.loading) |
| | | APIManager.shared.provider.rx |
| | | .request(.queryEndPush(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryEndPush(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .map(YYModel<SocketInfoModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: {[unowned self] (model) in |
| | |
| | | }else{ |
| | | // 查找数据 |
| | | let model = data.filter { (model) -> Bool in |
| | | return model.orderType == self.orderType.value.parame() |
| | | return model.orderType == self.orderType.value.rawValue |
| | | } |
| | | if model.count == 0{ |
| | | self.queryIdleDriver() |
| | |
| | | /// 获取5公里范围内空闲司机数量 |
| | | func queryIdleDriver() { |
| | | APIManager.shared.provider.rx |
| | | .request(.queryIdleDriver(lat: Double(YYMapViewManager.share.userLocation.latitude), lon: Double(YYMapViewManager.share.userLocation.longitude), type: orderType.value.parame())) |
| | | .request(.queryIdleDriver(lat: Double(YYMapViewManager.share.userLocation.latitude), lon: Double(YYMapViewManager.share.userLocation.longitude), type: orderType.value.rawValue)) |
| | | .map(YYModel<SwitchCityModel>.self) |
| | | .validate() |
| | | .subscribe(onSuccess: {[unowned self] (model) in |
| | |
| | | func queryOrderInfo() -> Observable<Result<TravelServiceModel?, Error>> { |
| | | return |
| | | APIManager.shared.provider.rx |
| | | .request(.queryOrderInfo(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryOrderInfo(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .mapThenValidate(TravelServiceModel.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | |
| | | case carRent |
| | | case carSale |
| | | case scenic |
| | | func parame() -> Int { |
| | | switch self { |
| | | case .privacy: |
| | |
| | | return 19 |
| | | case .carSale: |
| | | return 20 |
| | | case .scenic: |
| | | return 22 |
| | | } |
| | | } |
| | | |
| | |
| | | return "汽车出租协议" |
| | | case .question: |
| | | return "常见问题" |
| | | case .scenic: |
| | | return "景区直通车" |
| | | } |
| | | } |
| | | } |
| | |
| | | model.startLat = lat |
| | | model.address = info.address |
| | | model.addressDeatil = info.addressDeatil |
| | | model.type = orderType.value.parame() |
| | | model.type = orderType.value.rawValue |
| | | model.isFirst = priceModel.first |
| | | |
| | | let vc = ShippingInformationVC() |
| | |
| | | /// viewModel |
| | | let viewModel = TaxiOrderViewModel() |
| | | |
| | | init(orderType: Int) { |
| | | init(orderType: OrderType) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | viewModel.type.accept(orderType) |
| | | } |
| | |
| | | let model = viewModel.dataSource.value[sender.tag] |
| | | alert(popup: .double, title: "提示", text: "您确定要取消该订单吗?", submitTitle: "确定取消", cancelTitle: "不取消", submitClick: { [weak self] in |
| | | guard let self = self else{return} |
| | | if self.viewModel.type.value == 4 || self.viewModel.type.value == 5 { |
| | | if self.viewModel.type.value == .cityLogistics || self.viewModel.type.value == .acrossLogistics { |
| | | self.cancelPay(model: model) |
| | | }else { |
| | | self.cancelCharter(model: model) |
| | |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "item", for: indexPath) as! LogisticsListCell |
| | | cell.selectionStyle = .none |
| | | if viewModel.type.value == 5 || viewModel.type.value == 4 { |
| | | if viewModel.type.value == .acrossLogistics || viewModel.type.value == .cityLogistics { |
| | | cell.cancle_bt.tag = indexPath.row |
| | | cell.cancle_bt.addTarget(self, action: #selector(cancle(sender:)), for: .touchUpInside) |
| | | cell.pay_bt.tag = indexPath.row |
| | |
| | | view.needsUpdateConstraints() |
| | | |
| | | |
| | | viewModel.logisticsQueryPayMoney(endAddress: model!.address+model!.addressDeatil, number: model!.cargoNumber, startLonLat: "\(model!.startLon),\(model!.startLat)", type: orderType.value.parame()).subscribe { (data) in |
| | | viewModel.logisticsQueryPayMoney(endAddress: model!.address+model!.addressDeatil, number: model!.cargoNumber, startLonLat: "\(model!.startLon),\(model!.startLat)", type: orderType.value.rawValue).subscribe { (data) in |
| | | YYAlertKit.dismiss() |
| | | switch data{ |
| | | case .success( let data): |
| | |
| | | /// 获取价格 |
| | | func queryLogisticsUnitPrice()-> Observable<Result<LogisticsModel?,Error>>{ |
| | | return APIManager.shared.provider.rx |
| | | .request(.queryLogisticsUnitPrice(endAddress: endAddress.value, startLonLat: startLonLat.value, type: type.value.parame())) |
| | | .request(.queryLogisticsUnitPrice(endAddress: endAddress.value, startLonLat: startLonLat.value, type: type.value.rawValue)) |
| | | .mapThenValidate(LogisticsModel.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | let name = menu[Int(pageIndex)] |
| | | switch name { |
| | | case "出租车": |
| | | let vc = TaxiOrderListVC.init(orderType: 2) |
| | | let vc = TaxiOrderListVC.init(orderType: .taxi) |
| | | return vc |
| | | case "快车": |
| | | let vc = TaxiOrderListVC.init(orderType: 1) |
| | | case "快车/专车": |
| | | let vc = TaxiOrderListVC.init(orderType: .special) |
| | | return vc |
| | | case "机场专线": |
| | | let vc = TaxiOrderListVC.init(orderType: 3) |
| | | let vc = TaxiOrderListVC.init(orderType: .plane) |
| | | return vc |
| | | case "景区直通车": |
| | | var vc:LogisticsListVC? |
| | | //LogisticsListVC |
| | | var vc:TaxiOrderListVC? |
| | | if vc == nil { |
| | | vc = LogisticsListVC.init(orderType: 4) |
| | | vc = TaxiOrderListVC.init(orderType: .scenic) |
| | | } |
| | | return vc! |
| | | case "公务出行": |
| | | var vc:LogisticsListVC? |
| | | if vc == nil { |
| | | vc = LogisticsListVC.init(orderType: 5) |
| | | vc = LogisticsListVC.init(orderType: .offical) |
| | | } |
| | | return vc! |
| | | // case "包车": |
| | |
| | | /// viewModel |
| | | let viewModel = TaxiOrderViewModel() |
| | | |
| | | init(orderType: Int) { |
| | | init(orderType: OrderType) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | viewModel.type.accept(orderType) |
| | | } |
| | |
| | | |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let data = viewModel.dataSource.value[indexPath.row] |
| | | |
| | | // 8=待评价,9=已完成 |
| | | if data.state == 8 || data.state == 9{ |
| | | // 新的界面 有轨迹 |
| | | let vc = TaxiOrderDetailsVC.init(orderId: data.orderId, orderType: OrderType(rawValue: viewModel.type.value) ?? .taxi) |
| | | let vc = TaxiOrderDetailsVC.init(orderId: data.orderId, orderType: viewModel.type.value) |
| | | self.yy_push(vc: vc) |
| | | }else{ |
| | | // 订单流程界面 |
| | | if self.viewModel.type.value == 1{ |
| | | if self.viewModel.type.value == .special{ |
| | | |
| | | var isCarpool:Bool = false |
| | | if data.rideType == .seating{isCarpool = true} |
| | | let vc = YYSpecialCarViewController.init(orderId: data.orderId,isCarpool: isCarpool) |
| | | vc.viewModel.orderType.accept(.special) |
| | | self.yy_push(vc: vc) |
| | | }else if self.viewModel.type.value == 3{ |
| | | }else if viewModel.type.value == .scenic{ |
| | | if data.state == 7{ |
| | | let vc = TravelOrderSuccessVC() |
| | | vc.id.accept(data.orderId) |
| | | vc.statusType = .MyOrder |
| | | yy_push(vc: vc) |
| | | return |
| | | } |
| | | |
| | | let vc = TravelServiceVC(orderId: data.orderId, orderType: .scenic) |
| | | wy_pushAnimate(vc: vc) |
| | | // let vc = YYSpecialCarViewController.init(orderId: data.orderId) |
| | | // vc.viewModel.orderType.accept(.scenic) |
| | | // self.yy_push(vc: vc) |
| | | |
| | | }else if self.viewModel.type.value == .travel{ |
| | | if data.state == 7 { |
| | | //待支付 |
| | | let vc = TravelOrderSuccessVC() |
| | |
| | | vc.viewModel.orderType.accept(.travel) |
| | | self.yy_push(vc: vc) |
| | | }else{ |
| | | let vc = TravelServiceVC.init(orderId: data.orderId, orderType: OrderType(rawValue: viewModel.type.value) ?? .taxi) |
| | | let vc = TravelServiceVC.init(orderId: data.orderId, orderType: viewModel.type.value) |
| | | self.yy_push(vc: vc) |
| | | } |
| | | } |
| | |
| | | class TaxiOrderViewModel: YYRefreshViewModel<TaxiOrderModel> { |
| | | |
| | | /// 订单类型(1=快车,2=出租车,3=跨城出行) |
| | | let type = BehaviorRelay<Int>(value: 1) |
| | | let type = BehaviorRelay<OrderType>(value: .taxi) |
| | | |
| | | override func api() -> API! { |
| | | return .queryMyOrderList(type: type.value, pageNum: currentPage, size: totalPages) |
| | | return .queryMyOrderList(type: type.value.rawValue, pageNum: currentPage, size: totalPages) |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | class TravelMyCardViewModel:YYRefreshViewModel<CouponListModel> { |
| | | |
| | | let type = BehaviorRelay<Int>(value: 1) |
| | | let type = BehaviorRelay<OrderType>(value: .special) |
| | | |
| | | override func api() -> API! { |
| | | return .getMyTaxiCardList(orderType: OrderType(rawValue: type.value)!) |
| | | return .getMyTaxiCardList(orderType: type.value) |
| | | } |
| | | } |
| | | |
| | |
| | | .rx.tap |
| | | .subscribe(onNext: { (_) in |
| | | // 弹出分享框 |
| | | ShareView.share(controller: self, title: "分享行程", content: "你的好友(\(app.userInfo.phone))正在使用宽窄出行快车(\(self.viewModel.dataSource.value?.licensePlate ?? ""))。", url: "\(share_url)/orderShare/index.html?orderId=\(self.viewModel.orderId.value)&orderType=\(self.viewModel.orderType.value.parame())",hiddenMessage: false).show(success: { |
| | | ShareView.share(controller: self, title: "分享行程", content: "你的好友(\(app.userInfo.phone))正在使用宽窄出行快车(\(self.viewModel.dataSource.value?.licensePlate ?? ""))。", url: "\(share_url)/orderShare/index.html?orderId=\(self.viewModel.orderId.value)&orderType=\(self.viewModel.orderType.value.rawValue)",hiddenMessage: false).show(success: { |
| | | |
| | | }) |
| | | }).disposed(by: disposeBag) |
| | |
| | | YYSocketManager.shared().position |
| | | .subscribe(onNext: {[unowned self] (r) in |
| | | guard let data = r.data else{return} |
| | | if data.orderId == self.viewModel.orderId.value && data.orderType == self.viewModel.orderType.value.parame(){ |
| | | if data.orderId == self.viewModel.orderId.value && data.orderType == self.viewModel.orderType.value.rawValue{ |
| | | self.updateDriverLocation(data: data) |
| | | } |
| | | }).disposed(by: rx.disposeBag) |
| | |
| | | .rx.tap |
| | | .subscribe(onNext: { (_) in |
| | | // 弹出分享框 |
| | | ShareView.share(controller: self, title: "分享行程", content: "你的好友(\(app.userInfo.phone))正在使用宽窄出行快车(\(self.viewModel.dataSource.value?.licensePlate ?? ""))。", url: "\(share_url)/orderShare/index.html?orderId=\(self.viewModel.orderId.value)&orderType=\(self.viewModel.orderType.value.parame())",hiddenMessage: false).show(success: { |
| | | ShareView.share(controller: self, title: "分享行程", content: "你的好友(\(app.userInfo.phone))正在使用宽窄出行快车(\(self.viewModel.dataSource.value?.licensePlate ?? ""))。", url: "\(share_url)/orderShare/index.html?orderId=\(self.viewModel.orderId.value)&orderType=\(self.viewModel.orderType.value.rawValue)",hiddenMessage: false).show(success: { |
| | | |
| | | }) |
| | | }).disposed(by: disposeBag) |
| | |
| | | YYSocketManager.shared().position |
| | | .subscribe(onNext: {[unowned self] (r) in |
| | | guard let data = r.data else{return} |
| | | if data.orderId == self.viewModel.orderId.value && data.orderType == self.viewModel.orderType.value.parame(){ |
| | | if data.orderId == self.viewModel.orderId.value && data.orderType == self.viewModel.orderType.value.rawValue{ |
| | | self.updateDriverLocation(data: data) |
| | | } |
| | | |
| | |
| | | complain_driverBt.isHidden = false |
| | | } |
| | | // 跨城 |
| | | if viewModel?.orderType.value.parame() == 3 || model?.orderType == 3{ |
| | | if viewModel?.orderType.value == .travel || model?.orderType == 3{ |
| | | userInfo_view.isHidden = false |
| | | complain_driverBt.isHidden = true |
| | | } |
| | |
| | | |
| | | return |
| | | APIManager.shared.provider.rx |
| | | .request(.queryOrderInfo(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryOrderInfo(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .mapThenValidate(YYSpecialCarModel.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | /// 取消订单获取金额 |
| | | func queryCancleAmount() -> Observable<Result<CancleAmountModel?, Error>> { |
| | | return APIManager.shared.provider.rx |
| | | .request(.queryCancleAmount(id: orderId.value,orderType: orderType.value.parame())) |
| | | .request(.queryCancleAmount(id: orderId.value,orderType: orderType.value.rawValue)) |
| | | .mapThenValidate(CancleAmountModel.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | func queryOrderServer() -> Observable<Result<SocketInfoModel?, Error>> { |
| | | return |
| | | APIManager.shared.provider.rx |
| | | .request(.queryOrderServer(orderId: self.orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryOrderServer(orderId: self.orderId.value, orderType: orderType.value.rawValue)) |
| | | .mapThenValidate(SocketInfoModel.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | func queryEndPush() -> Observable<Result<SocketInfoModel?, Error>> { |
| | | return |
| | | APIManager.shared.provider.rx |
| | | .request(.queryEndPush(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.queryEndPush(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .mapThenValidate(SocketInfoModel.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | func pushOrder() -> Observable<Result<TravelServiceModel?, Error>> { |
| | | return |
| | | APIManager.shared.provider.rx |
| | | .request(.pushOrderTaxi(id: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.pushOrderTaxi(id: orderId.value, orderType: orderType.value.rawValue)) |
| | | .mapThenValidate(TravelServiceModel.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | func orderEvaluate() -> Observable<Result<Nothing?, Error>> { |
| | | return |
| | | APIManager.shared.provider.rx |
| | | .request(.orderEvaluate(orderId: self.orderId.value, orderType: orderType.value.parame(), fraction: fraction.value, content: content.value)) |
| | | .request(.orderEvaluate(orderId: self.orderId.value, orderType: orderType.value.rawValue, fraction: fraction.value, content: content.value)) |
| | | .mapThenValidate(Nothing.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | func queryRedMoney() -> Observable<Result<CancleAmountModel?, Error>> { |
| | | return |
| | | APIManager.shared.provider.rx |
| | | .request(.queryRedMoney(orderId: orderId.value,orderType: orderType.value.parame())) |
| | | .request(.queryRedMoney(orderId: orderId.value,orderType: orderType.value.rawValue)) |
| | | .mapThenValidate(CancleAmountModel.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | /// 评论成功后获取红包金额 |
| | | func shareRedEnvelope() -> Observable<Result<Nothing?, Error>> { |
| | | APIManager.shared.provider.rx |
| | | .request(.shareRedEnvelope(orderId: orderId.value, orderType: orderType.value.parame())) |
| | | .request(.shareRedEnvelope(orderId: orderId.value, orderType: orderType.value.rawValue)) |
| | | .mapThenValidate(Nothing.self) |
| | | .catchError { Single.just(.failure($0)) } |
| | | .asObservable() |
| | |
| | | vc.model = self.setDriverModel(model: data) |
| | | self.yy_push(vc: vc) |
| | | }else{ |
| | | let vc = ScanTravelVC(model: data, type: OrderType.type(id: id)) |
| | | let vc = ScanTravelVC(model: data, type: OrderType(rawValue: id)!) |
| | | self.yy_push(vc: vc) |
| | | } |
| | | } |
| | |
| | | YYSocketManager.shared().position |
| | | .subscribe(onNext: {[unowned self] (r) in |
| | | guard let data = r.data else{return} |
| | | if data.orderId == self.viewModel.orderId.value && data.orderType == self.viewModel.orderType.value.parame(){ |
| | | if data.orderId == self.viewModel.orderId.value && data.orderType == self.viewModel.orderType.value.rawValue{ |
| | | self.updateDriverLocation(data: data) |
| | | } |
| | | }).disposed(by: rx.disposeBag) |
| | |
| | | } |
| | | |
| | | |
| | | if data.orderId == self.viewModel.orderId.value && data.orderType == self.viewModel.orderType.value.parame(){ |
| | | if data.orderId == self.viewModel.orderId.value && data.orderType == self.viewModel.orderType.value.rawValue{ |
| | | guard let model = self.dataSource else{return} |
| | | if data.state < 7{ |
| | | if data.state == 4{ |
| | |
| | | /// 分享 |
| | | button_share.rx.tap.subscribe(onNext: { (_) in |
| | | // 弹出分享框 |
| | | ShareView.share(controller: self, title: "分享行程", content: "你的好友(\(app.userInfo.phone))正在使用宽窄出行出租车(\(self.dataSource?.licensePlate ?? ""))。", url: "\(share_url)/orderShare/index.html?orderId=\(self.viewModel.orderId.value)&orderType=\(self.viewModel.orderType.value.parame())",hiddenMessage: false).show(success: { |
| | | ShareView.share(controller: self, title: "分享行程", content: "你的好友(\(app.userInfo.phone))正在使用宽窄出行出租车(\(self.dataSource?.licensePlate ?? ""))。", url: "\(share_url)/orderShare/index.html?orderId=\(self.viewModel.orderId.value)&orderType=\(self.viewModel.orderType.value.rawValue)",hiddenMessage: false).show(success: { |
| | | |
| | | }) |
| | | }).disposed(by: disposeBag) |
| | |
| | | /// 筛选后的模型 |
| | | var screenModel = [TravleCityModel]() |
| | | var pyData = [String]() |
| | | var subType = 0 |
| | | var subType:OrderType = .taxi |
| | | |
| | | @IBOutlet weak var tableView: UITableView! |
| | | override func viewDidLoad() { |
| | |
| | | var endModel = TravelSitesModel() |
| | | var viewModel = TravelLineViewModel() |
| | | var showCar = true |
| | | var type = 0 //3=机场专线,7=景区直通车 |
| | | var type:OrderType = .taxi //9=机场专线,7=景区直通车,10=公务用车 |
| | | |
| | | |
| | | override func viewWillAppear(_ animated: Bool) { |
| | |
| | | //74067 【特惠购卡】需根据返回的状态,是否显示 购卡模块、 我的商家中心模块 |
| | | // buyCardView.isHidden = !showCar |
| | | |
| | | if type == 3{ |
| | | if type == .travel{ |
| | | banner_imageView.image = UIImage(named: "banner") |
| | | }else{ |
| | | banner_imageView.image = UIImage(named: "banner_1") |
| | |
| | | return v |
| | | } |
| | | func loadData(){ |
| | | agreement.type.accept(.travel) |
| | | agreement.type.accept(.scenic) |
| | | agreement.agreement() |
| | | agreement.requestSubject.subscribe { (r) in |
| | | YYAlertKit.dismiss() |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_1" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment version="4352" identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/> |
| | | <capability name="Named colors" minToolsVersion="9.0"/> |
| | | <capability name="Safe area layout guides" minToolsVersion="9.0"/> |
| | | <capability name="System colors in document resources" minToolsVersion="11.0"/> |
| | |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZII-g6-c3Y"> |
| | | <rect key="frame" x="0.0" y="44" width="414" height="818"/> |
| | | <rect key="frame" x="0.0" y="48" width="414" height="814"/> |
| | | <connections> |
| | | <action selector="dimssAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="C05-nU-1mL"/> |
| | | </connections> |
| | | </button> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8f0-S8-9Wq"> |
| | | <rect key="frame" x="48" y="191" width="318" height="372"/> |
| | | <rect key="frame" x="48" y="195" width="318" height="372"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JPf-go-oHo"> |
| | | <rect key="frame" x="0.0" y="34" width="318" height="292"/> |
| | |
| | | </objects> |
| | | <resources> |
| | | <namedColor name="Color"> |
| | | <color red="0.0" green="0.74900001287460327" blue="0.18799999356269836" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <color red="0.27099999785423279" green="0.70599997043609619" blue="0.57999998331069946" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | </namedColor> |
| | | <systemColor name="systemBackgroundColor"> |
| | | <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | |
| | | var type = BehaviorRelay<TravelChooseCityType>(value: .start) |
| | | /// 起点站点id |
| | | var startSiteId = BehaviorRelay<String>.init(value: "") |
| | | var subType = BehaviorRelay<Int>(value: 0) |
| | | var subType = BehaviorRelay<OrderType>(value: .taxi) |
| | | /// 拼音数组 |
| | | var pyData = BehaviorRelay<[String]>(value: []) |
| | | var data = BehaviorRelay<[TravleCityModel]>.init(value:[]) |
| | |
| | | func getStartSite(){ |
| | | subject.onNext(.loading) |
| | | if type.value == .start { |
| | | APIManager.shared.provider.rx.request(.siteQuerySite(startSiteId: "", type: subType.value)).map(YYModel<[TravleCityModel]>.self).validate().subscribe {[unowned self] (r) in |
| | | APIManager.shared.provider.rx.request(.siteQuerySite(startSiteId: "", type: subType.value.rawValue)).map(YYModel<[TravleCityModel]>.self).validate().subscribe {[unowned self] (r) in |
| | | guard let model = r.data else { return} |
| | | /// 处理拼音 |
| | | for (_,vaule) in model.enumerated(){ |
| | |
| | | self.subject.onNext(.error(e)) |
| | | }.disposed(by: disposeBag) |
| | | }else{ |
| | | APIManager.shared.provider.rx.request(.siteQuerySite(startSiteId: startSiteId.value, type: subType.value)).map(YYModel<[TravleCityModel]>.self).validate().subscribe {[unowned self] (r) in |
| | | APIManager.shared.provider.rx.request(.siteQuerySite(startSiteId: startSiteId.value, type: subType.value.rawValue)).map(YYModel<[TravleCityModel]>.self).validate().subscribe {[unowned self] (r) in |
| | | guard let model = r.data else { return} |
| | | /// 处理拼音 |
| | | for (_,vaule) in model.enumerated(){ |