|
@@ -39,7 +39,7 @@ import 'models/health_model.dart';
|
|
|
|
|
|
class HealthController extends GetxController with WatchRequestOption {
|
|
|
final api = HealthApi();
|
|
|
- var unlock = true.obs; //true 解锁中医诊脉 false 未解锁
|
|
|
+ var unlock = false.obs; //true 解锁中医诊脉 false 未解锁
|
|
|
var tcmLogin = false; //中医登录
|
|
|
StreamSubscription? _streamSubscription;
|
|
|
final HostTCMApi hostTCMApi = HostTCMApi();
|
|
@@ -119,7 +119,11 @@ class HealthController extends GetxController with WatchRequestOption {
|
|
|
var userId = GlobalConfig.prefs.getString(PreferenceConst.USER_ID) ?? '';
|
|
|
mac = GlobalConfig.prefs.getString(PreferenceConst.PRE_DEVICE_MAC) ?? '';
|
|
|
|
|
|
- if (token.isEmpty || userId.isEmpty || mac.isEmpty || !connectCore.deviceConnected.value) {
|
|
|
+ if (token.isEmpty ||
|
|
|
+ userId.isEmpty ||
|
|
|
+ mac.isEmpty ||
|
|
|
+ !connectCore.deviceConnected.value) {
|
|
|
+ debugPrint('*** didnot connected, return ***');
|
|
|
return;
|
|
|
}
|
|
|
var sex = '男';
|
|
@@ -140,6 +144,8 @@ class HealthController extends GetxController with WatchRequestOption {
|
|
|
userId, mac, sex, birthday, height, weight, token);
|
|
|
tcmLogin = await hostTCMApi.login();
|
|
|
if (tcmLogin) {
|
|
|
+ bool isPay = await hostTCMApi.isPay();
|
|
|
+ unlock.value = isPay;
|
|
|
var tcmLevels = await hostTCMApi.getRecentReport();
|
|
|
if (tcmLevels == null ||
|
|
|
tcmLevels.healthPoints == null ||
|