//
//  WA_RKPLCell.swift
//  wallpaper_project
//
//  Created by 忆海16 on 2024/3/17.
//

import UIKit
import SDWebImage


class WA_RKPLCell: UITableViewCell {
    @IBOutlet weak var headImagV: UIImageView!
    
    @IBOutlet weak var nameLabel: UILabel!
    
    @IBOutlet weak var countTextlabel: UILabel!
    
    
    @IBOutlet weak var timeLabel: UILabel!
    
    @IBOutlet weak var reportView: UIView!
    
    var reportBlcok:(()->())?
    var blackBLcok:(()->())?
    
    override func awakeFromNib() {
        super.awakeFromNib()
        headImagV.layer.cornerRadius = 5
        
        reportView.layer.cornerRadius = 10
        reportView.layer.borderWidth = 1
        reportView.layer.borderColor = UIColor.black.cgColor
    }
    
    var model: DataModel? {
          didSet {
              let imageUrl = URL(string: (model?.headImgv)!) // 替换为您的图片URL
              headImagV.sd_setImage(with: imageUrl, completed: nil)

                nameLabel.text = model!.name
                  timeLabel.text = "\(model!.time ?? "")"
              countTextlabel.text = model?.counttext
                  
              
              // 其他 UI 元素的赋值
          }
      }
    
    @IBAction func reporetBtn(_ sender: Any) {
        if self.reportBlcok != nil{
            self.reportBlcok!()
        }
        
    }
    
    
    @IBAction func blackBtn(_ sender: Any) {
        if self.blackBLcok != nil{
            self.blackBLcok!()
        }
    }
}
