1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- //
- // PaySuccessView.swift
- // ADHTuanCan
- //
- // Created by 敖德亨 on 2024/1/16.
- //
- import UIKit
- class PaySuccessView: UIView {
- @IBOutlet weak var blackView: UIView!
-
- @IBOutlet weak var moneyLab: UILabel!
-
- @IBOutlet weak var payTypeLab: UILabel!
-
- @IBOutlet weak var orderNumLab: UILabel!
-
- @IBOutlet weak var timeLab: UILabel!
-
-
- @IBAction func copyAction(_ sender: UIButton) {
- }
-
- @IBAction func finishAction(_ sender: UIButton) {
- if self.callBackBlock != nil{
- self.callBackBlock!()
- }
- self.hidden()
- }
-
- var callBackBlock : (()->Void)?
-
- var successModel : PaySuccessModel?
-
- public func showWithModel(model : PaySuccessModel){
- self.successModel = model
-
- let currentDate = Date()
- let dateFormatter = DateFormatter()
- dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
- let currentDateString = dateFormatter.string(from: currentDate)
- self.successModel?.time = currentDateString
-
- self.moneyLab.text = "\(self.successModel?.money ?? "")"
- self.payTypeLab.text = "\(self.successModel?.payTypeName ?? "")"
- self.orderNumLab.text = "\(self.successModel?.orderNum ?? "")"
- self.timeLab.text = "\(self.successModel?.time ?? "")"
-
-
- self.timeLab.text = currentDateString
-
-
- kAppDelegateWindow.addSubview(self)
- self.blackView.alpha = 0
- self.frame = CGRect.init(x: 0, y: kSCREEN_HEIGHT, width: kSCREEN_WIDTH, height: kSCREEN_HEIGHT)
- UIView.animate(withDuration: 0.5) {
- self.frame = CGRect.init(x: 0, y: 0, width: kSCREEN_WIDTH, height: kSCREEN_HEIGHT)
- self.layoutIfNeeded()
- }
- DELAY(0.5) {
- self.blackView.alpha = 0.3
- }
- }
-
- /// 隐藏
- public func hidden(){
- self.blackView.alpha = 0
- UIView.animate(withDuration: 0.5) {
- self.frame = CGRect.init(x: 0, y: kSCREEN_HEIGHT, width: kSCREEN_WIDTH, height: kSCREEN_HEIGHT)
- self.layoutIfNeeded()
- }
- DELAY(0.5) {
- self.removeFromSuperview()
- }
- }
- }
|