Commit af37e017 authored by lujunye's avatar lujunye

提醒支付页面,调用setPaymentUI方法

parent cb951225
{
"images" : [
{
"filename" : "编组 4备份.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "编组 4备份@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "编组 4备份@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -204,6 +204,7 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -204,6 +204,7 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
arrStr.append((dataModel?.fc_flag_cn)!) arrStr.append((dataModel?.fc_flag_cn)!)
print("sadkf == ",arrStr[indexPath.row]) print("sadkf == ",arrStr[indexPath.row])
cell.contentLbl.text = arrStr[indexPath.row] cell.contentLbl.text = arrStr[indexPath.row]
cell.imgRight.constant = 0
// cell.textTF.isUserInteractionEnabled = false // cell.textTF.isUserInteractionEnabled = false
cell.btmLine.isHidden = true cell.btmLine.isHidden = true
return cell return cell
...@@ -224,6 +225,7 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -224,6 +225,7 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
cell.contentLbl.text = arrStr[indexPath.row] cell.contentLbl.text = arrStr[indexPath.row]
// cell.textTF.isUserInteractionEnabled = false // cell.textTF.isUserInteractionEnabled = false
cell.imgRight.constant = 0
cell.btmLine.isHidden = true cell.btmLine.isHidden = true
return cell return cell
} }
......
...@@ -8,11 +8,17 @@ ...@@ -8,11 +8,17 @@
import UIKit import UIKit
class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource{ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource{
//测试数据
var datas = [1,2,3]
@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)
...@@ -22,8 +28,12 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -22,8 +28,12 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
listView.register(UINib(nibName: "WayBillStautsTableViewCell", bundle: nil), forCellReuseIdentifier: "WayBillStautsTableViewCell") listView.register(UINib(nibName: "WayBillStautsTableViewCell", bundle: nil), forCellReuseIdentifier: "WayBillStautsTableViewCell")
listView.register(UINib(nibName: "BtmBtnCell", bundle: nil), forCellReuseIdentifier: "BtmBtnCell") listView.register(UINib(nibName: "BtmBtnCell", bundle: nil), forCellReuseIdentifier: "BtmBtnCell")
setPaymentUI(data:datas)
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView.tag == 99 {
return datas.count
}
if section == 0 || section == 1 || section == 6 { if section == 0 || section == 1 || section == 6 {
return 1 return 1
} }
...@@ -37,6 +47,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -37,6 +47,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
return 7; return 7;
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if tableView.tag == 99 {
return 25
}
if indexPath.section == 0 { if indexPath.section == 0 {
return 60 return 60
} }
...@@ -55,6 +68,20 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -55,6 +68,20 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
return UITableView.automaticDimension return UITableView.automaticDimension
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView.tag == 99 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell
cell.nameLbl.text = "\(datas[indexPath.row])"
cell.contentLbl.text = cell.nameLbl.text
//cellUI设置
cell.btmLine.isHidden = true
cell.imgRight.constant = 0
cell.nameLbl.textColor = UIColor(named: "多选按钮字体颜色")
cell.contentLbl.textColor = cell.nameLbl.textColor
return cell
}
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "WayBillStautsTableViewCell") as! WayBillStautsTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: "WayBillStautsTableViewCell") as! WayBillStautsTableViewCell
...@@ -234,5 +261,108 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -234,5 +261,108 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
return footerView return footerView
} }
//MARK: - 提醒支付订单费用
var cBtn:UIButton?
var pView:UIView?
func setPaymentUI(data:Array<Int>){
let h = 190 + Float(data.count * 25)
if cBtn == nil {
cBtn = UIButton(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: fullScreenHeight))
cBtn?.backgroundColor = UIColor.black
cBtn?.alpha = 0.4
cBtn?.addTarget(self, action: #selector(closeAc), for: .touchUpInside)
self.view.addSubview(cBtn!)
pView = UIView(frame: CGRect(x: 0, y: fullScreenHeight - CGFloat(h), width: fullScreenWidth, height: CGFloat(h)))
pView?.backgroundColor = UIColor.white
pView?.layer.cornerRadius = 5
pView?.layer.maskedCorners = [CACornerMask.layerMinXMinYCorner,CACornerMask.layerMaxXMinYCorner]
self.view.addSubview(pView!)
let titleBtn = UIButton(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49))
titleBtn.setImage(UIImage(named: "编组 4备份"), for: .normal)
titleBtn.setTitle(" 该订单已完成,请尽快支付~", for: .normal)
titleBtn.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
titleBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 15)
titleBtn.isUserInteractionEnabled = false
pView?.addSubview(titleBtn)
let line = UIButton(frame: CGRect(x: 0, y: 49, width: fullScreenWidth, height: 1))
line.backgroundColor = UIColor(named: "灰色分界线")
pView?.addSubview(line)
let titleLbl = UILabel(frame: CGRect(x: 15, y: line.frame.maxY+15, width: fullScreenWidth, height: 21))
titleLbl.text = "还需支付"
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.setTitle("立即支付\(count)元", for: .normal)
btmBtn.setTitleColor(UIColor.white, for: .normal)
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
listV.delegate = self
listV.dataSource = self
pView?.addSubview(listV)
listV.register(UINib(nibName: "TitleAndLblCell", bundle: nil), forCellReuseIdentifier: "TitleAndLblCell")
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 leftBtnTitle = UILabel(frame: CGRect(x: 15, y: listV.frame.maxY+8, width: fullScreenWidth, height: 15))
leftBtnTitle.text = "费用有疑问?"
leftBtnTitle.textColor = UIColor(named: "按钮渐变色上")
leftBtnTitle.font = UIFont.systemFont(ofSize: 13)
pView?.addSubview(leftBtnTitle)
let rightBtn = UIButton(frame: CGRect(x: fullScreenWidth * 0.7, y: listV.frame.maxY, width: fullScreenWidth * 0.3, height: 44))
rightBtn.tag = 1
rightBtn.addTarget(self, action: #selector(btnAc(sender:)), for: .touchUpInside)
pView?.addSubview(rightBtn)
let rightBtnTitle = UILabel(frame: CGRect(x: 0, y: leftBtnTitle.frame.minY, width: fullScreenWidth-15, height: 15))
rightBtnTitle.text = "费用明细"
rightBtnTitle.textColor = UIColor(named: "按钮渐变色上")
rightBtnTitle.font = UIFont.systemFont(ofSize: 13)
rightBtnTitle.textAlignment = .right
pView?.addSubview(rightBtnTitle)
}
cBtn?.isHidden = false
pView?.isHidden = false
}
@objc func btnAc(sender:UIButton){
if sender.tag == 0 {
print("left")
}else{
print("right")
}
}
@objc func payAc(){
print("payAc")
}
@objc func closeAc(){
cBtn?.isHidden = true
pView?.isHidden = true
}
} }
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