Commit 1156d47c authored by David黄金龙's avatar David黄金龙

修改 文书列表逻辑

parent 683b8e5f
...@@ -16,23 +16,40 @@ class YHHomePageViewController: YHBaseViewController { ...@@ -16,23 +16,40 @@ class YHHomePageViewController: YHBaseViewController {
}() }()
lazy var homeCollectView = { lazy var homeCollectView = {
// // 设置布局方向
// let flowLayout = UICollectionViewFlowLayout()
// let margin = 20.0
// let gap = 20.0
// let itemWidth = ceil((KScreenWidth - 2*margin - gap)/2.0)
// flowLayout.itemSize = CGSize(width: itemWidth, height: 210 + 87 + 4)
// flowLayout.minimumInteritemSpacing = 10.0
// flowLayout.minimumLineSpacing = 10.0
// flowLayout.scrollDirection = .vertical
//
// let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
// collectinoView.backgroundColor = .white
// collectinoView.register(YHDavidTestCollectionViewCell.self, forCellWithReuseIdentifier:YHDavidTestCollectionViewCell.cellReuseIdentifier)
// collectinoView.delegate = self
// collectinoView.dataSource = self
// collectinoView.showsVerticalScrollIndicator = false
//
// collectinoView.translatesAutoresizingMaskIntoConstraints = false
// collectinoView.alwaysBounceVertical = true
//
// 设置布局方向 // 设置布局方向
let flowLayout = UICollectionViewFlowLayout() let flowLayout = YHHomeCollectionLayout()
let margin = 20.0 flowLayout.minimumInteritemSpacing = 7.0
let gap = 20.0 flowLayout.minimumColumnSpacing = 10.0
let itemWidth = ceil((KScreenWidth - 2*margin - gap)/2.0) flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
flowLayout.itemSize = CGSize(width: itemWidth, height: 210 + 87 + 4)
flowLayout.minimumInteritemSpacing = 10.0 let collectinoView = YHGestureCollectionView(frame: .zero, collectionViewLayout: flowLayout)
flowLayout.minimumLineSpacing = 10.0 // collectinoView.contentInset = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
flowLayout.scrollDirection = .vertical
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectinoView.backgroundColor = .white collectinoView.backgroundColor = .white
collectinoView.register(YHDavidTestCollectionViewCell.self, forCellWithReuseIdentifier:YHDavidTestCollectionViewCell.cellReuseIdentifier) collectinoView.register(YHHomeCollectionViewCell.self, forCellWithReuseIdentifier:YHHomeCollectionViewCell.cellReuseIdentifier)
collectinoView.delegate = self collectinoView.delegate = self
collectinoView.dataSource = self collectinoView.dataSource = self
collectinoView.showsVerticalScrollIndicator = false collectinoView.bounces = false
collectinoView.translatesAutoresizingMaskIntoConstraints = false collectinoView.translatesAutoresizingMaskIntoConstraints = false
collectinoView.alwaysBounceVertical = true collectinoView.alwaysBounceVertical = true
return collectinoView return collectinoView
...@@ -77,7 +94,7 @@ private extension YHHomePageViewController { ...@@ -77,7 +94,7 @@ private extension YHHomePageViewController {
view.addSubview(homeCollectView) view.addSubview(homeCollectView)
homeCollectView.snp.makeConstraints { make in homeCollectView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview() make.left.right.bottom.equalToSuperview()
make.top.equalTo(searchView.snp.bottom) make.top.equalTo(searchView.snp.bottom).offset(6)
} }
homeHeaderView.frame = CGRect(x: 0, y: -YHHomeHeadView.viewH, width: KScreenWidth - 40, height: YHHomeHeadView.viewH) homeHeaderView.frame = CGRect(x: 0, y: -YHHomeHeadView.viewH, width: KScreenWidth - 40, height: YHHomeHeadView.viewH)
...@@ -117,22 +134,33 @@ private extension YHHomePageViewController { ...@@ -117,22 +134,33 @@ private extension YHHomePageViewController {
extension YHHomePageViewController: UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, UICollectionViewDataSource { extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count return items.count
} }
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHDavidTestCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHDavidTestCollectionViewCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHHomeCollectionViewCell
return cell return cell
} }
private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { // func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print("index is \(indexPath.row)") // print("index is \(indexPath.row)")
} // }
} }
private extension YHHomePageViewController {
extension YHHomePageViewController : CollectionViewWaterfallLayoutDelegate {
func collectionView(_ collectionView: UICollectionView, layout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
let margin = 20.0
let gap = 7.0
let itemWidth = 70.0//ceil((KScreenWidth - 2*margin - gap)/2.0)
let arrItemH : [CGFloat] = [100,150,200,250,300,350,400]
let HHH = arrItemH[Int.random(in: 0...6)]
return CGSize(width: itemWidth, height: HHH)
}
} }
...@@ -12,7 +12,7 @@ class YHDavidTestCollectionViewCell: UICollectionViewCell { ...@@ -12,7 +12,7 @@ class YHDavidTestCollectionViewCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHDavidTestCollectionViewCell" static let cellReuseIdentifier = "YHDavidTestCollectionViewCell"
lazy var titleImageView:UIImageView = { lazy var titleImageView:UIImageView = {
let imageV = UIImageView(image: UIImage(named: "home_title_image")) let imageV = UIImageView(image: UIImage(named: "start_page_bkg"))
imageV.contentMode = .scaleAspectFill imageV.contentMode = .scaleAspectFill
imageV.roundCorners(UIRectCorner.topLeft, radius: 8) imageV.roundCorners(UIRectCorner.topLeft, radius: 8)
imageV.roundCorners(UIRectCorner.topRight, radius: 8) imageV.roundCorners(UIRectCorner.topRight, radius: 8)
......
...@@ -156,31 +156,28 @@ class YHDocListCell: UITableViewCell { ...@@ -156,31 +156,28 @@ class YHDocListCell: UITableViewCell {
*/ */
var statusTxt = "" var statusTxt = "--"
var color : UIColor = .brandMainColor var color : UIColor = .brandMainColor
if (dataSource.document.id == 0 && dataSource.file_type.contains("doc", caseSensitive: true)) || dataSource.file_type.contains("sign", caseSensitive: true) { if dataSource.file_type.contains("sign", caseSensitive: true) {
let signStatus = dataSource.status let status = dataSource.sign_doc.status
switch signStatus { if status == 3 {
case 2:
statusTxt = "待签章" statusTxt = "待签章"
color = UIColor.brandMainColor color = UIColor.brandMainColor
case 3: } else if status == 4 {
statusTxt = "已驳回"
color = UIColor.failColor
case 5:
statusTxt = "已签章" statusTxt = "已签章"
color = UIColor(hex: 0x49D2B1, alpha: 1.0) color = UIColor.successColor
case 7: } else if status == 5 {
statusTxt = "已完成" statusTxt = "已完成"
color = UIColor.labelTextColor2 color = UIColor.labelTextColor2
default: } else if status == 6 {
statusTxt = "已驳回"
color = UIColor.failColor
} else {
statusTxt = "--" statusTxt = "--"
color = UIColor.failColor color = UIColor.failColor
break
} }
} else { } else if dataSource.file_type.contains("doc", caseSensitive: true) {
let status = dataSource.status let status = dataSource.status
if status == 2 { if status == 2 {
statusTxt = "待确认" statusTxt = "待确认"
...@@ -201,6 +198,10 @@ class YHDocListCell: UITableViewCell { ...@@ -201,6 +198,10 @@ class YHDocListCell: UITableViewCell {
statusTxt = "--" statusTxt = "--"
color = UIColor.failColor color = UIColor.failColor
} }
} else {
statusTxt = "--"
color = UIColor.failColor
} }
statusLabel.text = statusTxt statusLabel.text = statusTxt
......
...@@ -25,7 +25,6 @@ public let CollectionViewWaterfallElementKindSectionFooter = "CollectionViewWate ...@@ -25,7 +25,6 @@ public let CollectionViewWaterfallElementKindSectionFooter = "CollectionViewWate
@objc optional func collectionView(_ collectionView: UICollectionView, layout: UICollectionViewLayout, insetForFooterInSection section: Int) -> UIEdgeInsets @objc optional func collectionView(_ collectionView: UICollectionView, layout: UICollectionViewLayout, insetForFooterInSection section: Int) -> UIEdgeInsets
@objc optional func collectionView(_ collectionView: UICollectionView, layout: UICollectionViewLayout, minimumInteritemSpacingForSection section: Int) -> Float @objc optional func collectionView(_ collectionView: UICollectionView, layout: UICollectionViewLayout, minimumInteritemSpacingForSection section: Int) -> Float
} }
......
...@@ -11,7 +11,12 @@ import UIKit ...@@ -11,7 +11,12 @@ import UIKit
class YHServiceTableFootView: UIView { class YHServiceTableFootView: UIView {
lazy var items = { lazy var items = {
return [AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "")] return [
AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: ""),
AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: ""),
AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: ""),
AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "")
]
}() }()
lazy var myCollectView = { lazy var myCollectView = {
...@@ -21,7 +26,6 @@ class YHServiceTableFootView: UIView { ...@@ -21,7 +26,6 @@ class YHServiceTableFootView: UIView {
flowLayout.minimumColumnSpacing = 7.0 flowLayout.minimumColumnSpacing = 7.0
flowLayout.sectionInset = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20) flowLayout.sectionInset = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
let collectinoView = YHGestureCollectionView(frame: .zero, collectionViewLayout: flowLayout) let collectinoView = YHGestureCollectionView(frame: .zero, collectionViewLayout: flowLayout)
// collectinoView.contentInset = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
collectinoView.backgroundColor = .white collectinoView.backgroundColor = .white
collectinoView.register(YHHomeCollectionViewCell.self, forCellWithReuseIdentifier:YHHomeCollectionViewCell.cellReuseIdentifier) collectinoView.register(YHHomeCollectionViewCell.self, forCellWithReuseIdentifier:YHHomeCollectionViewCell.cellReuseIdentifier)
collectinoView.delegate = self collectinoView.delegate = self
...@@ -41,7 +45,14 @@ class YHServiceTableFootView: UIView { ...@@ -41,7 +45,14 @@ class YHServiceTableFootView: UIView {
super.init(frame: frame) super.init(frame: frame)
backgroundColor = .white backgroundColor = .white
setUpView() setUpView()
self.items = [AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://copyright.bdstatic.com/vcg/creative/cc9c744cf9f7c864889c563cbdeddce6.jpg@h_1280"),AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://inews.gtimg.com/om_bt/OjPq2cnMN_-ivDKjxpCZ2kk_ab8YC5VMnL-0pQ21fUvd4AA/1000"),AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://img.pconline.com.cn/images/upload/upc/tx/itbbs/2101/25/c1/251135935_1611532823091_mthumb.jpg"),AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: ""),AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://photo.16pic.com/00/47/86/16pic_4786353_b.jpg"),AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://inews.gtimg.com/om_bt/OMvPDmiuH_X5Vq1YLNgbFEzD2h_-2dCfWQ7xZFcKFSEsAAA/641")] self.items = [
AboutAdvantageItem(iconName: "about_match", title: "精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://copyright.bdstatic.com/vcg/creative/cc9c744cf9f7c864889c563cbdeddce6.jpg@h_1280"),
AboutAdvantageItem(iconName: "about_match", title: "精准匹配精准匹配精准匹配精准匹配精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://inews.gtimg.com/om_bt/OjPq2cnMN_-ivDKjxpCZ2kk_ab8YC5VMnL-0pQ21fUvd4AA/1000"),
AboutAdvantageItem(iconName: "about_match", title: "精准匹配精准匹配精准匹配精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://img.pconline.com.cn/images/upload/upc/tx/itbbs/2101/25/c1/251135935_1611532823091_mthumb.jpg"),
AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: ""),
AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://photo.16pic.com/00/47/86/16pic_4786353_b.jpg"),
AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高", url: "https://inews.gtimg.com/om_bt/OMvPDmiuH_X5Vq1YLNgbFEzD2h_-2dCfWQ7xZFcKFSEsAAA/641")
]
self.myCollectView.reloadData() self.myCollectView.reloadData()
} }
...@@ -55,9 +66,9 @@ class YHServiceTableFootView: UIView { ...@@ -55,9 +66,9 @@ class YHServiceTableFootView: UIView {
myCollectView.snp.makeConstraints { make in myCollectView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview() make.top.left.right.bottom.equalToSuperview()
} }
// self.myCollectView.es.addInfiniteScrolling { // self.myCollectView.es.addInfiniteScrolling {
// self.loadFakeData() // self.loadFakeData()
// } // }
} }
func updateAllViews() { func updateAllViews() {
...@@ -101,9 +112,9 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData ...@@ -101,9 +112,9 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData
print("index is \(indexPath.row)") print("index is \(indexPath.row)")
} }
// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { // func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
// //
// } // }
} }
extension YHServiceTableFootView: CollectionViewWaterfallLayoutDelegate { extension YHServiceTableFootView: CollectionViewWaterfallLayoutDelegate {
......
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