Commit c868ec3d by pierce

fixed bugs

parent 8d5cb02b
......@@ -1642,7 +1642,7 @@
}];
}else if (status == PHAuthorizationStatusAuthorized) {
FUSPublicImagePickerViewController *imagePickVC = [FUSRouter.userRouter fus_imagePickerWithMaxImagesCount:6 columnNumber:4 isPushToPhoto:NO type:FUSAssetTypePhotoVideo];
FUSPublicImagePickerViewController *imagePickVC = [FUSRouter.userRouter fus_imagePickerWithMaxImagesCount:6 columnNumber:4 isPushToPhoto:YES type:FUSAssetTypePhotoVideo];
imagePickVC.imagePickerDelegate = self;
[FUSRouter.userRouter fus_setupImagePickerVideoTimeLimit:90 assetType:FUSAssetTypePhotoVideo];
imagePickVC.showRecordBtn = NO;
......
......@@ -919,28 +919,42 @@
- (void)fetchPhotoData
{
if ([[FUSImagePickerManager sharedManager]isAuthorization]) {
if (self.albumModel.result) {
[self.photoCollectionView reloadData];
}else{
if (self.albumModel.result == nil) {
PHFetchResult *result = [PHAsset fetchAssetsWithMediaType:[FUSImagePickerManager sharedManager].phAssetType options:nil];
FUSAlbumModel *albumModel = [[FUSAlbumModel alloc] init];
albumModel.title = [NSString fus_localString:@"相机胶卷"];
albumModel.count = result.count;
albumModel.result = result;
self.albumModel = albumModel;
}
self.photos = [NSMutableArray array];
NSEnumerationOptions option = [FUSImagePickerManager sharedManager].isPhotoListInReverseOrder ? NSEnumerationReverse : NSEnumerationConcurrent;
__weak typeof(self) weakSelf = self;
[albumModel.result enumerateObjectsWithOptions:option usingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[self.albumModel.result enumerateObjectsWithOptions:option usingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
//enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (![obj isKindOfClass:[PHAsset class]]) return ;
PHAsset *objAsset = (PHAsset *)obj;
switch ([FUSImagePickerManager sharedManager].phAssetType) {
case PHAssetMediaTypeImage:
if (objAsset.mediaType != PHAssetMediaTypeImage) {
return;
}
break;
case PHAssetMediaTypeVideo:
if (objAsset.mediaType != PHAssetMediaTypeVideo) {
return;
}
break;
default:
break;
}
FUSAssetModel *model = [[FUSAssetModel alloc]init];
model.asset = obj;
model.isSelected = [[FUSImagePickerManager sharedManager]fus_isModelSelected:model];
......@@ -951,7 +965,6 @@
[self.photoCollectionView reloadData];
}
}else{
[[FUSImagePickerManager sharedManager]fus_requestAuthorization:^(PHAuthorizationStatus status) {
......
......@@ -511,7 +511,7 @@ FUSImagePickerViewControllerDelegate>
[FUSImagePickerManager sharedManager].confirmBtnTitle = [NSString fus_localString:@"确定"];
self.imagePickerVc = [[FUSImagePickerViewController alloc] initWithMaxImagesCount:leftCount columnNumber:4 isPushToPhoto:NO type:assetType];
self.imagePickerVc = [[FUSImagePickerViewController alloc] initWithMaxImagesCount:leftCount columnNumber:4 isPushToPhoto:YES type:assetType];
self.imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
self.imagePickerVc.imagePickerDelegate = self;
......@@ -537,7 +537,7 @@ FUSImagePickerViewControllerDelegate>
}];
}else if (status == PHAuthorizationStatusAuthorized) {
[FUSImagePickerManager sharedManager].confirmBtnTitle = [NSString fus_localString:@"确定"];
FUSImagePickerViewController *pickVc = [[FUSImagePickerViewController alloc] initWithMaxImagesCount:1 columnNumber:3 type:FUSAssetTypeVideo];
FUSImagePickerViewController *pickVc = [[FUSImagePickerViewController alloc] initWithMaxImagesCount:1 columnNumber:3 isPushToPhoto:YES type:FUSAssetTypeVideo];
pickVc.modalPresentationStyle = UIModalPresentationFullScreen;
pickVc.imagePickerDelegate = self;
......
......@@ -969,7 +969,7 @@ FUSImagePickerViewControllerDelegate
return;
}
self.imagePickerVc = [[FUSImagePickerViewController alloc] initWithMaxImagesCount:6 - images.count columnNumber:4 isPushToPhoto:NO type:FUSAssetTypePhoto];
self.imagePickerVc = [[FUSImagePickerViewController alloc] initWithMaxImagesCount:6 - images.count columnNumber:4 isPushToPhoto:YES type:FUSAssetTypePhoto];
self.imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
self.imagePickerVc.imagePickerDelegate = self;
......
......@@ -245,7 +245,7 @@
}
self.imagePickerVc = [[FUSImagePickerViewController alloc] initWithMaxImagesCount:1 columnNumber:4 isPushToPhoto:NO type:FUSAssetTypePhoto];
self.imagePickerVc = [[FUSImagePickerViewController alloc] initWithMaxImagesCount:1 columnNumber:4 isPushToPhoto:YES type:FUSAssetTypePhoto];
self.imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
self.imagePickerVc.imagePickerDelegate = self;
......
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 sign in to comment