OKProject/API/API.swift
@@ -695,6 +695,10 @@ case validPermission case queryOfficalCarModel(calType:Int,startLonLat:String,endLonLat:String,startTime:String? = nil,endTime:String? = nil) case saveOrderBusiness(model:OfficalRequstModel) } @@ -1016,6 +1020,10 @@ return "/api/business/queryBusinessCarModel" case .validPermission: return "/api/business/validPermission" case .queryOfficalCarModel: return "/api/business/queryBusinessCarModel" case .saveOrderBusiness: return "/api/business/saveOrderBusiness" } } @@ -2037,11 +2045,23 @@ .append(key: "endTime", value: endTime) return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString) case .validPermission: let params = APIParamsAppender() return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString) case .queryOfficalCarModel(let calType, let startLonLat, let endLonLat, let startTime, let endTime): let params = APIParamsAppender() .append(key: "calType", value: calType) .append(key: "startLonLat", value: startLonLat) .append(key: "endLonLat", value: endLonLat) .append(key: "startTime", value: startTime) .append(key: "endTime", value: endTime) return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString) case .saveOrderBusiness(let model): let params = APIParamsAppender() params.params = model.toJSON() ?? [:] return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString) } } } OKProject/Class/Enums.swift
@@ -184,7 +184,7 @@ } } enum CalType:Int{ enum CalType:Int,HandyJSONEnum{ case Single = 1 case Charter = 2 } @@ -212,3 +212,25 @@ } } } enum OfficalPaymentType:Int{ //1=自费,2=企业支付) case selfPay = 1 case company = 2 } enum OrderAuthStatus:Int,HandyJSONEnum{ case normal = -1 //正常订单 case review = 0 //审核中 case pass = 1 //通过 case reject = 2 //拒绝 var rawStr:String{ switch self{ case .review:return "审核中" case .reject:return "已拒绝" } } } OKProject/Class/Home/Controller/HomeVC.swift
@@ -700,8 +700,9 @@ case "公务用车": let vc = TravelVC.init(orderType: .offical) vc.showCar = showCar vc.officialCharterClouse = { [weak self] in vc.officialCharterClouse = { [weak self] (viewModel) in let officialCharterVC = OfficialCharterVC() officialCharterVC.viewModel = viewModel officialCharterVC.view.frame = CGRect(x: 0, y: ScreenHeight, width: ScreenWidth, height: self?.view.height ?? 0) self?.view.addSubview(officialCharterVC.view) self?.addChild(officialCharterVC) OKProject/Class/Home/Controller/OfficialCharterVC.swift
@@ -25,6 +25,7 @@ @IBOutlet weak var tableViewHeiCons: NSLayoutConstraint! var test_num = 1 var viewModel:TravelViewModel! override func viewDidLoad() { super.viewDidLoad() OKProject/Class/Home/Controller/ReasonforTravelVC.swift
@@ -8,12 +8,13 @@ import UIKit import QMUIKit import HandyJSON class ReasonforTravelVC: YYViewController { class PassengerInfo{ class PassengerInfo:HandyJSON{ var name = "" var phone:String? required init(){} convenience init(name:String,phone:String? = nil){ self.init() @@ -21,6 +22,8 @@ self.phone = phone } } class ReasonforTravelVC: YYViewController { @IBOutlet weak var scrollButtomCons: NSLayoutConstraint! @IBOutlet weak var tableView: UITableView! @@ -36,8 +39,8 @@ @IBOutlet weak var view_addPassenger: UIView! var passengers = [PassengerInfo]() var reasonModels = [ReasonModel]() var selectIndex = 0 var viewModel:TravelViewModel! var selectIndex = Set<Int>() override func viewDidLoad() { super.viewDidLoad() @@ -55,9 +58,17 @@ let h = ceil(8 / 4.0) * 30.0 + floor(8 / 4.0) * 10.0 collectViewHeiCons.constant = h passengers.append(PassengerInfo(name: "杨锴", phone: "18111223301")) if viewModel.passengers.value.count == 0{ passengers.append(PassengerInfo(name: app.userInfo.nickName, phone: app.userInfo.phone)) }else{ passengers = viewModel.passengers.value } tableViewHeiCons.constant = 40 * Double(passengers.count) btn_cost.isSelected = viewModel.officalPaymentType.value == .selfPay btn_companyCost.isSelected = viewModel.officalPaymentType.value == .company textView.text = self.viewModel.trailContentReason.value APIManager.shared.provider.rx.request(.getBusinessReason).mapThenValidate([ReasonModel].self).subscribe { result in switch result{ @@ -65,6 +76,15 @@ self.reasonModels = m ?? [] let h = ceil(Double(self.reasonModels.count) / 4.0) * 30.0 + floor(Double(self.reasonModels.count) / 4.0) * 10.0 self.collectViewHeiCons.constant = h for (index,v) in self.reasonModels.enumerated(){ if let values = self.viewModel.trailReason.value{ if values.contains(v.name){ self.selectIndex.insert(index) } } } self.collectionView.reloadData() case .failure(let error): alert(text: error.localizedDescription) @@ -79,6 +99,10 @@ textView.rx.text.changed.subscribe(onNext: {text in self.label_limit.text = "\(text?.count ?? 0)/50" }).disposed(by: disposeBag) textView.rx.text.orEmpty.changed.subscribe(onNext: {text in self.viewModel.trailContentReason.accept(text) }).disposed(by: disposeBag) } @@ -108,6 +132,21 @@ } @IBAction func closeAction(_ sender: Any) { self.removeViewAndControllerFromParentViewController() } @IBAction func completeAction(_ sender: UIButton) { self.viewModel.trailContentReason.accept(textView.text) var cotnent = [String]() for v in selectIndex{ cotnent.append(reasonModels[v].name) } guard cotnent.count != 0 else {alert(text: "请选择出行事由");return} viewModel.trailReason.accept(cotnent.joined(separator: ",")) viewModel.officalPaymentType.accept(btn_cost.isSelected ? .selfPay:.company) viewModel.passengers.accept(passengers) self.removeViewAndControllerFromParentViewController() } } @@ -147,7 +186,11 @@ extension ReasonforTravelVC:UICollectionViewDelegate{ func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { selectIndex = indexPath.row if selectIndex.contains(indexPath.row){ selectIndex.remove(indexPath.row) }else{ selectIndex.insert(indexPath.row) } collectionView.reloadData() } } @@ -161,7 +204,7 @@ cell.titleL.cornerRadius = 2 cell.titleL.backgroundColor = .white cell.titleL.font = UIFont.systemFont(ofSize: 12, weight: .medium) if selectIndex == indexPath.row{ if selectIndex.contains(indexPath.row){ cell.titleL.borderColor = UIColor(hexString: "#FF884D")! cell.titleL.textColor = UIColor(hexString: "#FF884D")! }else{ OKProject/Class/Home/Controller/ReasonforTravelVC.xib
@@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <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"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_1" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/> <capability name="Named colors" minToolsVersion="9.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> @@ -189,6 +189,9 @@ <real key="value" value="4"/> </userDefinedRuntimeAttribute> </userDefinedRuntimeAttributes> <connections> <action selector="completeAction:" destination="-1" eventType="touchUpInside" id="3b2-HC-UhZ"/> </connections> </button> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cC2-x4-ivw"> <rect key="frame" x="0.0" y="157" width="394" height="30"/> OKProject/Class/Home/Controller/TravelVC.swift
@@ -44,7 +44,7 @@ /// 附近车辆 private var view_carNum = CarNumView.instance() var officialCharterClouse:(()->Void)? var officialCharterClouse:((TravelViewModel)->Void)? lazy var label_desc: UILabel = { let label = UILabel() @@ -243,6 +243,7 @@ } let vc = ReasonforTravelVC() vc.viewModel = self.viewModel vc.view.backgroundColor = UIColor.black.withAlphaComponent(0) vc.view.frame = CGRect(x: 0, y: screenH, width: ScreenWidth, height: ScreenHeight) self.navigationController?.addChild(vc) @@ -289,10 +290,11 @@ MineInfoView.instance(data: ["单程计费","包车计费"]).show { (row) in if row == 0{ self.cell_address.button_tip.setTitle("单程计费", for: .normal) YYMapViewManager.share.calType.accept(1) }else{ self.officialCharterClouse?() let vc = OfficialCharterVC() self.officialCharterClouse?(self.viewModel) YYMapViewManager.share.calType.accept(2) } } return @@ -356,7 +358,7 @@ if self.viewModel.orderType.value == .taxi{ self.viewModel.taxiOrder() }else if self.viewModel.orderType.value == .special{ if YYMapViewManager.share.passengerNum.value == nil{ if YYMapViewManager.share.passengerNum.value == 0{ SpecialSealAffirmView.show {[unowned self] num in YYMapViewManager.share.passengerNum.accept(num) self.viewModel.specialOrder() @@ -364,6 +366,11 @@ }else{ self.viewModel.specialOrder() } }else if self.viewModel.orderType.value == .offical{ guard YYMapViewManager.share.timeStamp.value != nil else {alert(text: "请选择出行日期");return} guard !(self.viewModel.trailReason.value?.isEmpty ?? true) else {alert(text: "请填写事由出行");return} guard YYMapViewManager.share.calType.value != nil else {alert(text: "请选择计费方式");return} self.viewModel.officalOrder() } } } OKProject/Class/Home/Model/EnterpriseModel.swift
@@ -56,3 +56,42 @@ struct AuthStatusModel:HandyJSON{ var permission = false } struct OfficalRequstModel:HandyJSON{ var serverCarModelId:Int? var calType:CalType! var endAddress:String! var endLat:Double! var endLon:Double! /// 订单来源(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单) var orderSource:Int! /// 是否预约(1=否,2=是) var orderType:Int! var passengers:String? var passengersPhone:String? /// 付费方式(1=自费,2=企业支付) var payWay:Int! /// 出行人员详情JSON格式数组对象[{"name":"小明","phone":"15908401993"}] var people:String? var peopleNum:Int! var placementLat:Double! var placementLon:Double! var reason:String? var reasonTypeNames:String? var startAddress:String! var startLat:Double! var startLon:Double! /// 是否代下单(0=否,1=是) var substitute:Int! /// 出行时间(2020-08-20 10:10) var travelTime:String! /// 订单类型(1=普通订单,2=摆渡订单) var type:Int! } OKProject/Class/Home/View/TripAddressCell.swift
@@ -276,7 +276,11 @@ view_carType.button_error.rx.tap .subscribe(onNext: {[unowned self] (_) in if YYMapViewManager.share.orderType.value == .offical{ self.queryServerCarOfficalModel() }else{ self.queryServerCarModel() } }) .disposed(by: rx.disposeBag) @@ -364,8 +368,11 @@ case .appointment: self.updateUIButton(sender: self.button_appointment) self.button_more.isHidden = YYMapViewManager.share.callState.value == .normal ? false : true self.button_date.isHidden = false self.button_date.isHidden = false if YYMapViewManager.share.orderType.value == .offical{ self.button_more.isHidden = true } // self.button_date.isHidden = true self.button_passenger.isHidden = false self.button_tip.isHidden = false if YYMapViewManager.share.orderType.value == .taxi{ @@ -382,6 +389,11 @@ case .call: self.updateUIButton(sender: self.button_call) self.button_more.isHidden = YYMapViewManager.share.callState.value == .normal ? false : true if YYMapViewManager.share.orderType.value == .offical{ self.button_more.isHidden = true } self.label_more.text = "选乘车人" if YYMapViewManager.share.orderType.value == .taxi{ self.button_date.isHidden = true @@ -392,6 +404,8 @@ self.button_tip.isHidden = false if YYMapViewManager.share.orderType.value == .taxi{ self.button_passenger.setTitle(YYMapViewManager.share.passenger.value == nil ? "更换乘车人" : "\(YYMapViewManager.share.passenger.value?.name ?? "更换乘车人")", for: .normal) }else if YYMapViewManager.share.orderType.value == .offical{ self.button_passenger.setTitle("事由出行", for: .normal) }else{ self.button_passenger.setTitle(YYMapViewManager.share.passenger.value == nil ? "选乘车人" : "\(YYMapViewManager.share.passenger.value?.name ?? "选乘车人")", for: .normal) } @@ -399,6 +413,15 @@ break } }).disposed(by: rx.disposeBag) YYMapViewManager.share.calType.subscribe { (state) in if state == 1{ self.button_tip.setTitle("单程计费", for: .normal) }else if state == 2{ self.button_tip.setTitle("包车计费", for: .normal) } }.disposed(by: rx.disposeBag) YYMapViewManager.share.callState.subscribe(onNext: { (state) in switch state{ @@ -447,7 +470,14 @@ self.view_carType.isHidden = false self.button_emergencyContact.isHidden = false self.button_tip.isHidden = true if YYMapViewManager.share.orderType.value == .offical{ self.button_emergencyContact.isHidden = true self.button_tip.isHidden = false self.queryServerCarOfficalModel() }else{ self.queryServerCarModel() } } var title = "" @@ -476,6 +506,11 @@ .subscribe(onNext: {[unowned self] (string) in if YYMapViewManager.share.orderType.value == .offical{ self.button_tip.setTitle(string == nil ? "计费方式" : string, for: .normal) if YYMapViewManager.share.calType.value == 1{ self.button_tip.setTitle("单程计费", for: .normal) }else if YYMapViewManager.share.calType.value == 2{ self.button_tip.setTitle("包车计费", for: .normal) } }else{ self.button_tip.setTitle(string == nil ? "小费" : string, for: .normal) } @@ -554,6 +589,30 @@ .disposed(by: rx.disposeBag) } func queryServerCarOfficalModel(){ view_carType.style = .refreshing APIManager.shared.provider.rx.request(.queryOfficalCarModel(calType: 1, startLonLat: "\(YYMapViewManager.share.originInfo.value?.lon ?? 0),\(YYMapViewManager.share.originInfo.value?.lat ?? 0)", endLonLat: "\(YYMapViewManager.share.destination.value?.lon ?? 0),\(YYMapViewManager.share.destination.value?.lat ?? 0)",startTime: "", endTime: "")).map(YYModel<[YYCarTypeModel]>.self) .validate() .subscribe(onSuccess: { [unowned self] (model) in self.view_carType.style = .none guard let data = model.data else {return} switch data.count{ case 0: self.view_carType.style = .nothing self.button_submit.alpha = 0.5 self.button_submit.isUserInteractionEnabled = false default: self.view_carType.dataSource = data self.button_submit.alpha = 1 self.button_submit.isUserInteractionEnabled = true } }) { (error) in self.view_carType.style = .error } .disposed(by: rx.disposeBag) } @IBAction func valuationRuleAction(_ sender: UIButton) { self.valuationRule.call(sender.tag) } OKProject/Class/Home/View/TripAddressCell.xib
@@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <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"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" 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="21678"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/> <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"/> @@ -682,7 +682,7 @@ <constraint firstAttribute="height" constant="40" id="7Ka-ol-iS1"/> </constraints> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/> <state key="normal" title="呼叫出租车"/> <state key="normal" title="预约出行"/> <userDefinedRuntimeAttributes> <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> <real key="value" value="4"/> @@ -789,7 +789,7 @@ <size key="intrinsicContentSize" width="86" height="18.5"/> </designable> <designable name="ZZG-Sj-1k7"> <size key="intrinsicContentSize" width="77" height="30"/> <size key="intrinsicContentSize" width="62" height="30"/> </designable> </designables> <resources> OKProject/Class/Home/ViewModel/TravelViewModel.swift
@@ -53,7 +53,22 @@ /// 订单Id let orderId = BehaviorRelay<Int>(value: 0) /// 企业审核情况 let authStatus = BehaviorRelay<Bool>(value: false) /// 出行事由 let trailReason = BehaviorRelay<String?>(value: nil) /// 出行具体内容 let trailContentReason = BehaviorRelay<String?>(value: nil) /// 付费方式 let officalPaymentType = BehaviorRelay<OfficalPaymentType>(value: .selfPay) let passengers = BehaviorRelay<[PassengerInfo]>(value: []) /// 计费方式 let calType = BehaviorRelay<Int?>(value: nil) /// 获取正在进行中的订单 func queryServingOrder() { @@ -161,6 +176,34 @@ .disposed(by: disposeBag) } func officalOrder(){ guard let originInfo = YYMapViewManager.share.originInfo.value,let destination = YYMapViewManager.share.destination.value else {return} taxiOrderSubject.onNext(.loading) let orderType = YYMapViewManager.share.state.value == .appointment ? 2 : 1 let substitute = YYMapViewManager.share.passenger.value == nil ? 0 : 1 let timeStamp = DateInRegion(Date(), region: Region(calendar: Calendars.gregorian, zone: Zones.current,locale: Locales.current)).toFormat("yyyy-MM-dd HH:mm") let travelTime = orderType == 2 ? YYMapViewManager.share.timeStamp.value?.toFormat(format: "yyyy-MM-dd HH:mm") ?? timeStamp : timeStamp if substitute == 1{ YYMapViewManager.share.passenger.accept(PassengerModel(name: app.userInfo.nickName, phone: app.userInfo.phone)) } let reqModel = OfficalRequstModel(serverCarModelId:selectedCarType.value?.id,calType: .Single, endAddress: destination.name, endLat: destination.lat, endLon: destination.lon, orderSource: 1, orderType: orderType, passengers: YYMapViewManager.share.passenger.value?.name, passengersPhone: YYMapViewManager.share.passenger.value?.phone, payWay: officalPaymentType.value.rawValue, people: passengers.value.arrayToJson(), peopleNum: passengers.value.count, placementLat: Double(YYMapViewManager.share.userLocation.latitude), placementLon: Double(YYMapViewManager.share.userLocation.longitude), reason: trailContentReason.value, reasonTypeNames: trailReason.value, startAddress: originInfo.name, startLat: originInfo.lat, startLon: originInfo.lon, substitute: substitute, travelTime: timeStamp, type: 1) APIManager.shared.provider.rx .request(.saveOrderBusiness(model: reqModel)).map(YYModel<SwitchCityModel>.self) .validate() .subscribe(onSuccess: {[unowned self] (model) in guard let data = model.data else{return} self.orderId.accept(data.id) self.taxiOrderSubject.onNext(.success(nil)) }) { [unowned self] (error) in self.taxiOrderSubject.onNext(.error(error)) } .disposed(by: disposeBag) } /// 快车下单 func specialOrder() { OKProject/Class/Order/Controller/MyOrderListVC.swift
@@ -14,7 +14,7 @@ var seletedIndex = 0 /// 菜单 private let menu = ["快车/专车","出租车","机场专线","景区直通车","公务出行"] private let menu = ["快车/专车","出租车","机场专线","景区直通车","公务用车"] /// VTMagicController private lazy var vtmagic: VTMagicController = { @@ -109,9 +109,9 @@ } return vc! case "公务用车": var vc:LogisticsListVC? var vc:TaxiOrderListVC? if vc == nil { vc = LogisticsListVC.init(orderType: .offical) vc = TaxiOrderListVC.init(orderType: .offical) } return vc! // case "包车": OKProject/Class/Order/Model/TaxiOrderModel.swift
@@ -69,6 +69,10 @@ var endServiceTime = "" //送达时间 var arriveTimeExpect = "" /// 审核状态(-1 正常订单,0待审核 1审核通过 2拒绝)' var auditStatus:OrderAuthStatus = .normal } struct CouponListModel:HandyJSON{ OKProject/Class/Order/View/TaxiOrderListCell.swift
@@ -114,6 +114,10 @@ default: break } if model.auditStatus == .review || model.auditStatus == .reject{ label_state.text = model.auditStatus.rawStr } if model.thankYouFee > 0{ thanksL.text = String(format: "答谢¥%@元", model.thankYouFee.ld_formatFloat) OKProject/Class/Taxi/Controller/TravelServiceVC.xib
@@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" 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="20020"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/> <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"/> @@ -66,16 +66,16 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U9W-pW-UXF"> <rect key="frame" x="0.0" y="44" width="414" height="818"/> <rect key="frame" x="0.0" y="48" width="414" height="814"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="u0g-2S-gi9" customClass="MAMapView"> <rect key="frame" x="0.0" y="0.0" width="414" height="818"/> <rect key="frame" x="0.0" y="0.0" width="414" height="814"/> <subviews> <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QXe-Aq-oXV"> <rect key="frame" x="0.0" y="0.0" width="414" height="818"/> <rect key="frame" x="0.0" y="0.0" width="414" height="814"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="一键叫的服务中" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Ek-qs-MUK"> <rect key="frame" x="153.5" y="400" width="107.5" height="18"/> <rect key="frame" x="153.5" y="398" width="107.5" height="18"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/> <color key="textColor" red="0.2901960784" green="0.29803921570000003" blue="0.35294117650000001" alpha="1" colorSpace="custom" customColorSpace="displayP3"/> <nil key="highlightedColor"/> @@ -580,7 +580,7 @@ </constraints> </view> <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TLg-yu-U9d"> <rect key="frame" x="14" y="764" width="386" height="40"/> <rect key="frame" x="14" y="760" width="386" height="40"/> <color key="backgroundColor" name="Color"/> <constraints> <constraint firstAttribute="height" constant="40" id="CuK-uF-r6T"/> @@ -589,7 +589,7 @@ <state key="normal" title="取消订单"/> </button> <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ysu-3F-DMF" customClass="YYView" customModule="OK出行" customModuleProvider="target"> <rect key="frame" x="8" y="769" width="398" height="41"/> <rect key="frame" x="8" y="765" width="398" height="41"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="司机接单" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WbQ-KD-CJN"> <rect key="frame" x="18" y="12" width="362" height="17"/> @@ -619,7 +619,7 @@ </userDefinedRuntimeAttributes> </view> <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LxQ-2K-dZB" customClass="YYButton" customModule="OK出行" customModuleProvider="target"> <rect key="frame" x="14" y="725" width="32" height="32"/> <rect key="frame" x="14" y="721" width="32" height="32"/> <subviews> <view userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9z0-hg-HQL"> <rect key="frame" x="0.0" y="0.0" width="32" height="32"/> @@ -670,7 +670,7 @@ </userDefinedRuntimeAttributes> </view> <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2UQ-Mt-BFb"> <rect key="frame" x="0.0" y="126" width="414" height="692"/> <rect key="frame" x="0.0" y="126" width="414" height="688"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fxB-fy-Goc"> <rect key="frame" x="177" y="102" width="60" height="43"/> @@ -685,7 +685,7 @@ <nil key="highlightedColor"/> </label> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VJH-VC-X53" customClass="YYButton" customModule="OK出行" customModuleProvider="target"> <rect key="frame" x="14" y="638" width="386" height="40"/> <rect key="frame" x="14" y="634" width="386" height="40"/> <color key="backgroundColor" red="0.2901960784" green="0.29803921570000003" blue="0.34901960780000002" alpha="1" colorSpace="calibratedRGB"/> <constraints> <constraint firstAttribute="height" constant="40" id="Zlt-Mx-oK6"/> @@ -711,10 +711,10 @@ </constraints> </view> <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rtQ-AU-27G"> <rect key="frame" x="0.0" y="126" width="414" height="692"/> <rect key="frame" x="0.0" y="126" width="414" height="688"/> <subviews> <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Z3o-iv-zL1"> <rect key="frame" x="0.0" y="0.0" width="414" height="692"/> <rect key="frame" x="0.0" y="0.0" width="414" height="688"/> <subviews> <view contentMode="scaleToFill" placeholderIntrinsicWidth="414" placeholderIntrinsicHeight="600" translatesAutoresizingMaskIntoConstraints="NO" id="dP2-TF-v3t"> <rect key="frame" x="0.0" y="0.0" width="414" height="600"/> @@ -851,14 +851,14 @@ </constraints> </scrollView> <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a1K-U5-OQV"> <rect key="frame" x="166.5" y="598" width="81" height="30"/> <rect key="frame" x="166.5" y="594" width="81" height="30"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/> <state key="normal" title="我已付款>>"> <color key="titleColor" name="Color"/> </state> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4Uk-fR-4Sm" customClass="YYButton" customModule="OK出行" customModuleProvider="target"> <rect key="frame" x="14" y="638" width="386" height="40"/> <rect key="frame" x="14" y="634" width="386" height="40"/> <color key="backgroundColor" name="Color"/> <constraints> <constraint firstAttribute="height" constant="40" id="dbV-MM-95d"/> @@ -927,6 +927,9 @@ </view> </objects> <designables> <designable name="24b-o9-s0u"> <size key="intrinsicContentSize" width="240" height="44"/> </designable> <designable name="4Uk-fR-4Sm"> <size key="intrinsicContentSize" width="58" height="29"/> </designable> @@ -944,14 +947,14 @@ <image name="evaluate_empty(3)" width="22" height="23"/> <image name="evaluate_empty(4)" width="22" height="23"/> <image name="icon_dial" width="30" height="30"/> <image name="icon_end point" width="10" height="10"/> <image name="icon_end point" width="14" height="14"/> <image name="icon_people" width="12" height="10"/> <image name="icon_score" width="14" height="14"/> <image name="icon_share" width="14" height="14"/> <image name="icon_starting point" width="20" height="20"/> <image name="icon_starting point" width="14" height="14"/> <image name="icon_time_l" width="10" height="10"/> <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> <namedColor name="Color-1"> <color red="0.94099998474121094" green="0.44699999690055847" blue="0.027000000700354576" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> OKProject/Tools/YYMapView/YYMapViewManager.swift
@@ -101,6 +101,9 @@ /// 小费 let tip = BehaviorRelay<String?>(value: nil) /// 计费方式 计费方式(1单程计费,2=包车计费) let calType = BehaviorRelay<Int?>(value: nil) /// 用户位置 private var userLocationView: LocationAnnotationView? @@ -257,6 +260,7 @@ YYMapViewManager.share.timeStamp.accept(nil) YYMapViewManager.share.passenger.accept(nil) YYMapViewManager.share.tip.accept(nil) YYMapViewManager.share.calType.accept(nil) guard let coordinate = originInfo.value else{return} self.mapView.setCenter(CLLocationCoordinate2D.init(latitude: coordinate.lat, longitude: coordinate.lon), animated: false) self.mapView.zoomLevel = 17