宽窄优行-由【嘉易行】项目成品而来
younger_times
2023-07-04 38f768d39ba27d303147c59a222655b7c6cdfb25
OKProject/Class/TravelAcrossCity(跨城)/Controller/SureTravelInfoController.swift
@@ -56,6 +56,8 @@
    
    
    let viewModel = TravelSiteViewModel()
    var type:OrderType = .taxi //9=机场专线,7=景区直通车,10=公务用车
    
    /// 线路模型
    let lineViewModel = TravelLineViewModel()
@@ -120,7 +122,7 @@
        YYLocationManager.shared.requestLocation { (model) in
            self.viewModel.cuurenModel.accept(model)
        } failure: { (error) in
            alert(text: "当前定位获取失败")
        }
        yy_popBlock = {
            self.navigationController?.popViewController(animated: true)
@@ -508,12 +510,20 @@
//            return
//        }
        viewModel.distance.accept("\(viewModel.orderPriceModel.value.distance)")
        let view = TravelInstructionsView.show()
        let view = TravelInstructionsView.show(type)
        view.loadData()
        view.sureBlock = {
            self.getOrder()
        view.sureBlock = {[weak self] () in
            guard let weakSelf = self else { return }
            if weakSelf.viewModel.cuurenModel.value == nil{
                YYLocationManager.shared.requestLocation { (model) in
                    weakSelf.viewModel.cuurenModel.accept(model)
                    weakSelf.getOrder()
                } failure: { (error) in
                    alert(text: "当前定位获取失败,请再试一次")
                }
            }else{
                weakSelf.getOrder()
            }
        }
    }
}