younger_times
2023-07-12 5a590aaf3fd9ed5f9cfd2d54e72c904ce4918e7f
WanPai/Root/Course/VC/CourseDetailVC.swift
@@ -49,28 +49,33 @@
            }
            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
                }
            }
@@ -103,7 +108,7 @@
    }
    @IBAction func applyAction(_ sender: UIButton) {
         let vc = CourseDetailApplyVC()
         let vc = CourseDetailApplyVC(detailModel: detailModel)
        push(vc: vc)
    }