YSMarryPlane.dart 77 KB

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