Commit f8e80c8bebb74ff088d8f059d0af37124753ba63

Authored by yanglingyu
1 parent 215105c9

布局微调

CNLiveCServiceModule.podspec
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 Pod::Spec.new do |s| 9 Pod::Spec.new do |s|
10 s.name = 'CNLiveCServiceModule' 10 s.name = 'CNLiveCServiceModule'
11 - s.version = '0.0.32' 11 + s.version = '0.0.33'
12 s.summary = '我的服务内容' 12 s.summary = '我的服务内容'
13 13
14 # This description is used to generate tags and improve search results. 14 # This description is used to generate tags and improve search results.
CNLiveCServiceModule/Classes/Present/CNLiveServicePresent.m
@@ -122,9 +122,9 @@ static const CGFloat margin = 15; @@ -122,9 +122,9 @@ static const CGFloat margin = 15;
122 } 122 }
123 NSString *serviceId = [dic[@"category"] stringForKey:@"id"]; 123 NSString *serviceId = [dic[@"category"] stringForKey:@"id"];
124 if (serviceId.integerValue == 6) { 124 if (serviceId.integerValue == 6) {
125 - cellheight = 160; 125 + cellheight = 150;
126 if (lists.count <= 2) { 126 if (lists.count <= 2) {
127 - cellheight = 90; 127 + cellheight = 80;
128 } 128 }
129 showNum = 4; 129 showNum = 4;
130 itemSize = CGSizeMake((KScreenWidth - 3*margin)/2, 60); 130 itemSize = CGSizeMake((KScreenWidth - 3*margin)/2, 60);
@@ -234,7 +234,7 @@ static const CGFloat margin = 15; @@ -234,7 +234,7 @@ static const CGFloat margin = 15;
234 [CNLiveNetworking setupShowDataResult:NO]; 234 [CNLiveNetworking setupShowDataResult:NO];
235 [CNLiveNetworking setupShowResult:YES]; 235 [CNLiveNetworking setupShowResult:YES];
236 236
237 - [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/contentApi/getPage") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { 237 + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNGetClassifyPageUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
238 NSArray *array = responseObject[@"data"]; 238 NSArray *array = responseObject[@"data"];
239 NSMutableArray *dataArray = [NSMutableArray array]; 239 NSMutableArray *dataArray = [NSMutableArray array];
240 if (array &&[array isKindOfClass:[NSArray class]]) { 240 if (array &&[array isKindOfClass:[NSArray class]]) {
@@ -359,7 +359,7 @@ static const CGFloat margin = 15; @@ -359,7 +359,7 @@ static const CGFloat margin = 15;
359 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/servingApi/allCategory") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { 359 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/servingApi/allCategory") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
360 NSDictionary * dic = responseObject[@"data"]; 360 NSDictionary * dic = responseObject[@"data"];
361 NSMutableArray *array = [NSMutableArray array]; 361 NSMutableArray *array = [NSMutableArray array];
362 - if (dic) { 362 + if (dic&&[dic isKindOfClass:[NSDictionary class]]) {
363 if (dic[@"list"]&&[dic[@"list"] isKindOfClass:[NSArray class]]) { 363 if (dic[@"list"]&&[dic[@"list"] isKindOfClass:[NSArray class]]) {
364 NSArray *list = dic[@"list"]; 364 NSArray *list = dic[@"list"];
365 365
@@ -379,7 +379,7 @@ static const CGFloat margin = 15; @@ -379,7 +379,7 @@ static const CGFloat margin = 15;
379 } 379 }
380 380
381 381
382 - if (dic) { 382 + if (dic&&[dic isKindOfClass:[NSDictionary class]]) {
383 NSString *lastPage = dic[@"hasNextPage"]; 383 NSString *lastPage = dic[@"hasNextPage"];
384 !succeed?:succeed(array.copy,!lastPage.boolValue); 384 !succeed?:succeed(array.copy,!lastPage.boolValue);
385 }else{ 385 }else{
CNLiveCServiceModule/Classes/View/CNLIveCategoryCell.m
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 { 86 {
87 if (!_subTitle) { 87 if (!_subTitle) {
88 _subTitle = [[UILabel alloc] init]; 88 _subTitle = [[UILabel alloc] init];
89 - _subTitle.textColor = CNLiveColorWithHexString(@"#A9A9A9"); 89 + _subTitle.textColor = CNLiveColorWithHexString(@"#999999");
90 _subTitle.font = UIFontCNMake(12); 90 _subTitle.font = UIFontCNMake(12);
91 } 91 }
92 return _subTitle; 92 return _subTitle;
CNLiveCServiceModule/Classes/View/CNLiveCycleCell.m
@@ -100,19 +100,19 @@ static NSString *CNServiceOrLookID = @&quot;CNLiveServiceOrLookCell&quot;; @@ -100,19 +100,19 @@ static NSString *CNServiceOrLookID = @&quot;CNLiveServiceOrLookCell&quot;;
100 #pragma mark - UICollectionViewDelegateFlowLayout 100 #pragma mark - UICollectionViewDelegateFlowLayout
101 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ 101 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
102 if ([_model.title isEqualToString:@"大家都在用"]) { 102 if ([_model.title isEqualToString:@"大家都在用"]) {
103 - return CGSizeMake(collectionView.width, (collectionView.height -40)/3); 103 + return CGSizeMake(collectionView.width, (collectionView.height -20)/3);
104 } 104 }
105 return CGSizeMake(_model.layout.width, _model.layout.height); 105 return CGSizeMake(_model.layout.width, _model.layout.height);
106 } 106 }
107 - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{ 107 - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{
108 if ([_model.categoryId isEqual:@"6"]) { 108 if ([_model.categoryId isEqual:@"6"]) {
109 - return UIEdgeInsetsMake(10, 5, 10, 5); 109 + return UIEdgeInsetsMake(0, 5, 5, 5);
110 } 110 }
111 if ([_model.title isEqual:@""] && [_model.subTitle isEqualToString:@""]) { 111 if ([_model.title isEqual:@""] && [_model.subTitle isEqualToString:@""]) {
112 return UIEdgeInsetsMake(5, 0, 5, 0); 112 return UIEdgeInsetsMake(5, 0, 5, 0);
113 } 113 }
114 if ([_model.title isEqual:@"大家都在用"]) { 114 if ([_model.title isEqual:@"大家都在用"]) {
115 - return UIEdgeInsetsMake(15, 0, 0, 0); 115 + return UIEdgeInsetsMake(5, 0, 0, 0);
116 } 116 }
117 return UIEdgeInsetsMake(15, 0, 0, 0); 117 return UIEdgeInsetsMake(15, 0, 0, 0);
118 118
@@ -124,6 +124,12 @@ static NSString *CNServiceOrLookID = @&quot;CNLiveServiceOrLookCell&quot;; @@ -124,6 +124,12 @@ static NSString *CNServiceOrLookID = @&quot;CNLiveServiceOrLookCell&quot;;
124 } 124 }
125 return 0; 125 return 0;
126 } 126 }
  127 +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
  128 + if ([_model.title isEqual:@"大家都在用"]) {
  129 + return 0;
  130 + }
  131 + return 5;
  132 +}
127 #pragma mark - Setting&&Getting 133 #pragma mark - Setting&&Getting
128 -(void)setModel:(CNLiveSearchHotsModel *)model 134 -(void)setModel:(CNLiveSearchHotsModel *)model
129 { 135 {
CNLiveCServiceModule/Classes/View/CNLiveServiceOrLookCell.m
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 if (!_titleLabel) { 95 if (!_titleLabel) {
96 _titleLabel = [[UILabel alloc] init]; 96 _titleLabel = [[UILabel alloc] init];
97 _titleLabel.font = UIFontCNMake(10); 97 _titleLabel.font = UIFontCNMake(10);
98 - _titleLabel.textColor = CNLiveColorWithHexString(@"#A9A9A9"); 98 + _titleLabel.textColor = CNLiveColorWithHexString(@"#999999");
99 _titleLabel.textAlignment = NSTextAlignmentLeft; 99 _titleLabel.textAlignment = NSTextAlignmentLeft;
100 } 100 }
101 return _titleLabel; 101 return _titleLabel;
Example/CNLiveCServiceModule.xcodeproj/project.pbxproj
@@ -568,10 +568,12 @@ @@ -568,10 +568,12 @@
568 baseConfigurationReference = 7FFF279F44B52D3DBDEA06AA /* Pods-CNLiveCServiceModule_Example.debug.xcconfig */; 568 baseConfigurationReference = 7FFF279F44B52D3DBDEA06AA /* Pods-CNLiveCServiceModule_Example.debug.xcconfig */;
569 buildSettings = { 569 buildSettings = {
570 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 570 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
  571 + CURRENT_PROJECT_VERSION = 2.0.5.21.12.28.15;
571 DEVELOPMENT_TEAM = 94X49GG3ZW; 572 DEVELOPMENT_TEAM = 94X49GG3ZW;
572 GCC_PRECOMPILE_PREFIX_HEADER = YES; 573 GCC_PRECOMPILE_PREFIX_HEADER = YES;
573 GCC_PREFIX_HEADER = "CNLiveCServiceModule/CNLiveCServiceModule-Prefix.pch"; 574 GCC_PREFIX_HEADER = "CNLiveCServiceModule/CNLiveCServiceModule-Prefix.pch";
574 INFOPLIST_FILE = "CNLiveCServiceModule/CNLiveCServiceModule-Info.plist"; 575 INFOPLIST_FILE = "CNLiveCServiceModule/CNLiveCServiceModule-Info.plist";
  576 + MARKETING_VERSION = 2.0.5;
575 MODULE_NAME = ExampleApp; 577 MODULE_NAME = ExampleApp;
576 PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 578 PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
577 PRODUCT_NAME = "$(TARGET_NAME)"; 579 PRODUCT_NAME = "$(TARGET_NAME)";
@@ -585,10 +587,12 @@ @@ -585,10 +587,12 @@
585 baseConfigurationReference = 89D3A4127C6ABFDE73E3D2CA /* Pods-CNLiveCServiceModule_Example.release.xcconfig */; 587 baseConfigurationReference = 89D3A4127C6ABFDE73E3D2CA /* Pods-CNLiveCServiceModule_Example.release.xcconfig */;
586 buildSettings = { 588 buildSettings = {
587 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 589 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
  590 + CURRENT_PROJECT_VERSION = 2.0.5.21.12.28.15;
588 DEVELOPMENT_TEAM = 94X49GG3ZW; 591 DEVELOPMENT_TEAM = 94X49GG3ZW;
589 GCC_PRECOMPILE_PREFIX_HEADER = YES; 592 GCC_PRECOMPILE_PREFIX_HEADER = YES;
590 GCC_PREFIX_HEADER = "CNLiveCServiceModule/CNLiveCServiceModule-Prefix.pch"; 593 GCC_PREFIX_HEADER = "CNLiveCServiceModule/CNLiveCServiceModule-Prefix.pch";
591 INFOPLIST_FILE = "CNLiveCServiceModule/CNLiveCServiceModule-Info.plist"; 594 INFOPLIST_FILE = "CNLiveCServiceModule/CNLiveCServiceModule-Info.plist";
  595 + MARKETING_VERSION = 2.0.5;
592 MODULE_NAME = ExampleApp; 596 MODULE_NAME = ExampleApp;
593 PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 597 PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
594 PRODUCT_NAME = "$(TARGET_NAME)"; 598 PRODUCT_NAME = "$(TARGET_NAME)";
Example/CNLiveCServiceModule/CNLIVEAppDelegate.m
@@ -9,20 +9,48 @@ @@ -9,20 +9,48 @@
9 #import "CNLIVEAppDelegate.h" 9 #import "CNLIVEAppDelegate.h"
10 #import <CNLiveCServiceModule/CNLiveServiceVC.h> 10 #import <CNLiveCServiceModule/CNLiveServiceVC.h>
11 #import <CNLiveUserManagement/CNUserInfoManager.h> 11 #import <CNLiveUserManagement/CNUserInfoManager.h>
12 - 12 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
  13 +#import <CNLiveEnvironment/CNLiveEnvironment.h>
  14 +#import <CNLiveEnvironment/CNLiveEnvironmentManager.h>
13 15
14 @implementation CNLIVEAppDelegate 16 @implementation CNLIVEAppDelegate
15 17
16 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
17 { 19 {
  20 + CNUserShareModel.uid = @"430783";
  21 + [CNLiveEnvironmentManager setEnvironment:CNLiveProductionAppStore];
  22 + [BHContext shareInstance].application = application;
  23 + [BHContext shareInstance].launchOptions = launchOptions;
  24 + [BHContext shareInstance].moduleConfigName = @"CNLiveBeeHive.bundle/BeeHive.bundle/BeeHive";
  25 + [BHContext shareInstance].serviceConfigName = @"CNLiveBeeHive.bundle/BeeHive.bundle/BHService";
  26 + [BeeHive shareInstance].enableException = YES;
  27 +
  28 + [super application:application didFinishLaunchingWithOptions:launchOptions];
  29 + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  30 + self.window.backgroundColor = [UIColor whiteColor];
18 CNLiveServiceVC *vc = [[CNLiveServiceVC alloc] init]; 31 CNLiveServiceVC *vc = [[CNLiveServiceVC alloc] init];
19 - CNUserShareModel.uid = @"1000057899";  
20 UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; 32 UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
21 self.window.rootViewController = nav; 33 self.window.rootViewController = nav;
22 [self.window makeKeyAndVisible]; 34 [self.window makeKeyAndVisible];
  35 + [self setParamNet];
23 return YES; 36 return YES;
24 } 37 }
25 - 38 +-(void)setParamNet
  39 +{
  40 + NSMutableDictionary * mDict = [[NSMutableDictionary alloc] init];
  41 + [mDict setValue:[CNUserInfoManager manager].userInfoModel.uid forKey:@"loginSid"];
  42 + [mDict setValue:@"com.cnlive.CNLiveNetAdd.debug" forKey:@"platform_id"];
  43 + [mDict setValue:[[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""] forKey:@"uuid"];
  44 + [mDict setValue:@"i" forKey:@"plat"];
  45 + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"ver"];
  46 + [mDict setObject:AppId forKey:@"appId"];
  47 + [mDict setObject:[CNUserInfoManager manager].userInfoModel.uid forKey:@"sid"];
  48 + [CNLiveNetworking setupDefaultParam:mDict];
  49 + [CNLiveNetworking setupShowResult:NO];
  50 + [CNLiveNetworking setupSignKey:APPKey];
  51 + [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  52 + [CNLiveNetworking setResponseSerializerType:CNLiveResponseSerializerJSON];
  53 +}
26 - (void)applicationWillResignActive:(UIApplication *)application 54 - (void)applicationWillResignActive:(UIApplication *)application
27 { 55 {
28 // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 56 // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Example/CNLiveCServiceModule/CNLiveCServiceModule-Info.plist
@@ -2,11 +2,6 @@ @@ -2,11 +2,6 @@
2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 <plist version="1.0"> 3 <plist version="1.0">
4 <dict> 4 <dict>
5 - <key>NSAppTransportSecurity</key>  
6 - <dict>  
7 - <key>NSAllowsArbitraryLoads</key>  
8 - <true/>  
9 - </dict>  
10 <key>CFBundleDevelopmentRegion</key> 5 <key>CFBundleDevelopmentRegion</key>
11 <string>en</string> 6 <string>en</string>
12 <key>CFBundleDisplayName</key> 7 <key>CFBundleDisplayName</key>
@@ -22,13 +17,18 @@ @@ -22,13 +17,18 @@
22 <key>CFBundlePackageType</key> 17 <key>CFBundlePackageType</key>
23 <string>APPL</string> 18 <string>APPL</string>
24 <key>CFBundleShortVersionString</key> 19 <key>CFBundleShortVersionString</key>
25 - <string>1.0</string> 20 + <string>$(MARKETING_VERSION)</string>
26 <key>CFBundleSignature</key> 21 <key>CFBundleSignature</key>
27 <string>????</string> 22 <string>????</string>
28 <key>CFBundleVersion</key> 23 <key>CFBundleVersion</key>
29 - <string>1.0</string> 24 + <string>$(CURRENT_PROJECT_VERSION)</string>
30 <key>LSRequiresIPhoneOS</key> 25 <key>LSRequiresIPhoneOS</key>
31 <true/> 26 <true/>
  27 + <key>NSAppTransportSecurity</key>
  28 + <dict>
  29 + <key>NSAllowsArbitraryLoads</key>
  30 + <true/>
  31 + </dict>
32 <key>UILaunchStoryboardName</key> 32 <key>UILaunchStoryboardName</key>
33 <string>LaunchScreen</string> 33 <string>LaunchScreen</string>
34 <key>UIMainStoryboardFile</key> 34 <key>UIMainStoryboardFile</key>
Example/CNLiveCServiceModule/main.m
@@ -13,7 +13,6 @@ @@ -13,7 +13,6 @@
13 int main(int argc, char * argv[]) 13 int main(int argc, char * argv[])
14 { 14 {
15 @autoreleasepool { 15 @autoreleasepool {
16 - [CNLiveEnvironmentManager setEnvironment:CNLiveProductionAppStore];  
17 return UIApplicationMain(argc, argv, nil, NSStringFromClass([CNLIVEAppDelegate class])); 16 return UIApplicationMain(argc, argv, nil, NSStringFromClass([CNLIVEAppDelegate class]));
18 } 17 }
19 } 18 }