Skip to content

Commit b525301

Browse files
committed
码币记录
1 parent b08c5ba commit b525301

12 files changed

Lines changed: 147 additions & 8 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@
368368
4EACB4411A2C448F0097ABB3 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EACB43E1A2C448F0097ABB3 /* [email protected] */; };
369369
4EACB4431A2C45300097ABB3 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EACB4421A2C45300097ABB3 /* [email protected] */; };
370370
4EACB4461A2C60110097ABB3 /* ProjectActivities.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EACB4451A2C60110097ABB3 /* ProjectActivities.m */; };
371+
4EAE068E1B78484D00179F4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE068D1B78484D00179F4B /* [email protected] */; };
372+
4EAE06901B784E9200179F4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE068F1B784E9200179F4B /* [email protected] */; };
371373
4EB0C2001A807ED00042FC4F /* NSURL+Common.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EB0C1FF1A807ED00042FC4F /* NSURL+Common.m */; };
372374
4EB845331AB83C3B0030DC69 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EB845301AB83C3B0030DC69 /* [email protected] */; };
373375
4EB845341AB83C3B0030DC69 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EB845311AB83C3B0030DC69 /* [email protected] */; };
@@ -1395,6 +1397,8 @@
13951397
4EACB4421A2C45300097ABB3 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
13961398
4EACB4441A2C60110097ABB3 /* ProjectActivities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectActivities.h; sourceTree = "<group>"; };
13971399
4EACB4451A2C60110097ABB3 /* ProjectActivities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectActivities.m; sourceTree = "<group>"; };
1400+
4EAE068D1B78484D00179F4B /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
1401+
4EAE068F1B784E9200179F4B /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
13981402
4EB0C1FE1A807ED00042FC4F /* NSURL+Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+Common.h"; sourceTree = "<group>"; };
13991403
4EB0C1FF1A807ED00042FC4F /* NSURL+Common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+Common.m"; sourceTree = "<group>"; };
14001404
4EB845301AB83C3B0030DC69 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
@@ -2717,6 +2721,7 @@
27172721
4E996BF91ABBF56A00C704F1 /* userInfo */ = {
27182722
isa = PBXGroup;
27192723
children = (
2724+
4EAE068D1B78484D00179F4B /* [email protected] */,
27202725
4E996BFA1ABBF56A00C704F1 /* [email protected] */,
27212726
4E996BFB1ABBF56A00C704F1 /* [email protected] */,
27222727
4E996BFC1ABBF56A00C704F1 /* [email protected] */,
@@ -3578,6 +3583,7 @@
35783583
4E095A811B6B24DE008DC439 /* [email protected] */,
35793584
4E095A821B6B24DE008DC439 /* [email protected] */,
35803585
4E62410A1B74D65400E1533C /* [email protected] */,
3586+
4EAE068F1B784E9200179F4B /* [email protected] */,
35813587
);
35823588
path = Images;
35833589
sourceTree = "<group>";
@@ -4324,6 +4330,7 @@
43244330
8E8F7B2E19EF6306006BA8BD /* [email protected] in Resources */,
43254331
8E8F7B3319EF6306006BA8BD /* [email protected] in Resources */,
43264332
4E6383D11B32665700D98648 /* [email protected] in Resources */,
4333+
4EAE068E1B78484D00179F4B /* [email protected] in Resources */,
43274334
4E9113AA1A1CB19900AC9431 /* [email protected] in Resources */,
43284335
4EF17EDA1B3C3112003CDD2D /* [email protected] in Resources */,
43294336
8E64ED8319ED0CE3006E99DA /* QBImagePickerController.strings in Resources */,
@@ -4372,6 +4379,7 @@
43724379
8E97CEBB1A0C7E26006F9AD7 /* [email protected] in Resources */,
43734380
8EA6D19F19E240C40076D59C /* [email protected] in Resources */,
43744381
4E996C041ABBF56A00C704F1 /* [email protected] in Resources */,
4382+
4EAE06901B784E9200179F4B /* [email protected] in Resources */,
43754383
4EF818161B049C89005F974B /* [email protected] in Resources */,
43764384
4ED673281A8E12F900DF2D1A /* [email protected] in Resources */,
43774385
4E07D30E1A4A9F45009EDDF2 /* [email protected] in Resources */,

Coding_iOS/Controllers/PointRecordsViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
106106
if (indexPath.row == 0) {
107107
PointRecord *record = [_curRecords.list firstObject];
108108
PointTopCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_PointTopCell forIndexPath:indexPath];
109-
cell.pointLeftStr = record.points_left.stringValue;
109+
cell.pointLeftStr = [NSString stringWithFormat:@"%.2f", record.points_left.floatValue];
110110
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:0 hasSectionLine:NO];
111111
return cell;
112112
}else{

Coding_iOS/Controllers/UserInfoViewController.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#import <APParallaxHeader/UIScrollView+APParallaxHeader.h>
3333

3434
#import "CSMyTopicVC.h"
35+
#import "PointRecordsViewController.h"
3536

3637
@interface UserInfoViewController ()<UITableViewDataSource, UITableViewDelegate>
3738
@property (strong, nonatomic) UITableView *myTableView;
@@ -139,7 +140,7 @@ - (UIView *)footerV{
139140

140141
#pragma mark Table M
141142
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
142-
return 3;
143+
return [self.curUser.global_key isEqualToString:[Login curLoginUser].global_key]? 4: 3;
143144
}
144145
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
145146
NSInteger row = 0;
@@ -149,6 +150,8 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
149150
row = 1;
150151
}else if (section == 2){
151152
row = 3;
153+
}else if (section == 3){
154+
row = 1;
152155
}
153156
return row;
154157
}
@@ -174,14 +177,16 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
174177
UserInfoIconCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_UserInfoIconCell forIndexPath:indexPath];
175178
if (indexPath.section == 1) {
176179
[cell setTitle:@"详细信息" icon:@"user_info_detail"];
177-
}else{
180+
}else if (indexPath.section == 2){
178181
if (indexPath.row == 0) {
179182
[cell setTitle:[self isMe]? @"我的项目": @"Ta的项目" icon:@"user_info_project"];
180183
}else if(indexPath.row == 1){
181184
[cell setTitle:[self isMe]? @"我的冒泡": @"Ta的冒泡" icon:@"user_info_tweet"];
182185
}else{
183186
[cell setTitle:[self isMe]? @"我的话题": @"Ta的话题" icon:@"user_info_topic"];
184187
}
188+
}else{
189+
[cell setTitle:@"我的码币" icon:@"user_info_point"];
185190
}
186191
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
187192
return cell;
@@ -226,6 +231,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
226231
}else{
227232
[self goToTopic];
228233
}
234+
}else if (indexPath.section == 3){
235+
[self goToPoint];
229236
}
230237
}
231238

@@ -288,6 +295,11 @@ - (void)goToTopic {
288295
[self.navigationController pushViewController:vc animated:YES];
289296
}
290297

298+
- (void)goToPoint{
299+
PointRecordsViewController *vc = [PointRecordsViewController new];
300+
[self.navigationController pushViewController:vc animated:YES];
301+
}
302+
291303
#pragma mark Nav
292304
- (void)settingBtnClicked:(id)sender{
293305
SettingViewController *vc = [[SettingViewController alloc] init];
3.43 KB
Loading
4.13 KB
Loading

Coding_iOS/Util/Manager/Coding_NetAPIManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ - (void)request_PointRecords:(PointRecords *)records andBlock:(void (^)(id data,
15671567
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:[records toPath] withParams:[records toParams] withMethodType:Get andBlock:^(id data, NSError *error) {
15681568
if (data) {
15691569
data = [data valueForKey:@"data"];
1570-
PointRecords *resultA = [NSObject objectOfClass:@"" fromJSON:data];
1570+
PointRecords *resultA = [NSObject objectOfClass:@"PointRecords" fromJSON:data];
15711571
block(resultA, nil);
15721572
}else{
15731573
block(nil, error);

Coding_iOS/Util/OC_Category/UILabel+Common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
- (void) setLongString:(NSString *)str withFitWidth:(CGFloat)width;
1414
- (void) setLongString:(NSString *)str withFitWidth:(CGFloat)width maxHeight:(CGFloat)maxHeight;
1515
- (void) setLongString:(NSString *)str withVariableWidth:(CGFloat)maxWidth;
16-
16+
+ (instancetype)labelWithFont:(UIFont *)font textColor:(UIColor *)textColor;
1717
@end

Coding_iOS/Util/OC_Category/UILabel+Common.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,11 @@ - (void) setLongString:(NSString *)str withVariableWidth:(CGFloat)maxWidth{
3636
[self setFrame:frame];
3737
}
3838

39+
+ (instancetype)labelWithFont:(UIFont *)font textColor:(UIColor *)textColor{
40+
UILabel *label = [self new];
41+
label.font = font;
42+
label.textColor = textColor;
43+
return label;
44+
}
45+
3946
@end

Coding_iOS/Views/Cell/PointRecordCell.m

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,53 @@
88

99
#import "PointRecordCell.h"
1010

11+
@interface PointRecordCell ()
12+
@property (strong, nonatomic) UILabel *usageL, *timeL, *pointsLeftL, *pointsChangeL;
13+
@end
14+
1115
@implementation PointRecordCell
1216
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
1317
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
1418
if (self) {
1519
// Initialization code
20+
self.backgroundColor = [UIColor clearColor];
21+
self.selectionStyle = UITableViewCellSelectionStyleNone;
22+
if (!_usageL) {
23+
_usageL = [UILabel labelWithFont:[UIFont systemFontOfSize:15] textColor:[UIColor colorWithHexString:@"0x222222"]];
24+
[self.contentView addSubview:_usageL];
25+
}
26+
if (!_timeL) {
27+
_timeL = [UILabel labelWithFont:[UIFont systemFontOfSize:12] textColor:[UIColor colorWithHexString:@"0x999999"]];
28+
[self.contentView addSubview:_timeL];
29+
}
30+
if (!_pointsLeftL) {
31+
_pointsLeftL = [UILabel labelWithFont:[UIFont systemFontOfSize:12] textColor:[UIColor colorWithHexString:@"0x999999"]];
32+
[self.contentView addSubview:_pointsLeftL];
33+
}
34+
if (!_pointsChangeL) {
35+
_pointsChangeL = [UILabel labelWithFont:[UIFont systemFontOfSize:15] textColor:[UIColor colorWithHexString:@"0x3bbd79"]];
36+
[self.contentView addSubview:_pointsChangeL];
37+
}
38+
[_usageL mas_makeConstraints:^(MASConstraintMaker *make) {
39+
make.left.equalTo(self.contentView).offset(kPaddingLeftWidth);
40+
make.top.equalTo(self.contentView).offset(10);
41+
make.height.mas_equalTo(25);
42+
}];
43+
[_timeL mas_makeConstraints:^(MASConstraintMaker *make) {
44+
make.right.equalTo(self.contentView).offset(-kPaddingLeftWidth);
45+
make.centerY.equalTo(_usageL);
46+
make.height.mas_equalTo(20);
47+
}];
48+
[_pointsLeftL mas_makeConstraints:^(MASConstraintMaker *make) {
49+
make.left.equalTo(self.contentView).offset(kPaddingLeftWidth);
50+
make.centerY.equalTo(_pointsChangeL);
51+
make.height.mas_equalTo(20);
52+
}];
53+
[_pointsChangeL mas_makeConstraints:^(MASConstraintMaker *make) {
54+
make.right.equalTo(self.contentView).offset(-kPaddingLeftWidth);
55+
make.bottom.equalTo(self.contentView).offset(-10);
56+
make.height.mas_equalTo(25);
57+
}];
1658
}
1759
return self;
1860
}
@@ -21,9 +63,12 @@ - (void)setCurRecord:(PointRecord *)curRecord{
2163
if (!_curRecord) {
2264
return;
2365
}
24-
66+
_usageL.text = _curRecord.usage;
67+
_timeL.text = [_curRecord.created_at stringWithFormat:@"yyyy-MM-dd hh:mm:ss"];
68+
_pointsLeftL.text = [NSString stringWithFormat:@"余额:%.2f", _curRecord.points_left.floatValue];
69+
_pointsChangeL.text = @"+0.02";
2570
}
2671
+ (CGFloat)cellHeight{
27-
return 44.0;
72+
return 75.0;
2873
}
2974
@end

0 commit comments

Comments
 (0)