LNCommonAlertView+Order.swift 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // LNCommonAlertView+Order.swift
  3. // Lanu
  4. //
  5. // Created by OneeChan on 2025/12/23.
  6. //
  7. import Foundation
  8. extension LNCommonAlertView {
  9. static func showCancelOrderAlert(orderId: String, completion: ((Bool) -> Void)? = nil) {
  10. let panel = LNCommonAlertView()
  11. panel.titleLabel.text = .init(key: "A00021")
  12. panel.showConfirm(.init(key: "A00022")) { }
  13. panel.showCancel(.init(key: "A00023")) {
  14. LNOrderManager.shared.cancelOrder(orderId: orderId) { success in
  15. completion?(success)
  16. }
  17. }
  18. panel.popup()
  19. }
  20. static func showFinishOrderAlert(orderId: String, completion: ((Bool) -> Void)? = nil) {
  21. let panel = LNCommonAlertView()
  22. panel.titleLabel.text = .init(key: "A00024")
  23. panel.showConfirm(.init(key: "A00025")) {
  24. LNOrderManager.shared.finishOrder(orderId: orderId) { success in
  25. completion?(success)
  26. }
  27. }
  28. panel.showCancel(.init(key: "A00003")) { }
  29. panel.popup()
  30. }
  31. }