Commit 889c1f8f authored by Steven杜宇's avatar Steven杜宇

// 赴港预约

parent 1d915dfa
......@@ -12,6 +12,7 @@ enum YHGrabItemViewType: Int {
case info
case grab
case files
case visit
}
class YHGrabItem {
......@@ -97,9 +98,14 @@ class YHGrabNumberInfoItemView: UIView {
if item.files.count%4 != 0 {
rowCount += 1
}
collectionView.snp.remakeConstraints { make in
make.left.right.bottom.equalTo(0)
make.top.equalTo(detailLabel.snp.bottom).offset(16)
if item.type == .visit {
make.top.equalTo(titleLabel.snp.bottom).offset(16)
} else {
make.top.equalTo(detailLabel.snp.bottom).offset(16)
}
if item.type == .files {
make.height.equalTo((fileWidth+16.0)*Double(rowCount))
......@@ -122,6 +128,7 @@ class YHGrabNumberInfoItemView: UIView {
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = .mainTextColor(alpha: 0.5)
return label
......
......@@ -42,7 +42,8 @@ class YHGrabingNumberListCell: UITableViewCell {
wantTimeText = group.wantMinTime
}
let items2 = [YHGrabItem(type: .info, title: "期望赴港时间:", detail: wantTimeText, isSingleLine: true),
YHGrabItem(type: .info, title: "期望香港办证点:", detail: group.wantImmigrationOffice, isSingleLine: false)]
YHGrabItem(type: .info, title: "期望香港办证点:", detail: group.wantImmigrationOffice, isSingleLine: false),
YHGrabItem(type: .visit, title: "到访香港体验中心:香港华润大厦 (湾仔入境处旁)", detail: "是", isSingleLine: false)]
listView.intentionInfoView.updateItems(items2)
......
......@@ -35,7 +35,8 @@ class YHHaveGrabbedNumberListCell: UITableViewCell {
wantTimeText = group.wantMinTime
}
let items2 = [YHGrabItem(type: .info, title: "期望赴港时间:", detail: wantTimeText, isSingleLine: true),
YHGrabItem(type: .info, title: "期望香港办证点:", detail: group.wantImmigrationOffice, isSingleLine: false)]
YHGrabItem(type: .info, title: "期望香港办证点:", detail: group.wantImmigrationOffice, isSingleLine: false),
YHGrabItem(type: .visit, title: "到访香港体验中心:香港华润大厦 (湾仔入境处旁)", detail: "是", isSingleLine: false)]
listView.intentionInfoView.updateItems(items2)
listContainView.addSubview(listView)
......
......@@ -55,6 +55,21 @@ class YHInfoItemOptionView: UIView {
}
}
var tips: String = "" {
didSet {
let isShowTips = !tips.isEmpty
tipsLabel.text = tips
tipsLabel.snp.updateConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(titleView.snp.bottom).offset(isShowTips ? 5.0 : 0.0)
make.height.equalTo(isShowTips ? 17.0 : 0.0)
make.bottom.equalTo(-titleGap)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
var selectIndex: Int = -1 {
didSet {
for (index, _) in options.enumerated() {
......@@ -69,8 +84,12 @@ class YHInfoItemOptionView: UIView {
didSet {
titleView.snp.updateConstraints { make in
make.top.equalTo(titleGap)
}
tipsLabel.snp.updateConstraints { make in
make.bottom.equalTo(-titleGap)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
......@@ -94,6 +113,14 @@ class YHInfoItemOptionView: UIView {
return label
}()
private lazy var tipsLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = .failColor
return label
}()
func createOptionButton() -> UIButton {
let btn = UIButton()
......@@ -139,6 +166,8 @@ class YHInfoItemOptionView: UIView {
func createUI() {
self.addSubview(titleView)
self.addSubview(tipsLabel)
titleView.addSubview(titleLabel)
let firstBtn = self.createOptionButton()
......@@ -165,10 +194,16 @@ class YHInfoItemOptionView: UIView {
titleView.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(titleGap)
make.bottom.equalTo(-titleGap)
make.width.equalTo(titleMaxWidth)
}
tipsLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(titleView.snp.bottom).offset(0)
make.height.equalTo(0)
make.bottom.equalTo(-titleGap)
}
titleLabel.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
......
......@@ -25,6 +25,24 @@ class YHSelectApplicantGroupCell: UITableViewCell {
// param 选中的用户 是否选中 选中的用户是第几批
var selectBlock: ((_ member: YHHKMemberModel, _ isSelect: Bool, _ groupIndex: Int) -> Void)?
var isShowVisitOption: Bool = true {
didSet {
visitOptionView.isHidden = !isShowVisitOption
visitOptionView.snp.remakeConstraints { make in
make.top.equalTo(locationSelectView.snp.bottom).offset(0)
make.left.equalTo(18)
make.right.equalTo(-18)
if !isShowVisitOption {
make.height.equalTo(0)
}
make.bottom.equalToSuperview()
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
var isShowSelectUserView: Bool = true {
didSet {
......@@ -288,6 +306,20 @@ class YHSelectApplicantGroupCell: UITableViewCell {
return label
}()
lazy var visitOptionView: YHInfoItemOptionView = {
let view = YHInfoItemOptionView(frame: .zero)
view.title = "到访香港体验中心:香港华润大厦 (湾仔入境处旁)"
view.options = ["是", "否"]
view.selectIndex = 0
view.selectBlock = {
[weak self] _ in
guard let self = self else { return }
// let isAllGo = index == 0 ? true : false
// self.selectBlock?(isAllGo)
}
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
......@@ -310,6 +342,7 @@ class YHSelectApplicantGroupCell: UITableViewCell {
whiteContentView.addSubview(optionsView)
whiteContentView.addSubview(timeSelectView)
whiteContentView.addSubview(locationSelectView)
whiteContentView.addSubview(visitOptionView)
whiteContentView.snp.makeConstraints { make in
make.top.equalTo(16)
......@@ -360,6 +393,12 @@ class YHSelectApplicantGroupCell: UITableViewCell {
make.top.equalTo(timeSelectView.snp.bottom).offset(0)
make.left.equalTo(18)
make.right.equalTo(-18)
}
visitOptionView.snp.makeConstraints { make in
make.top.equalTo(locationSelectView.snp.bottom).offset(0)
make.left.equalTo(18)
make.right.equalTo(-18)
make.bottom.equalToSuperview()
}
}
......@@ -473,6 +512,7 @@ private extension YHSelectApplicantGroupCell {
// 办证地点是否显示红色错误提示
timeSelectView.isNeedShowErrorTips = (model.isNeedCheck && !isSelectDate)
visitOptionView.tips = "请选择"
self.setNeedsLayout()
self.layoutIfNeeded()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment