| | |
| | | class HomeDetailAttachVC: BaseViewController,Refreshable { |
| | | |
| | | @IBOutlet weak var attachTableView: BaseTableView! |
| | | private(set) var orderId:String! |
| | | private(set) var orderId:String! |
| | | public let refreshStatus = BehaviorSubject(value: RefreshStatus.others) |
| | | private var page = 1 |
| | | private var datas = [AttachmentRecordModel]() |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | view.jq_height = 1000 |
| | | view.backgroundColor = UIColor(hexStr: "#F9FAFF") |
| | | attachTableView.delegate = self |
| | | attachTableView.dataSource = self |
| | |
| | | } |
| | | |
| | | func scrollViewDidScroll(_ scrollView: UIScrollView) { |
| | | |
| | | |
| | | let totalHeight = adapterViewController.headHeight |
| | | let offset = totalHeight - scrollView.contentOffset.y |
| | | let isTop = (offset - topSafeHeight) < 0 |
| | | |
| | | if scrollView.contentOffset.y > 0 && !isTop{ |
| | | adapterViewController.scrollview.contentOffset = scrollView.contentOffset |
| | | } |
| | | let totalHeight = adapterViewController?.headHeight ?? 0 |
| | | let offset = totalHeight - scrollView.contentOffset.y |
| | | let isTop = (offset - topSafeHeight) < 0 |
| | | if scrollView.contentOffset.y >= 0 { |
| | | if isTop{ |
| | | print("-->1") |
| | | adapterViewController?.scrollview.contentOffset = CGPoint(x: 0, y: totalHeight - topSafeHeight) |
| | | }else if scrollView.contentOffset.y <= 0{ |
| | | print("-->2") |
| | | adapterViewController?.scrollview.setContentOffset(.zero, animated: true) |
| | | }else{ |
| | | print("-->3") |
| | | adapterViewController?.scrollview.contentOffset = scrollView.contentOffset |
| | | } |
| | | } |
| | | } |
| | | |
| | | private func getData(_ isHeader:Bool = true){ |