杨锴
2024-11-06 63f7ed967433acee3ae8764c7a077e15c29c41f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
//  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)
                }
}