|
|
@@ -12,7 +12,7 @@ import SnapKit
|
|
|
|
|
|
class LNCreateOrderFromSkillListPanel: LNPopupView {
|
|
|
private let skillListView = UIStackView()
|
|
|
- private let priceLabel = UILabel()
|
|
|
+ private let costLabel = UILabel()
|
|
|
|
|
|
private let minusButton = UIButton()
|
|
|
private let countLabel = UILabel()
|
|
|
@@ -26,6 +26,7 @@ class LNCreateOrderFromSkillListPanel: LNPopupView {
|
|
|
} else {
|
|
|
minusButton.isEnabled = true
|
|
|
}
|
|
|
+ updatePrice()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -80,7 +81,7 @@ extension LNCreateOrderFromSkillListPanel {
|
|
|
let attrStr = NSMutableAttributedString(string: text)
|
|
|
let range = (text as NSString).range(of: "\(cost.toDisplay)")
|
|
|
attrStr.addAttribute(.font, value: UIFont.heading_h2, range: range)
|
|
|
- priceLabel.attributedText = attrStr
|
|
|
+ costLabel.attributedText = attrStr
|
|
|
}
|
|
|
|
|
|
private func setupViews() {
|
|
|
@@ -181,10 +182,24 @@ extension LNCreateOrderFromSkillListPanel {
|
|
|
}
|
|
|
|
|
|
let orderButton = UIButton()
|
|
|
- orderButton.setBackgroundImage(.init(named: "ic_skill_order"), for: .normal)
|
|
|
+ orderButton.setBackgroundImage(.init(named: "ic_skill_order_long"), for: .normal)
|
|
|
orderButton.setTitle(.init(key: "Order"), for: .normal)
|
|
|
orderButton.setTitleColor(.text_1, for: .normal)
|
|
|
orderButton.titleLabel?.font = .heading_h3
|
|
|
+ orderButton.addAction(UIAction(handler: { [weak self] _ in
|
|
|
+ guard let self else { return }
|
|
|
+ guard let curSelected else { return }
|
|
|
+
|
|
|
+ LNOrderManager.shared.createOrder(
|
|
|
+ skillId: curSelected.id, count: curCount,
|
|
|
+ remark: "")
|
|
|
+ { [weak self] orderNo in
|
|
|
+ guard let self else { return }
|
|
|
+ guard orderNo != nil else { return }
|
|
|
+
|
|
|
+ dismiss()
|
|
|
+ }
|
|
|
+ }), for: .touchUpInside)
|
|
|
buttonView.addSubview(orderButton)
|
|
|
orderButton.snp.makeConstraints { make in
|
|
|
make.trailing.equalToSuperview()
|
|
|
@@ -211,10 +226,10 @@ extension LNCreateOrderFromSkillListPanel {
|
|
|
make.width.height.equalTo(20)
|
|
|
}
|
|
|
|
|
|
- priceLabel.font = .body_s
|
|
|
- priceLabel.textColor = .text_4
|
|
|
- priceView.addSubview(priceLabel)
|
|
|
- priceLabel.snp.makeConstraints { make in
|
|
|
+ costLabel.font = .body_s
|
|
|
+ costLabel.textColor = .text_4
|
|
|
+ priceView.addSubview(costLabel)
|
|
|
+ costLabel.snp.makeConstraints { make in
|
|
|
make.verticalEdges.trailing.equalToSuperview()
|
|
|
make.leading.equalTo(coin.snp.trailing).offset(4)
|
|
|
}
|