Commit e030152bfcdeb614267f22240129835206460226

Authored by yanglingyu
1 parent 416fb8d5

轮播图变灰异常,网络请求超时退出,文字颜色适配后台参数配置

Showing 22 changed files with 66 additions and 62 deletions
CNLiveScioLive/AppDelegate.m
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 [self checkAppUpdate]; 60 [self checkAppUpdate];
61 61
62 [self initializeSDKConfiguration]; 62 [self initializeSDKConfiguration];
63 - [self requestLanchImage]; 63 + [self requestLanchImage:0];
64 do{ 64 do{
65 [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; 65 [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]];
66 66
@@ -92,8 +92,9 @@ @@ -92,8 +92,9 @@
92 [self.window makeKeyAndVisible]; 92 [self.window makeKeyAndVisible];
93 } 93 }
94 #pragma mark - 请求启动页 94 #pragma mark - 请求启动页
95 --(void)requestLanchImage 95 +-(void)requestLanchImage:(int)time
96 { 96 {
  97 + __block int requestTime = time;
97 NSString *urlStr = REQUESTURL(@"gxb/openBanner"); 98 NSString *urlStr = REQUESTURL(@"gxb/openBanner");
98 NSDictionary *parameters = @{@"params":@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"pageUUID\":\"852cde69-ecd8-11e6-b52e-c7d8a7a18cc4\",\"pageType\":\"channelList\"}"}; 99 NSDictionary *parameters = @{@"params":@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"pageUUID\":\"852cde69-ecd8-11e6-b52e-c7d8a7a18cc4\",\"pageType\":\"channelList\"}"};
99 [XWHTTPTool GET:urlStr params:parameters success:^(id json) { 100 [XWHTTPTool GET:urlStr params:parameters success:^(id json) {
@@ -103,7 +104,7 @@ @@ -103,7 +104,7 @@
103 if (mode.intValue == 1) { 104 if (mode.intValue == 1) {
104 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:ISGRAYMODE]; 105 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:ISGRAYMODE];
105 }else{ 106 }else{
106 - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:ISGRAYMODE]; 107 + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:ISGRAYMODE];
107 } 108 }
108 if (dic[@"homeTitleColor"]&&![dic[@"homeTitleColor"] isEqualToString:@""]) { 109 if (dic[@"homeTitleColor"]&&![dic[@"homeTitleColor"] isEqualToString:@""]) {
109 [[NSUserDefaults standardUserDefaults] setValue:dic[@"homeTitleColor"] forKey:HOMETITLECOLOR]; 110 [[NSUserDefaults standardUserDefaults] setValue:dic[@"homeTitleColor"] forKey:HOMETITLECOLOR];
@@ -139,7 +140,14 @@ @@ -139,7 +140,14 @@
139 [downloadTask resume ]; 140 [downloadTask resume ];
140 } 141 }
141 } failure:^(NSError *error) { 142 } failure:^(NSError *error) {
142 - [self addRootViewController]; 143 + ++requestTime;
  144 + if (requestTime<3) {
  145 + [self requestLanchImage:requestTime];
  146 + }else
  147 + {
  148 + exit(0);
  149 + }
  150 +
143 }]; 151 }];
144 152
145 } 153 }
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/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/Tools/ImageGray/UIColor+CNGray.m
@@ -80,7 +80,7 @@ static BOOL hexStrToARGB(NSString *str, @@ -80,7 +80,7 @@ static BOOL hexStrToARGB(NSString *str,
80 + (instancetype)colorWithHexString:(NSString *)hexStr { 80 + (instancetype)colorWithHexString:(NSString *)hexStr {
81 CGFloat r, g, b, a; 81 CGFloat r, g, b, a;
82 if (hexStrToARGB(hexStr, &a, &r, &g, &b)) { 82 if (hexStrToARGB(hexStr, &a, &r, &g, &b)) {
83 - return [UIColor colorWithRed:r green:g blue:b alpha:a]; 83 + return [UIColor colorWithRed:r green:g blue:b alpha:1];
84 } 84 }
85 return nil; 85 return nil;
86 } 86 }
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;