order_management_page.dart 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'order_management_page/order_detail_page.dart';
  4. import '../showDialog.dart';
  5. import '../util/models.dart';
  6. import '../util/api.dart';
  7. import '../util/util.dart';
  8. class OrderManagementPage extends StatefulWidget {
  9. final Widget child;
  10. OrderManagementPage({
  11. Key key,
  12. this.child
  13. }): super(key: key);
  14. _OrderManagementPageState createState() => _OrderManagementPageState();
  15. }
  16. class _OrderManagementPageState extends State < OrderManagementPage > with AutomaticKeepAliveClientMixin {
  17. @override
  18. Widget build(BuildContext context) {
  19. return Container(
  20. child: Scaffold(
  21. appBar: AppBar(
  22. title: Text('订单管理', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(36)), ),
  23. centerTitle: true,
  24. backgroundColor: Color.fromRGBO(64, 98, 254, 1),
  25. ),
  26. body: Container(
  27. decoration: BoxDecoration(
  28. color: Color.fromRGBO(246, 246, 254, 1)
  29. ),
  30. child: QueryWidget()
  31. ),
  32. resizeToAvoidBottomPadding: false //键盘弹出,页面不跟随向上滑动,防止出现溢出错误
  33. )
  34. );
  35. }
  36. @override
  37. bool get wantKeepAlive => true;
  38. }
  39. class QueryWidget extends StatefulWidget { //搜索栏
  40. final Widget child;
  41. QueryWidget({
  42. Key key,
  43. this.child
  44. }): super(key: key);
  45. _QueryWidgetState createState() => _QueryWidgetState();
  46. }
  47. class _QueryWidgetState extends State < QueryWidget > {
  48. //单号的输入框控制器
  49. TextEditingController _orderController = TextEditingController();
  50. ScrollController _scrollController = ScrollController();
  51. GlobalKey _globalKey = GlobalKey(); //搜索栏key
  52. List < bool > statusList = [true, false, false];
  53. double inputPostX = 0;
  54. double inputPostY = 0;
  55. double inputWidth = 0;
  56. double inputHeight = 0;
  57. bool showStatus = true; //提示层显示状态
  58. String _orderNo = "";
  59. int orderStatus = 1; //0:代收单,1:待取件,2:运途中:已完成
  60. int page = 1;
  61. bool hasNextPage = true;
  62. List < FromStatusGetOrderList > orderList = [];
  63. @override
  64. void initState() {
  65. super.initState();
  66. switchOrderFromStatus(orderStatus, page);
  67. _scrollController.addListener(() {
  68. if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {
  69. print("滑到底部了");
  70. }
  71. });
  72. }
  73. @override
  74. Widget build(BuildContext context) {
  75. return Stack(
  76. children: < Widget > [
  77. Container(
  78. child: Column(
  79. children: < Widget > [
  80. Container(
  81. color: Colors.white,
  82. height: ScreenUtil.getInstance().setHeight(222),
  83. padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), 0),
  84. child: Column(
  85. children: < Widget > [
  86. Container(
  87. key: _globalKey,
  88. height: ScreenUtil.getInstance().setHeight(100),
  89. decoration: BoxDecoration(
  90. border: Border.all(color: Color.fromRGBO(204, 204, 204, 1), width: 1),
  91. borderRadius: BorderRadius.all(Radius.circular(5))
  92. ),
  93. child: Row(
  94. children: < Widget > [
  95. Expanded(
  96. child: TextField(
  97. controller: _orderController,
  98. keyboardType: TextInputType.number,
  99. autocorrect: true,
  100. decoration: InputDecoration(
  101. border: InputBorder.none,
  102. hintText: "输入运单号后6位查询物流",
  103. hintStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(26), color: Color.fromRGBO(155, 155, 155, 1)),
  104. contentPadding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), 0, ScreenUtil.getInstance().setWidth(30), 0)
  105. ),
  106. onTap: () {
  107. RenderObject inputObj = _globalKey.currentContext.findRenderObject();
  108. setState(() {
  109. inputWidth = inputObj.paintBounds.size.width;
  110. inputHeight = inputObj.paintBounds.size.height;
  111. inputPostX = inputObj.getTransformTo(null).getTranslation().x;
  112. inputPostY = ScreenUtil.getInstance().setWidth(20) + inputHeight;
  113. });
  114. },
  115. onChanged: ((value) {
  116. print(value);
  117. setState(() {
  118. _orderNo = value;
  119. });
  120. if (_orderNo.length >= 6) {
  121. setState(() {
  122. showStatus = false;
  123. });
  124. } else {
  125. setState(() {
  126. showStatus = true;
  127. });
  128. }
  129. }),
  130. onEditingComplete: () {
  131. FocusScope.of(context).requestFocus(FocusNode());
  132. setState(() {
  133. showStatus = true;
  134. });
  135. },
  136. ),
  137. ),
  138. IconButton(
  139. icon: Image.asset('lib/images/icon_saoyisao.png',
  140. width: ScreenUtil.getInstance().setWidth(38),
  141. height: ScreenUtil.getInstance().setHeight(36),
  142. ),
  143. onPressed: () {},
  144. ),
  145. GestureDetector(
  146. child: Container(
  147. width: ScreenUtil.getInstance().setWidth(120),
  148. decoration: BoxDecoration(
  149. 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)), )
  150. ),
  151. child: Center(
  152. child: Text("查询", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(26), color: Color.fromRGBO(64, 98, 254, 1)), ),
  153. ),
  154. ),
  155. onTap: () {
  156. print("查询");
  157. }
  158. ),
  159. ],
  160. ),
  161. ),
  162. Container(
  163. height: ScreenUtil.getInstance().setHeight(100),
  164. child: Container(
  165. padding: EdgeInsets.only(top: ScreenUtil.getInstance().setHeight(25)),
  166. child: Row(
  167. mainAxisAlignment: MainAxisAlignment.spaceAround,
  168. children: < Widget > [
  169. GestureDetector(
  170. child: Container(
  171. height: ScreenUtil.getInstance().setHeight(80),
  172. decoration: BoxDecoration(
  173. border: statusList[0] ? Border(bottom: BorderSide.merge(BorderSide(color: Colors.black, width: 1), BorderSide(color: Colors.black, width: 0)), ) : Border()
  174. ),
  175. child: Center(
  176. child: Text("待取件", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: statusList[0] ? Colors.black : Color.fromRGBO(155, 155, 155, 1)), ),
  177. )
  178. ),
  179. onTap: () {
  180. if (statusList[0]) {
  181. return;
  182. } else {
  183. setState(() {
  184. statusList = [true, false, false];
  185. orderStatus = 1;
  186. });
  187. switchOrderFromStatus(orderStatus, page);
  188. }
  189. },
  190. ),
  191. GestureDetector(
  192. child: Container(
  193. height: ScreenUtil.getInstance().setHeight(80),
  194. decoration: BoxDecoration(
  195. border: statusList[1] ? Border(bottom: BorderSide.merge(BorderSide(color: Colors.black, width: 1), BorderSide(color: Colors.black, width: 0)), ) : Border()
  196. ),
  197. child: Center(
  198. child: Text("运途中", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: statusList[1] ? Colors.black : Color.fromRGBO(155, 155, 155, 1)), ),
  199. )
  200. ),
  201. onTap: () {
  202. if (statusList[1]) {
  203. return;
  204. } else {
  205. setState(() {
  206. statusList = [false, true, false];
  207. orderStatus = 2;
  208. });
  209. switchOrderFromStatus(orderStatus, page);
  210. }
  211. },
  212. ),
  213. GestureDetector(
  214. child: Container(
  215. height: ScreenUtil.getInstance().setHeight(80),
  216. decoration: BoxDecoration(
  217. border: statusList[2] ? Border(bottom: BorderSide.merge(BorderSide(color: Colors.black, width: 1), BorderSide(color: Colors.black, width: 0)), ) : Border()
  218. ),
  219. child: Center(
  220. child: Text("已完成", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: statusList[2] ? Colors.black : Color.fromRGBO(155, 155, 155, 1)), ),
  221. )
  222. ),
  223. onTap: () {
  224. if (statusList[2]) {
  225. return;
  226. } else {
  227. setState(() {
  228. statusList = [false, false, true];
  229. orderStatus = 3;
  230. });
  231. switchOrderFromStatus(orderStatus, page);
  232. }
  233. },
  234. ),
  235. ],
  236. )
  237. )
  238. ),
  239. ],
  240. )
  241. ),
  242. Expanded(
  243. child: Container(
  244. padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), 0),
  245. child: orderList == null ? Center(
  246. child: _getMoreWidget()
  247. ) : orderList.length == 0 ? Center(
  248. child: Text('暂无订单'),
  249. ) :
  250. ListView.builder(
  251. controller: _scrollController,
  252. itemCount: orderList.length + 1,
  253. itemBuilder: (BuildContext context, int index) {
  254. if (index < orderList.length) {
  255. return _cardWiget(orderList[index], index);
  256. }
  257. if (hasNextPage) {
  258. return _getMoreWidget();
  259. } else {
  260. return _noMoreWidegt();
  261. }
  262. },
  263. )
  264. ),
  265. )
  266. ],
  267. )
  268. ),
  269. Positioned(
  270. left: inputPostX,
  271. top: inputPostY,
  272. child: Offstage(
  273. offstage: showStatus,
  274. child:
  275. Container(
  276. width: inputWidth,
  277. height: ScreenUtil.getInstance().setHeight(320),
  278. margin: EdgeInsets.only(top: ScreenUtil.getInstance().setHeight(1)),
  279. decoration: BoxDecoration(
  280. color: Color.fromRGBO(244, 248, 251, 1),
  281. border: Border.all(color: Color.fromRGBO(204, 204, 204, 1), width: 1),
  282. borderRadius: BorderRadius.all(Radius.circular(5))
  283. ),
  284. child: ListView(
  285. children: < Widget > [
  286. InkWell(
  287. child: Padding(
  288. padding: EdgeInsets.all(10),
  289. child: Text("11012312312312312313123131"),
  290. ),
  291. onTap: () {
  292. setState(() {
  293. _orderController.text = ('11122223333333');
  294. showStatus = true;
  295. FocusScope.of(context).requestFocus(FocusNode());
  296. });
  297. },
  298. )
  299. ],
  300. ),
  301. ),
  302. )
  303. )
  304. ],
  305. );
  306. }
  307. Widget _cardWiget(FromStatusGetOrderList obj, int index) {
  308. Map < int, String > statusMap = {
  309. 1: '待取货',
  310. 2: '运途中',
  311. 3: '已签收',
  312. 4: '拒收'
  313. };
  314. return Card(
  315. color: Colors.white,
  316. child: Container(
  317. padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(20)),
  318. child: Column(
  319. children: < Widget > [
  320. Padding(
  321. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
  322. child: Row(
  323. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  324. children: < Widget > [
  325. Text('订单号:${obj.orderNo}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(102, 102, 102, 1)), ),
  326. Text('${statusMap[obj.orderStatus]}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(126, 211, 33, 1)), ),
  327. ],
  328. )
  329. ),
  330. Padding(
  331. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  332. child: Row(
  333. children: < Widget > [
  334. Text('${obj.sendCompanyName} --> ${obj.receiptCompanyName}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30)), ),
  335. ],
  336. )
  337. ),
  338. Padding(
  339. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(15)),
  340. child: Row(
  341. children: < Widget > [
  342. SizedBox(
  343. width: ScreenUtil.getInstance().setWidth(355),
  344. child: Text('货物名称:${obj.goods}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
  345. ),
  346. Text('代收款:${obj.goodsAgencyFund/100}元', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
  347. ],
  348. ),
  349. ),
  350. Padding(
  351. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
  352. child: Row(
  353. children: < Widget > [
  354. SizedBox(
  355. width: ScreenUtil.getInstance().setWidth(355),
  356. child: Text('货物件数:${obj.goodsQuantity}件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
  357. ),
  358. Text('运费:${obj.goodsFreight/100}元', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
  359. ],
  360. ),
  361. ),
  362. Padding(
  363. padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  364. child: Container(
  365. height: ScreenUtil.getInstance().setHeight(1),
  366. color: Color.fromRGBO(223, 223, 223, 1),
  367. ),
  368. ),
  369. orderStatus == 1 ? _status1Fun(obj, index) : orderStatus == 2 ? _status2Fun(obj, index) : _status3Fun(obj, index)
  370. ],
  371. ),
  372. )
  373. );
  374. }
  375. switchOrderFromStatus(int orderStatus, int page) {
  376. setState(() {
  377. orderList = null;
  378. });
  379. fromStatusGetOrderList(orderStatus, page).then((resp) {
  380. if (isNotError(context, resp)) {
  381. FromStatusGetOrderObj tempObj = FromStatusGetOrderObj.fromJson(resp.data);
  382. setState(() {
  383. orderList = tempObj.data.items;
  384. hasNextPage = tempObj.data.hasNextPage;
  385. });
  386. }
  387. });
  388. }
  389. getMoreOrder(int orderStatus, int page) {
  390. if (!hasNextPage) {
  391. return;
  392. }
  393. fromStatusGetOrderList(orderStatus, page).then((resp) {
  394. if (isNotError(context, resp)) {
  395. FromStatusGetOrderObj tempObj = FromStatusGetOrderObj.fromJson(resp.data);
  396. setState(() {
  397. orderList.addAll(tempObj.data.items);
  398. hasNextPage = tempObj.data.hasNextPage;
  399. });
  400. }
  401. });
  402. }
  403. Widget _status1Fun(FromStatusGetOrderList obj, int index) {
  404. return Row(
  405. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  406. children: < Widget > [
  407. InkWell(
  408. child: Container(
  409. width: ScreenUtil.getInstance().setWidth(94),
  410. height: ScreenUtil.getInstance().setHeight(48),
  411. decoration: BoxDecoration(
  412. color: Color.fromRGBO(239, 243, 249, 1),
  413. borderRadius: BorderRadius.all(Radius.circular(4.0))
  414. ),
  415. child: Center(
  416. child: Text('作废', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  417. ),
  418. ),
  419. onTap: () {
  420. showDialog < Null > (
  421. context: context, //BuildContext对象
  422. barrierDismissible: false,
  423. builder: (BuildContext context) {
  424. return new LoadingDialog( //调用对话框
  425. text: '是否确认作废', childCallback: (val) {
  426. if (val) {
  427. //widget.callback(widget.index);
  428. } else {
  429. return;
  430. }
  431. },
  432. );
  433. });
  434. print("作废");
  435. },
  436. ),
  437. InkWell(
  438. child: Container(
  439. width: ScreenUtil.getInstance().setWidth(94),
  440. height: ScreenUtil.getInstance().setHeight(48),
  441. decoration: BoxDecoration(
  442. color: Color.fromRGBO(239, 243, 249, 1),
  443. borderRadius: BorderRadius.all(Radius.circular(4.0))
  444. ),
  445. child: Center(
  446. child: Text('寄件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  447. ),
  448. ),
  449. onTap: () {
  450. showDialog < Null > (
  451. context: context, //BuildContext对象
  452. barrierDismissible: false,
  453. builder: (BuildContext context) {
  454. return new LoadingDialog( //调用对话框
  455. text: '是否确认寄件', childCallback: (val) {
  456. if (val) {
  457. Navigator.push(
  458. context,
  459. MaterialPageRoute(
  460. builder: (BuildContext context) {
  461. return OrderDetailPage(orderNo: obj.orderNo);
  462. })
  463. ).then((resp) {
  464. if (resp == true) {
  465. orderList.removeAt(index);
  466. if (orderList.length < 4) {
  467. if (hasNextPage) {
  468. setState(() {
  469. page = ++page;
  470. });
  471. getMoreOrder(orderStatus, page);
  472. }
  473. }
  474. }
  475. });
  476. } else {
  477. return;
  478. }
  479. },
  480. );
  481. });
  482. print("寄件");
  483. },
  484. ),
  485. ],
  486. );
  487. }
  488. Widget _status2Fun(FromStatusGetOrderList obj, int index) {
  489. return Row(
  490. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  491. children: < Widget > [
  492. InkWell(
  493. child: Container(
  494. width: ScreenUtil.getInstance().setWidth(94),
  495. height: ScreenUtil.getInstance().setHeight(48),
  496. decoration: BoxDecoration(
  497. color: Color.fromRGBO(239, 243, 249, 1),
  498. borderRadius: BorderRadius.all(Radius.circular(4.0))
  499. ),
  500. child: Center(
  501. child: Text('作废', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  502. ),
  503. ),
  504. onTap: () {
  505. showDialog < Null > (
  506. context: context, //BuildContext对象
  507. barrierDismissible: false,
  508. builder: (BuildContext context) {
  509. return new LoadingDialog( //调用对话框
  510. text: '是否确认作废', childCallback: (val) {
  511. if (val) {
  512. //widget.callback(widget.index);
  513. } else {
  514. return;
  515. }
  516. },
  517. );
  518. });
  519. print("作废");
  520. },
  521. ),
  522. InkWell(
  523. child: Container(
  524. width: ScreenUtil.getInstance().setWidth(94),
  525. height: ScreenUtil.getInstance().setHeight(48),
  526. decoration: BoxDecoration(
  527. color: Color.fromRGBO(239, 243, 249, 1),
  528. borderRadius: BorderRadius.all(Radius.circular(4.0))
  529. ),
  530. child: Center(
  531. child: Text('拒收', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  532. ),
  533. ),
  534. onTap: () {
  535. showDialog < Null > (
  536. context: context, //BuildContext对象
  537. barrierDismissible: false,
  538. builder: (BuildContext context) {
  539. return new LoadingDialog( //调用对话框
  540. text: '是否确认拒收', childCallback: (val) {
  541. if (val) {
  542. //widget.callback(widget.index);
  543. } else {
  544. return;
  545. }
  546. },
  547. );
  548. });
  549. print("拒收");
  550. },
  551. ),
  552. InkWell(
  553. child: Container(
  554. width: ScreenUtil.getInstance().setWidth(94),
  555. height: ScreenUtil.getInstance().setHeight(48),
  556. decoration: BoxDecoration(
  557. color: Color.fromRGBO(239, 243, 249, 1),
  558. borderRadius: BorderRadius.all(Radius.circular(4.0))
  559. ),
  560. child: Center(
  561. child: Text('签收', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  562. ),
  563. ),
  564. onTap: () {
  565. showDialog < Null > (
  566. context: context, //BuildContext对象
  567. barrierDismissible: false,
  568. builder: (BuildContext context) {
  569. return new LoadingDialog( //调用对话框
  570. text: '是否确认签收', childCallback: (val) {
  571. if (val) {
  572. //widget.callback(widget.index);
  573. } else {
  574. return;
  575. }
  576. },
  577. );
  578. });
  579. print("签收");
  580. },
  581. ),
  582. InkWell(
  583. child: Container(
  584. width: ScreenUtil.getInstance().setWidth(94),
  585. height: ScreenUtil.getInstance().setHeight(48),
  586. decoration: BoxDecoration(
  587. color: Color.fromRGBO(239, 243, 249, 1),
  588. borderRadius: BorderRadius.all(Radius.circular(4.0))
  589. ),
  590. child: Center(
  591. child: Text('改单', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  592. ),
  593. ),
  594. onTap: () {
  595. showDialog < Null > (
  596. context: context, //BuildContext对象
  597. barrierDismissible: false,
  598. builder: (BuildContext context) {
  599. return new LoadingDialog( //调用对话框
  600. text: '是否确认改单', childCallback: (val) {
  601. if (val) {
  602. Navigator.push(
  603. context,
  604. MaterialPageRoute(
  605. builder: (BuildContext context) {
  606. return OrderDetailPage(orderNo: obj.orderNo);
  607. })
  608. );
  609. } else {
  610. return;
  611. }
  612. },
  613. );
  614. });
  615. print("改单");
  616. },
  617. ),
  618. InkWell(
  619. child: Container(
  620. width: ScreenUtil.getInstance().setWidth(94),
  621. height: ScreenUtil.getInstance().setHeight(48),
  622. decoration: BoxDecoration(
  623. color: Color.fromRGBO(239, 243, 249, 1),
  624. borderRadius: BorderRadius.all(Radius.circular(4.0))
  625. ),
  626. child: Center(
  627. child: Text('打印', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  628. ),
  629. ),
  630. onTap: () {
  631. showDialog < Null > (
  632. context: context, //BuildContext对象
  633. barrierDismissible: false,
  634. builder: (BuildContext context) {
  635. return new LoadingDialog( //调用对话框
  636. text: '是否确认打印', childCallback: (val) {
  637. if (val) {
  638. //widget.callback(widget.index);
  639. } else {
  640. return;
  641. }
  642. },
  643. );
  644. });
  645. print("打印");
  646. },
  647. ),
  648. ],
  649. );
  650. }
  651. Widget _status3Fun(FromStatusGetOrderList obj, int index) {
  652. return Row(
  653. mainAxisAlignment: MainAxisAlignment.end,
  654. children: < Widget > [
  655. InkWell(
  656. child: Container(
  657. width: ScreenUtil.getInstance().setWidth(94),
  658. height: ScreenUtil.getInstance().setHeight(48),
  659. decoration: BoxDecoration(
  660. color: Color.fromRGBO(239, 243, 249, 1),
  661. borderRadius: BorderRadius.all(Radius.circular(4.0))
  662. ),
  663. child: Center(
  664. child: Text('打印', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
  665. ),
  666. ),
  667. onTap: () {
  668. showDialog < Null > (
  669. context: context, //BuildContext对象
  670. barrierDismissible: false,
  671. builder: (BuildContext context) {
  672. return new LoadingDialog( //调用对话框
  673. text: '是否确认打印', childCallback: (val) {
  674. if (val) {
  675. //widget.callback(widget.index);
  676. } else {
  677. return;
  678. }
  679. },
  680. );
  681. });
  682. print("打印");
  683. },
  684. ),
  685. ],
  686. );
  687. }
  688. Widget _getMoreWidget() {
  689. return Center(
  690. child: Padding(
  691. padding: EdgeInsets.all(10.0),
  692. child: Row(
  693. mainAxisAlignment: MainAxisAlignment.center,
  694. crossAxisAlignment: CrossAxisAlignment.center,
  695. children: < Widget > [
  696. Text(
  697. '加载中...',
  698. style: TextStyle(fontSize: 16.0),
  699. ),
  700. Container(
  701. width: ScreenUtil.getInstance().setWidth(50),
  702. height: ScreenUtil.getInstance().setHeight(50),
  703. child: CircularProgressIndicator()
  704. )
  705. ],
  706. ),
  707. ),
  708. );
  709. }
  710. Widget _noMoreWidegt() {
  711. return Center(
  712. child: Padding(
  713. padding: EdgeInsets.all(10.0),
  714. child: Text(
  715. '没有更多数据了...',
  716. style: TextStyle(fontSize: 16.0),
  717. ),
  718. ),
  719. );
  720. }
  721. }