Commit dc5ba551 authored by pete谢兆麟's avatar pete谢兆麟

首页甄选 优化

parent fb4be09d
......@@ -90,7 +90,10 @@ extension YHSelectViewController {
let model = self.viewModel.categoryArray[selectItem]
self.viewModel.getGoodsList(categoryID: model.id, sortType: buttonItem) {[weak self] success, error in
guard let self = self else { return }
self.tableView.reloadData()
self.tableView.reloadData {
self.tableView.contentOffset = CGPoint(x: 0, y: 92)
self.sectionView.isHidden = false
}
if self.viewModel.goodsArray.count == 0 {
noDataView.isHidden = false
} else {
......@@ -116,19 +119,15 @@ extension YHSelectViewController {
let head = YHSelectLookHeadView()
head.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 66)
head.block = { index in
self.sectionView.isHidden = true
self.selectItem = index
self.buttonItem = 0
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
self.updataData()
self.tableView.contentOffset = CGPoint(x: 0, y: 92)
}
self.updataData()
}
head.buttonBlock = { index in
self.buttonItem = index
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
self.updataData()
self.tableView.contentOffset = CGPoint(x: 0, y: 92)
}
self.sectionView.isHidden = true
self.updataData()
}
return head
}()
......@@ -158,7 +157,7 @@ extension YHSelectViewController {
}
tableView.es.addYHPullToRefresh {
self.updataData()
self.loadData()
self.tableView.es.stopPullToRefresh()
}
......
......@@ -214,7 +214,7 @@ extension YHSelectLookHeadView: UICollectionViewDelegate, UICollectionViewDataSo
if let block = block {
block(indexPath.row)
}
print("index is \(indexPath.row)")
collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
......
......@@ -37,7 +37,7 @@ class YHCompanySelectViewController: YHBaseViewController {
let bgView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xf8f9fb)
view.layer.cornerRadius = 20.5
view.layer.cornerRadius = 3
return view
}()
view.addSubview(bgView)
......@@ -55,10 +55,10 @@ class YHCompanySelectViewController: YHBaseViewController {
searchBar.font = UIFont.PFSC_R(ofSize: 14)
searchBar.keyboardType = .default
searchBar.delegate = self
searchBar.layer.cornerRadius = 3
searchBar.leftView = UIView(frame: CGRect(x: 0, y: 0, width: 16, height: 42))
searchBar.leftViewMode = .always
searchBar.clearButtonMode = .always
searchBar.layer.cornerRadius = 3
return searchBar
}()
view.addSubview(searchView)
......@@ -77,7 +77,6 @@ class YHCompanySelectViewController: YHBaseViewController {
button.setTitle("确认", for: .normal)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 3
button.addTarget(self, action: #selector(submit), for: .touchUpInside)
return button
}()
......
......@@ -203,7 +203,7 @@ class YHGCMainInformationCardTableViewCell: UITableViewCell {
centerView.addSubview(frontLabel)
frontLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(centerView.snp.centerX)
make.width.equalTo(147)
make.top.equalTo(64)
make.height.equalTo(20)
}
......@@ -218,7 +218,7 @@ class YHGCMainInformationCardTableViewCell: UITableViewCell {
centerView.addSubview(backSurfaceLabel)
backSurfaceLabel.snp.makeConstraints { make in
make.right.equalTo(-18)
make.left.equalTo(centerView.snp.centerX)
make.width.equalTo(147)
make.top.equalTo(64)
make.height.equalTo(20)
}
......
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