You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
0 B
51 lines
0 B
1 year ago
|
//
|
||
|
// NutritionSectionModel.swift
|
||
|
// VeSync
|
||
|
//
|
||
|
// Created by Sheldon on 2020/3/24.
|
||
|
// Copyright © 2020 Etekcity. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import Foundation
|
||
|
|
||
|
enum HealthSection {
|
||
|
case health(title: String, items: [HealthSectionItem])
|
||
|
}
|
||
|
|
||
|
enum HealthSectionItem {
|
||
1 year ago
|
case stepItem(viewModel: StepCellViewModels)
|
||
|
case healthItem(viewModel: HealthCellViewModels)
|
||
1 year ago
|
case blankItem
|
||
1 year ago
|
// case sleepItem(viewModel: HealthCellViewModels)
|
||
|
// case heartRateItem(viewModel: HealthCellViewModels)
|
||
|
// case temperatureItem(viewModel: HealthCellViewModels)
|
||
|
// case bloodPressureItem(viewModel: HealthCellViewModels)
|
||
|
// case bloodOxygenItem(viewModel: HealthCellViewModels)
|
||
1 year ago
|
|
||
1 year ago
|
case sleepHeartItem(viewModel: SleepHeartCellViewModels)
|
||
|
case sportItem(viewModel: SportCellViewModels)
|
||
1 year ago
|
case temperatureIitem(viewModel: TemperatureCellModel)
|
||
|
}
|
||
|
|
||
|
extension HealthSection: SectionModelType {
|
||
|
typealias Item = HealthSectionItem
|
||
|
|
||
|
var title: String {
|
||
|
switch self {
|
||
|
case .health(let title, _): return title
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var items: [HealthSectionItem] {
|
||
|
switch self {
|
||
|
case .health(_, let items): return items.map {$0}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
init(original: HealthSection, items: [Item]) {
|
||
|
switch original {
|
||
|
case .health(let title, let items): self = .health(title: title, items: items)
|
||
|
}
|
||
|
}
|
||
|
}
|