Browse Source

协议更改

remove_uniapp
w-R 3 years ago
parent
commit
c9abd24426
  1. 4
      lib/login/login_page.dart
  2. 5
      lib/main.dart
  3. 5
      lib/setting/about_page.dart
  4. 12
      lib/setting/treaty_page.dart
  5. 49
      lib/setting/user_service_page.dart
  6. 2
      lib/web/web_turntable_activity.dart

4
lib/login/login_page.dart

@ -111,7 +111,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
initController() { initController() {
tapGestureRecognizer.onTap = () { tapGestureRecognizer.onTap = () {
Navigator.of(context).pushNamed('/router/treaty_page',arguments: {"userType" : "0"}); Navigator.of(context).pushNamed('/router/treaty_page');
}; };
scrollController = ScrollController(keepScrollOffset: false); scrollController = ScrollController(keepScrollOffset: false);
@ -1112,7 +1112,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
recognizer: TapGestureRecognizer() recognizer: TapGestureRecognizer()
..onTap = () { ..onTap = () {
Navigator.of(context) Navigator.of(context)
.popAndPushNamed('/router/treaty_page',arguments: {"userType" : "0"}); .popAndPushNamed('/router/treaty_page');
}, },
), ),
]), ]),

5
lib/main.dart

@ -53,6 +53,7 @@ import 'package:huixiang/setting/logout_page.dart';
import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart';
import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/setting_page.dart';
import 'package:huixiang/setting/treaty_page.dart'; import 'package:huixiang/setting/treaty_page.dart';
import 'package:huixiang/setting/user_service_page.dart';
import 'package:huixiang/store/store_order.dart'; import 'package:huixiang/store/store_order.dart';
import 'package:huixiang/settlement/settlement.dart'; import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/test_page.dart'; import 'package:huixiang/test_page.dart';
@ -333,7 +334,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/coupons_page': (context, {arguments}) => CouponsPage(), '/router/coupons_page': (context, {arguments}) => CouponsPage(),
'/router/setting_page': (context, {arguments}) => SettingPage(), '/router/setting_page': (context, {arguments}) => SettingPage(),
'/router/qr_scan': (context, {arguments}) => QrCodeScanPage(), '/router/qr_scan': (context, {arguments}) => QrCodeScanPage(),
'/router/treaty_page': (context, {arguments}) => TreatyPage(arguments:arguments), '/router/treaty_page': (context, {arguments}) => TreatyPage(),
'/router/mine_card': (context, {arguments}) => MineCardPage(), '/router/mine_card': (context, {arguments}) => MineCardPage(),
'/router/guide_Page': (context, {arguments}) => GuidePage(), '/router/guide_Page': (context, {arguments}) => GuidePage(),
'/router/about_page': (context, {arguments}) => AboutPage(), '/router/about_page': (context, {arguments}) => AboutPage(),
@ -367,4 +368,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
LogoutPage(), LogoutPage(),
'/router/logout_ing': (context, {arguments}) => '/router/logout_ing': (context, {arguments}) =>
LogoutIng(), LogoutIng(),
'/router/user_service_page': (context, {arguments}) =>
UserServicePage(),
}; };

5
lib/setting/about_page.dart

@ -106,14 +106,13 @@ class _AboutPage extends State<AboutPage> {
GestureDetector( GestureDetector(
child: settingSingleItem(S.of(context).yinsishengming), child: settingSingleItem(S.of(context).yinsishengming),
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/treaty_page',arguments: {"userType" : "0"}); Navigator.of(context).pushNamed('/router/treaty_page');
}, },
), ),
GestureDetector( GestureDetector(
child: settingSingleItem("用户协议"), child: settingSingleItem("用户协议"),
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/treaty_page', Navigator.of(context).pushNamed('/router/user_service_page');
arguments: {"userType" : "1"});
}, },
), ),
Padding( Padding(

12
lib/setting/treaty_page.dart

@ -1,14 +1,15 @@
import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:webview_flutter/src/webview_cupertino.dart';
class TreatyPage extends StatefulWidget { class TreatyPage extends StatefulWidget {
final Map<String, dynamic> arguments;
TreatyPage({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _TreatyPage(); return _TreatyPage();
@ -22,7 +23,6 @@ class _TreatyPage extends State<TreatyPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
userType = widget.arguments["userType"];
// if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); // if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
// if (Platform.isIOS) WebView.platform = CupertinoWebView(); // if (Platform.isIOS) WebView.platform = CupertinoWebView();
} }
@ -31,7 +31,7 @@ class _TreatyPage extends State<TreatyPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
title: (userType == "0") ? S.of(context).yinsishengming : "用户协议", title:S.of(context).yinsishengming,
titleColor: Colors.black, titleColor: Colors.black,
background: Colors.transparent, background: Colors.transparent,
leadingColor: Colors.black, leadingColor: Colors.black,
@ -58,7 +58,7 @@ class _TreatyPage extends State<TreatyPage> {
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
(userType == "0") ? "用户注册及使用App隐私协议" : "用户协议", "用户注册及使用App隐私协议",
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,

49
lib/setting/user_service_page.dart

@ -0,0 +1,49 @@
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:webview_flutter/src/webview_cupertino.dart';
class UserServicePage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _UserServicePage();
}
}
class _UserServicePage extends State<UserServicePage> with WidgetsBindingObserver {
var controller = new ScrollController();
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
if (Platform.isIOS) WebView.platform = CupertinoWebView();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title:"用户协议",
titleColor: Colors.black,
background: Color(0xFFFFFFFF),
leadingColor: Colors.black,
),
body: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
alignment: Alignment.center,
child:
WebView(
initialUrl: "http://huixiang.lotus-wallet.com/user.html",
javascriptMode: JavascriptMode.unrestricted,
)),
);
}
}

2
lib/web/web_turntable_activity.dart

@ -8,6 +8,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter/webview_flutter.dart';
import 'package:webview_flutter/src/webview_cupertino.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class WebTurntableActivity extends StatefulWidget { class WebTurntableActivity extends StatefulWidget {
@ -35,6 +36,7 @@ class _WebTurntableActivity extends State<WebTurntableActivity> with WidgetsBind
token = value.getString('token'), token = value.getString('token'),
}); });
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
if (Platform.isIOS) WebView.platform = CupertinoWebView();
} }

Loading…
Cancel
Save