|
|
|
|
@@ -1633,6 +1633,7 @@ class VMLDContainerView : DDView , JXCategoryListContentViewDelegate {
|
|
|
|
|
var distanceFromPointLabel : DDLabel
|
|
|
|
|
var remainTimeLabel : DDLabel
|
|
|
|
|
var distanceLabel : DDLabel
|
|
|
|
|
var disposeBag : DisposeBag
|
|
|
|
|
override init(frame: CGRect) {
|
|
|
|
|
orderNumButton = UIButton()
|
|
|
|
|
orderNumButton.setTitleColor(.hex("0E76F4"), for: .normal)
|
|
|
|
|
@@ -1650,6 +1651,7 @@ class VMLDContainerView : DDView , JXCategoryListContentViewDelegate {
|
|
|
|
|
distanceFromPointLabel = DDLabel()
|
|
|
|
|
remainTimeLabel = DDLabel()
|
|
|
|
|
distanceLabel = DDLabel()
|
|
|
|
|
disposeBag = DisposeBag()
|
|
|
|
|
super.init(frame: frame)
|
|
|
|
|
|
|
|
|
|
addSubview(orderNumButton)
|
|
|
|
|
@@ -1772,45 +1774,53 @@ class VMLDContainerView : DDView , JXCategoryListContentViewDelegate {
|
|
|
|
|
stateLabel.text = taskModel.taskStatusString
|
|
|
|
|
incidentLabel.text = taskModel.vehiclePointAddress
|
|
|
|
|
destLabel.text = taskModel.destinationAddress
|
|
|
|
|
if let contractName = taskModel.contractName {
|
|
|
|
|
contractContent.text = contractName
|
|
|
|
|
contractTitle.text = "合同:"
|
|
|
|
|
contractImageView.image = UIImage(named: "vehichleMonitoring_contract_16")
|
|
|
|
|
}else{
|
|
|
|
|
contractContent.text = nil
|
|
|
|
|
contractTitle.text = nil
|
|
|
|
|
contractImageView.image = nil
|
|
|
|
|
}
|
|
|
|
|
var point = ""
|
|
|
|
|
var leftTime : Int? = nil
|
|
|
|
|
if let leftTimeB = taskModel.leftTimeB {
|
|
|
|
|
point = "B"
|
|
|
|
|
leftTime = Int(leftTimeB)
|
|
|
|
|
}else if let leftTimeC = taskModel.leftTimeC {
|
|
|
|
|
point = "C"
|
|
|
|
|
leftTime = Int(leftTimeC)
|
|
|
|
|
}
|
|
|
|
|
let distanceFromPointAttributeString = NSMutableAttributedString(string: "距离\(point)点: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
|
|
|
|
if let distance = taskModel.distance {
|
|
|
|
|
distanceFromPointAttributeString.append(NSMutableAttributedString(string: "\(distance)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
distanceFromPointAttributeString.append(NSMutableAttributedString(string: "km", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
distanceFromPointLabel.attributedText = distanceFromPointAttributeString
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let leftTimeAttributeString = NSMutableAttributedString(string: "剩余时间: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
|
|
|
|
if let leftTime {
|
|
|
|
|
leftTimeAttributeString.append(NSMutableAttributedString(string: "\(leftTime)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
leftTimeAttributeString.append(NSMutableAttributedString(string: "分", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
remainTimeLabel.attributedText = leftTimeAttributeString
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bcAttributeString = NSMutableAttributedString(string: "BC: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
|
|
|
|
if let mileageBc = taskModel.mileageBc {
|
|
|
|
|
bcAttributeString.append(NSMutableAttributedString(string: "\(mileageBc)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
bcAttributeString.append(NSMutableAttributedString(string: "km", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
distanceLabel.attributedText = bcAttributeString
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RQ.vehicleMonitorInfo(parameters: VehicleMonitorInfoParameters(vehicleId: taskModel.taskVehicleId,lon: taskModel.lon,lat: taskModel.lat,code: taskModel.orderCode))
|
|
|
|
|
.observe(on: MainScheduler.instance)
|
|
|
|
|
.subscribe(onSuccess: {[weak self] response in
|
|
|
|
|
guard let self = self else { return }
|
|
|
|
|
if let contractName = response?.data?.contractName {
|
|
|
|
|
self.contractContent.text = contractName
|
|
|
|
|
self.contractTitle.text = "合同:"
|
|
|
|
|
self.contractImageView.image = UIImage(named: "vehichleMonitoring_contract_16")
|
|
|
|
|
}else{
|
|
|
|
|
self.contractContent.text = nil
|
|
|
|
|
self.contractTitle.text = nil
|
|
|
|
|
self.contractImageView.image = nil
|
|
|
|
|
}
|
|
|
|
|
var point : String? = nil
|
|
|
|
|
var leftTime : Int? = nil
|
|
|
|
|
if let leftTimeB = response?.data?.leftTimeB,leftTimeB > 0 {
|
|
|
|
|
point = "B"
|
|
|
|
|
leftTime = Int(leftTimeB)
|
|
|
|
|
}else if let leftTimeC = response?.data?.leftTimeC,leftTimeC > 0 {
|
|
|
|
|
point = "C"
|
|
|
|
|
leftTime = Int(leftTimeC)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if let point, let distance = response?.data?.distance {
|
|
|
|
|
let distanceFromPointAttributeString = NSMutableAttributedString(string: "距离\(point)点: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
|
|
|
|
distanceFromPointAttributeString.append(NSMutableAttributedString(string: "\(distance)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
distanceFromPointAttributeString.append(NSMutableAttributedString(string: "km", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
self.distanceFromPointLabel.attributedText = distanceFromPointAttributeString
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let leftTimeAttributeString = NSMutableAttributedString(string: "剩余时间: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
|
|
|
|
if let _ = point, let leftTime {
|
|
|
|
|
leftTimeAttributeString.append(NSMutableAttributedString(string: "\(leftTime)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
leftTimeAttributeString.append(NSMutableAttributedString(string: "分", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
self.remainTimeLabel.attributedText = leftTimeAttributeString
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bcAttributeString = NSMutableAttributedString(string: "BC: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
|
|
|
|
if let mileageBc = response?.data?.mileageBc {
|
|
|
|
|
bcAttributeString.append(NSMutableAttributedString(string: "\(mileageBc)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
bcAttributeString.append(NSMutableAttributedString(string: "km", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
|
|
|
|
self.distanceLabel.attributedText = bcAttributeString
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.disposed(by: disposeBag)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func listView() -> UIView! {
|
|
|
|
|
|