order_management_page.dart 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'order_management_page/order_detail_page.dart';
  4. class OrderManagementPage extends StatefulWidget {
  5. final Widget child;
  6. OrderManagementPage({
  7. Key key,
  8. this.child
  9. }): super(key: key);
  10. _OrderManagementPageState createState() => _OrderManagementPageState();
  11. }
  12. class _OrderManagementPageState extends State < OrderManagementPage > with AutomaticKeepAliveClientMixin {
  13. @override
  14. Widget build(BuildContext context) {
  15. return Container(
  16. child: Scaffold(
  17. appBar: AppBar(
  18. title: Text('订单管理', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(36)), ),
  19. centerTitle: true,
  20. backgroundColor: Color.fromRGBO(64, 98, 254, 1),
  21. // actions: < Widget > [
  22. // IconButton(
  23. // icon: Icon(Icons.add_circle_outline),
  24. // onPressed: () {},
  25. // )
  26. // ],
  27. ),
  28. body: Container(
  29. decoration: BoxDecoration(
  30. color: Color.fromRGBO(246, 246, 254, 1)
  31. ),
  32. child: QueryWidget()
  33. ),
  34. resizeToAvoidBottomPadding: false //键盘弹出,页面不跟随向上滑动,防止出现溢出错误
  35. )
  36. );
  37. }
  38. @override
  39. bool get wantKeepAlive => true;
  40. }
  41. class QueryWidget extends StatefulWidget { //搜索栏
  42. final Widget child;
  43. QueryWidget({
  44. Key key,
  45. this.child
  46. }): super(key: key);
  47. _QueryWidgetState createState() => _QueryWidgetState();
  48. }
  49. class _QueryWidgetState extends State < QueryWidget > {
  50. @override
  51. Widget build(BuildContext context) {
  52. return Container(
  53. child: Column(
  54. children: < Widget > [
  55. Container(
  56. color: Colors.white,
  57. height: ScreenUtil.getInstance().setHeight(222),
  58. padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), 0),
  59. child: Column(
  60. children: < Widget > [
  61. Container(
  62. height: ScreenUtil.getInstance().setHeight(100),
  63. decoration: BoxDecoration(
  64. border: Border.all(color: Color.fromRGBO(204, 204, 204, 1), width: 1),
  65. borderRadius: BorderRadius.all(Radius.circular(5))
  66. ),
  67. child: Row(
  68. children: < Widget > [
  69. Expanded(
  70. child: TextField(
  71. keyboardType: TextInputType.number,
  72. decoration: InputDecoration(
  73. border: InputBorder.none,
  74. hintText: "输入运单号查询物流",
  75. hintStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(26), color: Color.fromRGBO(155, 155, 155, 1)),
  76. contentPadding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), 0, ScreenUtil.getInstance().setWidth(30), 0)
  77. ),
  78. ),
  79. ),
  80. IconButton(
  81. icon: Image.asset('lib/images/icon_saoyisao.png',
  82. width: ScreenUtil.getInstance().setWidth(38),
  83. height: ScreenUtil.getInstance().setHeight(36),
  84. ),
  85. onPressed: () {},
  86. ),
  87. GestureDetector(
  88. child: Container(
  89. width: ScreenUtil.getInstance().setWidth(120),
  90. decoration: BoxDecoration(
  91. border: Border(left: BorderSide.merge(BorderSide(color: Color.fromRGBO(204, 204, 204, 1), width: 1), BorderSide(color: Color.fromRGBO(204, 204, 204, 1), width: 0)), )
  92. ),
  93. child: Center(
  94. child: Text("查询", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(26), color: Color.fromRGBO(64, 98, 254, 1)), ),
  95. ),
  96. ),
  97. onTap: () {
  98. print("查询");
  99. }
  100. ),
  101. ],
  102. ),
  103. ),
  104. Container(
  105. height: ScreenUtil.getInstance().setHeight(100),
  106. child: Container(
  107. padding: EdgeInsets.only(top: ScreenUtil.getInstance().setHeight(25)),
  108. child: Row(
  109. mainAxisAlignment: MainAxisAlignment.spaceAround,
  110. children: < Widget > [
  111. Container(
  112. height: ScreenUtil.getInstance().setHeight(80),
  113. decoration: BoxDecoration(
  114. border: Border(bottom: BorderSide.merge(BorderSide(color: Colors.black, width: 1), BorderSide(color: Colors.black, width: 0)), )
  115. ),
  116. child: Center(
  117. child: Text("待取件", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30)), ),
  118. )
  119. ),
  120. Container(
  121. height: ScreenUtil.getInstance().setHeight(80),
  122. decoration: BoxDecoration(
  123. border: Border()
  124. ),
  125. child: Center(
  126. child: Text("运途中", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(155, 155, 155, 1)), ),
  127. )
  128. ),
  129. Container(
  130. height: ScreenUtil.getInstance().setHeight(80),
  131. decoration: BoxDecoration(
  132. border: Border()
  133. ),
  134. child: Center(
  135. child: Text("已完成", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(155, 155, 155, 1)), ),
  136. )
  137. ),
  138. ],
  139. )
  140. )
  141. ),
  142. ],
  143. )
  144. ),
  145. Expanded(
  146. child: Container(
  147. padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), 0),
  148. child: ListView(
  149. children: < Widget > [
  150. _cardWiget(),
  151. _cardWiget(),
  152. _cardWiget(),
  153. ],
  154. ),
  155. ),
  156. )
  157. ],
  158. )
  159. );
  160. }
  161. Widget _cardWiget() {
  162. return GestureDetector(
  163. child: Card(
  164. color: Colors.white,
  165. child: Container(
  166. padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(20)),
  167. child: Column(
  168. children: < Widget > [
  169. Padding(
  170. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
  171. child: Row(
  172. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  173. children: < Widget > [
  174. Text('订单号:10893477897899', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(102, 102, 102, 1)), ),
  175. Text("待取货", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(126, 211, 33, 1)), ),
  176. ],
  177. )
  178. ),
  179. Padding(
  180. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  181. child: Row(
  182. children: < Widget > [
  183. Text('朝阳门大阳汽贸 --> 香河汽修厂', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30)), ),
  184. ],
  185. )
  186. ),
  187. Padding(
  188. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(15)),
  189. child: Row(
  190. children: < Widget > [
  191. SizedBox(
  192. width: ScreenUtil.getInstance().setWidth(355),
  193. child: Text('货物名称:汽车轮胎', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
  194. ),
  195. Text('代收款:2800元', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
  196. ],
  197. ),
  198. ),
  199. Padding(
  200. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
  201. child: Row(
  202. children: < Widget > [
  203. SizedBox(
  204. width: ScreenUtil.getInstance().setWidth(355),
  205. child: Text('货物件数:4件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
  206. ),
  207. Text('运费:280元', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
  208. ],
  209. ),
  210. ),
  211. Padding(
  212. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  213. child: Container(
  214. height: ScreenUtil.getInstance().setHeight(1),
  215. color: Color.fromRGBO(223, 223, 223, 1),
  216. ),
  217. ),
  218. Row(
  219. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  220. children: < Widget > [
  221. GestureDetector(
  222. child: Container(
  223. width: ScreenUtil.getInstance().setWidth(94),
  224. height: ScreenUtil.getInstance().setHeight(48),
  225. decoration: BoxDecoration(
  226. color: Color.fromRGBO(239, 243, 249, 1),
  227. borderRadius: BorderRadius.all(Radius.circular(4.0))
  228. ),
  229. child: Center(
  230. child: Text('作废', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  231. ),
  232. ),
  233. onTap: () {
  234. print("作废");
  235. },
  236. ),
  237. GestureDetector(
  238. child: Container(
  239. width: ScreenUtil.getInstance().setWidth(94),
  240. height: ScreenUtil.getInstance().setHeight(48),
  241. decoration: BoxDecoration(
  242. color: Color.fromRGBO(239, 243, 249, 1),
  243. borderRadius: BorderRadius.all(Radius.circular(4.0))
  244. ),
  245. child: Center(
  246. child: Text('寄件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  247. ),
  248. ),
  249. onTap: () {
  250. print("寄件");
  251. },
  252. )
  253. ],
  254. )
  255. ],
  256. ),
  257. )
  258. ),
  259. onTap: () {
  260. Navigator.push(context, MaterialPageRoute(builder: (context) {
  261. return OrderDetailPage(orderId: 123456, );
  262. }));
  263. },
  264. );
  265. }
  266. }