diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 0d408704..453f21b3 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -205,7 +205,7 @@ class _CommunityDynamic extends State { ], ), ), - if(widget.comment.memberInfo == null || widget.comment.memberInfo.mid != widget.userId??"") + if(widget?.comment?.memberInfo?.mid != widget.userId??"") GestureDetector( onTap: () { setState(() { diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 4ee2a33d..092ca029 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -69,7 +69,8 @@ class _MineItem extends State { return; } Navigator.of(context) - .pushNamed('/router/releasePage'); + .pushNamed('/router/releasePage', + arguments: {}); }); }, child: mineItem( diff --git a/lib/mine/release_page.dart b/lib/mine/release_page.dart index dd0a21c1..f4191078 100644 --- a/lib/mine/release_page.dart +++ b/lib/mine/release_page.dart @@ -24,6 +24,7 @@ class _ReleasePage extends State { RefreshController refreshController = RefreshController(); ApiService apiService; int pageNum = 0; + String userId; List comments = []; @@ -42,6 +43,7 @@ class _ReleasePage extends State { queryCommunity() async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); + userId = value.getString('userId'); apiService = ApiService( Dio(), context: context, @@ -119,7 +121,7 @@ class _ReleasePage extends State { Navigator.of(context).pushNamed( '/router/community_details', arguments: { - "comment": comments[position], + "comment": comments[position],"userId":userId, }, ); }, 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 c8cfa1eb..abce5c58 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; @@ -393,6 +393,16 @@ class _Settlement extends State { promotions, couponCount(), placeOrder, + 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 aae17cc0..af832969 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -7,12 +7,14 @@ 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 bool placeOrder; + final String remark; ActivityCouponRemarks( this.couponCart, @@ -22,6 +24,8 @@ class ActivityCouponRemarks extends StatefulWidget { this.promotions, this.couponCount, this.placeOrder, + this.remark, + this.editRemark, ); @override @@ -145,7 +149,7 @@ class _ActivityCouponRemarks extends State { ), InkWell( onTap: () { - + widget.editRemark(); }, child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -162,15 +166,15 @@ class _ActivityCouponRemarks extends State { ), ), ), - 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,