Commit 0acebd0936f71eaab869b5bd7c0c744e2754d784

Authored by wdn127929
1 parent 7fe5fbde

创建优惠券输入判空

@@ -14,16 +14,16 @@ if (flutterRoot == null) { @@ -14,16 +14,16 @@ if (flutterRoot == null) {
14 14
15 15
16 16
17 -def flutterVersionCode = "473" 17 +def flutterVersionCode = "474"
18 if (flutterVersionCode == null) { 18 if (flutterVersionCode == null) {
19 - flutterVersionCode = '473' 19 + flutterVersionCode = '474'
20 } 20 }
21 21
22 22
23 23
24 -def flutterVersionName = "4.7.3" 24 +def flutterVersionName = "4.7.4"
25 if (flutterVersionName == null) { 25 if (flutterVersionName == null) {
26 - flutterVersionName = '4.7.3' 26 + flutterVersionName = '4.7.4'
27 } 27 }
28 28
29 29
@@ -197,25 +197,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -197,25 +197,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
197 //创建新券 客户经理创建活动 197 //创建新券 客户经理创建活动
198 _createNewCoupon() async { 198 _createNewCoupon() async {
199 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 199 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
200 - if (!widget.isMine) {  
201 - if (money && moneyControl.text.trim().length == 0) {  
202 - Utils.showToast('请输入代金券金额!');  
203 - return;  
204 - }  
205 - if (discount && discountControl.text.trim().length == 0) {  
206 - Utils.showToast('请输入折扣率!');  
207 - return;  
208 - }  
209 - if (dish && dishControl.text.trim().length == 0) {  
210 - Utils.showToast('请输入菜品!');  
211 - return;  
212 - }  
213 200
214 - if (limitWeek && weekShow == '点击设置可用日期') {  
215 - Utils.showToast('请设置可用日期!');  
216 - return;  
217 - }  
218 - }  
219 String from = fromDate + ' 00:00:00'; 201 String from = fromDate + ' 00:00:00';
220 String end = endDate + ' 23:59:59'; 202 String end = endDate + ' 23:59:59';
221 Map<String, String> params = { 203 Map<String, String> params = {
@@ -1035,6 +1017,25 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1035,6 +1017,25 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1035 Utils.showToast('请填写券名称'); 1017 Utils.showToast('请填写券名称');
1036 return; 1018 return;
1037 } 1019 }
  1020 + if (!widget.isMine) {
  1021 + if (money && moneyControl.text.trim().length == 0) {
  1022 + Utils.showToast('请输入代金券金额!');
  1023 + return;
  1024 + }
  1025 + if (discount && discountControl.text.trim().length == 0) {
  1026 + Utils.showToast('请输入折扣率!');
  1027 + return;
  1028 + }
  1029 + if (dish && dishControl.text.trim().length == 0) {
  1030 + Utils.showToast('请输入菜品!');
  1031 + return;
  1032 + }
  1033 +
  1034 + if (limitWeek && weekShow == '点击设置可用日期') {
  1035 + Utils.showToast('请设置可用日期!');
  1036 + return;
  1037 + }
  1038 + }
1038 if (_couponRequireEditControl.text.trim().length == 0) { 1039 if (_couponRequireEditControl.text.trim().length == 0) {
1039 Utils.showToast('请填写券要求'); 1040 Utils.showToast('请填写券要求');
1040 return; 1041 return;
@@ -50,7 +50,6 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> { @@ -50,7 +50,6 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> {
50 super.initState(); 50 super.initState();
51 51
52 WidgetsBinding.instance.addPostFrameCallback((_) { 52 WidgetsBinding.instance.addPostFrameCallback((_) {
53 - // _couponNetworkData(0);  
54 initTime(context); 53 initTime(context);
55 _getOrderRechargeByid(); 54 _getOrderRechargeByid();
56 }); 55 });
@@ -117,8 +116,6 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> { @@ -117,8 +116,6 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> {
117 context, {'id': widget.idstr}, 116 context, {'id': widget.idstr},
118 isShowLoading: isShowLoading); 117 isShowLoading: isShowLoading);
119 if (success) { 118 if (success) {
120 - pageState = PageState.Success;  
121 -  
122 DateTime dateTime = DateTime.fromMillisecondsSinceEpoch( 119 DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
123 int.parse(couponProvider.orderRechargeByidSunModel.activity.etime) * 120 int.parse(couponProvider.orderRechargeByidSunModel.activity.etime) *
124 1000); 121 1000);
@@ -164,53 +161,14 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> { @@ -164,53 +161,14 @@ class _VerificationCouponPageState extends State<VerificationCouponPage> {
164 } else { 161 } else {
165 canUse = true; 162 canUse = true;
166 } 163 }
  164 + pageState = PageState.Success;
167 } else { 165 } else {
168 pageState = PageState.ConnectivityError; 166 pageState = PageState.ConnectivityError;
169 } 167 }
170 setState(() {}); 168 setState(() {});
171 } 169 }
172 170
173 - ///时间选择  
174 - Widget _select(String title, String hintText, GestureTapCallback onTap) {  
175 - return InkWell(  
176 - onTap: onTap,  
177 - child: Container(  
178 - padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),  
179 - child: Row(  
180 - crossAxisAlignment: CrossAxisAlignment.center,  
181 - mainAxisAlignment: MainAxisAlignment.center,  
182 - children: [  
183 - Container(  
184 - // height: ScreenUtil().setWidth(40),  
185 - // color: Colors.red,  
186 - child: Text(  
187 - title,  
188 - style: TextStyle(  
189 - color: Color.fromRGBO(0, 0, 0, 0.9),  
190 - fontWeight: FontWeight.bold,  
191 - fontSize: ScreenUtil().setSp(32)),  
192 - ),  
193 - ),  
194 - HEmptyView(20),  
195 - Spacer(),  
196 - Text(hintText,  
197 - style: TextStyle(  
198 - color: hintText == '点击选择'  
199 - ? MyColours.color_999999  
200 - : MyColours.color_515151,  
201 - fontSize: ScreenUtil().setSp(32),  
202 - )),  
203 - HEmptyView(20),  
204 - Image.asset(  
205 - Utils.getImgPath('arrow_right_new'),  
206 - width: ScreenUtil().setWidth(20),  
207 - ),  
208 - HEmptyView(32),  
209 - ],  
210 - ),  
211 - ),  
212 - );  
213 - } 171 +
214 172
215 ///输入框 173 ///输入框
216 Widget _item(String title, String subTitle, 174 Widget _item(String title, String subTitle,