YSContractPlaneDetail.dart 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:ysairplane/code/YSContact.dart';
  4. import 'package:ysairplane/code/YSPay.dart';
  5. import 'package:ysairplane/tools/YSNetWorking.dart';
  6. import 'package:ysairplane/tools/YSTools.dart';
  7. class YSContractPlaneDetail extends StatefulWidget {
  8. final contractId,isWhole;
  9. const YSContractPlaneDetail({Key key, this.contractId, this.isWhole}) : super(key: key);
  10. @override
  11. _YSContractPlaneDetailState createState() => _YSContractPlaneDetailState();
  12. }
  13. class _YSContractPlaneDetailState extends State<YSContractPlaneDetail> {
  14. //List _tags = ['服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)',];
  15. bool _isDetail = false;
  16. bool _isOrder = false;
  17. Map _msgDict,_detailDict;
  18. List _chooses = [];
  19. String _timeStr;
  20. List _packList = [];
  21. List _priceList = [];
  22. int _index = 0;
  23. List _customer = [];
  24. bool _isShow = false;
  25. @override
  26. void initState() {
  27. Future.delayed(Duration(seconds: 0)).then((value){
  28. _getBackImageData();
  29. _getContractPlaneDetailData();
  30. });
  31. super.initState();
  32. }
  33. @override
  34. Widget build(BuildContext context) {
  35. return Scaffold(
  36. backgroundColor: Color(0xFFF1F2F4),
  37. body: Stack(
  38. children: [
  39. SingleChildScrollView(
  40. child: Column(
  41. children: [
  42. Container(
  43. height: MediaQuery.of(context).size.height-hsp(120),
  44. child: SingleChildScrollView(
  45. child: Stack(
  46. children: [
  47. Container(
  48. height: MediaQuery.of(context).padding.top+hsp(380),
  49. width: MediaQuery.of(context).size.width,
  50. child: Image(
  51. image: _msgDict==null?AssetImage('lib/images/home3.png'):NetworkImage('${_msgDict['background']}'),
  52. fit: BoxFit.fill,
  53. ),
  54. ),
  55. GestureDetector(
  56. onTap: (){Navigator.pop(context);},
  57. child: Container(
  58. margin: EdgeInsets.only(left: wsp(32),top: MediaQuery.of(context).padding.top+hsp(30)),
  59. child: Icon(Icons.arrow_back_ios,size: hsp(40),color: Colors.white,),
  60. ),
  61. ),
  62. if(_msgDict!=null)Container(
  63. margin: EdgeInsets.only(left: wsp(50),top: MediaQuery.of(context).padding.top+hsp(200)),
  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. Container(
  78. margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top+hsp(300)),
  79. child: Column(
  80. children: [
  81. Container(
  82. width: MediaQuery.of(context).size.width-wsp(60),
  83. margin: EdgeInsets.only(left: wsp(30),bottom: hsp(20)),
  84. padding: EdgeInsets.all(hsp(30)),
  85. decoration: BoxDecoration(
  86. borderRadius: BorderRadius.all(Radius.circular(10)),
  87. color: Colors.white,
  88. ),
  89. child: Column(
  90. crossAxisAlignment: CrossAxisAlignment.start,
  91. children: [
  92. Container(
  93. margin: EdgeInsets.only(bottom: hsp(30)),
  94. child: Row(
  95. children: [
  96. RichText(
  97. text: TextSpan(
  98. text: '${_detailDict!=null?_detailDict['dtPartner']['partnerName']:''}',
  99. style: TextStyle(fontSize: zsp(28),color: Color(0xFF444444)),
  100. children: [
  101. TextSpan(
  102. text: ' >',
  103. style: TextStyle(color: Color(0xFF2C7CF6))
  104. )
  105. ]
  106. ),
  107. ),
  108. Container(
  109. margin: EdgeInsets.only(left: wsp(40)),
  110. child: RichText(
  111. text: TextSpan(
  112. text: '${_detailDict!=null?_detailDict['dtFlightInformation']['model']:''}',
  113. style: TextStyle(fontSize: zsp(28),color: Color(0xFF444444)),
  114. children: [
  115. TextSpan(
  116. text: ' >',
  117. style: TextStyle(color: Color(0xFF2C7CF6))
  118. )
  119. ]
  120. ),
  121. ),
  122. )
  123. ],
  124. ),
  125. ),
  126. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),),
  127. Container(
  128. padding: EdgeInsets.only(top: hsp(30),bottom: hsp(30)),
  129. child: Column(
  130. children: [
  131. Row(
  132. children: [
  133. Container(
  134. child: Text('${_detailDict!=null?_detailDict['setoutInfo']['display']:''}',
  135. style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
  136. width: (MediaQuery.of(context).size.width-hsp(210))/2,
  137. alignment: Alignment.centerLeft,
  138. ),
  139. Image(height: hsp(60),width: hsp(60),image: AssetImage('lib/images/plane.png'),),
  140. Container(
  141. child: Text('${_detailDict!=null?_detailDict['arriveInfo']['display']:''}',style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
  142. width: (MediaQuery.of(context).size.width-hsp(210))/2,
  143. alignment: Alignment.centerRight,
  144. ),
  145. ],
  146. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  147. ),
  148. Row(
  149. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  150. children: [
  151. Container(
  152. child: Text('${_detailDict!=null?_detailDict['setoutInfo']['airplanename']:''}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  153. width: (MediaQuery.of(context).size.width-hsp(400))/2,
  154. alignment: Alignment.centerLeft,
  155. ),
  156. Text('${_detailDict!=null?_detailDict['hour']:''}',style: TextStyle(fontSize: zsp(20),color: Color(0xFF343434)),),
  157. Container(
  158. child: Text('${_detailDict!=null?_detailDict['arriveInfo']['airplanename']:''}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  159. width: (MediaQuery.of(context).size.width-hsp(400))/2,
  160. alignment: Alignment.centerRight,
  161. ),
  162. ],
  163. ),
  164. ],
  165. ),
  166. ),
  167. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),),
  168. Container(
  169. padding: EdgeInsets.only(top: hsp(20)),
  170. child: Column(
  171. children: [
  172. Text('出发',style: TextStyle(fontSize: zsp(24),color: Color(0xFF666666)),),
  173. RichText(
  174. text: TextSpan(
  175. text: '${_detailDict!=null?_detailDict['flightTime']:''}',
  176. style: TextStyle(fontSize: zsp(36),fontWeight: FontWeight.bold,color: Colors.black),
  177. children: [
  178. // TextSpan(
  179. // text: '今天',
  180. // style: TextStyle(fontSize: zsp(24),fontWeight: FontWeight.normal),
  181. // )
  182. ]
  183. ),
  184. )
  185. ],
  186. crossAxisAlignment: CrossAxisAlignment.start,
  187. ),
  188. )
  189. ],
  190. ),
  191. ),
  192. Container(
  193. width: MediaQuery.of(context).size.width-wsp(60),
  194. margin: EdgeInsets.only(left: wsp(30)),
  195. padding: EdgeInsets.all(hsp(30)),
  196. decoration: BoxDecoration(
  197. borderRadius: BorderRadius.all(Radius.circular(10)),
  198. color: Colors.white,
  199. ),
  200. child: Column(
  201. children: [
  202. Row(
  203. children: [
  204. Text('评价(${_detailDict!=null?_detailDict['dtOrderScoringNum']:''})',style: TextStyle(fontSize: zsp(36),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
  205. Text('更多',style: TextStyle(fontSize: zsp(28),color: Color(0xFF444444)),),
  206. ],
  207. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  208. ),
  209. Container(
  210. margin: EdgeInsets.only(top: hsp(30),bottom: hsp(30),right: wsp(10)),
  211. height: hsp(120),
  212. child: Row(
  213. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  214. children: [
  215. Container(
  216. child: Column(
  217. children: [
  218. RichText(
  219. text: TextSpan(
  220. text: '${_detailDict!=null?_detailDict['averageRating']:'0'}',
  221. style: TextStyle(fontSize: zsp(60),color: Color(0xFFED5E58),fontWeight: FontWeight.bold),
  222. children: [
  223. TextSpan(
  224. text: ' 超赞',
  225. style: TextStyle(fontSize: zsp(24),fontWeight: FontWeight.normal),
  226. )
  227. ]
  228. ),
  229. ),
  230. Text('高于${_detailDict!=null?_detailDict['scoreScale']:'0'}同类型航空',style: TextStyle(fontSize: zsp(20),color: Color(0xFF202020)),),
  231. ],
  232. ),
  233. width: wsp(200),
  234. ),
  235. Container(
  236. height: hsp(120),
  237. width: MediaQuery.of(context).size.width-hsp(120)-wsp(210)-wsp(60),
  238. margin: EdgeInsets.only(left: wsp(10),right: wsp(0)),
  239. child: GridView.builder(
  240. gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  241. crossAxisCount: 2,
  242. childAspectRatio: (MediaQuery.of(context).size.width-hsp(120)-wsp(210)-wsp(60))/2/hsp(60)
  243. ),
  244. itemBuilder: (context, index) {
  245. return Container(
  246. height: hsp(60),
  247. child: Row(
  248. children: [
  249. Text('${_detailDict['dtOrderScoringTypeList'][index]['name']} ${_detailDict['dtOrderScoringTypeList'][index]['avatarOrderScoring']} ',style: TextStyle(fontSize: zsp(22),color: Color(0xFF202020)),),
  250. Container(
  251. height: hsp(8),
  252. decoration: BoxDecoration(
  253. color: Color(0xFFED5E58),
  254. borderRadius: BorderRadius.all(Radius.circular(50))
  255. ),
  256. width: wsp(60)*(double.parse('${_detailDict['dtOrderScoringTypeList'][index]['avatarOrderScoring']}')/
  257. double.parse('${_detailDict['dtOrderScoringTypeList'][index]['totalScore']}')),
  258. )
  259. ],
  260. ),
  261. );
  262. },
  263. itemCount: _detailDict!=null?_detailDict['dtOrderScoringTypeList'].length:0,
  264. padding: EdgeInsets.all(0),
  265. physics: NeverScrollableScrollPhysics(),
  266. ),
  267. )
  268. ],
  269. ),
  270. ),
  271. // Container(
  272. // width: MediaQuery.of(context).size.width-hsp(120),
  273. // child: Wrap(
  274. // alignment: WrapAlignment.start,
  275. // children: <Widget>[
  276. // for (int i =0;i<_tags.length;i++ ) GestureDetector(
  277. // behavior: HitTestBehavior.opaque,
  278. // onTap: (){
  279. //
  280. // },
  281. // child: Container(
  282. // margin: EdgeInsets.symmetric(vertical: hsp(10), horizontal: hsp(10)),
  283. // decoration: BoxDecoration(
  284. // color: Color(0xFFFDF1F1),
  285. // borderRadius: BorderRadius.all(Radius.circular(5))
  286. // ),
  287. // padding: EdgeInsets.only(left: wsp(15), right: wsp(15),top: hsp(10),bottom: hsp(10)),
  288. // child: Text('${_tags[i]}', style: TextStyle(fontSize: zsp(22),color: Color(0xFF000000)), textAlign: TextAlign.center,),
  289. // ),
  290. // )
  291. // ]
  292. // ),
  293. // ),
  294. ListView.separated(
  295. shrinkWrap: true,
  296. itemBuilder: (context,index){
  297. return Container(
  298. child: Column(
  299. crossAxisAlignment: CrossAxisAlignment.start,
  300. children: [
  301. Row(
  302. children: [
  303. Container(
  304. height: hsp(90),
  305. width: hsp(90),
  306. margin: EdgeInsets.only(right: wsp(20)),
  307. decoration: BoxDecoration(
  308. color: Colors.lightGreen,
  309. borderRadius: BorderRadius.all(Radius.circular(50)),
  310. image: DecorationImage(image: NetworkImage('${_detailDict['dtOrderScoringContentList'][index]['dtUsers']['avatar']}'),fit: BoxFit.fill)
  311. ),
  312. ),
  313. Container(
  314. height: hsp(80),
  315. child: Column(
  316. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  317. crossAxisAlignment: CrossAxisAlignment.start,
  318. children: [
  319. Text('${_detailDict['dtOrderScoringContentList'][index]['dtUsers']['nickname']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
  320. Text('${_detailDict['dtOrderScoringContentList'][index]['createTime']}',style: TextStyle(fontSize: zsp(22),color: Color(0xFF9A9A9A)),)
  321. ],
  322. ),
  323. )
  324. ],
  325. ),
  326. Container(
  327. margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20)),
  328. child: ysTextExpend(text: '${_detailDict['dtOrderScoringContentList'][index]['content']}',
  329. style: TextStyle(fontSize: zsp(28),color: Color(0xFF000000)),maxLines: 3,)
  330. ),
  331. if((_detailDict['dtOrderScoringContentList'][index]['picture']).length>0)GridView.builder(
  332. shrinkWrap: true,
  333. gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  334. crossAxisCount: 3,
  335. childAspectRatio: (MediaQuery.of(context).size.width-hsp(140)-wsp(60))/3/hsp(160),
  336. crossAxisSpacing: hsp(10),
  337. mainAxisSpacing: hsp(10)
  338. ),
  339. itemBuilder: (context, indexSub) {
  340. return Container(
  341. height: hsp(160),
  342. child: Image(
  343. image: NetworkImage('${(_detailDict['dtOrderScoringContentList'][index]['picture']).split(',')[indexSub]}'),
  344. fit: BoxFit.fill,
  345. ),
  346. );
  347. },
  348. itemCount: _detailDict!=null?(_detailDict['dtOrderScoringContentList'][index]['picture']).split(',').length:0,
  349. padding: EdgeInsets.all(0),
  350. physics: NeverScrollableScrollPhysics(),
  351. )
  352. ],
  353. ),
  354. );
  355. },
  356. separatorBuilder: (context,index){
  357. return Divider(color: Colors.white,height: hsp(20),thickness: hsp(20),);
  358. },
  359. itemCount: (_detailDict!=null&&_detailDict['dtOrderScoringContentList']!=null)?_detailDict['dtOrderScoringContentList'].length:0,
  360. padding: EdgeInsets.only(left: hsp(15),right: hsp(15),top: hsp(15)),
  361. physics: NeverScrollableScrollPhysics(),
  362. ),
  363. ],
  364. ),
  365. ),
  366. Container(
  367. width: MediaQuery.of(context).size.width-wsp(60),
  368. margin: EdgeInsets.only(left: wsp(30),bottom: hsp(50),top: hsp(20)),
  369. padding: EdgeInsets.all(hsp(30)),
  370. decoration: BoxDecoration(
  371. borderRadius: BorderRadius.all(Radius.circular(10)),
  372. color: Colors.white,
  373. ),
  374. child: Column(
  375. crossAxisAlignment: CrossAxisAlignment.start,
  376. children: [
  377. Text('航线详情',style: TextStyle(fontSize: zsp(36),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
  378. Container(
  379. margin: EdgeInsets.only(top: hsp(30),bottom: hsp(10)),
  380. child: RichText(
  381. text: TextSpan(
  382. text: '航线: ',
  383. style: TextStyle(fontSize: zsp(28),color: Color(0xFF929292)),
  384. children: [
  385. TextSpan(
  386. text: '${_detailDict!=null?_detailDict['setoutInfo']['display']:''} - ${_detailDict!=null?_detailDict['arriveInfo']['display']:''}',
  387. style: TextStyle(color: Color(0xFF343434))
  388. )
  389. ]
  390. ),
  391. )
  392. ),
  393. RichText(
  394. text: TextSpan(
  395. text: '日期: ',
  396. style: TextStyle(fontSize: zsp(28),color: Color(0xFF929292)),
  397. children: [
  398. TextSpan(
  399. text: '${_detailDict!=null?_detailDict['flightTime']:''}',
  400. style: TextStyle(color: Color(0xFF343434))
  401. )
  402. ]
  403. ),
  404. )
  405. ],
  406. ),
  407. )
  408. ],
  409. ),
  410. ),
  411. ],
  412. ),
  413. ),
  414. ),
  415. Row(
  416. children: [
  417. Container(
  418. width: MediaQuery.of(context).size.width*0.2,
  419. height: hsp(120),
  420. color: Colors.white,
  421. alignment: Alignment.center,
  422. child: Column(
  423. mainAxisSize: MainAxisSize.min,
  424. children: [
  425. Icon(Icons.headset,color: Color(0xFF2C7CF6),size: hsp(40),),
  426. Text('咨询',style: TextStyle(fontSize: zsp(22),color: Color(0xFF007EFF),fontWeight: FontWeight.bold),)
  427. ],
  428. ),
  429. ),
  430. GestureDetector(
  431. onTap: (){
  432. _timeStr = DateTime.now().year.toString()+'-'+DateTime.now().month.toString().padLeft(2,'0')+'-'+DateTime.now().day.toString().padLeft(2,'0')+' '+
  433. DateTime.now().hour.toString().padLeft(2,'0')+':'+DateTime.now().minute.toString().padLeft(2,'0');
  434. _index = 0;
  435. _getPackData();
  436. },
  437. child: Container(
  438. width: MediaQuery.of(context).size.width*0.8,
  439. height: hsp(120),
  440. color: widget.isWhole==true?Color(0xFF51A2F5):Color(0xFF007EFF),
  441. alignment: Alignment.center,
  442. child: Column(
  443. mainAxisSize: MainAxisSize.min,
  444. children: [
  445. Text('${widget.isWhole==1?'整机':'拼机'}特惠价 (元)',style: TextStyle(fontSize: zsp(20),color: Colors.white,fontWeight: FontWeight.bold),),
  446. Text('¥${_detailDict!=null?_detailDict[widget.isWhole==1?'discountPrice':'retailPrice']:''}',style: TextStyle(fontSize: zsp(36),color: Colors.white,fontWeight: FontWeight.bold),)
  447. ],
  448. ),
  449. ),
  450. ),
  451. ],
  452. )
  453. ],
  454. ),
  455. ),
  456. if(_isOrder==true)GestureDetector(
  457. onTap: (){
  458. setState(() {
  459. _isOrder = false;
  460. });
  461. },
  462. child: Container(
  463. height: MediaQuery.of(context).size.height,
  464. width: MediaQuery.of(context).size.width,
  465. color: Colors.black54,
  466. child: GestureDetector(
  467. onTap: (){},
  468. child: Column(
  469. children: [
  470. Container(
  471. height: MediaQuery.of(context).size.height*0.8-hsp(120),
  472. width: MediaQuery.of(context).size.width,
  473. margin: EdgeInsets.only(top: MediaQuery.of(context).size.height*0.2),
  474. decoration: BoxDecoration(
  475. color: Color(0xFFF1F2F3),
  476. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  477. ),
  478. child: Column(
  479. crossAxisAlignment: CrossAxisAlignment.start,
  480. children: [
  481. Container(
  482. height: hsp(100),
  483. decoration: BoxDecoration(
  484. color: Colors.white,
  485. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  486. ),
  487. padding: EdgeInsets.only(left: 15,right: 15),
  488. child: Row(
  489. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  490. children: [
  491. Container(width: wsp(50),),
  492. Text('订单确认',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  493. GestureDetector(
  494. child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  495. onTap: (){
  496. setState(() {
  497. _isOrder = false;
  498. });
  499. },
  500. ),
  501. ],
  502. ),
  503. ),
  504. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),),
  505. Container(
  506. height: MediaQuery.of(context).size.height*0.8-hsp(220)-0.5,
  507. child: SingleChildScrollView(
  508. padding: EdgeInsets.all(0),
  509. child: Column(
  510. children: [
  511. Container(
  512. padding: EdgeInsets.all(hsp(30)),
  513. color: Colors.white,
  514. width: MediaQuery.of(context).size.width,
  515. child: Column(
  516. crossAxisAlignment: CrossAxisAlignment.start,
  517. children: [
  518. Text('使用日期',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  519. Container(
  520. margin: EdgeInsets.only(top: hsp(20)),
  521. child: Row(
  522. children: [
  523. Container(
  524. height: hsp(120),
  525. width: MediaQuery.of(context).size.width-hsp(200),
  526. child: ListView.separated(
  527. itemBuilder: (context,index){
  528. return GestureDetector(
  529. behavior: HitTestBehavior.opaque,
  530. onTap: (){
  531. _timeStr = _priceList[index]['time'];
  532. setState(() {
  533. _index = index;
  534. });
  535. },
  536. child: Stack(
  537. children: [
  538. Container(
  539. height: hsp(120),
  540. width: (MediaQuery.of(context).size.width-hsp(230))/3,
  541. decoration: BoxDecoration(
  542. color: index==_index?Color(0xFF007EFF):Color(0xFFF0EEEE),
  543. borderRadius: BorderRadius.all(Radius.circular(5))
  544. ),
  545. alignment: Alignment.center,
  546. child: Text('${_priceList[index]['time']} \n¥${_priceList[index]['price']}',
  547. style: TextStyle(fontSize: zsp(20),color: index==_index?Colors.white:Color(0xFF8B8B8B)),textAlign: TextAlign.center,),
  548. ),
  549. if(_index==index)Container(
  550. child: Text(timeTag('${_priceList[index]['time']}'),style: TextStyle(fontSize: zsp(16),color: Color(0xFF007EFF)),),
  551. height: hsp(30),
  552. padding: EdgeInsets.only(left: wsp(3),right: wsp(3)),
  553. decoration: BoxDecoration(
  554. color: Color(0xFFF7F7F7),
  555. borderRadius: BorderRadius.only(topLeft: Radius.circular(3),bottomRight: Radius.circular(5))
  556. ),
  557. alignment: Alignment.center,
  558. ),
  559. ],
  560. ),
  561. );
  562. },
  563. separatorBuilder: (context,index){
  564. return Container(width: hsp(15),color: Colors.white,);
  565. },
  566. itemCount: _priceList.length,
  567. padding: EdgeInsets.all(0),
  568. scrollDirection: Axis.horizontal,
  569. ),
  570. ),
  571. GestureDetector(
  572. onTap: (){
  573. showModalBottomSheet(
  574. context: context,
  575. builder: (context){
  576. return YSDatePicker(
  577. choose: (value){
  578. Map time = {'time':value.split(' ')[0],'price':_priceList[0]['price']};
  579. int index;
  580. for(int i=0;i<_priceList.length;i++){
  581. if(_priceList[i]['time']==time['time']){
  582. index = i;
  583. }
  584. }
  585. if(index!=null){
  586. _priceList.removeAt(index);
  587. }
  588. setState(() {
  589. _priceList.insert(0, time);
  590. });
  591. },
  592. );
  593. }
  594. );
  595. },
  596. behavior: HitTestBehavior.opaque,
  597. child: Container(
  598. height: hsp(120),
  599. width: hsp(140),
  600. alignment: Alignment.center,
  601. child: Text('更多\n日期',style: TextStyle(fontSize: zsp(26),color: Color(0xFF007EFF)),),
  602. ),
  603. )
  604. ],
  605. ),
  606. ),
  607. ],
  608. ),
  609. ),
  610. Container(
  611. padding: EdgeInsets.all(hsp(30)),
  612. margin: EdgeInsets.only(top: hsp(10)),
  613. color: Colors.white,
  614. child: Column(
  615. crossAxisAlignment: CrossAxisAlignment.start,
  616. children: [
  617. Row(
  618. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  619. children: [
  620. Text('成人票',style: TextStyle(fontSize: zsp(40),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
  621. Text('¥${_detailDict!=null?_detailDict[widget.isWhole==1?'discountPrice':'retailPrice']:''}',style: TextStyle(fontSize: zsp(40),color: Color(0xFFEB423B)),),
  622. ],
  623. ),
  624. Container(
  625. margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20)),
  626. child: Text('${_detailDict!=null?_detailDict['setoutInfo']['display']:''} - ${_detailDict!=null?_detailDict['arriveInfo']['display']:''}',
  627. style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
  628. ),
  629. GestureDetector(
  630. onTap: (){
  631. showModalBottomSheet(
  632. isScrollControlled: true,
  633. backgroundColor: Colors.transparent,
  634. context: context,
  635. builder: (context){
  636. return Container(
  637. height: MediaQuery.of(context).size.height*0.8,
  638. width: MediaQuery.of(context).size.width,
  639. decoration: BoxDecoration(
  640. color: Colors.white,
  641. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10)),
  642. ),
  643. child: Column(
  644. children: [
  645. Container(
  646. height: hsp(100),
  647. padding: EdgeInsets.only(left: 15,right: 15),
  648. child: Row(
  649. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  650. children: [
  651. Container(width: wsp(50),),
  652. Text('预订须知',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  653. GestureDetector(
  654. child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  655. onTap: (){
  656. Navigator.pop(context);
  657. },
  658. ),
  659. ],
  660. ),
  661. ),
  662. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),),
  663. Container(
  664. height: MediaQuery.of(context).size.height*0.8-hsp(100)-0.5,
  665. )
  666. ],
  667. ),
  668. );
  669. }
  670. );
  671. },
  672. child: RichText(
  673. text: TextSpan(
  674. text: '预订须知',
  675. style: TextStyle(fontSize: zsp(24),color: Color(0xFF027FFF)),
  676. children: [
  677. TextSpan(
  678. text: ' >',
  679. style: TextStyle(color: Color(0xFF000000))
  680. )
  681. ]
  682. ),
  683. ),
  684. )
  685. ],
  686. ),
  687. ),
  688. Container(
  689. child: Text('出行人',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  690. alignment: Alignment.centerLeft,
  691. height: hsp(80),
  692. padding: EdgeInsets.only(left: hsp(30)),
  693. margin: EdgeInsets.only(top: hsp(10)),
  694. width: MediaQuery.of(context).size.width,
  695. color: Colors.white,
  696. ),
  697. Container(
  698. padding: EdgeInsets.only(left: hsp(30),right: hsp(30),top: hsp(20)),
  699. margin: EdgeInsets.only(top: hsp(1)),
  700. color: Colors.white,
  701. width: MediaQuery.of(context).size.width,
  702. child: Column(
  703. crossAxisAlignment: CrossAxisAlignment.start,
  704. children: [
  705. Container(
  706. padding: EdgeInsets.only(left: hsp(30),right: hsp(30),bottom: hsp(20)),
  707. child: GestureDetector(
  708. onTap: (){
  709. Navigator.of(context).push(
  710. CupertinoPageRoute(
  711. builder: (context){
  712. return YSContact();
  713. }
  714. )
  715. ).then((value){
  716. if(value!=null){
  717. if(_customer.contains(value)){
  718. _customer.remove(value);
  719. }
  720. setState(() {
  721. _customer.insert(0, value);
  722. });
  723. }
  724. });
  725. },
  726. child: Container(
  727. height: hsp(60),
  728. width: hsp(160),
  729. decoration: BoxDecoration(
  730. color: Color(0xFF007EFF),
  731. borderRadius: BorderRadius.all(Radius.circular(5))
  732. ),
  733. child: Row(
  734. mainAxisSize: MainAxisSize.min,
  735. children: [
  736. Icon(Icons.add_circle,color: Colors.white,size: hsp(30),),
  737. Text(' 新增',style: TextStyle(fontSize: zsp(28),color: Colors.white),),
  738. ],
  739. ),
  740. alignment: Alignment.center,
  741. ),
  742. )
  743. ,
  744. ),
  745. ],
  746. ),
  747. ),
  748. Container(
  749. color: Colors.white,
  750. child: ListView.separated(
  751. itemBuilder: (context,index){
  752. return Container(
  753. color: Colors.white,
  754. padding: EdgeInsets.only(top: hsp(20),bottom: hsp(20),left: hsp(50),right: hsp(50)),
  755. child: Row(
  756. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  757. children: [
  758. GestureDetector(
  759. child: Icon(Icons.remove_circle,color: Colors.red,size: hsp(50),),
  760. onTap: (){
  761. setState(() {
  762. _customer.removeAt(index);
  763. });
  764. },
  765. ),
  766. Container(
  767. width: MediaQuery.of(context).size.width-hsp(180),
  768. child: Column(
  769. crossAxisAlignment: CrossAxisAlignment.start,
  770. children: [
  771. Text('${_customer[index]['username']} ${_customer[index]['phone']}',style: TextStyle(fontSize: zsp(34),color: Color(0xFF343434),fontWeight: FontWeight.bold),),
  772. Text('身份证 ${_customer[index]['cardid']}',style: TextStyle(fontSize: zsp(25),color: Color(0xFF666666)),)
  773. ],
  774. ),
  775. ),
  776. //Icon(Icons.mode_edit,color: Color(0xFF9A9A9A),size: hsp(50),),
  777. ],
  778. ),
  779. );
  780. },
  781. separatorBuilder: (context,index){
  782. return Divider(height: 0.5,thickness: 0.5,indent: hsp(100),);
  783. },
  784. itemCount: _customer.length,
  785. shrinkWrap: true,
  786. padding: EdgeInsets.all(0),
  787. physics: NeverScrollableScrollPhysics(),
  788. ),
  789. ),
  790. GestureDetector(
  791. onTap: (){
  792. setState(() {
  793. _isShow = !_isShow;
  794. });
  795. },
  796. behavior: HitTestBehavior.opaque,
  797. child: Container(
  798. padding: EdgeInsets.only(left: wsp(40),right: wsp(40),top: hsp(20),bottom: hsp(20)),
  799. margin: EdgeInsets.only(top: hsp(10)),
  800. color: Colors.white,
  801. child: Row(
  802. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  803. children: [
  804. Text('更多服务',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  805. Icon(Icons.keyboard_arrow_down,size: hsp(50),color: Color(0xFFC1C1C1),)
  806. ],
  807. )
  808. ),
  809. ),
  810. if(_isShow==true)Container(
  811. padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(20),bottom: hsp(10)),
  812. decoration: BoxDecoration(
  813. color: Color(0xFFFAFAFA),
  814. borderRadius: BorderRadius.only(bottomRight: Radius.circular(10),bottomLeft: Radius.circular(10))
  815. ),
  816. child: ListView.builder(
  817. shrinkWrap: true,
  818. itemBuilder: (context,index){
  819. return Container(
  820. padding: EdgeInsets.only(bottom: wsp(20)),
  821. child: Row(
  822. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  823. children: [
  824. Row(
  825. children: [
  826. Text('${_packList[index]['name']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF999999)),),
  827. Container(
  828. width: wsp(50),
  829. child: GestureDetector(
  830. child: Icon(Icons.error_outline,size: hsp(40),color: Color(0xFF999999)),
  831. ),
  832. ),
  833. Text('${_packList[index]['price']}元',style: TextStyle(fontSize: zsp(28),color: Colors.black),),
  834. ],
  835. ),
  836. GestureDetector(
  837. child: Container(
  838. height: hsp(60),
  839. width: hsp(100),
  840. child: Image.asset(_chooses.contains(_packList[index])==true?'lib/images/kaiguankai.png':'lib/images/kaiguanguan.png'),
  841. ),
  842. onTap: (){
  843. setState(() {
  844. if(_chooses.contains(_packList[index])==true){
  845. _chooses.remove(_packList[index]);
  846. }else{
  847. _chooses.add(_packList[index]);
  848. }
  849. });
  850. },
  851. )
  852. ],
  853. ),
  854. );
  855. },
  856. itemCount: _packList.length,
  857. padding: EdgeInsets.only(bottom: hsp(30)),
  858. physics: NeverScrollableScrollPhysics(),
  859. ),
  860. )
  861. ],
  862. ),
  863. ),
  864. ),
  865. ],
  866. ),
  867. ),
  868. Container(
  869. height: hsp(120),
  870. width: MediaQuery.of(context).size.width,
  871. color: Colors.white,
  872. padding: EdgeInsets.only(left: wsp(30),right: wsp(30)),
  873. child: Row(
  874. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  875. children: [
  876. RichText(
  877. text: TextSpan(
  878. text: '参考价(¥)',
  879. style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),
  880. children: [
  881. TextSpan(
  882. text: ' ${_getPrice()}',
  883. style: TextStyle(fontSize: zsp(40),color: Color(0xFFFF6600)),
  884. )
  885. ]
  886. ),
  887. ),
  888. GestureDetector(
  889. child: Row(
  890. children: [
  891. Text('明细',style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),),
  892. Icon(Icons.keyboard_arrow_up,size: hsp(30),color: Color(0xFF007EFF),),
  893. ],
  894. ),
  895. onTap: (){
  896. setState(() {
  897. _isDetail = !_isDetail;
  898. });
  899. },
  900. ),
  901. GestureDetector(
  902. onTap: (){
  903. _postPlaneOrderData();
  904. },
  905. child: Container(
  906. height: hsp(70),
  907. padding: EdgeInsets.only(left: wsp(50),right: wsp(50)),
  908. decoration: BoxDecoration(
  909. color: Color(0xFF007EFF),
  910. borderRadius: BorderRadius.all(Radius.circular(50))
  911. ),
  912. alignment: Alignment.center,
  913. child: Text('立即预约',style: TextStyle(fontSize: zsp(30),color: Colors.white,fontWeight: FontWeight.bold),),
  914. ),
  915. )
  916. ],
  917. ),
  918. )
  919. ],
  920. ),
  921. ),
  922. ),
  923. ),
  924. if(_isDetail==true)GestureDetector(
  925. onTap: (){
  926. setState(() {
  927. _isDetail = false;
  928. });
  929. },
  930. child: Container(
  931. height: MediaQuery.of(context).size.height-hsp(120),
  932. color: Colors.black45,
  933. child: Container(
  934. margin: EdgeInsets.only(top: MediaQuery.of(context).size.height-hsp(120)-hsp(370)),
  935. height: hsp(370),
  936. decoration: BoxDecoration(
  937. color: Colors.white,
  938. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  939. ),
  940. child: GestureDetector(
  941. onTap: (){},
  942. behavior: HitTestBehavior.opaque,
  943. child: Column(
  944. children: [
  945. Container(
  946. height: hsp(100),
  947. padding: EdgeInsets.only(left: 15,right: 15),
  948. child: Row(
  949. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  950. children: [
  951. GestureDetector(
  952. child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  953. onTap: (){
  954. setState(() {
  955. _isDetail = false;
  956. });
  957. },
  958. ),
  959. Text('明细',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  960. Container(width: wsp(50),),
  961. ],
  962. ),
  963. ),
  964. Container(
  965. height: hsp(100),
  966. color: Color(0xFFF7F8F9),
  967. padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(20),top: hsp(20)),
  968. child: Row(
  969. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  970. children: [
  971. Text('座位',style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),decoration: TextDecoration.none),),
  972. Text('¥ ${_priceList[_index]['price']}x ${_customer.length==0?1:_customer.length}人',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  973. ],
  974. ),
  975. ),
  976. Container(
  977. color: Color(0xFFF7F8F9),
  978. height: hsp(170),
  979. child: ListView.builder(
  980. padding: EdgeInsets.all(0),
  981. itemBuilder: (context,index){
  982. return Container(
  983. padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(10)),
  984. child: Row(
  985. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  986. children: [
  987. Text('${_chooses[index]['name']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
  988. Text('¥ ${_chooses[index]['price']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
  989. ],
  990. ),
  991. );
  992. },
  993. itemCount: _chooses.length,
  994. ),
  995. )
  996. ],
  997. ),
  998. ),
  999. ),
  1000. ),
  1001. )
  1002. ],
  1003. ),
  1004. );
  1005. }
  1006. _getBackImageData() async{
  1007. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/wallconfigure/get',parameter: {'type':8},isLoading: false,isToken: false);
  1008. if(dict!=null){
  1009. setState(() {
  1010. _msgDict = dict['data'];
  1011. });
  1012. }
  1013. }
  1014. _getContractPlaneDetailData() async{
  1015. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/AirTour/getTour',parameter: {'type':8,'id':widget.contractId},isLoading: false,isToken: false);
  1016. if(dict!=null){
  1017. setState(() {
  1018. _detailDict = dict['data'];
  1019. });
  1020. }
  1021. }
  1022. _getPackData() async{
  1023. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneservice/get',parameter: {'type':8},isLoading: true,isToken: false);
  1024. if(dict!=null){
  1025. _isOrder = true;
  1026. _packList = dict['data'];
  1027. _getPriceData();
  1028. }
  1029. }
  1030. _getPriceData() async{
  1031. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneorder/getDateAndTime',parameter: {'time':_timeStr,'type':8},isLoading: true,isToken: true);
  1032. if(dict!=null){
  1033. setState(() {
  1034. _priceList = dict['data'];
  1035. });
  1036. }
  1037. }
  1038. _getPrice(){
  1039. double price = double.parse('${_priceList[_index]['price']}')*(_customer.length==0?1:_customer.length);
  1040. _chooses.forEach((element) {
  1041. price+=double.parse('${element['price']}');
  1042. });
  1043. return price;
  1044. }
  1045. _postPlaneOrderData() async{
  1046. Map requestDict = {};
  1047. requestDict['flightTime'] = _timeStr;
  1048. requestDict['type'] = 8;
  1049. requestDict['airlaneId'] = _detailDict['dtPartner']['id'];
  1050. if(_customer.length>0)requestDict['personnelInfo'] = _customer;
  1051. requestDict['charterType'] = widget.isWhole==1?1:2;
  1052. requestDict['airportidSetout'] = _detailDict['setoutInfo']['id'];
  1053. requestDict['airportidArrive'] = _detailDict['arriveInfo']['id'];
  1054. requestDict['tourId'] = widget.contractId;
  1055. List array = [];
  1056. _chooses.forEach((element) {
  1057. array.add(element['id']);
  1058. });
  1059. requestDict['serviceIds'] = array.join(',');
  1060. Map dict = await ysRequestHttp(context,type: requestType.post,api: '/app/applets/airplaneorder/createOrder',parameter: requestDict,isLoading: true,isToken: true);
  1061. if(dict!=null){
  1062. Navigator.of(context).push(
  1063. CupertinoPageRoute(
  1064. builder: (context){
  1065. return YSPay(orderDict: dict['data'],type: payType.preferential,);
  1066. }
  1067. )
  1068. );
  1069. }
  1070. }
  1071. }