Commit 156c1ec431e6067ee41d2a41ad96aca525e2d5f5

Authored by daifengyi
1 parent 92b5af79

feat:debug alert

HDFwear/Mine/MineViewController.swift
@@ -185,8 +185,114 @@ extension MineViewController: UITableViewDataSource, UITableViewDelegate { @@ -185,8 +185,114 @@ extension MineViewController: UITableViewDataSource, UITableViewDelegate {
185 } 185 }
186 navigationController?.pushViewController(vc, animated: true) 186 navigationController?.pushViewController(vc, animated: true)
187 case "关于": 187 case "关于":
188 - let vc = UIStoryboard.loadViewControllerIdentifier(storyboardName: "Mine", identifier: "AboutAppVC")  
189 - navigationController?.pushViewController(vc, animated: true) 188 + //jtd!
  189 +// let vc = UIStoryboard.loadViewControllerIdentifier(storyboardName: "Mine", identifier: "AboutAppVC")
  190 +// navigationController?.pushViewController(vc, animated: true)
  191 + let alert = UIAlertController(title: "plz select", message: nil, preferredStyle: .actionSheet)
  192 + let archiveAction1 = UIAlertAction(title: "newSetTouchSense", style: .default) { action in
  193 + BluetoothManager.shared.newSetTouchSense(bool: true) { error in
  194 + if error != nil {
  195 + print("newSetTouchSense" + (error?.description ?? "") )
  196 + }else {
  197 + print("newSetTouchSense success")
  198 + }
  199 + }
  200 + }
  201 + let archiveAction2 = UIAlertAction(title: "newSetLowPowerRemind", style: .default) { action in
  202 + BluetoothManager.shared.newSetLowPowerRemind(bool: true) { error in
  203 + if error != nil {
  204 + print("newSetLowPowerRemind" + (error?.description ?? ""))
  205 + }else {
  206 + print("newSetLowPowerRemind success")
  207 + }
  208 + }
  209 + }
  210 + let archiveAction3 = UIAlertAction(title: "newSetRestore", style: .default) { action in
  211 + BluetoothManager.shared.newSetRestore() { error in
  212 + if error != nil {
  213 + print("newSetRestore" + (error?.description ?? ""))
  214 + }else {
  215 + print("newSetRestore success")
  216 + }
  217 + }
  218 + }
  219 + let archiveAction4 = UIAlertAction(title: "newSetHeartRateHighRemind", style: .default) { action in
  220 + BluetoothManager.shared.newSetHeartRateHighRemind(maxHr: 120) { error in
  221 + if error != nil {
  222 + print("newSetHeartRateHighRemind" + (error?.description ?? ""))
  223 + }else {
  224 + print("newSetHeartRateHighRemind success")
  225 + }
  226 + }
  227 + }
  228 + let archiveAction5 = UIAlertAction(title: "newSetHeartRateLowRemind", style: .default) { action in
  229 + BluetoothManager.shared.newSetHeartRateLowRemind(minHr: 120) { error in
  230 + if error != nil {
  231 + print("newSetHeartRateLowRemind" + (error?.description ?? ""))
  232 + }else {
  233 + print("newSetHeartRateLowRemind success")
  234 + }
  235 + }
  236 + }
  237 + let archiveAction6 = UIAlertAction(title: "newSetPressureAutoDetect", style: .default) { action in
  238 + BluetoothManager.shared.newSetPressureAutoDetect(bool: true) { error in
  239 + if error != nil {
  240 + print("newSetPressureAutoDetect" + (error?.description ?? ""))
  241 + }else {
  242 + print("newSetPressureAutoDetect success")
  243 + }
  244 + }
  245 + }
  246 + let archiveAction7 = UIAlertAction(title: "newSetBloodOxygenAutoDetect", style: .default) { action in
  247 + BluetoothManager.shared.newSetBloodOxygenAutoDetect(bool: true) { error in
  248 + if error != nil {
  249 + print("newSetBloodOxygenAutoDetect" + (error?.description ?? ""))
  250 + }else {
  251 + print("newSetBloodOxygenAutoDetect success")
  252 + }
  253 + }
  254 + }
  255 + let archiveAction8 = UIAlertAction(title: "newSetUserInfo", style: .default) { action in
  256 + BluetoothManager.shared.newSetUserInfo(AdminHelper.shared.loadLocalAdminData().userInfo) { error in
  257 + if error != nil {
  258 + print("newSetUserInfo" + (error?.description ?? ""))
  259 + }else {
  260 + print("newSetUserInfo success")
  261 + }
  262 + }
  263 + }
  264 + let archiveAction9 = UIAlertAction(title: "getSleepHistoryData", style: .default) { action in
  265 + BluetoothManager.shared.getSleepHistoryData(day: .today) { sleepArray, error in
  266 + if error != nil {
  267 + print("getSleepHistoryData" + (error?.description ?? ""))
  268 + }else {
  269 + print("getSleepHistoryData success")
  270 + SleepModel.addArray(sleepArray)
  271 + }
  272 + }
  273 + }
  274 + let archiveAction10 = UIAlertAction(title: "getBloodOxygenHistoryData", style: .default) { action in
  275 + BluetoothManager.shared.getBloodOxygenHistoryData(day: .today) { boArray, error in
  276 + if error != nil {
  277 + print("getBloodOxygenHistoryData" + (error?.description ?? ""))
  278 + }else {
  279 + print("getBloodOxygenHistoryData success")
  280 + BloodOxygenModel.addArray(boArray)
  281 + }
  282 + }
  283 + }
  284 +
  285 + alert.addAction(archiveAction1)
  286 + alert.addAction(archiveAction2)
  287 + alert.addAction(archiveAction3)
  288 + alert.addAction(archiveAction4)
  289 + alert.addAction(archiveAction5)
  290 + alert.addAction(archiveAction6)
  291 + alert.addAction(archiveAction7)
  292 + alert.addAction(archiveAction8)
  293 + alert.addAction(archiveAction9)
  294 + alert.addAction(archiveAction10)
  295 + present(alert, animated: true, completion: nil)
190 case "我的数据": 296 case "我的数据":
191 let vc = UIStoryboard.loadViewControllerIdentifier(storyboardName: "Mine", identifier: "HealthDataVC") 297 let vc = UIStoryboard.loadViewControllerIdentifier(storyboardName: "Mine", identifier: "HealthDataVC")
192 navigationController?.pushViewController(vc, animated: true) 298 navigationController?.pushViewController(vc, animated: true)