|
1
|
import 'dart:async';
|
1
|
import 'dart:async';
|
|
2
|
-import 'dart:math';
|
|
|
|
3
|
|
2
|
|
|
4
|
import 'package:doublefeel_flutter/app/modules/friends/controllers/friend_trend_controller.dart';
|
3
|
import 'package:doublefeel_flutter/app/modules/friends/controllers/friend_trend_controller.dart';
|
|
5
|
import 'package:doublefeel_flutter/app/modules/home/controllers/home_controller.dart';
|
4
|
import 'package:doublefeel_flutter/app/modules/home/controllers/home_controller.dart';
|
|
@@ -254,17 +253,24 @@ class TodayController extends GetMaterialController { |
|
@@ -254,17 +253,24 @@ class TodayController extends GetMaterialController { |
|
254
|
}
|
253
|
}
|
|
255
|
if (result.status == 1) {
|
254
|
if (result.status == 1) {
|
|
256
|
_performDataUpload();
|
255
|
_performDataUpload();
|
|
|
|
256
|
+ return;
|
|
257
|
}
|
257
|
}
|
|
258
|
- } catch (e) {}
|
258
|
+ // 打开苹果健康
|
|
|
|
259
|
+ _platformHostApi.nativeHandleUrl('x-apple-health://');
|
|
|
|
260
|
+ } catch (e) {
|
|
|
|
261
|
+ AppToast.show(e.toString());
|
|
|
|
262
|
+ }
|
|
259
|
}
|
263
|
}
|
|
260
|
}
|
264
|
}
|
|
261
|
|
265
|
|
|
262
|
void onAuthorizeTap() {
|
266
|
void onAuthorizeTap() {
|
|
263
|
- if (showHealthDataAuthCardStatus.value == 0) {
|
267
|
+ if (showHealthDataAuthCardStatus.value == 1) {
|
|
|
|
268
|
+ return;
|
|
|
|
269
|
+ } else if (showHealthDataAuthCardStatus.value == 0) {
|
|
264
|
Get.to(NoHealthDataPage(
|
270
|
Get.to(NoHealthDataPage(
|
|
265
|
onRefresh: requestHealthAuthorization,
|
271
|
onRefresh: requestHealthAuthorization,
|
|
266
|
));
|
272
|
));
|
|
267
|
- } else if (showHealthDataAuthCardStatus.value == -1) {
|
273
|
+ } else {
|
|
268
|
Get.to(NoHealthDataNoPermissionPage(
|
274
|
Get.to(NoHealthDataNoPermissionPage(
|
|
269
|
onRequest: requestHealthAuthorization,
|
275
|
onRequest: requestHealthAuthorization,
|
|
270
|
));
|
276
|
));
|