// // AddEvaluateCell.swift // ADHTuanCan // // Created by 敖德亨 on 2023/11/10. // import UIKit class AddEvaluateCell: UITableViewCell { @IBOutlet weak var foodImg: UIImageView! @IBOutlet weak var foodName: UILabel! @IBOutlet weak var addBtnView: UIView! @IBOutlet weak var contentTV: UITextView! /// 星星按钮数组 @IBOutlet var starBtnList: [UIButton]! @IBOutlet var deleteBtnList: [UIButton]! /// 添加图片Viewlist @IBOutlet var addImgViewList: [UIView]! @IBOutlet var foodImgIList: [UIImageView]! var dataModel : NeedEvaluateListModel? var reloadBlock : (()->Void)? var addImgBlock : (()->Void)? override func awakeFromNib() { super.awakeFromNib() self.contentTV.inputText(maxLength: 300) { self.dataModel?.comment = self.contentTV.text } for i in 0.. 5{ score = 5 } for i in 0.. 3{ self.addBtnView.isHidden = true }else{ self.addBtnView.isHidden = false } //设置数组不超过4个 var ListCount = model.links!.count if ListCount > 3{ ListCount = 3 } for i in 0.. @IBAction func addImgAction(_ sender: UIButton) { if self.addImgBlock != nil{ self.addImgBlock!() } } @objc func deleteImgAction(sender : UIButton) { self.dataModel?.links?.remove(at: sender.tag - 100) if self.reloadBlock != nil{ self.reloadBlock!() } } @objc func scoreAction(sender : UIButton){ self.dataModel?.score = "\(sender.tag - 1000 + 1)" if self.reloadBlock != nil{ self.reloadBlock!() } } }