优化订阅逻辑-未绑定账号的必须登录才可以购买套餐
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:kaer_with_panels/app/localization/app_translations.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/kr_app_text_style.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/kr_local_image.dart';
|
||||
import 'package:kaer_with_panels/app/routes/app_pages.dart';
|
||||
import 'package:kaer_with_panels/app/utils/kr_subscribe_navigation_util.dart';
|
||||
import '../controllers/kr_home_controller.dart';
|
||||
import '../models/kr_home_views_status.dart';
|
||||
|
||||
@@ -43,8 +44,8 @@ class KRHomeConnectionOptionsView extends GetView<KRHomeController> {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (controller.kr_subscribeService.kr_currentSubscribe.value == null) {
|
||||
// 未订阅状态下跳转到购买会员页面
|
||||
Get.toNamed(Routes.KR_PURCHASE_MEMBERSHIP);
|
||||
// 未订阅状态下,使用统一的订阅导航工具
|
||||
KRSubscribeNavigationUtil.navigateToPurchase(tag: 'ConnectionOptions');
|
||||
} else {
|
||||
// 已订阅状态下执行原有的点击事件
|
||||
onTap?.call();
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:kaer_with_panels/app/localization/app_translations.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/kr_app_text_style.dart';
|
||||
import '../../../routes/app_pages.dart';
|
||||
import '../../../utils/kr_subscribe_navigation_util.dart';
|
||||
import '../controllers/kr_home_controller.dart';
|
||||
|
||||
|
||||
@@ -40,7 +41,7 @@ class KRHomeLastDayCard extends GetView<KRHomeController> {
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () => Get.toNamed(Routes.KR_PURCHASE_MEMBERSHIP),
|
||||
onTap: () => KRSubscribeNavigationUtil.navigateToPurchase(tag: 'LastDayCard'),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:kaer_with_panels/app/widgets/kr_app_text_style.dart';
|
||||
import '../../../routes/app_pages.dart';
|
||||
import '../../../services/kr_subscribe_service.dart';
|
||||
import '../../../utils/kr_log_util.dart';
|
||||
import '../../../utils/kr_subscribe_navigation_util.dart';
|
||||
import '../controllers/kr_home_controller.dart';
|
||||
|
||||
/// 试用卡片组件
|
||||
@@ -41,7 +42,7 @@ class KRHomeTrialCard extends GetView<KRHomeController> {
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () => Get.toNamed(Routes.KR_PURCHASE_MEMBERSHIP),
|
||||
onTap: () => KRSubscribeNavigationUtil.navigateToPurchase(tag: 'TrialCard'),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:kaer_with_panels/app/localization/app_translations.dart';
|
||||
|
||||
import 'package:kaer_with_panels/app/routes/app_pages.dart';
|
||||
import 'package:kaer_with_panels/app/utils/kr_subscribe_navigation_util.dart';
|
||||
|
||||
import '../../../widgets/kr_app_text_style.dart';
|
||||
|
||||
@@ -65,7 +66,7 @@ class KRSubscriptionCard extends StatelessWidget {
|
||||
width: double.infinity,
|
||||
height: 42.h,
|
||||
child: ElevatedButton(
|
||||
onPressed: () => Get.toNamed(Routes.KR_PURCHASE_MEMBERSHIP),
|
||||
onPressed: () => KRSubscribeNavigationUtil.navigateToPurchase(tag: 'SubscriptionCard'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.blue,
|
||||
elevation: 0,
|
||||
|
||||
@@ -14,6 +14,7 @@ import 'package:kaer_with_panels/app/widgets/kr_app_text_style.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/kr_local_image.dart';
|
||||
import 'package:kaer_with_panels/app/modules/kr_main/controllers/kr_main_controller.dart';
|
||||
import 'package:kaer_with_panels/app/modules/kr_home/widgets/kr_subscribe_selector_view.dart';
|
||||
import 'package:kaer_with_panels/app/utils/kr_subscribe_navigation_util.dart';
|
||||
import '../../../common/app_run_data.dart';
|
||||
import '../../../model/response/kr_user_available_subscribe.dart';
|
||||
import '../../../services/kr_subscribe_service.dart';
|
||||
@@ -533,7 +534,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
onPressed: () => Get.toNamed(Routes.KR_PURCHASE_MEMBERSHIP),
|
||||
onPressed: () => KRSubscribeNavigationUtil.navigateToPurchase(tag: 'UserInfo'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF1797FF),
|
||||
foregroundColor: Colors.white,
|
||||
@@ -597,7 +598,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
||||
ElevatedButton(
|
||||
onPressed: !isLoggedIn
|
||||
? () => Get.find<KRMainController>().kr_setPage(0)
|
||||
: () => Get.toNamed(Routes.KR_PURCHASE_MEMBERSHIP),
|
||||
: () => KRSubscribeNavigationUtil.navigateToPurchase(tag: 'UserInfo'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF1797FF),
|
||||
foregroundColor: Colors.white,
|
||||
|
||||
Reference in New Issue
Block a user