Browse Source

1.安装带TV开关处理

huangxiaodong 7 hours ago
parent
commit
cc5e71deb4

+ 20 - 1
创维盒子/code/NAS/NasPreviewAPPViewController.m

@@ -946,6 +946,7 @@
         [self getFileListFun:NO];
         [self getUninstallAppListFun:NO];
         [self queryShareSwitchFunFun];
+        [self queryTVSwitchFunFun];
     }
 }
 
@@ -1368,7 +1369,25 @@
         if(queryShareMod){
             self->canShareType = queryShareMod.data.configValue;
             weakSelf.curEditTypeBottomView.isCanShareType = self->canShareType;
-            //[weakSelf.curEditTypeBottomView setCanShaewFunBy:queryShareMod.data.configValue];
+        }
+        
+    } failure:^(NSError * _Nonnull error) {
+    }];
+}
+
+#pragma mark 获取安装到TV开关
+-(void)queryTVSwitchFunFun
+{
+    NSMutableDictionary *paraDict = [NSMutableDictionary new];
+    
+    [paraDict setValue:@"tv_switch_button" forKey:@"configKey"];
+    
+    KWeakSelf
+    [[netWorkManager shareInstance] CommonGetWithCallBackCode:querySwitchButton Parameters:paraDict success:^(id  _Nonnull responseObject){
+        queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
+        if(queryShareMod){
+            BOOL canInstallToTVType = queryShareMod.data.configValue;
+            weakSelf.curEditTypeBottomView.isCanInstallToTVType = canInstallToTVType;
         }
         
     } failure:^(NSError * _Nonnull error) {

+ 1 - 0
创维盒子/code/NAS/view/editAPPBottomView.h

@@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
 //@property (nonatomic,assign) BOOL isBlackType;//黑色底部
 @property (nonatomic,assign) BOOL isCanDeleteType;//是否能删除
 @property (nonatomic,assign) BOOL isCanShareType;//是否能分享
+@property (nonatomic,assign) BOOL isCanInstallToTVType;//是否能分享
 
 - (void)setButtonStateFunBy:(BOOL)canClick;
 @end

+ 21 - 7
创维盒子/code/NAS/view/editAPPBottomView.m

@@ -220,6 +220,12 @@
     [self updateUIFun];
 }
 
+- (void)setIsCanInstallToTVType:(BOOL)isCanInstallToTVType
+{
+    _isCanInstallToTVType = isCanInstallToTVType;
+    [self updateUIFun];
+}
+
 - (void)setButtonStateFunBy:(BOOL)canClick
 {
     CGFloat alpha = canClick ? 1.0 : 0.5;
@@ -242,6 +248,8 @@
     NSInteger butNumber = 4;
     _twoButton.hidden = !_isCanShareType;
     _threeButton.hidden = !_isCanDeleteType;
+    _fourButton.hidden = !_isCanInstallToTVType;
+    
     
     if(!_isCanShareType){
         butNumber -= 1;
@@ -251,6 +259,10 @@
         butNumber -= 1;
     }
     
+    if(!_isCanInstallToTVType){
+        butNumber -= 1;
+    }
+    
     CGFloat curButFullWidth = SCREEN_W/butNumber;
     
     [_oneButton mas_remakeConstraints:^(MASConstraintMaker *make) {
@@ -270,13 +282,6 @@
     }
     
     
-    [_fourButton mas_remakeConstraints:^(MASConstraintMaker *make) {
-        make.width.mas_equalTo(curButFullWidth);
-        make.right.mas_equalTo(0);
-        make.height.mas_equalTo(60);
-        make.top.mas_equalTo(0);
-    }];
-    
     if (_isCanDeleteType) {
         [_threeButton mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.width.mas_equalTo(curButFullWidth);
@@ -286,6 +291,15 @@
         }];
     }
     
+    if (_isCanInstallToTVType) {
+        [_fourButton mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.width.mas_equalTo(curButFullWidth);
+            make.right.mas_equalTo(0);
+            make.height.mas_equalTo(60);
+            make.top.mas_equalTo(0);
+        }];
+    }
+    
 //    if(canShare){
 //        CGFloat curButFullWidth = SCREEN_W/3.0;
 //        [_leftButton mas_remakeConstraints:^(MASConstraintMaker *make) {

+ 6 - 0
创维盒子/code/netWork/newWorkInterface.h

@@ -192,4 +192,10 @@
  返回数据模型 */
 #define restartTheBox  @"/box/restartTheBox"
 
+/*28 安装TV按钮开关接口 POST请求
+输入参数 configKey 配置key=tv_switch_button
+ 
+ 返回数据模型 */
+#define querySwitchButton  @"/box/config/querySwitchButton"
+
 #endif /* newWorkInterface_h */