YSPay.dart 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:ysairplane/base/YSBase.dart';
  4. import 'package:ysairplane/code/YSCourseDetail.dart';
  5. import 'package:ysairplane/code/YSHome.dart';
  6. import 'package:ysairplane/code/YSMoney.dart';
  7. import 'package:ysairplane/code/YSSetPayPass.dart';
  8. import 'package:ysairplane/tools/YSNetWorking.dart';
  9. import 'package:ysairplane/tools/YSPayKeybord.dart';
  10. import 'package:ysairplane/tools/YSTools.dart';
  11. enum payType{
  12. doctor,
  13. help,
  14. goods,
  15. marry,
  16. sport,
  17. short,
  18. business,//商务
  19. preferential,//特惠
  20. sightseeing//游览
  21. }
  22. class YSPay extends StatefulWidget {
  23. final orderDict;
  24. final payType type;
  25. const YSPay({Key key, this.orderDict, this.type}) : super(key: key);
  26. @override
  27. _YSPayState createState() => _YSPayState();
  28. }
  29. class _YSPayState extends State<YSPay> {
  30. int _selected = 0;
  31. bool _isSucceed = false;
  32. @override
  33. Widget build(BuildContext context) {
  34. return YSBase(
  35. ystitle: '支付方式',
  36. yschild: _isSucceed==true?Column(
  37. children: [
  38. Container(
  39. color: Colors.white,
  40. width: MediaQuery.of(context).size.width,
  41. padding: EdgeInsets.only(left: wsp(30),right: wsp(30),top: hsp(60),bottom: hsp(60)),
  42. child: Column(
  43. children: [
  44. Image(
  45. image: AssetImage('lib/images/succeed.png'),
  46. height: hsp(130),
  47. width: wsp(130)
  48. ),
  49. Container(
  50. child: Text('支付成功',style: TextStyle(fontSize: zsp(40),color: Color(0xFF333333)),),
  51. margin: EdgeInsets.only(top: hsp(40),bottom: hsp(33)),
  52. ),
  53. Text('本次支付金额${widget.orderDict['price']}元',style: TextStyle(fontSize: zsp(28),color: Color(0xFF878787)),),
  54. ],
  55. ),
  56. ),
  57. GestureDetector(
  58. onTap: (){
  59. Navigator.of(context).pushAndRemoveUntil(
  60. CupertinoPageRoute(
  61. builder: (context){
  62. return YSHome();
  63. }
  64. ), (route) => false);
  65. },
  66. child: Container(
  67. height: hsp(94),
  68. width: MediaQuery.of(context).size.width-wsp(24)*2,
  69. alignment: Alignment.center,
  70. margin: EdgeInsets.only(top: hsp(58)),
  71. decoration: BoxDecoration(
  72. color: Color(0xFF0079FF),
  73. borderRadius: BorderRadius.all(Radius.circular(5))
  74. ),
  75. child: Text('完成',style: TextStyle(color: Colors.white,fontSize: zsp(34)),),
  76. ),
  77. ),
  78. GestureDetector(
  79. onTap: (){
  80. Navigator.of(context).push(
  81. CupertinoPageRoute(
  82. builder: (context){
  83. return YSCourseDetail(orderStr: widget.orderDict['orderSn'],);
  84. }
  85. ));
  86. },
  87. child: Container(
  88. height: hsp(94),
  89. width: MediaQuery.of(context).size.width-wsp(24)*2,
  90. alignment: Alignment.center,
  91. margin: EdgeInsets.only(top: hsp(58)),
  92. decoration: BoxDecoration(
  93. color: Color(0xFF0079FF),
  94. borderRadius: BorderRadius.all(Radius.circular(5))
  95. ),
  96. child: Text('查看订单',style: TextStyle(color: Colors.white,fontSize: zsp(34)),),
  97. ),
  98. )
  99. ],
  100. ):Column(
  101. children: [
  102. Container(
  103. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44-hsp(120),
  104. width: MediaQuery.of(context).size.width,
  105. color: Color(0xFFF1F2F3),
  106. child: SingleChildScrollView(
  107. child: Column(
  108. children: [
  109. Container(
  110. width: MediaQuery.of(context).size.width,
  111. padding: EdgeInsets.all(hsp(30)),
  112. color: Colors.white,
  113. child: Column(
  114. crossAxisAlignment: CrossAxisAlignment.start,
  115. children: [
  116. Container(
  117. child: Text('未支付',style: TextStyle(fontSize: zsp(32),color: Color(0xFFFF4747),fontWeight: FontWeight.bold),),
  118. margin: EdgeInsets.only(top: hsp(10),bottom: hsp(10)),
  119. ),
  120. Text('请在${_getMin('${widget.orderDict['expireHour']}')}分钟内完成支付, 否则该订单将被自动取消',style: TextStyle(fontSize: zsp(24),color: Color(0xFF9A9A9A)),)//${int.parse('${(widget.orderDict['expireHour'])*60}')}
  121. ],
  122. ),
  123. ),
  124. widget.type==payType.doctor?Column(
  125. children: [
  126. Container(
  127. padding: EdgeInsets.all(hsp(30)),
  128. margin: EdgeInsets.only(top: hsp(12)),
  129. width: MediaQuery.of(context).size.width,
  130. color: Colors.white,
  131. child: Row(
  132. crossAxisAlignment: CrossAxisAlignment.start,
  133. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  134. children: [
  135. Container(
  136. width: MediaQuery.of(context).size.width*0.6,
  137. child: ListView.builder(
  138. itemBuilder: (context,index){
  139. return Row(
  140. crossAxisAlignment: CrossAxisAlignment.start,
  141. children: [
  142. Column(
  143. children: [
  144. Container(
  145. height: hsp(30),
  146. width: hsp(30),
  147. decoration: BoxDecoration(
  148. color: Colors.white,
  149. borderRadius: BorderRadius.all(Radius.circular(50)),
  150. border: Border.all(color: index==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6))
  151. ),
  152. margin: EdgeInsets.only(top: hsp(7),bottom: hsp(7)),
  153. ),
  154. if(index<1)Container(
  155. height: hsp(30),
  156. width: hsp(5),
  157. color: Color(0xFFCACAD4),
  158. )
  159. ],
  160. ),
  161. Container(
  162. child: RichText(
  163. text: TextSpan(
  164. text: '${widget.orderDict[index==0?'citySetout':'cityArrive']}',
  165. style: TextStyle(color: Color(0xFF000000),fontSize: zsp(32),fontWeight: FontWeight.bold),
  166. children: [
  167. TextSpan(
  168. text: ' ${widget.orderDict[index==0?'airportSetout':'airportArrive']}',
  169. style: TextStyle(color: Color(0xFF999999),fontSize: zsp(20),fontWeight: FontWeight.normal),
  170. )
  171. ]
  172. ),
  173. ),
  174. margin: EdgeInsets.only(left: wsp(10),top: hsp(5)),
  175. )
  176. ],
  177. );
  178. },
  179. itemCount: 2,
  180. shrinkWrap: true,
  181. physics: NeverScrollableScrollPhysics(),
  182. ),
  183. ),
  184. Container(
  185. child: Text('¥ ${widget.orderDict['retailPrice']} x ${widget.orderDict['travelersNumber']}人',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
  186. padding: EdgeInsets.only(top: hsp(10)),
  187. )
  188. ],
  189. ),
  190. ),
  191. Container(
  192. padding: EdgeInsets.all(hsp(30)),
  193. margin: EdgeInsets.only(top: hsp(12)),
  194. width: MediaQuery.of(context).size.width,
  195. color: Colors.white,
  196. child: Column(
  197. crossAxisAlignment: CrossAxisAlignment.start,
  198. children: [
  199. RichText(
  200. text: TextSpan(
  201. text: '乘机人数 ',
  202. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  203. children: [
  204. TextSpan(
  205. text: '${widget.orderDict['travelersNumber']}人',
  206. style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
  207. )
  208. ]
  209. ),
  210. ),
  211. Container(height: 0.5,color: Color(0xFFE5E5E5),margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20),left: hsp(170)),),
  212. RichText(
  213. text: TextSpan(
  214. text: '出发时间 ',
  215. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  216. children: [
  217. TextSpan(
  218. text: '${widget.orderDict['flightTime']}',
  219. style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
  220. )
  221. ]
  222. ),
  223. ),
  224. ],
  225. ),
  226. ),
  227. ],
  228. ):widget.type==payType.help?Column(
  229. children: [
  230. Container(
  231. padding: EdgeInsets.all(hsp(30)),
  232. margin: EdgeInsets.only(top: hsp(12)),
  233. width: MediaQuery.of(context).size.width,
  234. color: Colors.white,
  235. child: Row(
  236. crossAxisAlignment: CrossAxisAlignment.start,
  237. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  238. children: [
  239. Container(
  240. width: MediaQuery.of(context).size.width*0.6,
  241. child: ListView.builder(
  242. itemBuilder: (context,index){
  243. return Row(
  244. crossAxisAlignment: CrossAxisAlignment.start,
  245. children: [
  246. Column(
  247. children: [
  248. Container(
  249. height: hsp(30),
  250. width: hsp(30),
  251. decoration: BoxDecoration(
  252. color: Colors.white,
  253. borderRadius: BorderRadius.all(Radius.circular(50)),
  254. border: Border.all(color: index==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6))
  255. ),
  256. margin: EdgeInsets.only(top: hsp(7),bottom: hsp(7)),
  257. ),
  258. if(index<1)Container(
  259. height: hsp(30),
  260. width: hsp(5),
  261. color: Color(0xFFCACAD4),
  262. )
  263. ],
  264. ),
  265. Container(
  266. child: RichText(
  267. text: TextSpan(
  268. text: '${widget.orderDict[index==0?'citySetout':'cityArrive']}',
  269. style: TextStyle(color: Color(0xFF000000),fontSize: zsp(32),fontWeight: FontWeight.bold),
  270. ),
  271. ),
  272. margin: EdgeInsets.only(left: wsp(10),top: hsp(5)),
  273. )
  274. ],
  275. );
  276. },
  277. itemCount: 2,
  278. shrinkWrap: true,
  279. physics: NeverScrollableScrollPhysics(),
  280. ),
  281. ),
  282. Container(
  283. child: Text('¥ ${widget.orderDict['retailPrice']} x ${widget.orderDict['travelersNumber']}人',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
  284. padding: EdgeInsets.only(top: hsp(10)),
  285. )
  286. ],
  287. ),
  288. ),
  289. Container(
  290. padding: EdgeInsets.all(hsp(30)),
  291. margin: EdgeInsets.only(top: hsp(12)),
  292. width: MediaQuery.of(context).size.width,
  293. color: Colors.white,
  294. child: Column(
  295. crossAxisAlignment: CrossAxisAlignment.start,
  296. children: [
  297. RichText(
  298. text: TextSpan(
  299. text: '人数 ',
  300. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  301. children: [
  302. TextSpan(
  303. text: '${widget.orderDict['travelersNumber']}人',
  304. style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
  305. )
  306. ]
  307. ),
  308. ),
  309. Container(height: 0.5,color: Color(0xFFE5E5E5),margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20),left: hsp(120)),),
  310. RichText(
  311. text: TextSpan(
  312. text: '电话 ',
  313. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  314. children: [
  315. TextSpan(
  316. text: '${widget.orderDict['phone']}',
  317. style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
  318. )
  319. ]
  320. ),
  321. ),
  322. Container(height: 0.5,color: Color(0xFFE5E5E5),margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20),left: hsp(120)),),
  323. RichText(
  324. text: TextSpan(
  325. text: '描述 ',
  326. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  327. children: [
  328. TextSpan(
  329. text: '${widget.orderDict['des']==null?'无':widget.orderDict['des']}',
  330. style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
  331. )
  332. ]
  333. ),
  334. ),
  335. ],
  336. ),
  337. ),
  338. ],
  339. ):widget.type==payType.goods?Column(
  340. children: [
  341. Container(
  342. padding: EdgeInsets.all(hsp(30)),
  343. margin: EdgeInsets.only(top: hsp(12)),
  344. width: MediaQuery.of(context).size.width,
  345. color: Colors.white,
  346. child: Row(
  347. crossAxisAlignment: CrossAxisAlignment.start,
  348. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  349. children: [
  350. Container(
  351. child: Text('费用明细',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  352. ),
  353. Container(
  354. width: (MediaQuery.of(context).size.width-hsp(280))*0.55,
  355. padding: EdgeInsets.only(right: wsp(30)),
  356. child: Column(
  357. crossAxisAlignment: CrossAxisAlignment.start,
  358. children: [
  359. Text(widget.orderDict['sourceType']==1?'整机':'拼机',style: TextStyle(fontSize: zsp(32),color: Colors.black,fontWeight: FontWeight.bold),),
  360. Container(
  361. margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20)),
  362. child: Row(
  363. children: [
  364. Text('${widget.orderDict['setoutInfo']['display']} ',style: TextStyle(fontSize: zsp(25),color: Color(0xFF9A9A9A))),
  365. Container(
  366. height: 1,
  367. width: wsp(20),
  368. color: Color(0xFFCCCCCC),
  369. ),
  370. Text(' ${widget.orderDict['arriveInfo']['display']}',style: TextStyle(fontSize: zsp(25),color: Color(0xFF9A9A9A)))
  371. ],
  372. ),
  373. ),
  374. RichText(
  375. text: TextSpan(
  376. text: '预订须知',
  377. style: TextStyle(fontSize: zsp(24),color: Color(0xFF348AE1)),
  378. children: [
  379. TextSpan(
  380. text: ' >',
  381. style: TextStyle(color: Color(0xFF000000))
  382. ),
  383. ]
  384. ),
  385. )
  386. ],
  387. ),
  388. ),
  389. Container(
  390. width: (MediaQuery.of(context).size.width-wsp(280))*0.4,
  391. alignment: Alignment.centerRight,
  392. child: Text('¥ ${widget.orderDict['price']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
  393. padding: EdgeInsets.only(top: hsp(10)),
  394. )
  395. ],
  396. ),
  397. ),
  398. Container(
  399. padding: EdgeInsets.all(hsp(30)),
  400. margin: EdgeInsets.only(top: hsp(12)),
  401. width: MediaQuery.of(context).size.width,
  402. color: Colors.white,
  403. child: Row(
  404. crossAxisAlignment: CrossAxisAlignment.start,
  405. children: [
  406. Container(
  407. width: wsp(150),
  408. alignment: Alignment.center,
  409. child: Text('乘机人 ',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  410. ),
  411. Container(
  412. width: MediaQuery.of(context).size.width-hsp(60)-wsp(150),
  413. child: ListView.separated(
  414. itemBuilder: (context,index){
  415. return Container(
  416. width: MediaQuery.of(context).size.width-hsp(60)-wsp(150),
  417. padding: EdgeInsets.only(bottom: index==1?0:hsp(20),top: index==0?0:hsp(20)),
  418. child: Column(
  419. crossAxisAlignment: CrossAxisAlignment.start,
  420. children: [
  421. Text('${widget.orderDict['dtAirplaneGoods']['contactPerson']}',style: TextStyle(fontSize: zsp(32),color: Color(0xFF343434),fontWeight: FontWeight.bold),),
  422. Text('联系方式 ${widget.orderDict['dtAirplaneGoods']['phone']}',style: TextStyle(fontSize: zsp(25),color: Color(0xFF666666),))
  423. ],
  424. ),
  425. );
  426. },
  427. separatorBuilder: (context,index){
  428. return Divider(color: Color(0xFFE5E5E5),height: 0.5,thickness: 0.5,);
  429. },
  430. itemCount: 1,
  431. padding: EdgeInsets.all(0),
  432. shrinkWrap: true,
  433. ),
  434. ),
  435. ],
  436. ),
  437. ),
  438. ],
  439. ):widget.type==payType.marry||widget.type==payType.sport||widget.type==payType.sightseeing?Column(
  440. children: [
  441. Container(
  442. padding: EdgeInsets.all(hsp(30)),
  443. margin: EdgeInsets.only(top: hsp(12)),
  444. width: MediaQuery.of(context).size.width,
  445. color: Colors.white,
  446. child: Row(
  447. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  448. children: [
  449. Text('${widget.orderDict['orderName']}',style: TextStyle(fontSize: zsp(40),color: Color(0xFF000000)),),
  450. Text('¥${widget.orderDict['price']}',style: TextStyle(fontSize: zsp(40),color: Color(0xFFEB423B),fontWeight: FontWeight.bold),)
  451. ],
  452. ),
  453. ),
  454. Container(
  455. padding: EdgeInsets.all(hsp(30)),
  456. margin: EdgeInsets.only(top: hsp(2)),
  457. width: MediaQuery.of(context).size.width,
  458. color: Colors.white,
  459. child: RichText(
  460. text: TextSpan(
  461. text: '联系方式 ',
  462. style: TextStyle(color: Colors.black,fontWeight: FontWeight.bold,fontSize: zsp(30)),
  463. children: [
  464. TextSpan(
  465. text: '${widget.orderDict['phone']}',
  466. style: TextStyle(fontWeight: FontWeight.normal,color: Color(0xFF666666))
  467. )
  468. ]
  469. ),
  470. ),
  471. ),
  472. if(widget.type==payType.marry)Container(
  473. padding: EdgeInsets.only(top: hsp(30),left: hsp(30),right: hsp(30),bottom: hsp(10)),
  474. margin: EdgeInsets.only(top: hsp(2)),
  475. width: MediaQuery.of(context).size.width,
  476. color: Colors.white,
  477. child: Text('贺卡备注',style: TextStyle(color: Colors.black,fontWeight: FontWeight.bold,fontSize: zsp(30)),),
  478. ),
  479. if(widget.type==payType.marry)Container(
  480. padding: EdgeInsets.only(left: hsp(40),right: hsp(30),bottom: hsp(30)),
  481. width: MediaQuery.of(context).size.width,
  482. color: Colors.white,
  483. child: Text(widget.orderDict['des']==null?'':'${widget.orderDict['des']}',style: TextStyle(color: Color(0xFF666666),fontWeight: FontWeight.normal,fontSize: zsp(30)),),
  484. )
  485. ],
  486. ):widget.type==payType.short?Column(
  487. children: [
  488. Container(
  489. padding: EdgeInsets.all(hsp(30)),
  490. margin: EdgeInsets.only(top: hsp(12)),
  491. width: MediaQuery.of(context).size.width,
  492. color: Colors.white,
  493. child: Row(
  494. crossAxisAlignment: CrossAxisAlignment.start,
  495. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  496. children: [
  497. Container(
  498. width: MediaQuery.of(context).size.width*0.6,
  499. child: ListView.builder(
  500. itemBuilder: (context,index){
  501. return Row(
  502. crossAxisAlignment: CrossAxisAlignment.start,
  503. children: [
  504. Column(
  505. children: [
  506. Container(
  507. height: hsp(30),
  508. width: hsp(30),
  509. decoration: BoxDecoration(
  510. color: Colors.white,
  511. borderRadius: BorderRadius.all(Radius.circular(50)),
  512. border: Border.all(color: index==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6))
  513. ),
  514. margin: EdgeInsets.only(top: hsp(7),bottom: hsp(7)),
  515. ),
  516. if(index<1)Container(
  517. height: hsp(30),
  518. width: hsp(5),
  519. color: Color(0xFFCACAD4),
  520. )
  521. ],
  522. ),
  523. Container(
  524. child: RichText(
  525. text: TextSpan(
  526. text: '${widget.orderDict[index==0?'setoutInfo':'arriveInfo']['display']}',
  527. style: TextStyle(color: Color(0xFF000000),fontSize: zsp(32),fontWeight: FontWeight.bold),
  528. children: [
  529. TextSpan(
  530. text: ' ${widget.orderDict[index==0?'setoutInfo':'arriveInfo']['airplanename']}',
  531. style: TextStyle(color: Color(0xFF999999),fontSize: zsp(20),fontWeight: FontWeight.normal),
  532. )
  533. ]
  534. ),
  535. ),
  536. margin: EdgeInsets.only(left: wsp(10),top: hsp(5)),
  537. )
  538. ],
  539. );
  540. },
  541. itemCount: 2,
  542. shrinkWrap: true,
  543. physics: NeverScrollableScrollPhysics(),
  544. ),
  545. ),
  546. Container(
  547. child: Text('¥ ${widget.orderDict['retailPrice']} x ${widget.orderDict['travelersNumber']}人',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
  548. padding: EdgeInsets.only(top: hsp(10)),
  549. )
  550. ],
  551. ),
  552. )
  553. ],
  554. ):widget.type==payType.business?Container(
  555. margin: EdgeInsets.only(top: hsp(10)),
  556. child: Column(
  557. children: [
  558. ListView.separated(
  559. shrinkWrap: true,
  560. itemBuilder: (context,index){
  561. return Container(
  562. color: Colors.white,
  563. child: Column(
  564. children: [
  565. widget.orderDict['charterType']==1?Container(
  566. padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(20),bottom: hsp(20)),
  567. child: Column(
  568. children: [
  569. Row(
  570. children: [
  571. Container(
  572. child: Text('${widget.orderDict['itineraries'][index]['setOutInfo']['display']}',
  573. style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
  574. width: (MediaQuery.of(context).size.width-hsp(210))/2,
  575. ),
  576. Image(height: hsp(60),width: hsp(60),image: AssetImage('lib/images/plane.png'),),
  577. Container(
  578. child: Text('${widget.orderDict['itineraries'][index]['arriveInfo']['display']}',
  579. style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
  580. width: (MediaQuery.of(context).size.width-hsp(210))/2,
  581. alignment: Alignment.centerRight,
  582. ),
  583. ],
  584. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  585. ),
  586. Row(
  587. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  588. children: [
  589. Container(
  590. child: Text('${widget.orderDict['itineraries'][index]['setOutInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  591. width: (MediaQuery.of(context).size.width-hsp(300))/2,
  592. ),
  593. Text('${widget.orderDict['itineraries'][index]['time']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  594. Container(
  595. child: Text('${widget.orderDict['itineraries'][index]['arriveInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
  596. width: (MediaQuery.of(context).size.width-hsp(300))/2,
  597. alignment: Alignment.centerRight,
  598. ),
  599. ],
  600. )
  601. ],
  602. ),
  603. ):Container(
  604. width: MediaQuery.of(context).size.width-hsp(60),
  605. child: ListView.builder(
  606. itemBuilder: (context,indexSub){
  607. return Row(
  608. crossAxisAlignment: CrossAxisAlignment.start,
  609. children: [
  610. Column(
  611. children: [
  612. Container(
  613. height: hsp(30),
  614. width: hsp(30),
  615. decoration: BoxDecoration(
  616. color: Colors.white,
  617. borderRadius: BorderRadius.all(Radius.circular(50)),
  618. border: Border.all(color: indexSub%2==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6))
  619. ),
  620. margin: EdgeInsets.only(top: hsp(10),bottom: hsp(7)),
  621. ),
  622. if(indexSub<1)Container(
  623. height: hsp(30),
  624. width: hsp(5),
  625. color: Color(0xFFCACAD4),
  626. )
  627. ],
  628. ),
  629. Container(
  630. child: RichText(
  631. text: TextSpan(
  632. text: '${widget.orderDict['itineraries'][index][indexSub==0?'setout':'arrive']}',
  633. style: TextStyle(color: Color(0xFF000000),fontSize: hsp(30),fontWeight: FontWeight.bold),
  634. children: [
  635. ]
  636. ),
  637. ),
  638. margin: EdgeInsets.only(left: wsp(10),top: hsp(5)),
  639. )
  640. ],
  641. );
  642. },
  643. itemCount: 2,
  644. shrinkWrap: true,
  645. physics: NeverScrollableScrollPhysics(),
  646. padding: EdgeInsets.only(top: hsp(10),bottom: hsp(10)),
  647. ),
  648. ),
  649. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE9E9E9),indent: wsp(32),endIndent: wsp(32),),
  650. Container(
  651. padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(20),bottom: hsp(20)),
  652. child: Row(
  653. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  654. children: [
  655. Column(
  656. children: [
  657. Text('出发',style: TextStyle(fontSize: zsp(24),color: Color(0xFF666666)),),
  658. RichText(
  659. text: TextSpan(
  660. text: _getDateStr('${widget.orderDict['itineraries'][index]['timeSetout']}'),style: TextStyle(fontSize: zsp(28),fontWeight: FontWeight.bold,color: Colors.black),
  661. children: [
  662. // TextSpan(
  663. // text: '今天',
  664. // style: TextStyle(fontSize: zsp(24),fontWeight: FontWeight.normal),
  665. // )
  666. ]
  667. ),
  668. )],
  669. crossAxisAlignment: CrossAxisAlignment.start,
  670. ),
  671. Column(
  672. children: [
  673. Text('到达',style: TextStyle(fontSize: zsp(24),color: Color(0xFF666666)),),
  674. RichText(
  675. text: TextSpan(
  676. text: _getDateStr('${widget.orderDict['itineraries'][index]['timeArrive']}'),style: TextStyle(fontSize: zsp(28),fontWeight: FontWeight.bold,color: Colors.black),
  677. children: [
  678. // TextSpan(
  679. // text: '今天',
  680. // style: TextStyle(fontSize: zsp(24),fontWeight: FontWeight.normal),
  681. // )
  682. ]
  683. ),
  684. )
  685. ],
  686. crossAxisAlignment: CrossAxisAlignment.start,
  687. ),
  688. // Icon(Icons.keyboard_arrow_right,size: hsp(50),color: Color(0xFFC1C1C1),)
  689. ],
  690. ),
  691. ),
  692. ],
  693. ),
  694. );
  695. },
  696. separatorBuilder: (context,index){
  697. return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE9E9E9),indent: wsp(32),endIndent: wsp(32),);
  698. },
  699. itemCount: (widget.orderDict['itineraries']).length,
  700. padding: EdgeInsets.all(0),
  701. physics: NeverScrollableScrollPhysics(),
  702. ),
  703. ],
  704. ),
  705. ):Column(
  706. children: [
  707. Container(
  708. padding: EdgeInsets.all(hsp(30)),
  709. margin: EdgeInsets.only(top: hsp(12)),
  710. width: MediaQuery.of(context).size.width,
  711. color: Colors.white,
  712. child: Row(
  713. crossAxisAlignment: CrossAxisAlignment.start,
  714. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  715. children: [
  716. Container(
  717. width: (MediaQuery.of(context).size.width-hsp(280))*0.65,
  718. padding: EdgeInsets.only(right: wsp(30)),
  719. child: Column(
  720. crossAxisAlignment: CrossAxisAlignment.start,
  721. children: [
  722. Row(
  723. children: [
  724. Text('${widget.orderDict['setoutInfo']['display']}',style: TextStyle(fontSize: zsp(40),color: Colors.black,fontWeight: FontWeight.bold),),
  725. Container(
  726. height: 2,
  727. width: wsp(40),
  728. color: Color(0xFFCCCCCC),
  729. ),
  730. Text('${widget.orderDict['arriveInfo']['display']}',style: TextStyle(fontSize: zsp(40),color: Colors.black,fontWeight: FontWeight.bold),)
  731. ],
  732. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  733. ),
  734. Container(
  735. child: Row(
  736. children: [
  737. Text('${widget.orderDict['setoutInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF9A9A9A)),),
  738. Text('${widget.orderDict['arriveInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF9A9A9A)),),
  739. ],
  740. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  741. ),
  742. margin: EdgeInsets.only(top: hsp(10),bottom: hsp(20)),
  743. ),
  744. // Row(
  745. // children: [
  746. // Container(
  747. // color: Color(0xFF000000),
  748. // height: hsp(35),
  749. // child: Row(
  750. // children: [
  751. // Image(image: AssetImage('lib/images/vip2.png'),height: hsp(15),width: wsp(16),),
  752. // Text(' G450',style: TextStyle(fontSize: zsp(18),color: Color(0xFFF9DEAC)),)
  753. // ],
  754. // ),
  755. // padding: EdgeInsets.only(left: wsp(5),right: wsp(5)),
  756. // ),
  757. // Container(
  758. // padding: EdgeInsets.only(left: wsp(5),right: wsp(5)),
  759. // height: hsp(35),
  760. // child: Text('座位30',style: TextStyle(fontSize: zsp(20),color: Color(0xFF565656)),),
  761. // decoration: BoxDecoration(
  762. // border: Border.all(color: Color(0xFF565656),width: 0.5)
  763. // ),
  764. // alignment: Alignment.center,
  765. // ),
  766. // ],
  767. // ),
  768. ],
  769. ),
  770. ),
  771. Container(
  772. width: (MediaQuery.of(context).size.width-wsp(280))*0.35,
  773. child: Text('¥ ${widget.orderDict['price']}x ${widget.orderDict['travelersNumber']}人',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
  774. padding: EdgeInsets.only(top: hsp(10)),
  775. )
  776. ],
  777. ),
  778. ),
  779. Container(
  780. padding: EdgeInsets.all(hsp(30)),
  781. margin: EdgeInsets.only(top: hsp(12)),
  782. width: MediaQuery.of(context).size.width,
  783. color: Colors.white,
  784. child: Row(
  785. crossAxisAlignment: CrossAxisAlignment.start,
  786. children: [
  787. Container(
  788. width: wsp(150),
  789. alignment: Alignment.center,
  790. child: Text('乘机人',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  791. ),
  792. Container(
  793. width: MediaQuery.of(context).size.width-hsp(60)-wsp(150),
  794. child: ListView.separated(
  795. itemBuilder: (context,index){
  796. return Container(
  797. width: MediaQuery.of(context).size.width-hsp(60)-wsp(150),
  798. padding: EdgeInsets.only(bottom: index==1?0:hsp(20),top: index==0?0:hsp(20)),
  799. child: Column(
  800. crossAxisAlignment: CrossAxisAlignment.start,
  801. children: [
  802. Text('${widget.orderDict['personnelInfo'][index]['username']} ${widget.orderDict['personnelInfo'][index]['phone']}',style: TextStyle(fontSize: zsp(32),color: Color(0xFF343434),fontWeight: FontWeight.bold),),
  803. Text('身份证 ${widget.orderDict['personnelInfo'][index]['cardid']}',style: TextStyle(fontSize: zsp(25),color: Color(0xFF666666),))
  804. ],
  805. ),
  806. );
  807. },
  808. separatorBuilder: (context,index){
  809. return Divider(color: Color(0xFFE5E5E5),height: 0.5,thickness: 0.5,);
  810. },
  811. itemCount: widget.orderDict['personnelInfo']!=null?widget.orderDict['personnelInfo'].length:0,
  812. padding: EdgeInsets.all(0),
  813. shrinkWrap: true,
  814. ),
  815. ),
  816. ],
  817. ),
  818. ),
  819. ],
  820. ),
  821. Container(
  822. padding: EdgeInsets.all(hsp(30)),
  823. margin: EdgeInsets.only(top: hsp(12)),
  824. width: MediaQuery.of(context).size.width,
  825. color: Colors.white,
  826. child: RichText(
  827. text: TextSpan(
  828. text: '应付总额:',
  829. style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),
  830. children: [
  831. TextSpan(
  832. text: '¥${widget.orderDict['price']}',
  833. style: TextStyle(color: Color(0xFF007EFF),fontWeight: FontWeight.bold),
  834. )
  835. ]
  836. ),
  837. ),
  838. ),
  839. Container(
  840. padding: EdgeInsets.all(hsp(30)),
  841. margin: EdgeInsets.only(top: hsp(12)),
  842. width: MediaQuery.of(context).size.width,
  843. color: Colors.white,
  844. child: Text('订单编号:${widget.orderDict['orderSn']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
  845. ),
  846. Container(
  847. padding: EdgeInsets.all(hsp(30)),
  848. margin: EdgeInsets.only(top: hsp(12)),
  849. width: MediaQuery.of(context).size.width,
  850. color: Colors.white,
  851. child: Text('支付方式',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  852. ),
  853. ListView.separated(
  854. itemBuilder: (context,index){
  855. return GestureDetector(
  856. onTap: (){
  857. setState(() {
  858. _selected = index;
  859. });
  860. },
  861. behavior: HitTestBehavior.opaque,
  862. child: Container(
  863. height: hsp(92),
  864. color: Colors.white,
  865. padding: EdgeInsets.only(left: hsp(30),right: hsp(30)),
  866. child: Row(
  867. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  868. children: [
  869. Row(
  870. children: [
  871. Container(
  872. height: hsp(50),
  873. width: hsp(50),
  874. margin: EdgeInsets.only(right: hsp(25)),
  875. child: Image.asset(index==0?'lib/images/wexinLogo.png':index==1?'lib/images/aliLogo.png':'lib/images/wexinLogo.png'),
  876. ),
  877. Text(index==0?'余额':index==1?'微信支付':'支付宝',style: TextStyle(fontSize: zsp(30),color: Color(0xFF343434),)),
  878. ],
  879. ),
  880. Icon(Icons.check,color:index==_selected?Color(0xFF007EFF):Colors.transparent,size: hsp(40),),
  881. ],
  882. ),
  883. ),
  884. );
  885. },
  886. separatorBuilder: (context,index){
  887. return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFF1F2F3),);
  888. },
  889. itemCount: 3,
  890. padding: EdgeInsets.all(0),
  891. physics: NeverScrollableScrollPhysics(),
  892. shrinkWrap: true,
  893. )
  894. ],
  895. ),
  896. ),
  897. ),
  898. Container(
  899. height: hsp(120),
  900. width: MediaQuery.of(context).size.width,
  901. color: Colors.white,
  902. padding: EdgeInsets.only(left: wsp(60),right: wsp(60)),
  903. child: Row(
  904. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  905. children: [
  906. GestureDetector(
  907. onTap: (){
  908. showDialog(
  909. context: context,
  910. builder: (context) {
  911. return AlertDialog(
  912. actionsPadding: EdgeInsets.all(0),
  913. title: Text('提示',style: TextStyle(fontWeight: FontWeight.bold,fontSize: zsp(36)),),
  914. content: Text('确认取消订单吗?',style: TextStyle(fontWeight: FontWeight.bold,fontSize: zsp(30))),
  915. actions: <Widget>[
  916. FlatButton(child: Text('取消',style: TextStyle(fontWeight: FontWeight.bold,fontSize: zsp(30))),onPressed: (){
  917. Navigator.pop(context);
  918. },),
  919. FlatButton(child: Text('确认',style: TextStyle(fontWeight: FontWeight.bold,fontSize: zsp(30))),onPressed: (){
  920. Navigator.pop(context);
  921. _postCancelOrderData();
  922. },),
  923. ],
  924. );
  925. }
  926. );
  927. },
  928. child: Container(
  929. height: hsp(88),
  930. width: wsp(300),
  931. decoration: BoxDecoration(
  932. borderRadius: BorderRadius.all(Radius.circular(50)),
  933. border: Border.all(color: Color(0xFFD9D9D9),width: 1)
  934. ),
  935. alignment: Alignment.center,
  936. child: Text('取消订单',style: TextStyle(fontSize: zsp(34),color: Color(0xFF343434)),),
  937. ),
  938. ),
  939. GestureDetector(
  940. onTap: (){
  941. showDialog(context: context,builder: (context){
  942. return AlertDialog(
  943. contentPadding: EdgeInsets.all(0),
  944. actionsPadding: EdgeInsets.all(0),
  945. buttonPadding: EdgeInsets.all(0),
  946. insetPadding: EdgeInsets.all(0),
  947. titlePadding: EdgeInsets.all(0),
  948. backgroundColor: Colors.transparent,
  949. content: ysPayKeybord(context,(value){
  950. _postPayData(value);
  951. },widget.type==payType.marry||widget.type==payType.sport||widget.type==payType.sightseeing?'${widget.orderDict['orderName']}':(widget.type==payType.doctor||
  952. widget.type==payType.help)?'${widget.orderDict['citySetout']}到${widget.orderDict['cityArrive']}':widget.type==payType.business?'商旅包机':'${widget.orderDict['setoutInfo']['display']}到'
  953. '${widget.orderDict['arriveInfo']['display']}',
  954. '${widget.orderDict['price']}')
  955. );
  956. });
  957. },
  958. child: Container(
  959. height: hsp(88),
  960. width: wsp(300),
  961. decoration: BoxDecoration(
  962. borderRadius: BorderRadius.all(Radius.circular(50)),
  963. color: Color(0xFF007EFF)
  964. ),
  965. alignment: Alignment.center,
  966. child: Text('去付款',style: TextStyle(fontSize: zsp(34),color: Colors.white),),
  967. ),
  968. )
  969. ],
  970. ),
  971. )
  972. ],
  973. ),
  974. );
  975. }
  976. _getMin(String hours){
  977. double time = double.parse(hours);
  978. return '${(time*60)~/1}';
  979. }
  980. _postCancelOrderData() async{
  981. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneorder/cancelOrder',parameter: {'orderSn':widget.orderDict['orderSn']},isLoading: false,isToken: true);
  982. if(dict!=null){
  983. Navigator.pop(context);
  984. }
  985. }
  986. _postPayData(String pass) async{
  987. var dict = await ysRequestHttpEncrypt(context,type: requestType.post,api: '/app/applets/balance/balancePay',
  988. parameter: {'orderSn':widget.orderDict['orderSn'],'price':widget.orderDict['price'],'password': pass},isLoading: true,isToken: true);
  989. if(dict!=null){
  990. if(dict==''){
  991. setState(() {
  992. _isSucceed = true;
  993. });
  994. }else if(dict['code']==804){
  995. _showAlertView(1);
  996. }else if(dict['code']==801){
  997. _showAlertView(2);
  998. }
  999. }
  1000. }
  1001. _showAlertView (int type) async{
  1002. showCupertinoDialog(
  1003. context: context,
  1004. builder: (context) {
  1005. return CupertinoAlertDialog(
  1006. title: Text('提示\n'),
  1007. content: Text(type==1?'未设置支付密码':'余额不足请充值'),
  1008. actions: <Widget>[
  1009. CupertinoDialogAction(child: Text('取消'),onPressed: (){Navigator.pop(context);},),
  1010. CupertinoDialogAction(child: Text(type==1?'去设置':'去充值'),onPressed: (){
  1011. Navigator.pop(context);
  1012. Navigator.of(context).push(
  1013. CupertinoPageRoute(
  1014. builder: (context){
  1015. return type==1?YSSetPayPass():YSMoney();
  1016. }
  1017. )
  1018. );
  1019. },),
  1020. ],
  1021. );
  1022. }
  1023. );
  1024. }
  1025. _getDateStr(String date){
  1026. return date.substring(0,date.length-3);
  1027. }
  1028. }