YSShortGoods.dart 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  1. import 'dart:convert';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:flutter_easyrefresh/easy_refresh.dart';
  5. import 'package:ysairplane/code/YSIssue.dart';
  6. import 'package:ysairplane/tools/YSNetWorking.dart';
  7. import 'package:ysairplane/tools/YSTools.dart';
  8. import 'YSPay.dart';
  9. class YSShortGoods extends StatefulWidget {
  10. @override
  11. _YSShortGoodsState createState() => _YSShortGoodsState();
  12. }
  13. class _YSShortGoodsState extends State<YSShortGoods> {
  14. int _type = 1;
  15. bool _isDetail = false;
  16. bool _isOrder = false;
  17. int _index,_selected = 0;
  18. Map _msgDict,_kind;
  19. List chooses = ['货源','机源'];
  20. String choose = '货源';
  21. int _page = 1;
  22. List _dataArray = [];
  23. List _priceList = [];
  24. List _kinds = [];
  25. TextEditingController _name = TextEditingController();
  26. TextEditingController _volume = TextEditingController();
  27. TextEditingController _weight = TextEditingController();
  28. @override
  29. void initState() {
  30. Future.delayed(Duration(seconds: 0)).then((value){
  31. _getBackImageData();
  32. _refreshData();
  33. });
  34. super.initState();
  35. }
  36. @override
  37. Widget build(BuildContext context) {
  38. return Scaffold(
  39. backgroundColor: Color(0xFFF1F2F4),
  40. body: SingleChildScrollView(
  41. child: Stack(
  42. children: [
  43. Container(
  44. height: MediaQuery.of(context).padding.top+hsp(370),
  45. width: MediaQuery.of(context).size.width,
  46. child: Image(
  47. image: _msgDict==null?AssetImage('lib/images/home3.png'):NetworkImage('${_msgDict['background']}'),
  48. fit: BoxFit.fill,
  49. ),
  50. ),
  51. if(_msgDict!=null)Container(
  52. margin: EdgeInsets.only(left: wsp(50),top: MediaQuery.of(context).padding.top+hsp(250)),
  53. child: RichText(
  54. text: TextSpan(
  55. text: '${_msgDict['name']} ',
  56. style: TextStyle(fontSize: zsp(50),color: Colors.white,fontWeight: FontWeight.bold),
  57. children: [
  58. TextSpan(
  59. text: '${_msgDict['subtitle']}',
  60. style: TextStyle(fontWeight: FontWeight.normal,fontSize: zsp(28),color: Colors.white.withOpacity(0.5))
  61. )
  62. ]
  63. ),
  64. ),
  65. ),
  66. GestureDetector(
  67. onTap: (){
  68. Navigator.pop(context);
  69. },
  70. child: Container(
  71. margin: EdgeInsets.only(left: hsp(30),right: wsp(30),top: MediaQuery.of(context).padding.top+hsp(65)),
  72. child: Icon(Icons.arrow_back_ios,color: Colors.white,size: hsp(50),),
  73. ),
  74. ),
  75. Container(
  76. margin: EdgeInsets.only(left: hsp(110),top: MediaQuery.of(context).padding.top+hsp(60)),
  77. width: MediaQuery.of(context).size.width-hsp(340),
  78. height: hsp(60),
  79. decoration: BoxDecoration(
  80. color: Colors.black.withOpacity(0.35),
  81. borderRadius: BorderRadius.all(Radius.circular(50))
  82. ),
  83. padding: EdgeInsets.only(left: wsp(30),right: wsp(30)),
  84. child: Row(
  85. children: [
  86. DropdownButton(
  87. value: choose,
  88. items: [
  89. for(int i=0;i<chooses.length;i++)DropdownMenuItem(child: Text('${chooses[i]}'),value: '${chooses[i]}',),
  90. ],
  91. onChanged: (value){
  92. setState(() {
  93. choose = value;
  94. });
  95. },
  96. underline: Container(),
  97. icon: Icon(Icons.keyboard_arrow_down,color: Colors.white.withOpacity(0.5),size: hsp(40),),
  98. style: TextStyle(fontSize: zsp(26),color: Colors.white),
  99. dropdownColor: Colors.black45,
  100. ),
  101. Container(
  102. height: hsp(30),
  103. width: 0.5,
  104. margin: EdgeInsets.only(left: wsp(10),right: wsp(10)),
  105. color: Colors.white.withOpacity(0.2),
  106. ),
  107. Row(
  108. children: [
  109. Icon(Icons.search,color: Colors.white.withOpacity(0.5),size: hsp(50),),
  110. Text(' 搜商机',style: TextStyle(fontSize: zsp(26),color: Colors.white.withOpacity(0.5)),),
  111. ],
  112. )
  113. ],
  114. ),
  115. ),
  116. GestureDetector(
  117. onTap: (){
  118. Navigator.of(context).push(
  119. CupertinoPageRoute(
  120. builder: (context){
  121. return YSIssue();
  122. }
  123. )
  124. ).then((value){
  125. if(value!=null&&_type==1){
  126. _refreshData();
  127. }
  128. });
  129. },
  130. child: Container(
  131. margin: EdgeInsets.only(left: hsp(110)+MediaQuery.of(context).size.width-hsp(340),top: MediaQuery.of(context).padding.top+hsp(60)),
  132. width: hsp(200),
  133. alignment: Alignment.center,
  134. child: Text('我要发布',style: TextStyle(fontSize: zsp(30),color: Colors.white),),
  135. ),
  136. ),
  137. Container(
  138. margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top+hsp(350)),
  139. width: MediaQuery.of(context).size.width,
  140. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-hsp(350),
  141. decoration: BoxDecoration(
  142. color: Color(0xFFF1F2F4),
  143. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  144. ),
  145. child: Column(
  146. children: [
  147. Row(
  148. children: [
  149. GestureDetector(
  150. onTap: (){
  151. _type = 1;
  152. _refreshData();
  153. },
  154. child: Container(
  155. height: hsp(100),
  156. width: MediaQuery.of(context).size.width/2,
  157. padding: EdgeInsets.only(top: hsp(30)),
  158. decoration: BoxDecoration(
  159. color: _type==1?Colors.white:Color(0xFFF1F2F3),
  160. borderRadius: BorderRadius.only(topLeft: Radius.circular(10))
  161. ),
  162. child: Column(
  163. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  164. children: [
  165. Text('货源',style: TextStyle(fontSize: zsp(34),color: Colors.black,fontWeight: FontWeight.bold),),
  166. Container(
  167. height: hsp(6),
  168. width: wsp(66),
  169. color: _type==1?Color(0xFF007EFF):Colors.transparent,
  170. )
  171. ],
  172. ),
  173. ),
  174. ),
  175. GestureDetector(
  176. onTap: (){
  177. _type = 2;
  178. _refreshData();
  179. },
  180. child: Container(
  181. height: hsp(100),
  182. width: MediaQuery.of(context).size.width/2,
  183. padding: EdgeInsets.only(top: hsp(30)),
  184. decoration: BoxDecoration(
  185. color: _type==2?Colors.white:Color(0xFFF1F2F3),
  186. borderRadius: BorderRadius.only(topRight: Radius.circular(10))
  187. ),
  188. child: Column(
  189. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  190. children: [
  191. Text('机源',style: TextStyle(fontSize: zsp(34),color: Colors.black,fontWeight: FontWeight.bold),),
  192. Container(
  193. height: hsp(6),
  194. width: wsp(66),
  195. color: _type==2?Color(0xFF007EFF):Colors.transparent,
  196. )
  197. ],
  198. ),
  199. ),
  200. )
  201. ],
  202. ),
  203. Container(
  204. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-hsp(450),
  205. child: EasyRefresh(
  206. onRefresh: _refreshData,
  207. onLoad: _loadMoreData,
  208. header: TaurusHeader(
  209. ),
  210. footer: TaurusFooter(
  211. ),
  212. child: ListView.separated(
  213. itemBuilder: (context,index){
  214. return _type==1?GestureDetector(
  215. onTap: (){
  216. showModalBottomSheet(
  217. backgroundColor: Colors.transparent,
  218. isScrollControlled: true,
  219. context: context,
  220. builder: (context){
  221. return Container(
  222. height: MediaQuery.of(context).size.height*0.5,
  223. child: Column(
  224. children: [
  225. Container(
  226. height: hsp(100),
  227. padding: EdgeInsets.only(left: hsp(30),right: hsp(30)),
  228. decoration: BoxDecoration(
  229. color: Colors.white,
  230. borderRadius: BorderRadius.only(topRight: Radius.circular(10),topLeft: Radius.circular(10))
  231. ),
  232. child: Row(
  233. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  234. children: [
  235. GestureDetector(
  236. child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  237. onTap: (){
  238. Navigator.pop(context);
  239. },
  240. ),
  241. Text('货源详情',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  242. Container(width: wsp(50),),
  243. ],
  244. ),
  245. ),
  246. Container(
  247. height: MediaQuery.of(context).size.height*0.5-hsp(100),
  248. color: Color(0xFFF7F7F7),
  249. child: ListView.separated(
  250. itemBuilder: (context,indexSub){
  251. return Container(
  252. padding: EdgeInsets.only(left: hsp(40),right: hsp(40),top: hsp(20),bottom: hsp(20)),
  253. child: indexSub==0?Column(
  254. crossAxisAlignment: CrossAxisAlignment.start,
  255. children: [
  256. RichText(
  257. text: TextSpan(
  258. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  259. children: [
  260. TextSpan(
  261. text: '货物名称: '
  262. ),
  263. TextSpan(
  264. text: '${_dataArray[index]['goodsName']}',
  265. style: TextStyle(color: Color(0xFF333333))
  266. ),
  267. ]
  268. ),
  269. ),
  270. RichText(
  271. text: TextSpan(
  272. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  273. children: [
  274. TextSpan(
  275. text: '性质: '
  276. ),
  277. TextSpan(
  278. text: '${_dataArray[index]['goodsNatureName']}',
  279. style: TextStyle(color: Color(0xFF333333))
  280. ),
  281. ]
  282. ),
  283. ),
  284. Row(
  285. children: [
  286. RichText(
  287. text: TextSpan(
  288. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  289. children: [
  290. TextSpan(
  291. text: '体积: '
  292. ),
  293. TextSpan(
  294. text: '${_dataArray[index]['goodsVolume']}立方米',
  295. style: TextStyle(color: Color(0xFF333333))
  296. ),
  297. ]
  298. ),
  299. ),
  300. RichText(
  301. text: TextSpan(
  302. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  303. children: [
  304. TextSpan(
  305. text: '重量: '
  306. ),
  307. TextSpan(
  308. text: '${_dataArray[index]['goodsWeight']}吨',
  309. style: TextStyle(color: Color(0xFF333333))
  310. ),
  311. ]
  312. ),
  313. )
  314. ],
  315. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  316. )
  317. ],
  318. ):indexSub==1?Column(
  319. crossAxisAlignment: CrossAxisAlignment.start,
  320. children: [
  321. RichText(
  322. text: TextSpan(
  323. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  324. children: [
  325. TextSpan(
  326. text: '出发地: '
  327. ),
  328. TextSpan(
  329. text: '${_dataArray[index]['citySetout']}',
  330. style: TextStyle(color: Color(0xFF333333))
  331. ),
  332. ]
  333. ),
  334. ),
  335. RichText(
  336. text: TextSpan(
  337. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  338. children: [
  339. TextSpan(
  340. text: '运货地点:'
  341. ),
  342. TextSpan(
  343. text: '${_dataArray[index]['goodsPlace']}',
  344. style: TextStyle(color: Color(0xFF333333))
  345. ),
  346. ]
  347. ),
  348. ),
  349. RichText(
  350. text: TextSpan(
  351. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  352. children: [
  353. TextSpan(
  354. text: '到达地:'
  355. ),
  356. TextSpan(
  357. text: '${_dataArray[index]['cityArrive']}',
  358. style: TextStyle(color: Color(0xFF333333))
  359. ),
  360. ]
  361. ),
  362. ),
  363. RichText(
  364. text: TextSpan(
  365. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  366. children: [
  367. TextSpan(
  368. text: '卸货地点:'
  369. ),
  370. TextSpan(
  371. text: '${_dataArray[index]['goodsUnloadingPlace']}',
  372. style: TextStyle(color: Color(0xFF333333))
  373. ),
  374. ]
  375. ),
  376. )
  377. ],
  378. ):Column(
  379. crossAxisAlignment: CrossAxisAlignment.start,
  380. children: [
  381. RichText(
  382. text: TextSpan(
  383. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  384. children: [
  385. TextSpan(
  386. text: '联系人:'
  387. ),
  388. TextSpan(
  389. text: '${_dataArray[index]['contactPerson']}',
  390. style: TextStyle(color: Color(0xFF333333))
  391. ),
  392. ]
  393. ),
  394. ),
  395. RichText(
  396. text: TextSpan(
  397. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  398. children: [
  399. TextSpan(
  400. text: '联系电话:'
  401. ),
  402. TextSpan(
  403. text: '${(_dataArray[index]['phone']).toString().substring(0,3)}****${(_dataArray[index]['phone']).toString().substring(7,(_dataArray[index]['phone']).toString().length)}',
  404. style: TextStyle(color: Color(0xFF333333))
  405. ),
  406. ]
  407. ),
  408. ),
  409. ],
  410. ),
  411. );
  412. },
  413. separatorBuilder: (context,index){
  414. return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),indent: hsp(30),endIndent: hsp(30),);
  415. },
  416. itemCount: 3
  417. ),
  418. ),
  419. ],
  420. ),
  421. );
  422. }
  423. );
  424. },
  425. child: Container(
  426. padding: EdgeInsets.all(hsp(30)),
  427. color: Colors.white,
  428. child: Column(
  429. crossAxisAlignment: CrossAxisAlignment.start,
  430. children: [
  431. Row(
  432. children: [
  433. Text('${_dataArray[index]['citySetout']}',style: TextStyle(fontSize: zsp(40),color: Colors.black,fontWeight: FontWeight.bold),),
  434. Container(
  435. height: 2,
  436. width: wsp(40),
  437. margin: EdgeInsets.only(left: wsp(20),right: wsp(20)),
  438. color: Color(0xFFCCCCCC),
  439. ),
  440. Text('${_dataArray[index]['cityArrive']}',style: TextStyle(fontSize: zsp(40),color: Colors.black,fontWeight: FontWeight.bold),)
  441. ],
  442. ),
  443. Container(
  444. child: Text('${_dataArray[index]['setoffTime']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF333333)),),
  445. margin: EdgeInsets.only(top: hsp(10),bottom: hsp(10)),
  446. ),
  447. RichText(
  448. text: TextSpan(
  449. style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),
  450. children: [
  451. TextSpan(
  452. text: '货物名称: '
  453. ),
  454. TextSpan(
  455. text: '${_dataArray[index]['goodsName']}',
  456. style: TextStyle(color: Color(0xFF333333))
  457. ),
  458. TextSpan(
  459. text: '体积: '
  460. ),
  461. TextSpan(
  462. text: '${_dataArray[index]['goodsVolume']}立方米',
  463. style: TextStyle(color: Color(0xFF333333))
  464. ),
  465. TextSpan(
  466. text: '性质: '
  467. ),
  468. TextSpan(
  469. text: '${_dataArray[index]['goodsNatureName']}',
  470. style: TextStyle(color: Color(0xFF333333))
  471. ),
  472. TextSpan(
  473. text: '重量: '
  474. ),
  475. TextSpan(
  476. text: '${_dataArray[index]['goodsWeight']}吨',
  477. style: TextStyle(color: Color(0xFF333333))
  478. )
  479. ]
  480. ),
  481. )
  482. ],
  483. ),
  484. ),
  485. ):GestureDetector(
  486. onTap: (){
  487. _index = index;
  488. _getPriceData();
  489. },
  490. child: Container(
  491. padding: EdgeInsets.all(hsp(30)),
  492. color: Colors.white,
  493. child: Column(
  494. children: [
  495. Container(
  496. padding: EdgeInsets.only(bottom: hsp(30)),
  497. child: Column(
  498. children: [
  499. Row(
  500. children: [
  501. Text('${_dataArray[index]['setoutInfo']['display']}',style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
  502. Image(height: hsp(60),width: hsp(60),image: AssetImage('lib/images/plane.png'),),
  503. Text('${_dataArray[index]['arriveInfo']['display']}',style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
  504. ],
  505. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  506. ),
  507. Row(
  508. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  509. children: [
  510. Text('${_dataArray[index]['setoutInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  511. Text('${_dataArray[index]['hour']}',style: TextStyle(fontSize: zsp(20),color: Color(0xFF343434)),),
  512. Text('${_dataArray[index]['arriveInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  513. ],
  514. )
  515. ],
  516. ),
  517. ),
  518. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),),
  519. Container(
  520. height: hsp(70),
  521. child: Row(
  522. children: [
  523. Text('${_dataArray[index]['flightTime']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF333333)),),
  524. Text('机型: ${_dataArray[index]['dtFlightInformation']['model']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF333333)),),
  525. ],
  526. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  527. ),
  528. ),
  529. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),),
  530. Container(
  531. height: hsp(70),
  532. child: Row(
  533. children: [
  534. RichText(
  535. text: TextSpan(
  536. style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),
  537. children: [
  538. TextSpan(
  539. text: '类型: '
  540. ),
  541. TextSpan(
  542. text: '${_dataArray[index]['type']==1?'整机':'拼机'}',
  543. style: TextStyle(color: Color(0xFF333333))
  544. ),
  545. TextSpan(
  546. text: '体积: '
  547. ),
  548. TextSpan(
  549. text: '${_dataArray[index]['totalVolume']}立方米',
  550. style: TextStyle(color: Color(0xFF333333))
  551. ),
  552. TextSpan(
  553. text: '重量: '
  554. ),
  555. TextSpan(
  556. text: '${_dataArray[index]['totalWeight']}吨',
  557. style: TextStyle(color: Color(0xFF333333))
  558. )
  559. ]
  560. ),
  561. ),
  562. Text('¥${_dataArray[index]['discountPrice']}',style: TextStyle(fontSize: zsp(40),color: Color(0xFFEA413A),fontWeight: FontWeight.bold),),
  563. ],
  564. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  565. ),
  566. margin: EdgeInsets.only(top: hsp(20)),
  567. ),
  568. ],
  569. ),
  570. ),
  571. );
  572. },
  573. separatorBuilder: (context,index){
  574. return Divider(color: Color(0xFFF1F2F4),thickness: 0.5,height: 0.5,);
  575. },
  576. itemCount: _dataArray.length,
  577. padding: EdgeInsets.all(0),
  578. ),
  579. ),
  580. ),
  581. ],
  582. ),
  583. ),
  584. if(_isOrder==true)GestureDetector(
  585. onTap: (){
  586. setState(() {
  587. _isOrder = false;
  588. });
  589. },
  590. child: Container(
  591. height: MediaQuery.of(context).size.height,
  592. width: MediaQuery.of(context).size.width,
  593. color: Colors.black54,
  594. child: GestureDetector(
  595. onTap: (){},
  596. child: Column(
  597. children: [
  598. Container(
  599. height: MediaQuery.of(context).size.height*0.8-hsp(120),
  600. width: MediaQuery.of(context).size.width,
  601. margin: EdgeInsets.only(top: MediaQuery.of(context).size.height*0.2),
  602. decoration: BoxDecoration(
  603. color: Color(0xFFF1F2F3),
  604. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  605. ),
  606. child: Column(
  607. crossAxisAlignment: CrossAxisAlignment.start,
  608. children: [
  609. Container(
  610. height: hsp(100),
  611. decoration: BoxDecoration(
  612. color: Colors.white,
  613. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  614. ),
  615. padding: EdgeInsets.only(left: 15,right: 15),
  616. child: Row(
  617. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  618. children: [
  619. Container(width: wsp(50),),
  620. Text('订单确认',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  621. GestureDetector(
  622. child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  623. onTap: (){
  624. setState(() {
  625. _isOrder = false;
  626. });
  627. },
  628. ),
  629. ],
  630. ),
  631. ),
  632. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),),
  633. Container(
  634. height: MediaQuery.of(context).size.height*0.8-hsp(220)-0.5,
  635. child: SingleChildScrollView(
  636. padding: EdgeInsets.all(0),
  637. child: Column(
  638. children: [
  639. Container(
  640. padding: EdgeInsets.all(hsp(30)),
  641. color: Colors.white,
  642. width: MediaQuery.of(context).size.width,
  643. child: Column(
  644. crossAxisAlignment: CrossAxisAlignment.start,
  645. children: [
  646. Text('使用日期',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  647. Container(
  648. margin: EdgeInsets.only(top: hsp(20)),
  649. child: Row(
  650. children: [
  651. Container(
  652. height: hsp(120),
  653. width: MediaQuery.of(context).size.width-hsp(200),
  654. child: ListView.separated(
  655. itemBuilder: (context,index){
  656. return GestureDetector(
  657. behavior: HitTestBehavior.opaque,
  658. onTap: (){
  659. setState(() {
  660. _selected = index;
  661. });
  662. },
  663. child: Stack(
  664. children: [
  665. Container(
  666. height: hsp(120),
  667. width: (MediaQuery.of(context).size.width-hsp(230))/3,
  668. decoration: BoxDecoration(
  669. color: index==_selected?Color(0xFF007EFF):Color(0xFFF0EEEE),
  670. borderRadius: BorderRadius.all(Radius.circular(5))
  671. ),
  672. alignment: Alignment.center,
  673. child: Text('${_priceList[index]['time']} \n¥${_priceList[index]['price']}',
  674. style: TextStyle(fontSize: zsp(20),color: index==_selected?Colors.white:Color(0xFF8B8B8B)),textAlign: TextAlign.center,),
  675. ),
  676. if(_selected==index)Container(
  677. child: Text(timeTag('${_priceList[index]['time']}'),style: TextStyle(fontSize: zsp(16),color: Color(0xFF007EFF)),),
  678. height: hsp(30),
  679. padding: EdgeInsets.only(left: wsp(3),right: wsp(3)),
  680. decoration: BoxDecoration(
  681. color: Color(0xFFF7F7F7),
  682. borderRadius: BorderRadius.only(topLeft: Radius.circular(3),bottomRight: Radius.circular(5))
  683. ),
  684. alignment: Alignment.center,
  685. ),
  686. ],
  687. ),
  688. );
  689. },
  690. separatorBuilder: (context,index){
  691. return Container(width: hsp(15),color: Colors.white,);
  692. },
  693. itemCount: _priceList.length,
  694. padding: EdgeInsets.all(0),
  695. scrollDirection: Axis.horizontal,
  696. ),
  697. ),
  698. GestureDetector(
  699. onTap: (){
  700. showModalBottomSheet(
  701. context: context,
  702. builder: (context){
  703. return YSDatePicker(
  704. choose: (value){
  705. Map time = {'time':value.split(' ')[0],'price':_priceList[0]['price']};
  706. int index;
  707. for(int i=0;i<_priceList.length;i++){
  708. if(_priceList[i]['time']==time['time']){
  709. index = i;
  710. }
  711. }
  712. if(index!=null){
  713. _priceList.removeAt(index);
  714. }
  715. setState(() {
  716. _priceList.insert(0, time);
  717. });
  718. },
  719. );
  720. }
  721. );
  722. },
  723. behavior: HitTestBehavior.opaque,
  724. child: Container(
  725. height: hsp(120),
  726. width: hsp(140),
  727. alignment: Alignment.center,
  728. child: Text('更多\n日期',style: TextStyle(fontSize: zsp(26),color: Color(0xFF007EFF)),),
  729. ),
  730. )
  731. ],
  732. ),
  733. ),
  734. ],
  735. ),
  736. ),
  737. if(_dataArray[_index]['type']==2)Container(
  738. padding: EdgeInsets.all(hsp(30)),
  739. margin: EdgeInsets.only(top: hsp(10)),
  740. width: MediaQuery.of(context).size.width,
  741. color: Colors.white,
  742. child: Column(
  743. crossAxisAlignment: CrossAxisAlignment.start,
  744. children: [
  745. Text('本次拼机截止时间:${_dataArray[_index]['deadlineTime']}',style: TextStyle(fontSize: zsp(26),color: Color(0xFF999999)),),
  746. Row(
  747. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  748. children: [
  749. Text('0吨',style: TextStyle(fontSize: zsp(22),color: Color(0xFF656565)),),
  750. Container(
  751. height: hsp(100),
  752. width: MediaQuery.of(context).size.width-hsp(200),
  753. child: Slider(
  754. value: double.parse('${_dataArray[_index]['nowWeight']}'),
  755. onChanged: (value){
  756. },
  757. activeColor: Color(0xFF0079FF),
  758. min: 0,
  759. max: 10,
  760. divisions: 4,
  761. ),
  762. ),
  763. Text('${_dataArray[_index]['totalWeight']}吨',style: TextStyle(fontSize: zsp(22),color: Color(0xFF656565)),),
  764. ],
  765. ),
  766. Container(
  767. width: MediaQuery.of(context).size.width,
  768. child: Text('目标${_dataArray[_index]['nowWeight']}吨',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  769. alignment: Alignment.center,
  770. ),
  771. ],
  772. ),
  773. ),
  774. Container(
  775. padding: EdgeInsets.all(hsp(30)),
  776. margin: EdgeInsets.only(top: hsp(10)),
  777. color: Colors.white,
  778. child: Column(
  779. children: [
  780. Container(
  781. padding: EdgeInsets.only(bottom: hsp(30)),
  782. child: Column(
  783. children: [
  784. Row(
  785. children: [
  786. Text('${_dataArray[_index]['setoutInfo']['display']}',style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
  787. Image(height: hsp(60),width: hsp(60),image: AssetImage('lib/images/plane.png'),),
  788. Text('${_dataArray[_index]['arriveInfo']['display']}',style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
  789. ],
  790. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  791. ),
  792. Row(
  793. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  794. children: [
  795. Text('${_dataArray[_index]['setoutInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  796. Text('${_dataArray[_index]['hour']}',style: TextStyle(fontSize: zsp(20),color: Color(0xFF343434)),),
  797. Text('${_dataArray[_index]['arriveInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  798. ],
  799. )
  800. ],
  801. ),
  802. ),
  803. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),),
  804. Container(
  805. height: hsp(70),
  806. child: Row(
  807. children: [
  808. Text('${_dataArray[_index]['flightTime']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF333333)),),
  809. Text('机型: ${_dataArray[_index]['dtFlightInformation']['model']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF333333)),),
  810. ],
  811. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  812. ),
  813. ),
  814. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),),
  815. Container(
  816. height: hsp(90),
  817. alignment: Alignment.centerLeft,
  818. child: Row(
  819. children: [
  820. RichText(
  821. text: TextSpan(
  822. style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),
  823. children: [
  824. TextSpan(
  825. text: '类型: '
  826. ),
  827. TextSpan(
  828. text: '${_dataArray[_index]['type']==1?'整机':'拼机'}',
  829. style: TextStyle(color: Color(0xFF333333))
  830. ),
  831. TextSpan(
  832. text: '体积: '
  833. ),
  834. TextSpan(
  835. text: '${_dataArray[_index]['totalVolume']}立方米',
  836. style: TextStyle(color: Color(0xFF333333))
  837. ),
  838. TextSpan(
  839. text: '重量: '
  840. ),
  841. TextSpan(
  842. text: '${_dataArray[_index]['totalWeight']}吨',
  843. style: TextStyle(color: Color(0xFF333333))
  844. )
  845. ]
  846. ),
  847. ),
  848. Text('¥${_dataArray[_index]['discountPrice']}',style: TextStyle(fontSize: zsp(40),color: Color(0xFFEA413A),fontWeight: FontWeight.bold),),
  849. ],
  850. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  851. ),
  852. ),
  853. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),),
  854. Container(
  855. height: hsp(90),
  856. alignment: Alignment.centerLeft,
  857. child: RichText(
  858. text: TextSpan(
  859. style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),
  860. children: [
  861. TextSpan(
  862. text: '说明: '
  863. ),
  864. TextSpan(
  865. text: '${_dataArray[_index]['explain']}',style: TextStyle(color: Color(0xFF333333))
  866. ),
  867. ]
  868. ),
  869. ),
  870. )
  871. ],
  872. ),
  873. ),
  874. ListView.separated(
  875. itemBuilder: (context,index){
  876. return Container(
  877. height: hsp(90),
  878. color: Colors.white,
  879. width: MediaQuery.of(context).size.width,
  880. padding: EdgeInsets.only(left: hsp(30),right: hsp(30)),
  881. alignment: Alignment.centerLeft,
  882. child: index==0?Text(
  883. '货物信息',style: TextStyle(fontSize: zsp(30),color: Color(0xFF333333),fontWeight: FontWeight.bold),
  884. ):Row(
  885. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  886. children: [
  887. Text(index==1?'名称':index==2?'类型':index==3?'体积':'重量',style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),),
  888. Container(
  889. height: hsp(90),
  890. width: MediaQuery.of(context).size.width*0.7,
  891. alignment: Alignment.centerRight,
  892. child: index==2?GestureDetector(
  893. onTap: (){
  894. FocusScope.of(context).unfocus();
  895. showModalBottomSheet(
  896. context: context,
  897. builder: (context){
  898. return YSPicker(
  899. dataArray: _kinds,
  900. title: 'name',
  901. choose: (value){
  902. setState(() {
  903. _kind = value;
  904. });
  905. },
  906. );
  907. }
  908. );
  909. },
  910. child: Row(
  911. mainAxisSize: MainAxisSize.min,
  912. children: [
  913. Text(_kind==null?'请选择类型':'${_kind['name']}',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  914. Icon(Icons.keyboard_arrow_down,size: hsp(40),color: Color(0xFF9A9A9A))
  915. ],
  916. ),
  917. ):CupertinoTextField(
  918. placeholder: index==1?'请输入名称':index==3?'请输入体积':'请输入重量',
  919. placeholderStyle: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),
  920. style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),
  921. decoration: BoxDecoration(),
  922. textAlign: TextAlign.right,
  923. suffix: Text(index==1?'':index==3?'立方米':'吨',style: TextStyle(fontSize: zsp(30),color: Colors.black)),
  924. controller: index==1?_name:index==3?_volume:_weight,
  925. keyboardType: index==1?TextInputType.text:TextInputType.numberWithOptions(),
  926. ),
  927. ),
  928. ],
  929. ),
  930. );
  931. },
  932. separatorBuilder: (context,index){
  933. return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),);
  934. },
  935. itemCount: 5,
  936. padding: EdgeInsets.only(top: hsp(10)),
  937. shrinkWrap: true,
  938. physics: NeverScrollableScrollPhysics(),
  939. ),
  940. if(_dataArray[_index]['type']==2)Container(
  941. padding: EdgeInsets.all(hsp(30)),
  942. margin: EdgeInsets.only(top: hsp(10),bottom: hsp(30)),
  943. color: Colors.white,
  944. child: Row(
  945. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  946. children: [
  947. Container(
  948. width: (MediaQuery.of(context).size.width-hsp(60))*0.6,
  949. child: SingleChildScrollView(
  950. child: Stack(
  951. children: [
  952. for(int i = 0;i<(_dataArray[_index]['dtAirplaneGoods']).length;i++)Container(
  953. height: hsp(70),
  954. width: hsp(70),
  955. margin: EdgeInsets.only(left: hsp(60)*i),
  956. decoration: BoxDecoration(
  957. color: Color(0xFFED5D57),
  958. borderRadius: BorderRadius.all(Radius.circular(50)),
  959. border: Border.all(color: Colors.white,width: 1),
  960. image: DecorationImage(
  961. image: NetworkImage('${_dataArray[_index]['dtAirplaneGoods'][i]['dtUsers']['avatar']}'),
  962. fit: BoxFit.fill,
  963. )
  964. ),
  965. )
  966. ],
  967. ),
  968. scrollDirection: Axis.horizontal,
  969. ),
  970. ),
  971. RichText(
  972. text: TextSpan(
  973. text: '已有',
  974. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  975. children: [
  976. TextSpan(
  977. text: '4',
  978. style: TextStyle(color: Color(0xFF007DFF))
  979. ),
  980. TextSpan(
  981. text: '个人在拼该机'
  982. )
  983. ]
  984. ),
  985. )
  986. ],
  987. ),
  988. )
  989. ],
  990. ),
  991. ),
  992. ),
  993. ],
  994. ),
  995. ),
  996. Container(
  997. height: hsp(120),
  998. width: MediaQuery.of(context).size.width,
  999. color: Colors.white,
  1000. padding: EdgeInsets.only(left: wsp(30),right: wsp(30)),
  1001. child: Row(
  1002. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1003. children: [
  1004. RichText(
  1005. text: TextSpan(
  1006. text: '参考价(¥)',
  1007. style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),
  1008. children: [
  1009. TextSpan(
  1010. text: ' ${_dataArray[_index]['discountPrice']}',
  1011. style: TextStyle(fontSize: zsp(40),color: Color(0xFFFF6600)),
  1012. ),
  1013. TextSpan(
  1014. text: ' 元',
  1015. )
  1016. ]
  1017. ),
  1018. ),
  1019. // GestureDetector(
  1020. // child: Row(
  1021. // children: [
  1022. // Text('明细',style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),),
  1023. // Icon(Icons.keyboard_arrow_up,size: hsp(30),color: Color(0xFF007EFF),),
  1024. // ],
  1025. // ),
  1026. // onTap: (){
  1027. // setState(() {
  1028. // _isDetail = !_isDetail;
  1029. // });
  1030. // },
  1031. // ),
  1032. GestureDetector(
  1033. onTap: (){
  1034. FocusScope.of(context).unfocus();
  1035. _postOrderData();
  1036. },
  1037. child: Container(
  1038. height: hsp(70),
  1039. padding: EdgeInsets.only(left: wsp(50),right: wsp(50)),
  1040. decoration: BoxDecoration(
  1041. color: Color(0xFF007EFF),
  1042. borderRadius: BorderRadius.all(Radius.circular(50))
  1043. ),
  1044. alignment: Alignment.center,
  1045. child: Text('立即预约',style: TextStyle(fontSize: zsp(30),color: Colors.white,fontWeight: FontWeight.bold),),
  1046. ),
  1047. )
  1048. ],
  1049. ),
  1050. )
  1051. ],
  1052. ),
  1053. ),
  1054. ),
  1055. ),
  1056. // if(_isDetail==true)GestureDetector(
  1057. // onTap: (){
  1058. // setState(() {
  1059. // _isDetail = false;
  1060. // });
  1061. // },
  1062. // child: Container(
  1063. // height: MediaQuery.of(context).size.height-hsp(120),
  1064. // color: Colors.black45,
  1065. // child: Container(
  1066. // margin: EdgeInsets.only(top: MediaQuery.of(context).size.height-hsp(120)-hsp(370)),
  1067. // height: hsp(370),
  1068. // decoration: BoxDecoration(
  1069. // color: Colors.white,
  1070. // borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  1071. // ),
  1072. // child: GestureDetector(
  1073. // onTap: (){},
  1074. // behavior: HitTestBehavior.opaque,
  1075. // child: Column(
  1076. // children: [
  1077. // Container(
  1078. // height: hsp(100),
  1079. // padding: EdgeInsets.only(left: 15,right: 15),
  1080. // child: Row(
  1081. // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1082. // children: [
  1083. // GestureDetector(
  1084. // child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  1085. // onTap: (){
  1086. // setState(() {
  1087. // _isDetail = false;
  1088. // });
  1089. // },
  1090. // ),
  1091. // Text('明细',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  1092. // Container(width: wsp(50),),
  1093. // ],
  1094. // ),
  1095. // ),
  1096. // Container(
  1097. // height: hsp(100),
  1098. // color: Color(0xFFF7F8F9),
  1099. // padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(20),top: hsp(20)),
  1100. // child: Row(
  1101. // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1102. // children: [
  1103. // Text('VIP尊享座位',style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),decoration: TextDecoration.none),),
  1104. // Text('¥ 780x 10人',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  1105. // ],
  1106. // ),
  1107. // ),
  1108. // Container(
  1109. // color: Color(0xFFF7F8F9),
  1110. // height: hsp(170),
  1111. // child: ListView.builder(
  1112. // padding: EdgeInsets.all(0),
  1113. // itemBuilder: (context,index){
  1114. // return Container(
  1115. // padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(10)),
  1116. // child: Row(
  1117. // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1118. // children: [
  1119. // Text('票价',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
  1120. // Text('¥ 770x 10人',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
  1121. // ],
  1122. // ),
  1123. // );
  1124. // },
  1125. // itemCount: 3,
  1126. // ),
  1127. // )
  1128. // ],
  1129. // ),
  1130. // ),
  1131. // ),
  1132. // ),
  1133. // )
  1134. ],
  1135. ),
  1136. ),
  1137. );
  1138. }
  1139. _getBackImageData() async{
  1140. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/wallconfigure/get',parameter: {'type':3},isLoading: false,isToken: false);
  1141. if(dict!=null){
  1142. setState(() {
  1143. _msgDict = dict['data'];
  1144. });
  1145. }
  1146. }
  1147. Future<void> _refreshData() async{
  1148. _page = 1;
  1149. 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);
  1150. if(dict!=null){
  1151. setState(() {
  1152. _dataArray = dict['data']['resultList'];
  1153. });
  1154. }
  1155. }
  1156. Future<void> _loadMoreData() async{
  1157. _page++;
  1158. 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);
  1159. if(dict!=null){
  1160. setState(() {
  1161. _dataArray.add(dict['data']['resultList']);
  1162. });
  1163. }
  1164. }
  1165. _getPriceData() async{
  1166. String time = DateTime.now().year.toString()+'-'+DateTime.now().month.toString().padLeft(2,'0')+'-'
  1167. +DateTime.now().day.toString().padLeft(2,'0')+' '+DateTime.now().hour.toString().padLeft(2,'0')+':'+DateTime.now().minute.toString().padLeft(2,'0');
  1168. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneorder/getDateAndTime',parameter: {'time':time,'type':3,'id':_dataArray[_index]['id']},isLoading: true,isToken: true);
  1169. if(dict!=null){
  1170. _isOrder = true;
  1171. _priceList = dict['data'];
  1172. _getTypeData();
  1173. }
  1174. }
  1175. _getTypeData() async{
  1176. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplanegoods/type/get',parameter: {},isLoading: true,isToken: false);
  1177. if(dict!=null){
  1178. setState(() {
  1179. _kinds = dict['data'];
  1180. _kind = _kinds[0];
  1181. });
  1182. }
  1183. }
  1184. _postOrderData() async{
  1185. if(_name.text.isEmpty){
  1186. ysFlutterToast(context, '货物名称不能为空');
  1187. return;
  1188. }
  1189. if(_volume.text.isEmpty){
  1190. ysFlutterToast(context, '货物体积不能为空');
  1191. return;
  1192. }
  1193. if(_weight.text.isEmpty){
  1194. ysFlutterToast(context, '货物重量不能为空');
  1195. return;
  1196. }
  1197. Map request = {};
  1198. request['flightTime'] = '2020-10-07 17:59:27';
  1199. request['type'] = 3;
  1200. request['airplaneid'] = _dataArray[_index]['id'];
  1201. request['airportidSetout'] = _dataArray[_index]['airportidSetout'];
  1202. request['airportidArrive'] = _dataArray[_index]['airportidArrive'];
  1203. request['airportidArrive'] = _dataArray[_index]['airportidArrive'];
  1204. Map value = {};
  1205. value['goodsName'] = _name.text;
  1206. value['goodsNatureId'] = _kind['id'];
  1207. value['goodsVolume'] = _volume.text;
  1208. value['goodsWeight'] = _weight.text;
  1209. value['contactPerson'] = '111';
  1210. value['phone'] = '15829646496';
  1211. value['goodsPlace'] = '西安小寨A座国际商务酒店';
  1212. value['goodsLocation'] = '108.985463,34.30501';
  1213. value['goodsUnloadingPlace'] = '上海酒店';
  1214. value['goodsUnloadingLocation'] = '108.985463,34.30501';
  1215. request['dtAirplaneGoods'] = value;
  1216. request['sourceType'] = _dataArray[_index]['type'];
  1217. Map dict = await ysRequestHttp(context,type: requestType.post,api: '/app/applets/airplaneorder/createOrder',parameter: request,isLoading: true,isToken: true);
  1218. if(dict!=null){
  1219. Navigator.of(context).push(
  1220. CupertinoPageRoute(
  1221. builder: (context){
  1222. return YSPay(orderDict: dict['data'],type: payType.goods,);
  1223. }
  1224. )
  1225. );
  1226. }
  1227. }
  1228. }