BBSForumCell.swift 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // BBSForumCell.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2016/11/3.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class BBSForumCell: UICollectionViewCell {
  10. @IBOutlet weak var bbsSectionTitleLabel: UILabel!
  11. @IBOutlet weak var bbsSectionIconImageView: UIImageView!
  12. @IBOutlet weak var timeLabel: UILabel!
  13. @IBOutlet weak var numberLabel: UILabel!
  14. var bbsSectionData:BBSectionListData? {
  15. didSet {
  16. self.bbsSectionTitleLabel.text = bbsSectionData?.sectionName
  17. if bbsSectionData?.icon != nil {
  18. self.bbsSectionIconImageView.image = UIImage.sd_image(with: Data(base64Encoded: (bbsSectionData?.icon)!, options:NSData.Base64DecodingOptions.ignoreUnknownCharacters))
  19. }else {
  20. self.bbsSectionIconImageView.image = UIImage(named: "icon_forum_default")
  21. }
  22. let time = self.bbsSectionData?.updateTime?.subString(from: 5, to: 10)
  23. self.timeLabel.text = "\(time ?? "")"
  24. self.numberLabel.text = "\(self.bbsSectionData?.subjectTotal ?? 0)个"
  25. }
  26. }
  27. }