Commit 26a89835 authored by jinzhu's avatar jinzhu

update

parent 6582f33b
......@@ -9,12 +9,10 @@
import 'package:dio/dio.dart';
import 'package:flutter_boost/flutter_boost.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 'netWork/DioUtil.dart';
class CommentSuggest extends StatelessWidget {
final Map params;
CommentSuggest(this.params);
......@@ -27,7 +25,7 @@ class CommentSuggest extends StatelessWidget {
theme: ThemeData(
splashColor: Colors.white10, //水波纹的颜色
),
home: CommentSuggestPage(title: '意见和建议',nativeCookie: this.params),
home: CommentSuggestPage(nativeCookie: this.params,title: '意见与建议',)
);
}
}
......@@ -35,9 +33,10 @@ class CommentSuggest extends StatelessWidget {
class CommentSuggestPage extends StatefulWidget {
final String title;
final String content;
final String tel;
final Map nativeCookie;
CommentSuggestPage({Key key, this.title, this.nativeCookie}) : super(key: key);
@override
_CommentSuggestPageState createState() => _CommentSuggestPageState();
}
......@@ -50,20 +49,13 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
// backgroundColor: ALColors.ColorFFFFFF,
backgroundColor: Colors.white10,
leading: new GestureDetector(
child: new Icon(Icons.keyboard_backspace),
onTap: () {
FlutterBoost.singleton.closePageForContext(context);
}),
title: this.title,
style: TextStyle(
color: ALColors.Color323232,
fontSize: 16,
fontWeight: FontWeight.bold),
),
title: new Text(widget.title),
),
body: Container(
height: ALDevice.height,
......@@ -151,11 +143,16 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
}
void confimSuggestInfo() {
print('11111111----come----confimSuggestInfo');
BaseOptions options = DioUtil.getDefOptions();
HttpConfig config = new HttpConfig(options: options, nativeCookie: this.);
HttpConfig config = new HttpConfig(options: options, nativeCookie: widget.nativeCookie);
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);
}
).then((error){
......
......@@ -22,7 +22,7 @@ class _MyAppState extends State<MyApp> {
'second': (pageName, params, _) => SecondRouteWidget(),
'tab': (pageName, params, _) => TabRouteWidget(),
'flutterFragment': (pageName, params, _) => FragmentRouteWidget(params),
'comment_suggest': (pageName, params, _) => CommentSuggest(params),
'comment_suggest': (pageName, params, _) => CommentSuggest(params),
///可以在native层通过 getContainerParams 来传递参数
'flutterPage': (pageName, params, _) {
......@@ -39,15 +39,6 @@ class _MyAppState extends State<MyApp> {
Widget build(BuildContext context) {
return MaterialApp(
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: [
Locale('en', 'US'),
Locale('zh', 'CN'),
......@@ -56,7 +47,7 @@ class _MyAppState extends State<MyApp> {
// home: NavigatorDemo(),
initialRoute: '/test',
routes: {
'/': (context) => CommentSuggest(),
'/': (context) => CommentSuggest({'cookie': '124'}),
},
theme: ThemeData(
primarySwatch: Colors.yellow,
......
......@@ -67,6 +67,7 @@ class HttpConfig {
this.pem,
this.pKCSPath,
this.pKCSPwd,
this.nativeCookie,
});
/// BaseResp [String status]字段 key, 默认:status.
......@@ -95,6 +96,8 @@ class HttpConfig {
/// 详细使用请查看dio官网 https://github.com/flutterchina/dio/blob/flutter/README-ZH.md#Https证书校验.
/// PKCS12 证书密码.
String pKCSPwd;
//缓存
Map nativeCookie;
}
/// 单例 DioUtil.
......@@ -403,7 +406,7 @@ class DioUtil {
options.connectTimeout = 10 * 1000;
options.receiveTimeout = 20 * 1000;
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>();
headers['Accept'] = 'application/json';
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