浏览代码

1.相册预览显示

huangxiaodong 2 年之前
父节点
当前提交
cd9e443902

+ 16 - 0
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -151,6 +151,10 @@
 		6B0581AF2AFCF57300D37290 /* AJPhotoGroupCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B0581A92AFCF57300D37290 /* AJPhotoGroupCell.h */; };
 		6B0581B22AFE02B100D37290 /* uploadFileBottomView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B0581B02AFE02B100D37290 /* uploadFileBottomView.h */; };
 		6B0581B32AFE02B100D37290 /* uploadFileBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0581B12AFE02B100D37290 /* uploadFileBottomView.m */; };
+		6B0582632AFF4B7D00D37290 /* PhotoPreviewViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B0582612AFF4B7D00D37290 /* PhotoPreviewViewController.h */; };
+		6B0582642AFF4B7D00D37290 /* PhotoPreviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0582622AFF4B7D00D37290 /* PhotoPreviewViewController.m */; };
+		6B05826F2AFF692700D37290 /* photoPreViewBottomView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B05826D2AFF692700D37290 /* photoPreViewBottomView.h */; };
+		6B0582702AFF692700D37290 /* photoPreViewBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B05826E2AFF692700D37290 /* photoPreViewBottomView.m */; };
 		6B3F96342AD2A15A008E349E /* netWorkManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3F96322AD2A15A008E349E /* netWorkManager.h */; };
 		6B3F96352AD2A15A008E349E /* netWorkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3F96332AD2A15A008E349E /* netWorkManager.m */; };
 		6B3F963A2AD2AD0B008E349E /* newWorkInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3F96392AD2AD0B008E349E /* newWorkInterface.h */; };
@@ -486,6 +490,10 @@
 		6B0581A92AFCF57300D37290 /* AJPhotoGroupCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AJPhotoGroupCell.h; sourceTree = "<group>"; };
 		6B0581B02AFE02B100D37290 /* uploadFileBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileBottomView.h; sourceTree = "<group>"; };
 		6B0581B12AFE02B100D37290 /* uploadFileBottomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileBottomView.m; sourceTree = "<group>"; };
+		6B0582612AFF4B7D00D37290 /* PhotoPreviewViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PhotoPreviewViewController.h; sourceTree = "<group>"; };
+		6B0582622AFF4B7D00D37290 /* PhotoPreviewViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PhotoPreviewViewController.m; sourceTree = "<group>"; };
+		6B05826D2AFF692700D37290 /* photoPreViewBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = photoPreViewBottomView.h; sourceTree = "<group>"; };
+		6B05826E2AFF692700D37290 /* photoPreViewBottomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = photoPreViewBottomView.m; sourceTree = "<group>"; };
 		6B3F96322AD2A15A008E349E /* netWorkManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = netWorkManager.h; sourceTree = "<group>"; };
 		6B3F96332AD2A15A008E349E /* netWorkManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = netWorkManager.m; sourceTree = "<group>"; };
 		6B3F96392AD2AD0B008E349E /* newWorkInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = newWorkInterface.h; sourceTree = "<group>"; };
@@ -1097,6 +1105,8 @@
 				6B0581622AFCDB4300D37290 /* photoView */,
 				6B05815E2AFCD0DF00D37290 /* uploadImageOrVideoViewController.h */,
 				6B05815F2AFCD0DF00D37290 /* uploadImageOrVideoViewController.m */,
+				6B0582612AFF4B7D00D37290 /* PhotoPreviewViewController.h */,
+				6B0582622AFF4B7D00D37290 /* PhotoPreviewViewController.m */,
 			);
 			path = uploadFile;
 			sourceTree = "<group>";
@@ -1114,6 +1124,8 @@
 				6B05819C2AFCF4E700D37290 /* AJPhotoListView.m */,
 				6B0581B02AFE02B100D37290 /* uploadFileBottomView.h */,
 				6B0581B12AFE02B100D37290 /* uploadFileBottomView.m */,
+				6B05826D2AFF692700D37290 /* photoPreViewBottomView.h */,
+				6B05826E2AFF692700D37290 /* photoPreViewBottomView.m */,
 			);
 			path = photoView;
 			sourceTree = "<group>";
@@ -1579,6 +1591,7 @@
 				6BF52C972AD5546500A617DB /* SimplePing.h in Headers */,
 				6B3F96342AD2A15A008E349E /* netWorkManager.h in Headers */,
 				184C8ADD2A949DBD00F26650 /* HWVersionModel.h in Headers */,
+				6B05826F2AFF692700D37290 /* photoPreViewBottomView.h in Headers */,
 				6B7B65582AD9227700BE8CB3 /* PlayerViewController+otherDelegate.h in Headers */,
 				186820212AB98600005702A6 /* QRCodeScanViewController.h in Headers */,
 				18FCE5482AD15E750020F623 /* PlayerViewController+AppDelegate.h in Headers */,
@@ -1599,6 +1612,7 @@
 				18963B462AB84398006E7C50 /* GuideView.h in Headers */,
 				18A909982ABC4A3300E6D2BE /* ComontAlretViewController.h in Headers */,
 				186820192AB94877005702A6 /* GuideLastView.h in Headers */,
+				6B0582632AFF4B7D00D37290 /* PhotoPreviewViewController.h in Headers */,
 				6B0581AD2AFCF57300D37290 /* AJPhotoGroupView.h in Headers */,
 				18F9CB072ABD7835003FF71A /* QRCodeScanForChangeDeviceViewController.h in Headers */,
 				18664FF62AC2B3A4008F8A61 /* ShearDeviceUDPManager.h in Headers */,
@@ -1935,6 +1949,7 @@
 				183AE6572A8A2CF000B11CB0 /* AFURLRequestSerialization.m in Sources */,
 				6B0581AC2AFCF57300D37290 /* AJPhotoGroupCell.m in Sources */,
 				184C8AD92A949DAC00F26650 /* HaveNewVersionView.m in Sources */,
+				6B0582642AFF4B7D00D37290 /* PhotoPreviewViewController.m in Sources */,
 				A003F6B527D841EE00715CBF /* UIView+HWCategory.m in Sources */,
 				A003F6E227D8428200715CBF /* Const.m in Sources */,
 				A08A94FE27E9A4E400C544BB /* BGTool.m in Sources */,
@@ -1998,6 +2013,7 @@
 				183AE6562A8A2CF000B11CB0 /* AFURLSessionManager.m in Sources */,
 				1868201A2AB94877005702A6 /* GuideLastView.m in Sources */,
 				18F9CB002ABD3643003FF71A /* ModifyPWDSecondViewController.m in Sources */,
+				6B0582702AFF692700D37290 /* photoPreViewBottomView.m in Sources */,
 				1868201E2AB97BE1005702A6 /* TipsQRCodeViewController.m in Sources */,
 				183AE6092A89CE3C00B11CB0 /* JSONAPI.m in Sources */,
 				6BF52CAE2AD82EA500A617DB /* PlayerControlButTipView.m in Sources */,

+ 22 - 0
创维盒子/双子星云手机/Assets.xcassets/Base/icon_white_back.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "icon_white_back@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "icon_white_back@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二进制
创维盒子/双子星云手机/Assets.xcassets/Base/icon_white_back.imageset/icon_white_back@2x.png


二进制
创维盒子/双子星云手机/Assets.xcassets/Base/icon_white_back.imageset/icon_white_back@3x.png


+ 18 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/PhotoPreviewViewController.h

@@ -0,0 +1,18 @@
+//
+//  PhotoPreviewViewController.h
+//  隐私保护
+//
+//  Created by xd h on 2023/11/11.
+//
+
+#import "BaseViewController.h"
+#import "TZImageManager.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface PhotoPreviewViewController : BaseViewController
+@property (strong, nonatomic) NSMutableArray *assets;
+@property (nonatomic, assign) NSInteger currentIndex;///< Index of the photo user click / 用户点击的图片的索引
+@end
+
+NS_ASSUME_NONNULL_END

+ 232 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/PhotoPreviewViewController.m

@@ -0,0 +1,232 @@
+//
+//  PhotoPreviewViewController.m
+//  隐私保护
+//
+//  Created by xd h on 2023/11/11.
+//
+
+#import "PhotoPreviewViewController.h"
+#import "TZPhotoPreviewCell.h"
+#import "photoPreViewBottomView.h"
+
+@interface PhotoPreviewViewController ()<UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout,UIScrollViewDelegate>
+@property (strong, nonatomic) UIButton *selectButton;
+@property (strong, nonatomic) UICollectionView *photoPreviewCollectionV;
+@property (strong, nonatomic) photoPreViewBottomView *photoPreViewBottomV;
+
+@property (assign, nonatomic) BOOL canSetCurrentIndex;//
+@end
+
+@implementation PhotoPreviewViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self.view setBackgroundColor:[UIColor blackColor]];
+    
+    [self.toolBar setHidden:YES];
+    [self.navigationBar setHidden:YES];
+    [self.navBarBGView setHidden:NO];
+    
+    [self setupPhotoPreviewNavBarView];
+    //列表view
+    [self setupPhotoPreviewCollectionView];
+    [self setupPhotoPreViewBottomView];
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear: animated];
+    //[self.photoPreviewCollectionV reloadData];
+    
+    if (_currentIndex) {
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            self->_canSetCurrentIndex = YES;
+            [self.photoPreviewCollectionV setContentOffset:CGPointMake(SCREEN_W * self.currentIndex, 0) animated:NO];
+        });
+    }
+    
+    [self refreshNaviBarAndBottomBarState];
+}
+
+#pragma mark 点击选中按钮
+- (void)didClickButtonFun:(UIButton*)but
+{
+    but.selected = !but.selected;
+}
+
+#pragma mark 刷新导航栏的UI
+- (void)refreshNaviBarAndBottomBarState
+{
+    self.titleLabel.text = [[NSString alloc] initWithFormat:@"%ld/%ld",(_currentIndex+1),_assets.count];
+}
+
+- (void)setupPhotoPreviewNavBarView
+{
+    [self.backBtn setImage:[UIImage imageNamed:@"icon_white_back"] forState:UIControlStateNormal];
+    self.navBarBGView.backgroundColor = [UIColor blackColor];
+    self.titleLabel.textColor = [UIColor whiteColor];
+    
+    UIButton *but = [[UIButton alloc] init];
+    [but setImage:[UIImage imageNamed:@"upload_file_uncheck"] forState:UIControlStateNormal];
+    [but setImage:[UIImage imageNamed:@"upload_file_check"] forState:UIControlStateSelected];
+    [but addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    [self.navBarBGView addSubview:but];
+
+    self.selectButton = but;
+    
+    [but mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15);
+        make.width.mas_equalTo(40);
+        make.height.mas_equalTo(40);
+        make.centerY.equalTo(self.titleLabel.mas_centerY).offset(0.f);
+       
+    }];
+}
+- (void)setupPhotoPreviewCollectionView
+{
+    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
+    [flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
+    
+    UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:flowLayout];
+    collectionView.dataSource = self;
+    collectionView.delegate = self;
+    collectionView.translatesAutoresizingMaskIntoConstraints = NO;
+    collectionView.pagingEnabled = YES;
+    collectionView.showsVerticalScrollIndicator = NO;
+    collectionView.showsHorizontalScrollIndicator = NO;
+    [self.view insertSubview:collectionView atIndex:0];
+    collectionView.backgroundColor = [UIColor blackColor];
+    
+    
+    [collectionView registerClass:[TZPhotoPreviewCell class] forCellWithReuseIdentifier:@"TZPhotoPreviewCell"];
+    [collectionView registerClass:[TZPhotoPreviewCell class] forCellWithReuseIdentifier:@"TZPhotoPreviewCellGIF"];
+    [collectionView registerClass:[TZVideoPreviewCell class] forCellWithReuseIdentifier:@"TZVideoPreviewCell"];
+    [collectionView registerClass:[TZGifPreviewCell class] forCellWithReuseIdentifier:@"TZGifPreviewCell"];
+    
+    self.photoPreviewCollectionV = collectionView;
+    
+    [collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(-(60 + safeArea));
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(0.f);
+    }];
+    
+
+}
+
+- (void)setupPhotoPreViewBottomView
+{
+    photoPreViewBottomView * bottomView = [[photoPreViewBottomView alloc] init];
+    [self.view addSubview:bottomView];
+    self.photoPreViewBottomV = bottomView;
+    
+    [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.height.mas_equalTo((60 + safeArea));
+    }];
+}
+#pragma mark - UIScrollViewDelegate
+
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
+    CGFloat offSetWidth = scrollView.contentOffset.x;
+    offSetWidth = offSetWidth +  (SCREEN_W * 0.5);
+    
+    NSInteger currentIndex = offSetWidth / (SCREEN_W + 20);
+    if (currentIndex < _assets.count && _currentIndex != currentIndex && _canSetCurrentIndex) {
+        _currentIndex = currentIndex;
+        [self refreshNaviBarAndBottomBarState];
+    }
+    [[NSNotificationCenter defaultCenter] postNotificationName:@"photoPreviewCollectionViewDidScroll" object:nil];
+}
+
+#pragma mark - uicollectionDelegate
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
+    return self.assets.count;
+}
+
+- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
+    
+    TZAssetModel *model = self.assets[indexPath.row];
+    
+    TZAssetPreviewCell *cell;
+    __weak typeof(self) weakSelf = self;
+    if (model.type == TZAssetModelMediaTypeVideo) {
+        cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZVideoPreviewCell" forIndexPath:indexPath];
+        TZVideoPreviewCell *currentCell = (TZVideoPreviewCell *)cell;
+        currentCell.iCloudSyncFailedHandle = ^(id asset, BOOL isSyncFailed) {
+            model.iCloudFailed = isSyncFailed;
+            //[weakSelf didICloudSyncStatusChanged:model];
+        };
+    } else if (model.type == TZAssetModelMediaTypePhotoGif) {
+        cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZGifPreviewCell" forIndexPath:indexPath];
+        TZGifPreviewCell *currentCell = (TZGifPreviewCell *)cell;
+        currentCell.previewView.iCloudSyncFailedHandle = ^(id asset, BOOL isSyncFailed) {
+            model.iCloudFailed = isSyncFailed;
+            //[weakSelf didICloudSyncStatusChanged:model];
+        };
+    } else {
+        NSString *reuseId = model.type == TZAssetModelMediaTypePhotoGif ? @"TZPhotoPreviewCellGIF" : @"TZPhotoPreviewCell";
+        cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseId forIndexPath:indexPath];
+        TZPhotoPreviewCell *photoPreviewCell = (TZPhotoPreviewCell *)cell;
+        //photoPreviewCell.cropRect = _tzImagePickerVc.cropRect;
+        //photoPreviewCell.allowCrop = _tzImagePickerVc.allowCrop;
+        //photoPreviewCell.scaleAspectFillCrop = _tzImagePickerVc.scaleAspectFillCrop;
+//        __weak typeof(_collectionView) weakCollectionView = _collectionView;
+//        __weak typeof(photoPreviewCell) weakCell = photoPreviewCell;
+//        [photoPreviewCell setImageProgressUpdateBlock:^(double progress) {
+//            __strong typeof(weakSelf) strongSelf = weakSelf;
+//            __strong typeof(weakCollectionView) strongCollectionView = weakCollectionView;
+//            __strong typeof(weakCell) strongCell = weakCell;
+//            strongSelf.progress = progress;
+//            if (progress >= 1) {
+//                if (strongSelf.isSelectOriginalPhoto) [strongSelf showPhotoBytes];
+//                if (strongSelf.alertView && [strongCollectionView.visibleCells containsObject:strongCell]) {
+//                    [strongSelf.alertView dismissViewControllerAnimated:YES completion:^{
+//                        strongSelf.alertView = nil;
+//                        [strongSelf doneButtonClick];
+//                    }];
+//                }
+//            }
+//        }];
+        photoPreviewCell.previewView.iCloudSyncFailedHandle = ^(id asset, BOOL isSyncFailed) {
+            model.iCloudFailed = isSyncFailed;
+            //[weakSelf didICloudSyncStatusChanged:model];
+        };
+    }
+    
+    cell.model = model;
+    [cell setSingleTapGestureBlock:^{
+        __strong typeof(weakSelf) strongSelf = weakSelf;
+        //[strongSelf didTapPreviewCell];
+    }];
+
+    return cell;
+}
+
+- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
+    return UIEdgeInsetsMake(0, 0, 0, 0);
+}
+
+- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
+    CGFloat wh = SCREEN_H - CGRectGetMaxY(self.navBarBGView.frame) - (60 + safeArea);
+    return CGSizeMake(SCREEN_W, wh);
+}
+
+- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
+    return 0.0;
+}
+
+- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
+    return 0.0;
+}
+
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
+  
+    
+}
+@end

+ 16 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/photoPreViewBottomView.h

@@ -0,0 +1,16 @@
+//
+//  photoPreViewBottomView.h
+//  隐私保护
+//
+//  Created by xd h on 2023/11/11.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface photoPreViewBottomView : UIView
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 122 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/photoPreViewBottomView.m

@@ -0,0 +1,122 @@
+//
+//  photoPreViewBottomView.m
+//  隐私保护
+//
+//  Created by xd h on 2023/11/11.
+//
+
+#import "photoPreViewBottomView.h"
+
+@interface photoPreViewBottomView ()
+@property(nonatomic,strong)UILabel *selectNumLabel;
+//@property(nonatomic,strong)UILabel *uploadFileRoutelabel;
+@property(nonatomic,strong)UIButton *uploadButon;
+@end
+
+@implementation photoPreViewBottomView
+
+- (id)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    
+    [self drawAnyView];
+    
+    return self;
+}
+
+- (void)drawAnyView{
+    [self setBackgroundColor:[UIColor blackColor]];
+    
+    _selectNumLabel = [[UILabel alloc] init];
+    _selectNumLabel.font = [UIFont boldSystemFontOfSize:16.0];
+    _selectNumLabel.textColor = [UIColor whiteColor];
+    _selectNumLabel.numberOfLines = 0;
+    [self addSubview:_selectNumLabel];
+    
+    [_selectNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.top.mas_equalTo(5);
+        make.right.mas_equalTo(-110);
+        make.height.mas_equalTo(50);
+    }];
+    
+    NSString *curStr1 = [NSString stringWithFormat:@"%@",@"已选0项"];
+    NSString *curStr2 = [NSString stringWithFormat:@"%@",@"(0kb,可用120.00GB)"];
+    NSString *totalStr = [[NSString alloc] initWithFormat:@"%@\n%@",curStr1,curStr2];
+    
+    NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:totalStr];
+    
+    NSRange redRange = NSMakeRange([totalStr rangeOfString:curStr2].location, [totalStr rangeOfString:curStr2].length);
+    //[noteStr addAttribute:NSForegroundColorAttributeName value:[UIColor hwColor:@"#959799" alpha:1.0] range:redRange];
+    [noteStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14.0] range:redRange];
+    // 设置行间距
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    [paragraphStyle setLineSpacing:5];        //设置行间距
+    
+    [noteStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [totalStr  length])];
+
+    _selectNumLabel.attributedText = noteStr;
+
+    
+//    _uploadFileRoutelabel = [[UILabel alloc] init];
+//    _uploadFileRoutelabel.font = [UIFont systemFontOfSize:14.0];
+//    _uploadFileRoutelabel.textColor = [UIColor hwColor:@"#959799" alpha:1.0];
+//    _uploadFileRoutelabel.text = @"上传路径:xxxxxxxxxxxxxxx";
+//    [self addSubview:_uploadFileRoutelabel];
+//
+//    [_uploadFileRoutelabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.left.mas_equalTo(15);
+//        make.top.mas_equalTo(_selectNumLabel.mas_bottom).offset(10);
+//        make.right.mas_equalTo(-110);
+//        make.height.mas_equalTo(20);
+//    }];
+    
+    //图片上传
+    NSString* curImgUploadStr = [[NSString alloc] initWithFormat:@"%@ %@",@"  ",NSLocalizedString(@"my_set_no_File_upload",nil)];
+    
+    
+    // gradient
+    CAGradientLayer *gl_But = [CAGradientLayer layer];
+    gl_But.frame = CGRectMake(0,0,88.f,40.f);
+    gl_But.startPoint = CGPointMake(0, 0.5);
+    gl_But.endPoint = CGPointMake(1, 0.5);
+    gl_But.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
+    gl_But.locations = @[@(0), @(1.0f)];
+    gl_But.cornerRadius = 8;
+    
+    
+    UIButton *imageUploadBut = [[UIButton alloc] init];
+    
+    
+    [imageUploadBut setImage:[UIImage imageNamed:@"upload_file_white_100"] forState:UIControlStateNormal];
+    [imageUploadBut setTitle:curImgUploadStr forState:UIControlStateNormal];
+   
+    [imageUploadBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    imageUploadBut.titleLabel.font = [UIFont boldSystemFontOfSize:13.0];
+    imageUploadBut.tag = 2;
+    [imageUploadBut addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
+    [self addSubview:imageUploadBut];
+    [imageUploadBut.layer insertSublayer:gl_But atIndex:0];
+    [imageUploadBut bringSubviewToFront:imageUploadBut.imageView];
+    
+    self.uploadButon = imageUploadBut;
+    
+    //imageUploadBut.backgroundColor = [UIColor redColor];
+    
+    [imageUploadBut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15);
+        make.top.mas_equalTo(10);
+        make.width.mas_equalTo(88);
+        make.height.mas_equalTo(40);
+    }];
+    
+    imageUploadBut.enabled = NO;
+    //imageUploadBut.alpha = 0.5;
+}
+
+#pragma mark 按钮点击
+- (void)didClickButFun:(UIButton*)but
+{
+    
+}
+
+@end

+ 8 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/uploadImageOrVideoViewController.m

@@ -12,6 +12,7 @@
 #import "AJPhotoGroupView.h"
 #import "AJPhotoListCell.h"
 #import "uploadFileBottomView.h"
+#import "PhotoPreviewViewController.h"
 
 @interface uploadImageOrVideoViewController ()<AJPhotoGroupViewProtocol,UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
 
@@ -349,8 +350,13 @@
 }
 
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
-    AJPhotoListCell *cell = (AJPhotoListCell *)[self.photoListView cellForItemAtIndexPath:indexPath];
-    ALAsset *asset = self.assets[indexPath.row];
+//    AJPhotoListCell *cell = (AJPhotoListCell *)[self.photoListView cellForItemAtIndexPath:indexPath];
+//    ALAsset *asset = self.assets[indexPath.row];
+    
+    PhotoPreviewViewController *vc =[PhotoPreviewViewController new];
+    vc.assets = _assets;
+    vc.currentIndex = indexPath.row;
+    [self.navigationController pushViewController:vc animated:YES];
     
     //相机按钮处理
 //    if ([asset isKindOfClass:[UIImage class]] && _delegate && [_delegate respondsToSelector:@selector(photoPickerTapCameraAction:)]) {