Browse Source

商品一键置顶功能完成;

商品板块流程性能优化更改;
生意总览页面优化;
订单列表键盘与底部点击事件冲突的处理;
商品搜索流程优化更改;
wr_2023_business
wurong 1 year ago
parent
commit
5ad5f04975
  1. 21
      lib/business_system/business_scan_code.dart
  2. 8
      lib/business_system/goods/goods_search_page.dart
  3. 4
      lib/business_system/goods/on_sale/add_assort.dart
  4. 49
      lib/business_system/goods/on_sale/batch_shelf.dart
  5. 397
      lib/business_system/goods/on_sale/goods_sort.dart
  6. 19
      lib/business_system/goods/on_sale/on_sale_page.dart
  7. 5
      lib/business_system/home/home_view/donut_auto_label_chart.dart
  8. 7
      lib/business_system/home/home_view/my_arc_label_decorator.dart
  9. 35
      lib/business_system/home/home_view/my_line_chart.dart
  10. 2
      lib/business_system/home/overview/trade_goods.dart
  11. 9
      lib/business_system/home/overview/trade_order.dart
  12. 19
      lib/business_system/home/overview/trade_summary.dart
  13. 168
      lib/business_system/mine/business_mine_page.dart
  14. 8
      lib/business_system/order/business_order_page.dart
  15. 8
      lib/business_system/order/order_list.dart
  16. 5
      lib/retrofit/business_api.dart
  17. 22
      lib/retrofit/business_api.g.dart
  18. 11
      lib/view_widget/icon_text.dart

21
lib/business_system/business_scan_code.dart

@ -53,7 +53,6 @@ class _BusinessScanCode extends State<BusinessScanCode>
onCapture: (data) { onCapture: (data) {
if (data != null && data != "") { if (data != null && data != "") {
// Navigator.of(context).pop(data); // Navigator.of(context).pop(data);
} }
}, },
), ),
@ -70,17 +69,17 @@ class _BusinessScanCode extends State<BusinessScanCode>
child: Container( child: Container(
margin: EdgeInsets.only(left:12.w,right: 16.w,top: 16.h), margin: EdgeInsets.only(left:12.w,right: 16.w,top: 16.h),
child:Row( child:Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(child:Text( // Expanded(child:Text(
S.of(context).saoma, // S.of(context).saoma,
style: TextStyle( // style: TextStyle(
color: Colors.white, // color: Colors.white,
fontSize: 18.sp, // fontSize: 18.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
)), // )),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
@ -91,7 +90,7 @@ class _BusinessScanCode extends State<BusinessScanCode>
child: Text( child: Text(
S.of(context).xiangce, S.of(context).xiangce,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.white,
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),

8
lib/business_system/goods/goods_search_page.dart

@ -137,6 +137,10 @@ class _GoodsSearchPage extends State<GoodsSearchPage>
/// ///
queryGoodsUpdate() async { queryGoodsUpdate() async {
try{
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) { if (businessService == null) {
businessService = BusinessApiService(Dio(), businessService = BusinessApiService(Dio(),
context: context, context: context,
@ -153,10 +157,12 @@ class _GoodsSearchPage extends State<GoodsSearchPage>
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
_pageIndex = 1; _pageIndex = 1;
adminProductVoList.clear(); adminProductVoList.clear();
await _onRefresh(); await _onRefresh(isShowLoad: false);
SmartDialog.showToast(widget.arguments["onSaleStatus"] == "1"?"商品下架成功":"商品上架成功", alignment: Alignment.center); SmartDialog.showToast(widget.arguments["onSaleStatus"] == "1"?"商品下架成功":"商品上架成功", alignment: Alignment.center);
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}}finally{
EasyLoading.dismiss();
} }
} }

4
lib/business_system/goods/on_sale/add_assort.dart

@ -61,6 +61,7 @@ class _AddAssort extends State<AddAssort> {
///-/ ///-/
querySaveProductGroup() async { querySaveProductGroup() async {
try{
EasyLoading.show( EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (businessService == null) { if (businessService == null) {
@ -80,7 +81,6 @@ class _AddAssort extends State<AddAssort> {
editingSortController.text == "" ? "1" : editingSortController.text, editingSortController.text == "" ? "1" : editingSortController.text,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
EasyLoading.dismiss();
Navigator.of(context).pop(); Navigator.of(context).pop();
if (name == "添加分类") if (name == "添加分类")
showProductTipDialog(); showProductTipDialog();
@ -89,6 +89,8 @@ class _AddAssort extends State<AddAssort> {
alignment: Alignment.center); alignment: Alignment.center);
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}}finally{
EasyLoading.dismiss();
} }
} }

49
lib/business_system/goods/on_sale/batch_shelf.dart

@ -154,27 +154,36 @@ class _BatchShelf extends State<BatchShelf> {
} }
queryGoodsUpdate() async { queryGoodsUpdate() async {
if (businessService == null) { try{
businessService = BusinessApiService(Dio(), EasyLoading.show(
context: context, status: S.current.zhengzaijiazai,
token: BusinessInstance.instance.businessToken, maskType: EasyLoadingMaskType.black);
tenant: BusinessInstance.instance.businessTenant, if (businessService == null) {
storeId: widget.arguments["storeId"]); businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData baseData = await businessService.goodsUpdate({
"productId": 0,
"productIds": productIds ?? [],
"sell": false,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
_pageIndex = 1;
adminProductVoList.clear();
await queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex]?.id ?? "", isSing: false);
setState(() {});
SmartDialog.showToast("商品下架成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
} }
BaseData baseData = await businessService.goodsUpdate({ finally{
"productId": 0, EasyLoading.dismiss();
"productIds": productIds ?? [],
"sell": false,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
_pageIndex = 1;
adminProductVoList.clear();
await queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex]?.id ?? "");
SmartDialog.showToast("商品下架成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
} }

397
lib/business_system/goods/on_sale/goods_sort.dart

@ -20,11 +20,13 @@ import '../../../view_widget/classic_header.dart';
import '../../../view_widget/custom_image.dart'; import '../../../view_widget/custom_image.dart';
import '../../../view_widget/my_footer.dart'; import '../../../view_widget/my_footer.dart';
import '../../../view_widget/no_data_view.dart'; import '../../../view_widget/no_data_view.dart';
import '../../../view_widget/settlement_tips_dialog.dart';
class GoodsSort extends StatefulWidget { class GoodsSort extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
GoodsSort({this.arguments}); GoodsSort({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _GoodsSort(); return _GoodsSort();
@ -42,7 +44,6 @@ class _GoodsSort extends State<GoodsSort> {
int groupIndex = -1; int groupIndex = -1;
bool _shimmer = true; bool _shimmer = true;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -61,13 +62,17 @@ class _GoodsSort extends State<GoodsSort> {
status: S.current.zhengzaijiazai, status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
businessService = BusinessApiService(Dio(), businessService = BusinessApiService(
context: context, Dio(),
token: BusinessInstance.instance.businessToken, context: context,
tenant: BusinessInstance.instance.businessTenant, token: BusinessInstance.instance.businessToken,
storeId: widget.arguments["storeId"],); tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"],
);
queryProductGroupList(); queryProductGroupList();
queryGoodsList(groupIndex != -1 ? productGroupList.records[groupIndex].id : "", isSing: false); queryGoodsList(
groupIndex != -1 ? productGroupList.records[groupIndex].id : "",
isSing: false);
}); });
} }
@ -118,7 +123,7 @@ class _GoodsSort extends State<GoodsSort> {
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
try { try {
BaseData<BusinessGoods> baseData = BaseData<BusinessGoods> baseData =
await businessService.findAdminProductLis({ await businessService.findAdminProductLis({
"groupId": groupId, "groupId": groupId,
"hasStock": "", "hasStock": "",
"keyword": "", "keyword": "",
@ -153,6 +158,37 @@ class _GoodsSort extends State<GoodsSort> {
} }
} }
////
goodsSortTop(id) async {
try{
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData baseData = await businessService.productSortTop({
"id": id,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
_pageIndex = 1;
adminProductVoList.clear();
await queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex]?.id ?? "",isSing: false);
SmartDialog.showToast("商品置顶成功", alignment: Alignment.center);
setState(() {});
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}finally{
EasyLoading.dismiss();
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -164,7 +200,7 @@ class _GoodsSort extends State<GoodsSort> {
leadingColor: Colors.black, leadingColor: Colors.black,
brightness: Brightness.dark, brightness: Brightness.dark,
), ),
body:Row( body: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -175,40 +211,40 @@ class _GoodsSort extends State<GoodsSort> {
color: Color(0xFFFAFAFA), color: Color(0xFFFAFAFA),
child: (_shimmer) child: (_shimmer)
? ListView.builder( ? ListView.builder(
itemCount: 10, itemCount: 10,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return sortLeftItemSm(); return sortLeftItemSm();
}, },
) )
: ListView.builder( : ListView.builder(
itemCount: productGroupList?.records?.length ?? 0, itemCount: productGroupList?.records?.length ?? 0,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
groupIndex = position; groupIndex = position;
_pageIndex = 1; _pageIndex = 1;
adminProductVoList.clear(); adminProductVoList.clear();
queryGoodsList(productGroupList?.records[position].id,); queryGoodsList(
}, productGroupList?.records[position].id,
child: sortLeftItem( );
productGroupList.records[position], },
position), child: sortLeftItem(
); productGroupList.records[position], position),
}, );
), },
),
), ),
Container( Container(
width: MediaQuery.of(context).size.width - 100.w, width: MediaQuery.of(context).size.width - 100.w,
child: SmartRefresher( child: SmartRefresher(
controller: _refreshController, controller: _refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: enablePullUp: adminProductVoList.length != 0 ? true : false,
adminProductVoList.length != 0 ? true : false,
header: MyHeader( header: MyHeader(
color: Color(0xFF30415B), color: Color(0xFF30415B),
), ),
@ -233,42 +269,40 @@ class _GoodsSort extends State<GoodsSort> {
color: Colors.white, color: Colors.white,
child: (_shimmer) child: (_shimmer)
? ListView.builder( ? ListView.builder(
itemCount: 10, itemCount: 10,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return sortGoodsItemSm(); return sortGoodsItemSm();
}, },
) )
: ((adminProductVoList == null || : ((adminProductVoList == null ||
adminProductVoList.length == 0) adminProductVoList.length == 0)
? NoDataView( ? NoDataView(
src: src: "assets/image/bs_no data_logo.webp",
"assets/image/bs_no data_logo.webp", isShowBtn: false,
isShowBtn: false, text: "该分组暂无添加商品",
text: "该分组暂无添加商品", fontSize: 16.sp,
fontSize: 16.sp, margin: EdgeInsets.all(20.h),
margin: EdgeInsets.all(20.h), )
) : ListView.builder(
: ListView.builder( itemCount: adminProductVoList?.length ?? 0,
itemCount: controller: controller,
adminProductVoList?.length ?? 0, physics: BouncingScrollPhysics(),
controller: controller, shrinkWrap: true,
physics: BouncingScrollPhysics(), itemBuilder: (context, position) {
shrinkWrap: true, return sortGoodsItem(
itemBuilder: (context, position) { adminProductVoList[position]);
return sortGoodsItem(adminProductVoList[position]); },
}, )))),
)))),
), ),
], ],
), ),
); );
} }
///list ///list
Widget sortLeftItem(Records records, index){ Widget sortLeftItem(Records records, index) {
return Container( return Container(
color: groupIndex == index ? Colors.white : Color(0xFFFAFAFA), color: groupIndex == index ? Colors.white : Color(0xFFFAFAFA),
alignment: Alignment.center, alignment: Alignment.center,
@ -279,24 +313,24 @@ class _GoodsSort extends State<GoodsSort> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
records?.groupName ?? "", records?.groupName ?? "",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: color:
groupIndex == index ? Color(0xFF30415B) : Color(0xFF626264), groupIndex == index ? Color(0xFF30415B) : Color(0xFF626264),
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: groupIndex == index fontWeight: groupIndex == index
? MyFontWeight.semi_bold ? MyFontWeight.semi_bold
: MyFontWeight.regular, : MyFontWeight.regular,
), ),
)), )),
], ],
), ),
); );
} }
///List ///List
Widget sortGoodsItem(AdminProductVoList adminProductVoList){ Widget sortGoodsItem(AdminProductVoList adminProductVoList) {
return Container( return Container(
margin: EdgeInsets.only(bottom: 21.h), margin: EdgeInsets.only(bottom: 21.h),
padding: EdgeInsets.only(left: 16.w, right: 14.w), padding: EdgeInsets.only(left: 16.w, right: 14.w),
@ -309,16 +343,21 @@ class _GoodsSort extends State<GoodsSort> {
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(4), radius: BorderRadius.circular(4),
), ),
SizedBox(width:12.w,), SizedBox(
Expanded(child:Column( width: 12.w,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h), Padding(
padding: EdgeInsets.only(bottom: 11.h, top: 2.h),
child: Row( child: Row(
children: [ children: [
Expanded(child: Text( Expanded(
child: Text(
adminProductVoList?.productName ?? "", adminProductVoList?.productName ?? "",
maxLines:1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
@ -326,16 +365,34 @@ class _GoodsSort extends State<GoodsSort> {
color: Color(0xFF000000), color: Color(0xFF000000),
), ),
)), )),
Text( GestureDetector(
"置顶", behavior: HitTestBehavior.opaque,
style: TextStyle( onTap: () {
fontSize: 12.sp, if (widget.arguments["storeId"] == "0") {
fontWeight: MyFontWeight.medium, SmartDialog.show(
color: Color(0xFFF4524D), widget: SettlementTips(
), () {},
) text: "当前为所有门店状态,置顶商品时,请将门店切换至对应门店操作!",
color: Color(0xFF30415B),
));
} else {
goodsSortTop(adminProductVoList.id);
}
},
child: Padding(
padding: EdgeInsets.only(left:10.w,top: 2.h,bottom: 2.h),
child: Text(
"置顶",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFF4524D),
),
),
))
], ],
),), ),
),
Row( Row(
children: [ children: [
Text( Text(
@ -346,7 +403,9 @@ class _GoodsSort extends State<GoodsSort> {
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),
), ),
), ),
SizedBox(width: 8.w,), SizedBox(
width: 8.w,
),
Text( Text(
"销量${adminProductVoList?.sellCount ?? 0}", "销量${adminProductVoList?.sellCount ?? 0}",
style: TextStyle( style: TextStyle(
@ -357,7 +416,9 @@ class _GoodsSort extends State<GoodsSort> {
), ),
], ],
), ),
SizedBox(height:7.h,), SizedBox(
height: 7.h,
),
Text.rich( Text.rich(
TextSpan( TextSpan(
children: [ children: [
@ -428,93 +489,95 @@ class _GoodsSort extends State<GoodsSort> {
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(bottom: 11.h, top: 2.h), padding: EdgeInsets.only(bottom: 11.h, top: 2.h),
child: Row( child: Row(
children: [Shimmer.fromColors( children: [
baseColor: Color(0XFFD8D8D8), Shimmer.fromColors(
highlightColor: Color(0XFFD8D8D8), baseColor: Color(0XFFD8D8D8),
child: Container( highlightColor: Color(0XFFD8D8D8),
decoration: BoxDecoration( child: Container(
color: Color(0XFFD8D8D8), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2), color: Color(0XFFD8D8D8),
), borderRadius: BorderRadius.circular(2),
width: 120.w,
height: 20.h,
), ),
width: 120.w,
height: 20.h,
), ),
SizedBox(
width:10.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 24.w,
height: 20.h,
),
),],
), ),
), SizedBox(
Row( width: 10.w,
children: [ ),
Shimmer.fromColors( Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8), baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8), highlightColor: Color(0XFFD8D8D8),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0XFFD8D8D8), color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
),
width: 43.w,
height: 18.h,
), ),
width: 24.w,
height: 20.h,
), ),
SizedBox( ),
width: 8.w, ],
), ),
Shimmer.fromColors( ),
baseColor: Color(0XFFD8D8D8), Row(
highlightColor: Color(0XFFD8D8D8), children: [
child: Container( Shimmer.fromColors(
decoration: BoxDecoration( baseColor: Color(0XFFD8D8D8),
color: Color(0XFFD8D8D8), highlightColor: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2), child: Container(
), decoration: BoxDecoration(
width: 43.w, color: Color(0XFFD8D8D8),
height: 18.h, borderRadius: BorderRadius.circular(2),
),
), ),
], width: 43.w,
height: 18.h,
),
), ),
SizedBox( SizedBox(
height: 7.h, width: 8.w,
), ),
Row( Shimmer.fromColors(
children: [ baseColor: Color(0XFFD8D8D8),
Shimmer.fromColors( highlightColor: Color(0XFFD8D8D8),
baseColor: Color(0XFFD8D8D8), child: Container(
highlightColor: Color(0XFFD8D8D8), decoration: BoxDecoration(
child: Container( color: Color(0XFFD8D8D8),
decoration: BoxDecoration( borderRadius: BorderRadius.circular(2),
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 28.w,
height: 20.h,
),
), ),
Spacer(), 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(),
],
)
],
)),
], ],
), ),
); );

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

@ -309,7 +309,10 @@ class _OnSalePage extends State<OnSalePage> {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/goods_assort', Navigator.of(context).pushNamed('/router/goods_assort',
arguments: {"storeId": widget.storeId}); arguments: {"storeId": widget.storeId}).then((value) {
adminProductVoList.clear();
_onRefresh();
});
}, },
child: Container( child: Container(
color: Color(0xFFEDEDED), color: Color(0xFFEDEDED),
@ -346,7 +349,10 @@ class _OnSalePage extends State<OnSalePage> {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/goods_sort', Navigator.of(context).pushNamed('/router/goods_sort',
arguments: {"storeId": widget.storeId}); arguments: {"storeId": widget.storeId}).then((value) {
adminProductVoList.clear();
_onRefresh();
});
}, },
child: Container( child: Container(
color: Color(0xFFEDEDED), color: Color(0xFFEDEDED),
@ -383,7 +389,10 @@ class _OnSalePage extends State<OnSalePage> {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/batch_shelf', Navigator.of(context).pushNamed('/router/batch_shelf',
arguments: {"storeId": widget.storeId}); arguments: {"storeId": widget.storeId}).then((value) {
adminProductVoList.clear();
_onRefresh();
});
}, },
child: Container( child: Container(
color: Color(0xFFEDEDED), color: Color(0xFFEDEDED),
@ -434,7 +443,9 @@ class _OnSalePage extends State<OnSalePage> {
}).then((value) => { }).then((value) => {
_pageIndex = 1, _pageIndex = 1,
adminProductVoList.clear(), adminProductVoList.clear(),
_onRefresh(isShowLoad: false), queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex]?.id ?? "")
}); });
}, },
child: Container( child: Container(

5
lib/business_system/home/home_view/donut_auto_label_chart.dart

@ -10,8 +10,9 @@ import 'my_arc_label_decorator.dart';
class DonutAutoLabelChart extends StatelessWidget { class DonutAutoLabelChart extends StatelessWidget {
final List<charts.Series> seriesList; final List<charts.Series> seriesList;
final bool animate; final bool animate;
final List<String> defaultLabelText;
DonutAutoLabelChart(this.seriesList, {this.animate = false}); DonutAutoLabelChart(this.seriesList,this.defaultLabelText, {this.animate = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -21,7 +22,7 @@ class DonutAutoLabelChart extends StatelessWidget {
arcWidth: 15, arcWidth: 15,
strokeWidthPx: 0, strokeWidthPx: 0,
arcRendererDecorators: [ arcRendererDecorators: [
new MyArcLabelDecorator(MediaQuery.of(context).size.width) new MyArcLabelDecorator(MediaQuery.of(context).size.width,defaultLabelText)
])); ]));
} }
} }

7
lib/business_system/home/home_view/my_arc_label_decorator.dart

@ -49,7 +49,7 @@ class MyArcLabelDecorator<D> extends ArcRendererDecorator<D> {
Color.fromHex(code: "#21CCFF"), Color.fromHex(code: "#21CCFF"),
Color.fromHex(code: "#313CA9") Color.fromHex(code: "#313CA9")
]; ];
static final _defaultLabelText = ["收款(0.00%)", "退款(0.00%)"]; // static final _defaultLabelText = ["收款(0.00%)", "退款(0.00%)"];
static final _defaultOutsideLabelStyle = static final _defaultOutsideLabelStyle =
TextStyleSpec(fontSize: 14, color: Color.fromHex(code: "#333333"),); TextStyleSpec(fontSize: 14, color: Color.fromHex(code: "#333333"),);
static final _defaultTextLabelStyle = static final _defaultTextLabelStyle =
@ -89,7 +89,10 @@ class MyArcLabelDecorator<D> extends ArcRendererDecorator<D> {
final double mediaQueryWidth; final double mediaQueryWidth;
final List<String> defaultLabelText;
MyArcLabelDecorator(this.mediaQueryWidth, MyArcLabelDecorator(this.mediaQueryWidth,
this.defaultLabelText,
{TextStyleSpec insideLabelStyleSpec, {TextStyleSpec insideLabelStyleSpec,
TextStyleSpec outsideLabelStyleSpec, TextStyleSpec outsideLabelStyleSpec,
ArcLabelLeaderLineStyleSpec leaderLineStyleSpec, ArcLabelLeaderLineStyleSpec leaderLineStyleSpec,
@ -193,7 +196,7 @@ class MyArcLabelDecorator<D> extends ArcRendererDecorator<D> {
..maxWidthStrategy = MaxWidthStrategy.ellipsize; ..maxWidthStrategy = MaxWidthStrategy.ellipsize;
final labelTextElement = graphicsFactory final labelTextElement = graphicsFactory
.createTextElement(_defaultLabelText[i]) .createTextElement(defaultLabelText[i])
..maxWidthStrategy = MaxWidthStrategy.ellipsize; ..maxWidthStrategy = MaxWidthStrategy.ellipsize;
var calculatedLabelPosition = calculateLabelPosition( var calculatedLabelPosition = calculateLabelPosition(

35
lib/business_system/home/home_view/my_line_chart.dart

@ -8,7 +8,8 @@ class LineChartSample2 extends StatefulWidget {
final List<LineChartSample2Data> lineChartSample2Data; final List<LineChartSample2Data> lineChartSample2Data;
final String tipName; final String tipName;
LineChartSample2(this.lineChartSample2Data,this.tipName, {Key key}) : super(key: key); LineChartSample2(this.lineChartSample2Data, this.tipName, {Key key})
: super(key: key);
@override @override
State<LineChartSample2> createState() => _LineChartSample2State(); State<LineChartSample2> createState() => _LineChartSample2State();
@ -28,9 +29,12 @@ class _LineChartSample2State extends State<LineChartSample2> {
} }
Widget bottomTitleWidgets(double value, TitleMeta meta) { Widget bottomTitleWidgets(double value, TitleMeta meta) {
if(value%1 != 0) if ((meta.appliedInterval <= 1 &&
double.parse(meta.formattedValue) % 1 != 0) ||
(meta.appliedInterval > 1 &&
double.parse(meta.formattedValue) % meta.appliedInterval != 0))
return Text(""); return Text("");
String text = widget.lineChartSample2Data[value.toInt()].time ?? ""; String text = widget.lineChartSample2Data[int.parse(meta.formattedValue)].time ?? "";
if (text.length == 10) if (text.length == 10)
text = text.substring(5, 10); text = text.substring(5, 10);
else if (text.length == 7) text = text.substring(2, 7); else if (text.length == 7) text = text.substring(2, 7);
@ -73,13 +77,15 @@ class _LineChartSample2State extends State<LineChartSample2> {
} else { } else {
text = value.toInt().toString(); text = value.toInt().toString();
} }
return Padding(padding:EdgeInsets.only(right:2.w), return Padding(
child: Text(text, padding: EdgeInsets.only(right: 2.w),
style: const TextStyle( child: Text(text,
fontWeight: MyFontWeight.light, style: const TextStyle(
fontSize: 10, fontWeight: MyFontWeight.light,
color: Color(0xFF999999)), fontSize: 10,
textAlign: TextAlign.right),); color: Color(0xFF999999)),
textAlign: TextAlign.right),
);
} }
LineChartData mainData() { LineChartData mainData() {
@ -168,14 +174,15 @@ class _LineChartSample2State extends State<LineChartSample2> {
}, },
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Color(0xFF3D3D3D), tooltipBgColor: Color(0xFF3D3D3D),
tooltipPadding: const EdgeInsets.symmetric(vertical:5,horizontal:6), tooltipPadding:
const EdgeInsets.symmetric(vertical: 5, horizontal: 6),
tooltipMargin: 5, tooltipMargin: 5,
tooltipRoundedRadius: 2, tooltipRoundedRadius: 2,
tooltipHorizontalAlignment: FLHorizontalAlignment.center, tooltipHorizontalAlignment: FLHorizontalAlignment.center,
getTooltipItems: (touchedSpots) { getTooltipItems: (touchedSpots) {
return touchedSpots.map((LineBarSpot touchedSpot) { return touchedSpots.map((LineBarSpot touchedSpot) {
return LineTooltipItem( return LineTooltipItem(
'${(widget.lineChartSample2Data[touchedSpot.x.toInt()].time ?? "").substring(5,10)}', '${(widget.lineChartSample2Data[touchedSpot.x.toInt()].time ?? "").substring(5, 10)}',
const TextStyle( const TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: MyFontWeight.light, fontWeight: MyFontWeight.light,
@ -183,7 +190,7 @@ class _LineChartSample2State extends State<LineChartSample2> {
textAlign: TextAlign.start, textAlign: TextAlign.start,
children: [ children: [
TextSpan( TextSpan(
text: '\n${widget?.tipName??""}: ', text: '\n${widget?.tipName ?? ""}: ',
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
@ -209,7 +216,7 @@ class _LineChartSample2State extends State<LineChartSample2> {
.toList(), .toList(),
isCurved: false, isCurved: false,
color: Color(0xFF165DFF), color: Color(0xFF165DFF),
barWidth:2.5, barWidth: 2.5,
dotData: FlDotData( dotData: FlDotData(
show: false, show: false,
getDotPainter: (spot, percent, barData, index) { getDotPainter: (spot, percent, barData, index) {

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

@ -601,7 +601,7 @@ class _TradeGoods extends State<TradeGoods> {
} }
}, },
child: Container( child: Container(
width: 194.w, width: 200.w,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(

9
lib/business_system/home/overview/trade_order.dart

@ -52,6 +52,7 @@ class _TradeOrder extends State<TradeOrder> {
LineChartSample2Data(5, 0, "2023-03-14"), LineChartSample2Data(5, 0, "2023-03-14"),
LineChartSample2Data(6, 0, "2023-03-15") LineChartSample2Data(6, 0, "2023-03-15")
]; ];
int dateIndex = 0; int dateIndex = 0;
String selectedDate = ""; String selectedDate = "";
String dayDate = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}"; String dayDate = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}";
@ -76,7 +77,7 @@ class _TradeOrder extends State<TradeOrder> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_onRefresh(); // _onRefresh();
} }
_onRefresh() async { _onRefresh() async {
@ -246,8 +247,7 @@ class _TradeOrder extends State<TradeOrder> {
border: border:
Border.all(color: Color(0xFFCFD0D1), width: 1.w), Border.all(color: Color(0xFFCFD0D1), width: 1.w),
), ),
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 16.h, right: 20.w, left: 20.w, bottom: 12.h),
top: 16.h, right: 20.w, left: 20.w, bottom: 12.h),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -618,7 +618,8 @@ class _TradeOrder extends State<TradeOrder> {
fontSize: 16.sp, fontSize: 16.sp,
margin: EdgeInsets.all(20.h), margin: EdgeInsets.all(20.h),
) )
: Padding( :
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w), padding: EdgeInsets.symmetric(horizontal: 20.w),
child: LineChartSample2(lineChartSample2DataOrderAmount, "金额"), child: LineChartSample2(lineChartSample2DataOrderAmount, "金额"),
), ),

19
lib/business_system/home/overview/trade_summary.dart

@ -497,7 +497,7 @@ class _TradeSummary extends State<TradeSummary> {
} }
}, },
child: Container( child: Container(
width: 194.w, width: 200.w,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -581,7 +581,8 @@ class _TradeSummary extends State<TradeSummary> {
} else if (dateIndex == 3) { } else if (dateIndex == 3) {
return (customDate == "" || customDate == null) return (customDate == "" || customDate == null)
? "${customDateNum ?? ""}(今日)" ? "${customDateNum ?? ""}(今日)"
: ("${customDate.substring(0,11)} ""${customDate.substring(21,34)}"); : ("${customDate.substring(0, 11)} "
"${customDate.substring(21, 34)}");
} }
} }
@ -848,6 +849,9 @@ class _TradeSummary extends State<TradeSummary> {
labelAccessorFn: (LinearSales row, _) => labelAccessorFn: (LinearSales row, _) =>
'${(row.sales / 100)}', '${(row.sales / 100)}',
) )
], [
"收款(${AppUtils.calculateDouble((tradeSummaryList?.collectionAmount == "0" && tradeSummaryList?.refundAmount == "0") ? 50 : (double.parse(tradeSummaryList?.collectionAmount ?? "0") / (double.parse(tradeSummaryList?.collectionAmount ?? "0") + double.parse(tradeSummaryList?.refundAmount ?? "0")) * 100))}%)",
"退款(${AppUtils.calculateDouble((tradeSummaryList?.collectionAmount == "0" && tradeSummaryList?.refundAmount == "0") ? 50 : (double.parse(tradeSummaryList?.refundAmount ?? "0") / (double.parse(tradeSummaryList?.collectionAmount ?? "0") + double.parse(tradeSummaryList?.refundAmount ?? "0")) * 100))}%)"
]), ]),
), ),
if (expensesSelect == 1) if (expensesSelect == 1)
@ -869,12 +873,12 @@ class _TradeSummary extends State<TradeSummary> {
colorFn: (LinearSales sales, __) => sales.color, colorFn: (LinearSales sales, __) => sales.color,
domainFn: (LinearSales sales, _) => sales.year, domainFn: (LinearSales sales, _) => sales.year,
measureFn: (LinearSales sales, _) => sales.sales, measureFn: (LinearSales sales, _) => sales.sales,
data: [ data: [
new LinearSales( new LinearSales(
0, 0,
tradeSummaryList?.collectionCount ?? 0, tradeSummaryList?.collectionCount ?? 0,
charts.Color.fromHex(code: "#313CA9")), charts.Color.fromHex(code: "#313CA9"),
),
new LinearSales(2, tradeSummaryList?.refundCount ?? 0, new LinearSales(2, tradeSummaryList?.refundCount ?? 0,
charts.Color.fromHex(code: "#30415B")), charts.Color.fromHex(code: "#30415B")),
], ],
@ -882,6 +886,9 @@ class _TradeSummary extends State<TradeSummary> {
labelAccessorFn: (LinearSales row, _) => labelAccessorFn: (LinearSales row, _) =>
'${(row.sales)}', '${(row.sales)}',
), ),
], [
"收款(${AppUtils.calculateDouble((tradeSummaryList?.collectionCount == 0 && tradeSummaryList?.refundCount == 0) ? 50 : ((tradeSummaryList?.collectionCount ?? 0) / ((tradeSummaryList?.collectionCount ?? 0) + (tradeSummaryList?.refundCount ?? 0)) * 100))}%)",
"退款(${AppUtils.calculateDouble((tradeSummaryList?.collectionCount == 0 && tradeSummaryList?.refundCount == 0) ? 50 : ((tradeSummaryList?.refundCount ?? 0) / ((tradeSummaryList?.collectionCount ?? 0) + (tradeSummaryList?.refundCount ?? 0)) * 100))}%)"
]), ]),
), ),
], ],

168
lib/business_system/mine/business_mine_page.dart

@ -38,7 +38,6 @@ class _BusinessMinePage extends State<BusinessMinePage>
List<Records> records = []; List<Records> records = [];
double visiblePercentage; double visiblePercentage;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -55,28 +54,29 @@ class _BusinessMinePage extends State<BusinessMinePage>
// EasyLoading.show( // EasyLoading.show(
// status: S.current.zhengzaijiazai, // status: S.current.zhengzaijiazai,
// maskType: EasyLoadingMaskType.black); // maskType: EasyLoadingMaskType.black);
if (businessService == null) { if (businessService == null) {
businessService = BusinessApiService(Dio(), businessService = BusinessApiService(Dio(),
context: context, context: context,
token: BusinessInstance.instance.businessToken, token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant, tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId); storeId: widget.storeId);
} }
BaseData<BusinessStoreList> baseData = BaseData<BusinessStoreList> baseData = await businessService
await businessService.getStoreList(BusinessInstance.instance.businessTenant,"1","100").catchError((error) { .getStoreList(BusinessInstance.instance.businessTenant, "1", "100")
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), .catchError((error) {
alignment: Alignment.center); SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
refreshController.refreshFailed(); alignment: Alignment.center);
refreshController.loadFailed(); refreshController.refreshFailed();
}); refreshController.loadFailed();
if (!mounted) return; });
if (baseData != null && baseData.isSuccess) { if (!mounted) return;
records = baseData.data.records ?? []; if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted(); records = baseData.data.records ?? [];
// EasyLoading.dismiss(); refreshController.refreshCompleted();
} else { // EasyLoading.dismiss();
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } else {
} SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
} }
@override @override
@ -86,60 +86,58 @@ class _BusinessMinePage extends State<BusinessMinePage>
key: Key('my-widget-key'), key: Key('my-widget-key'),
onVisibilityChanged: (visibilityInfo) { onVisibilityChanged: (visibilityInfo) {
visiblePercentage = visibilityInfo.visibleFraction; visiblePercentage = visibilityInfo.visibleFraction;
if(visiblePercentage == 1) if (visiblePercentage == 1) queryStoreList();
queryStoreList();
}, },
child: Column( child: Column(
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
child: SmartRefresher( child: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: MyHeader(color: Color(0xFF30415B)), header: MyHeader(color: Color(0xFF30415B)),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
footer: CustomFooter( footer: CustomFooter(
builder: (context, mode) { builder: (context, mode) {
return MyFooter(mode); return MyFooter(mode);
}, },
), ),
onRefresh: () { onRefresh: () {
if (widget.businessLoginInfo != null){ if (widget.businessLoginInfo != null) {
queryStoreList(); queryStoreList();
} } else
else refreshController.refreshFailed();
refreshController.refreshFailed(); },
}, child: SingleChildScrollView(
child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(), child: Container(
child: Container( child: Column(
child: Column( children: [
children: [ mineInfo(),
mineInfo(), commonFunctions(),
commonFunctions(), otherFunctions(),
otherFunctions(), SizedBox(
SizedBox( height: 54.h,
height: 54.h, ),
), Text(
Text( "@回乡信息公司",
"@回乡信息公司", style: TextStyle(
style: TextStyle( fontSize: 14.sp,
fontSize: 14.sp, color: Color(0xFF30415B),
color: Color(0xFF30415B), fontWeight: MyFontWeight.medium),
fontWeight: MyFontWeight.medium), ),
],
), ),
], )),
), ),
)), ),
), ),
), SizedBox(
), height: 76.h,
SizedBox( ),
height: 76.h, ],
), ));
],
));
} }
Widget mineInfo() { Widget mineInfo() {
@ -267,22 +265,20 @@ class _BusinessMinePage extends State<BusinessMinePage>
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if(widget.businessLoginInfo.storeList.length > 1){ if (widget.businessLoginInfo.storeList.length > 1) {
Navigator.of(context) Navigator.of(context).pushNamed('/router/select_shop',
.pushNamed('/router/select_shop', arguments: { arguments: {"routeSource": "门店设置", "records": records});
"routeSource":"门店设置", } else {
"records":records
});
}else{
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/merchant_info',arguments: { .pushNamed('/router/merchant_info', arguments: {
"storeId": widget.storeId, "storeId": widget.storeId,
"storeName": records[0].storeName, "storeName": records[0].storeName,
"records": records[0], "records": records[0],
}); });
} }
}, },
child: commonFunctionsItem("assets/image/bs_shop_logo.webp", "门店设置",""), child: commonFunctionsItem(
"assets/image/bs_shop_logo.webp", "门店设置", ""),
), ),
Container( Container(
width: double.infinity, width: double.infinity,
@ -374,7 +370,13 @@ class _BusinessMinePage extends State<BusinessMinePage>
SizedBox( SizedBox(
height: 20.h, height: 20.h,
), ),
commonFunctionsItem("assets/image/bs_user.webp", "关于我们", ""), GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/user_service_page');
},
child:
commonFunctionsItem("assets/image/bs_user.webp", "关于我们", ""))
], ],
), ),
); );

8
lib/business_system/order/business_order_page.dart

@ -120,13 +120,13 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
body: TabBarView( body: TabBarView(
children: [ children: [
OrderList(_allKey[0], 0, widget.storeId, OrderList(_allKey[0], 0, widget.storeId,
editingController.text, selectTime()), editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[1], 1, widget.storeId, OrderList(_allKey[1], 1, widget.storeId,
editingController.text, selectTime()), editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[2], 2, widget.storeId, OrderList(_allKey[2], 2, widget.storeId,
editingController.text, selectTime()), editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[3], 3, widget.storeId, OrderList(_allKey[3], 3, widget.storeId,
editingController.text, selectTime()), editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
], ],
), ),
), ),

8
lib/business_system/order/order_list.dart

@ -23,8 +23,9 @@ class OrderList extends StatefulWidget {
final String storeId; final String storeId;
final String keyword; final String keyword;
final String time; final String time;
final bool isKeyBoardShow;
OrderList(Key key, this.status, this.storeId, this.keyword, this.time) OrderList(Key key, this.status, this.storeId, this.keyword, this.time,this.isKeyBoardShow)
: super(key: key); : super(key: key);
@override @override
@ -169,12 +170,15 @@ class _OrderList extends State<OrderList> {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if(widget.isKeyBoardShow){
return;
}else{
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/business_order_detail', '/router/business_order_detail',
arguments: { arguments: {
"id": adminOrderDTOList[position].id, "id": adminOrderDTOList[position].id,
"storeId": widget.storeId "storeId": widget.storeId
}); });}
}, },
child: orderItem(adminOrderDTOList[position]), child: orderItem(adminOrderDTOList[position]),
); );

5
lib/retrofit/business_api.dart

@ -252,4 +252,9 @@ abstract class BusinessApiService {
Future<BaseData> wipedBatchs( Future<BaseData> wipedBatchs(
@Body() String param); @Body() String param);
////
@POST("product/productSortTop")
Future<BaseData> productSortTop(
@Body() Map<String, dynamic> param);
} }

22
lib/retrofit/business_api.g.dart

@ -572,4 +572,26 @@ class _BusinessApiService implements BusinessApiService {
); );
return value; return value;
} }
@override
Future<BaseData> productSortTop(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('product/productSortTop',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(
_result.data,
(json) => json == null ? null : json,
);
return value;
}
} }

11
lib/view_widget/icon_text.dart

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'custom_image.dart'; import 'custom_image.dart';
@ -38,7 +39,7 @@ class IconText extends StatelessWidget {
if (leftIcon != null) { if (leftIcon != null) {
widgets.add( widgets.add(
Padding( Padding(
padding: EdgeInsets.only(left: 2), padding: EdgeInsets.only(left: 2.w),
child: Icon( child: Icon(
leftIcon, leftIcon,
size: iconSize, size: iconSize,
@ -48,7 +49,7 @@ class IconText extends StatelessWidget {
); );
} else if (leftImage != null && leftImage != "") { } else if (leftImage != null && leftImage != "") {
widgets.add(Padding( widgets.add(Padding(
padding: EdgeInsets.only(left: 2), padding: EdgeInsets.only(left: 2.w),
child: leftImage.startsWith("http") child: leftImage.startsWith("http")
? MImage( ? MImage(
leftImage, leftImage,
@ -79,7 +80,7 @@ class IconText extends StatelessWidget {
child: Text( child: Text(
text, text,
overflow: overFlow, overflow: overFlow,
maxLines: 2, // maxLines: 2,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: textStyle, style: textStyle,
), ),
@ -100,7 +101,7 @@ class IconText extends StatelessWidget {
if (rightIcon != null) { if (rightIcon != null) {
widgets.add( widgets.add(
Padding( Padding(
padding: EdgeInsets.only(left: 2), padding: EdgeInsets.only(left: 2.w),
child: Icon( child: Icon(
rightIcon, rightIcon,
size: iconSize, size: iconSize,
@ -111,7 +112,7 @@ class IconText extends StatelessWidget {
} else if (rightImage != null && rightImage != "") { } else if (rightImage != null && rightImage != "") {
widgets.add( widgets.add(
Padding( Padding(
padding: EdgeInsets.only(left: 2), padding: EdgeInsets.only(left: 2.w),
child: rightImage.startsWith("http") child: rightImage.startsWith("http")
? Image.network( ? Image.network(
rightImage, rightImage,

Loading…
Cancel
Save