|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_picker/Picker.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/models/coupon_model.dart';
|
|
|
|
import 'package:one_key/models/filter_btn_model.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/provider/marketing_center_provider.dart';
|
|
|
|
import 'package:one_key/route/navigator_util.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../../../constant/state.dart';
|
|
|
|
import '../../../../res/colors.dart';
|
|
|
|
import '../../../../utils/dialog_util.dart';
|
|
|
|
|
|
|
|
import '../../../../utils/screen_util.dart';
|
|
|
|
import '../../../../utils/utils.dart';
|
|
|
|
import '../../../../widgets/h_empty_view.dart';
|
|
|
|
import '../../../../widgets/round_button.dart';
|
|
|
|
import '../../../../widgets/page_exception.dart';
|
|
|
|
|
|
|
|
import '../../../../widgets/v_empty_view.dart';
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -22,124 +25,30 @@ import '../../../../widgets/v_empty_view.dart'; |
|
|
|
*/
|
|
|
|
|
|
|
|
class RechargeDetailPage extends StatefulWidget {
|
|
|
|
RechargeDetailPage({Key key}) : super(key: key);
|
|
|
|
final String idstr;
|
|
|
|
RechargeDetailPage({Key key, this.idstr}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_RechargeDetailPageState createState() => _RechargeDetailPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _RechargeDetailPageState extends State<RechargeDetailPage> {
|
|
|
|
TextEditingController nameC = TextEditingController();
|
|
|
|
TextEditingController priceminC = TextEditingController();
|
|
|
|
TextEditingController givePriceC = TextEditingController(); //赠送金额
|
|
|
|
TextEditingController giveScoreC = TextEditingController(); //积分
|
|
|
|
TextEditingController remarkC = TextEditingController(); //备注
|
|
|
|
|
|
|
|
FocusNode nameF = FocusNode();
|
|
|
|
FocusNode priceminF = FocusNode();
|
|
|
|
FocusNode givePricF = FocusNode();
|
|
|
|
FocusNode giveScoreF = FocusNode();
|
|
|
|
FocusNode remarkF = FocusNode();
|
|
|
|
bool fixdate = true;
|
|
|
|
bool weekly = false;
|
|
|
|
bool birthday = false;
|
|
|
|
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
|
|
|
|
bool showDateSelWidget = false;
|
|
|
|
String fromDate = '点击设置开始日期'; //有效期开始时间
|
|
|
|
String endDate = '点击设置结束日期'; //有效期结束时间
|
|
|
|
|
|
|
|
List<FilterBtnModel> weekData = [];
|
|
|
|
|
|
|
|
String weekShow = '点击设置可用日期';
|
|
|
|
bool canUse = false;
|
|
|
|
List<String> coupons = [];
|
|
|
|
|
|
|
|
List<String> selectIDs = [];
|
|
|
|
|
|
|
|
bool givePriceSwich = false;
|
|
|
|
bool giveScoreSwich = false;
|
|
|
|
bool giveCouponsSwich = false;
|
|
|
|
MarketingCenterProvider marketingCenterProvider;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
_initWeekData();
|
|
|
|
|
|
|
|
nameF.addListener(() {
|
|
|
|
if (nameF.hasFocus) {
|
|
|
|
//有焦点
|
|
|
|
if (showDateSelWidget) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
showDateSelWidget = false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//失去焦点
|
|
|
|
// _editingController.text = '';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
priceminF.addListener(() {
|
|
|
|
if (priceminF.hasFocus) {
|
|
|
|
//有焦点
|
|
|
|
if (showDateSelWidget) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
showDateSelWidget = false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//失去焦点
|
|
|
|
// _editingController.text = '';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
givePricF.addListener(() {
|
|
|
|
if (givePricF.hasFocus) {
|
|
|
|
//有焦点
|
|
|
|
if (showDateSelWidget) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
showDateSelWidget = false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//失去焦点
|
|
|
|
// _editingController.text = '';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
giveScoreF.addListener(() {
|
|
|
|
if (giveScoreF.hasFocus) {
|
|
|
|
//有焦点
|
|
|
|
if (showDateSelWidget) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
showDateSelWidget = false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//失去焦点
|
|
|
|
// _editingController.text = '';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
remarkF.addListener(() {
|
|
|
|
if (remarkF.hasFocus) {
|
|
|
|
//有焦点
|
|
|
|
if (showDateSelWidget) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
showDateSelWidget = false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//失去焦点
|
|
|
|
// _editingController.text = '';
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
if (widget.idstr != null && widget.idstr != 'null') {
|
|
|
|
_getNewRechargeDetail();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
_initWeekData() {
|
|
|
|
FilterBtnModel filterBtnModel = FilterBtnModel();
|
|
|
|
filterBtnModel.select = false;
|
|
|
|
filterBtnModel.title = '周日';
|
|
|
|
weekData.add(filterBtnModel);
|
|
|
|
for (int i = 1; i < 7; i++) {
|
|
|
|
FilterBtnModel filterBtnModel = FilterBtnModel();
|
|
|
|
filterBtnModel.select = false;
|
|
|
|
filterBtnModel.title = '周${Utils.formatWeekDayNum(i)}';
|
|
|
|
weekData.add(filterBtnModel);
|
|
|
|
}
|
|
|
|
_getNewRechargeDetail() async {
|
|
|
|
bool success = await marketingCenterProvider.getNewRechargeDetail(
|
|
|
|
context, widget.idstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
///输入框
|
|
...
|
...
|
@@ -173,55 +82,12 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///时间选择
|
|
|
|
Widget _select(String title, String hintText, GestureTapCallback onTap) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(left: ScreenUtil().setWidth(32)),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: title == '点击设置可用日期'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
Spacer(),
|
|
|
|
Text(hintText,
|
|
|
|
style: TextStyle(
|
|
|
|
color: hintText == '点击设置开始日期' || hintText == '点击设置结束日期'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
)),
|
|
|
|
HEmptyView(20),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('arrow_right_new'),
|
|
|
|
width: ScreenUtil().setWidth(18),
|
|
|
|
),
|
|
|
|
HEmptyView(32),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///券说明
|
|
|
|
Widget _explain(String title, String hintText,
|
|
|
|
TextEditingController controller, FocusNode node) {
|
|
|
|
Widget _explain(
|
|
|
|
String title,
|
|
|
|
String hintText,
|
|
|
|
) {
|
|
|
|
return Container(
|
|
|
|
// height: ScreenUtil().setWidth(380),
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
...
|
...
|
@@ -235,14 +101,10 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { |
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
)),
|
|
|
|
VEmptyView(26),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(20)),
|
|
|
|
child: Text(
|
|
|
|
'beihaisehfisehfasfhaise',
|
|
|
|
marketingCenterProvider.rechargeDetail.explain,
|
|
|
|
|
|
|
|
// maxLengthEnforced: true,
|
|
|
|
style: TextStyle(
|
|
...
|
...
|
@@ -254,263 +116,287 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
_itemRadioWidget(bool select, String title, {GestureTapCallback onTap}) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Row(children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
select ? 'plan_dish_select' : 'plan_dish_unselect'),
|
|
|
|
width: w(20),
|
|
|
|
),
|
|
|
|
HEmptyView(6),
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
]));
|
|
|
|
}
|
|
|
|
|
|
|
|
///是否立即启用
|
|
|
|
Widget _canUse(String title, bool swich, GestureTapCallback onTap) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
|
|
|
|
// margin: EdgeInsets.only(right: ScreenUtil().setWidth(32)),
|
|
|
|
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: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Text(
|
|
|
|
'启用/禁用',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
Widget _canUse() {
|
|
|
|
return Container(
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
'立即启用',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
HEmptyView(20)
|
|
|
|
// Image.asset(
|
|
|
|
// swich
|
|
|
|
// ? Utils.getImgPath('swich_on')
|
|
|
|
// : Utils.getImgPath('swich_off'),
|
|
|
|
// width: ScreenUtil().setWidth(44 * 2),
|
|
|
|
// )
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Image.asset(
|
|
|
|
marketingCenterProvider.rechargeDetail.isOpen == '1'
|
|
|
|
? Utils.getImgPath('swich_on')
|
|
|
|
: Utils.getImgPath('swich_off'),
|
|
|
|
width: ScreenUtil().setWidth(44 * 2),
|
|
|
|
),
|
|
|
|
HEmptyView(16)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
marketingCenterProvider =
|
|
|
|
Provider.of<MarketingCenterProvider>(context, listen: true);
|
|
|
|
return Scaffold(
|
|
|
|
key: scaffoldKey,
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar('充值优惠详情'),
|
|
|
|
body: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(32)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
VEmptyView(24),
|
|
|
|
_text(
|
|
|
|
'活动名称',
|
|
|
|
'活动名称',
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_text(
|
|
|
|
'充值满',
|
|
|
|
'充值金额门槛',
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
'优惠活动',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(26),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(20)),
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar('充值优惠详情'),
|
|
|
|
body: Consumer<MarketingCenterProvider>(builder: (context, model, _) {
|
|
|
|
if (model.pageStateDetail != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageStateDetail,
|
|
|
|
callback: () {
|
|
|
|
// offset = 0;
|
|
|
|
// getMessage(showLoading: true);
|
|
|
|
|
|
|
|
if (model.pageStateDetail == PageState.Empty) {
|
|
|
|
// NavigatorUtil.goCouponHistoryPage(context);
|
|
|
|
} else {
|
|
|
|
// _couponNetworkData(widget.index);
|
|
|
|
}
|
|
|
|
_getNewRechargeDetail();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有详情数据哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
// showText: '查看过期优惠券',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'赠送1000元余额',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
VEmptyView(56),
|
|
|
|
_text(
|
|
|
|
'活动名称',
|
|
|
|
marketingCenterProvider.rechargeDetail.rname,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(0.5),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(48),
|
|
|
|
_text(
|
|
|
|
'充值满',
|
|
|
|
marketingCenterProvider
|
|
|
|
.rechargeDetail.rechargeMoney,
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Text(
|
|
|
|
'赠送1000积分',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
VEmptyView(24),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(0.5),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Text(
|
|
|
|
'赠送优惠券',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
VEmptyView(48),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
'优惠活动',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(28),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(45),
|
|
|
|
right: w(8),
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
if (marketingCenterProvider
|
|
|
|
.rechargeDetail.rechargeList.isPrice ==
|
|
|
|
'1')
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'赠送',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
'${marketingCenterProvider.rechargeDetail.rechargeList.price}元余额',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
HEmptyView(32)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
if (marketingCenterProvider
|
|
|
|
.rechargeDetail.rechargeList.isPrice ==
|
|
|
|
'1')
|
|
|
|
VEmptyView(26),
|
|
|
|
if (marketingCenterProvider
|
|
|
|
.rechargeDetail.rechargeList.isScore ==
|
|
|
|
'1')
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'赠送',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
'${marketingCenterProvider.rechargeDetail.rechargeList.score}积分',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
HEmptyView(32)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
if (marketingCenterProvider
|
|
|
|
.rechargeDetail.rechargeList.isScore ==
|
|
|
|
'1')
|
|
|
|
VEmptyView(26),
|
|
|
|
if (marketingCenterProvider.rechargeDetail
|
|
|
|
.rechargeList.isCoupons ==
|
|
|
|
'1')
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'赠送',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
'优惠券',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
HEmptyView(32)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
if (marketingCenterProvider.rechargeDetail
|
|
|
|
.rechargeList.isCoupons ==
|
|
|
|
'1')
|
|
|
|
VEmptyView(26),
|
|
|
|
if (marketingCenterProvider.rechargeDetail
|
|
|
|
.rechargeList.isCoupons ==
|
|
|
|
'1')
|
|
|
|
Wrap(
|
|
|
|
spacing: w(9),
|
|
|
|
runSpacing: w(9),
|
|
|
|
alignment: WrapAlignment.start,
|
|
|
|
runAlignment: WrapAlignment.start,
|
|
|
|
children: marketingCenterProvider
|
|
|
|
.rechargeDetail.rechargeList.coupons
|
|
|
|
.map((e) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// NavigatorUtil.goCouponDetailPage(
|
|
|
|
// conetxt);
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
e.aname,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
));
|
|
|
|
}).toList()),
|
|
|
|
VEmptyView(26),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(0.5),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(48),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'充值日期限制:',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
marketingCenterProvider
|
|
|
|
.rechargeDetail.expDate.isFix ==
|
|
|
|
'1'
|
|
|
|
? '${marketingCenterProvider.rechargeDetail.expDate.fixSdate}至${marketingCenterProvider.rechargeDetail.expDate.fixEdate}'
|
|
|
|
: marketingCenterProvider.rechargeDetail
|
|
|
|
.expDate.isWeek ==
|
|
|
|
'1'
|
|
|
|
? '每周指定日期可用'
|
|
|
|
: '会员生日当天',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: w(9),
|
|
|
|
runSpacing: w(9),
|
|
|
|
alignment: WrapAlignment.start,
|
|
|
|
runAlignment: WrapAlignment.start,
|
|
|
|
children: coupons.map((e) {
|
|
|
|
return Text(
|
|
|
|
e,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
);
|
|
|
|
}).toList())),
|
|
|
|
VEmptyView(20),
|
|
|
|
HEmptyView(32)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
if (marketingCenterProvider
|
|
|
|
.rechargeDetail.expDate.isWeek ==
|
|
|
|
'1')
|
|
|
|
VEmptyView(26),
|
|
|
|
if (marketingCenterProvider
|
|
|
|
.rechargeDetail.expDate.isWeek ==
|
|
|
|
'1')
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Text(
|
|
|
|
marketingCenterProvider
|
|
|
|
.rechargeDetail.expDate.weekDateShow,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
)),
|
|
|
|
VEmptyView(24),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(0.5),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(48),
|
|
|
|
_explain(
|
|
|
|
'备注',
|
|
|
|
'请输入备注信息',
|
|
|
|
),
|
|
|
|
VEmptyView(48),
|
|
|
|
_canUse()
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
'有效期',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(20)),
|
|
|
|
child: Text(
|
|
|
|
'2021.2.2-2022.3.4/周日、周一、周二/会员生日当天',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
)),
|
|
|
|
VEmptyView(24),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_explain('备注', '请输入备注信息', remarkC, remarkF),
|
|
|
|
VEmptyView(24),
|
|
|
|
_canUse('立即启用', canUse, () {
|
|
|
|
setState(() {
|
|
|
|
canUse = !canUse;
|
|
|
|
});
|
|
|
|
})
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(91 * 2),
|
|
|
|
// width: double.infinity,
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// top: ScreenUtil().setWidth(16 * 2),
|
|
|
|
// bottom: ScreenUtil().setWidth(35 * 2),
|
|
|
|
// left: ScreenUtil().setWidth(45 * 2),
|
|
|
|
// right: ScreenUtil().setWidth(45 * 2),
|
|
|
|
// ),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// boxShadow: [
|
|
|
|
// BoxShadow(
|
|
|
|
// spreadRadius: ScreenUtil().setWidth(2),
|
|
|
|
// color: Color.fromRGBO(0, 0, 0, 0.1),
|
|
|
|
// offset: Offset(0, ScreenUtil().setWidth(-2)),
|
|
|
|
// blurRadius: ScreenUtil().setWidth(8))
|
|
|
|
// ],
|
|
|
|
// borderRadius: BorderRadius.all(
|
|
|
|
// Radius.circular(ScreenUtil().setWidth(16)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// child: RoundButton(
|
|
|
|
// text: '保存',
|
|
|
|
// height: ScreenUtil().setWidth(80),
|
|
|
|
// radius: ScreenUtil().setWidth(14),
|
|
|
|
// isBold: false,
|
|
|
|
// fontSize: 28,
|
|
|
|
// onPressed: () async {
|
|
|
|
// // "stime": fromDate == '点击选择'
|
|
|
|
// // ? ""
|
|
|
|
// // : '${DateUtil.getDateMsByTimeStr(fromDate) / 1000}',
|
|
|
|
// // "etime": endDate == '点击选择'
|
|
|
|
// // ? ''
|
|
|
|
// // : '${DateUtil.getDateMsByTimeStr(endDate) / 1000}',
|
|
|
|
// // UserModel userModel =
|
|
|
|
// // Provider.of<UserModel>(context, listen: false);
|
|
|
|
// // if (userModel.user.role_name == '管理员' ||
|
|
|
|
// // userModel.user.role_name == '店长') {
|
|
|
|
// // NavigatorUtil.goRechargeDetailPage(context);
|
|
|
|
// // } else {
|
|
|
|
// // bool needRefresh =
|
|
|
|
// // await NavigatorUtil.goCouponEditPage(context);
|
|
|
|
// // print(needRefresh);
|
|
|
|
// // if (needRefresh != null && needRefresh) {
|
|
|
|
// // bus.emit('refresh_coupon_list_f');
|
|
|
|
// // //刷新页面数据
|
|
|
|
// // // _controller.callRefresh();
|
|
|
|
// // // _couponNetworkData(tabController.index);
|
|
|
|
// // }
|
|
|
|
// // }
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|