杨锴
2025-04-16 09a372bc45fde16fd42257ab6f78b8deeecf720b
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
//  PlanGuidePromptView.swift
//  XQMuse
//
//  Created by 无故事王国 on 2024/8/30.
//
 
import UIKit
import JQTools
 
class PlanGuidePromptView: UIView,JQNibView{
                @IBOutlet weak var label_title: UILabel!
                @IBOutlet weak var label_content: UILabel!
                @IBOutlet weak var label_info: UILabel!
                @IBOutlet weak var btn_handle1: UIButton!
                @IBOutlet weak var btn_handle2: UIButton!
                @IBOutlet weak var view_content: UIView!
 
                private var clouse:((PlanGuideType)->Void)?
 
                enum PlanGuideType {
                                case seeOther
                                case toSeting
                }
 
                override func awakeFromNib() {
                                super.awakeFromNib()
 
                                view_content.transform = .init(scaleX: 0.1, y: 0.1)
                                alpha = 0
 
                                label_title.font = Def_FlyFlowerSong(fontSize: 30)
 
                                label_content.attributedText = AttributedStringbuilder.build().add(string: "您的专属冥想空间。请选择您喜欢的背景音乐,您喜欢的背景颜色,可伴随进入冥想空间的第一时间呈现在您的面前。", withFont: Def_SourceHanSerifCN_Light(fontSize: 15), withColor: UIColor(hexStr: "#3E3E3E"), lineSpace: 8).mutableAttributedString
 
                                label_info.attributedText = AttributedStringbuilder.build().add(string: "(可以选择并跟随心境调整)", withFont: Def_SourceHanSerifCN_Light(fontSize: 14), withColor: UIColor(hexStr: "#3E3E3E"), lineSpace: 8).mutableAttributedString
 
                                btn_handle1.titleLabel?.font = Def_SourceHanSerif_Semibold(fontSize: 14)
 
                                btn_handle2.titleLabel?.font = Def_SourceHanSerif_Semibold(fontSize: 14)
 
                                layoutIfNeeded()
 
                }
 
                static func show(_ clouse:@escaping (PlanGuideType)->Void){
                                let planGuidePromptView = PlanGuidePromptView.jq_loadNibView()
                                sceneDelegate?.window?.addSubview(planGuidePromptView)
                                planGuidePromptView.frame = sceneDelegate?.window?.frame ?? .zero
                                planGuidePromptView.clouse = clouse
 
                                UIView.animate(withDuration: 0.5) {
                                                planGuidePromptView.view_content.transform = .init(scaleX: 1.0, y: 1.0)
                                                planGuidePromptView.alpha = 1
                                }
                }
 
                private func closeAction(){
                                UIView.animate(withDuration: 0.5) {
                                                self.view_content.transform = .init(scaleX: 0.1, y: 0.1)
                                                self.alpha = 0
                                }completion: { _ in
                                                self.removeFromSuperview()
                                }
                }
 
                @IBAction func seeOtherAction(_ sender: UIButton) {
                                clouse?(.seeOther)
                                closeAction()
                }
                @IBAction func setingAction(_ sender: UIButton) {
                                clouse?(.toSeting)
                                closeAction()
                }
                
}