YSMarryPlane.dart 77 KB

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