|
|
|
import 'package:doublefeel_flutter/app/modules/home/views/tabs/my_tab.dart';
|
|
|
|
import 'package:doublefeel_flutter/app/modules/membership_offer/controllers/membership_detail_controller.dart';
|
|
|
|
import 'package:doublefeel_flutter/app/modules/purchase/widgets/purchase_colors.dart';
|
|
|
|
import 'package:doublefeel_flutter/app/modules/purchase/widgets/refund_explanation_bottom_sheet.dart';
|
|
|
|
import 'package:doublefeel_flutter/app/utils/platform_compact.dart';
|
|
|
|
import 'package:doublefeel_flutter/app/widget/premium_benefit_list_view.dart';
|
|
|
|
import 'package:doublefeel_flutter/app/widget/purchase_legal_notes.dart';
|
|
|
|
import 'package:doublefeel_flutter/core/theme/app_theme.dart';
|
|
|
|
import 'package:doublefeel_flutter/data/local/user_preferences_storage.dart';
|
|
|
|
import 'package:doublefeel_flutter/data/models/local/user_preferences.dart';
|
|
|
|
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
|
|
|
|
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart' as context;
|
|
|
|
import 'package:flutter/gestures.dart';
|
|
|
|
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:intl/intl.dart';
|
|
...
|
...
|
@@ -250,6 +248,36 @@ class MembershipDetailView extends GetView<MembershipDetailController> { |
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (isOhos() &&
|
|
|
|
controller.subscriptionAgreementNo.value !=
|
|
|
|
null)
|
|
|
|
GestureDetector(
|
|
|
|
onTap:
|
|
|
|
controller.showCancelSubscriptionDialog,
|
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
|
child: SizedBox(
|
|
|
|
height: 56,
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'取消自动续费',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/common/ic_more_gray.png',
|
|
|
|
width: 16,
|
|
|
|
height: 16,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (!isOhos() &&
|
|
|
|
(vipInfo?.vipType == 1 ||
|
|
|
|
vipInfo?.vipType == 2 ||
|
|
...
|
...
|
@@ -292,7 +320,15 @@ class MembershipDetailView extends GetView<MembershipDetailController> { |
|
|
|
SizedBox(
|
|
|
|
height: 28,
|
|
|
|
),
|
|
|
|
_LegalNotes(controller: controller)
|
|
|
|
isOhos()
|
|
|
|
? OhosPurchaseLegalNotes(
|
|
|
|
onContactUsTap: controller.openContactUs,
|
|
|
|
onSupportEmailTap: controller.openSupportEmail,
|
|
|
|
)
|
|
|
|
: IosPurchaseLegalNotes(
|
|
|
|
onRefundExplanationTap: showRefundExplanationBottomSheet,
|
|
|
|
onContactUsTap: controller.openContactUs,
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
...
|
...
|
@@ -334,7 +370,7 @@ class MembershipDetailView extends GetView<MembershipDetailController> { |
|
|
|
|
|
|
|
final dateStr = DateFormat.yMMMd(locale).format(date);
|
|
|
|
|
|
|
|
return l10n.membershipValidUntilDate(dateStr);
|
|
|
|
return isOhos() ? dateStr : l10n.membershipValidUntilDate(dateStr);
|
|
|
|
}
|
|
|
|
|
|
|
|
String _vipType(UserPreferencesVipInfo? vipInfo) {
|
|
...
|
...
|
@@ -359,191 +395,3 @@ class MembershipDetailView extends GetView<MembershipDetailController> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
} |
|
|
|
|
|
|
|
class _LegalNotes extends StatelessWidget {
|
|
|
|
const _LegalNotes({required this.controller});
|
|
|
|
|
|
|
|
final MembershipDetailController controller;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
if (isOhos()) {
|
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
context.l10n.purchaseNotesTitle,
|
|
|
|
style: const TextStyle(
|
|
|
|
color: Colors.black,
|
|
|
|
fontSize: 18,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
height: 1.2,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
const _LegalText(
|
|
|
|
prefix: '1. ',
|
|
|
|
text: '确认支付成功后,会员权益将立即生效。',
|
|
|
|
),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
const _LegalText(
|
|
|
|
prefix: '2. ',
|
|
|
|
text: 'DoubleFeel Pro 会员属于虚拟服务商品,购买后除法律法规另有规定外,通常不支持退款。',
|
|
|
|
),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
const _LegalText(
|
|
|
|
prefix: '3. ',
|
|
|
|
text: '如支付成功后会员未生效,请尝试重新登录账号。',
|
|
|
|
),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
_LegalText(
|
|
|
|
prefix: '4. ',
|
|
|
|
text: '如果有更多其它问题请',
|
|
|
|
linkText: context.l10n.purchaseLinkContactUs,
|
|
|
|
linkSuffix: '。',
|
|
|
|
onLinkTap: controller.openContactUs,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
context.l10n.purchaseNotesTitle,
|
|
|
|
style: const TextStyle(
|
|
|
|
color: Colors.black,
|
|
|
|
fontSize: 18,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
height: 1.2,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
_LegalText(
|
|
|
|
prefix: '1. ',
|
|
|
|
text: context.l10n.purchaseNoteSubscription,
|
|
|
|
linkText: context.l10n.purchaseLinkLearnMore,
|
|
|
|
linkSuffix: '。',
|
|
|
|
onLinkTap: showRefundExplanationBottomSheet,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
/*
|
|
|
|
_LegalText(
|
|
|
|
prefix: '2. ',
|
|
|
|
text: context.l10n.purchaseNoteRestore,
|
|
|
|
linkText: context.l10n.purchaseRestore,
|
|
|
|
linkSuffix: '。',
|
|
|
|
onLinkTap: controller.restorePurchase,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
*/
|
|
|
|
_LegalText(
|
|
|
|
prefix: '2. ',
|
|
|
|
text: context.l10n.purchaseNoteContact,
|
|
|
|
linkText: context.l10n.purchaseLinkContactUs,
|
|
|
|
linkSuffix: '。',
|
|
|
|
onLinkTap: controller.openContactUs,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _LegalText extends StatefulWidget {
|
|
|
|
const _LegalText({
|
|
|
|
required this.prefix,
|
|
|
|
required this.text,
|
|
|
|
this.linkText,
|
|
|
|
this.linkSuffix,
|
|
|
|
this.onLinkTap,
|
|
|
|
});
|
|
|
|
|
|
|
|
final String prefix;
|
|
|
|
final String text;
|
|
|
|
final String? linkText;
|
|
|
|
final String? linkSuffix;
|
|
|
|
final VoidCallback? onLinkTap;
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<_LegalText> createState() => _LegalTextState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _LegalTextState extends State<_LegalText> {
|
|
|
|
late final TapGestureRecognizer _linkRecognizer;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
_linkRecognizer = TapGestureRecognizer()..onTap = widget.onLinkTap;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void didUpdateWidget(covariant _LegalText oldWidget) {
|
|
|
|
super.didUpdateWidget(oldWidget);
|
|
|
|
_linkRecognizer.onTap = widget.onLinkTap;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
_linkRecognizer.dispose();
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
static const _baseStyle = TextStyle(
|
|
|
|
color: PurchaseColors.subtitle,
|
|
|
|
fontSize: 12,
|
|
|
|
height: 1.4,
|
|
|
|
);
|
|
|
|
|
|
|
|
static const _linkStyle = TextStyle(
|
|
|
|
color: Color(0xFF845EEE),
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
decorationColor: Color(0xFF845EEE),
|
|
|
|
);
|
|
|
|
|
|
|
|
TextSpan _buildTextSpan() => TextSpan(
|
|
|
|
style: _baseStyle,
|
|
|
|
children: [
|
|
|
|
TextSpan(text: widget.text),
|
|
|
|
if (widget.linkText case final linkText?)
|
|
|
|
TextSpan(
|
|
|
|
text: linkText,
|
|
|
|
style: _linkStyle,
|
|
|
|
recognizer: widget.onLinkTap == null ? null : _linkRecognizer,
|
|
|
|
),
|
|
|
|
if (widget.linkSuffix case final linkSuffix?)
|
|
|
|
TextSpan(text: linkSuffix),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
widget.prefix,
|
|
|
|
style: const TextStyle(
|
|
|
|
color: PurchaseColors.subtitle,
|
|
|
|
fontSize: 12,
|
|
|
|
height: 1.4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Text.rich(
|
|
|
|
_buildTextSpan(),
|
|
|
|
textScaler: MediaQuery.textScalerOf(context),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|