//
|
// PaymentOrderResultTopView.swift
|
// XQMuse
|
//
|
// Created by 无故事王国 on 2024/8/15.
|
//
|
|
import UIKit
|
import JQTools
|
|
class PaymentOrderResultTopView: UIView,JQNibView{
|
|
@IBOutlet weak var label_price: UILabel!
|
@IBOutlet weak var btn_lookCourse: UIButton!
|
private var id:Int!
|
private var type:PaymentOrderVC.PaymentOrderType!
|
|
override func awakeFromNib() {
|
super.awakeFromNib()
|
}
|
|
func setPrice(type:PaymentOrderVC.PaymentOrderType,id:Int,price:Double){
|
self.id = id
|
self.type = type
|
|
label_price.attributedText = AttributedStringbuilder.build().add(string: "疗愈币", withFont: .systemFont(ofSize: 18, weight: .semibold), withColor: UIColor(hexStr: "#FF9000"))
|
.add(string: String(format: "%.2lf", price), withFont: UIFont(name: "DIN Alternate", size: 30)!, withColor: UIColor(hexStr: "#FF9000")).mutableAttributedString
|
|
switch type {
|
case .course:btn_lookCourse.setTitle("查看课程", for: .normal)
|
case .muse:btn_lookCourse.setTitle("查看疗愈", for: .normal)
|
}
|
}
|
|
@IBAction func backRootAction(_ sender: UIButton) {
|
JQ_currentNavigationController().popToRootViewController(animated: true)
|
}
|
|
@IBAction func lookCourseAction(_ sender: UIButton) {
|
|
if type == .course{
|
let vc = CourseDetialVC(courseId: id)
|
JQ_currentViewController().jq_push(vc: vc)
|
}
|
|
if type == .muse{
|
let vc = HomeItemDetailVC(id: id)
|
JQ_currentViewController().jq_push(vc: vc)
|
}
|
}
|
|
|
override func layoutSubviews() {
|
super.layoutSubviews()
|
btn_lookCourse.jq_gradientNibColor(colorArr: [UIColor(hexStr: "#8EA47A").cgColor,UIColor(hexStr: "#AFCA98").cgColor], cornerRadius: 20)
|
}
|
}
|