diff --git a/assets/image/2x/bs_mine_clerk.webp b/assets/image/2x/bs_mine_clerk.webp new file mode 100644 index 00000000..81cdd881 Binary files /dev/null and b/assets/image/2x/bs_mine_clerk.webp differ diff --git a/assets/image/bs_store_info_logo.webp b/assets/image/2x/bs_mine_code.webp similarity index 65% rename from assets/image/bs_store_info_logo.webp rename to assets/image/2x/bs_mine_code.webp index 83f8609b..f6b8fc83 100644 Binary files a/assets/image/bs_store_info_logo.webp and b/assets/image/2x/bs_mine_code.webp differ diff --git a/assets/image/2x/bs_secure.webp b/assets/image/2x/bs_secure.webp index d8f3eb12..a86e2287 100644 Binary files a/assets/image/2x/bs_secure.webp and b/assets/image/2x/bs_secure.webp differ diff --git a/assets/image/2x/bs_shop_logo.webp b/assets/image/2x/bs_shop_logo.webp index 2a8819bb..5bb7f860 100644 Binary files a/assets/image/2x/bs_shop_logo.webp and b/assets/image/2x/bs_shop_logo.webp differ diff --git a/assets/image/2x/bus_code_save.webp b/assets/image/2x/bus_code_save.webp new file mode 100644 index 00000000..41aaf2e1 Binary files /dev/null and b/assets/image/2x/bus_code_save.webp differ diff --git a/assets/image/2x/bus_home_bhy.webp b/assets/image/2x/bus_home_bhy.webp new file mode 100644 index 00000000..888b8eeb Binary files /dev/null and b/assets/image/2x/bus_home_bhy.webp differ diff --git a/assets/image/2x/bus_home_cz.webp b/assets/image/2x/bus_home_cz.webp new file mode 100644 index 00000000..56d9c576 Binary files /dev/null and b/assets/image/2x/bus_home_cz.webp differ diff --git a/assets/image/2x/bus_home_czjl.webp b/assets/image/2x/bus_home_czjl.webp new file mode 100644 index 00000000..a4b3f9f9 Binary files /dev/null and b/assets/image/2x/bus_home_czjl.webp differ diff --git a/assets/image/2x/bus_home_goods.webp b/assets/image/2x/bus_home_goods.webp new file mode 100644 index 00000000..10a50d3d Binary files /dev/null and b/assets/image/2x/bus_home_goods.webp differ diff --git a/assets/image/2x/bus_home_goods_ssfx.webp b/assets/image/2x/bus_home_goods_ssfx.webp new file mode 100644 index 00000000..e6eaeef5 Binary files /dev/null and b/assets/image/2x/bus_home_goods_ssfx.webp differ diff --git a/assets/image/2x/bus_home_hygl.webp b/assets/image/2x/bus_home_hygl.webp new file mode 100644 index 00000000..4faacb3b Binary files /dev/null and b/assets/image/2x/bus_home_hygl.webp differ diff --git a/assets/image/2x/bus_home_hyyetj.webp b/assets/image/2x/bus_home_hyyetj.webp new file mode 100644 index 00000000..c26a58f4 Binary files /dev/null and b/assets/image/2x/bus_home_hyyetj.webp differ diff --git a/assets/image/2x/bus_home_jrls.webp b/assets/image/2x/bus_home_jrls.webp new file mode 100644 index 00000000..0500eff4 Binary files /dev/null and b/assets/image/2x/bus_home_jrls.webp differ diff --git a/assets/image/2x/bus_home_rxbd.webp b/assets/image/2x/bus_home_rxbd.webp new file mode 100644 index 00000000..4f6b2ab6 Binary files /dev/null and b/assets/image/2x/bus_home_rxbd.webp differ diff --git a/assets/image/2x/bus_home_syt.webp b/assets/image/2x/bus_home_syt.webp new file mode 100644 index 00000000..60c95084 Binary files /dev/null and b/assets/image/2x/bus_home_syt.webp differ diff --git a/assets/image/2x/bus_home_syzl.webp b/assets/image/2x/bus_home_syzl.webp new file mode 100644 index 00000000..5a46aa56 Binary files /dev/null and b/assets/image/2x/bus_home_syzl.webp differ diff --git a/assets/image/2x/bus_home_xfjl.webp b/assets/image/2x/bus_home_xfjl.webp new file mode 100644 index 00000000..885f9ea7 Binary files /dev/null and b/assets/image/2x/bus_home_xfjl.webp differ diff --git a/assets/image/2x/bus_home_xfpm.webp b/assets/image/2x/bus_home_xfpm.webp new file mode 100644 index 00000000..917c4b56 Binary files /dev/null and b/assets/image/2x/bus_home_xfpm.webp differ diff --git a/assets/image/2x/bus_home_yytj.webp b/assets/image/2x/bus_home_yytj.webp new file mode 100644 index 00000000..bd9b6862 Binary files /dev/null and b/assets/image/2x/bus_home_yytj.webp differ diff --git a/assets/image/2x/bus_pay_success_logo.png b/assets/image/2x/bus_pay_success_logo.png new file mode 100644 index 00000000..52c37939 Binary files /dev/null and b/assets/image/2x/bus_pay_success_logo.png differ diff --git a/assets/image/3x/bs_mine_clerk.webp b/assets/image/3x/bs_mine_clerk.webp new file mode 100644 index 00000000..0da7fc78 Binary files /dev/null and b/assets/image/3x/bs_mine_clerk.webp differ diff --git a/assets/image/2x/bs_store_info_logo.webp b/assets/image/3x/bs_mine_code.webp similarity index 58% rename from assets/image/2x/bs_store_info_logo.webp rename to assets/image/3x/bs_mine_code.webp index b8aae3f9..e3a0ebc8 100644 Binary files a/assets/image/2x/bs_store_info_logo.webp and b/assets/image/3x/bs_mine_code.webp differ diff --git a/assets/image/3x/bs_secure.webp b/assets/image/3x/bs_secure.webp index 1f3b4306..70ad4f3f 100644 Binary files a/assets/image/3x/bs_secure.webp and b/assets/image/3x/bs_secure.webp differ diff --git a/assets/image/3x/bs_shop_logo.webp b/assets/image/3x/bs_shop_logo.webp index d362c0fa..b8c6a6dc 100644 Binary files a/assets/image/3x/bs_shop_logo.webp and b/assets/image/3x/bs_shop_logo.webp differ diff --git a/assets/image/3x/bs_store_info_logo.webp b/assets/image/3x/bs_store_info_logo.webp deleted file mode 100644 index 698b649d..00000000 Binary files a/assets/image/3x/bs_store_info_logo.webp and /dev/null differ diff --git a/assets/image/3x/bus_code_save.webp b/assets/image/3x/bus_code_save.webp new file mode 100644 index 00000000..8a97131f Binary files /dev/null and b/assets/image/3x/bus_code_save.webp differ diff --git a/assets/image/3x/bus_home_bhy.webp b/assets/image/3x/bus_home_bhy.webp new file mode 100644 index 00000000..24f8f180 Binary files /dev/null and b/assets/image/3x/bus_home_bhy.webp differ diff --git a/assets/image/3x/bus_home_cz.webp b/assets/image/3x/bus_home_cz.webp new file mode 100644 index 00000000..bcef6033 Binary files /dev/null and b/assets/image/3x/bus_home_cz.webp differ diff --git a/assets/image/3x/bus_home_czjl.webp b/assets/image/3x/bus_home_czjl.webp new file mode 100644 index 00000000..c56e0e65 Binary files /dev/null and b/assets/image/3x/bus_home_czjl.webp differ diff --git a/assets/image/3x/bus_home_goods.webp b/assets/image/3x/bus_home_goods.webp new file mode 100644 index 00000000..45f3cbb4 Binary files /dev/null and b/assets/image/3x/bus_home_goods.webp differ diff --git a/assets/image/3x/bus_home_goods_ssfx.webp b/assets/image/3x/bus_home_goods_ssfx.webp new file mode 100644 index 00000000..c5228122 Binary files /dev/null and b/assets/image/3x/bus_home_goods_ssfx.webp differ diff --git a/assets/image/3x/bus_home_hygl.webp b/assets/image/3x/bus_home_hygl.webp new file mode 100644 index 00000000..d15a0507 Binary files /dev/null and b/assets/image/3x/bus_home_hygl.webp differ diff --git a/assets/image/3x/bus_home_hyyetj.webp b/assets/image/3x/bus_home_hyyetj.webp new file mode 100644 index 00000000..2cdc29ef Binary files /dev/null and b/assets/image/3x/bus_home_hyyetj.webp differ diff --git a/assets/image/3x/bus_home_jrls.webp b/assets/image/3x/bus_home_jrls.webp new file mode 100644 index 00000000..c310bce7 Binary files /dev/null and b/assets/image/3x/bus_home_jrls.webp differ diff --git a/assets/image/3x/bus_home_rxbd.webp b/assets/image/3x/bus_home_rxbd.webp new file mode 100644 index 00000000..e6c4c76c Binary files /dev/null and b/assets/image/3x/bus_home_rxbd.webp differ diff --git a/assets/image/3x/bus_home_syt.webp b/assets/image/3x/bus_home_syt.webp new file mode 100644 index 00000000..350c4c16 Binary files /dev/null and b/assets/image/3x/bus_home_syt.webp differ diff --git a/assets/image/3x/bus_home_syzl.webp b/assets/image/3x/bus_home_syzl.webp new file mode 100644 index 00000000..b05722d6 Binary files /dev/null and b/assets/image/3x/bus_home_syzl.webp differ diff --git a/assets/image/3x/bus_home_xfjl.webp b/assets/image/3x/bus_home_xfjl.webp new file mode 100644 index 00000000..bb92bbc2 Binary files /dev/null and b/assets/image/3x/bus_home_xfjl.webp differ diff --git a/assets/image/3x/bus_home_xfpm.webp b/assets/image/3x/bus_home_xfpm.webp new file mode 100644 index 00000000..63eba47d Binary files /dev/null and b/assets/image/3x/bus_home_xfpm.webp differ diff --git a/assets/image/3x/bus_home_yytj.webp b/assets/image/3x/bus_home_yytj.webp new file mode 100644 index 00000000..9f6c1d25 Binary files /dev/null and b/assets/image/3x/bus_home_yytj.webp differ diff --git a/assets/image/3x/bus_pay_success_logo.png b/assets/image/3x/bus_pay_success_logo.png new file mode 100644 index 00000000..7419eda0 Binary files /dev/null and b/assets/image/3x/bus_pay_success_logo.png differ diff --git a/assets/image/bs_mine_clerk.webp b/assets/image/bs_mine_clerk.webp new file mode 100644 index 00000000..f97819be Binary files /dev/null and b/assets/image/bs_mine_clerk.webp differ diff --git a/assets/image/bs_mine_code.webp b/assets/image/bs_mine_code.webp new file mode 100644 index 00000000..419201ee Binary files /dev/null and b/assets/image/bs_mine_code.webp differ diff --git a/assets/image/bs_secure.webp b/assets/image/bs_secure.webp index 39203e2e..ae342709 100644 Binary files a/assets/image/bs_secure.webp and b/assets/image/bs_secure.webp differ diff --git a/assets/image/bs_shop_logo.webp b/assets/image/bs_shop_logo.webp index 912e96cd..5f71ed3e 100644 Binary files a/assets/image/bs_shop_logo.webp and b/assets/image/bs_shop_logo.webp differ diff --git a/assets/image/bus_code_save.webp b/assets/image/bus_code_save.webp new file mode 100644 index 00000000..0293de52 Binary files /dev/null and b/assets/image/bus_code_save.webp differ diff --git a/assets/image/bus_home_bhy.webp b/assets/image/bus_home_bhy.webp new file mode 100644 index 00000000..765d2034 Binary files /dev/null and b/assets/image/bus_home_bhy.webp differ diff --git a/assets/image/bus_home_cz.webp b/assets/image/bus_home_cz.webp new file mode 100644 index 00000000..b13fa089 Binary files /dev/null and b/assets/image/bus_home_cz.webp differ diff --git a/assets/image/bus_home_czjl.webp b/assets/image/bus_home_czjl.webp new file mode 100644 index 00000000..be54efc4 Binary files /dev/null and b/assets/image/bus_home_czjl.webp differ diff --git a/assets/image/bus_home_goods.webp b/assets/image/bus_home_goods.webp new file mode 100644 index 00000000..42edd3e3 Binary files /dev/null and b/assets/image/bus_home_goods.webp differ diff --git a/assets/image/bus_home_goods_ssfx.webp b/assets/image/bus_home_goods_ssfx.webp new file mode 100644 index 00000000..a9392598 Binary files /dev/null and b/assets/image/bus_home_goods_ssfx.webp differ diff --git a/assets/image/bus_home_hygl.webp b/assets/image/bus_home_hygl.webp new file mode 100644 index 00000000..502732bf Binary files /dev/null and b/assets/image/bus_home_hygl.webp differ diff --git a/assets/image/bus_home_hyyetj.webp b/assets/image/bus_home_hyyetj.webp new file mode 100644 index 00000000..1dae2931 Binary files /dev/null and b/assets/image/bus_home_hyyetj.webp differ diff --git a/assets/image/bus_home_jrls.webp b/assets/image/bus_home_jrls.webp new file mode 100644 index 00000000..e2db4ead Binary files /dev/null and b/assets/image/bus_home_jrls.webp differ diff --git a/assets/image/bus_home_rxbd.webp b/assets/image/bus_home_rxbd.webp new file mode 100644 index 00000000..bad50ca5 Binary files /dev/null and b/assets/image/bus_home_rxbd.webp differ diff --git a/assets/image/bus_home_syt.webp b/assets/image/bus_home_syt.webp new file mode 100644 index 00000000..c44dee68 Binary files /dev/null and b/assets/image/bus_home_syt.webp differ diff --git a/assets/image/bus_home_syzl.webp b/assets/image/bus_home_syzl.webp new file mode 100644 index 00000000..97bd9820 Binary files /dev/null and b/assets/image/bus_home_syzl.webp differ diff --git a/assets/image/bus_home_xfjl.webp b/assets/image/bus_home_xfjl.webp new file mode 100644 index 00000000..316cabee Binary files /dev/null and b/assets/image/bus_home_xfjl.webp differ diff --git a/assets/image/bus_home_xfpm.webp b/assets/image/bus_home_xfpm.webp new file mode 100644 index 00000000..92c7003b Binary files /dev/null and b/assets/image/bus_home_xfpm.webp differ diff --git a/assets/image/bus_home_yytj.webp b/assets/image/bus_home_yytj.webp new file mode 100644 index 00000000..3759b08b Binary files /dev/null and b/assets/image/bus_home_yytj.webp differ diff --git a/assets/image/bus_pay_success_logo.png b/assets/image/bus_pay_success_logo.png new file mode 100644 index 00000000..4cd921d3 Binary files /dev/null and b/assets/image/bus_pay_success_logo.png differ diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index ef4a453a..38b6173c 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -140,6 +140,8 @@ 打开相册 NSSpeechRecognitionUsageDescription 是否允许语音识别 + NSPhotoLibraryAddUsageDescription + 请允许App保存图片到相册 UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff --git a/lib/business_system/goods/off_shelf/off_shelf_page.dart b/lib/business_system/goods/off_shelf/off_shelf_page.dart index 192c34bb..55134bca 100644 --- a/lib/business_system/goods/off_shelf/off_shelf_page.dart +++ b/lib/business_system/goods/off_shelf/off_shelf_page.dart @@ -130,6 +130,7 @@ class _OffShelfPage extends State { checkStatus = false; SmartDialog.showToast("商品上架成功", alignment: Alignment.center); } else { + EasyLoading.dismiss(); SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -155,6 +156,7 @@ class _OffShelfPage extends State { EasyLoading.dismiss(); SmartDialog.showToast("商品删除成功", alignment: Alignment.center); } else { + EasyLoading.dismiss(); SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } diff --git a/lib/business_system/home/cashier/cashier_page.dart b/lib/business_system/home/cashier/cashier_page.dart new file mode 100644 index 00000000..06c14c27 --- /dev/null +++ b/lib/business_system/home/cashier/cashier_page.dart @@ -0,0 +1,60 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:intl/intl.dart'; + +class CashierPage extends StatefulWidget { + final Map arguments; + + CashierPage({this.arguments}); + + @override + State createState() { + return _CashierPage(); + } +} + +class _CashierPage extends State { + + @override + void initState() { + super.initState(); + } + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: "收银", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + brightness: Brightness.dark, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top:8.h, left: 16.w, right: 16.w), + padding: EdgeInsets.only(top:19.h,bottom: 36.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + ) + ], + ), + ); + } +} diff --git a/lib/business_system/home/consumer_ranking_page.dart b/lib/business_system/home/consumer_ranking_page.dart new file mode 100644 index 00000000..87cca153 --- /dev/null +++ b/lib/business_system/home/consumer_ranking_page.dart @@ -0,0 +1,579 @@ +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/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:intl/intl.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../../generated/l10n.dart'; +import '../../retrofit/business_api.dart'; +import '../../retrofit/data/balance_consumption_ranking_list.dart'; +import '../../retrofit/data/base_data.dart'; +import '../../utils/business_instance.dart'; +import '../../utils/flutter_utils.dart'; +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_footer.dart'; +import '../../view_widget/no_data_view.dart'; + +class ConsumerRankingPage extends StatefulWidget { + final Map arguments; + + ConsumerRankingPage({this.arguments}); + + @override + State createState() { + return _ConsumerRankingPage(); + } +} + +class _ConsumerRankingPage extends State { + String titleName; + String selectTimeDate = ""; + String selectTimeDateNum = + "${DateFormat("yyyy-MM-dd HH:mm:ss").format(DateTime.now().subtract(Duration(days: 2)))} 至 " + "${DateFormat("yyyy-MM-dd HH:mm:ss").format(DateTime.now())}"; + final TextEditingController editingController = TextEditingController(); + FocusNode _focusNode = FocusNode(); + bool isKeyBoardShow = false; + final RefreshController refreshController = RefreshController(); + BusinessApiService businessService; + String networkError = ""; + int networkStatus = 0; + List records = []; + int _pageNum = 1; + String total = "0"; + + @override + void initState() { + super.initState(); + titleName = widget?.arguments["titleName"] ?? ""; + _onRefresh(); + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + _focusNode.unfocus(); + } + + _onRefresh({bool isShowLoad = true}) async { + if (isShowLoad) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + await queryStoreMoney(); + EasyLoading.dismiss(); + if (refreshController.isRefresh) refreshController.refreshCompleted(); + if (mounted) setState(() {}); + } + + ///查询会员余额统计/消费排名 + queryStoreMoney({nickName,isShow = true}) async { + try { + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.storeMoney({ + "startTime": titleName == "消费排名" ? selectTimeDateNum.substring(0,19):"", + "endTime": titleName == "消费排名" ? selectTimeDateNum.substring(24,43):"", + "nickName": titleName == "消费排名" ? "" : nickName, + "type":titleName == "消费排名" ? 1:0, + "pageNum": _pageNum, + "pageSize": 10, + }).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + records.addAll(baseData?.data?.records ?? []); + total = baseData?.data?.total ?? "0"; + if ((baseData?.data?.records ?? []).isEmpty || + records.length.toString() == baseData.data.pages) + refreshController.loadNoData(); + else + refreshController.loadComplete(); + networkStatus = 1; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + if (isShow) setState(() {}); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: titleName, + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + brightness: Brightness.dark, + ), + body: networkStatus == -1 + ? noNetwork() + : Container( + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: records.length == 0 ? false : true, + header: MyHeader( + color: Color(0xFF30415B), + ), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + _pageNum = 1; + records.clear(); + _onRefresh(isShowLoad: false); + }, + onLoading: () { + _pageNum++; + _onRefresh(isShowLoad: false); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Column( + children: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(bottom: 16.h), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Column( + children: [ + titleName == "消费排名" + ? timeSelect() + : vipBalanceStatisticsSearch(), + titleName == "消费排名" + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(bottom: 15.h), + child: Text( + "消费会员数量", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF0D0D0D), + ), + ), + ), + Text( + total, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + ], + )), + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(bottom: 15.h), + child: Text( + "销售金额", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF0D0D0D), + ), + ), + ), + Text( + "12334.00", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + ], + )), + ], + ) + : Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(bottom: 15.h), + child: Text( + "总会员数", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF0D0D0D), + ), + ), + ), + Text( + total, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + ], + )), + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(bottom: 15.h), + child: Text( + "总余额数", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF0D0D0D), + ), + ), + ), + Text( + "12334.00", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + ], + )), + ], + ) + ], + ), + ), + Expanded(child: networkStatus == 0 + ? Container( + margin: EdgeInsets.only(bottom: 35.h,top:6.h), + child: ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: consumerRankingItemSm(), + ); + }, + )) + : ((records == null || records.length == 0) + ? NoDataView( + src: "assets/image/bs_no data_logo.webp", + isShowBtn: false, + text: "暂无商品分类", + fontSize: 16.sp, + margin: EdgeInsets.all(20.h), + ) + : Container( + margin: EdgeInsets.only(bottom: 35.h,top:6.h), + child: ListView.builder( + itemCount: records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: consumerRankingItem( + records[position]), + ); + }, + ), + )),) + ], + ), + ), + ), + ); + } + + ///时间选择 + Widget timeSelect() { + return Container( + color: Colors.white, + child: GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/custom_page', + arguments: {"beyondDateRange": "0"}).then((value) { + selectTimeDate = value; + setState((){}); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFFF7F8FA), + borderRadius: BorderRadius.circular(2), + ), + margin: + EdgeInsets.only(left: 18.w, right: 18.w, top: 11.h, bottom: 17.h), + padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 12.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + (selectTimeDate == "" || selectTimeDate == null) + ? "${selectTimeDateNum.substring(0,16)} 至 ${selectTimeDateNum.substring(24,40)}" + : "${selectTimeDate.replaceAll("年", "-").replaceAll("月", "-").replaceAll("日", "").substring(0,16)} 至" + " ${selectTimeDate.replaceAll("年", "-").replaceAll("月", "-").replaceAll("日", "").substring(22,38)} ", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF30415B), + fontWeight: MyFontWeight.regular), + ), + ], + ), + ), + ), + ); + } + + /// 搜索框 + Widget vipBalanceStatisticsSearch() { + return Container( + color: Colors.white, + child: Container( + height: 40.h, + margin: + EdgeInsets.only(left: 18.w, right: 18.w, top: 12.h, bottom: 12.h), + decoration: BoxDecoration( + color: Color(0xFFF7F8FA), + borderRadius: BorderRadius.circular(2), + ), + child: TextField( + focusNode: _focusNode, + textInputAction: TextInputAction.search, + onEditingComplete: () { + FocusScope.of(context).requestFocus(FocusNode()); + queryStoreMoney(nickName: editingController?.text ?? ""); + }, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + controller: editingController, + decoration: InputDecoration( + hintText: "会员手机号或姓名", + hintStyle: TextStyle( + color: Color(0xFF808080), + fontSize: 15.sp, + fontWeight: MyFontWeight.regular), + contentPadding: EdgeInsets.symmetric( + vertical: 12.h, + ), + prefixIcon: Image.asset( + "assets/image/bs_goods_search.webp", + width: 20, + height: 20, + ), + border: InputBorder.none, + ), + ), + ), + ); + } + + ///消费排行list + Widget consumerRankingItem(Records records) { + return Container( + padding: EdgeInsets.only(top: 12.h, bottom: 12.h, left: 16.w), + margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 16.h), + child: Text( + "${records?.name ?? ""}(${records?.phone})", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "消费:", + style: TextStyle( + color: Color(0xFF666666), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + TextSpan( + text: "¥${records?.money ?? ""}", + style: TextStyle( + color: Color(0xFFFA5151), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget consumerRankingItemSm() { + return Container( + padding: EdgeInsets.only(top: 12.h, bottom: 12.h, left: 16.w), + margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(bottom: 16.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 149.w, + height: 20.h, + ), + ), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 42.w, + height: 20.h, + ), + ), Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 60.w, + height: 20.h, + ), + ), + ], + ) + ], + ), + ); + } + + Widget noNetwork() { + return Container( + color: Colors.white, + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + networkError.substring(0, networkError.indexOf(",")), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.h), + child: Text( + "请检查网络设置或稍后重试", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + _onRefresh(); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), + child: Text( + "重试", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular), + )), + ) + ], + ), + ); + } +} diff --git a/lib/business_system/home/vip/add_vip.dart b/lib/business_system/home/vip/add_vip.dart index aec48522..47339663 100644 --- a/lib/business_system/home/vip/add_vip.dart +++ b/lib/business_system/home/vip/add_vip.dart @@ -1,10 +1,18 @@ +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/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../../generated/l10n.dart'; import '../../../retrofit/business_api.dart'; +import '../../../retrofit/data/add_vip_info.dart'; +import '../../../retrofit/data/base_data.dart'; +import '../../../utils/business_instance.dart'; +import '../../../utils/flutter_utils.dart'; +import '../../../view_widget/settlement_tips_dialog.dart'; class AddVip extends StatefulWidget { final Map arguments; @@ -23,6 +31,9 @@ class _AddVip extends State { bool isKeyBoardShow = false; FocusNode _focusNode = FocusNode(); BusinessApiService businessService; + AddVipInfo addVipInfo; + String networkError = ""; + int networkStatus = 0; @override void initState() { @@ -50,6 +61,48 @@ class _AddVip extends State { super.dispose(); } + ///新增会员接口 + addMember(String mobile,String nickName) async { + try { + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.createMemberSourceByMobile(mobile,nickName).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {});}); + if (baseData != null && baseData.isSuccess) { + addVipInfo = baseData.data; + Navigator.of(context).pop(); + SmartDialog.show( + widget: SettlementTips( + () {}, + text: "会员新增成功,请前往会员管理查询会员新增情况", + color: Color(0xFF30415B), + )); + networkStatus = 1; + }else{ + SmartDialog.show( + widget: SettlementTips( + () {}, + text: baseData.msg, + color: Color(0xFF30415B), + )); + networkStatus = 1; + } + } finally { + EasyLoading.dismiss(); + setState(() {}); + } + } + @override Widget build(BuildContext context) { return GestureDetector( @@ -67,7 +120,7 @@ class _AddVip extends State { leadingColor: Colors.black, brightness: Brightness.dark, ), - body: Container( + body:networkStatus == -1?noNetwork():Container( margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), child: Column( children: [ @@ -194,7 +247,7 @@ class _AddVip extends State { alignment: Alignment.center); return; } else { - print("新增成功"); + addMember(vipPhoneController?.text ?? "",vipNameController?.text ?? ""); } }, child: Container( @@ -222,4 +275,51 @@ class _AddVip extends State { ), ); } + + Widget noNetwork() { + return Container( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + networkError.substring(0, networkError.indexOf(",")), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.h), + child: Text( + "请检查网络设置或稍后重试", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + addMember(vipPhoneController?.text ?? "",vipNameController?.text ?? ""); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), + child: Text( + "重试", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular), + )), + ) + ], + ), + ); + } } diff --git a/lib/business_system/home/vip/bus_vip_list.dart b/lib/business_system/home/vip/bus_vip_list.dart index 649999ca..4552f0c5 100644 --- a/lib/business_system/home/vip/bus_vip_list.dart +++ b/lib/business_system/home/vip/bus_vip_list.dart @@ -196,7 +196,7 @@ class _BusVipList extends State { color: Color(0xFF30415B), borderRadius: BorderRadius.circular(4), ), - padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 5..h), + padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 5.h), margin: EdgeInsets.only(right: 8.w), child:Text( "会员充值", diff --git a/lib/business_system/home/vip/pay_success_page.dart b/lib/business_system/home/vip/pay_success_page.dart new file mode 100644 index 00000000..5dbbf9d6 --- /dev/null +++ b/lib/business_system/home/vip/pay_success_page.dart @@ -0,0 +1,180 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:intl/intl.dart'; + +class PaySuccessPage extends StatefulWidget { + final Map arguments; + + PaySuccessPage({this.arguments}); + + @override + State createState() { + return _PaySuccessPage(); + } +} + +class _PaySuccessPage extends State { + + @override + void initState() { + super.initState(); + } + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: "收银成功", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + brightness: Brightness.dark, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top:8.h, left: 16.w, right: 16.w), + padding: EdgeInsets.only(top:19.h,bottom: 36.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Column( + children: [ + Image.asset( + "assets/image/bus_pay_success_logo.png", + width: 76.h, + height: 76.h, + ), + Padding(padding: EdgeInsets.only(top:16.h,), + child:Text( + "收银成功", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 18.sp, + fontWeight: MyFontWeight.bold, + ), + )), + Container( + width: double.infinity, + margin: EdgeInsets.only(left:17.w,right: 16.w,top:11.h,bottom:17.h), + child: Flex( + children: List.generate(70, (_) { + return SizedBox( + width: 2.w, + height: 1.h, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFFEBECEF)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w,bottom: 20.h), + child:Row( + children: [ + Expanded(child:Text( + "订单编号", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + )), + Text( + widget?.arguments["rechargeId"] ?? "", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ) + ], + )), + Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w,bottom: 20.h), + child:Row( + children: [ + Expanded(child:Text( + "支付金额", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + )), + Text( + "¥${widget?.arguments["rechargeMoney"] ?? ""}", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ) + ], + )), + Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w,bottom: 20.h), + child:Row( + children: [ + Expanded(child:Text( + "支付时间", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + )), + Text( + DateFormat("yyyy-MM-dd HH:mm:ss").format(DateTime.now()), + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ) + ], + )), + Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w), + child:Row( + children: [ + Expanded(child:Text( + "支付方式", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + )), + Text( + widget.arguments["payIndex"] == 1 ? "现金":(widget.arguments["payIndex"] == 2?"微信支付":"支付宝支付"), + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ) + ], + )), + ], + ), + ) + ], + ), + ); + } +} diff --git a/lib/business_system/home/vip/vip_recharge_page.dart b/lib/business_system/home/vip/vip_recharge_page.dart index 31735b50..9ecdb0f0 100644 --- a/lib/business_system/home/vip/vip_recharge_page.dart +++ b/lib/business_system/home/vip/vip_recharge_page.dart @@ -1,13 +1,26 @@ +import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.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:shimmer/shimmer.dart'; import '../../../generated/l10n.dart'; import '../../../retrofit/business_api.dart'; +import '../../../retrofit/data/base_data.dart'; +import '../../../retrofit/data/bus_recharge_list.dart'; +import '../../../retrofit/data/phone_query_member_info.dart'; +import '../../../utils/business_instance.dart'; +import '../../../utils/flutter_utils.dart'; import '../../../utils/font_weight.dart'; +import '../../../view_widget/border_text.dart'; import '../../../view_widget/classic_header.dart'; import '../../../view_widget/my_footer.dart'; +import '../../../view_widget/no_data_view.dart'; +import '../../../view_widget/round_button.dart'; +import '../../../view_widget/settlement_tips_dialog.dart'; class VipRechargePage extends StatefulWidget { final Map arguments; @@ -23,11 +36,17 @@ class VipRechargePage extends StatefulWidget { class _VipRechargePage extends State { BusinessApiService businessService; final TextEditingController vipPhoneController = TextEditingController(); - final RefreshController refreshController = RefreshController(); + final RefreshController _refreshController = RefreshController(); bool isKeyBoardShow = false; FocusNode _focusNode = FocusNode(); int selectIndex = 0; - int payIndex = 0; + int payIndex = 1; + String networkError = ""; + int networkStatus = 0; + List records = []; + PhoneQueryMemberInfo phoneQueryMemberInfo; + String rechargeId; + List manualQueryInfo; @override void initState() { @@ -46,6 +65,7 @@ class _VipRechargePage extends State { } }); }); + _onRefresh(); } ///离开页面记着销毁和清除 @@ -55,6 +75,185 @@ class _VipRechargePage extends State { super.dispose(); } + _onRefresh({bool isShowLoad = true}) async { + if (isShowLoad) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (vipPhoneController?.text != "") + await queryMemberPhoneInfo(vipPhoneController?.text ?? "", isShow: false); + else + await queryRechargeList("", isShow: false); + EasyLoading.dismiss(); + if (!mounted) return; + if (_refreshController.isRefresh) _refreshController.refreshCompleted(); + setState(() {}); + } + + ///充值列表 + queryRechargeList(mid, {isShow = true}) async { + try { + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = + await businessService.getRechargePreferential({ + "current": 1, + "size": 999, + "model": { + "rechargeType": "", + "tenantCode": BusinessInstance.instance.businessTenant, + "mid": mid + } + }).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + records.clear(); + records.addAll(baseData?.data?.records ?? []); + networkStatus = 1; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + if (isShow) setState(() {}); + } + } + + ///根据手机号搜索用户信息 + queryMemberPhoneInfo(phoneNum, {isShow = true}) async { + try { + if (isShow) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService + .queryMemberInfo( + {"phoneNum": phoneNum, "isNewUser": false}).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + phoneQueryMemberInfo = baseData.data; + queryRechargeList(phoneQueryMemberInfo?.mid ?? ""); + networkStatus = 1; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + if (isShow) EasyLoading.dismiss(); + } + } + + ///充值方式支付 + payMemberType( + authCode, memberSourceId, rechargePreferentialId, source) async { + try { + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.posMemberRecharge({ + "authCode": authCode, + "memberSourceId": memberSourceId, + "rechargePreferentialId": rechargePreferentialId, + "source": source + }).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + rechargeId = baseData.data; + Navigator.of(context) + .popAndPushNamed('/router/pay_success_page', arguments: { + "rechargeId": baseData.data, + "rechargeMoney": records[selectIndex].rechargeMoney, + "payIndex": payIndex, + }); + networkStatus = 1; + setState(() {}); + } else { + SmartDialog.show( + widget: SettlementTips( + () {}, + text: baseData.msg, + color: Color(0xFF30415B), + )); + } + } finally { + EasyLoading.dismiss(); + } + } + + ///手动查询充值订单状态 + manualQueryRechargeOrder(memberRechargeId) async { + try { + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.manualQuery({ + "phone": phoneQueryMemberInfo?.phoneNum ?? "", + "memberRechargeId": memberRechargeId, + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + Navigator.of(context).pop(); + Navigator.of(context) + .popAndPushNamed('/router/pay_success_page', arguments: { + "rechargeId": baseData.data, + "rechargeMoney": records[selectIndex].rechargeMoney, + "payIndex": payIndex, + }); + } else { + if (baseData.msg != "需要用户输入支付密码") Navigator.of(context).pop(); + SmartDialog.show( + widget: SettlementTips( + () {}, + text: baseData.msg, + color: Color(0xFF30415B), + )); + } + } finally { + EasyLoading.dismiss(); + } + } + @override Widget build(BuildContext context) { return GestureDetector( @@ -71,405 +270,841 @@ class _VipRechargePage extends State { leadingColor: Colors.black, brightness: Brightness.dark, ), - body:SmartRefresher( + body: SmartRefresher( enablePullDown: true, enablePullUp: false, header: MyHeader( - color: Color(0xFF30415B),), + color: Color(0xFF30415B), + ), footer: CustomFooter( builder: (context, mode) { return MyFooter(mode); }, ), - controller: refreshController, - // onRefresh: _onRefresh, + controller: _refreshController, + onRefresh: (){ + _onRefresh(isShowLoad: false); + }, physics: BouncingScrollPhysics(), - child: SingleChildScrollView( + child: networkStatus == -1? noNetwork() : SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Color(0x0F06152E), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, - ) - ], - borderRadius: BorderRadius.circular(8), - ), - padding: EdgeInsets.symmetric(horizontal: 16.w), - margin: EdgeInsets.only(bottom: 16.h,right: 16.w,left: 16.w,top: 8.h), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Text( - "会员", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: FontWeight.w500, + child:networkStatus == 0 ?vipRechargeSm():Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ///会员搜索框 + Container( + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.symmetric(horizontal: 16.w), + margin: EdgeInsets.only( + bottom: 16.h, right: 16.w, left: 16.w, top: 8.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Text( + "会员", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ), + Expanded( + child: TextField( + controller: vipPhoneController, + textInputAction: TextInputAction.search, + onEditingComplete: () { + FocusScope.of(context) + .requestFocus(FocusNode()); + queryMemberPhoneInfo( + vipPhoneController.text ?? ""); + }, + decoration: InputDecoration( + hintText: "请输入会员手机号", + hintTextDirection: TextDirection.rtl, + hintStyle: TextStyle( + color: Color(0xFF808080), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + border: InputBorder.none, + contentPadding: EdgeInsets.only(left: 16.w), + ), + textAlign: TextAlign.right, + style: TextStyle( + color: Color(0xFF808080), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + ), + ), + ], + )), + + ///会员信息 + if (phoneQueryMemberInfo != null) + Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), ), + padding: EdgeInsets.only( + top: 16.h, bottom: 16.h, left: 16.w), + margin: EdgeInsets.only( + bottom: 16.h, right: 16.w, left: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 16.h), + child: Text( + "用户名称: ${phoneQueryMemberInfo?.nickName ?? ""}", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Padding( + padding: EdgeInsets.only(bottom: 16.h), + child: Text( + "手机号: ${phoneQueryMemberInfo?.phoneNum ?? ""}", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Text( + "会员余额: ¥${phoneQueryMemberInfo?.balance ?? ""}", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + + ///充值列表 + rechargeList(), + + ///选择充值的套餐 + if (networkStatus == 1) + Container( + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.all(16), + margin: EdgeInsets.only( + bottom: 24.h, + right: 16.w, + left: 16.w, + ), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Text( + "本次充值(元)", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ), + Text( + AppUtils.calculateDouble((double.tryParse( + records[selectIndex] + ?.rechargeMoney) ?? + 0)), + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.symmetric(vertical: 16.h), + ), + Row( + children: [ + Expanded( + child: Text( + "充后余额(元)", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ), + Text( + "${AppUtils.calculateDouble((double.tryParse(records[selectIndex]?.rechargeMoney) ?? 0) + (double.tryParse(records[selectIndex]?.giftdMoney) ?? 0))}", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ], ), ), - Expanded( - child: TextField( - controller: vipPhoneController, - decoration: InputDecoration( - hintText: "请输入会员手机号", - hintTextDirection: TextDirection.rtl, - hintStyle: TextStyle( - color: Color(0xFF808080), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular), - border: InputBorder.none, - contentPadding: EdgeInsets.only(left: 16.w), - ), - textAlign: TextAlign.right, + + ///充值方式 + Padding( + padding: EdgeInsets.only(left: 16.w, bottom: 16.h), + child: Text( + "充值方式", style: TextStyle( - color: Color(0xFF808080), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular), - ), + color: Colors.black, + fontSize: 15.sp, + fontWeight: MyFontWeight.bold, + ), + )), + Padding( + padding: EdgeInsets.only(left: 16.w, right: 10.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + payIndex = 1; + }); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: payIndex == 1 + ? Color(0xFF30415B) + : Color(0x29C5C5C5), + width: 2, + ), + color: payIndex == 1 + ? Color(0XFFEBF3FF) + : Color(0xFFF9FAF8)), + padding: EdgeInsets.only( + top: 21.h, + bottom: 15.h, + ), + margin: EdgeInsets.only(right: 6.w), + child: Column( + children: [ + Image.asset( + "assets/image/bus_vip_xj.webp", + width: 45.w, + height: 36.h, + ), + Padding( + padding: EdgeInsets.only(top: 15.h), + child: Text( + "现金支付", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )) + ], + ), + ), + )), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + payIndex = 3; + }); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: payIndex == 3 + ? Color(0xFF30415B) + : Color(0x29C5C5C5), + width: 2, + ), + color: payIndex == 3 + ? Color(0XFFEBF3FF) + : Color(0xFFF9FAF8)), + padding: EdgeInsets.only( + top: 21.h, + bottom: 15.h, + ), + margin: EdgeInsets.only(right: 6.w, left: 6.w), + child: Column( + children: [ + Image.asset( + "assets/image/bus_vip_alipay.webp", + width: 36.h, + height: 36.h, + ), + Padding( + padding: EdgeInsets.only(top: 15.h), + child: Text( + "支付宝支付", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )) + ], + ), + ), + )), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + payIndex = 2; + }); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: payIndex == 2 + ? Color(0xFF30415B) + : Color(0x29C5C5C5), + width: 2, + ), + color: payIndex == 2 + ? Color(0XFFEBF3FF) + : Color(0xFFF9FAF8)), + padding: EdgeInsets.only( + top: 21.h, + bottom: 15.h, + ), + margin: EdgeInsets.only(right: 6.w, left: 6.w), + child: Column( + children: [ + Image.asset( + "assets/image/bus_vip_wx.webp", + width: 36.h, + height: 36.h, + ), + Padding( + padding: EdgeInsets.only(top: 15.h), + child: Text( + "微信支付", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )) + ], + ), + ), + )), + ], ), - ], - )), - rechargeList(), - Container( - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Color(0x0F06152E), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, - ) + ), + + ///确认充值 + Align( + alignment: Alignment.bottomCenter, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if (widget.arguments["storeId"] == "0") { + SmartDialog.show( + widget: SettlementTips( + () {}, + text: "请选择门店进行充值", + color: Color(0xFF30415B), + )); + } else { + if (vipPhoneController.text == "") { + SmartDialog.show( + widget: SettlementTips( + () {}, + text: "请输入会员手机号进行充值", + color: Color(0xFF30415B), + )); + } else { + showRechargePayDialog(); + } + } + }, + child: Container( + color: Colors.white, + width: double.infinity, + margin: EdgeInsets.only(top: 132.h), + padding: EdgeInsets.only( + top: 10.h, + left: 16.w, + right: 16.w, + bottom: 34.h), + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 16.h), + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(27), + ), + child: Text( + "确认充值", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: MyFontWeight.bold, + ), + ), + ), + ), + )) ], - borderRadius: BorderRadius.circular(8), ), - padding: EdgeInsets.all(16), - margin: EdgeInsets.only(bottom:24.h,right: 16.w,left: 16.w,), - child: Column( - children: [ - Row( + )), + ), + ), + ); + } + + ///确认充值支付提示弹窗 + showRechargePayDialog() { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + contentPadding: EdgeInsets.all(0), + content: Container( + width: MediaQuery.of(context).size.width - 80, + padding: EdgeInsets.only( + top: 24.h, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: + EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w), + child: Text.rich( + TextSpan( children: [ - Expanded( - child: Text( - "本次充值(元)", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: FontWeight.w500, - ), - ), - ), - Text( - "322", + TextSpan( + text: "*", style: TextStyle( - color: Color(0xFF1A1A1A), + color: Color(0xFFFA5151), fontSize: 14.sp, fontWeight: FontWeight.w500, ), ), - ], - ), - Container( - width:double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.symmetric(vertical: 16.h), - ), - Row( - children: [ - Expanded( - child: Text( - "充后余额(元)", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: FontWeight.w500, - ), + TextSpan( + text: "请确认充账户及充值套餐后再点击确认", + style: TextStyle( + color: Color(0xFFFA5151), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, ), ), - Text( - "344", + TextSpan( + text: "*", style: TextStyle( - color: Color(0xFF1A1A1A), + color: Color(0xFFFA5151), fontSize: 14.sp, fontWeight: FontWeight.w500, ), ), ], ), + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + bottom: 18.h, left: 14.w, right: 14.w), + child: Text( + "充值账户: ${phoneQueryMemberInfo?.phoneNum ?? ""}", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ), + ), + Padding( + padding: EdgeInsets.only( + bottom: 18.h, left: 14.w, right: 14.w), + child: Text( + "充值套餐: 充${records[selectIndex]?.rechargeMoney ?? ""}送${records[selectIndex]?.giftdMoney ?? ""}", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ), + ), ], ), - ), - Padding(padding:EdgeInsets.only(left: 16.w,bottom: 16.h), - child: - Text( - "充值方式", - style: TextStyle( - color: Colors.black, - fontSize: 15.sp, - fontWeight: MyFontWeight.bold, + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFD8D8D8), ), - )), - Padding(padding:EdgeInsets.only(left: 16.w,right: 10.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded(child:GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: (){ - setState((){ - payIndex = 0; - }); - }, - child:Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - border: Border.all( - color: - payIndex == 0 ? Color(0xFF30415B) : Color(0x29C5C5C5), - width:2, - ), - color: - payIndex == 0 ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)), - padding: EdgeInsets.only(top: 21.h,bottom: 15.h,), - margin: EdgeInsets.only(right: 6.w), - child: Column( - children: [ - Image.asset( - "assets/image/bus_vip_xj.webp", - width: 45.w, - height:36.h, - ), - Padding(padding:EdgeInsets.only(top: 15.h), - child: Text( - "现金支付", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - )) - ], - ),), - )), - Expanded(child:GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: (){ - setState((){ - payIndex = 1; - }); - }, - child:Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - border: Border.all( - color: - payIndex == 1 ? Color(0xFF30415B) : Color(0x29C5C5C5), - width:2, - ), - color: - payIndex == 1 ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)), - padding: EdgeInsets.only(top: 21.h,bottom: 15.h,), - margin: EdgeInsets.only(right: 6.w,left: 6.w), - child: Column( - children: [ - Image.asset( - "assets/image/bus_vip_alipay.webp", - width: 36.h, - height:36.h, - ), - Padding(padding:EdgeInsets.only(top: 15.h), - child: Text( - "支付宝支付", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - )) - ], - ),), - )), - Expanded(child:GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: (){ - setState((){ - payIndex = 2; - }); - }, - child:Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - border: Border.all( - color: - payIndex == 2 ? Color(0xFF30415B) : Color(0x29C5C5C5), - width:2, + Container( + height: 55.h, + child: Row( + children: [ + Expanded( + child: InkWell( + child: BorderText( + text: S.of(context).quxiao, + textColor: Colors.black, + fontSize: 16.sp, + fontWeight: FontWeight.bold, + padding: EdgeInsets.all(14), ), - color: - payIndex == 2 ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)), - padding: EdgeInsets.only(top: 21.h,bottom: 15.h,), - margin: EdgeInsets.only(right: 6.w,left: 6.w), - child: Column( - children: [ - Image.asset( - "assets/image/bus_vip_wx.webp", - width: 36.h, - height:36.h, + onTap: () { + Navigator.of(context).pop(); + }, + ), + flex: 1, + ), + Container( + width: 1.w, + height: double.infinity, + color: Color(0xFFD8D8D8), + ), + Expanded( + child: InkWell( + child: RoundButton( + text: S.of(context).queren, + textColor: Color(0xFF30415B), + radius: 4, + padding: EdgeInsets.all(14), + fontSize: 16.sp, + fontWeight: FontWeight.bold, ), - Padding(padding:EdgeInsets.only(top: 15.h), - child: Text( - "微信支付", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - )) - ], - ),), - )), - ], - ),), - Align( - alignment: Alignment.bottomCenter, + onTap: () { + Navigator.of(context).pop(); + if (payIndex == 1) { + payMemberType( + null, + phoneQueryMemberInfo?.sid ?? "", + records[selectIndex]?.id ?? "", + payIndex); + } else { + Navigator.of(context).pushNamed( + '/router/scan_code_page', + arguments: { + "storeId": widget.arguments["storeId"], + "scanCodeType": "支付", + "rechargePreferentialId": + records[selectIndex]?.id ?? "", + "memberSourceId": + phoneQueryMemberInfo?.sid ?? "", + "source": payIndex.toString(), + "rechargeMoney": + records[selectIndex]?.rechargeMoney ?? + "" + }).then((value) { + if (value == 1) { + queryMemberPhoneInfo( + vipPhoneController?.text ?? "", + isShow: false); + } else { + manualQueryInfo = value; + showPayQueryDialog( + manualQueryInfo[0], manualQueryInfo[1]); + } + }); + } + }, + ), + flex: 1, + ), + ], + ), + ) + ], + ), + ), + ); + }, + ); + } + + ///手动查询弹窗 + showPayQueryDialog(String queryDialog, String rechargeOrderId) { + showDialog( + context: context, + barrierDismissible: false, + builder: (context) { + return AlertDialog( + contentPadding: EdgeInsets.all(0), + content: Container( + width: MediaQuery.of(context).size.width - 80, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pop(); + }, child: Container( - color: Colors.white, - width: double.infinity, - margin: EdgeInsets.only(top: 132.h), - padding: EdgeInsets.only(top: 10.h,left: 16.w,right: 16.w,bottom:34.h), - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric(vertical:16.h), - decoration: BoxDecoration( - color: Color(0xFF30415B), - borderRadius: BorderRadius.circular(27), + alignment: Alignment.topRight, + padding: + EdgeInsets.symmetric(horizontal: 5.w, vertical: 10.h), + child: Image.asset( + "assets/image/cancel.webp", + width: 24.h, + height: 24.h, + )), ), + Padding( + padding: + EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w), child: Text( - "确认充值", + queryDialog, style: TextStyle( - color: Colors.white, + color: Colors.black, fontSize: 16.sp, fontWeight: MyFontWeight.bold, ), ), ), - )) - ], + Padding( + padding: + EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w), + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "*", + style: TextStyle( + color: Color(0xFFFA5151), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "请确认用户支付成功后再点击手动查询", + style: TextStyle( + color: Color(0xFFFA5151), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + TextSpan( + text: "*", + style: TextStyle( + color: Color(0xFFFA5151), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "\n*", + style: TextStyle( + color: Colors.blue, + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "订单查询成功后可关闭当前弹窗", + style: TextStyle( + color: Colors.blue, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + TextSpan( + text: "*", + style: TextStyle( + color: Colors.blue, + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + manualQueryRechargeOrder(rechargeOrderId); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(4), + ), + padding: EdgeInsets.symmetric( + horizontal: 26.w, vertical: 10.h), + margin: EdgeInsets.only(right: 8.w, bottom: 20.h), + child: Text( + "手动查询", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + )), + ], + ), ), - ) - ), - ), - ), + ); + }, ); } Widget rechargeList() { return Container( - margin: EdgeInsets.only(left:16.w,right: 16.w,bottom:16.h), - child: ListView.builder( - padding: EdgeInsets.zero, - itemCount: 3, - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - setState(() { - selectIndex = position; - }); - }, - child: rechargeItem(position)); - }, - ), - ); - // : NoDataView( - // src: "assets/image/xiao_fei.webp", - // isShowBtn: false, - // text: "暂无充值套餐~", - // fontSize: 16.sp, - // margin: EdgeInsets.only(top: 90.h, left: 60.w, right: 60.w), - // ); + margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.h), + child: (records != null && (records?.length ?? 0) > 0) + ? ListView.builder( + padding: EdgeInsets.zero, + itemCount: records.length ?? 0, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + setState(() { + selectIndex = position; + }); + }, + child: rechargeItem(records[position], position)); + }, + ) + : NoDataView( + src: "assets/image/xiao_fei.webp", + isShowBtn: false, + text: "暂无充值套餐~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 90.h, left: 60.w, right: 60.w), + )); } - Widget rechargeItem(index) { - return Container( - width: double.infinity, - height: 69.h, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - border: Border.all( - color: - selectIndex == index ? Color(0xFF30415B) : Color(0x29C5C5C5), - width:2, - ), - color: - selectIndex == index ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)), - margin: EdgeInsets.only(bottom: 14.w), - padding: EdgeInsets.only(left: 16), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 1, - child: Container( - child: Text.rich( - TextSpan(children: [ - TextSpan( - text: "储值 ", - style: TextStyle( - fontSize: 12.sp, - color: selectIndex == index - ? Color(0xFF4D4D4D) - : Color(0xFF868686), - fontWeight: MyFontWeight.regular), - ), - TextSpan( - text: - "100", - style: TextStyle( - fontSize: 18.sp, - fontFamily: 'JDZhengHT', - color: selectIndex == index - ? Color(0xFF353535) - : Color(0xFF302F3A), - fontWeight: MyFontWeight.medium), - ),TextSpan( - text: - "元", - style: TextStyle( - fontSize: 18.sp, - fontFamily: 'JDZhengHT', - color: selectIndex == index - ? Color(0xFF353535) - : Color(0xFF302F3A), - fontWeight: MyFontWeight.semi_bold), - ), - ]), - ), - )), - Container( - width: 1.w, - height: 37.h, + Widget rechargeItem(Records records, index) { + return Stack( + alignment: Alignment.topRight, + children: [ + Container( + width: double.infinity, + height: 69.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: selectIndex == index + ? Color(0xFF30415B) + : Color(0x29C5C5C5), + width: 2, + ), color: - selectIndex == index ? Color(0xFF32A060) : Color(0xFF979797), - margin: EdgeInsets.only(right: 16.w, left: 12), - ), - Expanded( - flex: 2, - child: - Text.rich( + selectIndex == index ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)), + margin: EdgeInsets.only(bottom: 14.w), + padding: EdgeInsets.only(left: 16), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 2, + child: Container( + child: Text.rich( + TextSpan(children: [ + TextSpan( + text: "储值 ", + style: TextStyle( + fontSize: 12.sp, + color: selectIndex == index + ? Color(0xFF4D4D4D) + : Color(0xFF868686), + fontWeight: MyFontWeight.regular), + ), + TextSpan( + text: records?.rechargeMoney ?? "0", + style: TextStyle( + fontSize: 18.sp, + fontFamily: 'JDZhengHT', + color: selectIndex == index + ? Color(0xFF353535) + : Color(0xFF302F3A), + fontWeight: MyFontWeight.medium), + ), + TextSpan( + text: "元", + style: TextStyle( + fontSize: 18.sp, + fontFamily: 'JDZhengHT', + color: selectIndex == index + ? Color(0xFF353535) + : Color(0xFF302F3A), + fontWeight: MyFontWeight.semi_bold), + ), + ]), + ), + )), + Container( + width: 1.w, + height: 37.h, + color: selectIndex == index + ? Color(0xFF302F3A) + : Color(0xFF979797), + margin: EdgeInsets.only(right: 16.w, left: 12), + ), + Expanded( + flex: 3, + child: Text.rich( TextSpan(children: [ TextSpan( text: "赠送 ", @@ -481,8 +1116,7 @@ class _VipRechargePage extends State { fontWeight: MyFontWeight.regular), ), TextSpan( - text: - "120", + text: records?.giftdMoney ?? "0", style: TextStyle( fontSize: 18.sp, fontFamily: 'JDZhengHT', @@ -492,8 +1126,7 @@ class _VipRechargePage extends State { fontWeight: MyFontWeight.medium), ), TextSpan( - text: - "元", + text: "元", style: TextStyle( fontSize: 18.sp, fontFamily: 'JDZhengHT', @@ -503,8 +1136,576 @@ class _VipRechargePage extends State { fontWeight: MyFontWeight.semi_bold), ), ]), - ),) - ], - )); + ), + ) + ], + ), + ), + if (selectIndex == index) + Image.asset( + "assets/image/bus_vip_j.webp", + width: 32.h, + height: 32.h, + fit: BoxFit.fill, + ), + ], + ); } + + Widget vipRechargeSm() { + return Container( + margin: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ///会员搜索框 + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(top:8.h,bottom:16.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:double.infinity, + height: 51.h, + ), + ), + + ///会员信息 + Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w), + margin: EdgeInsets.only(bottom: 16.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:70.w, + height: 17.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:43.w, + height: 17.h, + ), + ), + ], + ), + SizedBox(height: 16.h,), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:56.w, + height: 17.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:85.w, + height: 17.h, + ), + ), + ], + ), + SizedBox(height: 16.h,), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:70.w, + height: 17.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:77.w, + height: 17.h, + ), + ), + ], + ), + ], + )), + + ///充值列表 + ListView.builder( + padding: EdgeInsets.zero, + itemCount: 3, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return rechargeItemSm(); + }, + ), + + ///选择充值的套餐 + Container( + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.all(16), + margin: EdgeInsets.only( + bottom: 24.h, + ), + child: Column( + children: [ + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:89.w, + height: 17.h, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:26.w, + height: 17.h, + ), + ), + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.symmetric(vertical: 16.h), + ), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:89.w, + height: 17.h, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:26.w, + height: 17.h, + ), + ), + ], + ), + ], + ), + ), + + ///充值方式 + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(left: 16.w, bottom: 16.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:60.w, + height: 21.h, + ), + ), + Row( + children: [ + Expanded(child:Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w), + margin: EdgeInsets.only(right: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(bottom:15.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:45.w, + height: 32.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:56.w, + height: 17.h, + ), + ), + ], + ))), + Expanded(child:Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w), + margin: EdgeInsets.only(right: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(bottom:15.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:45.w, + height: 32.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:56.w, + height: 17.h, + ), + ), + ], + ))), + Expanded(child:Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w), + margin: EdgeInsets.only(right: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(bottom:15.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:45.w, + height: 32.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:56.w, + height: 17.h, + ), + ), + ], + ))), + ], + ) + , + + ///确认充值 + Align( + alignment: Alignment.bottomCenter, + child: Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(bottom: 16.h,top: 30.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(27), + ), + width:double.infinity, + height: 54.h, + ), + ),) + ], + ), + ); + } + + Widget rechargeItemSm() { + return Container( + width: double.infinity, + height: 69.h, + color: Colors.white, + margin: EdgeInsets.only(bottom: 14.w), + padding: EdgeInsets.only(left: 16), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 2, + child: Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:25.w, + height: 15.h, + ), + ), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:50.w, + height: 25.h, + ), + ), + ], + ) + ], + )), + Container( + width: 1.w, + height: 37.h, + color: Color(0xFF979797), + margin: EdgeInsets.only(right: 16.w, left: 12), + ), + Expanded( + flex: 3, + child: Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:25.w, + height: 15.h, + ), + ), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right:10.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width:60.w, + height: 25.h, + ), + ), + ], + ) + ], + ), + ) + ], + ), + ); + } + + Widget noNetwork() { + return Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + // "无法连接到网络", + networkError.substring(0, networkError.indexOf(",")), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.h), + child: Text( + "请检查网络设置或稍后重试", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + _onRefresh(); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), + child: Text( + "重试", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular), + )), + ) + ], + ), + ); + } + } diff --git a/lib/business_system/mine/business_mine_page.dart b/lib/business_system/mine/business_mine_page.dart index a73a9d90..785cc8fc 100644 --- a/lib/business_system/mine/business_mine_page.dart +++ b/lib/business_system/mine/business_mine_page.dart @@ -246,22 +246,6 @@ 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 ?? ""), - // ), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(left: 32.w, bottom: 12.h), - ), GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -282,7 +266,22 @@ class _BusinessMinePage extends State } }, child: commonFunctionsItem( - "assets/image/bs_shop_logo.webp", "门店设置", ""), + "assets/image/bs_shop_logo.webp", "门店设置", "",20,20), + ), + 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/shop_reservation_code', + arguments: {"storeId": widget.storeId,}); + }, + child: commonFunctionsItem( + "assets/image/bs_mine_code.webp", "门店预约二维码", "",18,18), ), Container( width: double.infinity, @@ -300,25 +299,43 @@ class _BusinessMinePage extends State }); }, child: commonFunctionsItem( - "assets/image/bs_secure.webp", "安全设置", "登录手机号/密码")), + "assets/image/bs_secure.webp", "安全设置", "登录手机号/密码",18,22)), + 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/clerk_manage_page', arguments: { + "storeId": widget.storeId, + }); + }, + child: commonFunctionsItem( + "assets/image/bs_mine_clerk.webp", "店员管理", "",18,20), + ), ], ), ); } - Widget commonFunctionsItem(icon, leftText, rightText) { + Widget commonFunctionsItem(icon, leftText, rightText,double width,double height) { return Container( margin: EdgeInsets.only(bottom: 14.h), child: Row( + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( icon, - width: 24, - height: 24, + width: width.w, + height: height.h, fit: BoxFit.fill, ), SizedBox( - width: 8.w, + width:11.w, ), Expanded( child: Text( @@ -326,7 +343,7 @@ class _BusinessMinePage extends State style: TextStyle( fontSize: 14.sp, color: Color(0xFF30415B), - fontWeight: MyFontWeight.medium), + fontWeight: MyFontWeight.bold), )), Text( rightText, @@ -380,7 +397,7 @@ class _BusinessMinePage extends State Navigator.of(context).pushNamed('/router/user_service_page'); }, child: - commonFunctionsItem("assets/image/bs_user.webp", "关于我们", "")) + commonFunctionsItem("assets/image/bs_user.webp", "关于我们", "",24,24)) ], ), ); diff --git a/lib/business_system/mine/clerk_manage/add_new_clerk_page.dart b/lib/business_system/mine/clerk_manage/add_new_clerk_page.dart new file mode 100644 index 00000000..d72e73b7 --- /dev/null +++ b/lib/business_system/mine/clerk_manage/add_new_clerk_page.dart @@ -0,0 +1,546 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; + +import '../../../generated/l10n.dart'; +import '../../../retrofit/business_api.dart'; +import '../../../retrofit/data/base_data.dart'; +import '../../../retrofit/data/user_info_edit.dart'; +import '../../../utils/business_instance.dart'; +import '../../../utils/font_weight.dart'; +import '../../../view_widget/my_appbar.dart'; + +class AddNewClerkPage extends StatefulWidget { + final Map arguments; + + AddNewClerkPage({this.arguments}); + + @override + State createState() { + return _AddNewClerkPage(); + } +} + +class _AddNewClerkPage extends State { + String titleName; + final TextEditingController editingPhoneController = TextEditingController(); + final TextEditingController editingNameController = TextEditingController(); + bool isKeyBoardShow = false; + FocusNode _focusNode = FocusNode(); + BusinessApiService businessService; + String selectSexIndex = "N"; + String clerkAccount; + String clerkName; + String clerkSex; + String sexCode; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) { + setState(() { + print("object: ${MediaQuery.of(context).viewInsets.bottom}"); + if (MediaQuery.of(context).viewInsets.bottom == 0) { + if (isKeyBoardShow) { + isKeyBoardShow = false; + //关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 + FocusScope.of(context).requestFocus(FocusNode()); + } + } else { + isKeyBoardShow = true; + } + }); + }); + titleName = widget?.arguments["titleName"] ??""; + clerkAccount = widget?.arguments["clerkAccount"] ?? ""; + clerkName = widget?.arguments["clerkName"] ?? ""; + clerkSex = widget?.arguments["sex"] ?? ""; + sexCode = widget?.arguments["sexCode"] ?? ""; + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + _focusNode.unfocus(); + super.dispose(); + } + + ///店员信息编辑/新增店员 + editUser(account,name,sex) async { + try{ + EasyLoading.show( + status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.userEdit({ + "account":account, + "name":name, + "sex":sex, + "password": "123456", + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + Navigator.of(context).pop(1); + SmartDialog.showToast(titleName == "编辑店员资料" ? "店员资料编辑成功" : "新增店员成功", + alignment: Alignment.center); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + }}finally{ + EasyLoading.dismiss(); + } + } + + ///修改店员信息 + modifyUser(account,name,sex) async { + try{ + EasyLoading.show( + status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.userModify({ + "account": account == ""?clerkAccount:account, + "name": name == "" ? clerkName :name, + "sex": sex == ""?sexCode:sex, + "password": "123456", + "id":widget?.arguments["id"]??"" + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + Navigator.of(context).pop(1); + SmartDialog.showToast("修改店员信息成功", + alignment: Alignment.center); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + }}finally{ + EasyLoading.dismiss(); + } + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).unfocus(); + }, + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: Colors.white, + appBar: MyAppBar( + title: titleName, + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + brightness: Brightness.dark, + ), + body: Container( + margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "*", + style: TextStyle( + color: Color(0xFFE02020), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "员工姓名", + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ), + Expanded( + child: TextField( + controller: editingNameController, + decoration: InputDecoration( + hintText: clerkName != ""?clerkName:"请输入员工姓名", + hintTextDirection: TextDirection.rtl, + hintStyle: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold), + border: InputBorder.none, + contentPadding: EdgeInsets.only(left: 16.w), + ), + textAlign: TextAlign.right, + style: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold), + ), + ), + ], + ), + Container( + height: 1.h, + width: double.infinity, + color: Color(0xFFEBEBEB), + margin: EdgeInsets.only(bottom: 16.h), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "*", + style: TextStyle( + color: Color(0xFFE02020), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "员工性别", + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + showSexSelect(selectSexIndex); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + clerkSex != "" ? clerkSex:(selectSexIndex == "" ? "请选择员工性别":(selectSexIndex == "N"?"未知":(selectSexIndex == "M" ? "男":"女"))), + style: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + ), + Image.asset( + "assets/image/bs_right.webp", + width: 14.h, + height: 14.h, + color: Color(0xFF353535), + ) + ], + ) + ) + ], + ), + Container( + height: 1.h, + width: double.infinity, + color: Color(0xFFEBEBEB), + margin: EdgeInsets.only(top: 16.h), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "*", + style: TextStyle( + color: Color(0xFFE02020), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "手机号", + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ), + Expanded( + child: TextField( + controller: editingPhoneController, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + hintText: clerkAccount != ""?clerkAccount:"请输入手机号", + hintTextDirection: TextDirection.rtl, + hintStyle: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold), + border: InputBorder.none, + contentPadding: EdgeInsets.only(left: 16.w), + ), + inputFormatters: [ + LengthLimitingTextInputFormatter(11) + ], + textAlign: TextAlign.right, + style: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold), + ), + ), + ], + ), + Container( + height: 1.h, + width: double.infinity, + color: Color(0xFFEBEBEB), + margin: EdgeInsets.only(bottom: 16.h), + ), + Spacer(), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if (editingNameController.text == "" && clerkName == "") { + SmartDialog.showToast("请输入员工姓名", + alignment: Alignment.center); + return; + } else if (selectSexIndex == "" && clerkSex == "") { + SmartDialog.showToast("请选择员工性别", + alignment: Alignment.center); + return; + } else if (editingPhoneController.text == "" && clerkAccount == "") { + SmartDialog.showToast("请输入手机号", + alignment: Alignment.center); + return; + } { + if(clerkName != "" || clerkAccount != "" || clerkSex != ""){ + modifyUser(editingPhoneController.text,editingNameController.text,selectSexIndex); + }else + editUser(editingPhoneController.text,editingNameController.text,selectSexIndex); + } + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B), + ), + width: double.infinity, + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 16.h), + margin: EdgeInsets.only(bottom: 34.h), + child: Text( + S.of(context).baocun, + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ], + ), + ), + ), + ); + } + + showSexSelect(index) { + showModalBottomSheet( + context: context, + isDismissible: false, + builder: (context) { + return StatefulBuilder(builder: ( + context, + state, + ) { + return Container( + width: double.infinity, + height: 290.h, + padding: EdgeInsets.only(top: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(6), + topLeft: Radius.circular(6), + )), + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 14.w), + child: Row( + children: [ + Expanded( + child:GestureDetector( + behavior:HitTestBehavior.opaque, + onTap: (){ + state((){ + selectSexIndex = ""; + Navigator.of(context).pop(); + }); + }, + child: Text( + S.of(context).quxiao, + style: TextStyle( + color: Colors.black, + fontSize: 16.sp, + fontWeight: MyFontWeight.black, + ), + ), + )), + Expanded(child:GestureDetector( + behavior:HitTestBehavior.opaque, + onTap: (){ + selectSexIndex == "N"? "未知" :(selectSexIndex == "M" ? "男" : "女" ); + Navigator.of(context).pop(); + setState((){});}, + child: Container( + alignment: Alignment.centerRight, + child: Text( + S.of(context).queding, + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: MyFontWeight.black, + ), + ), + ), + )) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 12.h, bottom: 13.h), + height: 1.h, + color: Color(0xFFF2F2F2)), + GestureDetector( + behavior:HitTestBehavior.opaque, + onTap: () { + state((){ + selectSexIndex = "M"; + }); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + padding: + EdgeInsets.only(top:12.h, bottom:12.h, left: 12.w), + margin: EdgeInsets.symmetric(horizontal: 14.w), + decoration: BoxDecoration( + borderRadius:BorderRadius.circular(6), + border: Border.all( + color: selectSexIndex == "M" ? Color(0xFF30415B):Color(0xFFF7F7F7), + width: selectSexIndex == "M" ? 1 :0, + ), + color: selectSexIndex == "M" ? Color(0xFFEFF5FF) :Color(0xFFF7F7F7), + ), + child: Text( + "男", + style: TextStyle( + color: selectSexIndex == "M"? Color(0xFF30415B):Color(0xFF4D4D4D), + fontSize: 18.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + ), + SizedBox( + height: 13.h, + ), + GestureDetector( + behavior:HitTestBehavior.opaque, + onTap: () { + state((){ + selectSexIndex = "W"; + }); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + padding: + EdgeInsets.only(top: 12.h, bottom: 12.h, left: 12.w), + margin: EdgeInsets.symmetric(horizontal: 14.w), + decoration: BoxDecoration( + borderRadius:BorderRadius.circular(6), + border: Border.all( + color: selectSexIndex == "W" ? Color(0xFF30415B):Color(0xFFF7F7F7), + width: selectSexIndex == "W" ? 1 :0, + ), + color: selectSexIndex == "W" ? Color(0xFFEFF5FF) :Color(0xFFF7F7F7), + ), + child: Text( + "女", + style: TextStyle( + color: selectSexIndex == "W" ?Color(0xFF30415B):Color(0xFF4D4D4D), + fontSize: 18.sp, + fontWeight: MyFontWeight.regular, + ), + )), + ), + SizedBox( + height: 13.h, + ), + GestureDetector( + behavior:HitTestBehavior.opaque, + onTap: () { + state((){ + selectSexIndex = "N"; + }); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + padding: + EdgeInsets.only(top: 12.h, bottom: 12.h, left: 12.w), + margin: EdgeInsets.symmetric(horizontal: 14.w), + decoration: BoxDecoration( + borderRadius:BorderRadius.circular(6), + border: Border.all( + color: selectSexIndex == "N" ? Color(0xFF30415B):Color(0xFFF7F7F7), + width: selectSexIndex == "N" ? 1 :0, + ), + color: selectSexIndex == "N" ? Color(0xFFEFF5FF) :Color(0xFFF7F7F7), + ), + child: Text( + "未知", + style: TextStyle( + color: selectSexIndex == "N" ?Color(0xFF30415B):Color(0xFF4D4D4D), + fontSize: 18.sp, + fontWeight: MyFontWeight.regular, + ), + )), + ) + ], + ), + ); + }); + }, + ); + } +} diff --git a/lib/business_system/mine/clerk_manage/clerk_manage_page.dart b/lib/business_system/mine/clerk_manage/clerk_manage_page.dart new file mode 100644 index 00000000..050fbcdd --- /dev/null +++ b/lib/business_system/mine/clerk_manage/clerk_manage_page.dart @@ -0,0 +1,512 @@ +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/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../../../generated/l10n.dart'; +import '../../../retrofit/business_api.dart'; +import '../../../retrofit/data/base_data.dart'; +import '../../../retrofit/data/clerk_manage_list.dart'; +import '../../../utils/business_instance.dart'; +import '../../../utils/flutter_utils.dart'; +import '../../../view_widget/border_text.dart'; +import '../../../view_widget/classic_header.dart'; +import '../../../view_widget/my_footer.dart'; +import '../../../view_widget/no_data_view.dart'; +import '../../../view_widget/round_button.dart'; + +class ClerkManagePage extends StatefulWidget { + final Map arguments; + + ClerkManagePage({this.arguments}); + + @override + State createState() { + return _ClerkManagePage(); + } +} + +class _ClerkManagePage extends State { + final RefreshController refreshController = RefreshController(); + BusinessApiService businessService; + String networkError = ""; + int networkStatus = 0; + List records = []; + int _current = 1; + + @override + void initState() { + super.initState(); + _onRefresh(); + } + + _onRefresh({bool isShowLoad = true}) async { + if (isShowLoad) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + await queryClerkList(); + EasyLoading.dismiss(); + if (refreshController.isRefresh) refreshController.refreshCompleted(); + if (mounted) setState(() {}); + } + + ///查询店员管理列表 + queryClerkList({isShow = true}) async { + try { + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.clerkList({ + "size": 20, + "pageSize": 20, + "current": _current, + "currentPage": 1, + "sort": "id", + "order": "descending", + }).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + records.addAll(baseData?.data?.records ?? []); + if ((baseData?.data?.records ?? []).isEmpty || + records.length.toString() == baseData.data.total) + refreshController.loadNoData(); + else + refreshController.loadComplete(); + networkStatus = 1; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + if (isShow) setState(() {}); + } + } + + ///删除店员 + queryDelUser(ids) async { + try { + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = + await businessService.delUser(ids).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + await editOnRefresh(); + SmartDialog.showToast("删除店员成功", alignment: Alignment.center); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + EasyLoading.dismiss(); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: MyAppBar( + title: "店员管理", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + brightness: Brightness.dark, + ), + body: networkStatus == -1 + ? noNetwork() + : Container( + margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), + child: Column( + children: [ + Expanded( + child: Container( + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: records.length == 0 ? false : true, + header: MyHeader( + color: Color(0xFF30415B), + ), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + _current = 1; + records.clear(); + _onRefresh(isShowLoad: false); + }, + onLoading: () { + _current++; + _onRefresh(isShowLoad: false); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + child: networkStatus == 0 + ? ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: clerkManageItemSm(), + ); + }, + ) + : ((records == null || records.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: records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: clerkManageItem( + records[position]), + ); + }, + )), + ), + ), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed( + '/router/add_new_clerk_page', + arguments: { + "storeId": widget.arguments["storeId"], + "titleName": "添加新店员" + }).then((value) { + if (value == 1) { + _current = 1; + records.clear(); + _onRefresh(isShowLoad: false); + } + }); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B), + ), + width: double.infinity, + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 16.h), + margin: EdgeInsets.only(bottom: 34.h), + child: Text( + "添加店员", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + ), + )), + ], + ), + )); + } + + editOnRefresh() { + _current = 1; + records.clear(); + _onRefresh(isShowLoad: false); + } + + ///店员管理列表 + Widget clerkManageItem(Records records) { + return Container( + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Text( + records?.name ?? "", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context) + .pushNamed('/router/add_new_clerk_page', arguments: { + "storeId": widget.arguments["storeId"], + "titleName": "编辑店员资料", + "clerkAccount": (records?.mobile == "") + ? (records?.account ?? "") + : (records?.mobile ?? ""), + "clerkName": records?.name ?? "", + "sex": records?.sex?.desc ?? "", + "sexCode": records?.sex?.code ?? "", + "id": records?.id ?? "" + }).then((value) { + if(value == 1) + editOnRefresh(); + }); + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 17.w), + child: Text( + "编辑", + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + showDelGroupDialog(records?.id); + }, + child: Padding( + padding: EdgeInsets.only(right: 16.w, left: 17.w), + child: Text( + S.of(context).shanchu, + style: TextStyle( + color: Color(0xFFF4524D), + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + ) + ], + ), + Container( + margin: EdgeInsets.symmetric(vertical: 16.h), + color: Color(0xFFEBEBEB), + height: 1.h, + width: double.infinity, + ) + ], + ), + ); + } + + Widget clerkManageItemSm() { + return Container( + child: Column( + children: [ + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 112.w, + height: 20.h, + ), + ), + Spacer(), + Padding( + padding: EdgeInsets.symmetric(horizontal: 17.w), + child: Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 28.w, + height: 20.h, + ), + ), + ), + Padding( + padding: EdgeInsets.only(right: 16.w, left: 17.w), + child: Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 28.w, + height: 20.h, + ), + ), + ), + ], + ), + Container( + margin: EdgeInsets.symmetric(vertical: 16.h), + color: Color(0xFFEBEBEB), + height: 1.h, + width: double.infinity, + ) + ], + ), + ); + } + + ///删除分组提示弹窗 + showDelGroupDialog(id) { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + content: Container( + width: MediaQuery.of(context).size.width - 84, + height: 139.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "选中数据将被永久删除, 是否继续?", + style: TextStyle( + color: Color(0xFFF4524D), + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox( + height: 35.h, + ), + Row( + children: [ + Expanded( + child: InkWell( + child: BorderText( + text: S.of(context).quxiao, + textColor: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.bold, + borderColor: Color(0xFF30415B), + radius: 4, + padding: EdgeInsets.all(12), + borderWidth: 1, + ), + onTap: () { + Navigator.of(context).pop(); + }, + ), + flex: 1, + ), + SizedBox( + width: 16.w, + ), + Expanded( + child: 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(); + queryDelUser(id); + }, + ), + flex: 1, + ), + ], + ) + ], + ), + ), + ); + }, + ); + } + + Widget noNetwork() { + return Container( + color: Colors.white, + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + networkError.substring(0, networkError.indexOf(",")), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.h), + child: Text( + "请检查网络设置或稍后重试", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + _onRefresh(); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), + child: Text( + "重试", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular), + )), + ) + ], + ), + ); + } +} diff --git a/lib/business_system/mine/shop_reservation_code.dart b/lib/business_system/mine/shop_reservation_code.dart new file mode 100644 index 00000000..0c92631b --- /dev/null +++ b/lib/business_system/mine/shop_reservation_code.dart @@ -0,0 +1,208 @@ +import 'dart:typed_data'; + +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:image_gallery_saver/image_gallery_saver.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:qr_flutter/qr_flutter.dart'; + +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_footer.dart'; + +class ShopReservationCode extends StatefulWidget { + final Map arguments; + + ShopReservationCode({this.arguments}); + + @override + State createState() { + return _ShopReservationCode(); + } +} + +class _ShopReservationCode extends State { + final RefreshController refreshController = RefreshController(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: "门店预约二维码", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + brightness: Brightness.dark, + ), + body: + // networkStatus == -1 + // ? noNetwork() : + SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader( + color: Color(0xFF30415B), + ), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + // _onRefresh(isShowLoad: false); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + padding: EdgeInsets.only(top:16.h,bottom:45.h), + child: + // ListView.builder( + // itemCount: 10, + // physics: BouncingScrollPhysics(), + // shrinkWrap: true, + // itemBuilder: (context, position) { + // return GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: () {}, + // child: assortItemSm(), + // ); + // }, + // ) + // : ((productGroupList == null || + // productGroupList.records.length == 0) + // ? NoDataView( + // src: "assets/image/bs_no data_logo.webp", + // isShowBtn: false, + // text: "暂无商品分类", + // fontSize: 16.sp, + // margin: EdgeInsets.all(20.h), + // ) : + ListView.builder( + itemCount:6, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: reservationCodeItem(), + ); + }, + )), + )); + } + + void saveQrImg(String qrImgData) async{ + try { + EasyLoading.show(status: "正在保存...", maskType: EasyLoadingMaskType.clear); + // 如果用户已授权存储权限 + if (await Permission.storage.request().isGranted) { + final painter = QrPainter( + data: qrImgData, + version: QrVersions.auto, + gapless: true, + errorCorrectionLevel: QrErrorCorrectLevel.L, + ); + ByteData imageData = await painter.toImageData(600.0); + final data = imageData.buffer.asUint8List(); + if (data != null) { + var result = await + ImageGallerySaver.saveImage(data, + isReturnImagePathOfIOS: true); + if (result["isSuccess"] == true) { + SmartDialog.showToast("保存成功!", alignment: Alignment.center); + } else + SmartDialog.showToast("保存失败!${result["errorMessage"] ?? ""}", + alignment: Alignment.center); + } else + SmartDialog.showToast("获取图片失败!", alignment: Alignment.center); + } else { + // 没有存储权限时,弹出没有存储权限的弹窗 + await Permission.storage.request(); + SmartDialog.showToast("请在授予应用储存权限后再试!", alignment: Alignment.center); + } + } catch (e, s) { + SmartDialog.showToast("22222", alignment: Alignment.center); + SmartDialog.showToast(e.toString(), alignment: Alignment.center); + SmartDialog.showToast(s.toString(), alignment: Alignment.center); + } finally { + EasyLoading.dismiss(); + } + } + + Widget reservationCodeItem() { + return Container( + width: double.infinity, + margin: EdgeInsets.only(left: 16.w, right: 16.w,bottom:12.h), + padding: EdgeInsets.only(top:12.h, bottom: 12.h,left:20.w,), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + QrImage( + data: "555562332356564512", + version: QrVersions.auto, + size: 104.h, + gapless: true, + padding: EdgeInsets.all(0), + ), + SizedBox(width: 10.w,), + Expanded(child:Container( + height: 104.h, + child: Column( + children: [ + Expanded(child:Padding(padding: EdgeInsets.only(right: 22.w), + child: Text( + "海峡姐妹理发彭和会所", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: Color(0xD9000000), + fontSize: 18.sp, + fontWeight: MyFontWeight.bold, + ), + ),)), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + saveQrImg("555562332356564512"); + }, + child: Container( + padding: EdgeInsets.only(top:15.h,right: 22.w), + alignment: Alignment.bottomRight, + child: Image.asset( + "assets/image/bus_code_save.webp", + width: 20.w, + height: 18.h, + ), + ), + ) + ], + ), + )), + ], + ), + ); + } +} diff --git a/lib/business_system/scan_code_page.dart b/lib/business_system/scan_code_page.dart index 38701dec..2fba9600 100644 --- a/lib/business_system/scan_code_page.dart +++ b/lib/business_system/scan_code_page.dart @@ -1,6 +1,7 @@ import 'dart:ui'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:image_pickers/image_pickers.dart'; @@ -9,6 +10,8 @@ import '../../retrofit/business_api.dart'; import '../../retrofit/data/base_data.dart'; import '../../retrofit/data/ticket_details.dart'; import '../../utils/business_instance.dart'; +import '../generated/l10n.dart'; +import '../utils/font_weight.dart'; import '../view_widget/settlement_tips_dialog.dart'; class ScanCodePage extends StatefulWidget { @@ -65,6 +68,40 @@ class _ScanCodePage extends State { } } + ///会员充值支付 + rechargePay(authCode) async { + try{ + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.posMemberRecharge({ + "rechargePreferentialId": widget?.arguments["rechargePreferentialId"] ?? "", + "memberSourceId": widget?.arguments["memberSourceId"] ?? "", + "source": widget?.arguments["source"] ?? 1, + "authCode": authCode ?? null + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + Navigator.of(context).pop(1); + Navigator.of(context).popAndPushNamed('/router/pay_success_page',arguments: { + "rechargeId":baseData.data, + "rechargeMoney":widget?.arguments["rechargeMoney"], + "payIndex":int.tryParse(widget?.arguments["source"]), + }); + } else { + Navigator.of(context).pop([baseData.msg,baseData.data]); + }}finally{ + EasyLoading.dismiss(); + } + } + + @override Widget build(BuildContext context) { return Scaffold( @@ -79,8 +116,12 @@ class _ScanCodePage extends State { scanAreaScale: 0.7, scanLineColor: Colors.green.shade400, onCapture: (data) { - if (data != null && data != "") { + if (data != null && + data != "" && + widget.arguments["scanCodeType"] == null) { queryTicketDetails(data); + } else { + rechargePay(data); } }, ), @@ -136,7 +177,7 @@ class _ScanCodePage extends State { ), padding: EdgeInsets.all(8.w), margin: EdgeInsets.only(left: 12.w, right: 16.w, top: 16.h), - child:Icon( + child: Icon( Icons.image, size: 25.w, color: Colors.white, @@ -169,14 +210,13 @@ class _ScanCodePage extends State { String result = await Scan.parse(medias[0].path); if (result != null && result != "") { queryTicketDetails(result); - }else{ + } else { SmartDialog.show( widget: SettlementTips( - () { - }, - text: "照片中未识别到二维码/条码", - color: Color(0xFF30415B), - )); + () {}, + text: "照片中未识别到二维码/条码", + color: Color(0xFF30415B), + )); } } } diff --git a/lib/home/welfare_page.dart b/lib/home/welfare_page.dart index 895b8b2e..9277c070 100644 --- a/lib/home/welfare_page.dart +++ b/lib/home/welfare_page.dart @@ -26,6 +26,8 @@ import 'package:huixiang/view_widget/selector_store_dialog.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../view_widget/settlement_tips_dialog.dart'; + class WelfarePage extends StatefulWidget { @override State createState() { @@ -689,7 +691,12 @@ class _WelfarePage extends State { queryCoupon(); showAlertDialog(); } else { - SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); + SmartDialog.show( + clickBgDismissTemp: false, + widget: SettlementTips( + () {}, + text: baseData.msg, + )); } } diff --git a/lib/main.dart b/lib/main.dart index 7492e671..5bb02341 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -96,18 +96,24 @@ import 'business_system/goods/on_sale/batch_shelf.dart'; import 'business_system/goods/on_sale/goods_assort.dart'; import 'business_system/goods/on_sale/goods_sort.dart'; import 'business_system/goods/reservation_ page.dart'; +import 'business_system/home/cashier/cashier_page.dart'; +import 'business_system/home/consumer_ranking_page.dart'; import 'business_system/home/flow_page.dart'; import 'business_system/home/hot _selling_page.dart'; import 'business_system/home/select_shop.dart'; import 'business_system/home/overview/trade_overview_page.dart'; import 'business_system/home/vip/add_vip.dart'; import 'business_system/home/vip/business_vip_page.dart'; +import 'business_system/home/vip/pay_success_page.dart'; import 'business_system/home/vip/vip_recharge_page.dart'; import 'business_system/login/business_login_page.dart'; import 'business_system/mine/account_information.dart'; +import 'business_system/mine/clerk_manage/add_new_clerk_page.dart'; +import 'business_system/mine/clerk_manage/clerk_manage_page.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/mine/shop_reservation_code.dart'; import 'business_system/order/business_order_detail.dart'; import 'business_system/order/order_write_off.dart'; import 'business_system/order/request_refund.dart'; @@ -527,4 +533,16 @@ Map routers = { HotSellingPage(arguments:arguments), '/router/vip_recharge_page': (context, {arguments}) => VipRechargePage(arguments:arguments), + '/router/pay_success_page': (context, {arguments}) => + PaySuccessPage(arguments:arguments), + '/router/cashier_page': (context, {arguments}) => + CashierPage(arguments:arguments), + '/router/consumer_ranking_page': (context, {arguments}) => + ConsumerRankingPage(arguments:arguments), + '/router/shop_reservation_code': (context, {arguments}) => + ShopReservationCode(arguments:arguments), + '/router/clerk_manage_page': (context, {arguments}) => + ClerkManagePage(arguments:arguments), + '/router/add_new_clerk_page': (context, {arguments}) => + AddNewClerkPage(arguments:arguments), }; diff --git a/lib/qr/invite_friends.dart b/lib/qr/invite_friends.dart index 8a6ed6b7..025656a3 100644 --- a/lib/qr/invite_friends.dart +++ b/lib/qr/invite_friends.dart @@ -293,7 +293,7 @@ class _InviteFriends extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Column( + Expanded(child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -301,12 +301,12 @@ class _InviteFriends extends State { children: [ Image.asset( "assets/image/invite_wx.webp", - width: 42, - height: 42, + width: 42.h, + height: 42.h, fit: BoxFit.cover, ), Container( - width: 51, + width:50.w, child: Flex( children: List.generate(8, (_) { return SizedBox( @@ -330,8 +330,8 @@ class _InviteFriends extends State { children: [ Image.asset( "assets/image/invite_1.webp", - width: 24, - height: 24, + width: 24.h, + height: 24.h, fit: BoxFit.cover, ), Container( @@ -339,8 +339,8 @@ class _InviteFriends extends State { child: Flex( children: List.generate(0, (_) { return SizedBox( - width: 3, - height: 1, + width: 3.w, + height: 1.h, child: DecoratedBox( decoration: BoxDecoration(color: Colors.white), ), @@ -371,12 +371,12 @@ class _InviteFriends extends State { ), ), Container( - width: 43, + width: 43.w, child: Flex( children: List.generate(0, (_) { return SizedBox( - width: 3, - height: 1, + width: 3.w, + height: 1.h, child: DecoratedBox( decoration: BoxDecoration(color: Colors.white), ), @@ -389,8 +389,8 @@ class _InviteFriends extends State { ], ), ], - ), - Column( + )), + Expanded(child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -398,17 +398,17 @@ class _InviteFriends extends State { children: [ Image.asset( "assets/image/yq_zt.webp", - width: 42, - height: 42, + width: 42.h, + height: 42.h, fit: BoxFit.cover, ), Container( - width: 51, + width: 50.w, child: Flex( children: List.generate(8, (_) { return SizedBox( - width: 3, - height: 1, + width: 3.w, + height: 1.w, child: DecoratedBox( decoration: BoxDecoration(color: Color(0xFF32A060)), @@ -427,8 +427,8 @@ class _InviteFriends extends State { children: [ Image.asset( "assets/image/invite_2.webp", - width: 24, - height: 24, + width: 24.h, + height: 24.h, fit: BoxFit.cover, ), Container( @@ -436,8 +436,8 @@ class _InviteFriends extends State { child: Flex( children: List.generate(0, (_) { return SizedBox( - width: 3, - height: 1, + width: 3.w, + height: 1.h, child: DecoratedBox( decoration: BoxDecoration(color: Colors.white), ), @@ -472,8 +472,8 @@ class _InviteFriends extends State { child: Flex( children: List.generate(0, (_) { return SizedBox( - width: 3, - height: 1, + width: 3.w, + height: 1.h, child: DecoratedBox( decoration: BoxDecoration(color: Colors.white), ), @@ -486,8 +486,8 @@ class _InviteFriends extends State { ], ), ], - ), - Column( + )), + Expanded(child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -495,17 +495,17 @@ class _InviteFriends extends State { children: [ Image.asset( "assets/image/zt_m.webp", - width: 42, - height: 42, + width: 42.h, + height: 42.h, fit: BoxFit.cover, ), Container( - width: 51, + width: 50.w, child: Flex( children: List.generate(8, (_) { return SizedBox( - width: 3, - height: 1, + width: 3.w, + height: 1.h, child: DecoratedBox( decoration: BoxDecoration(color: Color(0xFF32A060)), @@ -524,8 +524,8 @@ class _InviteFriends extends State { children: [ Image.asset( "assets/image/invite_3.webp", - width: 24, - height: 24, + width: 24.h, + height: 24.h, fit: BoxFit.cover, ), Container( @@ -533,8 +533,8 @@ class _InviteFriends extends State { child: Flex( children: List.generate(0, (_) { return SizedBox( - width: 3, - height: 1, + width: 3.w, + height: 1.h, child: DecoratedBox( decoration: BoxDecoration(color: Colors.white), ), @@ -565,12 +565,12 @@ class _InviteFriends extends State { ), ), Container( - width: 43, + width: 43.w, child: Flex( children: List.generate(0, (_) { return SizedBox( - width: 3, - height: 1, + width: 3.w, + height: 1.h, child: DecoratedBox( decoration: BoxDecoration(color: Colors.white), ), @@ -583,19 +583,19 @@ class _InviteFriends extends State { ], ), ], - ), + )), Column( children: [ Image.asset( "assets/image/invite_q.webp", - width: 42, - height: 42, + width: 42.h, + height: 42.h, fit: BoxFit.cover, ), Image.asset( "assets/image/invite_4.webp", - width: 24, - height: 24, + width: 24.h, + height: 24.h, fit: BoxFit.cover, ), SizedBox(height: 8.h), @@ -613,7 +613,8 @@ class _InviteFriends extends State { ), ) ], - ), + ) + , ], ), ), diff --git a/lib/retrofit/business_api.dart b/lib/retrofit/business_api.dart index 0a9142b2..55adaf4d 100644 --- a/lib/retrofit/business_api.dart +++ b/lib/retrofit/business_api.dart @@ -12,16 +12,21 @@ import 'package:huixiang/retrofit/data/order_trend.dart'; import 'package:huixiang/retrofit/data/vip_counts_info.dart'; import 'package:retrofit/retrofit.dart'; +import 'data/add_vip_info.dart'; import 'data/balance_change_list.dart'; +import 'data/balance_consumption_ranking_list.dart'; import 'data/base_data.dart'; +import 'data/bus_recharge_list.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/business_vip_list.dart'; +import 'data/clerk_manage_list.dart'; import 'data/day_flow_list.dart'; import 'data/goods_type_sales_list.dart'; import 'data/order_user_detail.dart'; +import 'data/phone_query_member_info.dart'; import 'data/popular_sales_list.dart'; import 'data/product_group_list.dart'; import 'data/recharge_flow_list.dart'; @@ -34,6 +39,7 @@ import 'data/ticket_show.dart'; import 'data/ticket_stats_list.dart'; import 'data/trade_summary_list.dart'; import 'data/upload_result.dart'; +import 'data/user_info_edit.dart'; part 'business_api.g.dart'; @@ -244,7 +250,7 @@ abstract class BusinessApiService { @Path("pageIndex") String pageIndex, @Path("pageSize") String pageSize); - ///删除分组分类 + ///编辑门店信息 @PUT("store") Future saveStoreInfo(@Body() Map param); @@ -306,4 +312,45 @@ abstract class BusinessApiService { ///订单列表获取用户金额详情 @GET("order/getOrderUserDetail?orderId={orderId}") Future> getOrderUserDetail(@Path("orderId") String storeId); + + ///根据手机号查询会员信息 + @POST("member/queryMemberInfo") + Future> queryMemberInfo(@Body() Map param); + + ///会员充值列表 + @POST("rechargePreferential/get") + Future> getRechargePreferential(@Body() Map param); + + ///会员充值支付 + @POST("member/posMemberRecharge") + Future posMemberRecharge(@Body() Map param); + + ///充值订单查询 + @POST("member/manualQuery") + Future manualQuery(@Body() Map param); + + ///新增会员 + @GET("member/createMemberSourceByMobile?mobile={mobile}&nickName={nickName}") + Future> createMemberSourceByMobile(@Path("mobile") String mobile,@Path("nickName") String nickName); + + ///店员列表 + @POST("user/userPage") + Future> clerkList(@Body() Map param); + + ///添加新店员,店员信息编辑 + @POST("user") + Future> userEdit(@Body() Map param); + + ///删除会员 + @DELETE("user?ids[]={ids}") + Future delUser(@Path("ids") String ids); + + ///修改用户信息 + @PUT("user") + Future> userModify(@Body() Map param); + + ///会员余额统计/消费排名 + @POST("dashBoard/storeMoney") + Future> storeMoney(@Body() Map param); + } diff --git a/lib/retrofit/business_api.g.dart b/lib/retrofit/business_api.g.dart index c4f22f15..124e27a4 100644 --- a/lib/retrofit/business_api.g.dart +++ b/lib/retrofit/business_api.g.dart @@ -851,4 +851,229 @@ class _BusinessApiService implements BusinessApiService { return value; } + @override + Future> queryMemberInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'member/queryMemberInfo', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : PhoneQueryMemberInfo.fromJson(json), + ); + return value; + } + + @override + Future> getRechargePreferential(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'rechargePreferential/get', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : BusRechargeList.fromJson(json), + ); + return value; + } + + @override + Future posMemberRecharge(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _result = await _dio.request>( + 'member/posMemberRecharge', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: param); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : json, + ); + return value; + } + + @override + Future manualQuery(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _result = await _dio.request>( + 'member/manualQuery', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: param); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : json, + ); + return value; + } + + @override + Future> createMemberSourceByMobile(mobile,nickName) async { + ArgumentError.checkNotNull(mobile, 'mobile'); + ArgumentError.checkNotNull(nickName, 'nickName'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'member/createMemberSourceByMobile?mobile=$mobile&nickName=$nickName', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : AddVipInfo.fromJson(json), + ); + return value; + } + + @override + Future> clerkList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'user/userPage', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : ClerkManageList.fromJson(json), + ); + return value; + } + + @override + Future> userEdit(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'user', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : UserInfoEdit.fromJson(json), + ); + return value; + } + + @override + Future> delUser(ids) async { + ArgumentError.checkNotNull(ids, 'ids'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'user?ids[]=$ids', + queryParameters: queryParameters, + options: RequestOptions( + method: 'DELETE', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> userModify(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'user', + queryParameters: queryParameters, + options: RequestOptions( + method: 'PUT', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : UserInfoEdit.fromJson(json), + ); + return value; + } + + @override + Future> storeMoney(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'dashBoard/storeMoney', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : BalanceConsumptionRankingList.fromJson(json), + ); + return value; + } + } diff --git a/lib/retrofit/data/add_vip_info.dart b/lib/retrofit/data/add_vip_info.dart new file mode 100644 index 00000000..c0f48683 --- /dev/null +++ b/lib/retrofit/data/add_vip_info.dart @@ -0,0 +1,303 @@ +/// id : "1737361620364951552" +/// createTime : "2023-12-20 14:37:43" +/// createUser : "1640233401329909760" +/// updateTime : "2023-12-20 14:37:43" +/// updateUser : "1640233401329909760" +/// mid : "1737361616430694400" +/// masterId : null +/// openid : "" +/// aliOpenid : null +/// douyinOpenid : null +/// nickname : null +/// headimg : null +/// rankId : null +/// rankExpireTime : null +/// balance : null +/// realRecharge : null +/// sex : null +/// status : null +/// onCredit : null +/// loginTime : "2023-12-20 14:37:43" +/// loginNum : null +/// tenantCode : null +/// source : null +/// expendAmount : null +/// buyTimes : null +/// lastBuyTime : null +/// vip_no : "001119613052919191" +/// expireTime : "2033-12-20 14:37:43" +/// integral : null +/// level : null +/// vipRegStore : null +/// certification : null + +class AddVipInfo { + AddVipInfo({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String mid, + dynamic masterId, + String openid, + dynamic aliOpenid, + dynamic douyinOpenid, + dynamic nickname, + dynamic headimg, + dynamic rankId, + dynamic rankExpireTime, + dynamic balance, + dynamic realRecharge, + dynamic sex, + dynamic status, + dynamic onCredit, + String loginTime, + dynamic loginNum, + dynamic tenantCode, + dynamic source, + dynamic expendAmount, + dynamic buyTimes, + dynamic lastBuyTime, + String vipNo, + String expireTime, + dynamic integral, + dynamic level, + dynamic vipRegStore, + dynamic certification,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _mid = mid; + _masterId = masterId; + _openid = openid; + _aliOpenid = aliOpenid; + _douyinOpenid = douyinOpenid; + _nickname = nickname; + _headimg = headimg; + _rankId = rankId; + _rankExpireTime = rankExpireTime; + _balance = balance; + _realRecharge = realRecharge; + _sex = sex; + _status = status; + _onCredit = onCredit; + _loginTime = loginTime; + _loginNum = loginNum; + _tenantCode = tenantCode; + _source = source; + _expendAmount = expendAmount; + _buyTimes = buyTimes; + _lastBuyTime = lastBuyTime; + _vipNo = vipNo; + _expireTime = expireTime; + _integral = integral; + _level = level; + _vipRegStore = vipRegStore; + _certification = certification; +} + + AddVipInfo.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _mid = json['mid']; + _masterId = json['masterId']; + _openid = json['openid']; + _aliOpenid = json['aliOpenid']; + _douyinOpenid = json['douyinOpenid']; + _nickname = json['nickname']; + _headimg = json['headimg']; + _rankId = json['rankId']; + _rankExpireTime = json['rankExpireTime']; + _balance = json['balance']; + _realRecharge = json['realRecharge']; + _sex = json['sex']; + _status = json['status']; + _onCredit = json['onCredit']; + _loginTime = json['loginTime']; + _loginNum = json['loginNum']; + _tenantCode = json['tenantCode']; + _source = json['source']; + _expendAmount = json['expendAmount']; + _buyTimes = json['buyTimes']; + _lastBuyTime = json['lastBuyTime']; + _vipNo = json['vip_no']; + _expireTime = json['expireTime']; + _integral = json['integral']; + _level = json['level']; + _vipRegStore = json['vipRegStore']; + _certification = json['certification']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _mid; + dynamic _masterId; + String _openid; + dynamic _aliOpenid; + dynamic _douyinOpenid; + dynamic _nickname; + dynamic _headimg; + dynamic _rankId; + dynamic _rankExpireTime; + dynamic _balance; + dynamic _realRecharge; + dynamic _sex; + dynamic _status; + dynamic _onCredit; + String _loginTime; + dynamic _loginNum; + dynamic _tenantCode; + dynamic _source; + dynamic _expendAmount; + dynamic _buyTimes; + dynamic _lastBuyTime; + String _vipNo; + String _expireTime; + dynamic _integral; + dynamic _level; + dynamic _vipRegStore; + dynamic _certification; +AddVipInfo copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String mid, + dynamic masterId, + String openid, + dynamic aliOpenid, + dynamic douyinOpenid, + dynamic nickname, + dynamic headimg, + dynamic rankId, + dynamic rankExpireTime, + dynamic balance, + dynamic realRecharge, + dynamic sex, + dynamic status, + dynamic onCredit, + String loginTime, + dynamic loginNum, + dynamic tenantCode, + dynamic source, + dynamic expendAmount, + dynamic buyTimes, + dynamic lastBuyTime, + String vipNo, + String expireTime, + dynamic integral, + dynamic level, + dynamic vipRegStore, + dynamic certification, +}) => AddVipInfo( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + mid: mid ?? _mid, + masterId: masterId ?? _masterId, + openid: openid ?? _openid, + aliOpenid: aliOpenid ?? _aliOpenid, + douyinOpenid: douyinOpenid ?? _douyinOpenid, + nickname: nickname ?? _nickname, + headimg: headimg ?? _headimg, + rankId: rankId ?? _rankId, + rankExpireTime: rankExpireTime ?? _rankExpireTime, + balance: balance ?? _balance, + realRecharge: realRecharge ?? _realRecharge, + sex: sex ?? _sex, + status: status ?? _status, + onCredit: onCredit ?? _onCredit, + loginTime: loginTime ?? _loginTime, + loginNum: loginNum ?? _loginNum, + tenantCode: tenantCode ?? _tenantCode, + source: source ?? _source, + expendAmount: expendAmount ?? _expendAmount, + buyTimes: buyTimes ?? _buyTimes, + lastBuyTime: lastBuyTime ?? _lastBuyTime, + vipNo: vipNo ?? _vipNo, + expireTime: expireTime ?? _expireTime, + integral: integral ?? _integral, + level: level ?? _level, + vipRegStore: vipRegStore ?? _vipRegStore, + certification: certification ?? _certification, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get mid => _mid; + dynamic get masterId => _masterId; + String get openid => _openid; + dynamic get aliOpenid => _aliOpenid; + dynamic get douyinOpenid => _douyinOpenid; + dynamic get nickname => _nickname; + dynamic get headimg => _headimg; + dynamic get rankId => _rankId; + dynamic get rankExpireTime => _rankExpireTime; + dynamic get balance => _balance; + dynamic get realRecharge => _realRecharge; + dynamic get sex => _sex; + dynamic get status => _status; + dynamic get onCredit => _onCredit; + String get loginTime => _loginTime; + dynamic get loginNum => _loginNum; + dynamic get tenantCode => _tenantCode; + dynamic get source => _source; + dynamic get expendAmount => _expendAmount; + dynamic get buyTimes => _buyTimes; + dynamic get lastBuyTime => _lastBuyTime; + String get vipNo => _vipNo; + String get expireTime => _expireTime; + dynamic get integral => _integral; + dynamic get level => _level; + dynamic get vipRegStore => _vipRegStore; + dynamic get certification => _certification; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['mid'] = _mid; + map['masterId'] = _masterId; + map['openid'] = _openid; + map['aliOpenid'] = _aliOpenid; + map['douyinOpenid'] = _douyinOpenid; + map['nickname'] = _nickname; + map['headimg'] = _headimg; + map['rankId'] = _rankId; + map['rankExpireTime'] = _rankExpireTime; + map['balance'] = _balance; + map['realRecharge'] = _realRecharge; + map['sex'] = _sex; + map['status'] = _status; + map['onCredit'] = _onCredit; + map['loginTime'] = _loginTime; + map['loginNum'] = _loginNum; + map['tenantCode'] = _tenantCode; + map['source'] = _source; + map['expendAmount'] = _expendAmount; + map['buyTimes'] = _buyTimes; + map['lastBuyTime'] = _lastBuyTime; + map['vip_no'] = _vipNo; + map['expireTime'] = _expireTime; + map['integral'] = _integral; + map['level'] = _level; + map['vipRegStore'] = _vipRegStore; + map['certification'] = _certification; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/balance_consumption_ranking_list.dart b/lib/retrofit/data/balance_consumption_ranking_list.dart new file mode 100644 index 00000000..4fed435e --- /dev/null +++ b/lib/retrofit/data/balance_consumption_ranking_list.dart @@ -0,0 +1,187 @@ +/// records : [{"id":"1706504181134655488","name":"","phone":"13052919193","money":"4000.40"},{"id":"1699803728942465024","name":"","phone":"18638550294","money":"1502.00"},{"id":"1699032834800353280","name":"","phone":"13339999709","money":"1387.00"},{"id":"1700069353317203968","name":"","phone":"18530077112","money":"1185.00"},{"id":"1723679701001568256","name":"","phone":"13253333210","money":"1000.00"},{"id":"1700896910958657536","name":"","phone":"15093345036","money":"800.00"},{"id":"1695700464139501568","name":"","phone":"15838033785","money":"780.00"},{"id":"1697426943734972416","name":"昵称","phone":"15827991714","money":"710.11"},{"id":"1692483888078651392","name":"","phone":"15538288982","money":"647.60"},{"id":"1698868848263954432","name":"","phone":"13073719376","money":"628.10"}] +/// total : "1970" +/// size : "10" +/// current : "1" +/// orders : [{"column":"id","asc":false}] +/// hitCount : false +/// searchCount : true +/// pages : "197" + +class BalanceConsumptionRankingList { + BalanceConsumptionRankingList({ + 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; +} + + BalanceConsumptionRankingList.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; +BalanceConsumptionRankingList copyWith({ List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages, +}) => BalanceConsumptionRankingList( 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 : "1706504181134655488" +/// name : "" +/// phone : "13052919193" +/// money : "4000.40" + +class Records { + Records({ + String id, + String name, + String phone, + String money,}){ + _id = id; + _name = name; + _phone = phone; + _money = money; +} + + Records.fromJson(dynamic json) { + _id = json['id']; + _name = json['name']; + _phone = json['phone']; + _money = json['money']; + } + String _id; + String _name; + String _phone; + String _money; +Records copyWith({ String id, + String name, + String phone, + String money, +}) => Records( id: id ?? _id, + name: name ?? _name, + phone: phone ?? _phone, + money: money ?? _money, +); + String get id => _id; + String get name => _name; + String get phone => _phone; + String get money => _money; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['name'] = _name; + map['phone'] = _phone; + map['money'] = _money; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/bus_recharge_list.dart b/lib/retrofit/data/bus_recharge_list.dart new file mode 100644 index 00000000..47bb7ae4 --- /dev/null +++ b/lib/retrofit/data/bus_recharge_list.dart @@ -0,0 +1,304 @@ +/// records : [{"id":"1693482520970002431","rechargeMoney":"50.00","giftdMoney":"20.00","limitNum":0,"gitfdCouponId":null,"startDate":null,"endDate":null,"startTime":null,"endTime":null,"tenantCode":"1195","createTime":"2023-10-25 17:18:40","isDeleted":0,"rechargeType":0,"remark":"充值50.00 赠送20.00","sortValue":0,"useNum":0,"mid":null}] +/// total : "0" +/// size : "999" +/// current : "1" +/// orders : [{"column":"id","asc":false}] +/// hitCount : false +/// searchCount : true +/// pages : "0" + +class BusRechargeList { + BusRechargeList({ + 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; +} + + BusRechargeList.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; +BusRechargeList copyWith({ List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages, +}) => BusRechargeList( 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 : "1693482520970002431" +/// rechargeMoney : "50.00" +/// giftdMoney : "20.00" +/// limitNum : 0 +/// gitfdCouponId : null +/// startDate : null +/// endDate : null +/// startTime : null +/// endTime : null +/// tenantCode : "1195" +/// createTime : "2023-10-25 17:18:40" +/// isDeleted : 0 +/// rechargeType : 0 +/// remark : "充值50.00 赠送20.00" +/// sortValue : 0 +/// useNum : 0 +/// mid : null + +class Records { + Records({ + String id, + String rechargeMoney, + String giftdMoney, + num limitNum, + dynamic gitfdCouponId, + dynamic startDate, + dynamic endDate, + dynamic startTime, + dynamic endTime, + String tenantCode, + String createTime, + num isDeleted, + num rechargeType, + String remark, + num sortValue, + num useNum, + dynamic mid,}){ + _id = id; + _rechargeMoney = rechargeMoney; + _giftdMoney = giftdMoney; + _limitNum = limitNum; + _gitfdCouponId = gitfdCouponId; + _startDate = startDate; + _endDate = endDate; + _startTime = startTime; + _endTime = endTime; + _tenantCode = tenantCode; + _createTime = createTime; + _isDeleted = isDeleted; + _rechargeType = rechargeType; + _remark = remark; + _sortValue = sortValue; + _useNum = useNum; + _mid = mid; +} + + Records.fromJson(dynamic json) { + _id = json['id']; + _rechargeMoney = json['rechargeMoney']; + _giftdMoney = json['giftdMoney']; + _limitNum = json['limitNum']; + _gitfdCouponId = json['gitfdCouponId']; + _startDate = json['startDate']; + _endDate = json['endDate']; + _startTime = json['startTime']; + _endTime = json['endTime']; + _tenantCode = json['tenantCode']; + _createTime = json['createTime']; + _isDeleted = json['isDeleted']; + _rechargeType = json['rechargeType']; + _remark = json['remark']; + _sortValue = json['sortValue']; + _useNum = json['useNum']; + _mid = json['mid']; + } + String _id; + String _rechargeMoney; + String _giftdMoney; + num _limitNum; + dynamic _gitfdCouponId; + dynamic _startDate; + dynamic _endDate; + dynamic _startTime; + dynamic _endTime; + String _tenantCode; + String _createTime; + num _isDeleted; + num _rechargeType; + String _remark; + num _sortValue; + num _useNum; + dynamic _mid; +Records copyWith({ String id, + String rechargeMoney, + String giftdMoney, + num limitNum, + dynamic gitfdCouponId, + dynamic startDate, + dynamic endDate, + dynamic startTime, + dynamic endTime, + String tenantCode, + String createTime, + num isDeleted, + num rechargeType, + String remark, + num sortValue, + num useNum, + dynamic mid, +}) => Records( id: id ?? _id, + rechargeMoney: rechargeMoney ?? _rechargeMoney, + giftdMoney: giftdMoney ?? _giftdMoney, + limitNum: limitNum ?? _limitNum, + gitfdCouponId: gitfdCouponId ?? _gitfdCouponId, + startDate: startDate ?? _startDate, + endDate: endDate ?? _endDate, + startTime: startTime ?? _startTime, + endTime: endTime ?? _endTime, + tenantCode: tenantCode ?? _tenantCode, + createTime: createTime ?? _createTime, + isDeleted: isDeleted ?? _isDeleted, + rechargeType: rechargeType ?? _rechargeType, + remark: remark ?? _remark, + sortValue: sortValue ?? _sortValue, + useNum: useNum ?? _useNum, + mid: mid ?? _mid, +); + String get id => _id; + String get rechargeMoney => _rechargeMoney; + String get giftdMoney => _giftdMoney; + num get limitNum => _limitNum; + dynamic get gitfdCouponId => _gitfdCouponId; + dynamic get startDate => _startDate; + dynamic get endDate => _endDate; + dynamic get startTime => _startTime; + dynamic get endTime => _endTime; + String get tenantCode => _tenantCode; + String get createTime => _createTime; + num get isDeleted => _isDeleted; + num get rechargeType => _rechargeType; + String get remark => _remark; + num get sortValue => _sortValue; + num get useNum => _useNum; + dynamic get mid => _mid; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['rechargeMoney'] = _rechargeMoney; + map['giftdMoney'] = _giftdMoney; + map['limitNum'] = _limitNum; + map['gitfdCouponId'] = _gitfdCouponId; + map['startDate'] = _startDate; + map['endDate'] = _endDate; + map['startTime'] = _startTime; + map['endTime'] = _endTime; + map['tenantCode'] = _tenantCode; + map['createTime'] = _createTime; + map['isDeleted'] = _isDeleted; + map['rechargeType'] = _rechargeType; + map['remark'] = _remark; + map['sortValue'] = _sortValue; + map['useNum'] = _useNum; + map['mid'] = _mid; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/clerk_manage_list.dart b/lib/retrofit/data/clerk_manage_list.dart new file mode 100644 index 00000000..ddbf2a5c --- /dev/null +++ b/lib/retrofit/data/clerk_manage_list.dart @@ -0,0 +1,511 @@ +/// records : [{"id":"1718209460100399104","createTime":"2023-10-28 18:13:53","createUser":"0","updateTime":"2023-10-28 18:13:53","updateUser":"0","account":"王松涛","name":"王松涛","org":null,"station":null,"type":0,"email":"","mobile":"18738828830","sex":{"desc":"未知","code":"N"},"status":false,"avatar":"https://wework.qpic.cn/wwpic/66165_d3QhlRvnTKGAo6s_1698281591/0","nation":{"key":null,"data":""},"education":{"key":null,"data":""},"positionStatus":{"key":null,"data":""},"workDescribe":"","passwordErrorLastTime":null,"passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":null},{"id":"1716755848744665088","createTime":"2023-10-24 17:57:45","createUser":"0","updateTime":"2023-10-24 17:57:45","updateUser":"0","account":"李晟垒","name":"李晟垒","org":null,"station":null,"type":0,"email":"","mobile":"17629876603","sex":{"desc":"未知","code":"N"},"status":false,"avatar":"https://wework.qpic.cn/wwpic/249437_3fqtwXiGSuKq7ld_1697021007/0","nation":{"key":null,"data":""},"education":{"key":null,"data":""},"positionStatus":{"key":null,"data":""},"workDescribe":"","passwordErrorLastTime":null,"passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":null},{"id":"1716755840049872896","createTime":"2023-10-24 17:57:43","createUser":"0","updateTime":"2023-10-24 17:57:43","updateUser":"0","account":"高凤丽","name":"高凤丽","org":null,"station":null,"type":0,"email":"","mobile":"17698645321","sex":{"desc":"未知","code":"N"},"status":false,"avatar":"https://wework.qpic.cn/wwpic/879260_Hq64nFhRQu-oyYO_1693879864/0","nation":{"key":null,"data":""},"education":{"key":null,"data":""},"positionStatus":{"key":null,"data":""},"workDescribe":"","passwordErrorLastTime":null,"passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":null},{"id":"1712817865955999744","createTime":"2023-10-13 21:09:37","createUser":"0","updateTime":"2023-10-13 21:09:37","updateUser":"0","account":"马增凯","name":"马增凯","org":null,"station":null,"type":0,"email":"","mobile":"18539252112","sex":{"desc":"未知","code":"N"},"status":false,"avatar":"https://wework.qpic.cn/wwpic/26498_W5VMMKB8Ss-E9y-_1697005237/0","nation":{"key":null,"data":""},"education":{"key":null,"data":""},"positionStatus":{"key":null,"data":""},"workDescribe":"","passwordErrorLastTime":null,"passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":null},{"id":"1700087952224288768","createTime":"2023-09-08 18:05:29","createUser":"1684404021814624256","updateTime":"2023-09-08 18:05:29","updateUser":"1684404021814624256","account":"美食街运营","name":"美食街运营","org":null,"station":null,"type":0,"email":"","mobile":"","sex":{"desc":"未知","code":"N"},"status":true,"avatar":"","nation":{"key":"","data":""},"education":{"key":"","data":""},"positionStatus":{"key":"","data":""},"workDescribe":"","passwordErrorLastTime":"2023-10-08 10:15:03","passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":"2023-10-08 10:15:03"},{"id":"1694559126463447040","createTime":"2023-08-24 11:55:54","createUser":"0","updateTime":"2023-08-24 11:55:54","updateUser":"0","account":"金威","name":"金威","org":null,"station":null,"type":0,"email":"","mobile":"15871028672","sex":{"desc":"未知","code":"N"},"status":false,"avatar":"https://wework.qpic.cn/wwpic/670541_3pcB-e15RfK-v8S_1666828735/0","nation":{"key":null,"data":""},"education":{"key":null,"data":""},"positionStatus":{"key":null,"data":""},"workDescribe":"","passwordErrorLastTime":null,"passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":null},{"id":"1693150526188814336","createTime":"2023-08-20 14:38:37","createUser":"0","updateTime":"2023-08-20 14:38:37","updateUser":"0","account":"赵铭","name":"赵铭","org":null,"station":null,"type":0,"email":"","mobile":"15238461762","sex":{"desc":"未知","code":"N"},"status":false,"avatar":"https://wework.qpic.cn/wwpic/139874_aavX133wRmuEdfb_1681271010/0","nation":{"key":null,"data":""},"education":{"key":null,"data":""},"positionStatus":{"key":null,"data":""},"workDescribe":"","passwordErrorLastTime":null,"passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":null},{"id":"1692815660305874944","createTime":"2023-08-19 16:27:59","createUser":"0","updateTime":"2023-08-19 16:27:59","updateUser":"0","account":"张培林","name":"张培林","org":null,"station":null,"type":0,"email":"","mobile":"17734788755","sex":{"desc":"未知","code":"N"},"status":false,"avatar":"https://wework.qpic.cn/wwpic/159908_v3PahHp4ToiDy3w_1692188937/0","nation":{"key":null,"data":""},"education":{"key":null,"data":""},"positionStatus":{"key":null,"data":""},"workDescribe":"","passwordErrorLastTime":null,"passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":null},{"id":"1692772387621175296","createTime":"2023-08-19 13:36:02","createUser":"0","updateTime":"2023-08-19 13:36:02","updateUser":"0","account":"黄婷","name":"黄婷","org":null,"station":null,"type":0,"email":"","mobile":"15623342902","sex":{"desc":"未知","code":"N"},"status":false,"avatar":"https://wework.qpic.cn/wwpic/289190_R216gvd3Qw2lLwV_1684395430/0","nation":{"key":null,"data":""},"education":{"key":null,"data":""},"positionStatus":{"key":null,"data":""},"workDescribe":"","passwordErrorLastTime":null,"passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":null},{"id":"1692710101808316416","createTime":"2023-08-19 09:28:32","createUser":"0","updateTime":"2023-08-19 09:28:48","updateUser":"1684404021814624256","account":"胡灿","name":"胡灿","org":null,"station":null,"type":0,"email":"","mobile":"15921879317","sex":{"desc":"未知","code":"N"},"status":true,"avatar":"https://wework.qpic.cn/bizmail/BW6FKlOvPUwibCldA3qzZWwzeZyBXjNuhF4CqibDByr4AwqFafL6eNmg/0","nation":{"key":null,"data":""},"education":{"key":null,"data":""},"positionStatus":{"key":null,"data":""},"workDescribe":"","passwordErrorLastTime":"2023-11-22 09:17:42","passwordErrorNum":0,"passwordExpireTime":null,"password":"e10adc3949ba59abbe56e057f20f883e","lastLoginTime":"2023-11-22 09:17:42"}] +/// total : "26" +/// size : "10" +/// current : "1" +/// orders : [{"column":"id","asc":false}] +/// hitCount : false +/// searchCount : true +/// pages : "3" + +class ClerkManageList { + ClerkManageList({ + 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; +} + + ClerkManageList.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; +ClerkManageList copyWith({ List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages, +}) => ClerkManageList( 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 : "1718209460100399104" +/// createTime : "2023-10-28 18:13:53" +/// createUser : "0" +/// updateTime : "2023-10-28 18:13:53" +/// updateUser : "0" +/// account : "王松涛" +/// name : "王松涛" +/// org : null +/// station : null +/// type : 0 +/// email : "" +/// mobile : "18738828830" +/// sex : {"desc":"未知","code":"N"} +/// status : false +/// avatar : "https://wework.qpic.cn/wwpic/66165_d3QhlRvnTKGAo6s_1698281591/0" +/// nation : {"key":null,"data":""} +/// education : {"key":null,"data":""} +/// positionStatus : {"key":null,"data":""} +/// workDescribe : "" +/// passwordErrorLastTime : null +/// passwordErrorNum : 0 +/// passwordExpireTime : null +/// password : "e10adc3949ba59abbe56e057f20f883e" +/// lastLoginTime : null + +class Records { + Records({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String account, + String name, + dynamic org, + dynamic station, + num type, + String email, + String mobile, + Sex sex, + bool status, + String avatar, + Nation nation, + Education education, + PositionStatus positionStatus, + String workDescribe, + dynamic passwordErrorLastTime, + num passwordErrorNum, + dynamic passwordExpireTime, + String password, + dynamic lastLoginTime,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _account = account; + _name = name; + _org = org; + _station = station; + _type = type; + _email = email; + _mobile = mobile; + _sex = sex; + _status = status; + _avatar = avatar; + _nation = nation; + _education = education; + _positionStatus = positionStatus; + _workDescribe = workDescribe; + _passwordErrorLastTime = passwordErrorLastTime; + _passwordErrorNum = passwordErrorNum; + _passwordExpireTime = passwordExpireTime; + _password = password; + _lastLoginTime = lastLoginTime; +} + + Records.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _account = json['account']; + _name = json['name']; + _org = json['org']; + _station = json['station']; + _type = json['type']; + _email = json['email']; + _mobile = json['mobile']; + _sex = json['sex'] != null ? Sex.fromJson(json['sex']) : null; + _status = json['status']; + _avatar = json['avatar']; + _nation = json['nation'] != null ? Nation.fromJson(json['nation']) : null; + _education = json['education'] != null ? Education.fromJson(json['education']) : null; + _positionStatus = json['positionStatus'] != null ? PositionStatus.fromJson(json['positionStatus']) : null; + _workDescribe = json['workDescribe']; + _passwordErrorLastTime = json['passwordErrorLastTime']; + _passwordErrorNum = json['passwordErrorNum']; + _passwordExpireTime = json['passwordExpireTime']; + _password = json['password']; + _lastLoginTime = json['lastLoginTime']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _account; + String _name; + dynamic _org; + dynamic _station; + num _type; + String _email; + String _mobile; + Sex _sex; + bool _status; + String _avatar; + Nation _nation; + Education _education; + PositionStatus _positionStatus; + String _workDescribe; + dynamic _passwordErrorLastTime; + num _passwordErrorNum; + dynamic _passwordExpireTime; + String _password; + dynamic _lastLoginTime; +Records copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String account, + String name, + dynamic org, + dynamic station, + num type, + String email, + String mobile, + Sex sex, + bool status, + String avatar, + Nation nation, + Education education, + PositionStatus positionStatus, + String workDescribe, + dynamic passwordErrorLastTime, + num passwordErrorNum, + dynamic passwordExpireTime, + String password, + dynamic lastLoginTime, +}) => Records( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + account: account ?? _account, + name: name ?? _name, + org: org ?? _org, + station: station ?? _station, + type: type ?? _type, + email: email ?? _email, + mobile: mobile ?? _mobile, + sex: sex ?? _sex, + status: status ?? _status, + avatar: avatar ?? _avatar, + nation: nation ?? _nation, + education: education ?? _education, + positionStatus: positionStatus ?? _positionStatus, + workDescribe: workDescribe ?? _workDescribe, + passwordErrorLastTime: passwordErrorLastTime ?? _passwordErrorLastTime, + passwordErrorNum: passwordErrorNum ?? _passwordErrorNum, + passwordExpireTime: passwordExpireTime ?? _passwordExpireTime, + password: password ?? _password, + lastLoginTime: lastLoginTime ?? _lastLoginTime, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get account => _account; + String get name => _name; + dynamic get org => _org; + dynamic get station => _station; + num get type => _type; + String get email => _email; + String get mobile => _mobile; + Sex get sex => _sex; + bool get status => _status; + String get avatar => _avatar; + Nation get nation => _nation; + Education get education => _education; + PositionStatus get positionStatus => _positionStatus; + String get workDescribe => _workDescribe; + dynamic get passwordErrorLastTime => _passwordErrorLastTime; + num get passwordErrorNum => _passwordErrorNum; + dynamic get passwordExpireTime => _passwordExpireTime; + String get password => _password; + dynamic get lastLoginTime => _lastLoginTime; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['account'] = _account; + map['name'] = _name; + map['org'] = _org; + map['station'] = _station; + map['type'] = _type; + map['email'] = _email; + map['mobile'] = _mobile; + if (_sex != null) { + map['sex'] = _sex.toJson(); + } + map['status'] = _status; + map['avatar'] = _avatar; + if (_nation != null) { + map['nation'] = _nation.toJson(); + } + if (_education != null) { + map['education'] = _education.toJson(); + } + if (_positionStatus != null) { + map['positionStatus'] = _positionStatus.toJson(); + } + map['workDescribe'] = _workDescribe; + map['passwordErrorLastTime'] = _passwordErrorLastTime; + map['passwordErrorNum'] = _passwordErrorNum; + map['passwordExpireTime'] = _passwordExpireTime; + map['password'] = _password; + map['lastLoginTime'] = _lastLoginTime; + return map; + } + +} + +/// key : null +/// data : "" + +class PositionStatus { + PositionStatus({ + dynamic key, + String data,}){ + _key = key; + _data = data; +} + + PositionStatus.fromJson(dynamic json) { + _key = json['key']; + _data = json['data']; + } + dynamic _key; + String _data; +PositionStatus copyWith({ dynamic key, + String data, +}) => PositionStatus( key: key ?? _key, + data: data ?? _data, +); + dynamic get key => _key; + String get data => _data; + + Map toJson() { + final map = {}; + map['key'] = _key; + map['data'] = _data; + return map; + } + +} + +/// key : null +/// data : "" + +class Education { + Education({ + dynamic key, + String data,}){ + _key = key; + _data = data; +} + + Education.fromJson(dynamic json) { + _key = json['key']; + _data = json['data']; + } + dynamic _key; + String _data; +Education copyWith({ dynamic key, + String data, +}) => Education( key: key ?? _key, + data: data ?? _data, +); + dynamic get key => _key; + String get data => _data; + + Map toJson() { + final map = {}; + map['key'] = _key; + map['data'] = _data; + return map; + } + +} + +/// key : null +/// data : "" + +class Nation { + Nation({ + dynamic key, + String data,}){ + _key = key; + _data = data; +} + + Nation.fromJson(dynamic json) { + _key = json['key']; + _data = json['data']; + } + dynamic _key; + String _data; +Nation copyWith({ dynamic key, + String data, +}) => Nation( key: key ?? _key, + data: data ?? _data, +); + dynamic get key => _key; + String get data => _data; + + Map toJson() { + final map = {}; + map['key'] = _key; + map['data'] = _data; + return map; + } + +} + +/// desc : "未知" +/// code : "N" + +class Sex { + Sex({ + String desc, + String code,}){ + _desc = desc; + _code = code; +} + + Sex.fromJson(dynamic json) { + _desc = json['desc']; + _code = json['code']; + } + String _desc; + String _code; +Sex copyWith({ String desc, + String code, +}) => Sex( 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; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/phone_query_member_info.dart b/lib/retrofit/data/phone_query_member_info.dart new file mode 100644 index 00000000..33e57cec --- /dev/null +++ b/lib/retrofit/data/phone_query_member_info.dart @@ -0,0 +1,132 @@ +/// mid : "1379254113602109440" +/// sid : "1706504181134655488" +/// phoneNum : "13052919193" +/// nickName : "" +/// headimg : "" +/// sex : "0" +/// balance : "0.00" +/// memberSourceCredit : false +/// money : "1.49" +/// memberCredit : false +/// greenMoney : "0.00" +/// raiseMoney : "0.00" +/// payPassword : "222222" + +class PhoneQueryMemberInfo { + PhoneQueryMemberInfo({ + String mid, + String sid, + String phoneNum, + String nickName, + String headimg, + String sex, + String balance, + bool memberSourceCredit, + String money, + bool memberCredit, + String greenMoney, + String raiseMoney, + String payPassword,}){ + _mid = mid; + _sid = sid; + _phoneNum = phoneNum; + _nickName = nickName; + _headimg = headimg; + _sex = sex; + _balance = balance; + _memberSourceCredit = memberSourceCredit; + _money = money; + _memberCredit = memberCredit; + _greenMoney = greenMoney; + _raiseMoney = raiseMoney; + _payPassword = payPassword; +} + + PhoneQueryMemberInfo.fromJson(dynamic json) { + _mid = json['mid']; + _sid = json['sid']; + _phoneNum = json['phoneNum']; + _nickName = json['nickName']; + _headimg = json['headimg']; + _sex = json['sex']; + _balance = json['balance']; + _memberSourceCredit = json['memberSourceCredit']; + _money = json['money']; + _memberCredit = json['memberCredit']; + _greenMoney = json['greenMoney']; + _raiseMoney = json['raiseMoney']; + _payPassword = json['payPassword']; + } + String _mid; + String _sid; + String _phoneNum; + String _nickName; + String _headimg; + String _sex; + String _balance; + bool _memberSourceCredit; + String _money; + bool _memberCredit; + String _greenMoney; + String _raiseMoney; + String _payPassword; +PhoneQueryMemberInfo copyWith({ String mid, + String sid, + String phoneNum, + String nickName, + String headimg, + String sex, + String balance, + bool memberSourceCredit, + String money, + bool memberCredit, + String greenMoney, + String raiseMoney, + String payPassword, +}) => PhoneQueryMemberInfo( mid: mid ?? _mid, + sid: sid ?? _sid, + phoneNum: phoneNum ?? _phoneNum, + nickName: nickName ?? _nickName, + headimg: headimg ?? _headimg, + sex: sex ?? _sex, + balance: balance ?? _balance, + memberSourceCredit: memberSourceCredit ?? _memberSourceCredit, + money: money ?? _money, + memberCredit: memberCredit ?? _memberCredit, + greenMoney: greenMoney ?? _greenMoney, + raiseMoney: raiseMoney ?? _raiseMoney, + payPassword: payPassword ?? _payPassword, +); + String get mid => _mid; + String get sid => _sid; + String get phoneNum => _phoneNum; + String get nickName => _nickName; + String get headimg => _headimg; + String get sex => _sex; + String get balance => _balance; + bool get memberSourceCredit => _memberSourceCredit; + String get money => _money; + bool get memberCredit => _memberCredit; + String get greenMoney => _greenMoney; + String get raiseMoney => _raiseMoney; + String get payPassword => _payPassword; + + Map toJson() { + final map = {}; + map['mid'] = _mid; + map['sid'] = _sid; + map['phoneNum'] = _phoneNum; + map['nickName'] = _nickName; + map['headimg'] = _headimg; + map['sex'] = _sex; + map['balance'] = _balance; + map['memberSourceCredit'] = _memberSourceCredit; + map['money'] = _money; + map['memberCredit'] = _memberCredit; + map['greenMoney'] = _greenMoney; + map['raiseMoney'] = _raiseMoney; + map['payPassword'] = _payPassword; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/user_info_edit.dart b/lib/retrofit/data/user_info_edit.dart new file mode 100644 index 00000000..82899a5f --- /dev/null +++ b/lib/retrofit/data/user_info_edit.dart @@ -0,0 +1,267 @@ +/// id : "1738082396969893888" +/// createTime : "2023-12-22 14:21:50" +/// createUser : "1640233401329909760" +/// updateTime : "2023-12-22 14:21:50" +/// updateUser : "1640233401329909760" +/// account : "13052919193" +/// name : "wu" +/// org : null +/// station : null +/// type : null +/// email : null +/// mobile : null +/// sex : {"desc":"未知","code":"N"} +/// status : null +/// avatar : null +/// nation : null +/// education : null +/// positionStatus : null +/// workDescribe : null +/// passwordErrorLastTime : null +/// passwordErrorNum : 0 +/// passwordExpireTime : null +/// password : "e10adc3949ba59abbe56e057f20f883e" +/// lastLoginTime : null + +class UserInfoEdit { + UserInfoEdit({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String account, + String name, + dynamic org, + dynamic station, + dynamic type, + dynamic email, + dynamic mobile, + Sex sex, + dynamic status, + dynamic avatar, + dynamic nation, + dynamic education, + dynamic positionStatus, + dynamic workDescribe, + dynamic passwordErrorLastTime, + num passwordErrorNum, + dynamic passwordExpireTime, + String password, + dynamic lastLoginTime,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _account = account; + _name = name; + _org = org; + _station = station; + _type = type; + _email = email; + _mobile = mobile; + _sex = sex; + _status = status; + _avatar = avatar; + _nation = nation; + _education = education; + _positionStatus = positionStatus; + _workDescribe = workDescribe; + _passwordErrorLastTime = passwordErrorLastTime; + _passwordErrorNum = passwordErrorNum; + _passwordExpireTime = passwordExpireTime; + _password = password; + _lastLoginTime = lastLoginTime; +} + + UserInfoEdit.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _account = json['account']; + _name = json['name']; + _org = json['org']; + _station = json['station']; + _type = json['type']; + _email = json['email']; + _mobile = json['mobile']; + _sex = json['sex'] != null ? Sex.fromJson(json['sex']) : null; + _status = json['status']; + _avatar = json['avatar']; + _nation = json['nation']; + _education = json['education']; + _positionStatus = json['positionStatus']; + _workDescribe = json['workDescribe']; + _passwordErrorLastTime = json['passwordErrorLastTime']; + _passwordErrorNum = json['passwordErrorNum']; + _passwordExpireTime = json['passwordExpireTime']; + _password = json['password']; + _lastLoginTime = json['lastLoginTime']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _account; + String _name; + dynamic _org; + dynamic _station; + dynamic _type; + dynamic _email; + dynamic _mobile; + Sex _sex; + dynamic _status; + dynamic _avatar; + dynamic _nation; + dynamic _education; + dynamic _positionStatus; + dynamic _workDescribe; + dynamic _passwordErrorLastTime; + num _passwordErrorNum; + dynamic _passwordExpireTime; + String _password; + dynamic _lastLoginTime; +UserInfoEdit copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String account, + String name, + dynamic org, + dynamic station, + dynamic type, + dynamic email, + dynamic mobile, + Sex sex, + dynamic status, + dynamic avatar, + dynamic nation, + dynamic education, + dynamic positionStatus, + dynamic workDescribe, + dynamic passwordErrorLastTime, + num passwordErrorNum, + dynamic passwordExpireTime, + String password, + dynamic lastLoginTime, +}) => UserInfoEdit( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + account: account ?? _account, + name: name ?? _name, + org: org ?? _org, + station: station ?? _station, + type: type ?? _type, + email: email ?? _email, + mobile: mobile ?? _mobile, + sex: sex ?? _sex, + status: status ?? _status, + avatar: avatar ?? _avatar, + nation: nation ?? _nation, + education: education ?? _education, + positionStatus: positionStatus ?? _positionStatus, + workDescribe: workDescribe ?? _workDescribe, + passwordErrorLastTime: passwordErrorLastTime ?? _passwordErrorLastTime, + passwordErrorNum: passwordErrorNum ?? _passwordErrorNum, + passwordExpireTime: passwordExpireTime ?? _passwordExpireTime, + password: password ?? _password, + lastLoginTime: lastLoginTime ?? _lastLoginTime, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get account => _account; + String get name => _name; + dynamic get org => _org; + dynamic get station => _station; + dynamic get type => _type; + dynamic get email => _email; + dynamic get mobile => _mobile; + Sex get sex => _sex; + dynamic get status => _status; + dynamic get avatar => _avatar; + dynamic get nation => _nation; + dynamic get education => _education; + dynamic get positionStatus => _positionStatus; + dynamic get workDescribe => _workDescribe; + dynamic get passwordErrorLastTime => _passwordErrorLastTime; + num get passwordErrorNum => _passwordErrorNum; + dynamic get passwordExpireTime => _passwordExpireTime; + String get password => _password; + dynamic get lastLoginTime => _lastLoginTime; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['account'] = _account; + map['name'] = _name; + map['org'] = _org; + map['station'] = _station; + map['type'] = _type; + map['email'] = _email; + map['mobile'] = _mobile; + if (_sex != null) { + map['sex'] = _sex.toJson(); + } + map['status'] = _status; + map['avatar'] = _avatar; + map['nation'] = _nation; + map['education'] = _education; + map['positionStatus'] = _positionStatus; + map['workDescribe'] = _workDescribe; + map['passwordErrorLastTime'] = _passwordErrorLastTime; + map['passwordErrorNum'] = _passwordErrorNum; + map['passwordExpireTime'] = _passwordExpireTime; + map['password'] = _password; + map['lastLoginTime'] = _lastLoginTime; + return map; + } + +} + +/// desc : "未知" +/// code : "N" + +class Sex { + Sex({ + String desc, + String code,}){ + _desc = desc; + _code = code; +} + + Sex.fromJson(dynamic json) { + _desc = json['desc']; + _code = json['code']; + } + String _desc; + String _code; +Sex copyWith({ String desc, + String code, +}) => Sex( 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; + } + +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index a4caac9a..bd15e52c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -420,6 +420,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.1.4" + image_gallery_saver: + dependency: "direct main" + description: + name: image_gallery_saver + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.7.1" image_pickers: dependency: "direct main" description: @@ -573,7 +580,21 @@ packages: name: path_provider url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "2.0.11" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.9" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.11" path_provider_linux: dependency: transitive description: @@ -581,6 +602,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.10" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.3" path_provider_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e11cf7b0..d199fc36 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -81,8 +81,9 @@ dependencies: # qrscan: ^0.3.1 scan: ^1.5.0 - path_provider: ^1.2.0 + path_provider: ^2.0.4 network_to_file_image: ^4.0.1 + image_gallery_saver: ^1.7.0 flutter_html: ^2.1.5 #2.1.0 chewie_audio: ^1.1.2 @@ -125,7 +126,6 @@ dependencies: syncfusion_flutter_datepicker: ^19.4.38 - dev_dependencies: flutter_test: sdk: flutter