|
@@ -0,0 +1,94 @@
|
|
|
+//
|
|
|
+// ShoppingCartOrderPayFreightCell.swift
|
|
|
+// RainbowPlanet
|
|
|
+//
|
|
|
+// Created by Christopher on 2019/6/3.
|
|
|
+// Copyright © 2019 RainbowPlanet. All rights reserved.
|
|
|
+// 订单支付--运费Cell
|
|
|
+
|
|
|
+import UIKit
|
|
|
+
|
|
|
+class ShoppingCartOrderPayFreightCell: UITableViewCell {
|
|
|
+
|
|
|
+ class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingCartOrderPayFreightCell {
|
|
|
+ let ID = "ShoppingCartOrderPayFreightCell"
|
|
|
+ tableView.register(ShoppingCartOrderPayFreightCell.self, forCellReuseIdentifier: ID)
|
|
|
+ let cell : ShoppingCartOrderPayFreightCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ShoppingCartOrderPayFreightCell
|
|
|
+ cell.indexPath = indexPath
|
|
|
+ return cell
|
|
|
+ }
|
|
|
+
|
|
|
+ override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
|
|
+ super.init(style: style, reuseIdentifier: reuseIdentifier)
|
|
|
+ setupViews()
|
|
|
+ setupLayouts()
|
|
|
+ }
|
|
|
+
|
|
|
+ required init?(coder aDecoder: NSCoder) {
|
|
|
+ fatalError("init(coder:) has not been implemented")
|
|
|
+ }
|
|
|
+
|
|
|
+ var indexPath: IndexPath? {
|
|
|
+ didSet {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ override var frame: CGRect {
|
|
|
+ get {
|
|
|
+ return super.frame
|
|
|
+ }
|
|
|
+ set {
|
|
|
+ var frame = newValue
|
|
|
+ frame.origin.x += 14 * kScaleWidth
|
|
|
+ frame.size.width -= 14 * kScaleWidth * 2
|
|
|
+ super.frame = frame
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //MRAK: - 设置View
|
|
|
+ private func setupViews() {
|
|
|
+ self.selectionStyle = .none
|
|
|
+ addSubview(titleLabel)
|
|
|
+ addSubview(freightLabel)
|
|
|
+ addSubview(lineLabel)
|
|
|
+ }
|
|
|
+
|
|
|
+ private func setupLayouts() {
|
|
|
+ titleLabel.snp.makeConstraints { (make) in
|
|
|
+ make.left.equalTo(14)
|
|
|
+ make.top.bottom.equalToSuperview()
|
|
|
+ }
|
|
|
+ freightLabel.snp.makeConstraints { (make) in
|
|
|
+ make.right.equalTo(-14)
|
|
|
+ make.top.bottom.equalToSuperview()
|
|
|
+ }
|
|
|
+ lineLabel.snp.makeConstraints { (make) in
|
|
|
+ make.bottom.equalToSuperview()
|
|
|
+ make.left.equalTo(titleLabel)
|
|
|
+ make.right.equalTo(freightLabel)
|
|
|
+ make.height.equalTo(1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private lazy var titleLabel: UILabel = {
|
|
|
+ let titleLabel = UILabel()
|
|
|
+ titleLabel.text = "运费"
|
|
|
+ titleLabel.textColor = k333333Color
|
|
|
+ titleLabel.font = kRegularFont14
|
|
|
+ return titleLabel
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var freightLabel: UILabel = {
|
|
|
+ let freightLabel = UILabel()
|
|
|
+ freightLabel.textColor = k333333Color
|
|
|
+ freightLabel.font = kRegularFont14
|
|
|
+ freightLabel.text = priceConversion(price: 0)
|
|
|
+ return freightLabel
|
|
|
+ }()
|
|
|
+ private lazy var lineLabel: UILabel = {
|
|
|
+ let lineLabel = UILabel()
|
|
|
+ lineLabel.backgroundColor = kf5f5f5Color
|
|
|
+ return lineLabel
|
|
|
+ }()
|
|
|
+
|
|
|
+}
|