diff --git a/FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate b/FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate index b852d54..802dd02 100644 Binary files a/FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate and b/FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index b412f9a..47116a5 100644 --- a/FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -169,6 +169,21 @@ endingLineNumber = "0" offsetFromSymbolStart = "20"> + + @@ -188,5 +203,402 @@ landmarkType = "7"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FireBoltt/Const/Enum.swift b/FireBoltt/Const/Enum.swift index 5a287cc..1a28347 100644 --- a/FireBoltt/Const/Enum.swift +++ b/FireBoltt/Const/Enum.swift @@ -124,7 +124,8 @@ enum PushType: Int { } -fileprivate let sportTypeNameArr: [String] = ["所有运动", "健走", "户外跑", "室内跑", "爬山", "越野跑", "半马", "全马", "跳绳", "羽毛球", "篮球", "骑行", "滑冰", "健身房", "瑜伽", "网球", "乒乓球", "足球", "游泳", "性爱", "室内骑行", "室内健走", "自由训练"] + +fileprivate let sportTypeNameArr: [String] = ["所有运动", "健走", "户外跑", "室内跑", "爬山", "越野跑", "半马", "全马", "跳绳", "羽毛球", "篮球", "骑行", "滑冰", "健身房", "瑜伽", "网球", "乒乓球", "足球", "游泳", "性爱", "室内骑行", "室内健走", "自由训练", "太极", "户外步行", "室内跑步", "户外单车", "室内单车", "泳池游泳", "", "开放水域游泳", "铁人三项", "徒步", "椭圆机", "踏步机", "划船机", "高强度间隙训练", "功能性力量训练", "核心训练", "瑜伽", "普拉提", "舞蹈", "整理放松"] enum SportType: Int { // 占位,hasvalue+1 @@ -173,6 +174,44 @@ enum SportType: Int { case indoorWalkTraining /// 自由训练 22 case freeTraining + /// 太极 23 + case taiChi + /// 户外步行 24 + case outdoorWalking + /// 室内跑步 25 + case indoorRunning + /// 户外单车 26 + case outdoorBike + /// 室内单车 27 + case indoorCycling + /// 泳池游泳 28 + case swimmingPool + /// 开放水域游泳 29 + case openWaterSwimming + /// 铁人三项 30 + case triathlon + /// 徒步 31 + case hike + /// 椭圆机 32 + case ellipticalMachine + /// 踏步机 33 + case treadmills + /// 划船机 34 + case rowingMachine + /// 高强度间隙训练 35 + case highIntensityIntervalTraining + /// 功能性力量训练 36 + case functionalStrengthTraining + /// 核心训练 37 + case coreTraining + /// 瑜伽 38 + case yoga + /// 普拉提 39 + case pilates + /// 舞蹈 40 + case dance + /// 整理放松 41 + case tidyAndRelax } extension SportType { diff --git a/FireBoltt/FB_Modules/FB_DataBase/DataBaseModel.swift b/FireBoltt/FB_Modules/FB_DataBase/DataBaseModel.swift index b4c5d42..5dd05ca 100644 --- a/FireBoltt/FB_Modules/FB_DataBase/DataBaseModel.swift +++ b/FireBoltt/FB_Modules/FB_DataBase/DataBaseModel.swift @@ -127,7 +127,7 @@ class SportModel: BaseJsonModel { var dataDate: String = "" /// 版本号 var verison: Int = 0 - /// 运动类型 1.健走 2.户外跑 3.室内跑 4.登山 5.越野跑 6.半马 7.全马 8.跳绳 9.羽毛球 10.篮球 11.骑行 12.滑冰 13.健身房 14.瑜伽 15.网球 16.兵乓球 17.足球 18.游泳 19.性爱 20.室内骑行 21.室内健走22.自由训练 + /// 运动类型 1.健走 2.户外跑 3.室内跑 4.登山 5.越野跑 6.半马 7.全马 8.跳绳 9.羽毛球 10.篮球 11.骑行 12.滑冰 13.健身房 14.瑜伽 15.网球 16.兵乓球 17.足球 18.游泳 19.性爱 20.室内骑行 21.室内健走22.自由训练 23.太极 24.户外步行 25.室内跑步 26.户外单车 27.室内单车 28.泳池游泳 29.开放水域游泳 30.铁人三项 31.徒步 32.椭圆机 33.踏步机 34.划船机 35.高强度间隙训练 36.功能性力量训练 37.核心训练 38.瑜伽 39.普拉提 40.舞蹈 41.整理放松 var sportType: Int = 0 /// 运动时长(秒) var duration: Int = 0 diff --git a/FireBoltt/FB_Modules/FB_Device/Model/DeviceInfo.swift b/FireBoltt/FB_Modules/FB_Device/Model/DeviceInfo.swift index 9709224..5607ed9 100644 --- a/FireBoltt/FB_Modules/FB_Device/Model/DeviceInfo.swift +++ b/FireBoltt/FB_Modules/FB_Device/Model/DeviceInfo.swift @@ -53,7 +53,7 @@ fileprivate enum FuncCmd: Int { } struct AdapterInfo: Mappable { - var heartRate: Bool = true + var heartRate: Bool = false var weather: Bool = false var dailPush: Bool = false var wechatSport: Bool = false diff --git a/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift b/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift index 0aa4a3b..b19e1f9 100644 --- a/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift +++ b/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift @@ -693,7 +693,10 @@ extension BluetoothService: BLEBLDelegate { case .heartData: print("") case .sportModelData: - print("") + print("运动模式数据返回") + let dicData = data as! [String:Any] + handleHealthData(dict: dicData) + totalCount -= 1 case .realTimesync: // 实时数据 guard let temp = data["DataType"] as? Int, let bleCmd = BleCMD_FireBoltt(rawValue: temp) else { return } diff --git a/FireBoltt/FB_Modules/FB_Device/ViewModel/DeviceViewModels.swift b/FireBoltt/FB_Modules/FB_Device/ViewModel/DeviceViewModels.swift index c82775a..a1569d6 100644 --- a/FireBoltt/FB_Modules/FB_Device/ViewModel/DeviceViewModels.swift +++ b/FireBoltt/FB_Modules/FB_Device/ViewModel/DeviceViewModels.swift @@ -172,6 +172,7 @@ extension DeviceViewModels { if adapterInfo.notDisturb { section2.insert(.handUp, at: 0) } if adapterInfo.notDisturb { section2.append(.notDisturb) } if adapterInfo.heartRate { section2.append(.heartCheck) } +// if adapterInfo.heartRate { section2.append(.heartCheck) } if adapterInfo.bodyTemperature { section2.append(.tempeartureCheck) } if adapterInfo.alarmRemind { section2.append(.alarmClock) } if adapterInfo.drinkRemind { section2.append(.drinkRemind) } diff --git a/FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift b/FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift index b12d7cf..9b7723b 100644 --- a/FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift +++ b/FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift @@ -63,12 +63,13 @@ class HealthHomeViewModels: ViewModel { tempDisposeBag = DisposeBag() var items: [HealthSectionItem] = [] // 功能适配 - var defaultTypes: [HealthType] = [.step, .heartRate] + var defaultTypes: [HealthType] = [.step,] if let adapterInfo = UserDefaultsManagerFrieBoltt.getDeviceInfo()?.adapterInfo { if adapterInfo.sleep { defaultTypes.insert(.sleep, at: 1) } - if adapterInfo.bodyTemperature { defaultTypes.append(.temperature) } - if adapterInfo.bloodPressure { defaultTypes.append(.bloodPressure) } - if adapterInfo.bloodOxygen { defaultTypes.append(.bloodOxygen) } + if adapterInfo.heartRate { defaultTypes.append(.heartRate) } +// if adapterInfo.bodyTemperature { defaultTypes.append(.temperature) } +// if adapterInfo.bloodPressure { defaultTypes.append(.bloodPressure) } +// if adapterInfo.bloodOxygen { defaultTypes.append(.bloodOxygen) } // defaultTypes.append(.temperature) // defaultTypes.append(.bloodPressure) // defaultTypes.append(.bloodOxygen) @@ -145,17 +146,19 @@ class HealthHomeViewModels: ViewModel { } items.append(item) } - // 插入空Item(一行四个Item,每行第一个最后一个插入) - let tempItems = items[1...items.count - 1] - let totalRow = tempItems.count/2 + tempItems.count%2 - for i in (0.. items.count { - endIndex = items.count - } - items.insert(HealthSectionItem.blankItem, at: endIndex) - } +// 插入空Item(一行四个Item,每行第一个最后一个插入) +// let tempItems = items[1...items.count - 1] +// let totalRow = tempItems.count/2 + tempItems.count%2 +// for i in (0.. items.count { +// endIndex = items.count +// } +// items.insert(HealthSectionItem.blankItem, at: endIndex) +// } + + items.insert(HealthSectionItem.blankItem, at: 1) let section = HealthSection.health(title: "", items: items) relay.accept([section]) } diff --git a/FireBoltt/FB_Modules/FB_My/ViewModel/MineViewModel.swift b/FireBoltt/FB_Modules/FB_My/ViewModel/MineViewModel.swift index 0eb4d3f..a1f6dd7 100644 --- a/FireBoltt/FB_Modules/FB_My/ViewModel/MineViewModel.swift +++ b/FireBoltt/FB_Modules/FB_My/ViewModel/MineViewModel.swift @@ -32,7 +32,7 @@ class MineViewModel: ViewModel { func loadMeList() { // 我的列表 - var meList: [[MineSetType]] = [[], [.about,.privacy,.service,.disclaimerFB]] + var meList: [[MineSetType]] = [[], [.about,.privacy,.service]] // 功能适配 if let adapterInfo = UserDefaultsManagerFrieBoltt.getDeviceInfo()?.adapterInfo { if adapterInfo.unitSet { meList[0].append(.unitSet) }