YSContractPlaneDetail.dart 75 KB

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