From c01028534d6297bc1ea69fe7d5dd3776b3e66bbf Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Tue, 26 Oct 2021 19:23:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mine/mine_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 8163572b..5c6380ae 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -331,7 +331,7 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { ), ), Text( - "(" + (infoNumber != null ?infoNumber.follow.toString() :"()") +")", + "(" + (infoNumber != null ?infoNumber.follow.toString() :"0") +")", style: TextStyle( color: Color(0xFF000000), fontSize: 15.sp, @@ -351,7 +351,7 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { ), ), Text( - "(" + (infoNumber != null ?infoNumber.fans.toString() :"()") +")", + "(" + (infoNumber != null ?infoNumber.fans.toString() :"0") +")", style: TextStyle( color: Color(0xFF000000), fontSize: 15.sp, From 39193b3efae0fd35a5b30ea821f7d1bfc320e976 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Tue, 26 Oct 2021 19:35:25 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_view/community_dynamic.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index e9ad6b2c..34f56328 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.mid != widget.userId??"") + if(widget?.comment?.memberInfo?.mid != widget.userId??"") GestureDetector( onTap: () { setState(() { From a90795a52214049629ebe97978519643fa29e207 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Tue, 26 Oct 2021 20:43:56 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A4=87=E6=B3=A8=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/order/edit_remarks_page.dart | 55 +++-- lib/settlement/settlement.dart | 12 +- .../activity_coupon_remarks.dart | 203 +++++++++--------- 3 files changed, 154 insertions(+), 116 deletions(-) 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, - ), - ], - ), - ], - ), + ), + ], + ), ); } From f79317065b9320fca0114981820151107ca2f9c2 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Tue, 26 Oct 2021 22:30:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mine/mine_view/mine_item.dart | 3 ++- lib/mine/release_page.dart | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) 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, }, ); },