ShopInfoVC.m 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //
  2. // ShopInfoVC.m
  3. // YBVideo
  4. //
  5. // Created by ybRRR on 2021/3/8.
  6. // Copyright © 2021 cat. All rights reserved.
  7. //
  8. #import "ShopInfoVC.h"
  9. #import "QualificationsVC.h"
  10. @interface ShopInfoVC ()<UITableViewDelegate, UITableViewDataSource>
  11. @property (nonatomic, strong)UITableView *shopTable;
  12. @end
  13. @implementation ShopInfoVC
  14. - (UIStatusBarStyle)preferredStatusBarStyle {
  15. if (@available(iOS 13.0,*)) {
  16. return UIStatusBarStyleDarkContent;
  17. }
  18. return UIStatusBarStyleDefault;
  19. }
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. self.titleL.text = YZMsg(@"小店详情");
  23. self.subNavi.backgroundColor = UIColor.whiteColor;
  24. self.titleL.textColor = UIColor.blackColor;
  25. [self.leftBtn setImage:[UIImage imageNamed:@"pub_back_black"] forState:0];
  26. self.naviLine.hidden = NO;
  27. self.naviLine.backgroundColor = RGB(245, 245, 245);
  28. [self.view addSubview:self.shopTable];
  29. }
  30. -(UITableView *)shopTable{
  31. if (!_shopTable) {
  32. _shopTable = [[UITableView alloc]initWithFrame:CGRectMake(0, 64+statusbarHeight, _window_width, _window_height-64-statusbarHeight) style:UITableViewStylePlain];
  33. _shopTable.delegate = self;
  34. _shopTable.dataSource = self;
  35. _shopTable.separatorStyle = UITableViewCellSeparatorStyleNone;
  36. _shopTable.backgroundColor = UIColor.whiteColor;
  37. _shopTable.tableFooterView = [UIView new];
  38. }
  39. return _shopTable;
  40. }
  41. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  42. {
  43. return 1;
  44. }
  45. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  46. {
  47. return 4;
  48. }
  49. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  50. {
  51. return 50;
  52. }
  53. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  54. {
  55. UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"shopcell"];
  56. cell.backgroundColor = UIColor.whiteColor;
  57. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  58. if (indexPath.row == 0) {
  59. cell.textLabel.text = YZMsg(@"基础信息");
  60. cell.textLabel.font = [UIFont systemFontOfSize:16];
  61. cell.textLabel.textColor = UIColor.blackColor;
  62. }else{
  63. cell.textLabel.font = [UIFont systemFontOfSize:14];
  64. cell.textLabel.textColor = UIColor.blackColor;
  65. UILabel *statuLb = [[UILabel alloc]init];
  66. statuLb.font = [UIFont systemFontOfSize:14];
  67. statuLb.textColor = [UIColor blackColor];
  68. [cell addSubview:statuLb];
  69. [statuLb mas_makeConstraints:^(MASConstraintMaker *make) {
  70. make.right.equalTo(cell).offset(-20);
  71. make.centerY.equalTo(cell);
  72. make.height.mas_equalTo(18);
  73. }];
  74. UIImageView *rightImg = [[UIImageView alloc]init];
  75. rightImg.image = [UIImage imageNamed:@"shop_right"];
  76. [cell addSubview:rightImg];
  77. [rightImg mas_makeConstraints:^(MASConstraintMaker *make) {
  78. make.left.equalTo(statuLb.mas_right).offset(2);
  79. make.centerY.equalTo(statuLb);
  80. make.width.height.mas_equalTo(15);
  81. }];
  82. if (indexPath.row == 1) {
  83. cell.textLabel.text =YZMsg(@"资质证明") ;
  84. statuLb.text = YZMsg(@"查看资质证明");
  85. rightImg.hidden = NO;
  86. }else if (indexPath.row == 2){
  87. cell.textLabel.text = YZMsg(@"实名认证");
  88. statuLb.text = YZMsg(@"已认证");
  89. rightImg.hidden = YES;
  90. }else{
  91. cell.textLabel.text = YZMsg(@"店铺保证金");
  92. statuLb.text = YZMsg(@"已缴纳");
  93. rightImg.hidden = YES;
  94. }
  95. }
  96. return cell;
  97. }
  98. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  99. {
  100. [tableView deselectRowAtIndexPath:indexPath animated:NO];
  101. if (indexPath.row == 1) {
  102. QualificationsVC *quaVC = [[QualificationsVC alloc]init];
  103. quaVC.infos = self.shopInfoDic;
  104. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:quaVC animated:YES];
  105. }
  106. }
  107. @end