Browse Source

新增票券列表,票券核销记录,票券核销统计,会员列表,会员充值流水,会员余额变动接口;

首页用户概览板块更改成会员管理,并新增会员概览,会员列表,会员充值流水三个选项板块,并增加会员更多数据板块跳转;
首页接口优化更改;
订单页面更改,新增票券板块选项;
订单列表页面ui高度边距优化;
票券详情页面票券状态显示优化;
扫一扫页面ui优化;
新增余额变动,会员列表,会员充值流水,实体类;
新增会员页面,会员列表,会员充值流水,会员余额变动页面;
订单页面更改,单独新增订单页面;
新增tab下划线长度文件;(可用于自定义tab下划线长短,颜色等)
wr_2023_business
wurong 1 year ago
parent
commit
da552bddbd
  1. 411
      lib/business_system/home/business_home_page.dart
  2. 1013
      lib/business_system/home/vip/balance_change_record.dart
  3. 867
      lib/business_system/home/vip/bus_vip_list.dart
  4. 117
      lib/business_system/home/vip/business_vip_page.dart
  5. 988
      lib/business_system/home/vip/vip_recharge_flow.dart
  6. 190
      lib/business_system/order/business_order_page.dart
  7. 11
      lib/business_system/order/order_list.dart
  8. 232
      lib/business_system/order/order_list_page.dart
  9. 6
      lib/business_system/order/order_write_off.dart
  10. 1
      lib/business_system/order/request_refund.dart
  11. 612
      lib/business_system/order/ticket/ticket_list.dart
  12. 634
      lib/business_system/order/ticket/ticket_page.dart
  13. 622
      lib/business_system/order/ticket/ticket_records_page.dart
  14. 588
      lib/business_system/order/ticket/ticket_statistics_page.dart
  15. 106
      lib/business_system/order/ticket/ticket_tab.dart
  16. 25
      lib/business_system/scan_code_page.dart
  17. 1
      lib/home/main_home_page.dart
  18. 3
      lib/main.dart
  19. 67
      lib/retrofit/business_api.dart
  20. 141
      lib/retrofit/business_api.g.dart
  21. 367
      lib/retrofit/data/balance_change_list.dart
  22. 374
      lib/retrofit/data/business_vip_list.dart
  23. 329
      lib/retrofit/data/recharge_flow_list.dart
  24. 709
      lib/retrofit/data/ticket_record.dart
  25. 380
      lib/retrofit/data/ticket_show.dart
  26. 90
      lib/retrofit/data/ticket_stats_list.dart

411
lib/business_system/home/business_home_page.dart

@ -17,9 +17,11 @@ import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_login_info.dart';
import '../../retrofit/data/business_vip_list.dart' as vip;
import '../../retrofit/data/day_count.dart';
import '../../retrofit/data/order_trend.dart';
import '../../retrofit/data/popular_sales_list.dart';
import '../../retrofit/data/recharge_flow_list.dart';
import '../../retrofit/data/vip_counts_info.dart';
import '../../utils/flutter_utils.dart';
import '../../utils/font_weight.dart';
@ -48,9 +50,12 @@ class _BusinessHomePage extends State<BusinessHomePage>
DayCount dayCount;
int _loadCount = 0;
PopularSalesList popularSalesList;
List<vip.Records> records = [];
List<Records> rechargeFlowList = [];
List<OrderTrend> orderTrend = [];
VipCountsInfo vipCountsInfo;
int daySelectIndex = 0;
int vipIndex = 0;
List<DayFlowList> dayFlowList = [];
List<LineChartSample2Data> lineChartSample2Data = [
LineChartSample2Data(0, 0, "2023-03-09"),
@ -89,11 +94,17 @@ class _BusinessHomePage extends State<BusinessHomePage>
? "0"
: widget.businessLoginInfo
.storeList[index ?? widget.selectStoreIndex].id);
if(vipIndex != 1 && vipIndex != 2){
queryDayAmount();
queryPopularList(isSing: false);
queryOrderTrend();
queryVipCounts();
queryDayFlow();
}
if(vipIndex == 1)
queryVipList();
if(vipIndex == 2)
queryRechargeFlow();
});
}
@ -199,6 +210,50 @@ class _BusinessHomePage extends State<BusinessHomePage>
}
}
///
queryVipList() async {
try {
BaseData<vip.BusinessVipList> baseData = await businessService.vipDataList({
"map": {"nickname": "", "phone": "", "source": "", "hasMoney": "2"},
"model": {"tenantCode": null},
"date": "",
"sort": "id",
"size": 12,
"current": 1
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
records.clear();
records.addAll(baseData?.data?.records ?? []);
setState((){});
}
} finally {
EasyLoading.dismiss();
}
}
///
queryRechargeFlow() async {
try {
BaseData<RechargeFlowList> baseData = await businessService.rechargeFlow({
"size": 10,
"pageSize": 10,
"current": 1,
"currentPage": 1,
"sort": "id",
"order": "descending",
"model": {"id":""},
"timeRange": null
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
rechargeFlowList.clear();
rechargeFlowList.addAll(baseData?.data?.records ?? []);
setState((){});
}
} finally {
EasyLoading.dismiss();
}
}
@override
Widget build(BuildContext context) {
super.build(context);
@ -229,7 +284,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
children: [
homeTop(),
tradeOverview(),
userOverview(),
vipManage(),
hotSellHotCharts(),
todayFlow(),
],
@ -657,39 +712,13 @@ class _BusinessHomePage extends State<BusinessHomePage>
);
}
///
///
Widget userOverview() {
return Container(
color: Colors.white,
margin: EdgeInsets.only(top: 16.h),
padding: EdgeInsets.only(left: 9.w, right: 9.w, top: 12.h, bottom: 12.h),
margin: EdgeInsets.only(bottom: 16.h),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(
left: 7.w,
),
child: Row(
children: [
Container(width: 4.w, height: 16.h, color: Color(0xFF30415B)),
Padding(
padding: EdgeInsets.only(
left: 12.w,
),
child: Text(
"用户概览",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF0D0D0D),
),
),
),
],
)),
SizedBox(
height: 12.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
@ -866,6 +895,330 @@ class _BusinessHomePage extends State<BusinessHomePage>
);
}
///
Widget vipManage() {
return Container(
color: Colors.white,
margin: EdgeInsets.only(top: 16.h),
padding: EdgeInsets.only(bottom: 12.h),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 16.w),
child: Row(
children: [
Container(width: 4.w, height: 16.h, color: Color(0xFF30415B),margin: EdgeInsets.only(right: 12.w,top: 12.h),),
Expanded(
child: Padding(
padding: EdgeInsets.only(top: 12.h),
child: Text(
"会员管理",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF0D0D0D),
),
),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed(
'/router/business_vip_page',
arguments: {"storeId": widget.businessLoginInfo
.storeList[widget.selectStoreIndex].name ==
"所有门店"
? "0"
: widget.businessLoginInfo
.storeList[widget.selectStoreIndex].id,},
);
},
child: Container(
// color: Colors.red,
padding: EdgeInsets.only(left: 20.w,right: 20.w,top: 12.h),
child: Row(
children: [
Text(
"更多数据",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF252626),
),
),
SizedBox(
width: 5.w,
),
Image.asset(
"assets/image/bs_right.webp",
width: 8.w,
height: 12.h,
),
],
),
),
)
],
)),
Padding(
padding: EdgeInsets.only(left: 16.w),
child: Row(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
vipIndex = 0;
});
},
child: Container(
padding:
EdgeInsets.only(right: 20.w, top: 15.h, bottom: 18.h),
alignment: Alignment.center,
child: Text(
"会员概览",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.bold,
color: vipIndex == 0
? Color(0xFF30415B)
: Color(0XFF262626),
),
),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
vipIndex = 1;
_onRefresh();
});
},
child: Container(
padding:
EdgeInsets.only(right: 20.w, top: 15.h, bottom: 18.h),
alignment: Alignment.center,
child: Text(
"会员列表",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.bold,
color: vipIndex == 1
? Color(0xFF30415B)
: Color(0XFF262626),
),
),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
vipIndex = 2;
_onRefresh();
});
},
child: Container(
padding:
EdgeInsets.only(right: 20.w, top: 15.h, bottom: 18.h),
alignment: Alignment.center,
child: Text(
"会员充值流水",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.bold,
color: vipIndex == 2
? Color(0xFF30415B)
: Color(0XFF262626),
),
),
),
),
],
)),
if (vipIndex == 0) userOverview(),
if (vipIndex == 1 || vipIndex == 2)
Padding(
padding: EdgeInsets.only(left: 16.w),
child: Row(
children: [
Expanded(
child: Text(
"昵称",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF30415B),
),
),
),
Expanded(
child: Text(
"手机号",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF30415B),
),
),
),
Expanded(
child: Text(
"商户余额",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF30415B),
),
),
),
],
)),
if (vipIndex == 1)
Container(
height: 310.h,
padding: EdgeInsets.only(left: 16.w),
child:
(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(
padding: EdgeInsets.zero,
itemCount: records?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: busVipItem(records[position]),
);
},
),
),
if (vipIndex == 2)
Container(
height: 310.h,
padding: EdgeInsets.only(left: 16.w),
child:
(rechargeFlowList == null ||
rechargeFlowList.length == 0)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
) :
ListView.builder(
padding: EdgeInsets.zero,
itemCount: rechargeFlowList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: busRechargeFlowItem(rechargeFlowList[position]),
);
},
),
),
],
),
);
}
///
Widget busVipItem(vip.Records records) {
return Container(
margin: EdgeInsets.only(top: 17.h, bottom: 20.h),
child: Row(
children: [
Expanded(
child: Text(
records?.nickname ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xD9000000),
),
),
),
Expanded(
child: Text(
records?.phone ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xD9000000),
),
),
),
Expanded(
child: Text(
records?.balance ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xD9000000),
),
),
),
],
),
);
}
///
Widget busRechargeFlowItem(Records rechargeFlowList) {
return Container(
margin: EdgeInsets.only(top: 17.h, bottom: 20.h),
child: Row(
children: [
Expanded(
child: Text(
rechargeFlowList?.createPerson ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xD9000000),
),
),
),
Expanded(
child: Text(
rechargeFlowList?.phone ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xD9000000),
),
),
),
Expanded(
child: Text(
rechargeFlowList?.balance ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xD9000000),
),
),
),
],
),
);
}
///
showVipTipDialog(index) {
showDialog(

1013
lib/business_system/home/vip/balance_change_record.dart

File diff suppressed because it is too large Load Diff

867
lib/business_system/home/vip/bus_vip_list.dart

@ -0,0 +1,867 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
import '../../../retrofit/data/base_data.dart';
import '../../../retrofit/data/business_vip_list.dart';
import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
import '../../../view_widget/no_data_view.dart';
class BusVipList extends StatefulWidget {
final String storeId;
BusVipList(
Key key,
this.storeId,
) : super(key: key);
@override
State<StatefulWidget> createState() {
return _BusVipList();
}
}
class _BusVipList extends State<BusVipList> {
final RefreshController _refreshController = RefreshController();
BusinessApiService businessService;
List<Records> records = [];
int _current = 1;
String networkError = "";
int networkStatus = 0;
final TextEditingController editingController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
///
@override
void dispose() {
super.dispose();
_refreshController.dispose();
_focusNode.unfocus();
}
@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;
}
});
});
_onRefresh();
}
_onRefresh({bool isShowLoad = true}) async {
if (isShowLoad)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
await queryVipList(isRefreshData: false);
EasyLoading.dismiss();
if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
setState(() {});
}
queryVipList({isRefreshData = true}) async {
try {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<BusinessVipList> baseData = await businessService.vipDataList({
"map": {"nickname": "", "phone":editingController?.text ?? "", "source": "", "hasMoney": "2"},
"model": {"tenantCode": null},
"date": "",
"sort": "id",
"size": 10,
"current": _current
}).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 (isRefreshData)
setState(() {});
}
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFD8D8D8),
),
vipSearch(),
Expanded(
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: records.length == 0 ? false : true,
header: MyHeader(color: Color(0xFF30415B)),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
_current = 1;
records.clear();
_onRefresh(isShowLoad: false);
},
onLoading: () {
_current++;
_onRefresh(isShowLoad: false);
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(
left: 20.w,top: 16.h
),
child: Row(
children: [
Container(
width: 4.w,
height: 16.h,
color: Color(0xFF30415B),
margin: EdgeInsets.only(right: 12.w),
),
Expanded(
child: Text(
"会员管理",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF0D0D0D),
),
),
),
],
),
),
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),
)
: Padding(
padding: EdgeInsets.only(top: 16.h),
child: Expanded(
child: 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),
);
},
),
),
))),
],
)))),
],
);
}
///
Widget vipSearch() {
return Container(
color: Colors.white,
child: Container(
height: 40.h,
margin:
EdgeInsets.only(left: 20.w, right: 17.w, top: 10.h, bottom: 15.h),
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
child: TextField(
focusNode: _focusNode,
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
records.clear();
_onRefresh();
},
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,
),
),
),
);
}
Widget vipListItem(Records records, index) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 12.h),
padding: EdgeInsets.only(
left: 12.h,
top: 16.h,
bottom: 16.h,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
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,
),
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),
)),
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?.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: () {
setState(() {
records.isShow = !records.isShow;
});
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 6.h),
child: Icon(
records.isShow
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Color(0xFF0D0D0D),
size: 24,
)),
),
],
),
);
}
Widget vipListItemSm() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 12.h),
padding: EdgeInsets.only(
left: 12.h,
top: 16.h,
bottom: 16.h,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 60.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 40.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
],
)),
Expanded(
flex: 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 12),
child:
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 48.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 77.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 120.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 12),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
],
)),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
margin: EdgeInsets.only(right: 24.w),
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 16.w,
height: 16.h,
),
),
],
),
);
}
Widget noNetwork() {
return Container(
margin: EdgeInsets.only(top: 120.h),
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),
)),
)
],
),
);
}
}

117
lib/business_system/home/vip/business_vip_page.dart

@ -0,0 +1,117 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/business_system/home/vip/vip_recharge_flow.dart';
import 'package:huixiang/business_system/order/ticket/ticket_tab.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../view_widget/my_appbar.dart';
import '../../../view_widget/my_tab.dart';
import 'balance_change_record.dart';
import 'bus_vip_list.dart';
class BusinessVipPage extends StatefulWidget {
final Map<String, dynamic> arguments;
BusinessVipPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _BusinessVipPage();
}
}
class _BusinessVipPage extends State<BusinessVipPage>
with SingleTickerProviderStateMixin {
List<GlobalKey> _allKey = [];
String storeId;
TabController tabController;
@override
void initState() {
super.initState();
tabController = TabController(length: 3, vsync: this);
tabController.addListener(() {
if (!tabController.indexIsChanging) {
setState(() {});
FocusScope.of(context).requestFocus(FocusNode());
}
});
loadFinish();
storeId = widget.arguments["storeId"];
}
loadFinish() {
_allKey = [GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {});
}
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Column(
children: [
Expanded(child: DefaultTabController(
length: 3,
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title: "",
leadingColor: Colors.black,
background: Colors.white,
toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
bottom: TabBar (
// isScrollable: true, //
//
overlayColor: MaterialStateProperty.all(Colors.white),
indicator: const TicketTab(
width: 44,
borderSide:
BorderSide(width: 2.0, color: Color(0xFF30415B))),
labelColor: Colors.black,
labelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
color: Color(0xFF666666)),
controller: tabController,
//
unselectedLabelColor: Color(0xFF666666),
//
tabs: <Widget>[
MyTab(text: "会员列表"),
MyTab(text: "会员充值流水"),
MyTab(text: "会员余额变动"),
],
),
),
body: TabBarView(
controller: tabController,
children: [
BusVipList(
_allKey[0],
storeId),
VipRechargeFlow(
_allKey[1],
storeId),
BalanceChangeRecord(
_allKey[2],
storeId,),
],
),
),
)),
// SizedBox(
// height: 76.h,
// ),
],
),
);
}
}

988
lib/business_system/home/vip/vip_recharge_flow.dart

@ -0,0 +1,988 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
import '../../../retrofit/data/base_data.dart';
import '../../../retrofit/data/recharge_flow_list.dart';
import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
import '../../../view_widget/no_data_view.dart';
class VipRechargeFlow extends StatefulWidget {
final String storeId;
VipRechargeFlow(
Key key,
this.storeId,
) : super(key: key);
@override
State<StatefulWidget> createState() {
return _VipRechargeFlow();
}
}
class _VipRechargeFlow extends State<VipRechargeFlow> {
final RefreshController _refreshController = RefreshController();
BusinessApiService businessService;
List<Records> records = [];
int _current = 1;
String networkError = "";
int networkStatus = 0;
final TextEditingController editingController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
///
@override
void dispose() {
super.dispose();
_refreshController.dispose();
_focusNode.unfocus();
}
@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;
}
});
});
_onRefresh();
}
_onRefresh({bool isShowLoad = true}) async {
if (isShowLoad)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
await queryRechargeFlow(isRefreshData: false);
EasyLoading.dismiss();
if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
setState(() {});
}
queryRechargeFlow({isRefreshData = true}) async {
try {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<RechargeFlowList> baseData = await businessService.rechargeFlow({
"size": 10,
"pageSize": 10,
"current": _current,
"currentPage": 1,
"sort": "id",
"order": "descending",
"model": {"id": editingController?.text ?? ""},
// "map": {"startDate": "", "endDate": ""},
"timeRange": null
}).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 (isRefreshData) setState(() {});
}
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFD8D8D8),
),
rechargeFlowSearch(),
Expanded(
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: records.length == 0 ? false : true,
header: MyHeader(color: Color(0xFF30415B)),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
_current = 1;
records.clear();
_onRefresh(isShowLoad: false);
},
onLoading: () {
_current++;
_onRefresh(isShowLoad: false);
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 20.w, top: 16.h),
child: Row(
children: [
Container(
width: 4.w,
height: 16.h,
color: Color(0xFF30415B),
margin: EdgeInsets.only(right: 12.w),
),
Expanded(
child: Text(
"充值流水",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF0D0D0D),
),
),
),
],
),
),
networkStatus == -1
? noNetwork()
: ((networkStatus == 0)
? ListView.builder(
padding: EdgeInsets.zero,
itemCount: 10,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return rechargeFlowItemSm();
},
)
: ((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),
)
: Padding(
padding: EdgeInsets.only(top: 16.h),
child: Expanded(
child: 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: rechargeFlowItem(
records[position],
position),
);
},
),
),
))),
],
)))),
],
);
}
///
Widget rechargeFlowSearch() {
return Container(
color: Colors.white,
child: Container(
height: 40.h,
margin:
EdgeInsets.only(left: 20.w, right: 17.w, top: 10.h, bottom: 15.h),
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
child: TextField(
focusNode: _focusNode,
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
records.clear();
_onRefresh();
},
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,
),
),
),
);
}
Widget rechargeFlowItem(Records records, index) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 12.h),
padding: EdgeInsets.only(
top: 13.h,
bottom: 16.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: 12.h,
),
child: Text(
"订单编号: ${records?.id ?? ""}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.bold),
),
),
Container(
height: 1.h,
width: double.infinity,
color: Color(0xFFF4F6F7),
margin: EdgeInsets.symmetric(vertical: 13.h),
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Padding(
padding: EdgeInsets.only(
bottom: 12.h,
left: 12.w,
),
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,
),
Expanded(
child: Text(
records?.createPerson ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
),
flex: 2,
),
],
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12.h,
left: 12.w,
),
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: 2,
),
],
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
Expanded(
child: Text(
"充值实付金额: ",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
),
flex: 1,
),
Expanded(
child: Text(
"${records?.rechargeMoney ?? ""}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
),
flex: 2,
),
],
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
Expanded(
flex: 1,
child: Text(
"充值实赠金额: ",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)),
Expanded(
flex: 2,
child: Text(
"${records?.giftdMoney ?? ""}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)),
],
),
),
if (records.isShow)
Padding(
padding: EdgeInsets.only(
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
Expanded(
flex: 1,
child: Text(
"充值门店: ",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)),
Expanded(
flex: 2,
child: Text(
records?.storeName ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)),
],
),
),
if (records.isShow)
Padding(
padding: EdgeInsets.only(
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
Expanded(
flex: 1,
child: Text(
"充值方式: ",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)),
Expanded(
flex: 2,
child: Text(
records?.rechargeName ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)),
],
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
Expanded(
flex: 1,
child: Text(
"入账时间: ",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)),
Expanded(
flex: 2,
child: Text(
records?.createTime ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)),
],
)),
],
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
records.isShow = !records.isShow;
});
},
child: Container(
padding:
EdgeInsets.symmetric(horizontal: 24.w, vertical: 6.h),
child: Icon(
records.isShow
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Color(0xFF0D0D0D),
size: 24,
)),
),
],
)
],
),
);
}
Widget rechargeFlowItemSm() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 12.h),
padding: EdgeInsets.only(
top: 13.h,
bottom: 16.h,
),
child: Column(
children: [
Container(
padding: EdgeInsets.only(
left: 12.h,
),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 60.w,
height: 18.h,
),
),
SizedBox(
width: 15.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 198.w,
height: 18.h,
),
),
],
),
),
Container(
height: 1.h,
width: double.infinity,
color: Color(0xFFF4F6F7),
margin: EdgeInsets.symmetric(vertical: 13.h),
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 60.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 77.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
),
],
)),
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 48.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 77.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 120.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 44.w,
height: 18.h,
),
),
),
],
)),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
margin: EdgeInsets.only(right: 24.w),
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 16.w,
height: 16.h,
),
),
],
)
],
),
);
}
Widget noNetwork() {
return Container(
margin: EdgeInsets.only(top: 120.h),
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),
)),
)
],
),
);
}
}

190
lib/business_system/order/business_order_page.dart

@ -1,12 +1,11 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:huixiang/business_system/order/ticket/ticket_page.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../utils/font_weight.dart';
import '../../view_widget/my_appbar.dart';
import '../../view_widget/my_tab.dart';
import 'order_list.dart';
import 'order_list_page.dart';
class BusinessOrderPage extends StatefulWidget {
final String storeId;
@ -20,73 +19,36 @@ class BusinessOrderPage extends StatefulWidget {
}
class _BusinessOrderPage extends State<BusinessOrderPage>
with AutomaticKeepAliveClientMixin {
with AutomaticKeepAliveClientMixin,SingleTickerProviderStateMixin{
final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
final TextEditingController editingController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
List<GlobalKey> _allKey = [];
String selectTimeDate = "";
String selectTimeDateNum =
"${DateFormat("yyyy年MM月dd日 00:00:00").format(DateTime.now().subtract(Duration(days: 2)))}"
"${DateFormat("yyyy年MM月dd日 23:59:59").format(DateTime.now())}";
TabController tabController;
@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;
//
tabController = TabController(length: 2, vsync: this);
tabController.addListener(() {
if (!tabController.indexIsChanging) {
FocusScope.of(context).requestFocus(FocusNode());
}
} else {
isKeyBoardShow = true;
}
});
});
loadFinish();
}
loadFinish() {
_allKey = [GlobalKey(), GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {});
}
///
@override
void dispose() {
_focusNode.unfocus();
super.dispose();
}
@override
Widget build(BuildContext context) {
super.build(context);
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Column(
children: [
orderSearch(),
Expanded(
child: Stack(
return Column(
children: [
Expanded(child:
DefaultTabController(
length: 4,
length: 2,
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title: "",
title:"",
leading: false,
background: Colors.white,
toolbarHeight: MediaQuery.of(context).size.height >= 750 ? (kToolbarHeight + 15.h) : kToolbarHeight,
bottom: TabBar(
// isScrollable: true, //
//
@ -100,143 +62,31 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
color: Color(0xFF666666)),
// controller: tabController,
color: Color(0xFF666666)
),
controller: tabController,
//
unselectedLabelColor: Color(0xffA29E9E),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text: "全部"),
MyTab(text: "未付款"),
MyTab(text: "已付款"),
MyTab(text: "已退款"),
MyTab(text:"订单列表"),
MyTab(text: "票券"),
],
),
),
body: TabBarView(
controller: tabController,
children: [
OrderList(_allKey[0], 0, widget.storeId,
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[1], 1, widget.storeId,
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[2], 2, widget.storeId,
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[3], 3, widget.storeId,
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
],
),
OrderListPage(widget.storeId),
TicketPage(widget.storeId)],
),
),
timeSelect(),
),),
],
),
),
SizedBox(
height: 76.h,
),
],
),
);
}
///
Widget orderSearch() {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/goods_search_page');
},
child: Container(
color: Colors.white,
child: Container(
height: 40.h,
margin: EdgeInsets.only(
left: 18.w,
right: 18.w,
top: 55.h,
),
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
child: TextField(
focusNode: _focusNode,
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
loadFinish();
},
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
controller: editingController,
decoration: InputDecoration(
hintText: "请输入订单ID",
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,
),
),
),
),
);
}
Widget timeSelect() {
return Container(
color: Colors.white,
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/custom_page').then((value) {
selectTimeDate = value;
loadFinish();
});
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
margin:
EdgeInsets.only(left: 18.w, right: 18.w, top: 12.h, bottom: 16.h),
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 12.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
("${selectTime().substring(0, 11)} ${selectTime().substring(21, 34)}"),
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
),
],
),
),
),
);
}
String selectTime() {
if (selectTimeDate == "" || selectTimeDate == null) {
return selectTimeDateNum;
} else
return selectTimeDate;
}
@override
bool get wantKeepAlive => true;
}

11
lib/business_system/order/order_list.dart

@ -334,9 +334,6 @@ class _OrderList extends State<OrderList> {
),
],
),
SizedBox(
height: 20.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
@ -367,7 +364,7 @@ class _OrderList extends State<OrderList> {
right: (adminOrderDtoList.payStatus == 1 &&
adminOrderDtoList.refundStatus == 0 && adminOrderDtoList.enableRefundApprover == false)
? 20.w
: 0),
: 0,top: 20.h),
child: Text(
"核销",
style: TextStyle(
@ -406,6 +403,7 @@ class _OrderList extends State<OrderList> {
),
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 14.w),
margin: EdgeInsets.only(top:20.h),
child: Text(
"申请退款",
style: TextStyle(
@ -419,13 +417,14 @@ class _OrderList extends State<OrderList> {
),
if(adminOrderDtoList.payStatus == 1 &&
adminOrderDtoList.refundStatus == 0 && adminOrderDtoList.enableRefundApprover == true)
Text(
Padding(padding: EdgeInsets.only(top:15.h),
child: Text(
"备注:暂无退款权限,请前往企业微信联系退款审核人员进行审批",
style: TextStyle(
fontSize: 12.sp,
color: Colors.red,
fontWeight: MyFontWeight.regular),
),
),),
],
),
),

232
lib/business_system/order/order_list_page.dart

@ -0,0 +1,232 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../utils/font_weight.dart';
import '../../view_widget/my_appbar.dart';
import '../../view_widget/my_tab.dart';
import 'order_list.dart';
class OrderListPage extends StatefulWidget {
final String storeId;
OrderListPage(this.storeId);
@override
State<StatefulWidget> createState() {
return _OrderListPage();
}
}
class _OrderListPage extends State<OrderListPage> {
final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
final TextEditingController editingController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
List<GlobalKey> _allKey = [];
String selectTimeDate = "";
String selectTimeDateNum =
"${DateFormat("yyyy年MM月dd日 00:00:00").format(DateTime.now().subtract(Duration(days: 2)))}"
"${DateFormat("yyyy年MM月dd日 23:59:59").format(DateTime.now())}";
@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;
}
});
});
loadFinish();
}
loadFinish() {
_allKey = [GlobalKey(), GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {});
}
///
@override
void dispose() {
_focusNode.unfocus();
super.dispose();
}
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Column(
children: [
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFD8D8D8),
),
orderSearch(),
timeSelect(),
Expanded(
child: DefaultTabController(
length: 4,
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title: "",
leading: false,
background: Colors.white,
// toolbarHeight: MediaQuery.of(context).size.height >= 750 ? (kToolbarHeight + 15.h) : kToolbarHeight,
bottom: TabBar(
// isScrollable: true, //
//
overlayColor: MaterialStateProperty.all(Colors.white),
indicatorColor: Color(0xFF30415B),
labelColor: Colors.black,
labelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
color: Color(0xFF666666)),
// controller: tabController,
//
unselectedLabelColor: Color(0xffA29E9E),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text: "全部"),
MyTab(text: "未付款"),
MyTab(text: "已付款"),
MyTab(text: "已退款"),
],
),
),
body: TabBarView(
children: [
OrderList(_allKey[0], 0, widget.storeId,
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[1], 1, widget.storeId,
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[2], 2, widget.storeId,
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
OrderList(_allKey[3], 3, widget.storeId,
editingController.text, selectTime(),MediaQuery.of(context).viewInsets.bottom != 0 ? isKeyBoardShow = true: isKeyBoardShow = false),
],
),
),
),
),
SizedBox(
height: 76.h,
),
],
),
);
}
///
Widget orderSearch() {
return Container(
color: Colors.white,
child: Container(
height: 40.h,
margin: EdgeInsets.only(
left: 18.w,
right: 18.w,
top: 6.h,
),
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
child: TextField(
focusNode: _focusNode,
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
loadFinish();
},
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
controller: editingController,
decoration: InputDecoration(
hintText: "请输入订单ID",
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,
),
),
),
);
}
Widget timeSelect() {
return Container(
color: Colors.white,
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/custom_page').then((value) {
selectTimeDate = value;
loadFinish();
});
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
margin:
EdgeInsets.only(left: 18.w, right: 18.w, top: 13.h,),
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 12.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
("${selectTime().substring(0, 11)} ${selectTime().substring(21, 34)}"),
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
),
],
),
),
),
);
}
String selectTime() {
if (selectTimeDate == "" || selectTimeDate == null) {
return selectTimeDateNum;
} else
return selectTimeDate;
}
}

6
lib/business_system/order/order_write_off.dart

@ -446,7 +446,7 @@ class _OrderWriteOff extends State<OrderWriteOff> {
);
}
///
////
Widget scanCodeInfoItem(TicketItemList ticketItemList) {
return Container(
width: double.infinity,
@ -478,7 +478,7 @@ class _OrderWriteOff extends State<OrderWriteOff> {
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
color: (ticketItemList.state == 1)
color: (ticketItemList.state == 1 && ticketDetails.state != 9)
? Color(0xFF30415B)
: Color(0xFFACACAC),
),
@ -487,7 +487,7 @@ class _OrderWriteOff extends State<OrderWriteOff> {
SizedBox(
height: 25.h,
),
if (ticketItemList.state == 1)
if (ticketItemList.state == 1 && ticketDetails.state != 9)
Checkbox(
value: ticketItemList.isSelect,
onChanged: (a) {

1
lib/business_system/order/request_refund.dart

@ -6,7 +6,6 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart';

612
lib/business_system/order/ticket/ticket_list.dart

@ -0,0 +1,612 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
import '../../../retrofit/data/base_data.dart';
import '../../../retrofit/data/ticket_details.dart';
import '../../../retrofit/data/ticket_show.dart';
import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
import '../../../view_widget/no_data_view.dart';
class TicketList extends StatefulWidget {
final String ticketState;
final String ticketType;
final String storeId;
final String keyword;
final bool typeScreen;
final bool stateScreen;
final bool isKeyBoardShow;
TicketList(Key key, this.ticketState, this.ticketType, this.storeId, this.keyword,this.typeScreen,this.stateScreen,
this.isKeyBoardShow)
: super(key: key);
@override
State<StatefulWidget> createState() {
return _TicketList();
}
}
class _TicketList extends State<TicketList> {
final RefreshController _refreshController = RefreshController();
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics();
final ScrollController controller = ScrollController();
BusinessApiService businessService;
List<TicketShowList> ticketShowList = [];
int _pageNum = 1;
String networkError = "";
int networkStatus = 0;
TicketDetails ticketDetails;
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh({bool isShowLoad = true}) async {
if (isShowLoad)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
await queryTicketList(isRefreshData: false);
EasyLoading.dismiss();
if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
setState(() {});
}
queryTicketList({String queryName,isRefreshData = true}) async {
try {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<TicketShow> baseData = await businessService.showList({
"pageNum": _pageNum,
"pageSize": 10,
"productId": 0,
"productSkuId": 0,
"searchKey": widget.keyword == "" ? (queryName ?? "") : widget.keyword,
"state": widget?.ticketState ?? "",
"storeId": widget?.storeId ?? "",
"ticketCode": "",
"ticketId": 0,
"ticketItemIds": [],
"type": widget?.ticketType ?? ""
}).catchError((error) {
networkError = AppUtils.dioErrorTypeToString(error.type);
networkStatus = -1;
setState(() {});
_refreshController.refreshFailed();
_refreshController.loadFailed();
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
ticketShowList.addAll(baseData?.data?.list ?? []);
if ((baseData?.data?.list ?? []).isEmpty ||
ticketShowList.length.toString() == baseData.data.total)
_refreshController.loadNoData();
else
_refreshController.loadComplete();
networkStatus = 1;
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
} finally {
if (isRefreshData) setState(() {});
}
}
///
queryTicketDetails(code) async {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<TicketDetails> baseData =
await businessService.ticketCode(code).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
ticketDetails = baseData.data;
if(ticketDetails.state != 9){
Navigator.of(context)
.pushNamed('/router/order_write_off', arguments: {
"ticketDetails": ticketDetails,
}).then((value) async {
queryTicketList(queryName: ticketDetails.name);
});
}
else{
Navigator.of(context)
.pushNamed('/router/order_write_off', arguments: {
"ticketDetails": ticketDetails,
});
}
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
return SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: ticketShowList.length == 0 ? false : true,
header: MyHeader(color: Color(0xFF30415B)),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
_pageNum = 1;
ticketShowList.clear();
_onRefresh(isShowLoad: false);
},
onLoading: () {
_pageNum++;
_onRefresh(isShowLoad: false);
},
child: networkStatus == -1
? noNetwork()
: ((networkStatus == 0)
? ListView.builder(
padding: EdgeInsets.zero,
itemCount: 10,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return ticketListSm();
},
)
: ((ticketShowList == null || ticketShowList.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),
)
: Padding(
padding: EdgeInsets.only(top: 16.h),
child: ListView.builder(
itemCount: ticketShowList?.length ?? 0,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (widget.isKeyBoardShow || widget.stateScreen == true || widget.typeScreen == true) {
FocusScope.of(context)
.requestFocus(FocusNode());
return;
} else {
queryTicketDetails(ticketShowList[position].code ?? "");
}
},
child: ticketListItem(ticketShowList[position],position),
);
},
),
))),
);
}
Widget ticketListItem(TicketShowList ticketShowList,index) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.h),
padding: EdgeInsets.symmetric(vertical: 12.h),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12.w, right: 12.w, bottom: 13.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
ticketShowList.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 14.sp,
color: Colors.black,
fontWeight: MyFontWeight.bold),
),
),
Text(
ticketState(index),
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFFFA5151),
fontWeight: MyFontWeight.bold),
)
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
),
Padding(
padding: EdgeInsets.only(top: 13.h, left: 12.w),
child: Row(
children: [
Text(
"联系人:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
SizedBox(
width: 26.w,
),
Text(
ticketShowList?.nickName ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
)
],
)),
Padding(
padding: EdgeInsets.only(top: 12.h, left: 12.w),
child: Row(
children: [
Text(
"手机号:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
SizedBox(
width: 26.w,
),
Text(
ticketShowList?.userPhone ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
)
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
margin: EdgeInsets.symmetric(vertical: 12.h),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
Text(
"票券编号: ",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
Expanded(
child: Text(
ticketShowList?.code ??"",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.regular),
)),
Text(
ticketShowList?.amount ??"",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.bold),
)
],
)),
if(ticketShowList.state == 1 || ticketShowList?.state == 2)
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
queryTicketDetails(ticketShowList.code ?? "");
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFF30415B),
borderRadius: BorderRadius.circular(4),
),
padding:
EdgeInsets.symmetric(vertical: 5.h, horizontal: 26.w),
margin: EdgeInsets.only(top: 16.h, right:12.w),
child: Text(
"核销",
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
fontWeight: MyFontWeight.regular),
),
),
)
],
),
],
),
);
}
String ticketState(index){
if (ticketShowList[index].state == 1 || ticketShowList[index].state == 2) {
return "可使用";
} else if (ticketShowList[index].state == 7) {
return "已取消";
} else if (ticketShowList[index].state == 8) {
return "已失效";
}else if (ticketShowList[index].state == 9) {
return "已使用";
}
}
Widget ticketListSm() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.all(16),
padding: EdgeInsets.symmetric(vertical: 12.h),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12.w, right: 12.w, bottom: 13.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 154.w,
height: 18.h,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 42.w,
height: 18.h,
),
),
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
),
Padding(
padding: EdgeInsets.only(top: 13.h, left: 12.w),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 40.w,
height: 17.h,
),
),
SizedBox(
width: 26.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 24.w,
height: 17.h,
),
),
],
)),
Padding(
padding: EdgeInsets.only(top: 12.h, left: 12.w),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 40.w,
height: 17.h,
),
),
SizedBox(
width: 26.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 77.w,
height: 17.h,
),
),
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
margin: EdgeInsets.symmetric(vertical: 12.h),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 17.h,
),
),
SizedBox(width:14.w,),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 115.w,
height: 17.h,
),
),
],
)),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
margin: EdgeInsets.only(right: 20.w,top:16.h),
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 76.w,
height: 27.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),
)),
)
],
),
);
}
}

634
lib/business_system/order/ticket/ticket_page.dart

@ -0,0 +1,634 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/business_system/order/ticket/ticket_list.dart';
import 'package:huixiang/business_system/order/ticket/ticket_records_page.dart';
import 'package:huixiang/business_system/order/ticket/ticket_statistics_page.dart';
import 'package:huixiang/business_system/order/ticket/ticket_tab.dart';
import 'package:intl/intl.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../utils/font_weight.dart';
import '../../../view_widget/my_appbar.dart';
import '../../../view_widget/my_tab.dart';
class TicketPage extends StatefulWidget {
final String storeId;
TicketPage(this.storeId);
@override
State<StatefulWidget> createState() {
return _TicketPage();
}
}
class _TicketPage extends State<TicketPage>
with SingleTickerProviderStateMixin {
final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
final TextEditingController editingController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
List<GlobalKey> _allKey = [];
String selectTimeDate = "";
String selectTimeDateNum =
"${DateFormat("yyyy年MM月dd日 00:00:00").format(DateTime.now().subtract(Duration(days:5)))}"
"${DateFormat("yyyy年MM月dd日 23:59:59").format(DateTime.now())}";
bool typeScreen = false;
bool stateScreen = false;
String ticketType;
String ticketState = "-1";
TabController tabController;
@override
void initState() {
super.initState();
tabController = TabController(length: 3, vsync: this);
tabController.addListener(() {
if (!tabController.indexIsChanging) {
setState(() {});
FocusScope.of(context).requestFocus(FocusNode());
}
});
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;
}
});
});
loadFinish();
}
loadFinish() {
_allKey = [GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {});
}
///
@override
void dispose() {
_focusNode.unfocus();
super.dispose();
}
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Stack(
children: [
Column(
children: [
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFD8D8D8),
),
ticketSearch(),
tabController.index == 0 ? screen() : timeSelect(),
Expanded(
child: DefaultTabController(
length: 3,
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title: "",
leading: false,
background: Colors.white,
bottom: TabBar(
// isScrollable: true, //
//
overlayColor: MaterialStateProperty.all(Colors.white),
indicator: const TicketTab(
width: 33,
borderSide: BorderSide(
width: 2.0, color: Color(0xFF30415B))),
labelColor: Colors.black,
labelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
color: Color(0xFF666666)),
controller: tabController,
//
unselectedLabelColor: Color(0xFF0D0D0D),
//
tabs: <Widget>[
MyTab(text: "票券列表"),
MyTab(text: "核销记录"),
MyTab(text: "核销统计"),
],
),
),
body: TabBarView(
controller: tabController,
children: [
TicketList(
_allKey[0],
ticketState == "-1" ? "0" : ticketState,
ticketType,
widget.storeId,
editingController.text,
typeScreen,
stateScreen,
MediaQuery.of(context).viewInsets.bottom != 0
? isKeyBoardShow = true
: isKeyBoardShow = false),
TicketRecordPage(
_allKey[1],
1,
widget.storeId,
editingController.text,
(selectTimeDate == "" || selectTimeDate == null) ? "" :selectTimeDate,
MediaQuery.of(context).viewInsets.bottom != 0
? isKeyBoardShow = true
: isKeyBoardShow = false),
TicketStatisticsPage(
_allKey[2],
2,
widget.storeId,
editingController.text,
selectTime(),
MediaQuery.of(context).viewInsets.bottom != 0
? isKeyBoardShow = true
: isKeyBoardShow = false),
],
),
),
),
),
SizedBox(
height: 76.h,
),
],
),
Container(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (typeScreen && tabController.index == 0)
Expanded(
child: Container(
height: 176.h,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Color(0x29000000),
width: 0.5.w,
),
borderRadius: BorderRadius.circular(2),
),
margin: EdgeInsets.only(top: 108.h),
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 8.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
ticketType = "";
typeScreen = false;
loadFinish();
});
},
child: Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(vertical: 8.h),
child: Text(
"所有",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
)),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
ticketType = "ADOPT_WARRANT";
typeScreen = false;
loadFinish();
});
},
child: Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(vertical: 8.h),
child: Text(
"认领凭证",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
ticketType = "IDENTITY_CARD";
typeScreen = false;
loadFinish();
});
},
child: Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(vertical: 8.h),
child: Text(
"身份卡片",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
ticketType = "NORMAL";
typeScreen = false;
loadFinish();
});
},
child: Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(vertical: 8.h),
child: Text(
"常规票券",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
))),
],
))),
if (!typeScreen || !stateScreen) Expanded(child: Container()),
SizedBox(
width: 14.w,
),
if (stateScreen && tabController.index == 0)
Expanded(
child: Container(
height: 210.h,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Color(0x29000000),
width: 0.5.w,
),
borderRadius: BorderRadius.circular(2),
),
margin: EdgeInsets.only(top: 108.h),
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 8.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
ticketState = "0";
stateScreen = false;
loadFinish();
});
},
child: Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(vertical: 8.h),
child: Text(
"全部",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
))),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
ticketState = "1";
stateScreen = false;
loadFinish();
});
},
child: Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(vertical: 8.h),
child: Text(
"可使用",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
ticketState = "7";
stateScreen = false;
loadFinish();
});
},
child: Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(vertical: 8.h),
child: Text(
"已取消",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
ticketState = "8";
stateScreen = false;
loadFinish();
});
},
child: Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(vertical: 8.h),
child: Text(
"已失效",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
ticketState = "9";
stateScreen = false;
loadFinish();
});
},
child: Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(vertical: 8.h),
child: Text(
"已使用",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
),
)),
],
))),
],
),
),
],
),
);
}
///
Widget ticketSearch() {
return Container(
color: Colors.white,
child: Container(
height: 40.h,
margin:
EdgeInsets.only(left: 18.w, right: 18.w, top: 6.h, bottom: 13.h),
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
child: TextField(
focusNode: _focusNode,
textInputAction: TextInputAction.search,
onTap: () {
typeScreen = false;
stateScreen = false;
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
loadFinish();
},
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,
),
),
),
);
}
///
Widget screen() {
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.only(left: 18.w, right: 18.w),
child: Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
typeScreen = !typeScreen;
FocusScope.of(context).requestFocus(FocusNode());
stateScreen = false;
});
},
child: Container(
decoration: BoxDecoration(
color: Color(0XFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
padding: EdgeInsets.symmetric(horizontal: 9.w, vertical: 11.h),
child: Row(
children: [
Expanded(
child: Text(
ticketType == null ? "类型筛选" : shopTypeSelect(),
style: TextStyle(
color: Color(0xFF808080),
fontSize: 18.sp,
fontWeight: MyFontWeight.regular),
)),
Icon(
(typeScreen != null && !typeScreen)
? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_up,
color: Color(0xFF808080),
size: 24,
),
],
),
),
),
),
SizedBox(
width: 14.w,
),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
stateScreen = !stateScreen;
FocusScope.of(context).requestFocus(FocusNode());
typeScreen = false;
});
},
child: Container(
decoration: BoxDecoration(
color: Color(0XFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
padding:
EdgeInsets.symmetric(horizontal: 9.w, vertical: 11.h),
child: Row(
children: [
Expanded(
child: Text(
ticketState == "-1" ? "状态筛选" : shopStateSelect(),
style: TextStyle(
color: Color(0xFF808080),
fontSize: 18.sp,
fontWeight: MyFontWeight.regular),
)),
Icon(
(stateScreen != null && !stateScreen)
? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_up,
color: Color(0xFF808080),
size: 24,
),
],
),
))),
],
),
);
}
///
String shopTypeSelect() {
if (ticketType == "") {
return "所有";
} else if (ticketType == "ADOPT_WARRANT") {
return "认领凭证";
} else if (ticketType == "IDENTITY_CARD") {
return "身份卡片";
} else if (ticketType == "NORMAL") {
return "常规票券";
}
}
///
String shopStateSelect() {
if (ticketState == "0") {
return "全部";
} else if (ticketState == "1") {
return "可使用";
} else if (ticketState == "7") {
return "已取消";
} else if (ticketState == "8") {
return "已失效";
} else if (ticketState == "9") {
return "已使用";
}
}
///
Widget timeSelect() {
return Container(
color: Colors.white,
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/custom_page').then((value) {
selectTimeDate = value;
loadFinish();
});
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
margin: EdgeInsets.only(
left: 18.w,
right: 18.w,
),
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 12.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
(tabController.index == 1 && (selectTimeDate == "" || selectTimeDate == null)) ? "开始时间 至 结束时间" :"${selectTime().substring(0, 11)} ${selectTime().substring(21, 34)}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
),
],
),
),
),
);
}
String selectTime() {
if (selectTimeDate == "" || selectTimeDate == null) {
return selectTimeDateNum;
} else
return selectTimeDate;
}
}

622
lib/business_system/order/ticket/ticket_records_page.dart

@ -0,0 +1,622 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
import '../../../retrofit/data/base_data.dart';
import '../../../retrofit/data/ticket_record.dart';
import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
import '../../../view_widget/no_data_view.dart';
class TicketRecordPage extends StatefulWidget {
final int status;
final String storeId;
final String keyword;
final String time;
final bool isKeyBoardShow;
TicketRecordPage(Key key, this.status, this.storeId, this.keyword, this.time,
this.isKeyBoardShow)
: super(key: key);
@override
State<StatefulWidget> createState() {
return _TicketRecordPage();
}
}
class _TicketRecordPage extends State<TicketRecordPage> {
final RefreshController _refreshController = RefreshController();
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics();
final ScrollController controller = ScrollController();
BusinessApiService businessService;
List<TicketRecordList> ticketRecordList = [];
int _pageNum = 1;
String networkError = "";
int networkStatus = 0;
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh({bool isShowLoad = true}) async {
if (isShowLoad)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
await queryRecordsList(isRefreshData: false);
EasyLoading.dismiss();
if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
setState(() {});
}
queryRecordsList({isRefreshData = true}) async {
try {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<TicketRecord> baseData = await businessService.wipedRecord({
"pageNum":_pageNum,
"pageSize": 10,
"searchKey": widget?.keyword ?? "",
"startTime": widget.time == "" ? "" :widget.time
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 19),
"endTime": widget.time == "" ? "" :widget.time
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(widget.time.length >= 21 ? 22 : 0,
widget.time.length >= 21 ? 41 : 0),
}).catchError((error) {
networkError = AppUtils.dioErrorTypeToString(error.type);
networkStatus = -1;
setState(() {});
_refreshController.refreshFailed();
_refreshController.loadFailed();
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
ticketRecordList.addAll(baseData?.data?.list ?? []);
if ((baseData?.data?.list ?? []).isEmpty ||
ticketRecordList.length.toString() == baseData.data.total)
_refreshController.loadNoData();
else
_refreshController.loadComplete();
networkStatus = 1;
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
} finally {
if (isRefreshData) setState(() {});
}
}
@override
Widget build(BuildContext context) {
return SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: ticketRecordList.length == 0 ? false : true,
header: MyHeader(color: Color(0xFF30415B)),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
_pageNum = 1;
ticketRecordList.clear();
_onRefresh(isShowLoad: false);
},
onLoading: () {
_pageNum++;
_onRefresh(isShowLoad: false);
},
child: networkStatus == -1
? noNetwork()
: ((networkStatus==0)
? ListView.builder(
padding: EdgeInsets.zero,
itemCount: 10,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return recordsSm();
},
)
: ((ticketRecordList == null || ticketRecordList.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),
)
: Padding(
padding: EdgeInsets.only(top: 16.h),
child: ListView.builder(
itemCount: ticketRecordList?.length ?? 0,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (widget.isKeyBoardShow)
FocusScope.of(context)
.requestFocus(FocusNode());
return;
},
child: recordsItem(ticketRecordList[position],position),
);
},
),
))),
);
}
Widget recordsItem(TicketRecordList ticketRecordList,index) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.h),
padding: EdgeInsets.symmetric(vertical: 12.h),
child: Column(
children: [
Padding(padding:EdgeInsets.only(left: 12.w,right: 18.w,bottom:13.h),
child: Row(
children: [
Expanded(child:Text(
ticketRecordList?.ticketName ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 14.sp,
color: Colors.black,
fontWeight: MyFontWeight.bold),
)),
Text(
"核销次数: ${ticketRecordList?.ticketItems[0]?.canWipedNumber ?? "0"}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
)
],
),),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
),
Padding(padding:EdgeInsets.only(top:13.h,left:12.w),
child:Row(
children: [
Text(
"联系人:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
),
SizedBox(width: 26.w,),
Text(
ticketRecordList?.userName ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)
],
)),
Padding(padding:EdgeInsets.only(top:12.h,left:12.w),
child:Row(
children: [
Text(
"手机号:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
),
Text(
ticketRecordList?.userPhone ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)
],
),),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
margin: EdgeInsets.symmetric(vertical:12.h),
),
Padding(padding:EdgeInsets.only(left:12.w),
child:Row(
children: [
Text(
"核销店铺:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
SizedBox(width: 14.w,),
Text(
ticketRecordList?.wipedUserName ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.regular),
)
],
)),
Padding(padding:EdgeInsets.only(left:12.w),
child:Row(
children: [
Text(
"票券编号:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
SizedBox(width: 14.w,),
Text(
ticketRecordList?.ticketCode ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.regular),
)
],
)),
Padding(padding:EdgeInsets.symmetric(horizontal:12.w),
child:Row(
children: [
Text(
"核销时间:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
SizedBox(width: 14.w,),
Expanded(child:Text(
ticketRecordList?.ticketItems[0]?.finishTime ??"",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.regular),
)),
Text(
ticketRecordList?.ticket?.amount ??"",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.bold),
)
],
)),
],
),
);
}
Widget recordsSm() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.all(16),
padding: EdgeInsets.symmetric(vertical: 12.h),
child: Column(
children: [
Padding(padding:EdgeInsets.only(left: 12.w,right: 18.w,bottom:13.h),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 154.w,
height: 18.h,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 10.w,
height: 18.h,
margin: EdgeInsets.only(left: 14.w),
),
),
],
),),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
),
Padding(padding:EdgeInsets.only(top:13.h,left:12.w),
child:Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 40.w,
height: 18.h,
),
),
SizedBox(width: 26.w,),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 24.w,
height: 18.h,
),
),
],
)),
Padding(padding:EdgeInsets.only(top:12.h,left:12.w),
child:Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 40.w,
height: 18.h,
),
),
SizedBox(width: 26.w,),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 77.w,
height: 18.h,
),
),
],
),),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
margin: EdgeInsets.symmetric(vertical:12.h),
),
Container(
padding:EdgeInsets.only(left:12.w),
margin: EdgeInsets.only(bottom: 6.h),
child:Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
SizedBox(width: 14.w,),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 84.w,
height: 18.h,
),
),
],
)),
Container(padding:EdgeInsets.only(left:12.w),
margin: EdgeInsets.only(bottom: 6.h),
child:Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
SizedBox(width: 14.w,),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 107.w,
height: 18.h,
),
),
],
)),
Padding(padding:EdgeInsets.symmetric(horizontal:12.w),
child:Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
SizedBox(width: 14.w,),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 107.w,
height: 18.h,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 36.w,
height: 18.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),
)),
)
],
),
);
}
}

588
lib/business_system/order/ticket/ticket_statistics_page.dart

@ -0,0 +1,588 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
import '../../../retrofit/data/base_data.dart';
import '../../../retrofit/data/ticket_stats_list.dart';
import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
import '../../../view_widget/no_data_view.dart';
class TicketStatisticsPage extends StatefulWidget {
final int status;
final String storeId;
final String keyword;
final String time;
final bool isKeyBoardShow;
TicketStatisticsPage(Key key, this.status, this.storeId, this.keyword,
this.time, this.isKeyBoardShow)
: super(key: key);
@override
State<StatefulWidget> createState() {
return _TicketStatisticsPage();
}
}
class _TicketStatisticsPage extends State<TicketStatisticsPage> {
final RefreshController _refreshController = RefreshController();
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics();
final ScrollController controller = ScrollController();
BusinessApiService businessService;
List<InfoList> _infoList = [];
String networkError = "";
int networkStatus = 0;
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override
void initState() {
super.initState();
queryStatsList();
}
queryStatsList({isLoading = true}) async {
try {
if (isLoading)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<List<TicketStatsList>> baseData =
await businessService.wipedStats({
"searchKey": widget?.keyword ?? "",
"startDate": widget.time
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"endDate": widget.time
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(widget.time.length >= 21 ? 22 : 0,
widget.time.length >= 21 ? 32 : 0),
}).catchError((error) {
networkError = AppUtils.dioErrorTypeToString(error.type);
networkStatus = -1;
_refreshController.refreshFailed();
_refreshController.loadFailed();
});
_infoList.clear();
if (baseData != null && baseData.isSuccess) {
baseData.data.forEach((e1) {
e1.infoList.forEach((e2) {
e2.wipedDate = e1.wipedDate;
_infoList.add(e2);
});
});
networkStatus = 1;
_refreshController.refreshCompleted();
_refreshController.loadComplete();
}
} finally {
if (isLoading) setState(() {});
EasyLoading.dismiss();
}
}
@override
Widget build(BuildContext context) {
return SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(color: Color(0xFF30415B)),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
queryStatsList(isLoading: false);
},
child: networkStatus == -1
? noNetwork()
: ((networkStatus == 0)
? ListView.builder(
padding: EdgeInsets.zero,
itemCount: 10,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return statisticsSm();
},
)
: ((_infoList.isEmpty)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
iconHeight: 120.h,
margin: EdgeInsets.all(50.h),
)
: Padding(
padding: EdgeInsets.only(top: 16.h),
child: ListView.builder(
itemCount: _infoList.length,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (widget.isKeyBoardShow)
FocusScope.of(context)
.requestFocus(FocusNode());
return;
},
child: statisticsItem(_infoList[position]),
);
},
),
))),
);
}
Widget statisticsItem(InfoList infoList) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.h),
padding: EdgeInsets.symmetric(vertical: 12.h),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12.w, right: 18.w, bottom: 13.h),
child: Row(
children: [
Expanded(
child: Text(
infoList?.ticketName ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 14.sp,
color: Colors.black,
fontWeight: MyFontWeight.bold),
)),
Text(
"核销次数: ${infoList?.wipedNumber ?? 0}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
)
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
),
Padding(
padding: EdgeInsets.only(top: 13.h, left: 12.w),
child: Row(
children: [
Text(
"核销项:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
),
SizedBox(
width: 13.w,
),
Text(
infoList?.ticketItemName ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)
],
)),
Padding(
padding: EdgeInsets.only(top: 12.h, left: 12.w),
child: Row(
children: [
Text(
"手机号:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
),
SizedBox(
width: 13.w,
),
Text(
"12323227890",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
margin: EdgeInsets.symmetric(vertical: 12.h),
),
Padding(
padding: EdgeInsets.only(left: 12.w),
child: Row(
children: [
Text(
"核销时间 :",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
SizedBox(
width: 14.w,
),
Text(
infoList?.wipedDate ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.regular),
)
],
)),
],
),
);
}
Widget statisticsSm() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.all(16),
padding: EdgeInsets.symmetric(vertical: 12.h),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12.w, right: 18.w, bottom: 13.h),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 154.w,
height: 18.h,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 10.w,
height: 18.h,
margin: EdgeInsets.only(left: 14.w),
),
),
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
),
Padding(
padding: EdgeInsets.only(top: 13.h, left: 12.w),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 40.w,
height: 18.h,
),
),
SizedBox(
width: 26.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 24.w,
height: 18.h,
),
),
],
)),
Padding(
padding: EdgeInsets.only(top: 12.h, left: 12.w),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 40.w,
height: 18.h,
),
),
SizedBox(
width: 26.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 77.w,
height: 18.h,
),
),
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
margin: EdgeInsets.symmetric(vertical: 12.h),
),
Container(
padding: EdgeInsets.only(left: 12.w),
margin: EdgeInsets.only(bottom: 6.h),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
SizedBox(
width: 14.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 84.w,
height: 18.h,
),
),
],
)),
Container(
padding: EdgeInsets.only(left: 12.w),
margin: EdgeInsets.only(bottom: 6.h),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
SizedBox(
width: 14.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 107.w,
height: 18.h,
),
),
],
)),
Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 52.w,
height: 18.h,
),
),
SizedBox(
width: 14.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 107.w,
height: 18.h,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 36.w,
height: 18.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: () {
queryStatsList();
},
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),
)),
)
],
),
);
}
}

106
lib/business_system/order/ticket/ticket_tab.dart

@ -0,0 +1,106 @@
import 'package:flutter/material.dart';
class TicketTab extends Decoration {
/// Create an underline style selected tab indicator.
///
/// The [borderSide] and [insets] arguments must not be null.
const TicketTab({
this.width = 20,
this.strokeCap = StrokeCap.round,
this.borderSide = const BorderSide(width: 2.0, color: Colors.white),
this.insets = EdgeInsets.zero,
}) : assert(borderSide != null),
assert(insets != null);
/// The color and weight of the horizontal line drawn below the selected tab.
final BorderSide borderSide;
/// Locates the selected tab's underline relative to the tab's boundary.
///
/// The [TabBar.indicatorSize] property can be used to define the tab
/// indicator's bounds in terms of its (centered) tab widget with
/// [TabBarIndicatorSize.label], or the entire tab with
/// [TabBarIndicatorSize.tab].
final EdgeInsetsGeometry insets;
///
final double width; //
final StrokeCap strokeCap; //
@override
Decoration lerpFrom(Decoration a, double t) {
if (a is TicketTab) {
return TicketTab(
borderSide: BorderSide.lerp(a.borderSide, borderSide, t),
insets: EdgeInsetsGeometry.lerp(a.insets, insets, t),
);
}
return super.lerpFrom(a, t);
}
@override
Decoration lerpTo(Decoration b, double t) {
if (b is TicketTab) {
return TicketTab(
borderSide: BorderSide.lerp(borderSide, b.borderSide, t),
insets: EdgeInsetsGeometry.lerp(insets, b.insets, t),
);
}
return super.lerpTo(b, t);
}
@override
BoxPainter createBoxPainter([VoidCallback onChanged]) {
return _UnderlinePainter(this, onChanged);
}
///
Rect _indicatorRectFor(Rect rect, TextDirection textDirection) {
assert(rect != null);
assert(textDirection != null);
final Rect indicator = insets.resolve(textDirection).deflateRect(rect);
//
double wantWidth = this.width;
//
double cw = (indicator.left + indicator.right) / 2;
print(
'$cw,indicator left${indicator.left}, right ${indicator.right}, indicator top ${indicator.top},indicator bottom${indicator.bottom}, border width${borderSide.width}');
// //线
// return Rect.fromLTWH(indicator.left,
// indicator.bottom - borderSide.width, wantWidth, borderSide.width);
//线
return Rect.fromLTWH(cw - wantWidth / 2,
indicator.bottom - borderSide.width, wantWidth, borderSide.width);
}
@override
Path getClipPath(Rect rect, TextDirection textDirection) {
return Path()..addRect(_indicatorRectFor(rect, textDirection));
}
}
class _UnderlinePainter extends BoxPainter {
_UnderlinePainter(this.decoration, VoidCallback onChanged)
: assert(decoration != null),
super(onChanged);
final TicketTab decoration;
///
@override
void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) {
assert(configuration != null);
assert(configuration.size != null);
final Rect rect = offset & configuration.size;
final TextDirection textDirection = configuration.textDirection;
final Rect indicator = decoration
._indicatorRectFor(rect, textDirection)
.deflate(decoration.borderSide.width / 2.0);
final Paint paint = decoration.borderSide.toPaint()
..strokeCap = decoration.strokeCap; //
canvas.drawLine(indicator.bottomLeft, indicator.bottomRight, paint);
}
}

25
lib/business_system/scan_code_page.dart

@ -116,31 +116,6 @@ class _ScanCodePage extends State<ScanCodePage> {
),
),
Spacer(),
// Expanded(child:Text(
// S.of(context).saoma,
// style: TextStyle(
// color: Colors.white,
// fontSize: 18.sp,
// fontWeight: FontWeight.bold,
// ),
// )),
// GestureDetector(
// behavior: HitTestBehavior.opaque,
// onTap: () {
// pickImage();
// },
// child:Container(
// padding: EdgeInsets.symmetric(horizontal:10.w),
// child: Text(
// S.of(context).xiangce,
// style: TextStyle(
// color: Colors.white,
// fontSize: 18.sp,
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
// ),
],
),
),

1
lib/home/main_home_page.dart

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/home/activity_list_page.dart';
import 'package:huixiang/home/home_page.dart';
import 'package:huixiang/home/points_mall_page.dart';
import 'package:huixiang/main.dart';
import 'package:huixiang/utils/event_type.dart';

3
lib/main.dart

@ -98,6 +98,7 @@ import 'business_system/goods/on_sale/goods_sort.dart';
import 'business_system/home/flow_page.dart';
import 'business_system/home/select_shop.dart';
import 'business_system/home/overview/trade_overview_page.dart';
import 'business_system/home/vip/business_vip_page.dart';
import 'business_system/login/business_login_page.dart';
import 'business_system/mine/account_information.dart';
import 'business_system/mine/merchant_info.dart';
@ -512,4 +513,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
ShopImageInfo(arguments:arguments),
'/router/scan_code_page': (context, {arguments}) =>
ScanCodePage(arguments:arguments),
'/router/business_vip_page': (context, {arguments}) =>
BusinessVipPage(arguments:arguments),
};

67
lib/retrofit/business_api.dart

@ -12,18 +12,24 @@ import 'package:huixiang/retrofit/data/order_trend.dart';
import 'package:huixiang/retrofit/data/vip_counts_info.dart';
import 'package:retrofit/retrofit.dart';
import 'data/balance_change_list.dart';
import 'data/base_data.dart';
import 'data/business_goods.dart';
import 'data/business_order_detail_info.dart';
import 'data/business_order_list.dart';
import 'data/business_store_list.dart';
import 'data/business_vip_list.dart';
import 'data/day_flow_list.dart';
import 'data/goods_type_sales_list.dart';
import 'data/popular_sales_list.dart';
import 'data/product_group_list.dart';
import 'data/recharge_flow_list.dart';
import 'data/refund_reason_list.dart';
import 'data/single_sales_list.dart';
import 'data/ticket_details.dart';
import 'data/ticket_record.dart';
import 'data/ticket_show.dart';
import 'data/ticket_stats_list.dart';
import 'data/trade_summary_list.dart';
import 'data/upload_result.dart';
@ -210,55 +216,76 @@ abstract class BusinessApiService {
///
@PUT("user")
Future<BaseData> modifyPassword(
@Body() Map<String, dynamic> param);
Future<BaseData> modifyPassword(@Body() Map<String, dynamic> param);
///
@POST("product/putStatus")
Future<BaseData> goodsUpdate(
@Body() Map<String, dynamic> param);
Future<BaseData> goodsUpdate(@Body() Map<String, dynamic> param);
///
@POST("product/delProduct")
Future<BaseData> delProduct(
@Body() Map<String, dynamic> param);
Future<BaseData> delProduct(@Body() Map<String, dynamic> param);
////-/
@POST("productGroup/saveProductGroup")
Future<BaseData> saveProductGroup(
@Body() Map<String, dynamic> param);
Future<BaseData> saveProductGroup(@Body() Map<String, dynamic> param);
///
@POST("productGroup/delProductCategory")
Future<BaseData> delProductCategory(
@Body() Map<String, dynamic> param);
Future<BaseData> delProductCategory(@Body() Map<String, dynamic> param);
///-
@GET("store/getStoreList?tenantCode={tenantCode}&pageIndex={pageIndex}&pageSize={pageSize}")
Future<BaseData<BusinessStoreList>> getStoreList(@Path("tenantCode") String tenantCode, @Path("pageIndex") String pageIndex, @Path("pageSize") String pageSize);
@GET(
"store/getStoreList?tenantCode={tenantCode}&pageIndex={pageIndex}&pageSize={pageSize}")
Future<BaseData<BusinessStoreList>> getStoreList(
@Path("tenantCode") String tenantCode,
@Path("pageIndex") String pageIndex,
@Path("pageSize") String pageSize);
///
@PUT("store")
Future<BaseData> saveStoreInfo(
@Body() Map<String, dynamic> param);
Future<BaseData> saveStoreInfo(@Body() Map<String, dynamic> param);
///
@POST("file/upload")
@MultiPart()
Future<BaseData<UploadResult>> upload(@Part(name: "file") File data,
@Part(name: "folderId") int folderId);
Future<BaseData<UploadResult>> upload(
@Part(name: "file") File data, @Part(name: "folderId") int folderId);
///
@POST("ticket/wipedBatchs")
Future<BaseData> wipedBatchs(
@Body() String param);
Future<BaseData> wipedBatchs(@Body() String param);
////
@POST("product/productSortTop")
Future<BaseData> productSortTop(
@Body() Map<String, dynamic> param);
Future<BaseData> productSortTop(@Body() Map<String, dynamic> param);
///
@GET("ticket/code/{code}")
Future<BaseData<TicketDetails>> ticketCode(@Path("code") String code);
///
@POST("ticket/showList")
Future<BaseData<TicketShow>> showList(@Body() Map<String, dynamic> param);
///
@POST("ticket/wipedRecord")
Future<BaseData<TicketRecord>> wipedRecord(@Body() Map<String, dynamic> param);
///
@POST("ticket/wipedStats")
Future<BaseData<List<TicketStatsList>>> wipedStats(
@Body() Map<String, dynamic> param);
///
@POST("member/page")
Future<BaseData<BusinessVipList>> vipDataList(@Body() Map<String, dynamic> param);
///
@POST("audit/memberSourceRechargeDetial")
Future<BaseData<RechargeFlowList>> rechargeFlow(@Body() Map<String, dynamic> param);
///
@POST("member/getTenantMemberBill")
Future<BaseData<BalanceChangeList>> getTenantMemberBill(@Body() Map<String, dynamic> param);
}

141
lib/retrofit/business_api.g.dart

@ -624,4 +624,145 @@ class _BusinessApiService implements BusinessApiService {
);
return value;
}
@override
Future<BaseData<TicketShow>> showList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'ticket/showList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<TicketShow>.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : TicketShow.fromJson(json),
);
return value;
}
@override
Future<BaseData<TicketRecord>> wipedRecord(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'ticket/wipedRecord',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<TicketRecord>.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : TicketRecord.fromJson(json),
);
return value;
}
@override
Future<BaseData<List<TicketStatsList>>> wipedStats(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'ticket/wipedStats',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<TicketStatsList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<TicketStatsList>(
(i) => TicketStatsList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<BusinessVipList>> vipDataList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'member/page',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<BusinessVipList>.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : BusinessVipList.fromJson(json),
);
return value;
}
@override
Future<BaseData<RechargeFlowList>> rechargeFlow(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'audit/memberSourceRechargeDetial',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<RechargeFlowList>.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : RechargeFlowList.fromJson(json),
);
return value;
}
@override
Future<BaseData<BalanceChangeList>> getTenantMemberBill(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'member/getTenantMemberBill',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<BalanceChangeList>.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : BalanceChangeList.fromJson(json),
);
return value;
}
}

367
lib/retrofit/data/balance_change_list.dart

File diff suppressed because one or more lines are too long

374
lib/retrofit/data/business_vip_list.dart

@ -0,0 +1,374 @@
/// records : [{"id":"1730229003043733504","createTime":"2023-11-30 22:15:15","createUser":"0","updateTime":"2023-11-30 22:15:15","updateUser":"0","mid":null,"openid":"otrgp5C7qpd-V2AHosRZOnN4NoEM","nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-30 22:15:15","loginNum":1,"tenantCode":"1195","phone":"","source":0,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false},{"id":"1729813919708479488","createTime":"2023-11-29 18:45:52","createUser":"0","updateTime":"2023-11-29 18:45:52","updateUser":"0","mid":null,"openid":"otrgp5Brxv8c7fdZbIjmbUEaLBVM","nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-29 18:45:52","loginNum":2,"tenantCode":"1195","phone":"","source":0,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false},{"id":"1729685559346987008","createTime":"2023-11-29 10:15:48","createUser":"0","updateTime":"2023-11-29 10:15:48","updateUser":"0","mid":null,"openid":"otrgp5M6pxBus4Ykh1XdeHHLiFBA","nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-29 10:15:48","loginNum":1,"tenantCode":"1195","phone":"","source":0,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false},{"id":"1729685558696869888","createTime":"2023-11-29 10:15:48","createUser":"0","updateTime":"2023-11-29 10:15:48","updateUser":"0","mid":null,"openid":"otrgp5M6pxBus4Ykh1XdeHHLiFBA","nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-29 10:15:48","loginNum":1,"tenantCode":"1195","phone":"","source":0,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false},{"id":"1729062974783488000","createTime":"2023-11-27 17:01:52","createUser":"0","updateTime":"2023-11-27 17:01:52","updateUser":"0","mid":null,"openid":null,"nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-27 17:01:52","loginNum":0,"tenantCode":"1195","phone":"","source":1,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false},{"id":"1728984020596817920","createTime":"2023-11-27 11:48:08","createUser":"0","updateTime":"2023-11-27 11:48:08","updateUser":"0","mid":null,"openid":"otrgp5GG69LQo1_xaPpxNnpnds7A","nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-27 11:48:08","loginNum":1,"tenantCode":"1195","phone":"","source":0,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false},{"id":"1728980774142607360","createTime":"2023-11-27 11:35:14","createUser":"0","updateTime":"2023-11-27 11:35:14","updateUser":"0","mid":null,"openid":"otrgp5NcFDlLRPi7RPpFolajayLQ","nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-27 11:35:14","loginNum":1,"tenantCode":"1195","phone":"","source":0,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false},{"id":"1728297227396317184","createTime":"2023-11-25 14:19:04","createUser":"0","updateTime":"2023-11-25 14:19:04","updateUser":"0","mid":null,"openid":"otrgp5Obp61VrN7tyvXdT1MNsAL0","nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-25 14:19:04","loginNum":1,"tenantCode":"1195","phone":"","source":0,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false},{"id":"1728274418079105024","createTime":"2023-11-25 12:48:26","createUser":"0","updateTime":"2023-11-25 12:48:26","updateUser":"0","mid":null,"openid":"otrgp5L0bMvf8DXFf_kdRCzPqpEM","nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-25 12:48:26","loginNum":1,"tenantCode":"1195","phone":"","source":0,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false},{"id":"1727662634473357312","createTime":"2023-11-23 20:17:25","createUser":"0","updateTime":"2023-11-23 20:17:25","updateUser":"0","mid":null,"openid":"otrgp5Jxyl5zQOgIwZaYK3aHuF9g","nickname":"","headimg":"","balance":"0.00","money":"0","realRecharge":"0.00","giftRecharge":"0.00","sex":"0","status":true,"loginTime":"2023-11-23 20:17:25","loginNum":1,"tenantCode":"1195","phone":"","source":0,"expendAmount":"0.00","buyTimes":0,"lastBuyTime":null,"onCredit":false}]
/// total : "9378"
/// size : "10"
/// current : "1"
/// orders : [{"column":"id","asc":false}]
/// hitCount : false
/// searchCount : true
/// pages : "938"
class BusinessVipList {
BusinessVipList({
List<Records> records,
String total,
String size,
String current,
List<Orders> orders,
bool hitCount,
bool searchCount,
String pages,}){
_records = records;
_total = total;
_size = size;
_current = current;
_orders = orders;
_hitCount = hitCount;
_searchCount = searchCount;
_pages = pages;
}
BusinessVipList.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> _records;
String _total;
String _size;
String _current;
List<Orders> _orders;
bool _hitCount;
bool _searchCount;
String _pages;
BusinessVipList copyWith({ List<Records> records,
String total,
String size,
String current,
List<Orders> orders,
bool hitCount,
bool searchCount,
String pages,
}) => BusinessVipList( 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<Records> get records => _records;
String get total => _total;
String get size => _size;
String get current => _current;
List<Orders> get orders => _orders;
bool get hitCount => _hitCount;
bool get searchCount => _searchCount;
String get pages => _pages;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
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<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['column'] = _column;
map['asc'] = _asc;
return map;
}
}
/// id : "1730229003043733504"
/// createTime : "2023-11-30 22:15:15"
/// createUser : "0"
/// updateTime : "2023-11-30 22:15:15"
/// updateUser : "0"
/// mid : null
/// openid : "otrgp5C7qpd-V2AHosRZOnN4NoEM"
/// nickname : ""
/// headimg : ""
/// balance : "0.00"
/// money : "0"
/// realRecharge : "0.00"
/// giftRecharge : "0.00"
/// sex : "0"
/// status : true
/// loginTime : "2023-11-30 22:15:15"
/// loginNum : 1
/// tenantCode : "1195"
/// phone : ""
/// source : 0
/// expendAmount : "0.00"
/// buyTimes : 0
/// lastBuyTime : null
/// onCredit : false
class Records {
Records({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
dynamic mid,
String openid,
String nickname,
String headimg,
String balance,
String money,
String realRecharge,
String giftRecharge,
String sex,
bool status,
String loginTime,
num loginNum,
String tenantCode,
String phone,
num source,
String expendAmount,
num buyTimes,
dynamic lastBuyTime,
bool onCredit,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_mid = mid;
_openid = openid;
_nickname = nickname;
_headimg = headimg;
_balance = balance;
_money = money;
_realRecharge = realRecharge;
_giftRecharge = giftRecharge;
_sex = sex;
_status = status;
_loginTime = loginTime;
_loginNum = loginNum;
_tenantCode = tenantCode;
_phone = phone;
_source = source;
_expendAmount = expendAmount;
_buyTimes = buyTimes;
_lastBuyTime = lastBuyTime;
_onCredit = onCredit;
}
Records.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_mid = json['mid'];
_openid = json['openid'];
_nickname = json['nickname'];
_headimg = json['headimg'];
_balance = json['balance'];
_money = json['money'];
_realRecharge = json['realRecharge'];
_giftRecharge = json['giftRecharge'];
_sex = json['sex'];
_status = json['status'];
_loginTime = json['loginTime'];
_loginNum = json['loginNum'];
_tenantCode = json['tenantCode'];
_phone = json['phone'];
_source = json['source'];
_expendAmount = json['expendAmount'];
_buyTimes = json['buyTimes'];
_lastBuyTime = json['lastBuyTime'];
_onCredit = json['onCredit'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
dynamic _mid;
String _openid;
String _nickname;
String _headimg;
String _balance;
String _money;
String _realRecharge;
String _giftRecharge;
String _sex;
bool _status;
String _loginTime;
num _loginNum;
String _tenantCode;
String _phone;
num _source;
String _expendAmount;
num _buyTimes;
dynamic _lastBuyTime;
bool _onCredit;
Records copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
dynamic mid,
String openid,
String nickname,
String headimg,
String balance,
String money,
String realRecharge,
String giftRecharge,
String sex,
bool status,
String loginTime,
num loginNum,
String tenantCode,
String phone,
num source,
String expendAmount,
num buyTimes,
dynamic lastBuyTime,
bool onCredit,
}) => Records( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
mid: mid ?? _mid,
openid: openid ?? _openid,
nickname: nickname ?? _nickname,
headimg: headimg ?? _headimg,
balance: balance ?? _balance,
money: money ?? _money,
realRecharge: realRecharge ?? _realRecharge,
giftRecharge: giftRecharge ?? _giftRecharge,
sex: sex ?? _sex,
status: status ?? _status,
loginTime: loginTime ?? _loginTime,
loginNum: loginNum ?? _loginNum,
tenantCode: tenantCode ?? _tenantCode,
phone: phone ?? _phone,
source: source ?? _source,
expendAmount: expendAmount ?? _expendAmount,
buyTimes: buyTimes ?? _buyTimes,
lastBuyTime: lastBuyTime ?? _lastBuyTime,
onCredit: onCredit ?? _onCredit,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
dynamic get mid => _mid;
String get openid => _openid;
String get nickname => _nickname;
String get headimg => _headimg;
String get balance => _balance;
String get money => _money;
String get realRecharge => _realRecharge;
String get giftRecharge => _giftRecharge;
String get sex => _sex;
bool get status => _status;
String get loginTime => _loginTime;
num get loginNum => _loginNum;
String get tenantCode => _tenantCode;
String get phone => _phone;
num get source => _source;
String get expendAmount => _expendAmount;
num get buyTimes => _buyTimes;
dynamic get lastBuyTime => _lastBuyTime;
bool get onCredit => _onCredit;
bool _isShow = false;
bool get isShow => _isShow;
set isShow(bool value) {
_isShow = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['mid'] = _mid;
map['openid'] = _openid;
map['nickname'] = _nickname;
map['headimg'] = _headimg;
map['balance'] = _balance;
map['money'] = _money;
map['realRecharge'] = _realRecharge;
map['giftRecharge'] = _giftRecharge;
map['sex'] = _sex;
map['status'] = _status;
map['loginTime'] = _loginTime;
map['loginNum'] = _loginNum;
map['tenantCode'] = _tenantCode;
map['phone'] = _phone;
map['source'] = _source;
map['expendAmount'] = _expendAmount;
map['buyTimes'] = _buyTimes;
map['lastBuyTime'] = _lastBuyTime;
map['onCredit'] = _onCredit;
return map;
}
}

329
lib/retrofit/data/recharge_flow_list.dart

@ -0,0 +1,329 @@
/// records : [{"id":"1726114100938801152","rechargeType":2,"rechargeName":"微信","source":0,"createTime":"2023-11-19 13:44:06","createTimeFormat":null,"createPerson":"","phone":"18537827823","tenantCode":"1195","storeName":"","rechargeMoney":"50.00","giftdMoney":"20.00","sumMoney":"70.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"0.00","realRecharge":"0.00"},{"id":"1726114054612713472","rechargeType":2,"rechargeName":"微信","source":0,"createTime":"2023-11-19 13:43:55","createTimeFormat":null,"createPerson":"","phone":"18537827823","tenantCode":"1195","storeName":"","rechargeMoney":"50.00","giftdMoney":"20.00","sumMoney":"70.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"0.00","realRecharge":"0.00"},{"id":"1726113414083772416","rechargeType":2,"rechargeName":"微信","source":0,"createTime":"2023-11-19 13:41:22","createTimeFormat":null,"createPerson":"","phone":"18537827823","tenantCode":"1195","storeName":"","rechargeMoney":"50.00","giftdMoney":"20.00","sumMoney":"70.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"0.00","realRecharge":"0.00"},{"id":"1726113338053623808","rechargeType":2,"rechargeName":"微信","source":0,"createTime":"2023-11-19 13:41:04","createTimeFormat":null,"createPerson":"","phone":"18537827823","tenantCode":"1195","storeName":"","rechargeMoney":"50.00","giftdMoney":"20.00","sumMoney":"70.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"0.00","realRecharge":"0.00"},{"id":"1726113287562592256","rechargeType":2,"rechargeName":"微信","source":0,"createTime":"2023-11-19 13:40:52","createTimeFormat":null,"createPerson":"","phone":"18537827823","tenantCode":"1195","storeName":"","rechargeMoney":"50.00","giftdMoney":"20.00","sumMoney":"70.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"0.00","realRecharge":"0.00"},{"id":"1725756687412887552","rechargeType":2,"rechargeName":"微信","source":0,"createTime":"2023-11-18 14:03:52","createTimeFormat":null,"createPerson":"","phone":"17813120251","tenantCode":"1195","storeName":"","rechargeMoney":"50.00","giftdMoney":"20.00","sumMoney":"70.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"27.00","realRecharge":"27.00"},{"id":"1725730560917110784","rechargeType":2,"rechargeName":"微信","source":0,"createTime":"2023-11-18 12:20:03","createTimeFormat":null,"createPerson":"","phone":"15837166590","tenantCode":"1195","storeName":"","rechargeMoney":"50.00","giftdMoney":"20.00","sumMoney":"70.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"39.60","realRecharge":"39.60"},{"id":"1724976129296564224","rechargeType":2,"rechargeName":"微信","source":0,"createTime":"2023-11-16 10:22:12","createTimeFormat":null,"createPerson":"","phone":"15836615333","tenantCode":"1195","storeName":"","rechargeMoney":"50.00","giftdMoney":"20.00","sumMoney":"70.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"58.00","realRecharge":"50.00"},{"id":"1723958918691946496","rechargeType":2,"rechargeName":"微信","source":0,"createTime":"2023-11-13 15:00:10","createTimeFormat":null,"createPerson":"","phone":"17813120251","tenantCode":"1195","storeName":"","rechargeMoney":"50.00","giftdMoney":"20.00","sumMoney":"70.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"27.00","realRecharge":"27.00"},{"id":"1723682257861869568","rechargeType":1,"rechargeName":"现金","source":1,"createTime":"2023-11-12 20:40:49","createTimeFormat":null,"createPerson":"","phone":"13253333210","tenantCode":"1195","storeName":"台北牛肉面","rechargeMoney":"0.00","giftdMoney":"500.00","sumMoney":"500.00","createMemberId":null,"rechargePreferentialId":null,"rechargeStatus":0,"refuseReason":null,"balance":"1000.00","realRecharge":"0.00"}]
/// total : "21"
/// size : "10"
/// current : "1"
/// orders : [{"column":"id","asc":false}]
/// hitCount : false
/// searchCount : true
/// pages : "3"
class RechargeFlowList {
RechargeFlowList({
List<Records> records,
String total,
String size,
String current,
List<Orders> orders,
bool hitCount,
bool searchCount,
String pages,}){
_records = records;
_total = total;
_size = size;
_current = current;
_orders = orders;
_hitCount = hitCount;
_searchCount = searchCount;
_pages = pages;
}
RechargeFlowList.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> _records;
String _total;
String _size;
String _current;
List<Orders> _orders;
bool _hitCount;
bool _searchCount;
String _pages;
RechargeFlowList copyWith({ List<Records> records,
String total,
String size,
String current,
List<Orders> orders,
bool hitCount,
bool searchCount,
String pages,
}) => RechargeFlowList( 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<Records> get records => _records;
String get total => _total;
String get size => _size;
String get current => _current;
List<Orders> get orders => _orders;
bool get hitCount => _hitCount;
bool get searchCount => _searchCount;
String get pages => _pages;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
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<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['column'] = _column;
map['asc'] = _asc;
return map;
}
}
/// id : "1726114100938801152"
/// rechargeType : 2
/// rechargeName : "微信"
/// source : 0
/// createTime : "2023-11-19 13:44:06"
/// createTimeFormat : null
/// createPerson : ""
/// phone : "18537827823"
/// tenantCode : "1195"
/// storeName : ""
/// rechargeMoney : "50.00"
/// giftdMoney : "20.00"
/// sumMoney : "70.00"
/// createMemberId : null
/// rechargePreferentialId : null
/// rechargeStatus : 0
/// refuseReason : null
/// balance : "0.00"
/// realRecharge : "0.00"
class Records {
Records({
String id,
num rechargeType,
String rechargeName,
num source,
String createTime,
dynamic createTimeFormat,
String createPerson,
String phone,
String tenantCode,
String storeName,
String rechargeMoney,
String giftdMoney,
String sumMoney,
dynamic createMemberId,
dynamic rechargePreferentialId,
num rechargeStatus,
dynamic refuseReason,
String balance,
String realRecharge,}){
_id = id;
_rechargeType = rechargeType;
_rechargeName = rechargeName;
_source = source;
_createTime = createTime;
_createTimeFormat = createTimeFormat;
_createPerson = createPerson;
_phone = phone;
_tenantCode = tenantCode;
_storeName = storeName;
_rechargeMoney = rechargeMoney;
_giftdMoney = giftdMoney;
_sumMoney = sumMoney;
_createMemberId = createMemberId;
_rechargePreferentialId = rechargePreferentialId;
_rechargeStatus = rechargeStatus;
_refuseReason = refuseReason;
_balance = balance;
_realRecharge = realRecharge;
}
Records.fromJson(dynamic json) {
_id = json['id'];
_rechargeType = json['rechargeType'];
_rechargeName = json['rechargeName'];
_source = json['source'];
_createTime = json['createTime'];
_createTimeFormat = json['createTimeFormat'];
_createPerson = json['createPerson'];
_phone = json['phone'];
_tenantCode = json['tenantCode'];
_storeName = json['storeName'];
_rechargeMoney = json['rechargeMoney'];
_giftdMoney = json['giftdMoney'];
_sumMoney = json['sumMoney'];
_createMemberId = json['createMemberId'];
_rechargePreferentialId = json['rechargePreferentialId'];
_rechargeStatus = json['rechargeStatus'];
_refuseReason = json['refuseReason'];
_balance = json['balance'];
_realRecharge = json['realRecharge'];
}
String _id;
num _rechargeType;
String _rechargeName;
num _source;
String _createTime;
dynamic _createTimeFormat;
String _createPerson;
String _phone;
String _tenantCode;
String _storeName;
String _rechargeMoney;
String _giftdMoney;
String _sumMoney;
dynamic _createMemberId;
dynamic _rechargePreferentialId;
num _rechargeStatus;
dynamic _refuseReason;
String _balance;
String _realRecharge;
Records copyWith({ String id,
num rechargeType,
String rechargeName,
num source,
String createTime,
dynamic createTimeFormat,
String createPerson,
String phone,
String tenantCode,
String storeName,
String rechargeMoney,
String giftdMoney,
String sumMoney,
dynamic createMemberId,
dynamic rechargePreferentialId,
num rechargeStatus,
dynamic refuseReason,
String balance,
String realRecharge,
}) => Records( id: id ?? _id,
rechargeType: rechargeType ?? _rechargeType,
rechargeName: rechargeName ?? _rechargeName,
source: source ?? _source,
createTime: createTime ?? _createTime,
createTimeFormat: createTimeFormat ?? _createTimeFormat,
createPerson: createPerson ?? _createPerson,
phone: phone ?? _phone,
tenantCode: tenantCode ?? _tenantCode,
storeName: storeName ?? _storeName,
rechargeMoney: rechargeMoney ?? _rechargeMoney,
giftdMoney: giftdMoney ?? _giftdMoney,
sumMoney: sumMoney ?? _sumMoney,
createMemberId: createMemberId ?? _createMemberId,
rechargePreferentialId: rechargePreferentialId ?? _rechargePreferentialId,
rechargeStatus: rechargeStatus ?? _rechargeStatus,
refuseReason: refuseReason ?? _refuseReason,
balance: balance ?? _balance,
realRecharge: realRecharge ?? _realRecharge,
);
String get id => _id;
num get rechargeType => _rechargeType;
String get rechargeName => _rechargeName;
num get source => _source;
String get createTime => _createTime;
dynamic get createTimeFormat => _createTimeFormat;
String get createPerson => _createPerson;
String get phone => _phone;
String get tenantCode => _tenantCode;
String get storeName => _storeName;
String get rechargeMoney => _rechargeMoney;
String get giftdMoney => _giftdMoney;
String get sumMoney => _sumMoney;
dynamic get createMemberId => _createMemberId;
dynamic get rechargePreferentialId => _rechargePreferentialId;
num get rechargeStatus => _rechargeStatus;
dynamic get refuseReason => _refuseReason;
String get balance => _balance;
String get realRecharge => _realRecharge;
bool _isShow = false;
bool get isShow => _isShow;
set isShow(bool value) {
_isShow = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['rechargeType'] = _rechargeType;
map['rechargeName'] = _rechargeName;
map['source'] = _source;
map['createTime'] = _createTime;
map['createTimeFormat'] = _createTimeFormat;
map['createPerson'] = _createPerson;
map['phone'] = _phone;
map['tenantCode'] = _tenantCode;
map['storeName'] = _storeName;
map['rechargeMoney'] = _rechargeMoney;
map['giftdMoney'] = _giftdMoney;
map['sumMoney'] = _sumMoney;
map['createMemberId'] = _createMemberId;
map['rechargePreferentialId'] = _rechargePreferentialId;
map['rechargeStatus'] = _rechargeStatus;
map['refuseReason'] = _refuseReason;
map['balance'] = _balance;
map['realRecharge'] = _realRecharge;
return map;
}
}

709
lib/retrofit/data/ticket_record.dart

File diff suppressed because one or more lines are too long

380
lib/retrofit/data/ticket_show.dart

File diff suppressed because one or more lines are too long

90
lib/retrofit/data/ticket_stats_list.dart

@ -0,0 +1,90 @@
/// wipedDate : "2023-11-10"
/// infoList : [{"ticketName":"四神汤 ","ticketItemName":"测试规格222","wipedNumber":1},{"ticketName":"四神汤 ","ticketItemName":"测试规格","wipedNumber":1}]
class TicketStatsList {
TicketStatsList({
String wipedDate,
List<InfoList> infoList,}){
_wipedDate = wipedDate;
_infoList = infoList;
}
TicketStatsList.fromJson(dynamic json) {
_wipedDate = json['wipedDate'];
if (json['infoList'] != null) {
_infoList = [];
json['infoList'].forEach((v) {
_infoList.add(InfoList.fromJson(v));
});
}
}
String _wipedDate;
List<InfoList> _infoList;
TicketStatsList copyWith({ String wipedDate,
List<InfoList> infoList,
}) => TicketStatsList( wipedDate: wipedDate ?? _wipedDate,
infoList: infoList ?? _infoList,
);
String get wipedDate => _wipedDate;
List<InfoList> get infoList => _infoList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['wipedDate'] = _wipedDate;
if (_infoList != null) {
map['infoList'] = _infoList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// ticketName : "四神汤 "
/// ticketItemName : "测试规格222"
/// wipedNumber : 1
class InfoList {
InfoList({
String ticketName,
String ticketItemName,
num wipedNumber,}){
_ticketName = ticketName;
_ticketItemName = ticketItemName;
_wipedNumber = wipedNumber;
}
InfoList.fromJson(dynamic json) {
_ticketName = json['ticketName'];
_ticketItemName = json['ticketItemName'];
_wipedNumber = json['wipedNumber'];
}
String _ticketName;
String _ticketItemName;
num _wipedNumber;
String _wipedDate;
InfoList copyWith({ String ticketName,
String ticketItemName,
num wipedNumber,
}) => InfoList( ticketName: ticketName ?? _ticketName,
ticketItemName: ticketItemName ?? _ticketItemName,
wipedNumber: wipedNumber ?? _wipedNumber,
);
String get ticketName => _ticketName;
String get ticketItemName => _ticketItemName;
num get wipedNumber => _wipedNumber;
String get wipedDate => _wipedDate;
set wipedDate(String value) {
_wipedDate = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['ticketName'] = _ticketName;
map['ticketItemName'] = _ticketItemName;
map['wipedNumber'] = _wipedNumber;
return map;
}
}
Loading…
Cancel
Save