lmw
2023-06-13 adf8013576cbdd12e5ebea8ff7e32baf5d558b27
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
package com.kuanzhai.user.network.entity
 
import android.os.Parcel
import android.os.Parcelable
import com.kuanzhai.user.R
import kotlinx.android.parcel.Parcelize
 
@Parcelize
data class Order(
    val differenceMoney: Double = 0.0,
    val chargeRule: String = "",
    val chargeRules: String = "",
    val serverCarModel: String = "",
    val cancelReason: String = "",
    val cancelRemark: String = "",
    val cancelUserType: Int = 0,
    val driverCancle: Int = 0, //driverCancle=1 司机取消
    val endAddress: String = "",
    val insertTime: String = "",
    val arriveTime: String = "",
    val invoice: Int = 0, //开票状态(1=未开票,2=已开票)
    val num: Int = 0,
    val driverId: Int = 0,
    val orderId: Int = 0,
    val orderName: String = "",
    val orderTime: String = "",
    val travelTime: String = "",
    val travelTime1: String = "",
    val driverPhone: String = "",
    val driverName: String = "",
    val brand: String = "",
    val driverAvatar: String = "",
    val licensePlate: String = "",
    val evaluate: String = "",
    val carColor: String = "",
    val orderType: Int = 0,
    val orderNum: Int = 0,
    val cancelId: Int = 0,
    val device: Int = 0,
    val score: Double = 0.0,
    val orderScore: Int = 0,
    val tipMoney: Double = 0.0,
    val payMoney: Double = 0.0,
    val endLat: Double = 0.0,
    val endLon: Double = 0.0,
    val startLat: Double = 0.0,
    val startLon: Double = 0.0,
    val cancelPayMoney: Double = 0.0,
    val cancelMoney: Double = 0.0,
    val orderMoney: Double = 0.0,
    val startAddress: String = "",
    val cargoType: String = "",
    val remark: String = "",
    val lineShiftTime: String = "",
    val startCity: String = "",
    val endCity: String = "",
    var state: Int = 0, //订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中,12=取消待支付)加个15作为改派成功
    var auditStatus: Int = -1, //审核状态(-1 其他正常订单 -2取消订单 0待审核 1审核通过 2拒绝)
    val auditRemark: String = "",
    val auditUser: String = "",
    val time: String = "",
    val travelMoney: Double = 0.0,
    val roadTollMoney: Double = 0.0,
    val parkMoney: Double = 0.0,
    val discountMoney: Double = 0.0,
    val couponMoney: Double = 0.0,
    val redPacketMoney: Double = 0.0,
    val startMoney: Double = 0.0,
    val startMileage: Double = 0.0,
    val duration: String = "",
    val carTime: Int = 0,
    val durationMoney: Double = 0.0,
    val mileage: Double = 0.0,
    val mileageMoney: Double = 0.0,
    val longDistance: Double = 0.0,
    val longDistanceMoney: Double = 0.0,
    val waitMoney: Double = 0.0,
    val wait: Double = 0.0,
    val peopleNumber: Int = 0,
    val rideType: Int = 0,  //乘车类型(1=独享,2=一口价,3=拼车)
    val spellSuccess: Int = 0,  //拼车'0未成功,1成功'
    val seatNumber: String = "",
    val fareTypeNote1: String = "",
    val fareTypeNote2: String = "",
    val fareTypeNote3: String = "",
    val contentExclusive: Rule = Rule(),
    val contentNotOne: Rule = Rule(),
    val contentNotTwo: Rule = Rule(),
    val contentNotThree: Rule = Rule(),
    val contentPrice: Rule = Rule(),
    val contentPutOne: Rule = Rule(),
    val contentPutTwo: Rule = Rule(),
    val contentPutThree: Rule = Rule(),
    val userImg: String = "",
    val driverImg: String = "",
    val pickUpCode: String = "",
    val thankYouFee: Double = 0.0,
    val holidayFee: Double = 0.0,
    val taxiCardMoney: Double = 0.0,
    val arriveTimeExpect: String = "",
    val endServiceTime: String = "",
    val orderAdditionalFeeWarpper: List<FeeWarpper> = arrayListOf(),
    val meetOrderList: List<SubOrder> = arrayListOf(),
    val giveOrderList: List<SubOrder> = arrayListOf()
    ) : Parcelable {
    fun getStateStr() = when(state){
        1->"等待应答"
        2,3->"等待接驾"
        4->"等待上车"
        5->"服务中"
        6->"待确认费用"
        7->"待支付"
        8->"待评价"
        9->"已完成"
        10->"已取消"
        11->"改派中"
        12->"取消待支付"
        else->""
    }
 
    fun getOfficialStateStr() = when(state){
        1->{
            when(auditStatus){
                0->"待处理"
                2->"已处理"
                -2->"已取消"
                else->"等待应答"
            }
        }
        2,3->"等待接驾"
        4->"等待上车"
        5->"服务中"
        6->"待确认费用"
        7->"待支付"
        8->"待评价"
        9->"已完成"
        10->"已取消"
        11->"改派中"
        12->"取消待支付"
        else->""
    }
 
    fun getCharterState() = when(state){
        1->"待处理"
        2->"已处理"
        3->"已取消"
        else->""
    }
 
    fun getRideTypeStr() = when(rideType){ //乘车类型(1=独享,2=一口价,3=拼车)
        1->"独享订单"
        2->"一口价订单"
        3->"拼车订单"
        else->""
    }
 
    //小件物流订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待取货,5=送货中,6=已送达,7=待支付,8=需补差价,9=已取货,10=已取消,11=改派中,12=已支付差价
    fun getLogisticsState() = when(state){
        1->"待接单"
        2->"待出发"
        3,4->"取货中"
        5->"送货中"
        6->"已送达"
        7->"待支付"
        8->"取货中(需补差价)"
        9->"已取货"
        10->"已取消"
        11->"改派中"
        12->"已支付差价"
        else->""
    }
 
    fun getStateColor() = when(state){
        7,8-> R.color.colorOrange
        10-> R.color.textColor66
        else->R.color.colorPrimary
    }
 
    fun getCharterStateColor() = when(state){
        3-> R.color.textColor66
        else->R.color.colorOrange
    }
}
 
@Parcelize
data class SubOrder(
    val arriveTime: String = "",
    val endAddress: String = "",
    val endLat: Double = 0.0,
    val endLon: Double = 0.0,
    val nickName: String = "",
    val orderId: Int = 0,
    val orderState: Int = 0,
    val payMoney: String = "",
    val peopleNumber: Int = 0,
    val phone: String = "",
    val seatNumber: String = "",
    val startAddress: String = "",
    val startLat: Double = 0.0,
    val startLon: Double = 0.0,
    val trackId: String = "",
    val travelTime: String = "",
    val travelTime_: String = "",
    val userId: Int = 0,
    var isSend :Boolean = false
):Parcelable{
    fun getAddress() = if (isSend) endAddress else startAddress
 
    fun getTitle(uid:Int,isCurrent:Boolean):String{
        val who = if (userId == uid) "你" else "尾号${phone.substring(7)}"
        val action = when(orderState){ //1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中,12=取消待支付
            2,3,4-> "%s%s".format(if (isSend) "送" else "接",who)
            5-> if (!isSend) "${who}已上车" else "送$who"
            6,7,8,9-> if (isSend)"${who}已送达" else "${who}已上车"
            else-> return ""
        }
        return if (isCurrent) "司机正在${action}" else action
    }
 
    fun getMarkName(uid:Int):String{
        val who = if (userId == uid) "你的" else "尾号:${phone.substring(7)}"
        return "${who}${if (isSend) "终点" else "起点"}"
    }
}
 
data class TrippingInfo(
    val lat: String = "",
    val laveMileage: String = "",
    val laveTime: String = "",
    val lon: String = "",
    val orderId: Int = 0,
    val orderType: Int = 0,
    val reassignNotice: String = "",
    val reservationMileage: String = "",
    val reservationTime: String = "",
    val servedMileage: String = "",
    val servedTime: String = "",
    val state: Int = 0
)
 
data class Coupon(
    val fullMoney: Double = 0.0,
    val id: Int = 0,
    val money: Double = 0.0,
    val name: String = "",
    val couponName: String = "",
    val time: String = "",
    val type: Int = 0, //1=抵扣,2=满减
    val state: String = "", //1: 未使用 2:已使用 3:已过期
    val userType: Int = 0 //(0=通用,1=快车/专车,2=出租车,3=城际,4=小件物流)
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readDouble(),
        parcel.readInt(),
        parcel.readDouble(),
        parcel.readString()?:"",
        parcel.readString()?:"",
        parcel.readString()?:"",
        parcel.readInt(),
        parcel.readString()?:"",
        parcel.readInt()
    ) {
    }
 
    fun getTypeStr() = when(userType){
        0->"通用优惠券"
        1->"快车/专车优惠券"
        2->"出租车优惠券"
        3->"跨城出行优惠券"
        4->"小件物流"
        else->""
    }
    fun getTypeBg() = when(userType){
        0->R.mipmap.bg_coupon_orange
        1->R.mipmap.bg_coupon_green
        2->R.mipmap.bg_coupon_blue
        3->R.mipmap.bg_coupon_red
        else->R.mipmap.bg_coupon_grey
    }
    fun getRangeStr() = when(userType){
        0->"快车/专车、出租车、跨城出行都可使用"
        1->"仅限快车/专车使用"
        2->"仅限出租车使用"
        3->"仅限跨城出行使用"
        4->"仅限小件物流使用"
        else->""
    }
    fun getCardRangeStr() = when(userType){
        0->"快车/专车,出租车,跨城出行,小件物流"
        1->"快车/专车"
        2->"出租车"
        3->"跨城出行"
        4->"小件物流"
        else->""
    }
    fun getNameStr() = if (name.length <= 6) name else "${name.substring(0,6)}..."
    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeDouble(fullMoney)
        parcel.writeInt(id)
        parcel.writeDouble(money)
        parcel.writeString(name)
        parcel.writeString(couponName)
        parcel.writeString(time)
        parcel.writeInt(type)
        parcel.writeString(state)
        parcel.writeInt(userType)
    }
 
    override fun describeContents(): Int {
        return 0
    }
 
    companion object CREATOR : Parcelable.Creator<Coupon> {
        override fun createFromParcel(parcel: Parcel): Coupon {
            return Coupon(parcel)
        }
 
        override fun newArray(size: Int): Array<Coupon?> {
            return arrayOfNulls(size)
        }
    }
}
 
data class Point(
    val lat:Double = 0.0,
    val lon:Double = 0.0
)
 
data class FeeWarpper(val additionalFee:Double,val name:String) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readDouble(),
        parcel.readString()?:""
    ) {
    }
 
    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeDouble(additionalFee)
        parcel.writeString(name)
    }
 
    override fun describeContents(): Int {
        return 0
    }
 
    companion object CREATOR : Parcelable.Creator<FeeWarpper> {
        override fun createFromParcel(parcel: Parcel): FeeWarpper {
            return FeeWarpper(parcel)
        }
 
        override fun newArray(size: Int): Array<FeeWarpper?> {
            return arrayOfNulls(size)
        }
    }
}