Files
OrderScheduling/OrderScheduling/Rescue/View/RefuseOrderConfirmView.swift
2023-08-29 17:40:42 +08:00

121 lines
4.4 KiB
Swift

//
// RefuseOrderConfirmView.swift
// OrderScheduling
//
// Created by on 2023/8/29.
//
import Foundation
import DDControlsKit_Private
import SnapKit
import DDAutoUIKit_Private
open class RefuseOrderConfirmView : DDView {
private let radiusView : DDView
private let scrollView : DDScrollView
private let scrollContentView : DDView
public let titleLabel : DDLabel
public let contentLabel : DDLabel
public let horizontalLine : DDView
public let verticalLine : DDView
public let cancelButton : DDButton
public let sureButton : DDButton
public override init(frame: CGRect) {
radiusView = DDView.init()
scrollView = DDScrollView()
scrollContentView = DDView.init()
titleLabel = DDLabel.dd_init(withText: "", font: .mediumFont(auto(16)), textColor: .black)
contentLabel = DDLabel.dd_init(withText: "", font: .mediumFont(auto(14)), textColor: .hex("203053"))
horizontalLine = DDView()
verticalLine = DDView()
cancelButton = DDButton.dd_initCustom()
sureButton = DDButton.dd_initCustom()
super.init(frame: frame)
radiusView.layer.cornerRadius = auto(10)
radiusView.layer.masksToBounds = true
addSubview(radiusView)
radiusView.addSubview(scrollView)
scrollView.addSubview(scrollContentView)
radiusView.addSubview(titleLabel)
contentLabel.numberOfLines = 0
contentLabel.textAlignment = .center
contentLabel.text = "确认取消订单吗?"
scrollContentView.addSubview(contentLabel)
horizontalLine.backgroundColor = .hex("979797").alpha(0.35)
radiusView.addSubview(horizontalLine)
verticalLine.backgroundColor = .hex("979797").alpha(0.35)
radiusView.addSubview(verticalLine)
cancelButton.titleLabel?.font = .mediumFont(auto(14))
cancelButton.backgroundColor = .white
cancelButton.setTitleColor(.black.alpha(0.3), for: .normal)
cancelButton.setTitle("取消", for: .normal)
radiusView.addSubview(cancelButton)
sureButton.titleLabel?.font = .mediumFont(auto(14))
sureButton.backgroundColor = .white
sureButton.setTitleColor(.white, for: .normal)
sureButton.setTitle("确定", for: .normal)
sureButton.backgroundColor = .hex("1C62D9")
radiusView.addSubview(sureButton)
radiusView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalToSuperview().offset(auto(20))
}
scrollView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(auto(10))
make.left.right.equalToSuperview()
make.bottom.equalTo(horizontalLine.snp.top).offset(0)
}
scrollContentView.snp.makeConstraints { make in
make.edges.equalToSuperview()
make.width.equalToSuperview()
}
contentLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(auto(20))
make.top.equalToSuperview()
make.right.equalTo(-auto(20))
make.height.greaterThanOrEqualTo(auto(40))
make.bottom.equalTo(scrollContentView)
}
horizontalLine.snp.makeConstraints { make in
make.bottom.equalToSuperview().offset(-auto(40))
make.left.right.equalToSuperview()
make.height.equalTo(1)
}
verticalLine.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(horizontalLine.snp.bottom)
make.bottom.equalToSuperview()
make.width.equalTo(1)
}
cancelButton.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.equalToSuperview()
make.top.equalTo(horizontalLine.snp.bottom)
make.right.equalTo(verticalLine.snp.left)
}
sureButton.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.right.equalToSuperview()
make.top.equalTo(horizontalLine.snp.bottom)
make.left.equalTo(verticalLine.snp.right)
}
}
public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}