Commit ea559b8a authored by admin's avatar admin

评论数据目前为写死测试数据修改

parent b996770e
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 841D24FA1BEB75CA0005CC9F /* QuestionDetailFooterView.m */; }; 841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 841D24FA1BEB75CA0005CC9F /* QuestionDetailFooterView.m */; };
842547FC1BF03977006C79C5 /* QuestionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 842547FB1BF03977006C79C5 /* QuestionModel.m */; }; 842547FC1BF03977006C79C5 /* QuestionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 842547FB1BF03977006C79C5 /* QuestionModel.m */; };
8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */; }; 8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */; };
846206B51C06AF700015C456 /* RankListHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 846206B41C06AF700015C456 /* RankListHeaderView.m */; };
846206B81C06AFCA0015C456 /* RankCommentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846206B71C06AFCA0015C456 /* RankCommentModel.m */; };
846206BB1C06AFF50015C456 /* RankCommentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 846206BA1C06AFF50015C456 /* RankCommentCell.m */; };
8462C6EC1BF5F3BE00344DDD /* MenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8462C6EB1BF5F3BE00344DDD /* MenuButton.m */; }; 8462C6EC1BF5F3BE00344DDD /* MenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8462C6EB1BF5F3BE00344DDD /* MenuButton.m */; };
84720BC11C0377D300314099 /* CommentWithStarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84720BC01C0377D300314099 /* CommentWithStarView.m */; }; 84720BC11C0377D300314099 /* CommentWithStarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84720BC01C0377D300314099 /* CommentWithStarView.m */; };
8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474A01B1BE368D700315F30 /* HomeCellItem.m */; }; 8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474A01B1BE368D700315F30 /* HomeCellItem.m */; };
...@@ -135,6 +138,12 @@ ...@@ -135,6 +138,12 @@
842547FB1BF03977006C79C5 /* QuestionModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuestionModel.m; sourceTree = "<group>"; }; 842547FB1BF03977006C79C5 /* QuestionModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuestionModel.m; sourceTree = "<group>"; };
8442BA5A1BDB8FDB005E5657 /* MineTableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineTableHeaderView.h; sourceTree = "<group>"; }; 8442BA5A1BDB8FDB005E5657 /* MineTableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineTableHeaderView.h; sourceTree = "<group>"; };
8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineTableHeaderView.m; sourceTree = "<group>"; }; 8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineTableHeaderView.m; sourceTree = "<group>"; };
846206B31C06AF700015C456 /* RankListHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankListHeaderView.h; sourceTree = "<group>"; };
846206B41C06AF700015C456 /* RankListHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankListHeaderView.m; sourceTree = "<group>"; };
846206B61C06AFCA0015C456 /* RankCommentModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankCommentModel.h; sourceTree = "<group>"; };
846206B71C06AFCA0015C456 /* RankCommentModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankCommentModel.m; sourceTree = "<group>"; };
846206B91C06AFF50015C456 /* RankCommentCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankCommentCell.h; sourceTree = "<group>"; };
846206BA1C06AFF50015C456 /* RankCommentCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankCommentCell.m; sourceTree = "<group>"; };
8462C6EA1BF5F3BE00344DDD /* MenuButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuButton.h; sourceTree = "<group>"; }; 8462C6EA1BF5F3BE00344DDD /* MenuButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuButton.h; sourceTree = "<group>"; };
8462C6EB1BF5F3BE00344DDD /* MenuButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuButton.m; sourceTree = "<group>"; }; 8462C6EB1BF5F3BE00344DDD /* MenuButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuButton.m; sourceTree = "<group>"; };
84720BBF1C0377D300314099 /* CommentWithStarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentWithStarView.h; sourceTree = "<group>"; }; 84720BBF1C0377D300314099 /* CommentWithStarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentWithStarView.h; sourceTree = "<group>"; };
...@@ -532,6 +541,15 @@ ...@@ -532,6 +541,15 @@
path = WordOfMouth; path = WordOfMouth;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
846206B21C06AF700015C456 /* View */ = {
isa = PBXGroup;
children = (
846206B31C06AF700015C456 /* RankListHeaderView.h */,
846206B41C06AF700015C456 /* RankListHeaderView.m */,
);
path = View;
sourceTree = "<group>";
};
8474C5801BE751A2007DCF19 /* CommonFunc */ = { 8474C5801BE751A2007DCF19 /* CommonFunc */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -721,6 +739,7 @@ ...@@ -721,6 +739,7 @@
848699AD1BDF810900859DFE /* RankingList */ = { 848699AD1BDF810900859DFE /* RankingList */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
846206B21C06AF700015C456 /* View */,
84F30DA11BFC19DF00CBAD13 /* Model */, 84F30DA11BFC19DF00CBAD13 /* Model */,
848699AE1BDF810900859DFE /* Cell */, 848699AE1BDF810900859DFE /* Cell */,
848699AF1BDF810900859DFE /* ViewController */, 848699AF1BDF810900859DFE /* ViewController */,
...@@ -735,6 +754,8 @@ ...@@ -735,6 +754,8 @@
84846E961BE069BC0010550A /* DateButton.m */, 84846E961BE069BC0010550A /* DateButton.m */,
84846E981BE07CDF0010550A /* RankingListCell.h */, 84846E981BE07CDF0010550A /* RankingListCell.h */,
84846E991BE07CDF0010550A /* RankingListCell.m */, 84846E991BE07CDF0010550A /* RankingListCell.m */,
846206B91C06AFF50015C456 /* RankCommentCell.h */,
846206BA1C06AFF50015C456 /* RankCommentCell.m */,
); );
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1207,6 +1228,8 @@ ...@@ -1207,6 +1228,8 @@
84F30DA11BFC19DF00CBAD13 /* Model */ = { 84F30DA11BFC19DF00CBAD13 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
846206B61C06AFCA0015C456 /* RankCommentModel.h */,
846206B71C06AFCA0015C456 /* RankCommentModel.m */,
84F30DA21BFC19F200CBAD13 /* RankListModel.h */, 84F30DA21BFC19F200CBAD13 /* RankListModel.h */,
84F30DA31BFC19F200CBAD13 /* RankListModel.m */, 84F30DA31BFC19F200CBAD13 /* RankListModel.m */,
); );
...@@ -1547,11 +1570,13 @@ ...@@ -1547,11 +1570,13 @@
84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */, 84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */,
841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */, 841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */,
84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */, 84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */,
846206BB1C06AFF50015C456 /* RankCommentCell.m in Sources */,
841D24F81BEB473C0005CC9F /* CheckPicViewController.m in Sources */, 841D24F81BEB473C0005CC9F /* CheckPicViewController.m in Sources */,
84D80EB61BF714BE00A10EA4 /* GroupTabBar.m in Sources */, 84D80EB61BF714BE00A10EA4 /* GroupTabBar.m in Sources */,
8487D7721BF19A9C00E63E90 /* SearchToolBar.m in Sources */, 8487D7721BF19A9C00E63E90 /* SearchToolBar.m in Sources */,
84970E361BD8E09D00C1728A /* LoginViewController.m in Sources */, 84970E361BD8E09D00C1728A /* LoginViewController.m in Sources */,
84720BC11C0377D300314099 /* CommentWithStarView.m in Sources */, 84720BC11C0377D300314099 /* CommentWithStarView.m in Sources */,
846206B81C06AFCA0015C456 /* RankCommentModel.m in Sources */,
84FD8A0A1BDA01D1006E442A /* MineViewController.m in Sources */, 84FD8A0A1BDA01D1006E442A /* MineViewController.m in Sources */,
848699B21BDF810900859DFE /* InspectListViewController.m in Sources */, 848699B21BDF810900859DFE /* InspectListViewController.m in Sources */,
84846E971BE069BC0010550A /* DateButton.m in Sources */, 84846E971BE069BC0010550A /* DateButton.m in Sources */,
...@@ -1559,6 +1584,7 @@ ...@@ -1559,6 +1584,7 @@
84E363D21BFAC5200061547E /* TaskListModel.m in Sources */, 84E363D21BFAC5200061547E /* TaskListModel.m in Sources */,
84C9574E1BDB344900083584 /* UIView+Frame.m in Sources */, 84C9574E1BDB344900083584 /* UIView+Frame.m in Sources */,
848699B01BDF810900859DFE /* InspectListCell.m in Sources */, 848699B01BDF810900859DFE /* InspectListCell.m in Sources */,
846206B51C06AF700015C456 /* RankListHeaderView.m in Sources */,
84AD4F3A1BF4844600BFB37C /* RankDetailHeaderView.m in Sources */, 84AD4F3A1BF4844600BFB37C /* RankDetailHeaderView.m in Sources */,
8490C4D41BF9DEF0006B6569 /* PictureViewController.m in Sources */, 8490C4D41BF9DEF0006B6569 /* PictureViewController.m in Sources */,
8474C5951BE78AE1007DCF19 /* QuestionDetailViewController.m in Sources */, 8474C5951BE78AE1007DCF19 /* QuestionDetailViewController.m in Sources */,
......
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
// 口碑排名列表 // 口碑排名列表
#define kRankingListURL @"redstar-server/rest/praise/ranking" #define kRankingListURL @"redstar-server/rest/praise/ranking"
// 提交问题
// http://.../redstar-server/rest/question/submit?time={time}&operId={operId}&operName={operName}
#define kAddQuestionURL @""
// 提交评论 // 提交评论
//#define kAddCommentURL @"redstar-server/rest/comment/submit?time=2015-06-25+13:59:26&operId=admin&operName=admin" //#define kAddCommentURL @"redstar-server/rest/comment/submit?time=2015-06-25+13:59:26&operId=admin&operName=admin"
...@@ -46,4 +44,7 @@ ...@@ -46,4 +44,7 @@
// 上传新问题 // 上传新问题
#define kUpLoadQuestionURL @"redstar-server/rest/question/submit" #define kUpLoadQuestionURL @"redstar-server/rest/question/submit"
// 上报巡检结果
#define kUpLoadInspectResult @"redstar-server/rest/praise/report/"
#endif /* Url_h */ #endif /* Url_h */
...@@ -34,4 +34,5 @@ ...@@ -34,4 +34,5 @@
@property (nonatomic, copy) NSArray *stores; @property (nonatomic, copy) NSArray *stores;
@property (nonatomic, copy) NSString *uuid; @property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *version; @property (nonatomic, copy) NSString *version;
@property (nonatomic, copy) NSString *storePath;
@end @end
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
@property (nonatomic, copy) NSString *uuid; @property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *version; @property (nonatomic, copy) NSString *version;
@property (nonatomic, copy) NSString *storePath;
+ (instancetype)taskDetailModelWithDict:(NSDictionary *)dict; + (instancetype)taskDetailModelWithDict:(NSDictionary *)dict;
......
//
// RankCommentCell.h
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RankCommentModel.h"
@interface RankCommentCell : UITableViewCell
@property (nonatomic, strong) UILabel *peopleLabel;
@property (nonatomic, strong) UILabel *dateLabel;
@property (nonatomic, strong) UILabel *commentLabel;
@property (nonatomic, strong) RankCommentModel *rankComment;
@end
//
// RankCommentCell.m
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankCommentCell.h"
@interface RankCommentCell ()
@end
@implementation RankCommentCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
}
return self;
}
- (void)setRankComment:(RankCommentModel *)rankComment
{
_rankComment = rankComment;
self.peopleLabel.text = [NSString stringWithFormat:@"%@", rankComment.commentor_name];
self.dateLabel.text = [NSString stringWithFormat:@"%@", rankComment.commentTime];
self.commentLabel.text = [NSString stringWithFormat:@"评论:%@", rankComment.comment];
}
- (UILabel *)peopleLabel
{
if (!_peopleLabel) {
_peopleLabel = [[UILabel alloc] init];
_peopleLabel.font = [UIFont systemFontOfSize:15.0];
_peopleLabel.textColor = kRankHeadTitleTextColor;
_peopleLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_peopleLabel];
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingTop];
NSLayoutConstraint *shoppingRight = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-20];
[self.contentView addConstraint:shoppingRight];
NSLayoutConstraint *shoppingWidth = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:30];
[self.contentView addConstraint:shoppingWidth];
NSLayoutConstraint *shoppingHeight = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self.contentView addConstraint:shoppingHeight];
}
return _peopleLabel;
}
- (UILabel *)dateLabel
{
if (!_dateLabel) {
_dateLabel = [[UILabel alloc] init];
_dateLabel.font = [UIFont systemFontOfSize:15.0];
_dateLabel.textColor = kRankHeadTitleTextColor;
_dateLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_dateLabel];
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingTop];
NSLayoutConstraint *shoppingRight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:shoppingRight];
NSLayoutConstraint *shoppingWidth = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-20];
[self.contentView addConstraint:shoppingWidth];
NSLayoutConstraint *shoppingHeight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self.contentView addConstraint:shoppingHeight];
}
return _dateLabel;
}
- (UILabel *)commentLabel
{
if (!_commentLabel) {
_commentLabel = [[UILabel alloc] init];
_commentLabel.font = [UIFont systemFontOfSize:15.0];
_commentLabel.textColor = kRankHeadTitleTextColor;
_commentLabel.numberOfLines = 0;
_commentLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_commentLabel];
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:_commentLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.peopleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingTop];
NSLayoutConstraint *shoppingRight = [NSLayoutConstraint constraintWithItem:_commentLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:shoppingRight];
NSLayoutConstraint *shoppingWidth = [NSLayoutConstraint constraintWithItem:_commentLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:30];
[self.contentView addConstraint:shoppingWidth];
NSLayoutConstraint *shoppingHeight = [NSLayoutConstraint constraintWithItem:_commentLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
[self.contentView addConstraint:shoppingHeight];
}
return _commentLabel;
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
{ {
_rankList = rankList; _rankList = rankList;
[self.shopNameButton setTitle:[NSString stringWithFormat:@"%@", rankList.store_name] forState:UIControlStateNormal]; [self.shopNameButton setTitle:[NSString stringWithFormat:@"%@", rankList.store_name] forState:UIControlStateNormal];
self.scoreLabel.text = [NSString stringWithFormat:@"%.0f", rankList.score]; self.scoreLabel.text = [NSString stringWithFormat:@"%@", rankList.score];
} }
......
//
// RankCommentModel.h
// redstar
//
// Created by admin on 15/11/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RankCommentModel : NSObject
@property (nonatomic,copy) NSString *uuid;
@property (nonatomic,copy) NSString *commentor_uuid;
@property (nonatomic,copy) NSString *commentor_code;
@property (nonatomic,copy) NSString *commentor_name;
@property (nonatomic,copy) NSString *comment;
@property (nonatomic,copy) NSString *commentTime;
+ (instancetype)rankCommentModelWithDict:(NSDictionary *)dict;
- (instancetype)initWithDict:(NSDictionary *)dict;
@end
//
// RankCommentModel.m
// redstar
//
// Created by admin on 15/11/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankCommentModel.h"
@implementation RankCommentModel
+ (instancetype)rankCommentModelWithDict:(NSDictionary *)dict
{
return [[self alloc] initWithDict:dict];
}
- (instancetype)initWithDict:(NSDictionary *)dict
{
if (self = [super init]) {
[self setValuesForKeysWithDictionary:dict];
}
return self;
}
@end
...@@ -14,11 +14,15 @@ ...@@ -14,11 +14,15 @@
@property (nonatomic,copy) NSString *store_uuid; @property (nonatomic,copy) NSString *store_uuid;
@property (nonatomic,copy) NSString *store_code; @property (nonatomic,copy) NSString *store_code;
@property (nonatomic,copy) NSString *store_name; @property (nonatomic,copy) NSString *store_name;
@property (nonatomic, assign) double score; @property (nonatomic,copy) NSString * score;
@property (nonatomic,copy) NSString *reported; @property (nonatomic,copy) NSString *reported;
@property (nonatomic,copy) NSString *commentId; @property (nonatomic,copy) NSString *commentId;
@property (nonatomic,copy) NSString *ranking; @property (nonatomic,copy) NSString *ranking;
@property (nonatomic,copy) NSString *storePath;
@property (nonatomic,copy) NSString *storeAddress;
@property (nonatomic,strong) NSArray *storePictures;
@property (nonatomic, assign, getter = isOpened) BOOL opened;
@property (nonatomic,strong) NSArray *comments; @property (nonatomic,strong) NSArray *comments;
......
//
// RankListHeaderView.h
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@class RankListModel;
@protocol RankListHeaderDelegate <NSObject>
@optional
- (void)clickHeadView;
@end
@interface RankListHeaderView : UITableViewHeaderFooterView
@property (nonatomic, strong) RankListModel *rankListModel;
@property (nonatomic, weak) id<RankListHeaderDelegate> delegate;
@property (nonatomic, strong) UIButton *pushButton;
+ (instancetype)headViewWithTableView:(UITableView *)tableView section:(NSInteger)section;
@end
//
// RankListHeaderView.m
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankListHeaderView.h"
#import "RankListModel.h"
#define kPushTag 2354924
@interface RankListHeaderView ()
{
UIView *_bgView;
UIImageView *_arrowImageView;
UIButton *_bgButton;
UIButton *_otherButton;
UILabel *_scoreLabel;
NSInteger _section;
UILabel *_gradeLabel;
UIImageView *_gradeImageView;
}
@end
@implementation RankListHeaderView
+ (instancetype)headViewWithTableView:(UITableView *)tableView section:(NSInteger)section
{
static NSString *headIdentifier = @"header";
RankListHeaderView *headView = (RankListHeaderView *)[tableView dequeueReusableCellWithIdentifier:headIdentifier];
if (headView == nil) {
headView = [[RankListHeaderView alloc] initWithReuseIdentifier:headIdentifier section:(NSInteger)section];
}
return headView;
}
- (id)initWithReuseIdentifier:(NSString *)reuseIdentifier section:(NSInteger)section
{
if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
UIView *bgView = [[UIView alloc] init];
bgView.backgroundColor = [UIColor whiteColor];
[self addSubview:bgView];
_bgView = bgView;
UIButton *bgButton = [UIButton buttonWithType:UIButtonTypeCustom];
bgButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
bgButton.contentEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 10);
bgButton.titleEdgeInsets = UIEdgeInsetsMake(0, 45, 0, 0);
[bgButton setTitleColor:kLightBlack forState:UIControlStateNormal];
bgButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
[bgButton addTarget:self action:@selector(headBtnClick) forControlEvents:UIControlEventTouchUpInside];
bgButton.backgroundColor = [UIColor whiteColor];
[self addSubview:bgButton];
_bgButton = bgButton;
UIImageView *arrowIMView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"grey-trilateral_right"]];
[self addSubview:arrowIMView];
_arrowImageView = arrowIMView;
UILabel *scoreLabel = [[UILabel alloc] init];
scoreLabel.textAlignment = NSTextAlignmentCenter;
scoreLabel.textColor = kNavigationBarColor;
scoreLabel.font = [UIFont systemFontOfSize:17.0];
[self addSubview:scoreLabel];
_scoreLabel = scoreLabel;
if (section < 3) {
UIImageView *gradeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"medal_0%ld", section + 1]]];
[self addSubview:gradeImageView];
_gradeImageView = gradeImageView;
} else {
UILabel *gradeLabel = [[UILabel alloc] init];
gradeLabel.textAlignment = NSTextAlignmentCenter;
gradeLabel.textColor = kLightBlack;
gradeLabel.font = [UIFont systemFontOfSize:16.0];
[self addSubview:gradeLabel];
gradeLabel.text = [NSString stringWithFormat:@"第%ld名", section + 1];
_gradeLabel = gradeLabel;
}
_section = section;
UIButton *pushButton = [UIButton buttonWithType:UIButtonTypeCustom];
pushButton.tag = kPushTag + section;
[_bgView addSubview:pushButton];
_pushButton = pushButton;
}
return self;
}
- (void)headBtnClick
{
_rankListModel.opened = !_rankListModel.isOpened;
if ([_delegate respondsToSelector:@selector(clickHeadView)]) {
[_delegate clickHeadView];
}
}
- (void)setRankListModel:(RankListModel *)rankListModel
{
_rankListModel = rankListModel;
[_bgButton setTitle:rankListModel.store_name forState:UIControlStateNormal];
_scoreLabel.text = [NSString stringWithFormat:@"%@ 分",rankListModel.score];
}
- (void)didMoveToSuperview
{
if (_rankListModel.isOpened) {
[UIView animateWithDuration:0.2 animations:^{
_arrowImageView.transform = CGAffineTransformIdentity;
_arrowImageView.transform = CGAffineTransformMakeRotation(M_PI / 2);
}];
} else {
[UIView animateWithDuration:0.2 animations:^{
_arrowImageView.transform = CGAffineTransformIdentity;
_arrowImageView.transform = CGAffineTransformMakeRotation(0);
}];
}
}
- (void)layoutSubviews
{
[super layoutSubviews];
_bgView.frame = self.bounds;
_bgButton.frame = CGRectMake(30, 0, 0.3 * kScreenWidth, self.bounds.size.height);
_arrowImageView.frame = CGRectMake(20, (self.frame.size.height - 11) / 2, 9, 10);
_scoreLabel.frame = CGRectMake(0.4 * kScreenWidth, 0, 0.3 * kScreenWidth, 50);
if (_section < 3) {
_gradeImageView.frame = CGRectMake(0.8 * kScreenWidth, 9, 36, 33);
} else {
_gradeLabel.frame = CGRectMake(0.7 * kScreenWidth, 0, 0.3 * kScreenWidth, 50);
}
_pushButton.frame = CGRectMake(30 + 0.3 * kScreenWidth, 0, 0.7 * kScreenWidth - 30, self.bounds.size.height);;
}
@end
...@@ -120,6 +120,8 @@ ...@@ -120,6 +120,8 @@
*/ */
- (void)loginButtonClick:(UIButton *)sender - (void)loginButtonClick:(UIButton *)sender
{ {
self.rootTBC = [[RootTabBarController alloc] init];
[self presentViewController:_rootTBC animated:YES completion:nil];
if (self.loginView.usernameTextFiled.text.length == 0 || self.loginView.passwordTextFiled.text.length == 0) { if (self.loginView.usernameTextFiled.text.length == 0 || self.loginView.passwordTextFiled.text.length == 0) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"账号、密码不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"账号、密码不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
......
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