Skip to content

Commit

Permalink
新增web界面
Browse files Browse the repository at this point in the history
  • Loading branch information
lookingstars committed Sep 29, 2015
1 parent eb03b37 commit c502507
Show file tree
Hide file tree
Showing 10 changed files with 284 additions and 7 deletions.
14 changes: 14 additions & 0 deletions nuomi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
E3A3FB681BBA6510000E9729 /* JZShopPingjiaCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E3A3FB671BBA6510000E9729 /* JZShopPingjiaCell.m */; };
E3A3FB6B1BBA652F000E9729 /* JZShopCommentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E3A3FB6A1BBA652F000E9729 /* JZShopCommentCell.m */; };
E3A3FB6E1BBA7127000E9729 /* JZShopSeeBuyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E3A3FB6D1BBA7127000E9729 /* JZShopSeeBuyCell.m */; };
E3A3FB721BBA8AE4000E9729 /* JZWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E3A3FB711BBA8AE4000E9729 /* JZWebViewController.m */; };
E3B7F05D1BB23600001F4E16 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E3B7F05C1BB23600001F4E16 /* main.m */; };
E3B7F0601BB23600001F4E16 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E3B7F05F1BB23600001F4E16 /* AppDelegate.m */; };
E3B7F0631BB23600001F4E16 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E3B7F0621BB23600001F4E16 /* ViewController.m */; };
Expand Down Expand Up @@ -317,6 +318,8 @@
E3A3FB6A1BBA652F000E9729 /* JZShopCommentCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JZShopCommentCell.m; sourceTree = "<group>"; };
E3A3FB6C1BBA7127000E9729 /* JZShopSeeBuyCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JZShopSeeBuyCell.h; sourceTree = "<group>"; };
E3A3FB6D1BBA7127000E9729 /* JZShopSeeBuyCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JZShopSeeBuyCell.m; sourceTree = "<group>"; };
E3A3FB701BBA8AE4000E9729 /* JZWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JZWebViewController.h; sourceTree = "<group>"; };
E3A3FB711BBA8AE4000E9729 /* JZWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JZWebViewController.m; sourceTree = "<group>"; };
E3B7F0571BB23600001F4E16 /* nuomi.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = nuomi.app; sourceTree = BUILT_PRODUCTS_DIR; };
E3B7F05B1BB23600001F4E16 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E3B7F05C1BB23600001F4E16 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -724,6 +727,15 @@
path = "店铺详情";
sourceTree = "<group>";
};
E3A3FB6F1BBA8AC7000E9729 /* 网页 */ = {
isa = PBXGroup;
children = (
E3A3FB701BBA8AE4000E9729 /* JZWebViewController.h */,
E3A3FB711BBA8AE4000E9729 /* JZWebViewController.m */,
);
path = "网页";
sourceTree = "<group>";
};
E3B7F04E1BB23600001F4E16 = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1216,6 +1228,7 @@
E3B7F2341BB3C83D001F4E16 /* 首页 */ = {
isa = PBXGroup;
children = (
E3A3FB6F1BBA8AC7000E9729 /* 网页 */,
E3A3FB491BB9310E000E9729 /* 店铺详情 */,
E3A3FB351BB90961000E9729 /* 主题 */,
E3A3FB311BB90880000E9729 /* 精选抢购 */,
Expand Down Expand Up @@ -1681,6 +1694,7 @@
E3B7F0601BB23600001F4E16 /* AppDelegate.m in Sources */,
E3A3FB461BB91906000E9729 /* NSString+convertImgStr.m in Sources */,
E3A3FB3C1BB90D01000E9729 /* JZTopicImageCell.m in Sources */,
E3A3FB721BBA8AE4000E9729 /* JZWebViewController.m in Sources */,
E3B7F2381BB3C866001F4E16 /* JZHomeViewController.m in Sources */,
E3A3FB381BB9097B000E9729 /* JZTopicViewController.m in Sources */,
E3A3FB651BBA5F6C000E9729 /* JZShopNoticeCell.m in Sources */,
Expand Down
Binary file not shown.
55 changes: 51 additions & 4 deletions nuomi/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
<outlet property="imgView" destination="LHf-za-qR2" id="sJT-SB-k9h"/>
<outlet property="subtitleLabel" destination="qPI-hv-SW7" id="Plk-ku-Ggg"/>
<outlet property="titleLabel" destination="ZwW-8q-cdO" id="Ls8-Af-FWd"/>
<segue destination="MhT-yS-uJu" kind="push" id="9Ux-zD-vuS"/>
<segue destination="MhT-yS-uJu" kind="push" identifier="pushTopicSegue" id="9Ux-zD-vuS"/>
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" restorationIdentifier="JZHomeShopCell" selectionStyle="default" indentationWidth="10" reuseIdentifier="JZHomeShopCell" rowHeight="96" id="H6s-qF-MgD" customClass="JZHomeShopCell">
Expand Down Expand Up @@ -586,6 +586,7 @@
<outlet property="shopDesLabel" destination="B6q-Mg-1md" id="zu6-sP-xMt"/>
<outlet property="shopImageView" destination="BL1-wE-yZs" id="B7h-mf-exh"/>
<outlet property="shopNameLabel" destination="6Sm-Bt-Ffx" id="fSW-A8-MFd"/>
<segue destination="OvW-pp-SF4" kind="push" id="Pzg-rT-esF"/>
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="m7I-hc-SRl">
Expand Down Expand Up @@ -622,6 +623,7 @@
<outlet property="cityNameLabel" destination="w9o-zp-KCP" id="AgB-jZ-lT8"/>
<outlet property="searchTextField" destination="9VA-F4-ItF" id="ahd-qE-wBa"/>
<outlet property="tableView" destination="nbQ-gQ-Bh6" id="zFl-Hg-LMM"/>
<segue destination="ij4-Aj-Wvw" kind="push" id="9oe-KH-qVB"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="YLT-hU-xMI" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -663,12 +665,53 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4cu-65-SqS" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1534" y="-1265"/>
<point key="canvasLocation" x="1548.5" y="-1801.5"/>
</scene>
<!--web-->
<scene sceneID="OHL-DX-mWF">
<objects>
<viewController storyboardIdentifier="JZWebViewController" title="web" hidesBottomBarWhenPushed="YES" id="ij4-Aj-Wvw" customClass="JZWebViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="mLU-b8-zSu"/>
<viewControllerLayoutGuide type="bottom" id="Max-ZH-6dA"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="xpf-H8-HJh">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="inB-iH-tdS">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="delegate" destination="ij4-Aj-Wvw" id="Tyr-HY-ZoK"/>
</connections>
</webView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="inB-iH-tdS" firstAttribute="top" secondItem="xpf-H8-HJh" secondAttribute="top" id="HM1-mP-kWa"/>
<constraint firstAttribute="bottom" secondItem="inB-iH-tdS" secondAttribute="bottom" id="Mpn-Gd-fN0"/>
<constraint firstItem="inB-iH-tdS" firstAttribute="leading" secondItem="xpf-H8-HJh" secondAttribute="leading" id="PYK-Cr-Syx"/>
<constraint firstAttribute="trailing" secondItem="inB-iH-tdS" secondAttribute="trailing" id="j1s-kn-PZh"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="web" id="31x-ip-nrp">
<barButtonItem key="backBarButtonItem" title="返回" id="wY8-Ug-uxG"/>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<connections>
<outlet property="webView" destination="inB-iH-tdS" id="kQm-Ci-85Y"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="e7W-4r-xmj" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2117" y="-1571"/>
</scene>
<!--新用户立减-->
<scene sceneID="HKm-rb-5yf">
<objects>
<viewController hidesBottomBarWhenPushed="YES" id="MhT-yS-uJu" customClass="JZTopicViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="JZTopicViewController" hidesBottomBarWhenPushed="YES" id="MhT-yS-uJu" customClass="JZTopicViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="3bf-Jx-r1H"/>
<viewControllerLayoutGuide type="bottom" id="RXH-9d-uid"/>
Expand Down Expand Up @@ -807,7 +850,7 @@
<!--某店名-->
<scene sceneID="Nrx-bl-u8r">
<objects>
<viewController id="OvW-pp-SF4" customClass="JZShopViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="JZShopViewController" id="OvW-pp-SF4" customClass="JZShopViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="gWa-7r-HrZ"/>
<viewControllerLayoutGuide type="bottom" id="6KD-Eo-Mzu"/>
Expand Down Expand Up @@ -1036,6 +1079,7 @@
</view>
</barButtonItem>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="375" height="750"/>
<connections>
Expand Down Expand Up @@ -1089,4 +1133,7 @@
<image name="tabbar_voice_icon" width="40" height="40"/>
<image name="ugc_photo" width="68" height="68"/>
</resources>
<inferredMetricsTieBreakers>
<segue reference="Pzg-rT-esF"/>
</inferredMetricsTieBreakers>
</document>
69 changes: 69 additions & 0 deletions nuomi/Controller/首页/JZHomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#import "HomeMenuCell.h"
#import "JZAlbumCell.h"
#import "JZHomeBlock2Cell.h"
#import "JZTopicViewController.h"
#import "JZWebViewController.h"

@interface JZHomeViewController ()<UITableViewDataSource, UITableViewDelegate,JZAlbumDelegate,JZHomeBlock2Delegate>

Expand Down Expand Up @@ -58,6 +60,9 @@ - (void)viewDidLoad {

[self getHotData];
[self getRecommendData];
NSString *subStr = @"http%3A%2F%2Fhuodong.nuomi.com%2Factshow%2Fmobile%2Fcommon%2Fshort%2Fzhongqiu_manfan%3Fallcity%3D1%26key%3De492d73e8fed3aeac8a9321c94b77932%26cuid%3D11a2e62839f7bed05437dcb826be61a0c47a515c&hasshare=0&shareurl=http%3A%2F%2Fhuodong.nuomi.com%2Factshow%2Fmobile%2Fcommon%2Fshort%2Fzhongqiu_manfan_wap%3Fallcity%3D1";
subStr = [subStr stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"subStr :%@",subStr);
}

- (void)didReceiveMemoryWarning {
Expand Down Expand Up @@ -91,6 +96,7 @@ - (IBAction)OnMoreCityBtn:(id)sender {

//获取数据
-(void)getHotData {
// url内部添加有签名加密,所以只能把url写死,不能动态的改变url
NSString *url = @"http://app.nuomi.com/naserver/home/homepage?appid=ios&bduss=&channel=com_dot_apple&cityid=100010000&cuid=11a2e62839f7bed05437dcb826be61a0c47a515c&device=iPhone&ha=5&lbsidfa=ACAF9226-F987-417B-A708-C95D482A732D&location=39.989360%2C116.324490&logpage=Home&net=unknown&os=8.2&sheight=1334&sign=40c974d176568886ad0e72516645e23f&swidth=750&terminal_type=ios&timestamp=1442906717563&tn=ios&uuid=11a2e62839f7bed05437dcb826be61a0c47a515c&v=5.13.0";
JZNetworkSingleton *request = [JZNetworkSingleton request];
request.classModel = @"JZHomepageModel";
Expand Down Expand Up @@ -135,6 +141,15 @@ -(void)getRecommendData {
}];
}

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"pushTopicSegue"]) {
JZTopicViewController *topicVC = segue.destinationViewController;
NSString *cont = [_homepageM.special.block_1 objectForKey:@"cont"];
topicVC.specialid = [NSString getSpecialId:cont];

}
}

#pragma mark - **************** UITableViewDataSource
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
Expand Down Expand Up @@ -261,11 +276,65 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
#pragma mark - **************** JZAlbumDelegate
-(void)didSelectedAlbumAtIndex:(NSInteger)index {
NSLog(@"index:%ld",index);
NSDictionary *dic = _homepageM.special.block_3[index];
NSInteger goto_type = [[dic objectForKey:@"goto_type"] integerValue];
if (goto_type == 2) {
//bainuo://web?
NSString *cont = [dic objectForKey:@"cont"];

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
JZWebViewController *VC = [sb instantiateViewControllerWithIdentifier:@"JZWebViewController"];
VC.url = [NSString getWebUrl:cont];
[self.navigationController pushViewController:VC animated:YES];
}else if (goto_type == 5){
//bainuo://topic?
NSString *cont = [dic objectForKey:@"cont"];
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
JZTopicViewController *VC = [sb instantiateViewControllerWithIdentifier:@"JZTopicViewController"];
// VC.specialid = [NSString getSpecialId:cont];

[self.navigationController pushViewController:VC animated:YES];

}else if (goto_type == 8){
//http://
NSString *cont = [dic objectForKey:@"cont"];

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
JZWebViewController *VC = [sb instantiateViewControllerWithIdentifier:@"JZWebViewController"];
VC.url = [NSString getComponentUrl:cont];
[self.navigationController pushViewController:VC animated:YES];
}
}

#pragma mark - **************** JZHomeBlock2Delegate
-(void)didSelectedHomeBlock2AtIndex:(NSInteger)index{
NSLog(@"block2 index:%ld",index);
NSDictionary *dic = _homepageM.special.block_2[index];
NSInteger goto_type = [[dic objectForKey:@"goto_type"] integerValue];
if (goto_type == 2) {
//bainuo://web?
NSString *cont = [dic objectForKey:@"cont"];

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
JZWebViewController *VC = [sb instantiateViewControllerWithIdentifier:@"JZWebViewController"];
VC.url = [NSString getWebUrl:cont];
[self.navigationController pushViewController:VC animated:YES];
}else if (goto_type == 5){
//bainuo://topic?

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
JZTopicViewController *VC = [sb instantiateViewControllerWithIdentifier:@"JZTopicViewController"];
[self.navigationController pushViewController:VC animated:YES];

}else if (goto_type == 8){
//http://
NSString *cont = [dic objectForKey:@"cont"];

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
JZWebViewController *VC = [sb instantiateViewControllerWithIdentifier:@"JZWebViewController"];
VC.url = [NSString getComponentUrl:cont];
[self.navigationController pushViewController:VC animated:YES];
}
}


Expand Down
12 changes: 9 additions & 3 deletions nuomi/Controller/首页/主题/JZTopicViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ - (void)viewDidLoad {
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
[self initData];
[self requestData];

NSLog(@"specialid:%@",self.specialid);
}

- (void)didReceiveMemoryWarning {
Expand All @@ -43,11 +45,15 @@ -(void)initData {
_dataSource = [[NSMutableArray alloc] init];
}


//197611
// url内部添加有签名加密,所以只能把url写死,不能动态的改变url
-(void)requestData {
NSString *url = @"http://112.80.255.88/naserver/home/special?appid=ios&bduss=&channel=com_dot_apple&cityid=100010000&cuid=11a2e62839f7bed05437dcb826be61a0c47a515c&device=iPhone&goods_per_page=15&ha=5&lbsidfa=ACAF9226-F987-417B-A708-C95D482A732D&location=39.989320%2C116.324530&logpage=ActivityList&net=wifi&os=8.2&page_idx=1&sheight=1334&sign=ee82e43ea40205f921e60fefe63fe138&special_id=197611&swidth=750&terminal_type=ios&timestamp=1443415146869&tn=ios&uuid=11a2e62839f7bed05437dcb826be61a0c47a515c&v=5.13.0";
// NSString *url = @"http://112.80.255.88/naserver/home/special";
NSString *url1 = @"http://112.80.255.88/naserver/home/special?appid=ios&bduss=&channel=com_dot_apple&cityid=100010000&cuid=11a2e62839f7bed05437dcb826be61a0c47a515c&device=iPhone&goods_per_page=15&ha=5&lbsidfa=ACAF9226-F987-417B-A708-C95D482A732D&location=39.989320%2C116.324530&logpage=ActivityList&net=wifi&os=8.2&page_idx=1&sheight=1334&sign=ee82e43ea40205f921e60fefe63fe138";
NSString *url2 = @"&swidth=750&terminal_type=ios&timestamp=1443415146869&tn=ios&uuid=11a2e62839f7bed05437dcb826be61a0c47a515c&v=5.13.0";
// NSString *url = [NSString stringWithFormat:@"%@&special_id=%@%@",url1,self.specialid,url2];
NSString *url = [NSString stringWithFormat:@"%@&special_id=%@%@",url1,@"197611",url2];

// NSString *url = @"http://112.80.255.88/naserver/home/special";
//采用这种方式请求不到数据,服务器提示『签名错误』
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
[dic setObject:@"ios" forKey:@"appid"];
Expand Down
2 changes: 2 additions & 0 deletions nuomi/Controller/首页/店铺详情/JZShopViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ - (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.

self.navigationController.navigationBarHidden = NO;

[self requestItemDetail];
[self requestComment];
[self requestRelatedData];
Expand Down
18 changes: 18 additions & 0 deletions nuomi/Controller/首页/网页/JZWebViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// JZWebViewController.h
// nuomi
//
// Created by jinzelu on 15/9/29.
// Copyright (c) 2015年 jinzelu. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface JZWebViewController : UIViewController

/**
* 传参
*/
@property (nonatomic, strong) NSString *url;

@end
Loading

0 comments on commit c502507

Please sign in to comment.