diff --git a/lib/order/edit_remarks_page.dart b/lib/order/edit_remarks_page.dart index 33bd37f6..c870b004 100644 --- a/lib/order/edit_remarks_page.dart +++ b/lib/order/edit_remarks_page.dart @@ -12,6 +12,8 @@ class EditRemarksPage extends StatefulWidget { } class _EditRemarksPage extends State { + TextEditingController commentTextController = TextEditingController(); + @override Widget build(BuildContext context) { return Scaffold( @@ -65,6 +67,9 @@ class _EditRemarksPage extends State { ], ), child: TextField( + controller: commentTextController, + keyboardType: TextInputType.multiline, + maxLines: 10, decoration: InputDecoration( isDense: true, hintText: '请填写备注信息,例如:面包切一刀', @@ -85,17 +90,22 @@ class _EditRemarksPage extends State { ), flex: 1, ), - Container( - padding: EdgeInsets.all(16.h), - width: MediaQuery.of(context).size.width, - alignment: Alignment.center, - color: Color(0xFF32A060), - child: Text( - S.of(context).tijiao, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 16.sp, + GestureDetector( + onTap: (){ + Navigator.pop(context,commentTextController.text); + }, + child: Container( + padding: EdgeInsets.all(16.h), + width: MediaQuery.of(context).size.width, + alignment: Alignment.center, + color: Color(0xFF32A060), + child: Text( + S.of(context).tijiao, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 16.sp, + ), ), ), ), @@ -104,8 +114,15 @@ class _EditRemarksPage extends State { ); } + addRemarksCnt(cnt){ + setState(() { + commentTextController.text = commentTextController.text + cnt; + }); + } + List remarks() { return [ + GestureDetector(child: Container( padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), decoration: BoxDecoration( @@ -119,8 +136,9 @@ class _EditRemarksPage extends State { fontSize: 12.sp, ), ), - ), - Container( + ),onTap: (){addRemarksCnt("面包");},), + GestureDetector(child: + Container( padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), decoration: BoxDecoration( color: Color(0xFF32A060), @@ -133,7 +151,8 @@ class _EditRemarksPage extends State { fontSize: 12.sp, ), ), - ), + ),onTap: (){addRemarksCnt("面包要切好");},), + GestureDetector(child: Container( padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), decoration: BoxDecoration( @@ -147,7 +166,8 @@ class _EditRemarksPage extends State { fontSize: 12.sp, ), ), - ), + ),onTap: (){addRemarksCnt("一点");},), + GestureDetector(child: Container( padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), decoration: BoxDecoration( @@ -161,7 +181,8 @@ class _EditRemarksPage extends State { fontSize: 12.sp, ), ), - ), + ),onTap: (){addRemarksCnt("点");},), + GestureDetector(child: Container( padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), decoration: BoxDecoration( @@ -175,7 +196,7 @@ class _EditRemarksPage extends State { fontSize: 12.sp, ), ), - ), + ),onTap: (){addRemarksCnt("点");},), ]; } } diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 85c25e69..452d971c 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -51,7 +51,7 @@ class _Settlement extends State { SettleOrderInfo settleOrderInfo; MinOrderInfo minOrderInfo; int selectedBtn = 0; - String remakers = ""; + String remakers = "口味、面包硬度等"; String parentCode = ""; String parentId = ""; int payChannel = 4; @@ -390,6 +390,16 @@ class _Settlement extends State { coupons, promotions, couponCount(), + remakers, + (){ + Navigator.of(context).pushNamed( + '/router/edit_remarks_page', + arguments: {}, + ).then((value) => {setState(() { + if(value != null) + remakers = value; + })}); + } ), if (placeOrder) ///支付方式 diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index 52eedfaf..17ebd4d6 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -7,11 +7,13 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; class ActivityCouponRemarks extends StatefulWidget { final Function() couponCart; final Function() activityCart; + final Function() editRemark; final String coupons; final String promotions; final SettleOrderInfo settleOrderInfo; final int couponCount; + final String remark; ActivityCouponRemarks( this.couponCart, @@ -20,6 +22,8 @@ class ActivityCouponRemarks extends StatefulWidget { this.coupons, this.promotions, this.couponCount, + this.remark, + this.editRemark ); @override @@ -56,118 +60,121 @@ class _ActivityCouponRemarks extends State { top: 14, bottom: 14, ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - InkWell( - onTap: () { - widget.activityCart(); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Text( - S.of(context).huodong, + child:Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + InkWell( + onTap: () { + widget.activityCart(); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Text( + S.of(context).huodong, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF353535), + ), + ), + ), + Text( + activityText(), + textAlign: TextAlign.end, style: TextStyle( - fontWeight: MyFontWeight.regular, fontSize: 14.sp, - color: Color(0xFF353535), + color: Color(0xFF32A060), + fontWeight: MyFontWeight.semi_bold, ), ), - ), - Text( - activityText(), - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF32A060), - fontWeight: MyFontWeight.semi_bold, + Icon( + Icons.keyboard_arrow_right, + size: 16, ), - ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - ), - ], + ], + ), ), - ), - SizedBox( - height: 13, - ), - InkWell( - onTap: () { - widget.couponCart(); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Text( - S.of(context).youhuiquan, + SizedBox( + height: 13, + ), + InkWell( + onTap: () { + widget.couponCart(); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Text( + S.of(context).youhuiquan, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF353535), + ), + ), + ), + Text( + couponText(), + textAlign: TextAlign.end, style: TextStyle( - fontWeight: MyFontWeight.regular, fontSize: 14.sp, - color: Color(0xFF353535), + color: Color(0xFF32A060), + fontWeight: MyFontWeight.semi_bold, ), ), - ), - Text( - couponText(), - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF32A060), - fontWeight: MyFontWeight.semi_bold, + Icon( + Icons.keyboard_arrow_right, + size: 16, ), - ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - ), - ], + ], + ), ), - ), - SizedBox( - height: 13, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Text( - S.of(context).beizhu, - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 14.sp, - color: Color(0xFF353535), + SizedBox( + height: 13, + ), + InkWell( + onTap: (){ + widget.editRemark(); + }, + child: + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + S.of(context).beizhu, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF353535), + ), + ), + Expanded(child:Text( + widget.remark, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF353535), + fontWeight: MyFontWeight.semi_bold, + ), + ),), + Icon( + Icons.keyboard_arrow_right, + size: 16, ), - ), + ], ), - Text( - "口味、面包硬度等", - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535), - fontWeight: MyFontWeight.semi_bold, - ), - ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - ), - ], - ), - ], - ), + ), + ], + ), ); }