Commit dfeb3f64e6ab10282d33fd26c9458a6676d558c1

Authored by liushiyu
1 parent d9d044b0

0.2.2

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