OrderDetailFootView.swift 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // OrderDetailFootView.swift
  3. // ADHTuanCan
  4. //
  5. // Created by 敖德亨 on 2023/11/8.
  6. //
  7. import UIKit
  8. class OrderDetailFootView: UIView {
  9. @IBOutlet weak var countLab: UILabel!
  10. @IBOutlet weak var priceLab: UILabel!
  11. @IBOutlet weak var orderNumLab: UILabel!
  12. ///下单时间
  13. @IBOutlet weak var takeOrderTimeLab: UILabel!
  14. /// 结算方式
  15. @IBOutlet weak var paySetLab: UILabel!
  16. var dataModel : OrderOutDetailModel?
  17. /// hud 提示
  18. lazy var hud : MCHud! = {
  19. return MCHud()
  20. }()
  21. override func awakeFromNib() {
  22. super.awakeFromNib()
  23. }
  24. func configModel(model : OrderOutDetailModel){
  25. self.dataModel = model
  26. self.countLab.text = LanguagesUtil.createTextBy(Ctext: "共\(model.mealNum ?? "")件 合计s$", Etext: "There are \(model.mealNum ?? "") dishes,total s$")
  27. self.priceLab.text = "\(model.payAmount ?? "")"
  28. self.orderNumLab.text = "\(model.orderNo ?? "")"
  29. self.takeOrderTimeLab.text = "\(model.createTime ?? "")"
  30. ///结算方式,1全款,2定金
  31. if model.settleType === 1{
  32. self.paySetLab.text = LanguagesUtil.createTextBy(Ctext: "全款", Etext: "full payment")
  33. }else{
  34. self.paySetLab.text = LanguagesUtil.createTextBy(Ctext: "定金", Etext: "deposit")
  35. }
  36. }
  37. @IBAction func copyOrderNumAcTion(_ sender: UIButton) {
  38. let pastboard = UIPasteboard.general
  39. pastboard.string = "\(self.dataModel?.orderNo ?? "")"
  40. if !(pastboard.string.isEmptyStr){
  41. print("%@",pastboard.string!)
  42. self.hud.showSuccess(LanguagesUtil.createTextBy(Ctext: "复制成功", Etext: "copy success"))
  43. }
  44. }
  45. }