123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // OrderAddressCell.swift
- // ADHTuanCan
- //
- // Created by 敖德亨 on 2023/11/4.
- //
- import UIKit
- class OrderAddressCell: UITableViewCell {
- @IBOutlet weak var isDefualLab: UILabel!
-
- @IBOutlet weak var selectBtn: UIButton!
-
- @IBOutlet weak var nameLab: UILabel!
-
- @IBOutlet weak var phoneLab: UILabel!
-
- @IBOutlet weak var addressLab: UILabel!
-
- @IBOutlet weak var postCodeLab: UILabel!
-
- var addressModel : AddressModel?
-
- var selectBlock : (()->Void)?
-
- var editBlock : (()->Void)?
-
- override func awakeFromNib() {
- super.awakeFromNib()
- // Initialization code
- }
- override func setSelected(_ selected: Bool, animated: Bool) {
- super.setSelected(selected, animated: animated)
- // Configure the view for the selected state
- }
-
- func configModel(model : AddressModel){
-
- self.addressModel = model
-
- self.nameLab.text = "\(model.receiving ?? "")"
- self.phoneLab.text = "\(model.phoneNum ?? "")"
-
- if model.isDefault == "1"{
- self.isDefualLab.isHidden = false
- self.selectBtn.isSelected = true
-
- }else{
- self.isDefualLab.isHidden = true
- self.selectBtn.isSelected = false
- }
-
-
- self.addressLab.text = "\(model.street ?? "")\(model.detailAddress ?? "")"
- self.postCodeLab.text = "\(model.postcode ?? "")"
-
- }
- @IBAction func editAction(_ sender: UIButton) {
- if self.editBlock != nil{
- self.editBlock!()
- }
- }
-
- @IBAction func selectAction(_ sender: UIButton) {
-
- }
- }
|