Commit e4100e20 authored by admin's avatar admin

添加查询的viewcontroller

parent 97ac91c6
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AE900CC8E6ED3E19DFF18311"
BlueprintIdentifier = "17AE95F7A9A9C3B92C332D3E"
BuildableName = "libAFNetworking.a"
BlueprintName = "AFNetworking"
ReferencedContainer = "container:Pods.xcodeproj">
......
......@@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "747D7E0958082D17803EDDAC"
BlueprintIdentifier = "199D7984E4C79F2FE827B9F7"
BuildableName = "libPods.a"
BlueprintName = "Pods"
ReferencedContainer = "container:Pods.xcodeproj">
......
......@@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2BC52E53FCF0B8169EC62C4C"
BlueprintIdentifier = "16353C21856B847C437DDF61"
BuildableName = "libSDWebImage.a"
BlueprintName = "SDWebImage"
ReferencedContainer = "container:Pods.xcodeproj">
......
......@@ -32,12 +32,12 @@
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>093DA7459B26B3BB6EA2FAB386E04977</key>
<key>4082B3C59B8C69587CDAABCA983AFFE3</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>4082B3C59B8C69587CDAABCA983AFFE3</key>
<key>4150E8A3021008E6683A19FD6B05DAA6</key>
<dict>
<key>primary</key>
<true/>
......@@ -47,12 +47,12 @@
<key>primary</key>
<true/>
</dict>
<key>641530337E97CC5094B7B5005825BE9E</key>
<key>933B39CD36B6FAC0DA6DDB684400CB16</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>89FEAF84E8C8693D1BADE75876809E36</key>
<key>977186E6F9960A96887076F1E839B1A1</key>
<dict>
<key>primary</key>
<true/>
......
......@@ -92,6 +92,7 @@
84D3E5F31C04BCD3001FF1DD /* InspectNotUploadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5F21C04BCD3001FF1DD /* InspectNotUploadViewController.m */; };
84D3E5F91C04BD8E001FF1DD /* InspectNotUpLoadCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5F81C04BD8E001FF1DD /* InspectNotUpLoadCell.m */; };
84D3E6021C04DA85001FF1DD /* InspectUpLoadFootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E6011C04DA85001FF1DD /* InspectUpLoadFootView.m */; };
84D554EE1C0EDFB8006C9AD0 /* SearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D554ED1C0EDFB8006C9AD0 /* SearchViewController.m */; };
84D80EB51BF714BE00A10EA4 /* GroupItems.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D80EB21BF714BE00A10EA4 /* GroupItems.m */; };
84D80EB61BF714BE00A10EA4 /* GroupTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D80EB41BF714BE00A10EA4 /* GroupTabBar.m */; };
84D8257F1BDD2F7E00CC61F7 /* MineTableFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8257E1BDD2F7E00CC61F7 /* MineTableFooterView.m */; };
......@@ -311,6 +312,8 @@
84D3E5F81C04BD8E001FF1DD /* InspectNotUpLoadCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectNotUpLoadCell.m; sourceTree = "<group>"; };
84D3E6001C04DA85001FF1DD /* InspectUpLoadFootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectUpLoadFootView.h; sourceTree = "<group>"; };
84D3E6011C04DA85001FF1DD /* InspectUpLoadFootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectUpLoadFootView.m; sourceTree = "<group>"; };
84D554EC1C0EDFB8006C9AD0 /* SearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchViewController.h; sourceTree = "<group>"; };
84D554ED1C0EDFB8006C9AD0 /* SearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchViewController.m; sourceTree = "<group>"; };
84D80EB11BF714BE00A10EA4 /* GroupItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupItems.h; sourceTree = "<group>"; };
84D80EB21BF714BE00A10EA4 /* GroupItems.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupItems.m; sourceTree = "<group>"; };
84D80EB31BF714BE00A10EA4 /* GroupTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupTabBar.h; sourceTree = "<group>"; };
......@@ -1670,6 +1673,8 @@
children = (
84FD89F01BD9FC71006E442A /* HomeViewController.h */,
84FD89F11BD9FC71006E442A /* HomeViewController.m */,
84D554EC1C0EDFB8006C9AD0 /* SearchViewController.h */,
84D554ED1C0EDFB8006C9AD0 /* SearchViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
......@@ -1974,6 +1979,7 @@
8474C5991BE78BBC007DCF19 /* QuestionDetailCell.m in Sources */,
8474C5911BE78A85007DCF19 /* QuestionListTableCell.m in Sources */,
8490C4D71BF9DF1D006B6569 /* PictureStoryViewController.m in Sources */,
84D554EE1C0EDFB8006C9AD0 /* SearchViewController.m in Sources */,
84A673C01C0C7AEB000F828E /* FuncItem.m in Sources */,
84F1669B1BE715E40061D350 /* ZanButton.m in Sources */,
84CC34DF1C0953C3002F10E2 /* HandOutViewController.m in Sources */,
......
......@@ -51,6 +51,7 @@
#import <MBProgressHUD.h>
#import <MJRefresh.h>
#import "SearchViewController.h"
@interface HomeViewController () <UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate, UITextFieldDelegate, RankListHeaderDelegate>
@property (nonatomic, strong) UIImageView *bgImageView; // 背景
......@@ -1002,95 +1003,103 @@
return _tableView;
}
- (void)searchClick:(UIButton *)sender
{
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
// 口碑巡检
NSString *url1 = [NSString stringWithFormat:@"%@%@", kRedStarURL, kRankingListURL];
HttpClient *httpCilent1 = [[HttpClient alloc] initWithUrl:url1];
NSDictionary *parameters1 = @{
@"keyword":_searchTextField.text,
@"queryOrders":@[@{@"direction":@"asc"}],
@"pageNumber":@(0),
@"pageSize":@(3)
};
__block HomeViewController *weakSelf = self;
[httpCilent1 getRankingListWithParameters:parameters1 completion:^(id response, NSError *error) {
NSLog(@"口碑排名response = %@", response);
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
NSMutableArray *rankTempArr = [NSMutableArray array];
for (NSDictionary *ListDict in dataArray) {
RankListModel *rankList = [RankListModel rankListModelWithDict:ListDict];
[rankTempArr addObject:rankList];
}
weakSelf.allRankListArray = rankTempArr;
[self.tableView reloadData];
[MBProgressHUD hideHUDForView:self.view animated:YES];
}];
SearchViewController *searchVC = [[SearchViewController alloc] init];
searchVC.customStr = _searchTextField.text;
[self.navigationController pushViewController:searchVC animated:YES];
// 问题与知识
NSString *url2 = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQuestionListURL];
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSDictionary *parameters2 = @{
@"keyword":_searchTextField.text,
@"user":user_uuid,
@"scope":@"all",
@"pageNumber":@(0),
@"pageSize":@(2)
};
HttpClient *httpClient2 = [[HttpClient alloc] initWithUrl:url2];
[httpClient2 getQuestionListWithParameters:parameters2 completion:^(id response, NSError *error) {
NSDictionary *dataDict = (NSDictionary *)response[@"data"];
NSDictionary *recordsDict = (NSDictionary *)dataDict[@"records"];
NSLog(@"问题与知识列表recods = %@", response);
NSMutableArray *questionTempArr = [NSMutableArray array];
for (NSDictionary *questionDict in recordsDict) {
QuestionModel *question = [[QuestionModel alloc] init];
[question setValuesForKeysWithDictionary:questionDict];
[questionTempArr addObject:question];
}
weakSelf.allQuestionArray = questionTempArr;
[self.tableView reloadData];
[MBProgressHUD hideHUDForView:self.view animated:YES];
}];
// 口碑任务
NSString *url3 = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
HttpClient *httpCilent3 = [[HttpClient alloc] initWithUrl:url3];
NSDictionary *parameters3 = @{
@"keyword":_searchTextField.text,
@"userUuid":@"",
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"pageNumber":@(0),
@"pageSize":@(2)
};
[httpCilent3 getInspectListWithParameters:parameters3 completion:^(id response, NSError *error) {
NSLog(@"巡检列表%@", response);
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
NSMutableArray *inspectTempArr = [NSMutableArray array];
for (NSDictionary *dict in dataArray) {
TaskListModel *taskList = [[TaskListModel alloc] init];
[taskList setValuesForKeysWithDictionary:dict];
[inspectTempArr addObject:taskList];
}
_taskListDataArray = inspectTempArr;
[self.tableView reloadData];
[MBProgressHUD hideHUDForView:self.view animated:YES];
}];
[self.searchTextField resignFirstResponder];
}
//- (void)searchClick:(UIButton *)sender
//{
// [MBProgressHUD showHUDAddedTo:self.view animated:YES];
// // 口碑巡检
// NSString *url1 = [NSString stringWithFormat:@"%@%@", kRedStarURL, kRankingListURL];
// HttpClient *httpCilent1 = [[HttpClient alloc] initWithUrl:url1];
// NSDictionary *parameters1 = @{
// @"keyword":_searchTextField.text,
// @"queryOrders":@[@{@"direction":@"asc"}],
// @"pageNumber":@(0),
// @"pageSize":@(3)
// };
// __block HomeViewController *weakSelf = self;
// [httpCilent1 getRankingListWithParameters:parameters1 completion:^(id response, NSError *error) {
// NSLog(@"口碑排名response = %@", response);
// NSDictionary *dataDict = response[@"data"];
// NSArray *dataArray = dataDict[@"records"];
//
// NSMutableArray *rankTempArr = [NSMutableArray array];
// for (NSDictionary *ListDict in dataArray) {
// RankListModel *rankList = [RankListModel rankListModelWithDict:ListDict];
// [rankTempArr addObject:rankList];
// }
// weakSelf.allRankListArray = rankTempArr;
// [self.tableView reloadData];
// [MBProgressHUD hideHUDForView:self.view animated:YES];
// }];
//
//
// // 问题与知识
// NSString *url2 = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQuestionListURL];
// NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
// NSDictionary *parameters2 = @{
// @"keyword":_searchTextField.text,
// @"user":user_uuid,
// @"scope":@"all",
// @"pageNumber":@(0),
// @"pageSize":@(2)
// };
//
// HttpClient *httpClient2 = [[HttpClient alloc] initWithUrl:url2];
// [httpClient2 getQuestionListWithParameters:parameters2 completion:^(id response, NSError *error) {
// NSDictionary *dataDict = (NSDictionary *)response[@"data"];
// NSDictionary *recordsDict = (NSDictionary *)dataDict[@"records"];
// NSLog(@"问题与知识列表recods = %@", response);
//
// NSMutableArray *questionTempArr = [NSMutableArray array];
//
// for (NSDictionary *questionDict in recordsDict) {
// QuestionModel *question = [[QuestionModel alloc] init];
// [question setValuesForKeysWithDictionary:questionDict];
// [questionTempArr addObject:question];
// }
// weakSelf.allQuestionArray = questionTempArr;
// [self.tableView reloadData];
// [MBProgressHUD hideHUDForView:self.view animated:YES];
// }];
//
//
// // 口碑任务
// NSString *url3 = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
// HttpClient *httpCilent3 = [[HttpClient alloc] initWithUrl:url3];
// NSDictionary *parameters3 = @{
// @"keyword":_searchTextField.text,
// @"userUuid":@"",
// @"queryOrders":@[@{@"field":@"lastModifyInfo"}],
// @"pageNumber":@(0),
// @"pageSize":@(2)
// };
//
// [httpCilent3 getInspectListWithParameters:parameters3 completion:^(id response, NSError *error) {
// NSLog(@"巡检列表%@", response);
// NSDictionary *dataDict = response[@"data"];
// NSArray *dataArray = dataDict[@"records"];
// NSMutableArray *inspectTempArr = [NSMutableArray array];
// for (NSDictionary *dict in dataArray) {
// TaskListModel *taskList = [[TaskListModel alloc] init];
// [taskList setValuesForKeysWithDictionary:dict];
// [inspectTempArr addObject:taskList];
// }
// _taskListDataArray = inspectTempArr;
// [self.tableView reloadData];
// [MBProgressHUD hideHUDForView:self.view animated:YES];
//
// }];
//
// [self.searchTextField resignFirstResponder];
//
//}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
......
//
// SearchViewController.h
// redstar
//
// Created by admin on 15/12/2.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SearchViewController : UIViewController
@property (nonatomic, copy) NSString *customStr;
@end
//
// SearchViewController.m
// redstar
//
// Created by admin on 15/12/2.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "SearchViewController.h"
@interface SearchViewController ()
@end
@implementation SearchViewController
- (void)viewDidLoad {
[super viewDidLoad];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:self.customStr];
customLab.textAlignment = NSTextAlignmentCenter;
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)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
self.tabBarController.tabBar.hidden = YES;
}
#pragma mark - Prative Methods
// 返回上一页面
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
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