From b82268fabe7eeeb468a8dbe966721b7105740eb6 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Fri, 29 Dec 2023 17:04:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E5=88=97=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BC=9A=E5=91=98=E8=AF=A6=E6=83=85=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=EF=BC=9B=20=E4=BC=9A=E5=91=98=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2ui=E7=BB=98=E5=88=B6=EF=BC=8C=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=B9=E6=8E=A5=E8=B0=83=E8=AF=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/vip/bus_vip_list.dart | 508 ++++++++-------- .../home/vip/member_details_page.dart | 540 ++++++++++++++++++ .../home/vip/record_details.dart | 350 ++++++++++++ lib/main.dart | 6 + lib/retrofit/business_api.dart | 5 + lib/retrofit/business_api.g.dart | 23 + .../data/vip_record_details_list.dart | 349 +++++++++++ 7 files changed, 1535 insertions(+), 246 deletions(-) create mode 100644 lib/business_system/home/vip/member_details_page.dart create mode 100644 lib/business_system/home/vip/record_details.dart create mode 100644 lib/retrofit/data/vip_record_details_list.dart diff --git a/lib/business_system/home/vip/bus_vip_list.dart b/lib/business_system/home/vip/bus_vip_list.dart index 4552f0c5..66235725 100644 --- a/lib/business_system/home/vip/bus_vip_list.dart +++ b/lib/business_system/home/vip/bus_vip_list.dart @@ -93,7 +93,12 @@ class _BusVipList extends State { storeId: widget.storeId); } BaseData baseData = await businessService.vipDataList({ - "map": {"nickname": "", "phone":editingController?.text ?? "", "source": "", "hasMoney": "2"}, + "map": { + "nickname": "", + "phone": editingController?.text ?? "", + "source": "", + "hasMoney": "2" + }, "model": {"tenantCode": null}, "date": "", "sort": "id", @@ -119,8 +124,7 @@ class _BusVipList extends State { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } finally { - if (isRefreshData) - setState(() {}); + if (isRefreshData) setState(() {}); } } @@ -161,8 +165,7 @@ class _BusVipList extends State { children: [ Padding( padding: EdgeInsets.only( - left: 20.w,top: 16.h,bottom: 16.h - ), + left: 20.w, top: 16.h, bottom: 16.h), child: Row( children: [ Container( @@ -182,105 +185,118 @@ class _BusVipList extends State { ), ), GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: (){ - Navigator.of(context).pushNamed('/router/vip_recharge_page', - arguments: {"storeId": widget.storeId}).then((value){ - _current = 1; - records.clear(); - _onRefresh(isShowLoad: false); - }); - }, - child:Container( - decoration: BoxDecoration( - color: Color(0xFF30415B), - borderRadius: BorderRadius.circular(4), - ), - padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 5.h), - margin: EdgeInsets.only(right: 8.w), - child:Text( - "会员充值", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.white, - ), - ), - ) - ), + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed( + '/router/vip_recharge_page', + arguments: { + "storeId": widget.storeId + }).then((value) { + _current = 1; + records.clear(); + _onRefresh(isShowLoad: false); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(4), + ), + padding: EdgeInsets.symmetric( + horizontal: 14.w, vertical: 5.h), + margin: EdgeInsets.only(right: 8.w), + child: Text( + "会员充值", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + )), GestureDetector( behavior: HitTestBehavior.opaque, - onTap: (){ - Navigator.of(context).pushNamed('/router/add_vip', - arguments: {"storeId": widget.storeId}).then((value){ - _current = 1; - records.clear(); - _onRefresh(isShowLoad: false); + onTap: () { + Navigator.of(context).pushNamed( + '/router/add_vip', + arguments: { + "storeId": widget.storeId + }).then((value) { + _current = 1; + records.clear(); + _onRefresh(isShowLoad: false); }); }, - child:Container( - decoration: BoxDecoration( - color: Color(0xFF30415B), - borderRadius: BorderRadius.circular(4), - ), - padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 5..h), - margin: EdgeInsets.only(right:16.w), - child:Text( - "新增会员", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.white, - ), - ), - )), + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(4), + ), + padding: EdgeInsets.symmetric( + horizontal: 14.w, vertical: 5..h), + margin: EdgeInsets.only(right: 16.w), + child: Text( + "新增会员", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + )), ], ), ), networkStatus == -1 ? noNetwork() : ((networkStatus == 0) - ? ListView.builder( - padding: EdgeInsets.zero, - itemCount: 10, - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemBuilder: (context, position) { - return vipListItemSm(); - }, - ) - : ((records == null || records.length == 0) - ? NoDataView( - src: - "assets/image/bs_no data_logo.webp", - isShowBtn: false, - text: "暂无数据", - fontSize: 16.sp, - iconHeight: 120.h, - margin: EdgeInsets.all(50.h), - ) - : ListView.builder( - itemCount: records?.length ?? 0, - physics: BouncingScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, position) { - return GestureDetector( - behavior: - HitTestBehavior.opaque, - onTap: () { - if (isKeyBoardShow) - FocusScope.of(context) - .requestFocus( - FocusNode()); - return; - }, - child: vipListItem( - records[position], - position), - ); - }, - ))), + ? ListView.builder( + padding: EdgeInsets.zero, + itemCount: 10, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return vipListItemSm(); + }, + ) + : ((records == null || records.length == 0) + ? NoDataView( + src: + "assets/image/bs_no data_logo.webp", + isShowBtn: false, + text: "暂无数据", + fontSize: 16.sp, + iconHeight: 120.h, + margin: EdgeInsets.all(50.h), + ) + : ListView.builder( + itemCount: records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if((records[position]?.phone ??"") != ""){ + FocusScope.of(context) + .requestFocus(FocusNode()); + Navigator.of(context).pushNamed( + '/router/member_details_page', + arguments: { + "storeId": widget?.storeId??"", + "phoneNum":records[position]?.phone ?? "" + }); + }else{ + FocusScope.of(context) + .requestFocus(FocusNode()); + } + }, + child: vipListItem( + records[position], position), + ); + }, + ))), ], )))), ], @@ -350,99 +366,184 @@ class _BusVipList extends State { crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded(child: Column( - children: [ - Padding( - padding: EdgeInsets.only( - bottom: 12.h, + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only( + bottom: 12.h, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Text( + "会员名称: ", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + ), + flex: 1, ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( + Expanded( + child: Text( + records?.nickname ?? "", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + ), + flex: 3, + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only( + bottom: 12.h, + ), + child: Row( + children: [ + Expanded( + child: Text( + "手机号: ", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + ), + flex: 1, + ), + Expanded( + child: Text( + records?.phone ?? "", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + ), + flex: 3, + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only( + bottom: 12.h, + ), + child: Row( + children: [ + Expanded( + child: Text( + "加入时间: ", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + ), + flex: 1, + ), + Expanded( + child: Text( + records?.createTime ?? "", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + ), + flex: 3, + ), + ], + ), + ), + if (records.isShow) + Padding( + padding: EdgeInsets.only( + bottom: 12.h, + ), + child: Row( + children: [ + Expanded( + flex: 1, child: Text( - "会员名称: ", + "充值金额: ", style: TextStyle( fontSize: 12.sp, color: Color(0xFF1A1A1A), fontWeight: MyFontWeight.regular), - ), - flex: 1, - ), - Expanded( + )), + Expanded( + flex: 3, child: Text( - records?.nickname ?? "", + "¥${records?.realRecharge ?? ""}", style: TextStyle( fontSize: 12.sp, color: Color(0xFF1A1A1A), fontWeight: MyFontWeight.regular), - ), - flex: 3, - ), - ], - ), + )), + ], ), - Padding( - padding: EdgeInsets.only( - bottom: 12.h, - ), - child: Row( - children: [ - Expanded( + ), + if (records.isShow) + Padding( + padding: EdgeInsets.only( + bottom: 12.h, + ), + child: Row( + children: [ + Expanded( + flex: 1, child: Text( - "手机号: ", + "赠送金额: ", style: TextStyle( fontSize: 12.sp, color: Color(0xFF1A1A1A), fontWeight: MyFontWeight.regular), - ), - flex: 1, - ), - Expanded( + )), + Expanded( + flex: 3, child: Text( - records?.phone ?? "", + "¥${records?.giftRecharge ?? ""}", style: TextStyle( fontSize: 12.sp, color: Color(0xFF1A1A1A), fontWeight: MyFontWeight.regular), - ), - flex: 3, - ), - ], - ), + )), + ], ), - Padding( - padding: EdgeInsets.only( - bottom: 12.h, - ), - child: Row( - children: [ - Expanded( + ), + if (records.isShow) + Padding( + padding: EdgeInsets.only( + bottom: 12.h, + ), + child: Row( + children: [ + Expanded( + flex: 1, child: Text( - "加入时间: ", + "商户余额: ", style: TextStyle( fontSize: 12.sp, color: Color(0xFF1A1A1A), fontWeight: MyFontWeight.regular), - ), - flex: 1, - ), - Expanded( + )), + Expanded( + flex: 3, child: Text( - records?.createTime ?? "", + "¥${records?.realRecharge ?? ""}", style: TextStyle( fontSize: 12.sp, color: Color(0xFF1A1A1A), fontWeight: MyFontWeight.regular), - ), - flex: 3, - ), - ], - ), + )), + ], ), - if(records.isShow) - Padding( + ), + if (records.isShow) + Padding( padding: EdgeInsets.only( bottom: 12.h, ), @@ -451,7 +552,7 @@ class _BusVipList extends State { Expanded( flex: 1, child: Text( - "充值金额: ", + "平台余额: ", style: TextStyle( fontSize: 12.sp, color: Color(0xFF1A1A1A), @@ -460,100 +561,16 @@ class _BusVipList extends State { Expanded( flex: 3, child: Text( - "¥${records?.realRecharge ?? ""}", + "¥${records?.money ?? ""}", style: TextStyle( fontSize: 12.sp, color: Color(0xFF1A1A1A), fontWeight: MyFontWeight.regular), )), ], - ), - ), - if(records.isShow) - Padding( - padding: EdgeInsets.only( - bottom: 12.h, - ), - child: Row( - children: [ - Expanded( - flex: 1, - child: Text( - "赠送金额: ", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular), - )), - Expanded( - flex: 3, - child: Text( - "¥${records?.giftRecharge ?? ""}", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular), - )), - ], - ), - ), - if (records.isShow) - Padding( - padding: EdgeInsets.only( - bottom: 12.h, - ), - child: Row( - children: [ - Expanded( - flex: 1, - child: Text( - "商户余额: ", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular), - )), - Expanded( - flex: 3, - child: Text( - "¥${records?.realRecharge ?? ""}", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular), - )), - ], - ), - ), - if(records.isShow) - Padding( - padding: EdgeInsets.only( - bottom: 12.h, - ), - child: Row( - children: [ - Expanded( - flex: 1, - child: Text( - "平台余额: ", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular), - )), - Expanded( - flex: 3, - child: Text( - "¥${records?.money ?? ""}", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular), - )), - ], - )), - ], - )), + )), + ], + )), GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -629,7 +646,7 @@ class _BusVipList extends State { ), Padding( padding: EdgeInsets.only(bottom: 12), - child: Shimmer.fromColors( + child: Shimmer.fromColors( baseColor: Color(0XFFD8D8D8), highlightColor: Color(0XFFD8D8D8), child: Container( @@ -726,8 +743,7 @@ class _BusVipList extends State { children: [ Padding( padding: EdgeInsets.only(bottom: 12), - child: - Shimmer.fromColors( + child: Shimmer.fromColors( baseColor: Color(0XFFD8D8D8), highlightColor: Color(0XFFD8D8D8), child: Container( @@ -817,7 +833,7 @@ class _BusVipList extends State { ), Padding( padding: EdgeInsets.only(bottom: 12), - child: Shimmer.fromColors( + child: Shimmer.fromColors( baseColor: Color(0XFFD8D8D8), highlightColor: Color(0XFFD8D8D8), child: Container( diff --git a/lib/business_system/home/vip/member_details_page.dart b/lib/business_system/home/vip/member_details_page.dart new file mode 100644 index 00000000..0879431c --- /dev/null +++ b/lib/business_system/home/vip/member_details_page.dart @@ -0,0 +1,540 @@ +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 '../../../generated/l10n.dart'; +import '../../../retrofit/business_api.dart'; +import '../../../retrofit/data/base_data.dart'; +import '../../../retrofit/data/phone_query_member_info.dart'; +import '../../../utils/business_instance.dart'; +import '../../../utils/flutter_utils.dart'; +import '../../../view_widget/classic_header.dart'; +import '../../../view_widget/custom_image.dart'; +import '../../../view_widget/my_footer.dart'; +import '../../../view_widget/settlement_tips_dialog.dart'; + +class MemberDetailsPage extends StatefulWidget { + final Map arguments; + + MemberDetailsPage({this.arguments}); + + @override + State createState() { + return _MemberDetailsPage(); + } +} + +class _MemberDetailsPage extends State { + final RefreshController refreshController = RefreshController(); + BusinessApiService businessService; + PhoneQueryMemberInfo phoneQueryMemberInfo; + String networkError = ""; + int networkStatus = 0; + + @override + void initState() { + super.initState(); + queryMemberPhoneInfo(widget?.arguments["phoneNum"] ?? ""); + } + + ///根据手机号搜索用户信息 + 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; + refreshController.loadComplete(); + refreshController.refreshCompleted(); + networkStatus = 1; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + refreshController.refreshFailed(); + refreshController.loadFailed(); + } + } finally { + if (isShow) EasyLoading.dismiss(); + setState(() {}); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + 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: () { + queryMemberPhoneInfo(widget?.arguments["phoneNum"] ?? "",isShow: false); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + padding: EdgeInsets.only(top:15.h,left: 16.w,right: 16.w), + child: Column( + children: [ + vipPlate(), + vipFunction(), + vipRecord() + ], + )))); + } + + ///会员信息板块 + Widget vipPlate() { + return Container( + width: double.infinity, + margin: EdgeInsets.only(bottom: 12.h), + padding: EdgeInsets.only(bottom: 15.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: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 16.w, bottom: 33.h, top: 13.h), + margin: EdgeInsets.only(bottom: 10.h), + decoration: BoxDecoration( + color: Colors.white, + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [Color(0xFF30415B), Color(0xFF5171A4)]), + borderRadius: BorderRadius.vertical( + top: Radius.circular(8), + ), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 52.h, + height: 52.h, + margin: EdgeInsets.only(right: 15.w,), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + ), + child:MImage( + (phoneQueryMemberInfo?.headimg ?? + ""), + width: double.infinity, + height: double.infinity, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 8.h), + child: Text( + "会员名称:${phoneQueryMemberInfo?.nickName ?? ""}", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + )), + Text( + "手机号:${phoneQueryMemberInfo?.phoneNum ?? ""}", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ) + ], + ), + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 7.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/bus_vip_balance.webp", + width: 24.h, + height: 24.h, + fit: BoxFit.fill, + ), + Padding( + padding: EdgeInsets.only(left: 7.w), + child: Text( + "会员余额", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF252626), + ), + )) + ], + )), + Text( + phoneQueryMemberInfo?.balance ?? "0.00", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ) + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 7.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/bus_coupon.webp", + width: 20.w, + height: 18.h, + fit: BoxFit.fill, + ), + Padding( + padding: EdgeInsets.only(left: 7.w), + child: Text( + "优惠券", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF252626), + ), + )) + ], + )), + Text( + (phoneQueryMemberInfo?.useableConponList?.length ?? 0) + .toString(), + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ) + ], + )), + ], + ) + ], + ), + ); + } + + ///会员功能 + Widget vipFunction() { + return Container( + width: double.infinity, + margin: EdgeInsets.only(bottom: 12.h), + padding: EdgeInsets.only(bottom:17.h,top:27.h,), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child:Row( + children: [ + Expanded( + child:GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context) + .pushNamed('/router/vip_recharge_page', arguments: { + "storeId": widget.arguments["storeId"] ??"", + }); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding(padding:EdgeInsets.only(bottom: 12.h), + child: Image.asset( + "assets/image/bus_home_syt.webp", + width: 26.w, + height: 23.h, + fit: BoxFit.fill, + )), + Text( + "会员充值", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF252626), + ), + ), + ], + ), + )), + Expanded( + child:GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + if(widget.arguments["storeId"] == "0"){ + SmartDialog.show( + widget: SettlementTips( + () { + }, + text: "当前为所有门店状态,收银操作时,请将门店切换至要消费的门店!", + color: Color(0xFF30415B), + )); + }else{ + Navigator.of(context) + .pushNamed('/router/cashier_page', arguments: { + "storeId": widget.arguments["storeId"] ??"", + "phone":widget?.arguments["phoneNum"] ?? "" + }); + } + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding(padding:EdgeInsets.only(bottom: 12.h), + child: Image.asset( + "assets/image/bus_home_hyyetj.webp", + width: 23.h, + height: 23.h, + fit: BoxFit.fill, + )), + Text( + "会员收银", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF252626), + ), + ), + ], + ))), + Spacer() + // Expanded( + // child:Column( + // crossAxisAlignment: CrossAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // Padding(padding:EdgeInsets.only(bottom: 12.h), + // child: Image.asset( + // "assets/image/bus_vip_cc.webp", + // width: 24.h, + // height: 24.h, + // fit: BoxFit.fill, + // )), + // Text( + // "会员充次", + // style: TextStyle( + // fontSize: 14.sp, + // fontWeight: MyFontWeight.medium, + // color: Color(0xFF252626), + // ), + // ), + // ], + // )), + ], + ), + ); + } + + ///会员消费/充值/充次记录 + Widget vipRecord() { + return Container( + width: double.infinity, + margin: EdgeInsets.only(bottom: 12.h), + padding: EdgeInsets.only(bottom:17.h,top:11.h,left: 17.w,right: 16.w), + 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: [ + vipRecordText("消费记录"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + ), + vipRecordText("充值记录"), + // Container( + // width: double.infinity, + // height: 1.h, + // color: Color(0xFFEBECEF), + // ), + // vipRecordText("充次记录"), + ], + ), + ); + } + + Widget vipRecordText(String text){ + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed( + '/router/record_details', + arguments: { + "storeId": widget.arguments["storeId"], + "titleName":text, + "mid":phoneQueryMemberInfo?.sid ??"", + "title":text == "消费记录" ?"bill_tenant_balance":"bill_tenant_balance", + "category":text == "消费记录" ?"bill_cate_buy":"bill_cate_rechange", + }); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 16.h), + child: Row( + children: [ + Expanded( + child: Text( + text, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + )), + Padding(padding: EdgeInsets.only(right: 9.w,),child: Image.asset( + "assets/image/icon_right_z.webp", + width: 16.h, + height: 16.h, + color: Color(0xFF353535), + )), + ], + ), + ), + ); + } + + ///网络错误 + 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: () { + queryMemberPhoneInfo(widget?.arguments["phoneNum"] ?? ""); + }, + 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/record_details.dart b/lib/business_system/home/vip/record_details.dart new file mode 100644 index 00000000..264f9c99 --- /dev/null +++ b/lib/business_system/home/vip/record_details.dart @@ -0,0 +1,350 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.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/phone_query_member_info.dart'; +import '../../../retrofit/data/vip_record_details_list.dart'; +import '../../../utils/business_instance.dart'; +import '../../../utils/flutter_utils.dart'; +import '../../../utils/font_weight.dart'; +import '../../../view_widget/classic_header.dart'; +import '../../../view_widget/my_footer.dart'; +import '../../../view_widget/no_data_view.dart'; + +class RecordDetails extends StatefulWidget { + final Map arguments; + + RecordDetails({this.arguments}); + + @override + State createState() { + return _RecordDetails(); + } +} + +class _RecordDetails extends State { + final RefreshController refreshController = RefreshController(); + BusinessApiService businessService; + PhoneQueryMemberInfo phoneQueryMemberInfo; + String networkError = ""; + int networkStatus = 0; + String titleName; + int _current = 1; + List records = []; + String mid; + String title; + String category; + + @override + void initState() { + super.initState(); + titleName = widget?.arguments["titleName"] ?? ""; + mid = widget?.arguments["mid"] ?? ""; + title = widget?.arguments["title"] ?? ""; + category = widget?.arguments["category"] ?? ""; + queryMemberSourceBillDetails(mid:mid,title:title,category:category); + } + + ///查询会员消费/充值记录 + queryMemberSourceBillDetails({mid,title,category, isRefresh = true}) async { + try { + if (isRefresh) + 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.getMemberSourceBillDetails({ + "model": { + "mid": mid, + "title":title, + "category": category + }, + "current": _current, + "size": 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 ?? []); + if ((baseData?.data?.records ?? []).isEmpty || + records.length.toString() == baseData.data.total) + refreshController.loadNoData(); + else + refreshController.loadComplete(); + networkStatus = 1; + } + } finally { + if (isRefresh) { + setState(() {}); + EasyLoading.dismiss(); + } + } + } + + @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() + : 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(); + queryMemberSourceBillDetails(mid:mid,title:title,category:category,isRefresh: false); + }, + onLoading: () { + _current++; + queryMemberSourceBillDetails(mid:mid,title:title,category:category,isRefresh: 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: recordItemSm(), + ); + }, + ) + : ((records == null || records.length == 0) + ? NoDataView( + src: "assets/image/bs_no data_logo.webp", + isShowBtn: false, + text: titleName == "消费记录"?"暂无消费记录":"暂无充值记录", + fontSize: 16.sp, + margin: EdgeInsets.all(20.h), + ) : + Container( + margin: EdgeInsets.only(top: 16.h), + child: ListView.builder( + itemCount: records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: recordItem(records[position]), + ); + }, + ), + )), + ), + )); + } + + Widget recordItem(Records records) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(bottom: 12.h, left: 16.w, right: 16.w), + padding: EdgeInsets.only(bottom: 12.h, top: 12.h, left: 16.w), + 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: 20.h), + child: Text( + records?.createTime ?? "", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.bold), + ), + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "金额:", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF666666), + ), + ), + TextSpan( + text: titleName == "消费记录"?"- ${records?.number}":"+ ${records?.number}", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFFFA5151), + ), + ), + ], + ), + ) + ], + ), + ); + } + + Widget recordItemSm() { + return Container( + width: double.infinity, + margin: EdgeInsets.only(bottom: 12.h, left: 16.w, right: 16.w), + padding: EdgeInsets.only(bottom: 12.h, top: 12.h, left: 16.w), + 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: 141.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: 55.w, + height: 20.h, + ), + ), + ], + ) + ], + ), + ); + } + + ///网络错误 + Widget noNetwork() { + return Container( + color: Colors.white, + 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/main.dart b/lib/main.dart index 5bb02341..64ee5667 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -97,6 +97,7 @@ 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/vip/record_details.dart'; import 'business_system/home/consumer_ranking_page.dart'; import 'business_system/home/flow_page.dart'; import 'business_system/home/hot _selling_page.dart'; @@ -104,6 +105,7 @@ 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/member_details_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'; @@ -545,4 +547,8 @@ Map routers = { ClerkManagePage(arguments:arguments), '/router/add_new_clerk_page': (context, {arguments}) => AddNewClerkPage(arguments:arguments), + '/router/member_details_page': (context, {arguments}) => + MemberDetailsPage(arguments:arguments), + '/router/record_details': (context, {arguments}) => + RecordDetails(arguments:arguments), }; diff --git a/lib/retrofit/business_api.dart b/lib/retrofit/business_api.dart index 0b4aeadb..200e1ab4 100644 --- a/lib/retrofit/business_api.dart +++ b/lib/retrofit/business_api.dart @@ -41,6 +41,7 @@ import 'data/ticket_stats_list.dart'; import 'data/trade_summary_list.dart'; import 'data/upload_result.dart'; import 'data/user_info_edit.dart'; +import 'data/vip_record_details_list.dart'; part 'business_api.g.dart'; @@ -370,4 +371,8 @@ abstract class BusinessApiService { @POST("order/queryOrder/{orderId}?login={login}") Future queryCashierOrder(@Path("orderId") String orderId,@Path("login") bool login); + ///会员详情-查询会员消费/充值记录 + @POST("member/getMemberSourceBillDetials") + Future> getMemberSourceBillDetails(@Body() Map param); + } diff --git a/lib/retrofit/business_api.g.dart b/lib/retrofit/business_api.g.dart index 3a621c82..f1bc00f7 100644 --- a/lib/retrofit/business_api.g.dart +++ b/lib/retrofit/business_api.g.dart @@ -1163,4 +1163,27 @@ class _BusinessApiService implements BusinessApiService { return value; } + @override + Future> getMemberSourceBillDetails(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'member/getMemberSourceBillDetials', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : VipRecordDetailsList.fromJson(json), + ); + return value; + } + } diff --git a/lib/retrofit/data/vip_record_details_list.dart b/lib/retrofit/data/vip_record_details_list.dart new file mode 100644 index 00000000..65da0a4a --- /dev/null +++ b/lib/retrofit/data/vip_record_details_list.dart @@ -0,0 +1,349 @@ +/// records : [{"id":"1740270714188988416","createTime":"2023-12-28 15:17:26","createUser":"1659496253991419904","updateTime":"2023-12-28 15:17:26","updateUser":"1659496253991419904","mid":"1659496253991419904","linkId":"202312281517200005","pm":0,"title":"商户余额操作","category":"用户消费","type":"商户会员余额支付","number":"0.01","realNumber":"0.01","balance":"1109.94","mark":"","status":true,"isDeleted":false,"tenantName":"海峡姐妹茶膳坊","rechargeMoney":"0.01","giftMoney":"0.00","totalMoney":"0.01","balanceMoney":"1109.94"},{"id":"1740270550686629888","createTime":"2023-12-28 15:16:47","createUser":"1659496253991419904","updateTime":"2023-12-28 15:16:47","updateUser":"1659496253991419904","mid":"1659496253991419904","linkId":"202312281516420004","pm":0,"title":"商户余额操作","category":"用户消费","type":"商户会员余额支付","number":"0.01","realNumber":"0.01","balance":"1109.95","mark":"","status":true,"isDeleted":false,"tenantName":"海峡姐妹茶膳坊","rechargeMoney":"0.01","giftMoney":"0.00","totalMoney":"0.01","balanceMoney":"1109.95"},{"id":"1740270356993671168","createTime":"2023-12-28 15:16:00","createUser":"1659496253991419904","updateTime":"2023-12-28 15:16:00","updateUser":"1659496253991419904","mid":"1659496253991419904","linkId":"202312281515560003","pm":0,"title":"商户余额操作","category":"用户消费","type":"商户会员余额支付","number":"0.01","realNumber":"0.01","balance":"1109.96","mark":"","status":true,"isDeleted":false,"tenantName":"海峡姐妹茶膳坊","rechargeMoney":"0.01","giftMoney":"0.00","totalMoney":"0.01","balanceMoney":"1109.96"},{"id":"1740270215087783936","createTime":"2023-12-28 15:15:27","createUser":"1659496253991419904","updateTime":"2023-12-28 15:15:27","updateUser":"1659496253991419904","mid":"1659496253991419904","linkId":"202312281515230002","pm":0,"title":"商户余额操作","category":"用户消费","type":"商户会员余额支付","number":"0.01","realNumber":"0.01","balance":"1109.97","mark":"","status":true,"isDeleted":false,"tenantName":"海峡姐妹茶膳坊","rechargeMoney":"0.01","giftMoney":"0.00","totalMoney":"0.01","balanceMoney":"1109.97"},{"id":"1740270122343333888","createTime":"2023-12-28 15:15:04","createUser":"1659496253991419904","updateTime":"2023-12-28 15:15:04","updateUser":"1659496253991419904","mid":"1659496253991419904","linkId":"202312281515000001","pm":0,"title":"商户余额操作","category":"用户消费","type":"商户会员余额支付","number":"0.01","realNumber":"0.01","balance":"1109.98","mark":"","status":true,"isDeleted":false,"tenantName":"海峡姐妹茶膳坊","rechargeMoney":"0.01","giftMoney":"0.00","totalMoney":"0.01","balanceMoney":"1109.98"},{"id":"1740269600106348544","createTime":"2023-12-28 15:13:00","createUser":"1659496253991419904","updateTime":"2023-12-28 15:13:00","updateUser":"1659496253991419904","mid":"1659496253991419904","linkId":"202312281512530001","pm":0,"title":"商户余额操作","category":"用户消费","type":"商户会员余额支付","number":"0.01","realNumber":"0.01","balance":"1109.99","mark":"","status":true,"isDeleted":false,"tenantName":"海峡姐妹茶膳坊","rechargeMoney":"0.01","giftMoney":"0.00","totalMoney":"0.01","balanceMoney":"1109.99"}] +/// total : "6" +/// size : "10" +/// current : "1" +/// orders : [{"column":"id","asc":false}] +/// hitCount : false +/// searchCount : true +/// pages : "1" + +class VipRecordDetailsList { + VipRecordDetailsList({ + 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; +} + + VipRecordDetailsList.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; +VipRecordDetailsList copyWith({ List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages, +}) => VipRecordDetailsList( 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 : "1740270714188988416" +/// createTime : "2023-12-28 15:17:26" +/// createUser : "1659496253991419904" +/// updateTime : "2023-12-28 15:17:26" +/// updateUser : "1659496253991419904" +/// mid : "1659496253991419904" +/// linkId : "202312281517200005" +/// pm : 0 +/// title : "商户余额操作" +/// category : "用户消费" +/// type : "商户会员余额支付" +/// number : "0.01" +/// realNumber : "0.01" +/// balance : "1109.94" +/// mark : "" +/// status : true +/// isDeleted : false +/// tenantName : "海峡姐妹茶膳坊" +/// rechargeMoney : "0.01" +/// giftMoney : "0.00" +/// totalMoney : "0.01" +/// balanceMoney : "1109.94" + +class Records { + Records({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String mid, + String linkId, + num pm, + String title, + String category, + String type, + String number, + String realNumber, + String balance, + String mark, + bool status, + bool isDeleted, + String tenantName, + String rechargeMoney, + String giftMoney, + String totalMoney, + String balanceMoney,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _mid = mid; + _linkId = linkId; + _pm = pm; + _title = title; + _category = category; + _type = type; + _number = number; + _realNumber = realNumber; + _balance = balance; + _mark = mark; + _status = status; + _isDeleted = isDeleted; + _tenantName = tenantName; + _rechargeMoney = rechargeMoney; + _giftMoney = giftMoney; + _totalMoney = totalMoney; + _balanceMoney = balanceMoney; +} + + Records.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _mid = json['mid']; + _linkId = json['linkId']; + _pm = json['pm']; + _title = json['title']; + _category = json['category']; + _type = json['type']; + _number = json['number']; + _realNumber = json['realNumber']; + _balance = json['balance']; + _mark = json['mark']; + _status = json['status']; + _isDeleted = json['isDeleted']; + _tenantName = json['tenantName']; + _rechargeMoney = json['rechargeMoney']; + _giftMoney = json['giftMoney']; + _totalMoney = json['totalMoney']; + _balanceMoney = json['balanceMoney']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _mid; + String _linkId; + num _pm; + String _title; + String _category; + String _type; + String _number; + String _realNumber; + String _balance; + String _mark; + bool _status; + bool _isDeleted; + String _tenantName; + String _rechargeMoney; + String _giftMoney; + String _totalMoney; + String _balanceMoney; +Records copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String mid, + String linkId, + num pm, + String title, + String category, + String type, + String number, + String realNumber, + String balance, + String mark, + bool status, + bool isDeleted, + String tenantName, + String rechargeMoney, + String giftMoney, + String totalMoney, + String balanceMoney, +}) => Records( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + mid: mid ?? _mid, + linkId: linkId ?? _linkId, + pm: pm ?? _pm, + title: title ?? _title, + category: category ?? _category, + type: type ?? _type, + number: number ?? _number, + realNumber: realNumber ?? _realNumber, + balance: balance ?? _balance, + mark: mark ?? _mark, + status: status ?? _status, + isDeleted: isDeleted ?? _isDeleted, + tenantName: tenantName ?? _tenantName, + rechargeMoney: rechargeMoney ?? _rechargeMoney, + giftMoney: giftMoney ?? _giftMoney, + totalMoney: totalMoney ?? _totalMoney, + balanceMoney: balanceMoney ?? _balanceMoney, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get mid => _mid; + String get linkId => _linkId; + num get pm => _pm; + String get title => _title; + String get category => _category; + String get type => _type; + String get number => _number; + String get realNumber => _realNumber; + String get balance => _balance; + String get mark => _mark; + bool get status => _status; + bool get isDeleted => _isDeleted; + String get tenantName => _tenantName; + String get rechargeMoney => _rechargeMoney; + String get giftMoney => _giftMoney; + String get totalMoney => _totalMoney; + String get balanceMoney => _balanceMoney; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['mid'] = _mid; + map['linkId'] = _linkId; + map['pm'] = _pm; + map['title'] = _title; + map['category'] = _category; + map['type'] = _type; + map['number'] = _number; + map['realNumber'] = _realNumber; + map['balance'] = _balance; + map['mark'] = _mark; + map['status'] = _status; + map['isDeleted'] = _isDeleted; + map['tenantName'] = _tenantName; + map['rechargeMoney'] = _rechargeMoney; + map['giftMoney'] = _giftMoney; + map['totalMoney'] = _totalMoney; + map['balanceMoney'] = _balanceMoney; + return map; + } + +} \ No newline at end of file