YSShortGoods.dart 88 KB

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