Commit f3eadb2c authored by Q14's avatar Q14

aaa

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