| | |
| | | label_distance.text = String(format: "%.2lfkm", courseItemModel.distance) |
| | | stack_teachTime.isHidden = courseItemModel.classStartTime.count == 0 |
| | | |
| | | if courseItemModel.payType == .coin || (courseItemModel.originalPrice == 0 && courseItemModel.paymentPrice == 0 && courseItemModel.vipPrice == 0){ |
| | | label_price.text = "玩湃币 " + "\(courseItemModel.playPaiCoin)" |
| | | stackView_vipPrice.isHidden = true |
| | | label_originPrice.isHidden = true |
| | | }else{ |
| | | if UserInfoModel.get()?.isVip == 1{ |
| | | |
| | | |
| | | switch courseItemModel.payType { |
| | | case .cash,.cashCoin: |
| | | //显示原价 |
| | | label_originPrice.isHidden = courseItemModel.originalPrice == 0 |
| | | label_originPrice.attributedText = AttributedStringbuilder.build().add(string: courseItemModel.originalPrice.currency() , withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#C6C6C6")).delLine(color: UIColor(hexStr: "#C6C6C6")).mutableAttributedString |
| | | |
| | | if UserInfoModel.get()?.isVip == 1{ |
| | | //持续隐藏 |
| | | stackView_vipPrice.isHidden = true |
| | | //默认展示VIP价格【会员】 |
| | | label_price.text = courseItemModel.vipPrice.currency() |
| | | |
| | | if courseItemModel.paymentPrice == 0 && courseItemModel.vipPrice != 0{ |
| | | label_price.text = courseItemModel.vipPrice.currency() |
| | | }else if courseItemModel.paymentPrice != 0 && courseItemModel.vipPrice == 0{ |
| | | label_price.text = courseItemModel.paymentPrice.currency() |
| | | }else{ |
| | | label_price.text = min(courseItemModel.paymentPrice, courseItemModel.vipPrice).currency() |
| | | } |
| | | }else{ |
| | | label_vipPrice.text = courseItemModel.vipPrice.currency() |
| | | stackView_vipPrice.isHidden = courseItemModel.vipPrice == 0 || courseItemModel.vipPrice == courseItemModel.paymentPrice |
| | | |
| | | if courseItemModel.paymentPrice == 0 && courseItemModel.originalPrice != 0{ |
| | | label_price.text = courseItemModel.vipPrice.currency() |
| | | }else if courseItemModel.paymentPrice != 0 && courseItemModel.originalPrice == 0{ |
| | | label_price.text = courseItemModel.paymentPrice.currency() |
| | | }else{ |
| | | label_price.text = min(courseItemModel.paymentPrice, courseItemModel.originalPrice).currency() |
| | | } |
| | | } |
| | | case .coin: |
| | | stackView_vipPrice.isHidden = true |
| | | label_price.text = courseItemModel.vipPrice.currency() |
| | | |
| | | label_originPrice.attributedText = AttributedStringbuilder.build().add(string: courseItemModel.paymentPrice.currency() , withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#C6C6C6")).delLine(color: UIColor(hexStr: "#C6C6C6")).mutableAttributedString |
| | | label_originPrice.isHidden = courseItemModel.paymentPrice == 0 |
| | | }else{ |
| | | stackView_vipPrice.isHidden = courseItemModel.vipPrice == 0 || (courseItemModel.paymentPrice == courseItemModel.vipPrice) |
| | | label_price.text = courseItemModel.paymentPrice.currency() |
| | | |
| | | label_vipPrice.text = "会员价:\(courseItemModel.vipPrice.currency())" |
| | | |
| | | label_originPrice.attributedText = AttributedStringbuilder.build().add(string: courseItemModel.paymentPrice.currency(), withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#C6C6C6")).delLine(color: UIColor(hexStr: "#C6C6C6")).mutableAttributedString |
| | | |
| | | //容错:原价 == 支付价 | 原价 == 0 -> 原价隐藏 |
| | | label_originPrice.isHidden = courseItemModel.originalPrice == 0 || courseItemModel.paymentPrice <= courseItemModel.originalPrice |
| | | } |
| | | label_originPrice.isHidden = true |
| | | label_price.text = "玩湃币 " + "\(courseItemModel.playPaiCoin)" |
| | | } |
| | | } |
| | | } |