会员充值页面数据bug更改; 我的页面新增门店二维码,店员管理板块; 新增image_gallery_saver依赖用于保存二维码,IOS info文件需增加获取相册权限; 邀请好友ui适配更改; 新增充值支付成功页面; 新增收银页面(待绘制); 新增消费排名/会员余额统计页面,接口数据已对接(该页面金额,会员余额统计查询板块为完善,待接口更改;) 新增门店二维码页面(缺接口,保存二维码图片有bug待更改;) 新增店员管理页面,接口数据流程已对接; 新增店员新增/编辑页面,接口数据已对接; 在售商品接口优化; 扫一扫页面新增充值扫码付功能; 新增会员充值页面,接口数据流程已对接; app福利中心页面,领取优惠券提示更改; 新增根据手机号查询会员信息,会员充值列表,会员充值支付,充值订单查询,新增会员,店员列表,添加新店员,店员信息编辑,删除会员,修改用户信息,会员余额统计/消费排名接口;wr_2023_new_business
After Width: | Height: | Size: 890 B |
Before Width: | Height: | Size: 622 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 922 B After Width: | Height: | Size: 858 B |
Before Width: | Height: | Size: 740 B After Width: | Height: | Size: 692 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 916 B |
After Width: | Height: | Size: 762 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 768 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 590 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 888 B After Width: | Height: | Size: 818 B |
Before Width: | Height: | Size: 896 B |
After Width: | Height: | Size: 1012 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 980 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 652 B |
After Width: | Height: | Size: 558 B |
Before Width: | Height: | Size: 696 B After Width: | Height: | Size: 688 B |
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 590 B |
After Width: | Height: | Size: 626 B |
After Width: | Height: | Size: 758 B |
After Width: | Height: | Size: 740 B |
After Width: | Height: | Size: 632 B |
After Width: | Height: | Size: 750 B |
After Width: | Height: | Size: 826 B |
After Width: | Height: | Size: 984 B |
After Width: | Height: | Size: 836 B |
After Width: | Height: | Size: 838 B |
After Width: | Height: | Size: 874 B |
After Width: | Height: | Size: 902 B |
After Width: | Height: | Size: 762 B |
After Width: | Height: | Size: 658 B |
After Width: | Height: | Size: 784 B |
After Width: | Height: | Size: 806 B |
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,60 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:intl/intl.dart'; |
||||
|
||||
class CashierPage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
CashierPage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _CashierPage(); |
||||
} |
||||
} |
||||
|
||||
class _CashierPage extends State<CashierPage> { |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title: "收银", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
leadingColor: Colors.black, |
||||
brightness: Brightness.dark, |
||||
), |
||||
body: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Container( |
||||
width: double.infinity, |
||||
margin: EdgeInsets.only(top:8.h, left: 16.w, right: 16.w), |
||||
padding: EdgeInsets.only(top:19.h,bottom: 36.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
borderRadius: BorderRadius.circular(8), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,579 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:intl/intl.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:shimmer/shimmer.dart'; |
||||
|
||||
import '../../generated/l10n.dart'; |
||||
import '../../retrofit/business_api.dart'; |
||||
import '../../retrofit/data/balance_consumption_ranking_list.dart'; |
||||
import '../../retrofit/data/base_data.dart'; |
||||
import '../../utils/business_instance.dart'; |
||||
import '../../utils/flutter_utils.dart'; |
||||
import '../../view_widget/classic_header.dart'; |
||||
import '../../view_widget/my_footer.dart'; |
||||
import '../../view_widget/no_data_view.dart'; |
||||
|
||||
class ConsumerRankingPage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
ConsumerRankingPage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ConsumerRankingPage(); |
||||
} |
||||
} |
||||
|
||||
class _ConsumerRankingPage extends State<ConsumerRankingPage> { |
||||
String titleName; |
||||
String selectTimeDate = ""; |
||||
String selectTimeDateNum = |
||||
"${DateFormat("yyyy-MM-dd HH:mm:ss").format(DateTime.now().subtract(Duration(days: 2)))} 至 " |
||||
"${DateFormat("yyyy-MM-dd HH:mm:ss").format(DateTime.now())}"; |
||||
final TextEditingController editingController = TextEditingController(); |
||||
FocusNode _focusNode = FocusNode(); |
||||
bool isKeyBoardShow = false; |
||||
final RefreshController refreshController = RefreshController(); |
||||
BusinessApiService businessService; |
||||
String networkError = ""; |
||||
int networkStatus = 0; |
||||
List<Records> records = []; |
||||
int _pageNum = 1; |
||||
String total = "0"; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
titleName = widget?.arguments["titleName"] ?? ""; |
||||
_onRefresh(); |
||||
} |
||||
|
||||
///离开页面记着销毁和清除 |
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
refreshController.dispose(); |
||||
_focusNode.unfocus(); |
||||
} |
||||
|
||||
_onRefresh({bool isShowLoad = true}) async { |
||||
if (isShowLoad) |
||||
EasyLoading.show( |
||||
status: S.current.zhengzaijiazai, |
||||
maskType: EasyLoadingMaskType.black); |
||||
await queryStoreMoney(); |
||||
EasyLoading.dismiss(); |
||||
if (refreshController.isRefresh) refreshController.refreshCompleted(); |
||||
if (mounted) setState(() {}); |
||||
} |
||||
|
||||
///查询会员余额统计/消费排名 |
||||
queryStoreMoney({nickName,isShow = true}) async { |
||||
try { |
||||
if (businessService == null) { |
||||
businessService = BusinessApiService(Dio(), |
||||
context: context, |
||||
token: BusinessInstance.instance.businessToken, |
||||
tenant: BusinessInstance.instance.businessTenant, |
||||
storeId: widget.arguments["storeId"]); |
||||
} |
||||
BaseData<BalanceConsumptionRankingList> baseData = await businessService.storeMoney({ |
||||
"startTime": titleName == "消费排名" ? selectTimeDateNum.substring(0,19):"", |
||||
"endTime": titleName == "消费排名" ? selectTimeDateNum.substring(24,43):"", |
||||
"nickName": titleName == "消费排名" ? "" : nickName, |
||||
"type":titleName == "消费排名" ? 1:0, |
||||
"pageNum": _pageNum, |
||||
"pageSize": 10, |
||||
}).catchError((error) { |
||||
networkError = AppUtils.dioErrorTypeToString(error.type); |
||||
networkStatus = -1; |
||||
setState(() {}); |
||||
refreshController.refreshFailed(); |
||||
refreshController.loadFailed(); |
||||
}); |
||||
if (!mounted) return; |
||||
if (baseData != null && baseData.isSuccess) { |
||||
records.addAll(baseData?.data?.records ?? []); |
||||
total = baseData?.data?.total ?? "0"; |
||||
if ((baseData?.data?.records ?? []).isEmpty || |
||||
records.length.toString() == baseData.data.pages) |
||||
refreshController.loadNoData(); |
||||
else |
||||
refreshController.loadComplete(); |
||||
networkStatus = 1; |
||||
} else { |
||||
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
||||
} |
||||
} finally { |
||||
if (isShow) setState(() {}); |
||||
} |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title: titleName, |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
leadingColor: Colors.black, |
||||
brightness: Brightness.dark, |
||||
), |
||||
body: networkStatus == -1 |
||||
? noNetwork() |
||||
: Container( |
||||
child: SmartRefresher( |
||||
controller: refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: records.length == 0 ? false : true, |
||||
header: MyHeader( |
||||
color: Color(0xFF30415B), |
||||
), |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
_pageNum = 1; |
||||
records.clear(); |
||||
_onRefresh(isShowLoad: false); |
||||
}, |
||||
onLoading: () { |
||||
_pageNum++; |
||||
_onRefresh(isShowLoad: false); |
||||
}, |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: ScrollController(), |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
width: double.infinity, |
||||
padding: EdgeInsets.only(bottom: 16.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
), |
||||
child: Column( |
||||
children: [ |
||||
titleName == "消费排名" |
||||
? timeSelect() |
||||
: vipBalanceStatisticsSearch(), |
||||
titleName == "消费排名" |
||||
? Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Expanded( |
||||
child: Column( |
||||
children: [ |
||||
Padding( |
||||
padding: EdgeInsets.only(bottom: 15.h), |
||||
child: Text( |
||||
"消费会员数量", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
), |
||||
Text( |
||||
total, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
Expanded( |
||||
child: Column( |
||||
children: [ |
||||
Padding( |
||||
padding: EdgeInsets.only(bottom: 15.h), |
||||
child: Text( |
||||
"销售金额", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
), |
||||
Text( |
||||
"12334.00", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
], |
||||
) |
||||
: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Expanded( |
||||
child: Column( |
||||
children: [ |
||||
Padding( |
||||
padding: EdgeInsets.only(bottom: 15.h), |
||||
child: Text( |
||||
"总会员数", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
), |
||||
Text( |
||||
total, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
Expanded( |
||||
child: Column( |
||||
children: [ |
||||
Padding( |
||||
padding: EdgeInsets.only(bottom: 15.h), |
||||
child: Text( |
||||
"总余额数", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
), |
||||
Text( |
||||
"12334.00", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
], |
||||
) |
||||
], |
||||
), |
||||
), |
||||
Expanded(child: networkStatus == 0 |
||||
? Container( |
||||
margin: EdgeInsets.only(bottom: 35.h,top:6.h), |
||||
child: ListView.builder( |
||||
itemCount: 10, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: consumerRankingItemSm(), |
||||
); |
||||
}, |
||||
)) |
||||
: ((records == null || records.length == 0) |
||||
? NoDataView( |
||||
src: "assets/image/bs_no data_logo.webp", |
||||
isShowBtn: false, |
||||
text: "暂无商品分类", |
||||
fontSize: 16.sp, |
||||
margin: EdgeInsets.all(20.h), |
||||
) |
||||
: Container( |
||||
margin: EdgeInsets.only(bottom: 35.h,top:6.h), |
||||
child: ListView.builder( |
||||
itemCount: records?.length ?? 0, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: consumerRankingItem( |
||||
records[position]), |
||||
); |
||||
}, |
||||
), |
||||
)),) |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///时间选择 |
||||
Widget timeSelect() { |
||||
return Container( |
||||
color: Colors.white, |
||||
child: GestureDetector( |
||||
onTap: () { |
||||
Navigator.of(context).pushNamed('/router/custom_page', |
||||
arguments: {"beyondDateRange": "0"}).then((value) { |
||||
selectTimeDate = value; |
||||
setState((){}); |
||||
}); |
||||
}, |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF7F8FA), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
margin: |
||||
EdgeInsets.only(left: 18.w, right: 18.w, top: 11.h, bottom: 17.h), |
||||
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 12.h), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
(selectTimeDate == "" || selectTimeDate == null) |
||||
? "${selectTimeDateNum.substring(0,16)} 至 ${selectTimeDateNum.substring(24,40)}" |
||||
: "${selectTimeDate.replaceAll("年", "-").replaceAll("月", "-").replaceAll("日", "").substring(0,16)} 至" |
||||
" ${selectTimeDate.replaceAll("年", "-").replaceAll("月", "-").replaceAll("日", "").substring(22,38)} ", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF30415B), |
||||
fontWeight: MyFontWeight.regular), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
/// 搜索框 |
||||
Widget vipBalanceStatisticsSearch() { |
||||
return Container( |
||||
color: Colors.white, |
||||
child: Container( |
||||
height: 40.h, |
||||
margin: |
||||
EdgeInsets.only(left: 18.w, right: 18.w, top: 12.h, bottom: 12.h), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF7F8FA), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
child: TextField( |
||||
focusNode: _focusNode, |
||||
textInputAction: TextInputAction.search, |
||||
onEditingComplete: () { |
||||
FocusScope.of(context).requestFocus(FocusNode()); |
||||
queryStoreMoney(nickName: editingController?.text ?? ""); |
||||
}, |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF808080), |
||||
), |
||||
controller: editingController, |
||||
decoration: InputDecoration( |
||||
hintText: "会员手机号或姓名", |
||||
hintStyle: TextStyle( |
||||
color: Color(0xFF808080), |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.regular), |
||||
contentPadding: EdgeInsets.symmetric( |
||||
vertical: 12.h, |
||||
), |
||||
prefixIcon: Image.asset( |
||||
"assets/image/bs_goods_search.webp", |
||||
width: 20, |
||||
height: 20, |
||||
), |
||||
border: InputBorder.none, |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///消费排行list |
||||
Widget consumerRankingItem(Records records) { |
||||
return Container( |
||||
padding: EdgeInsets.only(top: 12.h, bottom: 12.h, left: 16.w), |
||||
margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
borderRadius: BorderRadius.circular(8), |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding( |
||||
padding: EdgeInsets.only(bottom: 16.h), |
||||
child: Text( |
||||
"${records?.name ?? ""}(${records?.phone})", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
), |
||||
Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "消费:", |
||||
style: TextStyle( |
||||
color: Color(0xFF666666), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "¥${records?.money ?? ""}", |
||||
style: TextStyle( |
||||
color: Color(0xFFFA5151), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget consumerRankingItemSm() { |
||||
return Container( |
||||
padding: EdgeInsets.only(top: 12.h, bottom: 12.h, left: 16.w), |
||||
margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
borderRadius: BorderRadius.circular(8), |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Shimmer.fromColors( |
||||
baseColor: Color(0XFFD8D8D8), |
||||
highlightColor: Color(0XFFD8D8D8), |
||||
child: Container( |
||||
margin: EdgeInsets.only(bottom: 16.h), |
||||
decoration: BoxDecoration( |
||||
color: Color(0XFFD8D8D8), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
width: 149.w, |
||||
height: 20.h, |
||||
), |
||||
), |
||||
Row( |
||||
children: [ |
||||
Shimmer.fromColors( |
||||
baseColor: Color(0XFFD8D8D8), |
||||
highlightColor: Color(0XFFD8D8D8), |
||||
child: Container( |
||||
margin: EdgeInsets.only(right:10.w), |
||||
decoration: BoxDecoration( |
||||
color: Color(0XFFD8D8D8), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
width: 42.w, |
||||
height: 20.h, |
||||
), |
||||
), Shimmer.fromColors( |
||||
baseColor: Color(0XFFD8D8D8), |
||||
highlightColor: Color(0XFFD8D8D8), |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0XFFD8D8D8), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
width: 60.w, |
||||
height: 20.h, |
||||
), |
||||
), |
||||
], |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget noNetwork() { |
||||
return Container( |
||||
color: Colors.white, |
||||
width: double.infinity, |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
networkError.substring(0, networkError.indexOf(",")), |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.bold), |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.symmetric(vertical: 10.h), |
||||
child: Text( |
||||
"请检查网络设置或稍后重试", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF7A797F), |
||||
fontWeight: MyFontWeight.regular), |
||||
), |
||||
), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
_onRefresh(); |
||||
}, |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(15), |
||||
), |
||||
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), |
||||
child: Text( |
||||
"重试", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Colors.white, |
||||
fontWeight: MyFontWeight.regular), |
||||
)), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,180 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:intl/intl.dart'; |
||||
|
||||
class PaySuccessPage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
PaySuccessPage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _PaySuccessPage(); |
||||
} |
||||
} |
||||
|
||||
class _PaySuccessPage extends State<PaySuccessPage> { |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title: "收银成功", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
leadingColor: Colors.black, |
||||
brightness: Brightness.dark, |
||||
), |
||||
body: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Container( |
||||
width: double.infinity, |
||||
margin: EdgeInsets.only(top:8.h, left: 16.w, right: 16.w), |
||||
padding: EdgeInsets.only(top:19.h,bottom: 36.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
borderRadius: BorderRadius.circular(8), |
||||
), |
||||
child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bus_pay_success_logo.png", |
||||
width: 76.h, |
||||
height: 76.h, |
||||
), |
||||
Padding(padding: EdgeInsets.only(top:16.h,), |
||||
child:Text( |
||||
"收银成功", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
)), |
||||
Container( |
||||
width: double.infinity, |
||||
margin: EdgeInsets.only(left:17.w,right: 16.w,top:11.h,bottom:17.h), |
||||
child: Flex( |
||||
children: List.generate(70, (_) { |
||||
return SizedBox( |
||||
width: 2.w, |
||||
height: 1.h, |
||||
child: DecoratedBox( |
||||
decoration: |
||||
BoxDecoration(color: Color(0xFFEBECEF)), |
||||
), |
||||
); |
||||
}), |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
direction: Axis.horizontal, |
||||
), |
||||
), |
||||
Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w,bottom: 20.h), |
||||
child:Row( |
||||
children: [ |
||||
Expanded(child:Text( |
||||
"订单编号", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
)), |
||||
Text( |
||||
widget?.arguments["rechargeId"] ?? "", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w,bottom: 20.h), |
||||
child:Row( |
||||
children: [ |
||||
Expanded(child:Text( |
||||
"支付金额", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
)), |
||||
Text( |
||||
"¥${widget?.arguments["rechargeMoney"] ?? ""}", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w,bottom: 20.h), |
||||
child:Row( |
||||
children: [ |
||||
Expanded(child:Text( |
||||
"支付时间", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
)), |
||||
Text( |
||||
DateFormat("yyyy-MM-dd HH:mm:ss").format(DateTime.now()), |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w), |
||||
child:Row( |
||||
children: [ |
||||
Expanded(child:Text( |
||||
"支付方式", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
)), |
||||
Text( |
||||
widget.arguments["payIndex"] == 1 ? "现金":(widget.arguments["payIndex"] == 2?"微信支付":"支付宝支付"), |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
], |
||||
), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,546 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter/services.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
|
||||
import '../../../generated/l10n.dart'; |
||||
import '../../../retrofit/business_api.dart'; |
||||
import '../../../retrofit/data/base_data.dart'; |
||||
import '../../../retrofit/data/user_info_edit.dart'; |
||||
import '../../../utils/business_instance.dart'; |
||||
import '../../../utils/font_weight.dart'; |
||||
import '../../../view_widget/my_appbar.dart'; |
||||
|
||||
class AddNewClerkPage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
AddNewClerkPage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _AddNewClerkPage(); |
||||
} |
||||
} |
||||
|
||||
class _AddNewClerkPage extends State<AddNewClerkPage> { |
||||
String titleName; |
||||
final TextEditingController editingPhoneController = TextEditingController(); |
||||
final TextEditingController editingNameController = TextEditingController(); |
||||
bool isKeyBoardShow = false; |
||||
FocusNode _focusNode = FocusNode(); |
||||
BusinessApiService businessService; |
||||
String selectSexIndex = "N"; |
||||
String clerkAccount; |
||||
String clerkName; |
||||
String clerkSex; |
||||
String sexCode; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
WidgetsBinding.instance.addPostFrameCallback((_) { |
||||
setState(() { |
||||
print("object: ${MediaQuery.of(context).viewInsets.bottom}"); |
||||
if (MediaQuery.of(context).viewInsets.bottom == 0) { |
||||
if (isKeyBoardShow) { |
||||
isKeyBoardShow = false; |
||||
//关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 |
||||
FocusScope.of(context).requestFocus(FocusNode()); |
||||
} |
||||
} else { |
||||
isKeyBoardShow = true; |
||||
} |
||||
}); |
||||
}); |
||||
titleName = widget?.arguments["titleName"] ??""; |
||||
clerkAccount = widget?.arguments["clerkAccount"] ?? ""; |
||||
clerkName = widget?.arguments["clerkName"] ?? ""; |
||||
clerkSex = widget?.arguments["sex"] ?? ""; |
||||
sexCode = widget?.arguments["sexCode"] ?? ""; |
||||
} |
||||
|
||||
///离开页面记着销毁和清除 |
||||
@override |
||||
void dispose() { |
||||
_focusNode.unfocus(); |
||||
super.dispose(); |
||||
} |
||||
|
||||
///店员信息编辑/新增店员 |
||||
editUser(account,name,sex) async { |
||||
try{ |
||||
EasyLoading.show( |
||||
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); |
||||
if (businessService == null) { |
||||
businessService = BusinessApiService(Dio(), |
||||
context: context, |
||||
token: BusinessInstance.instance.businessToken, |
||||
tenant: BusinessInstance.instance.businessTenant, |
||||
storeId: widget.arguments["storeId"]); |
||||
} |
||||
BaseData<UserInfoEdit> baseData = await businessService.userEdit({ |
||||
"account":account, |
||||
"name":name, |
||||
"sex":sex, |
||||
"password": "123456", |
||||
}).catchError((error) {}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
Navigator.of(context).pop(1); |
||||
SmartDialog.showToast(titleName == "编辑店员资料" ? "店员资料编辑成功" : "新增店员成功", |
||||
alignment: Alignment.center); |
||||
} else { |
||||
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
||||
}}finally{ |
||||
EasyLoading.dismiss(); |
||||
} |
||||
} |
||||
|
||||
///修改店员信息 |
||||
modifyUser(account,name,sex) async { |
||||
try{ |
||||
EasyLoading.show( |
||||
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); |
||||
if (businessService == null) { |
||||
businessService = BusinessApiService(Dio(), |
||||
context: context, |
||||
token: BusinessInstance.instance.businessToken, |
||||
tenant: BusinessInstance.instance.businessTenant, |
||||
storeId: widget.arguments["storeId"]); |
||||
} |
||||
BaseData<UserInfoEdit> baseData = await businessService.userModify({ |
||||
"account": account == ""?clerkAccount:account, |
||||
"name": name == "" ? clerkName :name, |
||||
"sex": sex == ""?sexCode:sex, |
||||
"password": "123456", |
||||
"id":widget?.arguments["id"]??"" |
||||
}).catchError((error) {}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
Navigator.of(context).pop(1); |
||||
SmartDialog.showToast("修改店员信息成功", |
||||
alignment: Alignment.center); |
||||
} else { |
||||
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
||||
}}finally{ |
||||
EasyLoading.dismiss(); |
||||
} |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.translucent, |
||||
onTap: () { |
||||
FocusScope.of(context).unfocus(); |
||||
}, |
||||
child: Scaffold( |
||||
resizeToAvoidBottomInset: false, |
||||
backgroundColor: Colors.white, |
||||
appBar: MyAppBar( |
||||
title: titleName, |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
leadingColor: Colors.black, |
||||
brightness: Brightness.dark, |
||||
), |
||||
body: Container( |
||||
margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Expanded( |
||||
child: Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "*", |
||||
style: TextStyle( |
||||
color: Color(0xFFE02020), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.w500, |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "员工姓名", |
||||
style: TextStyle( |
||||
color: Color(0xFF30415B), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.w500, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
Expanded( |
||||
child: TextField( |
||||
controller: editingNameController, |
||||
decoration: InputDecoration( |
||||
hintText: clerkName != ""?clerkName:"请输入员工姓名", |
||||
hintTextDirection: TextDirection.rtl, |
||||
hintStyle: TextStyle( |
||||
color: Color(0xFF7A797F), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
border: InputBorder.none, |
||||
contentPadding: EdgeInsets.only(left: 16.w), |
||||
), |
||||
textAlign: TextAlign.right, |
||||
style: TextStyle( |
||||
color: Color(0xFF7A797F), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Container( |
||||
height: 1.h, |
||||
width: double.infinity, |
||||
color: Color(0xFFEBEBEB), |
||||
margin: EdgeInsets.only(bottom: 16.h), |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Expanded( |
||||
child: Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "*", |
||||
style: TextStyle( |
||||
color: Color(0xFFE02020), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.w500, |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "员工性别", |
||||
style: TextStyle( |
||||
color: Color(0xFF30415B), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.w500, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
showSexSelect(selectSexIndex); |
||||
}, |
||||
child: Row( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
clerkSex != "" ? clerkSex:(selectSexIndex == "" ? "请选择员工性别":(selectSexIndex == "N"?"未知":(selectSexIndex == "M" ? "男":"女"))), |
||||
style: TextStyle( |
||||
color: Color(0xFF7A797F), |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
), |
||||
Image.asset( |
||||
"assets/image/bs_right.webp", |
||||
width: 14.h, |
||||
height: 14.h, |
||||
color: Color(0xFF353535), |
||||
) |
||||
], |
||||
) |
||||
) |
||||
], |
||||
), |
||||
Container( |
||||
height: 1.h, |
||||
width: double.infinity, |
||||
color: Color(0xFFEBEBEB), |
||||
margin: EdgeInsets.only(top: 16.h), |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Expanded( |
||||
child: Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "*", |
||||
style: TextStyle( |
||||
color: Color(0xFFE02020), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.w500, |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "手机号", |
||||
style: TextStyle( |
||||
color: Color(0xFF30415B), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.w500, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
Expanded( |
||||
child: TextField( |
||||
controller: editingPhoneController, |
||||
keyboardType: TextInputType.phone, |
||||
decoration: InputDecoration( |
||||
hintText: clerkAccount != ""?clerkAccount:"请输入手机号", |
||||
hintTextDirection: TextDirection.rtl, |
||||
hintStyle: TextStyle( |
||||
color: Color(0xFF7A797F), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
border: InputBorder.none, |
||||
contentPadding: EdgeInsets.only(left: 16.w), |
||||
), |
||||
inputFormatters: [ |
||||
LengthLimitingTextInputFormatter(11) |
||||
], |
||||
textAlign: TextAlign.right, |
||||
style: TextStyle( |
||||
color: Color(0xFF7A797F), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Container( |
||||
height: 1.h, |
||||
width: double.infinity, |
||||
color: Color(0xFFEBEBEB), |
||||
margin: EdgeInsets.only(bottom: 16.h), |
||||
), |
||||
Spacer(), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
if (editingNameController.text == "" && clerkName == "") { |
||||
SmartDialog.showToast("请输入员工姓名", |
||||
alignment: Alignment.center); |
||||
return; |
||||
} else if (selectSexIndex == "" && clerkSex == "") { |
||||
SmartDialog.showToast("请选择员工性别", |
||||
alignment: Alignment.center); |
||||
return; |
||||
} else if (editingPhoneController.text == "" && clerkAccount == "") { |
||||
SmartDialog.showToast("请输入手机号", |
||||
alignment: Alignment.center); |
||||
return; |
||||
} { |
||||
if(clerkName != "" || clerkAccount != "" || clerkSex != ""){ |
||||
modifyUser(editingPhoneController.text,editingNameController.text,selectSexIndex); |
||||
}else |
||||
editUser(editingPhoneController.text,editingNameController.text,selectSexIndex); |
||||
} |
||||
}, |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(27), |
||||
color: Color(0xFF30415B), |
||||
), |
||||
width: double.infinity, |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.symmetric(vertical: 16.h), |
||||
margin: EdgeInsets.only(bottom: 34.h), |
||||
child: Text( |
||||
S.of(context).baocun, |
||||
style: TextStyle( |
||||
color: Colors.white, |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
showSexSelect(index) { |
||||
showModalBottomSheet( |
||||
context: context, |
||||
isDismissible: false, |
||||
builder: (context) { |
||||
return StatefulBuilder(builder: ( |
||||
context, |
||||
state, |
||||
) { |
||||
return Container( |
||||
width: double.infinity, |
||||
height: 290.h, |
||||
padding: EdgeInsets.only(top: 12.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.only( |
||||
topRight: Radius.circular(6), |
||||
topLeft: Radius.circular(6), |
||||
)), |
||||
child: Column( |
||||
children: [ |
||||
Padding( |
||||
padding: EdgeInsets.symmetric(horizontal: 14.w), |
||||
child: Row( |
||||
children: [ |
||||
Expanded( |
||||
child:GestureDetector( |
||||
behavior:HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
state((){ |
||||
selectSexIndex = ""; |
||||
Navigator.of(context).pop(); |
||||
}); |
||||
}, |
||||
child: Text( |
||||
S.of(context).quxiao, |
||||
style: TextStyle( |
||||
color: Colors.black, |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.black, |
||||
), |
||||
), |
||||
)), |
||||
Expanded(child:GestureDetector( |
||||
behavior:HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
selectSexIndex == "N"? "未知" :(selectSexIndex == "M" ? "男" : "女" ); |
||||
Navigator.of(context).pop(); |
||||
setState((){});}, |
||||
child: Container( |
||||
alignment: Alignment.centerRight, |
||||
child: Text( |
||||
S.of(context).queding, |
||||
style: TextStyle( |
||||
color: Color(0xFF30415B), |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.black, |
||||
), |
||||
), |
||||
), |
||||
)) |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.only(top: 12.h, bottom: 13.h), |
||||
height: 1.h, |
||||
color: Color(0xFFF2F2F2)), |
||||
GestureDetector( |
||||
behavior:HitTestBehavior.opaque, |
||||
onTap: () { |
||||
state((){ |
||||
selectSexIndex = "M"; |
||||
}); |
||||
}, |
||||
child: Container( |
||||
width: double.infinity, |
||||
alignment: Alignment.center, |
||||
padding: |
||||
EdgeInsets.only(top:12.h, bottom:12.h, left: 12.w), |
||||
margin: EdgeInsets.symmetric(horizontal: 14.w), |
||||
decoration: BoxDecoration( |
||||
borderRadius:BorderRadius.circular(6), |
||||
border: Border.all( |
||||
color: selectSexIndex == "M" ? Color(0xFF30415B):Color(0xFFF7F7F7), |
||||
width: selectSexIndex == "M" ? 1 :0, |
||||
), |
||||
color: selectSexIndex == "M" ? Color(0xFFEFF5FF) :Color(0xFFF7F7F7), |
||||
), |
||||
child: Text( |
||||
"男", |
||||
style: TextStyle( |
||||
color: selectSexIndex == "M"? Color(0xFF30415B):Color(0xFF4D4D4D), |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 13.h, |
||||
), |
||||
GestureDetector( |
||||
behavior:HitTestBehavior.opaque, |
||||
onTap: () { |
||||
state((){ |
||||
selectSexIndex = "W"; |
||||
}); |
||||
}, |
||||
child: Container( |
||||
width: double.infinity, |
||||
alignment: Alignment.center, |
||||
padding: |
||||
EdgeInsets.only(top: 12.h, bottom: 12.h, left: 12.w), |
||||
margin: EdgeInsets.symmetric(horizontal: 14.w), |
||||
decoration: BoxDecoration( |
||||
borderRadius:BorderRadius.circular(6), |
||||
border: Border.all( |
||||
color: selectSexIndex == "W" ? Color(0xFF30415B):Color(0xFFF7F7F7), |
||||
width: selectSexIndex == "W" ? 1 :0, |
||||
), |
||||
color: selectSexIndex == "W" ? Color(0xFFEFF5FF) :Color(0xFFF7F7F7), |
||||
), |
||||
child: Text( |
||||
"女", |
||||
style: TextStyle( |
||||
color: selectSexIndex == "W" ?Color(0xFF30415B):Color(0xFF4D4D4D), |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
), |
||||
)), |
||||
), |
||||
SizedBox( |
||||
height: 13.h, |
||||
), |
||||
GestureDetector( |
||||
behavior:HitTestBehavior.opaque, |
||||
onTap: () { |
||||
state((){ |
||||
selectSexIndex = "N"; |
||||
}); |
||||
}, |
||||
child: Container( |
||||
width: double.infinity, |
||||
alignment: Alignment.center, |
||||
padding: |
||||
EdgeInsets.only(top: 12.h, bottom: 12.h, left: 12.w), |
||||
margin: EdgeInsets.symmetric(horizontal: 14.w), |
||||
decoration: BoxDecoration( |
||||
borderRadius:BorderRadius.circular(6), |
||||
border: Border.all( |
||||
color: selectSexIndex == "N" ? Color(0xFF30415B):Color(0xFFF7F7F7), |
||||
width: selectSexIndex == "N" ? 1 :0, |
||||
), |
||||
color: selectSexIndex == "N" ? Color(0xFFEFF5FF) :Color(0xFFF7F7F7), |
||||
), |
||||
child: Text( |
||||
"未知", |
||||
style: TextStyle( |
||||
color: selectSexIndex == "N" ?Color(0xFF30415B):Color(0xFF4D4D4D), |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
), |
||||
)), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
}); |
||||
}, |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,512 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:shimmer/shimmer.dart'; |
||||
|
||||
import '../../../generated/l10n.dart'; |
||||
import '../../../retrofit/business_api.dart'; |
||||
import '../../../retrofit/data/base_data.dart'; |
||||
import '../../../retrofit/data/clerk_manage_list.dart'; |
||||
import '../../../utils/business_instance.dart'; |
||||
import '../../../utils/flutter_utils.dart'; |
||||
import '../../../view_widget/border_text.dart'; |
||||
import '../../../view_widget/classic_header.dart'; |
||||
import '../../../view_widget/my_footer.dart'; |
||||
import '../../../view_widget/no_data_view.dart'; |
||||
import '../../../view_widget/round_button.dart'; |
||||
|
||||
class ClerkManagePage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
ClerkManagePage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ClerkManagePage(); |
||||
} |
||||
} |
||||
|
||||
class _ClerkManagePage extends State<ClerkManagePage> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
BusinessApiService businessService; |
||||
String networkError = ""; |
||||
int networkStatus = 0; |
||||
List<Records> records = []; |
||||
int _current = 1; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
_onRefresh(); |
||||
} |
||||
|
||||
_onRefresh({bool isShowLoad = true}) async { |
||||
if (isShowLoad) |
||||
EasyLoading.show( |
||||
status: S.current.zhengzaijiazai, |
||||
maskType: EasyLoadingMaskType.black); |
||||
await queryClerkList(); |
||||
EasyLoading.dismiss(); |
||||
if (refreshController.isRefresh) refreshController.refreshCompleted(); |
||||
if (mounted) setState(() {}); |
||||
} |
||||
|
||||
///查询店员管理列表 |
||||
queryClerkList({isShow = true}) async { |
||||
try { |
||||
if (businessService == null) { |
||||
businessService = BusinessApiService(Dio(), |
||||
context: context, |
||||
token: BusinessInstance.instance.businessToken, |
||||
tenant: BusinessInstance.instance.businessTenant, |
||||
storeId: widget.arguments["storeId"]); |
||||
} |
||||
BaseData<ClerkManageList> baseData = await businessService.clerkList({ |
||||
"size": 20, |
||||
"pageSize": 20, |
||||
"current": _current, |
||||
"currentPage": 1, |
||||
"sort": "id", |
||||
"order": "descending", |
||||
}).catchError((error) { |
||||
networkError = AppUtils.dioErrorTypeToString(error.type); |
||||
networkStatus = -1; |
||||
setState(() {}); |
||||
refreshController.refreshFailed(); |
||||
refreshController.loadFailed(); |
||||
}); |
||||
if (!mounted) return; |
||||
if (baseData != null && baseData.isSuccess) { |
||||
records.addAll(baseData?.data?.records ?? []); |
||||
if ((baseData?.data?.records ?? []).isEmpty || |
||||
records.length.toString() == baseData.data.total) |
||||
refreshController.loadNoData(); |
||||
else |
||||
refreshController.loadComplete(); |
||||
networkStatus = 1; |
||||
} else { |
||||
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
||||
} |
||||
} finally { |
||||
if (isShow) setState(() {}); |
||||
} |
||||
} |
||||
|
||||
///删除店员 |
||||
queryDelUser(ids) async { |
||||
try { |
||||
EasyLoading.show( |
||||
status: S.current.zhengzaijiazai, |
||||
maskType: EasyLoadingMaskType.black); |
||||
if (businessService == null) { |
||||
businessService = BusinessApiService(Dio(), |
||||
context: context, |
||||
token: BusinessInstance.instance.businessToken, |
||||
tenant: BusinessInstance.instance.businessTenant, |
||||
storeId: widget.arguments["storeId"]); |
||||
} |
||||
BaseData baseData = |
||||
await businessService.delUser(ids).catchError((error) {}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
await editOnRefresh(); |
||||
SmartDialog.showToast("删除店员成功", alignment: Alignment.center); |
||||
} else { |
||||
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
||||
} |
||||
} finally { |
||||
EasyLoading.dismiss(); |
||||
} |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Colors.white, |
||||
appBar: MyAppBar( |
||||
title: "店员管理", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
leadingColor: Colors.black, |
||||
brightness: Brightness.dark, |
||||
), |
||||
body: networkStatus == -1 |
||||
? noNetwork() |
||||
: Container( |
||||
margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), |
||||
child: Column( |
||||
children: [ |
||||
Expanded( |
||||
child: Container( |
||||
child: SmartRefresher( |
||||
controller: refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: records.length == 0 ? false : true, |
||||
header: MyHeader( |
||||
color: Color(0xFF30415B), |
||||
), |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
_current = 1; |
||||
records.clear(); |
||||
_onRefresh(isShowLoad: false); |
||||
}, |
||||
onLoading: () { |
||||
_current++; |
||||
_onRefresh(isShowLoad: false); |
||||
}, |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: ScrollController(), |
||||
child: Container( |
||||
child: networkStatus == 0 |
||||
? ListView.builder( |
||||
itemCount: 10, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: clerkManageItemSm(), |
||||
); |
||||
}, |
||||
) |
||||
: ((records == null || records.length == 0) |
||||
? NoDataView( |
||||
src: "assets/image/bs_no data_logo.webp", |
||||
isShowBtn: false, |
||||
text: "暂无商品分类", |
||||
fontSize: 16.sp, |
||||
margin: EdgeInsets.all(20.h), |
||||
) |
||||
: ListView.builder( |
||||
itemCount: records?.length ?? 0, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: clerkManageItem( |
||||
records[position]), |
||||
); |
||||
}, |
||||
)), |
||||
), |
||||
), |
||||
)), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
Navigator.of(context).pushNamed( |
||||
'/router/add_new_clerk_page', |
||||
arguments: { |
||||
"storeId": widget.arguments["storeId"], |
||||
"titleName": "添加新店员" |
||||
}).then((value) { |
||||
if (value == 1) { |
||||
_current = 1; |
||||
records.clear(); |
||||
_onRefresh(isShowLoad: false); |
||||
} |
||||
}); |
||||
}, |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(27), |
||||
color: Color(0xFF30415B), |
||||
), |
||||
width: double.infinity, |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.symmetric(vertical: 16.h), |
||||
margin: EdgeInsets.only(bottom: 34.h), |
||||
child: Text( |
||||
"添加店员", |
||||
style: TextStyle( |
||||
color: Colors.white, |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
)); |
||||
} |
||||
|
||||
editOnRefresh() { |
||||
_current = 1; |
||||
records.clear(); |
||||
_onRefresh(isShowLoad: false); |
||||
} |
||||
|
||||
///店员管理列表 |
||||
Widget clerkManageItem(Records records) { |
||||
return Container( |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Expanded( |
||||
child: Text( |
||||
records?.name ?? "", |
||||
style: TextStyle( |
||||
color: Color(0xFF000000), |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
)), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
Navigator.of(context) |
||||
.pushNamed('/router/add_new_clerk_page', arguments: { |
||||
"storeId": widget.arguments["storeId"], |
||||
"titleName": "编辑店员资料", |
||||
"clerkAccount": (records?.mobile == "") |
||||
? (records?.account ?? "") |
||||
: (records?.mobile ?? ""), |
||||
"clerkName": records?.name ?? "", |
||||
"sex": records?.sex?.desc ?? "", |
||||
"sexCode": records?.sex?.code ?? "", |
||||
"id": records?.id ?? "" |
||||
}).then((value) { |
||||
if(value == 1) |
||||
editOnRefresh(); |
||||
}); |
||||
}, |
||||
child: Padding( |
||||
padding: EdgeInsets.symmetric(horizontal: 17.w), |
||||
child: Text( |
||||
"编辑", |
||||
style: TextStyle( |
||||
color: Color(0xFF30415B), |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
showDelGroupDialog(records?.id); |
||||
}, |
||||
child: Padding( |
||||
padding: EdgeInsets.only(right: 16.w, left: 17.w), |
||||
child: Text( |
||||
S.of(context).shanchu, |
||||
style: TextStyle( |
||||
color: Color(0xFFF4524D), |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.symmetric(vertical: 16.h), |
||||
color: Color(0xFFEBEBEB), |
||||
height: 1.h, |
||||
width: double.infinity, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget clerkManageItemSm() { |
||||
return Container( |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Shimmer.fromColors( |
||||
baseColor: Color(0XFFD8D8D8), |
||||
highlightColor: Color(0XFFD8D8D8), |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0XFFD8D8D8), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
width: 112.w, |
||||
height: 20.h, |
||||
), |
||||
), |
||||
Spacer(), |
||||
Padding( |
||||
padding: EdgeInsets.symmetric(horizontal: 17.w), |
||||
child: Shimmer.fromColors( |
||||
baseColor: Color(0XFFD8D8D8), |
||||
highlightColor: Color(0XFFD8D8D8), |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0XFFD8D8D8), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
width: 28.w, |
||||
height: 20.h, |
||||
), |
||||
), |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(right: 16.w, left: 17.w), |
||||
child: Shimmer.fromColors( |
||||
baseColor: Color(0XFFD8D8D8), |
||||
highlightColor: Color(0XFFD8D8D8), |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0XFFD8D8D8), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
width: 28.w, |
||||
height: 20.h, |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.symmetric(vertical: 16.h), |
||||
color: Color(0xFFEBEBEB), |
||||
height: 1.h, |
||||
width: double.infinity, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///删除分组提示弹窗 |
||||
showDelGroupDialog(id) { |
||||
showDialog( |
||||
context: context, |
||||
builder: (context) { |
||||
return AlertDialog( |
||||
content: Container( |
||||
width: MediaQuery.of(context).size.width - 84, |
||||
height: 139.h, |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
"选中数据将被永久删除, 是否继续?", |
||||
style: TextStyle( |
||||
color: Color(0xFFF4524D), |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 35.h, |
||||
), |
||||
Row( |
||||
children: [ |
||||
Expanded( |
||||
child: InkWell( |
||||
child: BorderText( |
||||
text: S.of(context).quxiao, |
||||
textColor: Color(0xFF30415B), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
borderColor: Color(0xFF30415B), |
||||
radius: 4, |
||||
padding: EdgeInsets.all(12), |
||||
borderWidth: 1, |
||||
), |
||||
onTap: () { |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
), |
||||
flex: 1, |
||||
), |
||||
SizedBox( |
||||
width: 16.w, |
||||
), |
||||
Expanded( |
||||
child: InkWell( |
||||
child: RoundButton( |
||||
text: S.of(context).queren, |
||||
textColor: Colors.white, |
||||
radius: 4, |
||||
padding: EdgeInsets.all(12), |
||||
backgroup: Color(0xFF30415B), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
onTap: () { |
||||
Navigator.of(context).pop(); |
||||
queryDelUser(id); |
||||
}, |
||||
), |
||||
flex: 1, |
||||
), |
||||
], |
||||
) |
||||
], |
||||
), |
||||
), |
||||
); |
||||
}, |
||||
); |
||||
} |
||||
|
||||
Widget noNetwork() { |
||||
return Container( |
||||
color: Colors.white, |
||||
width: double.infinity, |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
networkError.substring(0, networkError.indexOf(",")), |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.bold), |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.symmetric(vertical: 10.h), |
||||
child: Text( |
||||
"请检查网络设置或稍后重试", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF7A797F), |
||||
fontWeight: MyFontWeight.regular), |
||||
), |
||||
), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
_onRefresh(); |
||||
}, |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(15), |
||||
), |
||||
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), |
||||
child: Text( |
||||
"重试", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Colors.white, |
||||
fontWeight: MyFontWeight.regular), |
||||
)), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,208 @@
|
||||
import 'dart:typed_data'; |
||||
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:image_gallery_saver/image_gallery_saver.dart'; |
||||
import 'package:permission_handler/permission_handler.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:qr_flutter/qr_flutter.dart'; |
||||
|
||||
import '../../view_widget/classic_header.dart'; |
||||
import '../../view_widget/my_footer.dart'; |
||||
|
||||
class ShopReservationCode extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
ShopReservationCode({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ShopReservationCode(); |
||||
} |
||||
} |
||||
|
||||
class _ShopReservationCode extends State<ShopReservationCode> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title: "门店预约二维码", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
leadingColor: Colors.black, |
||||
brightness: Brightness.dark, |
||||
), |
||||
body: |
||||
// networkStatus == -1 |
||||
// ? noNetwork() : |
||||
SmartRefresher( |
||||
controller: refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader( |
||||
color: Color(0xFF30415B), |
||||
), |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
// _onRefresh(isShowLoad: false); |
||||
}, |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: ScrollController(), |
||||
child: Container( |
||||
padding: EdgeInsets.only(top:16.h,bottom:45.h), |
||||
child: |
||||
// ListView.builder( |
||||
// itemCount: 10, |
||||
// physics: BouncingScrollPhysics(), |
||||
// shrinkWrap: true, |
||||
// itemBuilder: (context, position) { |
||||
// return GestureDetector( |
||||
// behavior: HitTestBehavior.opaque, |
||||
// onTap: () {}, |
||||
// child: assortItemSm(), |
||||
// ); |
||||
// }, |
||||
// ) |
||||
// : ((productGroupList == null || |
||||
// productGroupList.records.length == 0) |
||||
// ? NoDataView( |
||||
// src: "assets/image/bs_no data_logo.webp", |
||||
// isShowBtn: false, |
||||
// text: "暂无商品分类", |
||||
// fontSize: 16.sp, |
||||
// margin: EdgeInsets.all(20.h), |
||||
// ) : |
||||
ListView.builder( |
||||
itemCount:6, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: reservationCodeItem(), |
||||
); |
||||
}, |
||||
)), |
||||
)); |
||||
} |
||||
|
||||
void saveQrImg(String qrImgData) async{ |
||||
try { |
||||
EasyLoading.show(status: "正在保存...", maskType: EasyLoadingMaskType.clear); |
||||
// 如果用户已授权存储权限 |
||||
if (await Permission.storage.request().isGranted) { |
||||
final painter = QrPainter( |
||||
data: qrImgData, |
||||
version: QrVersions.auto, |
||||
gapless: true, |
||||
errorCorrectionLevel: QrErrorCorrectLevel.L, |
||||
); |
||||
ByteData imageData = await painter.toImageData(600.0); |
||||
final data = imageData.buffer.asUint8List(); |
||||
if (data != null) { |
||||
var result = await |
||||
ImageGallerySaver.saveImage(data, |
||||
isReturnImagePathOfIOS: true); |
||||
if (result["isSuccess"] == true) { |
||||
SmartDialog.showToast("保存成功!", alignment: Alignment.center); |
||||
} else |
||||
SmartDialog.showToast("保存失败!${result["errorMessage"] ?? ""}", |
||||
alignment: Alignment.center); |
||||
} else |
||||
SmartDialog.showToast("获取图片失败!", alignment: Alignment.center); |
||||
} else { |
||||
// 没有存储权限时,弹出没有存储权限的弹窗 |
||||
await Permission.storage.request(); |
||||
SmartDialog.showToast("请在授予应用储存权限后再试!", alignment: Alignment.center); |
||||
} |
||||
} catch (e, s) { |
||||
SmartDialog.showToast("22222", alignment: Alignment.center); |
||||
SmartDialog.showToast(e.toString(), alignment: Alignment.center); |
||||
SmartDialog.showToast(s.toString(), alignment: Alignment.center); |
||||
} finally { |
||||
EasyLoading.dismiss(); |
||||
} |
||||
} |
||||
|
||||
Widget reservationCodeItem() { |
||||
return Container( |
||||
width: double.infinity, |
||||
margin: EdgeInsets.only(left: 16.w, right: 16.w,bottom:12.h), |
||||
padding: EdgeInsets.only(top:12.h, bottom: 12.h,left:20.w,), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
borderRadius: BorderRadius.circular(8), |
||||
), |
||||
child: Row( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
QrImage( |
||||
data: "555562332356564512", |
||||
version: QrVersions.auto, |
||||
size: 104.h, |
||||
gapless: true, |
||||
padding: EdgeInsets.all(0), |
||||
), |
||||
SizedBox(width: 10.w,), |
||||
Expanded(child:Container( |
||||
height: 104.h, |
||||
child: Column( |
||||
children: [ |
||||
Expanded(child:Padding(padding: EdgeInsets.only(right: 22.w), |
||||
child: Text( |
||||
"海峡姐妹理发彭和会所", |
||||
overflow: TextOverflow.ellipsis, |
||||
maxLines: 2, |
||||
style: TextStyle( |
||||
color: Color(0xD9000000), |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.bold, |
||||
), |
||||
),)), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
saveQrImg("555562332356564512"); |
||||
}, |
||||
child: Container( |
||||
padding: EdgeInsets.only(top:15.h,right: 22.w), |
||||
alignment: Alignment.bottomRight, |
||||
child: Image.asset( |
||||
"assets/image/bus_code_save.webp", |
||||
width: 20.w, |
||||
height: 18.h, |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,303 @@
|
||||
/// id : "1737361620364951552" |
||||
/// createTime : "2023-12-20 14:37:43" |
||||
/// createUser : "1640233401329909760" |
||||
/// updateTime : "2023-12-20 14:37:43" |
||||
/// updateUser : "1640233401329909760" |
||||
/// mid : "1737361616430694400" |
||||
/// masterId : null |
||||
/// openid : "" |
||||
/// aliOpenid : null |
||||
/// douyinOpenid : null |
||||
/// nickname : null |
||||
/// headimg : null |
||||
/// rankId : null |
||||
/// rankExpireTime : null |
||||
/// balance : null |
||||
/// realRecharge : null |
||||
/// sex : null |
||||
/// status : null |
||||
/// onCredit : null |
||||
/// loginTime : "2023-12-20 14:37:43" |
||||
/// loginNum : null |
||||
/// tenantCode : null |
||||
/// source : null |
||||
/// expendAmount : null |
||||
/// buyTimes : null |
||||
/// lastBuyTime : null |
||||
/// vip_no : "001119613052919191" |
||||
/// expireTime : "2033-12-20 14:37:43" |
||||
/// integral : null |
||||
/// level : null |
||||
/// vipRegStore : null |
||||
/// certification : null |
||||
|
||||
class AddVipInfo { |
||||
AddVipInfo({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String mid, |
||||
dynamic masterId, |
||||
String openid, |
||||
dynamic aliOpenid, |
||||
dynamic douyinOpenid, |
||||
dynamic nickname, |
||||
dynamic headimg, |
||||
dynamic rankId, |
||||
dynamic rankExpireTime, |
||||
dynamic balance, |
||||
dynamic realRecharge, |
||||
dynamic sex, |
||||
dynamic status, |
||||
dynamic onCredit, |
||||
String loginTime, |
||||
dynamic loginNum, |
||||
dynamic tenantCode, |
||||
dynamic source, |
||||
dynamic expendAmount, |
||||
dynamic buyTimes, |
||||
dynamic lastBuyTime, |
||||
String vipNo, |
||||
String expireTime, |
||||
dynamic integral, |
||||
dynamic level, |
||||
dynamic vipRegStore, |
||||
dynamic certification,}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_mid = mid; |
||||
_masterId = masterId; |
||||
_openid = openid; |
||||
_aliOpenid = aliOpenid; |
||||
_douyinOpenid = douyinOpenid; |
||||
_nickname = nickname; |
||||
_headimg = headimg; |
||||
_rankId = rankId; |
||||
_rankExpireTime = rankExpireTime; |
||||
_balance = balance; |
||||
_realRecharge = realRecharge; |
||||
_sex = sex; |
||||
_status = status; |
||||
_onCredit = onCredit; |
||||
_loginTime = loginTime; |
||||
_loginNum = loginNum; |
||||
_tenantCode = tenantCode; |
||||
_source = source; |
||||
_expendAmount = expendAmount; |
||||
_buyTimes = buyTimes; |
||||
_lastBuyTime = lastBuyTime; |
||||
_vipNo = vipNo; |
||||
_expireTime = expireTime; |
||||
_integral = integral; |
||||
_level = level; |
||||
_vipRegStore = vipRegStore; |
||||
_certification = certification; |
||||
} |
||||
|
||||
AddVipInfo.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_mid = json['mid']; |
||||
_masterId = json['masterId']; |
||||
_openid = json['openid']; |
||||
_aliOpenid = json['aliOpenid']; |
||||
_douyinOpenid = json['douyinOpenid']; |
||||
_nickname = json['nickname']; |
||||
_headimg = json['headimg']; |
||||
_rankId = json['rankId']; |
||||
_rankExpireTime = json['rankExpireTime']; |
||||
_balance = json['balance']; |
||||
_realRecharge = json['realRecharge']; |
||||
_sex = json['sex']; |
||||
_status = json['status']; |
||||
_onCredit = json['onCredit']; |
||||
_loginTime = json['loginTime']; |
||||
_loginNum = json['loginNum']; |
||||
_tenantCode = json['tenantCode']; |
||||
_source = json['source']; |
||||
_expendAmount = json['expendAmount']; |
||||
_buyTimes = json['buyTimes']; |
||||
_lastBuyTime = json['lastBuyTime']; |
||||
_vipNo = json['vip_no']; |
||||
_expireTime = json['expireTime']; |
||||
_integral = json['integral']; |
||||
_level = json['level']; |
||||
_vipRegStore = json['vipRegStore']; |
||||
_certification = json['certification']; |
||||
} |
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _mid; |
||||
dynamic _masterId; |
||||
String _openid; |
||||
dynamic _aliOpenid; |
||||
dynamic _douyinOpenid; |
||||
dynamic _nickname; |
||||
dynamic _headimg; |
||||
dynamic _rankId; |
||||
dynamic _rankExpireTime; |
||||
dynamic _balance; |
||||
dynamic _realRecharge; |
||||
dynamic _sex; |
||||
dynamic _status; |
||||
dynamic _onCredit; |
||||
String _loginTime; |
||||
dynamic _loginNum; |
||||
dynamic _tenantCode; |
||||
dynamic _source; |
||||
dynamic _expendAmount; |
||||
dynamic _buyTimes; |
||||
dynamic _lastBuyTime; |
||||
String _vipNo; |
||||
String _expireTime; |
||||
dynamic _integral; |
||||
dynamic _level; |
||||
dynamic _vipRegStore; |
||||
dynamic _certification; |
||||
AddVipInfo copyWith({ String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String mid, |
||||
dynamic masterId, |
||||
String openid, |
||||
dynamic aliOpenid, |
||||
dynamic douyinOpenid, |
||||
dynamic nickname, |
||||
dynamic headimg, |
||||
dynamic rankId, |
||||
dynamic rankExpireTime, |
||||
dynamic balance, |
||||
dynamic realRecharge, |
||||
dynamic sex, |
||||
dynamic status, |
||||
dynamic onCredit, |
||||
String loginTime, |
||||
dynamic loginNum, |
||||
dynamic tenantCode, |
||||
dynamic source, |
||||
dynamic expendAmount, |
||||
dynamic buyTimes, |
||||
dynamic lastBuyTime, |
||||
String vipNo, |
||||
String expireTime, |
||||
dynamic integral, |
||||
dynamic level, |
||||
dynamic vipRegStore, |
||||
dynamic certification, |
||||
}) => AddVipInfo( id: id ?? _id, |
||||
createTime: createTime ?? _createTime, |
||||
createUser: createUser ?? _createUser, |
||||
updateTime: updateTime ?? _updateTime, |
||||
updateUser: updateUser ?? _updateUser, |
||||
mid: mid ?? _mid, |
||||
masterId: masterId ?? _masterId, |
||||
openid: openid ?? _openid, |
||||
aliOpenid: aliOpenid ?? _aliOpenid, |
||||
douyinOpenid: douyinOpenid ?? _douyinOpenid, |
||||
nickname: nickname ?? _nickname, |
||||
headimg: headimg ?? _headimg, |
||||
rankId: rankId ?? _rankId, |
||||
rankExpireTime: rankExpireTime ?? _rankExpireTime, |
||||
balance: balance ?? _balance, |
||||
realRecharge: realRecharge ?? _realRecharge, |
||||
sex: sex ?? _sex, |
||||
status: status ?? _status, |
||||
onCredit: onCredit ?? _onCredit, |
||||
loginTime: loginTime ?? _loginTime, |
||||
loginNum: loginNum ?? _loginNum, |
||||
tenantCode: tenantCode ?? _tenantCode, |
||||
source: source ?? _source, |
||||
expendAmount: expendAmount ?? _expendAmount, |
||||
buyTimes: buyTimes ?? _buyTimes, |
||||
lastBuyTime: lastBuyTime ?? _lastBuyTime, |
||||
vipNo: vipNo ?? _vipNo, |
||||
expireTime: expireTime ?? _expireTime, |
||||
integral: integral ?? _integral, |
||||
level: level ?? _level, |
||||
vipRegStore: vipRegStore ?? _vipRegStore, |
||||
certification: certification ?? _certification, |
||||
); |
||||
String get id => _id; |
||||
String get createTime => _createTime; |
||||
String get createUser => _createUser; |
||||
String get updateTime => _updateTime; |
||||
String get updateUser => _updateUser; |
||||
String get mid => _mid; |
||||
dynamic get masterId => _masterId; |
||||
String get openid => _openid; |
||||
dynamic get aliOpenid => _aliOpenid; |
||||
dynamic get douyinOpenid => _douyinOpenid; |
||||
dynamic get nickname => _nickname; |
||||
dynamic get headimg => _headimg; |
||||
dynamic get rankId => _rankId; |
||||
dynamic get rankExpireTime => _rankExpireTime; |
||||
dynamic get balance => _balance; |
||||
dynamic get realRecharge => _realRecharge; |
||||
dynamic get sex => _sex; |
||||
dynamic get status => _status; |
||||
dynamic get onCredit => _onCredit; |
||||
String get loginTime => _loginTime; |
||||
dynamic get loginNum => _loginNum; |
||||
dynamic get tenantCode => _tenantCode; |
||||
dynamic get source => _source; |
||||
dynamic get expendAmount => _expendAmount; |
||||
dynamic get buyTimes => _buyTimes; |
||||
dynamic get lastBuyTime => _lastBuyTime; |
||||
String get vipNo => _vipNo; |
||||
String get expireTime => _expireTime; |
||||
dynamic get integral => _integral; |
||||
dynamic get level => _level; |
||||
dynamic get vipRegStore => _vipRegStore; |
||||
dynamic get certification => _certification; |
||||
|
||||
Map<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['masterId'] = _masterId; |
||||
map['openid'] = _openid; |
||||
map['aliOpenid'] = _aliOpenid; |
||||
map['douyinOpenid'] = _douyinOpenid; |
||||
map['nickname'] = _nickname; |
||||
map['headimg'] = _headimg; |
||||
map['rankId'] = _rankId; |
||||
map['rankExpireTime'] = _rankExpireTime; |
||||
map['balance'] = _balance; |
||||
map['realRecharge'] = _realRecharge; |
||||
map['sex'] = _sex; |
||||
map['status'] = _status; |
||||
map['onCredit'] = _onCredit; |
||||
map['loginTime'] = _loginTime; |
||||
map['loginNum'] = _loginNum; |
||||
map['tenantCode'] = _tenantCode; |
||||
map['source'] = _source; |
||||
map['expendAmount'] = _expendAmount; |
||||
map['buyTimes'] = _buyTimes; |
||||
map['lastBuyTime'] = _lastBuyTime; |
||||
map['vip_no'] = _vipNo; |
||||
map['expireTime'] = _expireTime; |
||||
map['integral'] = _integral; |
||||
map['level'] = _level; |
||||
map['vipRegStore'] = _vipRegStore; |
||||
map['certification'] = _certification; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,187 @@
|
||||
/// records : [{"id":"1706504181134655488","name":"","phone":"13052919193","money":"4000.40"},{"id":"1699803728942465024","name":"","phone":"18638550294","money":"1502.00"},{"id":"1699032834800353280","name":"","phone":"13339999709","money":"1387.00"},{"id":"1700069353317203968","name":"","phone":"18530077112","money":"1185.00"},{"id":"1723679701001568256","name":"","phone":"13253333210","money":"1000.00"},{"id":"1700896910958657536","name":"","phone":"15093345036","money":"800.00"},{"id":"1695700464139501568","name":"","phone":"15838033785","money":"780.00"},{"id":"1697426943734972416","name":"昵称","phone":"15827991714","money":"710.11"},{"id":"1692483888078651392","name":"","phone":"15538288982","money":"647.60"},{"id":"1698868848263954432","name":"","phone":"13073719376","money":"628.10"}] |
||||
/// total : "1970" |
||||
/// size : "10" |
||||
/// current : "1" |
||||
/// orders : [{"column":"id","asc":false}] |
||||
/// hitCount : false |
||||
/// searchCount : true |
||||
/// pages : "197" |
||||
|
||||
class BalanceConsumptionRankingList { |
||||
BalanceConsumptionRankingList({ |
||||
List<Records> 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; |
||||
} |
||||
|
||||
BalanceConsumptionRankingList.fromJson(dynamic json) { |
||||
if (json['records'] != null) { |
||||
_records = []; |
||||
json['records'].forEach((v) { |
||||
_records.add(Records.fromJson(v)); |
||||
}); |
||||
} |
||||
_total = json['total']; |
||||
_size = json['size']; |
||||
_current = json['current']; |
||||
if (json['orders'] != null) { |
||||
_orders = []; |
||||
json['orders'].forEach((v) { |
||||
_orders.add(Orders.fromJson(v)); |
||||
}); |
||||
} |
||||
_hitCount = json['hitCount']; |
||||
_searchCount = json['searchCount']; |
||||
_pages = json['pages']; |
||||
} |
||||
List<Records> _records; |
||||
String _total; |
||||
String _size; |
||||
String _current; |
||||
List<Orders> _orders; |
||||
bool _hitCount; |
||||
bool _searchCount; |
||||
String _pages; |
||||
BalanceConsumptionRankingList copyWith({ List<Records> records, |
||||
String total, |
||||
String size, |
||||
String current, |
||||
List<Orders> orders, |
||||
bool hitCount, |
||||
bool searchCount, |
||||
String pages, |
||||
}) => BalanceConsumptionRankingList( records: records ?? _records, |
||||
total: total ?? _total, |
||||
size: size ?? _size, |
||||
current: current ?? _current, |
||||
orders: orders ?? _orders, |
||||
hitCount: hitCount ?? _hitCount, |
||||
searchCount: searchCount ?? _searchCount, |
||||
pages: pages ?? _pages, |
||||
); |
||||
List<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 : "1706504181134655488" |
||||
/// name : "" |
||||
/// phone : "13052919193" |
||||
/// money : "4000.40" |
||||
|
||||
class Records { |
||||
Records({ |
||||
String id, |
||||
String name, |
||||
String phone, |
||||
String money,}){ |
||||
_id = id; |
||||
_name = name; |
||||
_phone = phone; |
||||
_money = money; |
||||
} |
||||
|
||||
Records.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_name = json['name']; |
||||
_phone = json['phone']; |
||||
_money = json['money']; |
||||
} |
||||
String _id; |
||||
String _name; |
||||
String _phone; |
||||
String _money; |
||||
Records copyWith({ String id, |
||||
String name, |
||||
String phone, |
||||
String money, |
||||
}) => Records( id: id ?? _id, |
||||
name: name ?? _name, |
||||
phone: phone ?? _phone, |
||||
money: money ?? _money, |
||||
); |
||||
String get id => _id; |
||||
String get name => _name; |
||||
String get phone => _phone; |
||||
String get money => _money; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['name'] = _name; |
||||
map['phone'] = _phone; |
||||
map['money'] = _money; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,304 @@
|
||||
/// records : [{"id":"1693482520970002431","rechargeMoney":"50.00","giftdMoney":"20.00","limitNum":0,"gitfdCouponId":null,"startDate":null,"endDate":null,"startTime":null,"endTime":null,"tenantCode":"1195","createTime":"2023-10-25 17:18:40","isDeleted":0,"rechargeType":0,"remark":"充值50.00 赠送20.00","sortValue":0,"useNum":0,"mid":null}] |
||||
/// total : "0" |
||||
/// size : "999" |
||||
/// current : "1" |
||||
/// orders : [{"column":"id","asc":false}] |
||||
/// hitCount : false |
||||
/// searchCount : true |
||||
/// pages : "0" |
||||
|
||||
class BusRechargeList { |
||||
BusRechargeList({ |
||||
List<Records> 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; |
||||
} |
||||
|
||||
BusRechargeList.fromJson(dynamic json) { |
||||
if (json['records'] != null) { |
||||
_records = []; |
||||
json['records'].forEach((v) { |
||||
_records.add(Records.fromJson(v)); |
||||
}); |
||||
} |
||||
_total = json['total']; |
||||
_size = json['size']; |
||||
_current = json['current']; |
||||
if (json['orders'] != null) { |
||||
_orders = []; |
||||
json['orders'].forEach((v) { |
||||
_orders.add(Orders.fromJson(v)); |
||||
}); |
||||
} |
||||
_hitCount = json['hitCount']; |
||||
_searchCount = json['searchCount']; |
||||
_pages = json['pages']; |
||||
} |
||||
List<Records> _records; |
||||
String _total; |
||||
String _size; |
||||
String _current; |
||||
List<Orders> _orders; |
||||
bool _hitCount; |
||||
bool _searchCount; |
||||
String _pages; |
||||
BusRechargeList copyWith({ List<Records> records, |
||||
String total, |
||||
String size, |
||||
String current, |
||||
List<Orders> orders, |
||||
bool hitCount, |
||||
bool searchCount, |
||||
String pages, |
||||
}) => BusRechargeList( records: records ?? _records, |
||||
total: total ?? _total, |
||||
size: size ?? _size, |
||||
current: current ?? _current, |
||||
orders: orders ?? _orders, |
||||
hitCount: hitCount ?? _hitCount, |
||||
searchCount: searchCount ?? _searchCount, |
||||
pages: pages ?? _pages, |
||||
); |
||||
List<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 : "1693482520970002431" |
||||
/// rechargeMoney : "50.00" |
||||
/// giftdMoney : "20.00" |
||||
/// limitNum : 0 |
||||
/// gitfdCouponId : null |
||||
/// startDate : null |
||||
/// endDate : null |
||||
/// startTime : null |
||||
/// endTime : null |
||||
/// tenantCode : "1195" |
||||
/// createTime : "2023-10-25 17:18:40" |
||||
/// isDeleted : 0 |
||||
/// rechargeType : 0 |
||||
/// remark : "充值50.00 赠送20.00" |
||||
/// sortValue : 0 |
||||
/// useNum : 0 |
||||
/// mid : null |
||||
|
||||
class Records { |
||||
Records({ |
||||
String id, |
||||
String rechargeMoney, |
||||
String giftdMoney, |
||||
num limitNum, |
||||
dynamic gitfdCouponId, |
||||
dynamic startDate, |
||||
dynamic endDate, |
||||
dynamic startTime, |
||||
dynamic endTime, |
||||
String tenantCode, |
||||
String createTime, |
||||
num isDeleted, |
||||
num rechargeType, |
||||
String remark, |
||||
num sortValue, |
||||
num useNum, |
||||
dynamic mid,}){ |
||||
_id = id; |
||||
_rechargeMoney = rechargeMoney; |
||||
_giftdMoney = giftdMoney; |
||||
_limitNum = limitNum; |
||||
_gitfdCouponId = gitfdCouponId; |
||||
_startDate = startDate; |
||||
_endDate = endDate; |
||||
_startTime = startTime; |
||||
_endTime = endTime; |
||||
_tenantCode = tenantCode; |
||||
_createTime = createTime; |
||||
_isDeleted = isDeleted; |
||||
_rechargeType = rechargeType; |
||||
_remark = remark; |
||||
_sortValue = sortValue; |
||||
_useNum = useNum; |
||||
_mid = mid; |
||||
} |
||||
|
||||
Records.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_rechargeMoney = json['rechargeMoney']; |
||||
_giftdMoney = json['giftdMoney']; |
||||
_limitNum = json['limitNum']; |
||||
_gitfdCouponId = json['gitfdCouponId']; |
||||
_startDate = json['startDate']; |
||||
_endDate = json['endDate']; |
||||
_startTime = json['startTime']; |
||||
_endTime = json['endTime']; |
||||
_tenantCode = json['tenantCode']; |
||||
_createTime = json['createTime']; |
||||
_isDeleted = json['isDeleted']; |
||||
_rechargeType = json['rechargeType']; |
||||
_remark = json['remark']; |
||||
_sortValue = json['sortValue']; |
||||
_useNum = json['useNum']; |
||||
_mid = json['mid']; |
||||
} |
||||
String _id; |
||||
String _rechargeMoney; |
||||
String _giftdMoney; |
||||
num _limitNum; |
||||
dynamic _gitfdCouponId; |
||||
dynamic _startDate; |
||||
dynamic _endDate; |
||||
dynamic _startTime; |
||||
dynamic _endTime; |
||||
String _tenantCode; |
||||
String _createTime; |
||||
num _isDeleted; |
||||
num _rechargeType; |
||||
String _remark; |
||||
num _sortValue; |
||||
num _useNum; |
||||
dynamic _mid; |
||||
Records copyWith({ String id, |
||||
String rechargeMoney, |
||||
String giftdMoney, |
||||
num limitNum, |
||||
dynamic gitfdCouponId, |
||||
dynamic startDate, |
||||
dynamic endDate, |
||||
dynamic startTime, |
||||
dynamic endTime, |
||||
String tenantCode, |
||||
String createTime, |
||||
num isDeleted, |
||||
num rechargeType, |
||||
String remark, |
||||
num sortValue, |
||||
num useNum, |
||||
dynamic mid, |
||||
}) => Records( id: id ?? _id, |
||||
rechargeMoney: rechargeMoney ?? _rechargeMoney, |
||||
giftdMoney: giftdMoney ?? _giftdMoney, |
||||
limitNum: limitNum ?? _limitNum, |
||||
gitfdCouponId: gitfdCouponId ?? _gitfdCouponId, |
||||
startDate: startDate ?? _startDate, |
||||
endDate: endDate ?? _endDate, |
||||
startTime: startTime ?? _startTime, |
||||
endTime: endTime ?? _endTime, |
||||
tenantCode: tenantCode ?? _tenantCode, |
||||
createTime: createTime ?? _createTime, |
||||
isDeleted: isDeleted ?? _isDeleted, |
||||
rechargeType: rechargeType ?? _rechargeType, |
||||
remark: remark ?? _remark, |
||||
sortValue: sortValue ?? _sortValue, |
||||
useNum: useNum ?? _useNum, |
||||
mid: mid ?? _mid, |
||||
); |
||||
String get id => _id; |
||||
String get rechargeMoney => _rechargeMoney; |
||||
String get giftdMoney => _giftdMoney; |
||||
num get limitNum => _limitNum; |
||||
dynamic get gitfdCouponId => _gitfdCouponId; |
||||
dynamic get startDate => _startDate; |
||||
dynamic get endDate => _endDate; |
||||
dynamic get startTime => _startTime; |
||||
dynamic get endTime => _endTime; |
||||
String get tenantCode => _tenantCode; |
||||
String get createTime => _createTime; |
||||
num get isDeleted => _isDeleted; |
||||
num get rechargeType => _rechargeType; |
||||
String get remark => _remark; |
||||
num get sortValue => _sortValue; |
||||
num get useNum => _useNum; |
||||
dynamic get mid => _mid; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['rechargeMoney'] = _rechargeMoney; |
||||
map['giftdMoney'] = _giftdMoney; |
||||
map['limitNum'] = _limitNum; |
||||
map['gitfdCouponId'] = _gitfdCouponId; |
||||
map['startDate'] = _startDate; |
||||
map['endDate'] = _endDate; |
||||
map['startTime'] = _startTime; |
||||
map['endTime'] = _endTime; |
||||
map['tenantCode'] = _tenantCode; |
||||
map['createTime'] = _createTime; |
||||
map['isDeleted'] = _isDeleted; |
||||
map['rechargeType'] = _rechargeType; |
||||
map['remark'] = _remark; |
||||
map['sortValue'] = _sortValue; |
||||
map['useNum'] = _useNum; |
||||
map['mid'] = _mid; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,132 @@
|
||||
/// mid : "1379254113602109440" |
||||
/// sid : "1706504181134655488" |
||||
/// phoneNum : "13052919193" |
||||
/// nickName : "" |
||||
/// headimg : "" |
||||
/// sex : "0" |
||||
/// balance : "0.00" |
||||
/// memberSourceCredit : false |
||||
/// money : "1.49" |
||||
/// memberCredit : false |
||||
/// greenMoney : "0.00" |
||||
/// raiseMoney : "0.00" |
||||
/// payPassword : "222222" |
||||
|
||||
class PhoneQueryMemberInfo { |
||||
PhoneQueryMemberInfo({ |
||||
String mid, |
||||
String sid, |
||||
String phoneNum, |
||||
String nickName, |
||||
String headimg, |
||||
String sex, |
||||
String balance, |
||||
bool memberSourceCredit, |
||||
String money, |
||||
bool memberCredit, |
||||
String greenMoney, |
||||
String raiseMoney, |
||||
String payPassword,}){ |
||||
_mid = mid; |
||||
_sid = sid; |
||||
_phoneNum = phoneNum; |
||||
_nickName = nickName; |
||||
_headimg = headimg; |
||||
_sex = sex; |
||||
_balance = balance; |
||||
_memberSourceCredit = memberSourceCredit; |
||||
_money = money; |
||||
_memberCredit = memberCredit; |
||||
_greenMoney = greenMoney; |
||||
_raiseMoney = raiseMoney; |
||||
_payPassword = payPassword; |
||||
} |
||||
|
||||
PhoneQueryMemberInfo.fromJson(dynamic json) { |
||||
_mid = json['mid']; |
||||
_sid = json['sid']; |
||||
_phoneNum = json['phoneNum']; |
||||
_nickName = json['nickName']; |
||||
_headimg = json['headimg']; |
||||
_sex = json['sex']; |
||||
_balance = json['balance']; |
||||
_memberSourceCredit = json['memberSourceCredit']; |
||||
_money = json['money']; |
||||
_memberCredit = json['memberCredit']; |
||||
_greenMoney = json['greenMoney']; |
||||
_raiseMoney = json['raiseMoney']; |
||||
_payPassword = json['payPassword']; |
||||
} |
||||
String _mid; |
||||
String _sid; |
||||
String _phoneNum; |
||||
String _nickName; |
||||
String _headimg; |
||||
String _sex; |
||||
String _balance; |
||||
bool _memberSourceCredit; |
||||
String _money; |
||||
bool _memberCredit; |
||||
String _greenMoney; |
||||
String _raiseMoney; |
||||
String _payPassword; |
||||
PhoneQueryMemberInfo copyWith({ String mid, |
||||
String sid, |
||||
String phoneNum, |
||||
String nickName, |
||||
String headimg, |
||||
String sex, |
||||
String balance, |
||||
bool memberSourceCredit, |
||||
String money, |
||||
bool memberCredit, |
||||
String greenMoney, |
||||
String raiseMoney, |
||||
String payPassword, |
||||
}) => PhoneQueryMemberInfo( mid: mid ?? _mid, |
||||
sid: sid ?? _sid, |
||||
phoneNum: phoneNum ?? _phoneNum, |
||||
nickName: nickName ?? _nickName, |
||||
headimg: headimg ?? _headimg, |
||||
sex: sex ?? _sex, |
||||
balance: balance ?? _balance, |
||||
memberSourceCredit: memberSourceCredit ?? _memberSourceCredit, |
||||
money: money ?? _money, |
||||
memberCredit: memberCredit ?? _memberCredit, |
||||
greenMoney: greenMoney ?? _greenMoney, |
||||
raiseMoney: raiseMoney ?? _raiseMoney, |
||||
payPassword: payPassword ?? _payPassword, |
||||
); |
||||
String get mid => _mid; |
||||
String get sid => _sid; |
||||
String get phoneNum => _phoneNum; |
||||
String get nickName => _nickName; |
||||
String get headimg => _headimg; |
||||
String get sex => _sex; |
||||
String get balance => _balance; |
||||
bool get memberSourceCredit => _memberSourceCredit; |
||||
String get money => _money; |
||||
bool get memberCredit => _memberCredit; |
||||
String get greenMoney => _greenMoney; |
||||
String get raiseMoney => _raiseMoney; |
||||
String get payPassword => _payPassword; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['mid'] = _mid; |
||||
map['sid'] = _sid; |
||||
map['phoneNum'] = _phoneNum; |
||||
map['nickName'] = _nickName; |
||||
map['headimg'] = _headimg; |
||||
map['sex'] = _sex; |
||||
map['balance'] = _balance; |
||||
map['memberSourceCredit'] = _memberSourceCredit; |
||||
map['money'] = _money; |
||||
map['memberCredit'] = _memberCredit; |
||||
map['greenMoney'] = _greenMoney; |
||||
map['raiseMoney'] = _raiseMoney; |
||||
map['payPassword'] = _payPassword; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,267 @@
|
||||
/// id : "1738082396969893888" |
||||
/// createTime : "2023-12-22 14:21:50" |
||||
/// createUser : "1640233401329909760" |
||||
/// updateTime : "2023-12-22 14:21:50" |
||||
/// updateUser : "1640233401329909760" |
||||
/// account : "13052919193" |
||||
/// name : "wu" |
||||
/// org : null |
||||
/// station : null |
||||
/// type : null |
||||
/// email : null |
||||
/// mobile : null |
||||
/// sex : {"desc":"未知","code":"N"} |
||||
/// status : null |
||||
/// avatar : null |
||||
/// nation : null |
||||
/// education : null |
||||
/// positionStatus : null |
||||
/// workDescribe : null |
||||
/// passwordErrorLastTime : null |
||||
/// passwordErrorNum : 0 |
||||
/// passwordExpireTime : null |
||||
/// password : "e10adc3949ba59abbe56e057f20f883e" |
||||
/// lastLoginTime : null |
||||
|
||||
class UserInfoEdit { |
||||
UserInfoEdit({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String account, |
||||
String name, |
||||
dynamic org, |
||||
dynamic station, |
||||
dynamic type, |
||||
dynamic email, |
||||
dynamic mobile, |
||||
Sex sex, |
||||
dynamic status, |
||||
dynamic avatar, |
||||
dynamic nation, |
||||
dynamic education, |
||||
dynamic positionStatus, |
||||
dynamic workDescribe, |
||||
dynamic passwordErrorLastTime, |
||||
num passwordErrorNum, |
||||
dynamic passwordExpireTime, |
||||
String password, |
||||
dynamic lastLoginTime,}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_account = account; |
||||
_name = name; |
||||
_org = org; |
||||
_station = station; |
||||
_type = type; |
||||
_email = email; |
||||
_mobile = mobile; |
||||
_sex = sex; |
||||
_status = status; |
||||
_avatar = avatar; |
||||
_nation = nation; |
||||
_education = education; |
||||
_positionStatus = positionStatus; |
||||
_workDescribe = workDescribe; |
||||
_passwordErrorLastTime = passwordErrorLastTime; |
||||
_passwordErrorNum = passwordErrorNum; |
||||
_passwordExpireTime = passwordExpireTime; |
||||
_password = password; |
||||
_lastLoginTime = lastLoginTime; |
||||
} |
||||
|
||||
UserInfoEdit.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_account = json['account']; |
||||
_name = json['name']; |
||||
_org = json['org']; |
||||
_station = json['station']; |
||||
_type = json['type']; |
||||
_email = json['email']; |
||||
_mobile = json['mobile']; |
||||
_sex = json['sex'] != null ? Sex.fromJson(json['sex']) : null; |
||||
_status = json['status']; |
||||
_avatar = json['avatar']; |
||||
_nation = json['nation']; |
||||
_education = json['education']; |
||||
_positionStatus = json['positionStatus']; |
||||
_workDescribe = json['workDescribe']; |
||||
_passwordErrorLastTime = json['passwordErrorLastTime']; |
||||
_passwordErrorNum = json['passwordErrorNum']; |
||||
_passwordExpireTime = json['passwordExpireTime']; |
||||
_password = json['password']; |
||||
_lastLoginTime = json['lastLoginTime']; |
||||
} |
||||
String _id; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _updateTime; |
||||
String _updateUser; |
||||
String _account; |
||||
String _name; |
||||
dynamic _org; |
||||
dynamic _station; |
||||
dynamic _type; |
||||
dynamic _email; |
||||
dynamic _mobile; |
||||
Sex _sex; |
||||
dynamic _status; |
||||
dynamic _avatar; |
||||
dynamic _nation; |
||||
dynamic _education; |
||||
dynamic _positionStatus; |
||||
dynamic _workDescribe; |
||||
dynamic _passwordErrorLastTime; |
||||
num _passwordErrorNum; |
||||
dynamic _passwordExpireTime; |
||||
String _password; |
||||
dynamic _lastLoginTime; |
||||
UserInfoEdit copyWith({ String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String account, |
||||
String name, |
||||
dynamic org, |
||||
dynamic station, |
||||
dynamic type, |
||||
dynamic email, |
||||
dynamic mobile, |
||||
Sex sex, |
||||
dynamic status, |
||||
dynamic avatar, |
||||
dynamic nation, |
||||
dynamic education, |
||||
dynamic positionStatus, |
||||
dynamic workDescribe, |
||||
dynamic passwordErrorLastTime, |
||||
num passwordErrorNum, |
||||
dynamic passwordExpireTime, |
||||
String password, |
||||
dynamic lastLoginTime, |
||||
}) => UserInfoEdit( id: id ?? _id, |
||||
createTime: createTime ?? _createTime, |
||||
createUser: createUser ?? _createUser, |
||||
updateTime: updateTime ?? _updateTime, |
||||
updateUser: updateUser ?? _updateUser, |
||||
account: account ?? _account, |
||||
name: name ?? _name, |
||||
org: org ?? _org, |
||||
station: station ?? _station, |
||||
type: type ?? _type, |
||||
email: email ?? _email, |
||||
mobile: mobile ?? _mobile, |
||||
sex: sex ?? _sex, |
||||
status: status ?? _status, |
||||
avatar: avatar ?? _avatar, |
||||
nation: nation ?? _nation, |
||||
education: education ?? _education, |
||||
positionStatus: positionStatus ?? _positionStatus, |
||||
workDescribe: workDescribe ?? _workDescribe, |
||||
passwordErrorLastTime: passwordErrorLastTime ?? _passwordErrorLastTime, |
||||
passwordErrorNum: passwordErrorNum ?? _passwordErrorNum, |
||||
passwordExpireTime: passwordExpireTime ?? _passwordExpireTime, |
||||
password: password ?? _password, |
||||
lastLoginTime: lastLoginTime ?? _lastLoginTime, |
||||
); |
||||
String get id => _id; |
||||
String get createTime => _createTime; |
||||
String get createUser => _createUser; |
||||
String get updateTime => _updateTime; |
||||
String get updateUser => _updateUser; |
||||
String get account => _account; |
||||
String get name => _name; |
||||
dynamic get org => _org; |
||||
dynamic get station => _station; |
||||
dynamic get type => _type; |
||||
dynamic get email => _email; |
||||
dynamic get mobile => _mobile; |
||||
Sex get sex => _sex; |
||||
dynamic get status => _status; |
||||
dynamic get avatar => _avatar; |
||||
dynamic get nation => _nation; |
||||
dynamic get education => _education; |
||||
dynamic get positionStatus => _positionStatus; |
||||
dynamic get workDescribe => _workDescribe; |
||||
dynamic get passwordErrorLastTime => _passwordErrorLastTime; |
||||
num get passwordErrorNum => _passwordErrorNum; |
||||
dynamic get passwordExpireTime => _passwordExpireTime; |
||||
String get password => _password; |
||||
dynamic get lastLoginTime => _lastLoginTime; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['account'] = _account; |
||||
map['name'] = _name; |
||||
map['org'] = _org; |
||||
map['station'] = _station; |
||||
map['type'] = _type; |
||||
map['email'] = _email; |
||||
map['mobile'] = _mobile; |
||||
if (_sex != null) { |
||||
map['sex'] = _sex.toJson(); |
||||
} |
||||
map['status'] = _status; |
||||
map['avatar'] = _avatar; |
||||
map['nation'] = _nation; |
||||
map['education'] = _education; |
||||
map['positionStatus'] = _positionStatus; |
||||
map['workDescribe'] = _workDescribe; |
||||
map['passwordErrorLastTime'] = _passwordErrorLastTime; |
||||
map['passwordErrorNum'] = _passwordErrorNum; |
||||
map['passwordExpireTime'] = _passwordExpireTime; |
||||
map['password'] = _password; |
||||
map['lastLoginTime'] = _lastLoginTime; |
||||
return map; |
||||
} |
||||
|
||||
} |
||||
|
||||
/// desc : "未知" |
||||
/// code : "N" |
||||
|
||||
class Sex { |
||||
Sex({ |
||||
String desc, |
||||
String code,}){ |
||||
_desc = desc; |
||||
_code = code; |
||||
} |
||||
|
||||
Sex.fromJson(dynamic json) { |
||||
_desc = json['desc']; |
||||
_code = json['code']; |
||||
} |
||||
String _desc; |
||||
String _code; |
||||
Sex copyWith({ String desc, |
||||
String code, |
||||
}) => Sex( desc: desc ?? _desc, |
||||
code: code ?? _code, |
||||
); |
||||
String get desc => _desc; |
||||
String get code => _code; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['desc'] = _desc; |
||||
map['code'] = _code; |
||||
return map; |
||||
} |
||||
|
||||
} |