Browse Source

【代码优化】适配根据设备权限动态显示心率

master
公司电脑 1 year ago
parent
commit
aeea9335f7
  1. BIN
      FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate
  2. 412
      FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 41
      FireBoltt/Const/Enum.swift
  4. 2
      FireBoltt/FB_Modules/FB_DataBase/DataBaseModel.swift
  5. 2
      FireBoltt/FB_Modules/FB_Device/Model/DeviceInfo.swift
  6. 5
      FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift
  7. 1
      FireBoltt/FB_Modules/FB_Device/ViewModel/DeviceViewModels.swift
  8. 33
      FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift
  9. 2
      FireBoltt/FB_Modules/FB_My/ViewModel/MineViewModel.swift

BIN
FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

412
FireBoltt.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@ -169,6 +169,21 @@ @@ -169,6 +169,21 @@
endingLineNumber = "0"
offsetFromSymbolStart = "20">
</Location>
<Location
uuid = "2606C474-3C07-44B7-9566-F88837835AE5 - 8a693b7dabf410e9"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "closure #1 () -&gt; __C.UILabel in FireBoltt.HealthStepCell.fb_titleLabel.getter : __C.UILabel"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Health/View/HealthStepCell.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "13"
endingLineNumber = "13"
offsetFromSymbolStart = "0">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
@ -188,5 +203,402 @@ @@ -188,5 +203,402 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "98A229F0-240B-4681-B8DC-6EB2B655CB93"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "151"
endingLineNumber = "151"
landmarkName = "fbloadHealthData()"
landmarkType = "7">
<Locations>
<Location
uuid = "98A229F0-240B-4681-B8DC-6EB2B655CB93 - 257623df7280ea77"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "FireBoltt.HealthHomeViewModels.fbloadHealthData() -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "155"
endingLineNumber = "155"
offsetFromSymbolStart = "1728">
</Location>
<Location
uuid = "98A229F0-240B-4681-B8DC-6EB2B655CB93 - 257623df7280eb5c"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "FireBoltt.HealthHomeViewModels.fbloadHealthData() -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "162"
endingLineNumber = "162"
offsetFromSymbolStart = "1600">
</Location>
<Location
uuid = "98A229F0-240B-4681-B8DC-6EB2B655CB93 - 257623df7280ead0"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "FireBoltt.HealthHomeViewModels.fbloadHealthData() -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "158"
endingLineNumber = "158"
offsetFromSymbolStart = "1608">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "74102FF6-C108-4E71-A30E-40CB1E71CBE2"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_DataBase/DataBaseManagerFireBoltt.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "114"
endingLineNumber = "114"
landmarkName = "insertModels(models:dataType:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E0631F0C-5B86-415E-812F-FE11C5350058"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "865"
endingLineNumber = "865"
landmarkName = "handleHealthData(dict:)"
landmarkType = "7">
<Locations>
<Location
uuid = "E0631F0C-5B86-415E-812F-FE11C5350058 - 81af793b027c619"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "FireBoltt.BluetoothService.handleHealthData(dict: Swift.Dictionary&lt;Swift.String, Any&gt;) -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "863"
endingLineNumber = "863"
offsetFromSymbolStart = "3688">
</Location>
<Location
uuid = "E0631F0C-5B86-415E-812F-FE11C5350058 - ee886ede3a07a1d2"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "closure #1 (FireBoltt.SportModel) -&gt; () in FireBoltt.BluetoothService.handleHealthData(dict: Swift.Dictionary&lt;Swift.String, Any&gt;) -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "864"
endingLineNumber = "864"
offsetFromSymbolStart = "88">
</Location>
<Location
uuid = "E0631F0C-5B86-415E-812F-FE11C5350058 - 81af793b027c5c7"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "FireBoltt.BluetoothService.handleHealthData(dict: Swift.Dictionary&lt;Swift.String, Any&gt;) -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "865"
endingLineNumber = "865"
offsetFromSymbolStart = "3656">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "43FB20D8-897D-4868-B1DC-748755394D4C"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "697"
endingLineNumber = "697"
landmarkName = "finishedHandle(_:data:cmd:)"
landmarkType = "7">
<Locations>
<Location
uuid = "43FB20D8-897D-4868-B1DC-748755394D4C - 9cd1bb9455862750"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "FireBoltt.BluetoothService.finishedHandle(_: Swift.Optional&lt;__C.BLEBaseBlFireBoltt&gt;, data: Swift.Optional&lt;Swift.Dictionary&lt;Swift.AnyHashable, Any&gt;&gt;, cmd: __C.BleCMD_FireBoltt) -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "699"
endingLineNumber = "699"
offsetFromSymbolStart = "14648">
</Location>
<Location
uuid = "43FB20D8-897D-4868-B1DC-748755394D4C - 9cd1bb9455862750"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "FireBoltt.BluetoothService.finishedHandle(_: Swift.Optional&lt;__C.BLEBaseBlFireBoltt&gt;, data: Swift.Optional&lt;Swift.Dictionary&lt;Swift.AnyHashable, Any&gt;&gt;, cmd: __C.BleCMD_FireBoltt) -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "699"
endingLineNumber = "699"
offsetFromSymbolStart = "15100">
</Location>
<Location
uuid = "43FB20D8-897D-4868-B1DC-748755394D4C - 9cd1bb9455862792"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "FireBoltt.BluetoothService.finishedHandle(_: Swift.Optional&lt;__C.BLEBaseBlFireBoltt&gt;, data: Swift.Optional&lt;Swift.Dictionary&lt;Swift.AnyHashable, Any&gt;&gt;, cmd: __C.BleCMD_FireBoltt) -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "697"
endingLineNumber = "697"
offsetFromSymbolStart = "14632">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C5F2317D-E3A7-49CF-A890-8551F7423EFC"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "719"
endingLineNumber = "719"
landmarkName = "finishedHandle(_:data:cmd:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "615D9008-45AB-4639-BAC7-B77CDD8E41B5"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "774"
endingLineNumber = "774"
landmarkName = "finishedHandle(_:data:cmd:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "F78C4540-A800-4FBF-A47F-AE6C292DE26C"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Bluetooth/L2DataParseFireBoltt.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "999"
endingLineNumber = "999"
landmarkName = "+p_parseBraceletData_syncHealthWith:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "277E3F88-23DC-43CF-A2CF-ADC12209B361"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Bluetooth/L2DataParseFireBoltt.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "106"
endingLineNumber = "106"
landmarkName = "+L2_ParseData:type:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "47E326DB-8E1F-4E48-B3F4-DCF76AB7E6D6"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_DataBase/DataBaseManagerFireBoltt.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "86"
endingLineNumber = "86"
landmarkName = "createDataTables()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "32AA9704-8901-4A65-8BE1-C99030984CC1"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "94"
endingLineNumber = "94"
landmarkName = "fbloadHealthData()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "EC56E8DB-F3C2-4372-B06D-8B46BE99408A"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "350"
endingLineNumber = "350"
landmarkName = "fbsendSyncDeviceData()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C1BE2A4A-4B89-43B6-B2F4-A7F8C0ACB052"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_DataBase/DataBaseManagerFireBoltt.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "236"
endingLineNumber = "236"
landmarkName = "fbquerySleepModel(dataDate:queryType:_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "F5F86B84-6C64-4EF6-B882-57525997D1BD"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Health/ViewModel/HealthViewModels.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "63"
endingLineNumber = "63"
landmarkName = "fbloadHealthData()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "7B3B2F2A-BC9C-4A42-A1C1-30444EEA25D4"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "180"
endingLineNumber = "180"
landmarkName = "monitor()"
landmarkType = "7">
<Locations>
<Location
uuid = "7B3B2F2A-BC9C-4A42-A1C1-30444EEA25D4 - 6cc846a688ec7e4d"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "closure #2 (FireBoltt.HealthDataSyncState) -&gt; () in FireBoltt.HealthHomeViewModels.monitor() -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "180"
endingLineNumber = "180"
offsetFromSymbolStart = "176">
</Location>
<Location
uuid = "7B3B2F2A-BC9C-4A42-A1C1-30444EEA25D4 - b36d41eca6612d21"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "closure #1 (Swift.Array&lt;FireBoltt.BaseJsonModel&gt;) -&gt; () in closure #2 (FireBoltt.HealthDataSyncState) -&gt; () in FireBoltt.HealthHomeViewModels.monitor() -&gt; ()"
moduleName = "FireBoltt"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/FireBoltt_ios/FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "181"
endingLineNumber = "181"
offsetFromSymbolStart = "56">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

41
FireBoltt/Const/Enum.swift

@ -124,7 +124,8 @@ enum PushType: Int { @@ -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 { @@ -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 {

2
FireBoltt/FB_Modules/FB_DataBase/DataBaseModel.swift

@ -127,7 +127,7 @@ class SportModel: BaseJsonModel { @@ -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

2
FireBoltt/FB_Modules/FB_Device/Model/DeviceInfo.swift

@ -53,7 +53,7 @@ fileprivate enum FuncCmd: Int { @@ -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

5
FireBoltt/FB_Modules/FB_Device/Service/BluetoothService.swift

@ -693,7 +693,10 @@ extension BluetoothService: BLEBLDelegate { @@ -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 }

1
FireBoltt/FB_Modules/FB_Device/ViewModel/DeviceViewModels.swift

@ -172,6 +172,7 @@ extension DeviceViewModels { @@ -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) }

33
FireBoltt/FB_Modules/FB_Health/ViewModel/HealthHomeViewModels.swift

@ -63,12 +63,13 @@ class HealthHomeViewModels: ViewModel { @@ -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 { @@ -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..<totalRow) {
items.insert(HealthSectionItem.blankItem, at: 1 + i * 4)
var endIndex = 4 + i * 4
if endIndex > 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..<totalRow) {
// items.insert(HealthSectionItem.blankItem, at: 1 + i * 4)
// var endIndex = 4 + i * 4
// if endIndex > 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])
}

2
FireBoltt/FB_Modules/FB_My/ViewModel/MineViewModel.swift

@ -32,7 +32,7 @@ class MineViewModel: ViewModel { @@ -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) }

Loading…
Cancel
Save