|
|
@ -6,8 +6,12 @@
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
import GrowingTextView
|
|
|
|
|
|
|
|
import RxSwift
|
|
|
|
|
|
|
|
import RxCocoa
|
|
|
|
|
|
|
|
import RxDataSources
|
|
|
|
|
|
|
|
|
|
|
|
class FeedbackViewController: UIViewController {
|
|
|
|
class FeedbackViewController: ViewController {
|
|
|
|
let feedbackTypeView: FeedbackTypeView = {
|
|
|
|
let feedbackTypeView: FeedbackTypeView = {
|
|
|
|
let feedbackTypeView = FeedbackTypeView.init()
|
|
|
|
let feedbackTypeView = FeedbackTypeView.init()
|
|
|
|
|
|
|
|
|
|
|
@ -32,18 +36,34 @@ class FeedbackViewController: UIViewController {
|
|
|
|
confirmButton.setTitle("提交", for: .normal)
|
|
|
|
confirmButton.setTitle("提交", for: .normal)
|
|
|
|
confirmButton.titleLabel?.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
confirmButton.titleLabel?.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
confirmButton.backgroundColor = .init(hex: 0x000000)
|
|
|
|
confirmButton.backgroundColor = .init(hex: 0x000000)
|
|
|
|
|
|
|
|
confirmButton.layer.cornerRadius = 22
|
|
|
|
|
|
|
|
confirmButton.layer.masksToBounds = true
|
|
|
|
|
|
|
|
|
|
|
|
return confirmButton
|
|
|
|
return confirmButton
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
|
|
|
|
|
|
super.viewWillAppear(animated)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
navBarBgAlpha = 0
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
|
|
|
|
|
|
super.viewWillDisappear(animated)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
navBarBgAlpha = 1
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
|
override func viewDidLoad() {
|
|
|
|
super.viewDidLoad()
|
|
|
|
super.viewDidLoad()
|
|
|
|
|
|
|
|
|
|
|
|
makeUI()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func makeUI() {
|
|
|
|
override func makeUI() {
|
|
|
|
|
|
|
|
view.backgroundColor = .init(hex: 0xf5f5f5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view.addSubview(feedbackTypeView)
|
|
|
|
view.addSubview(feedbackTypeView)
|
|
|
|
view.addSubview(feedbackDetailView)
|
|
|
|
view.addSubview(feedbackDetailView)
|
|
|
@ -53,6 +73,23 @@ class FeedbackViewController: UIViewController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override func bindViewModel() {
|
|
|
|
|
|
|
|
super.bindViewModel()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guard let viewModel = viewModel as? FeedbackViewModel else { return }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let input = FeedbackViewModel.Input.init(viewWillAppear: rx.viewWillAppear)
|
|
|
|
|
|
|
|
let output = viewModel.transform(input: input)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let dataSource = FeedbackDetailSubView.dataSource()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.photoItems.bind(to: feedbackDetailView.feedbackDetailSubView.collectionView.rx.items(dataSource: dataSource)).disposed(by: rx.disposeBag)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override func viewDidLayoutSubviews() {
|
|
|
|
override func viewDidLayoutSubviews() {
|
|
|
|
super.viewDidLayoutSubviews()
|
|
|
|
super.viewDidLayoutSubviews()
|
|
|
|
|
|
|
|
|
|
|
@ -65,19 +102,18 @@ class FeedbackViewController: UIViewController {
|
|
|
|
feedbackDetailView.snp.makeConstraints { make in
|
|
|
|
feedbackDetailView.snp.makeConstraints { make in
|
|
|
|
make.left.equalTo(view)
|
|
|
|
make.left.equalTo(view)
|
|
|
|
make.right.equalTo(view)
|
|
|
|
make.right.equalTo(view)
|
|
|
|
make.top.equalTo(feedbackTypeView.snp.bottom)
|
|
|
|
make.top.equalTo(feedbackTypeView.snp.bottom).offset(12)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
feedbackContactView.snp.makeConstraints { make in
|
|
|
|
feedbackContactView.snp.makeConstraints { make in
|
|
|
|
make.left.equalTo(view)
|
|
|
|
make.left.equalTo(view)
|
|
|
|
make.right.equalTo(view)
|
|
|
|
make.right.equalTo(view)
|
|
|
|
make.top.equalTo(feedbackDetailView.snp.bottom)
|
|
|
|
make.top.equalTo(feedbackDetailView.snp.bottom).offset(12)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
confirmButton.snp.makeConstraints { make in
|
|
|
|
confirmButton.snp.makeConstraints { make in
|
|
|
|
make.left.equalTo(view)
|
|
|
|
make.left.equalTo(view).offset(46)
|
|
|
|
make.right.equalTo(view)
|
|
|
|
make.right.equalTo(view).offset(-46)
|
|
|
|
make.top.equalTo(feedbackContactView.snp.bottom).offset(30)
|
|
|
|
make.top.equalTo(feedbackContactView.snp.bottom).offset(30)
|
|
|
|
make.height.equalTo(44)
|
|
|
|
make.height.equalTo(44)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -90,6 +126,7 @@ class FeedbackViewController: UIViewController {
|
|
|
|
class FeedbackTypeView: UIView {
|
|
|
|
class FeedbackTypeView: UIView {
|
|
|
|
let titleLabel: UILabel = {
|
|
|
|
let titleLabel: UILabel = {
|
|
|
|
let titleLabel = UILabel.init()
|
|
|
|
let titleLabel = UILabel.init()
|
|
|
|
|
|
|
|
titleLabel.text = "反馈类型*"
|
|
|
|
|
|
|
|
|
|
|
|
return titleLabel
|
|
|
|
return titleLabel
|
|
|
|
}()
|
|
|
|
}()
|
|
|
@ -109,6 +146,7 @@ class FeedbackTypeView: UIView {
|
|
|
|
|
|
|
|
|
|
|
|
func makeUI() {
|
|
|
|
func makeUI() {
|
|
|
|
addSubview(titleLabel)
|
|
|
|
addSubview(titleLabel)
|
|
|
|
|
|
|
|
addSubview(feedbackTypeControl)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -119,6 +157,18 @@ class FeedbackTypeView: UIView {
|
|
|
|
override func layoutSubviews() {
|
|
|
|
override func layoutSubviews() {
|
|
|
|
super.layoutSubviews()
|
|
|
|
super.layoutSubviews()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
titleLabel.snp.makeConstraints { make in
|
|
|
|
|
|
|
|
make.left.equalTo(self).offset(18)
|
|
|
|
|
|
|
|
make.top.equalTo(self).offset(12)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feedbackTypeControl.snp.makeConstraints { make in
|
|
|
|
|
|
|
|
make.left.equalTo(self).offset(18)
|
|
|
|
|
|
|
|
make.height.equalTo(45)
|
|
|
|
|
|
|
|
make.right.equalTo(self).offset(-18)
|
|
|
|
|
|
|
|
make.top.equalTo(titleLabel.snp.bottom).offset(9)
|
|
|
|
|
|
|
|
make.bottom.equalTo(self)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -127,6 +177,7 @@ class FeedbackTypeControl: UIControl {
|
|
|
|
let titleLabel: UILabel = {
|
|
|
|
let titleLabel: UILabel = {
|
|
|
|
let titleLabel = UILabel.init()
|
|
|
|
let titleLabel = UILabel.init()
|
|
|
|
titleLabel.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
titleLabel.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
|
|
|
|
titleLabel.text = "请选择"
|
|
|
|
|
|
|
|
|
|
|
|
return titleLabel
|
|
|
|
return titleLabel
|
|
|
|
}()
|
|
|
|
}()
|
|
|
@ -140,7 +191,7 @@ class FeedbackTypeControl: UIControl {
|
|
|
|
|
|
|
|
|
|
|
|
let arrowView: UIImageView = {
|
|
|
|
let arrowView: UIImageView = {
|
|
|
|
let arrowView = UIImageView .init()
|
|
|
|
let arrowView = UIImageView .init()
|
|
|
|
arrowView.image = UIImage.init(named: "")
|
|
|
|
arrowView.image = UIImage.init(named: "setting_arrow")
|
|
|
|
|
|
|
|
|
|
|
|
return arrowView
|
|
|
|
return arrowView
|
|
|
|
}()
|
|
|
|
}()
|
|
|
@ -153,6 +204,10 @@ class FeedbackTypeControl: UIControl {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func makeUI() {
|
|
|
|
func makeUI() {
|
|
|
|
|
|
|
|
backgroundColor = .white
|
|
|
|
|
|
|
|
layer.cornerRadius = 22
|
|
|
|
|
|
|
|
layer.masksToBounds = true
|
|
|
|
|
|
|
|
|
|
|
|
addSubview(titleLabel)
|
|
|
|
addSubview(titleLabel)
|
|
|
|
addSubview(detailLabel)
|
|
|
|
addSubview(detailLabel)
|
|
|
|
addSubview(arrowView)
|
|
|
|
addSubview(arrowView)
|
|
|
@ -189,6 +244,7 @@ class FeedbackDetailView: UIView {
|
|
|
|
let titleLabel: UILabel = {
|
|
|
|
let titleLabel: UILabel = {
|
|
|
|
let titleLabel = UILabel.init()
|
|
|
|
let titleLabel = UILabel.init()
|
|
|
|
titleLabel.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
titleLabel.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
|
|
|
|
titleLabel.text = "问题描述*"
|
|
|
|
|
|
|
|
|
|
|
|
return titleLabel
|
|
|
|
return titleLabel
|
|
|
|
}()
|
|
|
|
}()
|
|
|
@ -207,6 +263,7 @@ class FeedbackDetailView: UIView {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func makeUI() {
|
|
|
|
func makeUI() {
|
|
|
|
|
|
|
|
|
|
|
|
addSubview(titleLabel)
|
|
|
|
addSubview(titleLabel)
|
|
|
|
addSubview(feedbackDetailSubView)
|
|
|
|
addSubview(feedbackDetailSubView)
|
|
|
|
|
|
|
|
|
|
|
@ -220,13 +277,25 @@ class FeedbackDetailView: UIView {
|
|
|
|
override func layoutSubviews() {
|
|
|
|
override func layoutSubviews() {
|
|
|
|
super.layoutSubviews()
|
|
|
|
super.layoutSubviews()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
titleLabel.snp.makeConstraints { make in
|
|
|
|
|
|
|
|
make.left.equalTo(self).offset(18)
|
|
|
|
|
|
|
|
make.top.equalTo(self).offset(12)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feedbackDetailSubView.snp.makeConstraints { make in
|
|
|
|
|
|
|
|
make.left.equalTo(self).offset(18)
|
|
|
|
|
|
|
|
make.top.equalTo(titleLabel.snp.bottom).offset(9)
|
|
|
|
|
|
|
|
make.right.equalTo(self).offset(-18)
|
|
|
|
|
|
|
|
make.bottom.equalTo(self)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class FeedbackDetailSubView: UIView {
|
|
|
|
class FeedbackDetailSubView: UIView {
|
|
|
|
let textView: UITextView = {
|
|
|
|
let textView: GrowingTextView = {
|
|
|
|
let textView = UITextView.init()
|
|
|
|
let textView = GrowingTextView.init()
|
|
|
|
|
|
|
|
textView.font = UIFont.systemFont(ofSize: 14)
|
|
|
|
|
|
|
|
textView.placeholder = "请详细描述问题或建议"
|
|
|
|
|
|
|
|
|
|
|
|
return textView
|
|
|
|
return textView
|
|
|
|
}()
|
|
|
|
}()
|
|
|
@ -234,11 +303,49 @@ class FeedbackDetailSubView: UIView {
|
|
|
|
let countLabel: UILabel = {
|
|
|
|
let countLabel: UILabel = {
|
|
|
|
let countLabel = UILabel.init()
|
|
|
|
let countLabel = UILabel.init()
|
|
|
|
countLabel.font = UIFont.systemFont(ofSize: 14)
|
|
|
|
countLabel.font = UIFont.systemFont(ofSize: 14)
|
|
|
|
|
|
|
|
countLabel.text = "0/200"
|
|
|
|
|
|
|
|
countLabel.textColor = .tertiaryText()
|
|
|
|
|
|
|
|
|
|
|
|
return countLabel
|
|
|
|
return countLabel
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
// TODO:相册
|
|
|
|
|
|
|
|
|
|
|
|
var collectionView: UICollectionView = {
|
|
|
|
|
|
|
|
let layout = UICollectionViewCompositionalLayout { (sectionIndex, environment) -> NSCollectionLayoutSection? in
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 创建item大小
|
|
|
|
|
|
|
|
let itemSize = NSCollectionLayoutSize(widthDimension: .absolute(84), heightDimension: .absolute(84))
|
|
|
|
|
|
|
|
let item = NSCollectionLayoutItem(layoutSize: itemSize)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 创建group大小
|
|
|
|
|
|
|
|
let groupSize = NSCollectionLayoutSize(widthDimension: .absolute(84), heightDimension: .absolute(84))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 创建group,这里使用.horizontal来使其横向滚动
|
|
|
|
|
|
|
|
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 创建section
|
|
|
|
|
|
|
|
let section = NSCollectionLayoutSection(group: group)
|
|
|
|
|
|
|
|
section.contentInsets = .init(top: 18, leading: 18, bottom: 18, trailing: 18)
|
|
|
|
|
|
|
|
section.interGroupSpacing = 18
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置横向滚动行为
|
|
|
|
|
|
|
|
section.orthogonalScrollingBehavior = .continuous
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return section
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: layout)
|
|
|
|
|
|
|
|
collectionView.register(FeedbackDetailViewCell.self, forCellWithReuseIdentifier: "FeedbackDetailViewCell")
|
|
|
|
|
|
|
|
collectionView.showsHorizontalScrollIndicator = false
|
|
|
|
|
|
|
|
collectionView.showsVerticalScrollIndicator = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// collectionView.backgroundColor = .init(hex: 0xfbfbfb)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return collectionView
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override init(frame: CGRect) {
|
|
|
|
override init(frame: CGRect) {
|
|
|
@ -252,11 +359,19 @@ class FeedbackDetailSubView: UIView {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func makeUI() {
|
|
|
|
func makeUI() {
|
|
|
|
|
|
|
|
backgroundColor = .white
|
|
|
|
|
|
|
|
layer.cornerRadius = 9
|
|
|
|
|
|
|
|
layer.masksToBounds = true
|
|
|
|
|
|
|
|
|
|
|
|
addSubview(textView)
|
|
|
|
addSubview(textView)
|
|
|
|
addSubview(countLabel)
|
|
|
|
addSubview(countLabel)
|
|
|
|
|
|
|
|
addSubview(collectionView)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override func layoutSubviews() {
|
|
|
|
override func layoutSubviews() {
|
|
|
|
super.layoutSubviews()
|
|
|
|
super.layoutSubviews()
|
|
|
|
|
|
|
|
|
|
|
@ -271,6 +386,131 @@ class FeedbackDetailSubView: UIView {
|
|
|
|
make.top.equalTo(textView.snp.bottom).offset(20)
|
|
|
|
make.top.equalTo(textView.snp.bottom).offset(20)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
collectionView.snp.remakeConstraints { make in
|
|
|
|
|
|
|
|
make.left.equalTo(self)
|
|
|
|
|
|
|
|
make.right.equalTo(self)
|
|
|
|
|
|
|
|
make.top.equalTo(countLabel.snp.bottom).offset(53)
|
|
|
|
|
|
|
|
make.bottom.equalTo(self).offset(0)
|
|
|
|
|
|
|
|
make.height.equalTo(120)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension FeedbackDetailSubView {
|
|
|
|
|
|
|
|
static func dataSource() -> RxCollectionViewSectionedReloadDataSource<FeedbackSection> {
|
|
|
|
|
|
|
|
return RxCollectionViewSectionedReloadDataSource<FeedbackSection>(
|
|
|
|
|
|
|
|
configureCell: { dataSource, collectionView, indexPath, item in
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch dataSource[indexPath] {
|
|
|
|
|
|
|
|
case .add:
|
|
|
|
|
|
|
|
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "FeedbackDetailViewCell", for: indexPath) as? FeedbackDetailViewCell
|
|
|
|
|
|
|
|
cell?.feedbackPhotoType = item
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cell!
|
|
|
|
|
|
|
|
case .photo(let photo):
|
|
|
|
|
|
|
|
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "FeedbackDetailViewCell", for: indexPath) as? FeedbackDetailViewCell
|
|
|
|
|
|
|
|
cell?.feedbackPhotoType = item
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cell!
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FeedbackDetailViewCell: UICollectionViewCell {
|
|
|
|
|
|
|
|
var imageView: UIImageView = {
|
|
|
|
|
|
|
|
let imageView = UIImageView.init()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return imageView
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var closeButton: UIButton = {
|
|
|
|
|
|
|
|
let closeButton = UIButton.init()
|
|
|
|
|
|
|
|
closeButton.setImage(UIImage.init(named: "feedback_close_btn"), for: .normal)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return closeButton
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var addImageView: UIImageView = {
|
|
|
|
|
|
|
|
let addImageView = UIImageView.init()
|
|
|
|
|
|
|
|
addImageView.image = UIImage.init(named: "feedback_add_btn")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return addImageView
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var feedbackPhotoType: FeedbackPhotoType? {
|
|
|
|
|
|
|
|
didSet {
|
|
|
|
|
|
|
|
guard let feedbackPhotoType = feedbackPhotoType else { return }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch feedbackPhotoType {
|
|
|
|
|
|
|
|
case .add:
|
|
|
|
|
|
|
|
addImageView.isHidden = false
|
|
|
|
|
|
|
|
imageView.isHidden = true
|
|
|
|
|
|
|
|
closeButton.isHidden = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentView.layer.borderColor = UIColor.separator().cgColor
|
|
|
|
|
|
|
|
contentView.layer.borderWidth = 1
|
|
|
|
|
|
|
|
contentView.layer.cornerRadius = 3
|
|
|
|
|
|
|
|
contentView.layer.masksToBounds = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case .photo(let image):
|
|
|
|
|
|
|
|
addImageView.isHidden = true
|
|
|
|
|
|
|
|
imageView.isHidden = false
|
|
|
|
|
|
|
|
closeButton.isHidden = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentView.layer.borderColor = UIColor.clear.cgColor
|
|
|
|
|
|
|
|
contentView.layer.borderWidth = 1
|
|
|
|
|
|
|
|
contentView.layer.cornerRadius = 3
|
|
|
|
|
|
|
|
contentView.layer.masksToBounds = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override init(frame: CGRect) {
|
|
|
|
|
|
|
|
super.init(frame: frame)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
makeUI()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
required init?(coder: NSCoder) {
|
|
|
|
|
|
|
|
fatalError("init(coder:) has not been implemented")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func makeUI() {
|
|
|
|
|
|
|
|
contentView.addSubview(imageView)
|
|
|
|
|
|
|
|
contentView.addSubview(addImageView)
|
|
|
|
|
|
|
|
contentView.addSubview(closeButton)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
imageView.snp.makeConstraints { make in
|
|
|
|
|
|
|
|
make.edges.equalTo(contentView)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
closeButton.snp.makeConstraints { make in
|
|
|
|
|
|
|
|
make.right.equalTo(imageView)
|
|
|
|
|
|
|
|
make.top.equalTo(imageView)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addImageView.snp.makeConstraints { make in
|
|
|
|
|
|
|
|
make.center.equalTo(contentView)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -280,14 +520,26 @@ class FeedbackContactView: UIView {
|
|
|
|
let titleLabel: UILabel = {
|
|
|
|
let titleLabel: UILabel = {
|
|
|
|
let titleLabel = UILabel.init()
|
|
|
|
let titleLabel = UILabel.init()
|
|
|
|
titleLabel.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
titleLabel.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
|
|
|
|
titleLabel.text = "联系方式"
|
|
|
|
|
|
|
|
|
|
|
|
return titleLabel
|
|
|
|
return titleLabel
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let containerView: UIView = {
|
|
|
|
|
|
|
|
let containerView = UIView.init()
|
|
|
|
|
|
|
|
containerView.backgroundColor = .white
|
|
|
|
|
|
|
|
containerView.layer.cornerRadius = 22
|
|
|
|
|
|
|
|
containerView.layer.masksToBounds = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return containerView
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
let textFieldView: UITextField = {
|
|
|
|
let textFieldView: UITextField = {
|
|
|
|
let textFieldView = UITextField.init()
|
|
|
|
let textFieldView = UITextField.init()
|
|
|
|
textFieldView.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
textFieldView.font = UIFont.systemFont(ofSize: 15)
|
|
|
|
textFieldView.placeholder = "手机/邮箱"
|
|
|
|
textFieldView.placeholder = "手机/邮箱"
|
|
|
|
|
|
|
|
textFieldView.backgroundColor = .white
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return textFieldView
|
|
|
|
return textFieldView
|
|
|
|
}()
|
|
|
|
}()
|
|
|
@ -305,7 +557,8 @@ class FeedbackContactView: UIView {
|
|
|
|
|
|
|
|
|
|
|
|
func makeUI() {
|
|
|
|
func makeUI() {
|
|
|
|
addSubview(titleLabel)
|
|
|
|
addSubview(titleLabel)
|
|
|
|
addSubview(textFieldView)
|
|
|
|
addSubview(containerView)
|
|
|
|
|
|
|
|
containerView.addSubview(textFieldView)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -317,11 +570,19 @@ class FeedbackContactView: UIView {
|
|
|
|
make.top.equalTo(self).offset(12)
|
|
|
|
make.top.equalTo(self).offset(12)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
textFieldView.snp.makeConstraints { make in
|
|
|
|
containerView.snp.makeConstraints { make in
|
|
|
|
make.left.equalTo(self).offset(18)
|
|
|
|
make.left.equalTo(self).offset(18)
|
|
|
|
make.right.equalTo(self).offset(-18)
|
|
|
|
make.right.equalTo(self).offset(-18)
|
|
|
|
make.top.equalTo(titleLabel.snp.bottom).offset(9)
|
|
|
|
make.top.equalTo(titleLabel.snp.bottom).offset(9)
|
|
|
|
make.height.equalTo(45)
|
|
|
|
make.height.equalTo(45)
|
|
|
|
|
|
|
|
make.bottom.equalTo(self)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textFieldView.snp.makeConstraints { make in
|
|
|
|
|
|
|
|
make.left.equalTo(containerView).offset(12)
|
|
|
|
|
|
|
|
make.top.equalTo(containerView)
|
|
|
|
|
|
|
|
make.bottom.equalTo(containerView)
|
|
|
|
|
|
|
|
make.right.equalTo(containerView).offset(-12)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|