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)
|
}
|
}
|
}
|