Commit 26a89835 authored by jinzhu's avatar jinzhu

update

parent 6582f33b
...@@ -9,12 +9,10 @@ ...@@ -9,12 +9,10 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter_boost/flutter_boost.dart'; import 'package:flutter_boost/flutter_boost.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/netWork/DioUtil.dart' as prefix0; import 'macros/ALColors.dart';
import 'macros/ALColors.dart'
import 'macros/ALDevice.dart'; import 'macros/ALDevice.dart';
import 'netWork/DioUtil.dart'; import 'netWork/DioUtil.dart';
class CommentSuggest extends StatelessWidget { class CommentSuggest extends StatelessWidget {
final Map params; final Map params;
CommentSuggest(this.params); CommentSuggest(this.params);
...@@ -27,7 +25,7 @@ class CommentSuggest extends StatelessWidget { ...@@ -27,7 +25,7 @@ class CommentSuggest extends StatelessWidget {
theme: ThemeData( theme: ThemeData(
splashColor: Colors.white10, //水波纹的颜色 splashColor: Colors.white10, //水波纹的颜色
), ),
home: CommentSuggestPage(title: '意见和建议',nativeCookie: this.params), home: CommentSuggestPage(nativeCookie: this.params,title: '意见与建议',)
); );
} }
} }
...@@ -35,9 +33,10 @@ class CommentSuggest extends StatelessWidget { ...@@ -35,9 +33,10 @@ class CommentSuggest extends StatelessWidget {
class CommentSuggestPage extends StatefulWidget { class CommentSuggestPage extends StatefulWidget {
final String title; final String title;
final String content;
final String tel;
final Map nativeCookie; final Map nativeCookie;
CommentSuggestPage({Key key, this.title, this.nativeCookie}) : super(key: key);
@override @override
_CommentSuggestPageState createState() => _CommentSuggestPageState(); _CommentSuggestPageState createState() => _CommentSuggestPageState();
} }
...@@ -50,20 +49,13 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> { ...@@ -50,20 +49,13 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
// backgroundColor: ALColors.ColorFFFFFF,
backgroundColor: Colors.white10, backgroundColor: Colors.white10,
leading: new GestureDetector( leading: new GestureDetector(
child: new Icon(Icons.keyboard_backspace), child: new Icon(Icons.keyboard_backspace),
onTap: () { onTap: () {
FlutterBoost.singleton.closePageForContext(context); FlutterBoost.singleton.closePageForContext(context);
}), }),
title: this.title, title: new Text(widget.title),
style: TextStyle(
color: ALColors.Color323232,
fontSize: 16,
fontWeight: FontWeight.bold),
),
), ),
body: Container( body: Container(
height: ALDevice.height, height: ALDevice.height,
...@@ -151,11 +143,16 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> { ...@@ -151,11 +143,16 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
} }
void confimSuggestInfo() { void confimSuggestInfo() {
print('11111111----come----confimSuggestInfo');
BaseOptions options = DioUtil.getDefOptions(); BaseOptions options = DioUtil.getDefOptions();
HttpConfig config = new HttpConfig(options: options, nativeCookie: this.); HttpConfig config = new HttpConfig(options: options, nativeCookie: widget.nativeCookie);
DioUtil().setConfig(config); DioUtil().setConfig(config);
print('aaaaaaaa----come----config');
print(config.nativeCookie);
print('bbbb----come----cookie');
print(widget.nativeCookie);
DioUtil().requestR(Method.post, "/api/v1/suggestion",data: {"content": "add", "phone": "aaa"}).then((res){ DioUtil().requestR(Method.post, "api/v1/suggestion",data: {"content": "add", "phone": "aaa"}).then((res){
showAlertDialog(context, res.data); showAlertDialog(context, res.data);
} }
).then((error){ ).then((error){
......
...@@ -22,7 +22,7 @@ class _MyAppState extends State<MyApp> { ...@@ -22,7 +22,7 @@ class _MyAppState extends State<MyApp> {
'second': (pageName, params, _) => SecondRouteWidget(), 'second': (pageName, params, _) => SecondRouteWidget(),
'tab': (pageName, params, _) => TabRouteWidget(), 'tab': (pageName, params, _) => TabRouteWidget(),
'flutterFragment': (pageName, params, _) => FragmentRouteWidget(params), 'flutterFragment': (pageName, params, _) => FragmentRouteWidget(params),
'comment_suggest': (pageName, params, _) => CommentSuggest(params), 'comment_suggest': (pageName, params, _) => CommentSuggest(params),
///可以在native层通过 getContainerParams 来传递参数 ///可以在native层通过 getContainerParams 来传递参数
'flutterPage': (pageName, params, _) { 'flutterPage': (pageName, params, _) {
...@@ -39,15 +39,6 @@ class _MyAppState extends State<MyApp> { ...@@ -39,15 +39,6 @@ class _MyAppState extends State<MyApp> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
locale: Locale('en', 'US'), locale: Locale('en', 'US'),
// locale: Locale('zh', 'CN'),
// localeResolutionCallback: (Locale locale, Iterable<Locale> supportedLocales) {
// return Locale('en', 'US');
// },
// localizationsDelegates: [
// NinghaoDemoLocalizationsDelegate(),
// GlobalMaterialLocalizations.delegate,
// GlobalWidgetsLocalizations.delegate,
// ],
supportedLocales: [ supportedLocales: [
Locale('en', 'US'), Locale('en', 'US'),
Locale('zh', 'CN'), Locale('zh', 'CN'),
...@@ -56,7 +47,7 @@ class _MyAppState extends State<MyApp> { ...@@ -56,7 +47,7 @@ class _MyAppState extends State<MyApp> {
// home: NavigatorDemo(), // home: NavigatorDemo(),
initialRoute: '/test', initialRoute: '/test',
routes: { routes: {
'/': (context) => CommentSuggest(), '/': (context) => CommentSuggest({'cookie': '124'}),
}, },
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.yellow, primarySwatch: Colors.yellow,
......
...@@ -67,6 +67,7 @@ class HttpConfig { ...@@ -67,6 +67,7 @@ class HttpConfig {
this.pem, this.pem,
this.pKCSPath, this.pKCSPath,
this.pKCSPwd, this.pKCSPwd,
this.nativeCookie,
}); });
/// BaseResp [String status]字段 key, 默认:status. /// BaseResp [String status]字段 key, 默认:status.
...@@ -95,6 +96,8 @@ class HttpConfig { ...@@ -95,6 +96,8 @@ class HttpConfig {
/// 详细使用请查看dio官网 https://github.com/flutterchina/dio/blob/flutter/README-ZH.md#Https证书校验. /// 详细使用请查看dio官网 https://github.com/flutterchina/dio/blob/flutter/README-ZH.md#Https证书校验.
/// PKCS12 证书密码. /// PKCS12 证书密码.
String pKCSPwd; String pKCSPwd;
//缓存
Map nativeCookie;
} }
/// 单例 DioUtil. /// 单例 DioUtil.
...@@ -403,7 +406,7 @@ class DioUtil { ...@@ -403,7 +406,7 @@ class DioUtil {
options.connectTimeout = 10 * 1000; options.connectTimeout = 10 * 1000;
options.receiveTimeout = 20 * 1000; options.receiveTimeout = 20 * 1000;
options.contentType = ContentType.parse('application/x-www-form-urlencoded'); options.contentType = ContentType.parse('application/x-www-form-urlencoded');
options.baseUrl = 'https://earth.iyanzhi.com'; options.baseUrl = 'http://earth.igengmei.com/';
Map<String, dynamic> headers = Map<String, dynamic>(); Map<String, dynamic> headers = Map<String, dynamic>();
headers['Accept'] = 'application/json'; headers['Accept'] = 'application/json';
return options; return options;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment