Commit c2ac647025e0cac9de0ce3cc1b5e48e77f05f17f
1 parent
dc0a557f
修改余额补贴接口请求
Showing
5 changed files
with
81 additions
and
8 deletions
CNLiveCMineModule.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 = 'CNLiveCMineModule' | 10 | s.name = 'CNLiveCMineModule' |
| 11 | - s.version = '0.3.0' | 11 | + s.version = '0.3.1' |
| 12 | s.summary = '网家家C端个人中心' | 12 | s.summary = '网家家C端个人中心' |
| 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. |
CNLiveCMineModule/Classes/CNCSubMine/Present/CNCSubMinePresent.h
| @@ -58,8 +58,6 @@ typedef void (^CNLoginResponseBlock)(NSURLSessionTask *requestTask, id responseO | @@ -58,8 +58,6 @@ typedef void (^CNLoginResponseBlock)(NSURLSessionTask *requestTask, id responseO | ||
| 58 | +(void)showWithScoreViewForScoreIntergal:(NSString *)scoreIntergal Statue:(BOOL)statue SuperView:(UIViewController *)superView; | 58 | +(void)showWithScoreViewForScoreIntergal:(NSString *)scoreIntergal Statue:(BOOL)statue SuperView:(UIViewController *)superView; |
| 59 | 59 | ||
| 60 | 60 | ||
| 61 | - | ||
| 62 | - | ||
| 63 | @end | 61 | @end |
| 64 | 62 | ||
| 65 | NS_ASSUME_NONNULL_END | 63 | NS_ASSUME_NONNULL_END |
CNLiveCMineModule/Classes/CNWallet/Present/CNWalletPresent.h
| @@ -11,6 +11,15 @@ NS_ASSUME_NONNULL_BEGIN | @@ -11,6 +11,15 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 11 | 11 | ||
| 12 | @interface CNWalletPresent : NSObject | 12 | @interface CNWalletPresent : NSObject |
| 13 | + (void)requestExchangeBalanceWithCardNumber:(NSString *)cardNumber completion:(void (^)(NSDictionary *))completion; | 13 | + (void)requestExchangeBalanceWithCardNumber:(NSString *)cardNumber completion:(void (^)(NSDictionary *))completion; |
| 14 | + | ||
| 15 | +/// 余额专用接口 | ||
| 16 | +/// @param responseBlock 返回 | ||
| 17 | +/// @param type 1-私人,2-群组,不传-达人 | ||
| 18 | ++ (void)requestBalanceWithType:(NSString *)type responseBlock:(void(^)(NSString *balance))responseBlock; | ||
| 19 | + | ||
| 20 | +/// 获取活动列表接口 | ||
| 21 | +/// @param responseBlock 返回 | ||
| 22 | ++ (void)requestActivityListBlock:(void(^)(NSArray *activities))responseBlock; | ||
| 14 | @end | 23 | @end |
| 15 | 24 | ||
| 16 | NS_ASSUME_NONNULL_END | 25 | NS_ASSUME_NONNULL_END |
CNLiveCMineModule/Classes/CNWallet/Present/CNWalletPresent.m
| @@ -44,4 +44,70 @@ | @@ -44,4 +44,70 @@ | ||
| 44 | }]; | 44 | }]; |
| 45 | }]; | 45 | }]; |
| 46 | } | 46 | } |
| 47 | ++ (void)requestBalanceWithType:(NSString *)type responseBlock:(void (^)(NSString * _Nonnull))responseBlock{ | ||
| 48 | + NSDictionary *params = @{@"appId":AppId, | ||
| 49 | + @"userId":CNUserShareModel.uid?CNUserShareModel.uid:@"", | ||
| 50 | + @"type":type //1-私人,2-群组,不传-达人 | ||
| 51 | + }; | ||
| 52 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 53 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNGetBalanceUrl Param:params CacheType:NO CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 54 | + if (error) { | ||
| 55 | + [QMUITips showError:error.localizedDescription inView:AppKeyWindow hideAfterDelay:1.5]; | ||
| 56 | + return; | ||
| 57 | + | ||
| 58 | + } | ||
| 59 | + if (responseObject[@"data"][@"balance"]) { | ||
| 60 | + if(responseBlock)responseBlock(responseObject[@"data"][@"balance"]); | ||
| 61 | + }else{ | ||
| 62 | + [QMUITips showError:responseObject[@"errorMessage"] inView:AppKeyWindow hideAfterDelay:1.5]; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + }]; | ||
| 66 | + | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | ++ (void)requestActivityListBlock:(void (^)(NSArray * _Nonnull))responseBlock | ||
| 70 | +{ | ||
| 71 | + NSDictionary *params = @{ | ||
| 72 | + @"blockId": @"9", | ||
| 73 | + @"userId":CNUserShareModel.uid?CNUserShareModel.uid:@"", | ||
| 74 | + @"type":@"1", | ||
| 75 | + @"page":@"1", | ||
| 76 | + @"pageSize":@"10" | ||
| 77 | + }; | ||
| 78 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 79 | + [CNLiveNetworking setupShowDataResult:YES]; | ||
| 80 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:cn_API_Classify(@"/contentApi/getBlockContents") Param:params CacheType:NO CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 81 | + if (error) { | ||
| 82 | + [QMUITips showError:error.localizedDescription inView:AppKeyWindow hideAfterDelay:1.5]; | ||
| 83 | + return; | ||
| 84 | + } | ||
| 85 | + if (responseObject && [responseObject isKindOfClass:[NSDictionary class]]) { | ||
| 86 | + | ||
| 87 | + | ||
| 88 | + NSArray *dataArr = responseObject[@"list"]; | ||
| 89 | + | ||
| 90 | + if (dataArr.count>0) { | ||
| 91 | + NSMutableArray *activityListArr = [[NSMutableArray alloc] init]; | ||
| 92 | + for (NSDictionary *dic in dataArr) | ||
| 93 | + { | ||
| 94 | + if ([dic isKindOfClass:[NSDictionary class]]) | ||
| 95 | + { | ||
| 96 | + NSDictionary *dictionary = @{ | ||
| 97 | + @"imgName":dic[@"transverseImg"], | ||
| 98 | + @"url":dic[@"thirdUrl"], | ||
| 99 | + @"title":dic[@"title"] | ||
| 100 | + }; | ||
| 101 | + CNActivityListModel *model = [CNActivityListModel mj_objectWithKeyValues:dictionary]; | ||
| 102 | + [activityListArr addObject:model]; | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + if (responseBlock) { | ||
| 106 | + responseBlock(activityListArr.copy); | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + } | ||
| 110 | + }]; | ||
| 111 | + | ||
| 112 | +} | ||
| 47 | @end | 113 | @end |
CNLiveCMineModule/Classes/CNWallet/ViewController/CNMineWalletController.m
| @@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
| 16 | #import "CNLiveMyExchangeBalanceView.h" | 16 | #import "CNLiveMyExchangeBalanceView.h" |
| 17 | 17 | ||
| 18 | #import <CNLiveCustomUI/CNLiveCycleScrollView.h> | 18 | #import <CNLiveCustomUI/CNLiveCycleScrollView.h> |
| 19 | -#import "CNScoreModel.h" | 19 | +#import "CNWalletPresent.h" |
| 20 | 20 | ||
| 21 | @interface CNMineWalletController ()<CNLiveCycleScrollViewDelegate> | 21 | @interface CNMineWalletController ()<CNLiveCycleScrollViewDelegate> |
| 22 | 22 | ||
| @@ -67,10 +67,11 @@ | @@ -67,10 +67,11 @@ | ||
| 67 | } else if (self.style==PayWalletStyle) { | 67 | } else if (self.style==PayWalletStyle) { |
| 68 | type = @"2"; | 68 | type = @"2"; |
| 69 | } | 69 | } |
| 70 | - [CNMinePresent requestMineDataSourceWithBlock:^(NSArray * _Nonnull activities, CNScoreModel * _Nonnull model) { | ||
| 71 | - self.moneyLab.text = [NSString stringWithFormat:@"¥%@",model.money]; | 70 | + [CNWalletPresent requestBalanceWithType:type responseBlock:^(NSString * _Nonnull balance) { |
| 71 | + self.moneyLab.text = balance; | ||
| 72 | + }]; | ||
| 73 | + [CNWalletPresent requestActivityListBlock:^(NSArray * _Nonnull activities) { | ||
| 72 | self.activityArray = activities; | 74 | self.activityArray = activities; |
| 73 | - | ||
| 74 | if(self.activityArray && self.activityArray.count > 0) | 75 | if(self.activityArray && self.activityArray.count > 0) |
| 75 | { | 76 | { |
| 76 | [self.view addSubview:self.activityScorllView]; | 77 | [self.view addSubview:self.activityScorllView]; |
| @@ -82,7 +83,6 @@ | @@ -82,7 +83,6 @@ | ||
| 82 | }]; | 83 | }]; |
| 83 | } | 84 | } |
| 84 | }]; | 85 | }]; |
| 85 | - | ||
| 86 | } | 86 | } |
| 87 | - (void)viewDidLayoutSubviews { | 87 | - (void)viewDidLayoutSubviews { |
| 88 | [super viewDidLayoutSubviews]; | 88 | [super viewDidLayoutSubviews]; |