Created
May 14, 2018 13:39
-
-
Save amannayak0007/f0b6feec0cd6e2a9db42013fdeb87a43 to your computer and use it in GitHub Desktop.
VAIBHACV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
case JRDealOrderSummarySectionType.orderStatus.rawValue: | |
if (orderSummaryDetail.orderState == 1 || orderSummaryDetail.orderState == 3) { | |
return 0 | |
} | |
if orderSummaryDetail.orderState == 4 { | |
return 2 | |
} | |
return 1 | |
case JRDealOrderSummarySectionType.confirmOrder.rawValue: | |
if (orderSummaryDetail.orderState == 1 || orderSummaryDetail.orderState == 3) { | |
return 1 | |
} | |
return 0 | |
case JRDealOrderSummarySectionType.itemDetails.rawValue ..< (orderItemList.keys.count + JRDealOrderSummarySectionType.itemDetails.rawValue) : | |
if (orderSummaryDetail.orderState == 1 || orderSummaryDetail.orderState == 3 || orderSummaryDetail.orderState == 4) { | |
return 1 | |
} | |
var numberOfRows = 1 | |
let orderItem = orderItems[section - 2] | |
if let _ = getVoucherCode(orderItem: orderItems[section - 2]) { | |
if let count = orderItemList[orderItem.productId]?.count { | |
numberOfRows += count | |
} | |
} | |
if let _ = getValidityDate(orderItem: orderItems[section - 2]) { | |
numberOfRows += 1 | |
} | |
if let _ = getHowToRedeemText(orderItem: orderItems[section - 2]) { | |
numberOfRows += 1 | |
} | |
return numberOfRows | |
case JRDealOrderSummarySectionType.paymentSummary.rawValue + (orderItemList.count - 1): | |
if orderSummaryDetail.orderState == 1 || orderSummaryDetail.orderState == 3 || orderSummaryDetail.orderState == 4 { | |
return 0 | |
} | |
return 1 | |
case JRDealOrderSummarySectionType.VIPCashback.rawValue + (orderItemList.count - 1): | |
if let isCommingFromOrderHistory = info, !isCommingFromOrderHistory, let orderItem = orderSummaryDetail.orderItems.first as? JROrderItem, orderItem.itemStatus.lowercased() == "success", let offerIds = JRServer.sharedServer().cashbackPostTxnEnabledOfferIds, offerIds.contains(66) { | |
return 0 | |
} | |
return 0 | |
case JRDealOrderSummarySectionType.promocode.rawValue + (orderItemList.count - 1): | |
if (orderSummaryDetail.orderState == 1 || orderSummaryDetail.orderState == 3 || orderSummaryDetail.orderState == 4) { | |
return 0 | |
} | |
for item in orderItems { | |
if let promocode = item.promocode, !promocode.isEmpty { | |
return 1 | |
} | |
} | |
return 0 | |
case JRDealOrderSummarySectionType.continueBooking.rawValue + (orderItemList.count - 1): | |
if let isCommingFromOrderHistory = info, isCommingFromOrderHistory { | |
return 0 | |
} | |
if (orderSummaryDetail.orderState == 1 || orderSummaryDetail.orderState == 3 || orderSummaryDetail.orderState == 4) { | |
return 0 | |
} | |
return 1 | |
case JRDealOrderSummarySectionType.paytmStamp.rawValue + (orderItemList.count - 1): | |
if orderSummaryDetail.orderState == 1 || orderSummaryDetail.orderState == 3 { | |
return 0 | |
} | |
return 1 | |
case JRDealOrderSummarySectionType.deals.rawValue + (orderItemList.count - 1): | |
return layouts?.count ?? 0 | |
default: | |
return 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment