YSShortGoods.dart 74 KB

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