|
|
|
@ -8,6 +8,7 @@ import 'package:huixiang/view_widget/custom_image.dart';
|
|
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
import 'package:shimmer/shimmer.dart'; |
|
|
|
|
|
|
|
|
|
import '../../generated/l10n.dart'; |
|
|
|
|
import '../../retrofit/business_api.dart'; |
|
|
|
@ -32,6 +33,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
|
|
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
|
BusinessApiService businessService; |
|
|
|
|
BusinessOrderDetailInfo orderDetailInfo; |
|
|
|
|
bool _shimmer = true; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
@ -69,6 +71,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
|
|
|
|
|
SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} finally { |
|
|
|
|
_shimmer = false; |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
if (refreshController.isRefresh) refreshController.refreshCompleted(); |
|
|
|
|
setState(() {}); |
|
|
|
@ -106,7 +109,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
|
|
|
|
|
child: Container( |
|
|
|
|
margin: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w), |
|
|
|
|
child: Column( |
|
|
|
|
children: [goodsInfo(), orderInfo()], |
|
|
|
|
children: [goodsInfo(), (_shimmer)?orderInfoSm():orderInfo()], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -162,6 +165,16 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
|
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
(_shimmer)?ListView.builder( |
|
|
|
|
padding: EdgeInsets.zero, |
|
|
|
|
itemCount: 3, |
|
|
|
|
scrollDirection: Axis.vertical, |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return goodsInfoSm(); |
|
|
|
|
}, |
|
|
|
|
): |
|
|
|
|
ListView.builder( |
|
|
|
|
padding: EdgeInsets.zero, |
|
|
|
|
itemCount: orderDetailInfo?.orderProductDTOList?.length ?? 0, |
|
|
|
@ -169,12 +182,10 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
|
|
|
|
|
shrinkWrap: true, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: goodsInfoItem(orderDetailInfo.orderProductDTOList[position]), |
|
|
|
|
); |
|
|
|
|
return goodsInfoItem(orderDetailInfo.orderProductDTOList[position]); |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
@ -337,6 +348,394 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget goodsInfoSm(){ |
|
|
|
|
return Container( |
|
|
|
|
margin: EdgeInsets.only(bottom: 12.h), |
|
|
|
|
height: 77.h, |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(4), |
|
|
|
|
), |
|
|
|
|
width: 77.h, |
|
|
|
|
height: 77.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 12.w, |
|
|
|
|
), |
|
|
|
|
Expanded(child:Column( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 117.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 15.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 29.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
)) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget orderInfoSm(){ |
|
|
|
|
return Container( |
|
|
|
|
padding: EdgeInsets.all(12), |
|
|
|
|
margin: EdgeInsets.only(top: 12.h,bottom:30.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.circular( |
|
|
|
|
2, |
|
|
|
|
), |
|
|
|
|
boxShadow: [ |
|
|
|
|
BoxShadow( |
|
|
|
|
color: Color(0x0F06152E).withAlpha(12), |
|
|
|
|
offset: Offset(0, 2), |
|
|
|
|
blurRadius: 4, |
|
|
|
|
spreadRadius: 0, |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 2.w, |
|
|
|
|
height: 16.h, |
|
|
|
|
color: Color(0xFF30415B), |
|
|
|
|
margin: EdgeInsets.only(right: 4.w), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"订单信息", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
fontWeight: MyFontWeight.semi_bold), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
Padding(padding:EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 42.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 171.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
Padding(padding:EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 56.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 147.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
Padding(padding:EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 28.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 70.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
Padding(padding:EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 42.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 34.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
Padding(padding:EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 42.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 84.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
Padding(padding:EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 56.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 25.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
Padding(padding:EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 56.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 38.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
Padding(padding:EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 56.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 55.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
Padding(padding:EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 56.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
width: 147.w, |
|
|
|
|
height: 20.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget orderInfoItem(leftText, rightText) { |
|
|
|
|
return Container( |
|
|
|
|
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), |
|
|
|
|