监控显示修改
This commit is contained in:
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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?
|
||||||
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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?
|
||||||
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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 }
|
||||||
}else{
|
if let contractName = response?.data?.contractName {
|
||||||
contractContent.text = nil
|
self.contractContent.text = contractName
|
||||||
contractTitle.text = nil
|
self.contractTitle.text = "合同:"
|
||||||
contractImageView.image = nil
|
self.contractImageView.image = UIImage(named: "vehichleMonitoring_contract_16")
|
||||||
}
|
}else{
|
||||||
var point = ""
|
self.contractContent.text = nil
|
||||||
var leftTime : Int? = nil
|
self.contractTitle.text = nil
|
||||||
if let leftTimeB = taskModel.leftTimeB {
|
self.contractImageView.image = nil
|
||||||
point = "B"
|
}
|
||||||
leftTime = Int(leftTimeB)
|
var point : String? = nil
|
||||||
}else if let leftTimeC = taskModel.leftTimeC {
|
var leftTime : Int? = nil
|
||||||
point = "C"
|
if let leftTimeB = response?.data?.leftTimeB,leftTimeB > 0 {
|
||||||
leftTime = Int(leftTimeC)
|
point = "B"
|
||||||
}
|
leftTime = Int(leftTimeB)
|
||||||
let distanceFromPointAttributeString = NSMutableAttributedString(string: "距离\(point)点: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
}else if let leftTimeC = response?.data?.leftTimeC,leftTimeC > 0 {
|
||||||
if let distance = taskModel.distance {
|
point = "C"
|
||||||
distanceFromPointAttributeString.append(NSMutableAttributedString(string: "\(distance)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
leftTime = Int(leftTimeC)
|
||||||
distanceFromPointAttributeString.append(NSMutableAttributedString(string: "km", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
}
|
||||||
distanceFromPointLabel.attributedText = distanceFromPointAttributeString
|
|
||||||
}
|
if let point, let distance = response?.data?.distance {
|
||||||
|
let distanceFromPointAttributeString = NSMutableAttributedString(string: "距离\(point)点: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
||||||
let leftTimeAttributeString = NSMutableAttributedString(string: "剩余时间: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
distanceFromPointAttributeString.append(NSMutableAttributedString(string: "\(distance)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
||||||
if let leftTime {
|
distanceFromPointAttributeString.append(NSMutableAttributedString(string: "km", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
||||||
leftTimeAttributeString.append(NSMutableAttributedString(string: "\(leftTime)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
self.distanceFromPointLabel.attributedText = distanceFromPointAttributeString
|
||||||
leftTimeAttributeString.append(NSMutableAttributedString(string: "分", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
}
|
||||||
remainTimeLabel.attributedText = leftTimeAttributeString
|
|
||||||
}
|
let leftTimeAttributeString = NSMutableAttributedString(string: "剩余时间: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
||||||
|
if let _ = point, let leftTime {
|
||||||
let bcAttributeString = NSMutableAttributedString(string: "BC: ",attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)])
|
leftTimeAttributeString.append(NSMutableAttributedString(string: "\(leftTime)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
||||||
if let mileageBc = taskModel.mileageBc {
|
leftTimeAttributeString.append(NSMutableAttributedString(string: "分", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
||||||
bcAttributeString.append(NSMutableAttributedString(string: "\(mileageBc)", attributes: [.foregroundColor : UIColor.hex("F93D3D"),.font : UIFont.regularFont(12)]))
|
self.remainTimeLabel.attributedText = leftTimeAttributeString
|
||||||
bcAttributeString.append(NSMutableAttributedString(string: "km", attributes: [.foregroundColor : UIColor.hex("11142F"),.font : UIFont.regularFont(12)]))
|
}
|
||||||
distanceLabel.attributedText = bcAttributeString
|
|
||||||
}
|
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! {
|
func listView() -> UIView! {
|
||||||
|
|||||||
Reference in New Issue
Block a user