Commit 9cd2e47f387ecc881e2835ea1e4718627820803c

Authored by 张旭
2 parents 67e6588e 7986b10b

Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/ScioLive

Showing 65 changed files with 702 additions and 993 deletions
CNLiveScioLive.xcodeproj/project.pbxproj
@@ -13,7 +13,6 @@ @@ -13,7 +13,6 @@
13 080AB4C8217AD4F4008BA78F /* TemplateShareManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 080AB4C5217AD4F4008BA78F /* TemplateShareManager.m */; }; 13 080AB4C8217AD4F4008BA78F /* TemplateShareManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 080AB4C5217AD4F4008BA78F /* TemplateShareManager.m */; };
14 0816B5E42648C23A005E1F8C /* UIColor+CNGray.m in Sources */ = {isa = PBXBuildFile; fileRef = 0816B5E32648C23A005E1F8C /* UIColor+CNGray.m */; }; 14 0816B5E42648C23A005E1F8C /* UIColor+CNGray.m in Sources */ = {isa = PBXBuildFile; fileRef = 0816B5E32648C23A005E1F8C /* UIColor+CNGray.m */; };
15 0816B5E92648C320005E1F8C /* WKWebView+CNGray.m in Sources */ = {isa = PBXBuildFile; fileRef = 0816B5E82648C320005E1F8C /* WKWebView+CNGray.m */; }; 15 0816B5E92648C320005E1F8C /* WKWebView+CNGray.m in Sources */ = {isa = PBXBuildFile; fileRef = 0816B5E82648C320005E1F8C /* WKWebView+CNGray.m */; };
16 - 0836125A264BA2BF00A18E52 /* UILabel+CNGray.m in Sources */ = {isa = PBXBuildFile; fileRef = 08361259264BA2BF00A18E52 /* UILabel+CNGray.m */; };  
17 083847E1215C5DDD00186618 /* VPImageCropperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 083847E0215C5DDD00186618 /* VPImageCropperViewController.m */; }; 16 083847E1215C5DDD00186618 /* VPImageCropperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 083847E0215C5DDD00186618 /* VPImageCropperViewController.m */; };
18 083847E2215C5DDD00186618 /* VPImageCropperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 083847E0215C5DDD00186618 /* VPImageCropperViewController.m */; }; 17 083847E2215C5DDD00186618 /* VPImageCropperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 083847E0215C5DDD00186618 /* VPImageCropperViewController.m */; };
19 083847E3215C5DDD00186618 /* VPImageCropperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 083847E0215C5DDD00186618 /* VPImageCropperViewController.m */; }; 18 083847E3215C5DDD00186618 /* VPImageCropperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 083847E0215C5DDD00186618 /* VPImageCropperViewController.m */; };
@@ -91,9 +90,6 @@ @@ -91,9 +90,6 @@
91 084ACE3B2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACE3A2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m */; }; 90 084ACE3B2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACE3A2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m */; };
92 084ACE3C2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACE3A2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m */; }; 91 084ACE3C2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACE3A2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m */; };
93 084ACE3D2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACE3A2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m */; }; 92 084ACE3D2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACE3A2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m */; };
94 - 084ACE402154D7F70089E035 /* CNHomeBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACE3F2154D7F70089E035 /* CNHomeBaseViewController.m */; };  
95 - 084ACE412154D7F70089E035 /* CNHomeBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACE3F2154D7F70089E035 /* CNHomeBaseViewController.m */; };  
96 - 084ACE422154D7F70089E035 /* CNHomeBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACE3F2154D7F70089E035 /* CNHomeBaseViewController.m */; };  
97 08515D07215B81E900411756 /* TopNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08515D06215B81E900411756 /* TopNoticeViewController.m */; }; 93 08515D07215B81E900411756 /* TopNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08515D06215B81E900411756 /* TopNoticeViewController.m */; };
98 08515D08215B81E900411756 /* TopNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08515D06215B81E900411756 /* TopNoticeViewController.m */; }; 94 08515D08215B81E900411756 /* TopNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08515D06215B81E900411756 /* TopNoticeViewController.m */; };
99 08515D09215B81E900411756 /* TopNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08515D06215B81E900411756 /* TopNoticeViewController.m */; }; 95 08515D09215B81E900411756 /* TopNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08515D06215B81E900411756 /* TopNoticeViewController.m */; };
@@ -741,8 +737,6 @@ @@ -741,8 +737,6 @@
741 0816B5E32648C23A005E1F8C /* UIColor+CNGray.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIColor+CNGray.m"; sourceTree = "<group>"; }; 737 0816B5E32648C23A005E1F8C /* UIColor+CNGray.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIColor+CNGray.m"; sourceTree = "<group>"; };
742 0816B5E72648C320005E1F8C /* WKWebView+CNGray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WKWebView+CNGray.h"; sourceTree = "<group>"; }; 738 0816B5E72648C320005E1F8C /* WKWebView+CNGray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WKWebView+CNGray.h"; sourceTree = "<group>"; };
743 0816B5E82648C320005E1F8C /* WKWebView+CNGray.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "WKWebView+CNGray.m"; sourceTree = "<group>"; }; 739 0816B5E82648C320005E1F8C /* WKWebView+CNGray.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "WKWebView+CNGray.m"; sourceTree = "<group>"; };
744 - 08361258264BA2BF00A18E52 /* UILabel+CNGray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UILabel+CNGray.h"; sourceTree = "<group>"; };  
745 - 08361259264BA2BF00A18E52 /* UILabel+CNGray.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UILabel+CNGray.m"; sourceTree = "<group>"; };  
746 083847DF215C5DDD00186618 /* VPImageCropperViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPImageCropperViewController.h; sourceTree = "<group>"; }; 740 083847DF215C5DDD00186618 /* VPImageCropperViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPImageCropperViewController.h; sourceTree = "<group>"; };
747 083847E0215C5DDD00186618 /* VPImageCropperViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VPImageCropperViewController.m; sourceTree = "<group>"; }; 741 083847E0215C5DDD00186618 /* VPImageCropperViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VPImageCropperViewController.m; sourceTree = "<group>"; };
748 0838483C215C838B00186618 /* CNLiveENTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveENTabBarController.h; sourceTree = "<group>"; }; 742 0838483C215C838B00186618 /* CNLiveENTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveENTabBarController.h; sourceTree = "<group>"; };
@@ -795,8 +789,6 @@ @@ -795,8 +789,6 @@
795 084ACE352154C6D60089E035 /* CNLiveNewsLeftPicTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveNewsLeftPicTableViewCell.m; sourceTree = "<group>"; }; 789 084ACE352154C6D60089E035 /* CNLiveNewsLeftPicTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveNewsLeftPicTableViewCell.m; sourceTree = "<group>"; };
796 084ACE392154C8310089E035 /* CNLiveNewsUpPicTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveNewsUpPicTableViewCell.h; sourceTree = "<group>"; }; 790 084ACE392154C8310089E035 /* CNLiveNewsUpPicTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveNewsUpPicTableViewCell.h; sourceTree = "<group>"; };
797 084ACE3A2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveNewsUpPicTableViewCell.m; sourceTree = "<group>"; }; 791 084ACE3A2154C8310089E035 /* CNLiveNewsUpPicTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveNewsUpPicTableViewCell.m; sourceTree = "<group>"; };
798 - 084ACE3E2154D7F70089E035 /* CNHomeBaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNHomeBaseViewController.h; sourceTree = "<group>"; };  
799 - 084ACE3F2154D7F70089E035 /* CNHomeBaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNHomeBaseViewController.m; sourceTree = "<group>"; };  
800 08515D05215B81E900411756 /* TopNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopNoticeViewController.h; sourceTree = "<group>"; }; 792 08515D05215B81E900411756 /* TopNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopNoticeViewController.h; sourceTree = "<group>"; };
801 08515D06215B81E900411756 /* TopNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopNoticeViewController.m; sourceTree = "<group>"; }; 793 08515D06215B81E900411756 /* TopNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopNoticeViewController.m; sourceTree = "<group>"; };
802 08585CE3215B302C00FC2CA2 /* CNLiveSearchViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveSearchViewController.h; sourceTree = "<group>"; }; 794 08585CE3215B302C00FC2CA2 /* CNLiveSearchViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveSearchViewController.h; sourceTree = "<group>"; };
@@ -1816,8 +1808,6 @@ @@ -1816,8 +1808,6 @@
1816 children = ( 1808 children = (
1817 08C09000214FB0E600E23D16 /* CNHomeViewController.h */, 1809 08C09000214FB0E600E23D16 /* CNHomeViewController.h */,
1818 08C09001214FB0E600E23D16 /* CNHomeViewController.m */, 1810 08C09001214FB0E600E23D16 /* CNHomeViewController.m */,
1819 - 084ACE3E2154D7F70089E035 /* CNHomeBaseViewController.h */,  
1820 - 084ACE3F2154D7F70089E035 /* CNHomeBaseViewController.m */,  
1821 08384845215C98A000186618 /* CNHomeENViewController.h */, 1811 08384845215C98A000186618 /* CNHomeENViewController.h */,
1822 08384846215C98A000186618 /* CNHomeENViewController.m */, 1812 08384846215C98A000186618 /* CNHomeENViewController.m */,
1823 084ACE202154B1270089E035 /* CNHomeModel.h */, 1813 084ACE202154B1270089E035 /* CNHomeModel.h */,
@@ -2255,8 +2245,6 @@ @@ -2255,8 +2245,6 @@
2255 0816B5E32648C23A005E1F8C /* UIColor+CNGray.m */, 2245 0816B5E32648C23A005E1F8C /* UIColor+CNGray.m */,
2256 0816B5E72648C320005E1F8C /* WKWebView+CNGray.h */, 2246 0816B5E72648C320005E1F8C /* WKWebView+CNGray.h */,
2257 0816B5E82648C320005E1F8C /* WKWebView+CNGray.m */, 2247 0816B5E82648C320005E1F8C /* WKWebView+CNGray.m */,
2258 - 08361258264BA2BF00A18E52 /* UILabel+CNGray.h */,  
2259 - 08361259264BA2BF00A18E52 /* UILabel+CNGray.m */,  
2260 ); 2248 );
2261 path = ImageGray; 2249 path = ImageGray;
2262 sourceTree = "<group>"; 2250 sourceTree = "<group>";
@@ -2845,7 +2833,6 @@ @@ -2845,7 +2833,6 @@
2845 isa = PBXSourcesBuildPhase; 2833 isa = PBXSourcesBuildPhase;
2846 buildActionMask = 2147483647; 2834 buildActionMask = 2147483647;
2847 files = ( 2835 files = (
2848 - 0836125A264BA2BF00A18E52 /* UILabel+CNGray.m in Sources */,  
2849 08B5C5822153400700F5476E /* CNNewsoundBaseModel.m in Sources */, 2836 08B5C5822153400700F5476E /* CNNewsoundBaseModel.m in Sources */,
2850 08585DB5215B4DA300FC2CA2 /* CNLiveAdvancedSearchViewController.m in Sources */, 2837 08585DB5215B4DA300FC2CA2 /* CNLiveAdvancedSearchViewController.m in Sources */,
2851 08C28A30263932960065B372 /* UIImageView+CNGrayImage.m in Sources */, 2838 08C28A30263932960065B372 /* UIImageView+CNGrayImage.m in Sources */,
@@ -2872,7 +2859,6 @@ @@ -2872,7 +2859,6 @@
2872 08585D86215B4C7200FC2CA2 /* PGDatePicker+Common.m in Sources */, 2859 08585D86215B4C7200FC2CA2 /* PGDatePicker+Common.m in Sources */,
2873 08C090732150C79C00E23D16 /* UIView+ViewController.m in Sources */, 2860 08C090732150C79C00E23D16 /* UIView+ViewController.m in Sources */,
2874 085D86D1215A3BFD0037D480 /* CNLiveUserUpdateViewController.m in Sources */, 2861 085D86D1215A3BFD0037D480 /* CNLiveUserUpdateViewController.m in Sources */,
2875 - 084ACE402154D7F70089E035 /* CNHomeBaseViewController.m in Sources */,  
2876 08C08FE3214FA01B00E23D16 /* CNLiveViewController.m in Sources */, 2862 08C08FE3214FA01B00E23D16 /* CNLiveViewController.m in Sources */,
2877 0838483E215C838B00186618 /* CNLiveENTabBarController.m in Sources */, 2863 0838483E215C838B00186618 /* CNLiveENTabBarController.m in Sources */,
2878 085D86C7215A20A50037D480 /* CNLiveUserSettingViewController.m in Sources */, 2864 085D86C7215A20A50037D480 /* CNLiveUserSettingViewController.m in Sources */,
@@ -3149,7 +3135,6 @@ @@ -3149,7 +3135,6 @@
3149 08B5C5AD21535D4400F5476E /* NSString+Validation.m in Sources */, 3135 08B5C5AD21535D4400F5476E /* NSString+Validation.m in Sources */,
3150 08384853215CA74700186618 /* SCIOSpecialViewController.m in Sources */, 3136 08384853215CA74700186618 /* SCIOSpecialViewController.m in Sources */,
3151 08384869215CAB1C00186618 /* YWWebScrollView.m in Sources */, 3137 08384869215CAB1C00186618 /* YWWebScrollView.m in Sources */,
3152 - 084ACE412154D7F70089E035 /* CNHomeBaseViewController.m in Sources */,  
3153 084ACE19215481870089E035 /* NoDataView.m in Sources */, 3138 084ACE19215481870089E035 /* NoDataView.m in Sources */,
3154 0870DACF215F1CE6008DC811 /* VideoPlayBackViewController.m in Sources */, 3139 0870DACF215F1CE6008DC811 /* VideoPlayBackViewController.m in Sources */,
3155 08B5C5A221534DC700F5476E /* CNLiveRegisterEmailViewController.m in Sources */, 3140 08B5C5A221534DC700F5476E /* CNLiveRegisterEmailViewController.m in Sources */,
@@ -3304,7 +3289,6 @@ @@ -3304,7 +3289,6 @@
3304 08B5C5AE21535D4400F5476E /* NSString+Validation.m in Sources */, 3289 08B5C5AE21535D4400F5476E /* NSString+Validation.m in Sources */,
3305 08384854215CA74700186618 /* SCIOSpecialViewController.m in Sources */, 3290 08384854215CA74700186618 /* SCIOSpecialViewController.m in Sources */,
3306 0838486A215CAB1C00186618 /* YWWebScrollView.m in Sources */, 3291 0838486A215CAB1C00186618 /* YWWebScrollView.m in Sources */,
3307 - 084ACE422154D7F70089E035 /* CNHomeBaseViewController.m in Sources */,  
3308 084ACE1A215481870089E035 /* NoDataView.m in Sources */, 3292 084ACE1A215481870089E035 /* NoDataView.m in Sources */,
3309 0870DAD0215F1CE6008DC811 /* VideoPlayBackViewController.m in Sources */, 3293 0870DAD0215F1CE6008DC811 /* VideoPlayBackViewController.m in Sources */,
3310 08B5C5A321534DC700F5476E /* CNLiveRegisterEmailViewController.m in Sources */, 3294 08B5C5A321534DC700F5476E /* CNLiveRegisterEmailViewController.m in Sources */,
CNLiveScioLive/AppDelegate.m
@@ -17,6 +17,8 @@ @@ -17,6 +17,8 @@
17 @interface AppDelegate ()<XGPushDelegate> 17 @interface AppDelegate ()<XGPushDelegate>
18 { 18 {
19 UIImageView *imageView; 19 UIImageView *imageView;
  20 + NSTimer *connectionTimer;
  21 + BOOL done;
20 } 22 }
21 @property (nonatomic, assign) BOOL isPush; //区分普通启动还是推送 23 @property (nonatomic, assign) BOOL isPush; //区分普通启动还是推送
22 @property (nonatomic, copy) NSString *type; //区分首页还是直播 还是id 24 @property (nonatomic, copy) NSString *type; //区分首页还是直播 还是id
@@ -58,17 +60,11 @@ @@ -58,17 +60,11 @@
58 [self checkAppUpdate]; 60 [self checkAppUpdate];
59 61
60 [self initializeSDKConfiguration]; 62 [self initializeSDKConfiguration];
61 - [self requestLanchImage];  
62 - NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"lanchImage"];  
63 - if (data.length>0) {  
64 - UIViewController *VC = [[UIViewController alloc] init];  
65 - imageView= [[UIImageView alloc ] initWithFrame :[ UIScreen mainScreen ]. bounds ];  
66 - [imageView setImage:[UIImage imageWithData:data]];  
67 - [VC.view addSubview:imageView];  
68 - self.window.rootViewController = VC;  
69 - [self performSelector:@selector(removeImage) withObject:nil afterDelay:3];  
70 - [self.window makeKeyAndVisible];  
71 - } 63 + [self requestLanchImage:0];
  64 + do{
  65 + [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]];
  66 +
  67 + }while (!done);
72 return YES; 68 return YES;
73 } 69 }
74 -(void)addRootViewController 70 -(void)addRootViewController
@@ -92,10 +88,11 @@ @@ -92,10 +88,11 @@
92 CNLiveENTabBarController *liveTab = [[CNLiveENTabBarController alloc] init]; 88 CNLiveENTabBarController *liveTab = [[CNLiveENTabBarController alloc] init];
93 self.window.rootViewController = liveTab; 89 self.window.rootViewController = liveTab;
94 } 90 }
  91 + done = YES;
95 [self.window makeKeyAndVisible]; 92 [self.window makeKeyAndVisible];
96 } 93 }
97 #pragma mark - 请求启动页 94 #pragma mark - 请求启动页
98 --(void)requestLanchImage 95 +-(void)requestLanchImage:(int)time
99 { 96 {
100 NSString *urlStr = REQUESTURL(@"gxb/openBanner"); 97 NSString *urlStr = REQUESTURL(@"gxb/openBanner");
101 NSDictionary *parameters = @{@"params":@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"pageUUID\":\"852cde69-ecd8-11e6-b52e-c7d8a7a18cc4\",\"pageType\":\"channelList\"}"}; 98 NSDictionary *parameters = @{@"params":@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"pageUUID\":\"852cde69-ecd8-11e6-b52e-c7d8a7a18cc4\",\"pageType\":\"channelList\"}"};
@@ -103,7 +100,7 @@ @@ -103,7 +100,7 @@
103 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json]; 100 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json];
104 NSURL *url = [NSURL URLWithString:dic[@"data"][@"image"]]; 101 NSURL *url = [NSURL URLWithString:dic[@"data"][@"image"]];
105 NSString * mode = dic[@"grayMode"]; 102 NSString * mode = dic[@"grayMode"];
106 - if (mode.intValue == 1) { 103 + if (mode&&mode.intValue == 1) {
107 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:ISGRAYMODE]; 104 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:ISGRAYMODE];
108 }else{ 105 }else{
109 [[NSUserDefaults standardUserDefaults] setBool:NO forKey:ISGRAYMODE]; 106 [[NSUserDefaults standardUserDefaults] setBool:NO forKey:ISGRAYMODE];
@@ -115,9 +112,17 @@ @@ -115,9 +112,17 @@
115 [[NSUserDefaults standardUserDefaults] setValue:nil forKey:HOMETITLECOLOR]; 112 [[NSUserDefaults standardUserDefaults] setValue:nil forKey:HOMETITLECOLOR];
116 } 113 }
117 NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"lanchImage"]; 114 NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"lanchImage"];
118 - if (data.length<=0) { 115 + NSString *errorCode = dic[@"errorCode"];
119 [self addRootViewController]; 116 [self addRootViewController];
120 - } 117 + if (errorCode.intValue == 0) {
  118 + if (data.length>0) {
  119 + self->imageView= [[UIImageView alloc ] initWithFrame :[ UIScreen mainScreen ]. bounds ];
  120 + [self->imageView setImage:[UIImage imageWithData:data]];
  121 + [AppKeyWindow addSubview:self->imageView];
  122 + self->imageView.contentMode= UIViewContentModeScaleAspectFill;
  123 + [self performSelector:@selector(removeImage) withObject:nil afterDelay:3];
  124 + self->done = YES;
  125 + }
121 NSURLSessionConfiguration *configuration = [ NSURLSessionConfiguration defaultSessionConfiguration ]; 126 NSURLSessionConfiguration *configuration = [ NSURLSessionConfiguration defaultSessionConfiguration ];
122 AFURLSessionManager *manager = [[ AFURLSessionManager alloc ] initWithSessionConfiguration :configuration]; 127 AFURLSessionManager *manager = [[ AFURLSessionManager alloc ] initWithSessionConfiguration :configuration];
123 NSURLRequest *request = [ NSURLRequest requestWithURL :url]; 128 NSURLRequest *request = [ NSURLRequest requestWithURL :url];
@@ -133,15 +138,16 @@ @@ -133,15 +138,16 @@
133 138
134 }]; 139 }];
135 [downloadTask resume ]; 140 [downloadTask resume ];
136 - 141 + }
137 } failure:^(NSError *error) { 142 } failure:^(NSError *error) {
138 - [self requestLanchImage]; 143 + [self addRootViewController];
  144 +
139 }]; 145 }];
  146 +
140 } 147 }
141 -(void)removeImage{ 148 -(void)removeImage{
142 [imageView removeFromSuperview]; 149 [imageView removeFromSuperview];
143 imageView = nil; 150 imageView = nil;
144 - [self addRootViewController];  
145 } 151 }
146 //语言 152 //语言
147 #pragma mark - 语言 153 #pragma mark - 语言
@@ -187,6 +193,7 @@ @@ -187,6 +193,7 @@
187 193
188 194
189 - (void)applicationDidEnterBackground:(UIApplication *)application { 195 - (void)applicationDidEnterBackground:(UIApplication *)application {
  196 + [[NSNotificationCenter defaultCenter] postNotificationName:RESIGNACTIVE object:nil];
190 // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 197 // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
191 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 198 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
192 } 199 }
@@ -195,13 +202,34 @@ @@ -195,13 +202,34 @@
195 - (void)applicationWillEnterForeground:(UIApplication *)application { 202 - (void)applicationWillEnterForeground:(UIApplication *)application {
196 // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 203 // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
197 self.isPush = NO; 204 self.isPush = NO;
198 - 205 + NSString *urlStr = REQUESTURL(@"gxb/openBanner");
  206 + NSDictionary *parameters = @{@"params":@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"pageUUID\":\"852cde69-ecd8-11e6-b52e-c7d8a7a18cc4\",\"pageType\":\"channelList\"}"};
  207 + [XWHTTPTool GET:urlStr params:parameters success:^(id json) {
  208 + NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json];
  209 + if (dic[@"homeTitleColor"]&&![dic[@"homeTitleColor"] isEqualToString:@""]) {
  210 + [[NSUserDefaults standardUserDefaults] setValue:dic[@"homeTitleColor"] forKey:HOMETITLECOLOR];
  211 + }else
  212 + {
  213 + [[NSUserDefaults standardUserDefaults] setValue:nil forKey:HOMETITLECOLOR];
  214 + }
  215 + NSString * mode = dic[@"grayMode"];
  216 + if (mode&&mode.intValue == 1 && ![[NSUserDefaults standardUserDefaults] boolForKey:ISGRAYMODE]) {
  217 + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:ISGRAYMODE];
  218 + [self addRootViewController];
  219 + }else if (mode&&mode.intValue == 0 && [[NSUserDefaults standardUserDefaults] boolForKey:ISGRAYMODE]){
  220 + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:ISGRAYMODE];
  221 + [self addRootViewController];
  222 + }
  223 +
  224 + } failure:^(NSError *error) {
  225 +
  226 + }];
199 } 227 }
200 228
201 229
202 - (void)applicationDidBecomeActive:(UIApplication *)application { 230 - (void)applicationDidBecomeActive:(UIApplication *)application {
203 // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 231 // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
204 - 232 + [[NSNotificationCenter defaultCenter] postNotificationName:BECOMEACTIVE object:nil];
205 if (self.isPush) { 233 if (self.isPush) {
206 if([self.window.rootViewController isKindOfClass:[XLSlideMenu class]]){ 234 if([self.window.rootViewController isKindOfClass:[XLSlideMenu class]]){
207 XLSlideMenu *menu = (XLSlideMenu *)self.window.rootViewController; 235 XLSlideMenu *menu = (XLSlideMenu *)self.window.rootViewController;
@@ -535,27 +563,30 @@ @@ -535,27 +563,30 @@
535 NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; 563 NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
536 NSString *nowVersion = [infoDict objectForKey:@"CFBundleShortVersionString"]; 564 NSString *nowVersion = [infoDict objectForKey:@"CFBundleShortVersionString"];
537 NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/lookup?id=%@", uAppId]]; 565 NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/lookup?id=%@", uAppId]];
538 - NSString * file = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];  
539 - NSDictionary *dic = [file objectFromJSONString];  
540 - NSDictionary *results = [[dic objectForKey:@"results"] firstObject];  
541 - NSString *newVersion =[results objectForKey:@"version"];  
542 - if([newVersion compare:nowVersion options:NSNumericSearch] == NSOrderedDescending) {  
543 - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"upDate"];  
544 - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:CustomStr(@"VersionUpdate")  
545 - message:[results objectForKey:@"releaseNotes"]  
546 - delegate:self  
547 - cancelButtonTitle:CustomStr(@"Cancel")  
548 - otherButtonTitles:CustomStr(@"Update"),nil];  
549 - [alert show];  
550 - return;  
551 - }  
552 -}  
553 -- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{  
554 - if(buttonIndex == 1){  
555 - // 此处加入应用在app store的地址,方便用户去更新,一种实现方式如下:  
556 - NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/us/app/id%@?ls=1&mt=8", uAppId]];  
557 - [[UIApplication sharedApplication] openURL:url];  
558 - } 566 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
  567 + NSString * file = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
  568 + NSDictionary *dic = [file objectFromJSONString];
  569 + if (dic.count<=0) {
  570 + return;
  571 + }
  572 + NSDictionary *results = [[dic objectForKey:@"results"] firstObject];
  573 + NSString *newVersion =[results objectForKey:@"version"];
  574 + if([newVersion compare:nowVersion options:NSNumericSearch] == NSOrderedDescending) {
  575 + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"upDate"];
  576 + dispatch_async(dispatch_get_main_queue(), ^{
  577 + UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:CustomStr(@"VersionUpdate") message:[results objectForKey:@"releaseNotes"] preferredStyle:UIAlertControllerStyleAlert];
  578 + UIAlertAction *action1 = [UIAlertAction actionWithTitle:CustomStr(@"Update") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  579 + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/us/app/id%@?ls=1&mt=8", uAppId]];
  580 + [[UIApplication sharedApplication] openURL:url];
  581 + }];
  582 + UIAlertAction *action2 = [UIAlertAction actionWithTitle:CustomStr(@"Cancel") style:UIAlertActionStyleCancel handler:nil];
  583 + [alertVC addAction:action2];
  584 + [alertVC addAction:action1];
  585 + [self.window.rootViewController presentViewController:alertVC animated:YES completion:nil];
  586 + });
  587 + }
  588 + });
  589 +
559 } 590 }
560 - (BOOL)shouldAutorotate { 591 - (BOOL)shouldAutorotate {
561 return NO; 592 return NO;
CNLiveScioLive/Assets.xcassets/Home/cnlive_CN.imageset/Contents.json
1 { 1 {
2 "images" : [ 2 "images" : [
3 { 3 {
4 - "idiom" : "universal",  
5 "filename" : "cnlive_CN.png", 4 "filename" : "cnlive_CN.png",
  5 + "idiom" : "universal",
6 "scale" : "1x" 6 "scale" : "1x"
7 }, 7 },
8 { 8 {
9 - "idiom" : "universal",  
10 "filename" : "cnlive_CN@2x.png", 9 "filename" : "cnlive_CN@2x.png",
  10 + "idiom" : "universal",
11 "scale" : "2x" 11 "scale" : "2x"
12 }, 12 },
13 { 13 {
14 "idiom" : "universal", 14 "idiom" : "universal",
15 - "filename" : "cnlive_CN@3x.png",  
16 "scale" : "3x" 15 "scale" : "3x"
17 } 16 }
18 ], 17 ],
19 "info" : { 18 "info" : {
20 - "version" : 1,  
21 - "author" : "xcode" 19 + "author" : "xcode",
  20 + "version" : 1
22 } 21 }
23 -}  
24 \ No newline at end of file 22 \ No newline at end of file
  23 +}
CNLiveScioLive/Assets.xcassets/Home/cnlive_CN.imageset/cnlive_CN@3x.png deleted 100644 → 0

2.4 KB

CNLiveScioLive/Assets.xcassets/Home/cnlive_EN.imageset/Contents.json
@@ -5,18 +5,17 @@ @@ -5,18 +5,17 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
8 - "idiom" : "universal",  
9 "filename" : "cnlive_EN@2x.png", 8 "filename" : "cnlive_EN@2x.png",
  9 + "idiom" : "universal",
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
13 "idiom" : "universal", 13 "idiom" : "universal",
14 - "filename" : "cnlive_EN@3x.png",  
15 "scale" : "3x" 14 "scale" : "3x"
16 } 15 }
17 ], 16 ],
18 "info" : { 17 "info" : {
19 - "version" : 1,  
20 - "author" : "xcode" 18 + "author" : "xcode",
  19 + "version" : 1
21 } 20 }
22 -}  
23 \ No newline at end of file 21 \ No newline at end of file
  22 +}
CNLiveScioLive/Assets.xcassets/Home/cnlive_EN.imageset/cnlive_EN@3x.png deleted 100755 → 0

1.92 KB

CNLiveScioLive/Assets.xcassets/Home/cnlive_additional_screening.imageset/Contents.json
@@ -5,18 +5,18 @@ @@ -5,18 +5,18 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
8 - "idiom" : "universal",  
9 "filename" : "cnlive_additional_screening@2x.png", 8 "filename" : "cnlive_additional_screening@2x.png",
  9 + "idiom" : "universal",
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
13 - "idiom" : "universal",  
14 "filename" : "cnlive_additional_screening@3x.png", 13 "filename" : "cnlive_additional_screening@3x.png",
  14 + "idiom" : "universal",
15 "scale" : "3x" 15 "scale" : "3x"
16 } 16 }
17 ], 17 ],
18 "info" : { 18 "info" : {
19 - "version" : 1,  
20 - "author" : "xcode" 19 + "author" : "xcode",
  20 + "version" : 1
21 } 21 }
22 -}  
23 \ No newline at end of file 22 \ No newline at end of file
  23 +}
CNLiveScioLive/Assets.xcassets/Home/cnlive_blue_search.imageset/Contents.json
@@ -5,18 +5,17 @@ @@ -5,18 +5,17 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
8 - "idiom" : "universal",  
9 "filename" : "cnlive_blue_search@2x.png", 8 "filename" : "cnlive_blue_search@2x.png",
  9 + "idiom" : "universal",
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
13 "idiom" : "universal", 13 "idiom" : "universal",
14 - "filename" : "cnlive_blue_search@3x.png",  
15 "scale" : "3x" 14 "scale" : "3x"
16 } 15 }
17 ], 16 ],
18 "info" : { 17 "info" : {
19 - "version" : 1,  
20 - "author" : "xcode" 18 + "author" : "xcode",
  19 + "version" : 1
21 } 20 }
22 -}  
23 \ No newline at end of file 21 \ No newline at end of file
  22 +}
CNLiveScioLive/Assets.xcassets/Home/cnlive_blue_search.imageset/cnlive_blue_search@3x.png deleted 100644 → 0

2.04 KB

CNLiveScioLive/Assets.xcassets/Home/cnlive_classification.imageset/Contents.json
@@ -5,18 +5,17 @@ @@ -5,18 +5,17 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
8 - "idiom" : "universal",  
9 "filename" : "cnlive_classification@2x.png", 8 "filename" : "cnlive_classification@2x.png",
  9 + "idiom" : "universal",
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
13 "idiom" : "universal", 13 "idiom" : "universal",
14 - "filename" : "cnlive_classification@3x.png",  
15 "scale" : "3x" 14 "scale" : "3x"
16 } 15 }
17 ], 16 ],
18 "info" : { 17 "info" : {
19 - "version" : 1,  
20 - "author" : "xcode" 18 + "author" : "xcode",
  19 + "version" : 1
21 } 20 }
22 -}  
23 \ No newline at end of file 21 \ No newline at end of file
  22 +}
CNLiveScioLive/Assets.xcassets/Home/cnlive_classification.imageset/cnlive_classification@3x.png deleted 100755 → 0

683 Bytes

CNLiveScioLive/Assets.xcassets/Home/cnlive_column.imageset/Contents.json
@@ -5,18 +5,18 @@ @@ -5,18 +5,18 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
8 - "idiom" : "universal",  
9 "filename" : "cnlive_column@2x.png", 8 "filename" : "cnlive_column@2x.png",
  9 + "idiom" : "universal",
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
13 - "idiom" : "universal",  
14 "filename" : "cnlive_column@3x.png", 13 "filename" : "cnlive_column@3x.png",
  14 + "idiom" : "universal",
15 "scale" : "3x" 15 "scale" : "3x"
16 } 16 }
17 ], 17 ],
18 "info" : { 18 "info" : {
19 - "version" : 1,  
20 - "author" : "xcode" 19 + "author" : "xcode",
  20 + "version" : 1
21 } 21 }
22 -}  
23 \ No newline at end of file 22 \ No newline at end of file
  23 +}
CNLiveScioLive/Assets.xcassets/Home/cnlive_column.imageset/cnlive_column@3x.png 100755 → 100644

1.45 KB | W: | H:

1.45 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
CNLiveScioLive/Assets.xcassets/Home/cnlive_icon.imageset/Contents.json
@@ -5,18 +5,17 @@ @@ -5,18 +5,17 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
8 - "idiom" : "universal",  
9 "filename" : "cnlive_icon@2x.png", 8 "filename" : "cnlive_icon@2x.png",
  9 + "idiom" : "universal",
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
13 "idiom" : "universal", 13 "idiom" : "universal",
14 - "filename" : "cnlive_icon@3x.png",  
15 "scale" : "3x" 14 "scale" : "3x"
16 } 15 }
17 ], 16 ],
18 "info" : { 17 "info" : {
19 - "version" : 1,  
20 - "author" : "xcode" 18 + "author" : "xcode",
  19 + "version" : 1
21 } 20 }
22 -}  
23 \ No newline at end of file 21 \ No newline at end of file
  22 +}
CNLiveScioLive/Assets.xcassets/Home/cnlive_icon.imageset/cnlive_icon@3x.png deleted 100755 → 0

9.18 KB

CNLiveScioLive/Assets.xcassets/Home/cnlive_pitch.imageset/Contents.json
1 { 1 {
2 "images" : [ 2 "images" : [
3 { 3 {
4 - "idiom" : "universal",  
5 "filename" : "cnlive_pitch.png", 4 "filename" : "cnlive_pitch.png",
  5 + "idiom" : "universal",
6 "scale" : "1x" 6 "scale" : "1x"
7 }, 7 },
8 { 8 {
9 - "idiom" : "universal",  
10 "filename" : "cnlive_pitch@2x.png", 9 "filename" : "cnlive_pitch@2x.png",
  10 + "idiom" : "universal",
11 "scale" : "2x" 11 "scale" : "2x"
12 }, 12 },
13 { 13 {
14 - "idiom" : "universal",  
15 "filename" : "cnlive_pitch@3x.png", 14 "filename" : "cnlive_pitch@3x.png",
  15 + "idiom" : "universal",
16 "scale" : "3x" 16 "scale" : "3x"
17 } 17 }
18 ], 18 ],
19 "info" : { 19 "info" : {
20 - "version" : 1,  
21 - "author" : "xcode" 20 + "author" : "xcode",
  21 + "version" : 1
22 } 22 }
23 -}  
24 \ No newline at end of file 23 \ No newline at end of file
  24 +}
CNLiveScioLive/Assets.xcassets/Home/cnlive_scan.imageset/Contents.json
@@ -5,18 +5,18 @@ @@ -5,18 +5,18 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
8 - "idiom" : "universal",  
9 "filename" : "cnlive_scan@2x.png", 8 "filename" : "cnlive_scan@2x.png",
  9 + "idiom" : "universal",
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
13 - "idiom" : "universal",  
14 "filename" : "cnlive_scan@3x.png", 13 "filename" : "cnlive_scan@3x.png",
  14 + "idiom" : "universal",
15 "scale" : "3x" 15 "scale" : "3x"
16 } 16 }
17 ], 17 ],
18 "info" : { 18 "info" : {
19 - "version" : 1,  
20 - "author" : "xcode" 19 + "author" : "xcode",
  20 + "version" : 1
21 } 21 }
22 -}  
23 \ No newline at end of file 22 \ No newline at end of file
  23 +}
CNLiveScioLive/Assets.xcassets/common/placeholder.imageset/91620976418_.pic_hd.jpg 0 → 100644

58.3 KB

CNLiveScioLive/Assets.xcassets/common/placeholder.imageset/Contents.json
@@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
  8 + "filename" : "91620976418_.pic_hd.jpg",
8 "idiom" : "universal", 9 "idiom" : "universal",
9 - "filename" : "placeholder@2x.png",  
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 } 15 }
16 ], 16 ],
17 "info" : { 17 "info" : {
18 - "version" : 1,  
19 - "author" : "xcode" 18 + "author" : "xcode",
  19 + "version" : 1
20 } 20 }
21 -}  
22 \ No newline at end of file 21 \ No newline at end of file
  22 +}
CNLiveScioLive/Assets.xcassets/common/placeholder.imageset/placeholder@2x.png deleted 100644 → 0

8.35 KB

CNLiveScioLive/Assets.xcassets/tabbar/my_tabbar.imageset/Contents.json
@@ -5,18 +5,17 @@ @@ -5,18 +5,17 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
8 - "idiom" : "universal",  
9 "filename" : "my_tabbar@2x.png", 8 "filename" : "my_tabbar@2x.png",
  9 + "idiom" : "universal",
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
13 "idiom" : "universal", 13 "idiom" : "universal",
14 - "filename" : "my_tabbar@3x.png",  
15 "scale" : "3x" 14 "scale" : "3x"
16 } 15 }
17 ], 16 ],
18 "info" : { 17 "info" : {
19 - "version" : 1,  
20 - "author" : "xcode" 18 + "author" : "xcode",
  19 + "version" : 1
21 } 20 }
22 -}  
23 \ No newline at end of file 21 \ No newline at end of file
  22 +}
CNLiveScioLive/Assets.xcassets/tabbar/my_tabbar.imageset/my_tabbar@3x.png deleted 100755 → 0

2.61 KB

CNLiveScioLive/Assets.xcassets/tabbar/my_tabbar_sel.imageset/Contents.json
@@ -5,18 +5,17 @@ @@ -5,18 +5,17 @@
5 "scale" : "1x" 5 "scale" : "1x"
6 }, 6 },
7 { 7 {
8 - "idiom" : "universal",  
9 "filename" : "my_tabbar_sel@2x.png", 8 "filename" : "my_tabbar_sel@2x.png",
  9 + "idiom" : "universal",
10 "scale" : "2x" 10 "scale" : "2x"
11 }, 11 },
12 { 12 {
13 "idiom" : "universal", 13 "idiom" : "universal",
14 - "filename" : "my_tabbar_sel@3x.png",  
15 "scale" : "3x" 14 "scale" : "3x"
16 } 15 }
17 ], 16 ],
18 "info" : { 17 "info" : {
19 - "version" : 1,  
20 - "author" : "xcode" 18 + "author" : "xcode",
  19 + "version" : 1
21 } 20 }
22 -}  
23 \ No newline at end of file 21 \ No newline at end of file
  22 +}
CNLiveScioLive/Assets.xcassets/tabbar/my_tabbar_sel.imageset/my_tabbar_sel@3x.png deleted 100755 → 0

2.82 KB

CNLiveScioLive/Pages/Base/CNLiveBaseViewController.m
@@ -60,7 +60,12 @@ @@ -60,7 +60,12 @@
60 [headerButton setImage:[UIImage imageNamed:@"cnlive_icon"] forState:UIControlStateSelected]; 60 [headerButton setImage:[UIImage imageNamed:@"cnlive_icon"] forState:UIControlStateSelected];
61 61
62 [headerButton setTitle:_name forState:UIControlStateNormal]; 62 [headerButton setTitle:_name forState:UIControlStateNormal];
  63 + if (HOMETITLECOLORSTR) {
  64 + [headerButton setTitleColor:[UIColor colorWithHexString:HOMETITLECOLORSTR] forState:UIControlStateNormal];
  65 + }else{
63 [headerButton setTitleColor:Color_Blue forState:UIControlStateNormal]; 66 [headerButton setTitleColor:Color_Blue forState:UIControlStateNormal];
  67 + }
  68 +
64 headerButton.titleLabel.font = [UIFont systemFontOfSize:15]; 69 headerButton.titleLabel.font = [UIFont systemFontOfSize:15];
65 70
66 headerButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//居左显示 71 headerButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//居左显示
@@ -83,7 +88,11 @@ @@ -83,7 +88,11 @@
83 88
84 self.navigationItem.rightBarButtonItem = item2; 89 self.navigationItem.rightBarButtonItem = item2;
85 } 90 }
86 - 91 +-(BOOL)forceEnableInteractivePopGestureRecognizer
  92 +{
  93 + return YES;
  94 +
  95 +}
87 - (void)didReceiveMemoryWarning { 96 - (void)didReceiveMemoryWarning {
88 [super didReceiveMemoryWarning]; 97 [super didReceiveMemoryWarning];
89 // Dispose of any resources that can be recreated. 98 // Dispose of any resources that can be recreated.
CNLiveScioLive/Pages/Header/PrefixHeader.pch
@@ -83,7 +83,6 @@ @@ -83,7 +83,6 @@
83 #import "UIImageView+CNGrayImage.h" 83 #import "UIImageView+CNGrayImage.h"
84 #import "UIColor+CNGray.h" 84 #import "UIColor+CNGray.h"
85 #import "WKWebView+CNGray.h" 85 #import "WKWebView+CNGray.h"
86 -#import "UILabel+CNGray.h"  
87 //友盟统计 86 //友盟统计
88 #import <UMCommon/MobClick.h> 87 #import <UMCommon/MobClick.h>
89 #import <UMCommon/UMConfigure.h> 88 #import <UMCommon/UMConfigure.h>
CNLiveScioLive/Pages/Header/SystemMacro.h
@@ -151,4 +151,8 @@ NO) @@ -151,4 +151,8 @@ NO)
151 #define leftImageCellWidth (MainScreenWidth*3/8) 151 #define leftImageCellWidth (MainScreenWidth*3/8)
152 #define threeImageCellWidth ((cellItemWidth - 16)/3) 152 #define threeImageCellWidth ((cellItemWidth - 16)/3)
153 153
  154 +//通知
  155 +#define RESIGNACTIVE @"resignActive"
  156 +#define BECOMEACTIVE @"becomeActive"
  157 +
154 #endif /* SystemMacro_h */ 158 #endif /* SystemMacro_h */
CNLiveScioLive/Pages/Header/UrlMacro.h
@@ -9,8 +9,8 @@ @@ -9,8 +9,8 @@
9 #ifndef UrlMacro_h 9 #ifndef UrlMacro_h
10 #define UrlMacro_h 10 #define UrlMacro_h
11 11
12 -#define REQUESTURL(url) [@"http://test.app.phonemovie.cnlive.com/" stringByAppendingPathComponent:url] //测试环境  
13 -//#define REQUESTURL(url) [@"http://app.phonemovie.cnlive.com/" stringByAppendingPathComponent:url] //正式环境 12 +//#define REQUESTURL(url) [@"http://test.app.phonemovie.cnlive.com/" stringByAppendingPathComponent:url] //测试环境
  13 +#define REQUESTURL(url) [@"http://app.phonemovie.cnlive.com/" stringByAppendingPathComponent:url] //正式环境
14 14
15 #define IS_STRING_EMPTY(string) (string==nil || string == NULL || [string isKindOfClass:[NSNull class]] || [[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0 || [string isEqualToString:@""] || [string isEqualToString:@"<null>"]) 15 #define IS_STRING_EMPTY(string) (string==nil || string == NULL || [string isKindOfClass:[NSNull class]] || [[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0 || [string isEqualToString:@""] || [string isEqualToString:@"<null>"])
16 16
@@ -48,7 +48,6 @@ @@ -48,7 +48,6 @@
48 //#define tuwen(id) [NSString stringWithFormat:@"http://www.scio.gov.cn:9095/video/JsonDataFromGXW.aspx/JsonDataFromGXW.aspx?type=Doc&DocID=%d",id] 48 //#define tuwen(id) [NSString stringWithFormat:@"http://www.scio.gov.cn:9095/video/JsonDataFromGXW.aspx/JsonDataFromGXW.aspx?type=Doc&DocID=%d",id]
49 #define tuwen(id) [NSString stringWithFormat:@"http://www.scio.gov.cn:9095/video/JsonDataFromGXW.aspx?type=Doc&DocID=%d",id] 49 #define tuwen(id) [NSString stringWithFormat:@"http://www.scio.gov.cn:9095/video/JsonDataFromGXW.aspx?type=Doc&DocID=%d",id]
50 50
51 -#define FORECAST REQUESTURL(@"gxb/api/")  
52 #define yugaoliebiao @"http://www.scio.gov.cn:9095/video/JsonDataFromGXW.aspx?type=DocList&ChannelID=20490" 51 #define yugaoliebiao @"http://www.scio.gov.cn:9095/video/JsonDataFromGXW.aspx?type=DocList&ChannelID=20490"
53 //#define newsdetail(id) [NSString stringWithFormat:@"http://www.scio.gov.cn:9095/video/JsonDataFromGXW.aspx/JsonDataFromGXW.aspx?type=Doc&DocID=%d",id] 52 //#define newsdetail(id) [NSString stringWithFormat:@"http://www.scio.gov.cn:9095/video/JsonDataFromGXW.aspx/JsonDataFromGXW.aspx?type=Doc&DocID=%d",id]
54 53
CNLiveScioLive/Pages/Home/CNHomeBaseViewController.h deleted 100755 → 0
1 -//  
2 -// CNHomeBaseViewController.h  
3 -// CNLiveScioLive  
4 -//  
5 -// Created by CNLive-zxw on 2018/9/21.  
6 -// Copyright © 2018年 CNLive. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveBaseViewController.h"  
10 -  
11 -@interface CNHomeBaseViewController : CNLiveBaseViewController  
12 -@property (nonatomic, copy) NSString *cid;  
13 -  
14 -@end  
CNLiveScioLive/Pages/Home/CNHomeBaseViewController.m deleted 100755 → 0
1 -//  
2 -// CNHomeBaseViewController.m  
3 -// CNLiveScioLive  
4 -//  
5 -// Created by CNLive-zxw on 2018/9/21.  
6 -// Copyright © 2018年 CNLive. All rights reserved.  
7 -//  
8 -  
9 -#import "CNHomeBaseViewController.h"  
10 -#import "CNHomeModel.h"  
11 -  
12 -#import "CNLiveNewsNoPicTableViewCell.h"  
13 -#import "CNLiveNewsThreePicTableViewCell.h"  
14 -#import "CNLiveNewsLeftPicTableViewCell.h"  
15 -#import "CNLiveNewsUpPicTableViewCell.h"  
16 -  
17 -  
18 -@interface CNHomeBaseViewController ()<UITableViewDelegate,UITableViewDataSource>  
19 -@property (nonatomic, strong) UITableView *tableView;  
20 -@property (nonatomic, strong) NSMutableArray *data;  
21 -@property (nonatomic, assign) NSInteger pageNo;  
22 -@property (nonatomic, assign) BOOL isRefreshing;  
23 -  
24 -@end  
25 -  
26 -@implementation CNHomeBaseViewController  
27 -static NSString *newsNoPicTableViewCell = @"CNLiveNewsNoPicTableViewCell";  
28 -static NSString *newsThreePicTableViewCell = @"CNLiveNewsThreePicTableViewCell";  
29 -static NSString *newsLeftPicTableViewCell = @"CNLiveNewsLeftPicTableViewCell";  
30 -static NSString *newsUpPicTableViewCell = @"CNLiveNewsUpPicTableViewCell";  
31 -  
32 -#pragma mark - Data  
33 -- (void)loadData{  
34 - NSString *strUrl = REQUESTURL(@"gxb/api/cataloglatest");  
35 - //NSLog(@"%@",strUrl);  
36 - NSString *categoryId = [NSString stringWithFormat:@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"categoryId\":\"%@\",\"page\":\"%ld\",\"pageSize\":\"10\"}",self.cid,(long)self.pageNo];  
37 - //NSLog(@"%@",categoryId);  
38 - NSDictionary *parameters = @{@"params":categoryId};  
39 -  
40 - if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {  
41 - [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];  
42 - [self.tableView.mj_header endRefreshing];  
43 - [self.tableView.mj_footer endRefreshing];  
44 - self->_isRefreshing = NO;  
45 - return;  
46 - }  
47 - [AlertViewTool showHUDView];  
48 - [XWHTTPTool POST:strUrl params:parameters success:^(id json) {  
49 - [AlertViewTool hideHUDView];  
50 -  
51 - // 请求成功,解析数据  
52 - NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json];  
53 -  
54 - if ([dic[@"errorCode"] isEqualToString:@"0"]) {  
55 -  
56 - if ([dic[@"programs"] isKindOfClass:[NSArray class]]) {  
57 - NSArray *lists = dic[@"programs"];  
58 - if(self->_pageNo == 1&&lists.count > 0){  
59 - [self.data removeAllObjects];  
60 - }  
61 - self->_pageNo++;  
62 - for (NSDictionary *dics in lists) {  
63 - [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
64 - return @{ @"ID" : @"id" ,@"Description" : @"description" };  
65 - }];  
66 - NSLog(@"%@",dics);  
67 - [self.data addObject:[CNHomeModel mj_objectWithKeyValues:dics]];  
68 -  
69 - }  
70 - }  
71 -  
72 - } else {  
73 - [AlertViewTool showHUDViewText:dic[@"errorMessage"]];  
74 -  
75 - }  
76 - [self.tableView.mj_header endRefreshing];  
77 -  
78 - if ([dic[@"nextCursor"] isEqualToString:@"0"]) {  
79 - [self.tableView.mj_footer endRefreshingWithNoMoreData];  
80 -  
81 - } else {  
82 - [self.tableView.mj_footer endRefreshing];  
83 -  
84 - }  
85 - [self.tableView reloadData];  
86 - self->_isRefreshing = NO;  
87 -  
88 -  
89 - } failure:^(NSError *error) {  
90 - [AlertViewTool hideHUDView];  
91 - [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")];  
92 - self->_isRefreshing = NO;  
93 -  
94 - }];  
95 -}  
96 -  
97 -- (void)loadUpData{  
98 - _pageNo = 1;  
99 - if(!_isRefreshing){  
100 - _isRefreshing = YES;  
101 - [self loadData];  
102 - }  
103 -}  
104 -- (void)loadMoreData{  
105 - if(!_isRefreshing){  
106 - _isRefreshing = YES;  
107 - [self loadData];  
108 - }  
109 -}  
110 -  
111 -- (void)viewDidLoad {  
112 - [super viewDidLoad];  
113 -  
114 - _pageNo = 1;  
115 - _isRefreshing = NO;  
116 -  
117 - [self loadData];  
118 - [self.view addSubview:self.tableView];  
119 -  
120 - // Do any additional setup after loading the view.  
121 -}  
122 -  
123 -- (void)didReceiveMemoryWarning {  
124 - [super didReceiveMemoryWarning];  
125 - // Dispose of any resources that can be recreated.  
126 -}  
127 -#pragma mark - UITableViewDelegate  
128 -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{  
129 - CNHomeModel *model = self.data[indexPath.row];  
130 - if([model.showType isEqualToString:@"0"]){  
131 - return 200*MainHScale+85;//一张图 上边  
132 -  
133 - }  
134 - else if([model.showType isEqualToString:@"1"]){  
135 - if(model.img && ![model.img isEqualToString:@""]){  
136 - return 80*MainScale+20;//一张图 左边  
137 - }  
138 -// return model.titleHeight+40;//无图  
139 - return 80*MainScale+20;//一张图 左边  
140 -  
141 - }  
142 - else if([model.showType isEqualToString:@"2"]){  
143 - return (MainScreenWidth-20-20)/3.0+85;//三张图  
144 -  
145 - }  
146 - else if([model.showType isEqualToString:@"3"]){  
147 - if(model.img && ![model.img isEqualToString:@""]){  
148 - return 80*MainScale+20;//一张图 左边  
149 - }  
150 -// return model.titleHeight+40;//无图  
151 - return 80*MainScale+20;//一张图 左边  
152 -  
153 - }else{  
154 -// return model.titleHeight+40;//无图  
155 - return 80*MainScale+20;//一张图 左边  
156 -  
157 - }  
158 -}  
159 -  
160 -#pragma mark - UITableViewDataSource  
161 -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{  
162 - return self.data.count;  
163 -  
164 -}  
165 -  
166 -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{  
167 - CNHomeModel *model = self.data[indexPath.row];  
168 - if([model.showType isEqualToString:@"0"]){  
169 - //一张图 上边  
170 - CNLiveNewsUpPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsUpPicTableViewCell];  
171 - if (!cell) {  
172 - cell = [[CNLiveNewsUpPicTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:newsUpPicTableViewCell];  
173 - }  
174 - cell.selectionStyle = UITableViewCellSelectionStyleNone;  
175 - cell.model = self.data[indexPath.row];  
176 - return cell;  
177 -  
178 - }  
179 - else if([model.showType isEqualToString:@"2"]){  
180 - //三张图  
181 - CNLiveNewsThreePicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsThreePicTableViewCell];  
182 - if (!cell) {  
183 - cell = [[CNLiveNewsThreePicTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:newsThreePicTableViewCell];  
184 - }  
185 - cell.selectionStyle = UITableViewCellSelectionStyleNone;  
186 - cell.model = self.data[indexPath.row];  
187 - return cell;  
188 -  
189 - }  
190 - else {  
191 - if(model.img){  
192 - //一张图 左边  
193 - CNLiveNewsLeftPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsLeftPicTableViewCell];  
194 - if (!cell) {  
195 - cell = [[CNLiveNewsLeftPicTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:newsLeftPicTableViewCell];  
196 - }  
197 - cell.selectionStyle = UITableViewCellSelectionStyleNone;  
198 - cell.model = self.data[indexPath.row];  
199 - return cell;  
200 - }  
201 - //无图  
202 - CNLiveNewsNoPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsNoPicTableViewCell];  
203 - if (!cell) {  
204 - cell = [[CNLiveNewsNoPicTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:newsNoPicTableViewCell];  
205 - }  
206 -// CNLiveNewsLeftPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsLeftPicTableViewCell];  
207 -// if (!cell) {  
208 -// cell = [[CNLiveNewsLeftPicTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:newsLeftPicTableViewCell];  
209 -// }  
210 - cell.selectionStyle = UITableViewCellSelectionStyleNone;  
211 - cell.model = self.data[indexPath.row];  
212 - return cell;  
213 - }  
214 -  
215 -}  
216 -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{  
217 - CNHomeModel *model = self.data[indexPath.row];  
218 - [self pushViewControllerWithModel:model];  
219 -}  
220 -/*  
221 - #pragma mark - Navigation  
222 -  
223 - // In a storyboard-based application, you will often want to do a little preparation before navigation  
224 - - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {  
225 - // Get the new view controller using [segue destinationViewController].  
226 - // Pass the selected object to the new view controller.  
227 - }  
228 - */  
229 -#pragma mark - Action  
230 -- (void)pushViewControllerWithModel:(CNHomeModel *)model {  
231 - NSDictionary *_dic = [model toDictionary];  
232 - if ([@"program" isEqualToString:_dic[@"type"]]) {  
233 - //视频  
234 - OldVideoDetailViewController *vc = [[OldVideoDetailViewController alloc] initWithDictionary:_dic];  
235 - vc.title = _dic[@"cmsColumnName"];  
236 - vc.hidesBottomBarWhenPushed = YES;  
237 - [self.navigationController pushViewController:vc animated:YES];  
238 -  
239 - } else if ([@"article" isEqualToString:_dic[@"type"]]) {  
240 - //文章  
241 - OldArticleDetailViewController *vc = [[OldArticleDetailViewController alloc] initWithDictionary:_dic];  
242 - vc.title = _dic[@"cmsColumnName"];  
243 - vc.hidesBottomBarWhenPushed = YES;  
244 - [self.navigationController pushViewController:vc animated:YES];  
245 -  
246 - } else if ([@"subject" isEqualToString:_dic[@"type"]]) {  
247 - SCIOSpecialViewController *vc = [[SCIOSpecialViewController alloc] initWithDictionary:_dic];  
248 - vc.title = @"国新专题";  
249 - vc.hidesBottomBarWhenPushed = YES;  
250 - [self.navigationController pushViewController:vc animated:YES];  
251 -  
252 - } else if ([@"LK" isEqualToString:_dic[@"type"]]) {  
253 - OldArticleDetailViewController *vc = [[OldArticleDetailViewController alloc] initWithDictionary:_dic];  
254 - vc.title = _dic[@"cmsColumnName"];  
255 - vc.hidesBottomBarWhenPushed = YES;  
256 - [self.navigationController pushViewController:vc animated:YES];  
257 -  
258 - }  
259 -}  
260 -#pragma mark - Lazy Laoding  
261 -- (UITableView *)tableView{  
262 - if(!_tableView){  
263 - _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight-45-NavBarHeight-TabBarHeight) style:UITableViewStylePlain];  
264 - _tableView.delegate = self;  
265 - _tableView.dataSource = self;  
266 - _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;  
267 - _tableView.backgroundColor = HEXCOLOR(0xebebeb);  
268 - _tableView.estimatedRowHeight = 0;  
269 - _tableView.estimatedSectionHeaderHeight = 0;  
270 - _tableView.estimatedSectionFooterHeight = 0;  
271 -  
272 - [_tableView registerClass:[CNLiveNewsLeftPicTableViewCell class] forCellReuseIdentifier:newsLeftPicTableViewCell];  
273 - [_tableView registerClass:[CNLiveNewsNoPicTableViewCell class] forCellReuseIdentifier:newsNoPicTableViewCell];  
274 - [_tableView registerClass:[CNLiveNewsUpPicTableViewCell class] forCellReuseIdentifier:newsUpPicTableViewCell];  
275 - [_tableView registerClass:[CNLiveNewsThreePicTableViewCell class] forCellReuseIdentifier:newsThreePicTableViewCell];  
276 -  
277 - // 设置上拉加载  
278 - MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadUpData)];  
279 - NSMutableArray *refreshingImages = [NSMutableArray array];  
280 - for (NSUInteger i = 0; i < 4; i++) {  
281 - UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"refresh_animation%lu", (unsigned long)i]];  
282 - [refreshingImages addObject:image];  
283 - }  
284 - [header setImages:refreshingImages forState:MJRefreshStateRefreshing];  
285 - header.lastUpdatedTimeLabel.hidden = YES;  
286 - header.stateLabel.hidden = YES;  
287 - _tableView.mj_header = header;  
288 -  
289 - // 设置下拉刷新  
290 - MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];  
291 - [footer setTitle:CustomStr(@"RefreshBackFooterIdleText") forState:MJRefreshStateIdle];  
292 - [footer setTitle:CustomStr(@"RefreshBackFooterPullingText") forState:MJRefreshStatePulling];  
293 - [footer setTitle:CustomStr(@"RefreshBackFooterRefreshingText") forState:MJRefreshStateRefreshing];  
294 - [footer setTitle:CustomStr(@"RefreshBackFooterNoMoreDataText") forState:MJRefreshStateNoMoreData];  
295 - _tableView.mj_footer = footer;  
296 -  
297 - }  
298 - return _tableView;  
299 -}  
300 -  
301 -- (NSMutableArray *)data{  
302 - if(!_data){  
303 - _data = [[NSMutableArray alloc] init];  
304 - }  
305 - return _data;  
306 -}  
307 -  
308 -  
309 -@end  
CNLiveScioLive/Pages/Home/CNHomeENViewController.m
@@ -41,6 +41,10 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -41,6 +41,10 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
41 NSLog(@"%@",parameters); 41 NSLog(@"%@",parameters);
42 42
43 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { 43 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
  44 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"ENHome"];
  45 + if (data && self.pageNo == 1) {
  46 + [self dealDictionaryData:data];
  47 + }
44 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; 48 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];
45 [self.tableView.mj_header endRefreshing]; 49 [self.tableView.mj_header endRefreshing];
46 [self.tableView.mj_footer endRefreshing]; 50 [self.tableView.mj_footer endRefreshing];
@@ -50,59 +54,22 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -50,59 +54,22 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
50 54
51 [AlertViewTool showHUDView]; 55 [AlertViewTool showHUDView];
52 [XWHTTPTool POST:strUrl params:parameters success:^(id json) { 56 [XWHTTPTool POST:strUrl params:parameters success:^(id json) {
53 - [MBProgressHUD hideHUDForView:self.view animated:YES];  
54 [AlertViewTool hideHUDView]; 57 [AlertViewTool hideHUDView];
55 58
56 // 请求成功,解析数据 59 // 请求成功,解析数据
57 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json]; 60 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json];
58 61
59 if ([dic[@"errorCode"] isEqualToString:@"0"]) { 62 if ([dic[@"errorCode"] isEqualToString:@"0"]) {
60 - if ([dic[@"programs"] isKindOfClass:[NSArray class]]) {  
61 -  
62 - NSArray *lists = dic[@"programs"];  
63 - if(self->_pageNo == 1&&lists.count > 0){  
64 - [self.data removeAllObjects];  
65 -  
66 - }  
67 - self->_pageNo++;  
68 - for (NSDictionary *dics in lists) {  
69 - [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
70 - return @{ @"ID" : @"id" ,@"Description" : @"description" };  
71 - }];  
72 - NSLog(@"%@",dics);  
73 - [self.data addObject:[CNHomeModel mj_objectWithKeyValues:dics]];  
74 -  
75 - }  
76 - 63 + NSData *data = [dic mj_JSONData];
  64 + if (self.pageNo==1) {
  65 + [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"ENHome"];
77 } 66 }
78 - NSDictionary *ttName = dic[@"ttName"];  
79 - NSArray *programs = ttName[@"programs"];  
80 -  
81 - if ([programs isKindOfClass:[NSArray class]]) {  
82 - [self.banner removeAllObjects];  
83 - for (NSDictionary *dics in programs) {  
84 - [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
85 - return @{ @"ID" : @"id" ,@"Description" : @"description" };  
86 - }];  
87 -  
88 - NSLog(@"%@",dics);  
89 - [self.banner addObject:[CNHomeModel mj_objectWithKeyValues:dics]];  
90 - }  
91 -  
92 - NSMutableArray *titles = [NSMutableArray array];  
93 - NSMutableArray *imagesURLStrings = [NSMutableArray array];  
94 - for(int i = 0; i < self.banner.count; i++){  
95 - CNHomeModel *model = self.banner[i];  
96 - [titles addObject:model.title];  
97 - [imagesURLStrings addObject:model.img];  
98 -  
99 - }  
100 - self.cycleScrollView.titlesGroup = titles;  
101 - self.cycleScrollView.imageURLStringsGroup = imagesURLStrings;  
102 -  
103 - }  
104 - 67 + [self dealDictionaryData:data];
105 } else { 68 } else {
  69 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"ENHome"];
  70 + if (data && self.pageNo == 1) {
  71 + [self dealDictionaryData:data];
  72 + }
106 [AlertViewTool showHUDViewText:dic[@"errorMessage"]]; 73 [AlertViewTool showHUDViewText:dic[@"errorMessage"]];
107 74
108 } 75 }
@@ -115,18 +82,81 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -115,18 +82,81 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
115 [self.tableView.mj_footer endRefreshing]; 82 [self.tableView.mj_footer endRefreshing];
116 83
117 } 84 }
118 - [self.tableView reloadData]; 85 +
119 self->_isRefreshing = NO; 86 self->_isRefreshing = NO;
120 87
121 88
122 } failure:^(NSError *error) { 89 } failure:^(NSError *error) {
123 [AlertViewTool hideHUDView]; 90 [AlertViewTool hideHUDView];
124 self->_isRefreshing = NO; 91 self->_isRefreshing = NO;
  92 + [self.tableView.mj_footer endRefreshing];
  93 + [self.tableView.mj_header endRefreshing];
125 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")]; 94 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")];
  95 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"ENHome"];
  96 + if (data && self.pageNo == 1) {
  97 + [self dealDictionaryData:data];
  98 + }
  99 +
126 100
127 }]; 101 }];
128 } 102 }
  103 +-(void)dealDictionaryData:(NSData *)data
  104 +{
  105 + NSDictionary *dic = [data mj_JSONObject];
  106 + if ([dic[@"programs"] isKindOfClass:[NSArray class]]) {
  107 +
  108 + NSArray *lists = dic[@"programs"];
  109 + if(self->_pageNo == 1&&lists.count > 0){
  110 + [self.data removeAllObjects];
  111 +
  112 + }
  113 + self->_pageNo++;
  114 + for (NSDictionary *dics in lists) {
  115 + [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
  116 + return @{ @"ID" : @"id" ,@"Description" : @"description" };
  117 + }];
  118 + NSLog(@"%@",dics);
  119 + [self.data addObject:[CNHomeModel mj_objectWithKeyValues:dics]];
  120 +
  121 + }
  122 +
  123 + }
  124 + NSDictionary *ttName = dic[@"ttName"];
  125 + NSArray *programs = ttName[@"programs"];
  126 +
  127 + if ([programs isKindOfClass:[NSArray class]]) {
  128 + [self.banner removeAllObjects];
  129 + for (NSDictionary *dics in programs) {
  130 + [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
  131 + return @{ @"ID" : @"id" ,@"Description" : @"description" };
  132 + }];
  133 +
  134 + NSLog(@"%@",dics);
  135 + [self.banner addObject:[CNHomeModel mj_objectWithKeyValues:dics]];
  136 + }
  137 +
  138 + NSMutableArray *titles = [NSMutableArray array];
  139 + NSMutableArray *imagesURLStrings = [NSMutableArray array];
  140 + for(int i = 0; i < self.banner.count; i++){
  141 + CNHomeModel *model = self.banner[i];
  142 + [titles addObject:model.title];
  143 + [imagesURLStrings addObject:model.img];
129 144
  145 + }
  146 + if (titles.count!=0) {
  147 + self.tableView.tableHeaderView = self.cycleScrollView;
  148 + self.cycleScrollView.titlesGroup = titles;
  149 + self.cycleScrollView.imageURLStringsGroup = imagesURLStrings;
  150 + }
  151 +
  152 + }else
  153 + {
  154 + if (self.pageNo == 2) {
  155 + self.tableView.tableHeaderView = nil;
  156 + }
  157 + }
  158 + [self.tableView reloadData];
  159 +}
130 - (void)loadUpData{ 160 - (void)loadUpData{
131 _pageNo = 1; 161 _pageNo = 1;
132 if(!_isRefreshing){ 162 if(!_isRefreshing){
@@ -151,7 +181,6 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -151,7 +181,6 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
151 _isRefreshing = NO; 181 _isRefreshing = NO;
152 182
153 [self.view addSubview:self.tableView]; 183 [self.view addSubview:self.tableView];
154 - self.tableView.tableHeaderView = self.cycleScrollView;  
155 184
156 [self loadData]; 185 [self loadData];
157 186
@@ -227,7 +256,7 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -227,7 +256,7 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
227 256
228 } 257 }
229 else{ 258 else{
230 - if(model.img){ 259 + if(model.img&&![model.img isEqualToString:@""]){
231 //一张图 左边 260 //一张图 左边
232 CNLiveNewsLeftPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsLeftPicTableViewCell]; 261 CNLiveNewsLeftPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsLeftPicTableViewCell];
233 if (!cell) { 262 if (!cell) {
CNLiveScioLive/Pages/Home/CNHomeModel.h
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 @property (nonatomic, copy) NSString *subTitle; 15 @property (nonatomic, copy) NSString *subTitle;
16 @property (nonatomic, copy) NSString *titleColor; 16 @property (nonatomic, copy) NSString *titleColor;
17 @property (nonatomic, copy) NSString *tagsColor; 17 @property (nonatomic, copy) NSString *tagsColor;
  18 +@property (nonatomic, copy) NSString *textColor;
18 19
19 20
20 @property (nonatomic, copy) NSString *ID; 21 @property (nonatomic, copy) NSString *ID;
CNLiveScioLive/Pages/Home/CNHomeViewController.m
@@ -14,8 +14,6 @@ @@ -14,8 +14,6 @@
14 #import "CNLiveHeraldedNewsViewController.h" 14 #import "CNLiveHeraldedNewsViewController.h"
15 #import "CNLiveReporterAskedViewController.h" 15 #import "CNLiveReporterAskedViewController.h"
16 16
17 -#import "CNHomeBaseViewController.h"  
18 -  
19 @interface CNHomeViewController () 17 @interface CNHomeViewController ()
20 @property (nonatomic, strong) NSMutableArray *data; 18 @property (nonatomic, strong) NSMutableArray *data;
21 @property (nonatomic, strong) UIButton *reFreshBtn; 19 @property (nonatomic, strong) UIButton *reFreshBtn;
@@ -29,97 +27,52 @@ @@ -29,97 +27,52 @@
29 27
30 NSDictionary *parameters = @{@"params":@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"pageUUID\":\"852cde69-ecd8-11e6-b52e-c7d8a7a18cc4\",\"pageType\":\"channelList\"}"}; 28 NSDictionary *parameters = @{@"params":@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"pageUUID\":\"852cde69-ecd8-11e6-b52e-c7d8a7a18cc4\",\"pageType\":\"channelList\"}"};
31 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { 29 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
32 - [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];  
33 - if (!_reFreshBtn &&self.data.count == 0) {  
34 - [self.view addSubview:self.reFreshBtn]; 30 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"homeList"];
  31 + if (data) {
  32 + [self dealDictionaryData:data];
35 } 33 }
  34 + [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];
  35 +// if (!_reFreshBtn &&self.data.count == 0) {
  36 +// [self.view addSubview:self.reFreshBtn];
  37 +// }
36 return; 38 return;
37 } 39 }
38 - [AlertViewTool showHUDView]; 40 +// [AlertViewTool showHUDView];
39 41
40 [XWHTTPTool POST:strUrl params:parameters success:^(id json) { 42 [XWHTTPTool POST:strUrl params:parameters success:^(id json) {
41 43
42 - if (self->_reFreshBtn) {  
43 - [self->_reFreshBtn removeFromSuperview];  
44 - }  
45 - [AlertViewTool hideHUDView]; 44 +// if (self->_reFreshBtn) {
  45 +// [self->_reFreshBtn removeFromSuperview];
  46 +// }
  47 +// [AlertViewTool hideHUDView];
46 48
47 // 请求成功,解析数据 49 // 请求成功,解析数据
48 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json]; 50 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json];
49 51
50 if ([dic[@"errorCode"] isEqualToString:@"0"]) { 52 if ([dic[@"errorCode"] isEqualToString:@"0"]) {
51 -  
52 - NSDictionary *ininav = dic[@"ininav"];  
53 - NSArray *ininavArray = ininav[@"programs"];  
54 -  
55 - if ([ininavArray isKindOfClass:[NSArray class]]) {  
56 - for (NSDictionary *dics in ininavArray) {  
57 - [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
58 - return @{ @"ID" : @"id" ,@"Description" : @"description" };  
59 - }];  
60 -  
61 - NSLog(@"%@",dics);  
62 - [self.data addObject:[CNHomeModel mj_objectWithKeyValues:dics]];  
63 -  
64 - }  
65 -  
66 - }  
67 -  
68 - NSMutableArray *controllers = [NSMutableArray array];  
69 - NSMutableArray *titles = [NSMutableArray array];  
70 -  
71 - for(int i = 0; i < self.data.count; i++){  
72 - CNHomeModel *model = self.data[i];  
73 - [titles addObject:model.title];  
74 - if ([model.cid isEqualToString:@"wz/toutiao/"]) {  
75 - //外宣要闻  
76 - CNLiveHeraldedNewsViewController *vc = [[CNLiveHeraldedNewsViewController alloc] init];  
77 - vc.cid = model.cid;  
78 - [controllers addObject:vc];  
79 -  
80 - }else if ([model.cid isEqualToString:@"spzl/djzw/"]) {  
81 - //答记者问  
82 - CNLiveReporterAskedViewController *vc = [[CNLiveReporterAskedViewController alloc] init];  
83 - vc.cid = model.cid;  
84 - [controllers addObject:vc];  
85 -  
86 - }else{  
87 - //基本  
88 - CNHomeBaseViewController *vc = [[CNHomeBaseViewController alloc] init];  
89 - vc.cid = model.cid;  
90 - [controllers addObject:vc];  
91 -  
92 - }  
93 -  
94 - }  
95 - if(controllers.count > 0){  
96 - self.segmentControl.titles = titles;  
97 - if (HOMETITLECOLORSTR) {  
98 - self.segmentControl.titleNormalColor = segementColor_title_color;  
99 - self.segmentControl.titleSelectColor = [UIColor colorWithHexString:HOMETITLECOLORSTR];  
100 - [self.segmentControl setBottomViewColor:[UIColor colorWithHexString:HOMETITLECOLORSTR]];  
101 - }else{  
102 - if (ininavArray[0][@"textColor"]&&![ininavArray[0][@"textColor"] isEqualToString:@""]) {  
103 -  
104 - self.segmentControl.titleSelectColor = [UIColor colorWithHexString:ininavArray[0][@"textColor"]];  
105 - [self.segmentControl setBottomViewColor:[UIColor colorWithHexString:ininavArray[0][@"textColor"]]];  
106 - }  
107 - }  
108 - self.segmentControl.viewControllers = controllers;  
109 - }  
110 - NSDictionary *dic = @{@"titles":titles};  
111 - [[NSNotificationCenter defaultCenter] postNotificationName:@"CNHomeRightViewController" object:nil userInfo:dic]; 53 + NSData *data = [dic mj_JSONData];
  54 + [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"homeList"];
  55 + [self dealDictionaryData:data];
112 56
113 } else { 57 } else {
  58 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"homeList"];
  59 + if (data) {
  60 + [self dealDictionaryData:data];
  61 + }
114 [AlertViewTool hideHUDView]; 62 [AlertViewTool hideHUDView];
115 [AlertViewTool showHUDViewText:dic[@"errorMessage"]]; 63 [AlertViewTool showHUDViewText:dic[@"errorMessage"]];
116 - if (!self->_reFreshBtn &&self.data.count == 0) {  
117 - [self.view addSubview:self.reFreshBtn];  
118 - } 64 +// if (!self->_reFreshBtn &&self.data.count == 0) {
  65 +// [self.view addSubview:self.reFreshBtn];
  66 +// }
119 } 67 }
120 68
121 69
122 } failure:^(NSError *error) { 70 } failure:^(NSError *error) {
  71 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"homeList"];
  72 + if (data) {
  73 + [self dealDictionaryData:data];
  74 + }
  75 +
123 [AlertViewTool hideHUDView]; 76 [AlertViewTool hideHUDView];
124 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")]; 77 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")];
125 if (!self->_reFreshBtn &&self.data.count == 0) { 78 if (!self->_reFreshBtn &&self.data.count == 0) {
@@ -127,6 +80,59 @@ @@ -127,6 +80,59 @@
127 } 80 }
128 }]; 81 }];
129 } 82 }
  83 +-(void)dealDictionaryData:(NSData *)data
  84 +{
  85 + NSDictionary *dic = [data mj_JSONObject];
  86 + NSDictionary *ininav = dic[@"ininav"];
  87 + NSArray *ininavArray = ininav[@"programs"];
  88 +
  89 + if ([ininavArray isKindOfClass:[NSArray class]]) {
  90 + for (NSDictionary *dics in ininavArray) {
  91 + [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
  92 + return @{ @"ID" : @"id" ,@"Description" : @"description" };
  93 + }];
  94 +
  95 + NSLog(@"%@",dics);
  96 + [self.data addObject:[CNHomeModel mj_objectWithKeyValues:dics]];
  97 +
  98 + }
  99 +
  100 + }
  101 +
  102 + NSMutableArray *controllers = [NSMutableArray array];
  103 + NSMutableArray *titles = [NSMutableArray array];
  104 + NSMutableArray *colors = [NSMutableArray array];
  105 + for(int i = 0; i < self.data.count; i++){
  106 + CNHomeModel *model = self.data[i];
  107 + [titles addObject:model.title];
  108 + if (!model.textColor) {
  109 + model.textColor = @"";
  110 + }
  111 + [colors addObject:model.textColor];
  112 + if ([model.cid isEqualToString:@"spzl/djzw/"]) {
  113 + //答记者问
  114 + CNLiveReporterAskedViewController *vc = [[CNLiveReporterAskedViewController alloc] init];
  115 + vc.cid = model.cid;
  116 + [controllers addObject:vc];
  117 +
  118 + }else{
  119 + //其他
  120 + CNLiveHeraldedNewsViewController *vc = [[CNLiveHeraldedNewsViewController alloc] init];
  121 + vc.cid = model.cid;
  122 + [controllers addObject:vc];
  123 + }
  124 +
  125 + }
  126 + if(controllers.count > 0){
  127 + NSMutableArray *textArray = [NSMutableArray array];
  128 + [textArray addObject:titles];
  129 + [textArray addObject:colors];
  130 + self.segmentControl.titles = textArray;
  131 + self.segmentControl.viewControllers = controllers;
  132 + }
  133 + NSDictionary *dic1 = @{@"titles":titles};
  134 + [[NSNotificationCenter defaultCenter] postNotificationName:@"CNHomeRightViewController" object:nil userInfo:dic1];
  135 +}
130 - (void)viewWillAppear:(BOOL)animated { 136 - (void)viewWillAppear:(BOOL)animated {
131 [super viewWillAppear:animated]; 137 [super viewWillAppear:animated];
132 [self.navigationController setNavigationBarHidden:NO]; 138 [self.navigationController setNavigationBarHidden:NO];
@@ -149,7 +155,11 @@ @@ -149,7 +155,11 @@
149 headerButton.layer.masksToBounds = true; 155 headerButton.layer.masksToBounds = true;
150 [headerButton setImage:[UIImage imageNamed:@"cnlive_icon"] forState:UIControlStateNormal]; 156 [headerButton setImage:[UIImage imageNamed:@"cnlive_icon"] forState:UIControlStateNormal];
151 [headerButton setTitle:@"国新" forState:UIControlStateNormal]; 157 [headerButton setTitle:@"国新" forState:UIControlStateNormal];
  158 + if (HOMETITLECOLORSTR) {
  159 + [headerButton setTitleColor:[UIColor colorWithHexString:HOMETITLECOLORSTR] forState:UIControlStateNormal];
  160 + }else{
152 [headerButton setTitleColor:Color_Blue forState:UIControlStateNormal]; 161 [headerButton setTitleColor:Color_Blue forState:UIControlStateNormal];
  162 + }
153 headerButton.titleLabel.font = [UIFont systemFontOfSize:15]; 163 headerButton.titleLabel.font = [UIFont systemFontOfSize:15];
154 164
155 headerButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//居左显示 165 headerButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//居左显示
CNLiveScioLive/Pages/Home/外宣要闻/Controller/CNLiveHeraldedNewsViewController.m
@@ -41,6 +41,10 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -41,6 +41,10 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
41 NSDictionary *parameters = @{@"params":categoryId}; 41 NSDictionary *parameters = @{@"params":categoryId};
42 42
43 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { 43 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
  44 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:self.cid];
  45 + if (data && self.pageNo == 1) {
  46 + [self dealDictionaryData:data];
  47 + }
44 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; 48 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];
45 [self.tableView.mj_header endRefreshing]; 49 [self.tableView.mj_header endRefreshing];
46 [self.tableView.mj_footer endRefreshing]; 50 [self.tableView.mj_footer endRefreshing];
@@ -48,62 +52,27 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -48,62 +52,27 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
48 return; 52 return;
49 } 53 }
50 54
51 - [AlertViewTool showHUDView]; 55 +// [AlertViewTool showHUDView];
52 56
53 [XWHTTPTool POST:strUrl params:parameters success:^(id json) { 57 [XWHTTPTool POST:strUrl params:parameters success:^(id json) {
54 - [AlertViewTool hideHUDView]; 58 +// [AlertViewTool hideHUDView];
55 59
56 // 请求成功,解析数据 60 // 请求成功,解析数据
57 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json]; 61 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json];
58 62
59 if ([dic[@"errorCode"] isEqualToString:@"0"]) { 63 if ([dic[@"errorCode"] isEqualToString:@"0"]) {
60 - if ([dic[@"programs"] isKindOfClass:[NSArray class]]) {  
61 - NSArray *lists = dic[@"programs"];  
62 - if(self->_pageNo == 1&&lists.count > 0){  
63 - [self.data removeAllObjects];  
64 -  
65 - }  
66 - self->_pageNo++;  
67 -  
68 - for (NSDictionary *dics in lists) {  
69 - [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
70 - return @{ @"ID" : @"id" ,@"Description" : @"description" };  
71 - }];  
72 - NSLog(@"%@",dics);  
73 - [self.data addObject:[CNHomeModel mj_objectWithKeyValues:dics]];  
74 -  
75 - }  
76 -  
77 - }  
78 - NSDictionary *ttName = dic[@"ttName"];  
79 - NSArray *programs = ttName[@"programs"];  
80 -  
81 - if ([programs isKindOfClass:[NSArray class]]) {  
82 - [self.banner removeAllObjects];  
83 - for (NSDictionary *dics in programs) {  
84 - [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
85 - return @{ @"ID" : @"id" ,@"Description" : @"description" };  
86 - }];  
87 -  
88 - NSLog(@"%@",dics);  
89 - [self.banner addObject:[CNHomeModel mj_objectWithKeyValues:dics]];  
90 - }  
91 -  
92 - NSMutableArray *titles = [NSMutableArray array];  
93 - NSMutableArray *imagesURLStrings = [NSMutableArray array];  
94 - for(int i = 0; i < self.banner.count; i++){  
95 - CNHomeModel *model = self.banner[i];  
96 - [titles addObject:model.title];  
97 - [imagesURLStrings addObject:model.img];  
98 -  
99 - }  
100 - self.cycleScrollView.titlesGroup = titles;  
101 - self.cycleScrollView.imageURLStringsGroup = imagesURLStrings; 64 + NSData *data = [dic mj_JSONData];
  65 + if (self -> _pageNo == 1) {
102 66
  67 + [[NSUserDefaults standardUserDefaults] setObject:data forKey:self.cid];
103 } 68 }
  69 + [self dealDictionaryData:data];
104 } else { 70 } else {
105 [AlertViewTool showHUDViewText:dic[@"errorMessage"]]; 71 [AlertViewTool showHUDViewText:dic[@"errorMessage"]];
106 - 72 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:self.cid];
  73 + if (data &&self.pageNo == 1) {
  74 + [self dealDictionaryData:data];
  75 + }
107 } 76 }
108 [self.tableView.mj_header endRefreshing]; 77 [self.tableView.mj_header endRefreshing];
109 78
@@ -114,18 +83,85 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -114,18 +83,85 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
114 [self.tableView.mj_footer endRefreshing]; 83 [self.tableView.mj_footer endRefreshing];
115 84
116 } 85 }
117 - [self.tableView reloadData]; 86 +
118 self->_isRefreshing = NO; 87 self->_isRefreshing = NO;
119 88
120 89
121 } failure:^(NSError *error) { 90 } failure:^(NSError *error) {
  91 + [AlertViewTool hideHUDView];
  92 + [self.tableView.mj_header endRefreshing];
  93 + [self.tableView.mj_footer endRefreshing];
122 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")]; 94 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")];
123 self->_isRefreshing = NO; 95 self->_isRefreshing = NO;
124 - [AlertViewTool hideHUDView]; 96 +
  97 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:self.cid];
  98 + if (data &&self.pageNo == 1) {
  99 + [self dealDictionaryData:data];
  100 + }
  101 +
125 102
126 }]; 103 }];
127 } 104 }
128 105
  106 +-(void)dealDictionaryData:(NSData *)data
  107 +{
  108 + NSDictionary *dic = [data mj_JSONObject];
  109 + if ([dic[@"programs"] isKindOfClass:[NSArray class]]) {
  110 + NSArray *lists = dic[@"programs"];
  111 + if(self->_pageNo == 1&&lists.count > 0){
  112 + [self.data removeAllObjects];
  113 +
  114 + }
  115 +
  116 +
  117 + self->_pageNo++;
  118 +
  119 + for (NSDictionary *dics in lists) {
  120 + [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
  121 + return @{ @"ID" : @"id" ,@"Description" : @"description" };
  122 + }];
  123 + NSLog(@"%@",dics);
  124 + [self.data addObject:[CNHomeModel mj_objectWithKeyValues:dics]];
  125 +
  126 + }
  127 +
  128 + }
  129 + NSDictionary *ttName = dic[@"ttName"];
  130 + NSArray *programs = ttName[@"programs"];
  131 +
  132 + if ([programs isKindOfClass:[NSArray class]]) {
  133 + [self.banner removeAllObjects];
  134 + for (NSDictionary *dics in programs) {
  135 + [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
  136 + return @{ @"ID" : @"id" ,@"Description" : @"description" };
  137 + }];
  138 +
  139 + NSLog(@"%@",dics);
  140 + [self.banner addObject:[CNHomeModel mj_objectWithKeyValues:dics]];
  141 + }
  142 +
  143 + NSMutableArray *titles = [NSMutableArray array];
  144 + NSMutableArray *imagesURLStrings = [NSMutableArray array];
  145 + for(int i = 0; i < self.banner.count; i++){
  146 + CNHomeModel *model = self.banner[i];
  147 + [titles addObject:model.title];
  148 + [imagesURLStrings addObject:model.img];
  149 +
  150 + }
  151 + if (titles.count!=0) {
  152 + self.tableView.tableHeaderView = self.cycleScrollView;
  153 + self.cycleScrollView.titlesGroup = titles;
  154 + self.cycleScrollView.imageURLStringsGroup = imagesURLStrings;
  155 + }
  156 + }else
  157 + {
  158 + if (self.pageNo == 2) {
  159 + self.tableView.tableHeaderView = nil;
  160 + }
  161 + }
  162 + [self.tableView reloadData];
  163 +}
  164 +
129 - (void)loadUpData{ 165 - (void)loadUpData{
130 _pageNo = 1; 166 _pageNo = 1;
131 if(!_isRefreshing){ 167 if(!_isRefreshing){
@@ -148,7 +184,6 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -148,7 +184,6 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
148 184
149 [self loadData]; 185 [self loadData];
150 [self.view addSubview:self.tableView]; 186 [self.view addSubview:self.tableView];
151 - self.tableView.tableHeaderView = self.cycleScrollView;  
152 187
153 // Do any additional setup after loading the view. 188 // Do any additional setup after loading the view.
154 } 189 }
@@ -224,7 +259,7 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -224,7 +259,7 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
224 259
225 }else{ 260 }else{
226 261
227 - if(model.img){ 262 + if(model.img&&![model.img isEqualToString:@""]){
228 CNLiveNewsLeftPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsLeftPicTableViewCell]; 263 CNLiveNewsLeftPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsLeftPicTableViewCell];
229 if (!cell) { 264 if (!cell) {
230 cell = [[CNLiveNewsLeftPicTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:newsLeftPicTableViewCell]; 265 cell = [[CNLiveNewsLeftPicTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:newsLeftPicTableViewCell];
CNLiveScioLive/Pages/Home/外宣要闻/View/CNLiveHeraldedNewsTableViewCell.m
@@ -159,8 +159,8 @@ @@ -159,8 +159,8 @@
159 }]; 159 }];
160 160
161 [_playImage mas_makeConstraints:^(MASConstraintMaker *make) { 161 [_playImage mas_makeConstraints:^(MASConstraintMaker *make) {
162 - make.centerX.offset(self->_picImage.centerX);  
163 - make.centerY.offset(self->_picImage.centerY-40); 162 + make.left.equalTo(self->_picImage).offset(5);
  163 + make.bottom.equalTo(self->_picImage).offset(-5);
164 make.width.offset(50); 164 make.width.offset(50);
165 make.height.offset(50); 165 make.height.offset(50);
166 166
CNLiveScioLive/Pages/Home/外宣要闻/View/CNLiveNewsLeftPicTableViewCell.m
@@ -80,17 +80,13 @@ @@ -80,17 +80,13 @@
80 _titleLabel.text = model.title; 80 _titleLabel.text = model.title;
81 _timeLabel.text = [model.createDate componentsSeparatedByString:@" "][0]; 81 _timeLabel.text = [model.createDate componentsSeparatedByString:@" "][0];
82 [_picImage sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"placeholder"]]; 82 [_picImage sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"placeholder"]];
83 - if (model.titleColor) { 83 + if (model.titleColor &&![model.titleColor isEqualToString:@""]) {
84 _titleLabel.textColor = [UIColor colorWithHexString:model.titleColor]; 84 _titleLabel.textColor = [UIColor colorWithHexString:model.titleColor];
85 } 85 }
86 - if (HOMETITLECOLORSTR) {  
87 - _projectLabel.backgroundColor = [UIColor colorWithHexString:HOMETITLECOLORSTR];  
88 - }else{  
89 - if (model.tagsColor) { 86 + if (model.tagsColor&&![model.tagsColor isEqualToString:@""]) {
90 87
91 _projectLabel.backgroundColor = [UIColor colorWithHexString:model.tagsColor]; 88 _projectLabel.backgroundColor = [UIColor colorWithHexString:model.tagsColor];
92 } 89 }
93 - }  
94 //专题 90 //专题
95 if(model.tags && ![model.tags isEqualToString:@""]){ 91 if(model.tags && ![model.tags isEqualToString:@""]){
96 _projectLabel.text = model.tags; 92 _projectLabel.text = model.tags;
@@ -137,8 +133,8 @@ @@ -137,8 +133,8 @@
137 133
138 }]; 134 }];
139 [_playImage mas_remakeConstraints:^(MASConstraintMaker *make) { 135 [_playImage mas_remakeConstraints:^(MASConstraintMaker *make) {
140 - make.centerX.equalTo(self->_picImage.mas_centerX);  
141 - make.centerY.equalTo(self->_picImage.mas_centerY); 136 + make.left.equalTo(self->_picImage).offset(5);
  137 + make.bottom.equalTo(self->_picImage).offset(-5);
142 make.width.height.offset(30*MainScale); 138 make.width.height.offset(30*MainScale);
143 139
144 }]; 140 }];
CNLiveScioLive/Pages/Home/外宣要闻/View/CNLiveNewsNoPicTableViewCell.m
@@ -63,17 +63,13 @@ @@ -63,17 +63,13 @@
63 - (void)setModel:(CNHomeModel *)model{ 63 - (void)setModel:(CNHomeModel *)model{
64 _model = model; 64 _model = model;
65 _titleLabel.text = model.title; 65 _titleLabel.text = model.title;
66 - if (model.titleColor) { 66 + if (model.titleColor &&![model.titleColor isEqualToString:@""]) {
67 _titleLabel.textColor = [UIColor colorWithHexString:model.titleColor]; 67 _titleLabel.textColor = [UIColor colorWithHexString:model.titleColor];
68 } 68 }
69 -  
70 - if (HOMETITLECOLORSTR) {  
71 - _projectLabel.backgroundColor = [UIColor colorWithHexString:HOMETITLECOLORSTR];  
72 - }else{  
73 - if (model.tagsColor) { 69 + if (model.tagsColor&&![model.tagsColor isEqualToString:@""]) {
  70 +
74 _projectLabel.backgroundColor = [UIColor colorWithHexString:model.tagsColor]; 71 _projectLabel.backgroundColor = [UIColor colorWithHexString:model.tagsColor];
75 } 72 }
76 - }  
77 _timeLabel.text = [model.createDate componentsSeparatedByString:@" "][0]; 73 _timeLabel.text = [model.createDate componentsSeparatedByString:@" "][0];
78 74
79 if(model.tags && ![model.tags isEqualToString:@""]){ 75 if(model.tags && ![model.tags isEqualToString:@""]){
CNLiveScioLive/Pages/Home/外宣要闻/View/CNLiveNewsThreePicTableViewCell.m
@@ -94,16 +94,13 @@ @@ -94,16 +94,13 @@
94 _projectLabel.text = model.subjecttag; 94 _projectLabel.text = model.subjecttag;
95 95
96 } 96 }
97 - if (model.titleColor) { 97 + if (model.titleColor &&![model.titleColor isEqualToString:@""]) {
98 _titleLabel.textColor = [UIColor colorWithHexString:model.titleColor]; 98 _titleLabel.textColor = [UIColor colorWithHexString:model.titleColor];
99 } 99 }
100 - if (HOMETITLECOLORSTR) {  
101 - _projectLabel.backgroundColor = [UIColor colorWithHexString:HOMETITLECOLORSTR];  
102 - }else{  
103 - if (model.tagsColor) { 100 + if (model.tagsColor&&![model.tagsColor isEqualToString:@""]) {
  101 +
104 _projectLabel.backgroundColor = [UIColor colorWithHexString:model.tagsColor]; 102 _projectLabel.backgroundColor = [UIColor colorWithHexString:model.tagsColor];
105 } 103 }
106 - }  
107 [_leftImage sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"placeholder"]]; 104 [_leftImage sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"placeholder"]];
108 [_picImage sd_setImageWithURL:[NSURL URLWithString:model.imgSmall] placeholderImage:[UIImage imageNamed:@"placeholder"]]; 105 [_picImage sd_setImageWithURL:[NSURL URLWithString:model.imgSmall] placeholderImage:[UIImage imageNamed:@"placeholder"]];
109 [_rightImage sd_setImageWithURL:[NSURL URLWithString:model.imgBig] placeholderImage:[UIImage imageNamed:@"placeholder"]]; 106 [_rightImage sd_setImageWithURL:[NSURL URLWithString:model.imgBig] placeholderImage:[UIImage imageNamed:@"placeholder"]];
CNLiveScioLive/Pages/Home/外宣要闻/View/CNLiveNewsUpPicTableViewCell.m
@@ -123,8 +123,8 @@ @@ -123,8 +123,8 @@
123 if ([_model.type isEqualToString:@"program"]) { 123 if ([_model.type isEqualToString:@"program"]) {
124 _playImage.hidden = NO; 124 _playImage.hidden = NO;
125 [_playImage mas_updateConstraints:^(MASConstraintMaker *make) { 125 [_playImage mas_updateConstraints:^(MASConstraintMaker *make) {
126 - make.left.equalTo(self->_backgroundImage.mas_left).with.offset((MainScreenWidth-20-50)/2);  
127 - make.top.equalTo(self->_picImage.mas_top).with.offset((200*MainHScale-50)/2); 126 + make.left.equalTo(self->_picImage).offset(5);
  127 + make.bottom.equalTo(self->_picImage).offset(-5);
128 make.width.offset(50); 128 make.width.offset(50);
129 make.height.offset(50); 129 make.height.offset(50);
130 130
CNLiveScioLive/Pages/Home/搜索/Controller/CNLiveSearchViewController.m
@@ -484,10 +484,12 @@ @@ -484,10 +484,12 @@
484 if ([text isEqualToString:@"<null>"]) { 484 if ([text isEqualToString:@"<null>"]) {
485 text = @""; 485 text = @"";
486 } 486 }
487 - if (_dic[@"titleColor"]) { 487 + NSString *titleColor = _dic[@"titleColor"];
  488 + if (titleColor&&![titleColor isEqualToString:@""]) {
488 cell.titleLabel.textColor = [UIColor colorWithHexString:_dic[@"titleColor"]]; 489 cell.titleLabel.textColor = [UIColor colorWithHexString:_dic[@"titleColor"]];
489 } 490 }
490 - if (_dic[@"tagsColor"]) { 491 + NSString *tagsColor = _dic[@"tagsColor"];
  492 + if (tagsColor&&![tagsColor isEqualToString:@""]) {
491 cell.tagsLabel.backgroundColor = [UIColor colorWithHexString:_dic[@"tagsColor"]]; 493 cell.tagsLabel.backgroundColor = [UIColor colorWithHexString:_dic[@"tagsColor"]];
492 } 494 }
493 cell.tagsLabel.text = text; 495 cell.tagsLabel.text = text;
CNLiveScioLive/Pages/Home/新闻详情/OldController/BaseViewController.m
@@ -16,7 +16,11 @@ @@ -16,7 +16,11 @@
16 16
17 // [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait]; 17 // [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
18 } 18 }
19 - 19 +-(BOOL)forceEnableInteractivePopGestureRecognizer
  20 +{
  21 + return YES;
  22 +
  23 +}
20 - (BOOL)shouldAutorotate { 24 - (BOOL)shouldAutorotate {
21 return NO; 25 return NO;
22 } 26 }
CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.h
@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 // Copyright © 2018年 CNLive. All rights reserved. 6 // Copyright © 2018年 CNLive. All rights reserved.
7 // 7 //
8 8
9 -#import "ZXVideoPlayerController.h"  
10 #import "CNLiveMyCollectionViewController.h" 9 #import "CNLiveMyCollectionViewController.h"
11 #import "CNLivePlayerController.h" 10 #import "CNLivePlayerController.h"
12 #import "BaseViewController.h" 11 #import "BaseViewController.h"
@@ -29,7 +28,6 @@ @@ -29,7 +28,6 @@
29 } 28 }
30 @property (strong, nonatomic) UILabel *errorLabe; 29 @property (strong, nonatomic) UILabel *errorLabe;
31 @property (strong, nonatomic) UITableView *tableView; 30 @property (strong, nonatomic) UITableView *tableView;
32 -@property (strong, nonatomic) ZXVideoPlayerController *videoController;  
33 31
34 @property (nonatomic, strong) CNLivePlayerController *liveController; 32 @property (nonatomic, strong) CNLivePlayerController *liveController;
35 33
CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.m
@@ -22,18 +22,7 @@ @@ -22,18 +22,7 @@
22 @end 22 @end
23 @implementation OldVideoDetailViewController 23 @implementation OldVideoDetailViewController
24 - (void)Pop:(id)sender{ 24 - (void)Pop:(id)sender{
25 -// [self.videoController stop];  
26 - for(UIViewController *controller in self.navigationController.viewControllers) {  
27 - if([controller isKindOfClass:[CNLiveMyCollectionViewController class]]) {  
28 - [self.navigationController popViewControllerAnimated:YES];  
29 - return;  
30 - }  
31 - if ([controller isKindOfClass:[SearchResultViewController class]]) {  
32 - [self.navigationController popViewControllerAnimated:YES];  
33 - return;  
34 - }  
35 - }  
36 - [self.navigationController popToRootViewControllerAnimated:YES]; 25 + [self.navigationController popViewControllerAnimated:YES];
37 } 26 }
38 - (id)initWithDictionary:(NSDictionary *)dictionary{ 27 - (id)initWithDictionary:(NSDictionary *)dictionary{
39 if (self = [super init]) { 28 if (self = [super init]) {
@@ -50,9 +39,9 @@ @@ -50,9 +39,9 @@
50 NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:self->_dictionary[@"imgSmall"]]]; 39 NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:self->_dictionary[@"imgSmall"]]];
51 self->bgImg = [UIImage imageWithData:data]; 40 self->bgImg = [UIImage imageWithData:data];
52 dispatch_async(dispatch_get_main_queue(), ^{ 41 dispatch_async(dispatch_get_main_queue(), ^{
53 - if (self.videoController && self->bgImg) {  
54 - self.videoController.view.contentMode=UIViewContentModeScaleToFill;  
55 - self.videoController.view.layer.contents = (__bridge id _Nullable) (self->bgImg.CGImage); 42 + if (self.liveController && self->bgImg) {
  43 + self.liveController.view.contentMode=UIViewContentModeScaleToFill;
  44 + self.liveController.view.layer.contents = (__bridge id _Nullable) (self->bgImg.CGImage);
56 45
57 } 46 }
58 }); 47 });
@@ -95,7 +84,6 @@ @@ -95,7 +84,6 @@
95 { 84 {
96 [self.liveController stop]; 85 [self.liveController stop];
97 self.liveController = nil; 86 self.liveController = nil;
98 - self.videoController = nil;  
99 NSLog(@"delloc"); 87 NSLog(@"delloc");
100 } 88 }
101 - (void)loadShareView { 89 - (void)loadShareView {
@@ -201,7 +189,6 @@ @@ -201,7 +189,6 @@
201 } 189 }
202 - (void)viewWillDisappear:(BOOL)animated { 190 - (void)viewWillDisappear:(BOOL)animated {
203 [super viewWillDisappear:animated]; 191 [super viewWillDisappear:animated];
204 - [self.videoController stop];  
205 [self.liveController stopShow]; 192 [self.liveController stopShow];
206 // self.liveController = nil; 193 // self.liveController = nil;
207 [self.navigationController setNavigationBarHidden:NO]; 194 [self.navigationController setNavigationBarHidden:NO];
@@ -269,11 +256,7 @@ @@ -269,11 +256,7 @@
269 [backgroundView addSubview:self.errorLabe]; 256 [backgroundView addSubview:self.errorLabe];
270 self.errorLabe.text = @"没有数据"; 257 self.errorLabe.text = @"没有数据";
271 self.errorLabe.hidden = YES; 258 self.errorLabe.hidden = YES;
272 - if ([_dictionary[@"playType"] isEqualToString:@"1"]) {  
273 [self addCNLivePlayer]; 259 [self addCNLivePlayer];
274 - } else {  
275 - [self addZXVideo:movieUrl];  
276 - }  
277 } 260 }
278 261
279 // CNLivePlayer 262 // CNLivePlayer
@@ -289,19 +272,28 @@ @@ -289,19 +272,28 @@
289 [backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside]; 272 [backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside];
290 [bgView addSubview:backButton]; 273 [bgView addSubview:backButton];
291 [self.view addSubview:bgView]; 274 [self.view addSubview:bgView];
292 - 275 + self.liveController = [[CNLivePlayerController alloc] initWithContentURL:[NSURL URLWithString:self -> url]];
  276 + if (!(nil==bgImg)) {
  277 + self.liveController.view.contentMode=UIViewContentModeScaleToFill;
  278 + self.liveController.view.layer.contents = (__bridge id _Nullable)(self->bgImg.CGImage);
  279 + }
  280 + [[AVAudioSession sharedInstance] setActive:YES error:nil];
  281 + [bgView removeFromSuperview];
  282 + [self.liveController configPlayerWithFrame:frame isLiving:NO];
  283 + [self.liveController showInView:self.view];
293 // 点播 284 // 点播
294 - self.liveController = [[CNLivePlayerController alloc] initVodPlayWithVId:_dictionary[@"uuid"] authSuccess:^{  
295 - NSError *error = nil;  
296 - [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: &error];  
297 - [[AVAudioSession sharedInstance] setActive:YES error:nil];  
298 -  
299 - [bgView removeFromSuperview];  
300 - [self.liveController configPlayerWithFrame:frame isLiving:NO];  
301 - [self.liveController showInView:self.view];  
302 - } authFailed:^(NSDictionary *errorInfo) {  
303 - NSLog(@"初始化点播播放器失败%@", errorInfo);  
304 - }]; 285 +// self.liveController = [[CNLivePlayerController alloc] initVodPlayWithVId:_dictionary[@"uuid"] authSuccess:^{
  286 +// [self.liveController reload:[NSURL URLWithString:self->url]];
  287 +// NSError *error = nil;
  288 +// [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: &error];
  289 +// [[AVAudioSession sharedInstance] setActive:YES error:nil];
  290 +//
  291 +// [bgView removeFromSuperview];
  292 +// [self.liveController configPlayerWithFrame:frame isLiving:NO];
  293 +// [self.liveController showInView:self.view];
  294 +// } authFailed:^(NSDictionary *errorInfo) {
  295 +// NSLog(@"初始化点播播放器失败%@", errorInfo);
  296 +// }];
305 self.liveController.delegate = self; 297 self.liveController.delegate = self;
306 298
307 [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"]; 299 [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"];
@@ -312,44 +304,6 @@ @@ -312,44 +304,6 @@
312 [strongSelf.liveController destroyPlayer]; 304 [strongSelf.liveController destroyPlayer];
313 // strongSelf.liveController = nil; 305 // strongSelf.liveController = nil;
314 [strongSelf Pop:nil]; 306 [strongSelf Pop:nil];
315 - };  
316 - }  
317 - ZXVideo *video = [[ZXVideo alloc] init];  
318 - video.title = _dictionary[@"title"];  
319 - video.playUrl = url;  
320 - self.liveController.video = video;  
321 -}  
322 -- (void)viewDidDisappear:(BOOL)animated{  
323 - [(AppDelegate *)[UIApplication sharedApplication].delegate initializeSDKConfiguration];  
324 -  
325 -}  
326 -- (void)backButtonAction:(UIButton *)sender {  
327 - [(AppDelegate *)[UIApplication sharedApplication].delegate initializeSDKConfiguration];  
328 - [self.navigationController popViewControllerAnimated:YES];  
329 -}  
330 -  
331 -- (void)addZXVideo:(NSURL *)videoUrl {  
332 - if (!self.videoController) {  
333 - CGRect frame = CGRectMake(0, iPhoneX ? 44 : 0, MainScreenWidth, videoHeight);  
334 - self.videoController = [[ZXVideoPlayerController alloc] initWithFrame:frame];  
335 - //增加播放器背景图片  
336 - if (!(nil==bgImg)) {  
337 - self.videoController.view.contentMode=UIViewContentModeScaleToFill;  
338 - self.videoController.view.layer.contents = (__bridge id _Nullable)(self->bgImg.CGImage);  
339 - }  
340 - self.liveController.delegate = self;  
341 - [self.videoController showInView:self.view];  
342 -  
343 - __weak typeof(self) weakSelf = self;  
344 - self.videoController.videoPlayerShare = ^{  
345 - __strong typeof(self) strongSelf = weakSelf;  
346 - [strongSelf shareButtonTaped:strongSelf->_shareBtn];  
347 - };  
348 - self.videoController.videoPlayerGoBackBlock = ^{  
349 - __strong typeof(self) strongSelf = weakSelf;  
350 - [[NSUserDefaults standardUserDefaults] setObject:@0 forKey:@"ZXVideoPlayer_DidLockScreen"];  
351 -// strongSelf.videoController = nil;  
352 - [strongSelf Pop:nil];  
353 //时长统计结束 307 //时长统计结束
354 if ([strongSelf->_dictionary[@"cmsColumnId"] isEqualToString:@"spzl/djzw/"]) { 308 if ([strongSelf->_dictionary[@"cmsColumnId"] isEqualToString:@"spzl/djzw/"]) {
355 //记者问答 309 //记者问答
@@ -375,9 +329,7 @@ @@ -375,9 +329,7 @@
375 } 329 }
376 330
377 }; 331 };
378 -  
379 } 332 }
380 -  
381 //时长统计开始 333 //时长统计开始
382 if ([_dictionary[@"cmsColumnId"] isEqualToString:@"spzl/djzw/"]) { 334 if ([_dictionary[@"cmsColumnId"] isEqualToString:@"spzl/djzw/"]) {
383 //记者问答 335 //记者问答
@@ -402,10 +354,19 @@ @@ -402,10 +354,19 @@
402 [CNLiveStat beginEvent:@"gxzssc"]; 354 [CNLiveStat beginEvent:@"gxzssc"];
403 } 355 }
404 ZXVideo *video = [[ZXVideo alloc] init]; 356 ZXVideo *video = [[ZXVideo alloc] init];
405 - video.playUrl = url;  
406 video.title = _dictionary[@"title"]; 357 video.title = _dictionary[@"title"];
407 - self.videoController.video = video; 358 + video.playUrl = url;
  359 + self.liveController.video = video;
  360 +}
  361 +- (void)viewDidDisappear:(BOOL)animated{
  362 + [(AppDelegate *)[UIApplication sharedApplication].delegate initializeSDKConfiguration];
  363 +
  364 +}
  365 +- (void)backButtonAction:(UIButton *)sender {
  366 + [(AppDelegate *)[UIApplication sharedApplication].delegate initializeSDKConfiguration];
  367 + [self.navigationController popViewControllerAnimated:YES];
408 } 368 }
  369 +
409 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { 370 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
410 NSURL *requestURL = webView.URL; 371 NSURL *requestURL = webView.URL;
411 if (([[requestURL scheme] isEqualToString: @"http"] || [[requestURL scheme] isEqualToString:@"https"] || [[requestURL scheme] isEqualToString: @"mailto" ]) && (navigationAction.navigationType == WKNavigationTypeLinkActivated)) { 372 if (([[requestURL scheme] isEqualToString: @"http"] || [[requestURL scheme] isEqualToString:@"https"] || [[requestURL scheme] isEqualToString: @"mailto" ]) && (navigationAction.navigationType == WKNavigationTypeLinkActivated)) {
@@ -507,7 +468,8 @@ @@ -507,7 +468,8 @@
507 [cell.backImage sd_setImageWithURL:[NSURL URLWithString:_dic[@"img"]] placeholderImage:[UIImage imageNamed:@"backDefault"]]; 468 [cell.backImage sd_setImageWithURL:[NSURL URLWithString:_dic[@"img"]] placeholderImage:[UIImage imageNamed:@"backDefault"]];
508 cell.titleLabel.text = _dic[@"title"]; 469 cell.titleLabel.text = _dic[@"title"];
509 cell.timeLabel.text = _dic[@"createDate"]; 470 cell.timeLabel.text = _dic[@"createDate"];
510 - if (_dic[@"titleColor"]) { 471 + NSString *titleColor = _dic[@"titleColor"];
  472 + if (titleColor && ![titleColor isEqualToString:@""]) {
511 cell.timeLabel.textColor = [UIColor colorWithHexString:_dic[@"titleColor"]]; 473 cell.timeLabel.textColor = [UIColor colorWithHexString:_dic[@"titleColor"]];
512 } 474 }
513 return cell; 475 return cell;
@@ -520,7 +482,7 @@ @@ -520,7 +482,7 @@
520 return cell; 482 return cell;
521 } 483 }
522 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 484 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
523 - [tableView deselectRowAtIndexPath:indexPath animated:YES]; 485 + [tableView deselectRowAtIndexPath:indexPath animated:YES];
524 NSLog(@"%@",_newsArray[indexPath.row]); 486 NSLog(@"%@",_newsArray[indexPath.row]);
525 NSDictionary *_dic = _newsArray[indexPath.row]; 487 NSDictionary *_dic = _newsArray[indexPath.row];
526 [self pushViewTo:_dic]; 488 [self pushViewTo:_dic];
@@ -531,7 +493,7 @@ @@ -531,7 +493,7 @@
531 vc.title = _dic[@"cmsColumnName"]; 493 vc.title = _dic[@"cmsColumnName"];
532 vc.hidesBottomBarWhenPushed = YES; 494 vc.hidesBottomBarWhenPushed = YES;
533 NSMutableArray *controllersAry = [NSMutableArray arrayWithArray:self.navigationController.viewControllers]; 495 NSMutableArray *controllersAry = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
534 - [controllersAry replaceObjectAtIndex:1 withObject:vc]; 496 + [controllersAry replaceObjectAtIndex:self.navigationController.viewControllers.count-1 withObject:vc];
535 [self.navigationController setViewControllers:controllersAry animated:YES]; 497 [self.navigationController setViewControllers:controllersAry animated:YES];
536 498
537 // [self.navigationController pushViewController:vc animated:YES]; 499 // [self.navigationController pushViewController:vc animated:YES];
CNLiveScioLive/Pages/Home/新闻详情/OldController/SCIOSpecialViewController.m
@@ -439,10 +439,12 @@ @@ -439,10 +439,12 @@
439 439
440 cell.titleLabel.text = _dic[@"title"]; 440 cell.titleLabel.text = _dic[@"title"];
441 cell.timeLabel.text = _dic[@"createDate"]; 441 cell.timeLabel.text = _dic[@"createDate"];
442 - if (_dic[@"titleColor"]) {  
443 - cell.tintColor = [UIColor colorWithHexString:_dic[@"titleColor"]]; 442 + NSString * titleColor = _dic[@"titleColor"];
  443 + if (titleColor&&![titleColor isEqualToString:@""]) {
  444 + cell.titleLabel.textColor = [UIColor colorWithHexString:_dic[@"titleColor"]];
444 } 445 }
445 - if (_dic[@"tagsColor"]) { 446 + NSString *tagsColor = _dic[@"tagsColor"];
  447 + if (tagsColor&&![tagsColor isEqualToString:@""]) {
446 cell.tagsLabel.backgroundColor = [UIColor colorWithHexString:_dic[@"tagsColor"]]; 448 cell.tagsLabel.backgroundColor = [UIColor colorWithHexString:_dic[@"tagsColor"]];
447 } 449 }
448 NSString *text = [NSString stringWithFormat:@"%@",_dic[@"tags"]]; 450 NSString *text = [NSString stringWithFormat:@"%@",_dic[@"tags"]];
CNLiveScioLive/Pages/Home/答记者问/Controller/CNLiveReporterAskedViewController.m
@@ -36,6 +36,10 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -36,6 +36,10 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
36 NSDictionary *parameters = @{@"params":categoryId}; 36 NSDictionary *parameters = @{@"params":categoryId};
37 37
38 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { 38 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
  39 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:self.cid];
  40 + if (data &&self.pageNo == 1) {
  41 + [self dealDictionaryData:data];
  42 + }
39 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; 43 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];
40 [self.tableView.mj_header endRefreshing]; 44 [self.tableView.mj_header endRefreshing];
41 [self.tableView.mj_footer endRefreshing]; 45 [self.tableView.mj_footer endRefreshing];
@@ -52,29 +56,15 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -52,29 +56,15 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
52 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json]; 56 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json];
53 57
54 if ([dic[@"errorCode"] isEqualToString:@"0"]) { 58 if ([dic[@"errorCode"] isEqualToString:@"0"]) {
55 - if ([dic[@"programs"] isKindOfClass:[NSArray class]]) {  
56 - NSArray *lists = dic[@"programs"];  
57 -  
58 - if(self->_pageNo == 1&&lists.count > 0){  
59 - [self.data removeAllObjects];  
60 -  
61 - }  
62 - self->_pageNo++;  
63 -  
64 - for (NSDictionary *dics in lists) {  
65 - [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
66 - return @{ @"ID" : @"id" ,@"Description" : @"description" };  
67 - }];  
68 -  
69 - NSLog(@"%@",dics);  
70 - [self.data addObject:[CNHomeModel mj_objectWithKeyValues:dics]];  
71 -  
72 - }  
73 -  
74 - } 59 + NSData *data = [dic mj_JSONData];
  60 + [[NSUserDefaults standardUserDefaults] setObject:data forKey:self.cid];
  61 + [self dealDictionaryData:data];
75 62
76 } else { 63 } else {
77 - 64 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:self.cid];
  65 + if (data &&self.pageNo == 1) {
  66 + [self dealDictionaryData:data];
  67 + }
78 [AlertViewTool showHUDViewText:dic[@"errorMessage"]]; 68 [AlertViewTool showHUDViewText:dic[@"errorMessage"]];
79 69
80 } 70 }
@@ -87,18 +77,51 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -87,18 +77,51 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
87 [self.tableView.mj_footer endRefreshing]; 77 [self.tableView.mj_footer endRefreshing];
88 78
89 } 79 }
90 - [self.tableView reloadData]; 80 +
91 self->_isRefreshing = NO; 81 self->_isRefreshing = NO;
92 82
93 83
94 } failure:^(NSError *error) { 84 } failure:^(NSError *error) {
  85 + [AlertViewTool hideHUDView];
95 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")]; 86 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")];
96 self->_isRefreshing = NO; 87 self->_isRefreshing = NO;
97 - [AlertViewTool hideHUDView]; 88 + [self.tableView.mj_header endRefreshing];
  89 + [self.tableView.mj_footer endRefreshing];
  90 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:self.cid];
  91 + if (data &&self.pageNo == 1) {
  92 + [self dealDictionaryData:data];
  93 + }
  94 +
98 95
99 }]; 96 }];
100 } 97 }
101 98
  99 +-(void)dealDictionaryData:(NSData *)data
  100 +{
  101 + NSDictionary *dic = [data mj_JSONObject];
  102 + if ([dic[@"programs"] isKindOfClass:[NSArray class]]) {
  103 + NSArray *lists = dic[@"programs"];
  104 +
  105 + if(self->_pageNo == 1&&lists.count > 0){
  106 + [self.data removeAllObjects];
  107 +
  108 + }
  109 + self->_pageNo++;
  110 +
  111 + for (NSDictionary *dics in lists) {
  112 + [CNHomeModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
  113 + return @{ @"ID" : @"id" ,@"Description" : @"description" };
  114 + }];
  115 +
  116 + NSLog(@"%@",dics);
  117 + [self.data addObject:[CNHomeModel mj_objectWithKeyValues:dics]];
  118 +
  119 + }
  120 +
  121 + }
  122 + [self.tableView reloadData];
  123 +}
  124 +
102 - (void)loadUpData{ 125 - (void)loadUpData{
103 _pageNo = 1; 126 _pageNo = 1;
104 if(!_isRefreshing){ 127 if(!_isRefreshing){
@@ -193,7 +216,7 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;; @@ -193,7 +216,7 @@ static NSString *newsUpPicTableViewCell = @&quot;CNLiveNewsUpPicTableViewCell&quot;;
193 216
194 } 217 }
195 else{ 218 else{
196 - if(model.img){ 219 + if(model.img&&![model.img isEqualToString:@""]){
197 //一张图 左边 220 //一张图 左边
198 CNLiveNewsLeftPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsLeftPicTableViewCell]; 221 CNLiveNewsLeftPicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:newsLeftPicTableViewCell];
199 if (!cell) { 222 if (!cell) {
CNLiveScioLive/Pages/Home/高级搜索/Controller/SearchResultViewController.m
@@ -318,7 +318,7 @@ @@ -318,7 +318,7 @@
318 NSArray *programs = dic[@"programs"]; 318 NSArray *programs = dic[@"programs"];
319 if (programs.count == 0) { 319 if (programs.count == 0) {
320 320
321 - [self.tableView.mj_footer noticeNoMoreData]; 321 + [self.tableView.mj_footer endRefreshingWithNoMoreData];
322 }else { 322 }else {
323 323
324 [self.dataArray addObjectsFromArray:programs]; 324 [self.dataArray addObjectsFromArray:programs];
CNLiveScioLive/Pages/Home/高级搜索/Controller/SelectedViewController.m
@@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
70 70
71 - (void)getList { 71 - (void)getList {
72 72
73 - NSString *strUrl = [NSString stringWithFormat:@"%@%@",REQUESTURL(@"gxb/api/"),self.url]; 73 + NSString *strUrl = [NSString stringWithFormat:@"%@/%@",REQUESTURL(@"gxb/api"),self.url];
74 NSMutableDictionary *param = [NSMutableDictionary dictionary]; 74 NSMutableDictionary *param = [NSMutableDictionary dictionary];
75 [param setObject:@"i" forKey:@"plat"]; 75 [param setObject:@"i" forKey:@"plat"];
76 [param setObject:@"5.0" forKey:@"version"]; 76 [param setObject:@"5.0" forKey:@"version"];
CNLiveScioLive/Pages/Live/Controller/CNLiveViewController.m
@@ -42,6 +42,11 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;; @@ -42,6 +42,11 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
42 - (void)getData{ 42 - (void)getData{
43 [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 43 [MBProgressHUD showHUDAddedTo:self.view animated:YES];
44 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { 44 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
  45 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"LiveHeader"];
  46 + if (data) {
  47 + [self dealDictionaryData:data];
  48 + }
  49 + [MBProgressHUD hideHUDForView:self.view animated:YES];
45 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; 50 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];
46 return; 51 return;
47 } 52 }
@@ -51,20 +56,31 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;; @@ -51,20 +56,31 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
51 56
52 // 请求成功,解析数据 57 // 请求成功,解析数据
53 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json]; 58 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json];
54 - [CNLiveModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
55 - return @{ @"ID" : @"id" ,@"Description" : @"description" };  
56 - }];  
57 - self.liveModel = [CNLiveModel mj_objectWithKeyValues:dic];  
58 - self.header.model = [CNLiveModel mj_objectWithKeyValues:dic];  
59 - [self.tableView reloadData]; 59 + NSData *data = [dic mj_JSONData];
  60 + [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"LiveHeader"];
  61 + [self dealDictionaryData:data];
60 // self->_isLoaded = YES; 62 // self->_isLoaded = YES;
61 63
62 } failure:^(NSError *error) { 64 } failure:^(NSError *error) {
  65 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"LiveHeader"];
  66 + if (data) {
  67 + [self dealDictionaryData:data];
  68 + }
63 [AlertViewTool showHUDAddedToView:self.view text:CustomStr(@"ServerBusy")]; 69 [AlertViewTool showHUDAddedToView:self.view text:CustomStr(@"ServerBusy")];
64 [MBProgressHUD hideHUDForView:self.view animated:YES]; 70 [MBProgressHUD hideHUDForView:self.view animated:YES];
65 71
66 }]; 72 }];
67 } 73 }
  74 +-(void)dealDictionaryData:(NSData *)data
  75 +{
  76 + NSDictionary *dic = [data mj_JSONObject];
  77 + [CNLiveModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
  78 + return @{ @"ID" : @"id" ,@"Description" : @"description" };
  79 + }];
  80 + self.liveModel = [CNLiveModel mj_objectWithKeyValues:dic];
  81 + self.header.model = [CNLiveModel mj_objectWithKeyValues:dic];
  82 + [self.tableView reloadData];
  83 +}
68 - (void)loadData{ 84 - (void)loadData{
69 NSString *strUrl = REQUESTURL(@"gxb/api/cataloglatest"); 85 NSString *strUrl = REQUESTURL(@"gxb/api/cataloglatest");
70 NSLog(@"%@",strUrl); 86 NSLog(@"%@",strUrl);
@@ -74,6 +90,10 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;; @@ -74,6 +90,10 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
74 NSLog(@"%@",parameters); 90 NSLog(@"%@",parameters);
75 91
76 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { 92 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
  93 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"liveList"];
  94 + if (data && self.pageNo == 1) {
  95 + [self dealDictionaryListData:data];
  96 + }
77 [AlertViewTool showHUDAddedToView:self.view text:CustomStr(@"NetworkiInterruption")]; 97 [AlertViewTool showHUDAddedToView:self.view text:CustomStr(@"NetworkiInterruption")];
78 [self.tableView.mj_header endRefreshing]; 98 [self.tableView.mj_header endRefreshing];
79 [self.tableView.mj_footer endRefreshing]; 99 [self.tableView.mj_footer endRefreshing];
@@ -90,38 +110,17 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;; @@ -90,38 +110,17 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
90 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json]; 110 NSDictionary *dic = [NSDictionary dictionaryWithDictionary:json];
91 111
92 if ([dic[@"errorCode"] isEqualToString:@"0"]) { 112 if ([dic[@"errorCode"] isEqualToString:@"0"]) {
93 -// if ([dic[@"programs"] isKindOfClass:[NSDictionary class]] && [dic[@"programs"] count]) {  
94 -// NSDictionary *dics = dic[@"programs"];  
95 -// [CNLiveModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
96 -// return @{ @"ID" : @"id" ,@"Description" : @"description" };  
97 -// }];  
98 -// [self.data addObject:[CNLiveModel mj_objectWithKeyValues:dics]];  
99 -// }  
100 -  
101 - if ([dic[@"programs"] isKindOfClass:[NSArray class]]) {  
102 - self->_newsArray = dic[@"programs"];  
103 - NSArray *lists = dic[@"programs"];  
104 -  
105 - if(self->_pageNo == 1&&lists.count > 0){  
106 - [self.data removeAllObjects];  
107 -  
108 - }  
109 - self->_pageNo++;  
110 -  
111 - for (NSDictionary *dics in lists) {  
112 - [CNLiveModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{  
113 - return @{ @"ID" : @"id" ,@"Description" : @"description" };  
114 - }];  
115 -  
116 - NSLog(@"%@",dics);  
117 - [self.data addObject:[CNLiveModel mj_objectWithKeyValues:dics]];  
118 -  
119 - }  
120 - 113 + NSData *data = [dic mj_JSONData];
  114 + if ( self.pageNo ==1 ) {
  115 + [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"liveList"];
121 } 116 }
122 - 117 + [self dealDictionaryListData:data];
123 118
124 } else { 119 } else {
  120 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"liveList"];
  121 + if (data && self.pageNo == 1) {
  122 + [self dealDictionaryListData:data];
  123 + }
125 [AlertViewTool showHUDAddedToView:self.view text:dic[@"errorMessage"]]; 124 [AlertViewTool showHUDAddedToView:self.view text:dic[@"errorMessage"]];
126 125
127 } 126 }
@@ -134,17 +133,48 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;; @@ -134,17 +133,48 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
134 [self.tableView.mj_footer endRefreshing]; 133 [self.tableView.mj_footer endRefreshing];
135 134
136 } 135 }
137 - [self.tableView reloadData]; 136 +
138 self->_isRefreshing = NO; 137 self->_isRefreshing = NO;
139 138
140 139
141 } failure:^(NSError *error) { 140 } failure:^(NSError *error) {
  141 + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"liveList"];
  142 + if (data && self.pageNo == 1) {
  143 + [self dealDictionaryListData:data];
  144 + }
142 self->_isRefreshing = NO; 145 self->_isRefreshing = NO;
143 [AlertViewTool hideHUDView]; 146 [AlertViewTool hideHUDView];
144 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")]; 147 [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")];
  148 + [self.tableView.mj_header endRefreshing];
  149 + [self.tableView.mj_footer endRefreshing];
145 150
146 }]; 151 }];
147 } 152 }
  153 +-(void)dealDictionaryListData:(NSData *)data{
  154 + NSDictionary *dic = [data mj_JSONObject];
  155 + if ([dic[@"programs"] isKindOfClass:[NSArray class]]) {
  156 + self->_newsArray = dic[@"programs"];
  157 + NSArray *lists = dic[@"programs"];
  158 +
  159 + if(self->_pageNo == 1&&lists.count > 0){
  160 + [self.data removeAllObjects];
  161 +
  162 + }
  163 + self->_pageNo++;
  164 +
  165 + for (NSDictionary *dics in lists) {
  166 + [CNLiveModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
  167 + return @{ @"ID" : @"id" ,@"Description" : @"description" };
  168 + }];
  169 +
  170 + NSLog(@"%@",dics);
  171 + [self.data addObject:[CNLiveModel mj_objectWithKeyValues:dics]];
  172 +
  173 + }
  174 +
  175 + }
  176 + [self.tableView reloadData];
  177 +}
148 - (void)loadYGData { 178 - (void)loadYGData {
149 NSString *strUrl = REQUESTURL(@"gxb/api/cataloglatest"); 179 NSString *strUrl = REQUESTURL(@"gxb/api/cataloglatest");
150 //NSLog(@"%@",strUrl); 180 //NSLog(@"%@",strUrl);
@@ -242,7 +272,11 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;; @@ -242,7 +272,11 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
242 headerButton.layer.masksToBounds = true; 272 headerButton.layer.masksToBounds = true;
243 [headerButton setImage:[UIImage imageNamed:@"cnlive_icon"] forState:UIControlStateNormal]; 273 [headerButton setImage:[UIImage imageNamed:@"cnlive_icon"] forState:UIControlStateNormal];
244 [headerButton setTitle:@"直播" forState:UIControlStateNormal]; 274 [headerButton setTitle:@"直播" forState:UIControlStateNormal];
  275 + if (HOMETITLECOLORSTR) {
  276 + [headerButton setTitleColor:[UIColor colorWithHexString:HOMETITLECOLORSTR] forState:UIControlStateNormal];
  277 + }else{
245 [headerButton setTitleColor:Color_Blue forState:UIControlStateNormal]; 278 [headerButton setTitleColor:Color_Blue forState:UIControlStateNormal];
  279 + }
246 headerButton.titleLabel.font = [UIFont systemFontOfSize:15]; 280 headerButton.titleLabel.font = [UIFont systemFontOfSize:15];
247 281
248 headerButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//居左显示 282 headerButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//居左显示
@@ -471,7 +505,7 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;; @@ -471,7 +505,7 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
471 } 505 }
472 - (CNLiveHeaderView *)header{ 506 - (CNLiveHeaderView *)header{
473 if(!_header){ 507 if(!_header){
474 - _header = [[CNLiveHeaderView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, 180)]; 508 + _header = [[CNLiveHeaderView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenWidth*9 /16)];
475 _header.backgroundColor = Color_Blue; 509 _header.backgroundColor = Color_Blue;
476 } 510 }
477 return _header; 511 return _header;
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
@@ -55,14 +55,42 @@ @@ -55,14 +55,42 @@
55 55
56 - (void)loadData { 56 - (void)loadData {
57 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { 57 if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
  58 + [self setUpUIWithTag:1000 Height:0];
  59 + return;
  60 + }
  61 +
  62 + AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
  63 + manager.responseSerializer = [AFHTTPResponseSerializer serializer];
  64 + [manager POST:@"http://s.scio.gov.cn/ocms/.content/function_provider/arswitch1.json" parameters:nil headers:nil progress:NULL success:^(NSURLSessionDataTask *task, id responseObject) {
  65 + NSLog(@"%@",responseObject);
  66 + NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
  67 + NSString *errorCode = dic[@"errorCode"];
  68 +
  69 + if ([errorCode isEqualToString:@"1"]) {
  70 + [self requestJsonData:dic[@"docId"]];
  71 + }
  72 +
  73 +
  74 + } failure:^(NSURLSessionDataTask *task, NSError *error) {
  75 + NSLog(@"%@",error);
  76 + [self setUpUIWithTag:1000 Height:0];
  77 +
  78 + }];
  79 +
  80 +
  81 +}
  82 +-(void)requestJsonData:(NSString *)docId
  83 +{
  84 + if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
58 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; 85 [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")];
59 return; 86 return;
60 } 87 }
61 [AlertViewTool showHUDView]; 88 [AlertViewTool showHUDView];
62 AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; 89 AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
63 manager.responseSerializer = [AFHTTPResponseSerializer serializer]; 90 manager.responseSerializer = [AFHTTPResponseSerializer serializer];
64 - [manager POST:tuwenzhibo parameters:nil headers:nil progress:^(NSProgress * _Nonnull uploadProgress) {} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { 91 + [manager POST:tuwen(docId.intValue) parameters:nil headers:nil progress:^(NSProgress * _Nonnull uploadProgress) {} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
65 [AlertViewTool hideHUDView]; 92 [AlertViewTool hideHUDView];
  93 + [self setUpUIWithTag:1000 Height:40.0];
66 // 请求成功,解析数据 94 // 请求成功,解析数据
67 NSString * jsonString = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]; 95 NSString * jsonString = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
68 NSArray *arr = [jsonString objectFromJSONString]; 96 NSArray *arr = [jsonString objectFromJSONString];
@@ -72,7 +100,7 @@ @@ -72,7 +100,7 @@
72 } else { 100 } else {
73 [self->_webView loadHTMLString:@"<html><body> </body></html>" baseURL:nil]; 101 [self->_webView loadHTMLString:@"<html><body> </body></html>" baseURL:nil];
74 } 102 }
75 - 103 +
76 104
77 } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { 105 } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
78 // 请求失败 106 // 请求失败
@@ -82,7 +110,6 @@ @@ -82,7 +110,6 @@
82 110
83 }]; 111 }];
84 } 112 }
85 -  
86 - (void)viewWillAppear:(BOOL)animated { 113 - (void)viewWillAppear:(BOOL)animated {
87 [super viewWillAppear:animated]; 114 [super viewWillAppear:animated];
88 [[JGMusicManager shareMusicManager] playStop]; 115 [[JGMusicManager shareMusicManager] playStop];
@@ -96,7 +123,6 @@ @@ -96,7 +123,6 @@
96 - (void)viewWillDisappear:(BOOL)animated { 123 - (void)viewWillDisappear:(BOOL)animated {
97 [super viewWillDisappear:animated]; 124 [super viewWillDisappear:animated];
98 [self.liveController stopShow]; 125 [self.liveController stopShow];
99 -// self.liveController = nil;  
100 [self.navigationController setNavigationBarHidden:NO]; 126 [self.navigationController setNavigationBarHidden:NO];
101 } 127 }
102 128
@@ -117,15 +143,6 @@ @@ -117,15 +143,6 @@
117 backgroundView.bounces = NO; 143 backgroundView.bounces = NO;
118 [self.view addSubview:backgroundView]; 144 [self.view addSubview:backgroundView];
119 145
120 - relatedWebView = [[WKWebView alloc] initWithFrame:CGRectZero];  
121 - relatedWebView.scrollView.backgroundColor = [UIColor whiteColor];  
122 -// relatedWebView.dataDetectorTypes = UIDataDetectorTypeNone;  
123 - relatedWebView.backgroundColor = [UIColor whiteColor];  
124 - relatedWebView.scrollView.bounces = NO;  
125 - relatedWebView.navigationDelegate = self;  
126 - relatedWebView.opaque = NO;  
127 - relatedWebView.tag = 1000;  
128 - [backgroundView addSubview:relatedWebView];  
129 146
130 // NSString* htmlHeader = [[NSString alloc] initWithFormat:@"<html><font style=\"font-size:20px;\"><strong>%@</strong></font><br><p>%@</p><p>来源 : 国新网</p><body>",[_dictionary objectForKey:@"title"],[_dictionary objectForKey:@"liveStartDateTime"]]; 147 // NSString* htmlHeader = [[NSString alloc] initWithFormat:@"<html><font style=\"font-size:20px;\"><strong>%@</strong></font><br><p>%@</p><p>来源 : 国新网</p><body>",[_dictionary objectForKey:@"title"],[_dictionary objectForKey:@"liveStartDateTime"]];
131 // NSString* htmlFooter = [[NSString alloc] initWithFormat:@"<div class=\"logo\" style=\"text-indent:2em\">%@</div></body></html>",[_dictionary objectForKey:@"Description"]]; 148 // NSString* htmlFooter = [[NSString alloc] initWithFormat:@"<div class=\"logo\" style=\"text-indent:2em\">%@</div></body></html>",[_dictionary objectForKey:@"Description"]];
@@ -156,16 +173,6 @@ @@ -156,16 +173,6 @@
156 NSString* strHtml = [[NSString alloc] initWithFormat:@"%@%@",htmlHeader,htmlFooter]; 173 NSString* strHtml = [[NSString alloc] initWithFormat:@"%@%@",htmlHeader,htmlFooter];
157 [relatedWebView loadHTMLString:strHtml baseURL:nil]; 174 [relatedWebView loadHTMLString:strHtml baseURL:nil];
158 175
159 - _webView = [[WKWebView alloc] initWithFrame:CGRectZero];  
160 - _webView.scrollView.backgroundColor = [UIColor whiteColor];  
161 -// _webView.dataDetectorTypes = UIDataDetectorTypeNone;  
162 - _webView.backgroundColor = [UIColor whiteColor];  
163 - _webView.navigationDelegate = self;  
164 - _webView.opaque = NO;  
165 - _webView.tag = 2000;  
166 - _webView.hidden = YES;  
167 - [backgroundView addSubview:_webView];  
168 -  
169 if (!isPlay) { 176 if (!isPlay) {
170 [self loadMovieView]; 177 [self loadMovieView];
171 } else { 178 } else {
@@ -329,44 +336,51 @@ @@ -329,44 +336,51 @@
329 [relatedWebView setFrame:CGRectMake(0, 0, MainScreenWidth, descriptionHeight)]; 336 [relatedWebView setFrame:CGRectMake(0, 0, MainScreenWidth, descriptionHeight)];
330 }]; 337 }];
331 } 338 }
332 -  
333 - if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {  
334 - [self setUpUIWithTag:webView.tag Height:0];  
335 - return;  
336 - }  
337 -  
338 - AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];  
339 - manager.responseSerializer = [AFHTTPResponseSerializer serializer];  
340 - [manager POST:@"http://s.scio.gov.cn/ocms/.content/function_provider/arswitch.json" parameters:nil headers:nil progress:NULL success:^(NSURLSessionDataTask *task, id responseObject) {  
341 - NSLog(@"%@",responseObject);  
342 - NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];  
343 - NSString *errorCode = dic[@"errorCode"];  
344 - [self setUpUIWithTag:webView.tag Height:[errorCode isEqualToString:@"1"]?40.0:0.0];  
345 -  
346 - } failure:^(NSURLSessionDataTask *task, NSError *error) {  
347 - NSLog(@"%@",error);  
348 - [self setUpUIWithTag:webView.tag Height:0]; 339 + if (webView.tag==2000) {
  340 + CGFloat width = MainScreenWidth - 20;
  341 + NSString *string = [NSString stringWithFormat:
  342 + @"var script = document.createElement('script');"
  343 + "script.type = 'text/javascript';"
  344 + "script.text = \"function ResizeImages() { "
  345 + "var myimg,oldwidth;"
  346 + "var maxwidth=%f;" //缩放系数
  347 + "for(i=0;i <document.images.length;i++){"
  348 + "myimg = document.images[i];"
  349 + "if(myimg.width > maxwidth){"
  350 + "oldwidth = myimg.width;"
  351 + "myimg.width = maxwidth;"
  352 + "myimg.height = myimg.height * (maxwidth/oldwidth);"
  353 + "}"
  354 + "}"
  355 + "}\";"
  356 + "document.getElementsByTagName('head')[0].appendChild(script);",width];
349 357
350 - }];  
351 - 358 + [webView evaluateJavaScript:string completionHandler:nil];
  359 + [webView evaluateJavaScript:@"ResizeImages();" completionHandler:nil];
  360 +
  361 + CGRect frame = webView.frame;
  362 + frame.size.width = MainScreenWidth;
  363 + frame.size.height = 1;
  364 + webView.frame = frame;
  365 + [webView evaluateJavaScript:@"document.body.scrollHeight"completionHandler:^(id _Nullable result,NSError * _Nullable error){
  366 + self->graphicLiveHeight = [result floatValue];
  367 + if (0 == [self->heightArr[self->fontIndex] floatValue]) {
  368 + [self->heightArr replaceObjectAtIndex:self->fontIndex withObject:[NSString stringWithFormat:@"%f",self->graphicLiveHeight]];
  369 + }
  370 +
  371 + if (self->isShow) {
  372 + NSLog(@"fontIndex = %d",self->fontIndex);
  373 + [self->backgroundView setContentSize:CGSizeMake(MainScreenWidth, 40 + self->descriptionHeight + [self->heightArr[self->fontIndex] floatValue] + 221)];
  374 + [webView setFrame:CGRectMake(0, 40 + self->descriptionHeight, MainScreenWidth, [self->heightArr[self->fontIndex] floatValue])];
  375 + [self showRelatedInformation:40 + self->descriptionHeight + [self->heightArr[self->fontIndex] floatValue]];
  376 + }
  377 + }];
  378 + }
  379 +
352 } 380 }
353 - (void)setUpUIWithTag:(NSInteger)tag Height:(NSInteger)height{ 381 - (void)setUpUIWithTag:(NSInteger)tag Height:(NSInteger)height{
354 382
355 if (1000 == tag) { 383 if (1000 == tag) {
356 - CGRect frame = relatedWebView.frame;  
357 - frame.size.width = MainScreenWidth;  
358 - frame.size.height = 1;  
359 - relatedWebView.frame = frame;  
360 -// descriptionHeight = relatedWebView.scrollView.contentSize.height;  
361 - [relatedWebView evaluateJavaScript:@"document.body.scrollHeight"completionHandler:^(id _Nullable result,NSError * _Nullable error){  
362 - NSLog(@"scrollHeight高度:%.2f",[result floatValue]);  
363 - descriptionHeight = [result floatValue];  
364 - dispatch_async(dispatch_get_main_queue(), ^{  
365 - [relatedWebView setFrame:CGRectMake(0, 0, MainScreenWidth, descriptionHeight)];  
366 -  
367 - });  
368 - }];  
369 -// [relatedWebView setFrame:CGRectMake(0, 0, MainScreenWidth, descriptionHeight)];  
370 lineImage1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, descriptionHeight, MainScreenWidth, 1)]; 384 lineImage1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, descriptionHeight, MainScreenWidth, 1)];
371 lineImage1.backgroundColor = Color_Line; 385 lineImage1.backgroundColor = Color_Line;
372 [backgroundView addSubview:lineImage1]; 386 [backgroundView addSubview:lineImage1];
@@ -418,58 +432,6 @@ @@ -418,58 +432,6 @@
418 432
419 [self showRelatedInformation:height + descriptionHeight]; 433 [self showRelatedInformation:height + descriptionHeight];
420 434
421 - } else if (2000 == tag) {  
422 - CGFloat width = MainScreenWidth - 20;  
423 - NSString *string = [NSString stringWithFormat:  
424 - @"var script = document.createElement('script');"  
425 - "script.type = 'text/javascript';"  
426 - "script.text = \"function ResizeImages() { "  
427 - "var myimg,oldwidth;"  
428 - "var maxwidth=%f;" //缩放系数  
429 - "for(i=0;i <document.images.length;i++){"  
430 - "myimg = document.images[i];"  
431 - "if(myimg.width > maxwidth){"  
432 - "oldwidth = myimg.width;"  
433 - "myimg.width = maxwidth;"  
434 - "myimg.height = myimg.height * (maxwidth/oldwidth);"  
435 - "}"  
436 - "}"  
437 - "}\";"  
438 - "document.getElementsByTagName('head')[0].appendChild(script);",width];  
439 -  
440 - [_webView evaluateJavaScript:string completionHandler:nil];  
441 - [_webView evaluateJavaScript:@"ResizeImages();" completionHandler:nil];  
442 -  
443 - CGRect frame = _webView.frame;  
444 - frame.size.width = MainScreenWidth;  
445 - frame.size.height = 1;  
446 - _webView.frame = frame;  
447 - [_webView evaluateJavaScript:@"document.body.scrollHeight"completionHandler:^(id _Nullable result,NSError * _Nullable error){  
448 - graphicLiveHeight = [result floatValue];  
449 - if (0 == [heightArr[fontIndex] floatValue]) {  
450 - [heightArr replaceObjectAtIndex:fontIndex withObject:[NSString stringWithFormat:@"%f",graphicLiveHeight]];  
451 - }  
452 -  
453 - if (isShow) {  
454 - NSLog(@"fontIndex = %d",fontIndex);  
455 - [backgroundView setContentSize:CGSizeMake(MainScreenWidth, 40 + descriptionHeight + [heightArr[fontIndex] floatValue] + 221)];  
456 - [_webView setFrame:CGRectMake(0, 40 + descriptionHeight, MainScreenWidth, [heightArr[fontIndex] floatValue])];  
457 - [self showRelatedInformation:40 + descriptionHeight + [heightArr[fontIndex] floatValue]];  
458 - }  
459 - }];  
460 -  
461 - NSLog(@"%@",NSStringFromCGRect(_webView.frame));  
462 - NSLog(@"%@",NSStringFromCGSize(_webView.scrollView.contentSize));  
463 -// if (0 == [heightArr[fontIndex] floatValue]) {  
464 -// [heightArr replaceObjectAtIndex:fontIndex withObject:[NSString stringWithFormat:@"%f",graphicLiveHeight]];  
465 -// }  
466 -//  
467 -// if (isShow) {  
468 -// NSLog(@"fontIndex = %d",fontIndex);  
469 -// [backgroundView setContentSize:CGSizeMake(MainScreenWidth, 40 + descriptionHeight + [heightArr[fontIndex] floatValue] + 221)];  
470 -// [_webView setFrame:CGRectMake(0, 40 + descriptionHeight, MainScreenWidth, [heightArr[fontIndex] floatValue])];  
471 -// [self showRelatedInformation:40 + descriptionHeight + [heightArr[fontIndex] floatValue]];  
472 -// }  
473 } 435 }
474 } 436 }
475 437
CNLiveScioLive/Pages/Live/Controller/TopNoticeViewController.m
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 NSLog(@"%@",josnParameters); 35 NSLog(@"%@",josnParameters);
36 NSDictionary *parameters = @{@"params":josnParameters 36 NSDictionary *parameters = @{@"params":josnParameters
37 }; 37 };
38 - NSString *urlStr = [NSString stringWithFormat:@"%@%@",FORECAST,@"programByContentId"]; 38 + NSString *urlStr = REQUESTURL(@"gxb/api/programByContentId");
39 [manager POST:urlStr parameters:parameters headers:nil progress:^(NSProgress * _Nonnull uploadProgress) {} success:^(NSURLSessionDataTask * _Nonnull task, id responseObject) { 39 [manager POST:urlStr parameters:parameters headers:nil progress:^(NSProgress * _Nonnull uploadProgress) {} success:^(NSURLSessionDataTask * _Nonnull task, id responseObject) {
40 [AlertViewTool hideHUDView]; 40 [AlertViewTool hideHUDView];
41 // 请求成功,解析数据 41 // 请求成功,解析数据
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 NSLog(@"%@",josnParameters); 67 NSLog(@"%@",josnParameters);
68 NSDictionary *parameters = @{@"params":josnParameters 68 NSDictionary *parameters = @{@"params":josnParameters
69 }; 69 };
70 - NSString *urlStr = [NSString stringWithFormat:@"%@%@",FORECAST,@"programDetail"]; 70 + NSString *urlStr = REQUESTURL(@"gxb/api/programDetail");
71 [manager POST:urlStr parameters:parameters headers:nil progress:^(NSProgress * _Nonnull uploadProgress) {} success:^(NSURLSessionDataTask * _Nonnull task, id responseObject) { 71 [manager POST:urlStr parameters:parameters headers:nil progress:^(NSProgress * _Nonnull uploadProgress) {} success:^(NSURLSessionDataTask * _Nonnull task, id responseObject) {
72 [AlertViewTool hideHUDView]; 72 [AlertViewTool hideHUDView];
73 // 请求成功,解析数据 73 // 请求成功,解析数据
CNLiveScioLive/Pages/Live/Controller/VideoPlayBackViewController.m
@@ -562,7 +562,7 @@ @@ -562,7 +562,7 @@
562 _newsArray = [NSArray arrayWithArray:array]; 562 _newsArray = [NSArray arrayWithArray:array];
563 [self.tableView setFrame:CGRectMake( 0, 40 + relatedWebView.scrollView.contentSize.height, MainScreenWidth, 36 + 86*_newsArray.count)]; 563 [self.tableView setFrame:CGRectMake( 0, 40 + relatedWebView.scrollView.contentSize.height, MainScreenWidth, 36 + 86*_newsArray.count)];
564 } 564 }
565 - [backgroundView setContentSize:CGSizeMake(MainScreenWidth, [heightArr[fontIndex] floatValue] + self.tableView.frame.size.height)]; 565 + [backgroundView setContentSize:CGSizeMake(MainScreenWidth,40 + descriptionHeight + [heightArr[fontIndex] floatValue] + self.tableView.frame.size.height)];
566 [self.tableView reloadData]; 566 [self.tableView reloadData];
567 } else { 567 } else {
568 [AlertViewTool showHUDViewText:_dic[@"errorMessage"]]; 568 [AlertViewTool showHUDViewText:_dic[@"errorMessage"]];
@@ -677,10 +677,7 @@ @@ -677,10 +677,7 @@
677 [super didReceiveMemoryWarning]; 677 [super didReceiveMemoryWarning];
678 } 678 }
679 - (BOOL)shouldAutorotate { 679 - (BOOL)shouldAutorotate {
680 -// if (![[[NSUserDefaults standardUserDefaults] objectForKey:@"ZXVideoPlayer_DidPlayBack"] boolValue]) {  
681 -// return [[[NSUserDefaults standardUserDefaults] objectForKey:@"ZXVideoPlayer_DidPlayBack"] boolValue];  
682 -// }  
683 - return ![[[NSUserDefaults standardUserDefaults] objectForKey:@"ZXVideoPlayer_DidLockScreen"] boolValue]; 680 + return isPlay;
684 } 681 }
685 - (UIInterfaceOrientationMask)supportedInterfaceOrientations { 682 - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
686 return UIInterfaceOrientationMaskAllButUpsideDown; 683 return UIInterfaceOrientationMaskAllButUpsideDown;
CNLiveScioLive/Pages/Live/View/CNLiveHeaderView.m
@@ -29,7 +29,6 @@ @@ -29,7 +29,6 @@
29 _backgroundImage.contentMode = UIViewContentModeScaleAspectFill; 29 _backgroundImage.contentMode = UIViewContentModeScaleAspectFill;
30 _backgroundImage.layer.masksToBounds = YES; 30 _backgroundImage.layer.masksToBounds = YES;
31 _backgroundImage.layer.cornerRadius = 2.0; 31 _backgroundImage.layer.cornerRadius = 2.0;
32 - _backgroundImage.image = [UIImage imageNamed:@"cnlive_placeholder"];  
33 [self addSubview:_backgroundImage]; 32 [self addSubview:_backgroundImage];
34 33
35 _playImage = [UIButton buttonWithType:UIButtonTypeCustom]; 34 _playImage = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -44,8 +43,6 @@ @@ -44,8 +43,6 @@
44 _stateLabel.textColor = [UIColor whiteColor]; 43 _stateLabel.textColor = [UIColor whiteColor];
45 if ([[NSUserDefaults standardUserDefaults] boolForKey:ISGRAYMODE]) { 44 if ([[NSUserDefaults standardUserDefaults] boolForKey:ISGRAYMODE]) {
46 _stateLabel.backgroundColor = [UIColor grayColor]; 45 _stateLabel.backgroundColor = [UIColor grayColor];
47 - }else if (HOMETITLECOLORSTR){  
48 - _stateLabel.backgroundColor = [UIColor colorWithHexString:HOMETITLECOLORSTR];  
49 }else{ 46 }else{
50 _stateLabel.backgroundColor = [UIColor redColor]; 47 _stateLabel.backgroundColor = [UIColor redColor];
51 } 48 }
@@ -63,7 +60,7 @@ @@ -63,7 +60,7 @@
63 } 60 }
64 - (void)setModel:(CNLiveModel *)model{ 61 - (void)setModel:(CNLiveModel *)model{
65 _model = model; 62 _model = model;
66 - [_backgroundImage sd_setImageWithURL:[NSURL URLWithString:model.poster] placeholderImage:[UIImage imageNamed:@"cnlive_placeholder"]]; 63 + [_backgroundImage sd_setImageWithURL:[NSURL URLWithString:model.poster] placeholderImage:[UIImage imageNamed:@"placeholder"]];
67 switch ([model.status intValue]) { 64 switch ([model.status intValue]) {
68 case 0: { 65 case 0: {
69 _stateLabel.text = @"直播准备"; 66 _stateLabel.text = @"直播准备";
@@ -137,8 +134,8 @@ @@ -137,8 +134,8 @@
137 }]; 134 }];
138 135
139 [_playImage mas_makeConstraints:^(MASConstraintMaker *make) { 136 [_playImage mas_makeConstraints:^(MASConstraintMaker *make) {
140 - make.centerX.offset(self->_backgroundImage.centerX);  
141 - make.centerY.offset(self->_backgroundImage.centerY); 137 + make.left.equalTo(self->_backgroundImage).offset(5);
  138 + make.bottom.equalTo(self->_backgroundImage).offset(-5);
142 make.width.offset(40); 139 make.width.offset(40);
143 make.height.offset(40); 140 make.height.offset(40);
144 141
CNLiveScioLive/Pages/Live/View/CNLiveTableViewCell.m
@@ -88,8 +88,8 @@ @@ -88,8 +88,8 @@
88 }]; 88 }];
89 89
90 [_playImage mas_makeConstraints:^(MASConstraintMaker *make) { 90 [_playImage mas_makeConstraints:^(MASConstraintMaker *make) {
91 - make.left.equalTo(self->_picImage.mas_left).with.offset((80*MainScale*16/9.0-30)/2.0);  
92 - make.centerY.offset(self->_picImage.centerY); 91 + make.left.equalTo(self->_picImage).offset(5);
  92 + make.bottom.equalTo(self->_picImage).offset(-5);
93 make.width.offset(30); 93 make.width.offset(30);
94 make.height.offset(30); 94 make.height.offset(30);
95 95
CNLiveScioLive/Pages/Newsound/OldController/VoiceViewController.m
@@ -173,11 +173,9 @@ static const NSInteger margin = 34; @@ -173,11 +173,9 @@ static const NSInteger margin = 34;
173 173
174 } 174 }
175 failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { 175 failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
176 - // 请求失败  
177 - [self.tableView.mj_header endRefreshing];  
178 - NSLog(@"%@", [error localizedDescription]);  
179 - [AlertViewTool hideHUDView];  
180 - [AlertViewTool showHUDViewText:CustomStr(@"ServerBusy")]; 176 + [self.tableView.mj_header endRefreshing];
  177 + [AlertViewTool hideHUDView];
  178 + [self.tableView.mj_footer setState:MJRefreshStateIdle];
181 179
182 }]; 180 }];
183 181
@@ -681,7 +679,7 @@ static const NSInteger margin = 34; @@ -681,7 +679,7 @@ static const NSInteger margin = 34;
681 [self.view addSubview:self.tableView]; 679 [self.view addSubview:self.tableView];
682 680
683 //设置下拉刷新 681 //设置下拉刷新
684 - MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadVoice)]; 682 + MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadVoiceData)];
685 [header setImages:refreshingImages forState:MJRefreshStateRefreshing]; 683 [header setImages:refreshingImages forState:MJRefreshStateRefreshing];
686 header.lastUpdatedTimeLabel.hidden = YES; 684 header.lastUpdatedTimeLabel.hidden = YES;
687 header.stateLabel.hidden = YES; 685 header.stateLabel.hidden = YES;
@@ -708,7 +706,7 @@ static const NSInteger margin = 34; @@ -708,7 +706,7 @@ static const NSInteger margin = 34;
708 [self.view addSubview:self.enTableView]; 706 [self.view addSubview:self.enTableView];
709 707
710 //设置下拉刷新 708 //设置下拉刷新
711 - MJRefreshGifHeader *engHeader = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadVOS)]; 709 + MJRefreshGifHeader *engHeader = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadVOSData)];
712 [engHeader setImages:refreshingImages forState:MJRefreshStateRefreshing]; 710 [engHeader setImages:refreshingImages forState:MJRefreshStateRefreshing];
713 engHeader.lastUpdatedTimeLabel.hidden = YES; 711 engHeader.lastUpdatedTimeLabel.hidden = YES;
714 engHeader.stateLabel.hidden = YES; 712 engHeader.stateLabel.hidden = YES;
CNLiveScioLive/Pages/Register/Controller/CNLiveRegisterViewController.m
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 - (void)getData{ 20 - (void)getData{
21 NSMutableArray *controllers = [NSMutableArray array]; 21 NSMutableArray *controllers = [NSMutableArray array];
22 NSArray *titles = @[CustomStr(@"PhoneNumberRegister"), CustomStr(@"EmailRegister")]; 22 NSArray *titles = @[CustomStr(@"PhoneNumberRegister"), CustomStr(@"EmailRegister")];
23 - 23 + NSArray *dTitles = @[titles,@[@"",@""]];
24 for(int i = 0; i < titles.count; i++){ 24 for(int i = 0; i < titles.count; i++){
25 25
26 if(i == 0){ 26 if(i == 0){
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 33
34 } 34 }
35 if(controllers.count > 0){ 35 if(controllers.count > 0){
36 - self.segmentControl.titles = titles; 36 + self.segmentControl.titles = dTitles;
37 self.segmentControl.viewControllers = controllers; 37 self.segmentControl.viewControllers = controllers;
38 } 38 }
39 } 39 }
CNLiveScioLive/Pages/Sources/zh-Hans.lproj/Localizable.strings
@@ -135,7 +135,7 @@ @@ -135,7 +135,7 @@
135 135
136 //提示 136 //提示
137 "NetworkiInterruption" = "网络连接中断"; 137 "NetworkiInterruption" = "网络连接中断";
138 -"ServerBusy" = "服务器忙"; 138 +"ServerBusy" = "网络异常";
139 "PhoneNumberError" = "手机号错误"; 139 "PhoneNumberError" = "手机号错误";
140 "EmailError" = "邮箱错误"; 140 "EmailError" = "邮箱错误";
141 "CodeError" = "验证码错误"; 141 "CodeError" = "验证码错误";
CNLiveScioLive/Pages/Tools/AlertView/AlertViewTool.m
@@ -96,11 +96,11 @@ @@ -96,11 +96,11 @@
96 96
97 } 97 }
98 + (void)showHUDView{ 98 + (void)showHUDView{
99 - [MBProgressHUD showHUDAddedTo:[self getCurrentVC].view animated:YES]; 99 + [MBProgressHUD showHUDAddedTo:AppKeyWindow animated:YES];
100 } 100 }
101 101
102 + (void)hideHUDView{ 102 + (void)hideHUDView{
103 - [MBProgressHUD hideHUDForView:[self getCurrentVC].view animated:YES]; 103 + [MBProgressHUD hideHUDForView:AppKeyWindow animated:YES];
104 } 104 }
105 105
106 + (UIViewController *)getCurrentVC{ 106 + (UIViewController *)getCurrentVC{
CNLiveScioLive/Pages/Tools/CNLivePlayer/CNLivePlayerController.m
No preview for this file type
CNLiveScioLive/Pages/Tools/ImageGray/UIColor+CNGray.m
@@ -34,8 +34,8 @@ static inline NSUInteger hexStrToInt(NSString *str) { @@ -34,8 +34,8 @@ static inline NSUInteger hexStrToInt(NSString *str) {
34 return result; 34 return result;
35 } 35 }
36 36
37 -static BOOL hexStrToRGBA(NSString *str,  
38 - CGFloat *r, CGFloat *g, CGFloat *b, CGFloat *a) { 37 +static BOOL hexStrToARGB(NSString *str,
  38 + CGFloat *a, CGFloat *r, CGFloat *g, CGFloat *b) {
39 39
40 40
41 str = ({ // Trim blank characters (space and newline) in head and tail. 41 str = ({ // Trim blank characters (space and newline) in head and tail.
@@ -63,19 +63,23 @@ static BOOL hexStrToRGBA(NSString *str, @@ -63,19 +63,23 @@ static BOOL hexStrToRGBA(NSString *str,
63 *b = hexStrToInt([str substringWithRange:NSMakeRange(2, 1)]) / 255.0f; 63 *b = hexStrToInt([str substringWithRange:NSMakeRange(2, 1)]) / 255.0f;
64 if (length == 4) *a = hexStrToInt([str substringWithRange:NSMakeRange(3, 1)]) / 255.0f; 64 if (length == 4) *a = hexStrToInt([str substringWithRange:NSMakeRange(3, 1)]) / 255.0f;
65 else *a = 1; 65 else *a = 1;
66 - } else { 66 + }else if (length == 6){
67 *r = hexStrToInt([str substringWithRange:NSMakeRange(0, 2)]) / 255.0f; 67 *r = hexStrToInt([str substringWithRange:NSMakeRange(0, 2)]) / 255.0f;
68 *g = hexStrToInt([str substringWithRange:NSMakeRange(2, 2)]) / 255.0f; 68 *g = hexStrToInt([str substringWithRange:NSMakeRange(2, 2)]) / 255.0f;
69 *b = hexStrToInt([str substringWithRange:NSMakeRange(4, 2)]) / 255.0f; 69 *b = hexStrToInt([str substringWithRange:NSMakeRange(4, 2)]) / 255.0f;
70 - if (length == 8) *a = hexStrToInt([str substringWithRange:NSMakeRange(6, 2)]) / 255.0f;  
71 - else *a = 1; 70 + }
  71 + else {
  72 + *a = hexStrToInt([str substringWithRange:NSMakeRange(0, 2)]) / 255.0f;
  73 + *r = hexStrToInt([str substringWithRange:NSMakeRange(2, 2)]) / 255.0f;
  74 + *g = hexStrToInt([str substringWithRange:NSMakeRange(4, 2)]) / 255.0f;
  75 + *b = hexStrToInt([str substringWithRange:NSMakeRange(6, 2)]) / 255.0f;
72 } 76 }
73 return YES; 77 return YES;
74 } 78 }
75 79
76 + (instancetype)colorWithHexString:(NSString *)hexStr { 80 + (instancetype)colorWithHexString:(NSString *)hexStr {
77 CGFloat r, g, b, a; 81 CGFloat r, g, b, a;
78 - if (hexStrToRGBA(hexStr, &r, &g, &b, &a)) { 82 + if (hexStrToARGB(hexStr, &a, &r, &g, &b)) {
79 return [UIColor colorWithRed:r green:g blue:b alpha:1]; 83 return [UIColor colorWithRed:r green:g blue:b alpha:1];
80 } 84 }
81 return nil; 85 return nil;
CNLiveScioLive/Pages/Tools/ImageGray/UIImage+CNGray.m
@@ -13,6 +13,9 @@ @@ -13,6 +13,9 @@
13 const int RED = 1; 13 const int RED = 1;
14 const int GREEN = 2; 14 const int GREEN = 2;
15 const int BLUE = 3; 15 const int BLUE = 3;
  16 + if (sourceImage.scale>2) {
  17 + return sourceImage;
  18 + }
16 CGRect imageRect = CGRectMake(0, 0, sourceImage.size.width *sourceImage.scale, sourceImage.size.height *sourceImage.scale); 19 CGRect imageRect = CGRectMake(0, 0, sourceImage.size.width *sourceImage.scale, sourceImage.size.height *sourceImage.scale);
17 int width = imageRect.size.width; 20 int width = imageRect.size.width;
18 int height = imageRect.size.height; 21 int height = imageRect.size.height;
CNLiveScioLive/Pages/Tools/ImageGray/UIImageView+CNGrayImage.m
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 25
26 /// 图片使用灰白处理 26 /// 图片使用灰白处理
27 BOOL gray = [[NSUserDefaults standardUserDefaults] boolForKey:ISGRAYMODE]; 27 BOOL gray = [[NSUserDefaults standardUserDefaults] boolForKey:ISGRAYMODE];
28 - if (gray) { 28 + if (gray&&[self isMemberOfClass:[UIImageView class]]) {
29 image = [UIImage grayImage:image]; 29 image = [UIImage grayImage:image];
30 } 30 }
31 [self xmtSwizzledSetImage:image]; 31 [self xmtSwizzledSetImage:image];
CNLiveScioLive/Pages/Tools/ImageGray/UILabel+CNGray.h deleted 100644 → 0
1 -//  
2 -// UILabel+CNGray.h  
3 -// CNLiveScioLive  
4 -//  
5 -// Created by CNLive on 2021/5/12.  
6 -// Copyright © 2021 CNLive. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -  
11 -NS_ASSUME_NONNULL_BEGIN  
12 -  
13 -@interface UILabel (CNGray)  
14 -  
15 -@end  
16 -  
17 -NS_ASSUME_NONNULL_END  
CNLiveScioLive/Pages/Tools/ImageGray/UILabel+CNGray.m deleted 100644 → 0
1 -//  
2 -// UILabel+CNGray.m  
3 -// CNLiveScioLive  
4 -//  
5 -// Created by CNLive on 2021/5/12.  
6 -// Copyright © 2021 CNLive. All rights reserved.  
7 -//  
8 -  
9 -#import "UILabel+CNGray.h"  
10 -#import "UIColor+CNGray.h"  
11 -#import "ZXWKitConst.h"  
12 -  
13 -@implementation UILabel (CNGray)  
14 -+(void)load  
15 -{  
16 - static dispatch_once_t onceToken;  
17 - dispatch_once(&onceToken, ^{  
18 - Method setImage = class_getInstanceMethod(self,@selector(setTextColor:));  
19 - Method xmtSwizzledSetImage = class_getInstanceMethod(self,@selector(cn_setTextColor:));  
20 - ///交换IMP  
21 - method_exchangeImplementations(setImage, xmtSwizzledSetImage);  
22 - });  
23 -}  
24 --(void)cn_setTextColor:(UIColor *)textColor{  
25 - if (HOMETITLECOLORSTR) {  
26 - if (![textColor isEqual:[UIColor whiteColor]]&&![textColor isEqual:segementColor_title_color]) {  
27 - textColor = [UIColor colorWithHexString:HOMETITLECOLORSTR];  
28 -  
29 - }  
30 - }  
31 - [self cn_setTextColor:textColor];  
32 -}  
33 -  
34 -@end  
CNLiveScioLive/Pages/Tools/ZXWSegmentControl/ZXWSegmentControl.h
@@ -28,6 +28,10 @@ @@ -28,6 +28,10 @@
28 * 标题数组 28 * 标题数组
29 */ 29 */
30 @property (strong, nonatomic) NSArray * titles; 30 @property (strong, nonatomic) NSArray * titles;
  31 +/**
  32 + *选中标题颜色
  33 + */
  34 +@property (strong, nonatomic) NSArray *textColors;
31 35
32 /** 36 /**
33 * 控制器数组 37 * 控制器数组
CNLiveScioLive/Pages/Tools/ZXWSegmentControl/ZXWSegmentControl.m
@@ -90,7 +90,12 @@ typedef NS_ENUM(NSInteger, ScrollCtrlViewScrollStatus) { @@ -90,7 +90,12 @@ typedef NS_ENUM(NSInteger, ScrollCtrlViewScrollStatus) {
90 if ([subview isKindOfClass:[ZXWSegment class]]) { 90 if ([subview isKindOfClass:[ZXWSegment class]]) {
91 ZXWSegment * segment = (ZXWSegment *)subview; 91 ZXWSegment * segment = (ZXWSegment *)subview;
92 segment.titleNormalColor = self.titleNormalColor; 92 segment.titleNormalColor = self.titleNormalColor;
  93 + NSString *textColor = self.textColors[segment.tag - 1995];
  94 + if (textColor&&![textColor isEqualToString:@""]) {
  95 + segment.titleSelectColor = [UIColor colorWithHexString:textColor];
  96 + }else{
93 segment.titleSelectColor = self.titleSelectColor; 97 segment.titleSelectColor = self.titleSelectColor;
  98 + }
94 segment.isTitleScale = self.isTitleScale; 99 segment.isTitleScale = self.isTitleScale;
95 } 100 }
96 } 101 }
@@ -204,18 +209,18 @@ typedef NS_ENUM(NSInteger, ScrollCtrlViewScrollStatus) { @@ -204,18 +209,18 @@ typedef NS_ENUM(NSInteger, ScrollCtrlViewScrollStatus) {
204 #pragma mark - Custom Accessors 209 #pragma mark - Custom Accessors
205 210
206 - (void)setTitles:(NSArray *)titles { 211 - (void)setTitles:(NSArray *)titles {
207 - _titles = titles;  
208 - 212 + _titles = titles[0];
  213 + _textColors = titles[1];
209 // Item的宽度 214 // Item的宽度
210 CGFloat itemW = 0.0; 215 CGFloat itemW = 0.0;
211 CGFloat itemX = 0.0; 216 CGFloat itemX = 0.0;
212 - for (int i = 0; i < titles.count; i ++) { 217 + for (int i = 0; i < _titles.count; i ++) {
213 // 判断是滑动还是静止标题栏 218 // 判断是滑动还是静止标题栏
214 if (self.isScrollTitle == YES) { 219 if (self.isScrollTitle == YES) {
215 // 滑动标题栏 220 // 滑动标题栏
216 221
217 // 计算文本标签的Size 222 // 计算文本标签的Size
218 - CGSize labelSize = [self sizeWithText:titles[i] font:segementTitleNormalFont maxSize:CGSizeMake(ZXWkScreen_width, self.height)]; 223 + CGSize labelSize = [self sizeWithText:_titles[i] font:segementTitleNormalFont maxSize:CGSizeMake(ZXWkScreen_width, self.height)];
219 // 计算Item的宽度 Item的宽度 = 本标签的宽度 + 间距 224 // 计算Item的宽度 Item的宽度 = 本标签的宽度 + 间距
220 itemW = labelSize.width + ZXWSegementViewTitlePadding / 2; 225 itemW = labelSize.width + ZXWSegementViewTitlePadding / 2;
221 // 设置contentSize 226 // 设置contentSize
@@ -225,17 +230,21 @@ typedef NS_ENUM(NSInteger, ScrollCtrlViewScrollStatus) { @@ -225,17 +230,21 @@ typedef NS_ENUM(NSInteger, ScrollCtrlViewScrollStatus) {
225 // 静止标题栏 230 // 静止标题栏
226 231
227 // Item的宽度 232 // Item的宽度
228 - itemW = ZXWkScreen_width / titles.count; 233 + itemW = ZXWkScreen_width / _titles.count;
229 // Item的x值 234 // Item的x值
230 itemX = i * itemW; 235 itemX = i * itemW;
231 // 设置contentSize 236 // 设置contentSize
232 self.segementScrollView.contentSize = CGSizeMake(ZXWkScreen_width, 0); 237 self.segementScrollView.contentSize = CGSizeMake(ZXWkScreen_width, 0);
233 } 238 }
234 ZXWSegment * segment = [[ZXWSegment alloc] initWithFrame:CGRectMake(itemX, 0, itemW, self.height)]; 239 ZXWSegment * segment = [[ZXWSegment alloc] initWithFrame:CGRectMake(itemX, 0, itemW, self.height)];
235 - segment.title = titles[i]; 240 + segment.title = _titles[i];
236 segment.titleNormalColor = self.titleNormalColor; 241 segment.titleNormalColor = self.titleNormalColor;
  242 + NSString *textColor = _textColors[i];
  243 + if (textColor&&![textColor isEqualToString:@""]) {
  244 + segment.titleSelectColor = [UIColor colorWithHexString:textColor];
  245 + }else{
237 segment.titleSelectColor = self.titleSelectColor; 246 segment.titleSelectColor = self.titleSelectColor;
238 - 247 + }
239 segment.titleSelectBold = YES; 248 segment.titleSelectBold = YES;
240 segment.tag = 1995 + i; 249 segment.tag = 1995 + i;
241 [segment addTarget:self action:@selector(itemAction:) forControlEvents:UIControlEventTouchUpInside]; 250 [segment addTarget:self action:@selector(itemAction:) forControlEvents:UIControlEventTouchUpInside];