| | |
| | | @IBOutlet weak var label_coin: UILabel! |
| | | @IBOutlet weak var cons_handleHei: NSLayoutConstraint! |
| | | @IBOutlet weak var btn_enroll: UIButton! |
| | | @IBOutlet weak var view_tag: UIView! |
| | | |
| | | private var id = 0 |
| | | |
| | |
| | | img_cover.sd_setImage(with: URL(string: m.coverDrawing)) |
| | | label_title.text = m.name |
| | | label_distance.text = String(format: "距离我%.2lfkm", m.distance) |
| | | label_local.text = m.storeAddress |
| | | label_listenWeek.text = m.weeks.joined(separator: "、") |
| | | label_local.text = String(format: "%@(%@)", m.storeName,m.storeAddress) |
| | | label_listenWeek.text = "每" + m.weeks.joined(separator: "、") |
| | | label_listenTime.text = m.times.joined(separator: "|") |
| | | label_vaildTime.text = m.time |
| | | 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)) |
| | |
| | | } |
| | | |
| | | //会员价 |
| | | if let vipPrice = subM.vipPrice{ |
| | | if subM.vipPrice != 0{ |
| | | let vipAttribute = AttributedStringbuilder.build() |
| | | .add(string: "会员价:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F")) |
| | | .add(string: vipPrice.currency(), withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")) |
| | | .add(string: subM.vipPrice.currency(), withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")) |
| | | label_vipPrice.attributedText = vipAttribute.mutableAttributedString |
| | | } |
| | | } |
| | |
| | | label_vipPrice.isHidden = true |
| | | label_vaildTime.text = "购买当天有效" |
| | | view_listen.isHidden = true |
| | | label_price.isHidden = (m.list.first?.paymentPrice ?? 0) == 0 |
| | | } |
| | | |
| | | //体验课,假期课不展示 |
| | |
| | | cons_handleHei.constant = 0 |
| | | } |
| | | |
| | | if let m = signUpCourseModel{ |
| | | label_originPrice.isHidden = true |
| | | // label_vipPrice.isHidden = true |
| | | |
| | | let coinAttribute = AttributedStringbuilder.build() |
| | | .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F")) |
| | | .add(string: "\(m.wpGold)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")) |
| | | label_coin.attributedText = coinAttribute.mutableAttributedString |
| | | label_price.text = m.paymentPrice.currency() |
| | | label_coin.alpha = m.wpGold == 0 ? 0:1 |
| | | } |
| | | // if let m = signUpCourseModel{ |
| | | // label_originPrice.isHidden = true |
| | | //// label_vipPrice.isHidden = true |
| | | // |
| | | // let coinAttribute = AttributedStringbuilder.build() |
| | | // .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F")) |
| | | // .add(string: "\(m.wpGold)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")) |
| | | // label_coin.attributedText = coinAttribute.mutableAttributedString |
| | | // label_price.text = m.paymentPrice.currency() |
| | | // label_coin.alpha = m.wpGold == 0 ? 0:1 |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | override func viewDidLayoutSubviews() { |
| | | super.viewDidLayoutSubviews() |
| | | let w = String.jq_getWidth(text: detailModel?.type.strTitle ?? "", height: 25, font: 14) + 16 |
| | | view_tag.jq_addCorners(corner: [.topLeft,.bottomLeft], radius: 4, width: w, height: 25) |
| | | } |
| | | |
| | | @IBAction func applyAction(_ sender: UIButton) { |