Commit 0533b5e2 by xuning

订单详情

parent c7852c20
......@@ -33,8 +33,6 @@
799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0E12B6BDA1300680907 /* BRPlaceholderTextView.m */; };
799DF0F82B6BDA1400680907 /* NSString+Unicode.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0E42B6BDA1300680907 /* NSString+Unicode.m */; };
799DF0F92B6BDA1400680907 /* UINavigationController+FDFullscreenPopGesture.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0E82B6BDA1300680907 /* UINavigationController+FDFullscreenPopGesture.m */; };
799DF0FB2B6BDA1400680907 /* WRNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0ED2B6BDA1300680907 /* WRNavigationBar.m */; };
799DF0FC2B6BDA1400680907 /* WRCustomNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0F02B6BDA1300680907 /* WRCustomNavigationBar.m */; };
799DF1042B6D220300680907 /* XVBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF1032B6D220300680907 /* XVBaseViewController.m */; };
799DF1072B6D224000680907 /* XVNaviViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF1062B6D224000680907 /* XVNaviViewController.m */; };
799DF10F2B6D25B400680907 /* UINavigation+SXFixSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF10C2B6D25B400680907 /* UINavigation+SXFixSpace.m */; };
......@@ -46,6 +44,7 @@
79DC8B752B74B69600DBD8EA /* XVOrderDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B742B74B69600DBD8EA /* XVOrderDetailsViewController.m */; };
79DC8B782B74B78A00DBD8EA /* XVOrderInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B772B74B78A00DBD8EA /* XVOrderInfoViewController.m */; };
79DC8B7B2B7AF42800DBD8EA /* XVOrderInfoTopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B7A2B7AF42800DBD8EA /* XVOrderInfoTopView.m */; };
79DC8B7E2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B7D2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m */; };
FA5E55D5A48FDC04BA4CCD08 /* Pods_fastservice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08D109EE60B32403F3655A70 /* Pods_fastservice.framework */; };
/* End PBXBuildFile section */
......@@ -104,10 +103,6 @@
799DF0E52B6BDA1300680907 /* NSString+Unicode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Unicode.h"; sourceTree = "<group>"; };
799DF0E72B6BDA1300680907 /* UINavigationController+FDFullscreenPopGesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+FDFullscreenPopGesture.h"; sourceTree = "<group>"; };
799DF0E82B6BDA1300680907 /* UINavigationController+FDFullscreenPopGesture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+FDFullscreenPopGesture.m"; sourceTree = "<group>"; };
799DF0ED2B6BDA1300680907 /* WRNavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WRNavigationBar.m; sourceTree = "<group>"; };
799DF0EE2B6BDA1300680907 /* WRCustomNavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WRCustomNavigationBar.h; sourceTree = "<group>"; };
799DF0EF2B6BDA1300680907 /* WRNavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WRNavigationBar.h; sourceTree = "<group>"; };
799DF0F02B6BDA1300680907 /* WRCustomNavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WRCustomNavigationBar.m; sourceTree = "<group>"; };
799DF0FF2B6BDA2500680907 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; };
799DF1022B6D220300680907 /* XVBaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVBaseViewController.h; sourceTree = "<group>"; };
799DF1032B6D220300680907 /* XVBaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVBaseViewController.m; sourceTree = "<group>"; };
......@@ -131,6 +126,8 @@
79DC8B772B74B78A00DBD8EA /* XVOrderInfoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVOrderInfoViewController.m; sourceTree = "<group>"; };
79DC8B792B7AF42800DBD8EA /* XVOrderInfoTopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVOrderInfoTopView.h; sourceTree = "<group>"; };
79DC8B7A2B7AF42800DBD8EA /* XVOrderInfoTopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVOrderInfoTopView.m; sourceTree = "<group>"; };
79DC8B7C2B88DC3B00DBD8EA /* XVOrderInfoViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVOrderInfoViewCell.h; sourceTree = "<group>"; };
79DC8B7D2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVOrderInfoViewCell.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -203,6 +200,8 @@
7981EAFB2B71272D00F357E7 /* XVNewJobViewCell.m */,
79DC8B792B7AF42800DBD8EA /* XVOrderInfoTopView.h */,
79DC8B7A2B7AF42800DBD8EA /* XVOrderInfoTopView.m */,
79DC8B7C2B88DC3B00DBD8EA /* XVOrderInfoViewCell.h */,
79DC8B7D2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m */,
);
path = View;
sourceTree = "<group>";
......@@ -328,7 +327,6 @@
799DF1082B6D25B400680907 /* UINavigation+SXFixSpace */,
799DF0E32B6BDA1300680907 /* NSString+Unicode */,
799DF0E62B6BDA1300680907 /* FDFullscreenPopGesture */,
799DF0EC2B6BDA1300680907 /* WRNavigationBar */,
);
path = Libs;
sourceTree = "<group>";
......@@ -351,17 +349,6 @@
path = FDFullscreenPopGesture;
sourceTree = "<group>";
};
799DF0EC2B6BDA1300680907 /* WRNavigationBar */ = {
isa = PBXGroup;
children = (
799DF0ED2B6BDA1300680907 /* WRNavigationBar.m */,
799DF0EE2B6BDA1300680907 /* WRCustomNavigationBar.h */,
799DF0EF2B6BDA1300680907 /* WRNavigationBar.h */,
799DF0F02B6BDA1300680907 /* WRCustomNavigationBar.m */,
);
path = WRNavigationBar;
sourceTree = "<group>";
};
799DF0F12B6BDA1400680907 /* Base */ = {
isa = PBXGroup;
children = (
......@@ -572,6 +559,7 @@
79DC8B782B74B78A00DBD8EA /* XVOrderInfoViewController.m in Sources */,
7981EABD2B6E675F00F357E7 /* NSString+XVAdd.m in Sources */,
799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */,
79DC8B7E2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m in Sources */,
79DC8B722B74B3EC00DBD8EA /* XVOrderSettingViewController.m in Sources */,
7981EB082B73BB2C00F357E7 /* XVPersonalHeaderView.m in Sources */,
7981EAF02B6FC07800F357E7 /* XVCategoryTitleCellModel.m in Sources */,
......@@ -587,13 +575,11 @@
7981EAFC2B71272D00F357E7 /* XVNewJobViewCell.m in Sources */,
799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */,
7981EAED2B6FC05B00F357E7 /* XVCategoryTitleView.m in Sources */,
799DF0FB2B6BDA1400680907 /* WRNavigationBar.m in Sources */,
799DF1102B6D25B400680907 /* UIBarButtonItem+SXCreate.m in Sources */,
799DF10F2B6D25B400680907 /* UINavigation+SXFixSpace.m in Sources */,
7981EB0B2B73BC1500F357E7 /* XVPersonalViewCell.m in Sources */,
799DF0F92B6BDA1400680907 /* UINavigationController+FDFullscreenPopGesture.m in Sources */,
799DF1072B6D224000680907 /* XVNaviViewController.m in Sources */,
799DF0FC2B6BDA1400680907 /* WRCustomNavigationBar.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -37,7 +37,7 @@
self.window.rootViewController = navi;
self.window.backgroundColor = [UIColor redColor];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
......
......@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface XVBaseViewController : UIViewController<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource,DZNEmptyDataSetDelegate>
@property (nonatomic, strong) UITableView *tableView;
- (void)setNavigationBarsetBackgroundColor:(UIColor *)color;
@end
......
......@@ -20,16 +20,39 @@
self.edgesForExtendedLayout = UIRectEdgeNone;
self.view.backgroundColor = DEFAULT_BACKGROUND_COLOR;
[self setNavigationBarsetBackgroundColor:[UIColor whiteColor]];
//ctrl + i 格式化
// 设置导航栏默认的背景颜色
[self wr_setNavBarBarTintColor:[UIColor whiteColor]];
// 设置导航栏标题默认颜色
[self wr_setNavBarTitleColor:[UIColor blackColor]];
[self wr_setStatusBarStyle:UIStatusBarStyleDefault];
// 如果需要设置导航栏底部分割线隐藏,可以在这里统一设置
[self wr_setNavBarShadowImageHidden:YES];
}
- (void)setNavigationBarsetBackgroundColor:(UIColor *)color {
if(@available(iOS 15.0, *)) {
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
appearance.backgroundImage = [UIImage imageWithColor:color];// 图片
appearance.backgroundColor = color;// 背景色
appearance.shadowColor = UIColor.clearColor; // 阴影
self.navigationController.navigationBar.standardAppearance = appearance;
self.navigationController.navigationBar.scrollEdgeAppearance = appearance;
}else{
// Fallback on earlier versions
self.navigationController.navigationBar.translucent = NO;
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageWithColor:color] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[UIImage imageWithColor:color]];
}
}
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
return [UIImage imageNamed:@"nodata_图标"];
}
......@@ -47,21 +70,5 @@
return YES;
}
- (UITableView *)tableView {
if (_tableView == nil) {
_tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.emptyDataSetSource = self;
_tableView.emptyDataSetDelegate = self;
_tableView.tableFooterView = [UIView new];
_tableView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 100;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
return _tableView;
}
@end
......@@ -38,6 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface UILabel (XVAdd)
/**
便利构造函数
......
......@@ -28,7 +28,8 @@
return NO;
}
+ (CGFloat)navBarBottom {
return [self isIphoneX] ? 88 : 64;
return [self isIphoneX] ? [self statusBarHeight] + 44 : 64;
}
+ (CGFloat)tabBarHeight {
return [self isIphoneX] ? 83 : 49;
......@@ -39,6 +40,9 @@
+ (CGFloat)screenHeight {
return [UIScreen mainScreen].bounds.size.height;
}
+ (CGFloat)statusBarHeight {
return [[UIApplication sharedApplication] statusBarFrame].size.height;
}
@end
......
......@@ -45,7 +45,8 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self wr_setNavBarBarTintColor:COLOR_THEMEGRENN];
[self setNavigationBarsetBackgroundColor:COLOR_THEMEGRENN];
self.view.backgroundColor = COLOR_THEMEGRENN;
[self setupUI];
......
......@@ -17,6 +17,7 @@
@property (nonatomic, strong) XVJobStatusToolView *toolView;
@property (nonatomic, strong) UITableView *tableView;
@end
......@@ -33,11 +34,6 @@
[super viewDidLoad];
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 100;
self.tableView.estimatedSectionFooterHeight = 0;
self.tableView.estimatedSectionHeaderHeight = 0;
[self.tableView registerClass:[XVNewJobViewCell class] forCellReuseIdentifier:@"XVNewJobViewCell"];
[self setupUI];
}
......@@ -121,4 +117,27 @@
return _toolView;
}
- (UITableView *)tableView {
if (_tableView == nil) {
_tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.emptyDataSetSource = self;
_tableView.emptyDataSetDelegate = self;
_tableView.tableFooterView = [UIView new];
_tableView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 100;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.estimatedSectionFooterHeight = 0;
_tableView.estimatedSectionHeaderHeight = 0;
[_tableView registerClass:[XVNewJobViewCell class] forCellReuseIdentifier:@"XVNewJobViewCell"];
}
return _tableView;
}
@end
......@@ -21,16 +21,16 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor greenColor];
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.infoVc.view];
self.infoVc.view.frame = CGRectMake(0, 361, SCREEN_WIDTH, SCREEN_HEIGHT);
self.infoVc.view.frame = CGRectMake(0, 361, SCREEN_WIDTH, SCREEN_HEIGHT-KTOP_HEIGHT);
[self.view addSubview:self.infoVc.view];
[self addChildViewController:self.infoVc];
self.infoVc.scrollView.scrollEnabled = NO;
......
......@@ -13,7 +13,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface XVOrderInfoViewController : XVBaseViewController
@property (nonatomic, strong) UIScrollView *scrollView;
//- (void)resetScrollViewUserEnabled:(BOOL)enabled;
@end
......
......@@ -8,6 +8,7 @@
#import "XVOrderInfoViewController.h"
#import "XVOrderInfoTopView.h"
#import "XVOrderInfoViewCell.h"
#define ORIGIN_Y_MIN 0
#define ORIGIN_Y_MID 180
......@@ -15,13 +16,10 @@
@interface XVOrderInfoViewController ()<UIGestureRecognizerDelegate>
@property (nonatomic, assign) NSInteger lastPos;
@property (nonatomic,assign) BOOL isDelay;
@property (nonatomic, strong) XVOrderInfoTopView *topView;
@property (nonatomic, strong) UITableView *tableView;
@end
......@@ -29,82 +27,15 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [[UIColor whiteColor]colorWithAlphaComponent:0];
[self setupUI];
//
// UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(handlePan:)];
// pan.delegate = self;
// [self.view addGestureRecognizer:pan];
}
- (void)handlePan:(UIPanGestureRecognizer *)pan {
UIView *view = pan.view;
CGPoint offset = [pan translationInView:self.view];
if(offset.y > 0 && self.view.top == 361) {
return;
}
if(view.top <= 0) {
view.top = 0;
}else{
view.top += offset.y;
}
Log(@"%f===%ld",view.top,(long)pan.state);
if(pan.state == UIGestureRecognizerStateEnded) {
if(view.top <= 90) {
[UIView animateWithDuration:0.3 animations:^{
view.top = 0;
} completion:^(BOOL finished) {
self.scrollView.contentOffset = CGPointMake(0, 0);
self.scrollView.scrollEnabled = YES;
}];
}else if(view.top <= 270 && view.top > 90) {
[UIView animateWithDuration:0.3 animations:^{
view.top = 180;
} completion:^(BOOL finished) {
self.scrollView.contentOffset = CGPointMake(0, 0);
self.scrollView.scrollEnabled = NO;
}];
}else if(view.top > 270) {
[UIView animateWithDuration:0.3 animations:^{
view.top = 361;
} completion:^(BOOL finished) {
self.scrollView.contentOffset = CGPointMake(0, 0);
self.scrollView.scrollEnabled = NO;
}];
}
}
[pan setTranslation:CGPointZero inView:view];
}
// 实现UIGestureRecognizerDelegate代理方法,返回YES表示支持多个手势同时触发,否则不允许多个手势同时触发
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
if ([otherGestureRecognizer.view isKindOfClass:[UIScrollView class]]) {
UIScrollView *tab = (UIScrollView *)[otherGestureRecognizer view];
CGPoint vel = [tab.panGestureRecognizer velocityInView:tab];
if (vel.y > 0) {
// 下拉 , 只有当contentOffset.y为0时才允许多手势同时触发
CGPoint Point= tab.contentOffset;
return Point.y == 0;
}else{
// 上拉
return NO;
}
}
return NO;
}
- (void)setupUI {
[self.view addSubview:self.scrollView];
self.scrollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
self.scrollView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-KTOP_HEIGHT);
[self.scrollView addSubview:self.topView];
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
......@@ -112,18 +43,13 @@
make.top.mas_equalTo(self.scrollView);
}];
self.tableView.rowHeight = 44;
self.tableView.scrollEnabled = NO;
self.tableView.estimatedSectionFooterHeight = 0;
self.tableView.estimatedSectionHeaderHeight = 0;
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"UITableViewCell"];
[self.scrollView addSubview:self.tableView];
[self.tableView layoutIfNeeded];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.topView.mas_bottom);
make.left.right.mas_equalTo(self.view);
make.height.mas_equalTo(10*44);
make.height.mas_equalTo(self.tableView.contentSize.height);
make.bottom.mas_equalTo(self.scrollView);
}];
......@@ -131,13 +57,16 @@
}
#pragma mark - TableViewDelegate & Datasource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 10;
}
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"];
cell.backgroundColor = kRandomColor;
XVOrderInfoViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"XVOrderInfoViewCell"];
cell.backgroundColor = [UIColor whiteColor];
return cell;
}
......@@ -145,26 +74,43 @@
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 54;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView *v = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 54)];
UILabel *label = [[UILabel alloc]initWithText:@"订单信息" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:18];
label.font = [UIFont boldSystemFontOfSize:18];
label.frame = CGRectMake(25, 20, SCREEN_WIDTH-40, 25);
[v addSubview:label];
v.backgroundColor = [UIColor whiteColor];
return v;
- (void)scrollContentAnimateWithOriginY:(CGFloat)originY{
if (self.view.top == originY) {
return;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
if(section == 2) {
return CGFLOAT_MIN;
}else{
return 1;
}
//dampingRatio(阻尼系数)
//velocity (弹性速率)
[UIView animateWithDuration:0.5 delay:0 usingSpringWithDamping:1 initialSpringVelocity:0 options:0 animations:^{
self.view.top = originY;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView *v = [[UIView alloc]initWithFrame:CGRectMake(22, 0, SCREEN_WIDTH-44, 1)];
v.backgroundColor = kHexRGB(0xEEEEEE);
return v;
} completion:^(BOOL finished) {
}];
}
- (UIScrollView *)scrollView {
if(_scrollView == nil) {
_scrollView = [[UIScrollView alloc]init];
// _scrollView.backgroundColor = kRandomColor;
// _scrollView.alwaysBounceVertical = YES;
_scrollView.backgroundColor = [[UIColor whiteColor]colorWithAlphaComponent:0];
}
return _scrollView;
......@@ -178,4 +124,25 @@
return _topView;
}
- (UITableView *)tableView {
if (_tableView == nil) {
_tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.emptyDataSetSource = self;
_tableView.emptyDataSetDelegate = self;
_tableView.tableFooterView = [UIView new];
_tableView.backgroundColor = [UIColor whiteColor];
_tableView.scrollEnabled = NO;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.estimatedRowHeight = 0;
_tableView.estimatedSectionFooterHeight = 0;
_tableView.estimatedSectionHeaderHeight = 0;
[_tableView registerClass:[XVOrderInfoViewCell class] forCellReuseIdentifier:@"XVOrderInfoViewCell"];
}
return _tableView;
}
@end
//
// XVOrderInfoViewCell.h
// fastservice
//
// Created by xuning on 2/23/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVOrderInfoViewCell : UITableViewCell
@end
NS_ASSUME_NONNULL_END
//
// XVOrderInfoViewCell.m
// fastservice
//
// Created by xuning on 2/23/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "XVOrderInfoViewCell.h"
#import "XVLabel.h"
@interface XVOrderInfoViewCell()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *detailLabel;
@end
@implementation XVOrderInfoViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self setupUI];
}
return self;
}
- (void)setupUI {
self.contentView.backgroundColor = [UIColor whiteColor];
[self.contentView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.contentView).mas_offset(0);
make.left.mas_equalTo(self.contentView).mas_offset(26);
make.height.mas_equalTo(44);
// make.bottom.mas_equalTo(self.contentView).mas_offset(-3.5);
}];
[self.contentView addSubview:self.detailLabel];
[self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.contentView).mas_offset(0);
make.right.mas_equalTo(self.contentView).mas_offset(-20);
make.left.mas_equalTo(self.titleLabel.mas_right).mas_offset(27);
make.bottom.mas_equalTo(self.contentView).mas_offset(0);
}];
}
- (UILabel *)titleLabel {
if(_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"标题" textColor:kHexRGB(0x606060) textAlignment:(NSTextAlignmentLeft) fontSize:16];
}
return _titleLabel;
}
- (UILabel *)detailLabel {
if(_detailLabel == nil) {
_detailLabel = [[UILabel alloc]init];
_detailLabel.text = @"副标题";
_detailLabel.textColor = kHexRGB(0x606060);
_detailLabel.textAlignment = NSTextAlignmentRight;
_detailLabel.font = [UIFont systemFontOfSize:16];
_detailLabel.numberOfLines = 0;
_detailLabel.lineBreakMode = NSLineBreakByWordWrapping;
[_detailLabel sizeToFit];
}
return _detailLabel;
}
@end
......@@ -25,7 +25,7 @@
@property (nonatomic, strong) NSArray *dataArray;
@property (nonatomic, strong) UITableView *tableView;
@end
......@@ -38,11 +38,6 @@
}
- (void)setupUI {
[self.tableView registerClass:[XVPersonalViewCell class] forCellReuseIdentifier:@"XVPersonalViewCell"];
self.tableView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
self.tableView.rowHeight = 64;
self.tableView.tableHeaderView = self.headerView;
self.tableView.tableFooterView = self.footerView;
[self.view addSubview:self.userImageView];
[self.userImageView mas_makeConstraints:^(MASConstraintMaker *make) {
......@@ -141,5 +136,24 @@
}
return _dataArray;
}
- (UITableView *)tableView {
if (_tableView == nil) {
_tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[_tableView registerClass:[XVPersonalViewCell class] forCellReuseIdentifier:@"XVPersonalViewCell"];
_tableView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_tableView.rowHeight = 64;
_tableView.tableHeaderView = self.headerView;
_tableView.tableFooterView = self.footerView;
}
return _tableView;
}
@end
......@@ -16,7 +16,7 @@
#import <MBProgressHUD.h>
#import <Masonry.h>
#import <MJRefresh/MJRefresh.h>
#import "WRNavigationBar.h"
//#import "WRNavigationBar.h"
#import <LEEAlert.h>
#import "UINavigationController+FDFullscreenPopGesture.h"
#import "UINavigation+SXFixSpace.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment