监控显示修改
This commit is contained in:
@@ -85,4 +85,6 @@ open class ApiList {
|
||||
public let onlineReminder = "/supplierAppV2/dispatchApp/alarm/onlineReminder"
|
||||
|
||||
public let onlineReminderRead = "/supplierAppV2/dispatchApp/alarm/onlineReminderRead"
|
||||
|
||||
public let vehicleMonitorInfo = "/supplierAppV2/dispatchApp/order/vehicleMonitorInfo"
|
||||
}
|
||||
|
||||
@@ -275,3 +275,10 @@ public struct OnlineReminderParameters : Encodable {
|
||||
public struct OnlineReminderReadParameters : Encodable {
|
||||
var id : Int?
|
||||
}
|
||||
|
||||
public struct VehicleMonitorInfoParameters : Encodable {
|
||||
var vehicleId : Int?
|
||||
var lon : String?
|
||||
var lat : String?
|
||||
var code : String?
|
||||
}
|
||||
|
||||
@@ -176,4 +176,8 @@ open class RequestList {
|
||||
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)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,11 +232,9 @@ public class VehicleMonitorListDataModel : Decodable {
|
||||
var destinationLongitude : Double?
|
||||
var destinationLatitude : Double?
|
||||
var destinationAddress : String?
|
||||
var leftTimeB : Double?
|
||||
var leftTimeC : Double?
|
||||
var distance : Double?
|
||||
var mileageBc : Double?
|
||||
var contractName : String? }
|
||||
var lat : String?
|
||||
var lon : String?
|
||||
}
|
||||
}
|
||||
|
||||
public class OrderPhotoListDataModel : Decodable {
|
||||
@@ -414,3 +412,11 @@ public class GetAppealDataModel : Decodable {
|
||||
public class SaveAppealModel : Decodable {
|
||||
|
||||
}
|
||||
|
||||
public class VehicleMonitorInfoDataModel : Decodable {
|
||||
var leftTimeB : Double?
|
||||
var leftTimeC : Double?
|
||||
var distance : Double?
|
||||
var mileageBc : Double?
|
||||
var contractName : String?
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ open class AcceptOrderView : DDView {
|
||||
horizontalLine.backgroundColor = .hex("979797").alpha(0.35)
|
||||
radiusView.addSubview(horizontalLine)
|
||||
verticalLine.backgroundColor = .hex("979797").alpha(0.35)
|
||||
verticalLine.isHidden = true
|
||||
radiusView.addSubview(verticalLine)
|
||||
readButton.titleLabel?.font = .mediumFont(auto(14))
|
||||
readButton.backgroundColor = .white
|
||||
|
||||
@@ -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")
|
||||
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{
|
||||
contractContent.text = nil
|
||||
contractTitle.text = nil
|
||||
contractImageView.image = nil
|
||||
self.contractContent.text = nil
|
||||
self.contractTitle.text = nil
|
||||
self.contractImageView.image = nil
|
||||
}
|
||||
var point = ""
|
||||
var point : String? = nil
|
||||
var leftTime : Int? = nil
|
||||
if let leftTimeB = taskModel.leftTimeB {
|
||||
if let leftTimeB = response?.data?.leftTimeB,leftTimeB > 0 {
|
||||
point = "B"
|
||||
leftTime = Int(leftTimeB)
|
||||
}else if let leftTimeC = taskModel.leftTimeC {
|
||||
}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)])
|
||||
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
|
||||
self.distanceFromPointLabel.attributedText = distanceFromPointAttributeString
|
||||
}
|
||||
|
||||
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: "分", 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)])
|
||||
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: "km", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
||||
distanceLabel.attributedText = bcAttributeString
|
||||
self.distanceLabel.attributedText = bcAttributeString
|
||||
}
|
||||
|
||||
})
|
||||
.disposed(by: disposeBag)
|
||||
|
||||
}
|
||||
|
||||
func listView() -> UIView! {
|
||||
|
||||
Reference in New Issue
Block a user