Browse Source

商品列表更改;

列表部分新增占位符框架;
wr_2023_business
wurong 1 year ago
parent
commit
c90120432b
  1. 138
      lib/business_system/goods/goods_search_page.dart
  2. 128
      lib/business_system/goods/off_shelf/off_shelf_page.dart
  3. 81
      lib/business_system/goods/on_sale/goods_assort.dart
  4. 404
      lib/business_system/goods/on_sale/on_sale_page.dart
  5. 104
      lib/business_system/home/flow_page.dart
  6. 59
      lib/business_system/home/overview/trade_goods.dart
  7. 409
      lib/business_system/order/business_order_detail.dart
  8. 274
      lib/business_system/order/order_list.dart
  9. 1
      lib/store/store_order.dart

138
lib/business_system/goods/goods_search_page.dart

@ -7,6 +7,7 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shimmer/shimmer.dart';
import '../../generated/l10n.dart'; import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart'; import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart'; import '../../retrofit/data/base_data.dart';
@ -46,6 +47,7 @@ class _GoodsSearchPage extends State<GoodsSearchPage>
BusinessApiService businessService; BusinessApiService businessService;
List<AdminProductVoList> adminProductVoList = []; List<AdminProductVoList> adminProductVoList = [];
int goodsIndex = 0; int goodsIndex = 0;
bool _shimmer =true;
@override @override
void didChangeMetrics() { void didChangeMetrics() {
@ -90,6 +92,7 @@ class _GoodsSearchPage extends State<GoodsSearchPage>
status: S.current.zhengzaijiazai, status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
await queryGoodsList(); await queryGoodsList();
_shimmer = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
if (!mounted) return; if (!mounted) return;
if (refreshController.isRefresh) refreshController.refreshCompleted(); if (refreshController.isRefresh) refreshController.refreshCompleted();
@ -243,7 +246,17 @@ class _GoodsSearchPage extends State<GoodsSearchPage>
_pageIndex++; _pageIndex++;
_onRefresh(isShowLoad: false); _onRefresh(isShowLoad: false);
}, },
child: (adminProductVoList == null || child: (_shimmer)?ListView.builder(
padding: EdgeInsets.zero,
itemCount: 10,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return searchGoodsItemSm();
},
):
((adminProductVoList == null ||
adminProductVoList.length == 0) adminProductVoList.length == 0)
? NoDataView( ? NoDataView(
src: "assets/image/bs_no data_logo.webp", src: "assets/image/bs_no data_logo.webp",
@ -270,7 +283,7 @@ class _GoodsSearchPage extends State<GoodsSearchPage>
); );
}, },
), ),
), )),
), ),
), ),
) )
@ -411,4 +424,125 @@ class _GoodsSearchPage extends State<GoodsSearchPage>
), ),
); );
} }
Widget searchGoodsItemSm() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Color(0x0F06152E).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
)
],
),
margin: EdgeInsets.only(bottom: 12.h, left: 16.w, right: 16.w),
padding:
EdgeInsets.only(left: 12.w, top: 12.h, bottom: 12.h, right: 24.w),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(4),
),
width: 70.h,
height: 70.h,
),
),
SizedBox(
width: 12.w,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 11.h, top: 2.h),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 124.w,
height: 20.h,
),
),
),
Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 43.w,
height: 18.h,
),
),
SizedBox(
width: 8.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 43.w,
height: 18.h,
),
),
],
),
SizedBox(height: 7.h,),
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: 24.w,
height: 18.h,
),
),
],
)
],
)),
],
),
);
}
} }

128
lib/business_system/goods/off_shelf/off_shelf_page.dart

@ -8,6 +8,7 @@ import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart'; import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart'; import '../../../retrofit/business_api.dart';
@ -40,6 +41,7 @@ class _OffShelfPage extends State<OffShelfPage> {
BusinessApiService businessService; BusinessApiService businessService;
List<AdminProductVoList> adminProductVoList = []; List<AdminProductVoList> adminProductVoList = [];
List<dynamic> productIds = []; List<dynamic> productIds = [];
bool _shimmer = true;
@override @override
void dispose() { void dispose() {
@ -59,6 +61,7 @@ class _OffShelfPage extends State<OffShelfPage> {
status: S.current.zhengzaijiazai, status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
await queryGoodsList(); await queryGoodsList();
_shimmer = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
if (!mounted) return; if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted(); if (_refreshController.isRefresh) _refreshController.refreshCompleted();
@ -222,7 +225,18 @@ class _OffShelfPage extends State<OffShelfPage> {
}, },
child: Container( child: Container(
color: Colors.white, color: Colors.white,
child: (adminProductVoList == null || child: (_shimmer)?ListView.builder(
itemCount:10,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: shelfGoodsItemSm(),
);
},
):
((adminProductVoList == null ||
adminProductVoList.length == 0) adminProductVoList.length == 0)
? NoDataView( ? NoDataView(
src: "assets/image/bs_no data_logo.webp", src: "assets/image/bs_no data_logo.webp",
@ -242,7 +256,7 @@ class _OffShelfPage extends State<OffShelfPage> {
adminProductVoList[position]), adminProductVoList[position]),
); );
}, },
), ))
)), )),
), ),
), ),
@ -551,4 +565,114 @@ class _OffShelfPage extends State<OffShelfPage> {
), ),
); );
} }
Widget shelfGoodsItemSm() {
return Container(
margin: EdgeInsets.only(bottom: 22.h),
padding: EdgeInsets.only(
left: 5.w,
),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 16.h,
height: 16.h,
),
),
SizedBox(
width: 18.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(4),
),
width: 70.h,
height: 70.h,
),
),
SizedBox(
width: 12.w,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 11.h, top: 2.h),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 112.w,
height: 20.h,
),
),
),
Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 43.w,
height: 18.h,
),
),
SizedBox(
width: 8.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 43.w,
height: 18.h,
),
),
],
),
SizedBox(
height: 7.h,
),
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,
),
),
],
)),
],
),
);
}
} }

81
lib/business_system/goods/on_sale/goods_assort.dart

@ -6,6 +6,7 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart'; import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart'; import '../../../retrofit/business_api.dart';
@ -35,6 +36,7 @@ class _GoodsAssort extends State<GoodsAssort> {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
BusinessApiService businessService; BusinessApiService businessService;
ProductGroupList productGroupList; ProductGroupList productGroupList;
bool _shimmer = true;
@override @override
void initState() { void initState() {
@ -48,6 +50,7 @@ class _GoodsAssort extends State<GoodsAssort> {
status: S.current.zhengzaijiazai, status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
await queryProductGroupList(); await queryProductGroupList();
_shimmer = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted(); if (refreshController.isRefresh) refreshController.refreshCompleted();
if (mounted) if (mounted)
@ -138,7 +141,19 @@ class _GoodsAssort extends State<GoodsAssort> {
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
scrollController: ScrollController(), scrollController: ScrollController(),
child: Container( child: Container(
child: (productGroupList == null || child: (_shimmer)?ListView.builder(
itemCount: 10,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: assortItemSm(),
);
},
):
((productGroupList == null ||
productGroupList.records.length == 0) productGroupList.records.length == 0)
? NoDataView( ? NoDataView(
src: "assets/image/bs_no data_logo.webp", src: "assets/image/bs_no data_logo.webp",
@ -158,7 +173,7 @@ class _GoodsAssort extends State<GoodsAssort> {
child: assortItem(productGroupList.records[position]), child: assortItem(productGroupList.records[position]),
); );
}, },
), )),
), ),
), ),
)), )),
@ -284,6 +299,68 @@ class _GoodsAssort extends State<GoodsAssort> {
); );
} }
Widget assortItemSm() {
return Container(
child: Column(
children: [
Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 112.w,
height: 20.h,
),
),
Spacer(),
Padding(
padding: EdgeInsets.symmetric(horizontal: 17.w),
child: 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,
),
),
),
Padding(
padding: EdgeInsets.only(right: 16.w, left: 17.w),
child: 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,
),
),
),
],
),
Container(
margin: EdgeInsets.symmetric(vertical: 16.h),
color: Color(0xFFEBEBEB),
height: 1.h,
width: double.infinity,
)
],
),
);
}
/// ///
showDelGroupDialog(id) { showDelGroupDialog(id) {
showDialog( showDialog(

404
lib/business_system/goods/on_sale/on_sale_page.dart

@ -8,6 +8,7 @@ import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart'; import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart'; import '../../../retrofit/business_api.dart';
@ -34,6 +35,7 @@ class OnSalePage extends StatefulWidget {
class _OnSalePage extends State<OnSalePage> { class _OnSalePage extends State<OnSalePage> {
final RefreshController _refreshController = RefreshController(); final RefreshController _refreshController = RefreshController();
final RefreshController refreshController = RefreshController();
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics();
final ScrollController controller = ScrollController(); final ScrollController controller = ScrollController();
BusinessApiService businessService; BusinessApiService businessService;
@ -42,11 +44,13 @@ class _OnSalePage extends State<OnSalePage> {
int _loadCount = 0; int _loadCount = 0;
int _pageIndex = 1; int _pageIndex = 1;
int groupIndex = -1; int groupIndex = -1;
bool _shimmer = true;
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
_refreshController.dispose(); _refreshController.dispose();
refreshController.dispose();
} }
@override @override
@ -67,7 +71,9 @@ class _OnSalePage extends State<OnSalePage> {
tenant: BusinessInstance.instance.businessTenant, tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId); storeId: widget.storeId);
queryProductGroupList(); queryProductGroupList();
queryGoodsList("", isSing: false); queryGoodsList(
groupIndex != -1 ? productGroupList.records[groupIndex].id : "",
isSing: false);
}); });
} }
@ -75,8 +81,9 @@ class _OnSalePage extends State<OnSalePage> {
_loadCount += 1; _loadCount += 1;
if (_loadCount == 2) { if (_loadCount == 2) {
_loadCount = 0; _loadCount = 0;
_shimmer = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
if (_refreshController.isRefresh) _refreshController.refreshCompleted(); if (refreshController.isRefresh) refreshController.refreshCompleted();
if (!mounted) setState(() {}); if (!mounted) setState(() {});
} }
} }
@ -93,8 +100,8 @@ class _OnSalePage extends State<OnSalePage> {
}).catchError((error) { }).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center); alignment: Alignment.center);
_refreshController.refreshFailed(); refreshController.refreshFailed();
_refreshController.loadFailed(); refreshController.loadFailed();
}); });
if (!mounted) return; if (!mounted) return;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -109,10 +116,10 @@ class _OnSalePage extends State<OnSalePage> {
/// ///
queryGoodsList(groupId, {isSing = true}) async { queryGoodsList(groupId, {isSing = true}) async {
if(isSing) if (isSing)
EasyLoading.show( EasyLoading.show(
status: S.current.zhengzaijiazai, status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
try { try {
BaseData<BusinessGoods> baseData = BaseData<BusinessGoods> baseData =
await businessService.findAdminProductLis({ await businessService.findAdminProductLis({
@ -125,18 +132,23 @@ class _OnSalePage extends State<OnSalePage> {
}).catchError((error) { }).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center); alignment: Alignment.center);
_refreshController.refreshFailed(); // _refreshController.refreshFailed();
_refreshController.loadFailed(); // _refreshController.loadFailed();
refreshController.refreshFailed();
refreshController.loadFailed();
}); });
if (!mounted) return; if (!mounted) return;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
adminProductVoList.addAll(baseData?.data?.adminProductVOList ?? []); adminProductVoList.addAll(baseData?.data?.adminProductVOList ?? []);
widget.total(baseData.data.total.toString()); widget.total(baseData.data.total.toString());
if ((baseData?.data?.adminProductVOList ?? []).isEmpty || if ((baseData?.data?.adminProductVOList ?? []).isEmpty ||
adminProductVoList.length == baseData.data.total) adminProductVoList.length == baseData.data.total) {
_refreshController.loadNoData(); // _refreshController.loadNoData();
else refreshController.loadNoData();
_refreshController.loadComplete(); } else {
// _refreshController.loadComplete();
refreshController.loadComplete();
}
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
@ -151,7 +163,7 @@ class _OnSalePage extends State<OnSalePage> {
} }
/// ///
queryGoodsUpdate() async { queryGoodsUpdate({isSing = true}) async {
if (businessService == null) { if (businessService == null) {
businessService = BusinessApiService(Dio(), businessService = BusinessApiService(Dio(),
context: context, context: context,
@ -164,7 +176,11 @@ class _OnSalePage extends State<OnSalePage> {
"sell": false, "sell": false,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
await queryGoodsList(groupIndex == -1?"":productGroupList?.records[groupIndex]?.id ?? ""); _pageIndex = 1;
adminProductVoList.clear();
await queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex]?.id ?? "");
SmartDialog.showToast("商品下架成功", alignment: Alignment.center); SmartDialog.showToast("商品下架成功", alignment: Alignment.center);
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -180,91 +196,144 @@ class _OnSalePage extends State<OnSalePage> {
children: [ children: [
Column( Column(
children: [ children: [
Column( goodsSearch(),
crossAxisAlignment: CrossAxisAlignment.start, Container(
children: [ color: Color(0xFFEBEBEB),
goodsSearch(), height: 1.h,
Container( width: double.infinity,
color: Color(0xFFEBEBEB),
height: 1.h,
width: double.infinity,
),
],
), ),
Expanded( Expanded(
child: Container( child: Container(
child: Row( child: SmartRefresher(
mainAxisAlignment: MainAxisAlignment.start, controller: refreshController,
crossAxisAlignment: CrossAxisAlignment.start, enablePullDown: true,
children: [ enablePullUp: false,
Container( header: MyHeader(
width: 100.w, color: Color(0xFF30415B),
child: ListView.builder( ),
itemCount: productGroupList?.records?.length ?? 0, physics: BouncingScrollPhysics(),
physics: BouncingScrollPhysics(), footer: CustomFooter(
shrinkWrap: true, builder: (context, mode) {
itemBuilder: (context, position) { return MyFooter(mode);
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
groupIndex = position;
_pageIndex = 1;
adminProductVoList.clear();
queryGoodsList(
productGroupList?.records[position].id,
isSing: false);
});
},
child: leftItem(
productGroupList.records[position], position),
);
},
),
),
Container(
width: MediaQuery.of(context).size.width - 100.w,
child: SmartRefresher(
controller: _refreshController,
enablePullDown: false,
enablePullUp: adminProductVoList.length != 0 ?true:false,
header: MyHeader(
color: Color(0xFF30415B),
),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onLoading: () {
_pageIndex++;
queryGoodsList(groupIndex == -1 ? "":productGroupList?.records[groupIndex].id);
},
child: Container(
color: Colors.white,
child: (adminProductVoList == null || adminProductVoList.length == 0)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "该分组暂无添加商品",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: ListView.builder(
itemCount: adminProductVoList?.length ?? 0,
controller: controller,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return rightGoodsItem(
adminProductVoList[position]);
}, },
), ),
)), onRefresh: () {
), _pageIndex = 1;
], adminProductVoList.clear();
) _onRefresh(isShowLoad: false);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 100.w,
child: (_shimmer)
? ListView.builder(
itemCount: 10,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return leftItemSm();
},
)
: ListView.builder(
itemCount:
productGroupList?.records?.length ??
0,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
groupIndex = position;
_pageIndex = 1;
adminProductVoList.clear();
queryGoodsList(
productGroupList
?.records[position].id,
isSing: false);
});
},
child: leftItem(
productGroupList
.records[position],
position),
);
},
),
),
Container(
width:
MediaQuery.of(context).size.width - 100.w,
child: SmartRefresher(
controller: _refreshController,
enablePullDown: false,
enablePullUp: adminProductVoList.length != 0
? true
: false,
header: MyHeader(
color: Color(0xFF30415B),
),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onLoading: () {
_pageIndex++;
queryGoodsList(groupIndex == -1
? ""
: productGroupList
?.records[groupIndex].id);
},
child: Container(
color: Colors.white,
child: (_shimmer)
? ListView.builder(
itemCount: 10,
physics:
BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder:
(context, position) {
return rightGoodsSm();
},
)
: ((adminProductVoList == null ||
adminProductVoList.length ==
0)
? NoDataView(
src:
"assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "该分组暂无添加商品",
fontSize: 16.sp,
margin:
EdgeInsets.all(20.h),
)
: ListView.builder(
itemCount:
adminProductVoList
?.length ??
0,
controller: controller,
physics:
BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder:
(context, position) {
return rightGoodsItem(
adminProductVoList[
position]);
},
)))),
),
],
))
// SmartRefresher( // SmartRefresher(
// controller: _refreshController, // controller: _refreshController,
// enablePullDown: true, // enablePullDown: true,
@ -285,7 +354,7 @@ class _OnSalePage extends State<OnSalePage> {
// }, // },
// onLoading: () { // onLoading: () {
// _pageIndex++; // _pageIndex++;
// queryGoodsList(); // queryGoodsList(groupIndex == -1 ? "" : productGroupList.records[groupIndex].id);
// }, // },
// child: Container( // child: Container(
// color: Colors.white, // color: Colors.white,
@ -303,7 +372,7 @@ class _OnSalePage extends State<OnSalePage> {
// return GestureDetector( // return GestureDetector(
// behavior: HitTestBehavior.opaque, // behavior: HitTestBehavior.opaque,
// onTap: () {}, // onTap: () {},
// child: leftItem(productGroupList.records[position]), // child: leftItem(productGroupList.records[position],position),
// ); // );
// }, // },
// ), // ),
@ -511,9 +580,12 @@ class _OnSalePage extends State<OnSalePage> {
records?.groupName ?? "", records?.groupName ?? "",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: groupIndex == index ? Color(0xFF30415B):Color(0xFF626264), color:
groupIndex == index ? Color(0xFF30415B) : Color(0xFF626264),
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: groupIndex == index ? MyFontWeight.semi_bold : MyFontWeight.regular, fontWeight: groupIndex == index
? MyFontWeight.semi_bold
: MyFontWeight.regular,
), ),
)), )),
], ],
@ -605,7 +677,7 @@ class _OnSalePage extends State<OnSalePage> {
), ),
)), )),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
queryGoodsUpdate(); queryGoodsUpdate();
}, },
child: Container( child: Container(
@ -618,7 +690,7 @@ class _OnSalePage extends State<OnSalePage> {
), ),
), ),
padding: padding:
EdgeInsets.symmetric(vertical: 2.h, horizontal: 12.w), EdgeInsets.symmetric(vertical: 2.h, horizontal: 12.w),
child: Text( child: Text(
"下架", "下架",
style: TextStyle( style: TextStyle(
@ -637,4 +709,132 @@ class _OnSalePage extends State<OnSalePage> {
), ),
); );
} }
Widget leftItemSm() {
return Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.w),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 48.w,
height: 30.h,
),
),
);
}
Widget rightGoodsSm() {
return Container(
margin: EdgeInsets.only(bottom: 21.h, left: 16.w, right: 16.w, top: 10.h),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(4),
),
width: 70.h,
height: 70.h,
),
),
SizedBox(
width: 12.w,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 11.h, top: 2.h),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 124.w,
height: 20.h,
),
),
),
Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 43.w,
height: 18.h,
),
),
SizedBox(
width: 8.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 43.w,
height: 18.h,
),
),
],
),
SizedBox(
height: 7.h,
),
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: 24.w,
height: 18.h,
),
),
],
)
],
)),
],
),
);
}
} }

104
lib/business_system/home/flow_page.dart

@ -8,6 +8,7 @@ import 'package:intl/intl.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:shimmer/shimmer.dart';
import '../../generated/l10n.dart'; import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart'; import '../../retrofit/business_api.dart';
@ -38,7 +39,7 @@ class _FlowPage extends State<FlowPage> {
List<DayFlowList> dayFlowList = []; List<DayFlowList> dayFlowList = [];
int _loadCount = 0; int _loadCount = 0;
String _datetime; String _datetime;
bool _shimmer = true;
@override @override
void initState() { void initState() {
@ -56,7 +57,11 @@ class _FlowPage extends State<FlowPage> {
token: BusinessInstance.instance.businessToken, token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant, tenant: BusinessInstance.instance.businessTenant,
storeId: storeId); storeId: storeId);
queryDayFlow(_datetime == null ? DateFormat("yyyy-MM-dd").format(DateTime.now()):(_datetime+"-01"), "0", queryDayFlow(
_datetime == null
? DateFormat("yyyy-MM-dd").format(DateTime.now())
: (_datetime + "-01"),
"0",
isSing: false); isSing: false);
}); });
} }
@ -65,6 +70,7 @@ class _FlowPage extends State<FlowPage> {
_loadCount += 1; _loadCount += 1;
if (_loadCount == 1) { if (_loadCount == 1) {
_loadCount = 0; _loadCount = 0;
_shimmer = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted(); if (refreshController.isRefresh) refreshController.refreshCompleted();
if (mounted) setState(() {}); if (mounted) setState(() {});
@ -142,7 +148,9 @@ class _FlowPage extends State<FlowPage> {
child: Row( child: Row(
children: [ children: [
Text( Text(
_datetime == null ? DateFormat("yyyy年MM月").format(DateTime.now()) : "${_datetime.replaceAll("-", "")}", _datetime == null
? DateFormat("yyyy年MM月").format(DateTime.now())
: "${_datetime.replaceAll("-", "")}",
style: TextStyle( style: TextStyle(
fontSize: 15.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -160,6 +168,7 @@ class _FlowPage extends State<FlowPage> {
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
if(!_shimmer)
(dayFlowList == null || dayFlowList.length == 0) (dayFlowList == null || dayFlowList.length == 0)
? NoDataView( ? NoDataView(
src: "assets/image/bs_no data_logo.webp", src: "assets/image/bs_no data_logo.webp",
@ -180,7 +189,18 @@ class _FlowPage extends State<FlowPage> {
child: billItem(dayFlowList[position]), child: billItem(dayFlowList[position]),
); );
}, },
) ),
if(_shimmer)
ListView.builder(
padding: EdgeInsets.zero,
itemCount: 10,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return billItemSm();
},
)
], ],
), ),
), ),
@ -269,6 +289,78 @@ class _FlowPage extends State<FlowPage> {
); );
} }
Widget billItemSm() {
return Container(
margin: EdgeInsets.only(bottom: 12.h),
padding: EdgeInsets.all(12),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(6),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 50.w,
height: 20.h,
),
),
Spacer(),
Icon(
Icons.keyboard_arrow_down,
color: Color(0xFF0D0D0D),
size: 24,
),
],
),
Padding(
padding: EdgeInsets.only(
top: 16.h,
),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 114.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,
),
),
],
))
],
),
);
}
/// ///
Widget billIDetailsItem(DayFlowList detailList) { Widget billIDetailsItem(DayFlowList detailList) {
return Container( return Container(
@ -332,7 +424,7 @@ class _FlowPage extends State<FlowPage> {
)); ));
} }
showDateSelector() async { showDateSelector() async {
String dateTime = await showModalBottomSheet( String dateTime = await showModalBottomSheet(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
context: context, context: context,
@ -341,7 +433,7 @@ class _FlowPage extends State<FlowPage> {
}); });
if (dateTime != null) { if (dateTime != null) {
_datetime = dateTime; _datetime = dateTime;
queryDayFlow(_datetime+"-01", "0"); queryDayFlow(_datetime + "-01", "0");
} }
} }
} }

59
lib/business_system/home/overview/trade_goods.dart

@ -9,6 +9,7 @@ import 'package:intl/intl.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart'; import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart'; import '../../../retrofit/business_api.dart';
@ -49,6 +50,7 @@ class _TradeGoods extends State<TradeGoods> {
BusinessApiService businessService; BusinessApiService businessService;
List<SingleSalesList> singleSalesList = []; List<SingleSalesList> singleSalesList = [];
List<GoodsTypeSalesList> goodsTypeSalesList = []; List<GoodsTypeSalesList> goodsTypeSalesList = [];
bool _shimmer = true;
@override @override
void dispose() { void dispose() {
@ -173,6 +175,7 @@ class _TradeGoods extends State<TradeGoods> {
_loadCount += 1; _loadCount += 1;
if (_loadCount == 2) { if (_loadCount == 2) {
_loadCount = 0; _loadCount = 0;
_shimmer = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
if (_refreshController.isRefresh) _refreshController.refreshCompleted(); if (_refreshController.isRefresh) _refreshController.refreshCompleted();
if (mounted) setState(() {}); if (mounted) setState(() {});
@ -762,6 +765,7 @@ class _TradeGoods extends State<TradeGoods> {
], ],
), ),
), ),
if(!_shimmer)
(goodsTypeSalesList == null || goodsTypeSalesList.length == 0) (goodsTypeSalesList == null || goodsTypeSalesList.length == 0)
? NoDataView( ? NoDataView(
src: "assets/image/bs_no data_logo.webp", src: "assets/image/bs_no data_logo.webp",
@ -786,7 +790,18 @@ class _TradeGoods extends State<TradeGoods> {
); );
}, },
), ),
) ),
if(_shimmer)
ListView.builder(
padding: EdgeInsets.zero,
itemCount: 9,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return goodsTypeItemSm(position);
},
)
], ],
), ),
), ),
@ -823,6 +838,48 @@ class _TradeGoods extends State<TradeGoods> {
); );
} }
Widget goodsTypeItemSm(index) {
return Container(
margin: EdgeInsets.only(bottom: 12.h),
padding: EdgeInsets.only(top: 8.h, left: 11.w, right: 24.w, bottom: 7.h),
width: double.infinity,
decoration: BoxDecoration(
color: index % 2 == 0 ? Color(0xFFF9FAF8) : Colors.white,
borderRadius: BorderRadius.circular(6),
),
child:
Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 50.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: 50.w,
height: 20.h,
),
),
],
),
);
}
/// ///
Widget singleSalesStatement() { Widget singleSalesStatement() {
return Container( return Container(

409
lib/business_system/order/business_order_detail.dart

@ -8,6 +8,7 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';
import '../../generated/l10n.dart'; import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart'; import '../../retrofit/business_api.dart';
@ -32,6 +33,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
BusinessApiService businessService; BusinessApiService businessService;
BusinessOrderDetailInfo orderDetailInfo; BusinessOrderDetailInfo orderDetailInfo;
bool _shimmer = true;
@override @override
void initState() { void initState() {
@ -69,6 +71,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center); SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center);
} }
} finally { } finally {
_shimmer = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted(); if (refreshController.isRefresh) refreshController.refreshCompleted();
setState(() {}); setState(() {});
@ -106,7 +109,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
child: Container( child: Container(
margin: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w), margin: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w),
child: Column( child: Column(
children: [goodsInfo(), orderInfo()], children: [goodsInfo(), (_shimmer)?orderInfoSm():orderInfo()],
), ),
), ),
), ),
@ -162,6 +165,16 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
SizedBox( SizedBox(
height: 12.h, 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( ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount: orderDetailInfo?.orderProductDTOList?.length ?? 0, itemCount: orderDetailInfo?.orderProductDTOList?.length ?? 0,
@ -169,12 +182,10 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
shrinkWrap: true, shrinkWrap: true,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return goodsInfoItem(orderDetailInfo.orderProductDTOList[position]);
onTap: () {},
child: 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) { Widget orderInfoItem(leftText, rightText) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),

274
lib/business_system/order/order_list.dart

@ -8,6 +8,7 @@ import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:shimmer/shimmer.dart';
import '../../../utils/font_weight.dart'; import '../../../utils/font_weight.dart';
import '../../generated/l10n.dart'; import '../../generated/l10n.dart';
@ -40,6 +41,7 @@ class _OrderList extends State<OrderList> {
BusinessApiService businessService; BusinessApiService businessService;
List<AdminOrderDtoList> adminOrderDTOList = []; List<AdminOrderDtoList> adminOrderDTOList = [];
int _pageIndex = 1; int _pageIndex = 1;
bool _shimmer = true;
@override @override
void dispose() { void dispose() {
@ -59,6 +61,7 @@ class _OrderList extends State<OrderList> {
status: S.current.zhengzaijiazai, status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
await queryOrderList(); await queryOrderList();
_shimmer = false;
EasyLoading.dismiss(); EasyLoading.dismiss();
if (!mounted) return; if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted(); if (_refreshController.isRefresh) _refreshController.refreshCompleted();
@ -68,7 +71,6 @@ class _OrderList extends State<OrderList> {
/// ///
queryOrderList() async { queryOrderList() async {
if (businessService == null) { if (businessService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
businessService = BusinessApiService(Dio(), businessService = BusinessApiService(Dio(),
context: context, context: context,
token: BusinessInstance.instance.businessToken, token: BusinessInstance.instance.businessToken,
@ -139,7 +141,16 @@ class _OrderList extends State<OrderList> {
_pageIndex++; _pageIndex++;
_onRefresh(isShowLoad: false); _onRefresh(isShowLoad: false);
}, },
child: (adminOrderDTOList == null || adminOrderDTOList.length == 0) child: (_shimmer) ? ListView.builder(
padding: EdgeInsets.zero,
itemCount: 10,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return orderItemSm();
},
): ((adminOrderDTOList == null || adminOrderDTOList.length == 0)
? NoDataView( ? NoDataView(
src: "assets/image/bs_no data_logo.webp", src: "assets/image/bs_no data_logo.webp",
isShowBtn: false, isShowBtn: false,
@ -158,14 +169,18 @@ class _OrderList extends State<OrderList> {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context).pushNamed(
.pushNamed('/router/business_order_detail',arguments: {"id":adminOrderDTOList[position].id,"storeId":widget.storeId}); '/router/business_order_detail',
arguments: {
"id": adminOrderDTOList[position].id,
"storeId": widget.storeId
});
}, },
child: orderItem(adminOrderDTOList[position]), child: orderItem(adminOrderDTOList[position]),
); );
}, },
), ),
), )),
); );
} }
@ -404,4 +419,253 @@ class _OrderList extends State<OrderList> {
), ),
); );
} }
Widget orderItemSm() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.h),
padding: EdgeInsets.symmetric(vertical: 12.h),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(bottom: 12.h, left: 12.w, right: 12.w),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 16.h,
height: 16.h,
),
),
SizedBox(
width: 3.w,
),
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,
),
),
Spacer(),
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,
),
),
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 17.h, bottom: 13.h),
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: 5,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: orderGoodsSm(),
);
},
),
),
Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 20.h,
),
),
Padding(
padding: EdgeInsets.only(left: 14.w),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 118.w,
height: 20.h,
),
),
),
],
),
SizedBox(
height: 4.h,
),
Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 20.h,
),
),
SizedBox(
width: 14.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 73.w,
height: 20.h,
),
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
margin: EdgeInsets.only(left: 4.w),
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 45.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: 36.w,
height: 20.h,
),
),
],
),
SizedBox(
height: 20.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
margin: EdgeInsets.only(right: 20.w),
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 76.w,
height: 27.h,
),
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 76.w,
height: 27.h,
),
),
],
)
],
),
),
],
),
);
}
Widget orderGoodsSm() {
return Container(
margin: EdgeInsets.only(bottom: 13.h),
child: Row(
children: [
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,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 17.w,
height: 20.h,
),
),
],
),
);
}
} }

1
lib/store/store_order.dart

@ -1054,7 +1054,6 @@ class _Title extends State<Title> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
widget.controller.addListener(() { widget.controller.addListener(() {
double maxScrollExtent = widget.controller.position.maxScrollExtent; double maxScrollExtent = widget.controller.position.maxScrollExtent;
double alphaHeight = (kToolbarHeight) / 2; double alphaHeight = (kToolbarHeight) / 2;

Loading…
Cancel
Save