无故事王国
2023-11-13 a64b39beb6ba6ed8208d70daef2ff8872bdf265a
WanPai/Root/Course/VC/CourseDetailVC.swift
@@ -49,7 +49,6 @@
            label_courseType.text = m.type.strTitle
            label_courseType.isHidden = m.type == .none
            view_vaildTime.isHidden = m.type == .normal
//            label_price.isHidden = (m.list.first?.paymentPrice ?? 0) == 0
            let w = String.jq_getWidth(text: m.type.strTitle, height: 25, font: 14)
            label_courseType.jq_cornerPartWithNib(byRoundingCorners: [.topLeft,.bottomLeft], radii: 8, size: CGSize(width: w, height: 25))
@@ -83,8 +82,11 @@
                  case .cash:
                     label_coin.isHidden = true;fallthrough
                  case .cashCoin:
                     if subM.originalPrice == 0{label_originPrice.isHidden = true}
                     label_originPrice.isHidden = (subM.paymentPrice == subM.originalPrice && subM.paymentPrice != 0 && subM.originalPrice != 0)
                     if subM.originalPrice == 0 || subM.originalPrice == subM.paymentPrice{
                        label_originPrice.isHidden = true
                     }else{
                        label_originPrice.isHidden = false
                     }
                        //玩湃币
                     label_coin.attributedText = AttributedStringbuilder.build()
                        .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
@@ -97,10 +99,16 @@
                     if UserInfoModel.get()?.isVip == 1{
                           //会员
                        label_vipPrice.isHidden = true
                        //优惠价比会员价更优惠
                        if subM.paymentPrice < subM.vipPrice && subM.paymentPrice != 0{
                           label_price.text = subM.paymentPrice.currency()
                        }else if subM.vipPrice < subM.paymentPrice && subM.vipPrice != 0{
                        }
                        //会员价比优惠价更优惠
                        else if subM.vipPrice < subM.paymentPrice && subM.vipPrice != 0{
                           label_price.text = subM.vipPrice.currency()
                        }else if subM.vipPrice != 0 && subM.paymentPrice != 0{
                           //会员价和优惠价一样
                           label_price.text = min(subM.vipPrice,subM.paymentPrice).currency()
                        }else{
                           label_price.text = subM.paymentPrice.currency()
                        }
@@ -117,8 +125,10 @@
                           label_price.text = subM.originalPrice.currency()
                        }else if subM.originalPrice == 0 && subM.paymentPrice != 0{
                           label_price.text = subM.paymentPrice.currency()
                        }else{
                        }else if subM.originalPrice != 0 && subM.paymentPrice != 0{
                           label_price.text = min(subM.originalPrice,subM.paymentPrice).currency()
                        }else{
                           label_price.text = subM.originalPrice.currency()
                        }
                     }
               }
@@ -127,9 +137,8 @@
            if m.type == .experience{
               label_price.text = (m.list.first?.paymentPrice ?? 0).currency()
               label_vaildTime.text = "购买当天有效"
               label_originPrice.alpha = 0
               label_vipPrice.alpha = 0
               view_listen.alpha = 0
               label_originPrice.isHidden = true
               label_vipPrice.isHidden = true
               view_listen.isHidden = true
               label_price.isHidden = (m.list.first?.paymentPrice ?? 0) == 0
            }
@@ -139,6 +148,10 @@
               view_handle.isHidden = true
               cons_handleHei.constant = 0
            }
            if label_originPrice.isHidden && label_vipPrice.isHidden && label_coin.isHidden{
               label_coin.alpha = 0
            }
         }
        }
    }