CNLiveShopPayController.swift
1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// CNLiveShopPayController.swift
// metaCode
//
// Created by zx on 2024/4/8.
// 支付页面
import Foundation
//支付完成回调
typealias FinishPayCallBack = (_ testStr:String)->Void//_ orderInfoModel:CNLivePayOrderInfoModel
class CNLiveShopPayController:CNLiveBaseViewController{
var finishPayCallBack:FinishPayCallBack?
var orderNumber:String
init(orderNumber:String) {
self.orderNumber = orderNumber
super.init(nibName: nil, bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
navigationBarHidden = false
titleName = "收银台"
self.view.backgroundColor = .white
NotificationCenter.default.addObserver(self, selector: #selector(didBecomeActiveNotification(_:)), name: UIApplication.didBecomeActiveNotification, object: nil)
self.getOrderInfoMessage()
}
// MARK: - 获取订单信息 并且进行检测
func getOrderInfoMessage(){
if self.orderNumber.count == 0{
return
}
showLoading(message: "")
CNLiveShoph5ViewModel.postOrderPayWithParams(orderId: self.orderNumber) { result, status in
if status == .success{
}
}
}
@objc func didBecomeActiveNotification(_ notification: Notification) {
// 处理应用变得活跃的逻辑
}
}