Commit 2069e0d8 authored by admin's avatar admin

接通图说列表接口

parent d0792c43
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
846206B81C06AFCA0015C456 /* RankCommentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846206B71C06AFCA0015C456 /* RankCommentModel.m */; }; 846206B81C06AFCA0015C456 /* RankCommentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846206B71C06AFCA0015C456 /* RankCommentModel.m */; };
846206BB1C06AFF50015C456 /* RankCommentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 846206BA1C06AFF50015C456 /* RankCommentCell.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 */; };
846ABDF51C1E5E780020C331 /* PictureListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABDF41C1E5E780020C331 /* PictureListModel.m */; };
846ABDF91C1E74430020C331 /* PictureDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABDF81C1E74430020C331 /* PictureDetailModel.m */; };
846ABDFC1C1EAB160020C331 /* PicTextModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABDFB1C1EAB160020C331 /* PicTextModel.m */; };
84720BC11C0377D300314099 /* CommentWithStarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84720BC01C0377D300314099 /* CommentWithStarView.m */; }; 84720BC11C0377D300314099 /* CommentWithStarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84720BC01C0377D300314099 /* CommentWithStarView.m */; };
8473E3881C1BBFF600960257 /* InspectTaskDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8473E3871C1BBFF600960257 /* InspectTaskDetailCell.m */; }; 8473E3881C1BBFF600960257 /* InspectTaskDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8473E3871C1BBFF600960257 /* InspectTaskDetailCell.m */; };
8473E38B1C1BCFC400960257 /* InspectTitleTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8473E38A1C1BCFC400960257 /* InspectTitleTableViewCell.m */; }; 8473E38B1C1BCFC400960257 /* InspectTitleTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8473E38A1C1BCFC400960257 /* InspectTitleTableViewCell.m */; };
...@@ -181,6 +184,12 @@ ...@@ -181,6 +184,12 @@
846206BA1C06AFF50015C456 /* RankCommentCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankCommentCell.m; 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>"; };
846ABDF31C1E5E780020C331 /* PictureListModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureListModel.h; sourceTree = "<group>"; };
846ABDF41C1E5E780020C331 /* PictureListModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureListModel.m; sourceTree = "<group>"; };
846ABDF71C1E74430020C331 /* PictureDetailModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureDetailModel.h; sourceTree = "<group>"; };
846ABDF81C1E74430020C331 /* PictureDetailModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureDetailModel.m; sourceTree = "<group>"; };
846ABDFA1C1EAB160020C331 /* PicTextModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PicTextModel.h; sourceTree = "<group>"; };
846ABDFB1C1EAB160020C331 /* PicTextModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PicTextModel.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>"; };
84720BC01C0377D300314099 /* CommentWithStarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentWithStarView.m; sourceTree = "<group>"; }; 84720BC01C0377D300314099 /* CommentWithStarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentWithStarView.m; sourceTree = "<group>"; };
8473E3861C1BBFF600960257 /* InspectTaskDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectTaskDetailCell.h; sourceTree = "<group>"; }; 8473E3861C1BBFF600960257 /* InspectTaskDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectTaskDetailCell.h; sourceTree = "<group>"; };
...@@ -675,6 +684,26 @@ ...@@ -675,6 +684,26 @@
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
846ABDF21C1E5E660020C331 /* Model */ = {
isa = PBXGroup;
children = (
846ABDF31C1E5E780020C331 /* PictureListModel.h */,
846ABDF41C1E5E780020C331 /* PictureListModel.m */,
);
path = Model;
sourceTree = "<group>";
};
846ABDF61C1E74360020C331 /* Model */ = {
isa = PBXGroup;
children = (
846ABDF71C1E74430020C331 /* PictureDetailModel.h */,
846ABDF81C1E74430020C331 /* PictureDetailModel.m */,
846ABDFA1C1EAB160020C331 /* PicTextModel.h */,
846ABDFB1C1EAB160020C331 /* PicTextModel.m */,
);
path = Model;
sourceTree = "<group>";
};
8474C5801BE751A2007DCF19 /* CommonFunc */ = { 8474C5801BE751A2007DCF19 /* CommonFunc */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -963,6 +992,7 @@ ...@@ -963,6 +992,7 @@
8490C4C71BF9DEF0006B6569 /* PictureDetail */ = { 8490C4C71BF9DEF0006B6569 /* PictureDetail */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
846ABDF61C1E74360020C331 /* Model */,
8490C4C81BF9DEF0006B6569 /* Cell */, 8490C4C81BF9DEF0006B6569 /* Cell */,
8490C4C91BF9DEF0006B6569 /* View */, 8490C4C91BF9DEF0006B6569 /* View */,
8490C4CA1BF9DEF0006B6569 /* ViewController */, 8490C4CA1BF9DEF0006B6569 /* ViewController */,
...@@ -1002,6 +1032,7 @@ ...@@ -1002,6 +1032,7 @@
8490C4CB1BF9DEF0006B6569 /* PictureList */ = { 8490C4CB1BF9DEF0006B6569 /* PictureList */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
846ABDF21C1E5E660020C331 /* Model */,
8490C4CC1BF9DEF0006B6569 /* Cell */, 8490C4CC1BF9DEF0006B6569 /* Cell */,
8490C4CF1BF9DEF0006B6569 /* View */, 8490C4CF1BF9DEF0006B6569 /* View */,
8490C4D01BF9DEF0006B6569 /* ViewController */, 8490C4D01BF9DEF0006B6569 /* ViewController */,
...@@ -2113,15 +2144,18 @@ ...@@ -2113,15 +2144,18 @@
84C972961C1ABE08003A3276 /* PicScreenView.m in Sources */, 84C972961C1ABE08003A3276 /* PicScreenView.m in Sources */,
8473E38B1C1BCFC400960257 /* InspectTitleTableViewCell.m in Sources */, 8473E38B1C1BCFC400960257 /* InspectTitleTableViewCell.m in Sources */,
84ECCF1B1C0210F000EA4960 /* CommentModel.m in Sources */, 84ECCF1B1C0210F000EA4960 /* CommentModel.m in Sources */,
846ABDF51C1E5E780020C331 /* PictureListModel.m in Sources */,
84E0ABCD1BFB082E001C8F45 /* TaskDetailModel.m in Sources */, 84E0ABCD1BFB082E001C8F45 /* TaskDetailModel.m in Sources */,
8490C4D31BF9DEF0006B6569 /* PictureTableCell.m in Sources */, 8490C4D31BF9DEF0006B6569 /* PictureTableCell.m in Sources */,
84970E391BD8E0B300C1728A /* LoginView.m in Sources */, 84970E391BD8E0B300C1728A /* LoginView.m in Sources */,
84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */, 84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */,
84D3E5F31C04BCD3001FF1DD /* InspectNotUploadViewController.m in Sources */, 84D3E5F31C04BCD3001FF1DD /* InspectNotUploadViewController.m in Sources */,
846ABDF91C1E74430020C331 /* PictureDetailModel.m in Sources */,
84D3E5F91C04BD8E001FF1DD /* InspectNotUpLoadCell.m in Sources */, 84D3E5F91C04BD8E001FF1DD /* InspectNotUpLoadCell.m in Sources */,
84ECCF181C01FA2600EA4960 /* QuestionDetailModel.m in Sources */, 84ECCF181C01FA2600EA4960 /* QuestionDetailModel.m in Sources */,
843D1B9E1C0B3F7600E30002 /* SpotCheckOnLineViewController.m in Sources */, 843D1B9E1C0B3F7600E30002 /* SpotCheckOnLineViewController.m in Sources */,
84846E9A1BE07CDF0010550A /* RankingListCell.m in Sources */, 84846E9A1BE07CDF0010550A /* RankingListCell.m in Sources */,
846ABDFC1C1EAB160020C331 /* PicTextModel.m in Sources */,
84A673911C0C2681000F828E /* FunctionViewController.m in Sources */, 84A673911C0C2681000F828E /* FunctionViewController.m in Sources */,
848699B61BDF812F00859DFE /* RankingListViewController.m in Sources */, 848699B61BDF812F00859DFE /* RankingListViewController.m in Sources */,
84C9729C1C1ADC5B003A3276 /* PictureTextTableCell.m in Sources */, 84C9729C1C1ADC5B003A3276 /* PictureTextTableCell.m in Sources */,
......
...@@ -127,9 +127,9 @@ ...@@ -127,9 +127,9 @@
// self.tableView.delegate = self; // self.tableView.delegate = self;
// self.tableView.dataSource = self; // self.tableView.dataSource = self;
// // 下拉加载更多 // // 下拉加载更多
// self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ // self.tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
// [self requestMoreList]; // [self requestMoreList];
// }]; // }];
// [self.tableView reloadData]; // [self.tableView reloadData];
// } // }
...@@ -418,7 +418,7 @@ ...@@ -418,7 +418,7 @@
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
// 下拉加载更多 // 下拉加载更多
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ self.tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
[self requestMoreList]; [self requestMoreList];
}]; }];
[self.tableView reloadData]; [self.tableView reloadData];
...@@ -534,7 +534,7 @@ ...@@ -534,7 +534,7 @@
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
// 下拉加载更多 // 下拉加载更多
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ self.tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
[self requestMoreList]; [self requestMoreList];
}]; }];
[self.tableView reloadData]; [self.tableView reloadData];
......
...@@ -134,9 +134,9 @@ ...@@ -134,9 +134,9 @@
// self.tableView.delegate = self; // self.tableView.delegate = self;
// self.tableView.dataSource = self; // self.tableView.dataSource = self;
// // 下拉加载更多 // // 下拉加载更多
// self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ // self.tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
// [self requestMoreList]; // [self requestMoreList];
// }]; // }];
// [self.tableView reloadData]; // [self.tableView reloadData];
// } // }
...@@ -431,7 +431,7 @@ ...@@ -431,7 +431,7 @@
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
// 下拉加载更多 // 下拉加载更多
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ self.tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
[self requestMoreList]; [self requestMoreList];
}]; }];
[self.tableView reloadData]; [self.tableView reloadData];
...@@ -510,7 +510,7 @@ ...@@ -510,7 +510,7 @@
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
// 下拉加载更多 // 下拉加载更多
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ self.tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
[self requestMoreList]; [self requestMoreList];
}]; }];
[self.tableView reloadData]; [self.tableView reloadData];
......
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
[_thumbBtn setImage:[UIImage imageNamed:@"commend"] forState:UIControlStateNormal]; [_thumbBtn setImage:[UIImage imageNamed:@"commend"] forState:UIControlStateNormal];
[_thumbBtn setImage:[UIImage imageNamed:@"commend_after"] forState:UIControlStateSelected]; [_thumbBtn setImage:[UIImage imageNamed:@"commend_after"] forState:UIControlStateSelected];
_thumbBtn.translatesAutoresizingMaskIntoConstraints = NO; _thumbBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_thumbBtn setTitle:@"200" forState:UIControlStateNormal];
_thumbBtn.titleLabel.font = [UIFont systemFontOfSize:16.0]; _thumbBtn.titleLabel.font = [UIFont systemFontOfSize:16.0];
[_thumbBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal]; [_thumbBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal];
[self.contentView addSubview:_thumbBtn]; [self.contentView addSubview:_thumbBtn];
......
...@@ -9,5 +9,7 @@ ...@@ -9,5 +9,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface PictureTextTableCell : UITableViewCell @interface PictureTextTableCell : UITableViewCell
@property (nonatomic, strong) UIImageView *bigImageView;
@property (nonatomic, strong) UILabel *descriptionLabel;
@end @end
...@@ -9,9 +9,56 @@ ...@@ -9,9 +9,56 @@
#import "PictureTextTableCell.h" #import "PictureTextTableCell.h"
@implementation PictureTextTableCell @implementation PictureTextTableCell
- (UIImageView *)bigImageView
{
if (!_bigImageView) {
_bigImageView = [[UIImageView alloc] init];
_bigImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_bigImageView];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_bigImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_bigImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:titleLeft];
// 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_bigImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleRight];
// 高度
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_bigImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:150];
[self.contentView addConstraint:titleHeight];
}
return _bigImageView;
}
- (void)awakeFromNib { - (UILabel *)descriptionLabel
// Initialization code {
if (!_descriptionLabel) {
_descriptionLabel = [[UILabel alloc] init];
_descriptionLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_descriptionLabel];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_descriptionLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.bigImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:5];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_descriptionLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:titleLeft];
// 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_descriptionLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleRight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_descriptionLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-10];
[self.contentView addConstraint:titleBottom];
}
return _descriptionLabel;
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
......
//
// PicTextModel.h
// redstar
//
// Created by admin on 15/12/14.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PicTextModel : NSObject
@property (nonatomic, copy) NSString *descriptionText;
@property (nonatomic, copy) NSString *fileContent;
@property (nonatomic, copy) NSString *fileName;
@property (nonatomic, copy) NSString *fileUrl;
@property (nonatomic, copy) NSString *index;
@property (nonatomic, copy) NSString *lastModified;
@property (nonatomic, copy) NSString *uuid;
@end
//
// PicTextModel.m
// redstar
//
// Created by admin on 15/12/14.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "PicTextModel.h"
@implementation PicTextModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
if([key isEqualToString:@"description"])
self.descriptionText = value;
}
@end
//
// PictureDetailModel.h
// redstar
//
// Created by admin on 15/12/14.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PictureDetailModel : NSObject
@property (nonatomic, strong) NSArray *attachments;
@property (nonatomic, copy) NSString *content;
@property (nonatomic, copy) NSString *create_id;
@property (nonatomic, copy) NSString *create_operName;
@property (nonatomic, copy) NSString *create_time;
@property (nonatomic, copy) NSString *enterprise;
@property (nonatomic, assign) int hotspot;
@property (nonatomic, copy) NSString *lastModify_id;
@property (nonatomic, copy) NSString *lastModify_operName;
@property (nonatomic, copy) NSString *lastModify_time;
@property (nonatomic, assign) int likeCount;
@property (nonatomic, assign) BOOL myLike;
@property (nonatomic, copy) NSString *state;
@property (nonatomic, copy) NSString *storePath;
@property (nonatomic, copy) NSString *store_code;
@property (nonatomic, copy) NSString *store_name;
@property (nonatomic, copy) NSString *store_uuid;
@property (nonatomic, copy) NSString *submitTime;
@property (nonatomic, copy) NSString *submit_code;
@property (nonatomic, copy) NSString *submit_name;
@property (nonatomic, copy) NSString *submit_uuid;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *version;
@end
//
// PictureDetailModel.m
// redstar
//
// Created by admin on 15/12/14.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "PictureDetailModel.h"
@implementation PictureDetailModel
@end
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface PictureStoryViewController : UIViewController @interface PictureStoryViewController : UIViewController
@property (nonatomic, copy) NSString *uuid;
@end @end
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ZanButton.h" #import "ZanButton.h"
#import "PictureListModel.h"
@interface PictureTableCell : UITableViewCell @interface PictureTableCell : UITableViewCell
...@@ -20,4 +21,6 @@ ...@@ -20,4 +21,6 @@
@property (nonatomic, strong) ZanButton *thumbBtn; @property (nonatomic, strong) ZanButton *thumbBtn;
@property (nonatomic, strong) ZanButton *commentBtn; @property (nonatomic, strong) ZanButton *commentBtn;
@property (nonatomic, strong) PictureListModel *pictureList;
@end @end
...@@ -7,32 +7,50 @@ ...@@ -7,32 +7,50 @@
// //
#import "PictureTableCell.h" #import "PictureTableCell.h"
#import <UIImageView+WebCache.h>
@interface PictureTableCell () @interface PictureTableCell ()
@property (nonatomic, strong) UILabel *hotLabel; @property (nonatomic, strong) UILabel *hotLabel;
@end @end
@implementation PictureTableCell @implementation PictureTableCell
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
#pragma mark - Private Methods - (void)setPictureList:(PictureListModel *)pictureList
- (void)setup
{ {
self.titleImageView.image = [UIImage imageNamed:@"default_pic"]; _pictureList = pictureList;
self.titleLabel.textColor = kPictureCellTitleColor; if (pictureList.attachments.count != 0) {
self.hotLabel.font = [UIFont boldSystemFontOfSize:12.0]; NSDictionary *dict = pictureList.attachments[0];
self.detailsLabel.textColor = kPictureCellDetailsColor; NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", kRedStarURL ,dict[@"fileUrl"]]];
self.dateLabel.textColor = kPictureCellDateColor; [self.titleImageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"default_pic"]];
self.thumbBtn.titleLabel.font = [UIFont systemFontOfSize:16.0]; } else {
self.commentBtn.titleLabel.font = [UIFont systemFontOfSize:16.0]; self.titleImageView.image = [UIImage imageNamed:@"default_pic"];
}
self.titleLabel.text = [NSString stringWithFormat:@"%@", pictureList.title];
self.detailsLabel.text = [NSString stringWithFormat:@"%@", pictureList.content];
if (pictureList.submitTime == nil || pictureList.submitTime == NULL || [pictureList.submitTime isEqual:[NSNull null]]) {
self.dateLabel.text = [NSString stringWithFormat:@"发布时间: "];
} else {
self.dateLabel.text = [NSString stringWithFormat:@"发布时间: %@",pictureList.submitTime];
}
if (pictureList.hotspot) {
self.hotLabel.hidden = NO;
} else {
self.hotLabel.hidden = YES;
}
if (pictureList.myLike) {
self.thumbBtn.selected = YES;
} else {
self.thumbBtn.selected = NO;
}
[self.thumbBtn setTitle:[NSString stringWithFormat:@"%d", pictureList.likeCount] forState:UIControlStateNormal];
[self.commentBtn setTitle:@"18" forState:UIControlStateNormal];
} }
#pragma mark - Lazy loading #pragma mark - Lazy loading
...@@ -62,6 +80,8 @@ ...@@ -62,6 +80,8 @@
{ {
if (!_titleLabel) { if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init]; _titleLabel = [[UILabel alloc] init];
_titleLabel.textColor = kPictureCellTitleColor;
_titleLabel.font = [UIFont systemFontOfSize:17.0]; _titleLabel.font = [UIFont systemFontOfSize:17.0];
_titleLabel.translatesAutoresizingMaskIntoConstraints = NO; _titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_titleLabel]; [self.contentView addSubview:_titleLabel];
...@@ -87,6 +107,7 @@ ...@@ -87,6 +107,7 @@
_hotLabel.translatesAutoresizingMaskIntoConstraints = NO; _hotLabel.translatesAutoresizingMaskIntoConstraints = NO;
_hotLabel.backgroundColor = kHotBackGroundColor; _hotLabel.backgroundColor = kHotBackGroundColor;
_hotLabel.textColor = [UIColor whiteColor]; _hotLabel.textColor = [UIColor whiteColor];
_hotLabel.font = [UIFont boldSystemFontOfSize:12.0];
_hotLabel.text = @"HOT"; _hotLabel.text = @"HOT";
_hotLabel.textAlignment = NSTextAlignmentCenter; _hotLabel.textAlignment = NSTextAlignmentCenter;
_hotLabel.layer.cornerRadius = 3; _hotLabel.layer.cornerRadius = 3;
...@@ -115,6 +136,8 @@ ...@@ -115,6 +136,8 @@
_detailsLabel.font = [UIFont systemFontOfSize:15.0]; _detailsLabel.font = [UIFont systemFontOfSize:15.0];
_detailsLabel.translatesAutoresizingMaskIntoConstraints = NO; _detailsLabel.translatesAutoresizingMaskIntoConstraints = NO;
_detailsLabel.numberOfLines = 0; _detailsLabel.numberOfLines = 0;
_detailsLabel.textColor = kPictureCellDetailsColor;
[self.contentView addSubview:_detailsLabel]; [self.contentView addSubview:_detailsLabel];
NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_detailsLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_detailsLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
...@@ -138,9 +161,11 @@ ...@@ -138,9 +161,11 @@
_dateLabel = [[UILabel alloc] init]; _dateLabel = [[UILabel alloc] init];
_dateLabel.translatesAutoresizingMaskIntoConstraints = NO; _dateLabel.translatesAutoresizingMaskIntoConstraints = NO;
_dateLabel.font = [UIFont systemFontOfSize:14.0]; _dateLabel.font = [UIFont systemFontOfSize:14.0];
_dateLabel.textColor = kPictureCellDateColor;
[self.contentView addSubview:_dateLabel]; [self.contentView addSubview:_dateLabel];
NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:5];
[self.contentView addConstraint:titleImageTop]; [self.contentView addConstraint:titleImageTop];
NSLayoutConstraint *titleImageLeft = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:15]; NSLayoutConstraint *titleImageLeft = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:15];
...@@ -149,10 +174,10 @@ ...@@ -149,10 +174,10 @@
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.thumbBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.thumbBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:titleRight]; [self.contentView addConstraint:titleRight];
NSLayoutConstraint *titleImageHeight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45]; NSLayoutConstraint *titleImageHeight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:35];
[self.contentView addConstraint:titleImageHeight]; [self.contentView addConstraint:titleImageHeight];
NSLayoutConstraint *titleImageBottom = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *titleImageBottom = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
[self.contentView addConstraint:titleImageBottom]; [self.contentView addConstraint:titleImageBottom];
} }
return _dateLabel; return _dateLabel;
...@@ -163,8 +188,10 @@ ...@@ -163,8 +188,10 @@
if (!_thumbBtn) { if (!_thumbBtn) {
_thumbBtn = [[ZanButton alloc] init]; _thumbBtn = [[ZanButton alloc] init];
[_thumbBtn setImage:[UIImage imageNamed:@"commend"] forState:UIControlStateNormal]; [_thumbBtn setImage:[UIImage imageNamed:@"commend"] forState:UIControlStateNormal];
[_thumbBtn setImage:[UIImage imageNamed:@"commend_after"] forState:UIControlStateSelected];
_thumbBtn.translatesAutoresizingMaskIntoConstraints = NO; _thumbBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_thumbBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal]; [_thumbBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal];
_thumbBtn.titleLabel.font = [UIFont systemFontOfSize:16.0];
[self.contentView addSubview:_thumbBtn]; [self.contentView addSubview:_thumbBtn];
NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_thumbBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12]; NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_thumbBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12];
...@@ -189,6 +216,7 @@ ...@@ -189,6 +216,7 @@
[_commentBtn setImage:[UIImage imageNamed:@"comment"] forState:UIControlStateNormal]; [_commentBtn setImage:[UIImage imageNamed:@"comment"] forState:UIControlStateNormal];
_commentBtn.translatesAutoresizingMaskIntoConstraints = NO; _commentBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_commentBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal]; [_commentBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal];
_commentBtn.titleLabel.font = [UIFont systemFontOfSize:16.0];
[self.contentView addSubview:_commentBtn]; [self.contentView addSubview:_commentBtn];
NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_commentBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12]; NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_commentBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12];
......
//
// PictureListModel.h
// redstar
//
// Created by admin on 15/12/14.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PictureListModel : NSObject
@property (nonatomic, strong) NSArray *attachments;
@property (nonatomic, copy) NSString *content;
@property (nonatomic, copy) NSString *create_id;
@property (nonatomic, copy) NSString *create_operName;
@property (nonatomic, copy) NSString *create_time;
@property (nonatomic, copy) NSString *enterprise;
@property (nonatomic, assign) int hotspot;
@property (nonatomic, copy) NSString *lastModify_id;
@property (nonatomic, copy) NSString *lastModify_operName;
@property (nonatomic, copy) NSString *lastModify_time;
@property (nonatomic, assign) int likeCount;
@property (nonatomic, assign) BOOL myLike;
@property (nonatomic, copy) NSString *state;
@property (nonatomic, copy) NSString *storePath;
@property (nonatomic, copy) NSString *store_code;
@property (nonatomic, copy) NSString *store_name;
@property (nonatomic, copy) NSString *store_uuid;
@property (nonatomic, copy) NSString *submitTime;
@property (nonatomic, copy) NSString *submit_code;
@property (nonatomic, copy) NSString *submit_name;
@property (nonatomic, copy) NSString *submit_uuid;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *version;
@end
//
// PictureListModel.m
// redstar
//
// Created by admin on 15/12/14.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "PictureListModel.h"
@implementation PictureListModel
@end
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#import <MBProgressHUD.h> #import <MBProgressHUD.h>
#import <MJRefresh.h> #import <MJRefresh.h>
#import "PictureListModel.h"
#define kPictureTableViewCell @"pictureTabelViewCell" #define kPictureTableViewCell @"pictureTabelViewCell"
...@@ -47,24 +48,27 @@ ...@@ -47,24 +48,27 @@
@property (nonatomic, assign) NSInteger stateRow; @property (nonatomic, assign) NSInteger stateRow;
@property (nonatomic, assign) NSInteger timeRow; @property (nonatomic, assign) NSInteger timeRow;
@property (nonatomic, assign) NSMutableArray *allPraiseListArray; @property (nonatomic, strong) NSMutableArray *allPraiseListArray;
@property (nonatomic, assign) int page; @property (nonatomic, assign) int page;
@end @end
@implementation PictureViewController @implementation PictureViewController
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self requestPicturePraise];
}
- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad]; [super viewDidLoad];
[self setupNav]; [self setupNav];
self.allPraiseListArray = [NSMutableArray array];
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.menuView.backgroundColor = kInspectSectionBackGroundColor; self.menuView.backgroundColor = kInspectSectionBackGroundColor;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone; self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO; self.extendedLayoutIncludesOpaqueBars = NO;
...@@ -73,8 +77,6 @@ ...@@ -73,8 +77,6 @@
} }
[self requestPicturePraise];
_page = 0; _page = 0;
} }
...@@ -119,6 +121,8 @@ ...@@ -119,6 +121,8 @@
- (void)requestPicturePraise - (void)requestPicturePraise
{ {
self.allPraiseListArray = [NSMutableArray array];
// 请求地址 // 请求地址
NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQueryPicturePraiseURL]; NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQueryPicturePraiseURL];
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"]; NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
...@@ -133,20 +137,31 @@ ...@@ -133,20 +137,31 @@
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:urlStr]; HttpClient *httpClient = [[HttpClient alloc] initWithUrl:urlStr];
[MBProgressHUD showHUDAddedTo:self.view animated:YES]; [MBProgressHUD showHUDAddedTo:self.view animated:YES];
__block PictureViewController *weakSelf = self;
// 请求问题列表 // 请求问题列表
[httpClient queryPicturePraiseWithParameters:parameters completion:^(id response, NSError *error) { [httpClient queryPicturePraiseWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"图说口碑 response = %@ error = %@" , response, error); NSLog(@"图说口碑 response = %@ error = %@" , response, error);
// if (_allPraiseListArray.count == 0) { NSDictionary *dataDict = response[@"data"];
// weakSelf.noDataView.backgroundColor = [UIColor whiteColor]; NSArray *dataArray = dataDict[@"records"];
// } else { NSMutableArray *tempArray = [NSMutableArray array];
// self.tableView.delegate = self; for (NSDictionary *dict in dataArray) {
// self.tableView.dataSource = self; PictureListModel *picList = [[PictureListModel alloc] init];
// self.menuView.backgroundColor = kInspectSectionBackGroundColor; [picList setValuesForKeysWithDictionary:dict];
// self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ [tempArray addObject:picList];
// [self requestMoreList]; }
// }]; _allPraiseListArray = tempArray;
// [self.tableView reloadData]; if (_allPraiseListArray.count == 0) {
// } weakSelf.noDataView.backgroundColor = [UIColor whiteColor];
} else {
weakSelf.menuView.backgroundColor = kInspectSectionBackGroundColor;
weakSelf.tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
[self requestMoreList];
}];
[weakSelf.tableView reloadData];
}
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
}]; }];
...@@ -302,7 +317,8 @@ ...@@ -302,7 +317,8 @@
_screenView.timeTableView.timeDeleagte = self; _screenView.timeTableView.timeDeleagte = self;
_screenView.backgroundColor = [UIColor whiteColor]; _screenView.backgroundColor = [UIColor whiteColor];
} }
[_screenView.resetBtn addTarget:self action:@selector(resetClick:) forControlEvents:UIControlEventTouchUpInside];
[_screenView.submitBtn addTarget:self action:@selector(submitClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_bgView]; [self.view addSubview:_bgView];
[self.view insertSubview:_screenView aboveSubview:_bgView]; [self.view insertSubview:_screenView aboveSubview:_bgView];
...@@ -439,11 +455,18 @@ ...@@ -439,11 +455,18 @@
[parameters setObject:array forKey:@"queryOrders"]; [parameters setObject:array forKey:@"queryOrders"];
} }
NSLog(@"parameters = %@",parameters); NSLog(@"parameters rrrrrrrr = %@",parameters);
// 请求问题列表 // 请求问题列表
[httpClient getQuestionListWithParameters:parameters completion:^(id response, NSError *error) { [httpClient getQuestionListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"图说口碑 列表recods = %@", response); NSDictionary *dataDict = (NSDictionary *)response[@"data"];
NSDictionary *recordsDict = (NSDictionary *)dataDict[@"records"];
NSLog(@"图说口碑 筛选排序 resp = %@ error = %@", response ,error);
NSMutableArray *tempArray = [NSMutableArray array]; NSMutableArray *tempArray = [NSMutableArray array];
for (NSDictionary *pictureDict in recordsDict) {
PictureListModel *picture = [[PictureListModel alloc] init];
[picture setValuesForKeysWithDictionary:pictureDict];
[tempArray addObject:picture];
}
_allPraiseListArray = tempArray; _allPraiseListArray = tempArray;
if (_allPraiseListArray.count == 0) { if (_allPraiseListArray.count == 0) {
...@@ -452,7 +475,6 @@ ...@@ -452,7 +475,6 @@
_tableView = nil; _tableView = nil;
} }
weakSelf.noDataView.backgroundColor = [UIColor whiteColor]; weakSelf.noDataView.backgroundColor = [UIColor whiteColor];
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
[weakSelf closeGreenView]; [weakSelf closeGreenView];
} else { } else {
if (_noDataView) { if (_noDataView) {
...@@ -462,9 +484,9 @@ ...@@ -462,9 +484,9 @@
weakSelf.tableView.delegate = weakSelf; weakSelf.tableView.delegate = weakSelf;
weakSelf.tableView.dataSource = weakSelf; weakSelf.tableView.dataSource = weakSelf;
[weakSelf.tableView reloadData]; [weakSelf.tableView reloadData];
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
[weakSelf closeGreenView]; [weakSelf closeGreenView];
} }
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
self.menuView.backgroundColor = kInspectSectionBackGroundColor; self.menuView.backgroundColor = kInspectSectionBackGroundColor;
}]; }];
...@@ -521,12 +543,10 @@ ...@@ -521,12 +543,10 @@
} }
NSDictionary *parameters = @{@"user":user_uuid, NSDictionary *parameters = @{@"user":user_uuid,
@"scope":@"all",
@"pageNumber":@(0), @"pageNumber":@(0),
@"pageSize":@(20), @"pageSize":@(10),
@"queryOrders":queryOrders @"queryOrders":queryOrders
}; };
// 发起请求 // 发起请求
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:urlStr]; HttpClient *httpClient = [[HttpClient alloc] initWithUrl:urlStr];
[MBProgressHUD showHUDAddedTo:self.view animated:YES]; [MBProgressHUD showHUDAddedTo:self.view animated:YES];
...@@ -534,8 +554,36 @@ ...@@ -534,8 +554,36 @@
// 请求问题列表 // 请求问题列表
[httpClient queryPicturePraiseWithParameters:parameters completion:^(id response, NSError *error) { [httpClient queryPicturePraiseWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"图说口碑 按点赞数 resp = %@ error = %@", response ,error);
NSDictionary *dataDict = (NSDictionary *)response[@"data"];
NSDictionary *recordsDict = (NSDictionary *)dataDict[@"records"];
NSLog(@"图说口碑 按点赞数排序 resp = %@ error = %@", response ,error);
NSMutableArray *tempArray = [NSMutableArray array];
for (NSDictionary *pictureDict in recordsDict) {
PictureListModel *picture = [[PictureListModel alloc] init];
[picture setValuesForKeysWithDictionary:pictureDict];
[tempArray addObject:picture];
}
_allPraiseListArray = tempArray;
if (_allPraiseListArray.count == 0) {
if (_tableView) {
[_tableView removeFromSuperview];
_tableView = nil;
}
self.noDataView.backgroundColor = [UIColor whiteColor];
} else {
if (_noDataView) {
[_noDataView removeFromSuperview];
_noDataView = nil;
}
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.tableView reloadData];
}
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
}]; }];
...@@ -547,7 +595,7 @@ ...@@ -547,7 +595,7 @@
#pragma mark - UITableView Delegate/DataSource #pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
return 2; return self.allPraiseListArray.count;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
...@@ -556,11 +604,8 @@ ...@@ -556,11 +604,8 @@
if (!cell) { if (!cell) {
cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPictureTableViewCell]; cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPictureTableViewCell];
} }
cell.titleLabel.text = @"【服务口碑现场】第二期";
cell.detailsLabel.text = @"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。"; cell.pictureList = _allPraiseListArray[indexPath.row];
cell.dateLabel.text = [NSString stringWithFormat:@"发布时间: 2015-08-26"];
[cell.thumbBtn setTitle:@"220" forState:UIControlStateNormal];
[cell.commentBtn setTitle:@"18" forState:UIControlStateNormal];
return cell; return cell;
} }
...@@ -578,7 +623,9 @@ ...@@ -578,7 +623,9 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
PictureListModel *picList = _allPraiseListArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init]; PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid;
[self.navigationController pushViewController:storyVC animated:YES]; [self.navigationController pushViewController:storyVC animated:YES];
} }
...@@ -615,7 +662,9 @@ ...@@ -615,7 +662,9 @@
_tableView.translatesAutoresizingMaskIntoConstraints = NO; _tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.showsVerticalScrollIndicator = NO; _tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO; _tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableFooterView = [[UIView alloc] init]; _tableView.delegate = self;
_tableView.dataSource = self;
// _tableView.tableFooterView = [[UIView alloc] init];
_tableView.rowHeight = UITableViewAutomaticDimension; _tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 150.0; _tableView.estimatedRowHeight = 150.0;
[_tableView registerClass:[PictureTableCell class] forCellReuseIdentifier:kPictureTableViewCell]; [_tableView registerClass:[PictureTableCell class] forCellReuseIdentifier:kPictureTableViewCell];
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
} else { } else {
[weakSelf setupTableView]; [weakSelf setupTableView];
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ self.tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
[self requestMoreList]; [self requestMoreList];
}]; }];
[self.tableView reloadData]; [self.tableView reloadData];
......
...@@ -136,6 +136,8 @@ ...@@ -136,6 +136,8 @@
for (NSDictionary *dict in dataArray) { for (NSDictionary *dict in dataArray) {
TaskListModel *taskList = [[TaskListModel alloc] init]; TaskListModel *taskList = [[TaskListModel alloc] init];
[taskList setValuesForKeysWithDictionary:dict]; [taskList setValuesForKeysWithDictionary:dict];
NSLog(@"taskList state = %@", taskList.state);
[taskArray addObject:taskList]; [taskArray addObject:taskList];
} }
[_taskListDataArray addObjectsFromArray:taskArray]; [_taskListDataArray addObjectsFromArray:taskArray];
...@@ -210,20 +212,18 @@ ...@@ -210,20 +212,18 @@
{ {
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL]; NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
NSLog(@"uuurl = %@", url);
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url]; HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{ NSDictionary *parameters = @{
@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"], @"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}], //@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"pageNumber":@(0), @"pageNumber":@(0),
@"pageSize":@(10) @"pageSize":@(10)
}; };
NSLog(@"parameters = %@", parameters);
[MBProgressHUD showHUDAddedTo:self.view animated:YES]; [MBProgressHUD showHUDAddedTo:self.view animated:YES];
[httpCilent getInspectListWithParameters:parameters completion:^(id response, NSError *error) { [httpCilent getInspectListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"巡检列表%@", response); NSLog(@"inspect List ---11-- 巡检列表%@", response);
NSDictionary *dataDict = response[@"data"]; NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"]; NSArray *dataArray = dataDict[@"records"];
...@@ -231,6 +231,7 @@ ...@@ -231,6 +231,7 @@
for (NSDictionary *dict in dataArray) { for (NSDictionary *dict in dataArray) {
TaskListModel *taskList = [[TaskListModel alloc] init]; TaskListModel *taskList = [[TaskListModel alloc] init];
[taskList setValuesForKeysWithDictionary:dict]; [taskList setValuesForKeysWithDictionary:dict];
NSLog(@"taskList state = %@", taskList.state);
[tempArray addObject:taskList]; [tempArray addObject:taskList];
} }
_taskListDataArray = [NSMutableArray arrayWithArray:tempArray]; _taskListDataArray = [NSMutableArray arrayWithArray:tempArray];
...@@ -242,7 +243,7 @@ ...@@ -242,7 +243,7 @@
} else { } else {
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ self.tableView.footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
[self requestMoreList]; [self requestMoreList];
}]; }];
self.menuView.backgroundColor = kInspectSectionBackGroundColor; self.menuView.backgroundColor = kInspectSectionBackGroundColor;
......
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, CGFLOAT_MIN)];
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
}]; }];
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:-35]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:tableTop]; [self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
......
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