|
...
|
...
|
@@ -21,7 +21,6 @@ import 'package:one_key/widgets/system_app_bar.dart'; |
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../generated/l10n.dart';
|
|
|
|
import '../../models/coupon_model.dart';
|
|
|
|
import '../../models/filter_btn_model.dart';
|
|
|
|
import '../../models/upload_img_model.dart';
|
|
...
|
...
|
@@ -204,8 +203,6 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
=======
|
|
|
|
if (widget.couponSunModel != null) {
|
|
|
|
_couponNameEditControl.text = widget.couponSunModel!.aname ?? "";
|
|
|
|
_couponRequireEditControl.text = widget.couponSunModel!.desc ?? "";
|
|
...
|
...
|
@@ -264,60 +261,8 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
// _couponNetworkData(0);
|
|
|
|
fromDate = '${S.of(context).click_to_select}'; //有效期开始时间
|
|
|
|
endDate = '${S.of(context).click_to_select}'; //有效期结束时间
|
|
|
|
if (widget.couponSunModel != null) {
|
|
|
|
_couponNameEditControl.text = widget.couponSunModel.aname;
|
|
|
|
_couponRequireEditControl.text = widget.couponSunModel.desc;
|
|
|
|
_couponExplainEditControl.text = widget.couponSunModel.explain;
|
|
|
|
DateTime dateTimes = DateTime.fromMillisecondsSinceEpoch(
|
|
|
|
int.parse(widget.couponSunModel.stime.toString()) * 1000);
|
|
|
|
fromDate = DateUtil.formatDate(dateTimes, format: DateFormats.y_mo_d);
|
|
|
|
DateTime dateTimee = DateTime.fromMillisecondsSinceEpoch(
|
|
|
|
int.parse(widget.couponSunModel.etime.toString()) * 1000);
|
|
|
|
endDate = DateUtil.formatDate(dateTimee, format: DateFormats.y_mo_d);
|
|
|
|
|
|
|
|
swichState = widget.couponSunModel.status == '1' ? true : false;
|
|
|
|
|
|
|
|
if (widget.isMine) {
|
|
|
|
//${S.of(context).my_coupons}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
//店铺
|
|
|
|
swichHexiao = widget.couponSunModel.isExamine == '1' ? true : false;
|
|
|
|
_priceControl.text = widget.couponSunModel.price;
|
|
|
|
|
|
|
|
money = widget.couponSunModel.use.isCash;
|
|
|
|
dish = widget.couponSunModel.use.isDish;
|
|
|
|
discount = widget.couponSunModel.use.isDiscount;
|
|
|
|
moneyControl.text = widget.couponSunModel.use.cash;
|
|
|
|
discountControl.text = widget.couponSunModel.use.discount;
|
|
|
|
dishControl.text = widget.couponSunModel.use.dish;
|
|
|
|
|
|
|
|
if (widget.couponSunModel.use.images.length > 0) {
|
|
|
|
widget.couponSunModel.use.images.forEach((element) {
|
|
|
|
UploadImgModel uploadImgModel = UploadImgModel();
|
|
|
|
uploadImgModel.qiniuUrl = element;
|
|
|
|
uploadImgModel.process = 1;
|
|
|
|
img.add(uploadImgModel);
|
|
|
|
imgAll.add(element); //初始化数据,同步数据库数据
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
limitNone = widget.couponSunModel.expDate.isNone ? true : false;
|
|
|
|
limitBirthday =
|
|
|
|
widget.couponSunModel.expDate.isBirthday ? true : false;
|
|
|
|
limitWeek = widget.couponSunModel.expDate.isWeek ? true : false;
|
|
|
|
|
|
|
|
weekShow = widget.couponSunModel.expDate.weekShow ?? '点击设置可用日期';
|
|
|
|
weekData = widget.couponSunModel.expDate.weekData ?? [];
|
|
|
|
uids = widget.couponSunModel.uidList;
|
|
|
|
_limitNumControl.text = widget.couponSunModel.grantNum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (weekData.length == 0) {
|
|
|
|
_initWeekData();
|
|
|
|
}
|
|
...
|
...
|
@@ -363,14 +308,13 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
FilterBtnModel filterBtnModel = FilterBtnModel();
|
|
|
|
filterBtnModel.selectNoon = false;
|
|
|
|
filterBtnModel.selectNig = false;
|
|
|
|
filterBtnModel.title = S.of(context).sunday;
|
|
|
|
filterBtnModel.title = '周日';
|
|
|
|
weekData.add(filterBtnModel);
|
|
|
|
for (int i = 1; i < 7; i++) {
|
|
|
|
FilterBtnModel filterBtnModel = FilterBtnModel();
|
|
|
|
filterBtnModel.selectNoon = false;
|
|
|
|
filterBtnModel.selectNig = false;
|
|
|
|
filterBtnModel.title =
|
|
|
|
Utils.getWeekLocal('周${Utils.formatWeekDayNum(i)}', context);
|
|
|
|
filterBtnModel.title = '周${Utils.formatWeekDayNum(i,context)}';
|
|
|
|
weekData.add(filterBtnModel);
|
|
|
|
}
|
|
|
|
FilterBtnModel filterBtnModel1 = FilterBtnModel();
|
|
...
|
...
|
@@ -390,15 +334,10 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user!.openid,
|
|
|
|
"aname": _couponNameEditControl.text.trim(),
|
|
|
|
"desc": _couponRequireEditControl.text.trim(),
|
|
|
|
"stime": fromDate == '${S.of(context).click_to_select}'
|
|
|
|
"stime": fromDate == '点击选择'
|
|
|
|
? ""
|
|
|
|
<<<<<<< HEAD
|
|
|
|
: '${(DateUtil.getDateMsByTimeStr(from) / 1000).floor()}',
|
|
|
|
"etime": endDate == '${S.of(context).click_to_select}'
|
|
|
|
=======
|
|
|
|
: '${(DateUtil.getDateMsByTimeStr(from)! / 1000).floor()}',
|
|
|
|
"etime": endDate == '点击选择'
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
? ''
|
|
|
|
: '${(DateUtil.getDateMsByTimeStr(end)! / 1000).floor()}',
|
|
|
|
"explain": _couponExplainEditControl.text,
|
|
...
|
...
|
@@ -521,7 +460,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
inputFormatters: title == '${S.of(context).coupon_name}'
|
|
|
|
inputFormatters: title == '券名称'
|
|
|
|
? [LengthLimitingTextInputFormatter(15)]
|
|
|
|
: title == '券金额' ||
|
|
|
|
title == '领取后有效天数' ||
|
|
...
|
...
|
@@ -677,7 +616,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
Spacer(),
|
|
|
|
Text(hintText,
|
|
|
|
style: TextStyle(
|
|
|
|
color: hintText == '${S.of(context).click_to_select}'
|
|
|
|
color: hintText == '点击选择'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
...
|
...
|
@@ -694,7 +633,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///${S.of(context).coupon_description}
|
|
|
|
///券说明
|
|
|
|
Widget _explain(String title, String hintText) {
|
|
|
|
return Container(
|
|
|
|
// height: ScreenUtil().setWidth(380),
|
|
...
|
...
|
@@ -774,14 +713,9 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
///是否${S.of(context).activate_now}
|
|
|
|
Widget _canUse(String title, bool swich, GestureTapCallback onTap) {
|
|
|
|
=======
|
|
|
|
///是否立即启用
|
|
|
|
Widget _canUse(String title, bool swich, GestureTapCallback onTap,
|
|
|
|
{bool isBig = true}) {
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
...
|
...
|
@@ -949,38 +883,6 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(56),
|
|
|
|
<<<<<<< HEAD
|
|
|
|
_item(
|
|
|
|
'${S.of(context).coupon_type}',
|
|
|
|
widget.isMine
|
|
|
|
? '${S.of(context).my_coupons}'
|
|
|
|
: '${S.of(context).shop_coupons}'),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
widget.isMine
|
|
|
|
? SizedBox()
|
|
|
|
: _canUse('${S.of(context).redeemable}',
|
|
|
|
swichHexiao, () {
|
|
|
|
setState(() {
|
|
|
|
swichHexiao = !swichHexiao;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
widget.isMine
|
|
|
|
? SizedBox()
|
|
|
|
: Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
widget.isMine ? SizedBox() : VEmptyView(24),
|
|
|
|
_textfield(
|
|
|
|
'${S.of(context).coupon_name}',
|
|
|
|
'例:9折券/200元代金券/菜品券',
|
|
|
|
_couponNameEditControl,
|
|
|
|
_nameFocusNode),
|
|
|
|
=======
|
|
|
|
// _item('券类型', widget.isMine ? '我的优惠券' : '店铺优惠券'),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
...
|
...
|
@@ -1003,7 +905,6 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
// widget.isMine ? SizedBox() : VEmptyView(24),
|
|
|
|
_textfield('券名称', '点击输入券名称',
|
|
|
|
_couponNameEditControl, _nameFocusNode),
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
...
|
...
|
@@ -1025,34 +926,13 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
if (!widget.isMine)
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
<<<<<<< HEAD
|
|
|
|
//${S.of(context).selling_price}
|
|
|
|
|
|
|
|
_textfield(
|
|
|
|
'${S.of(context).selling_price}',
|
|
|
|
'默认0元,可以免费发放',
|
|
|
|
_priceControl,
|
|
|
|
_priceFocusNode,
|
|
|
|
textInputType:
|
|
|
|
TextInputType.numberWithOptions(
|
|
|
|
decimal: true)),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
// VEmptyView(24),
|
|
|
|
//${S.of(context).coupon_use}
|
|
|
|
VEmptyView(56),
|
|
|
|
=======
|
|
|
|
// VEmptyView(24),
|
|
|
|
//券用途
|
|
|
|
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
'${S.of(context).coupon_use}',
|
|
|
|
'券用途',
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.9),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
...
|
...
|
@@ -1063,8 +943,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
HEmptyView(30),
|
|
|
|
_itemRadioWidget(money,
|
|
|
|
'${S.of(context).cash_voucher}',
|
|
|
|
_itemRadioWidget(money, '代金券',
|
|
|
|
onTap: () {
|
|
|
|
if (!money) {
|
|
|
|
setState(() {
|
|
...
|
...
|
@@ -1076,8 +955,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
}
|
|
|
|
}),
|
|
|
|
Spacer(),
|
|
|
|
_itemRadioWidget(discount,
|
|
|
|
'${S.of(context).discount_voucher}',
|
|
|
|
_itemRadioWidget(discount, '折扣券',
|
|
|
|
onTap: () {
|
|
|
|
if (!discount) {
|
|
|
|
setState(() {
|
|
...
|
...
|
@@ -1089,8 +967,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
}
|
|
|
|
}),
|
|
|
|
Spacer(),
|
|
|
|
_itemRadioWidget(dish,
|
|
|
|
'${S.of(context).dish_voucher}',
|
|
|
|
_itemRadioWidget(dish, '菜品券',
|
|
|
|
onTap: () {
|
|
|
|
if (!dish) {
|
|
|
|
setState(() {
|
|
...
|
...
|
@@ -1106,11 +983,8 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
VEmptyView(30),
|
|
|
|
|
|
|
|
if (money)
|
|
|
|
_textfieldSelect(
|
|
|
|
'${S.of(context).amount}:',
|
|
|
|
'点击输入代金券金额',
|
|
|
|
moneyControl,
|
|
|
|
moneyFocusNode,
|
|
|
|
_textfieldSelect('金额:', '点击输入代金券金额',
|
|
|
|
moneyControl, moneyFocusNode,
|
|
|
|
subtitle: '元',
|
|
|
|
textInputType: TextInputType
|
|
|
|
.numberWithOptions()),
|
|
...
|
...
|
@@ -1275,29 +1149,15 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
VEmptyView(48),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
<<<<<<< HEAD
|
|
|
|
_textfield(
|
|
|
|
'${S.of(context).coupon_requirements}',
|
|
|
|
'例:无门槛/满2000元',
|
|
|
|
_couponRequireEditControl,
|
|
|
|
_requireFocusNode),
|
|
|
|
=======
|
|
|
|
|
|
|
|
_textfield('消费要求(0为无门槛)', '点击输入最低消费金额需求',
|
|
|
|
_couponRequireEditControl, _requireFocusNode),
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
<<<<<<< HEAD
|
|
|
|
_select(
|
|
|
|
'${S.of(context).validity_from}', fromDate,
|
|
|
|
() {
|
|
|
|
=======
|
|
|
|
_select('活动开始于', fromDate, () {
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
//弹出时间选择器
|
|
...
|
...
|
@@ -1331,12 +1191,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
<<<<<<< HEAD
|
|
|
|
_select('${S.of(context).validity_to}', endDate,
|
|
|
|
() {
|
|
|
|
=======
|
|
|
|
_select('活动结束于', endDate, () {
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
//弹出时间选择器
|
|
...
|
...
|
@@ -1454,127 +1309,6 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
<<<<<<< HEAD
|
|
|
|
//${S.of(context).usage_limit}
|
|
|
|
VEmptyView(24),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
'${S.of(context).usage_limit}',
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.9),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
HEmptyView(30),
|
|
|
|
_itemRadioWidget(
|
|
|
|
limitNone, '${S.of(context).none}',
|
|
|
|
onTap: () {
|
|
|
|
if (!limitNone) {
|
|
|
|
setState(() {
|
|
|
|
limitNone = true;
|
|
|
|
|
|
|
|
limitWeek = false;
|
|
|
|
limitBirthday = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
Spacer(),
|
|
|
|
_itemRadioWidget(limitWeek,
|
|
|
|
'${S.of(context).weekly}',
|
|
|
|
onTap: () {
|
|
|
|
if (!limitWeek) {
|
|
|
|
setState(() {
|
|
|
|
limitWeek = true;
|
|
|
|
|
|
|
|
limitNone = false;
|
|
|
|
limitBirthday = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
Spacer(),
|
|
|
|
_itemRadioWidget(limitBirthday,
|
|
|
|
'${S.of(context).members_birthday}',
|
|
|
|
onTap: () {
|
|
|
|
if (!limitBirthday) {
|
|
|
|
setState(() {
|
|
|
|
limitBirthday = true;
|
|
|
|
limitNone = false;
|
|
|
|
limitWeek = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
HEmptyView(30),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
if (limitWeek) VEmptyView(30),
|
|
|
|
|
|
|
|
if (limitWeek)
|
|
|
|
_select1(weekShow, '', () async {
|
|
|
|
FocusScope.of(context).requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
//弹出时间选择器
|
|
|
|
// showPickerDateTime(context);
|
|
|
|
showDateSelWidget = false;
|
|
|
|
|
|
|
|
List<FilterBtnModel> data = await DialogUtil
|
|
|
|
.openCoponsWeekSelectModalBottomSheet(
|
|
|
|
context, weekData);
|
|
|
|
if (data != null) {
|
|
|
|
//改变了
|
|
|
|
weekData = [];
|
|
|
|
weekData.addAll(data);
|
|
|
|
weekShow = '';
|
|
|
|
|
|
|
|
String noonStr = '午餐:';
|
|
|
|
String nightStr = '晚餐:';
|
|
|
|
|
|
|
|
weekData.forEach((element) {
|
|
|
|
if (element.selectNoon) {
|
|
|
|
noonStr += '${element.title} ';
|
|
|
|
}
|
|
|
|
if (element.selectNig) {
|
|
|
|
nightStr += '${element.title} ';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if (noonStr.endsWith(' ')) {
|
|
|
|
noonStr = noonStr.substring(
|
|
|
|
0, noonStr.length - 1);
|
|
|
|
}
|
|
|
|
if (nightStr.endsWith(' ')) {
|
|
|
|
nightStr = nightStr.substring(
|
|
|
|
0, nightStr.length - 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (noonStr == '午餐:' &&
|
|
|
|
nightStr == '晚餐:') {
|
|
|
|
weekShow = '点击设置可用日期';
|
|
|
|
} else {
|
|
|
|
if (noonStr != '午餐:' &&
|
|
|
|
nightStr != '晚餐:') {
|
|
|
|
weekShow =
|
|
|
|
noonStr + '\n' + nightStr;
|
|
|
|
} else if (noonStr != '午餐:') {
|
|
|
|
weekShow = noonStr;
|
|
|
|
} else {
|
|
|
|
weekShow = nightStr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
limitWeek ? VEmptyView(22) : VEmptyView(48),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(48),
|
|
|
|
=======
|
|
|
|
_canUse('领取当日可用', isSameDay, () {
|
|
|
|
setState(() {
|
|
|
|
isSameDay = !isSameDay;
|
|
...
|
...
|
@@ -1605,7 +1339,6 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
isAppointment = !isAppointment;
|
|
|
|
});
|
|
|
|
}, isBig: false),
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
...
|
...
|
@@ -1781,14 +1514,8 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
widget.isMine ? VEmptyView(48) : VEmptyView(24),
|
|
|
|
widget.isMine
|
|
|
|
? SizedBox()
|
|
|
|
<<<<<<< HEAD
|
|
|
|
: _select('${S.of(context).who_can_issue}',
|
|
|
|
S.of(context).edit, () async {
|
|
|
|
Map temp = await NavigatorUtil
|
|
|
|
=======
|
|
|
|
: _select('谁可以发放', '编辑', () async {
|
|
|
|
Map? temp = await NavigatorUtil
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
.goCouponToPersonnalPage(
|
|
|
|
context, uids);
|
|
|
|
if (temp != null &&
|
|
...
|
...
|
@@ -1802,26 +1529,6 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
<<<<<<< HEAD
|
|
|
|
widget.isMine ? SizedBox() : VEmptyView(24),
|
|
|
|
widget.isMine
|
|
|
|
? SizedBox()
|
|
|
|
: _textfield(
|
|
|
|
'${S.of(context).total_issuance_limit}',
|
|
|
|
'点击输入总数量限制',
|
|
|
|
_limitNumControl,
|
|
|
|
_limitNumFocusNode,
|
|
|
|
textInputType: TextInputType.number),
|
|
|
|
widget.isMine
|
|
|
|
? SizedBox()
|
|
|
|
: Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
widget.isMine ? SizedBox() : VEmptyView(24),
|
|
|
|
_explain('${S.of(context).coupon_description}',
|
|
|
|
'例:可用包间,停车免费,不与店内其他活动共享等'),
|
|
|
|
=======
|
|
|
|
widget.isMine ? SizedBox() : VEmptyView(48),
|
|
|
|
_textfield('发放总量限制', '点击输入总数量限制',
|
|
|
|
_limitNumControl, _limitNumFocusNode,
|
|
...
|
...
|
@@ -1832,11 +1539,8 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_explain('券说明', '例:可用包间,停车免费,不与店内其他活动共享等'),
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
VEmptyView(20),
|
|
|
|
_canUse(
|
|
|
|
'${S.of(context).activate_now}', swichState,
|
|
|
|
() {
|
|
|
|
_canUse('立即启用', swichState, () {
|
|
|
|
setState(() {
|
|
|
|
swichState = !swichState;
|
|
|
|
});
|
|
...
|
...
|
@@ -1861,7 +1565,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
}
|
|
|
|
if (can) {
|
|
|
|
if (_couponNameEditControl.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请填写${S.of(context).coupon_name}');
|
|
|
|
Utils.showToast('请填写券名称');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (_priceControl.text.trim().length == 0) {
|
|
...
|
...
|
@@ -1921,27 +1625,8 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<<<<<<< HEAD
|
|
|
|
if (_couponRequireEditControl.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请填写券要求');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (fromDate == '${S.of(context).click_to_select}') {
|
|
|
|
Utils.showToast('请选择有效期起始时间');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (endDate == '${S.of(context).click_to_select}') {
|
|
|
|
Utils.showToast('请选择有效期结束时间');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (DateUtil.getDateTime(endDate)
|
|
|
|
.compareTo(DateUtil.getDateTime(fromDate)) <
|
|
|
|
0) {
|
|
|
|
Utils.showToast('有效期结束时间不能早于起始时间');
|
|
|
|
=======
|
|
|
|
if (_limitNumControl.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请填写发放总量限制');
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// bool isNumber = Utils.isInteger(
|
|
...
|
...
|
@@ -1962,15 +1647,9 @@ class _CouponEidtPageState extends State<CouponEidtPage> { |
|
|
|
_createNewCoupon();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
<<<<<<< HEAD
|
|
|
|
text: '${S.of(context).create_now}',
|
|
|
|
fontSize: 24,
|
|
|
|
isBold: false,
|
|
|
|
=======
|
|
|
|
text: '立即创建',
|
|
|
|
fontSize: 32,
|
|
|
|
isBold: true,
|
|
|
|
>>>>>>> v5.4.4+
|
|
|
|
height: ScreenUtil().setWidth(37 * 2),
|
|
|
|
width: ScreenUtil().setWidth(130 * 2),
|
|
|
|
radius: ScreenUtil().setWidth(22),
|
...
|
...
|
|