Commit 66b6f902b13fc2f9c724cd79647c8bea5884e8be

Authored by 常守达
1 parent 43a0a96b

feat(my):用户信息兼容苹果登陆

... ... @@ -737,7 +737,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "Runner/Runner-Debug.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = " 81";
CURRENT_PROJECT_VERSION = " 90";
DEVELOPMENT_TEAM = ZRPLMC329K;
ENABLE_PREVIEWS = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
... ... @@ -816,7 +816,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = " 81";
CURRENT_PROJECT_VERSION = " 90";
DEVELOPMENT_TEAM = ZRPLMC329K;
ENABLE_PREVIEWS = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
... ...
... ... @@ -297,15 +297,11 @@ class TodayController extends GetMaterialController {
};
final result = await _hostApi.checkHealthAppAuthorization();
if (!hasUploaded) {
showHealthDataAuthCardStatus.value = 0;
return;
}
showHealthDataAuthCardStatus.value = result.status;
// TODO:若用户从始至终没有任何数据,也显示该引导
if (result.status == 1) {
_performDataUpload();
}
showHealthDataAuthCardStatus.value = !hasUploaded ? 0 : result.status;
} catch (e) {}
}
... ... @@ -560,7 +556,7 @@ class TodayController extends GetMaterialController {
.toList();
yearlyProduct.value = products
.firstWhereOrNull((p) => p.appleId == Membership.yearlyProductId);
AppLogger.e(yearlyProduct);
// AppLogger.e(yearlyProduct);
if (yearlyProduct.value != null) {
final appleProductId = _nonEmpty(yearlyProduct.value!.appleId);
if (appleProductId == null) return;
... ...
... ... @@ -40,15 +40,26 @@ class AccountSettingView extends GetView<MyController> {
),
),
),
body: Obx(
() => Column(
body: Obx(() {
final telephone =
userPrefs.preferences.value.meUserInfo?.telephone ?? '';
final thirdAccountId =
userPrefs.preferences.value.meUserInfo?.thirdAccountId ?? '';
return Column(
children: [
SizedBox(height: 16),
_buildAccountCard(
context: context,
title: context.l10n.mobilePhoneNumber,
content: userPrefs.preferences.value.meUserInfo?.telephone ?? '',
),
if (thirdAccountId.isNotEmpty)
_buildAccountCard(
context: context,
title: 'Apple ID',
content: thirdAccountId,
)
else
_buildAccountCard(
context: context,
title: context.l10n.mobilePhoneNumber,
content: telephone,
),
SizedBox(height: 20),
GestureDetector(
behavior: HitTestBehavior.opaque,
... ... @@ -78,8 +89,8 @@ class AccountSettingView extends GetView<MyController> {
),
),
],
),
),
);
}),
);
}
... ...
... ... @@ -206,4 +206,12 @@ class MembershipOfferController extends GetxController {
if (trimmed == null || trimmed.isEmpty) return null;
return trimmed;
}
void onBackPressed() {
if (isFromOnboard) {
Get.offAllNamed(AppRoutes.home);
} else {
Get.back();
}
}
}
... ...
... ... @@ -21,6 +21,9 @@ class MembershipOfferView extends GetView<MembershipOfferController> {
final l10n = context.l10n;
return GuideCommonScaffold(
showGradientBg: true,
onBackPressed: () {
controller.onBackPressed();
},
bottom: OnboardingBottomButton(
label: controller.isFromOnboard ? l10n.continueButton : '免费兑换优惠',
enabled: true,
... ...
... ... @@ -205,7 +205,8 @@ class UserInfoResponse {
this.isBot,
this.uniqueCode,
this.enableAddWithUCode,
this.isPassNoviceGuide});
this.isPassNoviceGuide,
this.thirdAccountId});
final int? id;
final String? pairCode;
... ... @@ -221,6 +222,7 @@ class UserInfoResponse {
final String? uniqueCode;
final int? enableAddWithUCode;
final int? isPassNoviceGuide;
final String? thirdAccountId;
factory UserInfoResponse.fromJson(Map<String, dynamic> json) {
return UserInfoResponse(
... ... @@ -238,6 +240,7 @@ class UserInfoResponse {
uniqueCode: json['unique_code'] as String?,
enableAddWithUCode: json['enable_add_with_ucode'] as int?,
isPassNoviceGuide: json['is_pass_novice_guide'] as int?,
thirdAccountId: json['third_account_id'] as String?,
);
}
... ... @@ -261,6 +264,7 @@ class UserInfoResponse {
if (isPassNoviceGuide != null) {
val['is_pass_novice_guide'] = isPassNoviceGuide;
}
if (thirdAccountId != null) val['third_account_id'] = thirdAccountId;
return val;
}
}
... ...