YSUnionOrderDetail.dart 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import 'package:flutter/material.dart';
  2. import 'package:ysairplane2/base/YSBase.dart';
  3. import 'package:ysairplane2/tools/YSTools.dart';
  4. class YSUnionOrderDetail extends StatefulWidget {
  5. final order;
  6. const YSUnionOrderDetail({Key key, this.order}) : super(key: key);
  7. @override
  8. _YSUnionOrderDetailState createState() => _YSUnionOrderDetailState();
  9. }
  10. class _YSUnionOrderDetailState extends State<YSUnionOrderDetail> {
  11. List _titleArray = [{'title':'','content':''},{'title':'订单编号','content':''},{'title':'订单状态','content':''},{'title':'订单金额','content':''}
  12. ,{'title':'用户','content':''},{'title':'佣金金额','content':''},{'title':'支付时间','content':''},{'title':'订单来源','content':''}];
  13. @override
  14. void initState() {
  15. _titleArray[0]['title'] = widget.order['typeName'];
  16. _titleArray[1]['content'] = widget.order['orderSn'];
  17. _titleArray[2]['content'] = widget.order['orderStatus']==0?'已下单':widget.order['orderStatus']==1?'已核验':'已退款';
  18. _titleArray[3]['content'] = '${widget.order['orderPrice']??'0.00'}';
  19. _titleArray[4]['content'] = widget.order['nickName'];
  20. _titleArray[5]['content'] = '${widget.order['servantsPrice']??'0.00'}';
  21. _titleArray[6]['content'] = widget.order['payTime'];
  22. _titleArray[7]['content'] = widget.order['type']??'';
  23. super.initState();
  24. }
  25. @override
  26. Widget build(BuildContext context) {
  27. return YSBase(
  28. ystitle: '佣金订单详情',
  29. yscolor: Color(0xFFF5F6F8),
  30. yschild: Container(
  31. color: Colors.white,
  32. width: MediaQuery.of(context).size.width,
  33. child: ListView.separated(
  34. padding: EdgeInsets.only(left: hsp(30),right: hsp(30)),
  35. itemBuilder: (context,index){
  36. Map item = _titleArray[index];
  37. return Container(
  38. padding: EdgeInsets.only(top: hsp(30),bottom: hsp(30)),
  39. child: LayoutBuilder(
  40. builder: (context,listSize){
  41. return Row(
  42. children: [
  43. Container(
  44. width: hsp(200),
  45. child: Text(item['title'],style: TextStyle(fontSize: zsp(28),color: Colors.black,fontWeight: index==0?FontWeight.bold:FontWeight.normal),),
  46. ),
  47. Container(
  48. width: listSize.maxWidth-hsp(200),
  49. child: Text(item['content'],style: TextStyle(fontSize: zsp(28),
  50. color: Color(index==2?(item['content']=='冻结中'?0xFFFFAE00:0xFF999999):0xFF999999)),),
  51. alignment: Alignment.centerRight,
  52. )
  53. ],
  54. );
  55. },
  56. ),
  57. );
  58. },
  59. separatorBuilder: (context,index){
  60. return Divider(height: hsp(1),thickness: hsp(1),color: Color(0xFFF5F6F8),);
  61. },
  62. itemCount: _titleArray.length,
  63. shrinkWrap: true,
  64. physics: NeverScrollableScrollPhysics(),
  65. ),
  66. ),
  67. );
  68. }
  69. }