Browse Source

1.音频播放器---播放列表

huangxiaodong 11 months ago
parent
commit
1e56093183

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

@@ -1178,6 +1178,14 @@
 		6BF558C02C4515B500701854 /* audioPlayListManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BF558BD2C4515B500701854 /* audioPlayListManager.h */; };
 		6BF558C12C4515B500701854 /* audioPlayListManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF558BE2C4515B500701854 /* audioPlayListManager.m */; };
 		6BF558C22C4515B500701854 /* audioPlayListManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BF558BD2C4515B500701854 /* audioPlayListManager.h */; };
+		6BF558C52C45247E00701854 /* audioPlayListView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF558C42C45247E00701854 /* audioPlayListView.m */; };
+		6BF558C62C45247E00701854 /* audioPlayListView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BF558C32C45247E00701854 /* audioPlayListView.h */; };
+		6BF558C72C45247E00701854 /* audioPlayListView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF558C42C45247E00701854 /* audioPlayListView.m */; };
+		6BF558C82C45247E00701854 /* audioPlayListView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BF558C32C45247E00701854 /* audioPlayListView.h */; };
+		6BF558CB2C45394F00701854 /* audioPlayListViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF558CA2C45394F00701854 /* audioPlayListViewCell.m */; };
+		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 */; };
 		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 */; };
@@ -1910,6 +1918,10 @@
 		6BF558B82C4508CB00701854 /* previewAudioPortraitDetailsView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = previewAudioPortraitDetailsView.m; sourceTree = "<group>"; };
 		6BF558BD2C4515B500701854 /* audioPlayListManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = audioPlayListManager.h; sourceTree = "<group>"; };
 		6BF558BE2C4515B500701854 /* audioPlayListManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = audioPlayListManager.m; sourceTree = "<group>"; };
+		6BF558C32C45247E00701854 /* audioPlayListView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = audioPlayListView.h; sourceTree = "<group>"; };
+		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>"; };
 		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>"; };
@@ -2818,6 +2830,10 @@
 				6BF558B22C44F11C00701854 /* previewAudioPortraitTopMoreView.m */,
 				6BF558B72C4508CB00701854 /* previewAudioPortraitDetailsView.h */,
 				6BF558B82C4508CB00701854 /* previewAudioPortraitDetailsView.m */,
+				6BF558C32C45247E00701854 /* audioPlayListView.h */,
+				6BF558C42C45247E00701854 /* audioPlayListView.m */,
+				6BF558C92C45394F00701854 /* audioPlayListViewCell.h */,
+				6BF558CA2C45394F00701854 /* audioPlayListViewCell.m */,
 			);
 			path = view;
 			sourceTree = "<group>";
@@ -3649,6 +3665,7 @@
 				6BFF26992AFA16DA00FCB4F7 /* forgetSecretKeyViewController.h in Headers */,
 				6B45C4FD2B57BC87007E6911 /* cloudPhoneExtraFileListModel.h in Headers */,
 				6B2C1E642C070ADE00FDCF82 /* ZFLandscapeRotationManager_iOS15.h in Headers */,
+				6BF558C62C45247E00701854 /* audioPlayListView.h in Headers */,
 				6BFF26912AF9D88200FCB4F7 /* AuthCodeTextField.h in Headers */,
 				6B6D42F22C295BCD006CAE3A /* playerSetView.h in Headers */,
 				184C8ADA2A949DAC00F26650 /* HaveNewVersionView.h in Headers */,
@@ -3838,6 +3855,7 @@
 				6B05819F2AFCF4E800D37290 /* AJPhotoListView.h in Headers */,
 				6B9354A72BF3848D00AA8D31 /* shareRecordViewController.h in Headers */,
 				18963B462AB84398006E7C50 /* GuideView.h in Headers */,
+				6BF558CC2C45394F00701854 /* audioPlayListViewCell.h in Headers */,
 				6B2C1E742C070ADE00FDCF82 /* ZFLandscapeViewController.h in Headers */,
 				6B5D86742C22C63F008D25EA /* NASCommonUsedView.h in Headers */,
 				6B72725B2B0E22D000C03F87 /* uploadFileRecordBgScorllView.h in Headers */,
@@ -3903,6 +3921,7 @@
 				6BD5069F2B9576A4006E7CB0 /* forgetSecretKeyViewController.h in Headers */,
 				6BD506A02B9576A4006E7CB0 /* cloudPhoneExtraFileListModel.h in Headers */,
 				6B2C1E652C070ADE00FDCF82 /* ZFLandscapeRotationManager_iOS15.h in Headers */,
+				6BF558C82C45247E00701854 /* audioPlayListView.h in Headers */,
 				6BD506A12B9576A4006E7CB0 /* AuthCodeTextField.h in Headers */,
 				6B6D42F42C295BCD006CAE3A /* playerSetView.h in Headers */,
 				6BD506A32B9576A4006E7CB0 /* HaveNewVersionView.h in Headers */,
@@ -4092,6 +4111,7 @@
 				6BD506FA2B9576A4006E7CB0 /* AJPhotoListView.h in Headers */,
 				6B9354A82BF3848D00AA8D31 /* shareRecordViewController.h in Headers */,
 				6BD506FB2B9576A4006E7CB0 /* GuideView.h in Headers */,
+				6BF558CE2C45394F00701854 /* audioPlayListViewCell.h in Headers */,
 				6B2C1E752C070ADE00FDCF82 /* ZFLandscapeViewController.h in Headers */,
 				6B5D86752C22C63F008D25EA /* NASCommonUsedView.h in Headers */,
 				6BD506FD2B9576A4006E7CB0 /* uploadFileRecordBgScorllView.h in Headers */,
@@ -4627,6 +4647,7 @@
 				6B679DF32C252ED000D0DC03 /* NASMySpaceTableViewCell.m in Sources */,
 				6B6317A52BFD9DB500FF4FB4 /* ZFCustomControlView.m in Sources */,
 				6BD5074A2B9576A4006E7CB0 /* UIView+View.m in Sources */,
+				6BF558CD2C45394F00701854 /* audioPlayListViewCell.m in Sources */,
 				6B9354912BF30A8C00AA8D31 /* editTypeBottomView.m in Sources */,
 				6BD5074B2B9576A4006E7CB0 /* couldPhoneFileListModel.m in Sources */,
 				6BD5074C2B9576A4006E7CB0 /* AFNetworkActivityIndicatorManager.m in Sources */,
@@ -4682,6 +4703,7 @@
 				6BC741432C23DCD10049BA8D /* webSocketManager.m in Sources */,
 				6B467BB42BC7E4360039A6A6 /* addLogObject.m in Sources */,
 				6BD5076E2B9576A4006E7CB0 /* forgetPwdViewController.m in Sources */,
+				6BF558C72C45247E00701854 /* audioPlayListView.m in Sources */,
 				6BD5076F2B9576A4006E7CB0 /* uploadFileRecordTableViewHeadView.m in Sources */,
 				6BD507702B9576A4006E7CB0 /* JSONHTTPClient.m in Sources */,
 				6B4C0F752C0314BA0070EF2E /* DFPlayerTool.m in Sources */,
@@ -4963,6 +4985,7 @@
 				6B679DF12C252ED000D0DC03 /* NASMySpaceTableViewCell.m in Sources */,
 				6B6317A42BFD9DB500FF4FB4 /* ZFCustomControlView.m in Sources */,
 				183AE6D52A8CAFAE00B11CB0 /* UIView+View.m in Sources */,
+				6BF558CB2C45394F00701854 /* audioPlayListViewCell.m in Sources */,
 				6B93548E2BF30A8C00AA8D31 /* editTypeBottomView.m in Sources */,
 				6B5D40282B4BC402000965CF /* couldPhoneFileListModel.m in Sources */,
 				183AE64E2A8A2CF000B11CB0 /* AFNetworkActivityIndicatorManager.m in Sources */,
@@ -5018,6 +5041,7 @@
 				6BC741412C23DCD10049BA8D /* webSocketManager.m in Sources */,
 				6B467BB22BC7E4360039A6A6 /* addLogObject.m in Sources */,
 				6BFF268D2AF8E1C600FCB4F7 /* forgetPwdViewController.m in Sources */,
+				6BF558C52C45247E00701854 /* audioPlayListView.m in Sources */,
 				6B72724C2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m in Sources */,
 				183AE6082A89CE3C00B11CB0 /* JSONHTTPClient.m in Sources */,
 				6B4C0F742C0314BA0070EF2E /* DFPlayerTool.m in Sources */,

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

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

BIN
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_audio_add_icon.imageset/nas_audio_add_icon@2x.png


BIN
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_audio_add_icon.imageset/nas_audio_add_icon@3x.png


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

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

BIN
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_audio_del_icon.imageset/nas_audio_del_icon@2x.png


BIN
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_audio_del_icon.imageset/nas_audio_del_icon@3x.png


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

@@ -18,6 +18,7 @@
 #import "editShareView.h"
 #import "uploadFileRecordViewController.h"
 #import "previewAudioPortraitDetailsView.h"
+#import "audioPlayListView.h"
 
 @interface audioPlayerViewController ()<DFPlayerDelegate,DFPlayerDataSource>
 
@@ -36,6 +37,8 @@
 
 @property (nonatomic, strong) NSMutableArray<DFPlayerModel *> *dataArray;
 @property (nonatomic, assign) NSInteger lastAudioIndex;//-1未记录
+
+@property (nonatomic, strong) audioPlayListView *audioPlayListV;
 @end
 
 @implementation audioPlayerViewController
@@ -216,7 +219,7 @@
     //歌单
     _playListBtn = [[UIButton alloc] init];
     [_playListBtn setImage:[UIImage imageNamed:@"dfplayer_playlist"] forState:UIControlStateNormal];
-    //[_playListBtn addTarget:self action:@selector(playOrPauseButtonDidClickFun:) forControlEvents:UIControlEventTouchUpInside];
+    [_playListBtn addTarget:self action:@selector(didClickPlayListFun) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:_playListBtn];
     
     [_playListBtn mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -497,6 +500,21 @@
     }];
 }
 
+#pragma mark 用户点击播放列表
+- (void)didClickPlayListFun
+{
+    _audioPlayListV = [[audioPlayListView alloc] initWithFrame:CGRectZero withIndex:_index];
+    [self.view addSubview:_audioPlayListV];
+    
+    [_audioPlayListV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.left.mas_equalTo(0);
+    }];
+}
+
+
 #pragma mark - DFPLayer dataSource
 - (NSArray<DFPlayerModel *> *)df_audioDataForPlayer:(DFPlayer *)player{
     _dataArray = [NSMutableArray array];
@@ -662,7 +680,7 @@
 - (void)viewDidDisappear:(BOOL)animated
 {
     [super viewDidDisappear:animated];
-    [[DFPlayer sharedPlayer] df_deallocPlayer];
+    //[[DFPlayer sharedPlayer] df_deallocPlayer];
 }
 
 -(void)setTitleFunByIndex
@@ -672,6 +690,9 @@
         //self.titleLabel.text = dataModel.name;
         _AudioTitleLab.text = dataModel.name;
         
+        if(_audioPlayListV){
+            _audioPlayListV.playingIndex = _index;
+        }
     }
 }
 

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

@@ -0,0 +1,17 @@
+//
+//  audioPlayListView.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/15.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface audioPlayListView : UIView
+@property (nonatomic,assign) NSInteger playingIndex;
+- (id)initWithFrame:(CGRect)frame withIndex:(NSInteger)index;
+@end
+
+NS_ASSUME_NONNULL_END

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

@@ -0,0 +1,234 @@
+//
+//  audioPlayListView.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/15.
+//
+
+#import "audioPlayListView.h"
+#import "audioPlayListManager.h"
+#import "audioPlayListViewCell.h"
+
+@interface audioPlayListView ()<UITableViewDelegate,UITableViewDataSource>
+@property(nonatomic,strong) NSMutableArray*curDataArr;
+@property(nonatomic,strong) UILabel*leftTitleLab;
+@property (nonatomic, strong) UITableView *tableView;
+@end
+
+@implementation audioPlayListView
+
+- (id)initWithFrame:(CGRect)frame withIndex:(NSInteger)index{
+    self = [super initWithFrame:frame];
+    
+    self.backgroundColor = [UIColor hwColor:@"#000000" alpha:0.6];
+    _playingIndex = index;
+    [self drawAnyView];
+    
+    return self;
+}
+
+-(void)drawAnyView
+{
+    //大按钮响应
+    UIButton *bigRightButton = [[UIButton alloc] init];
+    bigRightButton.tag = 1;
+    [bigRightButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    [self addSubview:bigRightButton];
+    //bigRightButton.backgroundColor= [UIColor greenColor];
+    
+    [bigRightButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+    }];
+    
+    
+    CGFloat topViewH = 52.0;
+    CGFloat bottomViewH = 20.0 + safeArea;
+    CGFloat tableViewCellH = 70.0;
+    _curDataArr = [audioPlayListManager shareManager].audioPlayListArr;
+    
+    NSInteger count = _curDataArr.count;
+    if(count >5){
+        count = 5;
+    }
+    else if(count == 0){
+        count = 1;
+    }
+    
+    
+    UIView *whiteBgView = [[UIView alloc] init];
+    whiteBgView.backgroundColor = [UIColor whiteColor];
+    [self addSubview:whiteBgView];
+    whiteBgView.layer.cornerRadius = 12;
+    whiteBgView.layer.masksToBounds = YES;
+    
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.bottom.mas_equalTo(20);
+        make.right.mas_equalTo(0);
+        make.left.mas_equalTo(0);
+        make.height.mas_equalTo(topViewH + bottomViewH +tableViewCellH*count);
+        //make.height.mas_equalTo(150);
+    }];
+    
+    
+    //当前播放列表
+    _leftTitleLab = [[UILabel alloc] init];
+    _leftTitleLab.textColor = [UIColor hwColor:@"#0A132B"];
+    _leftTitleLab.font = [UIFont systemFontOfSize:14.0];
+    [whiteBgView addSubview:_leftTitleLab];
+
+    [_leftTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.width.mas_equalTo(200);
+        make.height.mas_equalTo(52);
+        make.top.mas_equalTo(0);
+    }];
+    
+    //添加播放列表
+    UIButton *addAudioBut = [[UIButton alloc] init];
+    [addAudioBut setTitle:NSLocalizedString(@"NAS_add_audio_to_play_list",nil) forState:UIControlStateNormal];
+    [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.backgroundColor = [UIColor hwColor:@"#F3F3F3"];
+    addAudioBut.layer.cornerRadius = 8;
+    addAudioBut.layer.masksToBounds = YES;
+    [whiteBgView addSubview:addAudioBut];
+
+    [addAudioBut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-20);
+        make.width.mas_equalTo(100);
+        make.height.mas_equalTo(26);
+        make.centerY.equalTo(_leftTitleLab.mas_centerY).offset(0);
+    }];
+    
+    
+    [whiteBgView addSubview:self.tableView];
+    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.top.mas_equalTo(topViewH);
+    }];
+    
+
+    [self setTitleStrFun];
+}
+
+#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;
+}
+
+
+#pragma mark - 列表委托
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
+    return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return _curDataArr.count;
+}
+
+- (audioPlayListViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
+    
+    __block NSInteger row = indexPath.row;
+    static NSString *identifier = @"audioPlayListViewCell";
+    
+    audioPlayListViewCell * cell =  [tableView dequeueReusableCellWithIdentifier:identifier];
+    cell.selectionStyle = UITableViewCellSelectionStyleNone;
+    if (!cell){
+        cell = [[audioPlayListViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
+        [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
+        [cell setBackgroundColor:[UIColor clearColor]];
+        [cell setAccessoryType:(UITableViewCellAccessoryNone)];
+        
+    }
+    
+    if(row < _curDataArr.count){
+        lastFileModel* dataModel = _curDataArr[row];
+        cell.curLastFileModel = dataModel;
+        
+        if(row == _playingIndex){
+            cell.isPlayingType = YES;
+        }
+        else{
+            cell.isPlayingType = NO;
+        }
+        
+        KWeakSelf
+        cell.didClickSwitch = ^(BOOL SwitchOn) {
+            
+        };
+    }
+    return cell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
+    return 70;
+}
+
+#pragma mark 设置标题
+- (void)setTitleStrFun
+{
+    NSString *leftStr = NSLocalizedString(@"NAS_audio_cur_play_list",nil);
+    _curDataArr = [audioPlayListManager shareManager].audioPlayListArr;
+    NSString *rightStr = [[NSString alloc] initWithFormat:@"(%ld)",_curDataArr.count];
+    NSString *totalStr = [[NSString alloc] initWithFormat:@"%@  %@",leftStr,rightStr];
+    
+    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:totalStr];
+    NSRange redRange = NSMakeRange([totalStr rangeOfString:rightStr].location, [totalStr rangeOfString:rightStr].length);
+    UIColor *noteColor =[UIColor hwColor:@"#959799" alpha:1.0];
+    [attrStr addAttribute:NSForegroundColorAttributeName value:noteColor range:redRange];
+    [attrStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.0] range:redRange];
+    _leftTitleLab.attributedText = attrStr;
+    
+    [self.tableView reloadData];
+}
+
+- (void)setPlayingIndex:(NSInteger)playingIndex
+{
+    _playingIndex = playingIndex;
+    [self.tableView reloadData];
+}
+
+#pragma mark 按钮事件
+- (void)didClickButtonFun:(UIButton*)but
+{
+    NSInteger tag = but.tag;
+    HLog(@"%ld",tag);
+    
+    [self removeFun];
+    
+}
+
+- (void)removeFun
+{
+    [self removeFromSuperview];
+}
+@end
+

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

@@ -0,0 +1,27 @@
+//
+//  audioPlayListViewCell.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/15.
+//
+
+#import <UIKit/UIKit.h>
+#import "lastFileModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface audioPlayListViewCell : UITableViewCell
+@property(nonatomic,strong)UIView *cellBgView;
+//@property(nonatomic,strong)UILabel *timeLabel;
+@property(nonatomic,strong)UIImageView *mImageView;
+@property(nonatomic,strong)UILabel *titleLabel;
+@property(nonatomic,strong)UILabel *contentLabel;
+@property(nonatomic, strong) UIButton *checkButton;
+
+@property (nonatomic,copy) void (^didClickSwitch)(BOOL SwitchOn);
+
+@property(nonatomic,strong) lastFileModel*curLastFileModel;
+@property (nonatomic,assign) BOOL isPlayingType;
+@end
+
+NS_ASSUME_NONNULL_END

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

@@ -0,0 +1,186 @@
+//
+//  audioPlayListViewCell.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/15.
+//
+
+#import "audioPlayListViewCell.h"
+
+@implementation audioPlayListViewCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
+{
+    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+    
+    if (self)
+    {
+        [self drawView];
+    }
+    
+    return self;
+}
+
+- (void)drawView
+{
+    _cellBgView = [[UIView alloc] init];
+    [self.contentView addSubview:_cellBgView];
+    _cellBgView.backgroundColor = [UIColor whiteColor];
+    [_cellBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0.f);
+        make.top.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.width.mas_equalTo(SCREEN_W);
+    }];
+    
+    /**时间*/
+//    _timeLabel = [[UILabel alloc] init];
+//    [_cellBgView addSubview:_timeLabel];
+//    _timeLabel.font = [UIFont systemFontOfSize:12.f];
+//    //[titleLabel2 setTextAlignment:(NSTextAlignmentRight)];
+//    [_timeLabel setTextColor:[UIColor hwColor:@"#828D9A"]];
+//    [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.right.mas_equalTo(0.f);
+//        make.left.mas_equalTo(15);
+//        //make.centerY.equalTo(cellBgView.mas_centerY);
+//        make.top.mas_equalTo(0);
+//        make.height.mas_equalTo(20);
+//    }];
+    
+    /*图片*/
+    _mImageView = [[UIImageView alloc] init];
+    [_mImageView setBackgroundColor:[UIColor clearColor]];
+    _mImageView.image = [UIImage imageNamed:@"uploadFile_audio"];
+    [_cellBgView  addSubview:_mImageView];
+    [_mImageView setContentMode:(UIViewContentModeScaleAspectFit)];
+    [_mImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.width.mas_equalTo(42);
+        make.height.mas_equalTo(42);
+        make.centerY.equalTo(self.mas_centerY);
+    }];
+    
+    
+    _checkButton = [[UIButton alloc] init];
+    [_checkButton setImage:[UIImage imageNamed:@"nas_audio_del_icon"] forState:UIControlStateNormal];
+    //[_checkButton setImage:[UIImage imageNamed:@"upload_file_check"] forState:UIControlStateSelected];
+    [_cellBgView addSubview:_checkButton];
+    
+    [_checkButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15.f);
+        make.centerY.equalTo(self.mas_centerY);
+        make.width.mas_equalTo(36.f);
+        make.height.mas_equalTo(36.f);
+    }];
+    
+    [_checkButton addTarget:self action:@selector(maskSwitchPressed:) forControlEvents:(UIControlEventTouchUpInside)];
+    
+    
+    /**标题*/
+    _titleLabel = [[UILabel alloc] init];
+    [_cellBgView addSubview:_titleLabel];
+    _titleLabel.font = [UIFont boldSystemFontOfSize:14.f];
+    _titleLabel.numberOfLines = 2;
+    _titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
+    [_titleLabel setTextColor:HW0A132BColor];
+    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(_mImageView.mas_right).offset(5.f);
+        make.right.equalTo(_checkButton.mas_left).offset(-5.f);
+        //make.centerY.equalTo(cellBgView.mas_centerY);
+        make.top.equalTo(_mImageView.mas_top);
+    }];
+    
+    /**副标题*/
+    _contentLabel = [[UILabel alloc] init];
+    [_cellBgView addSubview:_contentLabel];
+    _contentLabel.font = [UIFont systemFontOfSize:12.f];
+    _contentLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
+    //[titleLabel2 setTextAlignment:(NSTextAlignmentRight)];
+    [_contentLabel setTextColor:HW666666Color];
+    [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(_titleLabel.mas_right);
+        make.left.mas_equalTo(_titleLabel.mas_left);
+        //make.centerY.equalTo(cellBgView.mas_centerY);
+        make.top.equalTo(_titleLabel.mas_bottom).offset(5.0);
+    }];
+    
+}
+
+
+- (void)maskSwitchPressed:(UIButton *)maskSwitch{
+
+    maskSwitch.selected = !maskSwitch.selected;
+    if(_didClickSwitch){
+        _didClickSwitch(maskSwitch.selected);
+    }
+}
+
+- (void)setCurLastFileModel:(lastFileModel *)curLastFileModel
+{
+    _curLastFileModel = curLastFileModel;
+    
+    _checkButton.selected = _curLastFileModel.isSelectType;
+    
+    NSString *filePath = _curLastFileModel.path;
+    NSString *urlStr = ksharedAppDelegate.NASFileByBoxService;
+    NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getThumbnail?path=%@",urlStr,filePath];
+    
+    
+    _titleLabel.text = _curLastFileModel.name;
+    NSString *dateStr = _curLastFileModel.time;
+    //_timeLabel.text = dateStr;
+    
+    NSString * totalSizeStr = nil;
+    NSInteger totalSize_k = _curLastFileModel.size / 1024;
+    if(totalSize_k == 0){
+        totalSize_k = 1;
+    }
+    
+    if(totalSize_k < 1024){
+        totalSizeStr = [[NSString alloc] initWithFormat:@"%ldKB",totalSize_k];
+    }
+    else if( totalSize_k >= 1024 && totalSize_k < 1024*1024){
+        totalSizeStr = [[NSString alloc] initWithFormat:@"%.1fMB",totalSize_k/1024.0];
+        
+    }
+    else{
+        totalSizeStr = [[NSString alloc] initWithFormat:@"%.2fG",totalSize_k/1024.0/1024.0];
+    }
+    
+//    NSString *path = _curLastFileModel.path;
+//    if([path containsString:@"mnt/media_rw"]){
+//        path = [path stringByReplacingOccurrencesOfString:@"mnt/media_rw" withString:NSLocalizedString(@"disk_Extra_default_tip",nil)];
+//    }
+//    else if([path containsString:@"storage/emulated/0"]){
+//        path = [path stringByReplacingOccurrencesOfString:@"storage/emulated/0" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
+//    }
+//    else if([path containsString:@"sdcard"]){
+//        path = [path stringByReplacingOccurrencesOfString:@"sdcard" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
+//    }
+    
+    //NSString *totalStr = [[NSString alloc] initWithFormat:@"%@  %@",totalSizeStr,path];
+    NSString *totalStr = [[NSString alloc] initWithFormat:@"%@  %@",totalSizeStr,dateStr];
+    _contentLabel.text = totalStr;
+}
+
+- (void)setIsPlayingType:(BOOL)isPlayingType
+{
+    if(isPlayingType){
+        _checkButton.hidden = YES;
+        [_titleLabel setTextColor:[UIColor hwColor:@"#01B7EA"]];
+        [_contentLabel setTextColor:[UIColor hwColor:@"#01B7EA"]];
+    }
+    else{
+        _checkButton.hidden = NO;
+        [_titleLabel setTextColor:HW0A132BColor];
+        [_contentLabel setTextColor:HW666666Color];
+    }
+}
+
+@end
+

+ 2 - 0
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -554,6 +554,8 @@
 "NAS_details_file_date"   = "创建日期:";
 "NAS_details_file_size"   = "文件大小:";
 "NAS_details_file_path"   = "所在位置:";
+"NAS_audio_cur_play_list"   = "当前播放列表";
+"NAS_add_audio_to_play_list"   = "添加播放列表";
 
 "cloudPhone_enter_tip"   = "进入云机";
 "cloudPhone_upload_app"   = "应用上传";