Commit 1de228a0 authored by admin's avatar admin

修复权限

parent 04cebd92
......@@ -37,4 +37,5 @@
@property (nonatomic, copy) NSString *storePath;
@property (nonatomic, copy) NSString *gradeCount;
@property (nonatomic, strong) NSArray *published;
@property (nonatomic, copy) NSString *remark;
@end
......@@ -39,6 +39,7 @@
@property (nonatomic, copy) NSString *storePath;
@property (nonatomic, copy) NSString *gradeCount;
@property (nonatomic, strong) NSArray *published;
@property (nonatomic, copy) NSString *remark;
+ (instancetype)taskDetailModelWithDict:(NSDictionary *)dict;
- (instancetype)initWithDict:(NSDictionary *)dict;
......
......@@ -104,7 +104,7 @@
NSDictionary *dataDict = response[@"data"];
TaskDetailModel *taskDetail = [TaskDetailModel taskDetailModelWithDict:dataDict];
self.rankDetailHeaderView.taskDetail = taskDetail;
NSArray *dataArray = dataDict[@"categories"];
NSMutableArray *tgArray = [NSMutableArray array];
......@@ -248,19 +248,34 @@
- (void)setupScrollView
{
int imageCount = (int)self.storePictures.count;
NSLog(@"self.storePicture = %@",self.storePictures);
CGFloat marginW = 5.0;
CGFloat imageViewW = 90 + 2 * marginW;
CGFloat imageViewH = self.rankDetailHeaderView.rankDetailView.showScrollView.bounds.size.height - 4;
self.rankDetailHeaderView.rankDetailView.showScrollView.contentSize = CGSizeMake(imageCount *imageViewW, imageViewH + 4);
for (int i = 0; i < imageCount; i++) {
UIButton *button = [[UIButton alloc] init];
NSDictionary *dict = (NSDictionary *)self.storePictures[i];
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", kRedStarURL ,dict[@"fileUrl"]]];
[button sd_setImageWithURL:imageUrl forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"default_pic"]];
button.frame = CGRectMake(i * imageViewW + 2, 2, imageViewW - 2 * marginW, imageViewH);
[button addTarget:self action:@selector(showBigPic:) forControlEvents:UIControlEventTouchUpInside];
[self.rankDetailHeaderView.rankDetailView.showScrollView addSubview:button];
if (imageCount == 0) {
self.rankDetailHeaderView.rankDetailView.showScrollView.contentSize = CGSizeMake(4 *imageViewW, imageViewH + 4);
for (int i = 0; i < 4; i++) {
UIButton *button = [[UIButton alloc] init];
[button setImage:[UIImage imageNamed:@"default_pic"] forState:UIControlStateNormal];
button.frame = CGRectMake(i * imageViewW + 2, 2, imageViewW - 2 * marginW, imageViewH);
[button addTarget:self action:@selector(showBigPic:) forControlEvents:UIControlEventTouchUpInside];
[self.rankDetailHeaderView.rankDetailView.showScrollView addSubview:button];
}
} else {
self.rankDetailHeaderView.rankDetailView.showScrollView.contentSize = CGSizeMake(imageCount *imageViewW, imageViewH + 4);
for (int i = 0; i < imageCount; i++) {
UIButton *button = [[UIButton alloc] init];
NSDictionary *dict = (NSDictionary *)self.storePictures[i];
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", kRedStarURL ,dict[@"fileUrl"]]];
[button sd_setImageWithURL:imageUrl forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"default_pic"]];
button.frame = CGRectMake(i * imageViewW + 2, 2, imageViewW - 2 * marginW, imageViewH);
[button addTarget:self action:@selector(showBigPic:) forControlEvents:UIControlEventTouchUpInside];
[self.rankDetailHeaderView.rankDetailView.showScrollView addSubview:button];
}
}
}
......
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