Commit e6861c04 authored by Sandy's avatar Sandy

订单详情根据不同状态展示详情

parent 7d16f628
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon_order_car.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icon_order_car@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -26,7 +26,7 @@ typedef NS_ENUM(NSInteger, ORDERTOPTYPE) ...@@ -26,7 +26,7 @@ typedef NS_ENUM(NSInteger, ORDERTOPTYPE)
@property (nonatomic) CGFloat viewHeight; @property (nonatomic) CGFloat viewHeight;
- (void)updateByOrderType;
- (void)updateHeight; - (void)updateHeight;
@end @end
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "OrderDetailTopView.h" #import "OrderDetailTopView.h"
@interface OrderDetailTopView () @interface OrderDetailTopView ()
@property (weak, nonatomic) IBOutlet UIView *viewExpress;
@end @end
@implementation OrderDetailTopView @implementation OrderDetailTopView
...@@ -17,10 +18,21 @@ ...@@ -17,10 +18,21 @@
} }
- (void)updateByOrderType {
if (self.orderType == ORDERTOPTYPE_TRANSPORTED || self.orderType == ORDERTOPTYPE_COMMPLETE) {
[self.viewExpress removeFromSuperview];
}else{
[self.viewExpress removeFromSuperview];
}
}
- (void)updateHeight { - (void)updateHeight {
self.height = self.bottomView.bottom; self.height = self.bottomView.bottom;
} }
- (IBAction)actionCall:(id)sender { - (IBAction)actionCall:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", self.labelPhoneNumber.text]]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", self.labelPhoneNumber.text]]];
} }
......
...@@ -38,9 +38,12 @@ ...@@ -38,9 +38,12 @@
OrderDetailTopView *topView = [OrderDetailTopView viewWithNibName:@"OrderDetailTopView"]; OrderDetailTopView *topView = [OrderDetailTopView viewWithNibName:@"OrderDetailTopView"];
self.atopView = topView; self.atopView = topView;
self.atopView.orderType = self.orderType;
self.atopView.labelAddress.text = [NSString randomTestText]; self.atopView.labelAddress.text = [NSString randomTestText];
[self.tableView addSubview:topView]; [self.tableView addSubview:topView];
[self.atopView updateByOrderType];
self.bottomView = [OrderDetailBottomView viewWithNibName:@"OrderDetailBottomView"]; self.bottomView = [OrderDetailBottomView viewWithNibName:@"OrderDetailBottomView"];
self.bottomView.laberRemark.text = [NSString randomTestText]; self.bottomView.laberRemark.text = [NSString randomTestText];
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
<constraint firstAttribute="height" constant="30" id="bqM-pK-6q9"/> <constraint firstAttribute="height" constant="30" id="bqM-pK-6q9"/>
</constraints> </constraints>
</imageView> </imageView>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="1" placeholder="请输入手机号码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5eD-la-0j7"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="1" placeholder="请输入手机号码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5eD-la-0j7">
<rect key="frame" x="70" y="10" width="273" height="30"/> <rect key="frame" x="70" y="14" width="273" height="22"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/> <fontDescription key="fontDescription" type="system" pointSize="18"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
</textField> </textField>
......
...@@ -68,10 +68,12 @@ ...@@ -68,10 +68,12 @@
[self.manager GET:URLString parameters:parameters progress:^(NSProgress * _Nonnull downloadProgress) { [self.manager GET:URLString parameters:parameters progress:^(NSProgress * _Nonnull downloadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSDictionary *dic = responseObject; NSDictionary *dic = responseObject;
CLog(@"GET success!-------->%@", [dic JSONString]); CLog(@"GET success!-------->%@", [dic JSONString]);
success(task, responseObject); success(task, responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
CLog(@"GET请求失败!----->%@", [error localizedDescription]); CLog(@"GET请求失败!----->%@", [error localizedDescription]);
failure(task, error); failure(task, error);
}]; }];
......
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