Skip to content

Commit e631d3f

Browse files
committed
about & setup & pro_list
1 parent dc64309 commit e631d3f

5 files changed

Lines changed: 45 additions & 115 deletions

File tree

Coding_iOS/.DS_Store

2 KB
Binary file not shown.

Coding_iOS/Controllers/MeSetting/AboutViewController.m

Lines changed: 33 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,15 @@
77
//
88

99
#import "AboutViewController.h"
10+
#import "TitleDisclosureCell.h"
11+
#import "CodingShareView.h"
1012

11-
@interface AboutViewController ()
13+
@interface AboutViewController ()<UITableViewDataSource, UITableViewDelegate>
1214
@end
1315

1416
@implementation AboutViewController
1517

16-
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
17-
{
18-
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
19-
if (self) {
20-
// Custom initialization
21-
}
22-
return self;
23-
}
24-
25-
- (void)viewDidLoad
26-
{
18+
- (void)viewDidLoad{
2719
[super viewDidLoad];
2820
// Do any additional setup after loading the view.
2921
self.view.backgroundColor = kColorTableSectionBg;
@@ -99,62 +91,39 @@ - (void)viewDidLoad
9991
make.left.right.mas_equalTo(self.view);
10092
make.height.mas_equalTo(5*infoLabel.font.pointSize);
10193
}];
102-
103-
104-
105-
106-
// UILabel *infoLabel1 = [[UILabel alloc] init];
107-
// infoLabel1.numberOfLines = 0;
108-
// infoLabel1.backgroundColor = [UIColor clearColor];
109-
// infoLabel1.font = [UIFont systemFontOfSize:12];
110-
// infoLabel1.textColor = [UIColor colorWithHexString:@"0x666666"];
111-
// infoLabel1.textAlignment = NSTextAlignmentRight;
112-
// infoLabel1.text = [NSString stringWithFormat:@"官网:\nE-mail:\n微博:\n微信:"];
113-
// [self.view addSubview:infoLabel1];
114-
//
115-
// UILabel *infoLabel2 = [[UILabel alloc] init];
116-
// infoLabel2.numberOfLines = 0;
117-
// infoLabel2.backgroundColor = [UIColor clearColor];
118-
// infoLabel2.font = [UIFont systemFontOfSize:12];
119-
// infoLabel2.textColor = [UIColor colorWithHexString:@"0x666666"];
120-
// infoLabel2.textAlignment = NSTextAlignmentLeft;
121-
// infoLabel2.text = [NSString stringWithFormat:@"https://coding.net \[email protected] \nCoding \n扣钉Coding"];
122-
// [self.view addSubview:infoLabel2];
12394

95+
UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
96+
tableView.scrollEnabled = NO;
97+
tableView.backgroundColor = [UIColor clearColor];
98+
tableView.dataSource = self;
99+
tableView.delegate = self;
100+
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
101+
[tableView registerClass:[TitleDisclosureCell class] forCellReuseIdentifier:kCellIdentifier_TitleDisclosure];
102+
[self.view addSubview:tableView];
103+
[tableView mas_makeConstraints:^(MASConstraintMaker *make) {
104+
make.left.right.bottom.equalTo(self.view);
105+
make.top.equalTo(versionLabel.mas_bottom).offset(44);
106+
}];
107+
}
124108

125-
// UILabel *copyrightLabel = [[UILabel alloc] init];
126-
// copyrightLabel.font = [UIFont systemFontOfSize:12];
127-
// copyrightLabel.textColor = [UIColor colorWithHexString:@"0x666666"];
128-
// copyrightLabel.textAlignment = NSTextAlignmentCenter;
129-
// copyrightLabel.text = [NSString stringWithFormat:@"Copyright © 2015 Coding.net"];
130-
// [self.view addSubview:copyrightLabel];
131-
132-
// [infoLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
133-
// make.bottom.equalTo(copyrightLabel.mas_top).offset(-20);
134-
// make.left.mas_equalTo(self.view.mas_left);
135-
// make.right.equalTo(self.view.mas_centerX).offset(-20);
136-
// make.height.mas_equalTo(60);
137-
// }];
138-
//
139-
// [infoLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
140-
// make.bottom.equalTo(copyrightLabel.mas_top).offset(-20);
141-
// make.left.mas_equalTo(infoLabel1.mas_right);
142-
// make.right.equalTo(self.view.mas_right);
143-
// make.height.mas_equalTo(60);
144-
// }];
145-
146-
// [copyrightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
147-
// make.bottom.equalTo(self.view.mas_bottom).offset(-20);
148-
// make.left.right.equalTo(self.view);
149-
// make.height.mas_equalTo(20);
150-
// }];
151-
109+
#pragma mark Table
110+
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
111+
return 2;
152112
}
153113

154-
- (void)didReceiveMemoryWarning
155-
{
156-
[super didReceiveMemoryWarning];
157-
// Dispose of any resources that can be recreated.
114+
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
115+
TitleDisclosureCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TitleDisclosure forIndexPath:indexPath];
116+
[cell setTitleStr:indexPath.row == 0? @"去评分": @"推荐 Coding"];
117+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
118+
return cell;
119+
}
120+
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
121+
[tableView deselectRowAtIndexPath:indexPath animated:YES];
122+
if (indexPath.row == 0) {//评分
123+
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:kAppReviewURL]];
124+
}else{//推荐 Coding
125+
[CodingShareView showShareViewWithObj:nil];
126+
}
158127
}
159128

160129
@end

Coding_iOS/Controllers/MeSetting/SettingViewController.m

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
#import "Login.h"
1313
#import "AppDelegate.h"
1414
#import "SettingAccountViewController.h"
15-
#import "AboutViewController.h"
16-
#import "EditTopicViewController.h"
17-
#import "CodingShareView.h"
18-
#import "WebViewController.h"
1915

2016
@interface SettingViewController ()<UITableViewDataSource, UITableViewDelegate>
2117
@property (strong, nonatomic) UITableView *myTableView;
@@ -55,35 +51,21 @@ - (UIView*)tableFooterView{
5551
return footerV;
5652
}
5753

58-
- (void)dealloc{
59-
_myTableView.delegate = nil;
60-
_myTableView.dataSource = nil;
61-
}
6254
#pragma mark TableM
63-
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
64-
return 4;
65-
}
55+
6656
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
67-
NSInteger row = (section == 1? 3:
68-
section == 3? 2:
69-
1);
70-
return row;
57+
return 2;
7158
}
7259

7360
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
7461
UITableViewCell *cell;
75-
if (indexPath.section == 2) {
76-
cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TitleValueMore forIndexPath:indexPath];
77-
[(TitleValueMoreCell *)cell setTitleStr:@"清除缓存" valueStr:[self p_diskCacheSizeStr]];
78-
}else{
62+
if (indexPath.row == 0) {
7963
cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TitleDisclosure forIndexPath:indexPath];
64+
[(TitleDisclosureCell *)cell setTitleStr:@"账号设置"];
8065

81-
NSString *titleStr = (indexPath.section == 0? @"账号设置":
82-
indexPath.section == 1? (indexPath.row == 0? @"意见反馈":
83-
indexPath.row == 1? @"去评分":
84-
@"推荐 Coding"):
85-
indexPath.row == 0? @"帮助中心": @"关于Coding");
86-
[(TitleDisclosureCell *)cell setTitleStr:titleStr];
66+
}else{
67+
cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TitleValueMore forIndexPath:indexPath];
68+
[(TitleValueMoreCell *)cell setTitleStr:@"清除缓存" valueStr:[self p_diskCacheSizeStr]];
8769
}
8870
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
8971
return cell;
@@ -104,38 +86,16 @@ - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSIntege
10486

10587
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
10688
[tableView deselectRowAtIndexPath:indexPath animated:YES];
107-
108-
if (indexPath.section == 0) {//账号设置
89+
if (indexPath.row == 0) {
10990
SettingAccountViewController *vc = [[SettingAccountViewController alloc] init];
11091
[self.navigationController pushViewController:vc animated:YES];
111-
}else if (indexPath.section == 1){
112-
if (indexPath.row == 0) {//意见反馈
113-
EditTopicViewController *vc = [[EditTopicViewController alloc] init];
114-
vc.curProTopic = [ProjectTopic feedbackTopic];
115-
vc.type = TopicEditTypeFeedBack;
116-
vc.topicChangedBlock = nil;
117-
[self.navigationController pushViewController:vc animated:YES];
118-
}else if (indexPath.row == 1){//评分
119-
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:kAppReviewURL]];
120-
}else{//推荐 Coding
121-
[CodingShareView showShareViewWithObj:nil];
122-
}
123-
}else if (indexPath.section == 2){//清除缓存
92+
}else{
12493
__weak typeof(self) weakSelf = self;
12594
[[UIActionSheet bk_actionSheetCustomWithTitle:@"缓存数据有助于再次浏览或离线查看,你确定要清除缓存吗?" buttonTitles:nil destructiveTitle:@"确定清除" cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
12695
if (index == 0) {
12796
[weakSelf clearDiskCache];
12897
}
12998
}] showInView:self.view];
130-
}else{
131-
if (indexPath.row == 0) {//帮助中心
132-
WebViewController *webVc = [WebViewController webVCWithUrlStr:@"/help/doc/mobile/index.html"];
133-
[self.navigationController pushViewController:webVc animated:YES];
134-
}else{//关于
135-
AboutViewController *vc = [[AboutViewController alloc] init];
136-
[self.navigationController pushViewController:vc animated:YES];
137-
}
138-
13999
}
140100
}
141101

Coding_iOS/Controllers/ProjectListViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ @implementation ProjectListViewController
1212
- (void)viewDidLoad {
1313
[super viewDidLoad];
1414
// Do any additional setup after loading the view.
15-
self.title = _isFromMeRoot? @"我创建的": _curUser.name;
15+
self.title = _curUser.name;
1616
self.icarouselScrollEnabled = YES;
1717
}
1818

Coding_iOS/Views/Cell/MeRootServiceCell.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
7575
make.left.equalTo(_lineV.mas_right);
7676
}];
7777
[_proL mas_makeConstraints:^(MASConstraintMaker *make) {
78-
make.centerY.equalTo(@[_proTL, _lineV, _teamL, _teamTL]);
78+
make.centerY.equalTo(_lineV);
79+
make.baseline.equalTo(@[_proTL, _teamL, _teamTL]);
7980
make.right.equalTo(self.contentView.mas_right).multipliedBy(1.0/4);
8081
}];
8182
[_proTL mas_makeConstraints:^(MASConstraintMaker *make) {

0 commit comments

Comments
 (0)