| | |
| | | } |
| | | |
| | | label_price.text = detailModel.list.first!.paymentPrice.currency() |
| | | |
| | | |
| | | if let subM = detailModel.list.first { |
| | | label_originPrice.isHidden = subM.originalPrice == 0 |
| | | label_coin.isHidden = subM.playPaiCoin == 0 |
| | | label_vipPrice.isHidden = subM.vipPrice == 0 |
| | | label_originPrice.isHidden = subM.originalPrice == nil |
| | | label_coin.isHidden = subM.playPaiCoin == nil |
| | | label_vipPrice.isHidden = subM.vipPrice == nil |
| | | |
| | | //原价 |
| | | let attribute = AttributedStringbuilder.build().add(string: subM.originalPrice.currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).underLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)) |
| | | if let originPrice = subM.originalPrice{ |
| | | let attribute = AttributedStringbuilder.build().add(string: originPrice.currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).underLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)) |
| | | label_originPrice.attributedText = attribute.mutableAttributedString |
| | | } |
| | | |
| | | |
| | | //玩湃币 |
| | | if let paiCoin = subM.playPaiCoin{ |
| | | let coinAttribute = AttributedStringbuilder.build() |
| | | .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F")) |
| | | .add(string: "\(subM.playPaiCoin)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")) |
| | | .add(string: "\(paiCoin)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")) |
| | | label_coin.attributedText = coinAttribute.mutableAttributedString |
| | | } |
| | | |
| | | //会员价 |
| | | if let vipPrice = subM.vipPrice{ |
| | | let vipAttribute = AttributedStringbuilder.build() |
| | | .add(string: "会员价:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F")) |
| | | .add(string: subM.vipPrice.currency(), withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")) |
| | | .add(string: vipPrice.currency(), withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")) |
| | | label_vipPrice.attributedText = vipAttribute.mutableAttributedString |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func applyAction(_ sender: UIButton) { |
| | | let vc = CourseDetailApplyVC() |
| | | let vc = CourseDetailApplyVC(detailModel: detailModel) |
| | | push(vc: vc) |
| | | } |
| | | |