Commit b3e1d946 authored by admin's avatar admin

修复首页显示

parent db5156eb
......@@ -95,6 +95,7 @@
84AD4F3D1BF4894D00BFB37C /* RankDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F3C1BF4894D00BFB37C /* RankDetailView.m */; };
84AD4F3F1BF498A900BFB37C /* ranking.plist in Resources */ = {isa = PBXBuildFile; fileRef = 84AD4F3E1BF498A900BFB37C /* ranking.plist */; };
84AD4F461BF4A9E800BFB37C /* RankHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F451BF4A9E800BFB37C /* RankHeadView.m */; };
84B4765A1C2E4B37006C6488 /* PicCategoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B476591C2E4B37006C6488 /* PicCategoryViewController.m */; };
84BB16A21C191A7F00383A64 /* OnLineResultFootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84BB16A11C191A7F00383A64 /* OnLineResultFootView.m */; };
84C9574D1BDB344900083584 /* UIBarButtonItem+Create.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C9574A1BDB344900083584 /* UIBarButtonItem+Create.m */; };
84C9574E1BDB344900083584 /* UIView+Frame.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C9574C1BDB344900083584 /* UIView+Frame.m */; };
......@@ -359,6 +360,8 @@
84AD4F3E1BF498A900BFB37C /* ranking.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ranking.plist; sourceTree = "<group>"; };
84AD4F441BF4A9E800BFB37C /* RankHeadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankHeadView.h; sourceTree = "<group>"; };
84AD4F451BF4A9E800BFB37C /* RankHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankHeadView.m; sourceTree = "<group>"; };
84B476581C2E4B37006C6488 /* PicCategoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PicCategoryViewController.h; sourceTree = "<group>"; };
84B476591C2E4B37006C6488 /* PicCategoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PicCategoryViewController.m; sourceTree = "<group>"; };
84BB16A01C191A7F00383A64 /* OnLineResultFootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineResultFootView.h; sourceTree = "<group>"; };
84BB16A11C191A7F00383A64 /* OnLineResultFootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineResultFootView.m; sourceTree = "<group>"; };
84C957491BDB344900083584 /* UIBarButtonItem+Create.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIBarButtonItem+Create.h"; sourceTree = "<group>"; };
......@@ -716,6 +719,7 @@
8426A4A71BDF0CD600E5FDF5 /* Picture */ = {
isa = PBXGroup;
children = (
84B476531C2E4B1C006C6488 /* PictureCategory */,
849A183D1C152CD400071600 /* AddPicture */,
8490C4C71BF9DEF0006B6569 /* PictureDetail */,
8490C4CB1BF9DEF0006B6569 /* PictureList */,
......@@ -1599,6 +1603,47 @@
path = Model;
sourceTree = "<group>";
};
84B476531C2E4B1C006C6488 /* PictureCategory */ = {
isa = PBXGroup;
children = (
84B476541C2E4B1C006C6488 /* Cell */,
84B476551C2E4B1C006C6488 /* Model */,
84B476561C2E4B1C006C6488 /* View */,
84B476571C2E4B1C006C6488 /* ViewController */,
);
path = PictureCategory;
sourceTree = "<group>";
};
84B476541C2E4B1C006C6488 /* Cell */ = {
isa = PBXGroup;
children = (
);
path = Cell;
sourceTree = "<group>";
};
84B476551C2E4B1C006C6488 /* Model */ = {
isa = PBXGroup;
children = (
);
path = Model;
sourceTree = "<group>";
};
84B476561C2E4B1C006C6488 /* View */ = {
isa = PBXGroup;
children = (
);
path = View;
sourceTree = "<group>";
};
84B476571C2E4B1C006C6488 /* ViewController */ = {
isa = PBXGroup;
children = (
84B476581C2E4B37006C6488 /* PicCategoryViewController.h */,
84B476591C2E4B37006C6488 /* PicCategoryViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
84C582E91BDDFACD00AF838D /* Cell */ = {
isa = PBXGroup;
children = (
......@@ -2416,6 +2461,7 @@
8480BEB21C143A4100E2F18F /* StateTableView.m in Sources */,
849B2F711C0CA22F005D809F /* AnnoContentTableViewCell.m in Sources */,
84A2270E1C229409002766DC /* RankPickView.m in Sources */,
84B4765A1C2E4B37006C6488 /* PicCategoryViewController.m in Sources */,
84D3E6021C04DA85001FF1DD /* InspectUpLoadFootView.m in Sources */,
84A673881C0B50B4000F828E /* OnLineCompleteViewController.m in Sources */,
8474C5991BE78BBC007DCF19 /* QuestionDetailCell.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "store_show@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "store_show@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "case_show@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "case_show@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "report_show@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "report_show@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -6,12 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "task_online@2x.png",
"filename" : "口碑巡检_功能一览@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_online@3x.png",
"filename" : "口碑巡检_功能一览@3x.png",
"scale" : "3x"
}
],
......
......@@ -6,12 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "口碑巡检_功能一览@2x.png",
"filename" : "praise_report@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "口碑巡检_功能一览@3x.png",
"filename" : "praise_report@3x.png",
"scale" : "3x"
}
],
......
......@@ -6,12 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "praise_standard@2x.png",
"filename" : "question_problem@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "praise_standard@3x.png",
"filename" : "question_problem@3x.png",
"scale" : "3x"
}
],
......
......@@ -6,12 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "praise_image@2x.png",
"filename" : "praise_standard@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "praise_image@3x.png",
"filename" : "praise_standard@3x.png",
"scale" : "3x"
}
],
......
......@@ -6,12 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "question_problem@2x.png",
"filename" : "praise_image@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "question_problem@3x.png",
"filename" : "praise_image@3x.png",
"scale" : "3x"
}
],
......
......@@ -6,12 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "praise_report@2x.png",
"filename" : "stor_icon_big@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "praise_report@3x.png",
"filename" : "stor_icon_big@3x.png",
"scale" : "3x"
}
],
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_online@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_online@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "store_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "store_icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@
#import "RankingListViewController.h"
#import "PictureViewController.h"
#import "QuestionViewController.h"
#import "PicCategoryViewController.h"
@interface FunctionViewController ()
@property (nonatomic, strong) UIView *lineView;
......@@ -50,12 +51,12 @@
#pragma mark - Private Methods
- (void)setup
{
[self.onLineSamplingBtn setTitle:@"口碑巡检" forState:UIControlStateNormal];
[self.wordOfMouthBtn setTitle:@"口碑排名" forState:UIControlStateNormal];
[self.standardBtn setTitle:@"问题与知识" forState:UIControlStateNormal];
[self.pictureBtn setTitle:@"图说口碑" forState:UIControlStateNormal];
[self.questionBtn setTitle:@"口碑标准" forState:UIControlStateNormal];
[self.rankBtn setTitle:@"在线抽查" forState:UIControlStateNormal];
[self.onLineSamplingBtn setTitle:@"口碑报告" forState:UIControlStateNormal];
[self.wordOfMouthBtn setTitle:@"商场风采" forState:UIControlStateNormal];
[self.standardBtn setTitle:@"图说口碑" forState:UIControlStateNormal];
[self.pictureBtn setTitle:@"口碑标准" forState:UIControlStateNormal];
[self.questionBtn setTitle:@"问题知识" forState:UIControlStateNormal];
[self.rankBtn setTitle:@"口碑巡检" forState:UIControlStateNormal];
//self.lineView.backgroundColor = kSeparateLineViewColor;
......@@ -80,9 +81,12 @@
} else if ([item.titleLabel.text isEqualToString:@"问题与知识"]) {
QuestionViewController *questionVC = [[QuestionViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:questionVC];
} else if ([item.titleLabel.text isEqualToString:@"口碑排名"]) {
} else if ([item.titleLabel.text isEqualToString:@"口碑报告"]) {
RankingListViewController *rankingListVC = [[RankingListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:rankingListVC];
} else if ([item.titleLabel.text isEqualToString:@"商场风采"]) {
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
} else {
return;
}
......
......@@ -10,6 +10,7 @@
#import "AddPictureTableCell.h"
#import "AddButtonTableViewCell.h"
#import "AddPicTextTableViewCell.h"
#import "CheckPicViewController.h"
#import "HttpClient.h"
......@@ -81,7 +82,10 @@
- (void)doBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您确定要放弃编辑当前图说口碑吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.tag = 9211232;
[alert show];
}
- (void)createImagePicker:(UIButton *)sender
......@@ -122,7 +126,8 @@
HttpClient *http1 = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"title":cell.contentTextView.text,
@"content":cell.titleTextView.text
@"content":cell.titleTextView.text,
@"type":@"store"
};
[http1 savePicturePraiseWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"6.1保存图说口碑 resp = %@, error = %@", response, error);
......@@ -143,7 +148,6 @@
UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
NSData *imageData = UIImageJPEGRepresentation(image, 0.5);
NSString *imageBase64 = [imageData base64EncodedStringWithOptions:0];
NSDictionary *parameters = @{
@"description":cell.titleTextView.text,
@"fileName":imageName,
......@@ -170,6 +174,13 @@
[imageData writeToFile:fullPath atomically:NO];
}
- (void)showBigPic:(UIButton *)sender
{
CheckPicViewController *checkVC = [[CheckPicViewController alloc] init];
checkVC.checkImage = sender.imageView.image;
[self.navigationController pushViewController:checkVC animated:YES];
}
#pragma mark - UItextView
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
......@@ -270,15 +281,46 @@
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
NSString *url = [NSString stringWithFormat:@"%@%@%@/submit?time=%@&operId=%@&operName=%@", kRedStarURL, kSubmitPicturePraiseURL,_praiseUuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *http1 = [[HttpClient alloc] initWithUrl:url];
[http1 submitPicturePraiseWithCompletion:^(id response, NSError *error) {
NSLog(@"6.3接口上传口碑图片 res = %@, error = %@", response, error);
if (response[@"success"]) {
[self.navigationController popViewControllerAnimated:YES];
}
}];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:(_rowNumber - 2) inSection:0];
AddPicTextTableViewCell *cell = [_tableView cellForRowAtIndexPath:indexPath]; if (_imageNameArray.count == _rowNumber - 2 || cell.titleTextView.text.length != 0) {
NSString *urlStr = [NSString stringWithFormat:@"%@%@%@/submit_attachment?time=%@&operId=%@&operName=%@", kRedStarURL, kUpLoadPictureURL, _praiseUuid ,dateString, operId, operName];
urlStr = [urlStr stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClinet = [[HttpClient alloc] initWithUrl:urlStr];
NSString *imageName = _imageNameArray[_rowNumber - 3];
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
NSData *imageData = UIImageJPEGRepresentation(image, 0.5);
NSString *imageBase64 = [imageData base64EncodedStringWithOptions:0];
NSDictionary *parameters = @{
@"description":cell.titleTextView.text,
@"fileName":imageName,
@"fileContent":imageBase64
};
[httpClinet upLoadPraisePictureWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"6.2上传口碑图片 resp = %@, error = %@", response, error);
NSString *url = [NSString stringWithFormat:@"%@%@%@/submit?time=%@&operId=%@&operName=%@", kRedStarURL, kSubmitPicturePraiseURL,_praiseUuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *http1 = [[HttpClient alloc] initWithUrl:url];
[http1 submitPicturePraiseWithCompletion:^(id response, NSError *error) {
NSLog(@"6.3接口上传口碑图片 res = %@, error = %@", response, error);
if (response[@"success"]) {
[self.navigationController popViewControllerAnimated:YES];
}
}];
}];
}
}
}
if (alertView.tag == 9211232) {
if (buttonIndex == 1) {
[self.navigationController popViewControllerAnimated:YES];
}
}
}
......@@ -322,19 +364,29 @@
UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
UIImage *image00 = [self cutImage:image];
[cell.photoButton setImage:image00 forState:UIControlStateNormal];
[cell.photoButton removeTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
[cell.photoButton addTarget:self action:@selector(showBigPic:) forControlEvents:UIControlEventTouchUpInside];
} else {
if (indexPath.row == _rowNumber - 2) {
[cell.photoButton setImage:[UIImage imageNamed:@"add-photo_icon"] forState:UIControlStateNormal];
[cell.photoButton removeTarget:self action:@selector(showBigPic:) forControlEvents:UIControlEventTouchUpInside];
[cell.photoButton addTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
} else {
NSString *imageName = _imageNameArray[indexPath.row - 1];
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
UIImage *image00 = [self cutImage:image];
[cell.photoButton setImage:image00 forState:UIControlStateNormal];
[cell.photoButton removeTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
[cell.photoButton addTarget:self action:@selector(showBigPic:) forControlEvents:UIControlEventTouchUpInside];
cell.titleTextView.userInteractionEnabled = NO;
}
}
cell.titleTextView.delegate = self;
[cell.photoButton addTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
}
......
//
// PicCategoryViewController.h
// redstar
//
// Created by admin on 15/12/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PicCategoryViewController : UIViewController
@end
//
// PicCategoryViewController.m
// redstar
//
// Created by admin on 15/12/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "PicCategoryViewController.h"
#import "StandardTableViewCell.h"
#import "PictureViewController.h"
#define kPicCategoryTableViewCell @"picCategoryViewCell"
@interface PicCategoryViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSArray *detailTitleArray;
@end
@implementation PicCategoryViewController
- (void)viewDidLoad {
[super viewDidLoad];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
[self setupNav];
self.titleArray = [NSArray arrayWithObjects:@"商场风采",@"优秀案例",@"巡店报告", nil];
self.detailTitleArray = [NSArray arrayWithObjects:@"SOP:标准作业程序",@"内部精品培训课程讲义资料...",@"专家讲师精品课程视频分享...", nil];
self.tableView.delegate = self;
self.tableView.dataSource = self;
}
- (void)setupNav
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"口碑标准"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
-(void)doBack:(id)sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - UItableView Delegate/DataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return _titleArray.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
StandardTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kPicCategoryTableViewCell];
if (!cell) {
cell = [[StandardTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPicCategoryTableViewCell];
}
cell.iconImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"pic_0%ld",(long)indexPath.section]];
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _titleArray[indexPath.section]];
cell.detailTitleLabel.text = [NSString stringWithFormat:@"%@", _detailTitleArray[indexPath.section]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 10;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
PictureViewController *sopVC = [[PictureViewController alloc] init];
sopVC.come = @"图说";
if (indexPath.section == 0) {
sopVC.category = @"store";
[self.navigationController pushViewController:sopVC animated:YES];
} else if (indexPath.section == 1) {
sopVC.category = @"casus";
[self.navigationController pushViewController:sopVC animated:YES];
} else {
sopVC.category = @"report";
[self.navigationController pushViewController:sopVC animated:YES];
}
}
#pragma mark - lazy laoding
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableFooterView = [[UIView alloc] init];
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 300.0;
[self.view addSubview:_tableView];
[self.view insertSubview:_tableView atIndex:0];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:tableLeft];
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom];
}
return _tableView;
}
@end
......@@ -14,15 +14,16 @@
self.descriptionText = value;
}
- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues{
Class cls = self.class;
for (NSString *key in keyedValues.allKeys) {
NSString *varName = [NSString stringWithFormat:@"_%@", key];
const char *c_key = [varName cStringUsingEncoding:NSUTF8StringEncoding];
Ivar var = class_getInstanceVariable(cls, c_key);
if (var) {
[self setValue:[keyedValues objectForKey:key] forKey:key];
}
}
}
//- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues{
// Class cls = self.class;
// for (NSString *key in keyedValues.allKeys) {
// NSString *varName = [NSString stringWithFormat:@"_%@", key];
// NSLog(@"varName ===== %@", varName);
// const char *c_key = [varName cStringUsingEncoding:NSUTF8StringEncoding];
// Ivar var = class_getInstanceVariable(cls, c_key);
// if (var) {
// [self setValue:[keyedValues objectForKey:key] forKey:key];
// }
// }
//}
@end
......@@ -15,6 +15,7 @@
@property (nonatomic, strong) UIImageView *titleImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *detailsLabel;
@property (nonatomic, strong) UILabel *adressLabel;
@property (nonatomic, strong) UILabel *dateLabel;
......
......@@ -32,10 +32,11 @@
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:@"发布时间: "];
self.dateLabel.text = [NSString stringWithFormat:@""];
} else {
self.dateLabel.text = [NSString stringWithFormat:@"发布时间: %@",pictureList.submitTime];
self.dateLabel.text = [[NSString stringWithFormat:@"%@",pictureList.submitTime] substringToIndex:10];
}
self.adressLabel.text = [NSString stringWithFormat:@"%@", pictureList.storePath];
if (pictureList.hotspot) {
self.hotLabel.hidden = NO;
......@@ -149,12 +150,38 @@
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_detailsLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-15];
[self.contentView addConstraint:titleRight];
NSLayoutConstraint *titleImageHeight = [NSLayoutConstraint constraintWithItem:_detailsLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40];
NSLayoutConstraint *titleImageHeight = [NSLayoutConstraint constraintWithItem:_detailsLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:23];
[self.contentView addConstraint:titleImageHeight];
}
return _detailsLabel;
}
- (UILabel *)adressLabel
{
if (!_adressLabel) {
_adressLabel = [[UILabel alloc] init];
_adressLabel.font = [UIFont systemFontOfSize:14.0];
_adressLabel.translatesAutoresizingMaskIntoConstraints = NO;
_adressLabel.numberOfLines = 0;
_adressLabel.textColor = kLightGray;
[self.contentView addSubview:_adressLabel];
NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_adressLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.detailsLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:titleImageTop];
NSLayoutConstraint *titleImageLeft = [NSLayoutConstraint constraintWithItem:_adressLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.titleImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:10];
[self.contentView addConstraint:titleImageLeft];
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_adressLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-15];
[self.contentView addConstraint:titleRight];
NSLayoutConstraint *titleImageHeight = [NSLayoutConstraint constraintWithItem:_adressLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:23];
[self.contentView addConstraint:titleImageHeight];
}
return _adressLabel;
}
- (UILabel *)dateLabel
{
if (!_dateLabel) {
......@@ -165,16 +192,16 @@
[self.contentView addSubview:_dateLabel];
NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:5];
NSLayoutConstraint *titleImageTop = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:7];
[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.titleImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:10];
[self.contentView addConstraint:titleImageLeft];
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.thumbBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:titleRight];
NSLayoutConstraint *titleImageHeight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:35];
NSLayoutConstraint *titleImageHeight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self.contentView addConstraint:titleImageHeight];
NSLayoutConstraint *titleImageBottom = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
......@@ -194,7 +221,7 @@
_thumbBtn.titleLabel.font = [UIFont systemFontOfSize:16.0];
[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:8];
[self.contentView addConstraint:titleImageTop];
NSLayoutConstraint *titleImageWidth = [NSLayoutConstraint constraintWithItem:_thumbBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.commentBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
......@@ -219,7 +246,7 @@
_commentBtn.titleLabel.font = [UIFont systemFontOfSize:16.0];
[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:8];
[self.contentView addConstraint:titleImageTop];
NSLayoutConstraint *titleImageWidth = [NSLayoutConstraint constraintWithItem:_commentBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:70];
......
......@@ -9,5 +9,6 @@
#import <UIKit/UIKit.h>
@interface PictureViewController : UIViewController
@property (nonatomic, strong) NSString *come;
@property (nonatomic, strong) NSString *category;
@end
......@@ -67,6 +67,8 @@
[self setupNav];
self.view.backgroundColor = [UIColor whiteColor];
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
......@@ -76,7 +78,6 @@
self.navigationController.navigationBar.translucent = NO;
}
_page = 0;
}
......@@ -86,7 +87,7 @@
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"图说口碑"];
[customLab setText:@"商场风采"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
......@@ -110,17 +111,21 @@
-(void)doBack:(id)sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
if ([self.come isEqualToString:@"首页"]) {
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
} else {
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)addClick:(UIButton *)sender
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
// [alert show];
// AddPictureViewController *addPic = [[AddPictureViewController alloc] init];
// [self.navigationController pushViewController:addPic animated:YES];
AddPictureViewController *addPic = [[AddPictureViewController alloc] init];
[self.navigationController pushViewController:addPic animated:YES];
}
- (void)requestPicturePraise
......@@ -131,8 +136,9 @@
NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQueryPicturePraiseURL];
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSDictionary *parameters = @{
@"scope":@"all",
@"user":user_uuid,
// @"scope":@"all",
@"type":self.category,
@"pageNumber":@(0),
@"pageSize":@(10)
};
......@@ -179,7 +185,9 @@
NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQueryPicturePraiseURL];
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSDictionary *parameters = @{
@"scope":@"all",
@"user":user_uuid,
@"type":self.category,
@"pageNumber":@(_page),
@"pageSize":@(10)
};
......@@ -386,7 +394,10 @@
NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys:
user_uuid,@"user",
@(0),@"pageNumber",
@(10),@"pageSize", nil];
@(10),@"pageSize",
self.category,@"type",
@"all",@"scope",
nil];
// 发起请求
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:urlStr];
......@@ -557,7 +568,9 @@
NSDictionary *parameters = @{@"user":user_uuid,
@"pageNumber":@(_page),
@"pageSize":@(10),
@"queryOrders":queryOrders
@"queryOrders":queryOrders,
@"type":self.category,
@"scope":@"all"
};
// 发起请求
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:urlStr];
......
......@@ -80,7 +80,7 @@
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"口碑排名"];
[customLab setText:@"口碑报告"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
......@@ -138,7 +138,7 @@
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
__block RankingListViewController *weakSelf = self;
[httpCilent getRankingListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"口碑排名response = %@", response);
NSLog(@"口碑报告response = %@", response);
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
......@@ -212,7 +212,7 @@
NSLog(@"parrrrrters = %@", parameters);
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[httpCilent getRankingListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"分区域 口碑排名response = %@ error = %@", response, error);
NSLog(@"分区域 口碑报告response = %@ error = %@", response, error);
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
......
......@@ -65,7 +65,7 @@
[super viewDidLoad];
//NSMutableArray *titleArray = [[NSUserDefaults standardUserDefaults] objectForKey:@"function"];
NSArray *titleArray = [NSArray arrayWithObjects:@"口碑巡检",@"口碑排名",@"问题知识", nil];
NSArray *titleArray = [NSArray arrayWithObjects:@"口碑巡检",@"口碑报告",@"问题知识", nil];
self.titleArray = [NSMutableArray arrayWithArray:titleArray];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
......@@ -99,10 +99,10 @@
}
if ([self.titleArray containsObject:@"口碑排名"]) {
if ([self.titleArray containsObject:@"口碑报告"]) {
self.allRankListArray = [NSMutableArray array];
if (_allRankListArray.count == 0) {
[_titleArray removeObject:@"口碑排名"];
[_titleArray removeObject:@"口碑报告"];
}
[self requestAllRankList];
}
......@@ -221,7 +221,7 @@
@"keyword":self.customStr
};
[httpCilent1 getRankingListWithParameters:parameters1 completion:^(id response, NSError *error) {
NSLog(@"口碑排名response = %@", response);
NSLog(@"口碑报告response = %@", response);
if ([(NSArray *)response[@"data"] count] == 0) {
return;
}
......@@ -245,8 +245,8 @@
}
if (_allRankListArray.count != 0) {
if (![_titleArray containsObject:@"口碑排名"]) {
[_titleArray addObject:@"口碑排名"];
if (![_titleArray containsObject:@"口碑报告"]) {
[_titleArray addObject:@"口碑报告"];
}
}
......@@ -323,11 +323,11 @@
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSUInteger s1 = [_titleArray indexOfObject:@"口碑巡检"];
NSUInteger s2 = [_titleArray indexOfObject:@"口碑排名"];
NSUInteger s2 = [_titleArray indexOfObject:@"口碑报告"];
NSUInteger s3 = [_titleArray indexOfObject:@"问题知识"];
if ([_titleArray[section] isEqualToString:@"口碑巡检"] && section == s1) {
return _taskListDataArray.count;
} else if ([_titleArray[section] isEqualToString:@"口碑排名"] && section == s2) {
} else if ([_titleArray[section] isEqualToString:@"口碑报告"] && section == s2) {
return _allRankListArray.count + 1;
} else if ([_titleArray[section] isEqualToString:@"问题知识"] && section == s3) {
return _allQuestionArray.count;
......@@ -343,7 +343,7 @@
{
NSUInteger s1 = [_titleArray indexOfObject:@"口碑巡检"];
NSUInteger s2 = [_titleArray indexOfObject:@"口碑排名"];
NSUInteger s2 = [_titleArray indexOfObject:@"口碑报告"];
NSUInteger s3 = [_titleArray indexOfObject:@"问题知识"];
if ([_titleArray[indexPath.section] isEqualToString:@"口碑巡检"] && indexPath.section == s1) {
InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell];
......@@ -358,7 +358,7 @@
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
cell.alreadyView.image = image;
return cell;
} else if ([_titleArray[indexPath.section] isEqualToString:@"口碑排名"] && indexPath.section == s2) {
} else if ([_titleArray[indexPath.section] isEqualToString:@"口碑报告"] && indexPath.section == s2) {
if (indexPath.row == 0) {
HomeTitleTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeTitleTableCell];
if (!cell) {
......
......@@ -50,7 +50,7 @@
self.view.backgroundColor = kSectionBackGroundColor;
self.titleArray = [NSMutableArray arrayWithObjects:@"配置项目",@"配置",@"帮助与反馈",@"关于",@"检查版本更新", nil];
self.titleArray = [NSMutableArray arrayWithObjects:@"配置",@"关于",@"检查版本更新", nil];
[self setupTableView];
......@@ -189,9 +189,9 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 4) {
if (indexPath.row == 2) {
[self getVersion];
} else if (indexPath.row == 3) {
} else if (indexPath.row == 1) {
AboutMeViewController *about = [[AboutMeViewController alloc] init];
[self.navigationController pushViewController:about animated:YES];
}
......
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