Commit 18697307 authored by Sandy's avatar Sandy

订单详情界面

parent c2758b36
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "logistics_btn.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "logistics_btn@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -9,5 +9,6 @@
#import <UIKit/UIKit.h>
@interface OrderCellView : UIView
@property (weak, nonatomic) IBOutlet UILabel *labelTitle;
@end
......@@ -8,7 +8,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="OrderCellView">
<rect key="frame" x="0.0" y="0.0" width="320" height="140"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
......@@ -77,7 +77,10 @@
<constraint firstAttribute="bottom" secondItem="acf-qI-3N1" secondAttribute="bottom" constant="1" id="zcZ-yg-SPG"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="252" y="351"/>
<connections>
<outlet property="labelTitle" destination="dhI-dB-05Q" id="bF1-FF-LUO"/>
</connections>
<point key="canvasLocation" x="237" y="351"/>
</view>
</objects>
<resources>
......
//
// TransportedTableViewController.h
// OrderDetailTableViewCell.h
// ALand
//
// Created by Z on 16/3/30.
// Created by Z on 16/4/1.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TransportedTableViewController : UITableViewController
#import "OrderCellView.h"
@interface OrderDetailTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet OrderCellView *cellTopView;
@end
//
// OrderDetailTableViewCell.m
// ALand
//
// Created by Z on 16/4/1.
// Copyright © 2016年 Z. All rights reserved.
//
#import "OrderDetailTableViewCell.h"
@implementation OrderDetailTableViewCell
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
This diff is collapsed.
......@@ -7,11 +7,22 @@
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, ORDERTOPTYPE)
{
ORDERTOPTYPE_NOPAYMENT,//代支付
ORDERTOPTYPE_WAITFORDISPATCH,//待发货
ORDERTOPTYPE_TRANSPORTED,//已发货
ORDERTOPTYPE_COMMPLETE,//已完成
ORDERTOPTYPE_CANCELED//已取消
};
@interface OrderDetailTopView : UIView
@property (weak, nonatomic) IBOutlet UILabel *labelAddress;
@property (nonatomic) CGFloat viewHeight;
@property (weak, nonatomic) IBOutlet UILabel *labelRemark;
@property (nonatomic, assign) ORDERTOPTYPE orderType;
@property (nonatomic) CGFloat viewHeight;
- (void)updateTag;
- (CGFloat)viewHeight;
@end
......@@ -11,17 +11,49 @@
@interface OrderDetailTopView ()
@property (weak, nonatomic) IBOutlet UILabel *labelBottom;
@property (weak, nonatomic) IBOutlet UIView *labelLastView;
@property (weak, nonatomic) IBOutlet UIImageView *imageViewTag;
@end
@implementation OrderDetailTopView
- (void)awakeFromNib {
}
- (void)updateTag {
switch (self.orderType) {
case ORDERTOPTYPE_NOPAYMENT:
self.imageViewTag.image = [UIImage imageNamed:@"order_state_noPayment"];
break;
case ORDERTOPTYPE_WAITFORDISPATCH:
self.imageViewTag.image = [UIImage imageNamed:@"order_state_unstasport"];
break;
case ORDERTOPTYPE_TRANSPORTED:
self.imageViewTag.image = [UIImage imageNamed:@"order_state_transported"];
break;
case ORDERTOPTYPE_COMMPLETE:
break;
case ORDERTOPTYPE_CANCELED:
break;
default:
break;
}
}
- (CGFloat)viewHeight {
[self.labelLastView layoutIfNeeded];
return self.labelLastView.bottom;
}
/*
......
......@@ -9,7 +9,7 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="OrderDetailTopView"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="OrderDetailTopView">
<rect key="frame" x="0.0" y="0.0" width="320" height="419"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="405"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="订单信息" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lZw-qi-pdT">
......@@ -180,6 +180,14 @@
<constraint firstAttribute="height" constant="1" id="6rJ-qd-LaZ"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Y0-d9-PiW">
<rect key="frame" x="264" y="8" width="33" height="33"/>
<constraints>
<constraint firstAttribute="width" constant="33" id="mqd-63-s2Y"/>
<constraint firstAttribute="height" constant="33" id="yGR-cG-W4W"/>
</constraints>
<state key="normal" backgroundImage="call_icon"/>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
......@@ -187,6 +195,7 @@
<constraint firstAttribute="height" constant="49" id="B6a-9l-HQw"/>
<constraint firstItem="cmZ-vl-b4K" firstAttribute="bottom" secondItem="5It-5A-BoF" secondAttribute="bottomMargin" constant="1" id="Hcl-0P-p3u"/>
<constraint firstItem="cmZ-vl-b4K" firstAttribute="leading" secondItem="5It-5A-BoF" secondAttribute="leadingMargin" id="Sj3-w5-CBv"/>
<constraint firstItem="8Y0-d9-PiW" firstAttribute="centerY" secondItem="g9c-Jz-PuK" secondAttribute="centerY" id="Zea-Kf-Yul"/>
<constraint firstItem="g9c-Jz-PuK" firstAttribute="leading" secondItem="otl-rE-SZa" secondAttribute="trailing" id="cVt-0n-37E"/>
<constraint firstAttribute="trailingMargin" secondItem="cmZ-vl-b4K" secondAttribute="trailing" id="gDh-jj-d0J"/>
<constraint firstItem="g9c-Jz-PuK" firstAttribute="centerY" secondItem="otl-rE-SZa" secondAttribute="centerY" id="pl3-oG-dPc"/>
......@@ -339,6 +348,12 @@
<constraint firstItem="vYi-Qy-3u1" firstAttribute="leading" secondItem="Hqq-GG-0vG" secondAttribute="leading" constant="8" id="iQy-hP-XDv"/>
</constraints>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="order_state_noPayment" translatesAutoresizingMaskIntoConstraints="NO" id="j5Q-x8-oTR">
<rect key="frame" x="274" y="30" width="23" height="55"/>
<constraints>
<constraint firstAttribute="width" constant="23" id="jhb-yG-Hd8"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="0.91271875000000002" green="0.91271875000000002" blue="0.91271875000000002" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
......@@ -351,6 +366,7 @@
<constraint firstAttribute="trailing" secondItem="Hqq-GG-0vG" secondAttribute="trailing" id="AZk-IX-9qv"/>
<constraint firstAttribute="trailing" secondItem="frY-Ni-LsQ" secondAttribute="trailing" id="FKy-GF-z3v"/>
<constraint firstItem="o64-Kj-GIA" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="Jm5-Pg-aDC"/>
<constraint firstItem="8Y0-d9-PiW" firstAttribute="trailing" secondItem="j5Q-x8-oTR" secondAttribute="trailing" id="K20-BN-VQi"/>
<constraint firstItem="2rG-ti-JCC" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="8" id="Lxn-5D-jJr"/>
<constraint firstItem="o64-Kj-GIA" firstAttribute="top" secondItem="2rG-ti-JCC" secondAttribute="bottom" constant="8" id="Mcu-Hu-VWJ"/>
<constraint firstAttribute="trailing" secondItem="bza-2c-LTJ" secondAttribute="trailing" id="Mgb-q8-WOx"/>
......@@ -361,24 +377,33 @@
<constraint firstItem="2rG-ti-JCC" firstAttribute="top" secondItem="frY-Ni-LsQ" secondAttribute="bottom" constant="8" id="XcT-9r-g9E"/>
<constraint firstItem="bza-2c-LTJ" firstAttribute="top" secondItem="L3h-Sp-ioz" secondAttribute="bottom" id="YkW-OS-YNp"/>
<constraint firstItem="lZw-qi-pdT" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="8" id="bQ2-FC-VOb"/>
<constraint firstItem="frY-Ni-LsQ" firstAttribute="top" secondItem="j5Q-x8-oTR" secondAttribute="bottom" constant="1" id="bcv-OG-beS"/>
<constraint firstItem="bza-2c-LTJ" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="hLT-MA-zej"/>
<constraint firstItem="Hqq-GG-0vG" firstAttribute="top" secondItem="bza-2c-LTJ" secondAttribute="bottom" id="jnQ-W9-9Vc"/>
<constraint firstItem="g9c-Jz-PuK" firstAttribute="leading" secondItem="awy-IH-s2E" secondAttribute="leading" id="mQL-Q3-JHp"/>
<constraint firstItem="awy-IH-s2E" firstAttribute="leading" secondItem="hff-wW-3rZ" secondAttribute="leading" id="meE-2G-p9E"/>
<constraint firstAttribute="trailing" secondItem="kwe-gE-Axq" secondAttribute="trailing" id="om7-SC-jVz"/>
<constraint firstItem="j5Q-x8-oTR" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="30" id="pjr-xv-wJg"/>
<constraint firstItem="L3h-Sp-ioz" firstAttribute="top" secondItem="5It-5A-BoF" secondAttribute="bottom" id="q08-EE-UEC"/>
<constraint firstItem="frY-Ni-LsQ" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="sGS-9j-fcZ"/>
<constraint firstAttribute="trailing" secondItem="j5Q-x8-oTR" secondAttribute="trailing" constant="23" id="tsX-QC-o7X"/>
<constraint firstItem="5It-5A-BoF" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="uUC-Lu-AnR"/>
<constraint firstItem="lZw-qi-pdT" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="8" id="viX-wK-650"/>
<constraint firstItem="kwe-gE-Axq" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="yBd-cf-dda"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="imageViewTag" destination="j5Q-x8-oTR" id="2NC-gp-pZk"/>
<outlet property="labelAddress" destination="tAt-2m-H2J" id="boj-po-20q"/>
<outlet property="labelBottom" destination="vYi-Qy-3u1" id="83x-0X-p0i"/>
<outlet property="labelLastView" destination="Hqq-GG-0vG" id="w6d-o7-ZFl"/>
<outlet property="labelRemark" destination="wpt-Ta-hYY" id="upU-v3-G5V"/>
</connections>
<point key="canvasLocation" x="293" y="462.5"/>
<point key="canvasLocation" x="215" y="335.5"/>
</view>
</objects>
<resources>
<image name="call_icon" width="45" height="45"/>
<image name="order_state_noPayment" width="33" height="68"/>
</resources>
</document>
//
// CanceledTableViewController.h
// SeeLogistics.h
// ALand
//
// Created by Z on 16/3/30.
// Created by Z on 16/4/1.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CanceledTableViewController : UITableViewController
@interface SeeLogistics : UIView
@end
//
// SeeLogistics.m
// ALand
//
// Created by Z on 16/4/1.
// Copyright © 2016年 Z. All rights reserved.
//
#import "SeeLogistics.h"
@implementation SeeLogistics
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="SeeLogistics">
<rect key="frame" x="0.0" y="0.0" width="320" height="67"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BEp-i5-uuc">
<rect key="frame" x="52" y="12" width="216" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="216" id="QMg-u5-sI8"/>
<constraint firstAttribute="height" constant="44" id="saD-TZ-a7b"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="22"/>
<state key="normal" title="查看物流" backgroundImage="logistics_btn">
<color key="titleColor" red="0.48627450979999998" green="0.76470588240000004" blue="0.1450980392" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="l89-NE-khH">
<rect key="frame" x="0.0" y="0.0" width="320" height="1"/>
<color key="backgroundColor" red="0.70570833333333338" green="0.70570833333333338" blue="0.70570833333333338" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="hPW-Gv-6aX"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="BEp-i5-uuc" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="EvC-aV-7Ov"/>
<constraint firstItem="BEp-i5-uuc" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="N2E-Ng-G2d"/>
<constraint firstAttribute="trailing" secondItem="l89-NE-khH" secondAttribute="trailing" id="QEC-YP-ULd"/>
<constraint firstItem="l89-NE-khH" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="nTS-W6-4Xm"/>
<constraint firstItem="l89-NE-khH" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="ytH-o1-fbL"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="275" y="30.5"/>
</view>
</objects>
<resources>
<image name="logistics_btn" width="244" height="70"/>
</resources>
</document>
//
// CanceledTableViewController.m
// ALand
//
// Created by Z on 16/3/30.
// Copyright © 2016年 Z. All rights reserved.
//
#import "CanceledTableViewController.h"
#import "OrderTableViewCell.h"
#define kCellId @"OrderTableViewCell.h"
@interface CanceledTableViewController ()
@property (nonatomic, strong) NSArray *array;
@end
@implementation CanceledTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.array = @[@2,@3,@5,@10];
[self.tableView registerNib:[UINib nibWithNibName:@"OrderTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:kCellId];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 64, 0);
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 115 + 130 * [self.array[indexPath.row] integerValue];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
return self.array.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
OrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath];
// Configure the cell...
[cell cellWithViewNumber: [self.array[indexPath.row] integerValue]];
[cell setState:@"已取消"];
return cell;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return 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
//
// CommpleteTableViewController.h
// ALand
//
// Created by Z on 16/3/30.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CommpleteTableViewController : UITableViewController
@end
//
// CommpleteTableViewController.m
// ALand
//
// Created by Z on 16/3/30.
// Copyright © 2016年 Z. All rights reserved.
//
#import "CommpleteTableViewController.h"
#import "OrderTableViewCell.h"
#define kCellId @"OrderTableViewCell.h"
@interface CommpleteTableViewController ()
@property (nonatomic, strong) NSArray *array;
@end
@implementation CommpleteTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.array = @[@2,@3,@5,@10];
[self.tableView registerNib:[UINib nibWithNibName:@"OrderTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:kCellId];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 64, 0);
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 115 + 130 * [self.array[indexPath.row] integerValue];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
return self.array.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
OrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath];
// Configure the cell...
[cell cellWithViewNumber: [self.array[indexPath.row] integerValue]];
[cell setState:@"已完成"];
return cell;
}
@end
......@@ -9,6 +9,6 @@
#import <UIKit/UIKit.h>
@interface NoPaymentTableViewController : UITableViewController
@property (nonatomic, copy) NSString *state;
@property (nonatomic, copy) NSString *orderTag;
@end
......@@ -55,13 +55,26 @@
// Configure the cell...
[cell cellWithViewNumber: [self.array[indexPath.row] integerValue]];
[cell setState:@"待支付"];
[cell setState:_orderTag];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
OrderDetailViewController *orderDetailVC = [[OrderDetailViewController alloc] init];
if ([self.orderTag isEqualToString:@"代支付"]) {
orderDetailVC.orderType = ORDERTOPTYPE_NOPAYMENT;
}else if([self.orderTag isEqualToString:@"待发货"]){
orderDetailVC.orderType = ORDERTOPTYPE_WAITFORDISPATCH;
}else if ([self.orderTag isEqualToString:@"已发货"]){
orderDetailVC.orderType = ORDERTOPTYPE_TRANSPORTED;
}else if ([self.orderTag isEqualToString:@"已完成"]){
orderDetailVC.orderType = ORDERTOPTYPE_COMMPLETE;
}else if ([self.orderTag isEqualToString:@"已取消"]){
orderDetailVC.orderType = ORDERTOPTYPE_CANCELED;
}
[self.navigationController pushViewController:orderDetailVC animated:YES];
}
......
......@@ -7,7 +7,10 @@
//
#import "IBTUIViewController.h"
#import "OrderDetailTopView.h"
@interface OrderDetailViewController : IBTUIViewController
@property (nonatomic, strong) OrderDetailTopView *topView;
@property (nonatomic, assign) ORDERTOPTYPE orderType;
@end
......@@ -7,9 +7,12 @@
//
#import "OrderDetailViewController.h"
#import "OrderDetailTopView.h"
#import "NSString+Category.h"
@interface OrderDetailViewController ()
#import "OrderDetailTableViewCell.h"
#import "UITableView+Category.h"
#import "SeeLogistics.h"
#define kCellId @"OrderDetailTableViewCell.h"
@interface OrderDetailViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@end
......@@ -20,25 +23,49 @@
self.view.backgroundColor = kCustomGreenColor;
self.navigationItem.title = @"订单详情";
//tableView
self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"OrderDetailTableViewCell" cellId:kCellId];
self.tableView.frame = CGRectMake(0, 0, kWidth, kHeight);
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.backgroundColor = kBacroundColor;
[self.view addSubview:self.tableView];//topView
OrderDetailTopView *topView = [OrderDetailTopView viewWithNibName:@"OrderDetailTopView"];
topView.width = kWidth;
topView.labelAddress.text = [NSString randomTestText];
[self.view addSubview:topView];
CLog(@"%f",topView.viewHeight);
topView.labelRemark.text = [NSString randomTestText];
topView.frame = CGRectMake(0, -topView.viewHeight, kWidth, topView.viewHeight);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
topView.labelAddress.text = [NSString randomTestText];
CLog(@"%f",topView.viewHeight);
});
self.tableView.contentInset = UIEdgeInsetsMake(topView.viewHeight, 0, 64 + 65, 0);
[self.tableView addSubview:topView];
//改变tag
topView.orderType = self.orderType;
[topView updateTag];//根据
//底部查看物流按钮
if (self.orderType == ORDERTOPTYPE_TRANSPORTED) {
SeeLogistics *viewBottom = [SeeLogistics viewWithNibName:@"SeeLogistics"];
viewBottom.frame = CGRectMake(0, kHeight - 64 - 65, kWidth, 64 + 65);
[self.view addSubview:viewBottom];
}
// Do any additional setup after loading the view.
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 316;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
OrderDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath];
return cell;
}
- (void)setUpTableView {
}
......
......@@ -9,10 +9,6 @@
#import "OrderViewController.h"
#import "JavenMultipleViewWithHeader.h"
#import "NoPaymentTableViewController.h"
#import "WaitForDispatchTableViewController.h"
#import "TransportedTableViewController.h"
#import "CommpleteTableViewController.h"
#import "CanceledTableViewController.h"
@interface OrderViewController ()
@property (nonatomic, strong) JavenMultipleViewWithHeader *viewMutiple;
@end
......@@ -31,21 +27,15 @@
- (void)setUpView {
NoPaymentTableViewController *noPayMentVC = [[NoPaymentTableViewController alloc] init];
WaitForDispatchTableViewController *waitVC = [[WaitForDispatchTableViewController alloc] init];
TransportedTableViewController *transportedVC = [[TransportedTableViewController alloc] init];
CommpleteTableViewController *completeVC = [[CommpleteTableViewController alloc] init];
CanceledTableViewController *cancelVC = [[CanceledTableViewController alloc] init];
NSArray *arrVC = @[noPayMentVC, waitVC, transportedVC, completeVC, cancelVC];
NSArray *arrTitle = @[@"代支付",@"待发货",@"已发货",@"已完成",@"已取消"];
NSMutableArray *arrVC = [NSMutableArray array];
for (int i; i < arrTitle.count; i++) {
NoPaymentTableViewController *noPayMentVC = [[NoPaymentTableViewController alloc] init];
noPayMentVC.orderTag = arrTitle[i];
[arrVC addObject:noPayMentVC];
}
_viewMutiple = [[JavenMultipleViewWithHeader alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight)
views:arrVC
titles: arrTitle
......
//
// TransportedTableViewController.m
// ALand
//
// Created by Z on 16/3/30.
// Copyright © 2016年 Z. All rights reserved.
//
#import "TransportedTableViewController.h"
#import "OrderTableViewCell.h"
#define kCellId @"OrderTableViewCell.h"
@interface TransportedTableViewController ()
@property (nonatomic, strong) NSArray *array;
@end
@implementation TransportedTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.array = @[@2,@3,@5,@10];
[self.tableView registerNib:[UINib nibWithNibName:@"OrderTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:kCellId];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 64, 0);
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 115 + 130 * [self.array[indexPath.row] integerValue];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
return self.array.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
OrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath];
// Configure the cell...
[cell cellWithViewNumber: [self.array[indexPath.row] integerValue]];
[cell setState:@"已发货"];
return cell;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return 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
//
// WaitForDispatchTableViewController.h
// ALand
//
// Created by Z on 16/3/30.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WaitForDispatchTableViewController : UITableViewController
@end
//
// WaitForDispatchTableViewController.m
// ALand
//
// Created by Z on 16/3/30.
// Copyright © 2016年 Z. All rights reserved.
//
#import "WaitForDispatchTableViewController.h"
#import "OrderTableViewCell.h"
#define kCellId @"OrderTableViewCell.h"
@interface WaitForDispatchTableViewController ()
@property (nonatomic, strong) NSArray *array;
@end
@implementation WaitForDispatchTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.array = @[@2,@3,@5,@10];
[self.tableView registerNib:[UINib nibWithNibName:@"OrderTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:kCellId];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 64, 0);
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 115 + 130 * [self.array[indexPath.row] integerValue];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
return self.array.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
OrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath];
// Configure the cell...
[cell cellWithViewNumber: [self.array[indexPath.row] integerValue]];
[cell setState:@"待发货"];
return cell;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return 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
......@@ -18,10 +18,10 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tdr-oJ-D2D">
<rect key="frame" x="0.0" y="0.0" width="375" height="502"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" image="login_top" translatesAutoresizingMaskIntoConstraints="NO" id="gIO-Jz-jhA">
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="login_top" translatesAutoresizingMaskIntoConstraints="NO" id="gIO-Jz-jhA">
<rect key="frame" x="71" y="94" width="234" height="136"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Drd-sW-LYv">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Drd-sW-LYv">
<rect key="frame" x="32" y="274" width="311" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="300" id="1bQ-Cb-7AQ"/>
......@@ -40,7 +40,7 @@
<action selector="rigistAction:" destination="-1" eventType="touchUpInside" id="Qaf-df-5Yo"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Te4-Rx-W0K">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Te4-Rx-W0K">
<rect key="frame" x="32" y="348" width="311" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="300" id="do6-tj-oIb"/>
......
......@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>com.gomore.patrol</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
......
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