Commit ddd1178a authored by 马士红's avatar 马士红

Merge branch 'master' of git.wanmeizhensuo.com:mobile/gmalpha_flutter

parents 3476da0e 215838f4
...@@ -62,6 +62,8 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> { ...@@ -62,6 +62,8 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
color: ALColors.Color323232, color: ALColors.Color323232,
), ),
onTap: () { onTap: () {
print('123-------');
// FlutterBoost.singleton.closePageForContext(context);
FlutterBoost.singleton.closePageForContext(context); FlutterBoost.singleton.closePageForContext(context);
}), }),
), ),
...@@ -157,13 +159,20 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> { ...@@ -157,13 +159,20 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
String phone = (this.telCtrl.text.length > 0)? this.telCtrl.text : ''; String phone = (this.telCtrl.text.length > 0)? this.telCtrl.text : '';
DioUtil().requestR(Method.post, "api/v1/suggestion",data: {"content": content, "phone": phone}).then((res){ DioUtil().requestR(Method.post, "api/v1/suggestion",data: {"content": content, "phone": phone}).then((res){
if (res.code == 0) { if (res.code == 0) {
Toast.show(context, '请求成功'); Toast.show(context, '提交成功');
FlutterBoost.singleton.closePageForContext(context);
} else { } else {
Toast.show(context, res.msg); Toast.show(context, res.msg);
} }
} }
).then((error){ ).then((error){
print(error); if (error != null) {
Toast.show(context, '提交失败');
print(error);
} else {
// FlutterBoost.singleton.closePageForContext(context);
}
}); });
} }
......
...@@ -42,7 +42,7 @@ class _MyAppState extends State<MyApp> { ...@@ -42,7 +42,7 @@ class _MyAppState extends State<MyApp> {
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
initialRoute: '/test',//调试的时候可以打开 initialRoute: '/test',//调试的时候可以打开
routes: { routes: {
'/': (context) => CommentSuggest({'cookie': '124'}), '/': (context) => CommentSuggest({"Cookie":" _gm_token=7e48641558699683; sessionid=nb3ze4ur7ucosln8sd8pzwojddenv9ym; _gtid=a1bc0a387e1911e996b9525400fa516d4094"}),
},//调试的时候可以打开 },//调试的时候可以打开
builder: FlutterBoost.init(postPush: _onRoutePushed), builder: FlutterBoost.init(postPush: _onRoutePushed),
theme: new ThemeData( theme: new ThemeData(
......
...@@ -438,7 +438,7 @@ class DioUtil { ...@@ -438,7 +438,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 = 'http://earth.gmapp.com/'; options.baseUrl = 'https://earth.iyanzhi.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