浏览代码

1.app搜索相关bug修复

huangxiaodong 4 天之前
父节点
当前提交
ee3f8ea5a1

+ 3 - 4
创维盒子/code/NAS/NasPreviewAPPViewController.m

@@ -647,15 +647,15 @@
     
     if (!isDefaultTabType || isSecondTabType) {
         _curInstalledAppListMod = _getUninstalledAppListMod;
+        self.curEditTypeBottomView.isCanDeleteType = YES;
     }
     else{
         _curInstalledAppListMod = _getInstalledAppListMod;
+        self.curEditTypeBottomView.isCanDeleteType = NO;
     }
     
     if(isDefaultTabType //&& !isSecondTabType
        ){
-        //_curInstalledAppListMod = _getInstalledAppListMod;
-        self.curEditTypeBottomView.isCanDeleteType = NO;
         
         [_searchBarThridTypeV mas_remakeConstraints:^(MASConstraintMaker *make) {
             //make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
@@ -667,8 +667,6 @@
         }];
     }
     else{
-        //_curInstalledAppListMod = _getUninstalledAppListMod;
-        self.curEditTypeBottomView.isCanDeleteType = YES;
         
         [_searchBarThridTypeV mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
@@ -1463,6 +1461,7 @@
 - (void)gotoSearchVCFun
 {
     NasSearchAppViewController *vc = [NasSearchAppViewController new];
+    vc.isCanDeleteType = self.curEditTypeBottomView.isCanDeleteType;
     vc.totalAPPListModel = _curInstalledAppListMod;
     [self.navigationController pushViewController:vc animated:YES];
 }

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

@@ -11,6 +11,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface NasSearchAppViewController : BaseViewController
+@property (nonatomic,assign) BOOL isCanDeleteType;//是否能删除
 @property(nonatomic,strong) getInstalledAppListModel * totalAPPListModel;//当前外面传入全部数据
 @end
 

+ 26 - 5
创维盒子/code/NAS/NasSearchAppViewController.m

@@ -18,7 +18,7 @@
 #import "editShareView.h"
 #import "netWorkManager.h"
 #import "queryShareModel.h"
-
+#import "editAPPBottomView.h"
 
 @interface NasSearchAppViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
@@ -28,7 +28,7 @@
 
 @property(nonatomic,assign) BOOL isEditType;
 @property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
-@property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
+@property(nonatomic,strong) editAPPBottomView*curEditTypeBottomView;
 @property(nonatomic,strong) searchBarSecondTypeView* searchBarSecondTypeV;//
 @property (nonatomic, strong)  NSMutableArray*didSelectListArr;//选中的数据
 @property (nonatomic, strong)  NSMutableArray*curSearchListArr;//搜索(过滤)的数据
@@ -103,8 +103,9 @@
     };
     
     
-    _curEditTypeBottomView = [[editTypeBottomView alloc] init];
+    _curEditTypeBottomView = [[editAPPBottomView alloc] init];
     _curEditTypeBottomView.hidden = YES;
+    _curEditTypeBottomView.isCanDeleteType = _isCanDeleteType;
     [self.view addSubview:_curEditTypeBottomView];
     
     [_curEditTypeBottomView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -413,6 +414,7 @@
     
     if(!_curSearchListArr || _curSearchListArr.count == 0){
         [self queryShareSwitchFunFun];
+        [self queryTVSwitchFunFun];
     }
 }
 
@@ -642,11 +644,30 @@
         queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
         if(queryShareMod){
             self->canShareType = queryShareMod.data.configValue;
-            //weakSelf.curEditTypeBottomView.isCanShareType = self->canShareType;
-            [weakSelf.curEditTypeBottomView setCanShaewFunBy:queryShareMod.data.configValue];
+            weakSelf.curEditTypeBottomView.isCanShareType = self->canShareType;
         }
         
     } 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) {
+    }];
+}
+
 @end