// // EmergencyContactFooterView.swift // QuickLocation // // Created by 八条 on 2026/6/11. // import UIKit import RxSwift import RxCocoa class EmergencyContactFooterView: UIView { var disposeBag = DisposeBag() private func setupRx() { addView.rx.tapGesture.subscribe(onNext: { _ in AppRouter.push(Route.emergencyContactAdd) }).disposed(by: disposeBag) } private func setupUI() { addSubview(addView) addSubview(tipsTitleLab) addSubview(tipsLab) addView.layoutChain .top() .edgesHorzontal(15) .height(68) tipsTitleLab.layoutChain .topToBottomOfView(addView, offset: 20) .leftToView(addView) tipsLab.layoutChain .topToBottomOfView(tipsTitleLab, offset: 6) .leftToView(addView) .rightToView(addView) } lazy var addView: UIView = { let view = UIView() view.backgroundColor = UIColor(hexStr: "#F5FBFF") view.cornerRadius = 10 let titleLab = UILabel() titleLab.text = "添加紧急联系人" titleLab.font = .systemFont(ofSize: 14, weight: .semibold) titleLab.textColor = ThemeManager.shared.color.titleAuxColor view.addSubview(titleLab) titleLab.layoutChain .centerX().centerY() let addIcon = UIImageView(image: UIImage(named: "EmergencyContact/add")) view.addSubview(addIcon) addIcon.layoutChain .rightToLeftOfView(titleLab, offset: -4) .centerY() return view }() lazy var tipsTitleLab: UILabel = { let label = UILabel() label.text = "紧急联系人能力:" label.font = .systemFont(ofSize: 14, weight: .semibold) label.textColor = ThemeManager.shared.color.titleAuxColor return label }() lazy var tipsLab: UILabel = { let label = UILabel() label.text = "仅在使用SOS功能或紧急情况下,会主动通知紧急联系人" label.font = .systemFont(ofSize: 12, weight: .regular) label.textColor = UIColor(hexStr: "#777777") label.numberOfLines = 0 return label }() override init(frame: CGRect) { super.init(frame: frame) backgroundColor = .white setupUI() setupRx() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }