YSMarryPlane.dart 78 KB

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