import 'dart:convert'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:ysairplane2/code/YSIssue.dart'; import 'package:ysairplane2/tools/YSNetWorking.dart'; import 'package:ysairplane2/tools/YSTools.dart'; import 'YSChooseLocation.dart'; import 'YSPay.dart'; import 'YSSearchResult.dart'; class YSShortGoods extends StatefulWidget { @override _YSShortGoodsState createState() => _YSShortGoodsState(); } class _YSShortGoodsState extends State { int _type = 1; bool _isDetail = false; bool _isOrder = false; int _index,_selected = 0; Map _msgDict,_kind,_startDict,_endDict; List chooses = ['货源','机源']; String choose = '货源'; int _page = 1; List _dataArray = []; List _priceList = []; List _kinds = []; List _allPrices = []; TextEditingController _name = TextEditingController(); TextEditingController _volume = TextEditingController(); TextEditingController _weight = TextEditingController(); TextEditingController _userName = TextEditingController(); TextEditingController _phone = TextEditingController(); List _showArray = [{'title':'货物信息','content':''},{'title':'出发时间','content':'请选择时间'},{'title':'货物名称','content':'请输入货物名称'}, {'title':'性质','content':'请选择性质'},{'title':'体积','content':'请输入'},{'title':'重量','content':'请输入'},{'title':'联系人','content':'请输入联系人'},{'title':'联系电话','content':'请输入联系电话'}, {'title':'发货地点','content':'请选择发货地点'},{'title':'送货地点','content':'请选择送货地点'}]; String _timeStr; String _noticeStr = ''; @override void initState() { Future.delayed(Duration(seconds: 0)).then((value){ _getNoticeData(); _getBackImageData(); _refreshData(); }); super.initState(); } @override void dispose() { _name.dispose(); _volume.dispose(); _weight.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Color(0xFFF1F2F4), body: SingleChildScrollView( child: Stack( children: [ Container( height: MediaQuery.of(context).padding.top+hsp(370), 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(250)), 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: hsp(30),right: wsp(30),top: MediaQuery.of(context).padding.top+hsp(65)), child: Icon(Icons.arrow_back_ios,color: Colors.white,size: hsp(50),), ), ), GestureDetector( onTap: (){ Navigator.of(context).push( CupertinoPageRoute(builder: (context){ return YSSearchResult(type: choose=='货源'?3:33,); }) ); }, child: Container( margin: EdgeInsets.only(left: hsp(110),top: MediaQuery.of(context).padding.top+hsp(60)), width: MediaQuery.of(context).size.width-hsp(340), height: hsp(60), decoration: BoxDecoration( color: Colors.black.withOpacity(0.35), borderRadius: BorderRadius.all(Radius.circular(50)) ), padding: EdgeInsets.only(left: wsp(30),right: wsp(30)), child: Row( children: [ DropdownButton( value: choose, items: [ for(int i=0;i1)GestureDetector( onTap: (){ dateChooseAlert( context, dateValue: (dateValue){ int index = 0; _priceList.clear(); _priceList.addAll(_allPrices); for(int i=0;i<_priceList.length;i++){ DateTime date1 = DateTime.parse('${_priceList[i]['time']}'); DateTime date2 = DateTime.parse('$dateValue 00:00:00'); if(date1.year==date2.year&&date1.month==date2.month&&date1.day==date2.day){ index = i; } } _priceList.removeRange(0, index); _selected = 0; _timeStr = _priceList[_selected]['time']; setState(() {}); }, count: 45, startStr: _allPrices[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)),), ), ) ], ), ), ], ), ), if(_dataArray[_index]['type']==2)Container( padding: EdgeInsets.all(hsp(30)), margin: EdgeInsets.only(top: hsp(10)), width: MediaQuery.of(context).size.width, color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('本次拼机截止时间:${_dataArray[_index]['groupDeadline']}',style: TextStyle(fontSize: zsp(26),color: Color(0xFF999999)),), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('0吨',style: TextStyle(fontSize: zsp(22),color: Color(0xFF656565)),), Container( height: hsp(100), width: MediaQuery.of(context).size.width-hsp(200), child: Slider( value: double.parse('${_dataArray[_index]['nowWeight']}'), onChanged: (value){ }, activeColor: Color(0xFF0079FF), min: 0, max: 10, divisions: 4, ), ), Text('${_dataArray[_index]['totalWeight']}吨',style: TextStyle(fontSize: zsp(22),color: Color(0xFF656565)),), ], ), Container( width: MediaQuery.of(context).size.width, child: Text('目标${_dataArray[_index]['nowWeight']}吨',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),), alignment: Alignment.center, ), ], ), ), Container( padding: EdgeInsets.all(hsp(30)), margin: EdgeInsets.only(top: hsp(10)), color: Colors.white, child: Column( children: [ Container( padding: EdgeInsets.only(bottom: hsp(30)), child: Column( children: [ Row( children: [ Text('${_dataArray[_index]['setoutInfo']['display']}',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('${_dataArray[_index]['arriveInfo']['display']}',style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),), ], mainAxisAlignment: MainAxisAlignment.spaceBetween, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('${_dataArray[_index]['setoutInfo']['airplaneName']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),), Text('${_dataArray[_index]['hour']}',style: TextStyle(fontSize: zsp(20),color: Color(0xFF343434)),), Text('${_dataArray[_index]['arriveInfo']['airplaneName']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),), ], ) ], ), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),), Container( height: hsp(70), child: Row( children: [ Text('${_dataArray[_index]['flightTime']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF333333)),), Text('机型: ${_dataArray[_index]['dtFlightInformation']['model']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF333333)),), ], mainAxisAlignment: MainAxisAlignment.spaceBetween, ), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),), Container( height: hsp(90), alignment: Alignment.centerLeft, child: Row( children: [ RichText( text: TextSpan( style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)), children: [ TextSpan( text: '类型: ' ), TextSpan( text: '${_dataArray[_index]['type']==1?'整机':'拼机'}', style: TextStyle(color: Color(0xFF333333)) ), TextSpan( text: ' 体积: ' ), TextSpan( text: '${_dataArray[_index]['totalVolume']}立方米', style: TextStyle(color: Color(0xFF333333)) ), TextSpan( text: ' 重量: ' ), TextSpan( text: '${_dataArray[_index]['totalWeight']}吨', style: TextStyle(color: Color(0xFF333333)) ) ] ), ), Text('¥${_dataArray[_index]['discountPrice']}',style: TextStyle(fontSize: zsp(40),color: Color(0xFFEA413A),fontWeight: FontWeight.bold),), ], mainAxisAlignment: MainAxisAlignment.spaceBetween, ), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),), if(_dataArray[_index]['explain']!=null)Container( height: hsp(90), alignment: Alignment.centerLeft, child: RichText( text: TextSpan( style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)), children: [ TextSpan( text: '说明: ' ), TextSpan( text: '${_dataArray[_index]['explain']}',style: TextStyle(color: Color(0xFF333333)) ), ] ), ), ) ], ), ), ListView.separated( itemBuilder: (context,index){ return GestureDetector( onTap: (){ FocusScope.of(context).unfocus(); if(index==1){ }else if(index==3){ showModalBottomSheet(context: context,builder: (context){ return YSPicker( dataArray: _kinds, title: 'name', choose: (value){ setState(() { _kind = value; }); }, ); }); }else if(index==8||index==9){ Navigator.of(context).push( CupertinoPageRoute( builder: (context){ return YSChooseLocation(location: index==8?_startDict:_endDict,); } ) ).then((value){ if(value==null)return; if(index==8){ setState(() { _startDict = value; }); }else{ setState(() { _endDict = value; }); } }); } }, child: Container( color: Colors.white, padding: EdgeInsets.only(left: wsp(20),right: wsp(20)), height: hsp(100), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('${_showArray[index]['title']}',style: TextStyle(fontSize: zsp(30),color: index==0?Colors.black:Color(0xFF999999), fontWeight: index==0?FontWeight.bold:FontWeight.normal),), index==2||index==4||index==5||index==6||index==7?Container( width: MediaQuery.of(context).size.width*0.7, height: hsp(100), alignment: Alignment.centerRight, child: CupertinoTextField( placeholder: _showArray[index]['content'], placeholderStyle: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)), style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)), decoration: BoxDecoration(), textAlign: TextAlign.right, suffix: Text(index==4?'立方米':index==5?'吨':'',style: TextStyle(fontSize: zsp(30),color: Colors.black)), controller: index==2?_name:index==4?_volume:index==5?_weight:index==6?_userName:_phone, keyboardType: index==2?TextInputType.text:index==4?TextInputType.number:index==5? TextInputType.number:index==6?TextInputType.text:TextInputType.phone, onEditingComplete: (){ FocusScope.of(context).unfocus(); if(index==4){ if(double.parse('${_volume.text}')>double.parse('${_dataArray[_index]['totalVolume']}')){ ysFlutterToast(context, '货物体积不能超过限定体积'); _volume.text = ''; } }else if(index==5){ if(double.parse('${_weight.text}')>double.parse('${_dataArray[_index]['totalWeight']}')){ ysFlutterToast(context, '货物重量不能超过限定重量'); _weight.text = ''; } } }, ), ):index==3||index==8||index==9?Row( children: [ Text(index==3?(_kind==null?'${_showArray[index]['content']}':'${_kind['name']}'): index==8?(_startDict==null?'${_showArray[index]['content']}':'${_startDict['title']}') :(_endDict==null?'${_showArray[index]['content']}':'${_endDict['title']}'),style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),), Icon(index==3?Icons.keyboard_arrow_down:Icons.location_on,color: Color(0xFF999999),size: hsp(40),) ], ):Text(index==1?(_timeStr==null?'${_showArray[index]['content']}':_timeStr):'${_showArray[index]['content']}',style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),) ], ), ), ); }, separatorBuilder: (context,index){ return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFF1F2F3),); }, itemCount: _showArray.length, padding: EdgeInsets.all(0), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), ), // ListView.separated( // itemBuilder: (context,index){ // return Container( // height: hsp(90), // color: Colors.white, // width: MediaQuery.of(context).size.width, // padding: EdgeInsets.only(left: hsp(30),right: hsp(30)), // alignment: Alignment.centerLeft, // child: index==0?Text( // '货物信息',style: TextStyle(fontSize: zsp(30),color: Color(0xFF333333),fontWeight: FontWeight.bold), // ):Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ // Text(index==1?'名称':index==2?'类型':index==3?'体积':'重量',style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),), // Container( // height: hsp(90), // width: MediaQuery.of(context).size.width*0.7, // alignment: Alignment.centerRight, // child: index==2?GestureDetector( // onTap: (){ // FocusScope.of(context).unfocus(); // showModalBottomSheet( // context: context, // builder: (context){ // return YSPicker( // dataArray: _kinds, // title: 'name', // choose: (value){ // setState(() { // _kind = value; // }); // }, // ); // } // ); // }, // child: Row( // mainAxisSize: MainAxisSize.min, // children: [ // Text(_kind==null?'请选择类型':'${_kind['name']}',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),), // Icon(Icons.keyboard_arrow_down,size: hsp(40),color: Color(0xFF9A9A9A)) // ], // ), // ):CupertinoTextField( // placeholder: index==1?'请输入名称':index==3?'请输入体积':'请输入重量', // placeholderStyle: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)), // style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)), // decoration: BoxDecoration(), // textAlign: TextAlign.right, // suffix: Text(index==1?'':index==3?'立方米':'吨',style: TextStyle(fontSize: zsp(30),color: Colors.black)), // controller: index==1?_name:index==3?_volume:_weight, // keyboardType: index==1?TextInputType.text:TextInputType.numberWithOptions(), // ), // ), // ], // ), // ); // }, // separatorBuilder: (context,index){ // return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),); // }, // itemCount: 5, // padding: EdgeInsets.only(top: hsp(10)), // shrinkWrap: true, // physics: NeverScrollableScrollPhysics(), // ), if(_dataArray[_index]['type']==2&&_dataArray[_index]['dtAirplaneGoods']!=null)Container( padding: EdgeInsets.all(hsp(30)), margin: EdgeInsets.only(top: hsp(10),bottom: hsp(30)), color: Colors.white, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( width: (MediaQuery.of(context).size.width-hsp(60))*0.6, child: SingleChildScrollView( child: Stack( children: [ for(int i = 0;i<(_dataArray[_index]['dtAirplaneGoods']).length;i++)Container( height: hsp(70), width: hsp(70), margin: EdgeInsets.only(left: hsp(60)*i), decoration: BoxDecoration( color: Color(0xFFED5D57), borderRadius: BorderRadius.all(Radius.circular(50)), border: Border.all(color: Colors.white,width: 1), image: DecorationImage( image: NetworkImage('${_dataArray[_index]['dtAirplaneGoods'][i]['dtUsers']['avatar']}'), fit: BoxFit.fill, ) ), ) ], ), scrollDirection: Axis.horizontal, ), ), RichText( text: TextSpan( text: '已有', style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)), children: [ TextSpan( text: '${(_dataArray[_index]['dtAirplaneGoods']).length}', style: TextStyle(color: Color(0xFF007DFF)) ), TextSpan( text: '个人在拼该机' ) ] ), ) ], ), ) ], ), ), ), ], ), ), 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: ' ${_dataArray[_index]['discountPrice']}', style: TextStyle(fontSize: zsp(40),color: Color(0xFFFF6600)), ), TextSpan( text: ' 元', ) ] ), ), // 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: (){ FocusScope.of(context).unfocus(); _postOrderData(); }, 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('VIP尊享座位',style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),decoration: TextDecoration.none),), // Text('¥ 780x 10人',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('票价',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),), // Text('¥ 770x 10人',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),), // ], // ), // ); // }, // itemCount: 3, // ), // ) // ], // ), // ), // ), // ), // ) ], ), ), ); } _getBackImageData() async{ Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/wallconfigure/get',parameter: {'type':3},isLoading: false,isToken: false); if(dict!=null){ setState(() { _msgDict = dict['data']; }); } } Future _refreshData() async{ _page = 1; Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/AirTour/list',parameter: {'category':_type==1?3:33,'pageNo':_page,'pageSize':10},isLoading: false,isToken: false); if(dict!=null){ setState(() { _dataArray = dict['data']['resultList']; }); } } Future _loadMoreData() async{ _page++; Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/AirTour/list',parameter: {'category':_type==1?3:33,'pageNo':_page,'pageSize':10},isLoading: false,isToken: false); if(dict!=null){ setState(() { _dataArray.addAll(dict['data']['resultList']); }); } } _getPriceData() async{ Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneorder/getDateAndTime', parameter: {'type':3,'id':_dataArray[_index]['id'],'tourId':_dataArray[_index]['id']},isLoading: true,isToken: true); if(dict!=null){ _isOrder = true; Map item = _dataArray[_index]; _startDict = {'lat': item['setoutInfo']['latitude'],'lng': item['setoutInfo']['longitude'],'title': item['setoutInfo']['airplaneName'],'content': item['setoutInfo']['introduce'],'airplaneName':item['setoutInfo']['airplaneName']}; _endDict = {'lat': item['arriveInfo']['latitude'],'lng': item['arriveInfo']['longitude'],'title': item['arriveInfo']['airplaneName'],'content': item['arriveInfo']['introduce'],'airplaneName':item['arriveInfo']['airplaneName']}; _priceList = dict['data']; _allPrices.clear(); _allPrices.addAll(_priceList); if(_priceList.length>0){ _timeStr = _priceList[0]['time']; } _selected = 0; _getTypeData(); } } _getTypeData() async{ Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplanegoods/type/get',parameter: {},isLoading: true,isToken: false); if(dict!=null){ setState(() { _kinds = dict['data']; _kind = _kinds[0]; }); } } _getNoticeData() async{ Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneservice/ctrip',parameter: {'type':3}); if(dict!=null){ _noticeStr = dict['data']['value']; } } _postOrderData() async{ if(_timeStr==null){ ysFlutterToast(context, '请选择出发时间'); return; } if(_name.text.isEmpty){ ysFlutterToast(context, '货物名称不能为空'); return; } if(_volume.text.isEmpty){ ysFlutterToast(context, '货物体积不能为空'); return; } if(_weight.text.isEmpty){ ysFlutterToast(context, '货物重量不能为空'); return; } if(double.parse('${_weight.text}')>double.parse('${_dataArray[_index]['totalWeight']}')){ ysFlutterToast(context, '货物重量不能超过限定重量'); return; } if(double.parse('${_volume.text}')>double.parse('${_dataArray[_index]['totalVolume']}')){ ysFlutterToast(context, '货物体积不能超过限定体积'); return; } if(_userName.text.isEmpty){ ysFlutterToast(context, '联系人不能为空'); return; } if(_phone.text.isEmpty){ ysFlutterToast(context, '联系电话不能为空'); return; } if(_startDict==null){ ysFlutterToast(context, '请选择发货地点'); return; } if(_endDict==null){ ysFlutterToast(context, '请选择送货地点'); return; } if(_startDict['title']==_endDict['title']){ ysFlutterToast(context, '发货与送货地址不能相同'); return; } Map request = {}; request['flightTime'] = _timeStr; request['type'] = 3; request['airplaneid'] = _dataArray[_index]['airplaneid']; request['tourId'] = _dataArray[_index]['id']; request['airportidSetout'] = _dataArray[_index]['airportIdSetout']; request['airportidArrive'] = _dataArray[_index]['airportIdArrive']; Map value = {}; value['goodsName'] = _name.text; value['goodsNatureId'] = _kind['id']; value['goodsVolume'] = _volume.text; value['goodsWeight'] = _weight.text; value['contactPerson'] = _userName.text; value['phone'] = _phone.text; value['goodsPlace'] = '${_startDict['title']}'; value['goodsLocation'] = '${_startDict['lat']},${_startDict['lng']}'; value['goodsUnloadingPlace'] = '${_endDict['title']}'; value['goodsUnloadingLocation'] = '${_endDict['lat']},${_endDict['lng']}'; request['dtAirplaneGoods'] = value; request['sourceType'] = _dataArray[_index]['type']; showNegotiateAlertDio( context, content: _noticeStr, sure: () async{ Map dict = await ysRequestHttp(context,type: requestType.post,api: '/app/applets/airplaneorder/createOrder',parameter: request,isLoading: true,isToken: true); if(dict!=null){ Navigator.of(context).push( CupertinoPageRoute( builder: (context){ return YSPay(orderDict: dict['data'],type: payType.goods,); } ) ); } } ); } }