Commit 0bd0e249ff75602d6402c1f9a0e0e0fc6c3f2a3b
1 parent
9ca80b26
no message
Showing
11 changed files
with
119 additions
and
110 deletions
CNLiveBalanceModule.podspec
| ... | ... | @@ -84,12 +84,12 @@ TODO: 网家家-余额模块. |
| 84 | 84 | ss.dependency 'CNLiveBalanceModule/View' |
| 85 | 85 | end |
| 86 | 86 | |
| 87 | - # MonthBill 月账单 | |
| 88 | - s.subspec 'MonthBill' do |ss| | |
| 89 | - ss.source_files = 'CNLiveBalanceModule/Classes/MonthBill/*.{h,m}' | |
| 90 | - ss.dependency 'CNLiveBalanceModule/TradingRecord' | |
| 91 | - ss.dependency 'CNLiveBalanceModule/View' | |
| 92 | - end | |
| 87 | +# # MonthBill 月账单 | |
| 88 | +# s.subspec 'MonthBill' do |ss| | |
| 89 | +# ss.source_files = 'CNLiveBalanceModule/Classes/MonthBill/*.{h,m}' | |
| 90 | +# ss.dependency 'CNLiveBalanceModule/TradingRecord' | |
| 91 | +# ss.dependency 'CNLiveBalanceModule/View' | |
| 92 | +# end | |
| 93 | 93 | |
| 94 | 94 | s.resource_bundles = { |
| 95 | 95 | 'CNLiveBalanceModule' => ['CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets'] | ... | ... |
CNLiveBalanceModule/Classes/Controller/CNLiveBalanceController.h
| ... | ... | @@ -20,6 +20,9 @@ NS_ASSUME_NONNULL_BEGIN |
| 20 | 20 | @interface CNLiveBalanceController : CNCommonViewController |
| 21 | 21 | - (instancetype)initWithType:(NSString *)type ID:(NSString *)ID; |
| 22 | 22 | |
| 23 | +- (instancetype)init NS_UNAVAILABLE; | |
| 24 | ++ (instancetype)new NS_UNAVAILABLE; | |
| 25 | + | |
| 23 | 26 | @end |
| 24 | 27 | |
| 25 | 28 | NS_ASSUME_NONNULL_END | ... | ... |
CNLiveBalanceModule/Classes/Controller/CNLiveBalanceController.m
| ... | ... | @@ -32,6 +32,7 @@ |
| 32 | 32 | @end |
| 33 | 33 | |
| 34 | 34 | @implementation CNLiveBalanceController |
| 35 | +#pragma mark - 初始化 | |
| 35 | 36 | - (instancetype)initWithType:(NSString *)type ID:(NSString *)ID{ |
| 36 | 37 | if(self = [super init]){ |
| 37 | 38 | self.type = type; |
| ... | ... | @@ -78,6 +79,37 @@ |
| 78 | 79 | return UIStatusBarStyleLightContent; |
| 79 | 80 | |
| 80 | 81 | } |
| 82 | + | |
| 83 | +#pragma mark - CNLiveBalanceNavigationBarDelegate | |
| 84 | +- (void)navigationBar:(CNLiveBalanceNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{ | |
| 85 | + if ([actionEvents isEqualToString:@"1"]) { | |
| 86 | + [self goBack]; | |
| 87 | + | |
| 88 | + }else if ([actionEvents isEqualToString:@"2"]){ | |
| 89 | + | |
| 90 | + if ([self.type isEqualToString:@"1"]) { // 支付中心 | |
| 91 | + CNLivePayCenterController *vc = [CNLivePayCenterController new]; | |
| 92 | + [self.navigationController pushViewController:vc animated:YES]; | |
| 93 | + | |
| 94 | + } else if ([self.type isEqualToString:@"2"]) { // 明细 | |
| 95 | + CNLiveBalanceDetailController *vc = [CNLiveBalanceDetailController new]; | |
| 96 | + vc.ID = self.ID; | |
| 97 | + [self.navigationController pushViewController:vc animated:YES]; | |
| 98 | + } | |
| 99 | + | |
| 100 | + } | |
| 101 | +} | |
| 102 | + | |
| 103 | +#pragma mark - 响应方法 | |
| 104 | +- (void)goBack { | |
| 105 | + if (self.presentingViewController != nil) { | |
| 106 | + [self dismissViewControllerAnimated:YES completion:nil]; | |
| 107 | + } | |
| 108 | + else { | |
| 109 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 110 | + } | |
| 111 | +} | |
| 112 | + | |
| 81 | 113 | #pragma mark - 懒加载 |
| 82 | 114 | - (CNLiveBalanceNavigationBar *)navigationBar { |
| 83 | 115 | if (!_navigationBar) { |
| ... | ... | @@ -105,34 +137,4 @@ |
| 105 | 137 | return _balanceView; |
| 106 | 138 | } |
| 107 | 139 | |
| 108 | -#pragma mark - 响应方法 | |
| 109 | -- (void)goBack { | |
| 110 | - if (self.presentingViewController != nil) { | |
| 111 | - [self dismissViewControllerAnimated:YES completion:nil]; | |
| 112 | - } | |
| 113 | - else { | |
| 114 | - [self.navigationController popViewControllerAnimated:YES]; | |
| 115 | - } | |
| 116 | -} | |
| 117 | - | |
| 118 | -#pragma mark - CNLiveBalanceNavigationBarDelegate | |
| 119 | -- (void)navigationBar:(CNLiveBalanceNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{ | |
| 120 | - if ([actionEvents isEqualToString:@"1"]) { | |
| 121 | - [self goBack]; | |
| 122 | - | |
| 123 | - }else if ([actionEvents isEqualToString:@"2"]){ | |
| 124 | - | |
| 125 | - if ([self.type isEqualToString:@"1"]) { // 支付中心 | |
| 126 | - CNLivePayCenterController *vc = [CNLivePayCenterController new]; | |
| 127 | - [self.navigationController pushViewController:vc animated:YES]; | |
| 128 | - | |
| 129 | - } else if ([self.type isEqualToString:@"2"]) { // 明细 | |
| 130 | - CNLiveBalanceDetailController *vc = [CNLiveBalanceDetailController new]; | |
| 131 | - vc.ID = self.ID; | |
| 132 | - [self.navigationController pushViewController:vc animated:YES]; | |
| 133 | - } | |
| 134 | - | |
| 135 | - } | |
| 136 | -} | |
| 137 | - | |
| 138 | 140 | @end | ... | ... |
CNLiveBalanceModule/Classes/Detail/CNLiveBalanceDetailController.m
| ... | ... | @@ -44,7 +44,6 @@ static const CGFloat height = 44; |
| 44 | 44 | else { |
| 45 | 45 | self.automaticallyAdjustsScrollViewInsets = NO; |
| 46 | 46 | } |
| 47 | - | |
| 48 | 47 | [self createSubViews]; |
| 49 | 48 | |
| 50 | 49 | } |
| ... | ... | @@ -74,27 +73,9 @@ static const CGFloat height = 44; |
| 74 | 73 | return _navigationBar; |
| 75 | 74 | } |
| 76 | 75 | |
| 77 | -#pragma mark - 响应方法 | |
| 78 | -- (void)goBack { | |
| 79 | - if (self.presentingViewController != nil) { | |
| 80 | - [self dismissViewControllerAnimated:YES completion:nil]; | |
| 81 | - } | |
| 82 | - else { | |
| 83 | - [self.navigationController popViewControllerAnimated:YES]; | |
| 84 | - } | |
| 85 | -} | |
| 86 | - | |
| 87 | -#pragma mark - CNLiveBalanceNavigationBarDelegate | |
| 88 | -- (void)navigationBar:(CNLiveBalanceNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{ | |
| 89 | - if ([actionEvents isEqualToString:@"1"]) { | |
| 90 | - [self goBack]; | |
| 91 | - | |
| 92 | - } | |
| 93 | -} | |
| 94 | 76 | #pragma mark - JXCategoryViewDelegate |
| 95 | 77 | - (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { |
| 96 | 78 | //侧滑手势处理 |
| 97 | - | |
| 98 | 79 | } |
| 99 | 80 | |
| 100 | 81 | #pragma mark - JXCategoryListContainerViewDelegate |
| ... | ... | @@ -109,6 +90,24 @@ static const CGFloat height = 44; |
| 109 | 90 | return self.titles.count; |
| 110 | 91 | } |
| 111 | 92 | |
| 93 | +#pragma mark - CNLiveBalanceNavigationBarDelegate | |
| 94 | +- (void)navigationBar:(CNLiveBalanceNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{ | |
| 95 | + if ([actionEvents isEqualToString:@"1"]) { | |
| 96 | + [self goBack]; | |
| 97 | + | |
| 98 | + } | |
| 99 | +} | |
| 100 | + | |
| 101 | +#pragma mark - 响应方法 | |
| 102 | +- (void)goBack { | |
| 103 | + if (self.presentingViewController != nil) { | |
| 104 | + [self dismissViewControllerAnimated:YES completion:nil]; | |
| 105 | + } | |
| 106 | + else { | |
| 107 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 108 | + } | |
| 109 | +} | |
| 110 | + | |
| 112 | 111 | #pragma mark - 懒加载 |
| 113 | 112 | - (UIView *)tline { |
| 114 | 113 | if (!_tline) { | ... | ... |
CNLiveBalanceModule/Classes/PayCenter/CNLivePayCenterCell.m
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | |
| 24 | 24 | @implementation CNLivePayCenterCell |
| 25 | 25 | static const NSInteger margin = 12; |
| 26 | - | |
| 26 | +#pragma mark - 初始化 | |
| 27 | 27 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { |
| 28 | 28 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
| 29 | 29 | if (self) { |
| ... | ... | @@ -36,12 +36,6 @@ static const NSInteger margin = 12; |
| 36 | 36 | } |
| 37 | 37 | return self; |
| 38 | 38 | } |
| 39 | -- (void)setModel:(CNLiveBalanceModel *)model{ | |
| 40 | - _model = model; | |
| 41 | - _title.text = model.title; | |
| 42 | - [self xw_layoutSubviews]; | |
| 43 | - | |
| 44 | -} | |
| 45 | 39 | |
| 46 | 40 | - (void)xw_layoutSubviews{ |
| 47 | 41 | |
| ... | ... | @@ -70,6 +64,14 @@ static const NSInteger margin = 12; |
| 70 | 64 | |
| 71 | 65 | } |
| 72 | 66 | |
| 67 | +#pragma mark - 数据 | |
| 68 | +- (void)setModel:(CNLiveBalanceModel *)model{ | |
| 69 | + _model = model; | |
| 70 | + _title.text = model.title; | |
| 71 | + [self xw_layoutSubviews]; | |
| 72 | + | |
| 73 | +} | |
| 74 | + | |
| 73 | 75 | - (void)awakeFromNib { |
| 74 | 76 | [super awakeFromNib]; |
| 75 | 77 | // Initialization code | ... | ... |
CNLiveBalanceModule/Classes/PayCenter/CNLivePayCenterController.m
CNLiveBalanceModule/Classes/MonthBill/CNLiveMonthBillController.h renamed to CNLiveBalanceModule/Classes/TradingRecord/CNLiveMonthBillController.h
| ... | ... | @@ -15,8 +15,7 @@ |
| 15 | 15 | @interface CNLiveMonthBillController : CNCommonViewController |
| 16 | 16 | - (instancetype)initWithDate:(NSString *)date startTime:(NSString *)startTime endTime:(NSString *)endTime; |
| 17 | 17 | |
| 18 | -@property (nonatomic, copy) NSString *date; | |
| 19 | -@property (nonatomic, copy) NSString *startTime; | |
| 20 | -@property (nonatomic, copy) NSString *endTime; | |
| 18 | +- (instancetype)init NS_UNAVAILABLE; | |
| 19 | ++ (instancetype)new NS_UNAVAILABLE; | |
| 21 | 20 | |
| 22 | 21 | @end | ... | ... |
CNLiveBalanceModule/Classes/MonthBill/CNLiveMonthBillController.m renamed to CNLiveBalanceModule/Classes/TradingRecord/CNLiveMonthBillController.m
| ... | ... | @@ -32,17 +32,20 @@ |
| 32 | 32 | @property (nonatomic, strong) CNLiveBalanceNavigationBar *navigationBar; |
| 33 | 33 | @property (nonatomic, strong) CNLiveMonthBillView *monthBillView; |
| 34 | 34 | @property (nonatomic, strong) UITableView *tableView; |
| 35 | - | |
| 36 | 35 | @property (nonatomic, strong) NSMutableArray *data; |
| 37 | 36 | |
| 38 | 37 | @property (nonatomic, assign) NSInteger pageNo; |
| 39 | - | |
| 40 | 38 | @property (nonatomic, copy) NSString *type; |
| 41 | 39 | |
| 40 | +@property (nonatomic, copy) NSString *date; | |
| 41 | +@property (nonatomic, copy) NSString *startTime; | |
| 42 | +@property (nonatomic, copy) NSString *endTime; | |
| 43 | + | |
| 42 | 44 | @end |
| 43 | 45 | |
| 44 | 46 | @implementation CNLiveMonthBillController |
| 45 | 47 | static const CGFloat height = 60; |
| 48 | +#pragma mark - 初始化 | |
| 46 | 49 | - (instancetype)initWithDate:(NSString *)date startTime:(NSString *)startTime endTime:(NSString *)endTime{ |
| 47 | 50 | if(self = [super init]){ |
| 48 | 51 | self.date = date; | ... | ... |
CNLiveBalanceModule/Classes/MonthBill/CNLiveMonthBillView.h renamed to CNLiveBalanceModule/Classes/TradingRecord/CNLiveMonthBillView.h
CNLiveBalanceModule/Classes/MonthBill/CNLiveMonthBillView.m renamed to CNLiveBalanceModule/Classes/TradingRecord/CNLiveMonthBillView.m
Example/CNLiveBalanceModule.xcodeproj/project.pbxproj
| ... | ... | @@ -207,8 +207,8 @@ |
| 207 | 207 | 6003F586195388D20070C39A /* Sources */, |
| 208 | 208 | 6003F587195388D20070C39A /* Frameworks */, |
| 209 | 209 | 6003F588195388D20070C39A /* Resources */, |
| 210 | - 04DAF2C133B9CFF22FDE1366 /* [CP] Embed Pods Frameworks */, | |
| 211 | - CDA0F25F90257941F752081C /* [CP] Copy Pods Resources */, | |
| 210 | + D9364C82DD0EE796AF7084A4 /* [CP] Embed Pods Frameworks */, | |
| 211 | + B59B86F4A5A6E47AECF4CE6F /* [CP] Copy Pods Resources */, | |
| 212 | 212 | ); |
| 213 | 213 | buildRules = ( |
| 214 | 214 | ); |
| ... | ... | @@ -299,7 +299,47 @@ |
| 299 | 299 | /* End PBXResourcesBuildPhase section */ |
| 300 | 300 | |
| 301 | 301 | /* Begin PBXShellScriptBuildPhase section */ |
| 302 | - 04DAF2C133B9CFF22FDE1366 /* [CP] Embed Pods Frameworks */ = { | |
| 302 | + 23C1ED5A0D9008CEAD156961 /* [CP] Check Pods Manifest.lock */ = { | |
| 303 | + isa = PBXShellScriptBuildPhase; | |
| 304 | + buildActionMask = 2147483647; | |
| 305 | + files = ( | |
| 306 | + ); | |
| 307 | + inputFileListPaths = ( | |
| 308 | + ); | |
| 309 | + inputPaths = ( | |
| 310 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | |
| 311 | + "${PODS_ROOT}/Manifest.lock", | |
| 312 | + ); | |
| 313 | + name = "[CP] Check Pods Manifest.lock"; | |
| 314 | + outputFileListPaths = ( | |
| 315 | + ); | |
| 316 | + outputPaths = ( | |
| 317 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveBalanceModule_Tests-checkManifestLockResult.txt", | |
| 318 | + ); | |
| 319 | + runOnlyForDeploymentPostprocessing = 0; | |
| 320 | + shellPath = /bin/sh; | |
| 321 | + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | |
| 322 | + showEnvVarsInLog = 0; | |
| 323 | + }; | |
| 324 | + B59B86F4A5A6E47AECF4CE6F /* [CP] Copy Pods Resources */ = { | |
| 325 | + isa = PBXShellScriptBuildPhase; | |
| 326 | + buildActionMask = 2147483647; | |
| 327 | + files = ( | |
| 328 | + ); | |
| 329 | + inputPaths = ( | |
| 330 | + "${PODS_ROOT}/Target Support Files/Pods-CNLiveBalanceModule_Example/Pods-CNLiveBalanceModule_Example-resources.sh", | |
| 331 | + "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveBalanceModule/CNLiveBalanceModule.bundle", | |
| 332 | + ); | |
| 333 | + name = "[CP] Copy Pods Resources"; | |
| 334 | + outputPaths = ( | |
| 335 | + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveBalanceModule.bundle", | |
| 336 | + ); | |
| 337 | + runOnlyForDeploymentPostprocessing = 0; | |
| 338 | + shellPath = /bin/sh; | |
| 339 | + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveBalanceModule_Example/Pods-CNLiveBalanceModule_Example-resources.sh\"\n"; | |
| 340 | + showEnvVarsInLog = 0; | |
| 341 | + }; | |
| 342 | + D9364C82DD0EE796AF7084A4 /* [CP] Embed Pods Frameworks */ = { | |
| 303 | 343 | isa = PBXShellScriptBuildPhase; |
| 304 | 344 | buildActionMask = 2147483647; |
| 305 | 345 | files = ( |
| ... | ... | @@ -355,46 +395,6 @@ |
| 355 | 395 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveBalanceModule_Example/Pods-CNLiveBalanceModule_Example-frameworks.sh\"\n"; |
| 356 | 396 | showEnvVarsInLog = 0; |
| 357 | 397 | }; |
| 358 | - 23C1ED5A0D9008CEAD156961 /* [CP] Check Pods Manifest.lock */ = { | |
| 359 | - isa = PBXShellScriptBuildPhase; | |
| 360 | - buildActionMask = 2147483647; | |
| 361 | - files = ( | |
| 362 | - ); | |
| 363 | - inputFileListPaths = ( | |
| 364 | - ); | |
| 365 | - inputPaths = ( | |
| 366 | - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | |
| 367 | - "${PODS_ROOT}/Manifest.lock", | |
| 368 | - ); | |
| 369 | - name = "[CP] Check Pods Manifest.lock"; | |
| 370 | - outputFileListPaths = ( | |
| 371 | - ); | |
| 372 | - outputPaths = ( | |
| 373 | - "$(DERIVED_FILE_DIR)/Pods-CNLiveBalanceModule_Tests-checkManifestLockResult.txt", | |
| 374 | - ); | |
| 375 | - runOnlyForDeploymentPostprocessing = 0; | |
| 376 | - shellPath = /bin/sh; | |
| 377 | - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | |
| 378 | - showEnvVarsInLog = 0; | |
| 379 | - }; | |
| 380 | - CDA0F25F90257941F752081C /* [CP] Copy Pods Resources */ = { | |
| 381 | - isa = PBXShellScriptBuildPhase; | |
| 382 | - buildActionMask = 2147483647; | |
| 383 | - files = ( | |
| 384 | - ); | |
| 385 | - inputPaths = ( | |
| 386 | - "${PODS_ROOT}/Target Support Files/Pods-CNLiveBalanceModule_Example/Pods-CNLiveBalanceModule_Example-resources.sh", | |
| 387 | - "${PODS_CONFIGURATION_BUILD_DIR}/CNLiveBalanceModule/CNLiveBalanceModule.bundle", | |
| 388 | - ); | |
| 389 | - name = "[CP] Copy Pods Resources"; | |
| 390 | - outputPaths = ( | |
| 391 | - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNLiveBalanceModule.bundle", | |
| 392 | - ); | |
| 393 | - runOnlyForDeploymentPostprocessing = 0; | |
| 394 | - shellPath = /bin/sh; | |
| 395 | - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveBalanceModule_Example/Pods-CNLiveBalanceModule_Example-resources.sh\"\n"; | |
| 396 | - showEnvVarsInLog = 0; | |
| 397 | - }; | |
| 398 | 398 | E8746ACFF48907801CC338D9 /* [CP] Check Pods Manifest.lock */ = { |
| 399 | 399 | isa = PBXShellScriptBuildPhase; |
| 400 | 400 | buildActionMask = 2147483647; | ... | ... |