宽窄优行-由【嘉易行】项目成品而来
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
//  TravelCardBuyTCell.swift
//  OKProject
//
//  Created by 无故事王国 on 2022/2/10.
//  Copyright © 2022 yangwang. All rights reserved.
//
 
import UIKit
 
class TravelCardBuyTCell: UITableViewCell {
 
    @IBOutlet weak var typeNameL: UILabel!
    @IBOutlet weak var iconImg: UIImageView!
    @IBOutlet weak var couponNameL: UILabel!
    @IBOutlet weak var useDescL: UILabel!
    @IBOutlet weak var originPriceL: UILabel!
    @IBOutlet weak var discountPriceL: UILabel!
 
    var orderType:Int = 0
    var couponListModel:CouponListModel!{
        didSet{
            couponNameL.text = couponListModel.name
            useDescL.text = couponListModel.note
            originPriceL.text = String(format: "原价:%.2lf元", couponListModel.originalPrice)
            discountPriceL.text = String(format: "现价:%.2lf元", couponListModel.sellingPrice)
 
            var text = [String]()
            switch couponListModel.type {
                case .numberOfDiscounts:
                    text.append(String(format: "享%ld次打车打%@折", couponListModel.time,couponListModel.discounts.ld_formatFloat))
                case .dicountCard:
                    text.append(String(format: "每次打车最高抵扣%@元",couponListModel.discounts.ld_formatFloat))
                case .numberCard:
                    text.append(String(format: "享%ld次打车优惠%@元",couponListModel.time,couponListModel.discounts.ld_formatFloat))
                case .discountDayCard:
                    text.append(String(format: "每次打车打%@折",couponListModel.discounts.ld_formatFloat))
                case .expressCard:
                    text.append(String(format: "每次寄件打%@折",couponListModel.discounts.ld_formatFloat))
                case .expressPaket:
                    text.append(String(format: "送%ld张优惠券",couponListModel.couponNum))
            }
 
            if !couponListModel.cityName.isEmpty{
                text.append("\(couponListModel.cityName)可用")
            }
            useDescL.text = text.joined(separator: " | ")
 
            switch orderType {
                case 0:typeNameL.text = "通用"
                case 1:typeNameL.text = "快车/专车"
                case 2:typeNameL.text = "出租车"
                case 3:typeNameL.text = "跨城出行"
                case 4:typeNameL.text = "同城物流"
                case 5:typeNameL.text = "跨城物流"
                default:typeNameL.text = "未知"
            }
        }
    }
 
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
}