Commit e6ae252e authored by Steven杜宇's avatar Steven杜宇

// 客服段

parent 40d1d5bf
......@@ -274,7 +274,6 @@
0472CBA72C5A11640096F48F /* YHPrincipleCongratulationVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472CB9B2C5A11640096F48F /* YHPrincipleCongratulationVC.swift */; };
0472CBA82C5A11640096F48F /* YHPrincipleReviewListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472CB9C2C5A11640096F48F /* YHPrincipleReviewListVC.swift */; };
0472CBA92C5A11640096F48F /* YHPrincleGroupModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472CB9E2C5A11640096F48F /* YHPrincleGroupModel.swift */; };
0472CBAA2C5A11640096F48F /* YHPrincipleGroupReviewListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472CBA02C5A11640096F48F /* YHPrincipleGroupReviewListCell.swift */; };
0472CBAB2C5A11640096F48F /* YHPrincipleGroupUploadCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472CBA12C5A11640096F48F /* YHPrincipleGroupUploadCell.swift */; };
0472CBAC2C5A11640096F48F /* YHPrincleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472CBA32C5A11640096F48F /* YHPrincleViewModel.swift */; };
0472E25C2C521E64008EAB6E /* YHHomeIdentityListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472E25B2C521E64008EAB6E /* YHHomeIdentityListVC.swift */; };
......@@ -914,7 +913,6 @@
0472CB9B2C5A11640096F48F /* YHPrincipleCongratulationVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPrincipleCongratulationVC.swift; sourceTree = "<group>"; };
0472CB9C2C5A11640096F48F /* YHPrincipleReviewListVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPrincipleReviewListVC.swift; sourceTree = "<group>"; };
0472CB9E2C5A11640096F48F /* YHPrincleGroupModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPrincleGroupModel.swift; sourceTree = "<group>"; };
0472CBA02C5A11640096F48F /* YHPrincipleGroupReviewListCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPrincipleGroupReviewListCell.swift; sourceTree = "<group>"; };
0472CBA12C5A11640096F48F /* YHPrincipleGroupUploadCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPrincipleGroupUploadCell.swift; sourceTree = "<group>"; };
0472CBA32C5A11640096F48F /* YHPrincleViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPrincleViewModel.swift; sourceTree = "<group>"; };
0472E25B2C521E64008EAB6E /* YHHomeIdentityListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeIdentityListVC.swift; sourceTree = "<group>"; };
......@@ -2202,7 +2200,6 @@
0472CBA22C5A11640096F48F /* V */ = {
isa = PBXGroup;
children = (
0472CBA02C5A11640096F48F /* YHPrincipleGroupReviewListCell.swift */,
0472CBA12C5A11640096F48F /* YHPrincipleGroupUploadCell.swift */,
0409BEEA2C5B41D4003FCFD7 /* YHPrincipleUnapprovedCell.swift */,
04B360E22C60A346001EB053 /* YHPrinciplePhotoListCell.swift */,
......@@ -3782,7 +3779,6 @@
A59B43C72C48F68200B28379 /* YHEvaluationView.swift in Sources */,
045EEF122B9F171A0022A143 /* YHCNIDCardModel.swift in Sources */,
045EEF032B9F171A0022A143 /* YHFormItemDoubleChoiceCell.swift in Sources */,
0472CBAA2C5A11640096F48F /* YHPrincipleGroupReviewListCell.swift in Sources */,
045EEEAE2B9F171A0022A143 /* YHWorkHighlightsTableViewCell.swift in Sources */,
A567E59A2BD7643D00D5D5A0 /* YHHomeKingKongBlockModel.swift in Sources */,
045EEF062B9F171A0022A143 /* YHFormItemQuestionsCell.swift in Sources */,
......
......@@ -22,9 +22,8 @@ class YHPrincipleReviewListVC: YHBaseViewController {
tableView.dataSource = self
tableView.backgroundColor = UIColor.white
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHPrincipleGroupReviewListCell.self, forCellReuseIdentifier: YHPrincipleGroupReviewListCell.cellReuseIdentifier)
tableView.register(YHPrincipleGroupUploadCell.self, forCellReuseIdentifier: YHPrincipleGroupUploadCell.cellReuseIdentifier)
tableView.register(YHPrincipleEnvelopeCell.self, forCellReuseIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier)
tableView.register(YHPrincipleUploadStatusCell.self, forCellReuseIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier)
return tableView
}()
......@@ -42,24 +41,7 @@ class YHPrincipleReviewListVC: YHBaseViewController {
"新公司在职证明.pdf",
"主申人的曾用名证明文件.pdf",
"无刑事罪行记录证明.pdf"]
let m2 = YHPrincleGroupModel()
m2.fileList = ["新公司在职证明.pdf",
"主申人的曾用名证明文件.pdf"]
let m3 = YHPrincleGroupModel()
m3.fileList = ["新公司在职证明.pdf",
"主申人的曾用名证明文件.pdf",
"主申人的曾用名证明文件.pdf",
"无刑事罪行记录证明.pdf"]
let m4 = YHPrincleGroupModel()
m4.fileList = ["新公司在职证明.pdf",
"主申人的曾用名证明文件.pdf",
"主申人的曾用名证明文件.pdf",
"无刑事罪行记录证明.pdf"]
items.append(contentsOf: [m1, m2, m3, m4])
items.append(contentsOf: [m1])
self.tableView.reloadData()
}
......@@ -84,31 +66,9 @@ extension YHPrincipleReviewListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section%3 == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleGroupUploadCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleGroupUploadCell
return cell
} else if indexPath.section%3 == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleGroupReviewListCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleGroupReviewListCell
if 0 <= indexPath.section && indexPath.section < items.count {
let model = items[indexPath.section]
cell.updateModel(model)
cell.expandClick = {
[weak self] isExpand in
guard let self = self else { return }
model.isExpand = isExpand
self.tableView.reloadData()
}
}
return cell
}
// YHPrinciplePhotoCell
// YHPrincipleUnapprovedCell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
if 0 <= indexPath.section && indexPath.section < items.count {
let model = items[indexPath.section]
......@@ -139,14 +99,13 @@ extension YHPrincipleReviewListVC: UITableViewDelegate, UITableViewDataSource {
}
#endif
}
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 24.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
......
......@@ -7,9 +7,23 @@
//
import UIKit
import AttributedString
class YHPrincleGroupModel: NSObject {
var fileList:[String] = []
var isExpand:Bool = false
var isNeedTemplate: Bool = false
var isNeedUploadBtn: Bool = true
var tips: String = "1.新公司在职证明(在申请期间更换了工作时必传)\n2.主申人的曾用名证明文件,例如户口本副本\n3.主申请人的中国无刑事罪行记录证明书副本(由公安局开具)"
var tips1: ASAttributedString = YHPrincleGroupModel.getTips()
var redTips: String = ""
static func getTips() -> ASAttributedString {
let a: ASAttributedString = .init("请【下载模板】,填写信息,贵单位", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("签字盖章", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x3570DC)))
let c: ASAttributedString = .init("后,拍照or扫描上传", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
return a + b + c
}
}
//
// YHPrincipleGroupReviewListCell.swift
// galaxy
//
// Created by edy on 2024/4/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPrincipleGroupReviewItemView: UIView {
static let height = 55.0
var iconImgV: UIImageView!
var titleLabel: UILabel!
var timeLabel: UILabel!
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
func updateModel(_ str: String) {
titleLabel.text = str
timeLabel.text = "上传于2023.02.06"
}
func setupUI() {
iconImgV = UIImageView(image: UIImage(named: "my_cer_type_pdf"))
self.addSubview(iconImgV)
titleLabel = UILabel()
titleLabel.font = UIFont.PFSC_M(ofSize: 14)
titleLabel.textColor = UIColor.mainTextColor
titleLabel.text = "新公司在职证明.pdf"
self.addSubview(titleLabel)
timeLabel = UILabel()
timeLabel.font = UIFont.PFSC_R(ofSize: 11)
timeLabel.textColor = UIColor.labelTextColor2
timeLabel.text = "上传于2024.12.12"
self.addSubview(timeLabel)
iconImgV.snp.makeConstraints { make in
make.left.equalTo(22)
make.centerY.equalToSuperview()
make.width.height.equalTo(31.0)
}
titleLabel.snp.makeConstraints { make in
make.bottom.equalTo(self.snp.centerY).offset(-1)
make.left.equalTo(iconImgV.snp.right).offset(18)
make.right.equalTo(-16)
make.height.equalTo(20)
}
timeLabel.snp.makeConstraints { make in
make.top.equalTo(self.snp.centerY).offset(1)
make.left.equalTo(iconImgV.snp.right).offset(18)
make.height.equalTo(20)
make.right.equalTo(-16)
}
}
}
class YHPrincipleGroupReviewListCell: UITableViewCell {
static let cellReuseIdentifier = "YHPrincipleGroupReviewListCell"
var itemModel:YHPrincleGroupModel?
var expandClick:((Bool)->())?
var iconImgV: UIImageView!
var titleLabel: UILabel!
var grayView: UIView!
var expandBtn: UIButton!
lazy var listTitleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "已获得港府甄选名额"
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.labelTextColor2
label.text = "1.新公司在职证明(在申请期间更换了工作时必传)\n2.主申人的曾用名证明文件,例如户口本副本\n3.主申请人的中国无刑事罪行记录证明书副本(由公安局开具)"
return label
}()
lazy var statusLabel: UILabel = {
let label = UILabel()
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize: 10)
label.textColor = UIColor.init(hex: 0xFF9900)
label.backgroundColor = UIColor.init(hex:0xFF9900, alpha:0.3)
label.text = "审核中"
label.layer.cornerRadius = 4.0
label.clipsToBounds = true
return label
}()
lazy var listView: UIView = {
let view = UIView()
return view
}()
var items: [String] = []
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func updateModel(_ model:YHPrincleGroupModel) {
itemModel = model
items.removeAll()
items.append(contentsOf: model.fileList)
grayView.isHidden = !model.isExpand
if !model.isExpand {
grayView.removeSubviews()
grayView.snp.remakeConstraints { make in
make.left.right.equalTo(titleLabel)
make.top.equalTo(titleLabel.snp.bottom)
make.height.equalTo(0)
make.bottom.equalToSuperview()
}
return
}
// 展开状态
listView.removeSubviews()
grayView.addSubview(listTitleLabel)
grayView.addSubview(statusLabel)
grayView.addSubview(detailLabel)
grayView.addSubview(listView)
grayView.snp.remakeConstraints { make in
make.left.right.equalTo(titleLabel)
make.top.equalTo(titleLabel.snp.bottom).offset(12.0)
make.bottom.equalToSuperview()
}
listTitleLabel.snp.remakeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(16)
make.height.equalTo(24)
}
statusLabel.snp.remakeConstraints { make in
make.left.equalTo(listTitleLabel.snp.right).offset(8)
make.size.equalTo(CGSize(width: 38, height: 15))
make.centerY.equalTo(listTitleLabel)
make.right.lessThanOrEqualTo(-16)
}
detailLabel.snp.remakeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(listTitleLabel.snp.bottom).offset(28)
}
listView.snp.remakeConstraints { make in
make.left.right.equalTo(0)
make.top.equalTo(detailLabel.snp.bottom).offset(16)
let listHeight = Double(model.fileList.count) * YHPrincipleGroupReviewItemView.height
make.height.equalTo(listHeight)
let bottomMargin = model.fileList.count > 0 ? -16.0 : 0
make.bottom.equalTo(bottomMargin)
}
var lastItemView: YHPrincipleGroupReviewItemView? = nil
for (index, title) in items.enumerated() {
let itemView = YHPrincipleGroupReviewItemView(frame: .zero)
itemView.updateModel(title)
listView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.right.equalTo(0)
make.height.equalTo(YHPrincipleGroupReviewItemView.height)
if let lastItemView = lastItemView {
make.top.equalTo(lastItemView.snp.bottom)
} else {
make.top.equalToSuperview()
}
}
lastItemView = itemView
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
@objc func didExpandBtnClicked() {
guard let model = itemModel else { return }
expandClick?(!model.isExpand)
}
func setupUI() {
self.selectionStyle = .none
contentView.backgroundColor = UIColor.white
iconImgV = UIImageView(image: UIImage(named: "custom_service_icon_right"))
contentView.addSubview(iconImgV)
titleLabel = UILabel()
titleLabel.font = UIFont.PFSC_R(ofSize: 13)
titleLabel.textColor = UIColor.mainTextColor
titleLabel.text = "已获得港府甄选名额"
contentView.addSubview(titleLabel)
expandBtn = UIButton()
expandBtn.addTarget(self, action: #selector(didExpandBtnClicked), for: .touchUpInside)
contentView.addSubview(expandBtn)
grayView = UIView()
grayView.backgroundColor = UIColor.init(hex: 0xf8f9fb)
grayView.layer.cornerRadius = 6.0
grayView.clipsToBounds = true
contentView.addSubview(grayView)
iconImgV.snp.makeConstraints { make in
make.left.equalTo(24)
make.width.height.equalTo(14.0)
make.centerY.equalTo(titleLabel)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgV.snp.right).offset(8)
make.right.equalTo(-24)
make.top.equalTo(0)
make.height.equalTo(22)
}
expandBtn.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.bottom.equalTo(titleLabel)
}
grayView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.left.right.equalTo(titleLabel)
make.bottom.equalToSuperview()
}
}
}
......@@ -10,23 +10,41 @@ import UIKit
import AttributedString
enum YHPrincipleStatus: Int {
case review = 0 // 审核中
case rejected = 1 // 已驳回
case pass = 2 // 已通过
case mail = 3 // 已邮件港府
case preSubmit = 0 // 待提交
case review = 1 // 审核中
case rejected = 2 // 已驳回
case pass = 3 // 已通过
case mail = 4 // 已邮件港府
}
class YHPrincipleUploadStatusCell: UITableViewCell {
static let cellReuseIdentifier = "YHPrincipleUploadStatusCell"
var itemModel:YHPrincleGroupModel?
var items: [String] = []
var expandClick:((Bool)->())?
// 待提交 审核中 已知审核结果
lazy var titleLabel: UILabel = {
var label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14.0)
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.warnColor))
var status: YHPrincipleStatus = .review
lazy var whiteView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 6.0
view.clipsToBounds = true
return view
}()
lazy var titleLabel : UITextView = {
let label = UITextView()
label.textColor = UIColor(hex: 0x4E4E4E)
label.font = UIFont.PFSC_R(ofSize: 14)
label.isScrollEnabled = false
label.isEditable = false
label.isSelectable = false
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.failColor))
let title: ASAttributedString = .init("《赴港居留同意书》", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
let status: ASAttributedString = " \(.view(self.statusLabel, .original(.center)))"
label.attributed.text = mustTag + title + status
......@@ -39,6 +57,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
statusLabel.font = UIFont.PFSC_M(ofSize:10)
statusLabel.layer.cornerRadius = kCornerRadius3
statusLabel.clipsToBounds = true
statusLabel.text = "审核中"
statusLabel.backgroundColor = self.getUploadBgColor(status: .review)
statusLabel.textColor = self.getUploadTitleColor(status: .review)
statusLabel.frame = CGRectMake(0, 0, 38, 16)
......@@ -70,22 +89,17 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.labelTextColor2
label.text = "1.新公司在职证明(在申请期间更换了工作时必传)\n2.主申人的曾用名证明文件,例如户口本副本\n3.主申请人的中国无刑事罪行记录证明书副本(由公安局开具)"
return label
}()
lazy var detailLabel: UILabel = {
var label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("请【下载模板】,填写信息,贵单位", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("签字盖章", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x3570DC)))
let c: ASAttributedString = .init("后,拍照or扫描上传", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
label.attributed.text = a+b+c
return label
}()
lazy var uploadBtn: UIButton = {
let btn = UIButton()
let btn = UIButton(frame: CGRectMake(0, 0, KScreenWidth-36.0*2.0, 45.0))
btn.setTitle("上传".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(UIColor.init(hex: 0x3570DC), for: .normal)
......@@ -95,6 +109,20 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
return btn
}()
lazy var dotLineLayer:CAShapeLayer = {
let borderLayer = CAShapeLayer()
borderLayer.path = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: KScreenWidth-36.0*2, height: 45.0), cornerRadius: 3.0).cgPath
borderLayer.lineWidth = 1
//[数组第一个数字表示单个虚线长度,第二个数字表示间隔]
borderLayer.lineDashPattern = [3,1] as [NSNumber]?
//前边是虚线的长度,后边是虚线之间空隙的长度
borderLayer.lineDashPhase = 0.1
//实线边框
borderLayer.fillColor = UIColor.clear.cgColor
borderLayer.strokeColor = UIColor.brandMainColor.cgColor
return borderLayer
}()
lazy var redTipsLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
......@@ -114,6 +142,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
tableView.register(YHPrincipleUploadFileCell.self, forCellReuseIdentifier: YHPrincipleUploadFileCell.cellReuseIdentifier)
tableView.delegate = self
tableView.dataSource = self
tableView.isScrollEnabled = false
return tableView
}()
......@@ -135,8 +164,135 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
}
func setupUI() {
contentView.addSubview(titleLabel)
contentView.addSubview(lineView)
contentView.backgroundColor = UIColor.init(hex: 0xf8f9fb)
}
func updateModel(_ model:YHPrincleGroupModel) {
itemModel = model
items.removeAll()
items.append(contentsOf: model.fileList)
contentView.removeSubviews()
self.dotLineLayer.removeFromSuperlayer()
contentView.addSubview(whiteView)
whiteView.addSubview(titleLabel)
whiteView.addSubview(templateButton)
whiteView.addSubview(lineView)
whiteView.addSubview(grayLabel)
whiteView.addSubview(detailLabel)
whiteView.addSubview(tableView)
whiteView.addSubview(uploadBtn)
whiteView.addSubview(redTipsLabel)
grayLabel.text = model.tips
detailLabel.attributed.text = model.tips1
templateButton.isHidden = !model.isNeedTemplate
uploadBtn.isHidden = !model.isNeedUploadBtn
if model.isNeedUploadBtn {
uploadBtn.layer.addSublayer(self.dotLineLayer)
}
whiteView.snp.remakeConstraints { make in
make.top.equalTo(0)
make.left.equalTo(20)
make.right.equalTo(-20)
make.bottom.equalTo(0)
}
titleLabel.snp.remakeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(16)
make.right.equalTo(-16)
}
templateButton.snp.remakeConstraints { make in
make.top.equalTo(13)
make.right.equalTo(-16)
if model.isNeedTemplate {
make.width.equalTo(66)
} else {
make.width.equalTo(0)
}
make.height.equalTo(27)
}
lineView.snp.remakeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.height.equalTo(1.0)
}
grayLabel.snp.remakeConstraints { make in
make.top.equalTo(lineView.snp.bottom).offset(16)
make.left.equalTo(16)
make.right.equalTo(-16)
if model.tips.isEmpty {
make.height.equalTo(0)
}
}
detailLabel.snp.remakeConstraints { make in
make.top.equalTo(grayLabel.snp.bottom).offset(model.tips.isEmpty ? 0 : 16)
make.left.equalTo(16)
make.right.equalTo(-16)
if model.tips1.length <= 0 {
make.height.equalTo(0)
}
}
tableView.snp.remakeConstraints { make in
make.top.equalTo(detailLabel.snp.bottom).offset(model.tips1.length <= 0 ? 0 : 16)
make.left.equalTo(0)
make.right.equalTo(0)
var listHeight = 0.0
if model.fileList.count > 0 {
listHeight = Double(model.fileList.count) * 55.0 + Double(model.fileList.count-1) * 8.0
}
make.height.equalTo(listHeight)
}
uploadBtn.snp.remakeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
if model.isNeedUploadBtn {
make.height.equalTo(45)
} else {
make.height.equalTo(0)
}
make.top.equalTo(tableView.snp.bottom).offset(model.fileList.isEmpty ? 0 : 16)
}
redTipsLabel.snp.remakeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(uploadBtn.snp.bottom).offset(model.isNeedUploadBtn ? 0 : 16)
if model.redTips.isEmpty {
make.height.equalTo(0)
}
make.bottom.equalTo(-16)
}
// if status == .preSubmit { // 待提交
//
//
// } else {
//
// self.titleLabel.attributed.text = mustTag + title + status
//
// if status == .review {
//
// } else if status == .rejected {
//
// } else if status == .pass {
//
// } else if status == .mail {
//
// }
// }
}
func getUploadBgColor(status: YHPrincipleStatus) -> UIColor {
......@@ -176,9 +332,12 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegate {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadFileCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadFileCell
......@@ -192,4 +351,20 @@ extension YHPrincipleUploadStatusCell: UITableViewDataSource, UITableViewDelegat
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.001
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 8.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
}
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