Kaynağa Gözat

1.添加到播放列表--镜像中

huangxiaodong 11 ay önce
ebeveyn
işleme
efa5acfbe1

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

@@ -1186,6 +1186,10 @@
 		6BF558CC2C45394F00701854 /* audioPlayListViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BF558C92C45394F00701854 /* audioPlayListViewCell.h */; };
 		6BF558CD2C45394F00701854 /* audioPlayListViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF558CA2C45394F00701854 /* audioPlayListViewCell.m */; };
 		6BF558CE2C45394F00701854 /* audioPlayListViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BF558C92C45394F00701854 /* audioPlayListViewCell.h */; };
+		6BF558D12C45442100701854 /* addAudioToPlayListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF558D02C45442100701854 /* addAudioToPlayListViewController.m */; };
+		6BF558D22C45442100701854 /* addAudioToPlayListViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BF558CF2C45442100701854 /* addAudioToPlayListViewController.h */; };
+		6BF558D32C45442100701854 /* addAudioToPlayListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF558D02C45442100701854 /* addAudioToPlayListViewController.m */; };
+		6BF558D42C45442100701854 /* addAudioToPlayListViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BF558CF2C45442100701854 /* addAudioToPlayListViewController.h */; };
 		6BFF26882AF8949F00FCB4F7 /* playerShowSecretkeyView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BFF26862AF8949F00FCB4F7 /* playerShowSecretkeyView.h */; };
 		6BFF26892AF8949F00FCB4F7 /* playerShowSecretkeyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BFF26872AF8949F00FCB4F7 /* playerShowSecretkeyView.m */; };
 		6BFF268C2AF8E1C600FCB4F7 /* forgetPwdViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BFF268A2AF8E1C600FCB4F7 /* forgetPwdViewController.h */; };
@@ -1922,6 +1926,8 @@
 		6BF558C42C45247E00701854 /* audioPlayListView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = audioPlayListView.m; sourceTree = "<group>"; };
 		6BF558C92C45394F00701854 /* audioPlayListViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = audioPlayListViewCell.h; sourceTree = "<group>"; };
 		6BF558CA2C45394F00701854 /* audioPlayListViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = audioPlayListViewCell.m; sourceTree = "<group>"; };
+		6BF558CF2C45442100701854 /* addAudioToPlayListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = addAudioToPlayListViewController.h; sourceTree = "<group>"; };
+		6BF558D02C45442100701854 /* addAudioToPlayListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = addAudioToPlayListViewController.m; sourceTree = "<group>"; };
 		6BFF26862AF8949F00FCB4F7 /* playerShowSecretkeyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = playerShowSecretkeyView.h; sourceTree = "<group>"; };
 		6BFF26872AF8949F00FCB4F7 /* playerShowSecretkeyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = playerShowSecretkeyView.m; sourceTree = "<group>"; };
 		6BFF268A2AF8E1C600FCB4F7 /* forgetPwdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = forgetPwdViewController.h; sourceTree = "<group>"; };
@@ -2791,6 +2797,8 @@
 				6B63179B2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m */,
 				6B4C0F822C0315880070EF2E /* audioPlayerViewController.h */,
 				6B4C0F832C0315880070EF2E /* audioPlayerViewController.m */,
+				6BF558CF2C45442100701854 /* addAudioToPlayListViewController.h */,
+				6BF558D02C45442100701854 /* addAudioToPlayListViewController.m */,
 			);
 			path = previewFile;
 			sourceTree = "<group>";
@@ -3896,6 +3904,7 @@
 				6B7EA7B62BF74BDB002D5CC2 /* shareBySecretView.h in Headers */,
 				6B42A2232C41285C000555BB /* previewVideoPortraitTopMoreView.h in Headers */,
 				6BF52C982AD5546500A617DB /* WHPingTester.h in Headers */,
+				6BF558D22C45442100701854 /* addAudioToPlayListViewController.h in Headers */,
 				6B6D42EC2C290A06006CAE3A /* cloudPhoneSetView.h in Headers */,
 				18FCE5392AD1351B0020F623 /* PlayerViewController.h in Headers */,
 				6BF52CA62AD7D3BE00A617DB /* customLaunchView.h in Headers */,
@@ -4152,6 +4161,7 @@
 				6B7EA7B82BF74BDB002D5CC2 /* shareBySecretView.h in Headers */,
 				6B42A2252C41285C000555BB /* previewVideoPortraitTopMoreView.h in Headers */,
 				6BD5070A2B9576A4006E7CB0 /* WHPingTester.h in Headers */,
+				6BF558D42C45442100701854 /* addAudioToPlayListViewController.h in Headers */,
 				6B6D42EE2C290A06006CAE3A /* cloudPhoneSetView.h in Headers */,
 				6BD5070B2B9576A4006E7CB0 /* PlayerViewController.h in Headers */,
 				6BD5070C2B9576A4006E7CB0 /* customLaunchView.h in Headers */,
@@ -4535,6 +4545,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				6BF558D32C45442100701854 /* addAudioToPlayListViewController.m in Sources */,
 				6BD507122B9576A4006E7CB0 /* AppDelegate.m in Sources */,
 				6B2C1E492C070ADE00FDCF82 /* ZFSmallFloatControlView.m in Sources */,
 				6BD507132B9576A4006E7CB0 /* HWToolViewController.m in Sources */,
@@ -4873,6 +4884,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				6BF558D12C45442100701854 /* addAudioToPlayListViewController.m in Sources */,
 				A003F6E527D8428200715CBF /* AppDelegate.m in Sources */,
 				6B2C1E482C070ADE00FDCF82 /* ZFSmallFloatControlView.m in Sources */,
 				A084D68927E8587400054880 /* HWToolViewController.m in Sources */,

+ 16 - 0
创维盒子/双子星云手机/Class/Set/previewFile/addAudioToPlayListViewController.h

@@ -0,0 +1,16 @@
+//
+//  addAudioToPlayListViewController.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/15.
+//
+
+#import "BaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface addAudioToPlayListViewController : BaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 787 - 0
创维盒子/双子星云手机/Class/Set/previewFile/addAudioToPlayListViewController.m

@@ -0,0 +1,787 @@
+//
+//  addAudioToPlayListViewController.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/15.
+//
+
+#import "addAudioToPlayListViewController.h"
+
+#import "couldPhoneFileListModel.h"
+#import "downloadThumbnailManager.h"
+#import "downloadManager.h"
+#import "uploadFileRecordViewController.h"
+#import "UIScrollView+EmptyDataSet.h"
+#import "diskListBgView.h"
+#import "diskListTableView.h"
+#import "downLoadPreViewCell.h"
+#import "editTypeHeadView.h"
+#import "editTypeBottomView.h"
+#import "editShareView.h"
+#import "previewToUploadFileView.h"
+#import "netWorkManager.h"
+#import "NASFileAudioModel.h"
+#import "queryShareModel.h"
+#import "audioPlayerViewController.h"
+#import "videoPlayByAVPlayerViewController.h"
+
+@interface addAudioToPlayListViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
+{
+    UIButton *tapBtn;
+
+}
+@property (nonatomic, strong) UITableView *tableView;
+
+@property (strong, nonatomic) UILabel *MytitleLabel;
+@property (strong, nonatomic) UIImageView *selectTip;
+@property (nonatomic, strong) diskListBgView *diskListBgV;
+@property (nonatomic, strong) diskListTableView *diskListTableV;
+@property (nonatomic, strong)  NSMutableArray*diskListArr;
+@property (nonatomic, copy) NSString *defaultDiskPath;
+@property(nonatomic,assign) BOOL isEditType;
+@property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
+@property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
+
+@property (nonatomic, strong)  NSMutableArray*didSelectListArr;//选中的数据
+@property (nonatomic, strong)NASFileAudioModel * curNASFileAudioMod;
+@end
+
+@implementation addAudioToPlayListViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self.toolBar setHidden:YES];
+    [self.navigationBar setHidden:YES];
+    [self.navBarBGView setHidden:NO];
+    self.navBarBGView.backgroundColor = [UIColor whiteColor];
+    [self.view setBackgroundColor:[UIColor whiteColor]];
+    
+    [self drawAnyView];
+    
+    _didSelectListArr = [NSMutableArray new];
+    
+    //数据埋点
+    //[[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Music"];
+}
+
+- (void)drawAnyView{
+    
+    [self initNavHeadUIFun];
+    
+    _curEditTypeHeadView = [[editTypeHeadView alloc] init];
+    _curEditTypeHeadView.hidden = YES;
+    [self.navBarBGView addSubview:_curEditTypeHeadView];
+    
+    [_curEditTypeHeadView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.height.mas_equalTo(NAVIHEIGHT - AdaptNaviHeight);
+    }];
+    
+#pragma mark 编辑状态的 取消 和全选按钮 响应事件
+    KWeakSelf
+    _curEditTypeHeadView.didClickButtonFun = ^(NSInteger tag) {
+        if(tag==1){
+            [weakSelf userCancelEditTypeFun];
+        }
+    };
+    
+    _curEditTypeHeadView.didClickSelectAllFun = ^(UIButton * _Nonnull but) {
+        [weakSelf didClickSelectAllButton:but];
+    };
+    
+    
+    _curEditTypeBottomView = [[editTypeBottomView alloc] init];
+    _curEditTypeBottomView.hidden = YES;
+    [self.view addSubview:_curEditTypeBottomView];
+    
+    [_curEditTypeBottomView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.height.mas_equalTo(60 + AdaptTabHeight);
+    }];
+    
+#pragma mark 编辑状态的 下载 分享 删除 响应事件
+    _curEditTypeBottomView.didClickButtonFun = ^(NSInteger tag) {
+        if(tag==1){
+            [weakSelf gotoDownLoadFileFun];
+        }
+        else if(tag==2){
+            [weakSelf gotoShareViewFun];
+        }
+        else if(tag==3){
+            [weakSelf showDeleteAlearViewFun];
+        }
+    };
+    
+    [self.view addSubview:self.tableView];
+    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        //make.bottom.mas_equalTo(-(safeArea));
+        make.bottom.mas_equalTo(0);
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+    }];
+    
+    
+    NSMutableArray *arr = [NSMutableArray new];
+    NSArray *diskList = ksharedAppDelegate.cloudPhoneExtraFileListMod.data;
+    if(diskList && [diskList isKindOfClass:[NSArray class]]){
+        for (cloudPhoneExtraFileModel *model in diskList) {
+            model.isCheckType = NO;
+            [arr addObject:model];
+        }
+    }
+    
+    if(arr.count >0){
+        cloudPhoneExtraFileModel *model = arr.firstObject;
+        model.isCheckType = YES;
+        _defaultDiskPath = model.extraPath;
+    }
+    _diskListArr = arr;
+    [self setTitleAfterGetdiskFun];
+}
+
+- (void)initNavHeadUIFun
+{
+    //title
+    UILabel *titleLabel = [[UILabel alloc] init];
+    titleLabel.textAlignment = NSTextAlignmentCenter;
+    titleLabel.font = [UIFont boldSystemFontOfSize:16.0];
+    titleLabel.textColor = [UIColor blackColor];
+    titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
+    [self.navBarBGView addSubview:titleLabel];
+
+    self.MytitleLabel = titleLabel;
+    
+    //selectTipImageView
+    UIImageView *selectTip = [[UIImageView alloc] init];
+    selectTip.image = [UIImage imageNamed:@"upload_image_arrow"];
+    selectTip.translatesAutoresizingMaskIntoConstraints = NO;
+    [self.navBarBGView addSubview:selectTip];
+    self.selectTip = selectTip;
+    
+    tapBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    tapBtn.backgroundColor = [UIColor clearColor];
+    tapBtn.translatesAutoresizingMaskIntoConstraints = NO;
+    [tapBtn addTarget:self action:@selector(selectDiskAction:) forControlEvents:UIControlEventTouchUpInside];
+    [self.navBarBGView addSubview:tapBtn];
+    
+    [tapBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
+        make.centerY.mas_equalTo(self.backBtn.mas_centerY);
+        make.width.mas_equalTo(100);
+        make.height.mas_equalTo(30);
+    }];
+    
+    [self setTitleLabelText:@""];
+    
+}
+
+
+#pragma mark - 懒加载
+- (UITableView *)tableView{
+    if (!_tableView) {
+        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
+        _tableView.delegate = self;
+        _tableView.dataSource = self;
+        _tableView.showsVerticalScrollIndicator = NO;
+        _tableView.showsHorizontalScrollIndicator = NO;
+//        _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
+        [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
+        [_tableView setSeparatorColor:[UIColor clearColor]];
+        [_tableView setBackgroundColor:[UIColor clearColor]];
+        [_tableView setTableFooterView:[UIView new]];
+        [_tableView setBounces:YES];
+        
+        if (@available(iOS 15.0, *)) {
+            _tableView.sectionHeaderTopPadding = 0;
+        }
+        
+        //空数据引入第三方开源处理
+        _tableView.emptyDataSetSource = self;
+        _tableView.emptyDataSetDelegate = self;
+    }
+    
+    return _tableView;
+}
+
+
+- (diskListBgView*)diskListBgV
+{
+    if(!_diskListBgV){
+        _diskListBgV = [[diskListBgView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
+        _diskListBgV.hidden = YES;
+        [self.view addSubview:_diskListBgV];
+        
+        KWeakSelf
+        _diskListBgV.didTapWhitePlace = ^{
+            [weakSelf hideDiskListVieFun];
+        };
+        
+        [_diskListBgV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.bottom.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.top.mas_equalTo(self.navBarBGView.mas_bottom);
+        }];
+        
+        [self.view addSubview:self.diskListTableV];
+        self.diskListTableV.hidden = YES;
+        [self.diskListTableV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.height.mas_equalTo(3*70);
+            make.right.mas_equalTo(0);
+            make.top.mas_equalTo(self.navBarBGView.mas_bottom);
+        }];
+       
+        self.diskListTableV.diskListArr = _diskListArr;
+        
+        self.diskListTableV.didClickDiskModel = ^(NSString * _Nonnull checkPath) {
+            [weakSelf didCheckDiskFunByPath:checkPath];
+        };
+    }
+    
+    return  _diskListBgV;
+}
+
+- (UITableView *)diskListTableV{
+    if (!_diskListTableV) {
+        _diskListTableV = [[diskListTableView alloc] init];
+//
+    }
+    return _diskListTableV;
+}
+
+#pragma mark 选中磁盘
+- (void)didCheckDiskFunByPath:(NSString*)pathStr
+{
+    if(self.defaultDiskPath
+       && self.defaultDiskPath.length>0
+       && ![self.defaultDiskPath isEqualToString:pathStr]){
+        //切换硬盘了 取消全选
+        
+        [_didSelectListArr removeAllObjects];
+    }
+    
+    self.defaultDiskPath = pathStr;
+    [self getFileListFun];
+    [self setTitleAfterGetdiskFun];
+    [self hideDiskListVieFun];
+}
+
+#pragma mark - 列表委托
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
+    return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    if(!_curNASFileAudioMod){
+        return 0;
+    }
+    return _curNASFileAudioMod.data.list.count;
+}
+
+- (downLoadPreViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
+    
+    __block NSInteger row = indexPath.row;
+    static NSString *identifier = @"downLoadPreViewCell";
+    
+    downLoadPreViewCell * cell =  [tableView dequeueReusableCellWithIdentifier:identifier];
+    cell.selectionStyle = UITableViewCellSelectionStyleNone;
+    if (!cell){
+        cell = [[downLoadPreViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
+        [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
+        [cell setBackgroundColor:[UIColor clearColor]];
+        [cell setAccessoryType:(UITableViewCellAccessoryNone)];
+        
+        [cell.bgViewLayer removeFromSuperlayer];
+        [cell.titleLabel2 setHidden:NO];
+        [cell.rightImage setHidden:YES];
+        [cell.lineView setHidden:YES];
+        [cell.checkButton setHidden:NO];
+        
+    }
+    
+    if(row < _curNASFileAudioMod.data.list.count){
+        NASFileAudioDataModel* dataModel = _curNASFileAudioMod.data.list[row];
+        cell.curNASFileAudioDataModel = dataModel;
+        
+        KWeakSelf
+        cell.didClickSwitch = ^(BOOL SwitchOn) {
+                [weakSelf userCheckFilePreviewByRow:row];
+        };
+    }
+    return cell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
+    return 70;
+}
+
+
+#pragma mark 空数据
+- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
+    
+    NSString *imageName = @"common_no_data_pic";
+    
+    return [UIImage imageNamed:imageName];
+}
+
+- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
+    NSString *text = NSLocalizedString(@"common_no_data_tip",nil);
+    
+    NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
+                                 NSForegroundColorAttributeName: HW999999Color};
+    
+    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
+}
+
+//调整图片位置
+- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
+    return -150;
+}
+
+
+#pragma mark 用户长按图片进入编辑
+- (void)setViewEditTypeFun
+{
+    _isEditType = YES;
+    //[self.tableView  reloadData];
+    
+    _curEditTypeHeadView.hidden = NO;
+    _curEditTypeBottomView.hidden = NO;
+    
+    [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(_curEditTypeBottomView.mas_top);
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+    }];
+}
+
+#pragma mark 用户取消编辑编辑
+- (void)userCancelEditTypeFun
+{
+    //数据还原
+    for (NASFileAudioDataModel*model in _didSelectListArr) {
+        model.isSelectType = NO;
+    }
+    [_didSelectListArr removeAllObjects];
+    
+    _isEditType = NO;
+    [self.tableView  reloadData];
+    
+    _curEditTypeHeadView.hidden = YES;
+    _curEditTypeBottomView.hidden = YES;
+    
+    [self.tableView  mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+    }];
+}
+
+- (void)userCheckFilePreviewByRow:(NSInteger)row
+{
+    if(row < _curNASFileAudioMod.data.list.count){
+        NASFileAudioDataModel* dataModel = _curNASFileAudioMod.data.list[row];
+        
+        if(dataModel.isSelectType){
+            [_didSelectListArr removeObject:dataModel];
+        }
+        else{
+            [_didSelectListArr addObject:dataModel];
+        }
+        
+        dataModel.isSelectType = !dataModel.isSelectType;
+    
+        [self setEditTypeTitleFun];
+    }
+}
+
+- (void)didClickSelectAllButton:(UIButton*)button
+{
+    //button.selected = !button.selected;
+    
+    [_didSelectListArr removeAllObjects];
+    
+    for (NASFileAudioDataModel* dataModel in _curNASFileAudioMod.data.list) {
+        
+        if(!button.selected){
+            dataModel.isSelectType = button.selected;
+        }
+        else{
+            [_didSelectListArr addObject:dataModel];
+            dataModel.isSelectType = button.selected;
+        }
+    }
+    
+    [self.tableView reloadData];
+    //[self.dataCollectionView reloadData];
+    [self setEditTypeTitleFun];
+}
+
+#pragma mark 设置选中标题
+- (void)setEditTypeTitleFun
+{
+    [_curEditTypeHeadView setTitleLabetextByNumbers:_didSelectListArr.count];
+    
+    if(_didSelectListArr.count > 0){
+        [self  setViewEditTypeFun];
+    }
+    else{
+        [self userCancelEditTypeFun];
+    }
+}
+
+#pragma mark 用户点击分享
+- (void)gotoShareViewFun
+{
+    if (_didSelectListArr.count > 5) {
+        [[iToast makeText:NSLocalizedString(@"share_max_count_tip2",nil)] show];
+        return;
+    }
+    
+    editShareView *editShareV = [[editShareView alloc] init];
+    editShareV.didSelectListArr = _didSelectListArr;
+    editShareV.shareFileType = @"4";
+    [self.view addSubview:editShareV];
+    
+    [editShareV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+    }];
+}
+
+#pragma mark 用户点击上传文件
+- (void)userDidClickUploadViewFun
+{
+    previewToUploadFileView *previewToUploadFileV = [[previewToUploadFileView alloc] init];
+    [self.view addSubview:previewToUploadFileV];
+    
+    [previewToUploadFileV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+    }];
+    
+    KWeakSelf
+    previewToUploadFileV.didClickButtonFun = ^(NSInteger tag) {
+        [weakSelf gotoUploadFileFunWith:tag];
+    };
+}
+
+#pragma mark 设置标题
+- (void)setTitleLabelText:(NSString*)title
+{
+    NSArray *diskNameArr = [_defaultDiskPath componentsSeparatedByString:@"/"];
+    if(diskNameArr && diskNameArr.count >= 2){
+        
+        NSString *name = diskNameArr.lastObject;
+        if(name.length == 0)
+        {
+            name = diskNameArr[diskNameArr.count -2];
+        }
+        
+        name = [name stringByReplacingOccurrencesOfString:@"sdcard" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
+        
+        title = [[NSString alloc] initWithFormat:@"[%@]%@",name,title];
+    }
+    
+    
+    
+    self.MytitleLabel.text = title;
+    
+    CGFloat curWidth = [title boundingRectWithSize:CGSizeMake(SCREEN_W, 30) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:16.f]} context:nil].size.width;
+    
+    curWidth += 20;
+    //HLog(@"title w:%f",curWidth);
+    [self.MytitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.mas_equalTo(self.navBarBGView.mas_centerX).offset(-10);
+        make.centerY.mas_equalTo(self.backBtn.mas_centerY);
+        make.width.mas_equalTo(curWidth);
+        make.height.mas_equalTo(30);
+    }];
+    //self.MytitleLabel.backgroundColor = [UIColor greenColor];
+    
+    [self.selectTip mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(self.MytitleLabel.mas_right).offset(0);
+        make.centerY.mas_equalTo(self.backBtn.mas_centerY);
+        make.width.mas_equalTo(15);
+        make.height.mas_equalTo(15);
+    }];
+    
+    [tapBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
+        make.centerY.mas_equalTo(self.backBtn.mas_centerY);
+        make.width.mas_equalTo(curWidth+15);
+        make.height.mas_equalTo(30);
+    }];
+}
+
+#pragma mark 选择硬盘
+- (void)selectDiskAction:(UIButton*)but
+{
+    if(self.diskListBgV.hidden){
+        [self showDiskListVieFun];
+    }
+    else{
+        [self hideDiskListVieFun];
+        
+    }
+}
+
+- (void)showDiskListVieFun
+{
+    self.diskListBgV.hidden = NO;
+    self.diskListTableV.hidden = NO;
+    
+    [UIView animateWithDuration:0.3 animations:^{
+        CGRect rect = self.diskListTableV.frame;
+        rect.origin.y = CGRectGetMaxY(self.navBarBGView.frame);
+        self.diskListTableV.frame = rect;
+
+        self.selectTip.transform = CGAffineTransformMakeRotation(M_PI);
+    }];
+}
+
+- (void)hideDiskListVieFun
+{
+    self.diskListBgV.hidden = YES;
+    
+    [UIView animateWithDuration:0.3 animations:^{
+        self.diskListTableV.hidden = YES;
+        self.selectTip.transform = CGAffineTransformIdentity;
+        
+    }completion:^(BOOL finished) {
+        CGRect rect = self.diskListTableV.frame;
+        rect.origin.y = 0;
+        self.diskListTableV.frame = rect;
+    }];
+}
+
+
+
+#pragma mark 设置标题
+- (void)setTitleAfterGetdiskFun
+{
+    [self setTitleLabelText:NSLocalizedString(@"my_set_no_music",nil)];
+    
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    
+}
+
+- (void)viewDidAppear:(BOOL)animated{
+    [super viewDidAppear:animated];
+    [self showDownloadTipFun];
+    
+    if(!_curNASFileAudioMod){
+        [self getFileListFun];
+    }
+}
+
+- (void)viewWillDisappear:(BOOL)animated{
+    [super viewWillDisappear:animated];
+    
+    //[self removeNewIndicator];
+    [self removeNewIndicatorHaveStr];
+}
+
+
+
+
+
+- (void)gotoDownloadloadFileRecordFun
+{
+    uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+    vc.isDownloadingType = YES;
+    //[vc gotoDownloadFile:_downloadFileBottomV.indexPathsForSelectedItems];
+}
+
+- (void)showDownloadTipFun
+{
+    BOOL didReadUploadTipType = [HWDataManager getBoolWithKey:Const_file_downLoad_need_read];
+   
+    if(didReadUploadTipType){
+        return;
+    }
+    
+    
+    //KWeakSelf
+    /*弹窗提示恢复出厂*/
+    ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:nil
+                                                                                     msg:NSLocalizedString(@"upload_download_need_read_msg",nil)
+                                                                                imageStr:nil
+                                                                             cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
+                                                                                 okTitle:nil
+                                                                        isOkBtnHighlight:NO
+                                                                              didClickOk:^{
+        
+    } didClickCancel:^{
+        [HWDataManager setBoolWithKey:Const_file_downLoad_need_read value:YES];
+    }];
+    
+    nextVC.modalPresentationStyle = UIModalPresentationCustom;
+    
+    [self presentViewController:nextVC animated:YES completion:^{
+        nextVC.view.superview.backgroundColor = [UIColor clearColor];
+    }];
+    
+}
+
+
+- (void)didiClikRightButGotoTransferListFun:(UIButton*)but
+{
+    uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+}
+
+#pragma mark 获取文件数据
+- (void)getFileListFun
+{
+    NSMutableDictionary*paraDict = [NSMutableDictionary new];
+    [paraDict setValue:@"audio" forKey:@"type"];
+    
+    NSArray *diskNameArr = [_defaultDiskPath componentsSeparatedByString:@"/"];
+    if(diskNameArr && diskNameArr.count >= 2){
+        
+        NSString *name = diskNameArr.lastObject;
+        if(name.length == 0)
+        {
+            name = diskNameArr[diskNameArr.count -2];
+        }
+        
+        [paraDict setValue:name forKey:@"path"];
+    }
+    
+    [self showNewIndicatorHaveStrWithCanBack:YES canTouch:NO showText:NSLocalizedString(@"common_loading_tip",nil)];
+    
+    KWeakSelf
+    [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"getFileList" Parameters:paraDict success:^(id  _Nonnull responseObject) {
+        [weakSelf removeNewIndicatorHaveStr];
+        weakSelf.curNASFileAudioMod = [[NASFileAudioModel alloc] initWithDictionary:responseObject error:nil];
+        
+        if(weakSelf.curNASFileAudioMod && weakSelf.curNASFileAudioMod.status == 0){
+            [weakSelf.tableView reloadData];
+        }
+        
+    } failure:^(NSError * _Nonnull error) {
+        [weakSelf removeNewIndicatorHaveStr];
+    }];
+}
+
+#pragma mark 调整文件上传
+- (void)gotoUploadFileFunWith:(NSInteger)tag
+{
+    
+}
+
+#pragma mark 文件下载
+- (void)gotoDownLoadFileFun
+{
+    if(_didSelectListArr.count == 0){
+        [[iToast makeText:@""] show];
+        return;
+    }
+    
+    NSMutableArray *arr = [NSMutableArray new];
+    for (NASFilePicDataArrModel *dataModel in _didSelectListArr) {
+        
+        couldPhoneFileModel* fileModel =  [couldPhoneFileModel new];
+        fileModel.fileType = @"audio";
+        fileModel.path = dataModel.path;
+        fileModel.name = dataModel.name;
+        fileModel.length = dataModel.size;
+        fileModel.time = dataModel.duration;
+        
+        [arr addObject:fileModel];
+    }
+    
+    uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+    vc.isDownloadingType = YES;
+    [vc gotoDownloadFile:arr];
+}
+
+#pragma mark 删除图片
+- (void)showDeleteAlearViewFun
+{
+    NSString *titleStr = NSLocalizedString(@"delete_file_title_msg",nil);
+    NSString *tipStr = NSLocalizedString(@"delete_file_tip_msg",nil);
+
+    KWeakSelf
+    ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:titleStr
+                                                                                      msg:tipStr
+                                                                                 imageStr:nil
+                                                                              cancelTitle:NSLocalizedString(@"other_cancel",nil)
+                                                                                  okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
+                                                                               didClickOk:^{
+        
+        [weakSelf delFileListFun];
+     } didClickCancel:^{
+         
+     }];
+    
+    curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
+     
+     [self presentViewController:curAlretVC animated:YES completion:^{
+         curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
+     }];
+}
+
+
+#pragma mark 删除文件数据
+- (void)delFileListFun
+{
+    NSMutableDictionary*paraDict = [NSMutableDictionary new];
+    
+    NSMutableArray *pathArr = [NSMutableArray new];
+    for (NASFilePicDataArrModel *dataModel in _didSelectListArr) {
+        [pathArr addObject:dataModel.path];
+    }
+    
+    [paraDict setValue:pathArr forKey:@"path"];
+    
+    [self showNewIndicatorWithCanBack:YES canTouch:NO];
+    
+    //NSString*code = [[NSString alloc] initWithFormat:@"delFile?path=%@",paraDict[@"path"]]; //delFile?path=[/storage/emulated/0/Download/IMG_6464.HEIC]
+    KWeakSelf //@"delFile"
+    [[netWorkManager shareInstance] cloudPhonePostCallBackCode:@"delFile" Parameters:paraDict success:^(id  _Nonnull responseObject) {
+        [weakSelf removeNewIndicator];
+        SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
+        if(model && model.status == 0){
+            [[iToast makeText:NSLocalizedString(@"delete_file_suc_msg",nil)] show];
+            [weakSelf didDeleteSucFun];
+        }
+        else{
+            
+        }
+    } failure:^(NSError * _Nonnull error) {
+        [weakSelf removeNewIndicator];
+    }];
+}
+
+#pragma  mark 删除成功
+- (void)didDeleteSucFun
+{
+    [_didSelectListArr removeAllObjects];
+    [self setEditTypeTitleFun];
+    
+    [self getFileListFun];
+}
+
+@end

+ 12 - 0
创维盒子/双子星云手机/Class/Set/previewFile/audioPlayerViewController.m

@@ -19,6 +19,7 @@
 #import "uploadFileRecordViewController.h"
 #import "previewAudioPortraitDetailsView.h"
 #import "audioPlayListView.h"
+#import "addAudioToPlayListViewController.h"
 
 @interface audioPlayerViewController ()<DFPlayerDelegate,DFPlayerDataSource>
 
@@ -512,8 +513,19 @@
         make.right.mas_equalTo(0);
         make.left.mas_equalTo(0);
     }];
+    
+    KWeakSelf
+    _audioPlayListV.didClickButtonFun = ^{
+        [weakSelf gotoAddAudioToPlayListVCFun];
+    };
 }
 
+#pragma mark 跳转添加音乐到播放列表
+- (void)gotoAddAudioToPlayListVCFun
+{
+    addAudioToPlayListViewController *vc = [addAudioToPlayListViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+}
 
 #pragma mark - DFPLayer dataSource
 - (NSArray<DFPlayerModel *> *)df_audioDataForPlayer:(DFPlayer *)player{

+ 2 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/audioPlayListView.h

@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface audioPlayListView : UIView
 @property (nonatomic,assign) NSInteger playingIndex;
+@property (nonatomic,copy) void (^didClickButtonFun)(void);
+
 - (id)initWithFrame:(CGRect)frame withIndex:(NSInteger)index;
 @end
 

+ 9 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/audioPlayListView.m

@@ -92,6 +92,7 @@
     [addAudioBut setTitleColor:[UIColor hwColor:@"#51555C"] forState:UIControlStateNormal];
     addAudioBut.titleLabel.font = [UIFont systemFontOfSize:10.0];
     [addAudioBut setImage:[UIImage imageNamed:@"nas_audio_add_icon"] forState:UIControlStateNormal];
+    [addAudioBut addTarget:self action:@selector(didClickAddAudioFun) forControlEvents:UIControlEventTouchUpInside];
     addAudioBut.backgroundColor = [UIColor hwColor:@"#F3F3F3"];
     addAudioBut.layer.cornerRadius = 8;
     addAudioBut.layer.masksToBounds = YES;
@@ -117,6 +118,14 @@
     [self setTitleStrFun];
 }
 
+#pragma mark 点击了添加播放列表
+- (void)didClickAddAudioFun
+{
+    if(_didClickButtonFun){
+        _didClickButtonFun();
+    }
+}
+
 #pragma mark - 懒加载
 - (UITableView *)tableView{
     if (!_tableView) {