Commit 25b46362 authored by 刘俊宏's avatar 刘俊宏

调整运单详情

parent 8c5e21b4
...@@ -18,7 +18,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -18,7 +18,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
//测试数据 //测试数据
var isYDBc = false var isYDBc = false
var lwb_no = "" var lwb_no = ""
var datas = [1,2,3]
var dataModel:getHllOrderDetailsDataModel? = nil var dataModel:getHllOrderDetailsDataModel? = nil
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
override func viewDidLoad() { override func viewDidLoad() {
...@@ -44,8 +44,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -44,8 +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)
} }
@objc func loadData(){ @objc func loadData(){
indexNext = 0 indexNext = 0
...@@ -113,7 +112,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -113,7 +112,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
vc.lwbno = lwb_no vc.lwbno = lwb_no
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
}else if (bottomLbl.text?.contains("立即支付"))!{ }else if (bottomLbl.text?.contains("立即支付"))!{
setPaymentUI(data:datas) setPaymentUI(data:orderPriceArrName)
} }
} }
...@@ -135,7 +134,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -135,7 +134,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView.tag == 99 { if tableView.tag == 99 {
return datas.count return orderPriceArrName.count
} }
if dataModel == nil { if dataModel == nil {
return 0 return 0
...@@ -205,8 +204,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -205,8 +204,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
orderPriceArrName.append(rowModel.name!) orderPriceArrName.append(rowModel.name!)
orderPriceArrStr.append("¥" + String(format: "%.2f", (rowModel.price_fen!/100.0))) 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 {
...@@ -222,7 +220,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -222,7 +220,7 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if tableView.tag == 99 { if tableView.tag == 99 {
return 25 return 30
} }
if indexPath.section == 0 { if indexPath.section == 0 {
return 60 return 60
...@@ -262,9 +260,13 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -262,9 +260,13 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
if tableView.tag == 99 { if tableView.tag == 99 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell
cell.nameLbl.text = "\(datas[indexPath.row])" cell.nameLbl.text = "\(orderPriceArrName[indexPath.row])"
cell.contentLbl.text = cell.nameLbl.text cell.contentLbl.text = "\(orderPriceArrStr[indexPath.row])"
if orderPriceArrName[indexPath.row] == "额外费用" {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleHeaderCell") as! TitleHeaderCell
cell.nameLbl.text = orderPriceArrName[indexPath.row]
return cell
}
//cellUI设置 //cellUI设置
cell.btmLine.isHidden = true cell.btmLine.isHidden = true
cell.imgRight.constant = 0 cell.imgRight.constant = 0
...@@ -617,8 +619,8 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -617,8 +619,8 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
//MARK: - 提醒支付订单费用 //MARK: - 提醒支付订单费用
var cBtn:UIButton? var cBtn:UIButton?
var pView:UIView? var pView:UIView?
func setPaymentUI(data:Array<Int>){ func setPaymentUI(data:Array<Any>){
let h = 190 + Float(data.count * 25) let h = 49 + Float(data.count * 30) + 48 + Float(TabHeight)
if cBtn == nil { if cBtn == nil {
cBtn = UIButton(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: fullScreenHeight)) cBtn = UIButton(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: fullScreenHeight))
cBtn?.backgroundColor = UIColor.black cBtn?.backgroundColor = UIColor.black
...@@ -639,69 +641,53 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -639,69 +641,53 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
titleBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 15) titleBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 15)
titleBtn.isUserInteractionEnabled = false titleBtn.isUserInteractionEnabled = false
pView?.addSubview(titleBtn) pView?.addSubview(titleBtn)
let titiOutImgBtn = UIButton()
titiOutImgBtn.setImage( UIImage.init(named: "alterCodeOut"), for: .normal)
pView?.addSubview(titiOutImgBtn)
titiOutImgBtn.snp.makeConstraints { (make) in
make.right.equalTo(-15)
make.top.equalTo(15)
}
titiOutImgBtn.addTarget(self, action: #selector(closeAc), for: .touchUpInside)
let line = UIButton(frame: CGRect(x: 0, y: 49, width: fullScreenWidth, height: 1)) let line = UIButton(frame: CGRect(x: 0, y: 49, width: fullScreenWidth, height: 1))
line.backgroundColor = UIColor(named: "灰色分界线") line.backgroundColor = UIColor(named: "灰色分界线")
pView?.addSubview(line) pView?.addSubview(line)
let titleLbl = UILabel(frame: CGRect(x: 15, y: line.frame.maxY+15, width: fullScreenWidth, height: 21))
titleLbl.text = "需支付" let btmBtn = UIButton(frame: CGRect(x: 0, y: CGFloat(h)-CGFloat(TabHeight), width: fullScreenWidth, height: CGFloat(TabHeight)))
titleLbl.textColor = UIColor(named: "标题字颜色")
titleLbl.font = UIFont(name: "PingFangSC-Medium", size: 15)
pView?.addSubview(titleLbl)
let priceLbl = UILabel(frame: CGRect(x: 0, y: line.frame.maxY+15, width: fullScreenWidth - 15, height: 21))
var count = 0
for item in data {
count += item
}
priceLbl.text = \(count)"
priceLbl.textColor = UIColor(named: "标题字颜色")
priceLbl.textAlignment = .right
priceLbl.font = UIFont(name: "PingFangSC-Medium", size: 15)
pView?.addSubview(priceLbl)
let btmBtn = UIButton(frame: CGRect(x: 0, y: CGFloat(h)-47.5, width: fullScreenWidth, height: 47.5))
btmBtn.backgroundColor = UIColor(named: "按钮渐变色上") btmBtn.backgroundColor = UIColor(named: "按钮渐变色上")
btmBtn.setTitle("立即支付\(count)元", for: .normal) btmBtn.setTitle("确认支付" + String(format: "%.2f", ((self.dataModel?.order_detail_item?.order_item?.price_fen)!/100.0)) + "元", for: .normal)
btmBtn.setTitleColor(UIColor.white, for: .normal) btmBtn.setTitleColor(UIColor.white, for: .normal)
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: line.frame.maxY, width: fullScreenWidth, height: CGFloat(h) - CGFloat(TabHeight) - 49 - 48))
listV.tag = 99 listV.tag = 99
listV.separatorStyle = .none listV.separatorStyle = .none
listV.bounces = false
listV.delegate = self listV.delegate = self
listV.dataSource = self listV.dataSource = self
pView?.addSubview(listV) pView?.addSubview(listV)
listV.register(UINib(nibName: "TitleAndLblCell", bundle: nil), forCellReuseIdentifier: "TitleAndLblCell") listV.register(UINib(nibName: "TitleAndLblCell", bundle: nil), forCellReuseIdentifier: "TitleAndLblCell")
listV.register(UINib(nibName: "TitleHeaderCell", bundle: nil), forCellReuseIdentifier: "TitleHeaderCell")
let leftBtn = UIButton(frame: CGRect(x: 0, y: listV.frame.maxY, width: fullScreenWidth * 0.3, height: 44))
leftBtn.tag = 0
leftBtn.addTarget(self, action: #selector(btnAc(sender:)), for: .touchUpInside)
pView?.addSubview(leftBtn)
let tishiLbl = UILabel(frame: CGRect(x: 15, y: listV.frame.maxY+8, width: fullScreenWidth - 30, height: 40)) let tishiLbl = UILabel(frame: CGRect(x: 15, y: listV.frame.maxY+8, width: fullScreenWidth - 30, height: 40))
tishiLbl.text = "若产生消费、高速费、停车费、逾时等候费和搬运费,需要您额外支付。额外费用不可使用赠金支付" tishiLbl.text = "若产生消费、高速费、停车费、逾时等候费和搬运费,需要您额外支付。额外费用不可使用赠金支付"
tishiLbl.numberOfLines = 0 tishiLbl.numberOfLines = 0
tishiLbl.textColor = UIColor.init(named: "提示语字体颜色") tishiLbl.textColor = UIColor.init(named: "提示语字体颜色")
tishiLbl.font = UIFont.init(name: "PingFang SC", size: 11) tishiLbl.font = UIFont.init(name: "PingFang SC", size: 11)
pView?.addSubview(tishiLbl) pView?.addSubview(tishiLbl)
} }
cBtn?.isHidden = false cBtn?.isHidden = false
pView?.isHidden = false pView?.isHidden = false
} }
@objc func btnAc(sender:UIButton){
if sender.tag == 0 {
print("left")
}else{
print("right")
}
}
@objc func payAc(){ @objc func payAc(){
print("payAc") print("payAc")
} }
......
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