Commit 9f0e30e6e6528484d150d166029e8c8b4bbb528b
1 parent
04ee37bb
no message
Showing
4 changed files
with
74 additions
and
74 deletions
CNLiveMineModule/Classes/Controller/CNLiveMineController.m
| ... | ... | @@ -128,7 +128,7 @@ static const CGFloat timeValue = 1.5; |
| 128 | 128 | ]; |
| 129 | 129 | for(NSDictionary *dic in data){ |
| 130 | 130 | CNLiveMineModel *model = [CNLiveMineModel mj_objectWithKeyValues:dic]; |
| 131 | - [model editModel:NO]; | |
| 131 | +// [model editModel:NO]; | |
| 132 | 132 | [self.data addObject:model]; |
| 133 | 133 | } |
| 134 | 134 | [self.tableView reloadData]; |
| ... | ... | @@ -192,8 +192,7 @@ static const CGFloat timeValue = 1.5; |
| 192 | 192 | CNLiveMineCell *cell = [tableView dequeueReusableCellWithIdentifier:kCNLiveMineCell]; |
| 193 | 193 | cell.selectionStyle = UITableViewCellSelectionStyleNone; |
| 194 | 194 | cell.delegate = self; |
| 195 | - CNLiveMineModel *model = self.data[indexPath.row]; | |
| 196 | - cell.model = model; | |
| 195 | + cell.model = self.data[indexPath.row]; | |
| 197 | 196 | return cell; |
| 198 | 197 | } |
| 199 | 198 | |
| ... | ... | @@ -252,43 +251,6 @@ static const CGFloat timeValue = 1.5; |
| 252 | 251 | }]; |
| 253 | 252 | } |
| 254 | 253 | |
| 255 | -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { | |
| 256 | - CGPoint point = scrollView.contentOffset; | |
| 257 | - if (point.y < -kHEIGHT) { | |
| 258 | - CGRect rect = [self.tableView viewWithTag:666].frame; | |
| 259 | - rect.origin.y = point.y; | |
| 260 | - rect.size.height = -point.y; | |
| 261 | - [self.tableView viewWithTag:666].frame = rect; | |
| 262 | - if(point.y < -320){ | |
| 263 | -// XWWitnessController *vc = [[XWWitnessController alloc]init]; | |
| 264 | -// CATransition *transition = [CATransition animation]; | |
| 265 | -// transition.duration = 0.5; | |
| 266 | -// transition.timingFunction = [CAMediaTimingFunction | |
| 267 | -// functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | |
| 268 | -// transition.type = kCATransitionPush; | |
| 269 | -// transition.subtype = kCATransitionFromBottom; | |
| 270 | -// [self.view.window.layer addAnimation:transition forKey:nil]; | |
| 271 | -// [self.navigationController pushViewController:vc animated:NO]; | |
| 272 | - | |
| 273 | - } | |
| 274 | - } | |
| 275 | - | |
| 276 | - CGFloat offsetToShow = 50.0;//滑动多少就完全显示 | |
| 277 | - | |
| 278 | - CGFloat offsetY = scrollView.contentOffset.y+kHEIGHT; | |
| 279 | - if (offsetY <= 0) { | |
| 280 | - _navigationBar.alpha = 0.0; | |
| 281 | - } | |
| 282 | - else if (offsetY > offsetToShow) { | |
| 283 | - _navigationBar.alpha = 1.0; | |
| 284 | - } | |
| 285 | - else { | |
| 286 | - CGFloat alpha = MIN((offsetY / offsetToShow), 1); | |
| 287 | - _navigationBar.alpha = alpha; | |
| 288 | - } | |
| 289 | - | |
| 290 | -} | |
| 291 | - | |
| 292 | 254 | #pragma mark - CNLiveMineCellDelegate |
| 293 | 255 | - (void)cell:(CNLiveMineCell *)cell clickedButtonWithType:(CNLiveMineCellType)type tag:(NSInteger)tag{ |
| 294 | 256 | switch (type) { |
| ... | ... | @@ -378,10 +340,42 @@ static const CGFloat timeValue = 1.5; |
| 378 | 340 | |
| 379 | 341 | } |
| 380 | 342 | |
| 381 | -#pragma mark - 响应方法 | |
| 382 | -- (void)soccerDidClicked:(UIButton *)btn{ | |
| 383 | - id<CNLiveIntegralServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveIntegralServiceProtocol)]; | |
| 384 | - [service pushToTaskListViewController]; | |
| 343 | +#pragma mark - UIScrollViewDelegate | |
| 344 | +- (void)scrollViewDidScroll:(UIScrollView *)scrollView { | |
| 345 | + CGPoint point = scrollView.contentOffset; | |
| 346 | + if (point.y < -kHEIGHT) { | |
| 347 | + CGRect rect = [self.tableView viewWithTag:666].frame; | |
| 348 | + rect.origin.y = point.y; | |
| 349 | + rect.size.height = -point.y; | |
| 350 | + [self.tableView viewWithTag:666].frame = rect; | |
| 351 | + if(point.y < -320){ | |
| 352 | +// XWWitnessController *vc = [[XWWitnessController alloc]init]; | |
| 353 | +// CATransition *transition = [CATransition animation]; | |
| 354 | +// transition.duration = 0.5; | |
| 355 | +// transition.timingFunction = [CAMediaTimingFunction | |
| 356 | +// functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | |
| 357 | +// transition.type = kCATransitionPush; | |
| 358 | +// transition.subtype = kCATransitionFromBottom; | |
| 359 | +// [self.view.window.layer addAnimation:transition forKey:nil]; | |
| 360 | +// [self.navigationController pushViewController:vc animated:NO]; | |
| 361 | + | |
| 362 | + } | |
| 363 | + } | |
| 364 | + | |
| 365 | + CGFloat offsetToShow = 50.0;//滑动多少就完全显示 | |
| 366 | + | |
| 367 | + CGFloat offsetY = scrollView.contentOffset.y+kHEIGHT; | |
| 368 | + if (offsetY <= 0) { | |
| 369 | + _navigationBar.alpha = 0.0; | |
| 370 | + } | |
| 371 | + else if (offsetY > offsetToShow) { | |
| 372 | + _navigationBar.alpha = 1.0; | |
| 373 | + } | |
| 374 | + else { | |
| 375 | + CGFloat alpha = MIN((offsetY / offsetToShow), 1); | |
| 376 | + _navigationBar.alpha = alpha; | |
| 377 | + } | |
| 378 | + | |
| 385 | 379 | } |
| 386 | 380 | |
| 387 | 381 | #pragma mark - 状态栏 |
| ... | ... | @@ -396,6 +390,12 @@ static const CGFloat timeValue = 1.5; |
| 396 | 390 | |
| 397 | 391 | } |
| 398 | 392 | |
| 393 | +#pragma mark - 响应方法 | |
| 394 | +- (void)soccerDidClicked:(UIButton *)btn{ | |
| 395 | + id<CNLiveIntegralServiceProtocol> service = [[BeeHive shareInstance] createService:@protocol(CNLiveIntegralServiceProtocol)]; | |
| 396 | + [service pushToTaskListViewController]; | |
| 397 | +} | |
| 398 | + | |
| 399 | 399 | #pragma mark - 懒加载 |
| 400 | 400 | - (NSMutableArray *)data { |
| 401 | 401 | if (!_data) { | ... | ... |
CNLiveMineModule/Classes/Model/CNLiveMineRequest.h
| ... | ... | @@ -9,11 +9,11 @@ |
| 9 | 9 | #import <Foundation/Foundation.h> |
| 10 | 10 | |
| 11 | 11 | NS_ASSUME_NONNULL_BEGIN |
| 12 | -typedef void(^CancelCollectionBlock)(BOOL isSuccess, NSDictionary *data, NSError *error); | |
| 12 | +typedef void(^SignInBlock)(BOOL isSuccess, NSDictionary *data, NSError *error); | |
| 13 | 13 | |
| 14 | 14 | @interface CNLiveMineRequest : NSObject |
| 15 | 15 | |
| 16 | -+ (void)signIn:(CancelCollectionBlock)block; | |
| 16 | ++ (void)signIn:(SignInBlock)block; | |
| 17 | 17 | |
| 18 | 18 | @end |
| 19 | 19 | ... | ... |
CNLiveMineModule/Classes/Model/CNLiveMineRequest.m
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | |
| 17 | 17 | @implementation CNLiveMineRequest |
| 18 | 18 | |
| 19 | -+ (void)signIn:(CancelCollectionBlock)block { | |
| 19 | ++ (void)signIn:(SignInBlock)block { | |
| 20 | 20 | NSDictionary *params = @{@"sid":CNUserShareModel.uid}; |
| 21 | 21 | [CNLiveNetworking setAllowRequestDefaultArgument:YES]; |
| 22 | 22 | [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNIntegralSignInUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ... | ... |
Example/CNLiveMineModule.xcodeproj/project.pbxproj
| ... | ... | @@ -234,8 +234,8 @@ |
| 234 | 234 | 6003F586195388D20070C39A /* Sources */, |
| 235 | 235 | 6003F587195388D20070C39A /* Frameworks */, |
| 236 | 236 | 6003F588195388D20070C39A /* Resources */, |
| 237 | - 179A773721B29DE922FE36E4 /* [CP] Embed Pods Frameworks */, | |
| 238 | - 74528FB96C480F38FE82703E /* [CP] Copy Pods Resources */, | |
| 237 | + A2865851FA99976BFF15F3E3 /* [CP] Embed Pods Frameworks */, | |
| 238 | + 1C17EACB5E5C91135706CC76 /* [CP] Copy Pods Resources */, | |
| 239 | 239 | ); |
| 240 | 240 | buildRules = ( |
| 241 | 241 | ); |
| ... | ... | @@ -326,7 +326,31 @@ |
| 326 | 326 | /* End PBXResourcesBuildPhase section */ |
| 327 | 327 | |
| 328 | 328 | /* Begin PBXShellScriptBuildPhase section */ |
| 329 | - 179A773721B29DE922FE36E4 /* [CP] Embed Pods Frameworks */ = { | |
| 329 | + 1C17EACB5E5C91135706CC76 /* [CP] Copy Pods Resources */ = { | |
| 330 | + isa = PBXShellScriptBuildPhase; | |
| 331 | + buildActionMask = 2147483647; | |
| 332 | + files = ( | |
| 333 | + ); | |
| 334 | + inputPaths = ( | |
| 335 | + "${PODS_ROOT}/Target Support Files/Pods-CNLiveMineModule_Example/Pods-CNLiveMineModule_Example-resources.sh", | |
| 336 | + "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveMineModule/CNLiveMineModule.bundle", | |
| 337 | + "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveMyOrderModule/CNLiveMyOrderModule.bundle", | |
| 338 | + "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveQrCodeModule/CNLiveQrCodeModule.bundle", | |
| 339 | + "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveSettingModule/CNLiveSettingModule.bundle", | |
| 340 | + ); | |
| 341 | + name = "[CP] Copy Pods Resources"; | |
| 342 | + outputPaths = ( | |
| 343 | + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveMineModule.bundle", | |
| 344 | + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveMyOrderModule.bundle", | |
| 345 | + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveQrCodeModule.bundle", | |
| 346 | + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveSettingModule.bundle", | |
| 347 | + ); | |
| 348 | + runOnlyForDeploymentPostprocessing = 0; | |
| 349 | + shellPath = /bin/sh; | |
| 350 | + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveMineModule_Example/Pods-CNLiveMineModule_Example-resources.sh\"\n"; | |
| 351 | + showEnvVarsInLog = 0; | |
| 352 | + }; | |
| 353 | + A2865851FA99976BFF15F3E3 /* [CP] Embed Pods Frameworks */ = { | |
| 330 | 354 | isa = PBXShellScriptBuildPhase; |
| 331 | 355 | buildActionMask = 2147483647; |
| 332 | 356 | files = ( |
| ... | ... | @@ -432,30 +456,6 @@ |
| 432 | 456 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveMineModule_Example/Pods-CNLiveMineModule_Example-frameworks.sh\"\n"; |
| 433 | 457 | showEnvVarsInLog = 0; |
| 434 | 458 | }; |
| 435 | - 74528FB96C480F38FE82703E /* [CP] Copy Pods Resources */ = { | |
| 436 | - isa = PBXShellScriptBuildPhase; | |
| 437 | - buildActionMask = 2147483647; | |
| 438 | - files = ( | |
| 439 | - ); | |
| 440 | - inputPaths = ( | |
| 441 | - "${PODS_ROOT}/Target Support Files/Pods-CNLiveMineModule_Example/Pods-CNLiveMineModule_Example-resources.sh", | |
| 442 | - "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveMineModule/CNLiveMineModule.bundle", | |
| 443 | - "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveMyOrderModule/CNLiveMyOrderModule.bundle", | |
| 444 | - "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveQrCodeModule/CNLiveQrCodeModule.bundle", | |
| 445 | - "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveSettingModule/CNLiveSettingModule.bundle", | |
| 446 | - ); | |
| 447 | - name = "[CP] Copy Pods Resources"; | |
| 448 | - outputPaths = ( | |
| 449 | - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveMineModule.bundle", | |
| 450 | - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveMyOrderModule.bundle", | |
| 451 | - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveQrCodeModule.bundle", | |
| 452 | - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveSettingModule.bundle", | |
| 453 | - ); | |
| 454 | - runOnlyForDeploymentPostprocessing = 0; | |
| 455 | - shellPath = /bin/sh; | |
| 456 | - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveMineModule_Example/Pods-CNLiveMineModule_Example-resources.sh\"\n"; | |
| 457 | - showEnvVarsInLog = 0; | |
| 458 | - }; | |
| 459 | 459 | A9B5D0EFC5B6FCA241FAE929 /* [CP] Check Pods Manifest.lock */ = { |
| 460 | 460 | isa = PBXShellScriptBuildPhase; |
| 461 | 461 | buildActionMask = 2147483647; | ... | ... |