forked from lookingstars/meituan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2631c41
commit d0d11f2
Showing
14 changed files
with
273 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+3.05 KB
(110%)
meituan.xcworkspace/xcuserdata/jinzelu.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// ShopViewController.h | ||
// meituan | ||
// | ||
// Created by jinzelu on 15/7/7. | ||
// Copyright (c) 2015年 jinzelu. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface ShopViewController : UIViewController | ||
|
||
|
||
@property(nonatomic, strong) NSString *shopID; | ||
|
||
@property(nonatomic, strong) UITableView *tableView; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
// | ||
// ShopViewController.m | ||
// meituan | ||
// | ||
// Created by jinzelu on 15/7/7. | ||
// Copyright (c) 2015年 jinzelu. All rights reserved. | ||
// | ||
|
||
#import "ShopViewController.h" | ||
#import "NetworkSingleton.h" | ||
|
||
@interface ShopViewController ()<UITableViewDataSource,UITableViewDelegate> | ||
{ | ||
UILabel *_titleLabel; | ||
} | ||
|
||
@end | ||
|
||
@implementation ShopViewController | ||
|
||
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ | ||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; | ||
if (self) { | ||
self.hidesBottomBarWhenPushed = YES; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
// Do any additional setup after loading the view. | ||
self.view.backgroundColor = [UIColor whiteColor]; | ||
|
||
[self initData]; | ||
[self setNav]; | ||
[self initViews]; | ||
|
||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | ||
[self getShopData]; | ||
}); | ||
|
||
} | ||
|
||
- (void)didReceiveMemoryWarning { | ||
[super didReceiveMemoryWarning]; | ||
// Dispose of any resources that can be recreated. | ||
} | ||
|
||
-(void)initData{ | ||
|
||
} | ||
|
||
-(void)setNav{ | ||
UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screen_width, 64)]; | ||
backView.backgroundColor = RGB(250, 250, 250); | ||
[self.view addSubview:backView]; | ||
//下划线 | ||
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 63.5, screen_width, 0.5)]; | ||
lineView.backgroundColor = RGB(192, 192, 192); | ||
[backView addSubview:lineView]; | ||
|
||
//返回 | ||
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
backBtn.frame = CGRectMake(10, 30, 23, 23); | ||
[backBtn setImage:[UIImage imageNamed:@"btn_backItem"] forState:UIControlStateNormal]; | ||
[backBtn addTarget:self action:@selector(OnBackBtn:) forControlEvents:UIControlEventTouchUpInside]; | ||
[backView addSubview:backBtn]; | ||
|
||
//标题 | ||
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(screen_width/2-80, 30, 160, 30)]; | ||
_titleLabel.textAlignment = NSTextAlignmentCenter; | ||
// _titleLabel.textColor = [UIColor whiteColor]; | ||
_titleLabel.text = @"团购详情"; | ||
[backView addSubview:_titleLabel]; | ||
|
||
//收藏 | ||
UIButton *collectBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
collectBtn.frame = CGRectMake(screen_width-10-23, 30, 22, 22); | ||
[collectBtn setImage:[UIImage imageNamed:@"icon_collect"] forState:UIControlStateNormal]; | ||
[collectBtn setImage:[UIImage imageNamed:@"icon_collect_highlighted"] forState:UIControlStateHighlighted]; | ||
[backView addSubview:collectBtn]; | ||
|
||
//分享 | ||
UIButton *shareBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
shareBtn.frame = CGRectMake(screen_width-10-23-10-23, 30, 22, 22); | ||
[shareBtn setImage:[UIImage imageNamed:@"icon_merchant_share_normal"] forState:UIControlStateNormal]; | ||
[shareBtn setImage:[UIImage imageNamed:@"icon_merchant_share_highlighted"] forState:UIControlStateHighlighted]; | ||
[backView addSubview:shareBtn]; | ||
|
||
|
||
} | ||
|
||
-(void)OnBackBtn:(UIButton *)sender{ | ||
[self.navigationController popViewControllerAnimated:YES]; | ||
} | ||
|
||
-(void)initViews{ | ||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, screen_width, screen_height-64) style:UITableViewStyleGrouped]; | ||
self.tableView.delegate = self; | ||
self.tableView.dataSource =self; | ||
[self.view addSubview:self.tableView]; | ||
} | ||
|
||
|
||
-(void)getShopData{ | ||
NSString *Str1 = @"http://api.meituan.com/group/v1/deal/list/id/"; | ||
NSString *Str2 = @"?__skck=40aaaf01c2fc4801b9c059efcd7aa146&__skcy=4NDQ%2BojQ%2BZGArOWQCEgWI19Pzus%3D&__skno=803C28CE-8BA8-4831-B2DE-7BCD484348D9&__skts=1435888257.411030&__skua=bd6b6e8eadfad15571a15c3b9ef9199a&__vhost=api.mobile.meituan.com&ci=1&client=iphone&movieBundleVersion=100&msid=48E2B810-805D-4821-9CDD-D5C9E01BC98A2015-07-03-09-14430&userid=104108621&utm_campaign=AgroupBgroupC1080988208017226240_c0_e68cafa9e104898bb8bfcd78b64aef671D100Fab_i_group_5_3_poidetaildeallist__a__b___ab_chunceshishuju__a__a___ab_gxhceshi__nostrategy__leftflow___ab_gxhceshi0202__b__a___ab_pindaochangsha__a__leftflow___ab_xinkeceshi__b__leftflow___ab_gxtest__gd__leftflow___ab_waimaiwending__a__a___ab_gxh_82__nostrategy__leftflow___i_group_5_2_deallist_poitype__d__d___ab_b_food_57_purepoilist_extinfo__a__a___ab_pindaoshenyang__a__leftflow___ab_pindaoquxincelue0630__b__b1___ab_waimaizhanshi__b__b1___a20141120nanning__m1__leftflow___b1junglehomepagecatesort__b__leftflow___ab_i_group_5_5_onsite__b__b___ab_i_group_5_6_searchkuang__a__leftflowGhomepage_guess_27774127&utm_content=4B8C0B46F5B0527D55EA292904FD7E12E48FB7BEA8DF50BFE7828AF7F20BB08D&utm_medium=iphone&utm_source=AppStore&utm_term=5.7&uuid=4B8C0B46F5B0527D55EA292904FD7E12E48FB7BEA8DF50BFE7828AF7F20BB08D&version_name=5.7"; | ||
NSString *urlStr = [NSString stringWithFormat:@"%@%@%@",Str1,self.shopID,Str2]; | ||
|
||
// NSLog(@"urlStr:%@",urlStr); | ||
|
||
[[NetworkSingleton sharedManager] getShopResult:nil url:urlStr successBlock:^(id responseBody){ | ||
NSLog(@"店铺详情请求成功"); | ||
} failureBlock:^(NSString *error){ | ||
NSLog(@"店铺详情请求失败:%@",error); | ||
}]; | ||
} | ||
|
||
|
||
|
||
#pragma mark - UITableViewDataSource | ||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ | ||
return 2; | ||
} | ||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ | ||
if (section == 0) { | ||
return 3; | ||
}else if (section == 1){ | ||
return 3; | ||
}else{ | ||
return 1; | ||
} | ||
} | ||
|
||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ | ||
return 0.1; | ||
} | ||
|
||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ | ||
static NSString *cellIndentifier = @"shopCell"; | ||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIndentifier]; | ||
if (cell == nil) { | ||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIndentifier]; | ||
} | ||
|
||
|
||
cell.selectionStyle = UITableViewCellSelectionStyleNone; | ||
|
||
return cell; | ||
|
||
} | ||
|
||
|
||
|
||
#pragma mark - UITableViewDelegate | ||
|
||
|
||
|
||
|
||
|
||
|
||
/* | ||
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.