|
|
@ -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, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|