Commit f0e9a186 authored by 刘俊宏's avatar 刘俊宏

运单详情完成对接

parent 50f58458
...@@ -10,6 +10,8 @@ import UIKit ...@@ -10,6 +10,8 @@ import UIKit
class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource{ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource{
var orderID:String?
var dataModel:logisticsOrderDetailsDataModel?
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
@IBOutlet weak var btmView: UIView! @IBOutlet weak var btmView: UIView!
...@@ -50,9 +52,26 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -50,9 +52,26 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
} }
} }
loadData()
} }
func loadData(){
let UserToken = UserDefaults.standard.value(forKey: "user_token")
HUD.flash(.progress)
listView.isHidden = true
logisticsOrderDetails(["user_token":UserToken as Any,"id":"238" as Any], success: { (data) in
HUD.hide()
let model = data as! logisticsOrderDetailsModel
self.dataModel = model.data
self.listView.isHidden = false
self.listView.reloadData()
}) { (error) in
}
}
@objc func btnClick(sender:UIButton){ @objc func btnClick(sender:UIButton){
print(sender.tag) print(sender.tag)
let vc = WuLiuGenZongViewController() let vc = WuLiuGenZongViewController()
...@@ -89,12 +108,19 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -89,12 +108,19 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
return UIView() return UIView()
} }
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 10 return 10
} }
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
if dataModel == nil {
return 0
}
return 2 return 2
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if dataModel == nil {
return 0
}
if section == 0 { if section == 0 {
return 7 return 7
} }
...@@ -120,19 +146,37 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -120,19 +146,37 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
switch indexPath.row { switch indexPath.row {
case 0: case 0:
let cell = tableView.dequeueReusableCell(withIdentifier: "JiBenXinXiCell") as! JiBenXinXiCell let cell = tableView.dequeueReusableCell(withIdentifier: "JiBenXinXiCell") as! JiBenXinXiCell
cell.orderStatusLbl.text = dataModel?.delivery_status_cn
cell.payStatusLbl.text = dataModel?.pay_status_cn
return cell return cell
case 1,2: case 1,2:
let cell = tableView.dequeueReusableCell(withIdentifier: "XiaDanCGDiZhiCell") as! XiaDanCGDiZhiCell let cell = tableView.dequeueReusableCell(withIdentifier: "XiaDanCGDiZhiCell") as! XiaDanCGDiZhiCell
cell.statusLbl.text = "寄" cell.statusLbl.text = "寄"
cell.namelbl.text = dataModel?.s_consignee
cell.phoneLbl.text = dataModel?.s_mobile
cell.adrLbl.text = dataModel?.s_address
if indexPath.row == 2 { if indexPath.row == 2 {
cell.statusLbl.backgroundColor = UIColor(named: "企业、预售字体") cell.statusLbl.backgroundColor = UIColor(named: "企业、预售字体")
cell.statusLbl.text = "收" cell.statusLbl.text = "收"
cell.namelbl.text = dataModel?.r_consignee
cell.phoneLbl.text = dataModel?.r_mobile
cell.adrLbl.text = dataModel?.r_address
} }
return cell return cell
default: default:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = p2Arr[indexPath.row] cell.nameLbl.text = p2Arr[indexPath.row]
cell.textTF.text = p2Arr[indexPath.row] var arrStr:[String] = []
arrStr.append("")
arrStr.append("")
arrStr.append("")
arrStr.append((dataModel?.sale_plat)!)
arrStr.append((dataModel?.order_sn)!)
arrStr.append(String(format: "%.2f", (dataModel?.freight_pre)!))
arrStr.append((dataModel?.fc_flag_cn)!)
cell.textTF.text = arrStr[indexPath.row]
cell.textTF.isUserInteractionEnabled = false cell.textTF.isUserInteractionEnabled = false
cell.line.isHidden = true cell.line.isHidden = true
return cell return cell
...@@ -140,7 +184,18 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -140,7 +184,18 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
} }
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = p3Arr[indexPath.row] cell.nameLbl.text = p3Arr[indexPath.row]
cell.textTF.text = p3Arr[indexPath.row] var arrStr:[String] = []
arrStr.append((dataModel?.express_item_name)!)
arrStr.append(String(format: "%.2f", (dataModel?.weight)!))
arrStr.append(StringByInt(number: (dataModel?.express_item_qty)!))
arrStr.append(String(format: "%.2f", (dataModel?.volume)!))
arrStr.append((dataModel?.tempture_num)!)
arrStr.append((dataModel?.home_delivery_on_cn)!)
arrStr.append((dataModel?.site_delivery_cn)!)
arrStr.append(String(format: "%.2f", (dataModel?.guarantee_value)!))
arrStr.append((dataModel?.remark)!)
cell.textTF.text = arrStr[indexPath.row]
cell.textTF.isUserInteractionEnabled = false cell.textTF.isUserInteractionEnabled = false
cell.line.isHidden = true cell.line.isHidden = true
return cell return cell
......
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