Commit 9965a230 authored by 刘俊宏's avatar 刘俊宏

同上

parent b5c4c742
...@@ -23,7 +23,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -23,7 +23,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
navbar.title = "运单详情" navbar.title = "运单详情"
self.view.addSubview(navbar) self.view.addSubview(navbar)
SetTopFrameView(view: listView, btmView: self.view) SetTopFrameView(view: listView, btmView: self.view)
...@@ -35,8 +35,8 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -35,8 +35,8 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
listView.register(UINib(nibName: "TitleHeaderCell", bundle: nil), forCellReuseIdentifier: "TitleHeaderCell") listView.register(UINib(nibName: "TitleHeaderCell", bundle: nil), forCellReuseIdentifier: "TitleHeaderCell")
listView.register(UINib(nibName: "TitleAndLblCell", bundle: nil), forCellReuseIdentifier: "TitleAndLblCell") listView.register(UINib(nibName: "TitleAndLblCell", bundle: nil), forCellReuseIdentifier: "TitleAndLblCell")
listView.register(UINib(nibName: "LalamoveBillTableViewCell", bundle: nil), forCellReuseIdentifier: "LalamoveBillTableViewCell") listView.register(UINib(nibName: "LalamoveBillTableViewCell", bundle: nil), forCellReuseIdentifier: "LalamoveBillTableViewCell")
// setPaymentUI(data:datas) // setPaymentUI(data:datas)
loadData() loadData()
if !isYDBc { if !isYDBc {
NotificationCenter.default.addObserver(self, selector: #selector(loadData), name: NSNotification.Name(rawValue: "HuolalaOrderChange"), object: nil) NotificationCenter.default.addObserver(self, selector: #selector(loadData), name: NSNotification.Name(rawValue: "HuolalaOrderChange"), object: nil)
...@@ -45,42 +45,45 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -45,42 +45,45 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
bottomLheight.constant = 0 bottomLheight.constant = 0
bottomLbl.isHidden = true bottomLbl.isHidden = true
bottomBtn.isHidden = true bottomBtn.isHidden = true
} }
@objc func loadData(){ @objc func loadData(){
HUD.flash(.progress) HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
getHllOrderDetails(["user_token":UserToken as Any,"lwb_no":lwb_no as Any], success: { (data) in getHllOrderDetails(["user_token":UserToken as Any,"lwb_no":lwb_no as Any], success: { (data) in
HUD.hide() HUD.hide()
let model = data as! getHllOrderDetailsModel let model = data as! getHllOrderDetailsModel
self.dataModel = model.data! self.dataModel = model.data!
switch self.dataModel?.order_detail_item?.order_item?.order_status { if !isYDBc {
case 0: switch self.dataModel?.order_detail_item?.order_item?.order_status {
print("等待司机接单") case 0:
self.bottomLheight.constant = 49 print("等待司机接单")
self.bottomLbl.isHidden = false self.bottomLheight.constant = 49
self.bottomBtn.isHidden = false self.bottomLbl.isHidden = false
case 1: self.bottomBtn.isHidden = false
print("待装货") case 1:
self.bottomLheight.constant = 49 print("待装货")
self.bottomLbl.isHidden = false self.bottomLheight.constant = 49
self.bottomBtn.isHidden = false self.bottomLbl.isHidden = false
case 15: self.bottomBtn.isHidden = false
print("待装中") case 15:
case 7: print("待装中")
print("运输中") case 7:
case 2: print("运输中")
print("已完成") case 2:
self.bottomLheight.constant = 49 print("已完成")
self.bottomLbl.isHidden = false self.bottomLheight.constant = 49
self.bottomBtn.isHidden = false self.bottomLbl.isHidden = false
self.bottomLbl.text = "立即支付51.2元" self.bottomBtn.isHidden = false
case 3,4,5: self.bottomLbl.text = "立即支付51.2元"
print("已取消") case 3,4,5:
default: print("已取消")
break default:
break
}
} }
self.listView.reloadData() self.listView.reloadData()
}) { (error) in }) { (error) in
HUD.hide() HUD.hide()
...@@ -169,7 +172,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -169,7 +172,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
if indexPath.section == 6{ if indexPath.section == 6{
if indexPath.row == 1 { if indexPath.row == 1 {
return UITableView.automaticDimension return UITableView.automaticDimension
} }
return 35 return 35
} }
...@@ -177,7 +180,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -177,7 +180,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
if indexPath.section == 7 { if indexPath.section == 7 {
return 108 return 108
} }
return UITableView.automaticDimension return UITableView.automaticDimension
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
...@@ -220,7 +223,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -220,7 +223,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
default: default:
break break
} }
return cell return cell
} }
if indexPath.section == 1 { if indexPath.section == 1 {
...@@ -235,29 +238,29 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -235,29 +238,29 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
} }
if indexPath.section == 3 { if indexPath.section == 3 {
let cell = tableView.dequeueReusableCell(withIdentifier: "LalamoveBillTableViewCell") as! LalamoveBillTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: "LalamoveBillTableViewCell") as! LalamoveBillTableViewCell
return cell return cell
} }
if indexPath.section == 4 || indexPath.section == 5 || indexPath.section == 6{ if indexPath.section == 4 || indexPath.section == 5 || indexPath.section == 6{
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isUserInteractionEnabled = false cell.textTF.isUserInteractionEnabled = false
cell.line.isHidden = true cell.line.isHidden = true
if indexPath.section == 4 { if indexPath.section == 4 {
if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 { if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 {
if indexPath.row == (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! { if indexPath.row == (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleHeaderCell") as! TitleHeaderCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleHeaderCell") as! TitleHeaderCell
return cell return cell
} }
} }
if indexPath.row < (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! { if indexPath.row < (dataModel?.order_detail_item?.order_item?.order_price_arr?.count)! {
let rowModel = dataModel?.order_detail_item?.order_item?.order_price_arr![indexPath.row] let rowModel = dataModel?.order_detail_item?.order_item?.order_price_arr![indexPath.row]
cell.nameLbl.text = "" cell.nameLbl.text = ""
switch rowModel?.type { switch rowModel?.type {
case 1: case 1:
cell.nameLbl.text = "起步价" + "(" + (dataModel?.order_detail_item?.order_item?.vehicle_type_name)! + ")" cell.nameLbl.text = "起步价" + "(" + (dataModel?.order_detail_item?.order_item?.vehicle_type_name)! + ")"
...@@ -298,7 +301,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -298,7 +301,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
let rowModel = dataModel?.order_detail_item?.bill_price_arr![(indexPath.row - (dataModel?.order_detail_item?.order_item?.order_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)!) - 1]
cell.nameLbl.text = "" cell.nameLbl.text = ""
switch rowModel?.bill_type { switch rowModel?.bill_type {
case 1: case 1:
cell.nameLbl.text = "过桥费" cell.nameLbl.text = "过桥费"
...@@ -312,12 +315,12 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -312,12 +315,12 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
break break
} }
cell.textTF.text = "¥" + String(format: "%.2f", (rowModel?.price_fen)!) cell.textTF.text = "¥" + String(format: "%.2f", (rowModel?.price_fen)!)
} }
cell.nameLbl.textColor = UIColor.init(named: "灰色字体颜色") 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 {
cell.textTF.text = "-" cell.textTF.text = "-"
cell.nameLbl.text = "关联平台:" cell.nameLbl.text = "关联平台:"
...@@ -325,25 +328,25 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -325,25 +328,25 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
cell.textTF.text = dataModel?.delivery?.sale_plat cell.textTF.text = dataModel?.delivery?.sale_plat
if dataModel?.delivery?.sale_plat?.count == 0 { if dataModel?.delivery?.sale_plat?.count == 0 {
cell.textTF.text = "-" cell.textTF.text = "-"
} }
} }
if indexPath.row == 1 { if indexPath.row == 1 {
cell.nameLbl.text = "关联订单号:" cell.nameLbl.text = "关联订单号:"
if dataModel?.delivery?.order_sn != nil { if dataModel?.delivery?.order_sn != nil {
cell.textTF.text = dataModel?.delivery?.order_sn cell.textTF.text = dataModel?.delivery?.order_sn
if dataModel?.delivery?.order_sn?.count == 0 { if dataModel?.delivery?.order_sn?.count == 0 {
cell.textTF.text = "-" cell.textTF.text = "-"
} }
} }
} }
cell.nameLbl.textColor = UIColor.init(named: "标题字颜色") cell.nameLbl.textColor = UIColor.init(named: "标题字颜色")
cell.textTF.textColor = UIColor.init(named: "标题字颜色") cell.textTF.textColor = UIColor.init(named: "标题字颜色")
}else if indexPath.section == 6 { }else if indexPath.section == 6 {
cell.nameLbl.textColor = UIColor.init(named: "标题字颜色") cell.nameLbl.textColor = UIColor.init(named: "标题字颜色")
cell.textTF.textColor = UIColor.init(named: "灰色字体颜色") cell.textTF.textColor = UIColor.init(named: "灰色字体颜色")
...@@ -377,7 +380,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -377,7 +380,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
cell.iconH.constant = 22 cell.iconH.constant = 22
cell.iconLbl.layer.cornerRadius = 11 cell.iconLbl.layer.cornerRadius = 11
cell.lineTopView.isHidden = false cell.lineTopView.isHidden = false
let rowModel = dataModel?.order_detail_item?.order_item?.addr_info_arr![indexPath.row] let rowModel = dataModel?.order_detail_item?.order_item?.addr_info_arr![indexPath.row]
cell.addressDetailLbl.text = (rowModel?.addr)! + (rowModel?.house_number)! cell.addressDetailLbl.text = (rowModel?.addr)! + (rowModel?.house_number)!
cell.namePhoneLbl.text = (rowModel?.contact_name)! + " " + (rowModel?.contact_phone_no)! cell.namePhoneLbl.text = (rowModel?.contact_name)! + " " + (rowModel?.contact_phone_no)!
...@@ -398,7 +401,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -398,7 +401,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
} }
} }
if indexPath.row == ((dataModel?.order_detail_item?.order_item?.addr_info_arr!.count)! - 1){ if indexPath.row == ((dataModel?.order_detail_item?.order_item?.addr_info_arr!.count)! - 1){
//最后的不显示lineview //最后的不显示lineview
cell.lineView.isHidden = true cell.lineView.isHidden = true
...@@ -407,7 +410,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -407,7 +410,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
}else{ }else{
cell.lineView.isHidden = false cell.lineView.isHidden = false
} }
return cell return cell
} }
...@@ -421,14 +424,14 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -421,14 +424,14 @@ 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 {
return 10 return 10
} }
return 0.01 return 0.01
} }
if section == 5 || section == 6{ if section == 5 || section == 6{
return 10 return 10
} }
return 0.01 return 0.01
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
...@@ -437,7 +440,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -437,7 +440,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
subV.removeFromSuperview() subV.removeFromSuperview()
} }
headerView.backgroundColor = UIColor.white headerView.backgroundColor = UIColor.white
if section == 2 || section == 4 { if section == 2 || section == 4 {
let headerV = TitleTimeHeaderFooterView() let headerV = TitleTimeHeaderFooterView()
headerView.addSubview(headerV) headerView.addSubview(headerV)
...@@ -453,7 +456,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -453,7 +456,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
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)!)
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)
} }
} }
...@@ -472,7 +475,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -472,7 +475,7 @@ 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 {
return 10 return 10
} }
return 0.01 return 0.01
} }
...@@ -488,7 +491,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -488,7 +491,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
subV.removeFromSuperview() subV.removeFromSuperview()
} }
footerView.backgroundColor = UIColor.white footerView.backgroundColor = UIColor.white
let lineView = UIView() let lineView = UIView()
lineView.backgroundColor = UIColor.init(named: "灰色分界线") lineView.backgroundColor = UIColor.init(named: "灰色分界线")
if section == 2 { if section == 2 {
...@@ -527,7 +530,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -527,7 +530,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
break break
} }
} }
footerView.addSubview(lineView) footerView.addSubview(lineView)
lineView.snp.makeConstraints { (make) in lineView.snp.makeConstraints { (make) in
make.left.bottom.right.equalTo(0) make.left.bottom.right.equalTo(0)
...@@ -547,7 +550,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -547,7 +550,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
make.right.equalTo(-20) make.right.equalTo(-20)
} }
tishiLbl.backgroundColor = UIColor.white tishiLbl.backgroundColor = UIColor.white
footerView.addSubview(lineView) footerView.addSubview(lineView)
lineView.snp.makeConstraints { (make) in lineView.snp.makeConstraints { (make) in
make.left.bottom.right.equalTo(0) make.left.bottom.right.equalTo(0)
...@@ -618,7 +621,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -618,7 +621,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
btmBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 15) btmBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 15)
btmBtn.addTarget(self, action: #selector(payAc), for: .touchUpInside) btmBtn.addTarget(self, action: #selector(payAc), for: .touchUpInside)
pView?.addSubview(btmBtn) pView?.addSubview(btmBtn)
let listV = UITableView(frame: CGRect(x: 0, y: priceLbl.frame.maxY + 8, width: fullScreenWidth, height: CGFloat(h) - 190)) let listV = UITableView(frame: CGRect(x: 0, y: priceLbl.frame.maxY + 8, width: fullScreenWidth, height: CGFloat(h) - 190))
listV.tag = 99 listV.tag = 99
listV.separatorStyle = .none listV.separatorStyle = .none
......
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