| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- //
- // LNCreateOrderSuccessPanel.swift
- // Lanu
- //
- // Created by OneeChan on 2025/12/22.
- //
- import Foundation
- import UIKit
- import SnapKit
- class LNCreateOrderSuccessPanel: LNPopupView {
- private let costLabel = UILabel()
-
- override init(frame: CGRect) {
- super.init(frame: frame)
-
- setupViews()
- }
-
- func update(_ cost: Int) {
- costLabel.text = "\(cost)"
- }
-
- required init?(coder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
- }
- extension LNCreateOrderSuccessPanel {
- private func setupViews() {
- let bg = UIImageView()
- bg.image = .icOrderBg
- container.addSubview(bg)
- bg.snp.makeConstraints { make in
- make.horizontalEdges.equalToSuperview()
- make.top.equalToSuperview()
- }
-
- let ic = UIImageView()
- ic.image = .icOrderSuccess
- container.addSubview(ic)
- ic.snp.makeConstraints { make in
- make.centerX.equalToSuperview()
- make.top.equalToSuperview().offset(40)
- }
-
- let costView = UIView()
- container.addSubview(costView)
- costView.snp.makeConstraints { make in
- make.centerX.equalToSuperview()
- make.top.equalTo(ic.snp.bottom).offset(16)
- }
-
- let coin = UIImageView.coinImageView()
- costView.addSubview(coin)
- coin.snp.makeConstraints { make in
- make.leading.centerY.equalToSuperview()
- make.width.height.equalTo(24)
- }
-
- costLabel.font = .heading_h1
- costLabel.textColor = .text_5
- costView.addSubview(costLabel)
- costLabel.snp.makeConstraints { make in
- make.verticalEdges.equalToSuperview()
- make.trailing.equalToSuperview()
- make.leading.equalTo(coin.snp.trailing).offset(2)
- }
-
- let descLabel = UILabel()
- descLabel.text = .init(key: "A00120")
- descLabel.font = .heading_h2
- descLabel.textColor = .init(hex: "#1789FF")
- container.addSubview(descLabel)
- descLabel.snp.makeConstraints { make in
- make.centerX.equalToSuperview()
- make.top.equalTo(costView.snp.bottom).offset(2)
- }
-
- let confirmButton = UIButton()
- confirmButton.setTitle(.init(key: "A00002"), for: .normal)
- confirmButton.setTitleColor(.text_1, for: .normal)
- confirmButton.titleLabel?.font = .heading_h3
- confirmButton.setBackgroundImage(.primary_8, for: .normal)
- confirmButton.layer.cornerRadius = 23.5
- confirmButton.clipsToBounds = true
- confirmButton.addAction(UIAction(handler: { [weak self] _ in
- guard let self else { return }
- dismiss()
- }), for: .touchUpInside)
- container.addSubview(confirmButton)
- confirmButton.snp.makeConstraints { make in
- make.horizontalEdges.equalToSuperview().inset(12)
- make.top.equalTo(descLabel.snp.bottom).offset(49)
- make.bottom.equalToSuperview().offset(commonBottomInset)
- make.height.equalTo(47)
- }
- }
- }
|