|
|
|
@ -294,8 +294,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: (orderInfo != null && orderInfo.orderStatus == 4) |
|
|
|
|
? Color(0xFF32A060) |
|
|
|
|
: Color(0xffFE951E), |
|
|
|
|
? Color(0xFF32A060) : (orderInfo != null && orderInfo.orderStatus >= 5) ? Colors.grey : Color(0xffFE951E), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -365,7 +364,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
TextSpan( |
|
|
|
|
children: [ |
|
|
|
|
TextSpan( |
|
|
|
|
text: "共", |
|
|
|
|
text: S.of(context).gong, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF868686), |
|
|
|
@ -383,7 +382,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: "件", |
|
|
|
|
text: S.of(context).jian, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF868686), |
|
|
|
@ -399,16 +398,14 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
TextSpan( |
|
|
|
|
children: [ |
|
|
|
|
TextSpan( |
|
|
|
|
text: "合计:", |
|
|
|
|
text: S.of(context).heji, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF868686), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: S.of(context).yuan(orderInfo != null |
|
|
|
|
? orderInfo.finalPayPrice |
|
|
|
|
: "0"), |
|
|
|
|
text: totalPrice(orderInfo), |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
@ -416,7 +413,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: "元", |
|
|
|
|
text: S.of(context).yuan, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF868686), |
|
|
|
@ -431,8 +428,12 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
height: 8.h, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: statusBtn( |
|
|
|
|
orderInfo != null ? orderInfo.orderStatus : 0), |
|
|
|
|
children: (orderInfo != null) ? statusBtn( |
|
|
|
|
orderInfo.payStatus, |
|
|
|
|
orderInfo.orderStatus, |
|
|
|
|
orderInfo.isTakeOut, |
|
|
|
|
orderInfo.sendStatus, |
|
|
|
|
) : [], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
@ -443,6 +444,15 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String totalPrice(orderInfo) { |
|
|
|
|
if(orderInfo == null) return ""; |
|
|
|
|
double totalPrice = (double.tryParse(orderInfo.orderSum) + double.tryParse(orderInfo.postFee)); |
|
|
|
|
if(orderInfo.orderDetail != null && orderInfo.orderDetail.couponDTO != null) { |
|
|
|
|
totalPrice -= double.tryParse(orderInfo.orderDetail.couponDTO.money); |
|
|
|
|
} |
|
|
|
|
return "$totalPrice"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String statusText( |
|
|
|
|
refundStatus, orderStatus, payStatus, sendStatus, isTakeOut) { |
|
|
|
|
String statusText = ""; |
|
|
|
@ -462,9 +472,6 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
statusText = S.of(context).yiwancheng; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
if (refundStatus == 1) { |
|
|
|
|
statusText = S.of(context).yituikuan; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if (isTakeOut == 1) { |
|
|
|
|
if (payStatus == 0) { |
|
|
|
@ -493,9 +500,6 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (refundStatus == 1) { |
|
|
|
|
statusText = S.of(context).yituikuan; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if (isTakeOut == 2) { |
|
|
|
|
if (payStatus == 0) { |
|
|
|
@ -518,61 +522,73 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (refundStatus == 1) { |
|
|
|
|
statusText = S.of(context).yituikuan; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (orderStatus == 5) { |
|
|
|
|
statusText = S.of(context).yiquxiao; |
|
|
|
|
} |
|
|
|
|
return statusText; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Widget> statusBtn(orderStatus) { |
|
|
|
|
List<Widget> statusBtn(payStatus, orderStatus, isTakeOut, sendStatus) { |
|
|
|
|
if (orderStatus > 4) { |
|
|
|
|
return [ |
|
|
|
|
if (orderStatus == 2) |
|
|
|
|
RoundButton( |
|
|
|
|
text: S.of(context).querenshouhuo, |
|
|
|
|
text: S.of(context).zailaiyidan, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
radius: 2, |
|
|
|
|
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h), |
|
|
|
|
), |
|
|
|
|
if (orderStatus == 2) |
|
|
|
|
SizedBox( |
|
|
|
|
width: 10.w, |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
width: 72.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
margin: EdgeInsets.only(right: 10.w), |
|
|
|
|
child: TextButton( |
|
|
|
|
onPressed: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/logistics_information_page'); |
|
|
|
|
}, |
|
|
|
|
onPressed: () {}, |
|
|
|
|
style: ButtonStyle( |
|
|
|
|
padding: MaterialStateProperty.all(EdgeInsets.zero), |
|
|
|
|
side: MaterialStateProperty.all( |
|
|
|
|
BorderSide(color: Color(0xff32A060), width: 0.5), |
|
|
|
|
BorderSide( |
|
|
|
|
color: Color(0xff32A060), |
|
|
|
|
width: 0.5, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).chakanwuliu, |
|
|
|
|
style: TextStyle(color: Color(0xff32A060), fontSize: 12.sp), |
|
|
|
|
S.of(context).shanchudingdan, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xff32A060), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if (orderStatus == 3) |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
} else { |
|
|
|
|
if (payStatus == 0) { |
|
|
|
|
return [ |
|
|
|
|
RoundButton( |
|
|
|
|
text: S.of(context).zailaiyidan, |
|
|
|
|
text: S.of(context).quzhifu, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
radius: 2, |
|
|
|
|
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h), |
|
|
|
|
), |
|
|
|
|
if (orderStatus == 3) |
|
|
|
|
SizedBox( |
|
|
|
|
width: 10.w, |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
width: 72.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
margin: EdgeInsets.only(right: 10.w), |
|
|
|
|
child: TextButton( |
|
|
|
|
onPressed: () {}, |
|
|
|
|
style: ButtonStyle( |
|
|
|
@ -585,7 +601,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).shanchudingdan, |
|
|
|
|
S.of(context).quxiaozhifu, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xff32A060), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
@ -593,9 +609,81 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if (orderStatus == 0 || orderStatus == 1) |
|
|
|
|
]; |
|
|
|
|
} else { |
|
|
|
|
if (orderStatus < 4) { |
|
|
|
|
if (isTakeOut == 0) { |
|
|
|
|
return [ |
|
|
|
|
Expanded( |
|
|
|
|
flex: 1, |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only(left: 37.w), |
|
|
|
|
alignment: Alignment.centerLeft, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).qudanhao("123"), |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
} else if (isTakeOut == 1 || isTakeOut == 2) { |
|
|
|
|
// } else if (isTakeOut == 2) { |
|
|
|
|
if (sendStatus < 4) { |
|
|
|
|
return [ |
|
|
|
|
RoundButton( |
|
|
|
|
text: S.of(context).quzhifu, |
|
|
|
|
text: S.of(context).querenshouhuo, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
radius: 2, |
|
|
|
|
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 10.w, |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
width: 72.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
margin: EdgeInsets.only(right: 10.w), |
|
|
|
|
child: TextButton( |
|
|
|
|
onPressed: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/logistics_information_page'); |
|
|
|
|
}, |
|
|
|
|
style: ButtonStyle( |
|
|
|
|
padding: MaterialStateProperty.all(EdgeInsets.zero), |
|
|
|
|
side: MaterialStateProperty.all( |
|
|
|
|
BorderSide(color: Color(0xff32A060), width: 0.5), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).chakanwuliu, |
|
|
|
|
style: TextStyle(color: Color(0xff32A060), fontSize: 12.sp), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
} else { |
|
|
|
|
return [ |
|
|
|
|
RoundButton( |
|
|
|
|
text: S.of(context).zailaiyidan, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
radius: 2, |
|
|
|
|
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h), |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if (orderStatus == 4) { |
|
|
|
|
return [ |
|
|
|
|
RoundButton( |
|
|
|
|
text: S.of(context).zailaiyidan, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
@ -605,10 +693,10 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
SizedBox( |
|
|
|
|
width: 10.w, |
|
|
|
|
), |
|
|
|
|
if (orderStatus == 0 || orderStatus == 1) |
|
|
|
|
Container( |
|
|
|
|
width: 72.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
margin: EdgeInsets.only(right: 10.w), |
|
|
|
|
child: TextButton( |
|
|
|
|
onPressed: () {}, |
|
|
|
|
style: ButtonStyle( |
|
|
|
@ -621,7 +709,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).quxiaozhifu, |
|
|
|
|
S.of(context).shanchudingdan, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xff32A060), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
@ -629,24 +717,11 @@ class _OrderHistoryList extends State<OrderHistoryList>
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if (orderStatus == 3) |
|
|
|
|
Expanded( |
|
|
|
|
flex: 1, |
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only(left: 37.w), |
|
|
|
|
alignment: Alignment.centerLeft, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).qudanhao("123"), |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Widget> goodsItem(List<ProductList> products) { |
|
|
|
|
if (products == null) return []; |
|
|
|
|