This commit is contained in:
魏少阳 2023-10-12 14:00:54 +08:00
commit 35d35c545d
8 changed files with 95 additions and 4 deletions

View File

@ -59,6 +59,8 @@ PODS:
- Toast (4.0.0)
- url_launcher_ios (0.0.1):
- Flutter
- webview_flutter_wkwebview (0.0.1):
- Flutter
DEPENDENCIES:
- aj_captcha_flutter (from `.symlinks/plugins/aj_captcha_flutter/ios`)
@ -79,6 +81,7 @@ DEPENDENCIES:
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
SPEC REPOS:
trunk:
@ -128,6 +131,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
SPEC CHECKSUMS:
aj_captcha_flutter: dd7af1aa064bdd621ae335b819bab07309c3c023
@ -156,6 +161,7 @@ SPEC CHECKSUMS:
SwiftProtobuf: 40bd808372cb8706108f22d28f8ab4a6b9bc6989
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
PODFILE CHECKSUM: 99f32fc524867f7069762a97e548b5edf4ebf43f

View File

@ -72,6 +72,8 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>

View File

@ -8,6 +8,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart';
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
import 'package:star_lock/mine/about/webviewShow_page.dart';
import 'package:star_lock/mine/mine/safeVerify/safeVerify_page.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/mineBindPhoneOrEmail_page.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoViewSafetyProblem/minePersonInfoViewSafetyProblem_page.dart';
@ -329,6 +330,7 @@ abstract class Routers {
static const expireLockChangeDatePage =
'/expireLockChangeDatePage'; //
static const safeVerifyPage = '/safeVerifyPage'; //
static const webviewShowPage = '/webviewShowPage'; //
}
abstract class AppRouters {
@ -820,6 +822,7 @@ abstract class AppRouters {
GetPage(name: Routers.safeVerifyPage, page: () => const SafeVerifyPage()),
GetPage(
name: Routers.minePersonInfoViewSafetyProblemPage,
page: () => const MinePersonInfoViewSafetyProblemPage())
page: () => const MinePersonInfoViewSafetyProblemPage()),
GetPage(name: Routers.webviewShowPage, page: () => const WebviewShowPage()),
];
}

View File

@ -1,12 +1,22 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import '../../app_settings/app_colors.dart';
import '../../tools/commonItem.dart';
import '../../tools/titleAppBar.dart';
import '../../translations/trans_lib.dart';
//
class XSWebviewURLMacro {
static const baseWebURL = 'http://192.168.56.101:8099'; //baseURL
static const userAgreementURL =
'$baseWebURL/page/detail?pageId=1&lang=cn'; //1
static const privacyPolicyURL =
'$baseWebURL/page/detail?pageId=2&lang=cn'; //2
}
class AbountPage extends StatefulWidget {
const AbountPage({Key? key}) : super(key: key);
@ -66,7 +76,13 @@ class _AbountPageState extends State<AbountPage> {
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {}),
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSWebviewURLMacro.userAgreementURL,
"title": '用户协议'
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
@ -78,7 +94,13 @@ class _AbountPageState extends State<AbountPage> {
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {}),
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSWebviewURLMacro.privacyPolicyURL,
"title": '隐私政策'
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,

View File

@ -0,0 +1,56 @@
import 'package:flutter/material.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/tools/titleAppBar.dart';
import 'package:webview_flutter/webview_flutter.dart';
class WebviewShowPage extends StatefulWidget {
const WebviewShowPage({Key? key}) : super(key: key);
@override
State<WebviewShowPage> createState() => _WebviewShowPageState();
}
class _WebviewShowPageState extends State<WebviewShowPage> {
late WebViewController _webViewController;
String _webURL = '';
String _webTitle = '';
@override
void initState() {
super.initState();
_webViewController = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted);
}
@override
Widget build(BuildContext context) {
dynamic obj = ModalRoute.of(context)?.settings.arguments;
if (obj != null && (obj["url"] != null)) {
_webURL = obj["url"];
}
if (obj != null && (obj["title"] != null)) {
_webTitle = obj["title"];
}
_webViewController.loadRequest(Uri.parse(_webURL));
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFFFFFFF),
appBar: TitleAppBar(
barTitle: getWebTitle(),
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: WebViewWidget(controller: _webViewController));
}
String getWebTitle() {
String webTitleStr = _webTitle;
_webViewController.getTitle().then((result) {
webTitleStr = result!;
});
return webTitleStr;
}
}

View File

@ -1,7 +1,6 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:get/get_utils/get_utils.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoSetSafetyProblem/minePersonInfoSetSafetyProblem_state.dart';
import 'package:star_lock/tools/toast.dart';

View File

@ -4,6 +4,7 @@ abstract class Api {
// final String baseUrl = "http://wenlin.lock.star-lock.cn/api"; //
final String baseUrl = "http://192.168.56.101:8099/api"; //
// final String baseUrl = "http://192.168.1.14:8099/api"; //
final String baseWebURL = 'http://192.168.56.101:8099'; //
//
final String getVerificationCodeUrl = '/user/sendValidationCode';

View File

@ -110,6 +110,8 @@ dependencies:
#网络图片缓存
cached_network_image: ^3.2.0
webview_flutter: ^4.2.3
dev_dependencies:
flutter_test:
sdk: flutter