Commit f3eadb2c authored by Q14's avatar Q14

aaa

parent 079d3247
...@@ -6,18 +6,19 @@ ...@@ -6,18 +6,19 @@
// Copyright © 2019 Gengmei. All rights reserved. // Copyright © 2019 Gengmei. All rights reserved.
// 意见与建议页面 // 意见与建议页面
import 'package:dio/dio.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'macros/ALColors.dart'; import 'package:gmalpha_flutter/netWork/DioUtil.dart' as prefix0;
import 'macros/ALColors.dart'
import 'macros/ALDevice.dart'; import 'macros/ALDevice.dart';
import 'netWork/ALNetWork.dart'; import 'netWork/DioUtil.dart';
// import 'services/ALNetClient.dart';
// import 'hybrid_stack/hybrid_stack_manager_plugin.dart';
class CommentSuggest extends StatelessWidget { class CommentSuggest extends StatelessWidget {
// RouterOption routeOption; final Map params;
// Opinion(RouterOption option, {Key key}) : super(key: key) { CommentSuggest(this.params);
// routeOption = option;
// }
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
...@@ -26,18 +27,17 @@ class CommentSuggest extends StatelessWidget { ...@@ -26,18 +27,17 @@ class CommentSuggest extends StatelessWidget {
theme: ThemeData( theme: ThemeData(
splashColor: Colors.white10, //水波纹的颜色 splashColor: Colors.white10, //水波纹的颜色
), ),
home: CommentSuggestPage(title: '意见和建议',userId: '123'), home: CommentSuggestPage(title: '意见和建议',nativeCookie: this.params),
); );
} }
} }
class CommentSuggestPage extends StatefulWidget { class CommentSuggestPage extends StatefulWidget {
CommentSuggestPage({Key key, this.title,this.userId,this.content,this.tel}) : super(key: key);
final String title; final String title;
final String userId;
final String content; final String content;
final String tel; final String tel;
final Map nativeCookie;
@override @override
_CommentSuggestPageState createState() => _CommentSuggestPageState(); _CommentSuggestPageState createState() => _CommentSuggestPageState();
} }
...@@ -56,10 +56,9 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> { ...@@ -56,10 +56,9 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
leading: new GestureDetector( leading: new GestureDetector(
child: new Icon(Icons.keyboard_backspace), child: new Icon(Icons.keyboard_backspace),
onTap: () { onTap: () {
// HybridStackManagerPlugin.hybridStackManagerPlugin.popCurPage(); FlutterBoost.singleton.closePageForContext(context);
}), }),
title: new Text( title: this.title,
"意见与建议",
style: TextStyle( style: TextStyle(
color: ALColors.Color323232, color: ALColors.Color323232,
fontSize: 16, fontSize: 16,
...@@ -148,26 +147,43 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> { ...@@ -148,26 +147,43 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
void confirmClick() { void confirmClick() {
confimSuggestInfo(); confimSuggestInfo();
print('confirmClick');
} }
void confimSuggestInfo() { void confimSuggestInfo() {
ALNetwork( BaseOptions options = DioUtil.getDefOptions();
success: (NetworkSuccess success){ HttpConfig config = new HttpConfig(options: options, nativeCookie: this.);
setState(() { DioUtil().setConfig(config);
}); DioUtil().requestR(Method.post, "/api/v1/suggestion",data: {"content": "add", "phone": "aaa"}).then((res){
}, showAlertDialog(context, res.data);
error: (NetworkError error){ }
setState(() { ).then((error){
print(error);
}); });
},
api: '/api/v1/suggestion',
params: {'content': 'aaa', 'phone': 'bbb'}
);
} }
void showAlertDialog(BuildContext context, Text testStr) {
showDialog(
context: context,
builder: (_) => new AlertDialog(
title: testStr,
content: new Text("This is my content"),
actions:<Widget>[
new FlatButton(child:new Text("CANCEL"), onPressed: (){
// Navigator.of(context).pop();
},),
new FlatButton(child:new Text("OK"), onPressed: (){
// Navigator.of(context).pop();
},)
]
));
}
} }
...@@ -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(), 'comment_suggest': (pageName, params, _) => CommentSuggest(params),
///可以在native层通过 getContainerParams 来传递参数 ///可以在native层通过 getContainerParams 来传递参数
'flutterPage': (pageName, params, _) { 'flutterPage': (pageName, params, _) {
......
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