import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:ysairplane2/tools/YSNetWorking.dart'; import 'package:ysairplane2/tools/YSTools.dart'; import 'YSChoosePlane.dart'; import 'YSCity.dart'; import 'YSPay.dart'; class YSDoctorPlane extends StatefulWidget { @override _YSDoctorPlaneState createState() => _YSDoctorPlaneState(); } class _YSDoctorPlaneState extends State { bool _isDetail = false; bool _isOrder = false; bool _isShow = false; List _chooses = []; Map _msgDict,_startCity,_endCity; String _timeStr,_numStr; List _packList = []; List _priceList = []; int _index = 0; Map _planeType; String _noticeStr = ''; @override void initState() { Future.delayed(Duration(seconds: 0)).then((value){ _getBackImages(); _getNoticeData(); }); super.initState(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Color(0xFFF1F2F4), body: SingleChildScrollView( child: Stack( children: [ Container( height: MediaQuery.of(context).padding.top+hsp(380), width: MediaQuery.of(context).size.width, child: Image( image: _msgDict==null?AssetImage('lib/images/home3.png'):NetworkImage('${_msgDict['background']}'), fit: BoxFit.fill, ), ), if(_msgDict!=null)Container( margin: EdgeInsets.only(left: wsp(50),top: MediaQuery.of(context).padding.top+hsp(200)), child: RichText( text: TextSpan( text: '${_msgDict['name']} ', style: TextStyle(fontSize: zsp(50),color: Colors.white,fontWeight: FontWeight.bold), children: [ TextSpan( text: '${_msgDict['subtitle']}', style: TextStyle(fontWeight: FontWeight.normal,fontSize: zsp(28),color: Colors.white.withOpacity(0.5)) ) ] ), ), ), GestureDetector( onTap: (){Navigator.pop(context);}, child: Container( margin: EdgeInsets.only(left: wsp(32),top: MediaQuery.of(context).padding.top+hsp(30)), child: Icon(Icons.arrow_back_ios,size: hsp(40),color: Colors.white,), ), ), Container( width: MediaQuery.of(context).size.width-wsp(60), margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top+hsp(300),left: wsp(30),bottom: hsp(40)), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), color: Colors.white, ), child: Column( children: [ ListView.separated( shrinkWrap: true, itemBuilder: (context,index){ return Container( child: Column( children: [ Container( padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(50),bottom: hsp(20)), child: Column( children: [ Row( children: [ GestureDetector( onTap: (){ Navigator.of(context,rootNavigator: true).push( CupertinoPageRoute( builder: (context){ return YSCity(); } ) ).then((value){ if(value!=null){ setState(() { _startCity = value; }); // _getFeatureDisplayListData(); } }); }, child: Container( width: (MediaQuery.of(context).size.width-hsp(250))/2, child: SingleChildScrollView( child: Text(_startCity==null?'请选择出发地':'${_startCity['name']}',style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),), scrollDirection: Axis.horizontal, ), ) ), Image(height: hsp(60),width: hsp(60),image: AssetImage('lib/images/plane.png'),), GestureDetector( onTap: (){ Navigator.of(context,rootNavigator: true).push( CupertinoPageRoute( builder: (context){ return YSCity(); } ) ).then((value){ if(value!=null){ setState(() { _endCity = value; }); // _getFeatureDisplayListData(); } }); }, child: Container( width: (MediaQuery.of(context).size.width-hsp(250))/2, child: SingleChildScrollView( child: Text(_endCity==null?'请选择目的地':'${_endCity['name']}', style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),), scrollDirection: Axis.horizontal, ), alignment: Alignment.centerRight, ) ) ], mainAxisAlignment: MainAxisAlignment.spaceBetween, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(_startCity==null?'':'${_startCity['airplaneName']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),), Text(_endCity==null?'':'${_endCity['airplaneName']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),), ], ) ], ), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE9E9E9),indent: wsp(32),endIndent: wsp(32),), GestureDetector( onTap: (){ Navigator.of(context).push( CupertinoPageRoute( builder: (context){ return YSChoosePlane(category: 1,type: 1,); } ) ).then((value){ if(value!=null){ setState(() { _planeType = value; }); } }); }, behavior: HitTestBehavior.opaque, child: Container( padding: EdgeInsets.all(wsp(32)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(_planeType==null?'飞机类型':'${_planeType['model']}', style: TextStyle(fontSize: zsp(36),color: Colors.black),), Icon(Icons.keyboard_arrow_right,size: hsp(50),color: Color(0xFFC1C1C1),) ], ), ), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE9E9E9),indent: wsp(32),endIndent: wsp(32),), GestureDetector( child: Container( padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(20),bottom: hsp(20)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( children: [ Text('出发',style: TextStyle(fontSize: zsp(24),color: Color(0xFF666666)),), RichText( text: TextSpan( text: _timeStr==null?'请选择出发时间':_timeStr, style: TextStyle(fontSize: zsp(36),color: Colors.black), children: [ // TextSpan( // text: '今天', // style: TextStyle(fontSize: zsp(24),fontWeight: FontWeight.normal), // ) ] ), ) ], crossAxisAlignment: CrossAxisAlignment.start, ), Icon(Icons.keyboard_arrow_right,size: hsp(50),color: Color(0xFFC1C1C1),) ], ), ), onTap: (){ dateChooseAlert(context,dateValue: (date){ timeChooseAlert(context,timeValue: (time){ print(date); print(time); setState(() { _timeStr = '$date $time'; }); }); }); }, behavior: HitTestBehavior.opaque, ), ], ), ); }, separatorBuilder: (context,index){ return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE9E9E9),indent: wsp(32),endIndent: wsp(32),); }, itemCount: 1, padding: EdgeInsets.all(0), physics: NeverScrollableScrollPhysics(), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE9E9E9),indent: wsp(32),endIndent: wsp(32),), GestureDetector( onTap: (){ showModalBottomSheet( context: context, builder: (context){ return YSPicker( dataArray: [for(int i=0;i<30;i++){'title':'${i+1}'}], title: 'title', choose: (value){ setState(() { _numStr = value['title']; }); }, ); } ); }, behavior: HitTestBehavior.opaque, child: Container( padding: EdgeInsets.all(wsp(32)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(_numStr==null?'请选择出行人数':'$_numStr人出行',style: TextStyle(fontSize: zsp(36),color: Colors.black),), Icon(Icons.keyboard_arrow_right,size: hsp(50),color: Color(0xFFC1C1C1),) ], ), ), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE9E9E9),indent: wsp(32),endIndent: wsp(32),), GestureDetector( onTap: (){}, child: GestureDetector( onTap: (){ _getPackData(); }, child: Container( width: MediaQuery.of(context).size.width-wsp(64)-hsp(64), margin: EdgeInsets.all(hsp(32)), height: hsp(100), decoration: BoxDecoration( color: Color(0xFFF15204), borderRadius: BorderRadius.all(Radius.circular(3)) ), alignment: Alignment.center, child: Text('一键召唤公务机',style: TextStyle(fontWeight: FontWeight.bold,color: Colors.white,fontSize: zsp(36)),), ), ), ), GestureDetector( onTap: (){ if(_msgDict==null){ ysFlutterToast(context, '呼叫信息获取失败'); return; } showDialog( context: context, builder: (context){ return CupertinoAlertDialog( title: Text('提示\n'), content: Text('是否拨打${_msgDict['emergencyCall']}'), actions: [ CupertinoButton( child: Container( child: Text('取消',style: TextStyle(fontSize: 16,color: Color(0xFF292929),decoration: TextDecoration.none,fontWeight: FontWeight.normal),), height: 40, alignment: Alignment.center, ), padding: EdgeInsets.all(0), onPressed: (){ Navigator.pop(context); }, ), CupertinoButton( child: Container( child: Text('确定',style: TextStyle(fontSize: 16,color: Color(0xFF292929),decoration: TextDecoration.none,fontWeight: FontWeight.normal),), height: 40, alignment: Alignment.center, ), padding: EdgeInsets.all(0), onPressed: (){ Navigator.pop(context); launch('tel:${_msgDict['emergencyCall']}'); }, ) ], ); } ); }, child: Container( width: MediaQuery.of(context).size.width-wsp(64)-hsp(64), margin: EdgeInsets.only(left: hsp(32),right: hsp(32),bottom: hsp(40)), height: hsp(100), decoration: BoxDecoration( color: Colors.white, border: Border.all(color: Color(0xFF00B600),width: 1), borderRadius: BorderRadius.all(Radius.circular(3)) ), alignment: Alignment.center, child: Text('SOS紧急呼叫',style: TextStyle(fontWeight: FontWeight.bold,color: Color(0xFF00B600),fontSize: zsp(36)),), ), ), ], ), ), if(_isOrder==true)GestureDetector( onTap: (){ setState(() { _isOrder = false; }); }, child: Container( height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, color: Colors.black54, child: GestureDetector( onTap: (){}, child: Column( children: [ Container( height: MediaQuery.of(context).size.height*0.8-hsp(120), width: MediaQuery.of(context).size.width, margin: EdgeInsets.only(top: MediaQuery.of(context).size.height*0.2), decoration: BoxDecoration( color: Color(0xFFF1F2F3), borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10)) ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( height: hsp(100), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10)) ), padding: EdgeInsets.only(left: 15,right: 15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container(width: wsp(50),), Text('订单确认',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),), GestureDetector( child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none,fontWeight: FontWeight.bold),), onTap: (){ setState(() { _isOrder = false; }); }, ), ], ), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),), Container( height: MediaQuery.of(context).size.height*0.8-hsp(220)-0.5, child: SingleChildScrollView( padding: EdgeInsets.all(0), child: Column( children: [ Container( padding: EdgeInsets.all(hsp(30)), color: Colors.white, width: MediaQuery.of(context).size.width, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('使用日期',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),), Container( margin: EdgeInsets.only(top: hsp(20)), child: Row( children: [ Container( height: hsp(120), width: MediaQuery.of(context).size.width-hsp(200), child: ListView.separated( itemBuilder: (context,index){ return GestureDetector( behavior: HitTestBehavior.opaque, onTap: (){ _timeStr = _priceList[index]['time']; setState(() { _index = index; }); }, child: Stack( children: [ Container( height: hsp(120), width: (MediaQuery.of(context).size.width-hsp(230))/3, decoration: BoxDecoration( color: index==_index?Color(0xFF007EFF):Color(0xFFF0EEEE), borderRadius: BorderRadius.all(Radius.circular(5)) ), alignment: Alignment.center, child: Text('${_priceList[index]['time']} \n¥${_priceList[index]['price']}', style: TextStyle(fontSize: zsp(20),color: index==_index?Colors.white:Color(0xFF8B8B8B)),textAlign: TextAlign.center,), ), if(_index==index)Container( child: Text(timeTag('${_priceList[index]['time']}'),style: TextStyle(fontSize: zsp(16),color: Color(0xFF007EFF)),), height: hsp(30), padding: EdgeInsets.only(left: wsp(3),right: wsp(3)), decoration: BoxDecoration( color: Color(0xFFF7F7F7), borderRadius: BorderRadius.only(topLeft: Radius.circular(3),bottomRight: Radius.circular(5)) ), alignment: Alignment.center, ), ], ), ); }, separatorBuilder: (context,index){ return Container(width: hsp(15),color: Colors.white,); }, itemCount: _priceList.length, padding: EdgeInsets.all(0), scrollDirection: Axis.horizontal, ), ), if(_priceList.length>1)GestureDetector( onTap: (){ dateChooseAlert(context,dateValue: (dateValue){ Map time = {'time':dateValue,'price':_priceList[0]['price'],'discountprice':_priceList[0]['discountprice']}; int index; for(int i=0;i<_priceList.length;i++){ if(_priceList[i]['time']==time['time']){ index = i; } } if(index!=null){ _priceList.removeAt(index); } setState(() { _priceList.insert(0, time); }); }); }, behavior: HitTestBehavior.opaque, child: Container( height: hsp(120), width: hsp(140), alignment: Alignment.center, child: Text('更多\n日期',style: TextStyle(fontSize: zsp(26),color: Color(0xFF007EFF)),), ), ) ], ), ), ], ), ), Container( padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(20),bottom: hsp(20)), color: Colors.white, child: Column( children: [ Row( children: [ GestureDetector( child: Text('${_startCity['name']}',style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),), ), Image(height: hsp(60),width: hsp(60),image: AssetImage('lib/images/plane.png'),), Text('${_endCity['name']}',style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),), ], mainAxisAlignment: MainAxisAlignment.spaceBetween, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('${_startCity['airplaneName']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),), Text('${_endCity['airplaneName']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),), ], ) ], ), ), Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ RichText( text: TextSpan( text: '出行人数', style: TextStyle(fontSize: zsp(34),color: Color(0xFF9A9A9A)), children: [ TextSpan( text: ' $_numStr ', style: TextStyle(color: Color(0xFF348AE1)) ), TextSpan( text: '人' ) ] ), ), GestureDetector( onTap: (){ showInformAlert(context,title: '预定须知',content: _noticeStr); }, child: RichText( text: TextSpan( text: '预订须知', style: TextStyle(fontSize: zsp(28),color: Color(0xFF348AE1)), children: [ TextSpan( text: ' >', style: TextStyle(color: Color(0xFF000000)) ), ] ), ), ), ], ), padding: EdgeInsets.only(left: wsp(40),right: wsp(40)), margin: EdgeInsets.only(top: hsp(10),bottom: hsp(10)), height: hsp(100), width: MediaQuery.of(context).size.width, alignment: Alignment.centerLeft, color: Colors.white, ), // GestureDetector( // onTap: (){ // setState(() { // _isShow = !_isShow; // }); // }, // behavior: HitTestBehavior.opaque, // child: Container( // padding: EdgeInsets.only(left: wsp(40),right: wsp(40),top: hsp(20),bottom: hsp(20)), // color: Colors.white, // child: Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ // Text('更多服务',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),), // Icon(Icons.keyboard_arrow_down,size: hsp(50),color: Color(0xFFC1C1C1),) // ], // ) // ), // ), // if(_isShow==true)Container( // padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(20),bottom: hsp(10)), // decoration: BoxDecoration( // color: Color(0xFFFAFAFA), // borderRadius: BorderRadius.only(bottomRight: Radius.circular(10),bottomLeft: Radius.circular(10)) // ), // child: ListView.builder( // shrinkWrap: true, // itemBuilder: (context,index){ // return Container( // padding: EdgeInsets.only(bottom: wsp(20)), // child: Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ // Row( // children: [ // Text('${_packList[index]['name']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF999999)),), // Container( // width: wsp(50), // child: GestureDetector( // child: Icon(Icons.error_outline,size: hsp(40),color: Color(0xFF999999)), // ), // ), // Text('${_packList[index]['price']}元',style: TextStyle(fontSize: zsp(28),color: Colors.black),), // ], // ), // GestureDetector( // child: Container( // height: hsp(60), // width: hsp(100), // child: Image.asset(_chooses.contains(_packList[index])==true?'lib/images/kaiguankai.png':'lib/images/kaiguanguan.png'), // ), // onTap: (){ // setState(() { // if(_chooses.contains(_packList[index])==true){ // _chooses.remove(_packList[index]); // }else{ // _chooses.add(_packList[index]); // } // }); // }, // ) // ], // ), // ); // }, // itemCount: _packList.length, // padding: EdgeInsets.all(0), // physics: NeverScrollableScrollPhysics(), // ), // ) ], ), ), ), ], ), ), Container( height: hsp(120), width: MediaQuery.of(context).size.width, color: Colors.white, padding: EdgeInsets.only(left: wsp(30),right: wsp(30)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ RichText( text: TextSpan( text: '参考价(¥)', style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)), children: [ TextSpan( text: ' ${_getPrice()}', style: TextStyle(fontSize: zsp(40),color: Color(0xFFFF6600)), ) ] ), ), GestureDetector( child: Row( children: [ Text('明细',style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),), Icon(Icons.keyboard_arrow_up,size: hsp(30),color: Color(0xFF007EFF),), ], ), onTap: (){ setState(() { _isDetail = !_isDetail; }); }, ), GestureDetector( onTap: (){ _postPlaneOrderData(); }, child: Container( height: hsp(70), padding: EdgeInsets.only(left: wsp(50),right: wsp(50)), decoration: BoxDecoration( color: Color(0xFF007EFF), borderRadius: BorderRadius.all(Radius.circular(50)) ), alignment: Alignment.center, child: Text('立即预约',style: TextStyle(fontSize: zsp(30),color: Colors.white,fontWeight: FontWeight.bold),), ), ) ], ), ) ], ), ), ), ), if(_isDetail==true)GestureDetector( onTap: (){ setState(() { _isDetail = false; }); }, child: Container( height: MediaQuery.of(context).size.height-hsp(120), color: Colors.black45, child: Container( margin: EdgeInsets.only(top: MediaQuery.of(context).size.height-hsp(120)-hsp(370)), height: hsp(370), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10)) ), child: GestureDetector( onTap: (){}, behavior: HitTestBehavior.opaque, child: Column( children: [ Container( height: hsp(100), padding: EdgeInsets.only(left: 15,right: 15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ GestureDetector( child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),), onTap: (){ setState(() { _isDetail = false; }); }, ), Text('明细',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),), Container(width: wsp(50),), ], ), ), Container( height: hsp(100), color: Color(0xFFF7F8F9), padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(20),top: hsp(20)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('座位',style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),decoration: TextDecoration.none),), Text('¥ ${_priceList[_index]['price']}x $_numStr人',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),), ], ), ), Container( color: Color(0xFFF7F8F9), height: hsp(170), child: ListView.builder( padding: EdgeInsets.all(0), itemBuilder: (context,index){ return Container( padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(10)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('${_chooses[index]['name']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),), Text('¥ ${_chooses[index]['price']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),), ], ), ); }, itemCount: _chooses.length, ), ) ], ), ), ), ), ) ], ), ), ); } _getBackImages() async{ Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/wallconfigure/get',parameter: {'type':1},isLoading: true,isToken: false); if(dict!=null){ setState(() { _msgDict = dict['data']; }); } } _getPackData() async{ if(_startCity==null){ ysFlutterToast(context,'请选择出发地'); return; } if(_endCity==null){ ysFlutterToast(context,'请选择目的地'); return; } if(_planeType==null){ ysFlutterToast(context,'请选择飞机类型'); return; } if(_timeStr==null){ ysFlutterToast(context,'请选择出发时间'); return; } if(_numStr==null){ ysFlutterToast(context,'请选择出行人数'); return; } if(_startCity['airplaneName']==_endCity['airplaneName']){ ysFlutterToast(context,'出发机场与目的机场不能相同'); return; } _getPriceData(); } _getPriceData() async{ Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneorder/getDateAndTime', parameter: {'time':_timeStr,'type':1,'airportIdSetout':_startCity['id'],'airportIdArrive':_endCity['id'],'modelId':_planeType['modelId']},isLoading: true,isToken: true); if(dict!=null){ _isOrder = true; _packList = []; setState(() { _priceList = dict['data']; print(_priceList[0]['time']); }); } } _getNoticeData() async{ Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneservice/ctrip',parameter: {'type':1}); if(dict!=null){ _noticeStr = dict['data']['value']; } } _getPrice(){//*int.parse('$_numStr') double price = double.parse('${_priceList[_index]['price']}'); _chooses.forEach((element) { price+=double.parse('${element['price']}'); }); return price.toStringAsFixed(2); } _postPlaneOrderData() async{ if(_startCity==null){ ysFlutterToast(context,'请选择出发地'); return; } if(_endCity==null){ ysFlutterToast(context,'请选择目的地'); return; } if(_planeType==null){ ysFlutterToast(context,'请选择飞机类型'); return; } if(_timeStr==null){ ysFlutterToast(context,'请选择出发时间'); return; } if(_numStr==null){ ysFlutterToast(context,'请选择出行人数'); return; } if(_startCity['airplaneName']==_endCity['airplaneName']){ ysFlutterToast(context,'出发机场与目的机场不能相同'); return; } isLogin(context,login: (){}); Map requestDict = {}; requestDict['flightTime'] = _timeStr; requestDict['modelId'] = _planeType['modelId']; requestDict['type'] = 1; requestDict['travelersNumber'] = _numStr; requestDict['citySetout'] = _startCity['name']; requestDict['airportidSetout'] = _startCity['id']; requestDict['cityArrive'] = _endCity['name']; requestDict['airportidArrive'] = _endCity['id']; requestDict['price'] = '${_getPrice()}'; List array = []; _chooses.forEach((element) { array.add(element['id']); }); if(array.length>0)requestDict['serviceIds'] = array.join(','); showNegotiateAlertDio( context, content: _noticeStr, sure: () async{ Map dict = await ysRequestHttp(context,type: requestType.post,api: '/app/applets/airplaneorder/createOrder',parameter: requestDict,isLoading: true,isToken: true); if(dict!=null){ Navigator.of(context).push( CupertinoPageRoute( builder: (context){ return YSPay(orderDict: dict['data'],type: payType.doctor,); } ) ); } } ); } }