Browse Source

备注更改

master
w-R 3 years ago
parent
commit
a90795a522
  1. 55
      lib/order/edit_remarks_page.dart
  2. 12
      lib/settlement/settlement.dart
  3. 203
      lib/settlement/settlement_view/activity_coupon_remarks.dart

55
lib/order/edit_remarks_page.dart

@ -12,6 +12,8 @@ class EditRemarksPage extends StatefulWidget {
} }
class _EditRemarksPage extends State<EditRemarksPage> { class _EditRemarksPage extends State<EditRemarksPage> {
TextEditingController commentTextController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -65,6 +67,9 @@ class _EditRemarksPage extends State<EditRemarksPage> {
], ],
), ),
child: TextField( child: TextField(
controller: commentTextController,
keyboardType: TextInputType.multiline,
maxLines: 10,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
hintText: '请填写备注信息,例如:面包切一刀', hintText: '请填写备注信息,例如:面包切一刀',
@ -85,17 +90,22 @@ class _EditRemarksPage extends State<EditRemarksPage> {
), ),
flex: 1, flex: 1,
), ),
Container( GestureDetector(
padding: EdgeInsets.all(16.h), onTap: (){
width: MediaQuery.of(context).size.width, Navigator.pop(context,commentTextController.text);
alignment: Alignment.center, },
color: Color(0xFF32A060), child: Container(
child: Text( padding: EdgeInsets.all(16.h),
S.of(context).tijiao, width: MediaQuery.of(context).size.width,
style: TextStyle( alignment: Alignment.center,
color: Colors.white, color: Color(0xFF32A060),
fontWeight: FontWeight.bold, child: Text(
fontSize: 16.sp, S.of(context).tijiao,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16.sp,
),
), ),
), ),
), ),
@ -104,8 +114,15 @@ class _EditRemarksPage extends State<EditRemarksPage> {
); );
} }
addRemarksCnt(cnt){
setState(() {
commentTextController.text = commentTextController.text + cnt;
});
}
List<Widget> remarks() { List<Widget> remarks() {
return [ return [
GestureDetector(child:
Container( Container(
padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -119,8 +136,9 @@ class _EditRemarksPage extends State<EditRemarksPage> {
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
), ),onTap: (){addRemarksCnt("面包");},),
Container( GestureDetector(child:
Container(
padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF32A060), color: Color(0xFF32A060),
@ -133,7 +151,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
), ),onTap: (){addRemarksCnt("面包要切好");},),
GestureDetector(child:
Container( Container(
padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -147,7 +166,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
), ),onTap: (){addRemarksCnt("一点");},),
GestureDetector(child:
Container( Container(
padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -161,7 +181,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
), ),onTap: (){addRemarksCnt("");},),
GestureDetector(child:
Container( Container(
padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w), padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -175,7 +196,7 @@ class _EditRemarksPage extends State<EditRemarksPage> {
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
), ),onTap: (){addRemarksCnt("");},),
]; ];
} }
} }

12
lib/settlement/settlement.dart

@ -51,7 +51,7 @@ class _Settlement extends State<Settlement> {
SettleOrderInfo settleOrderInfo; SettleOrderInfo settleOrderInfo;
MinOrderInfo minOrderInfo; MinOrderInfo minOrderInfo;
int selectedBtn = 0; int selectedBtn = 0;
String remakers = ""; String remakers = "口味、面包硬度等";
String parentCode = ""; String parentCode = "";
String parentId = ""; String parentId = "";
int payChannel = 4; int payChannel = 4;
@ -390,6 +390,16 @@ class _Settlement extends State<Settlement> {
coupons, coupons,
promotions, promotions,
couponCount(), couponCount(),
remakers,
(){
Navigator.of(context).pushNamed(
'/router/edit_remarks_page',
arguments: {},
).then((value) => {setState(() {
if(value != null)
remakers = value;
})});
}
), ),
if (placeOrder) /// if (placeOrder) ///

203
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -7,11 +7,13 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class ActivityCouponRemarks extends StatefulWidget { class ActivityCouponRemarks extends StatefulWidget {
final Function() couponCart; final Function() couponCart;
final Function() activityCart; final Function() activityCart;
final Function() editRemark;
final String coupons; final String coupons;
final String promotions; final String promotions;
final SettleOrderInfo settleOrderInfo; final SettleOrderInfo settleOrderInfo;
final int couponCount; final int couponCount;
final String remark;
ActivityCouponRemarks( ActivityCouponRemarks(
this.couponCart, this.couponCart,
@ -20,6 +22,8 @@ class ActivityCouponRemarks extends StatefulWidget {
this.coupons, this.coupons,
this.promotions, this.promotions,
this.couponCount, this.couponCount,
this.remark,
this.editRemark
); );
@override @override
@ -56,118 +60,121 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
top: 14, top: 14,
bottom: 14, bottom: 14,
), ),
child: Column( child:Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
widget.activityCart(); widget.activityCart();
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
S.of(context).huodong, S.of(context).huodong,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Text(
activityText(),
textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF353535), color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold,
), ),
), ),
), Icon(
Text( Icons.keyboard_arrow_right,
activityText(), size: 16,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold,
), ),
), ],
Icon( ),
Icons.keyboard_arrow_right,
size: 16,
),
],
), ),
), SizedBox(
SizedBox( height: 13,
height: 13, ),
), InkWell(
InkWell( onTap: () {
onTap: () { widget.couponCart();
widget.couponCart(); },
}, child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Expanded(
Expanded( flex: 1,
flex: 1, child: Text(
child: Text( S.of(context).youhuiquan,
S.of(context).youhuiquan, style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Text(
couponText(),
textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF353535), color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold,
), ),
), ),
), Icon(
Text( Icons.keyboard_arrow_right,
couponText(), size: 16,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold,
), ),
), ],
Icon( ),
Icons.keyboard_arrow_right,
size: 16,
),
],
), ),
), SizedBox(
SizedBox( height: 13,
height: 13, ),
), InkWell(
Row( onTap: (){
mainAxisAlignment: MainAxisAlignment.center, widget.editRemark();
crossAxisAlignment: CrossAxisAlignment.center, },
children: [ child:
Expanded( Row(
flex: 1, mainAxisAlignment: MainAxisAlignment.center,
child: Text( crossAxisAlignment: CrossAxisAlignment.center,
S.of(context).beizhu, children: [
style: TextStyle( Text(
fontWeight: MyFontWeight.regular, S.of(context).beizhu,
fontSize: 14.sp, style: TextStyle(
color: Color(0xFF353535), 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,
),
],
),
],
),
); );
} }

Loading…
Cancel
Save