Commit 4fa26543 authored by 刘俊宏's avatar 刘俊宏

修正运单详情

parent 25a49bb5
{
"images" : [
{
"filename" : "driverIcon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "driverIcon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "driverIcon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -655,7 +655,7 @@ class billPricearrDataModel: Mappable { //司机添加的额外费用信息 ...@@ -655,7 +655,7 @@ class billPricearrDataModel: Mappable { //司机添加的额外费用信息
var bill_type : Int?//费用类型ID,1过桥费,2停车费,3搬运费,5逾时等候费 var bill_type : Int?//费用类型ID,1过桥费,2停车费,3搬运费,5逾时等候费
var name : String?//费用类型名称 示例:高速路桥费 var name : String?//费用类型名称 示例:高速路桥费
var price_fen : Int?//费用金额(分) 示例:0 var price_fen : Float?//费用金额(分) 示例:0
var img_url : String?//票据凭证图片链接 示例: var img_url : String?//票据凭证图片链接 示例:
required init?( map: Map) { required init?( map: Map) {
......
...@@ -44,7 +44,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -44,7 +44,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
bottomLheight.constant = 0 bottomLheight.constant = 0
bottomLbl.isHidden = true bottomLbl.isHidden = true
bottomBtn.isHidden = true bottomBtn.isHidden = true
setPaymentUI(data:datas) // setPaymentUI(data:datas)
} }
@objc func loadData(){ @objc func loadData(){
...@@ -81,7 +81,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -81,7 +81,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
self.bottomLheight.constant = 49 self.bottomLheight.constant = 49
self.bottomLbl.isHidden = false self.bottomLbl.isHidden = false
self.bottomBtn.isHidden = false self.bottomBtn.isHidden = false
self.bottomLbl.text = "立即支付" + String(format: "%.2f", (self.dataModel?.order_detail_item?.order_item?.price_fen)!) + "元" self.bottomLbl.text = "立即支付" + String(format: "%.2f", ((self.dataModel?.order_detail_item?.order_item?.price_fen)!/100.0)) + "元"
} }
case 3,4,5: case 3,4,5:
...@@ -90,7 +90,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -90,7 +90,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
break break
} }
} }
self.orderPeiceStrAndName()
self.listView.reloadData() self.listView.reloadData()
}else { }else {
self.loadData() self.loadData()
...@@ -138,28 +138,67 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -138,28 +138,67 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
} }
if section == 3 { if section == 3 {
if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 { if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 {
var isUrl = false
dataModel?.order_detail_item?.bill_price_arr?.forEach({ (model) in
if model.img_url?.count != 0 {
isUrl = true
}
})
if isUrl {
return 1 return 1
} }
return 0 return 0
} }
return 0
}
if section == 5 || section == 6{ if section == 5 || section == 6{
return 2 return 2
} }
if section == 4 { if section == 4 {
if (dataModel?.order_detail_item?.spec_req_price_arr?.count)! > 0 && (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 { return orderPriceArrName.count
return (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! + (dataModel?.order_detail_item?.bill_price_arr?.count)! + (dataModel?.order_detail_item?.spec_req_price_arr?.count)!
} }
if (dataModel?.order_detail_item?.spec_req_price_arr?.count)! > 0 { return (dataModel?.order_detail_item?.order_item?.addr_info_arr!.count)!
return (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! + (dataModel?.order_detail_item?.spec_req_price_arr?.count)!
} }
if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 { var orderPriceArrStr: [String] = []
return (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! + (dataModel?.order_detail_item?.bill_price_arr?.count)! var orderPriceArrName: [String] = []
//MARK:--处理订单费用数据展示
func orderPeiceStrAndName() {
orderPriceArrName.removeAll()
orderPriceArrStr.removeAll()
dataModel?.order_detail_item?.order_item?.order_price_arr?.forEach({ (rowModel) in
switch rowModel.type {
case 1:
orderPriceArrName.append("起步价" + "(" + (dataModel?.order_detail_item?.order_item?.vehicle_type_name)! + ")")
orderPriceArrStr.append("¥" + String(format: "%.2f", (rowModel.price_fen!/100.0)))
case 2:
let distance = ((dataModel?.order_detail_item?.exceed_distance)!) / 1000
orderPriceArrName.append("超里程价" + "(" + String(format: "%.d", distance) + "公里" + ")")
orderPriceArrStr.append("¥" + String(format: "%.2f", (rowModel.price_fen!/100.0)))
case 4:
dataModel?.order_detail_item?.spec_req_price_arr?.forEach({ (specModel) in
if specModel.price_fen! != 0 {
orderPriceArrName.append(specModel.name!)
orderPriceArrStr.append("¥" + String(format: "%.2f", (specModel.price_fen!/100.0)))
} }
})
return (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! case 15:
orderPriceArrName.append("货物保障(0元最高保5万)")
orderPriceArrStr.append("¥" + String(format: "%.2f", (rowModel.price_fen!/100.0)))
default:
break
} }
return (dataModel?.order_detail_item?.order_item?.addr_info_arr!.count)! })
if (dataModel?.order_detail_item?.bill_price_arr!.count)! > 0 {
orderPriceArrName.append("额外费用")
orderPriceArrStr.append("")
}
dataModel?.order_detail_item?.bill_price_arr?.forEach({ (rowModel) in
orderPriceArrName.append(rowModel.name!)
orderPriceArrStr.append("¥" + String(format: "%.2f", (rowModel.price_fen!/100.0)))
})
} }
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
if tableView.tag == 99 { if tableView.tag == 99 {
...@@ -259,13 +298,21 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -259,13 +298,21 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
if dataModel?.driver_info != nil { if dataModel?.driver_info != nil {
cell.driverNameLbl.text = dataModel?.driver_info?.name cell.driverNameLbl.text = dataModel?.driver_info?.name
cell.driverNumLbL.text = dataModel?.driver_info?.license_plate cell.driverNumLbL.text = dataModel?.driver_info?.license_plate
cell.driverTypeLbl.text = dataModel?.driver_info?.phone_no cell.driverTypeLbl.text = "联系方式:" + (dataModel?.driver_info?.phone_no)!
} }
return cell return cell
} }
if indexPath.section == 3 { if indexPath.section == 3 {
let cell = tableView.dequeueReusableCell(withIdentifier: "LalamoveBillTableViewCell") as! LalamoveBillTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: "LalamoveBillTableViewCell") as! LalamoveBillTableViewCell
var dataStrArr:[String] = []
dataModel?.order_detail_item?.bill_price_arr?.forEach({ (model) in
if model.img_url?.count != 0 {
dataStrArr.append(model.img_url!)
}
})
cell.datasArr = dataStrArr
return cell return cell
} }
...@@ -278,122 +325,15 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -278,122 +325,15 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
if indexPath.section == 4 { if indexPath.section == 4 {
let indexName = orderPriceArrName[indexPath.row]
if indexPath.row < ((dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - indexNext) { if indexName == "额外费用" {
var rowModel = dataModel?.order_detail_item?.order_item?.order_price_arr![indexPath.row + indexNext]
if rowModel?.type == 4 || rowModel?.type == 8 {
if (indexPath.row + 1) < (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! {
rowModel = dataModel?.order_detail_item?.order_item?.order_price_arr![indexPath.row + 1]
indexNext = indexNext + 1
if rowModel?.type == 4 || rowModel?.type == 8 {
if (indexPath.row + 1) < (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! {
rowModel = dataModel?.order_detail_item?.order_item?.order_price_arr![indexPath.row + 1]
indexNext = indexNext + 1
}
}
}
}
cell.nameLbl.text = ""
cell.textTF.text = "¥" + String(format: "%.2f", (rowModel?.price_fen)!)
switch rowModel?.type {
case 1:
cell.nameLbl.text = "起步价" + "(" + (dataModel?.order_detail_item?.order_item?.vehicle_type_name)! + ")"
case 2:
let distance = (dataModel?.order_detail_item?.exceed_distance)!
cell.nameLbl.text = "超里程价" + "(" + String(format: "%.d", distance) + "公里" + ")"
case 3:
cell.nameLbl.text = "拉拉券扣减"
case 5:
cell.nameLbl.text = "小费"
case 6:
cell.nameLbl.text = "规格"
case 7:
cell.nameLbl.text = "平台订单补贴"
case 15:
cell.nameLbl.text = "货物保障(0元最高保5万)"
case 21:
cell.nameLbl.text = "高速费"
case 22:
cell.nameLbl.text = "停车费"
case 23:
cell.nameLbl.text = "搬运费"
case 24:
cell.nameLbl.text = "其他"
case 25:
cell.nameLbl.text = "逾时等候费"
default:
break
}
}
if (dataModel?.order_detail_item?.spec_req_price_arr?.count)! > 0 {
if indexPath.row == (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - indexNext {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleHeaderCell") as! TitleHeaderCell
cell.nameLbl.text = "额外需求产生的费用"
return cell
}else if (indexPath.row > (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - indexNext) && indexPath.row < (((dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - indexNext) + (dataModel?.order_detail_item?.spec_req_price_arr?.count)! + 1) {
let rowModel = dataModel?.order_detail_item?.spec_req_price_arr![(indexPath.row - (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - indexNext) + 1]
cell.nameLbl.text = rowModel?.name
cell.textTF.text = "¥" + String(format: "%.2f", (rowModel?.price_fen)!)
}
}
if (dataModel?.order_detail_item?.spec_req_price_arr?.count)! == 0 && (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 {
if indexPath.row == (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - indexNext {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleHeaderCell") as! TitleHeaderCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleHeaderCell") as! TitleHeaderCell
cell.nameLbl.text = "司机添加的额外费用" cell.nameLbl.text = indexName
return cell return cell
}else if (indexPath.row > (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - indexNext) && indexPath.row < (((dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - indexNext) + (dataModel?.order_detail_item?.bill_price_arr?.count)! + 1) {
let rowModel = dataModel?.order_detail_item?.bill_price_arr![(indexPath.row - (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - indexNext) + 1]
cell.nameLbl.text = ""
switch rowModel?.bill_type {
case 1:
cell.nameLbl.text = "过桥费"
case 2:
cell.nameLbl.text = "停车费"
case 3:
cell.nameLbl.text = "搬运费"
case 5:
cell.nameLbl.text = "逾时等候费"
default:
break
} }
cell.textTF.text = "¥" + String(format: "%.2f", (rowModel?.price_fen)!) cell.nameLbl.text = indexName
} cell.textTF.text = orderPriceArrStr[indexPath.row]
} cell.nameLbl.textColor = UIColor.init(named: "标题字颜色")
if (dataModel?.order_detail_item?.spec_req_price_arr?.count)! > 0 && (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 {
if indexPath.row == (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! + (dataModel?.order_detail_item?.spec_req_price_arr?.count)! - 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleHeaderCell") as! TitleHeaderCell
cell.nameLbl.text = "司机添加的额外费用"
return cell
}else if indexPath.row > (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! + (dataModel?.order_detail_item?.spec_req_price_arr?.count)! - 1 {
let rowModel = dataModel?.order_detail_item?.bill_price_arr![indexPath.row - (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! - (dataModel?.order_detail_item?.spec_req_price_arr?.count)!]
cell.nameLbl.text = ""
switch rowModel?.bill_type {
case 1:
cell.nameLbl.text = "过桥费"
case 2:
cell.nameLbl.text = "停车费"
case 3:
cell.nameLbl.text = "搬运费"
case 5:
cell.nameLbl.text = "逾时等候费"
default:
break
}
cell.textTF.text = "¥" + String(format: "%.2f", (rowModel?.price_fen)!)
}
}
cell.nameLbl.textColor = UIColor.init(named: "灰色字体颜色")
cell.textTF.textColor = UIColor.init(named: "标题字颜色") cell.textTF.textColor = UIColor.init(named: "标题字颜色")
}else if indexPath.section == 5 { }else if indexPath.section == 5 {
...@@ -498,8 +438,16 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -498,8 +438,16 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
} }
if section == 3 { if section == 3 {
if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 { if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 {
var isUrl = false
dataModel?.order_detail_item?.bill_price_arr?.forEach({ (model) in
if model.img_url?.count != 0 {
isUrl = true
}
})
if isUrl {
return 10 return 10
}
return 0.01
} }
return 0.01 return 0.01
} }
...@@ -528,7 +476,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -528,7 +476,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
} }
if section == 4 { if section == 4 {
headerV.titleLbl.text = "订单费用" headerV.titleLbl.text = "订单费用"
headerV.fuTitleLbl.text = "总计¥" + String(format: "%.2f", (dataModel?.order_detail_item?.order_item?.price_fen)!) headerV.fuTitleLbl.text = "总计¥" + String(format: "%.2f", ((dataModel?.order_detail_item?.order_item?.price_fen!)!/100.0))
headerV.titleLbl.font = UIFont.boldSystemFont(ofSize: 15) headerV.titleLbl.font = UIFont.boldSystemFont(ofSize: 15)
headerV.fuTitleLbl.font = UIFont.boldSystemFont(ofSize: 15) headerV.fuTitleLbl.font = UIFont.boldSystemFont(ofSize: 15)
...@@ -549,8 +497,16 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -549,8 +497,16 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
} }
if section == 3 { if section == 3 {
if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 { if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 {
var isUrl = false
dataModel?.order_detail_item?.bill_price_arr?.forEach({ (model) in
if model.img_url?.count != 0 {
isUrl = true
}
})
if isUrl {
return 10 return 10
}
return 0.01
} }
return 0.01 return 0.01
} }
......
...@@ -16,6 +16,8 @@ class DriverItemTableViewCell: UITableViewCell { ...@@ -16,6 +16,8 @@ class DriverItemTableViewCell: UITableViewCell {
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
// Initialization code // Initialization code
self.selectionStyle = .none
} }
override func setSelected(_ selected: Bool, animated: Bool) { override func setSelected(_ selected: Bool, animated: Bool) {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<rect key="frame" x="0.0" y="0.0" width="377" height="142"/> <rect key="frame" x="0.0" y="0.0" width="377" height="142"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Wqp-PP-Pfx"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="driverIcon" translatesAutoresizingMaskIntoConstraints="NO" id="Wqp-PP-Pfx">
<rect key="frame" x="40" y="37" width="68" height="68"/> <rect key="frame" x="40" y="37" width="68" height="68"/>
<color key="backgroundColor" name="app底色"/> <color key="backgroundColor" name="app底色"/>
<constraints> <constraints>
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
</tableViewCell> </tableViewCell>
</objects> </objects>
<resources> <resources>
<image name="driverIcon" width="68" height="68"/>
<namedColor name="app底色"> <namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment