OrderListCard.dart 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:get/get.dart';
  4. import '../models/entities/OrderListAll.dart';
  5. import '../pages/OrderConfirmation/index.dart';
  6. import '../pages/orderInfo/index.dart';
  7. import 'LinearGradientText.dart';
  8. class OrderListCard extends StatefulWidget {
  9. final OrderListAll item;
  10. const OrderListCard({Key? key, required this.item}) : super(key: key);
  11. @override
  12. _OrderListCardPages createState() => _OrderListCardPages(item);
  13. }
  14. class _OrderListCardPages extends State<OrderListCard> {
  15. final OrderListAll item;
  16. _OrderListCardPages(this.item);
  17. void orderStates(item){
  18. // if (item.payStatus == 0) {
  19. // return {
  20. // title: '待付款',
  21. // styleColor: '#51D4FF'
  22. // };
  23. // } else if (item.payStatus == 1 && item.workStatus == 0 && item.dispatchStatus == 0) {
  24. // return {
  25. // title: '已付款',
  26. // styleColor: '#FF703B'
  27. // };
  28. // } else if (item.payStatus == 1 && item.dispatchStatus == 1 && item.workStatus == 0) {
  29. // return {
  30. // title: '待作业',
  31. // styleColor: '#FF703B'
  32. // };
  33. //
  34. // } else if (item.payStatus == 1 && (item.workStatus == 1 || item.workStatus == 2)) {
  35. // return {
  36. // title: '进行中',
  37. // styleColor: '#44F68B'
  38. // };
  39. // } else if (item.workStatus == 3 && item.isEvaluated == 0) {
  40. // return {
  41. // title: '待评价',
  42. // styleColor: '#51D4FF'
  43. // };
  44. // } if (item.workStatus == 3 && item.isEvaluated == 1 && item.dispatchStatus == 1) {
  45. // return {
  46. // title: '已完成',
  47. // styleColor: '#FF703B'
  48. // };
  49. // } else if (item.payStatus == -1 && item.workStatus == 0 && item.isRefund == 1) {
  50. // return {
  51. // title: '已退单',
  52. // styleColor: '#FF703B'
  53. // };
  54. // } else if (item.payStatus == 3 && (item.dispatchStatus == 1 || item.dispatchStatus == 0)) {
  55. // return {
  56. // title: '退单申请中',
  57. // styleColor: '#FF703B'
  58. // };
  59. // } else {
  60. // return {
  61. // title: '异常',
  62. // styleColor: '#FF0000'
  63. // };
  64. // }
  65. }
  66. @override
  67. Widget build(BuildContext context) {
  68. return Container(
  69. width: 375.w,
  70. height: 345.h,
  71. margin: EdgeInsets.fromLTRB(0, 0, 0, 20),
  72. decoration: const BoxDecoration(color: Colors.white, boxShadow: [
  73. BoxShadow(
  74. color: Colors.black12,
  75. offset: Offset(0.0, 15.0), //阴影xy轴偏移量
  76. blurRadius: 15.0, //阴影模糊程度
  77. spreadRadius: 1.0 //阴影扩散程度
  78. )
  79. ]),
  80. child: Row(
  81. crossAxisAlignment: CrossAxisAlignment.start,
  82. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  83. children: [
  84. Container(
  85. margin: EdgeInsets.fromLTRB(15, 20, 15, 0),
  86. width: 18.0,
  87. height: 275.h,
  88. child: Image(
  89. image: AssetImage('images/ordersLeft.png'),
  90. ),
  91. ),
  92. Expanded(
  93. child: Column(
  94. crossAxisAlignment: CrossAxisAlignment.start,
  95. children: [
  96. Container(
  97. width: 320.w,
  98. margin: EdgeInsets.fromLTRB(0, 10, 0, 15),
  99. padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
  100. decoration: const BoxDecoration(
  101. border: Border(
  102. bottom:
  103. BorderSide(width: 0.5, color: Color(0x20000000)
  104. // 0x17000000
  105. ))),
  106. child: Row(
  107. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  108. children: [
  109. Container(
  110. child: RichText(
  111. text: TextSpan(children: <InlineSpan>[
  112. TextSpan(
  113. text: '订单编号:',
  114. style: TextStyle(
  115. color: Color(0xff666666),
  116. fontSize: 16,
  117. fontWeight: FontWeight.bold)),
  118. TextSpan(
  119. text: item.orderNo,
  120. style: TextStyle(
  121. color: Color(0xff222222),
  122. fontSize: 16,
  123. fontWeight: FontWeight.bold)),
  124. ]),
  125. ),
  126. ),
  127. GestureDetector(
  128. child: const Text('详情 >>',
  129. style: TextStyle(
  130. color: Color(0xff222222),
  131. fontSize: 16,
  132. fontWeight: FontWeight.bold,
  133. )),
  134. onTap: () {
  135. print('进入详情');
  136. Get.to(OrderPageInfo());
  137. },
  138. )
  139. ],
  140. ),
  141. ),
  142. Expanded(
  143. child: Column(
  144. crossAxisAlignment: CrossAxisAlignment.start,
  145. children: [
  146. Padding(
  147. padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
  148. child: RichText(
  149. text: TextSpan(children: <InlineSpan>[
  150. TextSpan(
  151. text: '农机名称:',
  152. style: TextStyle(
  153. color: Color(0xff666666),
  154. fontSize: 16,
  155. fontWeight: FontWeight.bold)),
  156. TextSpan(
  157. text: item.machineryName,
  158. style: TextStyle(
  159. color: Color(0xff222222),
  160. fontSize: 16,
  161. fontWeight: FontWeight.bold)),
  162. ]),
  163. ),
  164. ),
  165. Padding(
  166. padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
  167. child: RichText(
  168. text: TextSpan(children: <InlineSpan>[
  169. TextSpan(
  170. text: '作业面积:',
  171. style: TextStyle(
  172. color: Color(0xff666666),
  173. fontSize: 16,
  174. fontWeight: FontWeight.bold)),
  175. TextSpan(
  176. text: item.amount.toString(),
  177. style: TextStyle(
  178. color: Color(0xff222222),
  179. fontSize: 16,
  180. fontWeight: FontWeight.bold)),
  181. ]),
  182. ),
  183. ),
  184. Padding(
  185. padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
  186. child: RichText(
  187. text: TextSpan(children: <InlineSpan>[
  188. TextSpan(
  189. text: '需求时间:',
  190. style: TextStyle(
  191. color: Color(0xff666666),
  192. fontSize: 16,
  193. fontWeight: FontWeight.bold)),
  194. TextSpan(
  195. text: item.appointmentDate.toString(),
  196. style: TextStyle(
  197. color: Color(0xff222222),
  198. fontSize: 16,
  199. fontWeight: FontWeight.bold)),
  200. ]),
  201. ),
  202. ),
  203. Padding(
  204. padding: EdgeInsets.fromLTRB(0, 0, 0, 4),
  205. child: RichText(
  206. text: TextSpan(children: <InlineSpan>[
  207. TextSpan(
  208. text: '下单时间:',
  209. style: TextStyle(
  210. color: Color(0xff666666),
  211. fontSize: 16,
  212. fontWeight: FontWeight.bold)),
  213. TextSpan(
  214. text: item.createDate.toString(),
  215. style: TextStyle(
  216. color: Color(0xff222222),
  217. fontSize: 16,
  218. fontWeight: FontWeight.bold)),
  219. ]),
  220. ),
  221. ),
  222. ],
  223. )),
  224. Container(
  225. margin: EdgeInsets.fromLTRB(0, 0, 0, 30),
  226. padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
  227. decoration: const BoxDecoration(
  228. border: Border(
  229. top: BorderSide(
  230. width: 0.5, color: Color(0x20000000)))),
  231. width: 320.w,
  232. child: Row(
  233. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  234. children: [
  235. RichText(
  236. text: const TextSpan(children: <InlineSpan>[
  237. TextSpan(
  238. text: '订单状态:',
  239. style: TextStyle(
  240. color: Color(0xff666666),
  241. fontSize: 16,
  242. fontWeight: FontWeight.bold)),
  243. TextSpan(
  244. text: '待付款',
  245. style: TextStyle(
  246. color: Color(0xff51D4FF),
  247. fontSize: 16,
  248. fontWeight: FontWeight.bold)),
  249. ]),
  250. ),
  251. Container(
  252. child: Row(
  253. children: [
  254. const Text('费用:',style: TextStyle(
  255. color: Color(0xff666666),
  256. fontSize: 16,
  257. fontWeight: FontWeight.bold)),
  258. LinearGradientText(
  259. colors: const <Color>[
  260. Color(0xFFFA7878),
  261. Color(0xFFB61515),
  262. ],
  263. child: RichText(
  264. text: TextSpan(
  265. children: <InlineSpan>[
  266. TextSpan(
  267. text:( item.charges!/100).toString(),
  268. style: TextStyle(
  269. fontSize: 16,
  270. fontWeight: FontWeight.bold,
  271. )),
  272. TextSpan(
  273. text: "元",
  274. style: TextStyle(
  275. fontSize: 16,
  276. fontWeight: FontWeight.bold,
  277. )),
  278. ]
  279. ),
  280. ),
  281. ),
  282. ],
  283. ),
  284. ),
  285. ],
  286. ),
  287. ),
  288. ],
  289. ),
  290. ),
  291. ],
  292. ),
  293. );
  294. }
  295. }