Commit 7704131fab88f6d19e2a07ae26a54b603fe93850

Authored by weixin_45529955
1 parent 83c692e1

设置消费金 OK

import 'package:flutter/material.dart';
class LadderReturnMoneyModel {
/*
{
"price": "100",
"coupons": [
{
"id": "997",
"name": "免费券15"
}
]
}
*/
String? givePrice;
TextEditingController givePriceC = TextEditingController();
String? backPrice;
TextEditingController backPriceC = TextEditingController();
LadderReturnMoneyModel({
this.givePrice,
this.backPrice,
});
LadderReturnMoneyModel.fromJson(Map<String, dynamic> json) {
givePrice = json['give_price']?.toString();
givePriceC.text = givePrice ?? '';
givePrice = json['back_price']?.toString();
givePriceC.text = givePrice ?? '';
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['give_price'] = givePrice;
data['back_price'] = backPrice;
return data;
}
}
... ...
... ... @@ -640,4 +640,10 @@ class HttpUrl {
static const get_seller_role_list =
"?service=App.Seller.GetSellerRoleList"; // 获取商家角色列表
static const set_consume_config =
"?service=App.Activity.SetConsumeConfig"; // 设置商家消费金规则
static const get_consume_config =
"?service=App.Activity.GetConsumeConfig"; // 获取商家消费金规则
}
... ...
... ... @@ -71,12 +71,16 @@ class _FinanceManageHomePageState extends State<FinanceManageHomePage> {
// NavigatorUtil.goEnterpriseInformationUploadPage(context);
// }),
// _item('微信商户账户开通结果查询', () {}),
_item('门店收款码', () {
NavigatorUtil.goPaymentCodePage(context);
}),
_item('支付返券', () {
NavigatorUtil.goPaymentGiftPage(context);
}),
_item('门店收款码', () {
NavigatorUtil.goPaymentCodePage(context);
_item('支付返消费金', () {
NavigatorUtil.goReturnMoneyPage(context);
}),
_item('交易记录', () {
NavigatorUtil.goTransactionRecordHomePage(context);
}),
... ...
import 'dart:convert';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:flutter_picker_plus/picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/ladder_return_money_model.dart';
import 'package:one_key/provider/finance_provider.dart';
import 'package:one_key/provider/user_model.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/utils/utils.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';
import 'package:provider/provider.dart';
/**
* 支付返消费金配置页
*/
class ReturnMoneyPage extends StatefulWidget {
const ReturnMoneyPage({super.key});
@override
State<ReturnMoneyPage> createState() => _ReturnMoneyPageState();
}
class _ReturnMoneyPageState extends State<ReturnMoneyPage> {
String fromDateFull = '选择日期';
String endDateFull = '选择日期';
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
FinanceProvider? financeProvider;
ScrollController controller = ScrollController();
bool isBack = false;
bool isRatio = true; //是否按照比例返还 true按照比例/false按照阶梯返还
TextEditingController ratioC = TextEditingController(); //比例输入框
FocusNode ratioNode = FocusNode(); //比例输入框
//消费金支付占实际消费金额比例
TextEditingController proportionC = TextEditingController(); //消费金支付占实际消费金额比例
FocusNode proportionNode = FocusNode(); //消费金支付占实际消费金额比例
List<LadderReturnMoneyModel> ladderSelectFree = [];
bool isCoexist = false; //消费金可与优惠券同时使用
@override
void initState() {
super.initState();
LadderReturnMoneyModel ladderReturnMoneyModel = LadderReturnMoneyModel();
ladderSelectFree.add(ladderReturnMoneyModel);
WidgetsBinding.instance.addPostFrameCallback((_) {});
}
//提交接口
_setConsumeConfig() async {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
Map<String, String?> fullReductionData = {};
if (isBack) {
if (fromDateFull == '选择日期') {
Utils.showToast('请选择活动的开始时间!');
return;
}
if (endDateFull == '选择日期') {
Utils.showToast('请选择活动的结束时间!');
return;
}
if (isRatio) {
//按照比例返还
//需要填写比例百分比
if (ratioC.text.trim().length == 0) {
Utils.showToast('请输入返还消费金占实际支付金额的百分比!');
return;
}
fullReductionData['is_ratio'] = '1';
fullReductionData['ratio_data'] = ratioC.text;
} else {
//按阶梯返还
//没有数据时,提示新增阶梯设置数据
if (ladderSelectFree.length == 0) {
Utils.showToast('请点击增加阶梯设置数据!');
return;
}
//判断阶梯里面的数据 实际支付金额是否输入
bool canPrice =
ladderSelectFree.any((e) => e.givePriceC.text.trim().length == 0);
if (canPrice) {
int index = ladderSelectFree
.indexWhere((e) => e.givePriceC.text.trim().length == 0);
Utils.showToast('请输入阶梯(${index + 1})的实际支付金额!');
return;
}
//判断返回消费金额是否输入
bool can =
ladderSelectFree.any((e) => e.backPriceC.text.trim().length == 0);
if (can) {
int index = ladderSelectFree
.indexWhere((e) => e.backPriceC.text.trim().length == 0);
Utils.showToast('请输入阶梯(${index + 1})的返还消费金额!');
return;
}
fullReductionData['is_ratio'] = '0'; //按阶梯
List<Map<String, String>> ladderData = [];
ladderSelectFree.forEach((e) {
Map<String, String> price = {
'give_price': e.givePriceC.text,
'back_price': e.backPriceC.text,
};
ladderData.add(price);
});
fullReductionData['ladder_data'] =
(ladderData.length == 0 ? null : jsonEncode(ladderData));
}
//设置数据
if (fromDateFull != '选择日期') {
String fromfull = fromDateFull + ' 00:00:00';
String sfull =
'${(DateUtil.getDateMsByTimeStr(fromfull)! / 1000).floor()}';
fullReductionData['stime'] = sfull;
}
if (endDateFull != '选择日期') {
String endfull = endDateFull + ' 23:59:59';
String efull =
'${(DateUtil.getDateMsByTimeStr(endfull)! / 1000).floor()}';
fullReductionData['etime'] = efull;
}
}
if (proportionC.text.trim().length == 0) {
Utils.showToast('请输入消费金支付占实际消费金额的百分比!');
return;
}
Map<String, String?> togetherJson = {};
togetherJson['is_coexist'] = isCoexist ? '1' : '0';
togetherJson['ratio_data'] = proportionC.text;
Map<String, String?> pramas = {
'sellerid':
Provider.of<UserModel>(context, listen: false).user!.sellerid!,
'is_return': isBack ? '1' : '0',
'return_json':
fullReductionData.length == 0 ? null : jsonEncode(fullReductionData),
'is_together': isCoexist ? '1' : '0',
'together_json':
togetherJson.length == 0 ? null : jsonEncode(togetherJson),
};
bool success = await financeProvider!.setConsumeConfig(context, pramas);
if (success) {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
}
}
///是否立即启用
Widget _canUse(
String title,
bool swich,
GestureTapCallback onTap,
) {
return InkWell(
onTap: onTap,
child: Container(
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
margin: EdgeInsets.only(left: ScreenUtil().setWidth(32)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
title,
style: TextStyle(
color: MyColours.color_515151, fontSize: font(16)),
),
),
Spacer(),
Image.asset(
swich
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(44 * 2),
),
HEmptyView(32)
],
),
),
);
}
//阶梯返还金额widget
Widget _ladderPriceWidget(
TextEditingController controllerGive,
FocusNode focusNodeGive,
TextEditingController controllerBack,
FocusNode focusNodeBack,
{num width = 40}) {
return Container(
height: w(40),
margin: EdgeInsets.only(left: w(width)),
padding: EdgeInsets.only(top: w(8), bottom: w(8)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
child: Row(
children: [
Text(
'实际支付',
style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
),
HEmptyView(10),
Container(
width: w(54),
height: w(26),
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(color: MyColours.color_999999, width: w(1))),
child: TextField(
controller: controllerGive,
textAlign: TextAlign.center,
textAlignVertical: TextAlignVertical.center,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp("[0-9.]")),
], // 限制输入为数字,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(20),
),
focusNode: focusNodeGive,
decoration: InputDecoration(
isCollapsed: true,
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: '请输入数字',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.numberWithOptions()),
),
HEmptyView(10),
Text(
'元,返还消费金',
style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
),
HEmptyView(10),
Container(
width: w(54),
height: w(26),
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(color: MyColours.color_999999, width: w(1))),
child: TextField(
controller: controllerBack,
textAlign: TextAlign.center,
textAlignVertical: TextAlignVertical.center,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp("[0-9.]")),
], // 限制输入为数字,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(20),
),
focusNode: focusNodeBack,
decoration: InputDecoration(
isCollapsed: true,
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: '请输入数字',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.numberWithOptions()),
),
HEmptyView(10),
Text(
'元',
style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
),
],
),
);
}
Widget _priceWidget(
String title, TextEditingController controller, FocusNode focusNode,
{num width = 40}) {
return Container(
height: w(40),
margin: EdgeInsets.only(left: w(width)),
padding: EdgeInsets.only(top: w(8), bottom: w(8), right: w(16)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
child: Row(
children: [
Text(
title,
style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
),
HEmptyView(10),
Container(
width: w(70),
height: w(26),
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(color: MyColours.color_999999, width: w(1))),
child: TextField(
controller: controller,
textAlign: TextAlign.center,
textAlignVertical: TextAlignVertical.center,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp("[0-9.]")),
], // 限制输入为数字,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(20),
),
focusNode: focusNode,
decoration: InputDecoration(
isCollapsed: true,
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: '请输入数字',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.numberWithOptions()),
),
HEmptyView(10),
Text(
'%',
style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
),
],
),
);
}
///时间选择
Widget _select(String title, String hintText, GestureTapCallback onTap) {
return InkWell(
onTap: onTap,
child: Container(
height: w(40),
margin: EdgeInsets.only(left: w(40)),
padding: EdgeInsets.only(
top: w(8),
bottom: w(8),
),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28)),
),
),
HEmptyView(20),
Spacer(),
Text(hintText,
style: TextStyle(
color: hintText == '选择日期'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24),
)),
HEmptyView(20),
Image.asset(
Utils.getImgPath('arrow_right_new'),
width: ScreenUtil().setWidth(16),
),
HEmptyView(32),
],
),
),
);
}
///发放阶梯
Widget _ladderWidget() {
return ListView.builder(
controller: controller,
shrinkWrap: true,
itemCount: ladderSelectFree.length,
itemBuilder: (context, index) {
LadderReturnMoneyModel data = ladderSelectFree[index];
return Container(
padding: EdgeInsets.only(
left: w(40), top: w(8), bottom: w(8), right: w(16)),
child: Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'阶梯(${index + 1})',
style: TextStyle(
color: MyColours.color_515151, fontSize: font(14)),
),
InkWell(
onTap: () {
//删除媒体
ladderSelectFree.remove(data);
setState(() {});
},
child: Padding(
padding: EdgeInsets.only(top: w(8), bottom: w(8)),
child: Text(
'删除',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: font(12)),
),
))
],
),
),
_ladderPriceWidget(
data.givePriceC, FocusNode(), data.backPriceC, FocusNode(),
width: 0),
],
),
);
});
}
_radioWidget(String title, bool select, {GestureTapCallback? onTap}) {
return InkWell(
onTap: onTap,
child: Container(
height: w(40),
margin: EdgeInsets.only(left: w(40)),
padding: EdgeInsets.only(
top: w(8),
bottom: w(8),
),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
Utils.getImgPath(select ? 'radio_back' : 'radio_back_un'),
width: ScreenUtil().setWidth(18),
),
HEmptyView(4),
Container(
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28)),
),
),
],
),
),
);
}
@override
Widget build(BuildContext context) {
financeProvider = Provider.of<FinanceProvider>(context, listen: true);
return KeyboardDismissOnTap(
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('支付返券'),
key: scaffoldKey,
body: Column(children: [
Expanded(
child: SingleChildScrollView(
controller: controller,
child: Column(children: [
_canUse('顾客支付后返消费金', isBack, () {
setState(() {
isBack = !isBack;
});
}),
_select('活动开始于', fromDateFull, () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
//弹出时间选择器
// showPickerDateTime(context);
// showDateSelWidget = true;
DialogUtil.showPickerDateTime24(
context,
scaffoldKey,
(value) {
// {'text': picker.adapter.text, 'select': selecteds}
if (value != null) {
if (endDateFull != '选择日期') {
if (DateUtil.getDateTime(endDateFull)
.compareTo(DateUtil.getDateTime(
DateUtil.formatDateStr(value,
format:
DateFormats.y_mo_d))) <
0) {
Utils.showToast('满减返券的活动开始时间不能迟于活动结束时间');
return;
}
}
setState(() {
print(value);
fromDateFull = DateUtil.formatDateStr(value,
format: DateFormats.y_mo_d);
});
}
// showDateSelWidget = false;
},
minValue: DateTime(1987, 1, 1),
dateTime: fromDateFull == '选择日期'
? null
: DateUtil.getDateTime(fromDateFull),
pickerDateTimeType: PickerDateTimeType.kYMD,
onCancel: () {
// showDateSelWidget = false;
});
}),
_select('活动结束于', endDateFull, () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
//弹出时间选择器
// showPickerDateTime(context);
// showDateSelWidget = true;
DialogUtil.showPickerDateTime24(
context,
scaffoldKey,
(value) {
// {'text': picker.adapter.text, 'select': selecteds}
if (value != null) {
if (fromDateFull != '选择日期') {
if (DateUtil.getDateTime(
DateUtil.formatDateStr(value,
format: DateFormats.y_mo_d))
.compareTo(DateUtil.getDateTime(
fromDateFull)) <
0) {
Utils.showToast('满减返券的活动结束时间不能早于活动开始时间');
return;
}
}
setState(() {
print(value);
endDateFull = DateUtil.formatDateStr(value,
format: DateFormats.y_mo_d);
});
}
// showDateSelWidget = false;
},
minValue: DateTime(1987, 1, 1),
dateTime: endDateFull == '选择日期'
? null
: DateUtil.getDateTime(endDateFull),
pickerDateTimeType: PickerDateTimeType.kYMD,
onCancel: () {
// showDateSelWidget = false;
});
}),
_radioWidget('按比例返还', isRatio, onTap: () {
if (!isRatio) {
setState(() {
isRatio = !isRatio;
});
}
}),
if (isRatio)
_priceWidget('返还消费金占实际支付金额', ratioC, ratioNode,
width: 60),
_radioWidget('按阶梯返还', !isRatio, onTap: () {
if (isRatio) {
setState(() {
isRatio = !isRatio;
});
}
}),
if (!isRatio) _ladderWidget(),
if (!isRatio)
InkWell(
onTap: () {
LadderReturnMoneyModel data =
LadderReturnMoneyModel();
ladderSelectFree.add(data);
setState(() {});
},
child: Container(
// height: w(30),
margin: EdgeInsets.only(
left: w(60), top: w(8), right: w(16)),
padding: EdgeInsets.symmetric(vertical: w(8)),
alignment: Alignment.centerRight,
decoration: BoxDecoration(
// color: Colors.red,
border: Border(
bottom: BorderSide(
width: w(0.5),
color: MyColours.color_E7E7E7))),
child: Text(
'+增加阶梯',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: font(12)),
),
)),
VEmptyView(24),
Container(
height: w(48),
// padding: EdgeInsets.symmetric(
// vertical: ScreenUtil().setWidth(24)),
margin: EdgeInsets.only(
left: ScreenUtil().setWidth(32)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: MyColours.color_E7E7E7,
width: w(0.5)))),
child: Container(
alignment: Alignment.centerLeft,
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
'消费金支付规则',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16)),
),
)),
InkWell(
onTap: () {
//消费金可与优惠券同时使用
setState(() {
isCoexist = !isCoexist;
});
},
child: Container(
height: w(40),
padding: EdgeInsets.only(right: w(16)),
margin: EdgeInsets.only(left: w(40)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: MyColours.color_E7E7E7,
width: w(0.5)))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
'消费金可与优惠券同时使用',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)),
),
),
Spacer(),
Image.asset(
isCoexist
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(44 * 2),
),
],
),
),
),
_priceWidget(
'消费金支付占实际消费金额', proportionC, proportionNode,
width: 40),
]))),
Container(
padding: EdgeInsets.only(
top: w(13), left: w(45), right: w(45), bottom: w(26)),
child: RoundButton(
text: '立即提交',
height: w(43),
radius: r(5),
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_ffffff,
isBold: true,
fontSize: 32,
onPressed: () {
// 调用接口
_setConsumeConfig();
},
),
)
])));
}
}
... ...
... ... @@ -227,6 +227,41 @@ class FinanceProvider extends ChangeNotifier {
}
}
// 设置商家消费金规则
Future<bool> setConsumeConfig(
BuildContext context, Map<String, String?> params,
{bool showLoading = true, bool needToast = true}) async {
try {
BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(
context, Method.post, HttpUrl.set_consume_config,
data: params, showLoading: showLoading);
if (baseResp.code == Constant.status_success) {
if (baseResp.data == 0 || baseResp.data == 1) {
if (needToast) {
Utils.showToast('设置成功');
}
return true;
} else {
if (needToast) {
Utils.showToast('设置失败,请重试');
}
}
} else {
if (needToast) {
Utils.showToast(baseResp.msg ?? '设置失败,请重试');
}
}
return false;
} catch (error) {
print(error.toString());
if (needToast) {
Utils.showToast('设置失败,请重试');
}
return false;
}
}
///获取商家券赠送规则配置 还没做--------待使用----------
Future getActivityConfig(BuildContext context, Map<String, String?> params,
{isShowLoading = true}) async {
... ...
... ... @@ -2433,6 +2433,15 @@ class NavigatorUtil {
replace: replace);
}
///支付返消费金
static Future<dynamic> goReturnMoneyPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.return_money_page}",
replace: replace);
}
///支付返券------优惠券选择
static Future<dynamic> goPaymentGiftSelectPage(
BuildContext context, String type, Map object, String from, String end,
... ...
... ... @@ -231,6 +231,7 @@ import '../pages/my/finance_manage/finance_manage_home_page.dart';
import '../pages/my/finance_manage/payment_code_page.dart';
import '../pages/my/finance_manage/payment_gift_page.dart';
import '../pages/my/finance_manage/payment_gift_select_page.dart';
import '../pages/my/finance_manage/return_money_page.dart';
import '../pages/my/finance_manage/transaction_record_detail_page.dart';
import '../pages/my/finance_manage/scan_record_page.dart';
import '../pages/my/finance_manage/transaction_record_search_page.dart';
... ... @@ -4307,6 +4308,13 @@ var paymentGiftPageHandle = new Handler(
create: (_) => FinanceProvider(), child: PaymentGiftPage());
});
///支付返消费金
var returnMoneyPageHandle = new Handler(
handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
return ChangeNotifierProvider<FinanceProvider>(
create: (_) => FinanceProvider(), child: ReturnMoneyPage());
});
// /选择优惠券
// var paymentGiftSelectPageHandle = new Handler(
// handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
... ...
... ... @@ -429,12 +429,9 @@ class Routes {
static String set_birthday_page = "/set_birthday_page"; //客户生日
static String table_home = "/table_home"; // 桌位设置
static String table_home = "/table_home"; // 桌位设置
static String return_money_page = "/return_money_page"; // 支付返消费金
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -817,12 +814,10 @@ class Routes {
router.define(vip_record_detail_page, handler: vipRecordDetailPageHandle);
router.define(set_birthday_page, handler: setBirthdayPageHandle);
router.define(set_birthday_page, handler: setBirthdayPageHandle);
router.define(table_home, handler: tableHomeHandle);
router.define(table_home, handler: tableHomeHandle);
router.define(return_money_page, handler: returnMoneyPageHandle);
}
}
... ...