Files
Woka_Native_iOS/WOKA/Cart/View/CartListCell.swift
BilalKhanWDI 22796ec0b1 - Made new module for Cart
- Finalised Listing of CartList
- Added pull to refresh and swipe to delete
- Handled manual delete on icon click
- Made CouponCart listing view controller
- Added api to fetch the coupons
- Added api to apply coupon with model
- Made a coupon discount stack , will show up
2024-07-23 19:53:12 +05:30

50 lines
1.5 KiB
Swift

//
// CartListCell.swift
// WOKA
//
// Created by MacBook Pro on 23/07/24.
//
import UIKit
class CartListCell: UITableViewCell {
@IBOutlet weak var productImage: UIImageView!
@IBOutlet weak var productTitle: LocalisedElementsLabel!
@IBOutlet weak var productStatus: LocalisedElementsLabel!
@IBOutlet weak var productPrice: LocalisedElementsLabel!
@IBOutlet weak var productQty: LocalisedElementsLabel!
typealias btnTappedBlock = () -> Void // 0 - plus 1 - minus
var btnTapped : btnTappedBlock!
override func awakeFromNib() {
super.awakeFromNib()
self.backgroundColor = .clear
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
func setData(data : CartListingDM.ResultData){
self.productTitle.text = data.productName ?? "NA"
self.productStatus.text = "Product_Status: " + (data.stockStatus ?? "NA")
self.productPrice.text = data.productPrice ?? "Rs. 0"
self.productQty.text = "Quantity: " + (data.productQuantity?.toString() ?? "1")
if let imageURL = data.shopImage?.first{
self.productImage.imageURL(imageURL, color: UIColor.appColor(.TextDarkBlue)!)
}
}
@IBAction func deleteBtnTapped(_ sender: UIButton) {
if btnTapped != nil {
btnTapped()
}
}
}