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

同上

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