younger_times
2023-07-04 b01e1f8e597092fcaba5f5d7d3b472f3b6e95807
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
//  SearchVC.swift
//  WanPai
//
//  Created by 杨锴 on 2023/6/8.
//
 
import UIKit
import JQTools
 
class SearchVC: BaseVC {
    @IBOutlet weak var scrollView: UIScrollView!
    @IBOutlet weak var banner_collectionView: UICollectionView!
 
 
    override func viewDidLoad() {
        super.viewDidLoad()
        scrollView.contentInsetAdjustmentBehavior = .never
    }
 
 
    override func setUI() {
        banner_collectionView.delegate = self
        banner_collectionView.dataSource = self
        banner_collectionView.register(UINib(nibName: "SearchBannerCCell", bundle: nil), forCellWithReuseIdentifier: "_SearchBannerCCell")
    }
 
 
    @IBAction func customerAction(_ sender: Any) {
        let vc = CustomerListVC()
        push(vc: vc)
    }
 
    override var preferredStatusBarStyle: UIStatusBarStyle{
        return .darkContent
    }
}
 
extension SearchVC:UICollectionViewDelegate{
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let vc = SearchStoreListVC()
        push(vc: vc)
    }
}
 
extension SearchVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 5
    }
 
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_SearchBannerCCell", for: indexPath) as! SearchBannerCCell
        return cell
    }
}
 
 
extension SearchVC:UICollectionViewDelegateFlowLayout{
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
        return 0
    }
 
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
        return 0
    }
 
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        return CGSize(width: JQ_ScreenW, height: JQ_ScreenW * 0.6541)
    }
}