-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathOrderModel.m
More file actions
145 lines (134 loc) · 4.21 KB
/
OrderModel.m
File metadata and controls
145 lines (134 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//
// OrderModel.m
// DuDu
//
// Created by i-chou on 12/28/15.
// Copyright © 2015 i-chou. All rights reserved.
//
#import "OrderModel.h"
#import "MainViewController.h"
@implementation OrderModel
+ (NSDictionary *)JSONKeyPathsByPropertyKey
{
return @{
@"user_id" : @"user_id",
@"start_lat" : @"start_lat",
@"start_lng" : @"start_lng",
@"star_loc_str" : @"star_loc_str",
@"dest_lat" : @"dest_lat",
@"dest_lng" : @"dest_lng",
@"dest_loc_str" : @"dest_loc_str",
@"car_style" : @"car_style",
@"startTimeType" : @"startTimeType",
@"startTimeStr" : @"startTimeStr",
@"coupon_id" : @"coupon_id",
@"order_time" : @"order_time",
@"order_id" : @"order_id",
@"order_initiate_rate" : @"order_initiate_rate",
@"order_mileage" : @"order_mileage",
@"order_mileage_money" : @"order_mileage_money",
@"order_duration_money" : @"order_duration_money",
@"order_allMoney" : @"order_allMoney",
@"order_allTime" : @"order_allTime",
@"order_status" : @"order_status",
@"driver_status" : @"driver_status",
@"order_payStatus" : @"order_payStatus",
@"isbook" : @"isbook",
@"coupon_title" : @"coupon_title",
@"coupon_discount" : @"coupon_discount",
@"relevance_id" : @"relevance_id",
@"evaluate_level" : @"evaluate_level",
@"car_position_id" : @"car_position_id",
@"car_color" : @"car_color",
@"car_plate_number" : @"car_plate_number",
@"driver_nickname" : @"driver_nickname",
@"driver_telephone" : @"driver_telephone",
@"driver_photo" : @"driver_photo",
@"car_brand" : @"car_brand",
@"location" : @"location",
@"free_ride_telephone" : @"free_ride_telephone",
@"car_style_flg" : @"car_style_flg",
};
}
+ (NSString *)managedObjectEntityName {
return @"OrderModel";
}
+ (NSDictionary *)managedObjectKeysByPropertyKey {
return nil;
}
//order_status:
//0.等待派单 2.司机前往 3. 开始乘车, 4到达目的地等待付款 ,5 订单完成, 6.乘客取消订单, 7司机取消订单
- (NSString *)order_status_str
{
switch ([_order_status intValue]) {
case 0:
return @"等待派单";
break;
case 2:
return @"司机前往";
break;
case 3:
return @"开始乘车";
break;
case 4:
return @"待付款";
break;
case 5:
return @"已付款";
break;
case 6:
return @"乘客取消订单";
break;
case 7:
return @"司机取消订单";
break;
default:
return @"";
break;
}
}
//driver_status:
//4=到达目的地等待付费,5=完成,付费成功。7司机取消
- (NSString *)driver_status_str
{
switch ([_driver_status intValue]) {
case 4:
return @"未付款";
break;
case 5:
return @"已付费";
break;
case 7:
return @"司机取消";
break;
default:
return @"";
break;
}
}
//order_payStatus:
//支付区分 0。微信支付。1.现金支付
- (NSString *)order_payStatus_str
{
switch ([_order_payStatus intValue]) {
case 0:
return @"微信支付";
break;
case 1:
return @"现金支付";
break;
default:
return @"";
break;
}
}
- (float)night_service_times
{
for (CarModel *car in [MainViewController sharedMainViewController].carStyles) {
if (car.car_style_id == _car_style) {
return [car.night_service_times floatValue];
}
}
return 1.5;
}
@end