Commit 14cbbf98441fb3d5528f27240047760a40cbb4ff

Authored by weixin_45529955
1 parent 97a514b1

积分明细UI

... ... @@ -748,21 +748,25 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))))));
data.add(Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10),
vertical: ScreenUtil().setWidth(4),
),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10),
),
),
child: Text('积分900',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20)))));
data.add(InkWell(
onTap: () {
NavigatorUtil.goIntegralDetailsPage(context);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10),
vertical: ScreenUtil().setWidth(4),
),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10),
),
),
child: Text('积分900',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))))));
return data;
}
... ...
import 'package:flutter/material.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
/**
* 积分明细页面
*/
class IntegralDetailsPage extends StatefulWidget {
const IntegralDetailsPage({super.key});
@override
State<IntegralDetailsPage> createState() => _IntegralDetailsPageState();
}
class _IntegralDetailsPageState extends State<IntegralDetailsPage> {
ScrollController controller = ScrollController();
Widget _item() {
return Container(
padding: EdgeInsets.only(left: w(20), right: w(20), top: w(10)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(width: w(0.5), color: MyColours.color_CBCBCB))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(
'获取/消耗',
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(14),
),
),
Text(
'+300',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: font(14),
fontWeight: FontWeight.bold),
)
]),
VEmptyView(28),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(
'2025-08-31 15:43:23',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14),
),
),
Text(
'变动后积分 220',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14),
),
)
]),
VEmptyView(16),
Text(
'备注:顾客已付现金',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14),
),
),
VEmptyView(8),
],
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('积分明细'),
body: Column(children: [
Expanded(
child: SingleChildScrollView(
controller: controller,
child: Stack(
children: <Widget>[
ListView.builder(
padding: EdgeInsets.only(top: w(50)),
controller: controller,
shrinkWrap: true,
itemCount: 20,
itemBuilder: (BuildContext context, int index) {
return _item();
},
),
Positioned(
top: 0, // 你可以根据需要调整位置
left: 0, // 你可以根据需要调整位置
right: 0, // 你可以根据需要调整位置
child: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(0.5),
color: MyColours.color_CBCBCB))),
margin: EdgeInsets.only(bottom: w(10)),
padding: EdgeInsets.symmetric(
horizontal: w(20),
vertical: w(10)), // 根据需要调整内边距
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'积分',
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(16),
fontWeight: FontWeight.bold),
),
Text(
'30',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: font(20),
fontWeight: FontWeight.bold),
)
],
)),
),
],
))),
Container(
padding: EdgeInsets.symmetric(horizontal: w(20), vertical: w(19)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: '发放',
width: w(162),
height: w(43),
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
radius: r(5),
onPressed: () {
//
DialogUtil.showGiveIntegralDialog(context, '发放', (value) {});
},
),
HEmptyView(20),
Expanded(
child: RoundButton(
text: '扣除',
height: w(43),
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
radius: r(5),
onPressed: () {
//
DialogUtil.showDeductMoneyDialog(
context, '扣除积分', '扣除数量', (value) {});
},
))
],
),
)
]));
}
}
... ...
... ... @@ -2627,8 +2627,7 @@ class NavigatorUtil {
replace: replace);
}
//余额明细页面
//余额明细页面
static Future<dynamic> goBalanceDetailsPage(
BuildContext context, {
replace = false,
... ... @@ -2637,12 +2636,7 @@ class NavigatorUtil {
replace: replace);
}
//消费金明细页面
//消费金明细页面
static Future<dynamic> goConsumerDetailsPage(
BuildContext context, {
replace = false,
... ... @@ -2651,4 +2645,12 @@ class NavigatorUtil {
replace: replace);
}
//积分明细页面
static Future<dynamic> goIntegralDetailsPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.integral_details_page}",
replace: replace);
}
}
... ...
... ... @@ -84,6 +84,7 @@ import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_
import 'package:one_key/pages/my/customer_type/my_customer/my_show_customer_list_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/balance_details_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/consumer_details_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/integral_details_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/set_birthday_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/show_customer_list_page.dart';
... ... @@ -4540,6 +4541,12 @@ var consumerDetailsPageHandle = new Handler(
create: (_) => CustomerProvider(), child: ConsumerDetailsPage());
});
var integralDetailsPageHandle = new Handler(
handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: IntegralDetailsPage());
});
var customLabelPageHandle = new Handler(
handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
return ChangeNotifierProvider<CustomerProvider>(
... ...
... ... @@ -471,13 +471,9 @@ class Routes {
static String balance_details_page = "/balance_details_page"; // 余额明细页面
static String consumer_details_page = "/consumer_details_page"; // 消费金明细页面
static String consumer_details_page = "/consumer_details_page"; // 消费金明细页面
static String integral_details_page = "/integral_details_page"; // 积分明细页面
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -903,16 +899,10 @@ class Routes {
router.define(customer_statistics_page,
handler: customerStatisticsPageHandle);
router.define(balance_details_page, handler: balanceDetailsPageHandle);
router.define(balance_details_page,
handler: balanceDetailsPageHandle);
router.define(consumer_details_page,
handler: consumerDetailsPageHandle);
router.define(consumer_details_page, handler: consumerDetailsPageHandle);
router.define(integral_details_page, handler: integralDetailsPageHandle);
}
}
... ...
... ... @@ -1702,7 +1702,8 @@ class DialogUtil {
}
//余额充值确认弹框
static showRechargeConfirmDialog(BuildContext context, String title,
static showRechargeConfirmDialog(
BuildContext context, String title, String subTitle,
{GestureTapCallback? onTapLeft, GestureTapCallback? onTapRight}) {
return showDialog(
context: context,
... ... @@ -1746,7 +1747,8 @@ class DialogUtil {
VEmptyView(28),
Container(
alignment: Alignment.center,
child: Text('为客户赵先生 ${title}1000元',
child: Text(
'为客户赵先生 ${title}${subTitle}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
... ... @@ -2061,7 +2063,7 @@ class DialogUtil {
Navigator.pop(context);
}
showRechargeConfirmDialog(
context, '充值金额');
context, '充值金额', '1000元');
})),
],
),
... ... @@ -2108,7 +2110,104 @@ class DialogUtil {
color: MyColours.color_515151,
fontSize: font(16)))),
VEmptyView(30),
rechargeItem(context, subTitle, '元'),
rechargeItem(context, subTitle,
title == '扣除积分' ? "个" : '元'),
// VEmptyView(30),
rechargeWidget('备注', '请输入备注',
TextEditingController(), FocusNode()),
])),
MyDivider(double.infinity, w(1),
color: MyColours.color_DBDBDB),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 1,
child: RoundButton(
text: '取消',
// width: (ScreenUtil().screenWidth -
// ScreenUtil().setWidth(62) * 2) /
// 2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_515151,
isBold: false,
fontSize: 32,
onPressed: () {
Navigator.pop(context);
})),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_DBDBDB),
Expanded(
flex: 1,
child: RoundButton(
text: '确定',
// width: (ScreenUtil().screenWidth -
// ScreenUtil().setWidth(62) * 2) /
// 2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
isBold: true,
fontSize: 32,
onPressed: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
showRechargeConfirmDialog(
context, '扣除积分', '1000个');
})),
],
),
])));
}));
});
}
//发放积分弹框
static showGiveIntegralDialog(
BuildContext context, String title, CustomCallBack callback,
{GestureTapCallback? onTapLeft, GestureTapCallback? onTapRight}) {
return showDialog(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return Center(child: StatefulBuilder(builder: (context, state) {
// locationState = state;
return Material(
color: Colors.transparent,
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: w(37)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.circular(
r(8),
)),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(40),
Container(
alignment: Alignment.center,
child: Text('发放积分',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: font(16)))),
VEmptyView(30),
rechargeItem(context, '发放数量', '个'),
// VEmptyView(30),
rechargeWidget('备注', '请输入备注',
TextEditingController(), FocusNode()),
... ... @@ -2157,7 +2256,7 @@ class DialogUtil {
Navigator.pop(context);
}
showRechargeConfirmDialog(
context, '扣除消费金');
context, '发放积分', '50个');
})),
],
),
... ... @@ -2253,7 +2352,7 @@ class DialogUtil {
Navigator.pop(context);
}
showRechargeConfirmDialog(
context, '发放消费金');
context, '发放消费金', '1000元');
})),
],
),
... ...