132 lines
3.5 KiB
Swift
132 lines
3.5 KiB
Swift
//
|
|
// GroupInfoView.swift
|
|
// QuickLocation
|
|
//
|
|
// Created by 八条 on 2026/6/12.
|
|
//
|
|
|
|
import UIKit
|
|
import RxSwift
|
|
import RxCocoa
|
|
|
|
class GroupInfoView: UIView {
|
|
|
|
var disposeBag = DisposeBag()
|
|
|
|
private func setupRx() {
|
|
|
|
backBtn.rx.tap.subscribe(onNext: { _ in
|
|
AppRouter.shared.popOrDismiss()
|
|
}).disposed(by: disposeBag)
|
|
}
|
|
|
|
private func setupUI() {
|
|
addSubview(navBgView)
|
|
addSubview(navBarView)
|
|
navBarView.addSubview(navTitleLabel)
|
|
navBarView.addSubview(backBtn)
|
|
|
|
addSubview(groupIcon)
|
|
addSubview(groupNameLab)
|
|
addSubview(applyBtn)
|
|
|
|
navBgView.layoutChain
|
|
.edges(excludingEdge: .bottom)
|
|
.heightToWidth(160/375)
|
|
|
|
navBarView.layoutChain
|
|
.edges(excludingEdge: .bottom)
|
|
.height(kNaviHeight)
|
|
|
|
navTitleLabel.layoutChain
|
|
.top(kStatusBarHeight + 12)
|
|
.centerY(backBtn)
|
|
.centerX()
|
|
|
|
backBtn.layoutChain
|
|
.centerY(navTitleLabel)
|
|
.left(15)
|
|
.width(24)
|
|
.height(24)
|
|
|
|
groupIcon.layoutChain
|
|
.topToBottomOfView(navBarView, offset: 24)
|
|
.width(80)
|
|
.height(80)
|
|
.centerX()
|
|
|
|
groupNameLab.layoutChain
|
|
.topToBottomOfView(groupIcon, offset: 4)
|
|
.centerX()
|
|
|
|
applyBtn.layoutChain
|
|
.edgesHorzontal(30)
|
|
.bottom(kSafeBottomMargin + 10)
|
|
.height(50)
|
|
}
|
|
|
|
lazy var navBgView: UIImageView = {
|
|
let iv = UIImageView()
|
|
iv.image = UIImage(named: "Common/navBar_bg_2")
|
|
iv.contentMode = .scaleAspectFill
|
|
return iv
|
|
}()
|
|
|
|
lazy var navBarView: UIView = {
|
|
let view = UIView()
|
|
view.backgroundColor = .clear
|
|
return view
|
|
}()
|
|
|
|
lazy var navTitleLabel: UILabel = {
|
|
let label = UILabel()
|
|
label.text = "圈子资料"
|
|
label.font = .systemFont(ofSize: 18, weight: .medium)
|
|
label.textColor = ThemeManager.shared.color.titleAuxColor
|
|
label.textAlignment = .center
|
|
return label
|
|
}()
|
|
|
|
lazy var backBtn: UIButton = {
|
|
let btn = UIButton(type: .custom)
|
|
btn.setImage(UIImage(named: "Common/back"), for: .normal)
|
|
btn.extendEdgeInsets = UIEdgeInsets(top: 54, left: 15, bottom: 100, right: 100)
|
|
return btn
|
|
}()
|
|
|
|
lazy var groupIcon: UIImageView = {
|
|
let view = UIImageView()
|
|
view.backgroundColor = .clear
|
|
view.cornerRadius = 40
|
|
return view
|
|
}()
|
|
|
|
lazy var groupNameLab: UILabel = {
|
|
let label = UILabel()
|
|
label.font = .systemFont(ofSize: 16, weight: .medium)
|
|
label.textColor = ThemeManager.shared.color.titleAuxColor
|
|
return label
|
|
}()
|
|
|
|
lazy var applyBtn: UIButton = {
|
|
let btn = UIButton(type: .custom)
|
|
btn.setTitle("申请加入", for: .normal)
|
|
btn.titleLabel?.font = .systemFont(ofSize: 16, weight: .medium)
|
|
btn.setTitleColor(.white, for: .normal)
|
|
btn.setBackgroundImage(UIImage(named: "Common/button_bg_2"), for: .normal)
|
|
btn.cornerRadius = 25
|
|
return btn
|
|
}()
|
|
|
|
override init(frame: CGRect) {
|
|
super.init(frame: .zero)
|
|
backgroundColor = .white
|
|
setupUI()
|
|
setupRx()
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
}
|