YSContractPlaneDetail.dart 75 KB

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