//
|
// 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()
|
}
|
|
}
|