Browse Source

备注更改

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

33
lib/order/edit_remarks_page.dart

@ -12,6 +12,8 @@ class EditRemarksPage extends StatefulWidget {
}
class _EditRemarksPage extends State<EditRemarksPage> {
TextEditingController commentTextController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
@ -65,6 +67,9 @@ class _EditRemarksPage extends State<EditRemarksPage> {
],
),
child: TextField(
controller: commentTextController,
keyboardType: TextInputType.multiline,
maxLines: 10,
decoration: InputDecoration(
isDense: true,
hintText: '请填写备注信息,例如:面包切一刀',
@ -85,7 +90,11 @@ class _EditRemarksPage extends State<EditRemarksPage> {
),
flex: 1,
),
Container(
GestureDetector(
onTap: (){
Navigator.pop(context,commentTextController.text);
},
child: Container(
padding: EdgeInsets.all(16.h),
width: MediaQuery.of(context).size.width,
alignment: Alignment.center,
@ -99,13 +108,21 @@ class _EditRemarksPage extends State<EditRemarksPage> {
),
),
),
),
],
),
);
}
addRemarksCnt(cnt){
setState(() {
commentTextController.text = commentTextController.text + cnt;
});
}
List<Widget> remarks() {
return [
GestureDetector(child:
Container(
padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w),
decoration: BoxDecoration(
@ -119,7 +136,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
fontSize: 12.sp,
),
),
),
),onTap: (){addRemarksCnt("面包");},),
GestureDetector(child:
Container(
padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 22.w),
decoration: BoxDecoration(
@ -133,7 +151,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
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<EditRemarksPage> {
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<EditRemarksPage> {
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<EditRemarksPage> {
fontSize: 12.sp,
),
),
),
),onTap: (){addRemarksCnt("");},),
];
}
}

12
lib/settlement/settlement.dart

@ -51,7 +51,7 @@ class _Settlement extends State<Settlement> {
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<Settlement> {
coupons,
promotions,
couponCount(),
remakers,
(){
Navigator.of(context).pushNamed(
'/router/edit_remarks_page',
arguments: {},
).then((value) => {setState(() {
if(value != null)
remakers = value;
})});
}
),
if (placeOrder) ///

21
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
@ -136,13 +140,16 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
SizedBox(
height: 13,
),
InkWell(
onTap: (){
widget.editRemark();
},
child:
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
Text(
S.of(context).beizhu,
style: TextStyle(
fontWeight: MyFontWeight.regular,
@ -150,22 +157,22 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
color: Color(0xFF353535),
),
),
),
Text(
"口味、面包硬度等",
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,
),
],
),
),
],
),
);

Loading…
Cancel
Save