Commit f8e80c8bebb74ff088d8f059d0af37124753ba63
1 parent
215105c9
布局微调
Showing
9 changed files
with
59 additions
and
22 deletions
CNLiveCServiceModule.podspec
CNLiveCServiceModule/Classes/Present/CNLiveServicePresent.m
| ... | ... | @@ -122,9 +122,9 @@ static const CGFloat margin = 15; |
| 122 | 122 | } |
| 123 | 123 | NSString *serviceId = [dic[@"category"] stringForKey:@"id"]; |
| 124 | 124 | if (serviceId.integerValue == 6) { |
| 125 | - cellheight = 160; | |
| 125 | + cellheight = 150; | |
| 126 | 126 | if (lists.count <= 2) { |
| 127 | - cellheight = 90; | |
| 127 | + cellheight = 80; | |
| 128 | 128 | } |
| 129 | 129 | showNum = 4; |
| 130 | 130 | itemSize = CGSizeMake((KScreenWidth - 3*margin)/2, 60); |
| ... | ... | @@ -234,7 +234,7 @@ static const CGFloat margin = 15; |
| 234 | 234 | [CNLiveNetworking setupShowDataResult:NO]; |
| 235 | 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 | 238 | NSArray *array = responseObject[@"data"]; |
| 239 | 239 | NSMutableArray *dataArray = [NSMutableArray array]; |
| 240 | 240 | if (array &&[array isKindOfClass:[NSArray class]]) { |
| ... | ... | @@ -359,7 +359,7 @@ static const CGFloat margin = 15; |
| 359 | 359 | [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/servingApi/allCategory") Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { |
| 360 | 360 | NSDictionary * dic = responseObject[@"data"]; |
| 361 | 361 | NSMutableArray *array = [NSMutableArray array]; |
| 362 | - if (dic) { | |
| 362 | + if (dic&&[dic isKindOfClass:[NSDictionary class]]) { | |
| 363 | 363 | if (dic[@"list"]&&[dic[@"list"] isKindOfClass:[NSArray class]]) { |
| 364 | 364 | NSArray *list = dic[@"list"]; |
| 365 | 365 | |
| ... | ... | @@ -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 | 383 | NSString *lastPage = dic[@"hasNextPage"]; |
| 384 | 384 | !succeed?:succeed(array.copy,!lastPage.boolValue); |
| 385 | 385 | }else{ | ... | ... |
CNLiveCServiceModule/Classes/View/CNLIveCategoryCell.m
| ... | ... | @@ -86,7 +86,7 @@ |
| 86 | 86 | { |
| 87 | 87 | if (!_subTitle) { |
| 88 | 88 | _subTitle = [[UILabel alloc] init]; |
| 89 | - _subTitle.textColor = CNLiveColorWithHexString(@"#A9A9A9"); | |
| 89 | + _subTitle.textColor = CNLiveColorWithHexString(@"#999999"); | |
| 90 | 90 | _subTitle.font = UIFontCNMake(12); |
| 91 | 91 | } |
| 92 | 92 | return _subTitle; | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveCycleCell.m
| ... | ... | @@ -100,19 +100,19 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell"; |
| 100 | 100 | #pragma mark - UICollectionViewDelegateFlowLayout |
| 101 | 101 | - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ |
| 102 | 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 | 105 | return CGSizeMake(_model.layout.width, _model.layout.height); |
| 106 | 106 | } |
| 107 | 107 | - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{ |
| 108 | 108 | if ([_model.categoryId isEqual:@"6"]) { |
| 109 | - return UIEdgeInsetsMake(10, 5, 10, 5); | |
| 109 | + return UIEdgeInsetsMake(0, 5, 5, 5); | |
| 110 | 110 | } |
| 111 | 111 | if ([_model.title isEqual:@""] && [_model.subTitle isEqualToString:@""]) { |
| 112 | 112 | return UIEdgeInsetsMake(5, 0, 5, 0); |
| 113 | 113 | } |
| 114 | 114 | if ([_model.title isEqual:@"大家都在用"]) { |
| 115 | - return UIEdgeInsetsMake(15, 0, 0, 0); | |
| 115 | + return UIEdgeInsetsMake(5, 0, 0, 0); | |
| 116 | 116 | } |
| 117 | 117 | return UIEdgeInsetsMake(15, 0, 0, 0); |
| 118 | 118 | |
| ... | ... | @@ -124,6 +124,12 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell"; |
| 124 | 124 | } |
| 125 | 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 | 133 | #pragma mark - Setting&&Getting |
| 128 | 134 | -(void)setModel:(CNLiveSearchHotsModel *)model |
| 129 | 135 | { | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveServiceOrLookCell.m
| ... | ... | @@ -95,7 +95,7 @@ |
| 95 | 95 | if (!_titleLabel) { |
| 96 | 96 | _titleLabel = [[UILabel alloc] init]; |
| 97 | 97 | _titleLabel.font = UIFontCNMake(10); |
| 98 | - _titleLabel.textColor = CNLiveColorWithHexString(@"#A9A9A9"); | |
| 98 | + _titleLabel.textColor = CNLiveColorWithHexString(@"#999999"); | |
| 99 | 99 | _titleLabel.textAlignment = NSTextAlignmentLeft; |
| 100 | 100 | } |
| 101 | 101 | return _titleLabel; | ... | ... |
Example/CNLiveCServiceModule.xcodeproj/project.pbxproj
| ... | ... | @@ -568,10 +568,12 @@ |
| 568 | 568 | baseConfigurationReference = 7FFF279F44B52D3DBDEA06AA /* Pods-CNLiveCServiceModule_Example.debug.xcconfig */; |
| 569 | 569 | buildSettings = { |
| 570 | 570 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 571 | + CURRENT_PROJECT_VERSION = 2.0.5.21.12.28.15; | |
| 571 | 572 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 572 | 573 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 573 | 574 | GCC_PREFIX_HEADER = "CNLiveCServiceModule/CNLiveCServiceModule-Prefix.pch"; |
| 574 | 575 | INFOPLIST_FILE = "CNLiveCServiceModule/CNLiveCServiceModule-Info.plist"; |
| 576 | + MARKETING_VERSION = 2.0.5; | |
| 575 | 577 | MODULE_NAME = ExampleApp; |
| 576 | 578 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; |
| 577 | 579 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| ... | ... | @@ -585,10 +587,12 @@ |
| 585 | 587 | baseConfigurationReference = 89D3A4127C6ABFDE73E3D2CA /* Pods-CNLiveCServiceModule_Example.release.xcconfig */; |
| 586 | 588 | buildSettings = { |
| 587 | 589 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 590 | + CURRENT_PROJECT_VERSION = 2.0.5.21.12.28.15; | |
| 588 | 591 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 589 | 592 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 590 | 593 | GCC_PREFIX_HEADER = "CNLiveCServiceModule/CNLiveCServiceModule-Prefix.pch"; |
| 591 | 594 | INFOPLIST_FILE = "CNLiveCServiceModule/CNLiveCServiceModule-Info.plist"; |
| 595 | + MARKETING_VERSION = 2.0.5; | |
| 592 | 596 | MODULE_NAME = ExampleApp; |
| 593 | 597 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; |
| 594 | 598 | PRODUCT_NAME = "$(TARGET_NAME)"; | ... | ... |
Example/CNLiveCServiceModule/CNLIVEAppDelegate.m
| ... | ... | @@ -9,20 +9,48 @@ |
| 9 | 9 | #import "CNLIVEAppDelegate.h" |
| 10 | 10 | #import <CNLiveCServiceModule/CNLiveServiceVC.h> |
| 11 | 11 | #import <CNLiveUserManagement/CNUserInfoManager.h> |
| 12 | - | |
| 12 | +#import <CNLiveRequestBastKit/CNLiveNetworking.h> | |
| 13 | +#import <CNLiveEnvironment/CNLiveEnvironment.h> | |
| 14 | +#import <CNLiveEnvironment/CNLiveEnvironmentManager.h> | |
| 13 | 15 | |
| 14 | 16 | @implementation CNLIVEAppDelegate |
| 15 | 17 | |
| 16 | 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 | 31 | CNLiveServiceVC *vc = [[CNLiveServiceVC alloc] init]; |
| 19 | - CNUserShareModel.uid = @"1000057899"; | |
| 20 | 32 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; |
| 21 | 33 | self.window.rootViewController = nav; |
| 22 | 34 | [self.window makeKeyAndVisible]; |
| 35 | + [self setParamNet]; | |
| 23 | 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 | 54 | - (void)applicationWillResignActive:(UIApplication *)application |
| 27 | 55 | { |
| 28 | 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 | 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 3 | 3 | <plist version="1.0"> |
| 4 | 4 | <dict> |
| 5 | - <key>NSAppTransportSecurity</key> | |
| 6 | - <dict> | |
| 7 | - <key>NSAllowsArbitraryLoads</key> | |
| 8 | - <true/> | |
| 9 | - </dict> | |
| 10 | 5 | <key>CFBundleDevelopmentRegion</key> |
| 11 | 6 | <string>en</string> |
| 12 | 7 | <key>CFBundleDisplayName</key> |
| ... | ... | @@ -22,13 +17,18 @@ |
| 22 | 17 | <key>CFBundlePackageType</key> |
| 23 | 18 | <string>APPL</string> |
| 24 | 19 | <key>CFBundleShortVersionString</key> |
| 25 | - <string>1.0</string> | |
| 20 | + <string>$(MARKETING_VERSION)</string> | |
| 26 | 21 | <key>CFBundleSignature</key> |
| 27 | 22 | <string>????</string> |
| 28 | 23 | <key>CFBundleVersion</key> |
| 29 | - <string>1.0</string> | |
| 24 | + <string>$(CURRENT_PROJECT_VERSION)</string> | |
| 30 | 25 | <key>LSRequiresIPhoneOS</key> |
| 31 | 26 | <true/> |
| 27 | + <key>NSAppTransportSecurity</key> | |
| 28 | + <dict> | |
| 29 | + <key>NSAllowsArbitraryLoads</key> | |
| 30 | + <true/> | |
| 31 | + </dict> | |
| 32 | 32 | <key>UILaunchStoryboardName</key> |
| 33 | 33 | <string>LaunchScreen</string> |
| 34 | 34 | <key>UIMainStoryboardFile</key> | ... | ... |
Example/CNLiveCServiceModule/main.m