Commit 994bf738e1f6be01e2e981c0033bb73c97bcc723

Authored by 刘宏哲
1 parent e76e2067

feat(app): update ui

... ... @@ -376,7 +376,7 @@ class _LegalNotes extends StatelessWidget {
_LegalText(
prefix: '1. ',
text: context.l10n.purchaseNoteSubscription,
linkText: '了解更多',
linkText: context.l10n.purchaseLinkLearnMore,
linkSuffix: '。',
onLinkTap: showRefundExplanationBottomSheet,
),
... ... @@ -392,9 +392,9 @@ class _LegalNotes extends StatelessWidget {
const SizedBox(height: 12),
*/
_LegalText(
prefix: '3. ',
prefix: '2. ',
text: context.l10n.purchaseNoteContact,
linkText: '联系我们',
linkText: context.l10n.purchaseLinkContactUs,
linkSuffix: '。',
onLinkTap: controller.openContactUs,
),
... ...
... ... @@ -187,6 +187,10 @@ class PurchaseController extends GetxController {
.where((product) => _nonEmpty(product.appleId) != null)
.toList();
plans.assignAll(products.map(_buildPlan));
final defaultProductIndex = products.indexWhere(
(product) => product.content?.isDefaultProduct() ?? false,
);
selectedIndex.value = defaultProductIndex >= 0 ? defaultProductIndex : 0;
isLoadingProducts.value = false;
await Future.wait(
... ...
... ... @@ -256,14 +256,14 @@ class _LegalNotes extends StatelessWidget {
_LegalText(
prefix: '1. ',
text: context.l10n.purchaseNoteSubscription,
linkText: '了解更多',
linkText: context.l10n.purchaseLinkLearnMore,
linkSuffix: '。',
onLinkTap: controller.openRefundExplanation,
),
const SizedBox(height: 12),
/*
_LegalText(
prefix: '2. ',
prefix: '3. ',
text: context.l10n.purchaseNoteRestore,
linkText: context.l10n.purchaseRestore,
linkSuffix: '。',
... ... @@ -272,9 +272,9 @@ class _LegalNotes extends StatelessWidget {
const SizedBox(height: 12),
*/
_LegalText(
prefix: '3. ',
prefix: '2. ',
text: context.l10n.purchaseNoteContact,
linkText: '联系我们',
linkText: context.l10n.purchaseLinkContactUs,
linkSuffix: '。',
onLinkTap: controller.openContactUs,
),
... ...
... ... @@ -87,6 +87,7 @@ class PayProductContent {
this.label,
this.description,
this.isForever,
this.isDefault,
this.share,
});
... ... @@ -95,6 +96,7 @@ class PayProductContent {
final String? label;
final String? description;
final int? isForever;
final int? isDefault;
final int? share;
factory PayProductContent.fromJson(Map<String, dynamic> json) {
... ... @@ -104,6 +106,7 @@ class PayProductContent {
label: json['label'] as String?,
description: json['description'] as String?,
isForever: json['is_forever'] as int?,
isDefault: json['is_default'] as int?,
share: json['share'] as int?,
);
}
... ... @@ -115,6 +118,7 @@ class PayProductContent {
if (label != null) val['label'] = label;
if (description != null) val['description'] = description;
if (isForever != null) val['is_forever'] = isForever;
if (isDefault != null) val['is_default'] = isDefault;
if (share != null) val['share'] = share;
return val;
}
... ... @@ -126,6 +130,10 @@ class PayProductContent {
int baseUnit() {
return isYearProduct() ? 12 : 1;
}
bool isDefaultProduct() {
return isDefault == 1;
}
}
class CreatePayOrderRequest {
... ...
... ... @@ -489,9 +489,11 @@
"purchaseBenefitSleepAnalysis": "Sleep analysis",
"purchaseBenefitFutureFeatures": "Free access to future premium features",
"purchaseNotesTitle": "Notes",
"purchaseNoteSubscription": "After you confirm and pay, the subscription will renew automatically through your iTunes account. Your Apple account will be charged within 24 hours before the current period ends, and the subscription will renew for another period. To cancel, turn off auto-renewal in your iTunes/Apple ID subscription settings at least 24 hours before the current period ends.\n\nDoubleFeel Pro is a virtual product. Purchases are non-refundable except through the App Store refund process. Tap Learn More for additional information.",
"purchaseNoteSubscription": "After you confirm and pay, the subscription will renew automatically through your iTunes account. Your Apple account will be charged within 24 hours before the current period ends, and the subscription will renew for another period. To cancel, turn off auto-renewal in your iTunes/Apple ID subscription settings at least 24 hours before the current period ends.\n\nDoubleFeel Pro is a virtual product. Purchases are non-refundable except through the App Store refund process. Tap ",
"purchaseLinkLearnMore": "Learn More",
"purchaseNoteRestore": "If your purchase does not take effect, tap Restore Purchases.",
"purchaseNoteContact": "Contact us if you have any other questions.",
"purchaseNoteContact": "If you have any other questions, ",
"purchaseLinkContactUs": "Contact Us",
"reportBottomSlogan": "FEEL MORE, STRESS LESS",
"refundExplanationTitle": "Refund Information",
"refundAppStoreReviewTitle": "Refunds are reviewed by the App Store",
... ...
... ... @@ -865,9 +865,11 @@
"purchaseBenefitSleepAnalysis": "睡眠分析",
"purchaseBenefitFutureFeatures": "未来更多高级权益免费获取",
"purchaseNotesTitle": "说明",
"purchaseNoteSubscription": "确认购买并支付后,将通过您的 iTunes 账号自动续订。苹果 iTunes 账户会在到期前24小时内扣费,扣费成功后订阅周期顺延一个订阅周期。如需取消续订,请在当前订阅周期到期前24小时以前,手动在 iTunes/Apple ID 设置管理中关闭自动续费功能。本服务由您自主选择是否取消,若您选择不取消,将为您开通下个计费周期的续费服务。\n\nDoubleFeel Pro 会员属于虚拟物品,购买后,除 App Store 渠道退款外,不支持其他形式退款。如有需要,可以点击了解更多。",
"purchaseNoteSubscription": "确认购买并支付后,将通过您的 iTunes 账号自动续订。苹果 iTunes 账户会在到期前24小时内扣费,扣费成功后订阅周期顺延一个订阅周期。如需取消续订,请在当前订阅周期到期前24小时以前,手动在 iTunes/Apple ID 设置管理中关闭自动续费功能。本服务由您自主选择是否取消,若您选择不取消,将为您开通下个计费周期的续费服务。\n\nDoubleFeel Pro 会员属于虚拟物品,购买后,除 App Store 渠道退款外,不支持其他形式退款。如有需要,可以点击",
"purchaseLinkLearnMore": "了解更多",
"purchaseNoteRestore": "如果购买后未生效,请点击恢复购买。",
"purchaseNoteContact": "如果有更多其他问题,请联系我们。",
"purchaseNoteContact": "如果有更多其他问题,请",
"purchaseLinkContactUs": "联系我们",
"reportBottomSlogan": "双倍感知 压力减半",
"refundExplanationTitle": "退费说明",
"@refundExplanationTitle": {
... ...
... ... @@ -3036,9 +3036,15 @@ abstract class AppLocalizations {
/// No description provided for @purchaseNoteSubscription.
///
/// In zh, this message translates to:
/// **'确认购买并支付后,将通过您的 iTunes 账号自动续订。苹果 iTunes 账户会在到期前24小时内扣费,扣费成功后订阅周期顺延一个订阅周期。如需取消续订,请在当前订阅周期到期前24小时以前,手动在 iTunes/Apple ID 设置管理中关闭自动续费功能。本服务由您自主选择是否取消,若您选择不取消,将为您开通下个计费周期的续费服务。\n\nDoubleFeel Pro 会员属于虚拟物品,购买后,除 App Store 渠道退款外,不支持其他形式退款。如有需要,可以点击了解更多。'**
/// **'确认购买并支付后,将通过您的 iTunes 账号自动续订。苹果 iTunes 账户会在到期前24小时内扣费,扣费成功后订阅周期顺延一个订阅周期。如需取消续订,请在当前订阅周期到期前24小时以前,手动在 iTunes/Apple ID 设置管理中关闭自动续费功能。本服务由您自主选择是否取消,若您选择不取消,将为您开通下个计费周期的续费服务。\n\nDoubleFeel Pro 会员属于虚拟物品,购买后,除 App Store 渠道退款外,不支持其他形式退款。如有需要,可以点击'**
String get purchaseNoteSubscription;
/// No description provided for @purchaseLinkLearnMore.
///
/// In zh, this message translates to:
/// **'了解更多'**
String get purchaseLinkLearnMore;
/// No description provided for @purchaseNoteRestore.
///
/// In zh, this message translates to:
... ... @@ -3048,9 +3054,15 @@ abstract class AppLocalizations {
/// No description provided for @purchaseNoteContact.
///
/// In zh, this message translates to:
/// **'如果有更多其他问题,请联系我们。'**
/// **'如果有更多其他问题,请'**
String get purchaseNoteContact;
/// No description provided for @purchaseLinkContactUs.
///
/// In zh, this message translates to:
/// **'联系我们'**
String get purchaseLinkContactUs;
/// No description provided for @reportBottomSlogan.
///
/// In zh, this message translates to:
... ...
... ... @@ -1696,15 +1696,20 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get purchaseNoteSubscription =>
'After you confirm and pay, the subscription will renew automatically through your iTunes account. Your Apple account will be charged within 24 hours before the current period ends, and the subscription will renew for another period. To cancel, turn off auto-renewal in your iTunes/Apple ID subscription settings at least 24 hours before the current period ends.\n\nDoubleFeel Pro is a virtual product. Purchases are non-refundable except through the App Store refund process. Tap Learn More for additional information.';
'After you confirm and pay, the subscription will renew automatically through your iTunes account. Your Apple account will be charged within 24 hours before the current period ends, and the subscription will renew for another period. To cancel, turn off auto-renewal in your iTunes/Apple ID subscription settings at least 24 hours before the current period ends.\n\nDoubleFeel Pro is a virtual product. Purchases are non-refundable except through the App Store refund process. Tap ';
@override
String get purchaseLinkLearnMore => 'Learn More';
@override
String get purchaseNoteRestore =>
'If your purchase does not take effect, tap Restore Purchases.';
@override
String get purchaseNoteContact =>
'Contact us if you have any other questions.';
String get purchaseNoteContact => 'If you have any other questions, ';
@override
String get purchaseLinkContactUs => 'Contact Us';
@override
String get reportBottomSlogan => 'FEEL MORE, STRESS LESS';
... ...
... ... @@ -1617,13 +1617,19 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get purchaseNoteSubscription =>
'确认购买并支付后,将通过您的 iTunes 账号自动续订。苹果 iTunes 账户会在到期前24小时内扣费,扣费成功后订阅周期顺延一个订阅周期。如需取消续订,请在当前订阅周期到期前24小时以前,手动在 iTunes/Apple ID 设置管理中关闭自动续费功能。本服务由您自主选择是否取消,若您选择不取消,将为您开通下个计费周期的续费服务。\n\nDoubleFeel Pro 会员属于虚拟物品,购买后,除 App Store 渠道退款外,不支持其他形式退款。如有需要,可以点击了解更多。';
'确认购买并支付后,将通过您的 iTunes 账号自动续订。苹果 iTunes 账户会在到期前24小时内扣费,扣费成功后订阅周期顺延一个订阅周期。如需取消续订,请在当前订阅周期到期前24小时以前,手动在 iTunes/Apple ID 设置管理中关闭自动续费功能。本服务由您自主选择是否取消,若您选择不取消,将为您开通下个计费周期的续费服务。\n\nDoubleFeel Pro 会员属于虚拟物品,购买后,除 App Store 渠道退款外,不支持其他形式退款。如有需要,可以点击';
@override
String get purchaseLinkLearnMore => '了解更多';
@override
String get purchaseNoteRestore => '如果购买后未生效,请点击恢复购买。';
@override
String get purchaseNoteContact => '如果有更多其他问题,请联系我们。';
String get purchaseNoteContact => '如果有更多其他问题,请';
@override
String get purchaseLinkContactUs => '联系我们';
@override
String get reportBottomSlogan => '双倍感知 压力减半';
... ...