| | |
| | | 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)) |
| | |
| | | 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")) |
| | |
| | | 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() |
| | | } |
| | |
| | | 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() |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 |
| | | } |
| | |
| | | view_handle.isHidden = true |
| | | cons_handleHei.constant = 0 |
| | | } |
| | | |
| | | if label_originPrice.isHidden && label_vipPrice.isHidden && label_coin.isHidden{ |
| | | label_coin.alpha = 0 |
| | | } |
| | | } |
| | | } |
| | | } |