Pārlūkot izejas kodu

需求:1.传输列表非流量环境下上传/下载文件优化

huangxiaodong 8 mēneši atpakaļ
vecāks
revīzija
1250875d6c

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

@@ -766,6 +766,10 @@
 		6B8FF6BA2B04E19600800981 /* uploadFileRecordheadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8FF6B82B04E19600800981 /* uploadFileRecordheadView.m */; };
 		6B8FF6C12B05B24D00800981 /* uploadFileRecordCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8FF6BF2B05B24D00800981 /* uploadFileRecordCell.h */; };
 		6B8FF6C22B05B24D00800981 /* uploadFileRecordCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8FF6C02B05B24D00800981 /* uploadFileRecordCell.m */; };
+		6B9037202CC0BD58009795F0 /* nonWifiTipInRecordView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B90371F2CC0BD57009795F0 /* nonWifiTipInRecordView.m */; };
+		6B9037212CC0BD58009795F0 /* nonWifiTipInRecordView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B90371E2CC0BD57009795F0 /* nonWifiTipInRecordView.h */; };
+		6B9037222CC0BD58009795F0 /* nonWifiTipInRecordView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B90371E2CC0BD57009795F0 /* nonWifiTipInRecordView.h */; };
+		6B9037232CC0BD58009795F0 /* nonWifiTipInRecordView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B90371F2CC0BD57009795F0 /* nonWifiTipInRecordView.m */; };
 		6B9283662C4B62A30098CC75 /* newerGuideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B9283652C4B62A30098CC75 /* newerGuideView.m */; };
 		6B9283672C4B62A30098CC75 /* newerGuideView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B9283642C4B62A30098CC75 /* newerGuideView.h */; };
 		6B9283682C4B62A30098CC75 /* newerGuideView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B9283642C4B62A30098CC75 /* newerGuideView.h */; };
@@ -2025,6 +2029,8 @@
 		6B8FF6B82B04E19600800981 /* uploadFileRecordheadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordheadView.m; sourceTree = "<group>"; };
 		6B8FF6BF2B05B24D00800981 /* uploadFileRecordCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordCell.h; sourceTree = "<group>"; };
 		6B8FF6C02B05B24D00800981 /* uploadFileRecordCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordCell.m; sourceTree = "<group>"; };
+		6B90371E2CC0BD57009795F0 /* nonWifiTipInRecordView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nonWifiTipInRecordView.h; sourceTree = "<group>"; };
+		6B90371F2CC0BD57009795F0 /* nonWifiTipInRecordView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = nonWifiTipInRecordView.m; sourceTree = "<group>"; };
 		6B9283642C4B62A30098CC75 /* newerGuideView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = newerGuideView.h; sourceTree = "<group>"; };
 		6B9283652C4B62A30098CC75 /* newerGuideView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = newerGuideView.m; sourceTree = "<group>"; };
 		6B92836A2C4B94310098CC75 /* errorAlertTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = errorAlertTool.h; sourceTree = "<group>"; };
@@ -2797,6 +2803,8 @@
 				6B05827F2B01C67400D37290 /* uploadFileRecordViewController.m */,
 				6B5B605E2B3BC8DE009A2AE2 /* fileTransferPopView.h */,
 				6B5B605F2B3BC8DE009A2AE2 /* fileTransferPopView.m */,
+				6B90371E2CC0BD57009795F0 /* nonWifiTipInRecordView.h */,
+				6B90371F2CC0BD57009795F0 /* nonWifiTipInRecordView.m */,
 			);
 			path = uploadFile;
 			sourceTree = "<group>";
@@ -4049,6 +4057,7 @@
 				6B257E9F2C95964E00CBB70A /* backupPathListModel.h in Headers */,
 				6B5D866E2C22AE2B008D25EA /* NASMySpaceView.h in Headers */,
 				6BB481CF2C52481E00C21921 /* backupsOptionTipView.h in Headers */,
+				6B9037212CC0BD58009795F0 /* nonWifiTipInRecordView.h in Headers */,
 				6B467BB32BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				183AE6D12A8CA98C00B11CB0 /* CloudPhoneAPI.h in Headers */,
 				6B07AC252BF85859005C2B0E /* ShareRecordModel.h in Headers */,
@@ -4337,6 +4346,7 @@
 				6B257EA12C95964E00CBB70A /* backupPathListModel.h in Headers */,
 				6B5D866F2C22AE2B008D25EA /* NASMySpaceView.h in Headers */,
 				6BB481D12C52481E00C21921 /* backupsOptionTipView.h in Headers */,
+				6B9037222CC0BD58009795F0 /* nonWifiTipInRecordView.h in Headers */,
 				6B467BB52BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				6BD506A92B9576A4006E7CB0 /* CloudPhoneAPI.h in Headers */,
 				6B07AC282BF85859005C2B0E /* ShareRecordModel.h in Headers */,
@@ -5260,6 +5270,7 @@
 				6BD507AE2B9576A4006E7CB0 /* fileTransferPathCheckTableViewCell.m in Sources */,
 				6BD507B02B9576A4006E7CB0 /* ModifyPWDSecondViewController.m in Sources */,
 				6BD507B12B9576A4006E7CB0 /* photoPreViewBottomView.m in Sources */,
+				6B9037232CC0BD58009795F0 /* nonWifiTipInRecordView.m in Sources */,
 				6BD507B22B9576A4006E7CB0 /* TipsQRCodeViewController.m in Sources */,
 				6BD507B32B9576A4006E7CB0 /* JSONAPI.m in Sources */,
 				6BD507B42B9576A4006E7CB0 /* PlayerControlButTipView.m in Sources */,
@@ -5630,6 +5641,7 @@
 				6B5B60732B3D8098009A2AE2 /* fileTransferPathCheckTableViewCell.m in Sources */,
 				18F9CB002ABD3643003FF71A /* ModifyPWDSecondViewController.m in Sources */,
 				6B0582702AFF692700D37290 /* photoPreViewBottomView.m in Sources */,
+				6B9037202CC0BD58009795F0 /* nonWifiTipInRecordView.m in Sources */,
 				1868201E2AB97BE1005702A6 /* TipsQRCodeViewController.m in Sources */,
 				183AE6092A89CE3C00B11CB0 /* JSONAPI.m in Sources */,
 				6BF52CAE2AD82EA500A617DB /* PlayerControlButTipView.m in Sources */,

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

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

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


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


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

@@ -0,0 +1,16 @@
+//
+//  nonWifiTipInRecordView.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/10/17.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface nonWifiTipInRecordView : UIView
+@property (nonatomic,copy) void (^didClickBut)(void);// 
+@end
+
+NS_ASSUME_NONNULL_END

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

@@ -0,0 +1,90 @@
+//
+//  nonWifiTipInRecordView.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/10/17.
+//
+
+#import "nonWifiTipInRecordView.h"
+
+@implementation nonWifiTipInRecordView
+
+- (id)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    self.backgroundColor = [UIColor whiteColor];
+    [self drawAnyView];
+    
+    return self;
+}
+
+- (void)drawAnyView{
+    
+    UIView *whiteBgView = [[UIView alloc] init];
+    whiteBgView.backgroundColor = [UIColor hwColor:@"#DD4E4E" alpha:0.1];
+    whiteBgView.layer.cornerRadius = 8;
+    [self addSubview:whiteBgView];
+    
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.height.mas_equalTo(56);
+        make.bottom.mas_equalTo(0);
+    }];
+    
+    //感叹号
+    UIImageView * tipImageV = [[UIImageView alloc] init];
+    tipImageV.image = [UIImage imageNamed:@"common_red_gantanhao"];
+    [whiteBgView addSubview:tipImageV];
+    
+    [tipImageV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(12);
+        make.width.mas_equalTo(16);
+        make.height.mas_equalTo(16);
+        make.centerY.mas_equalTo(0);
+    }];
+    
+    //去开启
+    NSString *buttonTitle = NSLocalizedString(@"common_wwan_open_tip",nil);
+    UIButton *openButton = [[UIButton alloc] init];
+    openButton.backgroundColor =  [UIColor hwColor:@"#DD4E4E" alpha:1.0];
+    [openButton setTitle:buttonTitle forState:UIControlStateNormal];
+    [openButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    openButton.titleLabel.font = [UIFont systemFontOfSize:12.0];
+    openButton.layer.cornerRadius = 4;
+    openButton.userInteractionEnabled = NO;
+    [whiteBgView addSubview:openButton];
+    
+    [openButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-12);
+        make.width.mas_equalTo(52);
+        make.height.mas_equalTo(23);
+        make.centerY.mas_equalTo(0);
+    }];
+    
+    
+    //提示文字
+    UILabel *tipLabel = [[UILabel alloc] init];
+    tipLabel.text = NSLocalizedString(@"no_wifi_warn_tip",nil);
+    tipLabel.font = [UIFont systemFontOfSize:12.0];
+    tipLabel.textColor = [UIColor hwColor:@"#DD4E4E" alpha:1.0];
+    tipLabel.numberOfLines = 2;
+    [whiteBgView addSubview:tipLabel];
+    
+    [tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.left.equalTo(tipImageV.mas_right).offset(8);
+        make.right.equalTo(openButton.mas_left).offset(-15);
+    }];
+    
+    [whiteBgView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoOpenFun)]];
+    
+}
+
+- (void)gotoOpenFun
+{
+    if(_didClickBut){
+        _didClickBut();
+    }
+}
+@end

+ 61 - 3
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileRecordViewController.m

@@ -22,6 +22,8 @@
 #import "MySetViewController.h"
 #import "receiveView.h"
 #import "ComontAlretDeleteTypeViewController.h"
+#import "nonWifiTipInRecordView.h"
+#import "fileTransfeSetViewController.h"
 
 @interface uploadFileRecordViewController ()<UIScrollViewDelegate,UIDocumentPickerDelegate>
 
@@ -35,6 +37,7 @@
 @property (nonatomic, strong) backupsFilerecordTableView *rightTableView;
 
 @property (nonatomic, strong) receiveView *curReceiveView;
+@property (nonatomic, strong) nonWifiTipInRecordView *nonWifiTipInRecordV;
 
 
 //@property (nonatomic,strong) uploadFileRecordTableViewHeadView *leftHeadView;
@@ -54,6 +57,7 @@
 @property (nonatomic,assign) BOOL didGetbackupsloadDataType;
 
 @property (nonatomic, copy) NSString *h5ShareDownloadUrl;
+@property (nonatomic,assign) BOOL isNotFirstPushType;//是否第一次进来
 @end
 
 @implementation uploadFileRecordViewController
@@ -94,6 +98,11 @@
 {
     [super viewWillAppear:animated];
     
+    if(_isNotFirstPushType){//判断是否第一次进入 非第一次进入 不处理下面的逻辑
+        return;
+    }
+    _isNotFirstPushType = YES;
+    
     if(![iTools checkFreeDiskSpaceInBytesIsOK:500*1024*1024]
        && _isDownloadingType){
         mainBlock(^{
@@ -183,17 +192,49 @@
         [weakSelf didClickHeadFun: index];
     };
     
-    //CGFloat curHeight = SCREEN_H - CGRectGetMaxY(self.navBarBGView.frame) - 50 - 15;
-    CGFloat curHeight = SCREEN_H - (H_STATE_BAR + 64.f) - 50 - 15;
+    CGFloat nonWifiTipViewHeight = 0;
+    
+    BOOL isCanUseCellular = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular_all)];
+    //当前网络为流量 与流量传输没开
+    if ([AFNetworkReachabilityManager sharedManager].isReachableViaWWAN
+        && !isCanUseCellular || 1) {
+        [self.view addSubview:self.nonWifiTipInRecordV];
+        
+        [self.nonWifiTipInRecordV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            make.top.mas_equalTo(self.uploadFileRecordheadV.mas_bottom).offset(0.0);
+            make.height.mas_equalTo(56);
+        }];
+        
+        nonWifiTipViewHeight = 56;
+        
+#pragma mark 点击去开启
+        KWeakSelf
+        self.nonWifiTipInRecordV.didClickBut = ^{
+            [weakSelf gotoTranSettingVCFun];
+        };
+    }
+    
+    
+    CGFloat curHeight = SCREEN_H - (H_STATE_BAR + 64.f) - 50 - nonWifiTipViewHeight - 15;
     
     
     _uploadFileRecordBgScorllV= [[uploadFileRecordBgScorllView alloc] init];
     _uploadFileRecordBgScorllV.delegate = self;
+    _uploadFileRecordBgScorllV.pagingEnabled = YES;
+    //_uploadFileRecordBgScorllV.backgroundColor = [UIColor yellowColor];
     [self.view addSubview:_uploadFileRecordBgScorllV];
     [_uploadFileRecordBgScorllV mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
         make.right.mas_equalTo(0);
-        make.top.mas_equalTo(_uploadFileRecordheadV.mas_bottom).offset(0.0);
+        if(nonWifiTipViewHeight > 0){
+            make.top.mas_equalTo(self.nonWifiTipInRecordV.mas_bottom).offset(0.0);
+        }
+        else{
+            make.top.mas_equalTo(_uploadFileRecordheadV.mas_bottom).offset(0.0);
+        }
+        
         make.bottom.mas_equalTo(0);
     }];
     
@@ -353,6 +394,16 @@
     };
 }
 
+#pragma mark 懒加载
+- (nonWifiTipInRecordView*)nonWifiTipInRecordV
+{
+    if(!_nonWifiTipInRecordV){
+        _nonWifiTipInRecordV = [[nonWifiTipInRecordView alloc] init];
+    }
+    
+    return _nonWifiTipInRecordV;
+}
+
 #pragma mark 底部删除点击
 -(void)didClickBottomDeleteFun
 {
@@ -1365,4 +1416,11 @@
     }];
 }
 
+#pragma mark 跳转传输设置页面
+- (void)gotoTranSettingVCFun
+{
+    fileTransfeSetViewController *nextVC = [fileTransfeSetViewController new];
+    [self.navigationController pushViewController:nextVC animated:YES];
+}
+
 @end

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

@@ -622,3 +622,6 @@
 "enable_photo_permission"   = "开启照片权限";
 "enable_photo_permission_tip"   = "照片权限被禁用,允许访问所有照片可以享受更好的上传服务,过程加密安全请放心。";
 "enable_photo_permission_noData_tip"   = "暂未开启相册权限,快去开启吧~";
+"common_wwan_open_tip"   = "去开启";
+"no_wifi_warn_tip"   = "当前为非WIFI环境,如果想通过流量传输文件,请到设置页面开启流量传输。";
+