监控显示修改

This commit is contained in:
ddisfriend
2025-10-17 17:01:13 +08:00
parent 3f4b032116
commit 017a241821
6 changed files with 73 additions and 45 deletions

View File

@@ -85,4 +85,6 @@ open class ApiList {
public let onlineReminder = "/supplierAppV2/dispatchApp/alarm/onlineReminder" public let onlineReminder = "/supplierAppV2/dispatchApp/alarm/onlineReminder"
public let onlineReminderRead = "/supplierAppV2/dispatchApp/alarm/onlineReminderRead" public let onlineReminderRead = "/supplierAppV2/dispatchApp/alarm/onlineReminderRead"
public let vehicleMonitorInfo = "/supplierAppV2/dispatchApp/order/vehicleMonitorInfo"
} }

View File

@@ -275,3 +275,10 @@ public struct OnlineReminderParameters : Encodable {
public struct OnlineReminderReadParameters : Encodable { public struct OnlineReminderReadParameters : Encodable {
var id : Int? var id : Int?
} }
public struct VehicleMonitorInfoParameters : Encodable {
var vehicleId : Int?
var lon : String?
var lat : String?
var code : String?
}

View File

@@ -176,4 +176,8 @@ open class RequestList {
func onlineReminderRead<P:Encodable>(parameters:P) -> Single<ResponseModel<String>?> { func onlineReminderRead<P:Encodable>(parameters:P) -> Single<ResponseModel<String>?> {
return DDAF.get(urlString: HOST+API.onlineReminderRead,parameters: parameters,encoding: URLEncodedFormParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<String>.self) return DDAF.get(urlString: HOST+API.onlineReminderRead,parameters: parameters,encoding: URLEncodedFormParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<String>.self)
} }
func vehicleMonitorInfo<P:Encodable>(parameters:P) -> Single<ResponseModel<VehicleMonitorInfoDataModel>?> {
return DDAF.post(urlString: HOST+API.vehicleMonitorInfo,parameters: parameters,encoding: JSONParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<VehicleMonitorInfoDataModel>.self)
}
} }

View File

@@ -232,11 +232,9 @@ public class VehicleMonitorListDataModel : Decodable {
var destinationLongitude : Double? var destinationLongitude : Double?
var destinationLatitude : Double? var destinationLatitude : Double?
var destinationAddress : String? var destinationAddress : String?
var leftTimeB : Double? var lat : String?
var leftTimeC : Double? var lon : String?
var distance : Double? }
var mileageBc : Double?
var contractName : String? }
} }
public class OrderPhotoListDataModel : Decodable { public class OrderPhotoListDataModel : Decodable {
@@ -414,3 +412,11 @@ public class GetAppealDataModel : Decodable {
public class SaveAppealModel : Decodable { public class SaveAppealModel : Decodable {
} }
public class VehicleMonitorInfoDataModel : Decodable {
var leftTimeB : Double?
var leftTimeC : Double?
var distance : Double?
var mileageBc : Double?
var contractName : String?
}

View File

@@ -43,7 +43,6 @@ open class AcceptOrderView : DDView {
horizontalLine.backgroundColor = .hex("979797").alpha(0.35) horizontalLine.backgroundColor = .hex("979797").alpha(0.35)
radiusView.addSubview(horizontalLine) radiusView.addSubview(horizontalLine)
verticalLine.backgroundColor = .hex("979797").alpha(0.35) verticalLine.backgroundColor = .hex("979797").alpha(0.35)
verticalLine.isHidden = true
radiusView.addSubview(verticalLine) radiusView.addSubview(verticalLine)
readButton.titleLabel?.font = .mediumFont(auto(14)) readButton.titleLabel?.font = .mediumFont(auto(14))
readButton.backgroundColor = .white readButton.backgroundColor = .white

View File

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