Browse Source

1.app更新弹框添加稍后再试(点击后此版本不在弹出)

huangxiaodong 1 year ago
parent
commit
05e2a601cb

+ 2 - 0
创维盒子/双子星云手机/AppDelegate/Config/Const.h

@@ -137,6 +137,8 @@ UIKIT_EXTERN NSString *const Const_need_show_Secret_key;
 /*标记公告已显示ID*/
 UIKIT_EXTERN NSString *const Const_did_show_Notice_ID;
 
+/*版本更新提示点击稍后再试*/
+UIKIT_EXTERN NSString *const Const_did_show_version_and_click_wait;
 @end
 
 NS_ASSUME_NONNULL_END

+ 4 - 1
创维盒子/双子星云手机/AppDelegate/Config/Const.m

@@ -131,5 +131,8 @@ NSString *const Const_default_upload_path = @"/sdcard/Download/";
 NSString *const Const_need_show_Secret_key = @"need_show_Secret_key";
 
 /*标记公告已显示ID*/
-NSString *const Const_did_show_Notice_ID = @"did_show_Notice_ID";;
+NSString *const Const_did_show_Notice_ID = @"did_show_Notice_ID";
+
+/*版本更新提示点击稍后再试*/
+NSString *const Const_did_show_version_and_click_wait = @"show_version_and_click_wait";
 @end

+ 84 - 36
创维盒子/双子星云手机/Class/Set/appUpdate/HaveNewVersionView.m

@@ -62,12 +62,15 @@ static HaveNewVersionView * _instance;
     NSString *tipStr = _versionModel.versionInfo;
     
     CGFloat curHeight = [tipStr boundingRectWithSize:CGSizeMake(300 -40, 1000) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0]} context:nil].size.height;
+    CGFloat fullHeight = curHeight + 20;
+    BOOL isNeedScroll = NO;
     
     curHeight += 10;
     
-    if( (curHeight + 280) >= SCREEN_H){
+    if( (curHeight + 380) >= SCREEN_H){
         
-        curHeight = SCREEN_H - 280 - 10;
+        curHeight = SCREEN_H - 380 - 10;
+        isNeedScroll = YES;
     }
     
     bgView = [[UIView alloc] init];
@@ -102,13 +105,49 @@ static HaveNewVersionView * _instance;
     [tipsLabel setFont:[UIFont systemFontOfSize:13.f]];
     //[tipsLabel setTextAlignment:(NSTextAlignmentCenter)];
     [tipsLabel setNumberOfLines:0];
-    [bgView addSubview:tipsLabel];
-    [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(topImageView.mas_bottom).offset(20.f);
-        make.left.mas_equalTo(20);
-        make.right.mas_equalTo(-20);
-        make.height.mas_equalTo(curHeight);
-    }];
+//    [bgView addSubview:tipsLabel];
+//    [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.equalTo(topImageView.mas_bottom).offset(20.f);
+//        make.left.mas_equalTo(20);
+//        make.right.mas_equalTo(-20);
+//        make.height.mas_equalTo(curHeight);
+//    }];
+    
+    
+    //可能文字超出
+    UIScrollView *bgScorllV = [[UIScrollView alloc] init];
+    //bgScorllV.showsHorizontalScrollIndicator = NO;
+    //bgScorllV.backgroundColor = [UIColor greenColor];
+    if(isNeedScroll){
+        
+        [bgView addSubview:bgScorllV];
+        [bgScorllV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.top.equalTo(topImageView.mas_bottom).offset(20.f);
+            make.left.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.height.mas_equalTo(curHeight);
+        }];
+        
+        [bgScorllV addSubview:tipsLabel];
+        [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.top.mas_equalTo(0);
+            make.left.mas_equalTo(20);
+            //make.right.mas_equalTo(-20);
+            make.width.mas_equalTo(260);
+            make.height.mas_equalTo(fullHeight);
+        }];
+        
+        bgScorllV.contentSize = CGSizeMake(300, fullHeight);
+    }
+    else{
+        [bgView addSubview:tipsLabel];
+        [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.top.equalTo(topImageView.mas_bottom).offset(20.f);
+            make.left.mas_equalTo(20);
+            make.right.mas_equalTo(-20);
+            make.height.mas_equalTo(curHeight);
+        }];
+    }
     
     /*删除按钮*/
     deleteBtn = [[UIButton alloc] init];
@@ -127,15 +166,15 @@ static HaveNewVersionView * _instance;
     deleteBtn.hidden = YES;
     
     // 分割线
-    UIView *line = [[UIView alloc] init];
-    line.backgroundColor = HWCCCCCCColor;
-    [bgView addSubview:line];
-    [line mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.mas_equalTo(0);
-        make.right.mas_equalTo(0);
-        make.height.mas_equalTo(1);
-        make.bottom.mas_equalTo(-92);
-    }];
+//    UIView *line = [[UIView alloc] init];
+//    line.backgroundColor = HWCCCCCCColor;
+//    [bgView addSubview:line];
+//    [line mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.left.mas_equalTo(0);
+//        make.right.mas_equalTo(0);
+//        make.height.mas_equalTo(1);
+//        make.bottom.mas_equalTo(-92);
+//    }];
     
 //    /*确定按钮*/
 //    UIButton *okBtn = [[UIButton alloc] init];
@@ -154,6 +193,21 @@ static HaveNewVersionView * _instance;
 //        make.bottom.mas_equalTo(-20.f);
 //    }];
     
+    /*稍后再说 按钮 app_update_wait*/
+    UIButton *waitBtn = [[UIButton alloc] init];
+    [waitBtn setTitle:NSLocalizedString(@"app_update_wait",nil) forState:(UIControlStateNormal)];
+    [waitBtn setTitleColor:HW666666Color forState:UIControlStateNormal];
+    [waitBtn.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
+    [waitBtn addTarget:self action:@selector(waitBtnPressed) forControlEvents:(UIControlEventTouchUpInside)];
+    [bgView addSubview:waitBtn];
+
+    [waitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(30.f);
+        make.width.mas_equalTo(168.f);
+        make.centerX.equalTo(bgView.mas_centerX);
+        make.bottom.mas_equalTo(-20.f);
+    }];
+    
     UIButton *updatekBtn = [[UIButton alloc] init];
     updatekBtn.frame = CGRectMake(0, 0, 160.f, 48.f);
 
@@ -176,28 +230,22 @@ static HaveNewVersionView * _instance;
     [updatekBtn mas_makeConstraints:^(MASConstraintMaker *make) {
         make.centerX.equalTo(bgView.mas_centerX);
         make.width.mas_equalTo(160.f);
-        make.bottom.mas_equalTo(-20.f);
-        make.height.mas_equalTo(48.f);
+        make.bottom.equalTo(waitBtn.mas_top).offset(-10);
+        make.height.mas_equalTo(40.f);
     }];
     
-//    UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 1, 1) style:(UITableViewStylePlain)];
-//    tableView.delegate = self;
-//    tableView.dataSource = self;
-//    [tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
-//    [tableView setSeparatorColor:[UIColor clearColor]];
-//    [tableView setBackgroundColor:[UIColor clearColor]];
-//    if (@available(iOS 15.0, *)) {
-//        tableView.sectionHeaderTopPadding = 0;
-//    }
-//    [bgView addSubview:tableView];
-//    [tableView mas_makeConstraints:^(MASConstraintMaker *make) {
-//        make.left.mas_equalTo(0);
-//        make.right.mas_equalTo(0);
-//        make.top.mas_equalTo(topImageView.mas_bottom);
-//        make.bottom.mas_equalTo(line.mas_top);
-//    }];
+   
 }
 
+- (void)waitBtnPressed
+{
+    [self deleteBtnPressed];
+    
+    if(_versionModel.versionNumber){
+        [HWDataManager setObjectWithKey:Const_did_show_version_and_click_wait value:_versionModel.versionNumber];
+    }
+    
+}
 - (void)deleteBtnPressed
 {
     [self removeFromSuperview];

+ 8 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm

@@ -127,6 +127,14 @@
     if (haveNewVersionView.isShow) {
         return;
     }
+    
+    //此版本点击过稍后再试
+    NSString *preVersionstr = [HWDataManager getStringWithKey:Const_did_show_version_and_click_wait];
+    if(preVersionstr && [versionModel.versionNumber isEqualToString:preVersionstr]){
+        [self getLastNoticeFun];
+        return;
+    }
+    
     haveNewVersionView.versionModel = versionModel;
     haveNewVersionView.isContinueCheckAlert = NO; // 是否继续走下一步弹窗检测流程
     [haveNewVersionView setBackgroundColor:RGBACOLOR(0, 0, 0, 0.5)];

+ 1 - 1
创维盒子/双子星云手机/en.lproj/Localizable.strings

@@ -88,7 +88,7 @@
 "app_update_checking" = "Detecting new version";
 "app_update_last_version" = "Already the latest version";
 "app_update_new_version_tips" = "For a better user experience, please update to the latest version";
-"app_update_update"   = "Update";
+"app_update_update"   = "Update Now";
 
 //"share_copy_paste_link"   = "链接已复制,快去粘贴吧";
 //"share_no_qq"   = "未安装QQ,请先安装QQ";

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

@@ -88,7 +88,7 @@
 "app_update_checking" = "检测新版本中…";
 "app_update_last_version" = "已是最新版本";
 "app_update_new_version_tips" = "为了更好的操作体验,请更新\n至最新版本";
-"app_update_update"   = "更新";
+"app_update_update"   = "立即更新";
 
 "share_copy_paste_link"   = "链接已复制,快去粘贴吧";
 "share_no_qq"   = "未安装QQ,请先安装QQ";
@@ -450,3 +450,4 @@
 "player_link_fail_tip_type3" = "检查步骤:\n1、检查盒子是否通电电网;\n2、检查路由网络是否正常;\n3、TV打开Private-X应用看能否进入推流;\n\n解决步骤:\n1、切换盒子网络后进入云机;\n2、拔插电源后等待3-5分钟后进入云机;\n3、拔插路由网络等待3-5分钟后进入云机;\n4、TV进行问题反馈,并将SN给到客服";
 "player_link_fail_tip_type9" = "网络异常,请联系Private-X公众号客服寻求帮助!";
 "common_loading_tip" = "数据正在加载中";
+"app_update_wait"   = "稍后再说";

+ 1 - 1
创维盒子/双子星云手机/zh-Hant.lproj/Localizable.strings

@@ -88,7 +88,7 @@
 "app_update_checking" = "檢測新版本中...";
 "app_update_last_version" = "已是最新版本";
 "app_update_new_version_tips" = "為了更好的操作體驗,請更新\n至最新版本";
-"app_update_update"   = "更新";
+"app_update_update"   = "立即更新";
 
 "share_copy_paste_link"   = "鏈接已複製,快去粘貼吧";
 "share_no_qq"   = "未安裝QQ,請先安裝QQ";