From 5bf3f6585e169938bf62e170f7ad759ba779c2ac Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Mon, 23 Oct 2023 14:20:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E7=BB=84=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=96=B0=E5=A2=9E=E6=8F=90=E7=A4=BA=EF=BC=9B=20?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=B8=8B=E6=9E=B6=E9=A1=B5=E9=9D=A2=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=EF=BC=9B=20=E9=A6=96=E9=A1=B5ui=E8=BE=B9=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=9B=20=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E6=88=91=E7=9A=84=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=9B=B4=E6=94=B9=EF=BC=8C=E6=96=B0=E5=A2=9E=E9=97=A8?= =?UTF-8?q?=E5=BA=97=E8=AE=BE=E7=BD=AE=EF=BC=8C=E4=B8=8D=E8=A6=81=E5=95=86?= =?UTF-8?q?=E5=AE=B6=E8=AE=BE=E7=BD=AE=EF=BC=9B=20=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9B=B4=E6=94=B9=EF=BC=8C=E6=A0=B8=E9=94=80?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AE=8C=E6=88=90=EF=BC=8C=E6=A0=B8=E9=94=80?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=BE=85=E8=B0=83=E8=AF=95=E6=A0=B8=E5=AF=B9?= =?UTF-8?q?=EF=BC=9B=20=E5=95=86=E5=93=81=E6=8E=92=E5=BA=8F=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=EF=BC=9B=20=E5=95=86=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=94=B9=E6=88=90=E9=97=A8=E5=BA=97=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E6=8E=A5=E5=8F=A3=E9=A1=B5=E9=9D=A2=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E8=B0=83=E8=AF=95=E5=AE=8C=E6=88=90=EF=BC=9B=20app?= =?UTF-8?q?=E6=88=90=E5=B0=B1=E5=BE=BD=E7=AB=A0=E9=A1=B5=E9=9D=A2=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E5=88=86=E7=BB=84?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=94=B9=EF=BC=9B?= =?UTF-8?q?=20=E5=95=86=E5=93=81=E9=A1=B5=E9=9D=A2=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=EF=BC=9B=20=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E6=A0=B8?= =?UTF-8?q?=E9=94=80=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E6=A0=B8=E9=94=80?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=EF=BC=9B=20=E7=94=B3=E8=AF=B7=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=97=A8=E5=BA=97=E9=A1=B5=E9=9D=A2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=97=A8=E5=BA=97=E5=88=97=E8=A1=A8=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E7=B1=BB=EF=BC=9B=20=E6=96=B0=E5=A2=9E=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/on_sale/add_assort.dart | 70 +- .../goods/on_sale/batch_shelf.dart | 600 +++++--- .../goods/on_sale/goods_sort.dart | 544 ++++++-- .../goods/on_sale/on_sale_page.dart | 316 ++--- .../home/business_home_page.dart | 24 +- lib/business_system/home/select_shop.dart | 78 +- .../login/business_login_page.dart | 5 +- .../mine/business_mine_page.dart | 200 ++- lib/business_system/mine/merchant_info.dart | 1223 ++++++++++++++--- lib/business_system/mine/shop_image_info.dart | 356 +++++ lib/business_system/order/order_list.dart | 15 +- .../order/order_write_off.dart | 69 +- lib/business_system/order/request_refund.dart | 6 +- .../points_mall_view/points_goods_view.dart | 5 - lib/main.dart | 5 +- lib/mine/mine_view/mine_item.dart | 5 +- lib/mine/mine_vip/mine_attainment_page.dart | 42 +- lib/retrofit/business_api.dart | 22 +- lib/retrofit/business_api.g.dart | 76 + lib/retrofit/data/business_order_list.dart | 604 ++++++-- lib/retrofit/data/business_store_list.dart | 943 +++++++++++++ 21 files changed, 4261 insertions(+), 947 deletions(-) create mode 100644 lib/business_system/mine/shop_image_info.dart create mode 100644 lib/retrofit/data/business_store_list.dart diff --git a/lib/business_system/goods/on_sale/add_assort.dart b/lib/business_system/goods/on_sale/add_assort.dart index 1d2f293d..60ebb6fa 100644 --- a/lib/business_system/goods/on_sale/add_assort.dart +++ b/lib/business_system/goods/on_sale/add_assort.dart @@ -10,6 +10,8 @@ import '../../../generated/l10n.dart'; import '../../../retrofit/business_api.dart'; import '../../../retrofit/data/base_data.dart'; import '../../../utils/business_instance.dart'; +import '../../../view_widget/border_text.dart'; +import '../../../view_widget/round_button.dart'; class AddAssort extends StatefulWidget { final Map arguments; @@ -80,8 +82,11 @@ class _AddAssort extends State { if (baseData != null && baseData.isSuccess) { EasyLoading.dismiss(); Navigator.of(context).pop(); - SmartDialog.showToast(name == "添加分类" ? "分类添加成功" : "分类编辑成功", - alignment: Alignment.center); + if (name == "添加分类") + showProductTipDialog(); + else + SmartDialog.showToast(name == "添加分类" ? "分类添加成功" : "分类编辑成功", + alignment: Alignment.center); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } @@ -240,4 +245,65 @@ class _AddAssort extends State { ), ); } + + ///新增分组提示 + showProductTipDialog() { + showDialog( + context: context, + barrierDismissible: false, + builder: (context) { + return AlertDialog( + content: Container( + width: MediaQuery.of(context).size.width - 84.w, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "提示", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox( + height: 15.h, + ), + Text( + "注意:新增分组完成后,请配置打印机,否则无法打印票单!", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFFF4524D), + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox( + height: 35.h, + ), + InkWell( + child: RoundButton( + text: S.of(context).queren, + textColor: Colors.white, + radius: 4, + padding: EdgeInsets.all(12), + backgroup: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + onTap: () { + Navigator.of(context).pop(); + SmartDialog.showToast("分类添加成功", + alignment: Alignment.center); + }, + ), + ], + ), + ), + ); + }, + ); + } } diff --git a/lib/business_system/goods/on_sale/batch_shelf.dart b/lib/business_system/goods/on_sale/batch_shelf.dart index 0752e923..3a501030 100644 --- a/lib/business_system/goods/on_sale/batch_shelf.dart +++ b/lib/business_system/goods/on_sale/batch_shelf.dart @@ -1,12 +1,25 @@ +import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shimmer/shimmer.dart'; import '../../../generated/l10n.dart'; +import '../../../retrofit/business_api.dart'; +import '../../../retrofit/data/base_data.dart'; +import '../../../retrofit/data/business_goods.dart'; +import '../../../retrofit/data/product_group_list.dart'; +import '../../../utils/business_instance.dart'; +import '../../../utils/flutter_utils.dart'; import '../../../utils/font_weight.dart'; import '../../../view_widget/classic_header.dart'; +import '../../../view_widget/custom_image.dart'; import '../../../view_widget/my_footer.dart'; +import '../../../view_widget/no_data_view.dart'; class BatchShelf extends StatefulWidget { final Map arguments; @@ -19,15 +32,150 @@ class BatchShelf extends StatefulWidget { } class _BatchShelf extends State { - final RefreshController refreshController = RefreshController(); - ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); + final RefreshController _refreshController = RefreshController(); final ScrollController controller = ScrollController(); - var checkStatus = false; + BusinessApiService businessService; + ProductGroupList productGroupList; + List adminProductVoList = []; + List productIds = []; + int _loadCount = 0; + int _pageIndex = 1; + int groupIndex = -1; + bool _shimmer = true; @override void initState() { super.initState(); + _onRefresh(); + } + + @override + void dispose() { + super.dispose(); + _refreshController.dispose(); + } + + _onRefresh({isShowLoad = true}) async { + if (isShowLoad) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + SharedPreferences.getInstance().then((value) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"],); + queryProductGroupList(); + queryGoodsList(groupIndex != -1 ? productGroupList.records[groupIndex].id : "", isSing: false); + }); + } + addLoadCount() { + _loadCount += 1; + if (_loadCount == 2) { + _loadCount = 0; + _shimmer = false; + EasyLoading.dismiss(); + if (!mounted) return; + if (_refreshController.isRefresh) _refreshController.refreshCompleted(); + setState(() {}); + } + } + + ///分组列表 + queryProductGroupList() async { + try { + BaseData baseData = await businessService.productGroup({ + "current": 1, + "map": {}, + "model": {"groupImg": "", "groupName": "", "isDelete": 0}, + "order": "ascending", + "size": 100, + "sort": "sort" + }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + productGroupList = baseData.data; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + addLoadCount(); + } + } + + ///商品列表 + queryGoodsList(groupId, {isSing = true}) async { + if (isSing) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + try { + BaseData baseData = + await businessService.findAdminProductLis({ + "groupId": groupId, + "hasStock": "", + "keyword": "", + "pageIndex": _pageIndex, + "pageSize": 10, + "status": "1" + }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + adminProductVoList.addAll(baseData?.data?.adminProductVOList ?? []); + if ((baseData?.data?.adminProductVOList ?? []).isEmpty || + adminProductVoList.length == baseData.data.total) { + _refreshController.loadNoData(); + } else { + _refreshController.loadComplete(); + } + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + if (isSing) { + setState(() {}); + EasyLoading.dismiss(); + } else { + addLoadCount(); + } + } + } + + queryGoodsUpdate() async { + if (businessService == null) { + 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 ?? ""); + SmartDialog.showToast("商品下架成功", alignment: Alignment.center); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } } @override @@ -40,152 +188,176 @@ class _BatchShelf extends State { background: Colors.white, leadingColor: Colors.black, brightness: Brightness.dark, - action: Container( - alignment: Alignment.center, - child: Text( - S.of(context).queren, - style: TextStyle( - color: Color(0xFF30415B), - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, + action: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + if (productIds.length != 0) + productIds.clear(); + adminProductVoList.forEach((element) { + if (element.isSelect) productIds.add(element.id); + }); + if (productIds.length == 0) { + SmartDialog.showToast("请选择要下架的商品", + alignment: Alignment.center); + return; + } else { + queryGoodsUpdate(); + } + }, + child: Container( + alignment: Alignment.center, + child: Text( + S.of(context).queren, + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + ), ), ), ), ), - body: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader( - color: Colors.white, - ), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - onRefresh: () {}, - physics: BouncingScrollPhysics(), - scrollController: ScrollController(), - child: Container( - margin: EdgeInsets.only(top: 24.h,), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: 100.w, - color: Color(0xFFFAFAFA), - height: double.infinity, - child: ListView.builder( - itemCount:5, - physics: BouncingScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, position) { - return GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: shelfLeftItem(), - ); + body: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 100.w, + height: double.infinity, + padding: EdgeInsets.only(bottom: 70.h), + color: Color(0xFFFAFAFA), + child: (_shimmer) + ? ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return shelfLeftItemSm(); + }, + ) + : ListView.builder( + itemCount: productGroupList?.records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + groupIndex = position; + _pageIndex = 1; + adminProductVoList.clear(); + queryGoodsList(productGroupList?.records[position].id,); }, + child: shelfLeftItem( + productGroupList.records[position], + position), + ); + }, + ), + ), + Container( + width: MediaQuery.of(context).size.width - 100.w, + child: SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: + adminProductVoList.length != 0 ? true : false, + header: MyHeader( + color: Color(0xFF30415B), ), - ), - Expanded(child: Container( - width: MediaQuery.of(context).size.width - 100.w, - child: ListView.builder( - itemCount: 6, - controller: controller, - physics: BouncingScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, position) { - return shelfGoodsItem(); + physics: BouncingScrollPhysics(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); }, ), - )), - ], + onLoading: () { + _pageIndex++; + queryGoodsList(groupIndex == -1 + ? "" + : productGroupList?.records[groupIndex].id); + }, + onRefresh: () { + _pageIndex = 1; + adminProductVoList.clear(); + _onRefresh(isShowLoad: false); + }, + child: Container( + color: Colors.white, + child: (_shimmer) + ? ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return shelfGoodsItemSm(); + }, + ) + : ((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 shelfGoodsItem(adminProductVoList[position]); + }, + )))), ), - ), + ], ), ); } ///左边list - Widget shelfLeftItem(){ + Widget shelfLeftItem(Records records, index){ return Container( - width: 100.w, - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - // controller.jumpTo(appletProducts[index].goodsIndex); - }); - }, - child: - Container( - // color: Color(0xFFFAFAFA), - alignment: Alignment.center, - padding: EdgeInsets.symmetric(vertical: 16.h, horizontal:14.w), - // margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Text( - "人气必点榜", - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xFF000000), - fontSize: 12.sp, - fontWeight:MyFontWeight.semi_bold, - ), - )), - ], - ), - ), + color: groupIndex == index ? Colors.white : Color(0xFFFAFAFA), + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( + records?.groupName ?? "", + textAlign: TextAlign.center, + style: TextStyle( + color: + groupIndex == index ? Color(0xFF30415B) : Color(0xFF626264), + fontSize: 12.sp, + fontWeight: groupIndex == index + ? MyFontWeight.semi_bold + : MyFontWeight.regular, + ), + )), + ], ), ); } - // ///右边List - // Widget shelfRightItem(){ - // return Container( - // margin: EdgeInsets.only(left:16.w,right:14.w), - // width: double.infinity, - // child:Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Padding(padding:EdgeInsets.symmetric(vertical: 16.h), - // child: Text("人气必点榜",style: TextStyle( - // color: Color(0xFF30415B), - // fontSize: 12.sp, - // fontWeight:MyFontWeight.regular, - // ),)), - // ListView.builder( - // itemCount: 3, - // controller: controller, - // physics: scrollPhysics, - // shrinkWrap: true, - // itemBuilder: (context, position) { - // return shelfGoodsItem(); - // }, - // ) - // ], - // ), - // ); - // } - - Widget shelfGoodsItem(){ + Widget shelfGoodsItem(AdminProductVoList adminProductVoList){ return Container( margin: EdgeInsets.only(bottom: 21.h), child: Row( children: [ - Image.asset( - "assets/image/hot_list.webp", - width: 77, - height: 77, - fit: BoxFit.fill, + MImage( + adminProductVoList?.productImg ?? "", + width: 77.h, + height: 77.h, + fit: BoxFit.cover, + radius: BorderRadius.circular(4), ), SizedBox(width:12.w,), Expanded(child:Column( @@ -193,7 +365,7 @@ class _BatchShelf extends State { children: [ Padding(padding:EdgeInsets.only(top: 2.h), child:Text( - "台湾甄选手抓饺子三生", + adminProductVoList?.productName ?? "", maxLines:1, overflow: TextOverflow.ellipsis, style: TextStyle( @@ -205,7 +377,7 @@ class _BatchShelf extends State { Row( children: [ Text( - "库存4321", + "库存${adminProductVoList?.stock ?? 0}", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.regular, @@ -214,7 +386,7 @@ class _BatchShelf extends State { ), SizedBox(width: 8.w,), Expanded(child: Text( - "销量4321", + "销量${adminProductVoList?.sellCount ?? 0}", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.regular, @@ -222,51 +394,169 @@ class _BatchShelf extends State { ), )), Checkbox( - visualDensity: VisualDensity.compact, - value: checkStatus, + value: adminProductVoList.isSelect, onChanged: (a) { setState(() { - checkStatus = !checkStatus; + adminProductVoList.isSelect = !adminProductVoList.isSelect; }); }, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(2.0), ), checkColor: Color(0xFFFFFFFF), - fillColor: - MaterialStateProperty.all(Color(0xFF30415B)), + fillColor: MaterialStateProperty.all(Color(0xFF30415B)), ), ], ), SizedBox(height:7.h,), - Row( - children: [ - Expanded(child:Text.rich( + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), TextSpan( - children: [ - TextSpan( - text: "¥", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFF4524D), + text: adminProductVoList?.price ?? "", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + ], + ), + ) + ], + )), + ], + ), + ); + } + + Widget shelfLeftItemSm() { + 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 shelfGoodsItemSm() { + 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, ), - TextSpan( - text: "19", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFF4524D), + ), + 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, ), - ], + ), + Spacer(), + 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( + 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, ), - )), + ), ], - ) - ], - )), + )), ], ), ); diff --git a/lib/business_system/goods/on_sale/goods_sort.dart b/lib/business_system/goods/on_sale/goods_sort.dart index b2803033..d50e21b8 100644 --- a/lib/business_system/goods/on_sale/goods_sort.dart +++ b/lib/business_system/goods/on_sale/goods_sort.dart @@ -1,11 +1,25 @@ +import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shimmer/shimmer.dart'; +import '../../../generated/l10n.dart'; +import '../../../retrofit/business_api.dart'; +import '../../../retrofit/data/base_data.dart'; +import '../../../retrofit/data/business_goods.dart'; +import '../../../retrofit/data/product_group_list.dart'; +import '../../../utils/business_instance.dart'; +import '../../../utils/flutter_utils.dart'; import '../../../utils/font_weight.dart'; import '../../../view_widget/classic_header.dart'; +import '../../../view_widget/custom_image.dart'; import '../../../view_widget/my_footer.dart'; +import '../../../view_widget/no_data_view.dart'; class GoodsSort extends StatefulWidget { final Map arguments; @@ -18,14 +32,125 @@ class GoodsSort extends StatefulWidget { } class _GoodsSort extends State { - final RefreshController refreshController = RefreshController(); - ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); + final RefreshController _refreshController = RefreshController(); final ScrollController controller = ScrollController(); + BusinessApiService businessService; + ProductGroupList productGroupList; + List adminProductVoList = []; + int _loadCount = 0; + int _pageIndex = 1; + int groupIndex = -1; + bool _shimmer = true; + @override void initState() { super.initState(); + _onRefresh(); + } + + @override + void dispose() { + super.dispose(); + _refreshController.dispose(); + } + + _onRefresh({isShowLoad = true}) async { + if (isShowLoad) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + SharedPreferences.getInstance().then((value) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"],); + queryProductGroupList(); + queryGoodsList(groupIndex != -1 ? productGroupList.records[groupIndex].id : "", isSing: false); + }); + } + addLoadCount() { + _loadCount += 1; + if (_loadCount == 2) { + _loadCount = 0; + _shimmer = false; + EasyLoading.dismiss(); + if (!mounted) return; + if (_refreshController.isRefresh) _refreshController.refreshCompleted(); + setState(() {}); + } + } + + ///分组列表 + queryProductGroupList() async { + try { + BaseData baseData = await businessService.productGroup({ + "current": 1, + "map": {}, + "model": {"groupImg": "", "groupName": "", "isDelete": 0}, + "order": "ascending", + "size": 100, + "sort": "sort" + }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + productGroupList = baseData.data; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + addLoadCount(); + } + } + + ///商品列表 + queryGoodsList(groupId, {isSing = true}) async { + if (isSing) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + try { + BaseData baseData = + await businessService.findAdminProductLis({ + "groupId": groupId, + "hasStock": "", + "keyword": "", + "pageIndex": _pageIndex, + "pageSize": 10, + "status": "1" + }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + adminProductVoList.addAll(baseData?.data?.adminProductVOList ?? []); + if ((baseData?.data?.adminProductVOList ?? []).isEmpty || + adminProductVoList.length == baseData.data.total) { + _refreshController.loadNoData(); + } else { + _refreshController.loadComplete(); + } + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + if (isSing) { + setState(() {}); + EasyLoading.dismiss(); + } else { + addLoadCount(); + } + } } @override @@ -39,140 +164,150 @@ class _GoodsSort extends State { leadingColor: Colors.black, brightness: Brightness.dark, ), - body: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader( - color: Colors.white, - ), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - onRefresh: () {}, - physics: BouncingScrollPhysics(), - scrollController: ScrollController(), - child: Container( - margin: EdgeInsets.only(top: 24.h,), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: 100.w, - color: Color(0xFFFAFAFA), - height: double.infinity, - child: ListView.builder( - itemCount:5, - physics: BouncingScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, position) { - return GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: sortLeftItem(), - ); + body:Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 100.w, + height: double.infinity, + padding: EdgeInsets.only(bottom: 70.h), + color: Color(0xFFFAFAFA), + child: (_shimmer) + ? ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return sortLeftItemSm(); + }, + ) + : ListView.builder( + itemCount: productGroupList?.records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + groupIndex = position; + _pageIndex = 1; + adminProductVoList.clear(); + queryGoodsList(productGroupList?.records[position].id,); }, + child: sortLeftItem( + productGroupList.records[position], + position), + ); + }, + ), + ), + Container( + width: MediaQuery.of(context).size.width - 100.w, + child: SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: + adminProductVoList.length != 0 ? true : false, + header: MyHeader( + color: Color(0xFF30415B), ), - ), - Expanded(child: Container( - width: MediaQuery.of(context).size.width - 100.w, - child: ListView.builder( - itemCount: 6, - controller: controller, - physics: BouncingScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, position) { - return sortRightItem(); + physics: BouncingScrollPhysics(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); }, ), - )), - ], + onLoading: () { + _pageIndex++; + queryGoodsList(groupIndex == -1 + ? "" + : productGroupList?.records[groupIndex].id); + }, + onRefresh: () { + _pageIndex = 1; + adminProductVoList.clear(); + _onRefresh(isShowLoad: false); + }, + child: Container( + color: Colors.white, + child: (_shimmer) + ? ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return sortGoodsItemSm(); + }, + ) + : ((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 sortGoodsItem(adminProductVoList[position]); + }, + )))), ), - ), + ], ), - ); - } - ///左边list - Widget sortLeftItem(){ - return Container( - width: 100.w, - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - // controller.jumpTo(appletProducts[index].goodsIndex); - }); - }, - child: - Container( - // color: Color(0xFFFAFAFA), - alignment: Alignment.center, - padding: EdgeInsets.symmetric(vertical: 16.h, horizontal:14.w), - // margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Text( - "人气必点榜", - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xFF000000), - fontSize: 12.sp, - fontWeight:MyFontWeight.semi_bold, - ), - )), - ], - ), - ), - ), ); } - ///右边List - Widget sortRightItem(){ + ///左边list + Widget sortLeftItem(Records records, index){ return Container( - margin: EdgeInsets.only(left:16.w,right: 14.w), - width: double.infinity, - child:Column( - crossAxisAlignment: CrossAxisAlignment.start, + color: groupIndex == index ? Colors.white : Color(0xFFFAFAFA), + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Padding(padding:EdgeInsets.symmetric(vertical: 16.h), - child: Text("人气必点榜",style: TextStyle( - color: Color(0xFF30415B), - fontSize: 12.sp, - fontWeight:MyFontWeight.regular, - ),)), - ListView.builder( - itemCount: 3, - controller: controller, - physics: scrollPhysics, - shrinkWrap: true, - itemBuilder: (context, position) { - return sortGoodsItem(); - }, - ) + Expanded( + child: Text( + records?.groupName ?? "", + textAlign: TextAlign.center, + style: TextStyle( + color: + groupIndex == index ? Color(0xFF30415B) : Color(0xFF626264), + fontSize: 12.sp, + fontWeight: groupIndex == index + ? MyFontWeight.semi_bold + : MyFontWeight.regular, + ), + )), ], ), ); } - Widget sortGoodsItem(){ + ///右边List + Widget sortGoodsItem(AdminProductVoList adminProductVoList){ return Container( margin: EdgeInsets.only(bottom: 21.h), + padding: EdgeInsets.only(left: 16.w, right: 14.w), child: Row( children: [ - Image.asset( - "assets/image/hot_list.webp", - width: 77, - height: 77, - fit: BoxFit.fill, + MImage( + adminProductVoList?.productImg ?? "", + width: 77.h, + height: 77.h, + fit: BoxFit.cover, + radius: BorderRadius.circular(4), ), SizedBox(width:12.w,), Expanded(child:Column( @@ -182,7 +317,7 @@ class _GoodsSort extends State { child: Row( children: [ Expanded(child: Text( - "台湾甄选手抓饺子三生", + adminProductVoList?.productName ?? "", maxLines:1, overflow: TextOverflow.ellipsis, style: TextStyle( @@ -204,7 +339,7 @@ class _GoodsSort extends State { Row( children: [ Text( - "库存4321", + "库存${adminProductVoList?.stock ?? 0}", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.regular, @@ -213,7 +348,7 @@ class _GoodsSort extends State { ), SizedBox(width: 8.w,), Text( - "销量4321", + "销量${adminProductVoList?.sellCount ?? 0}", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.regular, @@ -223,34 +358,163 @@ class _GoodsSort extends State { ], ), SizedBox(height:7.h,), - Row( - children: [ - Expanded(child:Text.rich( + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), TextSpan( - children: [ - TextSpan( - text: "¥", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFF4524D), + text: adminProductVoList?.price ?? "", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + ], + ), + ) + ], + )), + ], + ), + ); + } + + Widget sortLeftItemSm() { + 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 sortGoodsItemSm() { + 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: Row( + children: [Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), ), + width: 120.w, + height: 20.h, ), - TextSpan( - text: "19", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFF4524D), - ), + ), + 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, + ), + ),], ), - )), + ), + 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(), + ], + ) ], - ) - ], - )), + )), ], ), ); diff --git a/lib/business_system/goods/on_sale/on_sale_page.dart b/lib/business_system/goods/on_sale/on_sale_page.dart index f48ce332..dd7e8a4e 100644 --- a/lib/business_system/goods/on_sale/on_sale_page.dart +++ b/lib/business_system/goods/on_sale/on_sale_page.dart @@ -35,8 +35,6 @@ class OnSalePage extends StatefulWidget { class _OnSalePage extends State { final RefreshController _refreshController = RefreshController(); - final RefreshController refreshController = RefreshController(); - ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); final ScrollController controller = ScrollController(); BusinessApiService businessService; ProductGroupList productGroupList; @@ -50,7 +48,6 @@ class _OnSalePage extends State { void dispose() { super.dispose(); _refreshController.dispose(); - refreshController.dispose(); } @override @@ -83,8 +80,9 @@ class _OnSalePage extends State { _loadCount = 0; _shimmer = false; EasyLoading.dismiss(); - if (refreshController.isRefresh) refreshController.refreshCompleted(); - if (!mounted) setState(() {}); + if (!mounted) return; + if (_refreshController.isRefresh) _refreshController.refreshCompleted(); + setState(() {}); } } @@ -94,14 +92,15 @@ class _OnSalePage extends State { BaseData baseData = await businessService.productGroup({ "current": 1, "map": {}, - "model": {"groupImg": "", "groupName": "", "isDelete": ""}, + "model": {"groupImg": "", "groupName": "", "isDelete": 0}, + "order": "ascending", "size": 100, "sort": "sort" }).catchError((error) { SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center); - refreshController.refreshFailed(); - refreshController.loadFailed(); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); }); if (!mounted) return; if (baseData != null && baseData.isSuccess) { @@ -132,10 +131,8 @@ class _OnSalePage extends State { }).catchError((error) { SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center); - // _refreshController.refreshFailed(); - // _refreshController.loadFailed(); - refreshController.refreshFailed(); - refreshController.loadFailed(); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); }); if (!mounted) return; if (baseData != null && baseData.isSuccess) { @@ -143,11 +140,9 @@ class _OnSalePage extends State { widget.total(baseData.data.total.toString()); if ((baseData?.data?.adminProductVOList ?? []).isEmpty || adminProductVoList.length == baseData.data.total) { - // _refreshController.loadNoData(); - refreshController.loadNoData(); + _refreshController.loadNoData(); } else { - // _refreshController.loadComplete(); - refreshController.loadComplete(); + _refreshController.loadComplete(); } } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); @@ -163,7 +158,7 @@ class _OnSalePage extends State { } ///商品下架 - queryGoodsUpdate({isSing = true}) async { + queryGoodsUpdate() async { if (businessService == null) { businessService = BusinessApiService(Dio(), context: context, @@ -204,200 +199,107 @@ class _OnSalePage extends State { ), Expanded( child: Container( - child: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader( - color: Color(0xFF30415B), - ), - physics: BouncingScrollPhysics(), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 100.w, + height: double.infinity, + padding: EdgeInsets.only(bottom: 70.h), + color: Color(0xFFFAFAFA), + child: (_shimmer) + ? ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return leftItemSm(); + }, + ) + : ListView.builder( + itemCount: productGroupList?.records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + groupIndex = position; + _pageIndex = 1; + adminProductVoList.clear(); + queryGoodsList( + productGroupList?.records[position].id); + }, + child: leftItem( + productGroupList.records[position], + position), + ); }, ), - onRefresh: () { - _pageIndex = 1; - adminProductVoList.clear(); - _onRefresh(isShowLoad: false); + ), + Container( + width: MediaQuery.of(context).size.width - 100.w, + child: SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: + adminProductVoList.length != 0 ? true : false, + header: MyHeader( + color: Color(0xFF30415B), + ), + physics: BouncingScrollPhysics(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); }, - 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(); - }, + ), + onLoading: () { + _pageIndex++; + queryGoodsList(groupIndex == -1 + ? "" + : productGroupList?.records[groupIndex].id); + }, + onRefresh: () { + _pageIndex = 1; + adminProductVoList.clear(); + _onRefresh(isShowLoad: false); + }, + 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: - productGroupList?.records?.length ?? - 0, - physics: NeverScrollableScrollPhysics(), + adminProductVoList?.length ?? 0, + controller: controller, + physics: BouncingScrollPhysics(), 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), - ); + return rightGoodsItem( + adminProductVoList[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( - // controller: _refreshController, - // enablePullDown: true, - // enablePullUp: true, - // header: MyHeader( - // color: Color(0xFF30415B), - // ), - // physics: BouncingScrollPhysics(), - // footer: CustomFooter( - // builder: (context, mode) { - // return MyFooter(mode); - // }, - // ), - // onRefresh: () { - // _pageIndex = 1; - // adminProductVoList.clear(); - // _onRefresh(isShowLoad: false); - // }, - // onLoading: () { - // _pageIndex++; - // queryGoodsList(groupIndex == -1 ? "" : productGroupList.records[groupIndex].id); - // }, - // child: Container( - // color: Colors.white, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Container( - // width: 100.w, - // child: ListView.builder( - // itemCount: productGroupList?.records?.length ?? 0, - // physics: BouncingScrollPhysics(), - // shrinkWrap: true, - // itemBuilder: (context, position) { - // return GestureDetector( - // behavior: HitTestBehavior.opaque, - // onTap: () {}, - // child: leftItem(productGroupList.records[position],position), - // ); - // }, - // ), - // ), - // Container( - // width: - // MediaQuery.of(context).size.width - 100.w, - // child: ListView.builder( - // itemCount: adminProductVoList?.length ?? 0, - // controller: controller, - // physics: BouncingScrollPhysics(), - // shrinkWrap: true, - // itemBuilder: (context, position) { - // return rightGoodsItem(adminProductVoList[position]); - // }, - // ), - // ), - // ], - // ), - // ), - // ), - )), - SizedBox( - height: 70.h, - ) + )))), + ), + ], + ))), ], ), Row( @@ -443,7 +345,8 @@ class _OnSalePage extends State { child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { - Navigator.of(context).pushNamed('/router/goods_sort'); + Navigator.of(context).pushNamed('/router/goods_sort', + arguments: {"storeId": widget.storeId}); }, child: Container( color: Color(0xFFEDEDED), @@ -479,7 +382,8 @@ class _OnSalePage extends State { child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { - Navigator.of(context).pushNamed('/router/batch_shelf'); + Navigator.of(context).pushNamed('/router/batch_shelf', + arguments: {"storeId": widget.storeId}); }, child: Container( color: Color(0xFFEDEDED), @@ -568,7 +472,7 @@ class _OnSalePage extends State { ///左边list Widget leftItem(Records records, index) { return Container( - color: groupIndex == index ? Colors.transparent : Color(0xFFFAFAFA), + color: groupIndex == index ? Colors.white : Color(0xFFFAFAFA), alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.w), child: Row( @@ -668,7 +572,7 @@ class _OnSalePage extends State { TextSpan( text: adminProductVoList?.price ?? "", style: TextStyle( - fontSize: 14.sp, + fontSize: 18.sp, fontWeight: MyFontWeight.medium, color: Color(0xFFF4524D), ), diff --git a/lib/business_system/home/business_home_page.dart b/lib/business_system/home/business_home_page.dart index ec0edde4..0a0695e0 100644 --- a/lib/business_system/home/business_home_page.dart +++ b/lib/business_system/home/business_home_page.dart @@ -588,10 +588,11 @@ class _BusinessHomePage extends State color: Colors.white, margin: EdgeInsets.only(top: 16.h), padding: - EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 12.h), + EdgeInsets.only(left:9.w, right:9.w, top: 12.h, bottom: 12.h), child: Column( children: [ - Row( + Padding(padding:EdgeInsets.only(left:7.w,), + child: Row( children: [ Container(width: 4.w, height: 16.h, color: Color(0xFF30415B)), Padding( @@ -608,11 +609,13 @@ class _BusinessHomePage extends State ), ), ], - ), + )), SizedBox( height: 12.h, ), Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: GestureDetector( @@ -622,6 +625,7 @@ class _BusinessHomePage extends State }, child: Container( padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 6.h), + margin: EdgeInsets.symmetric(horizontal:4.w), decoration: BoxDecoration( gradient: LinearGradient( colors: [Color(0xFFFC5A58), Color(0xFFFF716F)], @@ -668,9 +672,9 @@ class _BusinessHomePage extends State ), ), )), - SizedBox( - width: 9.w, - ), + // SizedBox( + // width: 9.w, + // ), Expanded( child: GestureDetector( behavior: HitTestBehavior.opaque, @@ -680,6 +684,7 @@ class _BusinessHomePage extends State child: Container( padding: EdgeInsets.symmetric( horizontal: 8.w, vertical: 6.h), + margin: EdgeInsets.symmetric(horizontal:4.w), decoration: BoxDecoration( gradient: LinearGradient( colors: [Color(0xFFFFA238), Color(0xFFFFBA6D)], @@ -725,9 +730,9 @@ class _BusinessHomePage extends State ], ), ))), - SizedBox( - width: 9.w, - ), + // SizedBox( + // width: 9.w, + // ), Expanded( child: GestureDetector( behavior: HitTestBehavior.opaque, @@ -737,6 +742,7 @@ class _BusinessHomePage extends State child: Container( padding: EdgeInsets.symmetric( horizontal: 8.w, vertical: 6.h), + margin: EdgeInsets.symmetric(horizontal:4.w), decoration: BoxDecoration( gradient: LinearGradient( colors: [Color(0xFF4B77FC), Color(0xFF7091FF)], diff --git a/lib/business_system/home/select_shop.dart b/lib/business_system/home/select_shop.dart index 8331b897..97df863d 100644 --- a/lib/business_system/home/select_shop.dart +++ b/lib/business_system/home/select_shop.dart @@ -3,9 +3,11 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shimmer/shimmer.dart'; import '../../generated/l10n.dart'; import '../../retrofit/data/business_login_info.dart'; +import '../../retrofit/data/business_store_list.dart'; import '../../view_widget/classic_header.dart'; import '../../view_widget/my_footer.dart'; @@ -23,22 +25,23 @@ class SelectShop extends StatefulWidget { class _SelectShop extends State { final RefreshController refreshController = RefreshController(); BusinessLoginInfo businessLoginInfo; + List records = []; int selectIndex = 0; @override void initState() { super.initState(); businessLoginInfo = widget.arguments["businessLoginInfo"]; + records = widget.arguments["records"]; } @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Colors.white, + backgroundColor: Color(0xFFF8F8FA), appBar: MyAppBar( title: "选择门店", titleColor: Colors.black, - background: Colors.white, leadingColor: Colors.black, brightness: Brightness.dark, ), @@ -73,7 +76,7 @@ class _SelectShop extends State { width: 4.w, ), Text( - "门店切换", + (widget.arguments["routeSource"] == "门店设置")?"请选择门店":"请选择登录门店", style: TextStyle( fontSize: 15.sp, fontWeight: MyFontWeight.semi_bold, @@ -87,7 +90,7 @@ class _SelectShop extends State { Expanded( child: ListView.builder( padding: EdgeInsets.zero, - itemCount: businessLoginInfo?.storeList?.length ?? 0, + itemCount: (widget.arguments["routeSource"] == "门店设置") ? (records?.length ?? 0):(businessLoginInfo?.storeList?.length ?? 0), scrollDirection: Axis.vertical, shrinkWrap: true, physics: BouncingScrollPhysics(), @@ -98,20 +101,29 @@ class _SelectShop extends State { selectIndex = position; }); }, - child: shopsItem( - businessLoginInfo?.storeList[position], position), + child: (widget.arguments["routeSource"] == "门店设置") ? merchantItem(records[position], position): + shopsItem(businessLoginInfo?.storeList[position], position), ); }, )), GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { - Navigator.of(context).pushReplacementNamed( - '/router/business_page', - arguments: { - "selectStoreIndex": selectIndex, - "businessLoginInfo": businessLoginInfo, - }); + if(widget.arguments["routeSource"] == "门店设置"){ + Navigator.of(context) + .popAndPushNamed('/router/merchant_info',arguments: { + "storeId": records[selectIndex]?.id ?? "", + "storeName": records[selectIndex]?.storeName ?? "", + "records": records[selectIndex], + }); + }else{ + Navigator.of(context).pushReplacementNamed( + '/router/business_page', + arguments: { + "selectStoreIndex": selectIndex, + "businessLoginInfo": businessLoginInfo, + }); + } }, child: Container( width: double.infinity, @@ -180,4 +192,46 @@ class _SelectShop extends State { ), ); } + + Widget merchantItem(Records records, index) { + return Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + height: 52.h, + width: double.infinity, + decoration: BoxDecoration( + color: selectIndex == index ? Color(0xFFEFF5FF) : Colors.white, + borderRadius: BorderRadius.circular(4.w), + border: Border.all( + color: selectIndex == index ? Color(0xFF30415B) : Colors.white, + width: selectIndex == index ? 1.w : 0, + ), + ), + padding: EdgeInsets.only( + top: 16.h, bottom: 16.h, left: 16.w, right: 17.w), + child: Text( + records?.storeName ?? "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: selectIndex == index + ? Color(0xFF30415B) + : Color(0xFF0D0D0D)), + ), + ), + if (selectIndex == index) + Image.asset( + "assets/image/bs_shop.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + ], + ), + ); + } } diff --git a/lib/business_system/login/business_login_page.dart b/lib/business_system/login/business_login_page.dart index eeb474df..704f8b81 100644 --- a/lib/business_system/login/business_login_page.dart +++ b/lib/business_system/login/business_login_page.dart @@ -93,7 +93,9 @@ class _BusinessLoginPage extends State { }); if (baseData != null && baseData.isSuccess) { var businessLoginInfo = BusinessLoginInfo.fromJson(baseData.data); - businessLoginInfo.storeList.insert(0, StoreList(name: "所有门店")); + if(businessLoginInfo.storeList.length > 1){ + businessLoginInfo.storeList.insert(0, StoreList(name: "所有门店")); + } BusinessInstance.instance.businessTenant = businessLoginInfo.tenantCode; BusinessInstance.instance.businessToken = businessLoginInfo.token; sharedPreferences.setString('account', _userPhoneController.text); @@ -102,6 +104,7 @@ class _BusinessLoginPage extends State { Navigator.of(context) .pushReplacementNamed('/router/select_shop', arguments: { "businessLoginInfo": businessLoginInfo, + "routeSource":"登录", }); } else { Navigator.of(context) diff --git a/lib/business_system/mine/business_mine_page.dart b/lib/business_system/mine/business_mine_page.dart index 3cdce4e0..66ac89e6 100644 --- a/lib/business_system/mine/business_mine_page.dart +++ b/lib/business_system/mine/business_mine_page.dart @@ -1,19 +1,29 @@ +import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../generated/l10n.dart'; +import '../../retrofit/business_api.dart'; +import '../../retrofit/data/base_data.dart'; import '../../retrofit/data/business_login_info.dart'; +import '../../retrofit/data/business_store_list.dart'; +import '../../utils/business_instance.dart'; +import '../../utils/flutter_utils.dart'; import '../../utils/font_weight.dart'; class BusinessMinePage extends StatefulWidget { final BusinessLoginInfo businessLoginInfo; final String storeId; - BusinessMinePage(this.businessLoginInfo,this.storeId); + BusinessMinePage(this.businessLoginInfo, this.storeId); + @override State createState() { return _BusinessMinePage(); @@ -23,15 +33,48 @@ class BusinessMinePage extends StatefulWidget { class _BusinessMinePage extends State with AutomaticKeepAliveClientMixin { final RefreshController refreshController = RefreshController(); + BusinessApiService businessService; + List records = []; @override void initState() { super.initState(); + queryStoreList(); } @override void dispose() { super.dispose(); + refreshController.dispose(); + } + + ///门店设置列表 + queryStoreList() async { + 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.storeId); + } + BaseData baseData = + await businessService.getStoreList(BusinessInstance.instance.businessTenant,"1","100").catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + records = baseData.data.records ?? []; + refreshController.refreshCompleted(); + EasyLoading.dismiss(); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } } @override @@ -45,7 +88,7 @@ class _BusinessMinePage extends State controller: refreshController, enablePullDown: true, enablePullUp: false, - header: MyHeader(color:Color(0xFF30415B)), + header: MyHeader(color: Color(0xFF30415B)), physics: BouncingScrollPhysics(), footer: CustomFooter( builder: (context, mode) { @@ -53,8 +96,11 @@ class _BusinessMinePage extends State }, ), onRefresh: () { - if(widget.businessLoginInfo != null) - refreshController.refreshCompleted(); + if (widget.businessLoginInfo != null){ + // if(widget.businessLoginInfo.storeList.length <= 1) + queryStoreList(); + // refreshController.refreshCompleted(); + } else refreshController.refreshFailed(); }, @@ -67,14 +113,15 @@ class _BusinessMinePage extends State commonFunctions(), otherFunctions(), SizedBox( - height:54.h, + height: 54.h, ), Text( "@回乡信息公司", style: TextStyle( fontSize: 14.sp, color: Color(0xFF30415B), - fontWeight: MyFontWeight.medium),), + fontWeight: MyFontWeight.medium), + ), ], ), )), @@ -106,9 +153,10 @@ class _BusinessMinePage extends State ), GestureDetector( behavior: HitTestBehavior.opaque, - onTap: (){ - Navigator.of(context).pushNamed('/router/account_information',arguments: { - "businessLoginInfo":widget.businessLoginInfo, + onTap: () { + Navigator.of(context) + .pushNamed('/router/account_information', arguments: { + "businessLoginInfo": widget.businessLoginInfo, }); }, child: Container( @@ -116,15 +164,22 @@ class _BusinessMinePage extends State top: MediaQuery.of(context).padding.top + 50, left: 16.w), child: Row( children: [ - MImage( - widget?.businessLoginInfo?.avatar ?? "", - fit: BoxFit.cover, - width: 69.h, - height: 69.h, - radius: BorderRadius.circular(100), - errorSrc: "assets/image/bs_mine_heading.webp", - fadeSrc: "assets/image/bs_mine_heading.webp", - ), + (widget?.businessLoginInfo?.avatar != "") + ? MImage( + widget?.businessLoginInfo?.avatar ?? "", + fit: BoxFit.cover, + width: 69.h, + height: 69.h, + radius: BorderRadius.circular(100), + errorSrc: "assets/image/default_2_1.webp", + fadeSrc: "assets/image/default_2_1.webp", + ) + : Image.asset( + "assets/image/bs_mine_heading.webp", + width: 69, + height: 69, + fit: BoxFit.fill, + ), SizedBox( width: 10.w, ), @@ -163,7 +218,7 @@ class _BusinessMinePage extends State ///常用功能 Widget commonFunctions() { return Container( - margin: EdgeInsets.only(top:26.h, left: 16.w, right:17.w,bottom:23.h), + margin: EdgeInsets.only(top: 26.h, left: 16.w, right: 17.w, bottom: 23.h), child: Column( children: [ Row( @@ -183,82 +238,113 @@ class _BusinessMinePage extends State ), ], ), - SizedBox(height:20.h,), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: (){ - Navigator.of(context).pushNamed('/router/merchant_info',arguments:{ - "storeId":widget.storeId, - }); - }, - child: - commonFunctionsItem("assets/image/bs_store_info_logo.webp", "商户信息", widget?.businessLoginInfo?.name ?? ""), + SizedBox( + height: 20.h, ), + // GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: (){ + // Navigator.of(context).pushNamed('/router/merchant_info',arguments:{ + // "storeId":widget.storeId, + // }); + // }, + // child: + // commonFunctionsItem("assets/image/bs_store_info_logo.webp", "商户信息", widget?.businessLoginInfo?.name ?? ""), + // ), Container( width: double.infinity, height: 1.h, color: Color(0xFFEBECEF), - margin: EdgeInsets.only(left:32.w,bottom:12.h), + margin: EdgeInsets.only(left: 32.w, bottom: 12.h), ), - // commonFunctionsItem("assets/image/bs_shop_logo.webp", "门店设置", ""), - // Container( - // width: double.infinity, - // height: 1.h, - // color: Color(0xFFEBECEF), - // margin: EdgeInsets.only(left:32.w,bottom:12.h), - // ), GestureDetector( behavior: HitTestBehavior.opaque, - onTap: (){ - Navigator.of(context).pushNamed('/router/security_setting',arguments:{ - "storeId":widget.storeId, - "businessLoginInfo":widget.businessLoginInfo, - }); + onTap: () { + if(widget.businessLoginInfo.storeList.length > 1){ + Navigator.of(context) + .pushNamed('/router/select_shop', arguments: { + "routeSource":"门店设置", + "records":records + }); + }else{ + Navigator.of(context) + .pushNamed('/router/merchant_info',arguments: { + "storeId": widget.storeId, + "storeName": records[0].storeName, + "records": records[0], + }); + } }, - child: commonFunctionsItem("assets/image/bs_secure.webp", "安全设置", "登录手机号/密码") + child: commonFunctionsItem("assets/image/bs_shop_logo.webp", "门店设置",""), ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(left: 32.w, bottom: 12.h), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context) + .pushNamed('/router/security_setting', arguments: { + "storeId": widget.storeId, + "businessLoginInfo": widget.businessLoginInfo, + }); + }, + child: commonFunctionsItem( + "assets/image/bs_secure.webp", "安全设置", "登录手机号/密码")), ], ), ); } - Widget commonFunctionsItem(icon,leftText,rightText){ + Widget commonFunctionsItem(icon, leftText, rightText) { return Container( - margin: EdgeInsets.only(bottom:14.h), + margin: EdgeInsets.only(bottom: 14.h), child: Row( children: [ Image.asset( icon, width: 24, - height:24, - fit: BoxFit.fill,), - SizedBox(width:8.w,), - Expanded(child: Text( + height: 24, + fit: BoxFit.fill, + ), + SizedBox( + width: 8.w, + ), + Expanded( + child: Text( leftText, style: TextStyle( fontSize: 14.sp, color: Color(0xFF30415B), - fontWeight: MyFontWeight.medium),)), + fontWeight: MyFontWeight.medium), + )), Text( rightText, style: TextStyle( fontSize: 14.sp, color: Color(0xFF353535), - fontWeight: MyFontWeight.medium),), + fontWeight: MyFontWeight.medium), + ), Image.asset( "assets/image/icon_right_z.webp", width: 16, - height:16, - color: Color(0xFF353535), + height: 16, + color: Color(0xFF353535), ), ], ), ); } - Widget otherFunctions(){ + Widget otherFunctions() { return Container( - margin: EdgeInsets.only(left: 16.w, right:17.w,), + margin: EdgeInsets.only( + left: 16.w, + right: 17.w, + ), child: Column( children: [ Row( @@ -278,7 +364,9 @@ class _BusinessMinePage extends State ), ], ), - SizedBox(height:20.h,), + SizedBox( + height: 20.h, + ), commonFunctionsItem("assets/image/bs_user.webp", "关于我们", ""), ], ), diff --git a/lib/business_system/mine/merchant_info.dart b/lib/business_system/mine/merchant_info.dart index 9ad96abd..74d53e64 100644 --- a/lib/business_system/mine/merchant_info.dart +++ b/lib/business_system/mine/merchant_info.dart @@ -1,16 +1,23 @@ +import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/retrofit/data/business_store_list.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; - +import 'package:shimmer/shimmer.dart'; +import '../../generated/l10n.dart'; +import '../../retrofit/business_api.dart'; +import '../../retrofit/data/base_data.dart'; +import '../../utils/business_instance.dart'; import '../../utils/font_weight.dart'; -import '../../view_widget/classic_header.dart'; -import '../../view_widget/my_footer.dart'; class MerchantInfo extends StatefulWidget { final Map arguments; MerchantInfo({this.arguments}); + @override State createState() { return _MerchantInfo(); @@ -18,200 +25,477 @@ class MerchantInfo extends StatefulWidget { } class _MerchantInfo extends State { - final RefreshController refreshController = RefreshController(); - int checkIndex = 0; + int platformIndex = 0; + int useErpIndex = 0; + int isEnableIndex = 0; + BusinessApiService businessService; + Records records; + int tradeTypeIndex = 0; + String posTypeCode; + int shopTypeIndex = 0; + String serviceType; + TextEditingController shopNameController = TextEditingController(); + TextEditingController telController = TextEditingController(); + TextEditingController sortController = TextEditingController(); + List image; + String logo; + String facade; @override void initState() { super.initState(); + records = widget.arguments["records"]; + } + + ///保存店铺信息 + saveInfo() async { + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.saveStoreInfo({ + "id": widget.arguments["storeId"], + "storeName": (shopNameController.text??"")== "" ? records.storeName: shopNameController.text, + "posType": posTypeCode == null ? records.posType.code: tradeTypeCode(), + "serviceType": serviceType == null ? records.serviceType : shopTypeCode(), + "tel": telController.text ?? records.tel, + "logo": logo, + "facade": facade, + "sort": (sortController.text??"")==""? records.sort :double.tryParse(sortController.text), + "platformShow": platformIndex == 0 ? records.platformShow :(platformIndex == 1 ?true:false), + "isEnable": isEnableIndex == 0 ? records.isEnable :(isEnableIndex == 1 ?true:false), + "useErp": useErpIndex == 0 ? records.useErp :(useErpIndex == 1 ?true:false), + "isAutoSendRefundAddress": 1 + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + SmartDialog.showToast("店铺设置修改成功", alignment: Alignment.center); + Navigator.of(context).pop(); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } } @override Widget build(BuildContext context) { - return - Scaffold( + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + FocusScope.of(context).unfocus(); + }, + child: Scaffold( + resizeToAvoidBottomInset: false, backgroundColor: Color(0xFFF8F8FA), appBar: MyAppBar( - title: "商户信息", + title: "门店设置", titleColor: Colors.black, background: Colors.white, leadingColor: Colors.black, brightness: Brightness.dark, ), - body: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader( - color: Colors.white, - ), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - onRefresh: () { - }, - physics: BouncingScrollPhysics(), - scrollController: ScrollController(), - child: Container( - margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w), - child:Column( - children: [ - Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8.w), - boxShadow: [ - BoxShadow( - color: Color(0x0F06152E).withAlpha(12), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, - ), - ], + body: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 16.h, left: 14.w, right: 14.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + padding: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 17.h), + child: Column( + children: [ + textItem("店铺名称", shopNameController, records.storeName ?? ""), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top: 2.h, bottom: 16.h)), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + showTradeType(); + }, + child: textItems("收单类型", + posTypeCode == null ? tradeType() : posTypeCode), + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top: 2.h, bottom: 16.h)), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + showShopType(); + }, + child: textItems( + "店铺类型", serviceType == null ? shopType() : serviceType), ), - padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,bottom:44.h), - child: Column( + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top: 2.h)), + textItem("负责人电话", telController, records.tel ?? ""), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top: 2.h, bottom: 16.h)), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.pushNamed(context, "/router/shop_image_info", + arguments: { + "logo": ((logo ?? "") != "") ? logo : records.logo, + "facade": ((facade ??"") != "")?facade : records.facade, + "storeId":widget.arguments["storeId"], + }).then((value){ + if(value != null) { + image = value; + logo = image[0]; + facade = image[1]; + } + }); + }, + child: textItems("门店图片", "精美的图片更加吸引顾客"), + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top: 2.h)), + textItem( + "排序", sortController, records.sort.toString() ?? ""), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top: 2.h, bottom: 16.h)), + Row( children: [ - textItem("店铺名称","134****7777"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) + Expanded( + child: Text( + "是否在平台展示", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + platformIndex = 1; + }); + }, + child: Row( + children: [ + Image.asset( + (platformIndex == 0 ?(records.platformShow == true):(platformIndex==1)) + ? "assets/image/bs_check.webp" + : "assets/image/bs_uncheck.webp", + width: 16, + height: 16, + fit: BoxFit.cover, + ), + SizedBox( + width: 5.w, + ), + Text( + "是", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium), + ), + ], + ), ), - textItem("经营类目","奶"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) + SizedBox( + width: 36.w, + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + platformIndex = 2; + }); + }, + child: Row( + children: [ + Image.asset( + (platformIndex == 0 ?(records.platformShow == false):(platformIndex==2)) + ? "assets/image/bs_check.webp" + : "assets/image/bs_uncheck.webp", + width: 16, + height: 16, + fit: BoxFit.cover, + ), + SizedBox( + width: 5.w, + ), + Text( + "否", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium), + ) + ], + ), ), - textItem("所在地区","湖北省武汉市武昌区"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.symmetric(vertical: 16.h)), + Row( + children: [ + Expanded( + child: Text( + "是否启用仓库管理", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + useErpIndex = 1; + }); + }, + child: Row( + children: [ + Image.asset( + (useErpIndex == 0 ?(records.useErp == true):(useErpIndex==1)) + ? "assets/image/bs_check.webp" + : "assets/image/bs_uncheck.webp", + width: 16, + height: 16, + fit: BoxFit.cover, + ), + SizedBox( + width: 5.w, + ), + Text( + "是", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium), + ), + ], + ), ), - textItem("详细地址","武汉市武昌区221过道谢谢谢谢谢吾问无为谓无无寻"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) + SizedBox( + width: 36.w, ), - textItem("负责人电话","1122334444"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + useErpIndex = 2; + }); + }, + child: Row( + children: [ + Image.asset( + (useErpIndex == 0 ?(records.useErp == false):(useErpIndex==2)) + ? "assets/image/bs_check.webp" + : "assets/image/bs_uncheck.webp", + width: 16, + height: 16, + fit: BoxFit.cover, + ), + SizedBox( + width: 5.w, + ), + Text( + "否", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium), + ) + ], + ), ), - Row( - children: [ - Expanded(child:Text( - "是否在平台展示", + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.symmetric(vertical: 16.h)), + Row( + children: [ + Expanded( + child: Text( + "是否启用门店", style: TextStyle( fontSize: 14.sp, - color: Color(0xFF808080), - fontWeight: MyFontWeight.medium),)), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: (){ - setState((){ - checkIndex = 0; - }); - }, - child: Row( - children: [ - Image.asset( - checkIndex == 0? - "assets/image/bs_check.webp":"assets/image/bs_uncheck.webp", - width: 16, - height: 16, - fit: BoxFit.cover, - ), - SizedBox(width:5.w,), - Text( - "是", - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.medium),), - ], + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + isEnableIndex = 1; + }); + }, + child: Row( + children: [ + Image.asset( + (isEnableIndex == 0 ?(records.isEnable == true):(isEnableIndex==1)) + ? "assets/image/bs_check.webp" + : "assets/image/bs_uncheck.webp", + width: 16, + height: 16, + fit: BoxFit.cover, ), - ), - SizedBox(width: 36.w,), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: (){ - setState((){ - checkIndex = 1; - });}, - child: Row( - children: [ - Image.asset( - checkIndex == 1? - "assets/image/bs_check.webp":"assets/image/bs_uncheck.webp", - width: 16, - height: 16, - fit: BoxFit.cover, - ), - SizedBox(width:5.w,), - Text( - "否", - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.medium),) - ], + SizedBox( + width: 5.w, ), - ), - ], + Text( + "是", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium), + ), + ], + ), + ), + SizedBox( + width: 36.w, + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + isEnableIndex = 2; + }); + }, + child: Row( + children: [ + Image.asset( + (isEnableIndex == 0 ?(records.isEnable == false):(isEnableIndex==2)) + ? "assets/image/bs_check.webp" + : "assets/image/bs_uncheck.webp", + width: 16, + height: 16, + fit: BoxFit.cover, + ), + SizedBox( + width: 5.w, + ), + Text( + "否", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium), + ) + ], + ), ), ], ), - ), - Spacer(), - Container( - width: double.infinity, - alignment: Alignment.center, - margin: EdgeInsets.only(bottom:55.h,top: 125.h), - padding: EdgeInsets.symmetric(vertical:16.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(27), - color: Color(0xFF30415B) - ), - child: Text( - "保存", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 16.sp, - color: Colors.white, - ), + ], + ), + ), + Spacer(), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + saveInfo(); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 55.h, left: 16.w, right: 16.w), + padding: EdgeInsets.symmetric(vertical: 16.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B)), + child: Text( + S.of(context).baocun, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Colors.white, ), - ) - ], + ), + ), + ) + ], + ), + ), + ); + } + + Widget textItem(left, rightController, right) { + return Container( + child: Row( + children: [ + Expanded( + child: Text( + left, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + ), + flex: 1, + ), + Expanded( + child: TextField( + controller: rightController, + decoration: InputDecoration( + hintText: right ?? "", + hintTextDirection: TextDirection.rtl, + hintStyle: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + border: InputBorder.none, ), + textAlign: TextAlign.right, + style: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), ), + flex: 2, ), - ); + ], + )); } - Widget textItem(left,right){ + Widget textItems(left, right) { return Container( padding: EdgeInsets.only(bottom: 16.h), child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded(child:Text( + Expanded( + child: Text( left, style: TextStyle( fontSize: 14.sp, - color: Color(0xFF808080), - fontWeight: MyFontWeight.medium),)), - Expanded(child: + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + )), Text( right, maxLines: 2, @@ -219,11 +503,632 @@ class _MerchantInfo extends State { textAlign: TextAlign.right, style: TextStyle( fontSize: 14.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.medium),),flex: 3,), + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.medium), + ), + SizedBox( + width: 4.w, + ), + Image.asset( + "assets/image/icon_right_z.webp", + width: 16.h, + height: 16.h, + color: Color(0xFF7A797F), + ), ], - ) - ); + )); + } + + ///收单类型 + String tradeType() { + if (records.posType.code == "NORMALSTORE") { + return "普通餐饮"; + } else if (records.posType.code == "FASTSTORE") { + return "快消餐饮"; + } else if (records.posType.code == "RETAILSTORE") { + return "零售店"; + } else if (records.posType.code == "DIRECT") { + return "直付商店"; + } + } + + ///收单类型选择 + String tradeTypeCode() { + if (tradeTypeIndex == 0) { + return "NORMALSTORE"; + } else if (tradeTypeIndex == 1) { + return "FASTSTORE"; + } else if (tradeTypeIndex == 2) { + return "RETAILSTORE"; + } else if (tradeTypeIndex == 3) { + return "DIRECT"; + } + } + + ///收单类型弹窗选择 + showTradeType() { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return StatefulBuilder(builder: ( + context, + state, + ) { + return Container( + width: double.infinity, + height: 420.h, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Container( + alignment: Alignment.center, + margin: EdgeInsets.only( + top: 12.h, bottom: 12.h, left: 41.w), + child: Text( + "选择收单类型", + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 16.sp, + color: Color(0xFF1A1A1A), + ), + ), + )), + GestureDetector( + onTap: () { + state(() { + Navigator.of(context).pop(); + }); + }, + child: Padding( + padding: EdgeInsets.only(right: 16.w), + child: Image.asset( + "assets/image/cancel.webp", + width: 25.h, + height: 25.h, + ), + ), + ), + ], + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + children: [ + GestureDetector( + onTap: () { + state(() { + tradeTypeIndex = 0; + posTypeCode = "普通餐饮"; + }); + }, + child: Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + height: 52.h, + width: double.infinity, + decoration: BoxDecoration( + color: tradeTypeIndex == 0 + ? Color(0xFFEFF5FF) + : Color(0xFFF7F7F7), + borderRadius: BorderRadius.circular(4.w), + border: Border.all( + color: tradeTypeIndex == 0 + ? Color(0xFF30415B) + : Colors.white, + width: tradeTypeIndex == 0 ? 1.w : 0, + ), + ), + padding: EdgeInsets.only( + top: 16.h, + bottom: 16.h, + left: 16.w, + right: 17.w), + child: Text( + "普通餐饮", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: tradeTypeIndex == 0 + ? Color(0xFF30415B) + : Color(0xFF0D0D0D)), + ), + ), + if (tradeTypeIndex == 0) + Image.asset( + "assets/image/bs_shop.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + ], + ), + )), + GestureDetector( + onTap: () { + state(() { + tradeTypeIndex = 1; + posTypeCode = "快消餐饮"; + }); + }, + child: Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + height: 52.h, + width: double.infinity, + decoration: BoxDecoration( + color: tradeTypeIndex == 1 + ? Color(0xFFEFF5FF) + : Color(0xFFF7F7F7), + borderRadius: BorderRadius.circular(4.w), + border: Border.all( + color: tradeTypeIndex == 1 + ? Color(0xFF30415B) + : Colors.white, + width: tradeTypeIndex == 1 ? 1.w : 0, + ), + ), + padding: EdgeInsets.only( + top: 16.h, + bottom: 16.h, + left: 16.w, + right: 17.w), + child: Text( + "快消餐饮", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: tradeTypeIndex == 1 + ? Color(0xFF30415B) + : Color(0xFF0D0D0D)), + ), + ), + if (tradeTypeIndex == 1) + Image.asset( + "assets/image/bs_shop.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + ], + ), + )), + GestureDetector( + onTap: () { + state(() { + tradeTypeIndex = 2; + posTypeCode = "零售店"; + }); + }, + child: Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + height: 52.h, + width: double.infinity, + decoration: BoxDecoration( + color: tradeTypeIndex == 2 + ? Color(0xFFEFF5FF) + : Color(0xFFF7F7F7), + borderRadius: BorderRadius.circular(4.w), + border: Border.all( + color: tradeTypeIndex == 2 + ? Color(0xFF30415B) + : Colors.white, + width: tradeTypeIndex == 2 ? 1.w : 0, + ), + ), + padding: EdgeInsets.only( + top: 16.h, + bottom: 16.h, + left: 16.w, + right: 17.w), + child: Text( + "零售店", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: tradeTypeIndex == 2 + ? Color(0xFF30415B) + : Color(0xFF0D0D0D)), + ), + ), + if (tradeTypeIndex == 2) + Image.asset( + "assets/image/bs_shop.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + ], + ), + )), + GestureDetector( + onTap: () { + state(() { + tradeTypeIndex = 3; + posTypeCode = "直付商店"; + }); + }, + child: Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + height: 52.h, + width: double.infinity, + decoration: BoxDecoration( + color: tradeTypeIndex == 3 + ? Color(0xFFEFF5FF) + : Color(0xFFF7F7F7), + borderRadius: BorderRadius.circular(4.w), + border: Border.all( + color: tradeTypeIndex == 3 + ? Color(0xFF30415B) + : Colors.white, + width: tradeTypeIndex == 3 ? 1.w : 0, + ), + ), + padding: EdgeInsets.only( + top: 16.h, + bottom: 16.h, + left: 16.w, + right: 17.w), + child: Text( + "直付商店", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: tradeTypeIndex == 3 + ? Color(0xFF30415B) + : Color(0xFF0D0D0D)), + ), + ), + if (tradeTypeIndex == 3) + Image.asset( + "assets/image/bs_shop.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + ], + ), + )), + GestureDetector( + onTap: () { + setState(() { + Navigator.of(context).pop(posTypeCode); + }); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + margin: EdgeInsets.only(top: 25.h), + padding: EdgeInsets.symmetric(vertical: 16.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B)), + child: Text( + S.of(context).queding, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Colors.white, + ), + ), + ), + ) + ], + ), + ) + ], + ), + ); + }); + }); + } + + ///店铺类型 + String shopType() { + if (records.serviceType == "EATSTORE") { + return "吃"; + } else if (records.serviceType == "DRINKSTORE") { + return "喝"; + } else if (records.serviceType == "HAPPYSTORE") { + return "玩"; + } + } + + ///店铺类型选择 + String shopTypeCode() { + if (shopTypeIndex == 0) { + return "EATSTORE"; + } else if (shopTypeIndex == 1) { + return "DRINKSTORE"; + } else if (shopTypeIndex == 2) { + return "HAPPYSTORE"; + } } + ///店铺类型弹窗选择 + showShopType() { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return StatefulBuilder(builder: ( + context, + state, + ) { + return Container( + width: double.infinity, + height: 360.h, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Container( + alignment: Alignment.center, + margin: EdgeInsets.only( + top: 12.h, bottom: 12.h, left: 41.w), + child: Text( + "选择店铺类型", + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 16.sp, + color: Color(0xFF1A1A1A), + ), + ), + )), + GestureDetector( + onTap: () { + state(() { + Navigator.of(context).pop(); + }); + }, + child: Padding( + padding: EdgeInsets.only(right: 16.w), + child: Image.asset( + "assets/image/cancel.webp", + width: 25.h, + height: 25.h, + ), + ), + ), + ], + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + children: [ + GestureDetector( + onTap: () { + state(() { + shopTypeIndex = 0; + serviceType = "吃"; + }); + }, + child: Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + height: 52.h, + width: double.infinity, + decoration: BoxDecoration( + color: shopTypeIndex == 0 + ? Color(0xFFEFF5FF) + : Color(0xFFF7F7F7), + borderRadius: BorderRadius.circular(4.w), + border: Border.all( + color: shopTypeIndex == 0 + ? Color(0xFF30415B) + : Colors.white, + width: shopTypeIndex == 0 ? 1.w : 0, + ), + ), + padding: EdgeInsets.only( + top: 16.h, + bottom: 16.h, + left: 16.w, + right: 17.w), + child: Text( + "吃", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: shopTypeIndex == 0 + ? Color(0xFF30415B) + : Color(0xFF0D0D0D)), + ), + ), + if (shopTypeIndex == 0) + Image.asset( + "assets/image/bs_shop.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + ], + ), + )), + GestureDetector( + onTap: () { + state(() { + shopTypeIndex = 1; + serviceType = "喝"; + }); + }, + child: Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + height: 52.h, + width: double.infinity, + decoration: BoxDecoration( + color: shopTypeIndex == 1 + ? Color(0xFFEFF5FF) + : Color(0xFFF7F7F7), + borderRadius: BorderRadius.circular(4.w), + border: Border.all( + color: shopTypeIndex == 1 + ? Color(0xFF30415B) + : Colors.white, + width: shopTypeIndex == 1 ? 1.w : 0, + ), + ), + padding: EdgeInsets.only( + top: 16.h, + bottom: 16.h, + left: 16.w, + right: 17.w), + child: Text( + "喝", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: shopTypeIndex == 1 + ? Color(0xFF30415B) + : Color(0xFF0D0D0D)), + ), + ), + if (shopTypeIndex == 1) + Image.asset( + "assets/image/bs_shop.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + ], + ), + )), + GestureDetector( + onTap: () { + state(() { + shopTypeIndex = 2; + serviceType = "玩"; + }); + }, + child: Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + height: 52.h, + width: double.infinity, + decoration: BoxDecoration( + color: shopTypeIndex == 2 + ? Color(0xFFEFF5FF) + : Color(0xFFF7F7F7), + borderRadius: BorderRadius.circular(4.w), + border: Border.all( + color: shopTypeIndex == 2 + ? Color(0xFF30415B) + : Colors.white, + width: shopTypeIndex == 2 ? 1.w : 0, + ), + ), + padding: EdgeInsets.only( + top: 16.h, + bottom: 16.h, + left: 16.w, + right: 17.w), + child: Text( + "玩", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: shopTypeIndex == 2 + ? Color(0xFF30415B) + : Color(0xFF0D0D0D)), + ), + ), + if (shopTypeIndex == 2) + Image.asset( + "assets/image/bs_shop.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + ], + ), + )), + GestureDetector( + onTap: () { + setState(() { + Navigator.of(context).pop(serviceType); + }); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + margin: EdgeInsets.only(top: 25.h), + padding: EdgeInsets.symmetric(vertical: 16.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B)), + child: Text( + S.of(context).queding, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Colors.white, + ), + ), + ), + ) + ], + ), + ) + ], + ), + ); + }); + }); + } } diff --git a/lib/business_system/mine/shop_image_info.dart b/lib/business_system/mine/shop_image_info.dart new file mode 100644 index 00000000..ba6cecba --- /dev/null +++ b/lib/business_system/mine/shop_image_info.dart @@ -0,0 +1,356 @@ +import 'dart:convert'; +import 'dart:io'; +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/upload_result.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/cupertino_date_picker.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:image_pickers/image_pickers.dart'; +import 'package:intl/intl.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../retrofit/business_api.dart'; +import '../../utils/business_instance.dart'; + +class ShopImageInfo extends StatefulWidget { + final Map arguments; + + ShopImageInfo({this.arguments}); + + @override + State createState() { + return _ShopImageInfo(); + } +} + +class _ShopImageInfo extends State { + String filePath; + String logoPath; + BusinessApiService businessService; + Map imageInfo = { + "logo": "", + "facade": "", + }; + + @override + void initState() { + super.initState(); + // SharedPreferences.getInstance().then((value) => { + // imageInfo["logo"] = widget.arguments["logo"], + // imageInfo["facade"] = widget.arguments["facade"], + // }); + } + + refresh() async { + setState(() {}); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: Color(0xFFF8F8FA), + appBar: MyAppBar( + title: "门店图片", + titleColor: Colors.black, + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, + ), + body: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.w), + padding: EdgeInsets.only(top: 16.h, left: 18.w, bottom: 16.h), + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 16.h), + child: Text( + "店铺logo", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + showImagePicker(1); + }, + child: Container( + height: 77.h, + width: 77.h, + decoration: BoxDecoration( + color: Color(0xFFF2F2F2), + borderRadius: BorderRadius.circular(4), + ), + alignment: Alignment.center, + child: (widget.arguments["logo"] != "") + ? (logoPath == null + ? MImage( + widget.arguments["logo"], + fit: BoxFit.contain, + radius: BorderRadius.circular(2), + width: MediaQuery.of(context).size.width / 1.5, + height: MediaQuery.of(context).size.width / 1.5, + errorSrc: "assets/image/default_2_1.webp", + fadeSrc: "assets/image/default_2_1.webp", + ) + : Image.file( + File(logoPath), + width: MediaQuery.of(context).size.width / 1.5, + height: MediaQuery.of(context).size.width / 1.5, + fit: BoxFit.cover, + )) + : SvgPicture.asset( + "assets/svg/zhaopianshipin.svg", + width: 24.h, + height: 24.h, + fit: BoxFit.contain, + ), + ), + ) + ], + ), + ), + Container( + margin: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.w), + padding: EdgeInsets.only(top: 16.h, left: 18.w, bottom: 16.h), + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 16.h), + child: Text( + "门面图", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + showImagePicker(2); + }, + child: Container( + height: 77.h, + width: 77.h, + decoration: BoxDecoration( + color: Color(0xFFF2F2F2), + borderRadius: BorderRadius.circular(4), + ), + alignment: Alignment.center, + child: (widget.arguments["facade"] != "") + ? (filePath == null + ? MImage( + widget.arguments["facade"], + fit: BoxFit.contain, + radius: BorderRadius.circular(2), + width: MediaQuery.of(context).size.width / 1.5, + height: MediaQuery.of(context).size.width / 1.5, + errorSrc: "assets/image/default_2_1.webp", + fadeSrc: "assets/image/default_2_1.webp", + ) + : Image.file( + File(filePath), + width: MediaQuery.of(context).size.width / 1.5, + height: MediaQuery.of(context).size.width / 1.5, + fit: BoxFit.cover, + )) + : SvgPicture.asset( + "assets/svg/zhaopianshipin.svg", + width: 24.h, + height: 24.h, + fit: BoxFit.contain, + ), + ), + ) + ], + ), + ), + Spacer(), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pop([imageInfo["logo"] == "" ? widget.arguments["logo"]:imageInfo["logo"], + imageInfo["facade"] == "" ? widget.arguments["facade"]:imageInfo["facade"]]); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 55.h, left: 16.w, right: 16.w), + padding: EdgeInsets.symmetric(vertical: 16.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B)), + child: Text( + S.of(context).baocun, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Colors.white, + ), + ), + ), + ) + ], + ), + ); + } + + ///显示图片选择方式 + showImagePicker(index) { + showCupertinoModalPopup( + context: context, + builder: (contetx) { + return CupertinoActionSheet( + title: Text(S.of(context).genghuantouxiang), + actions: [ + CupertinoActionSheetAction( + child: Text(S.of(context).paizhao), + onPressed: () { + openCamera(index); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), + CupertinoActionSheetAction( + child: Text(S.of(context).xiangce), + onPressed: () { + openStorage(index); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), + ], + cancelButton: CupertinoActionSheetAction( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(S.of(context).quxiao), + isDestructiveAction: true, + ), + ); + }); + } + + ///拍照 + openCamera(index) async { + if (await Permission.camera.isGranted) { + Media medias = await ImagePickers.openCamera( + cameraMimeType: CameraMimeType.photo, + cropConfig: CropConfig( + enableCrop: true, + width: 200, + height: 200, + ), + compressSize: 500, + ); + if (medias == null) return; + if(index == 1){ + logoPath = medias.path; + }else{ + filePath = medias.path; + } + fileImgUpload(index); + } else { + await Permission.camera.request(); + openCamera(index); + } + } + + ///打开相册 + openStorage(index) async { + if (await Permission.storage.isGranted) { + List medias = await ImagePickers.pickerPaths( + galleryMode: GalleryMode.image, + selectCount: 1, + showGif: true, + showCamera: false, + compressSize: 500, + uiConfig: UIConfig( + uiThemeColor: Color(0xFFFFFFFF), + ), + cropConfig: CropConfig( + enableCrop: true, + width: 200, + height: 200, + ), + ); + if (medias == null || medias.length == 0) return; + if (index == 1) { + logoPath = medias[0].path; + } else { + filePath = medias[0].path; + } + setState(() {}); + fileImgUpload(index); + } else { + await Permission.storage.request(); + openStorage(index); + } + } + + ///文件上传 + fileImgUpload(index) async { + 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"]); + } + if (logoPath != null && logoPath != "" && await File(logoPath).exists() || filePath != null && filePath != "" && await File(filePath).exists()) { + BaseData baseData = await businessService + .upload(File(index == 1 ? logoPath:filePath), 1) + .catchError((onError) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center); + }); + if (baseData != null && baseData.isSuccess) { + UploadResult uploadResult = baseData.data; + if (index == 1) { + imageInfo["logo"] = uploadResult.url; + } else { + imageInfo["facade"] = uploadResult.url; + } + } + EasyLoading.dismiss(); + } + } +} diff --git a/lib/business_system/order/order_list.dart b/lib/business_system/order/order_list.dart index bfd27915..a9f1e131 100644 --- a/lib/business_system/order/order_list.dart +++ b/lib/business_system/order/order_list.dart @@ -7,7 +7,6 @@ import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import 'package:shimmer/shimmer.dart'; import '../../../utils/font_weight.dart'; @@ -42,6 +41,7 @@ class _OrderList extends State { List adminOrderDTOList = []; int _pageIndex = 1; bool _shimmer = true; + int index = 0; @override void dispose() { @@ -251,7 +251,9 @@ class _OrderList extends State { physics: BouncingScrollPhysics(), itemBuilder: (context, position) { return GestureDetector( - onTap: () {}, + onTap: () { + index = position; + }, child: orderGoodsList( adminOrderDtoList.orderProductList[position]), ); @@ -318,12 +320,17 @@ class _OrderList extends State { Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - // Spacer(), + if(adminOrderDtoList.ticketStatus != null) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { Navigator.of(context) - .pushNamed('/router/order_write_off'); + .pushNamed('/router/order_write_off', arguments:{ + "tickets":adminOrderDtoList.tickets, + "productName": adminOrderDtoList.orderProductList[index].productName, + "orderCode": adminOrderDtoList?.orderCode ?? "", + "userName":adminOrderDtoList?.name ?? "" + }); }, child: Container( decoration: BoxDecoration( diff --git a/lib/business_system/order/order_write_off.dart b/lib/business_system/order/order_write_off.dart index 73f9d3eb..18604872 100644 --- a/lib/business_system/order/order_write_off.dart +++ b/lib/business_system/order/order_write_off.dart @@ -4,10 +4,15 @@ import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../retrofit/data/business_order_list.dart'; import '../../view_widget/classic_header.dart'; import '../../view_widget/my_footer.dart'; class OrderWriteOff extends StatefulWidget { + final Map arguments; + + OrderWriteOff({this.arguments}); + @override State createState() { return _OrderWriteOff(); @@ -17,10 +22,14 @@ class OrderWriteOff extends StatefulWidget { class _OrderWriteOff extends State { final RefreshController refreshController = RefreshController(); var writeOffCheck = false; + List tickets; + String productName; @override void initState() { super.initState(); + tickets = widget.arguments["tickets"]; + productName = widget.arguments["productName"]; } @override @@ -123,10 +132,10 @@ class _OrderWriteOff extends State { SizedBox( height: 12.h, ), - basicInfoItem("票券名称:","单人尊享票"), - basicInfoItem("用户名称::","李哈哈"), + basicInfoItem("票券名称:",productName ?? ""), + basicInfoItem("用户名称::",widget?.arguments["userName"] ?? ""), basicInfoItem("票券编号::","177777622222223"), - basicInfoItem("订单编号::","7666677777777772233") + basicInfoItem("订单编号::",widget?.arguments["orderCode"] ?? ""), ], ), ); @@ -204,14 +213,14 @@ class _OrderWriteOff extends State { ), ListView.builder( padding: EdgeInsets.zero, - itemCount: 3, + itemCount: tickets?.length ?? 0, scrollDirection: Axis.vertical, shrinkWrap: true, physics: BouncingScrollPhysics(), itemBuilder: (context, position) { return GestureDetector( onTap: () {}, - child: writeOffInfoItem(), + child: writeOffInfoItem(tickets[position]), ); }, ) @@ -220,7 +229,7 @@ class _OrderWriteOff extends State { ); } - Widget writeOffInfoItem(){ + Widget writeOffInfoItem(Tickets tickets){ return Container( width: double.infinity, child: Column( @@ -230,11 +239,11 @@ class _OrderWriteOff extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded(child: Text( - "台湾天然手作牡丹茶*1(牡丹野餐区茶饮车兑换)", + tickets?.name ?? "", style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 14.sp, - color: Color(0xFF0D0D0D), + color: tickets.state == 1?Color(0xFF0D0D0D):Color(0xFFABACAB), ), )), Expanded(child: Column( @@ -242,14 +251,15 @@ class _OrderWriteOff extends State { children: [ Padding(padding: EdgeInsets.only(right:10.w), child: Text( - "已核销", + (tickets.state == 1)?"待核销":"已核销", style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 12.sp, - color: Color(0xFFACACAC), + color: (tickets.state == 1)?Color(0xFF30415B):Color(0xFFACACAC), ), ),), SizedBox(height:25.h,), + if(tickets.state == 1) Checkbox( value: writeOffCheck, onChanged: (a) { @@ -267,25 +277,26 @@ class _OrderWriteOff extends State { )) ], ), - // Align( - // alignment: Alignment.centerRight, - // child:Container( - // decoration: BoxDecoration( - // color: Colors.white, - // borderRadius: BorderRadius.circular( - // 2, - // ), - // border: Border.all( - // color: Color(0xFFCFCFCF), - // width: 1.w, - // ), - // ), - // child: Icon( - // Icons.check, - // color: Color(0xFFCFCFCF), - // size: 14.w, - // ) - // ),), + Align( + alignment: Alignment.centerRight, + child:Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular( + 2, + ), + border: Border.all( + color: Color(0xFFCFCFCF), + width: 1.w, + ), + ), + child: Icon( + Icons.check, + color: Color(0xFFCFCFCF), + size: 14.w, + ) + ),), Container( margin: EdgeInsets.only(bottom:11.h,top: 13.h), width: double.infinity, diff --git a/lib/business_system/order/request_refund.dart b/lib/business_system/order/request_refund.dart index 70db15cb..710cd7a3 100644 --- a/lib/business_system/order/request_refund.dart +++ b/lib/business_system/order/request_refund.dart @@ -368,9 +368,9 @@ class _RequestRefund extends State { builder: (context) { return AlertDialog( content: Container( - width: MediaQuery.of(context).size.width - 84, - height: 139.h, + width: MediaQuery.of(context).size.width - 84.w, child: Column( + mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -476,7 +476,7 @@ class _RequestRefund extends State { Expanded( child: Container( alignment: Alignment.center, - margin: EdgeInsets.symmetric(vertical: 12), + margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left: 41.w), child: Text( "退款原因", style: TextStyle( diff --git a/lib/home/points_mall_view/points_goods_view.dart b/lib/home/points_mall_view/points_goods_view.dart index eac4013b..30540ba9 100644 --- a/lib/home/points_mall_view/points_goods_view.dart +++ b/lib/home/points_mall_view/points_goods_view.dart @@ -46,11 +46,6 @@ class _PointGoods extends State { @override Widget build(BuildContext context) { return Container( - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(4), - // color: Colors.white, - // ), - // margin: EdgeInsets.only(top: 16.h,right: 14.w,left: 14.w), child:(widget.goods == null || widget.goods.length == 0) ? NoDataView( src: "assets/image/xiao_fei.webp", diff --git a/lib/main.dart b/lib/main.dart index d92cadac..accfe223 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -102,6 +102,7 @@ import 'business_system/login/business_login_page.dart'; import 'business_system/mine/account_information.dart'; import 'business_system/mine/merchant_info.dart'; import 'business_system/mine/security_setting.dart'; +import 'business_system/mine/shop_image_info.dart'; import 'business_system/order/business_order_detail.dart'; import 'business_system/order/order_write_off.dart'; import 'business_system/order/request_refund.dart'; @@ -489,7 +490,7 @@ Map routers = { '/router/business_order_detail': (context, {arguments}) => BusinessOrderDetail(arguments: arguments), '/router/order_write_off': (context, {arguments}) => - OrderWriteOff(), + OrderWriteOff(arguments: arguments), '/router/security_setting': (context, {arguments}) => SecuritySetting(arguments: arguments), '/router/merchant_info': (context, {arguments}) => @@ -506,4 +507,6 @@ Map routers = { MonthlyReportPage(), '/router/custom_page': (context, {arguments}) => CustomPage(), + '/router/shop_image_info': (context, {arguments}) => + ShopImageInfo(arguments:arguments), }; diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 4fd4e75a..79ebd698 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -31,7 +31,6 @@ class _MineItem extends State { "account": account, "password": password, }; - EasyLoading.show( status: S.of(context).zhengzaijiazai, maskType: EasyLoadingMaskType.black); @@ -44,7 +43,9 @@ class _MineItem extends State { }); if (baseData != null && baseData.isSuccess) { var businessLoginInfo = BusinessLoginInfo.fromJson(baseData.data); - businessLoginInfo.storeList.insert(0, StoreList(name: "所有门店")); + if(businessLoginInfo.storeList.length > 1) { + businessLoginInfo.storeList.insert(0, StoreList(name: "所有门店")); + } BusinessInstance.instance.businessTenant = businessLoginInfo.tenantCode; BusinessInstance.instance.businessToken = businessLoginInfo.token; if (businessLoginInfo.storeList.length > 1) { diff --git a/lib/mine/mine_vip/mine_attainment_page.dart b/lib/mine/mine_vip/mine_attainment_page.dart index c7e1895c..ac7986b0 100644 --- a/lib/mine/mine_vip/mine_attainment_page.dart +++ b/lib/mine/mine_vip/mine_attainment_page.dart @@ -170,17 +170,17 @@ class _MineAttainmentPage extends State { physics: BouncingScrollPhysics(), child: Column( children: [ - SizedBox(height: 24), + SizedBox(height: 24.h), MImage( userInfo?.headimg ?? "", isCircle: true, - width: 58, - height: 58, + width: 58.h, + height: 58.h, fit: BoxFit.cover, errorSrc: "assets/image/default_user.webp", fadeSrc: "assets/image/default_user.webp", ), - SizedBox(height: 8), + SizedBox(height: 8.h), Text( userInfo?.nickname ?? S.of(context).denglu, style: TextStyle( @@ -189,11 +189,11 @@ class _MineAttainmentPage extends State { color: Color(0xFF353535), ), ), - SizedBox(height: 28), + SizedBox(height: 28.h), Container( margin: EdgeInsets.only( - left: 16, right: 16, top: 26, bottom: 8), - padding: EdgeInsets.all(20), + left: 16.w, right: 16.w, top: 26.h, bottom: 8.h), + padding: EdgeInsets.symmetric(vertical: 20.h,), decoration: BoxDecoration( color: Colors.white, boxShadow: [ @@ -210,6 +210,8 @@ class _MineAttainmentPage extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding(padding:EdgeInsets.symmetric(horizontal:20.w), + child: Row( children: [ Text( @@ -244,8 +246,8 @@ class _MineAttainmentPage extends State { color: Color(0xFF353535)), ), ], - ), - SizedBox(height: 12), + )), + SizedBox(height: 12.h), attainmentBadge(), ], ), @@ -269,14 +271,14 @@ class _MineAttainmentPage extends State { gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( //一行的Widget数量 crossAxisCount: 3, - //水平子Widget之间间距 - crossAxisSpacing: 13, - //垂直子Widget之间间距 - mainAxisSpacing: 12, - //子Widget宽高比例 - childAspectRatio: AppUtils.textScale(context) > 1 - ? (1 - ((AppUtils.textScale(context) - 1))) - : 0.85, + // //水平子Widget之间间距 + // crossAxisSpacing: 13, + // //垂直子Widget之间间距 + // mainAxisSpacing: 12, + // //子Widget宽高比例 + // childAspectRatio: AppUtils.textScale(context) > 1 + // ? (1 - ((AppUtils.textScale(context) - 1))) + // : 0.85, ), itemBuilder: (context, index) { return GestureDetector( @@ -285,7 +287,7 @@ class _MineAttainmentPage extends State { queryAchievementDetail(index); }); }, - child: badgeItem(vipBadgesList[index]), + child: badgeItem(vipBadgesList[index]) ); }, ) @@ -306,8 +308,8 @@ class _MineAttainmentPage extends State { children: [ MImage( vipBadgesList?.icon ?? "", - width: 80, - height: 80, + width: 80.h, + height: 80.h, fit: BoxFit.cover, errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", diff --git a/lib/retrofit/business_api.dart b/lib/retrofit/business_api.dart index 54efed7b..5470d0a4 100644 --- a/lib/retrofit/business_api.dart +++ b/lib/retrofit/business_api.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; @@ -15,6 +16,7 @@ import 'data/base_data.dart'; import 'data/business_goods.dart'; import 'data/business_order_detail_info.dart'; import 'data/business_order_list.dart'; +import 'data/business_store_list.dart'; import 'data/day_flow_list.dart'; import 'data/goods_type_sales_list.dart'; import 'data/popular_sales_list.dart'; @@ -22,6 +24,7 @@ import 'data/product_group_list.dart'; import 'data/refund_reason_list.dart'; import 'data/single_sales_list.dart'; import 'data/trade_summary_list.dart'; +import 'data/upload_result.dart'; part 'business_api.g.dart'; @@ -58,8 +61,8 @@ abstract class BusinessApiService { if (kReleaseMode) baseUrl = serviceBaseUrl; if (url != null) baseUrl = url; dio.options = BaseOptions( - connectTimeout: 60000, - receiveTimeout: 60000, + connectTimeout: 30000, + receiveTimeout: 30000, headers: headers, responseType: ResponseType.json, baseUrl: baseUrl, @@ -229,4 +232,19 @@ abstract class BusinessApiService { Future delProductCategory( @Body() Map param); + ///门店设置-列表 + @GET("store/getStoreList?tenantCode={tenantCode}&pageIndex={pageIndex}&pageSize={pageSize}") + Future> getStoreList(@Path("tenantCode") String tenantCode, @Path("pageIndex") String pageIndex, @Path("pageSize") String pageSize); + + ///删除分组分类 + @PUT("store") + Future saveStoreInfo( + @Body() Map param); + + ///文件上传 + @POST("file/upload") + @MultiPart() + Future> upload(@Part(name: "file") File data, + @Part(name: "folderId") int folderId); + } diff --git a/lib/retrofit/business_api.g.dart b/lib/retrofit/business_api.g.dart index 735a2563..6513d479 100644 --- a/lib/retrofit/business_api.g.dart +++ b/lib/retrofit/business_api.g.dart @@ -476,4 +476,80 @@ class _BusinessApiService implements BusinessApiService { ); return value; } + + @override + Future> getStoreList(tenantCode,pageIndex,pageSize) async { + ArgumentError.checkNotNull(tenantCode, 'tenantCode'); + ArgumentError.checkNotNull(pageIndex, 'pageIndex'); + ArgumentError.checkNotNull(pageSize, 'pageSize'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'store/getStoreList?tenantCode=$tenantCode&pageIndex=$pageIndex&pageSize=$pageSize', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => BusinessStoreList.fromJson(json), + ); + return value; + } + + @override + Future saveStoreInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('store', + queryParameters: queryParameters, + options: RequestOptions( + method: 'PUT', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json == null ? null : json, + ); + return value; + } + + @override + Future> upload(data, folderId) async { + ArgumentError.checkNotNull(data, 'data'); + ArgumentError.checkNotNull(folderId, 'folderId'); + const _extra = {}; + final queryParameters = {}; + final _data = FormData(); + String fileName = data.path.split(Platform.pathSeparator).last; + _data.files.add(MapEntry( + 'file', MultipartFile.fromFileSync(data.path, filename: fileName))); + print("filename:$fileName"); + if (folderId != null) { + _data.fields.add(MapEntry('folderId', folderId.toString())); + } + final _result = await _dio.request>('/file/upload', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + connectTimeout: 60000, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => UploadResult.fromJson(json), + ); + return value; + } } diff --git a/lib/retrofit/data/business_order_list.dart b/lib/retrofit/data/business_order_list.dart index 763b9744..5c787ce7 100644 --- a/lib/retrofit/data/business_order_list.dart +++ b/lib/retrofit/data/business_order_list.dart @@ -1,9 +1,9 @@ -/// total : 1 -/// adminOrderDTOList : [{"id":"1704311046749028352","orderCode":"202309200946320001","storeName":"士林鲜果&牛奶","productCount":1,"orderStatus":1,"orderSum":"0.01","paySum":"0","createTime":"2023-09-20 09:46:33","returnType":0,"orderType":0,"returnCode":null,"returnStatus":null,"applyTime":null,"applySum":null,"memberAccount":"郑州小吃街","name":null,"payStatus":0,"couponSubPrice":"0.00","totalDiscountPrice":"0.00","orderSource":3,"dayFlowCode":"352","tableId":"0","tableName":null,"realPeople":null,"refundStatus":0,"notes":"","payNum":null,"reason":null,"isSubscribe":false,"subcribeTime":null,"endRefundTime":null,"memberInfo":null,"orderProductList":[{"id":"1704311046925189120","createTime":"2023-09-20 09:46:33","createUser":"1640233401329909760","updateTime":"2023-09-20 09:46:33","updateUser":"1640233401329909760","tenantCode":"1195","storeId":"1645316356192600064","orderId":"1704311046749028352","actInfo":null,"productId":"1685891939443933184","productName":"芒果牛乳","skuId":"1704310860643565568","skuNameStr":"700ml 冰 七分糖","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"19.00","sellPrice":"0.01","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}],"mid":"1640233401329909760","isTakeOut":0,"logisticsId":"0","shipperCode":"","logisticsName":"","logisticsNum":"","logisticsCase":null,"postFee":"0.00","finalPayPrice":"0.00"}] +/// total : 12260 +/// adminOrderDTOList : [{"id":"1670299926090743808","orderCode":"202306181318290001","storeName":"一心回乡古桑园","productCount":2,"orderStatus":4,"orderSum":"80.00","paySum":"80.00","createTime":"2023-06-18 13:18:30","returnType":0,"orderType":0,"returnCode":null,"returnStatus":null,"applyTime":null,"applySum":null,"memberAccount":"_oODK34iuq0gsqyS-TyG0E6SxWlbg","name":"","payStatus":1,"couponSubPrice":"0.00","totalDiscountPrice":"0.00","orderSource":1,"dayFlowCode":"700","tableId":"0","tableName":null,"realPeople":null,"refundStatus":0,"notes":"","payNum":"","reason":null,"isSubscribe":false,"subcribeTime":"2023-06-18 00:00:00","endRefundTime":null,"memberInfo":{"mid":null,"name":null,"phone":"","mark":null},"orderProductList":[{"id":"1670299926174629888","createTime":"2023-06-18 13:18:30","createUser":"1670299754392715264","updateTime":"2023-06-18 13:18:30","updateUser":"1670299754392715264","tenantCode":"1187","storeId":"1509798399048679424","orderId":"1670299926090743808","actInfo":null,"productId":"1511546728703066112","productName":"一心回乡古桑园门票","skuId":"1511546728765980672","skuNameStr":"","skuImg":"","buyNum":2,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"40.00","sellPrice":"40.00","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"NORMAL","ticketDays":"1","takeType":null,"skuTickets":["古桑园单人票*1张"],"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}],"mid":"1670299754392715264","isTakeOut":0,"logisticsId":"0","shipperCode":"","logisticsName":"","logisticsNum":"","logisticsCase":null,"postFee":"0.00","finalPayPrice":"0.00","ticketStatus":false,"tickets":[{"id":"1670299949914390528","createTime":"2023-06-18 13:18:35","createUser":"0","updateTime":"2023-06-18 13:18:35","updateUser":"0","mid":"1670299754392715264","storeId":"1509798399048679424","orderId":"1670299926090743808","orderProductId":"1670299926174629888","productId":"1511546728703066112","productSkuId":"1511546728765980672","ticketWipedTimeTemplateId":"0","amount":"40.00","name":"一心回乡古桑园门票 ","code":"T202306181318357219620001","useStartTime":"2023-06-18 00:00:00","useEndTime":"2023-06-18 17:00:00","finishTime":"2023-06-18 13:19:08","type":"NORMAL","takeType":null,"style":"","state":9,"canSettlement":true,"canSubscribe":true,"isDelete":0,"tenantCode":"1187"},{"id":"1670299949931167744","createTime":"2023-06-18 13:18:35","createUser":"0","updateTime":"2023-06-18 13:18:35","updateUser":"0","mid":"1670299754392715264","storeId":"1509798399048679424","orderId":"1670299926090743808","orderProductId":"1670299926174629888","productId":"1511546728703066112","productSkuId":"1511546728765980672","ticketWipedTimeTemplateId":"0","amount":"40.00","name":"一心回乡古桑园门票 ","code":"T202306181318354318130002","useStartTime":"2023-06-18 00:00:00","useEndTime":"2023-06-18 17:00:00","finishTime":"2023-06-18 13:19:08","type":"NORMAL","takeType":null,"style":"","state":9,"canSettlement":true,"canSubscribe":true,"isDelete":0,"tenantCode":"1187"}]},{"id":"1670298860821413888","orderCode":"202306181314150004","storeName":"游客服务中心","productCount":1,"orderStatus":4,"orderSum":"21.00","paySum":"21.00","createTime":"2023-06-18 13:14:16","returnType":0,"orderType":5,"returnCode":null,"returnStatus":null,"applyTime":null,"applySum":null,"memberAccount":"_oODK34qw0YgVKmxTCcPOIkPDadyg","name":"","payStatus":1,"couponSubPrice":"0.00","totalDiscountPrice":"0.00","orderSource":1,"dayFlowCode":"807","tableId":null,"tableName":null,"realPeople":null,"refundStatus":0,"notes":"","payNum":"","reason":null,"isSubscribe":false,"subcribeTime":null,"endRefundTime":null,"memberInfo":{"mid":null,"name":null,"phone":"","mark":null},"orderProductList":[{"id":"1670298860833996800","createTime":"2023-06-18 13:14:16","createUser":"1670298846741135360","updateTime":"2023-06-18 13:14:16","updateUser":"1670298846741135360","tenantCode":"1187","storeId":"1657952889512919040","orderId":"1670298860821413888","actInfo":null,"productId":"-2","productName":"扫码支付","skuId":"-2","skuNameStr":"扫码支付","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"21.00","sellPrice":"21.00","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":false,"batch":0,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":null,"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}],"mid":"1670298846741135360","isTakeOut":0,"logisticsId":"0","shipperCode":"","logisticsName":"","logisticsNum":"","logisticsCase":null,"postFee":"0.00","finalPayPrice":"0.00","ticketStatus":null,"tickets":null},{"id":"1670297567398723584","orderCode":"202306181309070004","storeName":"食间餐厅","productCount":1,"orderStatus":4,"orderSum":"239.00","paySum":"239.00","createTime":"2023-06-18 13:09:07","returnType":0,"orderType":5,"returnCode":null,"returnStatus":null,"applyTime":null,"applySum":null,"memberAccount":"_oODK34r-TK_dJrrbdcHt0BeVp4Kk","name":"","payStatus":1,"couponSubPrice":"0.00","totalDiscountPrice":"0.00","orderSource":1,"dayFlowCode":"296","tableId":null,"tableName":null,"realPeople":null,"refundStatus":0,"notes":"","payNum":"","reason":null,"isSubscribe":false,"subcribeTime":null,"endRefundTime":null,"memberInfo":{"mid":null,"name":null,"phone":"","mark":null},"orderProductList":[{"id":"1670297567415500800","createTime":"2023-06-18 13:09:07","createUser":"1670272634157268992","updateTime":"2023-06-18 13:09:07","updateUser":"1670272634157268992","tenantCode":"1187","storeId":"1658649144362795008","orderId":"1670297567398723584","actInfo":null,"productId":"-2","productName":"扫码支付","skuId":"-2","skuNameStr":"扫码支付","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"239.00","sellPrice":"239.00","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":false,"batch":0,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":null,"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}],"mid":"1670272634157268992","isTakeOut":0,"logisticsId":"0","shipperCode":"","logisticsName":"","logisticsNum":"","logisticsCase":null,"postFee":"0.00","finalPayPrice":"0.00","ticketStatus":null,"tickets":null}] class BusinessOrderList { BusinessOrderList({ - num total, + num total, List adminOrderDTOList,}){ _total = total; _adminOrderDTOList = adminOrderDTOList; @@ -39,40 +39,40 @@ BusinessOrderList copyWith({ num total, } -/// id : "1704311046749028352" -/// orderCode : "202309200946320001" -/// storeName : "士林鲜果&牛奶" -/// productCount : 1 -/// orderStatus : 1 -/// orderSum : "0.01" -/// paySum : "0" -/// createTime : "2023-09-20 09:46:33" +/// id : "1670299926090743808" +/// orderCode : "202306181318290001" +/// storeName : "一心回乡古桑园" +/// productCount : 2 +/// orderStatus : 4 +/// orderSum : "80.00" +/// paySum : "80.00" +/// createTime : "2023-06-18 13:18:30" /// returnType : 0 /// orderType : 0 /// returnCode : null /// returnStatus : null /// applyTime : null /// applySum : null -/// memberAccount : "郑州小吃街" -/// name : null -/// payStatus : 0 +/// memberAccount : "_oODK34iuq0gsqyS-TyG0E6SxWlbg" +/// name : "" +/// payStatus : 1 /// couponSubPrice : "0.00" /// totalDiscountPrice : "0.00" -/// orderSource : 3 -/// dayFlowCode : "352" +/// orderSource : 1 +/// dayFlowCode : "700" /// tableId : "0" /// tableName : null /// realPeople : null /// refundStatus : 0 /// notes : "" -/// payNum : null +/// payNum : "" /// reason : null /// isSubscribe : false -/// subcribeTime : null +/// subcribeTime : "2023-06-18 00:00:00" /// endRefundTime : null -/// memberInfo : null -/// orderProductList : [{"id":"1704311046925189120","createTime":"2023-09-20 09:46:33","createUser":"1640233401329909760","updateTime":"2023-09-20 09:46:33","updateUser":"1640233401329909760","tenantCode":"1195","storeId":"1645316356192600064","orderId":"1704311046749028352","actInfo":null,"productId":"1685891939443933184","productName":"芒果牛乳","skuId":"1704310860643565568","skuNameStr":"700ml 冰 七分糖","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"19.00","sellPrice":"0.01","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}] -/// mid : "1640233401329909760" +/// memberInfo : {"mid":null,"name":null,"phone":"","mark":null} +/// orderProductList : [{"id":"1670299926174629888","createTime":"2023-06-18 13:18:30","createUser":"1670299754392715264","updateTime":"2023-06-18 13:18:30","updateUser":"1670299754392715264","tenantCode":"1187","storeId":"1509798399048679424","orderId":"1670299926090743808","actInfo":null,"productId":"1511546728703066112","productName":"一心回乡古桑园门票","skuId":"1511546728765980672","skuNameStr":"","skuImg":"","buyNum":2,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"40.00","sellPrice":"40.00","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"NORMAL","ticketDays":"1","takeType":null,"skuTickets":["古桑园单人票*1张"],"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}] +/// mid : "1670299754392715264" /// isTakeOut : 0 /// logisticsId : "0" /// shipperCode : "" @@ -81,51 +81,55 @@ BusinessOrderList copyWith({ num total, /// logisticsCase : null /// postFee : "0.00" /// finalPayPrice : "0.00" +/// ticketStatus : false +/// tickets : [{"id":"1670299949914390528","createTime":"2023-06-18 13:18:35","createUser":"0","updateTime":"2023-06-18 13:18:35","updateUser":"0","mid":"1670299754392715264","storeId":"1509798399048679424","orderId":"1670299926090743808","orderProductId":"1670299926174629888","productId":"1511546728703066112","productSkuId":"1511546728765980672","ticketWipedTimeTemplateId":"0","amount":"40.00","name":"一心回乡古桑园门票 ","code":"T202306181318357219620001","useStartTime":"2023-06-18 00:00:00","useEndTime":"2023-06-18 17:00:00","finishTime":"2023-06-18 13:19:08","type":"NORMAL","takeType":null,"style":"","state":9,"canSettlement":true,"canSubscribe":true,"isDelete":0,"tenantCode":"1187"},{"id":"1670299949931167744","createTime":"2023-06-18 13:18:35","createUser":"0","updateTime":"2023-06-18 13:18:35","updateUser":"0","mid":"1670299754392715264","storeId":"1509798399048679424","orderId":"1670299926090743808","orderProductId":"1670299926174629888","productId":"1511546728703066112","productSkuId":"1511546728765980672","ticketWipedTimeTemplateId":"0","amount":"40.00","name":"一心回乡古桑园门票 ","code":"T202306181318354318130002","useStartTime":"2023-06-18 00:00:00","useEndTime":"2023-06-18 17:00:00","finishTime":"2023-06-18 13:19:08","type":"NORMAL","takeType":null,"style":"","state":9,"canSettlement":true,"canSubscribe":true,"isDelete":0,"tenantCode":"1187"}] class AdminOrderDtoList { AdminOrderDtoList({ - String id, - String orderCode, - String storeName, - num productCount, - num orderStatus, - String orderSum, - String paySum, - String createTime, - num returnType, - num orderType, - dynamic returnCode, - dynamic returnStatus, - dynamic applyTime, - dynamic applySum, - String memberAccount, - dynamic name, - num payStatus, - String couponSubPrice, - String totalDiscountPrice, - num orderSource, - String dayFlowCode, - String tableId, - dynamic tableName, - dynamic realPeople, - num refundStatus, - String notes, - dynamic payNum, - dynamic reason, - bool isSubscribe, - dynamic subcribeTime, - dynamic endRefundTime, - dynamic memberInfo, - List orderProductList, - String mid, - num isTakeOut, - String logisticsId, - String shipperCode, - String logisticsName, - String logisticsNum, - dynamic logisticsCase, - String postFee, - String finalPayPrice,}){ + String id, + String orderCode, + String storeName, + num productCount, + num orderStatus, + String orderSum, + String paySum, + String createTime, + num returnType, + num orderType, + dynamic returnCode, + dynamic returnStatus, + dynamic applyTime, + dynamic applySum, + String memberAccount, + String name, + num payStatus, + String couponSubPrice, + String totalDiscountPrice, + num orderSource, + String dayFlowCode, + String tableId, + dynamic tableName, + dynamic realPeople, + num refundStatus, + String notes, + String payNum, + dynamic reason, + bool isSubscribe, + String subcribeTime, + dynamic endRefundTime, + MemberInfo memberInfo, + List orderProductList, + String mid, + num isTakeOut, + String logisticsId, + String shipperCode, + String logisticsName, + String logisticsNum, + dynamic logisticsCase, + String postFee, + String finalPayPrice, + bool ticketStatus, + List tickets,}){ _id = id; _orderCode = orderCode; _storeName = storeName; @@ -168,6 +172,8 @@ class AdminOrderDtoList { _logisticsCase = logisticsCase; _postFee = postFee; _finalPayPrice = finalPayPrice; + _ticketStatus = ticketStatus; + _tickets = tickets; } AdminOrderDtoList.fromJson(dynamic json) { @@ -202,7 +208,7 @@ class AdminOrderDtoList { _isSubscribe = json['isSubscribe']; _subcribeTime = json['subcribeTime']; _endRefundTime = json['endRefundTime']; - _memberInfo = json['memberInfo']; + _memberInfo = json['memberInfo'] != null ? MemberInfo.fromJson(json['memberInfo']) : null; if (json['orderProductList'] != null) { _orderProductList = []; json['orderProductList'].forEach((v) { @@ -218,6 +224,13 @@ class AdminOrderDtoList { _logisticsCase = json['logisticsCase']; _postFee = json['postFee']; _finalPayPrice = json['finalPayPrice']; + _ticketStatus = json['ticketStatus']; + if (json['tickets'] != null) { + _tickets = []; + json['tickets'].forEach((v) { + _tickets.add(Tickets.fromJson(v)); + }); + } } String _id; String _orderCode; @@ -234,7 +247,7 @@ class AdminOrderDtoList { dynamic _applyTime; dynamic _applySum; String _memberAccount; - dynamic _name; + String _name; num _payStatus; String _couponSubPrice; String _totalDiscountPrice; @@ -245,12 +258,12 @@ class AdminOrderDtoList { dynamic _realPeople; num _refundStatus; String _notes; - dynamic _payNum; + String _payNum; dynamic _reason; bool _isSubscribe; - dynamic _subcribeTime; + String _subcribeTime; dynamic _endRefundTime; - dynamic _memberInfo; + MemberInfo _memberInfo; List _orderProductList; String _mid; num _isTakeOut; @@ -261,6 +274,8 @@ class AdminOrderDtoList { dynamic _logisticsCase; String _postFee; String _finalPayPrice; + bool _ticketStatus; + List _tickets; AdminOrderDtoList copyWith({ String id, String orderCode, String storeName, @@ -276,7 +291,7 @@ AdminOrderDtoList copyWith({ String id, dynamic applyTime, dynamic applySum, String memberAccount, - dynamic name, + String name, num payStatus, String couponSubPrice, String totalDiscountPrice, @@ -287,12 +302,12 @@ AdminOrderDtoList copyWith({ String id, dynamic realPeople, num refundStatus, String notes, - dynamic payNum, + String payNum, dynamic reason, bool isSubscribe, - dynamic subcribeTime, + String subcribeTime, dynamic endRefundTime, - dynamic memberInfo, + MemberInfo memberInfo, List orderProductList, String mid, num isTakeOut, @@ -303,6 +318,8 @@ AdminOrderDtoList copyWith({ String id, dynamic logisticsCase, String postFee, String finalPayPrice, + bool ticketStatus, + List tickets, }) => AdminOrderDtoList( id: id ?? _id, orderCode: orderCode ?? _orderCode, storeName: storeName ?? _storeName, @@ -345,6 +362,8 @@ AdminOrderDtoList copyWith({ String id, logisticsCase: logisticsCase ?? _logisticsCase, postFee: postFee ?? _postFee, finalPayPrice: finalPayPrice ?? _finalPayPrice, + ticketStatus: ticketStatus ?? _ticketStatus, + tickets: tickets ?? _tickets, ); String get id => _id; String get orderCode => _orderCode; @@ -361,7 +380,7 @@ AdminOrderDtoList copyWith({ String id, dynamic get applyTime => _applyTime; dynamic get applySum => _applySum; String get memberAccount => _memberAccount; - dynamic get name => _name; + String get name => _name; num get payStatus => _payStatus; String get couponSubPrice => _couponSubPrice; String get totalDiscountPrice => _totalDiscountPrice; @@ -372,12 +391,12 @@ AdminOrderDtoList copyWith({ String id, dynamic get realPeople => _realPeople; num get refundStatus => _refundStatus; String get notes => _notes; - dynamic get payNum => _payNum; + String get payNum => _payNum; dynamic get reason => _reason; bool get isSubscribe => _isSubscribe; - dynamic get subcribeTime => _subcribeTime; + String get subcribeTime => _subcribeTime; dynamic get endRefundTime => _endRefundTime; - dynamic get memberInfo => _memberInfo; + MemberInfo get memberInfo => _memberInfo; List get orderProductList => _orderProductList; String get mid => _mid; num get isTakeOut => _isTakeOut; @@ -388,6 +407,8 @@ AdminOrderDtoList copyWith({ String id, dynamic get logisticsCase => _logisticsCase; String get postFee => _postFee; String get finalPayPrice => _finalPayPrice; + bool get ticketStatus => _ticketStatus; + List get tickets => _tickets; Map toJson() { final map = {}; @@ -422,7 +443,9 @@ AdminOrderDtoList copyWith({ String id, map['isSubscribe'] = _isSubscribe; map['subcribeTime'] = _subcribeTime; map['endRefundTime'] = _endRefundTime; - map['memberInfo'] = _memberInfo; + if (_memberInfo != null) { + map['memberInfo'] = _memberInfo.toJson(); + } if (_orderProductList != null) { map['orderProductList'] = _orderProductList.map((v) => v.toJson()).toList(); } @@ -435,32 +458,286 @@ AdminOrderDtoList copyWith({ String id, map['logisticsCase'] = _logisticsCase; map['postFee'] = _postFee; map['finalPayPrice'] = _finalPayPrice; + map['ticketStatus'] = _ticketStatus; + if (_tickets != null) { + map['tickets'] = _tickets.map((v) => v.toJson()).toList(); + } + return map; + } + +} + +/// id : "1670299949914390528" +/// createTime : "2023-06-18 13:18:35" +/// createUser : "0" +/// updateTime : "2023-06-18 13:18:35" +/// updateUser : "0" +/// mid : "1670299754392715264" +/// storeId : "1509798399048679424" +/// orderId : "1670299926090743808" +/// orderProductId : "1670299926174629888" +/// productId : "1511546728703066112" +/// productSkuId : "1511546728765980672" +/// ticketWipedTimeTemplateId : "0" +/// amount : "40.00" +/// name : "一心回乡古桑园门票 " +/// code : "T202306181318357219620001" +/// useStartTime : "2023-06-18 00:00:00" +/// useEndTime : "2023-06-18 17:00:00" +/// finishTime : "2023-06-18 13:19:08" +/// type : "NORMAL" +/// takeType : null +/// style : "" +/// state : 9 +/// canSettlement : true +/// canSubscribe : true +/// isDelete : 0 +/// tenantCode : "1187" + +class Tickets { + Tickets({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String mid, + String storeId, + String orderId, + String orderProductId, + String productId, + String productSkuId, + String ticketWipedTimeTemplateId, + String amount, + String name, + String code, + String useStartTime, + String useEndTime, + String finishTime, + String type, + dynamic takeType, + String style, + num state, + bool canSettlement, + bool canSubscribe, + num isDelete, + String tenantCode,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _mid = mid; + _storeId = storeId; + _orderId = orderId; + _orderProductId = orderProductId; + _productId = productId; + _productSkuId = productSkuId; + _ticketWipedTimeTemplateId = ticketWipedTimeTemplateId; + _amount = amount; + _name = name; + _code = code; + _useStartTime = useStartTime; + _useEndTime = useEndTime; + _finishTime = finishTime; + _type = type; + _takeType = takeType; + _style = style; + _state = state; + _canSettlement = canSettlement; + _canSubscribe = canSubscribe; + _isDelete = isDelete; + _tenantCode = tenantCode; +} + + Tickets.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _mid = json['mid']; + _storeId = json['storeId']; + _orderId = json['orderId']; + _orderProductId = json['orderProductId']; + _productId = json['productId']; + _productSkuId = json['productSkuId']; + _ticketWipedTimeTemplateId = json['ticketWipedTimeTemplateId']; + _amount = json['amount']; + _name = json['name']; + _code = json['code']; + _useStartTime = json['useStartTime']; + _useEndTime = json['useEndTime']; + _finishTime = json['finishTime']; + _type = json['type']; + _takeType = json['takeType']; + _style = json['style']; + _state = json['state']; + _canSettlement = json['canSettlement']; + _canSubscribe = json['canSubscribe']; + _isDelete = json['isDelete']; + _tenantCode = json['tenantCode']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _mid; + String _storeId; + String _orderId; + String _orderProductId; + String _productId; + String _productSkuId; + String _ticketWipedTimeTemplateId; + String _amount; + String _name; + String _code; + String _useStartTime; + String _useEndTime; + String _finishTime; + String _type; + dynamic _takeType; + String _style; + num _state; + bool _canSettlement; + bool _canSubscribe; + num _isDelete; + String _tenantCode; +Tickets copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String mid, + String storeId, + String orderId, + String orderProductId, + String productId, + String productSkuId, + String ticketWipedTimeTemplateId, + String amount, + String name, + String code, + String useStartTime, + String useEndTime, + String finishTime, + String type, + dynamic takeType, + String style, + num state, + bool canSettlement, + bool canSubscribe, + num isDelete, + String tenantCode, +}) => Tickets( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + mid: mid ?? _mid, + storeId: storeId ?? _storeId, + orderId: orderId ?? _orderId, + orderProductId: orderProductId ?? _orderProductId, + productId: productId ?? _productId, + productSkuId: productSkuId ?? _productSkuId, + ticketWipedTimeTemplateId: ticketWipedTimeTemplateId ?? _ticketWipedTimeTemplateId, + amount: amount ?? _amount, + name: name ?? _name, + code: code ?? _code, + useStartTime: useStartTime ?? _useStartTime, + useEndTime: useEndTime ?? _useEndTime, + finishTime: finishTime ?? _finishTime, + type: type ?? _type, + takeType: takeType ?? _takeType, + style: style ?? _style, + state: state ?? _state, + canSettlement: canSettlement ?? _canSettlement, + canSubscribe: canSubscribe ?? _canSubscribe, + isDelete: isDelete ?? _isDelete, + tenantCode: tenantCode ?? _tenantCode, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get mid => _mid; + String get storeId => _storeId; + String get orderId => _orderId; + String get orderProductId => _orderProductId; + String get productId => _productId; + String get productSkuId => _productSkuId; + String get ticketWipedTimeTemplateId => _ticketWipedTimeTemplateId; + String get amount => _amount; + String get name => _name; + String get code => _code; + String get useStartTime => _useStartTime; + String get useEndTime => _useEndTime; + String get finishTime => _finishTime; + String get type => _type; + dynamic get takeType => _takeType; + String get style => _style; + num get state => _state; + bool get canSettlement => _canSettlement; + bool get canSubscribe => _canSubscribe; + num get isDelete => _isDelete; + String get tenantCode => _tenantCode; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['mid'] = _mid; + map['storeId'] = _storeId; + map['orderId'] = _orderId; + map['orderProductId'] = _orderProductId; + map['productId'] = _productId; + map['productSkuId'] = _productSkuId; + map['ticketWipedTimeTemplateId'] = _ticketWipedTimeTemplateId; + map['amount'] = _amount; + map['name'] = _name; + map['code'] = _code; + map['useStartTime'] = _useStartTime; + map['useEndTime'] = _useEndTime; + map['finishTime'] = _finishTime; + map['type'] = _type; + map['takeType'] = _takeType; + map['style'] = _style; + map['state'] = _state; + map['canSettlement'] = _canSettlement; + map['canSubscribe'] = _canSubscribe; + map['isDelete'] = _isDelete; + map['tenantCode'] = _tenantCode; return map; } } -/// id : "1704311046925189120" -/// createTime : "2023-09-20 09:46:33" -/// createUser : "1640233401329909760" -/// updateTime : "2023-09-20 09:46:33" -/// updateUser : "1640233401329909760" -/// tenantCode : "1195" -/// storeId : "1645316356192600064" -/// orderId : "1704311046749028352" +/// id : "1670299926174629888" +/// createTime : "2023-06-18 13:18:30" +/// createUser : "1670299754392715264" +/// updateTime : "2023-06-18 13:18:30" +/// updateUser : "1670299754392715264" +/// tenantCode : "1187" +/// storeId : "1509798399048679424" +/// orderId : "1670299926090743808" /// actInfo : null -/// productId : "1685891939443933184" -/// productName : "芒果牛乳" -/// skuId : "1704310860643565568" -/// skuNameStr : "700ml 冰 七分糖" +/// productId : "1511546728703066112" +/// productName : "一心回乡古桑园门票" +/// skuId : "1511546728765980672" +/// skuNameStr : "" /// skuImg : "" -/// buyNum : 1 +/// buyNum : 2 /// refundNum : 0 /// type : 0 /// reason : null /// weight : 0.0 -/// applyPrice : "19.00" -/// sellPrice : "0.01" +/// applyPrice : "40.00" +/// sellPrice : "40.00" /// postPay : "0.00" /// isDelete : 0 /// discountAmount : "0.00" @@ -468,50 +745,50 @@ AdminOrderDtoList copyWith({ String id, /// status : true /// batch : 1 /// deliveries : 0 -/// ticketType : "" -/// ticketDays : "0" +/// ticketType : "NORMAL" +/// ticketDays : "1" /// takeType : null -/// skuTickets : [] +/// skuTickets : ["古桑园单人票*1张"] /// ticketStyle : "" /// setMealDataList : null /// packagingFee : "0.00" class OrderProductList { OrderProductList({ - String id, - String createTime, - String createUser, - String updateTime, - String updateUser, - String tenantCode, - String storeId, - String orderId, - dynamic actInfo, - String productId, - String productName, - String skuId, - String skuNameStr, - String skuImg, - num buyNum, - num refundNum, - num type, - dynamic reason, - num weight, - String applyPrice, - String sellPrice, - String postPay, - num isDelete, - String discountAmount, - num discountPercent, - bool status, - num batch, - num deliveries, - String ticketType, - String ticketDays, - dynamic takeType, - List skuTickets, - String ticketStyle, - dynamic setMealDataList, + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String tenantCode, + String storeId, + String orderId, + dynamic actInfo, + String productId, + String productName, + String skuId, + String skuNameStr, + String skuImg, + num buyNum, + num refundNum, + num type, + dynamic reason, + num weight, + String applyPrice, + String sellPrice, + String postPay, + num isDelete, + String discountAmount, + num discountPercent, + bool status, + num batch, + num deliveries, + String ticketType, + String ticketDays, + dynamic takeType, + List skuTickets, + String ticketStyle, + dynamic setMealDataList, String packagingFee,}){ _id = id; _createTime = createTime; @@ -582,12 +859,7 @@ class OrderProductList { _ticketType = json['ticketType']; _ticketDays = json['ticketDays']; _takeType = json['takeType']; - // if (json['skuTickets'] != null) { - // _skuTickets = []; - // json['skuTickets'].forEach((v) { - // _skuTickets.add(Dynamic.fromJson(v)); - // }); - // } + _skuTickets = json['skuTickets'] != null ? json['skuTickets'].cast() : []; _ticketStyle = json['ticketStyle']; _setMealDataList = json['setMealDataList']; _packagingFee = json['packagingFee']; @@ -623,7 +895,7 @@ class OrderProductList { String _ticketType; String _ticketDays; dynamic _takeType; - List _skuTickets; + List _skuTickets; String _ticketStyle; dynamic _setMealDataList; String _packagingFee; @@ -658,7 +930,7 @@ OrderProductList copyWith({ String id, String ticketType, String ticketDays, dynamic takeType, - List skuTickets, + List skuTickets, String ticketStyle, dynamic setMealDataList, String packagingFee, @@ -729,7 +1001,7 @@ OrderProductList copyWith({ String id, String get ticketType => _ticketType; String get ticketDays => _ticketDays; dynamic get takeType => _takeType; - List get skuTickets => _skuTickets; + List get skuTickets => _skuTickets; String get ticketStyle => _ticketStyle; dynamic get setMealDataList => _setMealDataList; String get packagingFee => _packagingFee; @@ -767,13 +1039,63 @@ OrderProductList copyWith({ String id, map['ticketType'] = _ticketType; map['ticketDays'] = _ticketDays; map['takeType'] = _takeType; - if (_skuTickets != null) { - map['skuTickets'] = _skuTickets.map((v) => v.toJson()).toList(); - } + map['skuTickets'] = _skuTickets; map['ticketStyle'] = _ticketStyle; map['setMealDataList'] = _setMealDataList; map['packagingFee'] = _packagingFee; return map; } +} + +/// mid : null +/// name : null +/// phone : "" +/// mark : null + +class MemberInfo { + MemberInfo({ + dynamic mid, + dynamic name, + String phone, + dynamic mark,}){ + _mid = mid; + _name = name; + _phone = phone; + _mark = mark; +} + + MemberInfo.fromJson(dynamic json) { + _mid = json['mid']; + _name = json['name']; + _phone = json['phone']; + _mark = json['mark']; + } + dynamic _mid; + dynamic _name; + String _phone; + dynamic _mark; +MemberInfo copyWith({ dynamic mid, + dynamic name, + String phone, + dynamic mark, +}) => MemberInfo( mid: mid ?? _mid, + name: name ?? _name, + phone: phone ?? _phone, + mark: mark ?? _mark, +); + dynamic get mid => _mid; + dynamic get name => _name; + String get phone => _phone; + dynamic get mark => _mark; + + Map toJson() { + final map = {}; + map['mid'] = _mid; + map['name'] = _name; + map['phone'] = _phone; + map['mark'] = _mark; + return map; + } + } \ No newline at end of file diff --git a/lib/retrofit/data/business_store_list.dart b/lib/retrofit/data/business_store_list.dart new file mode 100644 index 00000000..c5c35814 --- /dev/null +++ b/lib/retrofit/data/business_store_list.dart @@ -0,0 +1,943 @@ +/// records : [{"id":"1645701646107279360","createTime":"2023-04-11 16:13:43","createUser":"1640233401329909760","updateTime":"2023-04-11 16:13:43","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"炸蚵嗲","nickName":"","logo":"","facade":"","shipAddress":"","remark":"","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"湖北省武汉市江汉区万松街道王家墩社区","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":null,"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":64,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":{"use_auto_open":false,"use_finish_order":false,"use_flow_auto_open":true,"use_flow_finish_order":true},"posType":{"desc":"快消餐饮","code":"FASTSTORE"}},{"id":"1645701593900777472","createTime":"2023-04-11 16:13:30","createUser":"1640233401329909760","updateTime":"2023-04-11 16:13:30","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"盐酥鸡","nickName":"","logo":"","facade":"","shipAddress":"","remark":"","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"郑州360广场189号摊位左转1米","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":null,"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"44","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":65,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":null,"posType":{"desc":"快消餐饮","code":"FASTSTORE"}},{"id":"1645701540310155264","createTime":"2023-04-11 16:13:18","createUser":"1640233401329909760","updateTime":"2023-04-11 16:13:18","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"台式夯肉","nickName":"","logo":"","facade":"https://pos.upload.lotus-wallet.com/1195/2023/04/47626481-87fc-4b24-901f-132f9367af5d.png","shipAddress":"","remark":"

","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"郑州360广场189号摊位左转1米","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":null,"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"33","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":56,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":null,"posType":{"desc":"快消餐饮","code":"FASTSTORE"}},{"id":"1645701459838238720","createTime":"2023-04-11 16:12:58","createUser":"1640233401329909760","updateTime":"2023-04-11 16:12:58","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"大肠包小肠","nickName":"","logo":"","facade":"","shipAddress":"","remark":"

","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"郑州360广场189号摊位左转1米","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":null,"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":67,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":null,"posType":{"desc":"快消餐饮","code":"FASTSTORE"}},{"id":"1645701372395388928","createTime":"2023-04-11 16:12:37","createUser":"1640233401329909760","updateTime":"2023-04-11 16:12:37","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"润饼卷","nickName":"","logo":"","facade":"","shipAddress":"","remark":"","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"郑州360广场189号摊位左转1米","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":null,"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":66,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":null,"posType":{"desc":"快消餐饮","code":"FASTSTORE"}},{"id":"1645701282909913088","createTime":"2023-04-11 16:12:16","createUser":"1640233401329909760","updateTime":"2023-04-11 16:12:16","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"南投红薯饼","nickName":"","logo":"","facade":"","shipAddress":"","remark":"

","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"郑州360广场189号摊位左转1米","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":null,"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"12","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":68,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":null,"posType":{"desc":"快消餐饮","code":"FASTSTORE"}},{"id":"1645701214400151552","createTime":"2023-04-11 16:12:00","createUser":"1640233401329909760","updateTime":"2023-04-11 16:12:00","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"炸元宝","nickName":"","logo":"","facade":"","shipAddress":"","remark":"","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"郑州360广场189号摊位左转1米","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":null,"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":69,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":null,"posType":{"desc":"快消餐饮","code":"FASTSTORE"}},{"id":"1645698953653518336","createTime":"2023-04-11 16:03:01","createUser":"1640233401329909760","updateTime":"2023-04-11 16:03:01","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"鸡蛋糕","nickName":"","logo":"","facade":"","shipAddress":"","remark":"","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"郑州360广场189号摊位左转1米","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":null,"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"5","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":70,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":null,"posType":{"desc":"快消餐饮","code":"FASTSTORE"}},{"id":"1645698860804210688","createTime":"2023-04-11 16:02:39","createUser":"1640233401329909760","updateTime":"2023-04-11 16:02:39","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"QQ地瓜球","nickName":"","logo":"","facade":"","shipAddress":"","remark":"","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"郑州360广场189号摊位左转1米","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":{"mini_program_app_id":"","mini_program_secret":"","mini_mch_id":"","mini_sub_mch_id":"","is_sub_app":false,"sub_app_id":"","mini_mch_key":"","mini_key_path":"","mini_key_sn_no":"","mini_key_cert_path":"","mini_key_key_path":""},"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"3","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":79,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":{"use_auto_open":false,"use_finish_order":false,"use_flow_auto_open":true,"use_flow_finish_order":true},"posType":{"desc":"快消餐饮","code":"FASTSTORE"}},{"id":"1645698130097733632","createTime":"2023-04-11 15:59:44","createUser":"1640233401329909760","updateTime":"2023-04-11 15:59:44","updateUser":"1640233401329909760","tenantCode":"1195","useErp":false,"openStartTime":"08:00:00","openEndTime":"23:30:00","storeName":"烤鹌鹑蛋","nickName":"","logo":"","facade":"","shipAddress":"","remark":"","mobile":"","longitude":null,"latitude":null,"refundAddress":"","refundTel":"","refundContact":"","isAutoSendRefundAddress":1,"province":"","city":"","district":"","address":"郑州360广场189号摊位左转1米","headName":"","headMobile":"","tel":"","businessService":"","businessType":"","deliveryInfo":null,"pickupType":{"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false},"miniParam":null,"alipayParam":{"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"},"setting":{"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null},"tableFee":{"merchant_table_price":"","per_capita_consumption":"","pay_set":["0","1","2","3","4"]},"money":"0.00","platformShow":false,"subMchId":"","serviceType":"EATSTORE","isEnable":true,"is_delete":0,"sort":57,"profitSharing":{"type":"manual","mchName":"","mchCode":"","ratio":0},"autoSetting":null,"posType":{"desc":"快消餐饮","code":"FASTSTORE"}}] +/// total : "43" +/// size : "10" +/// current : "1" +/// orders : [{"column":"id","asc":false}] +/// hitCount : false +/// searchCount : true +/// pages : "5" + +class BusinessStoreList { + BusinessStoreList({ + List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages,}){ + _records = records; + _total = total; + _size = size; + _current = current; + _orders = orders; + _hitCount = hitCount; + _searchCount = searchCount; + _pages = pages; +} + + BusinessStoreList.fromJson(dynamic json) { + if (json['records'] != null) { + _records = []; + json['records'].forEach((v) { + _records.add(Records.fromJson(v)); + }); + } + _total = json['total']; + _size = json['size']; + _current = json['current']; + if (json['orders'] != null) { + _orders = []; + json['orders'].forEach((v) { + _orders.add(Orders.fromJson(v)); + }); + } + _hitCount = json['hitCount']; + _searchCount = json['searchCount']; + _pages = json['pages']; + } + List _records; + String _total; + String _size; + String _current; + List _orders; + bool _hitCount; + bool _searchCount; + String _pages; +BusinessStoreList copyWith({ List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages, +}) => BusinessStoreList( records: records ?? _records, + total: total ?? _total, + size: size ?? _size, + current: current ?? _current, + orders: orders ?? _orders, + hitCount: hitCount ?? _hitCount, + searchCount: searchCount ?? _searchCount, + pages: pages ?? _pages, +); + List get records => _records; + String get total => _total; + String get size => _size; + String get current => _current; + List get orders => _orders; + bool get hitCount => _hitCount; + bool get searchCount => _searchCount; + String get pages => _pages; + + Map toJson() { + final map = {}; + if (_records != null) { + map['records'] = _records.map((v) => v.toJson()).toList(); + } + map['total'] = _total; + map['size'] = _size; + map['current'] = _current; + if (_orders != null) { + map['orders'] = _orders.map((v) => v.toJson()).toList(); + } + map['hitCount'] = _hitCount; + map['searchCount'] = _searchCount; + map['pages'] = _pages; + return map; + } + +} + +/// column : "id" +/// asc : false + +class Orders { + Orders({ + String column, + bool asc,}){ + _column = column; + _asc = asc; +} + + Orders.fromJson(dynamic json) { + _column = json['column']; + _asc = json['asc']; + } + String _column; + bool _asc; +Orders copyWith({ String column, + bool asc, +}) => Orders( column: column ?? _column, + asc: asc ?? _asc, +); + String get column => _column; + bool get asc => _asc; + + Map toJson() { + final map = {}; + map['column'] = _column; + map['asc'] = _asc; + return map; + } + +} + +/// id : "1645701646107279360" +/// createTime : "2023-04-11 16:13:43" +/// createUser : "1640233401329909760" +/// updateTime : "2023-04-11 16:13:43" +/// updateUser : "1640233401329909760" +/// tenantCode : "1195" +/// useErp : false +/// openStartTime : "08:00:00" +/// openEndTime : "23:30:00" +/// storeName : "炸蚵嗲" +/// nickName : "" +/// logo : "" +/// facade : "" +/// shipAddress : "" +/// remark : "" +/// mobile : "" +/// longitude : null +/// latitude : null +/// refundAddress : "" +/// refundTel : "" +/// refundContact : "" +/// isAutoSendRefundAddress : 1 +/// province : "" +/// city : "" +/// district : "" +/// address : "湖北省武汉市江汉区万松街道王家墩社区" +/// headName : "" +/// headMobile : "" +/// tel : "" +/// businessService : "" +/// businessType : "" +/// deliveryInfo : null +/// pickupType : {"dineInTakeStatus":false,"takeawayStatus":false,"expressDeliveryStatus":false} +/// miniParam : null +/// alipayParam : {"appid":"","privateKey":"","alipayPublicKey":"","alipayPid":"2021004109611523","appAuthToken":"202304BB5ef5b1805ea3434289259ee8790fdX69"} +/// setting : {"speakerKey":"","speakerSn":"","printUsername":"","printUserPwd":"","tagWidth":null,"tagHeight":null} +/// tableFee : {"merchant_table_price":"","per_capita_consumption":"","pay_set":["0","1","2","3","4"]} +/// money : "0.00" +/// platformShow : false +/// subMchId : "" +/// serviceType : "EATSTORE" +/// isEnable : true +/// is_delete : 0 +/// sort : 64 +/// profitSharing : {"type":"manual","mchName":"","mchCode":"","ratio":0} +/// autoSetting : {"use_auto_open":false,"use_finish_order":false,"use_flow_auto_open":true,"use_flow_finish_order":true} +/// posType : {"desc":"快消餐饮","code":"FASTSTORE"} + +class Records { + Records({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String tenantCode, + bool useErp, + String openStartTime, + String openEndTime, + String storeName, + String nickName, + String logo, + String facade, + String shipAddress, + String remark, + String mobile, + dynamic longitude, + dynamic latitude, + String refundAddress, + String refundTel, + String refundContact, + num isAutoSendRefundAddress, + String province, + String city, + String district, + String address, + String headName, + String headMobile, + String tel, + String businessService, + String businessType, + dynamic deliveryInfo, + PickupType pickupType, + dynamic miniParam, + AlipayParam alipayParam, + Setting setting, + TableFee tableFee, + String money, + bool platformShow, + String subMchId, + String serviceType, + bool isEnable, + num isDelete, + num sort, + ProfitSharing profitSharing, + AutoSetting autoSetting, + PosType posType,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _tenantCode = tenantCode; + _useErp = useErp; + _openStartTime = openStartTime; + _openEndTime = openEndTime; + _storeName = storeName; + _nickName = nickName; + _logo = logo; + _facade = facade; + _shipAddress = shipAddress; + _remark = remark; + _mobile = mobile; + _longitude = longitude; + _latitude = latitude; + _refundAddress = refundAddress; + _refundTel = refundTel; + _refundContact = refundContact; + _isAutoSendRefundAddress = isAutoSendRefundAddress; + _province = province; + _city = city; + _district = district; + _address = address; + _headName = headName; + _headMobile = headMobile; + _tel = tel; + _businessService = businessService; + _businessType = businessType; + _deliveryInfo = deliveryInfo; + _pickupType = pickupType; + _miniParam = miniParam; + _alipayParam = alipayParam; + _setting = setting; + _tableFee = tableFee; + _money = money; + _platformShow = platformShow; + _subMchId = subMchId; + _serviceType = serviceType; + _isEnable = isEnable; + _isDelete = isDelete; + _sort = sort; + _profitSharing = profitSharing; + _autoSetting = autoSetting; + _posType = posType; +} + + Records.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _tenantCode = json['tenantCode']; + _useErp = json['useErp']; + _openStartTime = json['openStartTime']; + _openEndTime = json['openEndTime']; + _storeName = json['storeName']; + _nickName = json['nickName']; + _logo = json['logo']; + _facade = json['facade']; + _shipAddress = json['shipAddress']; + _remark = json['remark']; + _mobile = json['mobile']; + _longitude = json['longitude']; + _latitude = json['latitude']; + _refundAddress = json['refundAddress']; + _refundTel = json['refundTel']; + _refundContact = json['refundContact']; + _isAutoSendRefundAddress = json['isAutoSendRefundAddress']; + _province = json['province']; + _city = json['city']; + _district = json['district']; + _address = json['address']; + _headName = json['headName']; + _headMobile = json['headMobile']; + _tel = json['tel']; + _businessService = json['businessService']; + _businessType = json['businessType']; + _deliveryInfo = json['deliveryInfo']; + _pickupType = json['pickupType'] != null ? PickupType.fromJson(json['pickupType']) : null; + _miniParam = json['miniParam']; + _alipayParam = json['alipayParam'] != null ? AlipayParam.fromJson(json['alipayParam']) : null; + _setting = json['setting'] != null ? Setting.fromJson(json['setting']) : null; + _tableFee = json['tableFee'] != null ? TableFee.fromJson(json['tableFee']) : null; + _money = json['money']; + _platformShow = json['platformShow']; + _subMchId = json['subMchId']; + _serviceType = json['serviceType']; + _isEnable = json['isEnable']; + _isDelete = json['is_delete']; + _sort = json['sort']; + _profitSharing = json['profitSharing'] != null ? ProfitSharing.fromJson(json['profitSharing']) : null; + _autoSetting = json['autoSetting'] != null ? AutoSetting.fromJson(json['autoSetting']) : null; + _posType = json['posType'] != null ? PosType.fromJson(json['posType']) : null; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _tenantCode; + bool _useErp; + String _openStartTime; + String _openEndTime; + String _storeName; + String _nickName; + String _logo; + String _facade; + String _shipAddress; + String _remark; + String _mobile; + dynamic _longitude; + dynamic _latitude; + String _refundAddress; + String _refundTel; + String _refundContact; + num _isAutoSendRefundAddress; + String _province; + String _city; + String _district; + String _address; + String _headName; + String _headMobile; + String _tel; + String _businessService; + String _businessType; + dynamic _deliveryInfo; + PickupType _pickupType; + dynamic _miniParam; + AlipayParam _alipayParam; + Setting _setting; + TableFee _tableFee; + String _money; + bool _platformShow; + String _subMchId; + String _serviceType; + bool _isEnable; + num _isDelete; + num _sort; + ProfitSharing _profitSharing; + AutoSetting _autoSetting; + PosType _posType; +Records copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String tenantCode, + bool useErp, + String openStartTime, + String openEndTime, + String storeName, + String nickName, + String logo, + String facade, + String shipAddress, + String remark, + String mobile, + dynamic longitude, + dynamic latitude, + String refundAddress, + String refundTel, + String refundContact, + num isAutoSendRefundAddress, + String province, + String city, + String district, + String address, + String headName, + String headMobile, + String tel, + String businessService, + String businessType, + dynamic deliveryInfo, + PickupType pickupType, + dynamic miniParam, + AlipayParam alipayParam, + Setting setting, + TableFee tableFee, + String money, + bool platformShow, + String subMchId, + String serviceType, + bool isEnable, + num isDelete, + num sort, + ProfitSharing profitSharing, + AutoSetting autoSetting, + PosType posType, +}) => Records( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + tenantCode: tenantCode ?? _tenantCode, + useErp: useErp ?? _useErp, + openStartTime: openStartTime ?? _openStartTime, + openEndTime: openEndTime ?? _openEndTime, + storeName: storeName ?? _storeName, + nickName: nickName ?? _nickName, + logo: logo ?? _logo, + facade: facade ?? _facade, + shipAddress: shipAddress ?? _shipAddress, + remark: remark ?? _remark, + mobile: mobile ?? _mobile, + longitude: longitude ?? _longitude, + latitude: latitude ?? _latitude, + refundAddress: refundAddress ?? _refundAddress, + refundTel: refundTel ?? _refundTel, + refundContact: refundContact ?? _refundContact, + isAutoSendRefundAddress: isAutoSendRefundAddress ?? _isAutoSendRefundAddress, + province: province ?? _province, + city: city ?? _city, + district: district ?? _district, + address: address ?? _address, + headName: headName ?? _headName, + headMobile: headMobile ?? _headMobile, + tel: tel ?? _tel, + businessService: businessService ?? _businessService, + businessType: businessType ?? _businessType, + deliveryInfo: deliveryInfo ?? _deliveryInfo, + pickupType: pickupType ?? _pickupType, + miniParam: miniParam ?? _miniParam, + alipayParam: alipayParam ?? _alipayParam, + setting: setting ?? _setting, + tableFee: tableFee ?? _tableFee, + money: money ?? _money, + platformShow: platformShow ?? _platformShow, + subMchId: subMchId ?? _subMchId, + serviceType: serviceType ?? _serviceType, + isEnable: isEnable ?? _isEnable, + isDelete: isDelete ?? _isDelete, + sort: sort ?? _sort, + profitSharing: profitSharing ?? _profitSharing, + autoSetting: autoSetting ?? _autoSetting, + posType: posType ?? _posType, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get tenantCode => _tenantCode; + bool get useErp => _useErp; + String get openStartTime => _openStartTime; + String get openEndTime => _openEndTime; + String get storeName => _storeName; + String get nickName => _nickName; + String get logo => _logo; + String get facade => _facade; + String get shipAddress => _shipAddress; + String get remark => _remark; + String get mobile => _mobile; + dynamic get longitude => _longitude; + dynamic get latitude => _latitude; + String get refundAddress => _refundAddress; + String get refundTel => _refundTel; + String get refundContact => _refundContact; + num get isAutoSendRefundAddress => _isAutoSendRefundAddress; + String get province => _province; + String get city => _city; + String get district => _district; + String get address => _address; + String get headName => _headName; + String get headMobile => _headMobile; + String get tel => _tel; + String get businessService => _businessService; + String get businessType => _businessType; + dynamic get deliveryInfo => _deliveryInfo; + PickupType get pickupType => _pickupType; + dynamic get miniParam => _miniParam; + AlipayParam get alipayParam => _alipayParam; + Setting get setting => _setting; + TableFee get tableFee => _tableFee; + String get money => _money; + bool get platformShow => _platformShow; + String get subMchId => _subMchId; + String get serviceType => _serviceType; + bool get isEnable => _isEnable; + num get isDelete => _isDelete; + num get sort => _sort; + ProfitSharing get profitSharing => _profitSharing; + AutoSetting get autoSetting => _autoSetting; + PosType get posType => _posType; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['tenantCode'] = _tenantCode; + map['useErp'] = _useErp; + map['openStartTime'] = _openStartTime; + map['openEndTime'] = _openEndTime; + map['storeName'] = _storeName; + map['nickName'] = _nickName; + map['logo'] = _logo; + map['facade'] = _facade; + map['shipAddress'] = _shipAddress; + map['remark'] = _remark; + map['mobile'] = _mobile; + map['longitude'] = _longitude; + map['latitude'] = _latitude; + map['refundAddress'] = _refundAddress; + map['refundTel'] = _refundTel; + map['refundContact'] = _refundContact; + map['isAutoSendRefundAddress'] = _isAutoSendRefundAddress; + map['province'] = _province; + map['city'] = _city; + map['district'] = _district; + map['address'] = _address; + map['headName'] = _headName; + map['headMobile'] = _headMobile; + map['tel'] = _tel; + map['businessService'] = _businessService; + map['businessType'] = _businessType; + map['deliveryInfo'] = _deliveryInfo; + if (_pickupType != null) { + map['pickupType'] = _pickupType.toJson(); + } + map['miniParam'] = _miniParam; + if (_alipayParam != null) { + map['alipayParam'] = _alipayParam.toJson(); + } + if (_setting != null) { + map['setting'] = _setting.toJson(); + } + if (_tableFee != null) { + map['tableFee'] = _tableFee.toJson(); + } + map['money'] = _money; + map['platformShow'] = _platformShow; + map['subMchId'] = _subMchId; + map['serviceType'] = _serviceType; + map['isEnable'] = _isEnable; + map['is_delete'] = _isDelete; + map['sort'] = _sort; + if (_profitSharing != null) { + map['profitSharing'] = _profitSharing.toJson(); + } + if (_autoSetting != null) { + map['autoSetting'] = _autoSetting.toJson(); + } + if (_posType != null) { + map['posType'] = _posType.toJson(); + } + return map; + } + +} + +/// desc : "快消餐饮" +/// code : "FASTSTORE" + +class PosType { + PosType({ + String desc, + String code,}){ + _desc = desc; + _code = code; +} + + PosType.fromJson(dynamic json) { + _desc = json['desc']; + _code = json['code']; + } + String _desc; + String _code; +PosType copyWith({ String desc, + String code, +}) => PosType( desc: desc ?? _desc, + code: code ?? _code, +); + String get desc => _desc; + String get code => _code; + + Map toJson() { + final map = {}; + map['desc'] = _desc; + map['code'] = _code; + return map; + } + +} + +/// use_auto_open : false +/// use_finish_order : false +/// use_flow_auto_open : true +/// use_flow_finish_order : true + +class AutoSetting { + AutoSetting({ + bool useAutoOpen, + bool useFinishOrder, + bool useFlowAutoOpen, + bool useFlowFinishOrder,}){ + _useAutoOpen = useAutoOpen; + _useFinishOrder = useFinishOrder; + _useFlowAutoOpen = useFlowAutoOpen; + _useFlowFinishOrder = useFlowFinishOrder; +} + + AutoSetting.fromJson(dynamic json) { + _useAutoOpen = json['use_auto_open']; + _useFinishOrder = json['use_finish_order']; + _useFlowAutoOpen = json['use_flow_auto_open']; + _useFlowFinishOrder = json['use_flow_finish_order']; + } + bool _useAutoOpen; + bool _useFinishOrder; + bool _useFlowAutoOpen; + bool _useFlowFinishOrder; +AutoSetting copyWith({ bool useAutoOpen, + bool useFinishOrder, + bool useFlowAutoOpen, + bool useFlowFinishOrder, +}) => AutoSetting( useAutoOpen: useAutoOpen ?? _useAutoOpen, + useFinishOrder: useFinishOrder ?? _useFinishOrder, + useFlowAutoOpen: useFlowAutoOpen ?? _useFlowAutoOpen, + useFlowFinishOrder: useFlowFinishOrder ?? _useFlowFinishOrder, +); + bool get useAutoOpen => _useAutoOpen; + bool get useFinishOrder => _useFinishOrder; + bool get useFlowAutoOpen => _useFlowAutoOpen; + bool get useFlowFinishOrder => _useFlowFinishOrder; + + Map toJson() { + final map = {}; + map['use_auto_open'] = _useAutoOpen; + map['use_finish_order'] = _useFinishOrder; + map['use_flow_auto_open'] = _useFlowAutoOpen; + map['use_flow_finish_order'] = _useFlowFinishOrder; + return map; + } + +} + +/// type : "manual" +/// mchName : "" +/// mchCode : "" +/// ratio : 0 + +class ProfitSharing { + ProfitSharing({ + String type, + String mchName, + String mchCode, + num ratio,}){ + _type = type; + _mchName = mchName; + _mchCode = mchCode; + _ratio = ratio; +} + + ProfitSharing.fromJson(dynamic json) { + _type = json['type']; + _mchName = json['mchName']; + _mchCode = json['mchCode']; + _ratio = json['ratio']; + } + String _type; + String _mchName; + String _mchCode; + num _ratio; +ProfitSharing copyWith({ String type, + String mchName, + String mchCode, + num ratio, +}) => ProfitSharing( type: type ?? _type, + mchName: mchName ?? _mchName, + mchCode: mchCode ?? _mchCode, + ratio: ratio ?? _ratio, +); + String get type => _type; + String get mchName => _mchName; + String get mchCode => _mchCode; + num get ratio => _ratio; + + Map toJson() { + final map = {}; + map['type'] = _type; + map['mchName'] = _mchName; + map['mchCode'] = _mchCode; + map['ratio'] = _ratio; + return map; + } + +} + +/// merchant_table_price : "" +/// per_capita_consumption : "" +/// pay_set : ["0","1","2","3","4"] + +class TableFee { + TableFee({ + String merchantTablePrice, + String perCapitaConsumption, + List paySet,}){ + _merchantTablePrice = merchantTablePrice; + _perCapitaConsumption = perCapitaConsumption; + _paySet = paySet; +} + + TableFee.fromJson(dynamic json) { + _merchantTablePrice = json['merchant_table_price']; + _perCapitaConsumption = json['per_capita_consumption']; + _paySet = json['pay_set'] != null ? json['pay_set'].cast() : []; + } + String _merchantTablePrice; + String _perCapitaConsumption; + List _paySet; +TableFee copyWith({ String merchantTablePrice, + String perCapitaConsumption, + List paySet, +}) => TableFee( merchantTablePrice: merchantTablePrice ?? _merchantTablePrice, + perCapitaConsumption: perCapitaConsumption ?? _perCapitaConsumption, + paySet: paySet ?? _paySet, +); + String get merchantTablePrice => _merchantTablePrice; + String get perCapitaConsumption => _perCapitaConsumption; + List get paySet => _paySet; + + Map toJson() { + final map = {}; + map['merchant_table_price'] = _merchantTablePrice; + map['per_capita_consumption'] = _perCapitaConsumption; + map['pay_set'] = _paySet; + return map; + } + +} + +/// speakerKey : "" +/// speakerSn : "" +/// printUsername : "" +/// printUserPwd : "" +/// tagWidth : null +/// tagHeight : null + +class Setting { + Setting({ + String speakerKey, + String speakerSn, + String printUsername, + String printUserPwd, + dynamic tagWidth, + dynamic tagHeight,}){ + _speakerKey = speakerKey; + _speakerSn = speakerSn; + _printUsername = printUsername; + _printUserPwd = printUserPwd; + _tagWidth = tagWidth; + _tagHeight = tagHeight; +} + + Setting.fromJson(dynamic json) { + _speakerKey = json['speakerKey']; + _speakerSn = json['speakerSn']; + _printUsername = json['printUsername']; + _printUserPwd = json['printUserPwd']; + _tagWidth = json['tagWidth']; + _tagHeight = json['tagHeight']; + } + String _speakerKey; + String _speakerSn; + String _printUsername; + String _printUserPwd; + dynamic _tagWidth; + dynamic _tagHeight; +Setting copyWith({ String speakerKey, + String speakerSn, + String printUsername, + String printUserPwd, + dynamic tagWidth, + dynamic tagHeight, +}) => Setting( speakerKey: speakerKey ?? _speakerKey, + speakerSn: speakerSn ?? _speakerSn, + printUsername: printUsername ?? _printUsername, + printUserPwd: printUserPwd ?? _printUserPwd, + tagWidth: tagWidth ?? _tagWidth, + tagHeight: tagHeight ?? _tagHeight, +); + String get speakerKey => _speakerKey; + String get speakerSn => _speakerSn; + String get printUsername => _printUsername; + String get printUserPwd => _printUserPwd; + dynamic get tagWidth => _tagWidth; + dynamic get tagHeight => _tagHeight; + + Map toJson() { + final map = {}; + map['speakerKey'] = _speakerKey; + map['speakerSn'] = _speakerSn; + map['printUsername'] = _printUsername; + map['printUserPwd'] = _printUserPwd; + map['tagWidth'] = _tagWidth; + map['tagHeight'] = _tagHeight; + return map; + } + +} + +/// appid : "" +/// privateKey : "" +/// alipayPublicKey : "" +/// alipayPid : "2021004109611523" +/// appAuthToken : "202304BB5ef5b1805ea3434289259ee8790fdX69" + +class AlipayParam { + AlipayParam({ + String appid, + String privateKey, + String alipayPublicKey, + String alipayPid, + String appAuthToken,}){ + _appid = appid; + _privateKey = privateKey; + _alipayPublicKey = alipayPublicKey; + _alipayPid = alipayPid; + _appAuthToken = appAuthToken; +} + + AlipayParam.fromJson(dynamic json) { + _appid = json['appid']; + _privateKey = json['privateKey']; + _alipayPublicKey = json['alipayPublicKey']; + _alipayPid = json['alipayPid']; + _appAuthToken = json['appAuthToken']; + } + String _appid; + String _privateKey; + String _alipayPublicKey; + String _alipayPid; + String _appAuthToken; +AlipayParam copyWith({ String appid, + String privateKey, + String alipayPublicKey, + String alipayPid, + String appAuthToken, +}) => AlipayParam( appid: appid ?? _appid, + privateKey: privateKey ?? _privateKey, + alipayPublicKey: alipayPublicKey ?? _alipayPublicKey, + alipayPid: alipayPid ?? _alipayPid, + appAuthToken: appAuthToken ?? _appAuthToken, +); + String get appid => _appid; + String get privateKey => _privateKey; + String get alipayPublicKey => _alipayPublicKey; + String get alipayPid => _alipayPid; + String get appAuthToken => _appAuthToken; + + Map toJson() { + final map = {}; + map['appid'] = _appid; + map['privateKey'] = _privateKey; + map['alipayPublicKey'] = _alipayPublicKey; + map['alipayPid'] = _alipayPid; + map['appAuthToken'] = _appAuthToken; + return map; + } + +} + +/// dineInTakeStatus : false +/// takeawayStatus : false +/// expressDeliveryStatus : false + +class PickupType { + PickupType({ + bool dineInTakeStatus, + bool takeawayStatus, + bool expressDeliveryStatus,}){ + _dineInTakeStatus = dineInTakeStatus; + _takeawayStatus = takeawayStatus; + _expressDeliveryStatus = expressDeliveryStatus; +} + + PickupType.fromJson(dynamic json) { + _dineInTakeStatus = json['dineInTakeStatus']; + _takeawayStatus = json['takeawayStatus']; + _expressDeliveryStatus = json['expressDeliveryStatus']; + } + bool _dineInTakeStatus; + bool _takeawayStatus; + bool _expressDeliveryStatus; +PickupType copyWith({ bool dineInTakeStatus, + bool takeawayStatus, + bool expressDeliveryStatus, +}) => PickupType( dineInTakeStatus: dineInTakeStatus ?? _dineInTakeStatus, + takeawayStatus: takeawayStatus ?? _takeawayStatus, + expressDeliveryStatus: expressDeliveryStatus ?? _expressDeliveryStatus, +); + bool get dineInTakeStatus => _dineInTakeStatus; + bool get takeawayStatus => _takeawayStatus; + bool get expressDeliveryStatus => _expressDeliveryStatus; + + Map toJson() { + final map = {}; + map['dineInTakeStatus'] = _dineInTakeStatus; + map['takeawayStatus'] = _takeawayStatus; + map['expressDeliveryStatus'] = _expressDeliveryStatus; + return map; + } + +} \ No newline at end of file