Commit dfeb3f64e6ab10282d33fd26c9458a6676d558c1
1 parent
d9d044b0
0.2.2
Showing
5 changed files
with
49 additions
and
16 deletions
CNLiveCommuntyModule.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 = 'CNLiveCommuntyModule' | 10 | s.name = 'CNLiveCommuntyModule' |
| 11 | - s.version = '0.2.1' | 11 | + s.version = '0.2.2' |
| 12 | s.summary = 'A short description of CNLiveCommuntyModule.' | 12 | s.summary = 'A short description of CNLiveCommuntyModule.' |
| 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. |
CNLiveCommuntyModule/Classes/Core/CNLiveCommuntyModule.h
| @@ -40,6 +40,10 @@ static NSString *const kCNLiveHiddenModalViewWithQrNotification = @"kCNLiveHidde | @@ -40,6 +40,10 @@ static NSString *const kCNLiveHiddenModalViewWithQrNotification = @"kCNLiveHidde | ||
| 40 | /// @param nbhdId 小区id | 40 | /// @param nbhdId 小区id |
| 41 | -(void)pushCommuntyRepairEditWithNBhdId:(NSString *)nbhdId; | 41 | -(void)pushCommuntyRepairEditWithNBhdId:(NSString *)nbhdId; |
| 42 | 42 | ||
| 43 | +/// 跳转到缴费记录列表界面 | ||
| 44 | +/// @param nbhdId 小区id | ||
| 45 | +-(void)pushCommuntyPayCostWithNBhdId:(NSString *)nbhdId; | ||
| 46 | + | ||
| 43 | /// 跳转到支付结果界面 | 47 | /// 跳转到支付结果界面 |
| 44 | /// @param status 支付结果 | 48 | /// @param status 支付结果 |
| 45 | -(void)pushCommuntyPayCostResultWithStatus:(BOOL)status; | 49 | -(void)pushCommuntyPayCostResultWithStatus:(BOOL)status; |
CNLiveCommuntyModule/Classes/Core/CNLiveCommuntyModule.m
| @@ -99,6 +99,13 @@ | @@ -99,6 +99,13 @@ | ||
| 99 | [[self displayViewController] dsPushViewController:informView animated:YES]; | 99 | [[self displayViewController] dsPushViewController:informView animated:YES]; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | +/// 跳转到缴费记录列表界面 | ||
| 103 | +/// @param nbhdId 小区id | ||
| 104 | +-(void)pushCommuntyPayCostWithNBhdId:(NSString *)nbhdId | ||
| 105 | +{ | ||
| 106 | + CNLiveCommuntListViewController * informView = [[CNLiveCommuntListViewController alloc] initWithShowType:CNLiveCommuntListShowTypePayCost NBhdId:nbhdId]; | ||
| 107 | + [[self displayViewController] dsPushViewController:informView animated:YES]; | ||
| 108 | +} | ||
| 102 | 109 | ||
| 103 | /// 跳转到支付结果界面 | 110 | /// 跳转到支付结果界面 |
| 104 | /// @param status 支付结果 | 111 | /// @param status 支付结果 |
CNLiveCommuntyModule/Classes/ViewController/CNLiveCommuntListViewController.m
| @@ -54,6 +54,7 @@ | @@ -54,6 +54,7 @@ | ||
| 54 | self.view.backgroundColor = UIColorHex(#F9F9F9); | 54 | self.view.backgroundColor = UIColorHex(#F9F9F9); |
| 55 | self.dataArray = [[NSMutableArray alloc] init]; | 55 | self.dataArray = [[NSMutableArray alloc] init]; |
| 56 | [self addRefreshMainView]; | 56 | [self addRefreshMainView]; |
| 57 | + if (self.showType == CNLiveCommuntListShowTypePayCost) self.title = @"物业缴费"; | ||
| 57 | 58 | ||
| 58 | } | 59 | } |
| 59 | 60 | ||
| @@ -101,11 +102,11 @@ | @@ -101,11 +102,11 @@ | ||
| 101 | self.tableView.backgroundColor = UIColorHex(#f9f9f9); | 102 | self.tableView.backgroundColor = UIColorHex(#f9f9f9); |
| 102 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; | 103 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
| 103 | 104 | ||
| 104 | - __weak typeof(self) weakSelf = self; | ||
| 105 | - [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 106 | - make.top.mas_equalTo(weakSelf.view).offset(kNavigationBarHeight+44); | ||
| 107 | - make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 108 | - }]; | 105 | +// __weak typeof(self) weakSelf = self; |
| 106 | +// [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 107 | +// make.top.mas_equalTo(weakSelf.view).offset(kNavigationBarHeight+44); | ||
| 108 | +// make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 109 | +// }]; | ||
| 109 | } | 110 | } |
| 110 | -(void)initSubviews | 111 | -(void)initSubviews |
| 111 | { | 112 | { |
| @@ -114,7 +115,18 @@ | @@ -114,7 +115,18 @@ | ||
| 114 | -(void)layoutTableView | 115 | -(void)layoutTableView |
| 115 | { | 116 | { |
| 116 | [super layoutTableView]; | 117 | [super layoutTableView]; |
| 117 | - | 118 | + if (self.showType == CNLiveCommuntListShowTypePayCost) { |
| 119 | + self.tableView.estimatedRowHeight = 0; | ||
| 120 | + self.tableView.estimatedSectionFooterHeight = 0; | ||
| 121 | + self.tableView.estimatedSectionHeaderHeight = 0; | ||
| 122 | + self.tableView.frame = CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight); | ||
| 123 | + }else{ | ||
| 124 | + __weak typeof(self) weakSelf = self; | ||
| 125 | + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 126 | + make.top.mas_equalTo(weakSelf.view).offset(kNavigationBarHeight+44); | ||
| 127 | + make.left.right.bottom.mas_equalTo(weakSelf.view); | ||
| 128 | + }]; | ||
| 129 | + } | ||
| 118 | } | 130 | } |
| 119 | -(void)dealloc | 131 | -(void)dealloc |
| 120 | { | 132 | { |
CNLiveCommuntyModule/Classes/ViewController/CNLiveCommuntPaycostViewController.m
| @@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
| 12 | @property (nonatomic, strong) CNLiveCommuntyActivityPaycostListModel * detailModel; | 12 | @property (nonatomic, strong) CNLiveCommuntyActivityPaycostListModel * detailModel; |
| 13 | @property (nonatomic, copy) NSString * payCostId; | 13 | @property (nonatomic, copy) NSString * payCostId; |
| 14 | @property (nonatomic, strong) NSMutableArray * dataArray; | 14 | @property (nonatomic, strong) NSMutableArray * dataArray; |
| 15 | +@property (nonatomic, strong) UIView * footerView; | ||
| 15 | @end | 16 | @end |
| 16 | 17 | ||
| 17 | @implementation CNLiveCommuntPaycostViewController | 18 | @implementation CNLiveCommuntPaycostViewController |
| @@ -19,20 +20,28 @@ | @@ -19,20 +20,28 @@ | ||
| 19 | { | 20 | { |
| 20 | self = [super init]; | 21 | self = [super init]; |
| 21 | if (self) { | 22 | if (self) { |
| 22 | - self.dataArray = [[NSMutableArray alloc] init]; | ||
| 23 | _payCostId = payCostId; | 23 | _payCostId = payCostId; |
| 24 | } | 24 | } |
| 25 | return self; | 25 | return self; |
| 26 | } | 26 | } |
| 27 | +-(void)viewWillAppear:(BOOL)animated | ||
| 28 | +{ | ||
| 29 | + [super viewWillAppear:animated]; | ||
| 30 | + [self loadData]; | ||
| 31 | +} | ||
| 27 | - (void)viewDidLoad { | 32 | - (void)viewDidLoad { |
| 28 | [super viewDidLoad]; | 33 | [super viewDidLoad]; |
| 29 | // Do any additional setup after loading the view. | 34 | // Do any additional setup after loading the view. |
| 30 | self.view.backgroundColor = UIColorHex(#F9F9F9); | 35 | self.view.backgroundColor = UIColorHex(#F9F9F9); |
| 36 | + self.dataArray = [[NSMutableArray alloc] init]; | ||
| 31 | self.title = @"物业费"; | 37 | self.title = @"物业费"; |
| 32 | - | 38 | +} |
| 39 | +-(void)loadData | ||
| 40 | +{ | ||
| 33 | __weak typeof(self) weakSelf = self; | 41 | __weak typeof(self) weakSelf = self; |
| 34 | [CNLiveCommuntViewModel requestWithCommuntyPayCostDetailMentPaycostId:self.payCostId CompleterBlock:^(CNLiveCommuntyActivityPaycostListModel * _Nonnull detailModel) { | 42 | [CNLiveCommuntViewModel requestWithCommuntyPayCostDetailMentPaycostId:self.payCostId CompleterBlock:^(CNLiveCommuntyActivityPaycostListModel * _Nonnull detailModel) { |
| 35 | weakSelf.detailModel = detailModel; | 43 | weakSelf.detailModel = detailModel; |
| 44 | + [weakSelf.dataArray removeAllObjects]; | ||
| 36 | [weakSelf.view addSubview:[weakSelf setTableViewFooterView:[NSString stringWithFormat:@"(¥%@)",detailModel.totalFee] isStatus:[detailModel.payStatus isEqualToString:@"1"]]]; | 45 | [weakSelf.view addSubview:[weakSelf setTableViewFooterView:[NSString stringWithFormat:@"(¥%@)",detailModel.totalFee] isStatus:[detailModel.payStatus isEqualToString:@"1"]]]; |
| 37 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | 46 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; |
| 38 | [dateFormatter setDateFormat:@"yyyy/MM"]; | 47 | [dateFormatter setDateFormat:@"yyyy/MM"]; |
| @@ -53,7 +62,6 @@ | @@ -53,7 +62,6 @@ | ||
| 53 | [weakSelf.tableView reloadData]; | 62 | [weakSelf.tableView reloadData]; |
| 54 | }]; | 63 | }]; |
| 55 | } | 64 | } |
| 56 | - | ||
| 57 | - (void)initTableView | 65 | - (void)initTableView |
| 58 | { | 66 | { |
| 59 | [super initTableView]; | 67 | [super initTableView]; |
| @@ -72,8 +80,9 @@ | @@ -72,8 +80,9 @@ | ||
| 72 | 80 | ||
| 73 | self.tableView.contentInset = UIEdgeInsetsMake(kNavigationBarHeight, 0, [nb_info isNotBlank]?(isStatus?30:90):0, 0); | 81 | self.tableView.contentInset = UIEdgeInsetsMake(kNavigationBarHeight, 0, [nb_info isNotBlank]?(isStatus?30:90):0, 0); |
| 74 | 82 | ||
| 75 | - UIView * footerView = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenHeight - ([nb_info isNotBlank]?(isStatus?30:90):0), kScreenWidth, [nb_info isNotBlank]?(isStatus?30:90):0)]; | ||
| 76 | - footerView.backgroundColor = [UIColor whiteColor]; | 83 | + [self.footerView removeFromSuperview]; |
| 84 | + self.footerView = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenHeight - ([nb_info isNotBlank]?(isStatus?30:90):0) - kVerticalBottomSafeHeight, kScreenWidth, [nb_info isNotBlank]?(isStatus?30:90):0 + kVerticalBottomSafeHeight)]; | ||
| 85 | + self.footerView.backgroundColor = [UIColor whiteColor]; | ||
| 77 | 86 | ||
| 78 | if ([nb_info isNotBlank]) { | 87 | if ([nb_info isNotBlank]) { |
| 79 | CNLiveCommuntyHomeListModel * listModel = [CNLiveCommuntyHomeListModel mj_objectWithKeyValues:nb_info]; | 88 | CNLiveCommuntyHomeListModel * listModel = [CNLiveCommuntyHomeListModel mj_objectWithKeyValues:nb_info]; |
| @@ -103,12 +112,12 @@ | @@ -103,12 +112,12 @@ | ||
| 103 | [[self displayViewController] presentViewController:alert animated:YES completion:nil]; | 112 | [[self displayViewController] presentViewController:alert animated:YES completion:nil]; |
| 104 | }]; | 113 | }]; |
| 105 | phoneLabel.attributedText = textAttributedString; | 114 | phoneLabel.attributedText = textAttributedString; |
| 106 | - [footerView addSubview:phoneLabel]; | 115 | + [self.footerView addSubview:phoneLabel]; |
| 107 | 116 | ||
| 108 | UILabel * lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 30, kScreenWidth - 20, 0.5)]; | 117 | UILabel * lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 30, kScreenWidth - 20, 0.5)]; |
| 109 | lineLabel.backgroundColor = UIColorHex(#E6E6E6); | 118 | lineLabel.backgroundColor = UIColorHex(#E6E6E6); |
| 110 | lineLabel.hidden = isStatus; | 119 | lineLabel.hidden = isStatus; |
| 111 | - [footerView addSubview:lineLabel]; | 120 | + [self.footerView addSubview:lineLabel]; |
| 112 | } | 121 | } |
| 113 | 122 | ||
| 114 | UIButton * submitBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | 123 | UIButton * submitBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| @@ -116,13 +125,14 @@ | @@ -116,13 +125,14 @@ | ||
| 116 | submitBtn.frame = CGRectMake(10, [nb_info isNotBlank]?40:20, kScreenWidth - 20, isStatus?0:40); | 125 | submitBtn.frame = CGRectMake(10, [nb_info isNotBlank]?40:20, kScreenWidth - 20, isStatus?0:40); |
| 117 | submitBtn.layer.cornerRadius = 20; | 126 | submitBtn.layer.cornerRadius = 20; |
| 118 | submitBtn.layer.masksToBounds = YES; | 127 | submitBtn.layer.masksToBounds = YES; |
| 128 | + submitBtn.hidden = isStatus; | ||
| 119 | [submitBtn setTitle:[NSString stringWithFormat:@"立即缴费%@",priceString] forState:UIControlStateNormal]; | 129 | [submitBtn setTitle:[NSString stringWithFormat:@"立即缴费%@",priceString] forState:UIControlStateNormal]; |
| 120 | submitBtn.titleLabel.font = [UIFont systemFontOfSize:16]; | 130 | submitBtn.titleLabel.font = [UIFont systemFontOfSize:16]; |
| 121 | submitBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16]; | 131 | submitBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16]; |
| 122 | [submitBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | 132 | [submitBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
| 123 | [submitBtn addTarget:self action:@selector(submitRequestAction:) forControlEvents:UIControlEventTouchUpInside]; | 133 | [submitBtn addTarget:self action:@selector(submitRequestAction:) forControlEvents:UIControlEventTouchUpInside]; |
| 124 | - [footerView addSubview:submitBtn]; | ||
| 125 | - return footerView; | 134 | + [self.footerView addSubview:submitBtn]; |
| 135 | + return self.footerView; | ||
| 126 | } | 136 | } |
| 127 | -(void)submitRequestAction:(UIButton *)button | 137 | -(void)submitRequestAction:(UIButton *)button |
| 128 | { | 138 | { |