diff --git a/assets/image/2x/bs_mine_clerk.webp b/assets/image/2x/bs_mine_clerk.webp
new file mode 100644
index 00000000..81cdd881
Binary files /dev/null and b/assets/image/2x/bs_mine_clerk.webp differ
diff --git a/assets/image/bs_store_info_logo.webp b/assets/image/2x/bs_mine_code.webp
similarity index 65%
rename from assets/image/bs_store_info_logo.webp
rename to assets/image/2x/bs_mine_code.webp
index 83f8609b..f6b8fc83 100644
Binary files a/assets/image/bs_store_info_logo.webp and b/assets/image/2x/bs_mine_code.webp differ
diff --git a/assets/image/2x/bs_secure.webp b/assets/image/2x/bs_secure.webp
index d8f3eb12..a86e2287 100644
Binary files a/assets/image/2x/bs_secure.webp and b/assets/image/2x/bs_secure.webp differ
diff --git a/assets/image/2x/bs_shop_logo.webp b/assets/image/2x/bs_shop_logo.webp
index 2a8819bb..5bb7f860 100644
Binary files a/assets/image/2x/bs_shop_logo.webp and b/assets/image/2x/bs_shop_logo.webp differ
diff --git a/assets/image/2x/bus_code_save.webp b/assets/image/2x/bus_code_save.webp
new file mode 100644
index 00000000..41aaf2e1
Binary files /dev/null and b/assets/image/2x/bus_code_save.webp differ
diff --git a/assets/image/2x/bus_home_bhy.webp b/assets/image/2x/bus_home_bhy.webp
new file mode 100644
index 00000000..888b8eeb
Binary files /dev/null and b/assets/image/2x/bus_home_bhy.webp differ
diff --git a/assets/image/2x/bus_home_cz.webp b/assets/image/2x/bus_home_cz.webp
new file mode 100644
index 00000000..56d9c576
Binary files /dev/null and b/assets/image/2x/bus_home_cz.webp differ
diff --git a/assets/image/2x/bus_home_czjl.webp b/assets/image/2x/bus_home_czjl.webp
new file mode 100644
index 00000000..a4b3f9f9
Binary files /dev/null and b/assets/image/2x/bus_home_czjl.webp differ
diff --git a/assets/image/2x/bus_home_goods.webp b/assets/image/2x/bus_home_goods.webp
new file mode 100644
index 00000000..10a50d3d
Binary files /dev/null and b/assets/image/2x/bus_home_goods.webp differ
diff --git a/assets/image/2x/bus_home_goods_ssfx.webp b/assets/image/2x/bus_home_goods_ssfx.webp
new file mode 100644
index 00000000..e6eaeef5
Binary files /dev/null and b/assets/image/2x/bus_home_goods_ssfx.webp differ
diff --git a/assets/image/2x/bus_home_hygl.webp b/assets/image/2x/bus_home_hygl.webp
new file mode 100644
index 00000000..4faacb3b
Binary files /dev/null and b/assets/image/2x/bus_home_hygl.webp differ
diff --git a/assets/image/2x/bus_home_hyyetj.webp b/assets/image/2x/bus_home_hyyetj.webp
new file mode 100644
index 00000000..c26a58f4
Binary files /dev/null and b/assets/image/2x/bus_home_hyyetj.webp differ
diff --git a/assets/image/2x/bus_home_jrls.webp b/assets/image/2x/bus_home_jrls.webp
new file mode 100644
index 00000000..0500eff4
Binary files /dev/null and b/assets/image/2x/bus_home_jrls.webp differ
diff --git a/assets/image/2x/bus_home_rxbd.webp b/assets/image/2x/bus_home_rxbd.webp
new file mode 100644
index 00000000..4f6b2ab6
Binary files /dev/null and b/assets/image/2x/bus_home_rxbd.webp differ
diff --git a/assets/image/2x/bus_home_syt.webp b/assets/image/2x/bus_home_syt.webp
new file mode 100644
index 00000000..60c95084
Binary files /dev/null and b/assets/image/2x/bus_home_syt.webp differ
diff --git a/assets/image/2x/bus_home_syzl.webp b/assets/image/2x/bus_home_syzl.webp
new file mode 100644
index 00000000..5a46aa56
Binary files /dev/null and b/assets/image/2x/bus_home_syzl.webp differ
diff --git a/assets/image/2x/bus_home_xfjl.webp b/assets/image/2x/bus_home_xfjl.webp
new file mode 100644
index 00000000..885f9ea7
Binary files /dev/null and b/assets/image/2x/bus_home_xfjl.webp differ
diff --git a/assets/image/2x/bus_home_xfpm.webp b/assets/image/2x/bus_home_xfpm.webp
new file mode 100644
index 00000000..917c4b56
Binary files /dev/null and b/assets/image/2x/bus_home_xfpm.webp differ
diff --git a/assets/image/2x/bus_home_yytj.webp b/assets/image/2x/bus_home_yytj.webp
new file mode 100644
index 00000000..bd9b6862
Binary files /dev/null and b/assets/image/2x/bus_home_yytj.webp differ
diff --git a/assets/image/2x/bus_pay_success_logo.png b/assets/image/2x/bus_pay_success_logo.png
new file mode 100644
index 00000000..52c37939
Binary files /dev/null and b/assets/image/2x/bus_pay_success_logo.png differ
diff --git a/assets/image/3x/bs_mine_clerk.webp b/assets/image/3x/bs_mine_clerk.webp
new file mode 100644
index 00000000..0da7fc78
Binary files /dev/null and b/assets/image/3x/bs_mine_clerk.webp differ
diff --git a/assets/image/2x/bs_store_info_logo.webp b/assets/image/3x/bs_mine_code.webp
similarity index 58%
rename from assets/image/2x/bs_store_info_logo.webp
rename to assets/image/3x/bs_mine_code.webp
index b8aae3f9..e3a0ebc8 100644
Binary files a/assets/image/2x/bs_store_info_logo.webp and b/assets/image/3x/bs_mine_code.webp differ
diff --git a/assets/image/3x/bs_secure.webp b/assets/image/3x/bs_secure.webp
index 1f3b4306..70ad4f3f 100644
Binary files a/assets/image/3x/bs_secure.webp and b/assets/image/3x/bs_secure.webp differ
diff --git a/assets/image/3x/bs_shop_logo.webp b/assets/image/3x/bs_shop_logo.webp
index d362c0fa..b8c6a6dc 100644
Binary files a/assets/image/3x/bs_shop_logo.webp and b/assets/image/3x/bs_shop_logo.webp differ
diff --git a/assets/image/3x/bs_store_info_logo.webp b/assets/image/3x/bs_store_info_logo.webp
deleted file mode 100644
index 698b649d..00000000
Binary files a/assets/image/3x/bs_store_info_logo.webp and /dev/null differ
diff --git a/assets/image/3x/bus_code_save.webp b/assets/image/3x/bus_code_save.webp
new file mode 100644
index 00000000..8a97131f
Binary files /dev/null and b/assets/image/3x/bus_code_save.webp differ
diff --git a/assets/image/3x/bus_home_bhy.webp b/assets/image/3x/bus_home_bhy.webp
new file mode 100644
index 00000000..24f8f180
Binary files /dev/null and b/assets/image/3x/bus_home_bhy.webp differ
diff --git a/assets/image/3x/bus_home_cz.webp b/assets/image/3x/bus_home_cz.webp
new file mode 100644
index 00000000..bcef6033
Binary files /dev/null and b/assets/image/3x/bus_home_cz.webp differ
diff --git a/assets/image/3x/bus_home_czjl.webp b/assets/image/3x/bus_home_czjl.webp
new file mode 100644
index 00000000..c56e0e65
Binary files /dev/null and b/assets/image/3x/bus_home_czjl.webp differ
diff --git a/assets/image/3x/bus_home_goods.webp b/assets/image/3x/bus_home_goods.webp
new file mode 100644
index 00000000..45f3cbb4
Binary files /dev/null and b/assets/image/3x/bus_home_goods.webp differ
diff --git a/assets/image/3x/bus_home_goods_ssfx.webp b/assets/image/3x/bus_home_goods_ssfx.webp
new file mode 100644
index 00000000..c5228122
Binary files /dev/null and b/assets/image/3x/bus_home_goods_ssfx.webp differ
diff --git a/assets/image/3x/bus_home_hygl.webp b/assets/image/3x/bus_home_hygl.webp
new file mode 100644
index 00000000..d15a0507
Binary files /dev/null and b/assets/image/3x/bus_home_hygl.webp differ
diff --git a/assets/image/3x/bus_home_hyyetj.webp b/assets/image/3x/bus_home_hyyetj.webp
new file mode 100644
index 00000000..2cdc29ef
Binary files /dev/null and b/assets/image/3x/bus_home_hyyetj.webp differ
diff --git a/assets/image/3x/bus_home_jrls.webp b/assets/image/3x/bus_home_jrls.webp
new file mode 100644
index 00000000..c310bce7
Binary files /dev/null and b/assets/image/3x/bus_home_jrls.webp differ
diff --git a/assets/image/3x/bus_home_rxbd.webp b/assets/image/3x/bus_home_rxbd.webp
new file mode 100644
index 00000000..e6c4c76c
Binary files /dev/null and b/assets/image/3x/bus_home_rxbd.webp differ
diff --git a/assets/image/3x/bus_home_syt.webp b/assets/image/3x/bus_home_syt.webp
new file mode 100644
index 00000000..350c4c16
Binary files /dev/null and b/assets/image/3x/bus_home_syt.webp differ
diff --git a/assets/image/3x/bus_home_syzl.webp b/assets/image/3x/bus_home_syzl.webp
new file mode 100644
index 00000000..b05722d6
Binary files /dev/null and b/assets/image/3x/bus_home_syzl.webp differ
diff --git a/assets/image/3x/bus_home_xfjl.webp b/assets/image/3x/bus_home_xfjl.webp
new file mode 100644
index 00000000..bb92bbc2
Binary files /dev/null and b/assets/image/3x/bus_home_xfjl.webp differ
diff --git a/assets/image/3x/bus_home_xfpm.webp b/assets/image/3x/bus_home_xfpm.webp
new file mode 100644
index 00000000..63eba47d
Binary files /dev/null and b/assets/image/3x/bus_home_xfpm.webp differ
diff --git a/assets/image/3x/bus_home_yytj.webp b/assets/image/3x/bus_home_yytj.webp
new file mode 100644
index 00000000..9f6c1d25
Binary files /dev/null and b/assets/image/3x/bus_home_yytj.webp differ
diff --git a/assets/image/3x/bus_pay_success_logo.png b/assets/image/3x/bus_pay_success_logo.png
new file mode 100644
index 00000000..7419eda0
Binary files /dev/null and b/assets/image/3x/bus_pay_success_logo.png differ
diff --git a/assets/image/bs_mine_clerk.webp b/assets/image/bs_mine_clerk.webp
new file mode 100644
index 00000000..f97819be
Binary files /dev/null and b/assets/image/bs_mine_clerk.webp differ
diff --git a/assets/image/bs_mine_code.webp b/assets/image/bs_mine_code.webp
new file mode 100644
index 00000000..419201ee
Binary files /dev/null and b/assets/image/bs_mine_code.webp differ
diff --git a/assets/image/bs_secure.webp b/assets/image/bs_secure.webp
index 39203e2e..ae342709 100644
Binary files a/assets/image/bs_secure.webp and b/assets/image/bs_secure.webp differ
diff --git a/assets/image/bs_shop_logo.webp b/assets/image/bs_shop_logo.webp
index 912e96cd..5f71ed3e 100644
Binary files a/assets/image/bs_shop_logo.webp and b/assets/image/bs_shop_logo.webp differ
diff --git a/assets/image/bus_code_save.webp b/assets/image/bus_code_save.webp
new file mode 100644
index 00000000..0293de52
Binary files /dev/null and b/assets/image/bus_code_save.webp differ
diff --git a/assets/image/bus_home_bhy.webp b/assets/image/bus_home_bhy.webp
new file mode 100644
index 00000000..765d2034
Binary files /dev/null and b/assets/image/bus_home_bhy.webp differ
diff --git a/assets/image/bus_home_cz.webp b/assets/image/bus_home_cz.webp
new file mode 100644
index 00000000..b13fa089
Binary files /dev/null and b/assets/image/bus_home_cz.webp differ
diff --git a/assets/image/bus_home_czjl.webp b/assets/image/bus_home_czjl.webp
new file mode 100644
index 00000000..be54efc4
Binary files /dev/null and b/assets/image/bus_home_czjl.webp differ
diff --git a/assets/image/bus_home_goods.webp b/assets/image/bus_home_goods.webp
new file mode 100644
index 00000000..42edd3e3
Binary files /dev/null and b/assets/image/bus_home_goods.webp differ
diff --git a/assets/image/bus_home_goods_ssfx.webp b/assets/image/bus_home_goods_ssfx.webp
new file mode 100644
index 00000000..a9392598
Binary files /dev/null and b/assets/image/bus_home_goods_ssfx.webp differ
diff --git a/assets/image/bus_home_hygl.webp b/assets/image/bus_home_hygl.webp
new file mode 100644
index 00000000..502732bf
Binary files /dev/null and b/assets/image/bus_home_hygl.webp differ
diff --git a/assets/image/bus_home_hyyetj.webp b/assets/image/bus_home_hyyetj.webp
new file mode 100644
index 00000000..1dae2931
Binary files /dev/null and b/assets/image/bus_home_hyyetj.webp differ
diff --git a/assets/image/bus_home_jrls.webp b/assets/image/bus_home_jrls.webp
new file mode 100644
index 00000000..e2db4ead
Binary files /dev/null and b/assets/image/bus_home_jrls.webp differ
diff --git a/assets/image/bus_home_rxbd.webp b/assets/image/bus_home_rxbd.webp
new file mode 100644
index 00000000..bad50ca5
Binary files /dev/null and b/assets/image/bus_home_rxbd.webp differ
diff --git a/assets/image/bus_home_syt.webp b/assets/image/bus_home_syt.webp
new file mode 100644
index 00000000..c44dee68
Binary files /dev/null and b/assets/image/bus_home_syt.webp differ
diff --git a/assets/image/bus_home_syzl.webp b/assets/image/bus_home_syzl.webp
new file mode 100644
index 00000000..97bd9820
Binary files /dev/null and b/assets/image/bus_home_syzl.webp differ
diff --git a/assets/image/bus_home_xfjl.webp b/assets/image/bus_home_xfjl.webp
new file mode 100644
index 00000000..316cabee
Binary files /dev/null and b/assets/image/bus_home_xfjl.webp differ
diff --git a/assets/image/bus_home_xfpm.webp b/assets/image/bus_home_xfpm.webp
new file mode 100644
index 00000000..92c7003b
Binary files /dev/null and b/assets/image/bus_home_xfpm.webp differ
diff --git a/assets/image/bus_home_yytj.webp b/assets/image/bus_home_yytj.webp
new file mode 100644
index 00000000..3759b08b
Binary files /dev/null and b/assets/image/bus_home_yytj.webp differ
diff --git a/assets/image/bus_pay_success_logo.png b/assets/image/bus_pay_success_logo.png
new file mode 100644
index 00000000..4cd921d3
Binary files /dev/null and b/assets/image/bus_pay_success_logo.png differ
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index ef4a453a..38b6173c 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -140,6 +140,8 @@
打开相册
NSSpeechRecognitionUsageDescription
是否允许语音识别
+ NSPhotoLibraryAddUsageDescription
+ 请允许App保存图片到相册
UIApplicationSceneManifest
UIApplicationSupportsMultipleScenes
diff --git a/lib/business_system/goods/off_shelf/off_shelf_page.dart b/lib/business_system/goods/off_shelf/off_shelf_page.dart
index 192c34bb..55134bca 100644
--- a/lib/business_system/goods/off_shelf/off_shelf_page.dart
+++ b/lib/business_system/goods/off_shelf/off_shelf_page.dart
@@ -130,6 +130,7 @@ class _OffShelfPage extends State {
checkStatus = false;
SmartDialog.showToast("商品上架成功", alignment: Alignment.center);
} else {
+ EasyLoading.dismiss();
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@@ -155,6 +156,7 @@ class _OffShelfPage extends State {
EasyLoading.dismiss();
SmartDialog.showToast("商品删除成功", alignment: Alignment.center);
} else {
+ EasyLoading.dismiss();
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
diff --git a/lib/business_system/home/cashier/cashier_page.dart b/lib/business_system/home/cashier/cashier_page.dart
new file mode 100644
index 00000000..06c14c27
--- /dev/null
+++ b/lib/business_system/home/cashier/cashier_page.dart
@@ -0,0 +1,60 @@
+import 'package:flutter/material.dart';
+import 'package:huixiang/utils/font_weight.dart';
+import 'package:huixiang/view_widget/my_appbar.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:intl/intl.dart';
+
+class CashierPage extends StatefulWidget {
+ final Map arguments;
+
+ CashierPage({this.arguments});
+
+ @override
+ State createState() {
+ return _CashierPage();
+ }
+}
+
+class _CashierPage extends State {
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: MyAppBar(
+ title: "收银",
+ titleColor: Colors.black,
+ background: Colors.white,
+ leadingColor: Colors.black,
+ brightness: Brightness.dark,
+ ),
+ body: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Container(
+ width: double.infinity,
+ margin: EdgeInsets.only(top:8.h, left: 16.w, right: 16.w),
+ padding: EdgeInsets.only(top:19.h,bottom: 36.h),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ )
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/business_system/home/consumer_ranking_page.dart b/lib/business_system/home/consumer_ranking_page.dart
new file mode 100644
index 00000000..87cca153
--- /dev/null
+++ b/lib/business_system/home/consumer_ranking_page.dart
@@ -0,0 +1,579 @@
+import 'package:dio/dio.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_easyloading/flutter_easyloading.dart';
+import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
+import 'package:huixiang/utils/font_weight.dart';
+import 'package:huixiang/view_widget/my_appbar.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:intl/intl.dart';
+import 'package:pull_to_refresh/pull_to_refresh.dart';
+import 'package:shimmer/shimmer.dart';
+
+import '../../generated/l10n.dart';
+import '../../retrofit/business_api.dart';
+import '../../retrofit/data/balance_consumption_ranking_list.dart';
+import '../../retrofit/data/base_data.dart';
+import '../../utils/business_instance.dart';
+import '../../utils/flutter_utils.dart';
+import '../../view_widget/classic_header.dart';
+import '../../view_widget/my_footer.dart';
+import '../../view_widget/no_data_view.dart';
+
+class ConsumerRankingPage extends StatefulWidget {
+ final Map arguments;
+
+ ConsumerRankingPage({this.arguments});
+
+ @override
+ State createState() {
+ return _ConsumerRankingPage();
+ }
+}
+
+class _ConsumerRankingPage extends State {
+ String titleName;
+ String selectTimeDate = "";
+ String selectTimeDateNum =
+ "${DateFormat("yyyy-MM-dd HH:mm:ss").format(DateTime.now().subtract(Duration(days: 2)))} 至 "
+ "${DateFormat("yyyy-MM-dd HH:mm:ss").format(DateTime.now())}";
+ final TextEditingController editingController = TextEditingController();
+ FocusNode _focusNode = FocusNode();
+ bool isKeyBoardShow = false;
+ final RefreshController refreshController = RefreshController();
+ BusinessApiService businessService;
+ String networkError = "";
+ int networkStatus = 0;
+ List records = [];
+ int _pageNum = 1;
+ String total = "0";
+
+ @override
+ void initState() {
+ super.initState();
+ titleName = widget?.arguments["titleName"] ?? "";
+ _onRefresh();
+ }
+
+ ///离开页面记着销毁和清除
+ @override
+ void dispose() {
+ super.dispose();
+ refreshController.dispose();
+ _focusNode.unfocus();
+ }
+
+ _onRefresh({bool isShowLoad = true}) async {
+ if (isShowLoad)
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai,
+ maskType: EasyLoadingMaskType.black);
+ await queryStoreMoney();
+ EasyLoading.dismiss();
+ if (refreshController.isRefresh) refreshController.refreshCompleted();
+ if (mounted) setState(() {});
+ }
+
+ ///查询会员余额统计/消费排名
+ queryStoreMoney({nickName,isShow = true}) async {
+ try {
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData = await businessService.storeMoney({
+ "startTime": titleName == "消费排名" ? selectTimeDateNum.substring(0,19):"",
+ "endTime": titleName == "消费排名" ? selectTimeDateNum.substring(24,43):"",
+ "nickName": titleName == "消费排名" ? "" : nickName,
+ "type":titleName == "消费排名" ? 1:0,
+ "pageNum": _pageNum,
+ "pageSize": 10,
+ }).catchError((error) {
+ networkError = AppUtils.dioErrorTypeToString(error.type);
+ networkStatus = -1;
+ setState(() {});
+ refreshController.refreshFailed();
+ refreshController.loadFailed();
+ });
+ if (!mounted) return;
+ if (baseData != null && baseData.isSuccess) {
+ records.addAll(baseData?.data?.records ?? []);
+ total = baseData?.data?.total ?? "0";
+ if ((baseData?.data?.records ?? []).isEmpty ||
+ records.length.toString() == baseData.data.pages)
+ refreshController.loadNoData();
+ else
+ refreshController.loadComplete();
+ networkStatus = 1;
+ } else {
+ SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
+ }
+ } finally {
+ if (isShow) setState(() {});
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: MyAppBar(
+ title: titleName,
+ titleColor: Colors.black,
+ background: Colors.white,
+ leadingColor: Colors.black,
+ brightness: Brightness.dark,
+ ),
+ body: networkStatus == -1
+ ? noNetwork()
+ : Container(
+ child: SmartRefresher(
+ controller: refreshController,
+ enablePullDown: true,
+ enablePullUp: records.length == 0 ? false : true,
+ header: MyHeader(
+ color: Color(0xFF30415B),
+ ),
+ footer: CustomFooter(
+ builder: (context, mode) {
+ return MyFooter(mode);
+ },
+ ),
+ onRefresh: () {
+ _pageNum = 1;
+ records.clear();
+ _onRefresh(isShowLoad: false);
+ },
+ onLoading: () {
+ _pageNum++;
+ _onRefresh(isShowLoad: false);
+ },
+ physics: BouncingScrollPhysics(),
+ scrollController: ScrollController(),
+ child: Column(
+ children: [
+ Container(
+ width: double.infinity,
+ padding: EdgeInsets.only(bottom: 16.h),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ ),
+ child: Column(
+ children: [
+ titleName == "消费排名"
+ ? timeSelect()
+ : vipBalanceStatisticsSearch(),
+ titleName == "消费排名"
+ ? Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Expanded(
+ child: Column(
+ children: [
+ Padding(
+ padding: EdgeInsets.only(bottom: 15.h),
+ child: Text(
+ "消费会员数量",
+ style: TextStyle(
+ fontSize: 12.sp,
+ fontWeight: MyFontWeight.regular,
+ color: Color(0xFF0D0D0D),
+ ),
+ ),
+ ),
+ Text(
+ total,
+ style: TextStyle(
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ color: Color(0xFF0D0D0D),
+ ),
+ ),
+ ],
+ )),
+ Expanded(
+ child: Column(
+ children: [
+ Padding(
+ padding: EdgeInsets.only(bottom: 15.h),
+ child: Text(
+ "销售金额",
+ style: TextStyle(
+ fontSize: 12.sp,
+ fontWeight: MyFontWeight.regular,
+ color: Color(0xFF0D0D0D),
+ ),
+ ),
+ ),
+ Text(
+ "12334.00",
+ style: TextStyle(
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ color: Color(0xFF0D0D0D),
+ ),
+ ),
+ ],
+ )),
+ ],
+ )
+ : Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Expanded(
+ child: Column(
+ children: [
+ Padding(
+ padding: EdgeInsets.only(bottom: 15.h),
+ child: Text(
+ "总会员数",
+ style: TextStyle(
+ fontSize: 12.sp,
+ fontWeight: MyFontWeight.regular,
+ color: Color(0xFF0D0D0D),
+ ),
+ ),
+ ),
+ Text(
+ total,
+ style: TextStyle(
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ color: Color(0xFF0D0D0D),
+ ),
+ ),
+ ],
+ )),
+ Expanded(
+ child: Column(
+ children: [
+ Padding(
+ padding: EdgeInsets.only(bottom: 15.h),
+ child: Text(
+ "总余额数",
+ style: TextStyle(
+ fontSize: 12.sp,
+ fontWeight: MyFontWeight.regular,
+ color: Color(0xFF0D0D0D),
+ ),
+ ),
+ ),
+ Text(
+ "12334.00",
+ style: TextStyle(
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ color: Color(0xFF0D0D0D),
+ ),
+ ),
+ ],
+ )),
+ ],
+ )
+ ],
+ ),
+ ),
+ Expanded(child: networkStatus == 0
+ ? Container(
+ margin: EdgeInsets.only(bottom: 35.h,top:6.h),
+ child: ListView.builder(
+ itemCount: 10,
+ physics: BouncingScrollPhysics(),
+ shrinkWrap: true,
+ itemBuilder: (context, position) {
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {},
+ child: consumerRankingItemSm(),
+ );
+ },
+ ))
+ : ((records == null || records.length == 0)
+ ? NoDataView(
+ src: "assets/image/bs_no data_logo.webp",
+ isShowBtn: false,
+ text: "暂无商品分类",
+ fontSize: 16.sp,
+ margin: EdgeInsets.all(20.h),
+ )
+ : Container(
+ margin: EdgeInsets.only(bottom: 35.h,top:6.h),
+ child: ListView.builder(
+ itemCount: records?.length ?? 0,
+ physics: BouncingScrollPhysics(),
+ shrinkWrap: true,
+ itemBuilder: (context, position) {
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {},
+ child: consumerRankingItem(
+ records[position]),
+ );
+ },
+ ),
+ )),)
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ ///时间选择
+ Widget timeSelect() {
+ return Container(
+ color: Colors.white,
+ child: GestureDetector(
+ onTap: () {
+ Navigator.of(context).pushNamed('/router/custom_page',
+ arguments: {"beyondDateRange": "0"}).then((value) {
+ selectTimeDate = value;
+ setState((){});
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0xFFF7F8FA),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ margin:
+ EdgeInsets.only(left: 18.w, right: 18.w, top: 11.h, bottom: 17.h),
+ padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 12.h),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ (selectTimeDate == "" || selectTimeDate == null)
+ ? "${selectTimeDateNum.substring(0,16)} 至 ${selectTimeDateNum.substring(24,40)}"
+ : "${selectTimeDate.replaceAll("年", "-").replaceAll("月", "-").replaceAll("日", "").substring(0,16)} 至"
+ " ${selectTimeDate.replaceAll("年", "-").replaceAll("月", "-").replaceAll("日", "").substring(22,38)} ",
+ style: TextStyle(
+ fontSize: 14.sp,
+ color: Color(0xFF30415B),
+ fontWeight: MyFontWeight.regular),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ /// 搜索框
+ Widget vipBalanceStatisticsSearch() {
+ return Container(
+ color: Colors.white,
+ child: Container(
+ height: 40.h,
+ margin:
+ EdgeInsets.only(left: 18.w, right: 18.w, top: 12.h, bottom: 12.h),
+ decoration: BoxDecoration(
+ color: Color(0xFFF7F8FA),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ child: TextField(
+ focusNode: _focusNode,
+ textInputAction: TextInputAction.search,
+ onEditingComplete: () {
+ FocusScope.of(context).requestFocus(FocusNode());
+ queryStoreMoney(nickName: editingController?.text ?? "");
+ },
+ style: TextStyle(
+ fontSize: 15.sp,
+ fontWeight: MyFontWeight.regular,
+ color: Color(0xFF808080),
+ ),
+ controller: editingController,
+ decoration: InputDecoration(
+ hintText: "会员手机号或姓名",
+ hintStyle: TextStyle(
+ color: Color(0xFF808080),
+ fontSize: 15.sp,
+ fontWeight: MyFontWeight.regular),
+ contentPadding: EdgeInsets.symmetric(
+ vertical: 12.h,
+ ),
+ prefixIcon: Image.asset(
+ "assets/image/bs_goods_search.webp",
+ width: 20,
+ height: 20,
+ ),
+ border: InputBorder.none,
+ ),
+ ),
+ ),
+ );
+ }
+
+ ///消费排行list
+ Widget consumerRankingItem(Records records) {
+ return Container(
+ padding: EdgeInsets.only(top: 12.h, bottom: 12.h, left: 16.w),
+ margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: EdgeInsets.only(bottom: 16.h),
+ child: Text(
+ "${records?.name ?? ""}(${records?.phone})",
+ style: TextStyle(
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ color: Color(0xFF0D0D0D),
+ ),
+ ),
+ ),
+ Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text: "消费:",
+ style: TextStyle(
+ color: Color(0xFF666666),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ ),
+ TextSpan(
+ text: "¥${records?.money ?? ""}",
+ style: TextStyle(
+ color: Color(0xFFFA5151),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.medium,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ Widget consumerRankingItemSm() {
+ return Container(
+ padding: EdgeInsets.only(top: 12.h, bottom: 12.h, left: 16.w),
+ margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(bottom: 16.h),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width: 149.w,
+ height: 20.h,
+ ),
+ ),
+ Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width: 42.w,
+ height: 20.h,
+ ),
+ ), Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width: 60.w,
+ height: 20.h,
+ ),
+ ),
+ ],
+ )
+ ],
+ ),
+ );
+ }
+
+ Widget noNetwork() {
+ return Container(
+ color: Colors.white,
+ width: double.infinity,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ networkError.substring(0, networkError.indexOf(",")),
+ style: TextStyle(
+ fontSize: 14.sp,
+ color: Color(0xFF0D0D0D),
+ fontWeight: MyFontWeight.bold),
+ ),
+ Padding(
+ padding: EdgeInsets.symmetric(vertical: 10.h),
+ child: Text(
+ "请检查网络设置或稍后重试",
+ style: TextStyle(
+ fontSize: 12.sp,
+ color: Color(0xFF7A797F),
+ fontWeight: MyFontWeight.regular),
+ ),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ _onRefresh();
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0xFF30415B),
+ borderRadius: BorderRadius.circular(15),
+ ),
+ padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h),
+ child: Text(
+ "重试",
+ style: TextStyle(
+ fontSize: 14.sp,
+ color: Colors.white,
+ fontWeight: MyFontWeight.regular),
+ )),
+ )
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/business_system/home/vip/add_vip.dart b/lib/business_system/home/vip/add_vip.dart
index aec48522..47339663 100644
--- a/lib/business_system/home/vip/add_vip.dart
+++ b/lib/business_system/home/vip/add_vip.dart
@@ -1,10 +1,18 @@
+import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
+import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
+import '../../../retrofit/data/add_vip_info.dart';
+import '../../../retrofit/data/base_data.dart';
+import '../../../utils/business_instance.dart';
+import '../../../utils/flutter_utils.dart';
+import '../../../view_widget/settlement_tips_dialog.dart';
class AddVip extends StatefulWidget {
final Map arguments;
@@ -23,6 +31,9 @@ class _AddVip extends State {
bool isKeyBoardShow = false;
FocusNode _focusNode = FocusNode();
BusinessApiService businessService;
+ AddVipInfo addVipInfo;
+ String networkError = "";
+ int networkStatus = 0;
@override
void initState() {
@@ -50,6 +61,48 @@ class _AddVip extends State {
super.dispose();
}
+ ///新增会员接口
+ addMember(String mobile,String nickName) async {
+ try {
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai,
+ maskType: EasyLoadingMaskType.black);
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData = await businessService.createMemberSourceByMobile(mobile,nickName).catchError((error) {
+ networkError = AppUtils.dioErrorTypeToString(error.type);
+ networkStatus = -1;
+ setState(() {});});
+ if (baseData != null && baseData.isSuccess) {
+ addVipInfo = baseData.data;
+ Navigator.of(context).pop();
+ SmartDialog.show(
+ widget: SettlementTips(
+ () {},
+ text: "会员新增成功,请前往会员管理查询会员新增情况",
+ color: Color(0xFF30415B),
+ ));
+ networkStatus = 1;
+ }else{
+ SmartDialog.show(
+ widget: SettlementTips(
+ () {},
+ text: baseData.msg,
+ color: Color(0xFF30415B),
+ ));
+ networkStatus = 1;
+ }
+ } finally {
+ EasyLoading.dismiss();
+ setState(() {});
+ }
+ }
+
@override
Widget build(BuildContext context) {
return GestureDetector(
@@ -67,7 +120,7 @@ class _AddVip extends State {
leadingColor: Colors.black,
brightness: Brightness.dark,
),
- body: Container(
+ body:networkStatus == -1?noNetwork():Container(
margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w),
child: Column(
children: [
@@ -194,7 +247,7 @@ class _AddVip extends State {
alignment: Alignment.center);
return;
} else {
- print("新增成功");
+ addMember(vipPhoneController?.text ?? "",vipNameController?.text ?? "");
}
},
child: Container(
@@ -222,4 +275,51 @@ class _AddVip extends State {
),
);
}
+
+ Widget noNetwork() {
+ return Container(
+ width: double.infinity,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ networkError.substring(0, networkError.indexOf(",")),
+ style: TextStyle(
+ fontSize: 14.sp,
+ color: Color(0xFF0D0D0D),
+ fontWeight: MyFontWeight.bold),
+ ),
+ Padding(
+ padding: EdgeInsets.symmetric(vertical: 10.h),
+ child: Text(
+ "请检查网络设置或稍后重试",
+ style: TextStyle(
+ fontSize: 12.sp,
+ color: Color(0xFF7A797F),
+ fontWeight: MyFontWeight.regular),
+ ),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ addMember(vipPhoneController?.text ?? "",vipNameController?.text ?? "");
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0xFF30415B),
+ borderRadius: BorderRadius.circular(15),
+ ),
+ padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h),
+ child: Text(
+ "重试",
+ style: TextStyle(
+ fontSize: 14.sp,
+ color: Colors.white,
+ fontWeight: MyFontWeight.regular),
+ )),
+ )
+ ],
+ ),
+ );
+ }
}
diff --git a/lib/business_system/home/vip/bus_vip_list.dart b/lib/business_system/home/vip/bus_vip_list.dart
index 649999ca..4552f0c5 100644
--- a/lib/business_system/home/vip/bus_vip_list.dart
+++ b/lib/business_system/home/vip/bus_vip_list.dart
@@ -196,7 +196,7 @@ class _BusVipList extends State {
color: Color(0xFF30415B),
borderRadius: BorderRadius.circular(4),
),
- padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 5..h),
+ padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 5.h),
margin: EdgeInsets.only(right: 8.w),
child:Text(
"会员充值",
diff --git a/lib/business_system/home/vip/pay_success_page.dart b/lib/business_system/home/vip/pay_success_page.dart
new file mode 100644
index 00000000..5dbbf9d6
--- /dev/null
+++ b/lib/business_system/home/vip/pay_success_page.dart
@@ -0,0 +1,180 @@
+import 'package:flutter/material.dart';
+import 'package:huixiang/utils/font_weight.dart';
+import 'package:huixiang/view_widget/my_appbar.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:intl/intl.dart';
+
+class PaySuccessPage extends StatefulWidget {
+ final Map arguments;
+
+ PaySuccessPage({this.arguments});
+
+ @override
+ State createState() {
+ return _PaySuccessPage();
+ }
+}
+
+class _PaySuccessPage extends State {
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: MyAppBar(
+ title: "收银成功",
+ titleColor: Colors.black,
+ background: Colors.white,
+ leadingColor: Colors.black,
+ brightness: Brightness.dark,
+ ),
+ body: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Container(
+ width: double.infinity,
+ margin: EdgeInsets.only(top:8.h, left: 16.w, right: 16.w),
+ padding: EdgeInsets.only(top:19.h,bottom: 36.h),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Column(
+ children: [
+ Image.asset(
+ "assets/image/bus_pay_success_logo.png",
+ width: 76.h,
+ height: 76.h,
+ ),
+ Padding(padding: EdgeInsets.only(top:16.h,),
+ child:Text(
+ "收银成功",
+ style: TextStyle(
+ color: Color(0xFF0D0D0D),
+ fontSize: 18.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )),
+ Container(
+ width: double.infinity,
+ margin: EdgeInsets.only(left:17.w,right: 16.w,top:11.h,bottom:17.h),
+ child: Flex(
+ children: List.generate(70, (_) {
+ return SizedBox(
+ width: 2.w,
+ height: 1.h,
+ child: DecoratedBox(
+ decoration:
+ BoxDecoration(color: Color(0xFFEBECEF)),
+ ),
+ );
+ }),
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ direction: Axis.horizontal,
+ ),
+ ),
+ Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w,bottom: 20.h),
+ child:Row(
+ children: [
+ Expanded(child:Text(
+ "订单编号",
+ style: TextStyle(
+ color: Color(0xFF0D0D0D),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )),
+ Text(
+ widget?.arguments["rechargeId"] ?? "",
+ style: TextStyle(
+ color: Color(0xFF0D0D0D),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )
+ ],
+ )),
+ Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w,bottom: 20.h),
+ child:Row(
+ children: [
+ Expanded(child:Text(
+ "支付金额",
+ style: TextStyle(
+ color: Color(0xFF0D0D0D),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )),
+ Text(
+ "¥${widget?.arguments["rechargeMoney"] ?? ""}",
+ style: TextStyle(
+ color: Color(0xFF0D0D0D),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )
+ ],
+ )),
+ Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w,bottom: 20.h),
+ child:Row(
+ children: [
+ Expanded(child:Text(
+ "支付时间",
+ style: TextStyle(
+ color: Color(0xFF0D0D0D),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )),
+ Text(
+ DateFormat("yyyy-MM-dd HH:mm:ss").format(DateTime.now()),
+ style: TextStyle(
+ color: Color(0xFF0D0D0D),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )
+ ],
+ )),
+ Padding(padding:EdgeInsets.only(left: 24.w,right: 24.w),
+ child:Row(
+ children: [
+ Expanded(child:Text(
+ "支付方式",
+ style: TextStyle(
+ color: Color(0xFF0D0D0D),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )),
+ Text(
+ widget.arguments["payIndex"] == 1 ? "现金":(widget.arguments["payIndex"] == 2?"微信支付":"支付宝支付"),
+ style: TextStyle(
+ color: Color(0xFF0D0D0D),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )
+ ],
+ )),
+ ],
+ ),
+ )
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/business_system/home/vip/vip_recharge_page.dart b/lib/business_system/home/vip/vip_recharge_page.dart
index 31735b50..9ecdb0f0 100644
--- a/lib/business_system/home/vip/vip_recharge_page.dart
+++ b/lib/business_system/home/vip/vip_recharge_page.dart
@@ -1,13 +1,26 @@
+import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
+import 'package:shimmer/shimmer.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
+import '../../../retrofit/data/base_data.dart';
+import '../../../retrofit/data/bus_recharge_list.dart';
+import '../../../retrofit/data/phone_query_member_info.dart';
+import '../../../utils/business_instance.dart';
+import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
+import '../../../view_widget/border_text.dart';
import '../../../view_widget/classic_header.dart';
import '../../../view_widget/my_footer.dart';
+import '../../../view_widget/no_data_view.dart';
+import '../../../view_widget/round_button.dart';
+import '../../../view_widget/settlement_tips_dialog.dart';
class VipRechargePage extends StatefulWidget {
final Map arguments;
@@ -23,11 +36,17 @@ class VipRechargePage extends StatefulWidget {
class _VipRechargePage extends State {
BusinessApiService businessService;
final TextEditingController vipPhoneController = TextEditingController();
- final RefreshController refreshController = RefreshController();
+ final RefreshController _refreshController = RefreshController();
bool isKeyBoardShow = false;
FocusNode _focusNode = FocusNode();
int selectIndex = 0;
- int payIndex = 0;
+ int payIndex = 1;
+ String networkError = "";
+ int networkStatus = 0;
+ List records = [];
+ PhoneQueryMemberInfo phoneQueryMemberInfo;
+ String rechargeId;
+ List manualQueryInfo;
@override
void initState() {
@@ -46,6 +65,7 @@ class _VipRechargePage extends State {
}
});
});
+ _onRefresh();
}
///离开页面记着销毁和清除
@@ -55,6 +75,185 @@ class _VipRechargePage extends State {
super.dispose();
}
+ _onRefresh({bool isShowLoad = true}) async {
+ if (isShowLoad)
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai,
+ maskType: EasyLoadingMaskType.black);
+ if (vipPhoneController?.text != "")
+ await queryMemberPhoneInfo(vipPhoneController?.text ?? "", isShow: false);
+ else
+ await queryRechargeList("", isShow: false);
+ EasyLoading.dismiss();
+ if (!mounted) return;
+ if (_refreshController.isRefresh) _refreshController.refreshCompleted();
+ setState(() {});
+ }
+
+ ///充值列表
+ queryRechargeList(mid, {isShow = true}) async {
+ try {
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData =
+ await businessService.getRechargePreferential({
+ "current": 1,
+ "size": 999,
+ "model": {
+ "rechargeType": "",
+ "tenantCode": BusinessInstance.instance.businessTenant,
+ "mid": mid
+ }
+ }).catchError((error) {
+ networkError = AppUtils.dioErrorTypeToString(error.type);
+ networkStatus = -1;
+ setState(() {});
+ _refreshController.refreshFailed();
+ _refreshController.loadFailed();
+ });
+ if (!mounted) return;
+ if (baseData != null && baseData.isSuccess) {
+ records.clear();
+ records.addAll(baseData?.data?.records ?? []);
+ networkStatus = 1;
+ } else {
+ SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
+ }
+ } finally {
+ if (isShow) setState(() {});
+ }
+ }
+
+ ///根据手机号搜索用户信息
+ queryMemberPhoneInfo(phoneNum, {isShow = true}) async {
+ try {
+ if (isShow)
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai,
+ maskType: EasyLoadingMaskType.black);
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData = await businessService
+ .queryMemberInfo(
+ {"phoneNum": phoneNum, "isNewUser": false}).catchError((error) {
+ networkError = AppUtils.dioErrorTypeToString(error.type);
+ networkStatus = -1;
+ setState(() {});
+ _refreshController.refreshFailed();
+ _refreshController.loadFailed();
+ });
+ if (!mounted) return;
+ if (baseData != null && baseData.isSuccess) {
+ phoneQueryMemberInfo = baseData.data;
+ queryRechargeList(phoneQueryMemberInfo?.mid ?? "");
+ networkStatus = 1;
+ } else {
+ SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
+ }
+ } finally {
+ if (isShow) EasyLoading.dismiss();
+ }
+ }
+
+ ///充值方式支付
+ payMemberType(
+ authCode, memberSourceId, rechargePreferentialId, source) async {
+ try {
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai,
+ maskType: EasyLoadingMaskType.black);
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData = await businessService.posMemberRecharge({
+ "authCode": authCode,
+ "memberSourceId": memberSourceId,
+ "rechargePreferentialId": rechargePreferentialId,
+ "source": source
+ }).catchError((error) {
+ networkError = AppUtils.dioErrorTypeToString(error.type);
+ networkStatus = -1;
+ setState(() {});
+ _refreshController.refreshFailed();
+ _refreshController.loadFailed();
+ });
+ if (!mounted) return;
+ if (baseData != null && baseData.isSuccess) {
+ rechargeId = baseData.data;
+ Navigator.of(context)
+ .popAndPushNamed('/router/pay_success_page', arguments: {
+ "rechargeId": baseData.data,
+ "rechargeMoney": records[selectIndex].rechargeMoney,
+ "payIndex": payIndex,
+ });
+ networkStatus = 1;
+ setState(() {});
+ } else {
+ SmartDialog.show(
+ widget: SettlementTips(
+ () {},
+ text: baseData.msg,
+ color: Color(0xFF30415B),
+ ));
+ }
+ } finally {
+ EasyLoading.dismiss();
+ }
+ }
+
+ ///手动查询充值订单状态
+ manualQueryRechargeOrder(memberRechargeId) async {
+ try {
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai,
+ maskType: EasyLoadingMaskType.black);
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData = await businessService.manualQuery({
+ "phone": phoneQueryMemberInfo?.phoneNum ?? "",
+ "memberRechargeId": memberRechargeId,
+ }).catchError((error) {});
+ if (baseData != null && baseData.isSuccess) {
+ Navigator.of(context).pop();
+ Navigator.of(context)
+ .popAndPushNamed('/router/pay_success_page', arguments: {
+ "rechargeId": baseData.data,
+ "rechargeMoney": records[selectIndex].rechargeMoney,
+ "payIndex": payIndex,
+ });
+ } else {
+ if (baseData.msg != "需要用户输入支付密码") Navigator.of(context).pop();
+ SmartDialog.show(
+ widget: SettlementTips(
+ () {},
+ text: baseData.msg,
+ color: Color(0xFF30415B),
+ ));
+ }
+ } finally {
+ EasyLoading.dismiss();
+ }
+ }
+
@override
Widget build(BuildContext context) {
return GestureDetector(
@@ -71,405 +270,841 @@ class _VipRechargePage extends State {
leadingColor: Colors.black,
brightness: Brightness.dark,
),
- body:SmartRefresher(
+ body: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(
- color: Color(0xFF30415B),),
+ color: Color(0xFF30415B),
+ ),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
- controller: refreshController,
- // onRefresh: _onRefresh,
+ controller: _refreshController,
+ onRefresh: (){
+ _onRefresh(isShowLoad: false);
+ },
physics: BouncingScrollPhysics(),
- child: SingleChildScrollView(
+ child: networkStatus == -1? noNetwork() : SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- decoration: BoxDecoration(
- color: Colors.white,
- boxShadow: [
- BoxShadow(
- color: Color(0x0F06152E),
- offset: Offset(0, 2),
- blurRadius: 4,
- spreadRadius: 0,
- )
- ],
- borderRadius: BorderRadius.circular(8),
- ),
- padding: EdgeInsets.symmetric(horizontal: 16.w),
- margin: EdgeInsets.only(bottom: 16.h,right: 16.w,left: 16.w,top: 8.h),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Expanded(
- child: Text(
- "会员",
- style: TextStyle(
- color: Color(0xFF1A1A1A),
- fontSize: 14.sp,
- fontWeight: FontWeight.w500,
+ child:networkStatus == 0 ?vipRechargeSm():Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ ///会员搜索框
+ Container(
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ padding: EdgeInsets.symmetric(horizontal: 16.w),
+ margin: EdgeInsets.only(
+ bottom: 16.h, right: 16.w, left: 16.w, top: 8.h),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Expanded(
+ child: Text(
+ "会员",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ),
+ Expanded(
+ child: TextField(
+ controller: vipPhoneController,
+ textInputAction: TextInputAction.search,
+ onEditingComplete: () {
+ FocusScope.of(context)
+ .requestFocus(FocusNode());
+ queryMemberPhoneInfo(
+ vipPhoneController.text ?? "");
+ },
+ decoration: InputDecoration(
+ hintText: "请输入会员手机号",
+ hintTextDirection: TextDirection.rtl,
+ hintStyle: TextStyle(
+ color: Color(0xFF808080),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular),
+ border: InputBorder.none,
+ contentPadding: EdgeInsets.only(left: 16.w),
+ ),
+ textAlign: TextAlign.right,
+ style: TextStyle(
+ color: Color(0xFF808080),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular),
+ ),
+ ),
+ ],
+ )),
+
+ ///会员信息
+ if (phoneQueryMemberInfo != null)
+ Container(
+ width: double.infinity,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
),
+ padding: EdgeInsets.only(
+ top: 16.h, bottom: 16.h, left: 16.w),
+ margin: EdgeInsets.only(
+ bottom: 16.h, right: 16.w, left: 16.w),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: EdgeInsets.only(bottom: 16.h),
+ child: Text(
+ "用户名称: ${phoneQueryMemberInfo?.nickName ?? ""}",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ )),
+ Padding(
+ padding: EdgeInsets.only(bottom: 16.h),
+ child: Text(
+ "手机号: ${phoneQueryMemberInfo?.phoneNum ?? ""}",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ )),
+ Text(
+ "会员余额: ¥${phoneQueryMemberInfo?.balance ?? ""}",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ ),
+ ],
+ )),
+
+ ///充值列表
+ rechargeList(),
+
+ ///选择充值的套餐
+ if (networkStatus == 1)
+ Container(
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ padding: EdgeInsets.all(16),
+ margin: EdgeInsets.only(
+ bottom: 24.h,
+ right: 16.w,
+ left: 16.w,
+ ),
+ child: Column(
+ children: [
+ Row(
+ children: [
+ Expanded(
+ child: Text(
+ "本次充值(元)",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ),
+ Text(
+ AppUtils.calculateDouble((double.tryParse(
+ records[selectIndex]
+ ?.rechargeMoney) ??
+ 0)),
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ],
+ ),
+ Container(
+ width: double.infinity,
+ height: 1.h,
+ color: Color(0xFFEBECEF),
+ margin: EdgeInsets.symmetric(vertical: 16.h),
+ ),
+ Row(
+ children: [
+ Expanded(
+ child: Text(
+ "充后余额(元)",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ),
+ Text(
+ "${AppUtils.calculateDouble((double.tryParse(records[selectIndex]?.rechargeMoney) ?? 0) + (double.tryParse(records[selectIndex]?.giftdMoney) ?? 0))}",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ],
+ ),
+ ],
),
),
- Expanded(
- child: TextField(
- controller: vipPhoneController,
- decoration: InputDecoration(
- hintText: "请输入会员手机号",
- hintTextDirection: TextDirection.rtl,
- hintStyle: TextStyle(
- color: Color(0xFF808080),
- fontSize: 14.sp,
- fontWeight: MyFontWeight.regular),
- border: InputBorder.none,
- contentPadding: EdgeInsets.only(left: 16.w),
- ),
- textAlign: TextAlign.right,
+
+ ///充值方式
+ Padding(
+ padding: EdgeInsets.only(left: 16.w, bottom: 16.h),
+ child: Text(
+ "充值方式",
style: TextStyle(
- color: Color(0xFF808080),
- fontSize: 14.sp,
- fontWeight: MyFontWeight.regular),
- ),
+ color: Colors.black,
+ fontSize: 15.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ )),
+ Padding(
+ padding: EdgeInsets.only(left: 16.w, right: 10.w),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Expanded(
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ setState(() {
+ payIndex = 1;
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(8),
+ border: Border.all(
+ color: payIndex == 1
+ ? Color(0xFF30415B)
+ : Color(0x29C5C5C5),
+ width: 2,
+ ),
+ color: payIndex == 1
+ ? Color(0XFFEBF3FF)
+ : Color(0xFFF9FAF8)),
+ padding: EdgeInsets.only(
+ top: 21.h,
+ bottom: 15.h,
+ ),
+ margin: EdgeInsets.only(right: 6.w),
+ child: Column(
+ children: [
+ Image.asset(
+ "assets/image/bus_vip_xj.webp",
+ width: 45.w,
+ height: 36.h,
+ ),
+ Padding(
+ padding: EdgeInsets.only(top: 15.h),
+ child: Text(
+ "现金支付",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ ))
+ ],
+ ),
+ ),
+ )),
+ Expanded(
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ setState(() {
+ payIndex = 3;
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(8),
+ border: Border.all(
+ color: payIndex == 3
+ ? Color(0xFF30415B)
+ : Color(0x29C5C5C5),
+ width: 2,
+ ),
+ color: payIndex == 3
+ ? Color(0XFFEBF3FF)
+ : Color(0xFFF9FAF8)),
+ padding: EdgeInsets.only(
+ top: 21.h,
+ bottom: 15.h,
+ ),
+ margin: EdgeInsets.only(right: 6.w, left: 6.w),
+ child: Column(
+ children: [
+ Image.asset(
+ "assets/image/bus_vip_alipay.webp",
+ width: 36.h,
+ height: 36.h,
+ ),
+ Padding(
+ padding: EdgeInsets.only(top: 15.h),
+ child: Text(
+ "支付宝支付",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ ))
+ ],
+ ),
+ ),
+ )),
+ Expanded(
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ setState(() {
+ payIndex = 2;
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(8),
+ border: Border.all(
+ color: payIndex == 2
+ ? Color(0xFF30415B)
+ : Color(0x29C5C5C5),
+ width: 2,
+ ),
+ color: payIndex == 2
+ ? Color(0XFFEBF3FF)
+ : Color(0xFFF9FAF8)),
+ padding: EdgeInsets.only(
+ top: 21.h,
+ bottom: 15.h,
+ ),
+ margin: EdgeInsets.only(right: 6.w, left: 6.w),
+ child: Column(
+ children: [
+ Image.asset(
+ "assets/image/bus_vip_wx.webp",
+ width: 36.h,
+ height: 36.h,
+ ),
+ Padding(
+ padding: EdgeInsets.only(top: 15.h),
+ child: Text(
+ "微信支付",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ ))
+ ],
+ ),
+ ),
+ )),
+ ],
),
- ],
- )),
- rechargeList(),
- Container(
- decoration: BoxDecoration(
- color: Colors.white,
- boxShadow: [
- BoxShadow(
- color: Color(0x0F06152E),
- offset: Offset(0, 2),
- blurRadius: 4,
- spreadRadius: 0,
- )
+ ),
+
+ ///确认充值
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ if (widget.arguments["storeId"] == "0") {
+ SmartDialog.show(
+ widget: SettlementTips(
+ () {},
+ text: "请选择门店进行充值",
+ color: Color(0xFF30415B),
+ ));
+ } else {
+ if (vipPhoneController.text == "") {
+ SmartDialog.show(
+ widget: SettlementTips(
+ () {},
+ text: "请输入会员手机号进行充值",
+ color: Color(0xFF30415B),
+ ));
+ } else {
+ showRechargePayDialog();
+ }
+ }
+ },
+ child: Container(
+ color: Colors.white,
+ width: double.infinity,
+ margin: EdgeInsets.only(top: 132.h),
+ padding: EdgeInsets.only(
+ top: 10.h,
+ left: 16.w,
+ right: 16.w,
+ bottom: 34.h),
+ child: Container(
+ alignment: Alignment.center,
+ padding: EdgeInsets.symmetric(vertical: 16.h),
+ decoration: BoxDecoration(
+ color: Color(0xFF30415B),
+ borderRadius: BorderRadius.circular(27),
+ ),
+ child: Text(
+ "确认充值",
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 16.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ ))
],
- borderRadius: BorderRadius.circular(8),
),
- padding: EdgeInsets.all(16),
- margin: EdgeInsets.only(bottom:24.h,right: 16.w,left: 16.w,),
- child: Column(
- children: [
- Row(
+ )),
+ ),
+ ),
+ );
+ }
+
+ ///确认充值支付提示弹窗
+ showRechargePayDialog() {
+ showDialog(
+ context: context,
+ builder: (context) {
+ return AlertDialog(
+ contentPadding: EdgeInsets.all(0),
+ content: Container(
+ width: MediaQuery.of(context).size.width - 80,
+ padding: EdgeInsets.only(
+ top: 24.h,
+ ),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Padding(
+ padding:
+ EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w),
+ child: Text.rich(
+ TextSpan(
children: [
- Expanded(
- child: Text(
- "本次充值(元)",
- style: TextStyle(
- color: Color(0xFF1A1A1A),
- fontSize: 14.sp,
- fontWeight: FontWeight.w500,
- ),
- ),
- ),
- Text(
- "322",
+ TextSpan(
+ text: "*",
style: TextStyle(
- color: Color(0xFF1A1A1A),
+ color: Color(0xFFFA5151),
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
),
- ],
- ),
- Container(
- width:double.infinity,
- height: 1.h,
- color: Color(0xFFEBECEF),
- margin: EdgeInsets.symmetric(vertical: 16.h),
- ),
- Row(
- children: [
- Expanded(
- child: Text(
- "充后余额(元)",
- style: TextStyle(
- color: Color(0xFF1A1A1A),
- fontSize: 14.sp,
- fontWeight: FontWeight.w500,
- ),
+ TextSpan(
+ text: "请确认充账户及充值套餐后再点击确认",
+ style: TextStyle(
+ color: Color(0xFFFA5151),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
),
),
- Text(
- "344",
+ TextSpan(
+ text: "*",
style: TextStyle(
- color: Color(0xFF1A1A1A),
+ color: Color(0xFFFA5151),
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
),
],
),
+ ),
+ ),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: EdgeInsets.only(
+ bottom: 18.h, left: 14.w, right: 14.w),
+ child: Text(
+ "充值账户: ${phoneQueryMemberInfo?.phoneNum ?? ""}",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ ),
+ ),
+ Padding(
+ padding: EdgeInsets.only(
+ bottom: 18.h, left: 14.w, right: 14.w),
+ child: Text(
+ "充值套餐: 充${records[selectIndex]?.rechargeMoney ?? ""}送${records[selectIndex]?.giftdMoney ?? ""}",
+ style: TextStyle(
+ color: Color(0xFF1A1A1A),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ ),
+ ),
],
),
- ),
- Padding(padding:EdgeInsets.only(left: 16.w,bottom: 16.h),
- child:
- Text(
- "充值方式",
- style: TextStyle(
- color: Colors.black,
- fontSize: 15.sp,
- fontWeight: MyFontWeight.bold,
+ Container(
+ width: double.infinity,
+ height: 1.h,
+ color: Color(0xFFD8D8D8),
),
- )),
- Padding(padding:EdgeInsets.only(left: 16.w,right: 10.w),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Expanded(child:GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: (){
- setState((){
- payIndex = 0;
- });
- },
- child:Container(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(8),
- border: Border.all(
- color:
- payIndex == 0 ? Color(0xFF30415B) : Color(0x29C5C5C5),
- width:2,
- ),
- color:
- payIndex == 0 ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)),
- padding: EdgeInsets.only(top: 21.h,bottom: 15.h,),
- margin: EdgeInsets.only(right: 6.w),
- child: Column(
- children: [
- Image.asset(
- "assets/image/bus_vip_xj.webp",
- width: 45.w,
- height:36.h,
- ),
- Padding(padding:EdgeInsets.only(top: 15.h),
- child: Text(
- "现金支付",
- style: TextStyle(
- color: Color(0xFF1A1A1A),
- fontSize: 14.sp,
- fontWeight: MyFontWeight.regular,
- ),
- ))
- ],
- ),),
- )),
- Expanded(child:GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: (){
- setState((){
- payIndex = 1;
- });
- },
- child:Container(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(8),
- border: Border.all(
- color:
- payIndex == 1 ? Color(0xFF30415B) : Color(0x29C5C5C5),
- width:2,
- ),
- color:
- payIndex == 1 ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)),
- padding: EdgeInsets.only(top: 21.h,bottom: 15.h,),
- margin: EdgeInsets.only(right: 6.w,left: 6.w),
- child: Column(
- children: [
- Image.asset(
- "assets/image/bus_vip_alipay.webp",
- width: 36.h,
- height:36.h,
- ),
- Padding(padding:EdgeInsets.only(top: 15.h),
- child: Text(
- "支付宝支付",
- style: TextStyle(
- color: Color(0xFF1A1A1A),
- fontSize: 14.sp,
- fontWeight: MyFontWeight.regular,
- ),
- ))
- ],
- ),),
- )),
- Expanded(child:GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: (){
- setState((){
- payIndex = 2;
- });
- },
- child:Container(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(8),
- border: Border.all(
- color:
- payIndex == 2 ? Color(0xFF30415B) : Color(0x29C5C5C5),
- width:2,
+ Container(
+ height: 55.h,
+ child: Row(
+ children: [
+ Expanded(
+ child: InkWell(
+ child: BorderText(
+ text: S.of(context).quxiao,
+ textColor: Colors.black,
+ fontSize: 16.sp,
+ fontWeight: FontWeight.bold,
+ padding: EdgeInsets.all(14),
),
- color:
- payIndex == 2 ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)),
- padding: EdgeInsets.only(top: 21.h,bottom: 15.h,),
- margin: EdgeInsets.only(right: 6.w,left: 6.w),
- child: Column(
- children: [
- Image.asset(
- "assets/image/bus_vip_wx.webp",
- width: 36.h,
- height:36.h,
+ onTap: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ flex: 1,
+ ),
+ Container(
+ width: 1.w,
+ height: double.infinity,
+ color: Color(0xFFD8D8D8),
+ ),
+ Expanded(
+ child: InkWell(
+ child: RoundButton(
+ text: S.of(context).queren,
+ textColor: Color(0xFF30415B),
+ radius: 4,
+ padding: EdgeInsets.all(14),
+ fontSize: 16.sp,
+ fontWeight: FontWeight.bold,
),
- Padding(padding:EdgeInsets.only(top: 15.h),
- child: Text(
- "微信支付",
- style: TextStyle(
- color: Color(0xFF1A1A1A),
- fontSize: 14.sp,
- fontWeight: MyFontWeight.regular,
- ),
- ))
- ],
- ),),
- )),
- ],
- ),),
- Align(
- alignment: Alignment.bottomCenter,
+ onTap: () {
+ Navigator.of(context).pop();
+ if (payIndex == 1) {
+ payMemberType(
+ null,
+ phoneQueryMemberInfo?.sid ?? "",
+ records[selectIndex]?.id ?? "",
+ payIndex);
+ } else {
+ Navigator.of(context).pushNamed(
+ '/router/scan_code_page',
+ arguments: {
+ "storeId": widget.arguments["storeId"],
+ "scanCodeType": "支付",
+ "rechargePreferentialId":
+ records[selectIndex]?.id ?? "",
+ "memberSourceId":
+ phoneQueryMemberInfo?.sid ?? "",
+ "source": payIndex.toString(),
+ "rechargeMoney":
+ records[selectIndex]?.rechargeMoney ??
+ ""
+ }).then((value) {
+ if (value == 1) {
+ queryMemberPhoneInfo(
+ vipPhoneController?.text ?? "",
+ isShow: false);
+ } else {
+ manualQueryInfo = value;
+ showPayQueryDialog(
+ manualQueryInfo[0], manualQueryInfo[1]);
+ }
+ });
+ }
+ },
+ ),
+ flex: 1,
+ ),
+ ],
+ ),
+ )
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+
+ ///手动查询弹窗
+ showPayQueryDialog(String queryDialog, String rechargeOrderId) {
+ showDialog(
+ context: context,
+ barrierDismissible: false,
+ builder: (context) {
+ return AlertDialog(
+ contentPadding: EdgeInsets.all(0),
+ content: Container(
+ width: MediaQuery.of(context).size.width - 80,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ Navigator.of(context).pop();
+ },
child: Container(
- color: Colors.white,
- width: double.infinity,
- margin: EdgeInsets.only(top: 132.h),
- padding: EdgeInsets.only(top: 10.h,left: 16.w,right: 16.w,bottom:34.h),
- child: Container(
- alignment: Alignment.center,
- padding: EdgeInsets.symmetric(vertical:16.h),
- decoration: BoxDecoration(
- color: Color(0xFF30415B),
- borderRadius: BorderRadius.circular(27),
+ alignment: Alignment.topRight,
+ padding:
+ EdgeInsets.symmetric(horizontal: 5.w, vertical: 10.h),
+ child: Image.asset(
+ "assets/image/cancel.webp",
+ width: 24.h,
+ height: 24.h,
+ )),
),
+ Padding(
+ padding:
+ EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w),
child: Text(
- "确认充值",
+ queryDialog,
style: TextStyle(
- color: Colors.white,
+ color: Colors.black,
fontSize: 16.sp,
fontWeight: MyFontWeight.bold,
),
),
),
- ))
- ],
+ Padding(
+ padding:
+ EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w),
+ child: Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text: "*",
+ style: TextStyle(
+ color: Color(0xFFFA5151),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ TextSpan(
+ text: "请确认用户支付成功后再点击手动查询",
+ style: TextStyle(
+ color: Color(0xFFFA5151),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ ),
+ TextSpan(
+ text: "*",
+ style: TextStyle(
+ color: Color(0xFFFA5151),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ TextSpan(
+ text: "\n*",
+ style: TextStyle(
+ color: Colors.blue,
+ fontSize: 14.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ TextSpan(
+ text: "订单查询成功后可关闭当前弹窗",
+ style: TextStyle(
+ color: Colors.blue,
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ ),
+ TextSpan(
+ text: "*",
+ style: TextStyle(
+ color: Colors.blue,
+ fontSize: 14.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ manualQueryRechargeOrder(rechargeOrderId);
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0xFF30415B),
+ borderRadius: BorderRadius.circular(4),
+ ),
+ padding: EdgeInsets.symmetric(
+ horizontal: 26.w, vertical: 10.h),
+ margin: EdgeInsets.only(right: 8.w, bottom: 20.h),
+ child: Text(
+ "手动查询",
+ style: TextStyle(
+ fontSize: 12.sp,
+ fontWeight: MyFontWeight.regular,
+ color: Colors.white,
+ ),
+ ),
+ )),
+ ],
+ ),
),
- )
- ),
- ),
- ),
+ );
+ },
);
}
Widget rechargeList() {
return Container(
- margin: EdgeInsets.only(left:16.w,right: 16.w,bottom:16.h),
- child: ListView.builder(
- padding: EdgeInsets.zero,
- itemCount: 3,
- scrollDirection: Axis.vertical,
- shrinkWrap: true,
- physics: BouncingScrollPhysics(),
- itemBuilder: (context, position) {
- return GestureDetector(
- onTap: () {
- setState(() {
- selectIndex = position;
- });
- },
- child: rechargeItem(position));
- },
- ),
- );
- // : NoDataView(
- // src: "assets/image/xiao_fei.webp",
- // isShowBtn: false,
- // text: "暂无充值套餐~",
- // fontSize: 16.sp,
- // margin: EdgeInsets.only(top: 90.h, left: 60.w, right: 60.w),
- // );
+ margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.h),
+ child: (records != null && (records?.length ?? 0) > 0)
+ ? ListView.builder(
+ padding: EdgeInsets.zero,
+ itemCount: records.length ?? 0,
+ scrollDirection: Axis.vertical,
+ shrinkWrap: true,
+ physics: BouncingScrollPhysics(),
+ itemBuilder: (context, position) {
+ return GestureDetector(
+ onTap: () {
+ setState(() {
+ selectIndex = position;
+ });
+ },
+ child: rechargeItem(records[position], position));
+ },
+ )
+ : NoDataView(
+ src: "assets/image/xiao_fei.webp",
+ isShowBtn: false,
+ text: "暂无充值套餐~",
+ fontSize: 16.sp,
+ margin: EdgeInsets.only(top: 90.h, left: 60.w, right: 60.w),
+ ));
}
- Widget rechargeItem(index) {
- return Container(
- width: double.infinity,
- height: 69.h,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(8),
- border: Border.all(
- color:
- selectIndex == index ? Color(0xFF30415B) : Color(0x29C5C5C5),
- width:2,
- ),
- color:
- selectIndex == index ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)),
- margin: EdgeInsets.only(bottom: 14.w),
- padding: EdgeInsets.only(left: 16),
- child: Flex(
- direction: Axis.horizontal,
- children: [
- Expanded(
- flex: 1,
- child: Container(
- child: Text.rich(
- TextSpan(children: [
- TextSpan(
- text: "储值 ",
- style: TextStyle(
- fontSize: 12.sp,
- color: selectIndex == index
- ? Color(0xFF4D4D4D)
- : Color(0xFF868686),
- fontWeight: MyFontWeight.regular),
- ),
- TextSpan(
- text:
- "100",
- style: TextStyle(
- fontSize: 18.sp,
- fontFamily: 'JDZhengHT',
- color: selectIndex == index
- ? Color(0xFF353535)
- : Color(0xFF302F3A),
- fontWeight: MyFontWeight.medium),
- ),TextSpan(
- text:
- "元",
- style: TextStyle(
- fontSize: 18.sp,
- fontFamily: 'JDZhengHT',
- color: selectIndex == index
- ? Color(0xFF353535)
- : Color(0xFF302F3A),
- fontWeight: MyFontWeight.semi_bold),
- ),
- ]),
- ),
- )),
- Container(
- width: 1.w,
- height: 37.h,
+ Widget rechargeItem(Records records, index) {
+ return Stack(
+ alignment: Alignment.topRight,
+ children: [
+ Container(
+ width: double.infinity,
+ height: 69.h,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(8),
+ border: Border.all(
+ color: selectIndex == index
+ ? Color(0xFF30415B)
+ : Color(0x29C5C5C5),
+ width: 2,
+ ),
color:
- selectIndex == index ? Color(0xFF32A060) : Color(0xFF979797),
- margin: EdgeInsets.only(right: 16.w, left: 12),
- ),
- Expanded(
- flex: 2,
- child:
- Text.rich(
+ selectIndex == index ? Color(0XFFEBF3FF) : Color(0xFFF9FAF8)),
+ margin: EdgeInsets.only(bottom: 14.w),
+ padding: EdgeInsets.only(left: 16),
+ child: Flex(
+ direction: Axis.horizontal,
+ children: [
+ Expanded(
+ flex: 2,
+ child: Container(
+ child: Text.rich(
+ TextSpan(children: [
+ TextSpan(
+ text: "储值 ",
+ style: TextStyle(
+ fontSize: 12.sp,
+ color: selectIndex == index
+ ? Color(0xFF4D4D4D)
+ : Color(0xFF868686),
+ fontWeight: MyFontWeight.regular),
+ ),
+ TextSpan(
+ text: records?.rechargeMoney ?? "0",
+ style: TextStyle(
+ fontSize: 18.sp,
+ fontFamily: 'JDZhengHT',
+ color: selectIndex == index
+ ? Color(0xFF353535)
+ : Color(0xFF302F3A),
+ fontWeight: MyFontWeight.medium),
+ ),
+ TextSpan(
+ text: "元",
+ style: TextStyle(
+ fontSize: 18.sp,
+ fontFamily: 'JDZhengHT',
+ color: selectIndex == index
+ ? Color(0xFF353535)
+ : Color(0xFF302F3A),
+ fontWeight: MyFontWeight.semi_bold),
+ ),
+ ]),
+ ),
+ )),
+ Container(
+ width: 1.w,
+ height: 37.h,
+ color: selectIndex == index
+ ? Color(0xFF302F3A)
+ : Color(0xFF979797),
+ margin: EdgeInsets.only(right: 16.w, left: 12),
+ ),
+ Expanded(
+ flex: 3,
+ child: Text.rich(
TextSpan(children: [
TextSpan(
text: "赠送 ",
@@ -481,8 +1116,7 @@ class _VipRechargePage extends State {
fontWeight: MyFontWeight.regular),
),
TextSpan(
- text:
- "120",
+ text: records?.giftdMoney ?? "0",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
@@ -492,8 +1126,7 @@ class _VipRechargePage extends State {
fontWeight: MyFontWeight.medium),
),
TextSpan(
- text:
- "元",
+ text: "元",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
@@ -503,8 +1136,576 @@ class _VipRechargePage extends State {
fontWeight: MyFontWeight.semi_bold),
),
]),
- ),)
- ],
- ));
+ ),
+ )
+ ],
+ ),
+ ),
+ if (selectIndex == index)
+ Image.asset(
+ "assets/image/bus_vip_j.webp",
+ width: 32.h,
+ height: 32.h,
+ fit: BoxFit.fill,
+ ),
+ ],
+ );
}
+
+ Widget vipRechargeSm() {
+ return Container(
+ margin: EdgeInsets.symmetric(horizontal: 16.w),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ ///会员搜索框
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(top:8.h,bottom:16.h),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:double.infinity,
+ height: 51.h,
+ ),
+ ),
+
+ ///会员信息
+ Container(
+ width: double.infinity,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w),
+ margin: EdgeInsets.only(bottom: 16.h),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:70.w,
+ height: 17.h,
+ ),
+ ),
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:43.w,
+ height: 17.h,
+ ),
+ ),
+ ],
+ ),
+ SizedBox(height: 16.h,),
+ Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:56.w,
+ height: 17.h,
+ ),
+ ),
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:85.w,
+ height: 17.h,
+ ),
+ ),
+ ],
+ ),
+ SizedBox(height: 16.h,),
+ Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:70.w,
+ height: 17.h,
+ ),
+ ),
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:77.w,
+ height: 17.h,
+ ),
+ ),
+ ],
+ ),
+ ],
+ )),
+
+ ///充值列表
+ ListView.builder(
+ padding: EdgeInsets.zero,
+ itemCount: 3,
+ scrollDirection: Axis.vertical,
+ shrinkWrap: true,
+ physics: BouncingScrollPhysics(),
+ itemBuilder: (context, position) {
+ return rechargeItemSm();
+ },
+ ),
+
+ ///选择充值的套餐
+ Container(
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ padding: EdgeInsets.all(16),
+ margin: EdgeInsets.only(
+ bottom: 24.h,
+ ),
+ child: Column(
+ children: [
+ Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:89.w,
+ height: 17.h,
+ ),
+ ),
+ Spacer(),
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:26.w,
+ height: 17.h,
+ ),
+ ),
+ ],
+ ),
+ Container(
+ width: double.infinity,
+ height: 1.h,
+ color: Color(0xFFEBECEF),
+ margin: EdgeInsets.symmetric(vertical: 16.h),
+ ),
+ Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:89.w,
+ height: 17.h,
+ ),
+ ),
+ Spacer(),
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:26.w,
+ height: 17.h,
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+
+ ///充值方式
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(left: 16.w, bottom: 16.h),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:60.w,
+ height: 21.h,
+ ),
+ ),
+ Row(
+ children: [
+ Expanded(child:Container(
+ width: double.infinity,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w),
+ margin: EdgeInsets.only(right: 16.w),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(bottom:15.h),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:45.w,
+ height: 32.h,
+ ),
+ ),
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:56.w,
+ height: 17.h,
+ ),
+ ),
+ ],
+ ))),
+ Expanded(child:Container(
+ width: double.infinity,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w),
+ margin: EdgeInsets.only(right: 16.w),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(bottom:15.h),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:45.w,
+ height: 32.h,
+ ),
+ ),
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:56.w,
+ height: 17.h,
+ ),
+ ),
+ ],
+ ))),
+ Expanded(child:Container(
+ width: double.infinity,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w),
+ margin: EdgeInsets.only(right: 16.w),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(bottom:15.h),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:45.w,
+ height: 32.h,
+ ),
+ ),
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:56.w,
+ height: 17.h,
+ ),
+ ),
+ ],
+ ))),
+ ],
+ )
+ ,
+
+ ///确认充值
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(bottom: 16.h,top: 30.h),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(27),
+ ),
+ width:double.infinity,
+ height: 54.h,
+ ),
+ ),)
+ ],
+ ),
+ );
+ }
+
+ Widget rechargeItemSm() {
+ return Container(
+ width: double.infinity,
+ height: 69.h,
+ color: Colors.white,
+ margin: EdgeInsets.only(bottom: 14.w),
+ padding: EdgeInsets.only(left: 16),
+ child: Flex(
+ direction: Axis.horizontal,
+ children: [
+ Expanded(
+ flex: 2,
+ child: Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:25.w,
+ height: 15.h,
+ ),
+ ),
+ Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:50.w,
+ height: 25.h,
+ ),
+ ),
+ ],
+ )
+ ],
+ )),
+ Container(
+ width: 1.w,
+ height: 37.h,
+ color: Color(0xFF979797),
+ margin: EdgeInsets.only(right: 16.w, left: 12),
+ ),
+ Expanded(
+ flex: 3,
+ child: Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:25.w,
+ height: 15.h,
+ ),
+ ),
+ Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ margin: EdgeInsets.only(right:10.w),
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width:60.w,
+ height: 25.h,
+ ),
+ ),
+ ],
+ )
+ ],
+ ),
+ )
+ ],
+ ),
+ );
+ }
+
+ Widget noNetwork() {
+ return Container(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ // "无法连接到网络",
+ networkError.substring(0, networkError.indexOf(",")),
+ style: TextStyle(
+ fontSize: 14.sp,
+ color: Color(0xFF0D0D0D),
+ fontWeight: MyFontWeight.bold),
+ ),
+ Padding(
+ padding: EdgeInsets.symmetric(vertical: 10.h),
+ child: Text(
+ "请检查网络设置或稍后重试",
+ style: TextStyle(
+ fontSize: 12.sp,
+ color: Color(0xFF7A797F),
+ fontWeight: MyFontWeight.regular),
+ ),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ _onRefresh();
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0xFF30415B),
+ borderRadius: BorderRadius.circular(15),
+ ),
+ padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h),
+ child: Text(
+ "重试",
+ style: TextStyle(
+ fontSize: 14.sp,
+ color: Colors.white,
+ fontWeight: MyFontWeight.regular),
+ )),
+ )
+ ],
+ ),
+ );
+ }
+
}
diff --git a/lib/business_system/mine/business_mine_page.dart b/lib/business_system/mine/business_mine_page.dart
index a73a9d90..785cc8fc 100644
--- a/lib/business_system/mine/business_mine_page.dart
+++ b/lib/business_system/mine/business_mine_page.dart
@@ -246,22 +246,6 @@ class _BusinessMinePage extends State
SizedBox(
height: 20.h,
),
- // GestureDetector(
- // behavior: HitTestBehavior.opaque,
- // onTap: (){
- // Navigator.of(context).pushNamed('/router/merchant_info',arguments:{
- // "storeId":widget.storeId,
- // });
- // },
- // child:
- // commonFunctionsItem("assets/image/bs_store_info_logo.webp", "商户信息", widget?.businessLoginInfo?.name ?? ""),
- // ),
- Container(
- width: double.infinity,
- height: 1.h,
- color: Color(0xFFEBECEF),
- margin: EdgeInsets.only(left: 32.w, bottom: 12.h),
- ),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
@@ -282,7 +266,22 @@ class _BusinessMinePage extends State
}
},
child: commonFunctionsItem(
- "assets/image/bs_shop_logo.webp", "门店设置", ""),
+ "assets/image/bs_shop_logo.webp", "门店设置", "",20,20),
+ ),
+ Container(
+ width: double.infinity,
+ height: 1.h,
+ color: Color(0xFFEBECEF),
+ margin: EdgeInsets.only(left: 32.w, bottom: 12.h),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ Navigator.of(context).pushNamed('/router/shop_reservation_code',
+ arguments: {"storeId": widget.storeId,});
+ },
+ child: commonFunctionsItem(
+ "assets/image/bs_mine_code.webp", "门店预约二维码", "",18,18),
),
Container(
width: double.infinity,
@@ -300,25 +299,43 @@ class _BusinessMinePage extends State
});
},
child: commonFunctionsItem(
- "assets/image/bs_secure.webp", "安全设置", "登录手机号/密码")),
+ "assets/image/bs_secure.webp", "安全设置", "登录手机号/密码",18,22)),
+ Container(
+ width: double.infinity,
+ height: 1.h,
+ color: Color(0xFFEBECEF),
+ margin: EdgeInsets.only(left: 32.w, bottom: 12.h),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ Navigator.of(context)
+ .pushNamed('/router/clerk_manage_page', arguments: {
+ "storeId": widget.storeId,
+ });
+ },
+ child: commonFunctionsItem(
+ "assets/image/bs_mine_clerk.webp", "店员管理", "",18,20),
+ ),
],
),
);
}
- Widget commonFunctionsItem(icon, leftText, rightText) {
+ Widget commonFunctionsItem(icon, leftText, rightText,double width,double height) {
return Container(
margin: EdgeInsets.only(bottom: 14.h),
child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
icon,
- width: 24,
- height: 24,
+ width: width.w,
+ height: height.h,
fit: BoxFit.fill,
),
SizedBox(
- width: 8.w,
+ width:11.w,
),
Expanded(
child: Text(
@@ -326,7 +343,7 @@ class _BusinessMinePage extends State
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF30415B),
- fontWeight: MyFontWeight.medium),
+ fontWeight: MyFontWeight.bold),
)),
Text(
rightText,
@@ -380,7 +397,7 @@ class _BusinessMinePage extends State
Navigator.of(context).pushNamed('/router/user_service_page');
},
child:
- commonFunctionsItem("assets/image/bs_user.webp", "关于我们", ""))
+ commonFunctionsItem("assets/image/bs_user.webp", "关于我们", "",24,24))
],
),
);
diff --git a/lib/business_system/mine/clerk_manage/add_new_clerk_page.dart b/lib/business_system/mine/clerk_manage/add_new_clerk_page.dart
new file mode 100644
index 00000000..d72e73b7
--- /dev/null
+++ b/lib/business_system/mine/clerk_manage/add_new_clerk_page.dart
@@ -0,0 +1,546 @@
+import 'package:dio/dio.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_easyloading/flutter_easyloading.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
+
+import '../../../generated/l10n.dart';
+import '../../../retrofit/business_api.dart';
+import '../../../retrofit/data/base_data.dart';
+import '../../../retrofit/data/user_info_edit.dart';
+import '../../../utils/business_instance.dart';
+import '../../../utils/font_weight.dart';
+import '../../../view_widget/my_appbar.dart';
+
+class AddNewClerkPage extends StatefulWidget {
+ final Map arguments;
+
+ AddNewClerkPage({this.arguments});
+
+ @override
+ State createState() {
+ return _AddNewClerkPage();
+ }
+}
+
+class _AddNewClerkPage extends State {
+ String titleName;
+ final TextEditingController editingPhoneController = TextEditingController();
+ final TextEditingController editingNameController = TextEditingController();
+ bool isKeyBoardShow = false;
+ FocusNode _focusNode = FocusNode();
+ BusinessApiService businessService;
+ String selectSexIndex = "N";
+ String clerkAccount;
+ String clerkName;
+ String clerkSex;
+ String sexCode;
+
+ @override
+ void initState() {
+ super.initState();
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ setState(() {
+ print("object: ${MediaQuery.of(context).viewInsets.bottom}");
+ if (MediaQuery.of(context).viewInsets.bottom == 0) {
+ if (isKeyBoardShow) {
+ isKeyBoardShow = false;
+ //关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题
+ FocusScope.of(context).requestFocus(FocusNode());
+ }
+ } else {
+ isKeyBoardShow = true;
+ }
+ });
+ });
+ titleName = widget?.arguments["titleName"] ??"";
+ clerkAccount = widget?.arguments["clerkAccount"] ?? "";
+ clerkName = widget?.arguments["clerkName"] ?? "";
+ clerkSex = widget?.arguments["sex"] ?? "";
+ sexCode = widget?.arguments["sexCode"] ?? "";
+ }
+
+ ///离开页面记着销毁和清除
+ @override
+ void dispose() {
+ _focusNode.unfocus();
+ super.dispose();
+ }
+
+ ///店员信息编辑/新增店员
+ editUser(account,name,sex) async {
+ try{
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData = await businessService.userEdit({
+ "account":account,
+ "name":name,
+ "sex":sex,
+ "password": "123456",
+ }).catchError((error) {});
+ if (baseData != null && baseData.isSuccess) {
+ Navigator.of(context).pop(1);
+ SmartDialog.showToast(titleName == "编辑店员资料" ? "店员资料编辑成功" : "新增店员成功",
+ alignment: Alignment.center);
+ } else {
+ SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
+ }}finally{
+ EasyLoading.dismiss();
+ }
+ }
+
+ ///修改店员信息
+ modifyUser(account,name,sex) async {
+ try{
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData = await businessService.userModify({
+ "account": account == ""?clerkAccount:account,
+ "name": name == "" ? clerkName :name,
+ "sex": sex == ""?sexCode:sex,
+ "password": "123456",
+ "id":widget?.arguments["id"]??""
+ }).catchError((error) {});
+ if (baseData != null && baseData.isSuccess) {
+ Navigator.of(context).pop(1);
+ SmartDialog.showToast("修改店员信息成功",
+ alignment: Alignment.center);
+ } else {
+ SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
+ }}finally{
+ EasyLoading.dismiss();
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return GestureDetector(
+ behavior: HitTestBehavior.translucent,
+ onTap: () {
+ FocusScope.of(context).unfocus();
+ },
+ child: Scaffold(
+ resizeToAvoidBottomInset: false,
+ backgroundColor: Colors.white,
+ appBar: MyAppBar(
+ title: titleName,
+ titleColor: Colors.black,
+ background: Colors.white,
+ leadingColor: Colors.black,
+ brightness: Brightness.dark,
+ ),
+ body: Container(
+ margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w),
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Expanded(
+ child: Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text: "*",
+ style: TextStyle(
+ color: Color(0xFFE02020),
+ fontSize: 16.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ TextSpan(
+ text: "员工姓名",
+ style: TextStyle(
+ color: Color(0xFF30415B),
+ fontSize: 16.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ Expanded(
+ child: TextField(
+ controller: editingNameController,
+ decoration: InputDecoration(
+ hintText: clerkName != ""?clerkName:"请输入员工姓名",
+ hintTextDirection: TextDirection.rtl,
+ hintStyle: TextStyle(
+ color: Color(0xFF7A797F),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.semi_bold),
+ border: InputBorder.none,
+ contentPadding: EdgeInsets.only(left: 16.w),
+ ),
+ textAlign: TextAlign.right,
+ style: TextStyle(
+ color: Color(0xFF7A797F),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.semi_bold),
+ ),
+ ),
+ ],
+ ),
+ Container(
+ height: 1.h,
+ width: double.infinity,
+ color: Color(0xFFEBEBEB),
+ margin: EdgeInsets.only(bottom: 16.h),
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Expanded(
+ child: Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text: "*",
+ style: TextStyle(
+ color: Color(0xFFE02020),
+ fontSize: 16.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ TextSpan(
+ text: "员工性别",
+ style: TextStyle(
+ color: Color(0xFF30415B),
+ fontSize: 16.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: (){
+ showSexSelect(selectSexIndex);
+ },
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Text(
+ clerkSex != "" ? clerkSex:(selectSexIndex == "" ? "请选择员工性别":(selectSexIndex == "N"?"未知":(selectSexIndex == "M" ? "男":"女"))),
+ style: TextStyle(
+ color: Color(0xFF7A797F),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ Image.asset(
+ "assets/image/bs_right.webp",
+ width: 14.h,
+ height: 14.h,
+ color: Color(0xFF353535),
+ )
+ ],
+ )
+ )
+ ],
+ ),
+ Container(
+ height: 1.h,
+ width: double.infinity,
+ color: Color(0xFFEBEBEB),
+ margin: EdgeInsets.only(top: 16.h),
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Expanded(
+ child: Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text: "*",
+ style: TextStyle(
+ color: Color(0xFFE02020),
+ fontSize: 16.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ TextSpan(
+ text: "手机号",
+ style: TextStyle(
+ color: Color(0xFF30415B),
+ fontSize: 16.sp,
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ Expanded(
+ child: TextField(
+ controller: editingPhoneController,
+ keyboardType: TextInputType.phone,
+ decoration: InputDecoration(
+ hintText: clerkAccount != ""?clerkAccount:"请输入手机号",
+ hintTextDirection: TextDirection.rtl,
+ hintStyle: TextStyle(
+ color: Color(0xFF7A797F),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.semi_bold),
+ border: InputBorder.none,
+ contentPadding: EdgeInsets.only(left: 16.w),
+ ),
+ inputFormatters: [
+ LengthLimitingTextInputFormatter(11)
+ ],
+ textAlign: TextAlign.right,
+ style: TextStyle(
+ color: Color(0xFF7A797F),
+ fontSize: 14.sp,
+ fontWeight: MyFontWeight.semi_bold),
+ ),
+ ),
+ ],
+ ),
+ Container(
+ height: 1.h,
+ width: double.infinity,
+ color: Color(0xFFEBEBEB),
+ margin: EdgeInsets.only(bottom: 16.h),
+ ),
+ Spacer(),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ if (editingNameController.text == "" && clerkName == "") {
+ SmartDialog.showToast("请输入员工姓名",
+ alignment: Alignment.center);
+ return;
+ } else if (selectSexIndex == "" && clerkSex == "") {
+ SmartDialog.showToast("请选择员工性别",
+ alignment: Alignment.center);
+ return;
+ } else if (editingPhoneController.text == "" && clerkAccount == "") {
+ SmartDialog.showToast("请输入手机号",
+ alignment: Alignment.center);
+ return;
+ } {
+ if(clerkName != "" || clerkAccount != "" || clerkSex != ""){
+ modifyUser(editingPhoneController.text,editingNameController.text,selectSexIndex);
+ }else
+ editUser(editingPhoneController.text,editingNameController.text,selectSexIndex);
+ }
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(27),
+ color: Color(0xFF30415B),
+ ),
+ width: double.infinity,
+ alignment: Alignment.center,
+ padding: EdgeInsets.symmetric(vertical: 16.h),
+ margin: EdgeInsets.only(bottom: 34.h),
+ child: Text(
+ S.of(context).baocun,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 16.sp,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ showSexSelect(index) {
+ showModalBottomSheet(
+ context: context,
+ isDismissible: false,
+ builder: (context) {
+ return StatefulBuilder(builder: (
+ context,
+ state,
+ ) {
+ return Container(
+ width: double.infinity,
+ height: 290.h,
+ padding: EdgeInsets.only(top: 12.h),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.only(
+ topRight: Radius.circular(6),
+ topLeft: Radius.circular(6),
+ )),
+ child: Column(
+ children: [
+ Padding(
+ padding: EdgeInsets.symmetric(horizontal: 14.w),
+ child: Row(
+ children: [
+ Expanded(
+ child:GestureDetector(
+ behavior:HitTestBehavior.opaque,
+ onTap: (){
+ state((){
+ selectSexIndex = "";
+ Navigator.of(context).pop();
+ });
+ },
+ child: Text(
+ S.of(context).quxiao,
+ style: TextStyle(
+ color: Colors.black,
+ fontSize: 16.sp,
+ fontWeight: MyFontWeight.black,
+ ),
+ ),
+ )),
+ Expanded(child:GestureDetector(
+ behavior:HitTestBehavior.opaque,
+ onTap: (){
+ selectSexIndex == "N"? "未知" :(selectSexIndex == "M" ? "男" : "女" );
+ Navigator.of(context).pop();
+ setState((){});},
+ child: Container(
+ alignment: Alignment.centerRight,
+ child: Text(
+ S.of(context).queding,
+ style: TextStyle(
+ color: Color(0xFF30415B),
+ fontSize: 16.sp,
+ fontWeight: MyFontWeight.black,
+ ),
+ ),
+ ),
+ ))
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 12.h, bottom: 13.h),
+ height: 1.h,
+ color: Color(0xFFF2F2F2)),
+ GestureDetector(
+ behavior:HitTestBehavior.opaque,
+ onTap: () {
+ state((){
+ selectSexIndex = "M";
+ });
+ },
+ child: Container(
+ width: double.infinity,
+ alignment: Alignment.center,
+ padding:
+ EdgeInsets.only(top:12.h, bottom:12.h, left: 12.w),
+ margin: EdgeInsets.symmetric(horizontal: 14.w),
+ decoration: BoxDecoration(
+ borderRadius:BorderRadius.circular(6),
+ border: Border.all(
+ color: selectSexIndex == "M" ? Color(0xFF30415B):Color(0xFFF7F7F7),
+ width: selectSexIndex == "M" ? 1 :0,
+ ),
+ color: selectSexIndex == "M" ? Color(0xFFEFF5FF) :Color(0xFFF7F7F7),
+ ),
+ child: Text(
+ "男",
+ style: TextStyle(
+ color: selectSexIndex == "M"? Color(0xFF30415B):Color(0xFF4D4D4D),
+ fontSize: 18.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ ),
+ ),
+ ),
+ SizedBox(
+ height: 13.h,
+ ),
+ GestureDetector(
+ behavior:HitTestBehavior.opaque,
+ onTap: () {
+ state((){
+ selectSexIndex = "W";
+ });
+ },
+ child: Container(
+ width: double.infinity,
+ alignment: Alignment.center,
+ padding:
+ EdgeInsets.only(top: 12.h, bottom: 12.h, left: 12.w),
+ margin: EdgeInsets.symmetric(horizontal: 14.w),
+ decoration: BoxDecoration(
+ borderRadius:BorderRadius.circular(6),
+ border: Border.all(
+ color: selectSexIndex == "W" ? Color(0xFF30415B):Color(0xFFF7F7F7),
+ width: selectSexIndex == "W" ? 1 :0,
+ ),
+ color: selectSexIndex == "W" ? Color(0xFFEFF5FF) :Color(0xFFF7F7F7),
+ ),
+ child: Text(
+ "女",
+ style: TextStyle(
+ color: selectSexIndex == "W" ?Color(0xFF30415B):Color(0xFF4D4D4D),
+ fontSize: 18.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ )),
+ ),
+ SizedBox(
+ height: 13.h,
+ ),
+ GestureDetector(
+ behavior:HitTestBehavior.opaque,
+ onTap: () {
+ state((){
+ selectSexIndex = "N";
+ });
+ },
+ child: Container(
+ width: double.infinity,
+ alignment: Alignment.center,
+ padding:
+ EdgeInsets.only(top: 12.h, bottom: 12.h, left: 12.w),
+ margin: EdgeInsets.symmetric(horizontal: 14.w),
+ decoration: BoxDecoration(
+ borderRadius:BorderRadius.circular(6),
+ border: Border.all(
+ color: selectSexIndex == "N" ? Color(0xFF30415B):Color(0xFFF7F7F7),
+ width: selectSexIndex == "N" ? 1 :0,
+ ),
+ color: selectSexIndex == "N" ? Color(0xFFEFF5FF) :Color(0xFFF7F7F7),
+ ),
+ child: Text(
+ "未知",
+ style: TextStyle(
+ color: selectSexIndex == "N" ?Color(0xFF30415B):Color(0xFF4D4D4D),
+ fontSize: 18.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ )),
+ )
+ ],
+ ),
+ );
+ });
+ },
+ );
+ }
+}
diff --git a/lib/business_system/mine/clerk_manage/clerk_manage_page.dart b/lib/business_system/mine/clerk_manage/clerk_manage_page.dart
new file mode 100644
index 00000000..050fbcdd
--- /dev/null
+++ b/lib/business_system/mine/clerk_manage/clerk_manage_page.dart
@@ -0,0 +1,512 @@
+import 'package:dio/dio.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_easyloading/flutter_easyloading.dart';
+import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
+import 'package:huixiang/utils/font_weight.dart';
+import 'package:huixiang/view_widget/my_appbar.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:pull_to_refresh/pull_to_refresh.dart';
+import 'package:shimmer/shimmer.dart';
+
+import '../../../generated/l10n.dart';
+import '../../../retrofit/business_api.dart';
+import '../../../retrofit/data/base_data.dart';
+import '../../../retrofit/data/clerk_manage_list.dart';
+import '../../../utils/business_instance.dart';
+import '../../../utils/flutter_utils.dart';
+import '../../../view_widget/border_text.dart';
+import '../../../view_widget/classic_header.dart';
+import '../../../view_widget/my_footer.dart';
+import '../../../view_widget/no_data_view.dart';
+import '../../../view_widget/round_button.dart';
+
+class ClerkManagePage extends StatefulWidget {
+ final Map arguments;
+
+ ClerkManagePage({this.arguments});
+
+ @override
+ State createState() {
+ return _ClerkManagePage();
+ }
+}
+
+class _ClerkManagePage extends State {
+ final RefreshController refreshController = RefreshController();
+ BusinessApiService businessService;
+ String networkError = "";
+ int networkStatus = 0;
+ List records = [];
+ int _current = 1;
+
+ @override
+ void initState() {
+ super.initState();
+ _onRefresh();
+ }
+
+ _onRefresh({bool isShowLoad = true}) async {
+ if (isShowLoad)
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai,
+ maskType: EasyLoadingMaskType.black);
+ await queryClerkList();
+ EasyLoading.dismiss();
+ if (refreshController.isRefresh) refreshController.refreshCompleted();
+ if (mounted) setState(() {});
+ }
+
+ ///查询店员管理列表
+ queryClerkList({isShow = true}) async {
+ try {
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData = await businessService.clerkList({
+ "size": 20,
+ "pageSize": 20,
+ "current": _current,
+ "currentPage": 1,
+ "sort": "id",
+ "order": "descending",
+ }).catchError((error) {
+ networkError = AppUtils.dioErrorTypeToString(error.type);
+ networkStatus = -1;
+ setState(() {});
+ refreshController.refreshFailed();
+ refreshController.loadFailed();
+ });
+ if (!mounted) return;
+ if (baseData != null && baseData.isSuccess) {
+ records.addAll(baseData?.data?.records ?? []);
+ if ((baseData?.data?.records ?? []).isEmpty ||
+ records.length.toString() == baseData.data.total)
+ refreshController.loadNoData();
+ else
+ refreshController.loadComplete();
+ networkStatus = 1;
+ } else {
+ SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
+ }
+ } finally {
+ if (isShow) setState(() {});
+ }
+ }
+
+ ///删除店员
+ queryDelUser(ids) async {
+ try {
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai,
+ maskType: EasyLoadingMaskType.black);
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData =
+ await businessService.delUser(ids).catchError((error) {});
+ if (baseData != null && baseData.isSuccess) {
+ await editOnRefresh();
+ SmartDialog.showToast("删除店员成功", alignment: Alignment.center);
+ } else {
+ SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
+ }
+ } finally {
+ EasyLoading.dismiss();
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ backgroundColor: Colors.white,
+ appBar: MyAppBar(
+ title: "店员管理",
+ titleColor: Colors.black,
+ background: Colors.white,
+ leadingColor: Colors.black,
+ brightness: Brightness.dark,
+ ),
+ body: networkStatus == -1
+ ? noNetwork()
+ : Container(
+ margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w),
+ child: Column(
+ children: [
+ Expanded(
+ child: Container(
+ child: SmartRefresher(
+ controller: refreshController,
+ enablePullDown: true,
+ enablePullUp: records.length == 0 ? false : true,
+ header: MyHeader(
+ color: Color(0xFF30415B),
+ ),
+ footer: CustomFooter(
+ builder: (context, mode) {
+ return MyFooter(mode);
+ },
+ ),
+ onRefresh: () {
+ _current = 1;
+ records.clear();
+ _onRefresh(isShowLoad: false);
+ },
+ onLoading: () {
+ _current++;
+ _onRefresh(isShowLoad: false);
+ },
+ physics: BouncingScrollPhysics(),
+ scrollController: ScrollController(),
+ child: Container(
+ child: networkStatus == 0
+ ? ListView.builder(
+ itemCount: 10,
+ physics: BouncingScrollPhysics(),
+ shrinkWrap: true,
+ itemBuilder: (context, position) {
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {},
+ child: clerkManageItemSm(),
+ );
+ },
+ )
+ : ((records == null || records.length == 0)
+ ? NoDataView(
+ src: "assets/image/bs_no data_logo.webp",
+ isShowBtn: false,
+ text: "暂无商品分类",
+ fontSize: 16.sp,
+ margin: EdgeInsets.all(20.h),
+ )
+ : ListView.builder(
+ itemCount: records?.length ?? 0,
+ physics: BouncingScrollPhysics(),
+ shrinkWrap: true,
+ itemBuilder: (context, position) {
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {},
+ child: clerkManageItem(
+ records[position]),
+ );
+ },
+ )),
+ ),
+ ),
+ )),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ Navigator.of(context).pushNamed(
+ '/router/add_new_clerk_page',
+ arguments: {
+ "storeId": widget.arguments["storeId"],
+ "titleName": "添加新店员"
+ }).then((value) {
+ if (value == 1) {
+ _current = 1;
+ records.clear();
+ _onRefresh(isShowLoad: false);
+ }
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(27),
+ color: Color(0xFF30415B),
+ ),
+ width: double.infinity,
+ alignment: Alignment.center,
+ padding: EdgeInsets.symmetric(vertical: 16.h),
+ margin: EdgeInsets.only(bottom: 34.h),
+ child: Text(
+ "添加店员",
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 16.sp,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ )),
+ ],
+ ),
+ ));
+ }
+
+ editOnRefresh() {
+ _current = 1;
+ records.clear();
+ _onRefresh(isShowLoad: false);
+ }
+
+ ///店员管理列表
+ Widget clerkManageItem(Records records) {
+ return Container(
+ child: Column(
+ children: [
+ Row(
+ children: [
+ Expanded(
+ child: Text(
+ records?.name ?? "",
+ style: TextStyle(
+ color: Color(0xFF000000),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.bold,
+ ),
+ )),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ Navigator.of(context)
+ .pushNamed('/router/add_new_clerk_page', arguments: {
+ "storeId": widget.arguments["storeId"],
+ "titleName": "编辑店员资料",
+ "clerkAccount": (records?.mobile == "")
+ ? (records?.account ?? "")
+ : (records?.mobile ?? ""),
+ "clerkName": records?.name ?? "",
+ "sex": records?.sex?.desc ?? "",
+ "sexCode": records?.sex?.code ?? "",
+ "id": records?.id ?? ""
+ }).then((value) {
+ if(value == 1)
+ editOnRefresh();
+ });
+ },
+ child: Padding(
+ padding: EdgeInsets.symmetric(horizontal: 17.w),
+ child: Text(
+ "编辑",
+ style: TextStyle(
+ color: Color(0xFF30415B),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ showDelGroupDialog(records?.id);
+ },
+ child: Padding(
+ padding: EdgeInsets.only(right: 16.w, left: 17.w),
+ child: Text(
+ S.of(context).shanchu,
+ style: TextStyle(
+ color: Color(0xFFF4524D),
+ fontSize: 14.sp,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ )
+ ],
+ ),
+ Container(
+ margin: EdgeInsets.symmetric(vertical: 16.h),
+ color: Color(0xFFEBEBEB),
+ height: 1.h,
+ width: double.infinity,
+ )
+ ],
+ ),
+ );
+ }
+
+ Widget clerkManageItemSm() {
+ return Container(
+ child: Column(
+ children: [
+ Row(
+ children: [
+ Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width: 112.w,
+ height: 20.h,
+ ),
+ ),
+ Spacer(),
+ Padding(
+ padding: EdgeInsets.symmetric(horizontal: 17.w),
+ child: Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width: 28.w,
+ height: 20.h,
+ ),
+ ),
+ ),
+ Padding(
+ padding: EdgeInsets.only(right: 16.w, left: 17.w),
+ child: Shimmer.fromColors(
+ baseColor: Color(0XFFD8D8D8),
+ highlightColor: Color(0XFFD8D8D8),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0XFFD8D8D8),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ width: 28.w,
+ height: 20.h,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Container(
+ margin: EdgeInsets.symmetric(vertical: 16.h),
+ color: Color(0xFFEBEBEB),
+ height: 1.h,
+ width: double.infinity,
+ )
+ ],
+ ),
+ );
+ }
+
+ ///删除分组提示弹窗
+ showDelGroupDialog(id) {
+ showDialog(
+ context: context,
+ builder: (context) {
+ return AlertDialog(
+ content: Container(
+ width: MediaQuery.of(context).size.width - 84,
+ height: 139.h,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Text(
+ "选中数据将被永久删除, 是否继续?",
+ style: TextStyle(
+ color: Color(0xFFF4524D),
+ fontSize: 16.sp,
+ fontWeight: MyFontWeight.regular,
+ ),
+ ),
+ SizedBox(
+ height: 35.h,
+ ),
+ Row(
+ children: [
+ Expanded(
+ child: InkWell(
+ child: BorderText(
+ text: S.of(context).quxiao,
+ textColor: Color(0xFF30415B),
+ fontSize: 16.sp,
+ fontWeight: FontWeight.bold,
+ borderColor: Color(0xFF30415B),
+ radius: 4,
+ padding: EdgeInsets.all(12),
+ borderWidth: 1,
+ ),
+ onTap: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ flex: 1,
+ ),
+ SizedBox(
+ width: 16.w,
+ ),
+ Expanded(
+ child: InkWell(
+ child: RoundButton(
+ text: S.of(context).queren,
+ textColor: Colors.white,
+ radius: 4,
+ padding: EdgeInsets.all(12),
+ backgroup: Color(0xFF30415B),
+ fontSize: 16.sp,
+ fontWeight: FontWeight.bold,
+ ),
+ onTap: () {
+ Navigator.of(context).pop();
+ queryDelUser(id);
+ },
+ ),
+ flex: 1,
+ ),
+ ],
+ )
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ }
+
+ Widget noNetwork() {
+ return Container(
+ color: Colors.white,
+ width: double.infinity,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ networkError.substring(0, networkError.indexOf(",")),
+ style: TextStyle(
+ fontSize: 14.sp,
+ color: Color(0xFF0D0D0D),
+ fontWeight: MyFontWeight.bold),
+ ),
+ Padding(
+ padding: EdgeInsets.symmetric(vertical: 10.h),
+ child: Text(
+ "请检查网络设置或稍后重试",
+ style: TextStyle(
+ fontSize: 12.sp,
+ color: Color(0xFF7A797F),
+ fontWeight: MyFontWeight.regular),
+ ),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ _onRefresh();
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ color: Color(0xFF30415B),
+ borderRadius: BorderRadius.circular(15),
+ ),
+ padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h),
+ child: Text(
+ "重试",
+ style: TextStyle(
+ fontSize: 14.sp,
+ color: Colors.white,
+ fontWeight: MyFontWeight.regular),
+ )),
+ )
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/business_system/mine/shop_reservation_code.dart b/lib/business_system/mine/shop_reservation_code.dart
new file mode 100644
index 00000000..0c92631b
--- /dev/null
+++ b/lib/business_system/mine/shop_reservation_code.dart
@@ -0,0 +1,208 @@
+import 'dart:typed_data';
+
+import 'package:flutter/material.dart';
+import 'package:flutter_easyloading/flutter_easyloading.dart';
+import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
+import 'package:huixiang/utils/font_weight.dart';
+import 'package:huixiang/view_widget/my_appbar.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:image_gallery_saver/image_gallery_saver.dart';
+import 'package:permission_handler/permission_handler.dart';
+import 'package:pull_to_refresh/pull_to_refresh.dart';
+import 'package:qr_flutter/qr_flutter.dart';
+
+import '../../view_widget/classic_header.dart';
+import '../../view_widget/my_footer.dart';
+
+class ShopReservationCode extends StatefulWidget {
+ final Map arguments;
+
+ ShopReservationCode({this.arguments});
+
+ @override
+ State createState() {
+ return _ShopReservationCode();
+ }
+}
+
+class _ShopReservationCode extends State {
+ final RefreshController refreshController = RefreshController();
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: MyAppBar(
+ title: "门店预约二维码",
+ titleColor: Colors.black,
+ background: Colors.white,
+ leadingColor: Colors.black,
+ brightness: Brightness.dark,
+ ),
+ body:
+ // networkStatus == -1
+ // ? noNetwork() :
+ SmartRefresher(
+ controller: refreshController,
+ enablePullDown: true,
+ enablePullUp: false,
+ header: MyHeader(
+ color: Color(0xFF30415B),
+ ),
+ footer: CustomFooter(
+ builder: (context, mode) {
+ return MyFooter(mode);
+ },
+ ),
+ onRefresh: () {
+ // _onRefresh(isShowLoad: false);
+ },
+ physics: BouncingScrollPhysics(),
+ scrollController: ScrollController(),
+ child: Container(
+ padding: EdgeInsets.only(top:16.h,bottom:45.h),
+ child:
+ // ListView.builder(
+ // itemCount: 10,
+ // physics: BouncingScrollPhysics(),
+ // shrinkWrap: true,
+ // itemBuilder: (context, position) {
+ // return GestureDetector(
+ // behavior: HitTestBehavior.opaque,
+ // onTap: () {},
+ // child: assortItemSm(),
+ // );
+ // },
+ // )
+ // : ((productGroupList == null ||
+ // productGroupList.records.length == 0)
+ // ? NoDataView(
+ // src: "assets/image/bs_no data_logo.webp",
+ // isShowBtn: false,
+ // text: "暂无商品分类",
+ // fontSize: 16.sp,
+ // margin: EdgeInsets.all(20.h),
+ // ) :
+ ListView.builder(
+ itemCount:6,
+ physics: BouncingScrollPhysics(),
+ shrinkWrap: true,
+ itemBuilder: (context, position) {
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {},
+ child: reservationCodeItem(),
+ );
+ },
+ )),
+ ));
+ }
+
+ void saveQrImg(String qrImgData) async{
+ try {
+ EasyLoading.show(status: "正在保存...", maskType: EasyLoadingMaskType.clear);
+ // 如果用户已授权存储权限
+ if (await Permission.storage.request().isGranted) {
+ final painter = QrPainter(
+ data: qrImgData,
+ version: QrVersions.auto,
+ gapless: true,
+ errorCorrectionLevel: QrErrorCorrectLevel.L,
+ );
+ ByteData imageData = await painter.toImageData(600.0);
+ final data = imageData.buffer.asUint8List();
+ if (data != null) {
+ var result = await
+ ImageGallerySaver.saveImage(data,
+ isReturnImagePathOfIOS: true);
+ if (result["isSuccess"] == true) {
+ SmartDialog.showToast("保存成功!", alignment: Alignment.center);
+ } else
+ SmartDialog.showToast("保存失败!${result["errorMessage"] ?? ""}",
+ alignment: Alignment.center);
+ } else
+ SmartDialog.showToast("获取图片失败!", alignment: Alignment.center);
+ } else {
+ // 没有存储权限时,弹出没有存储权限的弹窗
+ await Permission.storage.request();
+ SmartDialog.showToast("请在授予应用储存权限后再试!", alignment: Alignment.center);
+ }
+ } catch (e, s) {
+ SmartDialog.showToast("22222", alignment: Alignment.center);
+ SmartDialog.showToast(e.toString(), alignment: Alignment.center);
+ SmartDialog.showToast(s.toString(), alignment: Alignment.center);
+ } finally {
+ EasyLoading.dismiss();
+ }
+ }
+
+ Widget reservationCodeItem() {
+ return Container(
+ width: double.infinity,
+ margin: EdgeInsets.only(left: 16.w, right: 16.w,bottom:12.h),
+ padding: EdgeInsets.only(top:12.h, bottom: 12.h,left:20.w,),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [
+ BoxShadow(
+ color: Color(0x0F06152E),
+ offset: Offset(0, 2),
+ blurRadius: 4,
+ spreadRadius: 0,
+ )
+ ],
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ QrImage(
+ data: "555562332356564512",
+ version: QrVersions.auto,
+ size: 104.h,
+ gapless: true,
+ padding: EdgeInsets.all(0),
+ ),
+ SizedBox(width: 10.w,),
+ Expanded(child:Container(
+ height: 104.h,
+ child: Column(
+ children: [
+ Expanded(child:Padding(padding: EdgeInsets.only(right: 22.w),
+ child: Text(
+ "海峡姐妹理发彭和会所",
+ overflow: TextOverflow.ellipsis,
+ maxLines: 2,
+ style: TextStyle(
+ color: Color(0xD9000000),
+ fontSize: 18.sp,
+ fontWeight: MyFontWeight.bold,
+ ),
+ ),)),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: (){
+ saveQrImg("555562332356564512");
+ },
+ child: Container(
+ padding: EdgeInsets.only(top:15.h,right: 22.w),
+ alignment: Alignment.bottomRight,
+ child: Image.asset(
+ "assets/image/bus_code_save.webp",
+ width: 20.w,
+ height: 18.h,
+ ),
+ ),
+ )
+ ],
+ ),
+ )),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/business_system/scan_code_page.dart b/lib/business_system/scan_code_page.dart
index 38701dec..2fba9600 100644
--- a/lib/business_system/scan_code_page.dart
+++ b/lib/business_system/scan_code_page.dart
@@ -1,6 +1,7 @@
import 'dart:ui';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:image_pickers/image_pickers.dart';
@@ -9,6 +10,8 @@ import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/ticket_details.dart';
import '../../utils/business_instance.dart';
+import '../generated/l10n.dart';
+import '../utils/font_weight.dart';
import '../view_widget/settlement_tips_dialog.dart';
class ScanCodePage extends StatefulWidget {
@@ -65,6 +68,40 @@ class _ScanCodePage extends State {
}
}
+ ///会员充值支付
+ rechargePay(authCode) async {
+ try{
+ EasyLoading.show(
+ status: S.current.zhengzaijiazai,
+ maskType: EasyLoadingMaskType.black);
+ if (businessService == null) {
+ businessService = BusinessApiService(Dio(),
+ context: context,
+ token: BusinessInstance.instance.businessToken,
+ tenant: BusinessInstance.instance.businessTenant,
+ storeId: widget.arguments["storeId"]);
+ }
+ BaseData baseData = await businessService.posMemberRecharge({
+ "rechargePreferentialId": widget?.arguments["rechargePreferentialId"] ?? "",
+ "memberSourceId": widget?.arguments["memberSourceId"] ?? "",
+ "source": widget?.arguments["source"] ?? 1,
+ "authCode": authCode ?? null
+ }).catchError((error) {});
+ if (baseData != null && baseData.isSuccess) {
+ Navigator.of(context).pop(1);
+ Navigator.of(context).popAndPushNamed('/router/pay_success_page',arguments: {
+ "rechargeId":baseData.data,
+ "rechargeMoney":widget?.arguments["rechargeMoney"],
+ "payIndex":int.tryParse(widget?.arguments["source"]),
+ });
+ } else {
+ Navigator.of(context).pop([baseData.msg,baseData.data]);
+ }}finally{
+ EasyLoading.dismiss();
+ }
+ }
+
+
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -79,8 +116,12 @@ class _ScanCodePage extends State {
scanAreaScale: 0.7,
scanLineColor: Colors.green.shade400,
onCapture: (data) {
- if (data != null && data != "") {
+ if (data != null &&
+ data != "" &&
+ widget.arguments["scanCodeType"] == null) {
queryTicketDetails(data);
+ } else {
+ rechargePay(data);
}
},
),
@@ -136,7 +177,7 @@ class _ScanCodePage extends State {
),
padding: EdgeInsets.all(8.w),
margin: EdgeInsets.only(left: 12.w, right: 16.w, top: 16.h),
- child:Icon(
+ child: Icon(
Icons.image,
size: 25.w,
color: Colors.white,
@@ -169,14 +210,13 @@ class _ScanCodePage extends State {
String result = await Scan.parse(medias[0].path);
if (result != null && result != "") {
queryTicketDetails(result);
- }else{
+ } else {
SmartDialog.show(
widget: SettlementTips(
- () {
- },
- text: "照片中未识别到二维码/条码",
- color: Color(0xFF30415B),
- ));
+ () {},
+ text: "照片中未识别到二维码/条码",
+ color: Color(0xFF30415B),
+ ));
}
}
}
diff --git a/lib/home/welfare_page.dart b/lib/home/welfare_page.dart
index 895b8b2e..9277c070 100644
--- a/lib/home/welfare_page.dart
+++ b/lib/home/welfare_page.dart
@@ -26,6 +26,8 @@ import 'package:huixiang/view_widget/selector_store_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
+import '../view_widget/settlement_tips_dialog.dart';
+
class WelfarePage extends StatefulWidget {
@override
State createState() {
@@ -689,7 +691,12 @@ class _WelfarePage extends State {
queryCoupon();
showAlertDialog();
} else {
- SmartDialog.showToast(baseData?.msg, alignment: Alignment.center);
+ SmartDialog.show(
+ clickBgDismissTemp: false,
+ widget: SettlementTips(
+ () {},
+ text: baseData.msg,
+ ));
}
}
diff --git a/lib/main.dart b/lib/main.dart
index 7492e671..5bb02341 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -96,18 +96,24 @@ import 'business_system/goods/on_sale/batch_shelf.dart';
import 'business_system/goods/on_sale/goods_assort.dart';
import 'business_system/goods/on_sale/goods_sort.dart';
import 'business_system/goods/reservation_ page.dart';
+import 'business_system/home/cashier/cashier_page.dart';
+import 'business_system/home/consumer_ranking_page.dart';
import 'business_system/home/flow_page.dart';
import 'business_system/home/hot _selling_page.dart';
import 'business_system/home/select_shop.dart';
import 'business_system/home/overview/trade_overview_page.dart';
import 'business_system/home/vip/add_vip.dart';
import 'business_system/home/vip/business_vip_page.dart';
+import 'business_system/home/vip/pay_success_page.dart';
import 'business_system/home/vip/vip_recharge_page.dart';
import 'business_system/login/business_login_page.dart';
import 'business_system/mine/account_information.dart';
+import 'business_system/mine/clerk_manage/add_new_clerk_page.dart';
+import 'business_system/mine/clerk_manage/clerk_manage_page.dart';
import 'business_system/mine/merchant_info.dart';
import 'business_system/mine/security_setting.dart';
import 'business_system/mine/shop_image_info.dart';
+import 'business_system/mine/shop_reservation_code.dart';
import 'business_system/order/business_order_detail.dart';
import 'business_system/order/order_write_off.dart';
import 'business_system/order/request_refund.dart';
@@ -527,4 +533,16 @@ Map routers = {
HotSellingPage(arguments:arguments),
'/router/vip_recharge_page': (context, {arguments}) =>
VipRechargePage(arguments:arguments),
+ '/router/pay_success_page': (context, {arguments}) =>
+ PaySuccessPage(arguments:arguments),
+ '/router/cashier_page': (context, {arguments}) =>
+ CashierPage(arguments:arguments),
+ '/router/consumer_ranking_page': (context, {arguments}) =>
+ ConsumerRankingPage(arguments:arguments),
+ '/router/shop_reservation_code': (context, {arguments}) =>
+ ShopReservationCode(arguments:arguments),
+ '/router/clerk_manage_page': (context, {arguments}) =>
+ ClerkManagePage(arguments:arguments),
+ '/router/add_new_clerk_page': (context, {arguments}) =>
+ AddNewClerkPage(arguments:arguments),
};
diff --git a/lib/qr/invite_friends.dart b/lib/qr/invite_friends.dart
index 8a6ed6b7..025656a3 100644
--- a/lib/qr/invite_friends.dart
+++ b/lib/qr/invite_friends.dart
@@ -293,7 +293,7 @@ class _InviteFriends extends State {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
- Column(
+ Expanded(child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@@ -301,12 +301,12 @@ class _InviteFriends extends State {
children: [
Image.asset(
"assets/image/invite_wx.webp",
- width: 42,
- height: 42,
+ width: 42.h,
+ height: 42.h,
fit: BoxFit.cover,
),
Container(
- width: 51,
+ width:50.w,
child: Flex(
children: List.generate(8, (_) {
return SizedBox(
@@ -330,8 +330,8 @@ class _InviteFriends extends State {
children: [
Image.asset(
"assets/image/invite_1.webp",
- width: 24,
- height: 24,
+ width: 24.h,
+ height: 24.h,
fit: BoxFit.cover,
),
Container(
@@ -339,8 +339,8 @@ class _InviteFriends extends State {
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
- width: 3,
- height: 1,
+ width: 3.w,
+ height: 1.h,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.white),
),
@@ -371,12 +371,12 @@ class _InviteFriends extends State {
),
),
Container(
- width: 43,
+ width: 43.w,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
- width: 3,
- height: 1,
+ width: 3.w,
+ height: 1.h,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.white),
),
@@ -389,8 +389,8 @@ class _InviteFriends extends State {
],
),
],
- ),
- Column(
+ )),
+ Expanded(child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@@ -398,17 +398,17 @@ class _InviteFriends extends State {
children: [
Image.asset(
"assets/image/yq_zt.webp",
- width: 42,
- height: 42,
+ width: 42.h,
+ height: 42.h,
fit: BoxFit.cover,
),
Container(
- width: 51,
+ width: 50.w,
child: Flex(
children: List.generate(8, (_) {
return SizedBox(
- width: 3,
- height: 1,
+ width: 3.w,
+ height: 1.w,
child: DecoratedBox(
decoration:
BoxDecoration(color: Color(0xFF32A060)),
@@ -427,8 +427,8 @@ class _InviteFriends extends State {
children: [
Image.asset(
"assets/image/invite_2.webp",
- width: 24,
- height: 24,
+ width: 24.h,
+ height: 24.h,
fit: BoxFit.cover,
),
Container(
@@ -436,8 +436,8 @@ class _InviteFriends extends State {
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
- width: 3,
- height: 1,
+ width: 3.w,
+ height: 1.h,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.white),
),
@@ -472,8 +472,8 @@ class _InviteFriends extends State {
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
- width: 3,
- height: 1,
+ width: 3.w,
+ height: 1.h,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.white),
),
@@ -486,8 +486,8 @@ class _InviteFriends extends State {
],
),
],
- ),
- Column(
+ )),
+ Expanded(child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@@ -495,17 +495,17 @@ class _InviteFriends extends State {
children: [
Image.asset(
"assets/image/zt_m.webp",
- width: 42,
- height: 42,
+ width: 42.h,
+ height: 42.h,
fit: BoxFit.cover,
),
Container(
- width: 51,
+ width: 50.w,
child: Flex(
children: List.generate(8, (_) {
return SizedBox(
- width: 3,
- height: 1,
+ width: 3.w,
+ height: 1.h,
child: DecoratedBox(
decoration:
BoxDecoration(color: Color(0xFF32A060)),
@@ -524,8 +524,8 @@ class _InviteFriends extends State {
children: [
Image.asset(
"assets/image/invite_3.webp",
- width: 24,
- height: 24,
+ width: 24.h,
+ height: 24.h,
fit: BoxFit.cover,
),
Container(
@@ -533,8 +533,8 @@ class _InviteFriends extends State {
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
- width: 3,
- height: 1,
+ width: 3.w,
+ height: 1.h,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.white),
),
@@ -565,12 +565,12 @@ class _InviteFriends extends State {
),
),
Container(
- width: 43,
+ width: 43.w,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
- width: 3,
- height: 1,
+ width: 3.w,
+ height: 1.h,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.white),
),
@@ -583,19 +583,19 @@ class _InviteFriends extends State {
],
),
],
- ),
+ )),
Column(
children: [
Image.asset(
"assets/image/invite_q.webp",
- width: 42,
- height: 42,
+ width: 42.h,
+ height: 42.h,
fit: BoxFit.cover,
),
Image.asset(
"assets/image/invite_4.webp",
- width: 24,
- height: 24,
+ width: 24.h,
+ height: 24.h,
fit: BoxFit.cover,
),
SizedBox(height: 8.h),
@@ -613,7 +613,8 @@ class _InviteFriends extends State {
),
)
],
- ),
+ )
+ ,
],
),
),
diff --git a/lib/retrofit/business_api.dart b/lib/retrofit/business_api.dart
index 0a9142b2..55adaf4d 100644
--- a/lib/retrofit/business_api.dart
+++ b/lib/retrofit/business_api.dart
@@ -12,16 +12,21 @@ import 'package:huixiang/retrofit/data/order_trend.dart';
import 'package:huixiang/retrofit/data/vip_counts_info.dart';
import 'package:retrofit/retrofit.dart';
+import 'data/add_vip_info.dart';
import 'data/balance_change_list.dart';
+import 'data/balance_consumption_ranking_list.dart';
import 'data/base_data.dart';
+import 'data/bus_recharge_list.dart';
import 'data/business_goods.dart';
import 'data/business_order_detail_info.dart';
import 'data/business_order_list.dart';
import 'data/business_store_list.dart';
import 'data/business_vip_list.dart';
+import 'data/clerk_manage_list.dart';
import 'data/day_flow_list.dart';
import 'data/goods_type_sales_list.dart';
import 'data/order_user_detail.dart';
+import 'data/phone_query_member_info.dart';
import 'data/popular_sales_list.dart';
import 'data/product_group_list.dart';
import 'data/recharge_flow_list.dart';
@@ -34,6 +39,7 @@ import 'data/ticket_show.dart';
import 'data/ticket_stats_list.dart';
import 'data/trade_summary_list.dart';
import 'data/upload_result.dart';
+import 'data/user_info_edit.dart';
part 'business_api.g.dart';
@@ -244,7 +250,7 @@ abstract class BusinessApiService {
@Path("pageIndex") String pageIndex,
@Path("pageSize") String pageSize);
- ///删除分组分类
+ ///编辑门店信息
@PUT("store")
Future saveStoreInfo(@Body() Map param);
@@ -306,4 +312,45 @@ abstract class BusinessApiService {
///订单列表获取用户金额详情
@GET("order/getOrderUserDetail?orderId={orderId}")
Future> getOrderUserDetail(@Path("orderId") String storeId);
+
+ ///根据手机号查询会员信息
+ @POST("member/queryMemberInfo")
+ Future> queryMemberInfo(@Body() Map param);
+
+ ///会员充值列表
+ @POST("rechargePreferential/get")
+ Future> getRechargePreferential(@Body() Map param);
+
+ ///会员充值支付
+ @POST("member/posMemberRecharge")
+ Future posMemberRecharge(@Body() Map param);
+
+ ///充值订单查询
+ @POST("member/manualQuery")
+ Future manualQuery(@Body() Map param);
+
+ ///新增会员
+ @GET("member/createMemberSourceByMobile?mobile={mobile}&nickName={nickName}")
+ Future> createMemberSourceByMobile(@Path("mobile") String mobile,@Path("nickName") String nickName);
+
+ ///店员列表
+ @POST("user/userPage")
+ Future> clerkList(@Body() Map param);
+
+ ///添加新店员,店员信息编辑
+ @POST("user")
+ Future> userEdit(@Body() Map param);
+
+ ///删除会员
+ @DELETE("user?ids[]={ids}")
+ Future delUser(@Path("ids") String ids);
+
+ ///修改用户信息
+ @PUT("user")
+ Future> userModify(@Body() Map param);
+
+ ///会员余额统计/消费排名
+ @POST("dashBoard/storeMoney")
+ Future> storeMoney(@Body() Map param);
+
}
diff --git a/lib/retrofit/business_api.g.dart b/lib/retrofit/business_api.g.dart
index c4f22f15..124e27a4 100644
--- a/lib/retrofit/business_api.g.dart
+++ b/lib/retrofit/business_api.g.dart
@@ -851,4 +851,229 @@ class _BusinessApiService implements BusinessApiService {
return value;
}
+ @override
+ Future> queryMemberInfo(param) async {
+ ArgumentError.checkNotNull(param, 'param');
+ const _extra = {};
+ final queryParameters = {};
+ final _data = {};
+ _data.addAll(param ?? {});
+ final _result = await _dio.request