Commit 8abd0ea22a6ed1d7ecfd37d92ae8d46348db8471

Authored by zhangxiaowen
1 parent 86cb2b7d

no message

CNLiveBalanceModule/Classes/Controller/CNLiveBalanceController.h
@@ -16,9 +16,9 @@ @@ -16,9 +16,9 @@
16 NS_ASSUME_NONNULL_BEGIN 16 NS_ASSUME_NONNULL_BEGIN
17 17
18 //type: 1-个人中心 2-特色群组 18 //type: 1-个人中心 2-特色群组
  19 +//ID: 用户id-个人中心 群组id-特色群组
19 @interface CNLiveBalanceController : CNCommonViewController 20 @interface CNLiveBalanceController : CNCommonViewController
20 -@property (nonatomic, copy) NSString *type;  
21 -@property (nonatomic, copy) NSString *ID; 21 +- (instancetype)initWithType:(NSString *)type ID:(NSString *)ID;
22 22
23 @end 23 @end
24 24
CNLiveBalanceModule/Classes/Controller/CNLiveBalanceController.m
@@ -25,9 +25,19 @@ @@ -25,9 +25,19 @@
25 @property (nonatomic, strong) CNLiveBalanceNavigationBar *navigationBar; 25 @property (nonatomic, strong) CNLiveBalanceNavigationBar *navigationBar;
26 @property (nonatomic, strong) CNLiveBalanceView *balanceView; 26 @property (nonatomic, strong) CNLiveBalanceView *balanceView;
27 27
  28 +@property (nonatomic, copy) NSString *type;
  29 +@property (nonatomic, copy) NSString *ID;
  30 +
28 @end 31 @end
29 32
30 @implementation CNLiveBalanceController 33 @implementation CNLiveBalanceController
  34 +- (instancetype)initWithType:(NSString *)type ID:(NSString *)ID{
  35 + if(self = [super init]){
  36 + self.type = type;
  37 + self.ID = ID;
  38 + }
  39 + return self;
  40 +}
31 #pragma mark - 加载数据 41 #pragma mark - 加载数据
32 - (void)loadData { 42 - (void)loadData {
33 [CNLiveBalanceRequest getBalance:self.type ID:self.ID block:^(BOOL isSuccess, NSString * _Nonnull number) { 43 [CNLiveBalanceRequest getBalance:self.type ID:self.ID block:^(BOOL isSuccess, NSString * _Nonnull number) {
@@ -67,14 +77,15 @@ @@ -67,14 +77,15 @@
67 if (!_navigationBar) { 77 if (!_navigationBar) {
68 _navigationBar = [[CNLiveBalanceNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)]; 78 _navigationBar = [[CNLiveBalanceNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];
69 _navigationBar.delegate = self; 79 _navigationBar.delegate = self;
70 - _navigationBar.title.text = @"中国网家家补贴余额";  
71 if([self.type isEqualToString:@"1"]){ 80 if([self.type isEqualToString:@"1"]){
72 - // 余额补贴 81 + // 个人余额
  82 + _navigationBar.title.text = @"中国网家家补贴余额";
73 UIImage *image = [self getImageWithImageName:@"balance_pay_center" bundleName:@"CNLiveBalanceModule" targetClass:[self class]]; 83 UIImage *image = [self getImageWithImageName:@"balance_pay_center" bundleName:@"CNLiveBalanceModule" targetClass:[self class]];
74 [_navigationBar.right setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; 84 [_navigationBar.right setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
75 85
76 }else if ([self.type isEqualToString:@"2"]){ 86 }else if ([self.type isEqualToString:@"2"]){
77 // 特色群组 87 // 特色群组
  88 + _navigationBar.title.text = @"余额";
78 [_navigationBar.right setTitle:@"明细" forState:UIControlStateNormal]; 89 [_navigationBar.right setTitle:@"明细" forState:UIControlStateNormal];
79 } 90 }
80 } 91 }
CNLiveBalanceModule/Classes/Module/CNLiveBalanceService.m
@@ -20,13 +20,18 @@ @@ -20,13 +20,18 @@
20 20
21 @implementation CNLiveBalanceService 21 @implementation CNLiveBalanceService
22 22
23 -// 设置  
24 -- (UIViewController *)getBalanceViewController {  
25 - return [CNLiveBalanceController new]; 23 +// 补贴余额
  24 +//type: 1-个人中心 2-特色群组
  25 +//ID: 用户id-个人中心 群组id-特色群组
  26 +
  27 +- (UIViewController *)getBalanceViewControllerWithType:(NSString *)type ID:(NSString *)ID{
  28 + return [[CNLiveBalanceController alloc]initWithType:type ID:ID];
26 } 29 }
27 30
28 -- (void)pushToBalanceViewController {  
29 - CNLiveBalanceController *vc = [[CNLiveBalanceController alloc]init]; 31 +//type: 1-个人中心 2-特色群组
  32 +//ID: 用户id-个人中心 群组id-特色群组
  33 +- (void)pushToBalanceViewControllerWithType:(NSString *)type ID:(NSString *)ID{
  34 + CNLiveBalanceController *vc = [[CNLiveBalanceController alloc]initWithType:type ID:ID];
30 [CNLivePageJumpManager jumpViewController:vc]; 35 [CNLivePageJumpManager jumpViewController:vc];
31 } 36 }
32 37
Example/CNLiveBalanceModule.xcodeproj/project.pbxproj
@@ -207,8 +207,8 @@ @@ -207,8 +207,8 @@
207 6003F586195388D20070C39A /* Sources */, 207 6003F586195388D20070C39A /* Sources */,
208 6003F587195388D20070C39A /* Frameworks */, 208 6003F587195388D20070C39A /* Frameworks */,
209 6003F588195388D20070C39A /* Resources */, 209 6003F588195388D20070C39A /* Resources */,
210 - 17E5EDE4BAD413BFEB61C294 /* [CP] Embed Pods Frameworks */,  
211 - 4B66AA6D5D71CE1886A7CC0C /* [CP] Copy Pods Resources */, 210 + 04DAF2C133B9CFF22FDE1366 /* [CP] Embed Pods Frameworks */,
  211 + CDA0F25F90257941F752081C /* [CP] Copy Pods Resources */,
212 ); 212 );
213 buildRules = ( 213 buildRules = (
214 ); 214 );
@@ -299,7 +299,7 @@ @@ -299,7 +299,7 @@
299 /* End PBXResourcesBuildPhase section */ 299 /* End PBXResourcesBuildPhase section */
300 300
301 /* Begin PBXShellScriptBuildPhase section */ 301 /* Begin PBXShellScriptBuildPhase section */
302 - 17E5EDE4BAD413BFEB61C294 /* [CP] Embed Pods Frameworks */ = { 302 + 04DAF2C133B9CFF22FDE1366 /* [CP] Embed Pods Frameworks */ = {
303 isa = PBXShellScriptBuildPhase; 303 isa = PBXShellScriptBuildPhase;
304 buildActionMask = 2147483647; 304 buildActionMask = 2147483647;
305 files = ( 305 files = (
@@ -375,7 +375,7 @@ @@ -375,7 +375,7 @@
375 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"; 375 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";
376 showEnvVarsInLog = 0; 376 showEnvVarsInLog = 0;
377 }; 377 };
378 - 4B66AA6D5D71CE1886A7CC0C /* [CP] Copy Pods Resources */ = { 378 + CDA0F25F90257941F752081C /* [CP] Copy Pods Resources */ = {
379 isa = PBXShellScriptBuildPhase; 379 isa = PBXShellScriptBuildPhase;
380 buildActionMask = 2147483647; 380 buildActionMask = 2147483647;
381 files = ( 381 files = (
Example/CNLiveBalanceModule/CNLIVEAppDelegate.m
@@ -62,9 +62,7 @@ @@ -62,9 +62,7 @@
62 }]; 62 }];
63 [[NSUserDefaults standardUserDefaults] setObject:@"RkFYeLkl/u5S7tW8UcOkT3rfLTP/Ua8NIkdEsKlcolvl/yxTMNbAYXmmJyhKGpkj" forKey:@"CNLiveAuthToken"]; 63 [[NSUserDefaults standardUserDefaults] setObject:@"RkFYeLkl/u5S7tW8UcOkT3rfLTP/Ua8NIkdEsKlcolvl/yxTMNbAYXmmJyhKGpkj" forKey:@"CNLiveAuthToken"];
64 64
65 - CNLiveBalanceController *vc = [[CNLiveBalanceController alloc] init];  
66 - vc.type = @"1";  
67 - vc.ID = CNUserShareModel.uid; 65 + CNLiveBalanceController *vc = [[CNLiveBalanceController alloc] initWithType:@"1" ID:CNUserShareModel.uid];
68 UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; 66 UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
69 self.window.rootViewController = nav;//设置根视图控制器 67 self.window.rootViewController = nav;//设置根视图控制器
70 [self.window makeKeyAndVisible]; 68 [self.window makeKeyAndVisible];