Commit 0acebd0936f71eaab869b5bd7c0c744e2754d784

Authored by wdn127929
1 parent 7fe5fbde

创建优惠券输入判空

... ... @@ -14,16 +14,16 @@ if (flutterRoot == null) {
def flutterVersionCode = "473"
def flutterVersionCode = "474"
if (flutterVersionCode == null) {
flutterVersionCode = '473'
flutterVersionCode = '474'
}
def flutterVersionName = "4.7.3"
def flutterVersionName = "4.7.4"
if (flutterVersionName == null) {
flutterVersionName = '4.7.3'
flutterVersionName = '4.7.4'
}
... ...
... ... @@ -197,25 +197,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
//创建新券 客户经理创建活动
_createNewCoupon() async {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
if (!widget.isMine) {
if (money && moneyControl.text.trim().length == 0) {
Utils.showToast('请输入代金券金额!');
return;
}
if (discount && discountControl.text.trim().length == 0) {
Utils.showToast('请输入折扣率!');
return;
}
if (dish && dishControl.text.trim().length == 0) {
Utils.showToast('请输入菜品!');
return;
}
if (limitWeek && weekShow == '点击设置可用日期') {
Utils.showToast('请设置可用日期!');
return;
}
}
String from = fromDate + ' 00:00:00';
String end = endDate + ' 23:59:59';
Map<String, String> params = {
... ... @@ -1035,6 +1017,25 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
Utils.showToast('请填写券名称');
return;
}
if (!widget.isMine) {
if (money && moneyControl.text.trim().length == 0) {
Utils.showToast('请输入代金券金额!');
return;
}
if (discount && discountControl.text.trim().length == 0) {
Utils.showToast('请输入折扣率!');
return;
}
if (dish && dishControl.text.trim().length == 0) {
Utils.showToast('请输入菜品!');
return;
}
if (limitWeek && weekShow == '点击设置可用日期') {
Utils.showToast('请设置可用日期!');
return;
}
}
if (_couponRequireEditControl.text.trim().length == 0) {
Utils.showToast('请填写券要求');
return;
... ...
... ... @@ -50,7 +50,6 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
// _couponNetworkData(0);
initTime(context);
_getOrderRechargeByid();
});
... ... @@ -117,8 +116,6 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> {
context, {'id': widget.idstr},
isShowLoading: isShowLoading);
if (success) {
pageState = PageState.Success;
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
int.parse(couponProvider.orderRechargeByidSunModel.activity.etime) *
1000);
... ... @@ -164,53 +161,14 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> {
} else {
canUse = true;
}
pageState = PageState.Success;
} else {
pageState = PageState.ConnectivityError;
}
setState(() {});
}
///时间选择
Widget _select(String title, String hintText, GestureTapCallback onTap) {
return InkWell(
onTap: onTap,
child: Container(
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
title,
style: TextStyle(
color: Color.fromRGBO(0, 0, 0, 0.9),
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
),
),
HEmptyView(20),
Spacer(),
Text(hintText,
style: TextStyle(
color: hintText == '点击选择'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
)),
HEmptyView(20),
Image.asset(
Utils.getImgPath('arrow_right_new'),
width: ScreenUtil().setWidth(20),
),
HEmptyView(32),
],
),
),
);
}
///输入框
Widget _item(String title, String subTitle,
... ...