YSContractPlaneDetail.dart 75 KB

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