Commit ddaef8f6 authored by Alex朱枝文's avatar Alex朱枝文

在港记录showcase bug修复

parent 0048e5fd
...@@ -116,7 +116,10 @@ extension YHHKRecordsSummaryVC { ...@@ -116,7 +116,10 @@ extension YHHKRecordsSummaryVC {
guard let self = self else { guard let self = self else {
return return
} }
var summaryItems: [YHHKRecordItemDetailType] = [.detailHeader("逗留共\(record.sum_days)天(\(record.sum_days)次)"), .lastStay("上次逗留:\(self.getShortDateString(record.last_stay_date))")] var summaryItems: [YHHKRecordItemDetailType] = [.detailHeader("逗留共\(record.sum_days)天(\(record.sum_times)次)")]
if record.last_stay_date.count > 0 {
summaryItems.append(.lastStay("上次逗留:\(self.getShortDateString(record.last_stay_date))"))
}
record.statistics.forEach { item in record.statistics.forEach { item in
let summaryItem = YHHKRecordItemDetailType.summaryItem("\(item.year)\(item.sum_days)天(\(item.sum_times)次)") let summaryItem = YHHKRecordItemDetailType.summaryItem("\(item.year)\(item.sum_days)天(\(item.sum_times)次)")
summaryItems.append(summaryItem) summaryItems.append(summaryItem)
...@@ -169,6 +172,12 @@ extension YHHKRecordsSummaryVC { ...@@ -169,6 +172,12 @@ extension YHHKRecordsSummaryVC {
} else { } else {
cellType = .mid cellType = .mid
} }
case .detailHeader:
if indexPath.row == model.summaryItems.count {
cellType = .single
} else {
cellType = .top
}
default: default:
break break
} }
...@@ -237,7 +246,8 @@ extension YHHKRecordsSummaryVC: UITableViewDelegate, UITableViewDataSource { ...@@ -237,7 +246,8 @@ extension YHHKRecordsSummaryVC: UITableViewDelegate, UITableViewDataSource {
} }
case let .detailHeader(title): case let .detailHeader(title):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsSectionHeaderCell.cellReuseIdentifier) as? YHHKRecordsSectionHeaderCell { if let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsSectionHeaderCell.cellReuseIdentifier) as? YHHKRecordsSectionHeaderCell {
cell.setupCellInfo(title: title, cellType: .top) let cellType = getSubCellType(model: model, indexPath: indexPath, subType: subType)
cell.setupCellInfo(title: title, cellType: cellType)
return cell return cell
} }
case let .lastStay(title): case let .lastStay(title):
......
...@@ -36,6 +36,7 @@ class YHHKRecordsSectionHeaderCell: YHHKRecordsSectionItemBaseCell { ...@@ -36,6 +36,7 @@ class YHHKRecordsSectionHeaderCell: YHHKRecordsSectionItemBaseCell {
func setupCellInfo(title: String?, cellType: YHResignRoundCellType = .top) { func setupCellInfo(title: String?, cellType: YHResignRoundCellType = .top) {
infoTitleLabel.text = title infoTitleLabel.text = title
bottomLineView.isHidden = cellType != .top
updateCellCorner(cellType) updateCellCorner(cellType)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment