Showing
7 changed files
with
449 additions
and
175 deletions
| @@ -5,7 +5,6 @@ import 'package:json_annotation/json_annotation.dart'; | @@ -5,7 +5,6 @@ import 'package:json_annotation/json_annotation.dart'; | ||
| 5 | import 'package:one_key/models/CouponDataExpirationDate.dart'; | 5 | import 'package:one_key/models/CouponDataExpirationDate.dart'; |
| 6 | import 'package:one_key/models/filter_btn_model.dart'; | 6 | import 'package:one_key/models/filter_btn_model.dart'; |
| 7 | 7 | ||
| 8 | - | ||
| 9 | import 'dart:convert' as convert; | 8 | import 'dart:convert' as convert; |
| 10 | 9 | ||
| 11 | part 'coupon_model.g.dart'; | 10 | part 'coupon_model.g.dart'; |
| @@ -126,36 +125,36 @@ class CouponSunModel extends Object { | @@ -126,36 +125,36 @@ class CouponSunModel extends Object { | ||
| 126 | TextEditingController numberC = TextEditingController(text: '1'); | 125 | TextEditingController numberC = TextEditingController(text: '1'); |
| 127 | 126 | ||
| 128 | CouponSunModel( | 127 | CouponSunModel( |
| 129 | - this.id, | ||
| 130 | - this.uid, | ||
| 131 | - this.aname, | ||
| 132 | - this.desc, | ||
| 133 | - this.stime, | ||
| 134 | - this.etime, | ||
| 135 | - this.explain, | ||
| 136 | - this.status, | ||
| 137 | - this.cdate, | ||
| 138 | - this.receiveNum, | ||
| 139 | - this.useNum, | ||
| 140 | - this.nickname, | ||
| 141 | - this.uidList, | ||
| 142 | - this.isExamine, | ||
| 143 | - this.isType, | ||
| 144 | - this.isOpen, | ||
| 145 | - this.isOpenBool, | ||
| 146 | - this.price, | ||
| 147 | - this.use, | ||
| 148 | - this.arule, | ||
| 149 | - this.expDate, | ||
| 150 | - this.nickNameShow, | ||
| 151 | - this.grantNum, | ||
| 152 | - this.urllink, | ||
| 153 | - this.liteQrcode, | ||
| 154 | - // this.aexpiration, | ||
| 155 | - this.number, | ||
| 156 | - this.aexpiration, | ||
| 157 | - this.expirationDate, | ||
| 158 | - ); | 128 | + this.id, |
| 129 | + this.uid, | ||
| 130 | + this.aname, | ||
| 131 | + this.desc, | ||
| 132 | + this.stime, | ||
| 133 | + this.etime, | ||
| 134 | + this.explain, | ||
| 135 | + this.status, | ||
| 136 | + this.cdate, | ||
| 137 | + this.receiveNum, | ||
| 138 | + this.useNum, | ||
| 139 | + this.nickname, | ||
| 140 | + this.uidList, | ||
| 141 | + this.isExamine, | ||
| 142 | + this.isType, | ||
| 143 | + this.isOpen, | ||
| 144 | + this.isOpenBool, | ||
| 145 | + this.price, | ||
| 146 | + this.use, | ||
| 147 | + this.arule, | ||
| 148 | + this.expDate, | ||
| 149 | + this.nickNameShow, | ||
| 150 | + this.grantNum, | ||
| 151 | + this.urllink, | ||
| 152 | + this.liteQrcode, | ||
| 153 | + // this.aexpiration, | ||
| 154 | + this.number, | ||
| 155 | + this.aexpiration, | ||
| 156 | + this.expirationDate, | ||
| 157 | + ); | ||
| 159 | 158 | ||
| 160 | factory CouponSunModel.fromJson(Map<String, dynamic> srcJson) => | 159 | factory CouponSunModel.fromJson(Map<String, dynamic> srcJson) => |
| 161 | _$CouponSunModelFromJson(srcJson); | 160 | _$CouponSunModelFromJson(srcJson); |
| @@ -228,17 +227,17 @@ class Arule extends Object { | @@ -228,17 +227,17 @@ class Arule extends Object { | ||
| 228 | // String commission; | 227 | // String commission; |
| 229 | 228 | ||
| 230 | Arule( | 229 | Arule( |
| 231 | - this.isSameDay, | ||
| 232 | - this.isAccumulation, | ||
| 233 | - this.isCompartment, | ||
| 234 | - this.isEatin, | ||
| 235 | - this.isTakeout, | ||
| 236 | - this.isAppointment, | ||
| 237 | - this.isShareLose, | ||
| 238 | - this.isShareHave, | ||
| 239 | - // this.isCommission, | ||
| 240 | - // this.commission | ||
| 241 | - ); | 230 | + this.isSameDay, |
| 231 | + this.isAccumulation, | ||
| 232 | + this.isCompartment, | ||
| 233 | + this.isEatin, | ||
| 234 | + this.isTakeout, | ||
| 235 | + this.isAppointment, | ||
| 236 | + this.isShareLose, | ||
| 237 | + this.isShareHave, | ||
| 238 | + // this.isCommission, | ||
| 239 | + // this.commission | ||
| 240 | + ); | ||
| 242 | 241 | ||
| 243 | factory Arule.fromJson(Map<String, dynamic> srcJson) => | 242 | factory Arule.fromJson(Map<String, dynamic> srcJson) => |
| 244 | _$AruleFromJson(srcJson); | 243 | _$AruleFromJson(srcJson); |
| @@ -135,6 +135,20 @@ class _CouponItemState extends State<CouponItem> { | @@ -135,6 +135,20 @@ class _CouponItemState extends State<CouponItem> { | ||
| 135 | fontWeight: FontWeight.normal)), | 135 | fontWeight: FontWeight.normal)), |
| 136 | ), | 136 | ), |
| 137 | VEmptyView(20), | 137 | VEmptyView(20), |
| 138 | + if (sunModel.isType == '3' && | ||
| 139 | + sunModel.expirationDate != null) | ||
| 140 | + Container( | ||
| 141 | + child: Text( | ||
| 142 | + sunModel.expirationDate!.validForever == | ||
| 143 | + '1' | ||
| 144 | + ? '使用时间:永久有效' | ||
| 145 | + : '使用时间:${ObjectUtil.isNotEmpty(sunModel.expirationDate!.stime) ? Utils.getDateStrFromJiekou(sunModel.expirationDate!.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.expirationDate!.etime) ? Utils.getDateStrFromJiekou(sunModel.expirationDate!.etime) : '--'}', | ||
| 146 | + style: TextStyle( | ||
| 147 | + color: widget.from == 'history' | ||
| 148 | + ? MyColours.color_BFC4D4 | ||
| 149 | + : MyColours.color_999999, | ||
| 150 | + fontSize: ScreenUtil().setSp(20))), | ||
| 151 | + ), | ||
| 138 | (ObjectUtil.isNotEmpty(sunModel.stime) && | 152 | (ObjectUtil.isNotEmpty(sunModel.stime) && |
| 139 | sunModel.stime != '0') || | 153 | sunModel.stime != '0') || |
| 140 | (ObjectUtil.isNotEmpty(sunModel.etime) && | 154 | (ObjectUtil.isNotEmpty(sunModel.etime) && |
| @@ -79,7 +79,8 @@ class _CouponItemFState extends State<CouponItemF> { | @@ -79,7 +79,8 @@ class _CouponItemFState extends State<CouponItemF> { | ||
| 79 | onTap: widget.onPressedSelect, | 79 | onTap: widget.onPressedSelect, |
| 80 | child: Container( | 80 | child: Container( |
| 81 | // color: Colors.red, | 81 | // color: Colors.red, |
| 82 | - padding: EdgeInsets.symmetric(vertical: w(50),horizontal: w(5)), | 82 | + padding: EdgeInsets.symmetric( |
| 83 | + vertical: w(50), horizontal: w(5)), | ||
| 83 | child: Image.asset( | 84 | child: Image.asset( |
| 84 | Utils.getImgPath(sunModel.isCheck | 85 | Utils.getImgPath(sunModel.isCheck |
| 85 | ? widget.radio | 86 | ? widget.radio |
| @@ -420,9 +421,26 @@ class _CouponItemFState extends State<CouponItemF> { | @@ -420,9 +421,26 @@ class _CouponItemFState extends State<CouponItemF> { | ||
| 420 | ], | 421 | ], |
| 421 | ), | 422 | ), |
| 422 | VEmptyView(16), | 423 | VEmptyView(16), |
| 423 | - (ObjectUtil.isNotEmpty(sunModel.stime) && | 424 | + if (sunModel.isType == '3' && |
| 425 | + sunModel.expirationDate != null) | ||
| 426 | + Container( | ||
| 427 | + child: Text( | ||
| 428 | + sunModel.expirationDate!.validForever == | ||
| 429 | + '1' | ||
| 430 | + ? '使用时间:永久有效' | ||
| 431 | + : '使用时间:${ObjectUtil.isNotEmpty(sunModel.expirationDate!.stime) ? Utils.getDateStrFromJiekou(sunModel.expirationDate!.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.expirationDate!.etime) ? Utils.getDateStrFromJiekou(sunModel.expirationDate!.etime) : '--'}', | ||
| 432 | + style: TextStyle( | ||
| 433 | + color: widget.from == 'history' | ||
| 434 | + ? MyColours.color_BFC4D4 | ||
| 435 | + : MyColours.color_999999, | ||
| 436 | + fontSize: ScreenUtil().setSp(20))), | ||
| 437 | + ), | ||
| 438 | + (sunModel.isType == '1' && | ||
| 439 | + ObjectUtil.isNotEmpty( | ||
| 440 | + sunModel.stime) && | ||
| 424 | sunModel.stime != '0') || | 441 | sunModel.stime != '0') || |
| 425 | - (ObjectUtil.isNotEmpty( | 442 | + (sunModel.isType == '1' && |
| 443 | + ObjectUtil.isNotEmpty( | ||
| 426 | sunModel.etime) && | 444 | sunModel.etime) && |
| 427 | sunModel.etime != '0') | 445 | sunModel.etime != '0') |
| 428 | ? Container( | 446 | ? Container( |
| @@ -33,7 +33,8 @@ class PaymentGiftPage extends StatefulWidget { | @@ -33,7 +33,8 @@ class PaymentGiftPage extends StatefulWidget { | ||
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | class _PaymentGiftPageState extends State<PaymentGiftPage> { | 35 | class _PaymentGiftPageState extends State<PaymentGiftPage> { |
| 36 | - bool fullReduction = true; | 36 | + bool fullReduction = false; //默认都不选中 |
| 37 | + bool stairs = false; //默认都不选中 | ||
| 37 | 38 | ||
| 38 | String fromDateFull = '选择日期'; | 39 | String fromDateFull = '选择日期'; |
| 39 | String endDateFull = '选择日期'; | 40 | String endDateFull = '选择日期'; |
| @@ -77,12 +78,9 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | @@ -77,12 +78,9 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | ||
| 77 | .getActivityConfig(context, params, isShowLoading: isShowLoading); | 78 | .getActivityConfig(context, params, isShowLoading: isShowLoading); |
| 78 | if (financeProvider!.giftData != null) { | 79 | if (financeProvider!.giftData != null) { |
| 79 | //已经设置了数据 | 80 | //已经设置了数据 |
| 80 | - fullReduction = financeProvider!.giftData!.fullReduction == '1' | ||
| 81 | - ? true | ||
| 82 | - : financeProvider!.giftData!.stairs == '1' | ||
| 83 | - ? false | ||
| 84 | - : true; | ||
| 85 | - | 81 | + fullReduction = |
| 82 | + financeProvider!.giftData!.fullReduction == '1' ? true : false; | ||
| 83 | + stairs = financeProvider!.giftData!.stairs == '1' ? true : false; | ||
| 86 | if (financeProvider!.giftData!.fullReductionData != null) { | 84 | if (financeProvider!.giftData!.fullReductionData != null) { |
| 87 | rule = financeProvider!.giftData!.fullReductionData!.rule == '1' | 85 | rule = financeProvider!.giftData!.fullReductionData!.rule == '1' |
| 88 | ? true | 86 | ? true |
| @@ -155,7 +153,8 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | @@ -155,7 +153,8 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | ||
| 155 | Utils.showToast('请选择满减返券活动的优惠券!'); | 153 | Utils.showToast('请选择满减返券活动的优惠券!'); |
| 156 | return; | 154 | return; |
| 157 | } | 155 | } |
| 158 | - } else { | 156 | + } |
| 157 | + if (stairs) { | ||
| 159 | //阶梯返券 | 158 | //阶梯返券 |
| 160 | if (fromDateLadder == '选择日期') { | 159 | if (fromDateLadder == '选择日期') { |
| 161 | Utils.showToast('请选择阶梯返券活动的开始时间!'); | 160 | Utils.showToast('请选择阶梯返券活动的开始时间!'); |
| @@ -254,7 +253,7 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | @@ -254,7 +253,7 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | ||
| 254 | 'sellerid': | 253 | 'sellerid': |
| 255 | Provider.of<UserModel>(context, listen: false).user!.sellerid!, | 254 | Provider.of<UserModel>(context, listen: false).user!.sellerid!, |
| 256 | 'full_reduction': fullReduction ? '1' : '0', | 255 | 'full_reduction': fullReduction ? '1' : '0', |
| 257 | - 'stairs': !fullReduction ? '1' : '0', | 256 | + 'stairs': stairs ? '1' : '0', |
| 258 | 'full_reduction_data': | 257 | 'full_reduction_data': |
| 259 | fullReductionData.length == 0 ? null : jsonEncode(fullReductionData), | 258 | fullReductionData.length == 0 ? null : jsonEncode(fullReductionData), |
| 260 | 'stairs_data': stairsData.length == 0 ? null : jsonEncode(stairsData), | 259 | 'stairs_data': stairsData.length == 0 ? null : jsonEncode(stairsData), |
| @@ -521,7 +520,7 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | @@ -521,7 +520,7 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | ||
| 521 | ///发放阶梯 | 520 | ///发放阶梯 |
| 522 | Widget _ladderWidget() { | 521 | Widget _ladderWidget() { |
| 523 | return ListView.builder( | 522 | return ListView.builder( |
| 524 | - controller: controller, | 523 | + controller: controller, |
| 525 | shrinkWrap: true, | 524 | shrinkWrap: true, |
| 526 | itemCount: ladderSelectFree.length, | 525 | itemCount: ladderSelectFree.length, |
| 527 | itemBuilder: (context, index) { | 526 | itemBuilder: (context, index) { |
| @@ -612,12 +611,15 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | @@ -612,12 +611,15 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | ||
| 612 | children: [ | 611 | children: [ |
| 613 | Expanded( | 612 | Expanded( |
| 614 | child: SingleChildScrollView( | 613 | child: SingleChildScrollView( |
| 615 | - controller: controller, | 614 | + controller: controller, |
| 616 | child: Column( | 615 | child: Column( |
| 617 | children: [ | 616 | children: [ |
| 618 | _canUse('开通实际支付满减返券【拉复购】', fullReduction, () { | 617 | _canUse('开通实际支付满减返券【拉复购】', fullReduction, () { |
| 619 | setState(() { | 618 | setState(() { |
| 620 | fullReduction = !fullReduction; | 619 | fullReduction = !fullReduction; |
| 620 | + if (fullReduction) { | ||
| 621 | + stairs = false; | ||
| 622 | + } | ||
| 621 | }); | 623 | }); |
| 622 | }), | 624 | }), |
| 623 | _select('活动开始于', fromDateFull, () { | 625 | _select('活动开始于', fromDateFull, () { |
| @@ -799,10 +801,13 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | @@ -799,10 +801,13 @@ class _PaymentGiftPageState extends State<PaymentGiftPage> { | ||
| 799 | ), | 801 | ), |
| 800 | ), | 802 | ), |
| 801 | VEmptyView(22), | 803 | VEmptyView(22), |
| 802 | - _canUse('开通实际支付阶梯返券【提客单】', !fullReduction, () { | 804 | + _canUse('开通实际支付阶梯返券【提客单】', stairs, () { |
| 803 | // | 805 | // |
| 804 | setState(() { | 806 | setState(() { |
| 805 | - fullReduction = !fullReduction; | 807 | + stairs = !stairs; |
| 808 | + if (stairs) { | ||
| 809 | + fullReduction = false; | ||
| 810 | + } | ||
| 806 | }); | 811 | }); |
| 807 | }), | 812 | }), |
| 808 | _select('活动开始于', fromDateLadder, () { | 813 | _select('活动开始于', fromDateLadder, () { |
| @@ -33,7 +33,7 @@ import '../../../../utils/screen_util.dart'; | @@ -33,7 +33,7 @@ import '../../../../utils/screen_util.dart'; | ||
| 33 | */ | 33 | */ |
| 34 | class PaymentGiftSelectPage extends StatefulWidget { | 34 | class PaymentGiftSelectPage extends StatefulWidget { |
| 35 | final String? type; | 35 | final String? type; |
| 36 | - final List<CouponSunModel>?couponList; | 36 | + final List<CouponSunModel>? couponList; |
| 37 | final String? from; | 37 | final String? from; |
| 38 | final String? end; | 38 | final String? end; |
| 39 | 39 | ||
| @@ -124,22 +124,28 @@ class _PaymentGiftSelectPageState extends State<PaymentGiftSelectPage> { | @@ -124,22 +124,28 @@ class _PaymentGiftSelectPageState extends State<PaymentGiftSelectPage> { | ||
| 124 | // data.stime | 124 | // data.stime |
| 125 | // data.etime | 125 | // data.etime |
| 126 | //重组数据 | 126 | //重组数据 |
| 127 | -// 券开始早于活动开始 && 券结束大于活动结束 | ||
| 128 | - DateTime dateTimes = DateTime.fromMillisecondsSinceEpoch( | ||
| 129 | - int.parse(data.stime.toString()) * 1000); | ||
| 130 | - String fromC = DateUtil.formatDate(dateTimes, format: DateFormats.y_mo_d); | ||
| 131 | - | ||
| 132 | - DateTime dateTimeseEnd = DateTime.fromMillisecondsSinceEpoch( | ||
| 133 | - int.parse(data.etime.toString()) * 1000); | ||
| 134 | - String endC = | ||
| 135 | - DateUtil.formatDate(dateTimeseEnd, format: DateFormats.y_mo_d); | ||
| 136 | - if (DateUtil.getDateTime(fromC) | ||
| 137 | - .compareTo(DateUtil.getDateTime(widget.from!)) <= | ||
| 138 | - 0 && | ||
| 139 | - DateUtil.getDateTime(widget.end!) | ||
| 140 | - .compareTo(DateUtil.getDateTime(endC)) <= | ||
| 141 | - 0) { | 127 | + if (data.expirationDate?.validForever == '1') { |
| 128 | + //长期有效 | ||
| 142 | temp.add(couponProvider.couponListSelect![i]); | 129 | temp.add(couponProvider.couponListSelect![i]); |
| 130 | + } else { | ||
| 131 | + // 券开始早于活动开始 && 券结束大于活动结束 | ||
| 132 | + DateTime dateTimes = DateTime.fromMillisecondsSinceEpoch( | ||
| 133 | + int.parse(data.stime.toString()) * 1000); | ||
| 134 | + String fromC = | ||
| 135 | + DateUtil.formatDate(dateTimes, format: DateFormats.y_mo_d); | ||
| 136 | + | ||
| 137 | + DateTime dateTimeseEnd = DateTime.fromMillisecondsSinceEpoch( | ||
| 138 | + int.parse(data.etime.toString()) * 1000); | ||
| 139 | + String endC = | ||
| 140 | + DateUtil.formatDate(dateTimeseEnd, format: DateFormats.y_mo_d); | ||
| 141 | + if (DateUtil.getDateTime(fromC) | ||
| 142 | + .compareTo(DateUtil.getDateTime(widget.from!)) <= | ||
| 143 | + 0 && | ||
| 144 | + DateUtil.getDateTime(widget.end!) | ||
| 145 | + .compareTo(DateUtil.getDateTime(endC)) <= | ||
| 146 | + 0) { | ||
| 147 | + temp.add(couponProvider.couponListSelect![i]); | ||
| 148 | + } | ||
| 143 | } | 149 | } |
| 144 | } | 150 | } |
| 145 | couponProvider.couponListSelect = temp; | 151 | couponProvider.couponListSelect = temp; |
| @@ -285,10 +291,12 @@ class _PaymentGiftSelectPageState extends State<PaymentGiftSelectPage> { | @@ -285,10 +291,12 @@ class _PaymentGiftSelectPageState extends State<PaymentGiftSelectPage> { | ||
| 285 | needNum: false, | 291 | needNum: false, |
| 286 | couponSonModel: | 292 | couponSonModel: |
| 287 | couponProvider.couponListSelect![index], | 293 | couponProvider.couponListSelect![index], |
| 288 | - onPressed: () { | ||
| 289 | - NavigatorUtil.goCouponDetailPage(context, couponProvider.couponListSelect![index], | ||
| 290 | - idStr: couponProvider.couponListSelect![index].id); | ||
| 291 | - }, | 294 | + onPressed: () { |
| 295 | + NavigatorUtil.goCouponDetailPage(context, | ||
| 296 | + couponProvider.couponListSelect![index], | ||
| 297 | + idStr: couponProvider | ||
| 298 | + .couponListSelect![index].id); | ||
| 299 | + }, | ||
| 292 | onPressedSelect: () { | 300 | onPressedSelect: () { |
| 293 | // bool old = couponProvider | 301 | // bool old = couponProvider |
| 294 | // .couponListSelect[index].isCheck; | 302 | // .couponListSelect[index].isCheck; |
| @@ -4918,6 +4918,7 @@ class DialogUtil { | @@ -4918,6 +4918,7 @@ class DialogUtil { | ||
| 4918 | child: TextField( | 4918 | child: TextField( |
| 4919 | controller: controllerMin, | 4919 | controller: controllerMin, |
| 4920 | maxLines: 1, | 4920 | maxLines: 1, |
| 4921 | + maxLength: 3, // 设置最大输入字符数为3 | ||
| 4921 | // //光标颜色 | 4922 | // //光标颜色 |
| 4922 | // cursorColor: | 4923 | // cursorColor: |
| 4923 | // widget.isSelect ? Colors.white : MyColours.color_199095, | 4924 | // widget.isSelect ? Colors.white : MyColours.color_199095, |
| @@ -4933,6 +4934,7 @@ class DialogUtil { | @@ -4933,6 +4934,7 @@ class DialogUtil { | ||
| 4933 | .digitsOnly | 4934 | .digitsOnly |
| 4934 | ], | 4935 | ], |
| 4935 | decoration: InputDecoration( | 4936 | decoration: InputDecoration( |
| 4937 | + counterText: "", | ||
| 4936 | isCollapsed: true, | 4938 | isCollapsed: true, |
| 4937 | contentPadding: EdgeInsets | 4939 | contentPadding: EdgeInsets |
| 4938 | .zero, //设置文字内容与边框距离 | 4940 | .zero, //设置文字内容与边框距离 |
| @@ -5003,6 +5005,7 @@ class DialogUtil { | @@ -5003,6 +5005,7 @@ class DialogUtil { | ||
| 5003 | child: TextField( | 5005 | child: TextField( |
| 5004 | controller: controllerMax, | 5006 | controller: controllerMax, |
| 5005 | maxLines: 1, | 5007 | maxLines: 1, |
| 5008 | + maxLength: 3, // 设置最大输入字符数为3 | ||
| 5006 | // //光标颜色 | 5009 | // //光标颜色 |
| 5007 | // cursorColor: | 5010 | // cursorColor: |
| 5008 | // widget.isSelect ? Colors.white : MyColours.color_199095, | 5011 | // widget.isSelect ? Colors.white : MyColours.color_199095, |
| @@ -5021,6 +5024,7 @@ class DialogUtil { | @@ -5021,6 +5024,7 @@ class DialogUtil { | ||
| 5021 | isCollapsed: true, | 5024 | isCollapsed: true, |
| 5022 | contentPadding: EdgeInsets | 5025 | contentPadding: EdgeInsets |
| 5023 | .zero, //设置文字内容与边框距离 | 5026 | .zero, //设置文字内容与边框距离 |
| 5027 | + counterText: "", // 隐藏默认的字符计数器 | ||
| 5024 | 5028 | ||
| 5025 | // enabledBorder: UnderlineInputBorder( | 5029 | // enabledBorder: UnderlineInputBorder( |
| 5026 | // borderSide: BorderSide( | 5030 | // borderSide: BorderSide( |
| @@ -5523,6 +5527,7 @@ class DialogUtil { | @@ -5523,6 +5527,7 @@ class DialogUtil { | ||
| 5523 | child: TextField( | 5527 | child: TextField( |
| 5524 | controller: controllerMin, | 5528 | controller: controllerMin, |
| 5525 | maxLines: 1, | 5529 | maxLines: 1, |
| 5530 | + maxLength: 3, // 设置最大输入字符数为3 | ||
| 5526 | // //光标颜色 | 5531 | // //光标颜色 |
| 5527 | // cursorColor: | 5532 | // cursorColor: |
| 5528 | // widget.isSelect ? Colors.white : MyColours.color_199095, | 5533 | // widget.isSelect ? Colors.white : MyColours.color_199095, |
| @@ -5535,6 +5540,7 @@ class DialogUtil { | @@ -5535,6 +5540,7 @@ class DialogUtil { | ||
| 5535 | FilteringTextInputFormatter.digitsOnly | 5540 | FilteringTextInputFormatter.digitsOnly |
| 5536 | ], | 5541 | ], |
| 5537 | decoration: InputDecoration( | 5542 | decoration: InputDecoration( |
| 5543 | + counterText: "", // 隐藏默认的字符计数器 | ||
| 5538 | isCollapsed: true, | 5544 | isCollapsed: true, |
| 5539 | contentPadding: | 5545 | contentPadding: |
| 5540 | EdgeInsets.zero, //设置文字内容与边框距离 | 5546 | EdgeInsets.zero, //设置文字内容与边框距离 |
| @@ -5598,6 +5604,7 @@ class DialogUtil { | @@ -5598,6 +5604,7 @@ class DialogUtil { | ||
| 5598 | child: TextField( | 5604 | child: TextField( |
| 5599 | controller: controllerMax, | 5605 | controller: controllerMax, |
| 5600 | maxLines: 1, | 5606 | maxLines: 1, |
| 5607 | + maxLength: 3, // 设置最大输入字符数为3 | ||
| 5601 | // //光标颜色 | 5608 | // //光标颜色 |
| 5602 | // cursorColor: | 5609 | // cursorColor: |
| 5603 | // widget.isSelect ? Colors.white : MyColours.color_199095, | 5610 | // widget.isSelect ? Colors.white : MyColours.color_199095, |
| @@ -5610,6 +5617,7 @@ class DialogUtil { | @@ -5610,6 +5617,7 @@ class DialogUtil { | ||
| 5610 | FilteringTextInputFormatter.digitsOnly | 5617 | FilteringTextInputFormatter.digitsOnly |
| 5611 | ], | 5618 | ], |
| 5612 | decoration: InputDecoration( | 5619 | decoration: InputDecoration( |
| 5620 | + counterText: "", // 隐藏默认的字符计数器 | ||
| 5613 | isCollapsed: true, | 5621 | isCollapsed: true, |
| 5614 | contentPadding: | 5622 | contentPadding: |
| 5615 | EdgeInsets.zero, //设置文字内容与边框距离 | 5623 | EdgeInsets.zero, //设置文字内容与边框距离 |
| @@ -6228,6 +6236,7 @@ class DialogUtil { | @@ -6228,6 +6236,7 @@ class DialogUtil { | ||
| 6228 | child: TextField( | 6236 | child: TextField( |
| 6229 | controller: controllerMin, | 6237 | controller: controllerMin, |
| 6230 | maxLines: 1, | 6238 | maxLines: 1, |
| 6239 | + maxLength: 3, // 设置最大输入字符数为3 | ||
| 6231 | // //光标颜色 | 6240 | // //光标颜色 |
| 6232 | // cursorColor: | 6241 | // cursorColor: |
| 6233 | // widget.isSelect ? Colors.white : MyColours.color_199095, | 6242 | // widget.isSelect ? Colors.white : MyColours.color_199095, |
| @@ -6240,6 +6249,7 @@ class DialogUtil { | @@ -6240,6 +6249,7 @@ class DialogUtil { | ||
| 6240 | FilteringTextInputFormatter.digitsOnly | 6249 | FilteringTextInputFormatter.digitsOnly |
| 6241 | ], | 6250 | ], |
| 6242 | decoration: InputDecoration( | 6251 | decoration: InputDecoration( |
| 6252 | + counterText: "", // 隐藏默认的字符计数器 | ||
| 6243 | isCollapsed: true, | 6253 | isCollapsed: true, |
| 6244 | contentPadding: | 6254 | contentPadding: |
| 6245 | EdgeInsets.zero, //设置文字内容与边框距离 | 6255 | EdgeInsets.zero, //设置文字内容与边框距离 |
| @@ -6303,6 +6313,7 @@ class DialogUtil { | @@ -6303,6 +6313,7 @@ class DialogUtil { | ||
| 6303 | child: TextField( | 6313 | child: TextField( |
| 6304 | controller: controllerMax, | 6314 | controller: controllerMax, |
| 6305 | maxLines: 1, | 6315 | maxLines: 1, |
| 6316 | + maxLength: 3, // 设置最大输入字符数为3 | ||
| 6306 | // //光标颜色 | 6317 | // //光标颜色 |
| 6307 | // cursorColor: | 6318 | // cursorColor: |
| 6308 | // widget.isSelect ? Colors.white : MyColours.color_199095, | 6319 | // widget.isSelect ? Colors.white : MyColours.color_199095, |
| @@ -6316,6 +6327,7 @@ class DialogUtil { | @@ -6316,6 +6327,7 @@ class DialogUtil { | ||
| 6316 | ], | 6327 | ], |
| 6317 | decoration: InputDecoration( | 6328 | decoration: InputDecoration( |
| 6318 | isCollapsed: true, | 6329 | isCollapsed: true, |
| 6330 | + counterText: "", // 隐藏默认的字符计数器 | ||
| 6319 | contentPadding: | 6331 | contentPadding: |
| 6320 | EdgeInsets.zero, //设置文字内容与边框距离 | 6332 | EdgeInsets.zero, //设置文字内容与边框距离 |
| 6321 | 6333 | ||
| @@ -7358,10 +7370,14 @@ class DialogUtil { | @@ -7358,10 +7370,14 @@ class DialogUtil { | ||
| 7358 | TextEditingController controller = TextEditingController(); | 7370 | TextEditingController controller = TextEditingController(); |
| 7359 | FocusNode focusNode = FocusNode(); | 7371 | FocusNode focusNode = FocusNode(); |
| 7360 | bool showArea = true; | 7372 | bool showArea = true; |
| 7373 | + areas.remove('全部'); | ||
| 7361 | bool showPnumMin = true; | 7374 | bool showPnumMin = true; |
| 7362 | bool showPnumMax = true; | 7375 | bool showPnumMax = true; |
| 7363 | - String pnumMin = ''; | ||
| 7364 | - String pnumMax = ''; | 7376 | + // String pnumMin = ''; |
| 7377 | + // String pnumMax = ''; | ||
| 7378 | + | ||
| 7379 | + TextEditingController controllerMax = TextEditingController(); | ||
| 7380 | + TextEditingController controllerMin = TextEditingController(); | ||
| 7365 | // StateSetter globalState; | 7381 | // StateSetter globalState; |
| 7366 | // //输入框焦点 | 7382 | // //输入框焦点 |
| 7367 | // focusNode.addListener(() { | 7383 | // focusNode.addListener(() { |
| @@ -7556,38 +7572,202 @@ class DialogUtil { | @@ -7556,38 +7572,202 @@ class DialogUtil { | ||
| 7556 | color: | 7572 | color: |
| 7557 | MyColours.color_333333), | 7573 | MyColours.color_333333), |
| 7558 | ), | 7574 | ), |
| 7559 | - HEmptyView(40), | 7575 | + HEmptyView(5), |
| 7560 | // Stack( | 7576 | // Stack( |
| 7561 | // overflow: Overflow.visible, | 7577 | // overflow: Overflow.visible, |
| 7562 | // children: [ | 7578 | // children: [ |
| 7563 | - btnChoose(pnumMin, | ||
| 7564 | - ScreenUtil().setWidth(54 * 2), | ||
| 7565 | - (value) { | ||
| 7566 | - state(() { | ||
| 7567 | - showArea = true; | ||
| 7568 | - showPnumMax = true; | ||
| 7569 | - showPnumMin = !showPnumMin; | ||
| 7570 | - }); | ||
| 7571 | - }), | ||
| 7572 | - HEmptyView(20), | 7579 | + // btnChoose(pnumMin, |
| 7580 | + // ScreenUtil().setWidth(54 * 2), | ||
| 7581 | + // (value) { | ||
| 7582 | + // state(() { | ||
| 7583 | + // showArea = true; | ||
| 7584 | + // showPnumMax = true; | ||
| 7585 | + // showPnumMin = !showPnumMin; | ||
| 7586 | + // }); | ||
| 7587 | + // }), | ||
| 7588 | + // HEmptyView(20), | ||
| 7589 | + // Text( | ||
| 7590 | + // '至', | ||
| 7591 | + // style: TextStyle( | ||
| 7592 | + // fontSize: | ||
| 7593 | + // ScreenUtil().setSp(30), | ||
| 7594 | + // color: | ||
| 7595 | + // MyColours.color_199095), | ||
| 7596 | + // ), | ||
| 7597 | + // HEmptyView(20), | ||
| 7598 | + // btnChoose(pnumMax, | ||
| 7599 | + // ScreenUtil().setWidth(54 * 2), | ||
| 7600 | + // (value) { | ||
| 7601 | + // state(() { | ||
| 7602 | + // showArea = true; | ||
| 7603 | + // showPnumMin = true; | ||
| 7604 | + // showPnumMax = !showPnumMax; | ||
| 7605 | + // }); | ||
| 7606 | + // }), | ||
| 7607 | + Container( | ||
| 7608 | + width: w(76), | ||
| 7609 | + // margin: EdgeInsets.symmetric( | ||
| 7610 | + // horizontal: ScreenUtil().setWidth(44)), | ||
| 7611 | + height: w(30), | ||
| 7612 | + alignment: Alignment.center, | ||
| 7613 | + decoration: BoxDecoration( | ||
| 7614 | + color: | ||
| 7615 | + MyColours.color_f3f3f3, | ||
| 7616 | + borderRadius: | ||
| 7617 | + BorderRadius.circular( | ||
| 7618 | + ScreenUtil() | ||
| 7619 | + .setWidth(10))), | ||
| 7620 | + child: TextField( | ||
| 7621 | + controller: controllerMin, | ||
| 7622 | + maxLines: 1, | ||
| 7623 | + maxLength: 3, // 设置最大输入字符数为3 | ||
| 7624 | + // //光标颜色 | ||
| 7625 | + // cursorColor: | ||
| 7626 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 7627 | + //输入文本的样式 | ||
| 7628 | + textAlign: TextAlign.center, | ||
| 7629 | + style: TextStyle( | ||
| 7630 | + fontSize: ScreenUtil() | ||
| 7631 | + .setSp(30), | ||
| 7632 | + color: MyColours | ||
| 7633 | + .color_515151), | ||
| 7634 | + inputFormatters: [ | ||
| 7635 | + FilteringTextInputFormatter | ||
| 7636 | + .digitsOnly | ||
| 7637 | + ], | ||
| 7638 | + decoration: InputDecoration( | ||
| 7639 | + counterText: "", | ||
| 7640 | + isCollapsed: true, | ||
| 7641 | + contentPadding: EdgeInsets | ||
| 7642 | + .zero, //设置文字内容与边框距离 | ||
| 7643 | + // enabledBorder: UnderlineInputBorder( | ||
| 7644 | + // borderSide: BorderSide( | ||
| 7645 | + // color: MyColours.color_efefef), | ||
| 7646 | + // ), | ||
| 7647 | + // focusedBorder: UnderlineInputBorder( | ||
| 7648 | + // borderSide: BorderSide( | ||
| 7649 | + // color: MyColours.color_efefef, | ||
| 7650 | + // width: ScreenUtil().setWidth(2)), | ||
| 7651 | + // ), | ||
| 7652 | + // prefixText: '*', | ||
| 7653 | + // prefixStyle: TextStyle( | ||
| 7654 | + // fontSize: ScreenUtil().setSp(32), | ||
| 7655 | + // color: MyColours.color_E95750), | ||
| 7656 | + border: OutlineInputBorder( | ||
| 7657 | + borderSide: | ||
| 7658 | + BorderSide.none), | ||
| 7659 | + hintText: '输入最小', | ||
| 7660 | + hintStyle: TextStyle( | ||
| 7661 | + color: MyColours | ||
| 7662 | + .color_BFC4D4, | ||
| 7663 | + fontSize: ScreenUtil() | ||
| 7664 | + .setSp(30), | ||
| 7665 | + ), | ||
| 7666 | + ), | ||
| 7667 | + onChanged: (value) { | ||
| 7668 | + state(() {}); | ||
| 7669 | + }, | ||
| 7670 | + onEditingComplete: () { | ||
| 7671 | + FocusScope.of(context) | ||
| 7672 | + .requestFocus( | ||
| 7673 | + FocusNode()); //点击空白处隐藏键盘 | ||
| 7674 | + }, | ||
| 7675 | + keyboardType: | ||
| 7676 | + TextInputType.number, | ||
| 7677 | + ), | ||
| 7678 | + ), | ||
| 7679 | + | ||
| 7680 | + // btnChooseTableManagePnum(pnumMin, 'min', | ||
| 7681 | + // ScreenUtil().setWidth(54 * 2), (value) { | ||
| 7682 | + // state(() { | ||
| 7683 | + // showBaojian = true; | ||
| 7684 | + // showPnumMax = true; | ||
| 7685 | + // showPnumMin = !showPnumMin; | ||
| 7686 | + // }); | ||
| 7687 | + // }), | ||
| 7688 | + HEmptyView(10), | ||
| 7573 | Text( | 7689 | Text( |
| 7574 | '至', | 7690 | '至', |
| 7575 | style: TextStyle( | 7691 | style: TextStyle( |
| 7576 | fontSize: | 7692 | fontSize: |
| 7577 | ScreenUtil().setSp(30), | 7693 | ScreenUtil().setSp(30), |
| 7578 | color: | 7694 | color: |
| 7579 | - MyColours.color_199095), | 7695 | + MyColours.color_000000), |
| 7696 | + ), | ||
| 7697 | + HEmptyView(10), | ||
| 7698 | + | ||
| 7699 | + Container( | ||
| 7700 | + width: w(76), | ||
| 7701 | + height: w(30), | ||
| 7702 | + alignment: Alignment.center, | ||
| 7703 | + decoration: BoxDecoration( | ||
| 7704 | + color: | ||
| 7705 | + MyColours.color_f3f3f3, | ||
| 7706 | + borderRadius: | ||
| 7707 | + BorderRadius.circular( | ||
| 7708 | + ScreenUtil() | ||
| 7709 | + .setWidth(10))), | ||
| 7710 | + child: TextField( | ||
| 7711 | + controller: controllerMax, | ||
| 7712 | + maxLines: 1, | ||
| 7713 | + maxLength: 3, // 设置最大输入字符数为3 | ||
| 7714 | + // //光标颜色 | ||
| 7715 | + // cursorColor: | ||
| 7716 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 7717 | + //输入文本的样式 | ||
| 7718 | + textAlign: TextAlign.center, | ||
| 7719 | + style: TextStyle( | ||
| 7720 | + fontSize: ScreenUtil() | ||
| 7721 | + .setSp(30), | ||
| 7722 | + color: MyColours | ||
| 7723 | + .color_515151), | ||
| 7724 | + inputFormatters: [ | ||
| 7725 | + FilteringTextInputFormatter | ||
| 7726 | + .digitsOnly | ||
| 7727 | + ], | ||
| 7728 | + decoration: InputDecoration( | ||
| 7729 | + isCollapsed: true, | ||
| 7730 | + contentPadding: EdgeInsets | ||
| 7731 | + .zero, //设置文字内容与边框距离 | ||
| 7732 | + counterText: | ||
| 7733 | + "", // 隐藏默认的字符计数器 | ||
| 7734 | + | ||
| 7735 | + // enabledBorder: UnderlineInputBorder( | ||
| 7736 | + // borderSide: BorderSide( | ||
| 7737 | + // color: MyColours.color_efefef), | ||
| 7738 | + // ), | ||
| 7739 | + // focusedBorder: UnderlineInputBorder( | ||
| 7740 | + // borderSide: BorderSide( | ||
| 7741 | + // color: MyColours.color_efefef, | ||
| 7742 | + // width: ScreenUtil().setWidth(2)), | ||
| 7743 | + // ), | ||
| 7744 | + // prefixText: '*', | ||
| 7745 | + // prefixStyle: TextStyle( | ||
| 7746 | + // fontSize: ScreenUtil().setSp(32), | ||
| 7747 | + // color: MyColours.color_E95750), | ||
| 7748 | + border: OutlineInputBorder( | ||
| 7749 | + borderSide: | ||
| 7750 | + BorderSide.none), | ||
| 7751 | + hintText: '输入最大', | ||
| 7752 | + hintStyle: TextStyle( | ||
| 7753 | + color: MyColours | ||
| 7754 | + .color_BFC4D4, | ||
| 7755 | + fontSize: ScreenUtil() | ||
| 7756 | + .setSp(30), | ||
| 7757 | + ), | ||
| 7758 | + ), | ||
| 7759 | + onChanged: (value) { | ||
| 7760 | + state(() {}); | ||
| 7761 | + }, | ||
| 7762 | + onEditingComplete: () { | ||
| 7763 | + FocusScope.of(context) | ||
| 7764 | + .requestFocus( | ||
| 7765 | + FocusNode()); //点击空白处隐藏键盘 | ||
| 7766 | + }, | ||
| 7767 | + keyboardType: | ||
| 7768 | + TextInputType.number, | ||
| 7769 | + ), | ||
| 7580 | ), | 7770 | ), |
| 7581 | - HEmptyView(20), | ||
| 7582 | - btnChoose(pnumMax, | ||
| 7583 | - ScreenUtil().setWidth(54 * 2), | ||
| 7584 | - (value) { | ||
| 7585 | - state(() { | ||
| 7586 | - showArea = true; | ||
| 7587 | - showPnumMin = true; | ||
| 7588 | - showPnumMax = !showPnumMax; | ||
| 7589 | - }); | ||
| 7590 | - }), | ||
| 7591 | ], | 7771 | ], |
| 7592 | ), | 7772 | ), |
| 7593 | ), | 7773 | ), |
| @@ -7611,12 +7791,49 @@ class DialogUtil { | @@ -7611,12 +7791,49 @@ class DialogUtil { | ||
| 7611 | //最高人数 | 7791 | //最高人数 |
| 7612 | // pnumMax | 7792 | // pnumMax |
| 7613 | 7793 | ||
| 7794 | + if (controllerMax.text | ||
| 7795 | + .trim() | ||
| 7796 | + .length > | ||
| 7797 | + 0 && | ||
| 7798 | + controllerMin.text | ||
| 7799 | + .trim() | ||
| 7800 | + .length > | ||
| 7801 | + 0) { | ||
| 7802 | + if (int.parse(controllerMin.text | ||
| 7803 | + .trim()) > | ||
| 7804 | + int.parse(controllerMax.text | ||
| 7805 | + .trim())) { | ||
| 7806 | + Utils.showToast( | ||
| 7807 | + '最大人数不能小于最小人数!'); | ||
| 7808 | + return; | ||
| 7809 | + } | ||
| 7810 | + if (int.parse(controllerMin.text | ||
| 7811 | + .trim()) == | ||
| 7812 | + 0) { | ||
| 7813 | + Utils.showToast('最小人数不能为0!'); | ||
| 7814 | + return; | ||
| 7815 | + } | ||
| 7816 | + if (int.parse(controllerMax.text | ||
| 7817 | + .trim()) == | ||
| 7818 | + 0) { | ||
| 7819 | + Utils.showToast('最大人数不能为0!'); | ||
| 7820 | + return; | ||
| 7821 | + } | ||
| 7822 | + if (int.parse(controllerMax.text | ||
| 7823 | + .trim()) > | ||
| 7824 | + 999) { | ||
| 7825 | + Utils.showToast( | ||
| 7826 | + '最大人数不能超过999!'); | ||
| 7827 | + return; | ||
| 7828 | + } | ||
| 7829 | + } | ||
| 7830 | + | ||
| 7614 | onTap!({ | 7831 | onTap!({ |
| 7615 | 'areaname': | 7832 | 'areaname': |
| 7616 | areas[currentAreaIndex!], | 7833 | areas[currentAreaIndex!], |
| 7617 | 'name': controller.text, | 7834 | 'name': controller.text, |
| 7618 | - 'pnumMin': pnumMin, | ||
| 7619 | - 'pnumMax': pnumMax | 7835 | + 'pnumMin': controllerMin.text, |
| 7836 | + 'pnumMax': controllerMax.text | ||
| 7620 | }); | 7837 | }); |
| 7621 | if (Navigator.canPop(context)) { | 7838 | if (Navigator.canPop(context)) { |
| 7622 | Navigator.pop(context); | 7839 | Navigator.pop(context); |
| @@ -7667,34 +7884,34 @@ class DialogUtil { | @@ -7667,34 +7884,34 @@ class DialogUtil { | ||
| 7667 | color: Colors.transparent) | 7884 | color: Colors.transparent) |
| 7668 | ], | 7885 | ], |
| 7669 | ), | 7886 | ), |
| 7670 | - Positioned( | ||
| 7671 | - left: ScreenUtil().setWidth(136 * 2), | ||
| 7672 | - top: ScreenUtil().setWidth(221 * 2), | ||
| 7673 | - child: Offstage( | ||
| 7674 | - offstage: showPnumMin, | ||
| 7675 | - child: Material( | ||
| 7676 | - color: Colors.transparent, | ||
| 7677 | - child: selectWidget(pnum, (index) { | ||
| 7678 | - state(() { | ||
| 7679 | - showPnumMin = !showPnumMin; | ||
| 7680 | - pnumMin = pnum[index as int]; | ||
| 7681 | - }); | ||
| 7682 | - }), | ||
| 7683 | - ))), | ||
| 7684 | - Positioned( | ||
| 7685 | - left: ScreenUtil().setWidth(223 * 2), | ||
| 7686 | - top: ScreenUtil().setWidth(221 * 2), | ||
| 7687 | - child: Material( | ||
| 7688 | - color: Colors.transparent, | ||
| 7689 | - child: Offstage( | ||
| 7690 | - offstage: showPnumMax, | ||
| 7691 | - child: selectWidget(pnum, (index) { | ||
| 7692 | - state(() { | ||
| 7693 | - showPnumMax = !showPnumMax; | ||
| 7694 | - pnumMax = pnum[index as int]; | ||
| 7695 | - }); | ||
| 7696 | - }), | ||
| 7697 | - ))), | 7887 | + // Positioned( |
| 7888 | + // left: ScreenUtil().setWidth(136 * 2), | ||
| 7889 | + // top: ScreenUtil().setWidth(221 * 2), | ||
| 7890 | + // child: Offstage( | ||
| 7891 | + // offstage: showPnumMin, | ||
| 7892 | + // child: Material( | ||
| 7893 | + // color: Colors.transparent, | ||
| 7894 | + // child: selectWidget(pnum, (index) { | ||
| 7895 | + // state(() { | ||
| 7896 | + // showPnumMin = !showPnumMin; | ||
| 7897 | + // pnumMin = pnum[index as int]; | ||
| 7898 | + // }); | ||
| 7899 | + // }), | ||
| 7900 | + // ))), | ||
| 7901 | + // Positioned( | ||
| 7902 | + // left: ScreenUtil().setWidth(223 * 2), | ||
| 7903 | + // top: ScreenUtil().setWidth(221 * 2), | ||
| 7904 | + // child: Material( | ||
| 7905 | + // color: Colors.transparent, | ||
| 7906 | + // child: Offstage( | ||
| 7907 | + // offstage: showPnumMax, | ||
| 7908 | + // child: selectWidget(pnum, (index) { | ||
| 7909 | + // state(() { | ||
| 7910 | + // showPnumMax = !showPnumMax; | ||
| 7911 | + // pnumMax = pnum[index as int]; | ||
| 7912 | + // }); | ||
| 7913 | + // }), | ||
| 7914 | + // ))), | ||
| 7698 | ]))); | 7915 | ]))); |
| 7699 | }); | 7916 | }); |
| 7700 | }); | 7917 | }); |
| @@ -2530,8 +2530,8 @@ class Utils { | @@ -2530,8 +2530,8 @@ class Utils { | ||
| 2530 | height: 1, | 2530 | height: 1, |
| 2531 | maxLines: 1, | 2531 | maxLines: 1, |
| 2532 | ellipsis: '3', | 2532 | ellipsis: '3', |
| 2533 | - fontSize: 38)); | ||
| 2534 | - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38)); | 2533 | + fontSize: 16*scaleX)); |
| 2534 | + pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16*scaleX)); | ||
| 2535 | pb2.addText( | 2535 | pb2.addText( |
| 2536 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); | 2536 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); |
| 2537 | 2537 | ||
| @@ -2552,8 +2552,8 @@ class Utils { | @@ -2552,8 +2552,8 @@ class Utils { | ||
| 2552 | fontWeight: FontWeight.bold, | 2552 | fontWeight: FontWeight.bold, |
| 2553 | fontStyle: FontStyle.normal, | 2553 | fontStyle: FontStyle.normal, |
| 2554 | height: 1, | 2554 | height: 1, |
| 2555 | - fontSize: 38)); | ||
| 2556 | - pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38)); | 2555 | + fontSize: 16*scaleX)); |
| 2556 | + pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16*scaleX)); | ||
| 2557 | pb.addText(time); | 2557 | pb.addText(time); |
| 2558 | 2558 | ||
| 2559 | // 设置文本的宽度约束 | 2559 | // 设置文本的宽度约束 |
| @@ -2643,8 +2643,9 @@ class Utils { | @@ -2643,8 +2643,9 @@ class Utils { | ||
| 2643 | maxLines: 2, | 2643 | maxLines: 2, |
| 2644 | height: 1, | 2644 | height: 1, |
| 2645 | fontStyle: FontStyle.normal, | 2645 | fontStyle: FontStyle.normal, |
| 2646 | - fontSize: 42)); | ||
| 2647 | - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 42)); | 2646 | + fontSize: 16 * scaleX)); |
| 2647 | + pb2.pushStyle( | ||
| 2648 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); | ||
| 2648 | pb2.addText( | 2649 | pb2.addText( |
| 2649 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); | 2650 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); |
| 2650 | 2651 | ||
| @@ -2660,8 +2661,9 @@ class Utils { | @@ -2660,8 +2661,9 @@ class Utils { | ||
| 2660 | fontWeight: FontWeight.bold, | 2661 | fontWeight: FontWeight.bold, |
| 2661 | height: 1, | 2662 | height: 1, |
| 2662 | fontStyle: FontStyle.normal, | 2663 | fontStyle: FontStyle.normal, |
| 2663 | - fontSize: 86)); | ||
| 2664 | - pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 86)); | 2664 | + fontSize: 36 * scaleX)); |
| 2665 | + pb3.pushStyle( | ||
| 2666 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 36 * scaleX)); | ||
| 2665 | pb3.addText(month); | 2667 | pb3.addText(month); |
| 2666 | 2668 | ||
| 2667 | // 设置文本的宽度约束 | 2669 | // 设置文本的宽度约束 |
| @@ -2676,8 +2678,9 @@ class Utils { | @@ -2676,8 +2678,9 @@ class Utils { | ||
| 2676 | fontWeight: FontWeight.bold, | 2678 | fontWeight: FontWeight.bold, |
| 2677 | fontStyle: FontStyle.normal, | 2679 | fontStyle: FontStyle.normal, |
| 2678 | height: 1, | 2680 | height: 1, |
| 2679 | - fontSize: 42)); | ||
| 2680 | - pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 42)); | 2681 | + fontSize: 16 * scaleX)); |
| 2682 | + pb.pushStyle( | ||
| 2683 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); | ||
| 2681 | pb.addText(time); | 2684 | pb.addText(time); |
| 2682 | 2685 | ||
| 2683 | // 设置文本的宽度约束 | 2686 | // 设置文本的宽度约束 |
| @@ -2754,8 +2757,9 @@ class Utils { | @@ -2754,8 +2757,9 @@ class Utils { | ||
| 2754 | fontWeight: FontWeight.bold, | 2757 | fontWeight: FontWeight.bold, |
| 2755 | fontStyle: FontStyle.normal, | 2758 | fontStyle: FontStyle.normal, |
| 2756 | maxLines: 2, | 2759 | maxLines: 2, |
| 2757 | - fontSize: 38)); | ||
| 2758 | - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38)); | 2760 | + fontSize: 16 * scaleX)); |
| 2761 | + pb2.pushStyle( | ||
| 2762 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); | ||
| 2759 | pb2.addText( | 2763 | pb2.addText( |
| 2760 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); | 2764 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); |
| 2761 | 2765 | ||
| @@ -2770,15 +2774,16 @@ class Utils { | @@ -2770,15 +2774,16 @@ class Utils { | ||
| 2770 | fontWeight: FontWeight.bold, | 2774 | fontWeight: FontWeight.bold, |
| 2771 | fontStyle: FontStyle.normal, | 2775 | fontStyle: FontStyle.normal, |
| 2772 | height: 1, | 2776 | height: 1, |
| 2773 | - fontSize: 88)); | ||
| 2774 | - pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 88)); | 2777 | + fontSize: 40 * scaleX)); |
| 2778 | + pb3.pushStyle( | ||
| 2779 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 40 * scaleX)); | ||
| 2775 | pb3.addText(month); | 2780 | pb3.addText(month); |
| 2776 | 2781 | ||
| 2777 | // 设置文本的宽度约束 | 2782 | // 设置文本的宽度约束 |
| 2778 | - ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 270); | 2783 | + ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 300); |
| 2779 | ui.Paragraph paragraph3 = pb3.build()..layout(pc3); | 2784 | ui.Paragraph paragraph3 = pb3.build()..layout(pc3); |
| 2780 | canvas.drawParagraph( | 2785 | canvas.drawParagraph( |
| 2781 | - paragraph3, Offset(images.width - 340, images.height - 180)); | 2786 | + paragraph3, Offset(images.width - 380, images.height - 190)); |
| 2782 | 2787 | ||
| 2783 | // 绘制文字 | 2788 | // 绘制文字 |
| 2784 | ui.ParagraphBuilder pb4 = ui.ParagraphBuilder(ui.ParagraphStyle( | 2789 | ui.ParagraphBuilder pb4 = ui.ParagraphBuilder(ui.ParagraphStyle( |
| @@ -2786,8 +2791,9 @@ class Utils { | @@ -2786,8 +2791,9 @@ class Utils { | ||
| 2786 | height: 1, | 2791 | height: 1, |
| 2787 | fontWeight: FontWeight.bold, | 2792 | fontWeight: FontWeight.bold, |
| 2788 | fontStyle: FontStyle.normal, | 2793 | fontStyle: FontStyle.normal, |
| 2789 | - fontSize: 38)); | ||
| 2790 | - pb4.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38)); | 2794 | + fontSize: 16 * scaleX)); |
| 2795 | + pb4.pushStyle( | ||
| 2796 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); | ||
| 2791 | pb4.addText(week); | 2797 | pb4.addText(week); |
| 2792 | 2798 | ||
| 2793 | // 设置文本的宽度约束 | 2799 | // 设置文本的宽度约束 |
| @@ -2797,8 +2803,8 @@ class Utils { | @@ -2797,8 +2803,8 @@ class Utils { | ||
| 2797 | paragraph4, Offset(images.width - 70, images.height - 180)); | 2803 | paragraph4, Offset(images.width - 70, images.height - 180)); |
| 2798 | 2804 | ||
| 2799 | Rect rect = subType1 == '1' | 2805 | Rect rect = subType1 == '1' |
| 2800 | - ? Rect.fromLTWH(images.width - 250, images.height - 90, 220, 50) | ||
| 2801 | - : Rect.fromLTWH(158 * scaleX, images.height - 90, 40 * scaleX, 50); | 2806 | + ? Rect.fromLTWH(images.width - 255 - 10, images.height - 90, 240, 50) |
| 2807 | + : Rect.fromLTWH(150 * scaleX, images.height - 90, 50 * scaleX, 50); | ||
| 2802 | paint.color = MyColours.color_66FFEFC5; | 2808 | paint.color = MyColours.color_66FFEFC5; |
| 2803 | RRect rRect = RRect.fromRectAndRadius(rect, Radius.circular(6)); | 2809 | RRect rRect = RRect.fromRectAndRadius(rect, Radius.circular(6)); |
| 2804 | canvas.drawRRect(rRect, paint); | 2810 | canvas.drawRRect(rRect, paint); |
| @@ -2810,15 +2816,16 @@ class Utils { | @@ -2810,15 +2816,16 @@ class Utils { | ||
| 2810 | fontWeight: FontWeight.bold, | 2816 | fontWeight: FontWeight.bold, |
| 2811 | height: 1, | 2817 | height: 1, |
| 2812 | fontStyle: FontStyle.normal, | 2818 | fontStyle: FontStyle.normal, |
| 2813 | - fontSize: 38)); | ||
| 2814 | - pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38)); | 2819 | + fontSize: 16 * scaleX)); |
| 2820 | + pb.pushStyle( | ||
| 2821 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); | ||
| 2815 | pb.addText(time); | 2822 | pb.addText(time); |
| 2816 | 2823 | ||
| 2817 | // 设置文本的宽度约束 | 2824 | // 设置文本的宽度约束 |
| 2818 | - double width = subType1 == '1' ? 240 : 40 * scaleX; | 2825 | + double width = subType1 == '1' ? 240 : 50 * scaleX; |
| 2819 | Offset offset = subType1 == '1' | 2826 | Offset offset = subType1 == '1' |
| 2820 | - ? Offset(images.width - 260, images.height - 80) | ||
| 2821 | - : Offset(158 * scaleX, images.height - 80); | 2827 | + ? Offset(images.width - 258 - 10, images.height - 80) |
| 2828 | + : Offset(150 * scaleX, images.height - 80); | ||
| 2822 | ParagraphConstraints pc = ui.ParagraphConstraints(width: width); | 2829 | ParagraphConstraints pc = ui.ParagraphConstraints(width: width); |
| 2823 | ui.Paragraph paragraph = pb.build()..layout(pc); | 2830 | ui.Paragraph paragraph = pb.build()..layout(pc); |
| 2824 | canvas.drawParagraph(paragraph, offset); | 2831 | canvas.drawParagraph(paragraph, offset); |
| @@ -2892,8 +2899,9 @@ class Utils { | @@ -2892,8 +2899,9 @@ class Utils { | ||
| 2892 | fontWeight: FontWeight.bold, | 2899 | fontWeight: FontWeight.bold, |
| 2893 | fontStyle: FontStyle.normal, | 2900 | fontStyle: FontStyle.normal, |
| 2894 | maxLines: 1, | 2901 | maxLines: 1, |
| 2895 | - fontSize: 38)); | ||
| 2896 | - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38)); | 2902 | + fontSize: scaleX * 16)); |
| 2903 | + pb2.pushStyle( | ||
| 2904 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: scaleX * 16)); | ||
| 2897 | pb2.addText( | 2905 | pb2.addText( |
| 2898 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); | 2906 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); |
| 2899 | 2907 | ||
| @@ -2909,15 +2917,16 @@ class Utils { | @@ -2909,15 +2917,16 @@ class Utils { | ||
| 2909 | height: 1, | 2917 | height: 1, |
| 2910 | fontWeight: FontWeight.bold, | 2918 | fontWeight: FontWeight.bold, |
| 2911 | fontStyle: FontStyle.normal, | 2919 | fontStyle: FontStyle.normal, |
| 2912 | - fontSize: 38)); | ||
| 2913 | - pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38)); | 2920 | + fontSize: scaleX * 16)); |
| 2921 | + pb3.pushStyle( | ||
| 2922 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: scaleX * 16)); | ||
| 2914 | pb3.addText(month + week); | 2923 | pb3.addText(month + week); |
| 2915 | 2924 | ||
| 2916 | // 设置文本的宽度约束 | 2925 | // 设置文本的宽度约束 |
| 2917 | ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 240); | 2926 | ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 240); |
| 2918 | ui.Paragraph paragraph3 = pb3.build()..layout(pc3); | 2927 | ui.Paragraph paragraph3 = pb3.build()..layout(pc3); |
| 2919 | canvas.drawParagraph(paragraph3, | 2928 | canvas.drawParagraph(paragraph3, |
| 2920 | - Offset(subType1 == '1' ? 17 * scaleX : 35 * scaleX, 146 * scaleY)); | 2929 | + Offset(subType1 == '1' ? 14 * scaleX : 35 * scaleX, 146 * scaleY)); |
| 2921 | 2930 | ||
| 2922 | // // 绘制文字 | 2931 | // // 绘制文字 |
| 2923 | // ui.ParagraphBuilder pb4 = ui.ParagraphBuilder(ui.ParagraphStyle( | 2932 | // ui.ParagraphBuilder pb4 = ui.ParagraphBuilder(ui.ParagraphStyle( |
| @@ -2934,8 +2943,8 @@ class Utils { | @@ -2934,8 +2943,8 @@ class Utils { | ||
| 2934 | // ui.Paragraph paragraph4 = pb4.build()..layout(pc4); | 2943 | // ui.Paragraph paragraph4 = pb4.build()..layout(pc4); |
| 2935 | // canvas.drawParagraph(paragraph4, Offset(420, 320)); | 2944 | // canvas.drawParagraph(paragraph4, Offset(420, 320)); |
| 2936 | 2945 | ||
| 2937 | - Rect rect = Rect.fromLTWH(subType1 == '1' ? 107 * scaleX : 127 * scaleX, | ||
| 2938 | - 142 * scaleY, subType1 == '1' ? 80 * scaleX : 40 * scaleX, 20 * scaleY); | 2946 | + Rect rect = Rect.fromLTWH(subType1 == '1' ? 113 * scaleX : 132 * scaleX, |
| 2947 | + 142 * scaleY, subType1 == '1' ? 83 * scaleX : 45 * scaleX, 20 * scaleY); | ||
| 2939 | paint.color = MyColours.color_66FFEFC5; | 2948 | paint.color = MyColours.color_66FFEFC5; |
| 2940 | RRect rRect = RRect.fromRectAndRadius(rect, Radius.circular(6)); | 2949 | RRect rRect = RRect.fromRectAndRadius(rect, Radius.circular(6)); |
| 2941 | canvas.drawRRect(rRect, paint); | 2950 | canvas.drawRRect(rRect, paint); |
| @@ -2948,23 +2957,24 @@ class Utils { | @@ -2948,23 +2957,24 @@ class Utils { | ||
| 2948 | fontWeight: FontWeight.bold, | 2957 | fontWeight: FontWeight.bold, |
| 2949 | height: 1, | 2958 | height: 1, |
| 2950 | fontStyle: FontStyle.normal, | 2959 | fontStyle: FontStyle.normal, |
| 2951 | - fontSize: 38)); | ||
| 2952 | - pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38)); | 2960 | + fontSize: scaleX * 16)); |
| 2961 | + pb.pushStyle( | ||
| 2962 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: scaleX * 16)); | ||
| 2953 | pb.addText(time); | 2963 | pb.addText(time); |
| 2954 | 2964 | ||
| 2955 | // 设置文本的宽度约束 | 2965 | // 设置文本的宽度约束 |
| 2956 | 2966 | ||
| 2957 | Offset offset = subType1 == '1' | 2967 | Offset offset = subType1 == '1' |
| 2958 | ? Offset( | 2968 | ? Offset( |
| 2959 | - 103 * scaleX, | 2969 | + 110 * scaleX, |
| 2960 | 146 * scaleY, | 2970 | 146 * scaleY, |
| 2961 | ) | 2971 | ) |
| 2962 | : Offset( | 2972 | : Offset( |
| 2963 | - 126 * scaleX, | 2973 | + 131 * scaleX, |
| 2964 | 146 * scaleY, | 2974 | 146 * scaleY, |
| 2965 | ); | 2975 | ); |
| 2966 | ParagraphConstraints pc = ui.ParagraphConstraints( | 2976 | ParagraphConstraints pc = ui.ParagraphConstraints( |
| 2967 | - width: subType1 == '1' ? 87 * scaleX : 41 * scaleX); | 2977 | + width: subType1 == '1' ? 87 * scaleX : 46 * scaleX); |
| 2968 | ui.Paragraph paragraph = pb.build()..layout(pc); | 2978 | ui.Paragraph paragraph = pb.build()..layout(pc); |
| 2969 | canvas.drawParagraph(paragraph, offset); | 2979 | canvas.drawParagraph(paragraph, offset); |
| 2970 | 2980 | ||
| @@ -3030,8 +3040,9 @@ class Utils { | @@ -3030,8 +3040,9 @@ class Utils { | ||
| 3030 | fontWeight: FontWeight.normal, | 3040 | fontWeight: FontWeight.normal, |
| 3031 | fontStyle: FontStyle.normal, | 3041 | fontStyle: FontStyle.normal, |
| 3032 | height: 1, | 3042 | height: 1, |
| 3033 | - fontSize: 28)); | ||
| 3034 | - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 28)); | 3043 | + fontSize: scaleX * 12)); |
| 3044 | + pb2.pushStyle( | ||
| 3045 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: scaleX * 12)); | ||
| 3035 | pb2.addText( | 3046 | pb2.addText( |
| 3036 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); | 3047 | '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); |
| 3037 | 3048 | ||
| @@ -3047,8 +3058,9 @@ class Utils { | @@ -3047,8 +3058,9 @@ class Utils { | ||
| 3047 | fontWeight: FontWeight.bold, | 3058 | fontWeight: FontWeight.bold, |
| 3048 | height: 1, | 3059 | height: 1, |
| 3049 | fontStyle: FontStyle.normal, | 3060 | fontStyle: FontStyle.normal, |
| 3050 | - fontSize: 72)); | ||
| 3051 | - pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 72)); | 3061 | + fontSize: scaleX * 36)); |
| 3062 | + pb.pushStyle( | ||
| 3063 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: scaleX * 36)); | ||
| 3052 | pb.addText(month); | 3064 | pb.addText(month); |
| 3053 | 3065 | ||
| 3054 | // 设置文本的宽度约束 | 3066 | // 设置文本的宽度约束 |
| @@ -3063,8 +3075,9 @@ class Utils { | @@ -3063,8 +3075,9 @@ class Utils { | ||
| 3063 | height: 1, | 3075 | height: 1, |
| 3064 | fontWeight: FontWeight.bold, | 3076 | fontWeight: FontWeight.bold, |
| 3065 | fontStyle: FontStyle.normal, | 3077 | fontStyle: FontStyle.normal, |
| 3066 | - fontSize: 36)); | ||
| 3067 | - pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 36)); | 3078 | + fontSize: scaleX * 18)); |
| 3079 | + pb3.pushStyle( | ||
| 3080 | + ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: scaleX * 18)); | ||
| 3068 | pb3.addText(week); | 3081 | pb3.addText(week); |
| 3069 | 3082 | ||
| 3070 | // 设置文本的宽度约束 | 3083 | // 设置文本的宽度约束 |
-
Please register or login to post a comment