Commit 446e6dd9 authored by yqz's avatar yqz

Merge branch 'dev_main' into yQz0507

* dev_main:
  1
  【修改】删除方法
  【修改】优化

# Conflicts:
#	PhoneManager/Class/Page/Home/Controller/PhotoRemoveViewController.swift
parents 5ea0eb91 045cc5ee
......@@ -265,7 +265,9 @@ class HomePhotosDetailViewController : BaseViewController {
/// 获取当前页面数据
/// - Parameter completed: 完成回调
func getCurrentPageData(completed:@escaping ()->Void){
// FIXME: 从新获取数据
PhotoManager.shared.reloadTrashAndKeep()
var data = self.mediaType == .Other ? PhotoManager.shared.filterOtherModels : PhotoManager.shared.filterScreenShotModels
// 过滤掉垃圾桶数据
......
......@@ -101,6 +101,9 @@ class HomeVideoDetailController :BaseViewController {
/// 获取当前页面数据
/// - Parameter completed: 完成回调
func getCurrentPageData(completed:@escaping ()->Void){
PhotoManager.shared.reloadTrashAndKeep()
var data = PhotoManager.shared.filterVideoModels
// 过滤掉垃圾桶数据
......@@ -597,11 +600,6 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
// 移除当前数据
self.resourceData.removeAll{ $0.localIdentifier == item.localIdentifier }
}
// 清理下缓存数据
//PhotoDataManager.manager.removeDataWhenDeleteInPage(data: self.selectedModel)
PhotoManager.shared.removeDataWhenDeleteInPage(data: self.selectedModel) {
// 删除完成刷新数据
}
......
......@@ -167,6 +167,15 @@ class HomeInfoView :UIView {
make.height.equalTo(38)
make.width.equalTo(24)
}
self.nextRowButton.isHidden = !self.isShowNextRowButton()
}
/// 是否显示下一个按钮
/// - Returns: 是否显示
func isShowNextRowButton() -> Bool{
return self.ids?.count ?? 0 > 0 && (self.type == .similar || self.type == .similarScreenshots)
}
func changeValue() {
......@@ -298,6 +307,7 @@ class HomeInfoView :UIView {
deleteView.changeContent(title: self.type!.rawValue, seletedCount: seletedNumber)
tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: deleteView.isHidden ? 12 : deleteView.height + 12 , right: 0)
self.nextRowButton.isHidden = !self.isShowNextRowButton()
}
}
......@@ -337,18 +347,29 @@ extension HomeInfoView:UITableViewDataSource,UITableViewDelegate {
/// 让表格自动滚动一行
private func tableScrollToNextRow(){
if let indexPath = tableView.indexPathsForVisibleRows?.first {
// 计算下一行的索引
let nextRow = indexPath.row + 1
let nextSection = indexPath.section
// 检查下一行是否存在
if nextRow < tableView.numberOfRows(inSection: nextSection) {
let nextIndexPath = IndexPath(row: nextRow, section: nextSection)
// 滚动到下一行
tableView.scrollToRow(at: nextIndexPath, at: .top, animated: true)
}
}
private func tableScrollToNextRow() {
guard let indexPath = tableView.indexPathsForVisibleRows?.first else { return }
let nextRow = indexPath.row + 1
let nextSection = indexPath.section
// 检查下一行是否存在
guard nextRow < tableView.numberOfRows(inSection: nextSection) else { return }
let nextIndexPath = IndexPath(row: nextRow, section: nextSection)
// 计算目标行的位置
let targetRect = tableView.rectForRow(at: nextIndexPath)
// 向上微调的偏移量(例如 20 点)
let adjustedOffset = CGPoint(
x: 0,
y: targetRect.origin.y - 38 // 修改这里的数值调整微调量
)
// 直接滚动到调整后的位置
tableView.setContentOffset(adjustedOffset, animated: true)
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
......
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