Commit aa5a40d4 by ludi

Merge branch 'feature/私讯+座驾体系' of http://git.yabolive.net:88/pidan/FuSiLive into feature/私讯+座驾体系

parents dab64430 c868ec3d
...@@ -1642,7 +1642,7 @@ ...@@ -1642,7 +1642,7 @@
}]; }];
}else if (status == PHAuthorizationStatusAuthorized) { }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; imagePickVC.imagePickerDelegate = self;
[FUSRouter.userRouter fus_setupImagePickerVideoTimeLimit:90 assetType:FUSAssetTypePhotoVideo]; [FUSRouter.userRouter fus_setupImagePickerVideoTimeLimit:90 assetType:FUSAssetTypePhotoVideo];
imagePickVC.showRecordBtn = NO; imagePickVC.showRecordBtn = NO;
......
...@@ -919,28 +919,42 @@ ...@@ -919,28 +919,42 @@
- (void)fetchPhotoData - (void)fetchPhotoData
{ {
if ([[FUSImagePickerManager sharedManager]isAuthorization]) { if ([[FUSImagePickerManager sharedManager]isAuthorization]) {
if (self.albumModel.result) { if (self.albumModel.result == nil) {
[self.photoCollectionView reloadData];
}else{
PHFetchResult *result = [PHAsset fetchAssetsWithMediaType:[FUSImagePickerManager sharedManager].phAssetType options:nil]; PHFetchResult *result = [PHAsset fetchAssetsWithMediaType:[FUSImagePickerManager sharedManager].phAssetType options:nil];
FUSAlbumModel *albumModel = [[FUSAlbumModel alloc] init]; FUSAlbumModel *albumModel = [[FUSAlbumModel alloc] init];
albumModel.title = [NSString fus_localString:@"相机胶卷"]; albumModel.title = [NSString fus_localString:@"相机胶卷"];
albumModel.count = result.count; albumModel.count = result.count;
albumModel.result = result; albumModel.result = result;
self.albumModel = albumModel;
}
self.photos = [NSMutableArray array]; self.photos = [NSMutableArray array];
NSEnumerationOptions option = [FUSImagePickerManager sharedManager].isPhotoListInReverseOrder ? NSEnumerationReverse : NSEnumerationConcurrent; NSEnumerationOptions option = [FUSImagePickerManager sharedManager].isPhotoListInReverseOrder ? NSEnumerationReverse : NSEnumerationConcurrent;
__weak typeof(self) weakSelf = self; __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) { //enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (![obj isKindOfClass:[PHAsset class]]) return ; 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]; FUSAssetModel *model = [[FUSAssetModel alloc]init];
model.asset = obj; model.asset = obj;
model.isSelected = [[FUSImagePickerManager sharedManager]fus_isModelSelected:model]; model.isSelected = [[FUSImagePickerManager sharedManager]fus_isModelSelected:model];
...@@ -951,7 +965,6 @@ ...@@ -951,7 +965,6 @@
[self.photoCollectionView reloadData]; [self.photoCollectionView reloadData];
}
}else{ }else{
[[FUSImagePickerManager sharedManager]fus_requestAuthorization:^(PHAuthorizationStatus status) { [[FUSImagePickerManager sharedManager]fus_requestAuthorization:^(PHAuthorizationStatus status) {
......
...@@ -511,7 +511,7 @@ FUSImagePickerViewControllerDelegate> ...@@ -511,7 +511,7 @@ FUSImagePickerViewControllerDelegate>
[FUSImagePickerManager sharedManager].confirmBtnTitle = [NSString fus_localString:@"确定"]; [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.modalPresentationStyle = UIModalPresentationFullScreen;
self.imagePickerVc.imagePickerDelegate = self; self.imagePickerVc.imagePickerDelegate = self;
...@@ -537,7 +537,7 @@ FUSImagePickerViewControllerDelegate> ...@@ -537,7 +537,7 @@ FUSImagePickerViewControllerDelegate>
}]; }];
}else if (status == PHAuthorizationStatusAuthorized) { }else if (status == PHAuthorizationStatusAuthorized) {
[FUSImagePickerManager sharedManager].confirmBtnTitle = [NSString fus_localString:@"确定"]; [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.modalPresentationStyle = UIModalPresentationFullScreen;
pickVc.imagePickerDelegate = self; pickVc.imagePickerDelegate = self;
......
...@@ -969,7 +969,7 @@ FUSImagePickerViewControllerDelegate ...@@ -969,7 +969,7 @@ FUSImagePickerViewControllerDelegate
return; 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.modalPresentationStyle = UIModalPresentationFullScreen;
self.imagePickerVc.imagePickerDelegate = self; self.imagePickerVc.imagePickerDelegate = self;
......
...@@ -245,7 +245,7 @@ ...@@ -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.modalPresentationStyle = UIModalPresentationFullScreen;
self.imagePickerVc.imagePickerDelegate = self; 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