YSOrderTwo.dart 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:ysairplane2/base/YSBase.dart';
  4. import 'package:ysairplane2/tools/YSTools.dart';
  5. class YSOrderTwo extends StatefulWidget {
  6. final confirmDict,orderDict;
  7. const YSOrderTwo({Key key, this.confirmDict, this.orderDict}) : super(key: key);
  8. @override
  9. _YSOrderTwoState createState() => _YSOrderTwoState();
  10. }
  11. class _YSOrderTwoState extends State<YSOrderTwo> {
  12. bool _isShow = false;
  13. bool _isDetail = false;
  14. List _chooses = [{'title':'接机鲜花','isTips':0,'amount':'188','isChoose':0},{'title':'接机鲜花','isTips':1,'amount':'188','isChoose':0},{'title':'接机鲜花','isTips':1,'amount':'188','isChoose':1},
  15. {'title':'接机鲜花','isTips':0,'amount':'188','isChoose':1},{'title':'接机鲜花','isTips':1,'amount':'188','isChoose':0}];
  16. @override
  17. Widget build(BuildContext context) {
  18. return Scaffold(
  19. body: YSBase(
  20. ystitle: '订单确认',
  21. yschild: Column(
  22. children: [
  23. Stack(
  24. children: [
  25. Container(
  26. height: MediaQuery.of(context).size.height-hsp(120)-MediaQuery.of(context).padding.top-44,
  27. width: MediaQuery.of(context).size.width,
  28. color: Color(0xFFF1F2F4),
  29. child: SingleChildScrollView(
  30. child: Stack(
  31. children: [
  32. Container(
  33. height: MediaQuery.of(context).padding.top+hsp(800),
  34. width: MediaQuery.of(context).size.width,
  35. decoration: BoxDecoration(
  36. gradient: const LinearGradient(colors: [Color(0xFF007EFF),Color(0x00007EFF)],begin: Alignment.topCenter,end: Alignment.bottomCenter),
  37. ),
  38. ),
  39. Column(
  40. children: [
  41. Container(
  42. margin: EdgeInsets.all(hsp(30)),
  43. decoration: BoxDecoration(
  44. color: Colors.white,
  45. borderRadius: BorderRadius.all(Radius.circular(5))
  46. ),
  47. child: Column(
  48. crossAxisAlignment: CrossAxisAlignment.start,
  49. children: [
  50. Container(
  51. child: Text('出发时间',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  52. padding: EdgeInsets.only(left: wsp(40),right: wsp(40)),
  53. height: hsp(80),
  54. width: MediaQuery.of(context).size.width,
  55. alignment: Alignment.centerLeft,
  56. decoration: BoxDecoration(
  57. color: Colors.white,
  58. borderRadius: BorderRadius.only(topRight: Radius.circular(5),topLeft: Radius.circular(5))
  59. ),
  60. ),
  61. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),),
  62. Container(
  63. child: Text('${widget.confirmDict['00']}',style: TextStyle(fontSize: zsp(34),color: Color(0xFF343434),fontWeight: FontWeight.bold),),
  64. padding: EdgeInsets.only(left: wsp(40),right: wsp(40)),
  65. height: hsp(100),
  66. width: MediaQuery.of(context).size.width,
  67. alignment: Alignment.centerLeft,
  68. decoration: BoxDecoration(
  69. color: Colors.white,
  70. borderRadius: BorderRadius.only(bottomRight: Radius.circular(5),bottomLeft: Radius.circular(5))
  71. ),
  72. )
  73. ],
  74. ),
  75. ),
  76. Container(
  77. margin: EdgeInsets.only(left: hsp(30),right: hsp(30),bottom: hsp(30)),
  78. decoration: BoxDecoration(
  79. color: Colors.white,
  80. borderRadius: BorderRadius.all(Radius.circular(5))
  81. ),
  82. child: Column(
  83. children: [
  84. ListView.builder(
  85. itemBuilder: (context,index){
  86. return Row(
  87. crossAxisAlignment: CrossAxisAlignment.start,
  88. children: [
  89. Column(
  90. children: [
  91. Container(
  92. height: hsp(30),
  93. width: hsp(30),
  94. decoration: BoxDecoration(
  95. color: Colors.white,
  96. borderRadius: BorderRadius.all(Radius.circular(50)),
  97. border: Border.all(color: index==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6))
  98. ),
  99. margin: EdgeInsets.only(top: hsp(7),bottom: hsp(7)),
  100. ),
  101. if(index<1)Container(
  102. height: hsp(30),
  103. width: hsp(5),
  104. color: Color(0xFFCACAD4),
  105. )
  106. ],
  107. ),
  108. Container(
  109. child: Text(index==0?'西安市长安区樱花广场一路执行樱花园4号楼':'西安市新城区208号',style: TextStyle(fontSize: zsp(28),color: Color(0xFF000000)),),
  110. margin: EdgeInsets.only(left: wsp(10)),
  111. )
  112. ],
  113. );
  114. },
  115. itemCount: 2,
  116. padding: EdgeInsets.only(left: wsp(40),right: wsp(40),top: hsp(30),bottom: hsp(30)),
  117. shrinkWrap: true,
  118. physics: NeverScrollableScrollPhysics(),
  119. ),
  120. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),),
  121. Container(
  122. child: Row(
  123. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  124. children: [
  125. RichText(
  126. text: TextSpan(
  127. text: '出行人数',
  128. style: TextStyle(fontSize: zsp(34),color: Color(0xFF343434),fontWeight: FontWeight.bold),
  129. children: [
  130. TextSpan(
  131. text: ' 10 ',
  132. style: TextStyle(color: Color(0xFF348AE1))
  133. ),
  134. TextSpan(
  135. text: '人'
  136. )
  137. ]
  138. ),
  139. ),
  140. RichText(
  141. text: TextSpan(
  142. text: '预订须知',
  143. style: TextStyle(fontSize: zsp(28),color: Color(0xFF348AE1)),
  144. children: [
  145. TextSpan(
  146. text: ' >',
  147. style: TextStyle(color: Color(0xFF000000))
  148. ),
  149. ]
  150. ),
  151. ),
  152. ],
  153. ),
  154. padding: EdgeInsets.only(left: wsp(40),right: wsp(40)),
  155. height: hsp(100),
  156. width: MediaQuery.of(context).size.width,
  157. alignment: Alignment.centerLeft,
  158. decoration: BoxDecoration(
  159. color: Colors.white,
  160. borderRadius: BorderRadius.only(bottomRight: Radius.circular(5),bottomLeft: Radius.circular(5))
  161. ),
  162. )
  163. ],
  164. ),
  165. ),
  166. GestureDetector(
  167. onTap: (){
  168. setState(() {
  169. _isShow = !_isShow;
  170. });
  171. },
  172. behavior: HitTestBehavior.opaque,
  173. child: Container(
  174. padding: EdgeInsets.all(wsp(32)),
  175. margin: EdgeInsets.only(left: hsp(30),right: hsp(30)),
  176. decoration: BoxDecoration(
  177. color: Colors.white,
  178. borderRadius: _isShow==true?BorderRadius.only(topRight: Radius.circular(5),topLeft: Radius.circular(5)):BorderRadius.all(Radius.circular(5))
  179. ),
  180. child: Row(
  181. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  182. children: [
  183. Text('更多服务',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
  184. Icon(Icons.keyboard_arrow_down,size: hsp(50),color: Color(0xFFC1C1C1),)
  185. ],
  186. )
  187. ),
  188. ),
  189. if(_isShow==true)Container(
  190. padding: EdgeInsets.all(wsp(32)),
  191. margin: EdgeInsets.only(left: hsp(30),right: hsp(30),bottom: hsp(30)),
  192. decoration: BoxDecoration(
  193. color: Color(0xFFFAFAFA),
  194. borderRadius: BorderRadius.only(bottomRight: Radius.circular(10),bottomLeft: Radius.circular(10))
  195. ),
  196. child: ListView.builder(
  197. shrinkWrap: true,
  198. itemBuilder: (context,index){
  199. return Container(
  200. padding: EdgeInsets.only(left: wsp(30),right: wsp(30),bottom: wsp(30)),
  201. child: Row(
  202. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  203. children: [
  204. Row(
  205. children: [
  206. Text('${_chooses[index]['title']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF999999)),),
  207. Container(
  208. width: wsp(50),
  209. child: GestureDetector(
  210. child: Icon(Icons.error_outline,size: hsp(40),color: _chooses[index]['isTips']==1?Color(0xFF999999):Colors.transparent),
  211. ),
  212. ),
  213. Text('${_chooses[index]['amount']}元',style: TextStyle(fontSize: zsp(28),color: Colors.black),),
  214. ],
  215. ),
  216. GestureDetector(
  217. child: Container(
  218. height: hsp(60),
  219. width: hsp(100),
  220. child: Image.asset(_chooses[index]['isChoose']==1?'lib/images/kaiguankai.png':'lib/images/kaiguanguan.png'),
  221. ),
  222. onTap: (){
  223. setState(() {
  224. _chooses[index]['isChoose']==1?_chooses[index]['isChoose'] = 0:_chooses[index]['isChoose'] = 1;
  225. });
  226. },
  227. )
  228. ],
  229. ),
  230. );
  231. },
  232. itemCount: _chooses.length,
  233. padding: EdgeInsets.all(0),
  234. ),
  235. )
  236. ],
  237. )
  238. ],
  239. ),
  240. ),
  241. ),
  242. if(_isDetail==true)Stack(
  243. children: [
  244. GestureDetector(
  245. onTap: (){
  246. setState(() {
  247. _isDetail = false;
  248. });
  249. },
  250. child: Container(
  251. height: MediaQuery.of(context).size.height-hsp(120)-MediaQuery.of(context).padding.top-44,
  252. color: Colors.black45,
  253. ),
  254. ),
  255. Container(
  256. margin: EdgeInsets.only(top: MediaQuery.of(context).size.height-hsp(120)-MediaQuery.of(context).padding.top-44-hsp(370)),
  257. height: hsp(370),
  258. decoration: BoxDecoration(
  259. color: Colors.white,
  260. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  261. ),
  262. child: Column(
  263. children: [
  264. Container(
  265. height: hsp(100),
  266. padding: EdgeInsets.only(left: 15,right: 15),
  267. child: Row(
  268. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  269. children: [
  270. GestureDetector(
  271. child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  272. onTap: (){
  273. Navigator.pop(context);
  274. },
  275. ),
  276. Text('明细',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  277. Container(),
  278. ],
  279. ),
  280. ),
  281. Container(
  282. height: hsp(100),
  283. color: Color(0xFFF7F8F9),
  284. padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(20),top: hsp(20)),
  285. child: Row(
  286. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  287. children: [
  288. Text('VIP尊享座位',style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),decoration: TextDecoration.none),),
  289. Text('¥ 780x 10人',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  290. ],
  291. ),
  292. ),
  293. Container(
  294. color: Color(0xFFF7F8F9),
  295. height: hsp(170),
  296. child: ListView.builder(
  297. padding: EdgeInsets.all(0),
  298. itemBuilder: (context,index){
  299. return Container(
  300. padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(10)),
  301. child: Row(
  302. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  303. children: [
  304. Text('票价',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
  305. Text('¥ 770x 10人',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
  306. ],
  307. ),
  308. );
  309. },
  310. itemCount: 3,
  311. ),
  312. )
  313. ],
  314. ),
  315. )
  316. ],
  317. )
  318. ],
  319. ),
  320. Container(
  321. height: hsp(120),
  322. width: MediaQuery.of(context).size.width,
  323. color: Colors.white,
  324. padding: EdgeInsets.only(left: wsp(30),right: wsp(30)),
  325. child: Row(
  326. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  327. children: [
  328. RichText(
  329. text: TextSpan(
  330. text: '参考价(¥)',
  331. style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),
  332. children: [
  333. TextSpan(
  334. text: ' 7800.00',
  335. style: TextStyle(fontSize: zsp(40),color: Color(0xFFFF6600)),
  336. )
  337. ]
  338. ),
  339. ),
  340. GestureDetector(
  341. child: Row(
  342. children: [
  343. Text('明细',style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),),
  344. Icon(Icons.keyboard_arrow_up,size: hsp(30),color: Color(0xFF007EFF),),
  345. ],
  346. ),
  347. onTap: (){
  348. setState(() {
  349. _isDetail = !_isDetail;
  350. });
  351. },
  352. ),
  353. Container(
  354. height: hsp(70),
  355. padding: EdgeInsets.only(left: wsp(50),right: wsp(50)),
  356. decoration: BoxDecoration(
  357. color: Color(0xFF007EFF),
  358. borderRadius: BorderRadius.all(Radius.circular(50))
  359. ),
  360. alignment: Alignment.center,
  361. child: Text('立即预约',style: TextStyle(fontSize: zsp(30),color: Colors.white,fontWeight: FontWeight.bold),),
  362. )
  363. ],
  364. ),
  365. )
  366. ],
  367. ),
  368. ),
  369. );
  370. }
  371. }