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
package com.kuanzhai.user.network.entity
 
import com.kuanzhai.user.R
 
data class CouponOrCard(
    val city: String = "",
    val company: String = "",
    val dataType: Int = 0,
    val fullMoney: String = "",
    val id: Int = 0,
    val money: Double = 0.0,
    val name: String = "",
    val state: Int = 0,
    val time: String = "",
    val type: Int = 0,
    val userType: Int = 0,
    var check:Boolean = false
){
    fun getRangeStr() = when(userType){
        0->"快车/专车、出租车、跨城出行、小件物流都可使用"
        1->"仅限快车/专车使用"
        2->"仅限出租车使用"
        3->"仅限跨城出行使用"
        4->"仅限小件物流使用"
        else->""
    }
 
    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 getCompanyStr() = if (company.length <= 6) company else "${company.substring(0,6)}..."
 
}