宽窄优行-由【嘉易行】项目成品而来
younger_times
2023-07-05 0d8f5fc8a516bfd07e425909e4a4432600572ee7
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
//
//  TripPreferCardTCell.swift
//  OKProject
//
//  Created by 无故事王国 on 2022/2/17.
//  Copyright © 2022 yangwang. All rights reserved.
//
 
import UIKit
 
class TripPreferCardTCell: UITableViewCell {
 
    @IBOutlet weak var checkImg: UIImageView!
    @IBOutlet weak var titleL: UILabel!
    @IBOutlet weak var overdueTimeL: UILabel!
    @IBOutlet weak var infoL: UILabel!
 
    var paymentCouponModel:PaymentCouponModel!{
        didSet{
            titleL.text = paymentCouponModel.name
            overdueTimeL.text = String(format: "有效期至 %@", paymentCouponModel.time)
            var info = [String]()
            if paymentCouponModel.type == .discount{
                info.append(String(format: "每次打车打%@折", paymentCouponModel.money.ld_formatFloat))
            }
            if paymentCouponModel.type == .fullMinus{
                if paymentCouponModel.fullMoney == 0{
                    info.append(String(format: "每次打车减%@元",paymentCouponModel.money.ld_formatFloat))
                }else{
                    info.append(String(format: "每次打车满%@元减%@元", paymentCouponModel.fullMoney.ld_formatFloat,paymentCouponModel.money.ld_formatFloat))
                }
            }
            info.append(String(format: "%@可用", paymentCouponModel.city))
            infoL.text = info.joined(separator: " | ")
        }
    }
 
    override var isSelected: Bool{
        didSet{
            if isSelected{
                checkImg.image = UIImage(named: "icon_raidobutton_selected")
            }else{
                checkImg.image = UIImage(named: "icon_raidobutton")
            }
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
    }
}