Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PhoneManager
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yang
PhoneManager
Commits
00999a0c
Commit
00999a0c
authored
May 19, 2025
by
CZ1004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【优化】修复bug
parent
92bec182
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
34 deletions
+41
-34
CompressController.swift
...r/Class/Page/Compress/Controller/CompressController.swift
+2
-2
HomePhotosDetailViewController.swift
...Page/Home/Controller/HomePhotosDetailViewController.swift
+15
-11
HomeVideoDetailController.swift
...lass/Page/Home/Controller/HomeVideoDetailController.swift
+16
-14
PhotoRemoveViewController.swift
...lass/Page/Home/Controller/PhotoRemoveViewController.swift
+4
-4
TrashSubView.swift
PhoneManager/Class/Page/Home/View/TrashSubView.swift
+3
-3
TrashDataManager.swift
...nager/Class/Page/Trash/DataManager/TrashDataManager.swift
+1
-0
No files found.
PhoneManager/Class/Page/Compress/Controller/CompressController.swift
View file @
00999a0c
...
...
@@ -128,7 +128,7 @@ class CompressController : BaseViewController {
guard
let
self
else
{
return
}
self
.
resourceData
=
models
Singleton
.
shared
.
resourceModel
=
self
.
resourceData
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
1.0
)
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.5
)
{
PMLoadingHUD
.
share
.
disMiss
()
}
}
...
...
@@ -251,7 +251,7 @@ extension CompressController:WaterfallMutiSectionDelegate,UICollectionViewDataSo
CompressViewModel
()
.
getAllPhotosToAssets
(
sortType
:
self
.
currentSort
,
assetType
:
flag
)
{
[
weak
self
]
models
in
guard
let
self
else
{
return
}
self
.
resourceData
=
models
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
1.0
)
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.5
)
{
PMLoadingHUD
.
share
.
disMiss
()
}
}
...
...
PhoneManager/Class/Page/Home/Controller/HomePhotosDetailViewController.swift
View file @
00999a0c
...
...
@@ -47,21 +47,21 @@ class HomePhotosDetailViewController : BaseViewController {
self
.
deleteButtonView
.
deleteButton
.
setTitle
(
"Delete"
,
for
:
.
normal
)
UIView
.
animate
(
withDuration
:
0.1
)
{
// 更新约束
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
-
safeHeight
+
78
)
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
safeHeight
+
78
)
}
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
safeHeight
)
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
)
}
else
if
self
.
selectedModel
.
count
==
1
{
self
.
deleteButtonView
.
deleteButton
.
setTitle
(
"Delete
\(
self
.
selectedModel
.
count
)
Photo"
,
for
:
.
normal
)
UIView
.
animate
(
withDuration
:
0.1
)
{
// 更新约束
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
-
safeHeight
)
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
0
)
}
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
78
-
safeHeight
)
}
else
{
self
.
deleteButtonView
.
deleteButton
.
setTitle
(
"Delete
\(
self
.
selectedModel
.
count
)
Photos"
,
for
:
.
normal
)
UIView
.
animate
(
withDuration
:
0.1
)
{
// 更新约束
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
-
safeHeight
)
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
0
)
}
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
78
-
safeHeight
)
}
...
...
@@ -194,10 +194,10 @@ class HomePhotosDetailViewController : BaseViewController {
self
.
view
.
addSubview
(
self
.
deleteButtonView
)
self
.
deleteButtonView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
15
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
15
)
make
.
height
.
equalTo
(
78
)
self
.
deleteViewBottomConstraint
=
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
safeHeight
+
78
)
.
constraint
make
.
left
.
equalToSuperview
()
make
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
78
+
safeHeight
)
self
.
deleteViewBottomConstraint
=
make
.
bottom
.
equalToSuperview
()
.
offset
(
safeHeight
+
78
)
.
constraint
}
self
.
view
.
addSubview
(
self
.
defaultImageView
)
...
...
@@ -224,8 +224,8 @@ class HomePhotosDetailViewController : BaseViewController {
self
.
view
.
addSubview
(
self
.
trashSubView
)
self
.
trashSubView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
safeHeight
)
make
.
height
.
equalTo
(
78
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
0
)
make
.
height
.
equalTo
(
78
+
safeHeight
)
}
// 判断垃圾桶有没有数据
let
array
=
TrashDataManager
.
getCurrentMediaTypeTrashData
(
mediaType
:
self
.
mediaType
==
PhotsFileType
.
Other
?
TrashTypeEnum
.
other
:
TrashTypeEnum
.
shot
)
...
...
@@ -238,7 +238,7 @@ class HomePhotosDetailViewController : BaseViewController {
if
array
.
count
>
0
{
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
78
-
safeHeight
)
}
else
{
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
safeHeight
)
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
)
}
}
}
...
...
@@ -290,6 +290,9 @@ class HomePhotosDetailViewController : BaseViewController {
let
vc
:
TrashViewController
=
TrashViewController
()
vc
.
currentPage
=
self
.
mediaType
==
PhotsFileType
.
Other
?
2
:
3
vc
.
dissmisCallBack
=
{
self
.
getCurrentPageData
{
self
.
collectionView
.
reloadData
()
}
self
.
addTrashView
()
}
self
.
present
(
vc
,
animated
:
true
)
...
...
@@ -414,6 +417,7 @@ class HomePhotosDetailViewController : BaseViewController {
completed
(
cachedImage
!
)
}
let
fetchResult
=
PHAsset
.
fetchAssets
(
withLocalIdentifiers
:
[
model
.
localIdentifier
],
options
:
nil
)
let
assetsArray
=
fetchResult
.
objects
(
at
:
IndexSet
(
0
..<
fetchResult
.
count
))
let
options
=
PHImageRequestOptions
()
...
...
PhoneManager/Class/Page/Home/Controller/HomeVideoDetailController.swift
View file @
00999a0c
...
...
@@ -40,21 +40,21 @@ class HomeVideoDetailController :BaseViewController {
self
.
deleteButtonView
.
deleteButton
.
setTitle
(
"Delete"
,
for
:
.
normal
)
UIView
.
animate
(
withDuration
:
0.1
)
{
// 更新约束
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
-
safeHeight
+
78
)
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
safeHeight
+
78
)
}
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
safeHeight
)
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
)
}
else
if
self
.
selectedModel
.
count
==
1
{
self
.
deleteButtonView
.
deleteButton
.
setTitle
(
"Delete
\(
self
.
selectedModel
.
count
)
Video"
,
for
:
.
normal
)
UIView
.
animate
(
withDuration
:
0.1
)
{
// 更新约束
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
-
safeHeight
)
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
0
)
}
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
78
-
safeHeight
)
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
78
)
}
else
{
self
.
deleteButtonView
.
deleteButton
.
setTitle
(
"Delete
\(
self
.
selectedModel
.
count
)
Videos"
,
for
:
.
normal
)
UIView
.
animate
(
withDuration
:
0.1
)
{
// 更新约束
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
-
safeHeight
)
self
.
deleteViewBottomConstraint
?
.
update
(
offset
:
0
)
}
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
78
-
safeHeight
)
}
...
...
@@ -232,10 +232,10 @@ class HomeVideoDetailController :BaseViewController {
self
.
view
.
addSubview
(
self
.
deleteButtonView
)
self
.
deleteButtonView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
15
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
15
)
make
.
height
.
equalTo
(
78
)
self
.
deleteViewBottomConstraint
=
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
safeHeight
+
78
)
.
constraint
make
.
left
.
equalToSuperview
()
make
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
78
+
safeHeight
)
self
.
deleteViewBottomConstraint
=
make
.
bottom
.
equalToSuperview
()
.
offset
(
safeHeight
+
78
)
.
constraint
}
self
.
view
.
addSubview
(
self
.
defaultImageView
)
self
.
defaultImageView
.
snp
.
makeConstraints
{
make
in
...
...
@@ -273,6 +273,9 @@ class HomeVideoDetailController :BaseViewController {
let
vc
:
TrashViewController
=
TrashViewController
()
vc
.
currentPage
=
1
vc
.
dissmisCallBack
=
{
self
.
getCurrentPageData
{
self
.
collectionView
.
reloadData
()
}
self
.
addTrashView
()
}
self
.
present
(
vc
,
animated
:
true
)
...
...
@@ -297,8 +300,8 @@ class HomeVideoDetailController :BaseViewController {
self
.
view
.
addSubview
(
self
.
trashSubView
)
self
.
trashSubView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
safeHeight
)
make
.
height
.
equalTo
(
78
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
0
)
make
.
height
.
equalTo
(
78
+
safeHeight
)
}
// 判断垃圾桶有没有数据
let
array
=
TrashDataManager
.
getCurrentMediaTypeTrashData
(
mediaType
:
TrashTypeEnum
.
video
)
...
...
@@ -311,7 +314,7 @@ class HomeVideoDetailController :BaseViewController {
if
array
.
count
>
0
{
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
78
-
safeHeight
)
}
else
{
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
-
safeHeight
)
self
.
collectionView
.
frame
=
CGRect
(
x
:
marginLR
,
y
:
self
.
videoDetailNavView
!.
height
,
width
:
self
.
view
.
width
-
2
*
marginLR
,
height
:
self
.
view
.
height
-
self
.
videoDetailNavView
!.
height
)
}
}
}
...
...
@@ -391,6 +394,7 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
else
{
let
vc
=
PMShowImgVideoController
()
vc
.
oldPageIndexPath
=
indexPath
vc
.
state
=
.
similarVideos
vc
.
currentIdx
=
0
let
dataSource
=
ImageSeletedCollectionItem
()
...
...
@@ -435,8 +439,6 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
}
}
}
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
errorHandler
:
{
...
...
PhoneManager/Class/Page/Home/Controller/PhotoRemoveViewController.swift
View file @
00999a0c
...
...
@@ -95,8 +95,8 @@ class PhotoRemoveViewController: BaseViewController {
self
.
view
.
addSubview
(
self
.
trashSubView
)
self
.
trashSubView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
self
.
bottomConstraint
=
make
.
bottom
.
equalToSuperview
()
.
offset
(
78
)
.
constraint
make
.
height
.
equalTo
(
78
)
self
.
bottomConstraint
=
make
.
bottom
.
equalToSuperview
()
.
offset
(
78
+
safeHeight
)
.
constraint
make
.
height
.
equalTo
(
78
+
safeHeight
)
}
self
.
trashSubView
.
clearTashDataCallBack
=
{[
weak
self
]
in
...
...
@@ -239,7 +239,7 @@ class PhotoRemoveViewController: BaseViewController {
self
.
trashSubView
.
isHidden
=
false
UIView
.
animate
(
withDuration
:
0.1
)
{
// 更新约束
self
.
bottomConstraint
?
.
update
(
offset
:
-
safeHeight
)
self
.
bottomConstraint
?
.
update
(
offset
:
0
)
}
}
}
...
...
@@ -247,7 +247,7 @@ class PhotoRemoveViewController: BaseViewController {
DispatchQueue
.
main
.
async
{
UIView
.
animate
(
withDuration
:
0.1
)
{
// 更新约束
self
.
bottomConstraint
?
.
update
(
offset
:
-
78
)
self
.
bottomConstraint
?
.
update
(
offset
:
78
+
safeHeight
)
}
completion
:
{
finished
in
self
.
trashSubView
.
isHidden
=
true
}
...
...
PhoneManager/Class/Page/Home/View/TrashSubView.swift
View file @
00999a0c
...
...
@@ -64,20 +64,20 @@ class TrashSubView: UIView {
private
func
setUILocation
(){
self
.
resourceCountlabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
centerY
.
equalToSuperview
(
)
make
.
top
.
equalToSuperview
()
.
offset
(
28
)
make
.
height
.
equalTo
(
22
)
make
.
width
.
equalTo
(
30
)
}
self
.
tipLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
17
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
17
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
17
-
safeHeight
)
make
.
left
.
equalTo
(
self
.
resourceCountlabel
.
snp
.
right
)
.
offset
(
11
)
make
.
width
.
equalTo
(
100
)
}
self
.
emptyButton
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalToSuperview
()
.
offset
(
-
9
)
make
.
height
.
equalTo
(
38
)
make
.
centerY
.
equalToSuperview
(
)
make
.
top
.
equalToSuperview
()
.
offset
(
20
)
make
.
width
.
equalTo
(
145
)
}
}
...
...
PhoneManager/Class/Page/Trash/DataManager/TrashDataManager.swift
View file @
00999a0c
...
...
@@ -29,6 +29,7 @@ class TrashDataManager {
clearCurrentMediaTypeTrashSigtonData
(
mediaType
:
mediaType
)
clearCurrentMediaTypeTrashDBData
(
mediaType
:
mediaType
)
// 删除完成之后回调
PhotoManager
.
shared
.
removeDataWhenDeleteInPage
(
data
:
trashData
)
comlete
()
}
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment