协议前置

This commit is contained in:
2026-03-19 14:41:32 +08:00
parent 9b6f93ca95
commit 03b35f660c
2 changed files with 91 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
PODS:
- AlicloudELS (1.0.3)
- AlicloudPush (3.2.3):
- AlicloudELS (= 1.0.3)
- AlicloudELS (~> 1.0.3)
- AlicloudUTDID (~> 1.0)
- AlicloudUTDID (1.6.1)
- aliyun_push_flutter (0.0.1):
@@ -115,11 +115,11 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AlicloudELS: fbf821383330465a5af84a033f36f263ae46ca41
AlicloudPush: 95150880af380f64cf1741f5586047c17d36c1d9
AlicloudPush: 52cbf38ffc20c07f039cbc72d5738745fd986215
AlicloudUTDID: 5d2f22d50e11eecd38f30bc7a48c71925ea90976
aliyun_push_flutter: 0fc2f048a08687ef256c0cfdd72dd7a550ef3347
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
device_info_plus: 71ffc6ab7634ade6267c7a93088ed7e4f74e5896
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_app_update: 816fdb2e30e4832a7c45e3f108d391c42ef040a9
flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99

View File

@@ -1,16 +1,103 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:get/get.dart';
import 'package:getx_scaffold/common/components/index.dart';
import 'package:getx_scaffold/common/widgets/rich_text_x.dart';
import 'package:ln_jq_app/pages/home/view.dart';
import 'package:ln_jq_app/pages/login/view.dart';
import 'package:ln_jq_app/storage_service.dart';
import '../common/webview/view.dart';
class WelcomeController extends GetxController {
@override
void onReady() {
super.onReady();
// 移除原生闪屏页(如果有的话)
FlutterNativeSplash.remove();
_startTimer();
if (Platform.isAndroid) {
if (StorageService.to.isPrivacyAgreed) {
_startTimer();
} else {
showPrivacyDialog();
}
} else if (Platform.isIOS) {
_startTimer();
}
}
void showPrivacyDialog() {
DialogX.to.showConfirmDialog(
title: "个人信息保护提示",
content: _buildDialogContent(),
confirmText: '同意',
cancelText: '不同意',
onConfirm: () async {
await StorageService.to.savePrivacyAgreed(true);
Get.offAll(() => const HomePage());
},
onCancel: () {
DialogX.to.showConfirmDialog(
title: "温馨提示",
content: RichTextX(
children: [
TextSpanItem('如果您不同意'),
TextSpanItem(
'《隐私协议》',
onTap: () => openPage("隐私政策", "https://lnh2e.com/privacy_agreement.html"),
),
TextSpanItem(''),
TextSpanItem(
'《用户政策》',
onTap: () => openPage("用户协议", "https://lnh2e.com/user_agreement.html"),
),
TextSpanItem(
',很遗憾我们将无法为您提供服务。您需要同意以上协议后,才能使用本应用。\n\n我们将严格按照相关法律法规要求,坚决保护您的个人隐私和信息安全。',
),
TextSpanItem('\n点击“同意”按钮,表示您已知情并同意以上协议。'),
],
),
confirmText: '同意并继续',
cancelText: '不同意',
onConfirm: () async {
await StorageService.to.savePrivacyAgreed(true);
Get.offAll(() => const HomePage());
},
onCancel: () {
SystemNavigator.pop();
},
);
},
);
}
Widget _buildDialogContent() {
return RichTextX(
children: [
TextSpanItem('欢迎使用小羚羚!\n我们将通过'),
TextSpanItem(
'《隐私协议》',
onTap: () => openPage("隐私政策", "https://lnh2e.com/privacy_agreement.html"),
),
TextSpanItem(''),
TextSpanItem(
'《用户政策》',
onTap: () => openPage("用户协议", "https://lnh2e.com/user_agreement.html"),
),
TextSpanItem(
',帮助您了解我们为您提供的服务、我们如何处理个人信息以及您享有的权利。我们会严格按照相关法律法规要求,采取各种安全措施来保护您的个人信息。',
),
TextSpanItem('\n点击“同意”按钮,表示您已知情并同意以上协议。'),
],
);
}
void openPage(String title, String url) {
Get.to(() => const WebViewPage(), arguments: {'title': title, 'url': url});
}
void _startTimer() {