Commit bdb4a171 authored by lujunye's avatar lujunye

客户列表显示完善

parent 0a2117a9
...@@ -11,6 +11,9 @@ import UIKit ...@@ -11,6 +11,9 @@ import UIKit
@objc optional func KeHuGuanLiCellEditClick(cell:KeHuGuanLiCell) @objc optional func KeHuGuanLiCellEditClick(cell:KeHuGuanLiCell)
} }
class KeHuGuanLiCell: UITableViewCell { class KeHuGuanLiCell: UITableViewCell {
@IBOutlet weak var photoIcon: UIImageView!
@IBOutlet weak var nameLbl2: UILabel!
@IBOutlet weak var arrowImg: UIImageView!
var delegate:KeHuGuanLiCellDelegate? var delegate:KeHuGuanLiCellDelegate?
@IBOutlet weak var iconImg: UIImageView! @IBOutlet weak var iconImg: UIImageView!
@IBOutlet weak var compenyLbl: UILabel! @IBOutlet weak var compenyLbl: UILabel!
...@@ -21,9 +24,12 @@ class KeHuGuanLiCell: UITableViewCell { ...@@ -21,9 +24,12 @@ class KeHuGuanLiCell: UITableViewCell {
@IBOutlet weak var statusLbl1: UILabel! @IBOutlet weak var statusLbl1: UILabel!
@IBOutlet weak var statusLbl2: UILabel! @IBOutlet weak var statusLbl2: UILabel!
@IBOutlet weak var statusLbl3: UILabel! @IBOutlet weak var statusLbl3: UILabel!
var phoneNum:String? = "phoneNum" var phoneNum = ""
var cus_type:Int?
@IBAction func phoneCallAction(_ sender: Any) { @IBAction func phoneCallAction(_ sender: Any) {
print("打电话方法 拼接\(phoneNum)") if phoneNum.count > 0 {
UIApplication.shared.openURL(NSURL.init(string: "tel://\(phoneNum)")! as URL)
}
} }
@IBAction func editAction(_ sender: Any) { @IBAction func editAction(_ sender: Any) {
delegate?.KeHuGuanLiCellEditClick?(cell: self) delegate?.KeHuGuanLiCellEditClick?(cell: self)
...@@ -34,7 +40,17 @@ class KeHuGuanLiCell: UITableViewCell { ...@@ -34,7 +40,17 @@ class KeHuGuanLiCell: UITableViewCell {
// Initialization code // Initialization code
} }
override func layoutIfNeeded() {
super.layoutIfNeeded()
if cus_type == 1 {
statusLbl1.text = "个人"
statusLbl1.textColor = UIColor(named: "蓝色字体颜色")
}else{
statusLbl1.text = "企业"
statusLbl1.textColor = UIColor(named: "企业、预售字体")
}
statusLbl1.layer.borderColor = statusLbl1.textColor.cgColor
}
override func setSelected(_ selected: Bool, animated: Bool) { override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated) super.setSelected(selected, animated: animated)
......
...@@ -303,6 +303,27 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView ...@@ -303,6 +303,27 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
cell.compenyLbl.text = rowModel.company cell.compenyLbl.text = rowModel.company
cell.nameLbl.text = rowModel.cus_name cell.nameLbl.text = rowModel.cus_name
cell.delegate = self cell.delegate = self
cell.cus_type = rowModel.cus_type!
cell.statusLbl2.isHidden = true
if rowModel.discounts_rate != 0 && rowModel.discounts_rate != 100{
cell.statusLbl2.isHidden = false
cell.statusLbl2.text = "\(rowModel.discounts_rate!)折"
}
cell.arrowImg.isHidden = true
cell.nameLbl2.isHidden = true
if rowModel.phone != nil {
cell.photoIcon.isHidden = false
cell.phoneNum = rowModel.phone!
}else{
cell.photoIcon.isHidden = true
}
if rowModel.user_name != nil {
cell.nameLbl2.isHidden = false
cell.arrowImg.isHidden = false
cell.nameLbl2.text = rowModel.user_name!
}
return cell return cell
} }
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
......
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