Browse Source

1.上传空间不足提示

huangxiaodong 1 year ago
parent
commit
319b4d3f30

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

@@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
 //选中的项 TZAssetModel
 @property (nonatomic,strong) NSMutableArray *indexPathsForSelectedItems;
 @property (nonatomic,copy) NSString *availableStorage;
+@property (nonatomic,assign) long available;
 //点击上传
 @property (nonatomic,copy) void (^didClickUploadFile)(void);
 @end

+ 13 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/uploadFileBottomView.m

@@ -99,6 +99,7 @@
 #pragma mark 数据处理
 - (void)setIndexPathsForSelectedItems:(NSMutableArray *)indexPathsForSelectedItems
 {
+    BOOL isCanUpload = YES;
     
     _indexPathsForSelectedItems = indexPathsForSelectedItems;
     if(!_indexPathsForSelectedItems){
@@ -121,6 +122,10 @@
         
     }
     
+    if(allImageData > self.available && self.available > 1024){
+        isCanUpload = NO;
+    }
+    
     allImageData /= 1024;
     
     NSString *byteStr = nil;
@@ -149,7 +154,13 @@
     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];
+    
+    UIColor *noteColor =[UIColor hwColor:@"#959799" alpha:1.0];
+    if(!isCanUpload){
+        noteColor = [UIColor redColor];
+    }
+    
+    [noteStr addAttribute:NSForegroundColorAttributeName value:noteColor range:redRange];
     [noteStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14.0] range:redRange];
     // 设置行间距
     NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
@@ -159,7 +170,7 @@
 
     _selectNumLabel.attributedText = noteStr;
     
-    if(_indexPathsForSelectedItems.count > 0){
+    if(_indexPathsForSelectedItems.count > 0 && isCanUpload){
         self.uploadButon.enabled = YES;
         self.uploadButon.alpha = 1;
     }

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

@@ -564,6 +564,7 @@
     }
     
     self.uploadFileBottomV.availableStorage = baseInfoModel.data.availableStorage;
+    self.uploadFileBottomV.available =  baseInfoModel.data.available;
     [self setDataToBottomViewFun];
 }
 @end