Commit 14cbbf98441fb3d5528f27240047760a40cbb4ff

Authored by weixin_45529955
1 parent 97a514b1

积分明细UI

@@ -748,21 +748,25 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -748,21 +748,25 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
748 color: MyColours.color_ffffff, 748 color: MyColours.color_ffffff,
749 fontSize: ScreenUtil().setSp(20)))))); 749 fontSize: ScreenUtil().setSp(20))))));
750 750
751 - data.add(Container(  
752 - padding: EdgeInsets.symmetric(  
753 - horizontal: ScreenUtil().setWidth(10),  
754 - vertical: ScreenUtil().setWidth(4),  
755 - ),  
756 - decoration: BoxDecoration(  
757 - color: MyColours.color_438E93,  
758 - borderRadius: BorderRadius.circular(  
759 - ScreenUtil().setWidth(10),  
760 - ),  
761 - ),  
762 - child: Text('积分900',  
763 - style: TextStyle(  
764 - color: MyColours.color_ffffff,  
765 - fontSize: ScreenUtil().setSp(20))))); 751 + data.add(InkWell(
  752 + onTap: () {
  753 + NavigatorUtil.goIntegralDetailsPage(context);
  754 + },
  755 + child: Container(
  756 + padding: EdgeInsets.symmetric(
  757 + horizontal: ScreenUtil().setWidth(10),
  758 + vertical: ScreenUtil().setWidth(4),
  759 + ),
  760 + decoration: BoxDecoration(
  761 + color: MyColours.color_438E93,
  762 + borderRadius: BorderRadius.circular(
  763 + ScreenUtil().setWidth(10),
  764 + ),
  765 + ),
  766 + child: Text('积分900',
  767 + style: TextStyle(
  768 + color: MyColours.color_ffffff,
  769 + fontSize: ScreenUtil().setSp(20))))));
766 770
767 return data; 771 return data;
768 } 772 }
  1 +import 'package:flutter/material.dart';
  2 +import 'package:one_key/res/colors.dart';
  3 +import 'package:one_key/utils/dialog_util.dart';
  4 +import 'package:one_key/utils/screen_util.dart';
  5 +import 'package:one_key/widgets/h_empty_view.dart';
  6 +import 'package:one_key/widgets/round_button.dart';
  7 +import 'package:one_key/widgets/system_app_bar.dart';
  8 +import 'package:one_key/widgets/v_empty_view.dart';
  9 +
  10 +/**
  11 + * 积分明细页面
  12 + */
  13 +
  14 +class IntegralDetailsPage extends StatefulWidget {
  15 + const IntegralDetailsPage({super.key});
  16 +
  17 + @override
  18 + State<IntegralDetailsPage> createState() => _IntegralDetailsPageState();
  19 +}
  20 +
  21 +class _IntegralDetailsPageState extends State<IntegralDetailsPage> {
  22 + ScrollController controller = ScrollController();
  23 +
  24 + Widget _item() {
  25 + return Container(
  26 + padding: EdgeInsets.only(left: w(20), right: w(20), top: w(10)),
  27 + decoration: BoxDecoration(
  28 + border: Border(
  29 + bottom:
  30 + BorderSide(width: w(0.5), color: MyColours.color_CBCBCB))),
  31 + child: Column(
  32 + crossAxisAlignment: CrossAxisAlignment.start,
  33 + children: [
  34 + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
  35 + Text(
  36 + '获取/消耗',
  37 + style: TextStyle(
  38 + color: MyColours.color_000000,
  39 + fontSize: font(14),
  40 + ),
  41 + ),
  42 + Text(
  43 + '+300',
  44 + style: TextStyle(
  45 + color: MyColours.color_438E93,
  46 + fontSize: font(14),
  47 + fontWeight: FontWeight.bold),
  48 + )
  49 + ]),
  50 + VEmptyView(28),
  51 + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
  52 + Text(
  53 + '2025-08-31 15:43:23',
  54 + style: TextStyle(
  55 + color: MyColours.color_999999,
  56 + fontSize: font(14),
  57 + ),
  58 + ),
  59 + Text(
  60 + '变动后积分 220',
  61 + style: TextStyle(
  62 + color: MyColours.color_999999,
  63 + fontSize: font(14),
  64 + ),
  65 + )
  66 + ]),
  67 + VEmptyView(16),
  68 + Text(
  69 + '备注:顾客已付现金',
  70 + style: TextStyle(
  71 + color: MyColours.color_999999,
  72 + fontSize: font(14),
  73 + ),
  74 + ),
  75 + VEmptyView(8),
  76 + ],
  77 + ),
  78 + );
  79 + }
  80 +
  81 + @override
  82 + Widget build(BuildContext context) {
  83 + return Scaffold(
  84 + backgroundColor: MyColours.color_ffffff,
  85 + appBar: SystemAppBar('积分明细'),
  86 + body: Column(children: [
  87 + Expanded(
  88 + child: SingleChildScrollView(
  89 + controller: controller,
  90 + child: Stack(
  91 + children: <Widget>[
  92 + ListView.builder(
  93 + padding: EdgeInsets.only(top: w(50)),
  94 + controller: controller,
  95 + shrinkWrap: true,
  96 + itemCount: 20,
  97 + itemBuilder: (BuildContext context, int index) {
  98 + return _item();
  99 + },
  100 + ),
  101 + Positioned(
  102 + top: 0, // 你可以根据需要调整位置
  103 + left: 0, // 你可以根据需要调整位置
  104 + right: 0, // 你可以根据需要调整位置
  105 + child: Container(
  106 + decoration: BoxDecoration(
  107 + border: Border(
  108 + bottom: BorderSide(
  109 + width: w(0.5),
  110 + color: MyColours.color_CBCBCB))),
  111 + margin: EdgeInsets.only(bottom: w(10)),
  112 + padding: EdgeInsets.symmetric(
  113 + horizontal: w(20),
  114 + vertical: w(10)), // 根据需要调整内边距
  115 +
  116 + child: Row(
  117 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  118 + children: [
  119 + Text(
  120 + '积分',
  121 + style: TextStyle(
  122 + color: MyColours.color_000000,
  123 + fontSize: font(16),
  124 + fontWeight: FontWeight.bold),
  125 + ),
  126 + Text(
  127 + '30',
  128 + style: TextStyle(
  129 + color: MyColours.color_438E93,
  130 + fontSize: font(20),
  131 + fontWeight: FontWeight.bold),
  132 + )
  133 + ],
  134 + )),
  135 + ),
  136 + ],
  137 + ))),
  138 + Container(
  139 + padding: EdgeInsets.symmetric(horizontal: w(20), vertical: w(19)),
  140 + child: Row(
  141 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  142 + children: [
  143 + RoundButton(
  144 + text: '发放',
  145 + width: w(162),
  146 + height: w(43),
  147 + gradientStart: MyColours.color_438E93,
  148 + gradientEnd: MyColours.color_438E93,
  149 + radius: r(5),
  150 + onPressed: () {
  151 + //
  152 +
  153 + DialogUtil.showGiveIntegralDialog(context, '发放', (value) {});
  154 + },
  155 + ),
  156 + HEmptyView(20),
  157 + Expanded(
  158 + child: RoundButton(
  159 + text: '扣除',
  160 + height: w(43),
  161 + gradientStart: MyColours.color_ffffff,
  162 + gradientEnd: MyColours.color_ffffff,
  163 + borderColor: MyColours.color_438E93,
  164 + textColor: MyColours.color_438E93,
  165 + radius: r(5),
  166 + onPressed: () {
  167 + //
  168 +
  169 + DialogUtil.showDeductMoneyDialog(
  170 + context, '扣除积分', '扣除数量', (value) {});
  171 + },
  172 + ))
  173 + ],
  174 + ),
  175 + )
  176 + ]));
  177 + }
  178 +}
@@ -2627,8 +2627,7 @@ class NavigatorUtil { @@ -2627,8 +2627,7 @@ class NavigatorUtil {
2627 replace: replace); 2627 replace: replace);
2628 } 2628 }
2629 2629
2630 -  
2631 - //余额明细页面 2630 + //余额明细页面
2632 static Future<dynamic> goBalanceDetailsPage( 2631 static Future<dynamic> goBalanceDetailsPage(
2633 BuildContext context, { 2632 BuildContext context, {
2634 replace = false, 2633 replace = false,
@@ -2637,12 +2636,7 @@ class NavigatorUtil { @@ -2637,12 +2636,7 @@ class NavigatorUtil {
2637 replace: replace); 2636 replace: replace);
2638 } 2637 }
2639 2638
2640 -  
2641 -  
2642 -  
2643 -  
2644 -  
2645 - //消费金明细页面 2639 + //消费金明细页面
2646 static Future<dynamic> goConsumerDetailsPage( 2640 static Future<dynamic> goConsumerDetailsPage(
2647 BuildContext context, { 2641 BuildContext context, {
2648 replace = false, 2642 replace = false,
@@ -2651,4 +2645,12 @@ class NavigatorUtil { @@ -2651,4 +2645,12 @@ class NavigatorUtil {
2651 replace: replace); 2645 replace: replace);
2652 } 2646 }
2653 2647
  2648 + //积分明细页面
  2649 + static Future<dynamic> goIntegralDetailsPage(
  2650 + BuildContext context, {
  2651 + replace = false,
  2652 + }) {
  2653 + return _navigateTo(context, "${Routes.integral_details_page}",
  2654 + replace: replace);
  2655 + }
2654 } 2656 }
@@ -84,6 +84,7 @@ import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_ @@ -84,6 +84,7 @@ import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_
84 import 'package:one_key/pages/my/customer_type/my_customer/my_show_customer_list_page.dart'; 84 import 'package:one_key/pages/my/customer_type/my_customer/my_show_customer_list_page.dart';
85 import 'package:one_key/pages/my/customer_type/store_customer/balance_details_page.dart'; 85 import 'package:one_key/pages/my/customer_type/store_customer/balance_details_page.dart';
86 import 'package:one_key/pages/my/customer_type/store_customer/consumer_details_page.dart'; 86 import 'package:one_key/pages/my/customer_type/store_customer/consumer_details_page.dart';
  87 +import 'package:one_key/pages/my/customer_type/store_customer/integral_details_page.dart';
87 import 'package:one_key/pages/my/customer_type/store_customer/set_birthday_page.dart'; 88 import 'package:one_key/pages/my/customer_type/store_customer/set_birthday_page.dart';
88 import 'package:one_key/pages/my/customer_type/store_customer/show_customer_list_page.dart'; 89 import 'package:one_key/pages/my/customer_type/store_customer/show_customer_list_page.dart';
89 90
@@ -4540,6 +4541,12 @@ var consumerDetailsPageHandle = new Handler( @@ -4540,6 +4541,12 @@ var consumerDetailsPageHandle = new Handler(
4540 create: (_) => CustomerProvider(), child: ConsumerDetailsPage()); 4541 create: (_) => CustomerProvider(), child: ConsumerDetailsPage());
4541 }); 4542 });
4542 4543
  4544 +var integralDetailsPageHandle = new Handler(
  4545 + handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
  4546 + return ChangeNotifierProvider<CustomerProvider>(
  4547 + create: (_) => CustomerProvider(), child: IntegralDetailsPage());
  4548 +});
  4549 +
4543 var customLabelPageHandle = new Handler( 4550 var customLabelPageHandle = new Handler(
4544 handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) { 4551 handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
4545 return ChangeNotifierProvider<CustomerProvider>( 4552 return ChangeNotifierProvider<CustomerProvider>(
@@ -471,13 +471,9 @@ class Routes { @@ -471,13 +471,9 @@ class Routes {
471 471
472 static String balance_details_page = "/balance_details_page"; // 余额明细页面 472 static String balance_details_page = "/balance_details_page"; // 余额明细页面
473 473
  474 + static String consumer_details_page = "/consumer_details_page"; // 消费金明细页面
474 475
475 -  
476 - static String consumer_details_page = "/consumer_details_page"; // 消费金明细页面  
477 -  
478 -  
479 -  
480 - 476 + static String integral_details_page = "/integral_details_page"; // 积分明细页面
481 477
482 static void configureRoutes(FluroRouter router) { 478 static void configureRoutes(FluroRouter router) {
483 router.notFoundHandler = new Handler( 479 router.notFoundHandler = new Handler(
@@ -903,16 +899,10 @@ class Routes { @@ -903,16 +899,10 @@ class Routes {
903 router.define(customer_statistics_page, 899 router.define(customer_statistics_page,
904 handler: customerStatisticsPageHandle); 900 handler: customerStatisticsPageHandle);
905 901
  902 + router.define(balance_details_page, handler: balanceDetailsPageHandle);
906 903
907 - router.define(balance_details_page,  
908 - handler: balanceDetailsPageHandle);  
909 -  
910 -  
911 -  
912 - router.define(consumer_details_page,  
913 - handler: consumerDetailsPageHandle);  
914 - 904 + router.define(consumer_details_page, handler: consumerDetailsPageHandle);
915 905
916 - 906 + router.define(integral_details_page, handler: integralDetailsPageHandle);
917 } 907 }
918 } 908 }
@@ -1702,7 +1702,8 @@ class DialogUtil { @@ -1702,7 +1702,8 @@ class DialogUtil {
1702 } 1702 }
1703 1703
1704 //余额充值确认弹框 1704 //余额充值确认弹框
1705 - static showRechargeConfirmDialog(BuildContext context, String title, 1705 + static showRechargeConfirmDialog(
  1706 + BuildContext context, String title, String subTitle,
1706 {GestureTapCallback? onTapLeft, GestureTapCallback? onTapRight}) { 1707 {GestureTapCallback? onTapLeft, GestureTapCallback? onTapRight}) {
1707 return showDialog( 1708 return showDialog(
1708 context: context, 1709 context: context,
@@ -1746,7 +1747,8 @@ class DialogUtil { @@ -1746,7 +1747,8 @@ class DialogUtil {
1746 VEmptyView(28), 1747 VEmptyView(28),
1747 Container( 1748 Container(
1748 alignment: Alignment.center, 1749 alignment: Alignment.center,
1749 - child: Text('为客户赵先生 ${title}1000元', 1750 + child: Text(
  1751 + '为客户赵先生 ${title}${subTitle}',
1750 style: TextStyle( 1752 style: TextStyle(
1751 fontWeight: FontWeight.bold, 1753 fontWeight: FontWeight.bold,
1752 color: MyColours.color_515151, 1754 color: MyColours.color_515151,
@@ -2061,7 +2063,7 @@ class DialogUtil { @@ -2061,7 +2063,7 @@ class DialogUtil {
2061 Navigator.pop(context); 2063 Navigator.pop(context);
2062 } 2064 }
2063 showRechargeConfirmDialog( 2065 showRechargeConfirmDialog(
2064 - context, '充值金额'); 2066 + context, '充值金额', '1000元');
2065 })), 2067 })),
2066 ], 2068 ],
2067 ), 2069 ),
@@ -2108,7 +2110,104 @@ class DialogUtil { @@ -2108,7 +2110,104 @@ class DialogUtil {
2108 color: MyColours.color_515151, 2110 color: MyColours.color_515151,
2109 fontSize: font(16)))), 2111 fontSize: font(16)))),
2110 VEmptyView(30), 2112 VEmptyView(30),
2111 - rechargeItem(context, subTitle, '元'), 2113 + rechargeItem(context, subTitle,
  2114 + title == '扣除积分' ? "个" : '元'),
  2115 + // VEmptyView(30),
  2116 + rechargeWidget('备注', '请输入备注',
  2117 + TextEditingController(), FocusNode()),
  2118 + ])),
  2119 + MyDivider(double.infinity, w(1),
  2120 + color: MyColours.color_DBDBDB),
  2121 + Row(
  2122 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2123 + children: [
  2124 + Expanded(
  2125 + flex: 1,
  2126 + child: RoundButton(
  2127 + text: '取消',
  2128 + // width: (ScreenUtil().screenWidth -
  2129 + // ScreenUtil().setWidth(62) * 2) /
  2130 + // 2,
  2131 + height: ScreenUtil().setWidth(112),
  2132 + // radius: ScreenUtil().setWidth(10),
  2133 + gradientStart: Colors.transparent,
  2134 + gradientEnd: Colors.transparent,
  2135 + textColor: MyColours.color_515151,
  2136 + isBold: false,
  2137 + fontSize: 32,
  2138 + onPressed: () {
  2139 + Navigator.pop(context);
  2140 + })),
  2141 + MyDivider(ScreenUtil().setWidth(2),
  2142 + ScreenUtil().setWidth(112),
  2143 + color: MyColours.color_DBDBDB),
  2144 + Expanded(
  2145 + flex: 1,
  2146 + child: RoundButton(
  2147 + text: '确定',
  2148 + // width: (ScreenUtil().screenWidth -
  2149 + // ScreenUtil().setWidth(62) * 2) /
  2150 + // 2,
  2151 + height: ScreenUtil().setWidth(112),
  2152 + // radius: ScreenUtil().setWidth(10),
  2153 + gradientStart: Colors.transparent,
  2154 + gradientEnd: Colors.transparent,
  2155 + textColor: MyColours.color_438E93,
  2156 + isBold: true,
  2157 + fontSize: 32,
  2158 + onPressed: () {
  2159 + if (Navigator.canPop(context)) {
  2160 + Navigator.pop(context);
  2161 + }
  2162 + showRechargeConfirmDialog(
  2163 + context, '扣除积分', '1000个');
  2164 + })),
  2165 + ],
  2166 + ),
  2167 + ])));
  2168 + }));
  2169 + });
  2170 + }
  2171 +
  2172 + //发放积分弹框
  2173 + static showGiveIntegralDialog(
  2174 + BuildContext context, String title, CustomCallBack callback,
  2175 + {GestureTapCallback? onTapLeft, GestureTapCallback? onTapRight}) {
  2176 + return showDialog(
  2177 + context: context,
  2178 + barrierDismissible: true,
  2179 + builder: (BuildContext context) {
  2180 + return Center(child: StatefulBuilder(builder: (context, state) {
  2181 + // locationState = state;
  2182 + return Material(
  2183 + color: Colors.transparent,
  2184 + child: Container(
  2185 + width: double.infinity,
  2186 + margin: EdgeInsets.symmetric(horizontal: w(37)),
  2187 + decoration: BoxDecoration(
  2188 + color: MyColours.color_ffffff,
  2189 + borderRadius: BorderRadius.circular(
  2190 + r(8),
  2191 + )),
  2192 + child: Column(
  2193 + mainAxisSize: MainAxisSize.min,
  2194 + crossAxisAlignment: CrossAxisAlignment.start,
  2195 + children: <Widget>[
  2196 + Padding(
  2197 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  2198 + child: Column(
  2199 + crossAxisAlignment: CrossAxisAlignment.start,
  2200 + children: [
  2201 + VEmptyView(40),
  2202 + Container(
  2203 + alignment: Alignment.center,
  2204 + child: Text('发放积分',
  2205 + style: TextStyle(
  2206 + fontWeight: FontWeight.bold,
  2207 + color: MyColours.color_515151,
  2208 + fontSize: font(16)))),
  2209 + VEmptyView(30),
  2210 + rechargeItem(context, '发放数量', '个'),
2112 // VEmptyView(30), 2211 // VEmptyView(30),
2113 rechargeWidget('备注', '请输入备注', 2212 rechargeWidget('备注', '请输入备注',
2114 TextEditingController(), FocusNode()), 2213 TextEditingController(), FocusNode()),
@@ -2157,7 +2256,7 @@ class DialogUtil { @@ -2157,7 +2256,7 @@ class DialogUtil {
2157 Navigator.pop(context); 2256 Navigator.pop(context);
2158 } 2257 }
2159 showRechargeConfirmDialog( 2258 showRechargeConfirmDialog(
2160 - context, '扣除消费金'); 2259 + context, '发放积分', '50个');
2161 })), 2260 })),
2162 ], 2261 ],
2163 ), 2262 ),
@@ -2253,7 +2352,7 @@ class DialogUtil { @@ -2253,7 +2352,7 @@ class DialogUtil {
2253 Navigator.pop(context); 2352 Navigator.pop(context);
2254 } 2353 }
2255 showRechargeConfirmDialog( 2354 showRechargeConfirmDialog(
2256 - context, '发放消费金'); 2355 + context, '发放消费金', '1000元');
2257 })), 2356 })),
2258 ], 2357 ],
2259 ), 2358 ),