123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- //
- // PayRecoderDetailViewController.m
- // 隐私保护
- //
- // Created by APPLE on 2023/8/29.
- //
- #import "PayRecoderDetailViewController.h"
- @interface PayRecoderDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
- @property (nonatomic, strong, nullable) UITableView *tableView;
- @end
- @implementation PayRecoderDetailViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- [self drawAnyView];
- }
- - (void)drawAnyView{
- [self.view setBackgroundColor:HWF5F7FAColor];
-
- [self.toolBar setHidden:YES];
- [self.navigationBar setHidden:YES];
- [self.navBarBGView setHidden:NO];
- [self.titleLabel setText:NSLocalizedString(@"buy_vip_buy_recoder_cell_buy_detaile",nil)];
-
- [self.view addSubview:self.tableView];
- [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(16);
- make.right.mas_equalTo(-16);
- make.bottom.mas_equalTo(0);
- make.top.equalTo(self.navBarBGView.mas_bottom).offset(4);
- }];
-
- [self.tableView setTableHeaderView:[self tableHeaderView]];
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- #pragma mark - 懒加载
- - (UITableView *)tableView{
- if (!_tableView) {
- _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStyleGrouped];
- _tableView.delegate = self;
- _tableView.dataSource = self;
- _tableView.showsVerticalScrollIndicator = NO;
- _tableView.showsHorizontalScrollIndicator = NO;
- // _tableView.contentInset = UIEdgeInsetsMake(-20, 0, 0, 0);
- [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
- [_tableView setSeparatorColor:[UIColor clearColor]];
- [_tableView setBackgroundColor:[UIColor clearColor]];
- [_tableView setTableFooterView:[UIView new]];
- [_tableView setBounces:YES];
- if (@available(iOS 15.0, *)) {
- _tableView.sectionHeaderTopPadding = 0;
- }
- }
-
- return _tableView;
- }
- #pragma mark - 列表委托
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return 5;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
-
- NSInteger row = indexPath.row;
- static NSString *identifier = @"BuyRecoderDetailCell";
-
- UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- if (!cell){
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
- [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
- [cell setBackgroundColor:[UIColor clearColor]];
- [cell setAccessoryType:(UITableViewCellAccessoryNone)];
- [cell.textLabel setTextColor:HW666666Color];
- [cell.textLabel setFont:[UIFont systemFontOfSize:12]];
-
- [cell.detailTextLabel setTextColor:HW0A132BColor];
- [cell.detailTextLabel setFont:[UIFont systemFontOfSize:12]];
- [cell.detailTextLabel setTextAlignment:(NSTextAlignmentRight)];
- [cell.contentView setBackgroundColor:HWFFFFFFColor];
- }
- cell.contentView.layer.mask = nil;
- if (0 == row){
- [cell.textLabel setText:NSLocalizedString(@"buy_vip_buy_recoder_detaile_buy_time",nil)];
- [cell.detailTextLabel setText:@"2023-12-12 19:00:00"];
- }else if (1 == row){
- [cell.textLabel setText:NSLocalizedString(@"buy_vip_buy_recoder_detaile_expect_time",nil)];
- [cell.detailTextLabel setText:@"2023-12-15 19:00:00"];
- }else if (2 == row){
- [cell.textLabel setText:NSLocalizedString(@"buy_vip_buy_recoder_detaile_order_number",nil)];
- [cell.detailTextLabel setText:@"okrs0m9gyyoYS39733673768"];
- }else if (3 == row){
- [cell.textLabel setText:NSLocalizedString(@"buy_vip_buy_recoder_detaile_pay_states",nil)];
- [cell.detailTextLabel setText:@"支付成功"];
- }else if (4 == row){
- [cell.textLabel setText:NSLocalizedString(@"buy_vip_buy_recoder_detaile_pay_type",nil)];
- [cell.detailTextLabel setText:@"支付宝"];
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W - 2*16.f, 35.f)
- byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
- cornerRadii:CGSizeMake(8, 8)];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = cell.contentView.bounds;
- maskLayer.path = maskPath.CGPath;
- cell.contentView.layer.mask = maskLayer;
- }
- return cell;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
- return 35;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
- [tableView deselectRowAtIndexPath:indexPath animated:YES];
-
- NSInteger row = indexPath.row;
- }
- - (UIView *)tableHeaderView{
- UIView *headView = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, SCREEN_W - 2*16.f, 52.f))];
- [headView setBackgroundColor:HWFFFFFFColor];
-
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W - 2*16.f, 52.f)
- byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
- cornerRadii:CGSizeMake(8, 8)];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = headView.bounds;
- maskLayer.path = maskPath.CGPath;
- headView.layer.mask = maskLayer;
-
- /*订单时间相关*/
- UILabel *vipTypeLabel = [[UILabel alloc] init];
- [vipTypeLabel setText:@"VIP30天"];
- [vipTypeLabel setFont:[UIFont boldSystemFontOfSize:16]];
- [vipTypeLabel setTextColor:HW0A132BColor];
- [headView addSubview:vipTypeLabel];
- [vipTypeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(14.f);
- make.top.mas_equalTo(16);
- }];
- /*价格标签*/
- NSString *leftStr3 = @"¥";
- NSString *rightStr3 = @"99.00";
- UILabel *priceLabel = [[UILabel alloc] init];
- [priceLabel setText:[leftStr3 stringByAppendingString:rightStr3]];
- [priceLabel setFont:[UIFont boldSystemFontOfSize:16]];
- [priceLabel setTextColor:HWDD4E4EColor];
- [priceLabel setTextAlignment:(NSTextAlignmentRight)];
- [headView addSubview:priceLabel];
- [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(-14.f);
- make.top.mas_equalTo(16);
- }];
-
- /*分割线*/
- UIView *line = [[UIView alloc] init];
- [line setBackgroundColor:HW979797Color10];
- [headView addSubview:line];
- [line mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(14.f);
- make.right.mas_equalTo(-14.f);
- make.height.mas_equalTo(1.f);
- make.bottom.mas_equalTo(0);
- }];
-
- return headView;
- }
- @end
|