Commit bdb4a171 authored by lujunye's avatar lujunye

客户列表显示完善

parent 0a2117a9
......@@ -11,19 +11,25 @@ import UIKit
@objc optional func KeHuGuanLiCellEditClick(cell:KeHuGuanLiCell)
}
class KeHuGuanLiCell: UITableViewCell {
@IBOutlet weak var photoIcon: UIImageView!
@IBOutlet weak var nameLbl2: UILabel!
@IBOutlet weak var arrowImg: UIImageView!
var delegate:KeHuGuanLiCellDelegate?
@IBOutlet weak var iconImg: UIImageView!
@IBOutlet weak var compenyLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
@IBOutlet weak var btnWidth: NSLayoutConstraint!
@IBOutlet weak var statusLbl1: UILabel!
@IBOutlet weak var statusLbl2: UILabel!
@IBOutlet weak var statusLbl3: UILabel!
var phoneNum:String? = "phoneNum"
var phoneNum = ""
var cus_type:Int?
@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) {
delegate?.KeHuGuanLiCellEditClick?(cell: self)
......@@ -34,10 +40,20 @@ class KeHuGuanLiCell: UITableViewCell {
// 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) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
......
......@@ -303,6 +303,27 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
cell.compenyLbl.text = rowModel.company
cell.nameLbl.text = rowModel.cus_name
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
}
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