OOMeetingPersonTableViewCell.swift 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // OOMeetingPersonTableViewCell.swift
  3. // o2app
  4. //
  5. // Created by 刘振兴 on 2018/1/31.
  6. // Copyright © 2018年 zone. All rights reserved.
  7. //
  8. import UIKit
  9. class OOMeetingPersonTableViewCell: UITableViewCell,Configurable {
  10. @IBOutlet weak var iconImageView: UIImageView!
  11. @IBOutlet weak var nameLabel: UILabel!
  12. @IBOutlet weak var mobileLabel: UILabel!
  13. @IBOutlet weak var deptLabel: UILabel!
  14. @IBOutlet weak var activityContainerView: UIVisualEffectView!
  15. var viewModel:OOMeetingCreateViewModel?
  16. override func awakeFromNib() {
  17. super.awakeFromNib()
  18. self.iconImageView.layer.cornerRadius = 20
  19. self.iconImageView.layer.masksToBounds = true
  20. }
  21. override func setSelected(_ selected: Bool, animated: Bool) {
  22. super.setSelected(selected, animated: animated)
  23. // Configure the view for the selected state
  24. }
  25. func config(withItem item: Any?) {
  26. guard let p = item as? OOPersonModel else {
  27. return
  28. }
  29. nameLabel.text = p.name
  30. mobileLabel.text = p.mobile ?? "未填写手机号"
  31. viewModel?.getIconOfPerson(p, compeletionBlock: { (iconImage, errMSg) in
  32. self.activityContainerView.alpha = 0
  33. if let errMSG = errMSg {
  34. if p.genderType == "f" {
  35. self.iconImageView.image = #imageLiteral(resourceName: "icon_men")
  36. }else if p.genderType == "m"{
  37. self.iconImageView.image = #imageLiteral(resourceName: "icon_women")
  38. }else {
  39. self.iconImageView.image = iconImage
  40. }
  41. print(errMSG)
  42. }else{
  43. self.iconImageView.image = iconImage
  44. }
  45. })
  46. }
  47. }