diff --git a/HDFwear/Mine/MineViewController.swift b/HDFwear/Mine/MineViewController.swift index 94a82d1..0359518 100644 --- a/HDFwear/Mine/MineViewController.swift +++ b/HDFwear/Mine/MineViewController.swift @@ -185,8 +185,114 @@ extension MineViewController: UITableViewDataSource, UITableViewDelegate { } navigationController?.pushViewController(vc, animated: true) case "关于": - let vc = UIStoryboard.loadViewControllerIdentifier(storyboardName: "Mine", identifier: "AboutAppVC") - navigationController?.pushViewController(vc, animated: true) + //jtd! +// let vc = UIStoryboard.loadViewControllerIdentifier(storyboardName: "Mine", identifier: "AboutAppVC") +// navigationController?.pushViewController(vc, animated: true) + let alert = UIAlertController(title: "plz select", message: nil, preferredStyle: .actionSheet) + let archiveAction1 = UIAlertAction(title: "newSetTouchSense", style: .default) { action in + BluetoothManager.shared.newSetTouchSense(bool: true) { error in + if error != nil { + print("newSetTouchSense" + (error?.description ?? "") ) + }else { + print("newSetTouchSense success") + } + } + } + let archiveAction2 = UIAlertAction(title: "newSetLowPowerRemind", style: .default) { action in + BluetoothManager.shared.newSetLowPowerRemind(bool: true) { error in + if error != nil { + print("newSetLowPowerRemind" + (error?.description ?? "")) + }else { + print("newSetLowPowerRemind success") + } + } + } + let archiveAction3 = UIAlertAction(title: "newSetRestore", style: .default) { action in + BluetoothManager.shared.newSetRestore() { error in + if error != nil { + print("newSetRestore" + (error?.description ?? "")) + }else { + print("newSetRestore success") + } + } + } + let archiveAction4 = UIAlertAction(title: "newSetHeartRateHighRemind", style: .default) { action in + BluetoothManager.shared.newSetHeartRateHighRemind(maxHr: 120) { error in + if error != nil { + print("newSetHeartRateHighRemind" + (error?.description ?? "")) + }else { + print("newSetHeartRateHighRemind success") + } + } + } + let archiveAction5 = UIAlertAction(title: "newSetHeartRateLowRemind", style: .default) { action in + BluetoothManager.shared.newSetHeartRateLowRemind(minHr: 120) { error in + if error != nil { + print("newSetHeartRateLowRemind" + (error?.description ?? "")) + }else { + print("newSetHeartRateLowRemind success") + } + } + } + let archiveAction6 = UIAlertAction(title: "newSetPressureAutoDetect", style: .default) { action in + BluetoothManager.shared.newSetPressureAutoDetect(bool: true) { error in + if error != nil { + print("newSetPressureAutoDetect" + (error?.description ?? "")) + }else { + print("newSetPressureAutoDetect success") + } + } + } + let archiveAction7 = UIAlertAction(title: "newSetBloodOxygenAutoDetect", style: .default) { action in + BluetoothManager.shared.newSetBloodOxygenAutoDetect(bool: true) { error in + if error != nil { + print("newSetBloodOxygenAutoDetect" + (error?.description ?? "")) + }else { + print("newSetBloodOxygenAutoDetect success") + } + } + } + let archiveAction8 = UIAlertAction(title: "newSetUserInfo", style: .default) { action in + BluetoothManager.shared.newSetUserInfo(AdminHelper.shared.loadLocalAdminData().userInfo) { error in + if error != nil { + print("newSetUserInfo" + (error?.description ?? "")) + }else { + print("newSetUserInfo success") + } + } + } + let archiveAction9 = UIAlertAction(title: "getSleepHistoryData", style: .default) { action in + BluetoothManager.shared.getSleepHistoryData(day: .today) { sleepArray, error in + if error != nil { + print("getSleepHistoryData" + (error?.description ?? "")) + }else { + print("getSleepHistoryData success") + SleepModel.addArray(sleepArray) + } + } + } + let archiveAction10 = UIAlertAction(title: "getBloodOxygenHistoryData", style: .default) { action in + BluetoothManager.shared.getBloodOxygenHistoryData(day: .today) { boArray, error in + if error != nil { + print("getBloodOxygenHistoryData" + (error?.description ?? "")) + }else { + print("getBloodOxygenHistoryData success") + BloodOxygenModel.addArray(boArray) + } + } + } + + alert.addAction(archiveAction1) + alert.addAction(archiveAction2) + alert.addAction(archiveAction3) + alert.addAction(archiveAction4) + alert.addAction(archiveAction5) + alert.addAction(archiveAction6) + alert.addAction(archiveAction7) + alert.addAction(archiveAction8) + alert.addAction(archiveAction9) + alert.addAction(archiveAction10) + present(alert, animated: true, completion: nil) case "我的数据": let vc = UIStoryboard.loadViewControllerIdentifier(storyboardName: "Mine", identifier: "HealthDataVC") navigationController?.pushViewController(vc, animated: true)