| | |
| | | btn_price.setTitle(price, for: .normal) |
| | | } |
| | | |
| | | label_hasNum.attributedText = AttributedStringbuilder.build().add(string: "包含课时数:", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#737373")).add(string: "\(detailCourseModel.classHours)课时", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#F11010")).mutableAttributedString |
| | | let num = detailCourseModel.classHours.map({"\($0)"}).joined(separator: "、").filter({$0 != "0"}) |
| | | stack_hasNum.isHidden = num.isEmpty |
| | | label_hasNum.attributedText = AttributedStringbuilder.build().add(string: "包含课时数:", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#737373")).add(string: "\(detailCourseModel.classHours.map({"\($0)"}).joined(separator: ","))课时", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#F11010")).mutableAttributedString |
| | | |
| | | stack_teachTime.isHidden = detailCourseModel.classStartTime?.isEmpty ?? true |
| | | } |
| | | } |
| | | |
| | |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var label_teachTime: UILabel! |
| | | @IBOutlet weak var label_hasNum: UILabel! |
| | | @IBOutlet weak var label_enrollNum: UILabel! |
| | | @IBOutlet weak var stack_teachTime: UIStackView! |
| | | @IBOutlet weak var stack_hasNum: UIStackView! |
| | | @IBOutlet weak var label_enrollNum: UILabel! |
| | | @IBOutlet weak var btn_price: UIButton! |
| | | |
| | | |