From 789a1e51a53c554a9bb3bf7af41ef5cf110ac6a6 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Thu, 5 Sep 2024 10:59:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E5=87=8F=E5=AE=8C=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6=E7=9A=84=20=E5=95=86=E5=93=81=E5=90=8E=20=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E5=BA=94=E8=AF=A5=E6=B6=88=E5=A4=B1=EF=BC=9B=20?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BB=93=E7=AE=97=E9=A1=B5=E9=9D=A2=EF=BC=9A?= =?UTF-8?q?=E6=9D=BF=E5=9D=97=E9=97=B4=E9=97=B4=E8=B7=9D=E8=B0=83=E6=95=B4?= =?UTF-8?q?;=20=E9=97=A8=E5=BA=97=E5=B1=95=E7=A4=BA-=E4=BC=98=E5=8C=96:?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=B1=95=E7=A4=BA-=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=BB=B7=E6=A0=BC;=20=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E4=BD=BF=E7=94=A8=E8=AF=A6=E6=83=85=E5=BC=B9=E7=AA=97?= =?UTF-8?q?/=20=E4=BD=99=E9=A2=9D=E5=85=85=E5=80=BC=E5=BC=B9=E7=AA=97/=20?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E4=B8=AD=E5=BF=83=E9=97=A8=E5=BA=97=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=BC=B9=E7=AA=97=E6=A0=87=E9=A2=98=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=9B=20=E9=A1=B6=E9=83=A8title=E5=B1=85?= =?UTF-8?q?=E4=B8=AD=E5=A4=84=E7=90=86=EF=BC=9B=20=E9=80=89=E8=A7=84?= =?UTF-8?q?=E6=A0=BC=E6=8C=89=E9=92=AE=E8=B0=83=E6=95=B4;(=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E5=9C=86=E5=BD=A2=E6=8C=89=E9=92=AE)=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=95=86=E5=93=81=E5=B1=95=E7=A4=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E8=BF=87=E5=B0=8F=E9=97=AE=E9=A2=98=EF=BC=8C=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=E5=9B=BE=E7=89=87=E5=B0=BA=E5=AF=B8?= =?UTF-8?q?=E6=9B=B4=E6=94=B9102=EF=BC=9B=20=E5=8A=A0=E8=B4=AD=E5=89=8D=20?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=20=E2=80=9C=E2=80=94=E2=80=9C?= =?UTF-8?q?=E5=8F=B7=EF=BC=8C=E5=8A=A0=E8=B4=AD=E6=95=B0=E9=87=8F=E4=B8=BA?= =?UTF-8?q?1=E6=97=B6=E6=98=BE=E7=A4=BA=E2=80=9C=E2=80=94=E2=80=9C?= =?UTF-8?q?=E5=8F=B7=EF=BC=9B=20=E6=B7=BB=E5=8A=A0=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6=E6=97=B6=E5=A2=9E=E5=8A=A0=E7=BA=A2=E7=82=B9=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E6=95=88=E6=9E=9C=20=E4=BE=8B=E3=80=8C=E7=BE=8E?= =?UTF-8?q?=E5=9B=A2=E5=A4=96=E5=8D=96=E3=80=8D=EF=BC=9B=20=E5=88=A0?= =?UTF-8?q?=E5=87=8F=E5=AE=8C=E8=B4=AD=E7=89=A9=E8=BD=A6=E7=9A=84=20?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=90=8E=20=E5=BC=B9=E6=A1=86=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=B6=88=E5=A4=B1=EF=BC=9B=20=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=95=86=E5=93=81=E6=9D=BF=E5=9D=97ui?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9B=20=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=8A=A0=E8=B4=AD=E5=95=86=E5=93=81=E6=97=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BA=A2=E8=89=B2=E6=8A=9B=E7=89=A9=E7=BA=BF=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/add.webp | Bin 228 -> 486 bytes assets/image/2x/reduce.webp | Bin 248 -> 516 bytes assets/image/3x/add.webp | Bin 358 -> 952 bytes assets/image/3x/reduce.webp | Bin 446 -> 878 bytes assets/image/add.webp | Bin 154 -> 362 bytes assets/image/reduce.webp | Bin 162 -> 314 bytes lib/settlement/settlement.dart | 5 +- .../activity_coupon_remarks.dart | 2 +- .../settlement_view/pay_method.dart | 1 - .../settlement_order_commodity.dart | 3 +- .../settlement_view/vip_discounts_select.dart | 2 +- lib/store/shop_details_page.dart | 335 ++++++++----- lib/store/store_order.dart | 72 ++- lib/store/store_view/red_dot_page.dart | 83 ++++ lib/store/store_view/shop_car.dart | 30 +- lib/store/store_view/shop_goods.dart | 331 +++++++------ lib/store/store_view/store_order_list.dart | 3 + lib/union/union_list.dart | 450 ++++++++++++------ lib/view_widget/coupon_details_dialog.dart | 4 +- lib/view_widget/my_appbar.dart | 2 +- lib/view_widget/recharge_details_dialog.dart | 2 +- lib/view_widget/selector_store_dialog.dart | 2 +- 22 files changed, 849 insertions(+), 478 deletions(-) create mode 100644 lib/store/store_view/red_dot_page.dart diff --git a/assets/image/2x/add.webp b/assets/image/2x/add.webp index 4b9cd6b91e1ebbbaf100a20d4bc726c3ea4baefc..ecc7a5368c7d5c9a78025b87acf3e2436d8605cb 100644 GIT binary patch literal 486 zcmVMNk&HA0RRA3MM6+kP&il$0000G0000h001ih06|PpNWK6700CfATU(od z!VWr^aF8`N7_-Mk6@ZIh2M*GEc`*_h|Dl7mj06vjGm`Ek0 zA|WcZT~M$R32FeZ@3DLb2v+*~jkkIb9Y7n&cmN;3KL`yenZ$3H@i(YUPh1=o(F&R@ zB9K|iWem;t+6g;q0092ii^%&L0@7WVgDRo#cB&>EugY^a_3%f==r#VG#(!JXm1J+{ zejuHuci@NPC*h9=DC4oghi`smC5=oB2k)+%YSQ+#J#+qU_7P#$pZgTeVLd6qF8(}o zuc+=E2L2aTKk(tkr!V>A<^L(L)4@<2H)AA-M~t!dY5vZVxHhs|I0yiklaonf^;D?b cn-H`Neh6$kC1YB|f`NLZ<5XY+!za)H0B;)81poj5 literal 228 zcmVlTUK#>i;)z>TIB=k0p|`OBf+7fS7;{pidj5(fs@Vq&lMiXxp}pG$rj=^$3yU zHtldf6Omh%cDfwOpiF@W=bR$l1!Gh(P6cC^Gghg!@tvVPhEo5YmsSS7rcI=b&MmMQ eS{knWd$h-h@2R!))zd;~O|(2(DJ`1TPk#!N?rS~( diff --git a/assets/image/2x/reduce.webp b/assets/image/2x/reduce.webp index d0c58b64277b1bb7495e6069bef38e94f263cc14..b06646f57d66831d9e44b67ff5d7c25e8a9c6854 100644 GIT binary patch literal 516 zcmV+f0{i_^Nk&He0RRA3MM6+kP&il$0000G0000h001ih06|PpNaO$j00Ac;5J=%> z7ZDMIgV?s(=#oT083g>yA|Opb_%KO_HxIR{yrhXNB zwy+-BNnIP2houhLCK{y^v6+ry%}EnowQkb8(KJT~jR1pQwE!~gP-f6&%ojl?hRTZ= z4lPK+VV=L}BQGA#sFRE2V|`2b1F?=%g#l=f1YlmgO9_np14%mj$S%HkMh|)Mq0?#} zY@$qKBtc%rdf3`Ge8Q%%@P#S59rK;Rrvw6FadRZg- zxk&aL|MO=kgr>?|)2xOH_(S-GANo#i(!c?XPYm?sIITbYt!j{Ee-Yp<25_5Ir%uldR#%+xbm&m=xfJ&`wG)2t?F56>ek!EMv0Wi@ GzyJV(;OFcB literal 248 zcmV=MwOvEflQb-P77b?KlG)FTzIy-9azvqXvN^2MSUMw5Wcgp@8&b?26*E{7x94l@?OH z-~j&p0!fSd8*G0Q`f}3SDA8$2RCQ^h$QWA$+R<&18&sw-@D0!7{ylhGwW*Z4oh^Jy zD})CQ2?t}Hd6aa|i#%zRd;CQP06tWJ4EH*l1TZ+sey68`5nfX2m6ZH`Pu^ZZ_V_w) zH>>%0Zrww-+}T~H{9DCA-+}fQ)cF6iEMiiF7`~teE@jFWkfhP?r{c~T`7M#KIfkAb zg;}AIN{_kqh&LJfwZp*YT!08qOM-~1@pXqz|J$yx=*ge&6@w?RtxRR^BZCv>Ot<%l z+2H1P-u1%ln*(SOyk+FQeZ{*M(F3L_w775kn4kCovLcW@Wmif6drrAdAl29gFU+6=XY+>S?TWf9%?;Gui)C}>Q#RM`oW?9&P0F? zaXl^&v~wB+#y%xi7c)g?sXvhhI3O#iZy_k?jxhjj0-yHB`15QoR;z%iNcw;+7XUAh z`SfV^+h4}koaEMx+c;)U&lz-l^Gb9VQwr8pxIFDzxj50jmfYMuCxad4A1Nxjq>IdO aef2~9c^{z(H^0Y``Wye~OaK4?0002pgw3-6 literal 358 zcmV-s0h#_%Nk&Fq0RRA3MM6+kP&iCc0RR9mK|l}?@1UfSB&o;0$<5NEFWR=jD3T;a zJ+b~htpPT{{5@!;k!&^h35pKrzaA`#5~BZsZ6sT54%Z3&*FggwrZbIIOZpu;7vU1n^>N91a63L zc|+lI_+vz1@{yRn1SUYn6iOm6Os5KsK%tc=G$Vy}rqB=tTB=4<7HI1ND+U^?76L0L E0I~X_>;M1& diff --git a/assets/image/3x/reduce.webp b/assets/image/3x/reduce.webp index e7edbc831be1767d66f6a2850d0edbeca9e348ae..4cde0aa64cb9b7387229b214db04d9fe749a0952 100644 GIT binary patch literal 878 zcmV-!1CjhvNk&Fy0{{S5MM6+kP&il$0000G0000%002P%06|PpNNNE900Ac;5J=%> z7ZDKygxa>NIG2C`=pZ0vo`Cs80K6Rkrue8@j!-W1(;`U@kZfDGN)iYd~W&njKW zNIA*Oirq*@P72D{LBfjS@LfON2x6ZtLE zt#CKD|F@M!)m9oYyy%)_`jNg-8X20bNOf-FMXIHZNh@80%phg@1}jMt*1(Y@rvbKm z(T8P*-H3%bX(uNIWlV>eIcOstsnUgv6rFBZh%=mxkODGvXL?})m4~i6cFQqc&R{p* zkgmyLx%7sI?mAdH87s`X@4$1JH2r=6Q{;!MU&ZEnQYM8j%a`x-N7n&XP&gpg0RR9{ z3;>-0DnbB406vjCnMkFhBB3jh&3Ld932Fu?0QIc>>(^~;jNr6TY~S;uS!s50!veu}e_M0tQ~?9vd>6l4 zg@pI`W^?Kt38`arR(oxI8uG9oLP$#}{k^S^$El~fFVHTDf9-Ed1o#i>P{>g&@v9nO z#ff7q8TQZ>0PQoy4wzXpf|T}&2?D8hs=k1pZMnnT$;0f*BB#?W7k_P9de{2(w(XpW z#xL22KltjwDRcV+U|MpdP)4rSe*Cqb~-)rdg;NSnWq5uE@ E0NJmyzW@LL literal 446 zcmV;v0YUy!Nk&Gt0RRA3MM6+kP&iDg0RR9mK|l}?ufZUaBq#Gv1}FFzfTEn^*kBY% zl9VhCUzor>7I^I&hC$m#lDt2FCAg#y&P~}ywyosd_xR4}}tka?-G&I6m|zS03{ECkc~|T8;JxE~qSzY=JdM>9ibtfQ<$p zAjc098~_mb(Ox*r6=_1F{dawS)O4P;+-q}l9NE9l{<(L1e*h#&woP06+P3fGdiIW7N$>g8>nxEPcP+CnR*5A6J|mLg oZ+s!cB9LK~$gqrLSZ6XUL>X496iZo#wN5fz3`mBn1(D#(2`k3chX4Qo diff --git a/assets/image/add.webp b/assets/image/add.webp index dff3b1beb4f9a718b71f9b36a7f46d7d3e6420b0..9b45ea3fcd4a05f612401648e4903f4e8b175aed 100644 GIT binary patch literal 362 zcmV-w0hRtzNk&Fu0RRA3MM6+kP&il$0000G0000L000#L06|PpNO}MO00Cd1pp7Io zcjSOc!Q1$V2(b9`PNk6Gw6<+0I)n~zC?po0yND&AQ8>C_q0q=Q;gvVTts$cSirlts zA35U6$1AY#1?n}`PPPShUeLA;qA9?wz^oW9>s(fMlv%G!}V*1fbW0Y#QypJ zm@0YL|7-~OdyYO@S_|G#&qDMob;m2as^RX30#CElpP^%uIOF5Kz)mn9BHX2-{Y8)v z*@Hh00*)0h9>xwwI&1ON4E{_px_?qg1~>&)m$TviV;|qJ#mCQ9PXGQ+OtX8LX_v46 IlYh=I0LVk5Z~y=R literal 154 zcmV;L0A>GDNk&GJ00012MM6+kP&iD50000l6+i_LM?fHHvmmSgm}fN<1t0?0iJ-iWy0Q=J=1s_$=shtknhp{r{_&)1-qKC_QUDU=!O`9Fi#b7N}CL z4)6d9cqjk?sqp=`85BhHe*&%oxgQDo*9@Z?GWcY2w9q;y@!ti2U|b+trcjxfn_(ow IcNL`{07oi4mjD0& diff --git a/assets/image/reduce.webp b/assets/image/reduce.webp index e207282588b5c6b970eff2c67cb32ce53c4b8f7f..57cf7da3d767cb128c80ae64fa8cb3c6de9107a6 100644 GIT binary patch literal 314 zcmV-A0mc4ONk&F80RRA3MM6+kP&il$0000G0000L000#L06|PpNNfNA00Ac;5J=%> z7ZDMIgGjPkX&xZp)nR~p7>ELX@^6ZuA)@~i0BCznn05TbUN?0CGy|7oP63Q{Bl%5{ zOEwxR`)CJtQUmFm9W@?Yk-gbTJ&2cVG^pPcN8T7*Zjl1e1ketUhUx#63AK?009H^q zAfNyM0FVR#odGHq02Tl~kwBP9rK6%DC<>^s5(#Vooic;XPE5w@Os}5P*tiI_Ij{i! z%V#VRq__WI8pNZP+Y82<(3e`W?!3o%3@563J-9whDf$2B5nxNc2gv(x^UyIhi=j{= z3k%N5NrX!~r|!C)9L$=3hyQ5xMgH7BCi@~Rd`$Mq3fSR4dN?YnVd;N4xlgbED1`TE MEAQ9;$-eLa01{+@n*aa+ literal 162 zcmV;T0A2r5Nk&GR00012MM6+kP&iDD0000l6+i_LXJC+Rq|Tq>ME^Amq-~S!g6?14 z2m~QwsQ)i03IM|K7DWFFGAN+HcJmj2{peDJR>7Mb=+B4c+ { subscribeStoresName, ), + ///支付方式 if (settleOrderInfo != null && placeOrder && joinA != JoinActivity.BargainBug) - - ///支付方式 PayMethod( payChannelCheck, coupons, @@ -1146,7 +1145,7 @@ class _Settlement extends State { ], borderRadius: BorderRadius.circular(8), ), - margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 6.h, bottom: 6.h), + margin: EdgeInsets.only(left: 16.w, right: 16.w,bottom: 16.h), padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 10.h), child: Row( children: [ diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index db8522c9..fd259c86 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -84,7 +84,7 @@ class _ActivityCouponRemarks extends State { ], borderRadius: BorderRadius.circular(8), ), - margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 14.h, bottom: 14.h), + margin: EdgeInsets.only(left: 16.w, right: 16.w,bottom: 16.h), padding: EdgeInsets.only( left: 16.w, right: 16.w, diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index 9a22199a..a108e23d 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -54,7 +54,6 @@ class _PayMethod extends State { margin: EdgeInsets.only( left: 16.w, right: 16.w, - top: 8.h, bottom: 16.h, ), padding: EdgeInsets.only( diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 0fc396f7..31e7ecb2 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -52,8 +52,7 @@ class _SettlementOrderCommodity extends State { margin: EdgeInsets.only( left: 16.w, right: 16.w, - top: 16.h, - bottom: 8.h, + bottom: 16.h, ), padding: EdgeInsets.only( left: 20.w, diff --git a/lib/settlement/settlement_view/vip_discounts_select.dart b/lib/settlement/settlement_view/vip_discounts_select.dart index 6a017e50..7e62c5af 100644 --- a/lib/settlement/settlement_view/vip_discounts_select.dart +++ b/lib/settlement/settlement_view/vip_discounts_select.dart @@ -41,7 +41,7 @@ class _VipDiscountsSelect extends State { ], borderRadius: BorderRadius.circular(8), ), - margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 14.h, bottom: 14.h), + margin: EdgeInsets.only(left: 16.w, right: 16.w,bottom: 16.h), padding: EdgeInsets.only( left: 16.w, right: 16.w, diff --git a/lib/store/shop_details_page.dart b/lib/store/shop_details_page.dart index 57b023dd..3b331db7 100644 --- a/lib/store/shop_details_page.dart +++ b/lib/store/shop_details_page.dart @@ -16,6 +16,7 @@ import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/store/store_view/people_num.dart'; +import 'package:huixiang/store/store_view/red_dot_page.dart'; import 'package:huixiang/store/store_view/shop_car.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; @@ -73,6 +74,9 @@ class _ShopDetailsPage extends State { int singleNum = 0; String goodsSkuId; bool isCounts = false; + GlobalKey _key = GlobalKey(); + Offset _endOffset; + double rightOffset = 23.0; @override void initState() { @@ -91,6 +95,12 @@ class _ShopDetailsPage extends State { }); } }); + WidgetsBinding.instance.addPostFrameCallback((c) { + // 获取「购物车」的位置 + _endOffset = (_key.currentContext.findRenderObject() as RenderBox) + .localToGlobal(Offset.zero)+ + Offset(rightOffset, 0.0); + }); // SharedPreferences.getInstance().then((value) { // String minToken = value.getString("minToken"); // String tenant = value.getString("tenant"); @@ -330,20 +340,36 @@ class _ShopDetailsPage extends State { queryShopCar().then((value) { this.shopCarGoods = value; dialogShowing = true; - SmartDialog.show( - widget: ShopCar( - shopCartKey, - this.shopCarGoods, - clearShopCar, - toDownOrder, - shopCartAdd, - shopCartReduce, - ), - onDismiss: () { - dialogShowing = false; - }, - alignmentTemp: Alignment.bottomCenter, - ); + //使用showModalBottomSheet加载弹窗才有效 + showModalBottomSheet( + backgroundColor: Colors.transparent, + context: context, + //点击背景弹窗是否关闭 + // isDismissible: true, + builder: (_) { + return ShopCar( + shopCartKey, + this.shopCarGoods, + clearShopCar, + toDownOrder, + shopCartAdd, + shopCartReduce, + ); + }); + // SmartDialog.show( + // widget: ShopCar( + // shopCartKey, + // this.shopCarGoods, + // clearShopCar, + // toDownOrder, + // shopCartAdd, + // shopCartReduce, + // ), + // onDismiss: () { + // dialogShowing = false; + // }, + // alignmentTemp: Alignment.bottomCenter, + // ); }); } @@ -359,8 +385,8 @@ class _ShopDetailsPage extends State { ///选规格 _queryMiNiDetail(String id, int count) async { - EasyLoading.show( - status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); + //加红点抛物线动画,故单规格加购时不显示加载中 + // EasyLoading.show( status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); if (count < 0) { shopCarGoods.shoppingCartSkuItemList.forEach((element) { if (element.productId == id) { @@ -376,7 +402,7 @@ class _ShopDetailsPage extends State { }else{ SmartDialog.showToast(baseData.msg); } - EasyLoading.dismiss(); + // EasyLoading.dismiss(); } ///选规格弹窗 @@ -822,9 +848,10 @@ class _ShopDetailsPage extends State { }, child: Image.asset( "assets/image/shopping_bag.webp", - width: 66, - height: 66, + width: 57.w, + height: 57.w, fit: BoxFit.fitWidth, + key: _key, ), ), if (count() != 0) @@ -910,65 +937,89 @@ class _ShopDetailsPage extends State { ), ), Spacer(), - GestureDetector( - onTap: () async { - if (storeInfo.posType.code == "NORMALSTORE" && - tableId == 0) { - showDeleteDialog(); - } else if (isSetMeal == true) { - await Navigator.of(context) - .pushNamed('/router/product_meals_sku', arguments: { - "id": id, - "storeId": storeId, - "tableId": tableId - }); - queryShopCar().then((value) { - this.shopCarGoods = value; - setState(() {}); - }); - } else { - _queryMiNiDetail(id, counts); - } - }, - child: Container( - width: 92.w, - height: 32.h, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), - color: Color(0xFF32A060), - ), - margin: EdgeInsets.only(bottom: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/goods_shopp.webp", - fit: BoxFit.fill, - width: 18, - height: 18, - ), - SizedBox( - width: 2, + Builder( + builder: (context) { + return GestureDetector( + onTap: () async { + if (storeInfo.posType.code == "NORMALSTORE" && + tableId == 0) { + showDeleteDialog(); + } else if (isSetMeal == true) { + await Navigator.of(context).pushNamed( + '/router/product_meals_sku', + arguments: { + "id": id, + "storeId": storeId, + "tableId": tableId + }); + queryShopCar().then((value) { + this.shopCarGoods = value; + setState(() {}); + }); + } else { + if (miNiDetail.attrList != null && + miNiDetail.attrList.length == 1 && + miNiDetail.attrList[0].attrValueList.length == 1){ + /// 点击的时候获取当前 widget 的位置,传入 overlayEntry + var _overlayEntry = OverlayEntry(builder: (_) { + RenderBox box = context.findRenderObject(); + var offset = box.localToGlobal(Offset.zero); + return RedDotPage( + startPosition: offset, + endPosition: _endOffset, + ); + }); + // 显示Overlay + Overlay.of(context).insert(_overlayEntry); + // 等待动画结束 + Future.delayed(Duration(milliseconds: 800), () { + _overlayEntry.remove(); + _overlayEntry = null; + }); + } + _queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0) + ? (widget.arguments["minQty"]??0):counts)); + } + }, + child: Container( + width: 92.w, + height: 32.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: Color(0xFF32A060), ), - Text( - ((miNiDetail?.subscribeParam?.isEnableSubscribe ?? - false) == - true) - ? S.of(context).lijiyuyue - : (isSetMeal ?? false) == true - ? "选套餐" - : "加入购物车", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), - ), + margin: EdgeInsets.only(bottom: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/goods_shopp.webp", + fit: BoxFit.fill, + width: 18, + height: 18, + ), + SizedBox( + width: 2, + ), + Text( + ((miNiDetail?.subscribeParam?.isEnableSubscribe ?? + false) == + true) + ? S.of(context).lijiyuyue + : (isSetMeal ?? false) == true + ? "选套餐" + : "加入购物车", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], ), - ], - ), - ), - ) + ), + );},) ], ), ) @@ -1053,67 +1104,89 @@ class _ShopDetailsPage extends State { ), ), Spacer(), - GestureDetector( - onTap: () async { - if (storeInfo.posType.code == "NORMALSTORE" && - tableId == 0) { - showDeleteDialog(); - } else if (isSetMeal == true) { - await Navigator.of(context).pushNamed( - '/router/product_meals_sku', - arguments: { - "id": id, - "storeId": storeId, - "tableId": tableId + Builder( + builder: (context) { + return GestureDetector( + onTap: () async { + if (storeInfo.posType.code == "NORMALSTORE" && + tableId == 0) { + showDeleteDialog(); + } else if (isSetMeal == true) { + await Navigator.of(context).pushNamed( + '/router/product_meals_sku', + arguments: { + "id": id, + "storeId": storeId, + "tableId": tableId + }); + queryShopCar().then((value) { + this.shopCarGoods = value; + setState(() {}); }); - queryShopCar().then((value) { - this.shopCarGoods = value; - setState(() {}); - }); - } else { - _queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0) - ? (widget.arguments["minQty"]??0):counts)); - } - }, - child: Container( - width: 92.w, - height: 32.h, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), - color: Color(0xFF32A060), - ), - margin: EdgeInsets.only(bottom: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/goods_shopp.webp", - fit: BoxFit.fill, - width: 18, - height: 18, - ), - SizedBox( - width: 2, + } else { + if (miNiDetail.attrList != null && + miNiDetail.attrList.length == 1 && + miNiDetail.attrList[0].attrValueList.length == 1){ + /// 点击的时候获取当前 widget 的位置,传入 overlayEntry + var _overlayEntry = OverlayEntry(builder: (_) { + RenderBox box = context.findRenderObject(); + var offset = box.localToGlobal(Offset.zero); + return RedDotPage( + startPosition: offset, + endPosition: _endOffset, + ); + }); + // 显示Overlay + Overlay.of(context).insert(_overlayEntry); + // 等待动画结束 + Future.delayed(Duration(milliseconds: 800), () { + _overlayEntry.remove(); + _overlayEntry = null; + }); + } + _queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0) + ? (widget.arguments["minQty"]??0):counts)); + } + }, + child: Container( + width: 92.w, + height: 32.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: Color(0xFF32A060), ), - Text( - ((miNiDetail?.subscribeParam?.isEnableSubscribe ?? - false) == + margin: EdgeInsets.only(bottom: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/goods_shopp.webp", + fit: BoxFit.fill, + width: 18, + height: 18, + ), + SizedBox( + width: 2, + ), + Text( + ((miNiDetail?.subscribeParam?.isEnableSubscribe ?? + false) == true) - ? S.of(context).lijiyuyue - : (isSetMeal ?? false) == true + ? S.of(context).lijiyuyue + : (isSetMeal ?? false) == true ? "选套餐" : "加入购物车", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), - ), + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], ), - ], - ), - ), - ) + ), + );},), ], ), Text( diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index b77a8a34..64089526 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -18,6 +18,7 @@ import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/store/store_view/people_num.dart'; import 'package:huixiang/store/store_view/product_sku.dart'; +import 'package:huixiang/store/store_view/red_dot_page.dart'; import 'package:huixiang/store/store_view/shop_car.dart'; import 'package:huixiang/store/store_view/store_info.dart'; import 'package:huixiang/store/store_view/store_order_list.dart'; @@ -74,6 +75,10 @@ class _StoreOrderPage extends State String cName; String cid; + GlobalKey _key = GlobalKey(); + Offset _endOffset; + double rightOffset = 23.0; + @override void initState() { super.initState(); @@ -81,6 +86,12 @@ class _StoreOrderPage extends State tableId = widget.arguments["tableId"] ?? 0; tenant = widget.arguments["tenant"]; storeId = widget.arguments["id"]; + WidgetsBinding.instance.addPostFrameCallback((c) { + // 获取「购物车」的位置 + _endOffset = (_key.currentContext.findRenderObject() as RenderBox) + .localToGlobal(Offset.zero)+ + Offset(rightOffset, 0.0); + }); debugPrint( "store_param tableId:$tableId tenant:$tenant storeId:$storeId"); @@ -458,6 +469,7 @@ class _StoreOrderPage extends State minToken, tenant, tableId, + _endOffset, _queryMiNiDetail, () { queryShopCar().then((value) { this.shopCarGoods = value; @@ -563,21 +575,21 @@ class _StoreOrderPage extends State ), ), Stack( - children: [ + children: [ InkWell( onTap: () { if (count() != 0) showShoppingCart(); }, child: Image.asset( "assets/image/shopping_bag.webp", - width: 66, - height: 66, + width: 57.w, + height: 57.h, fit: BoxFit.fitWidth, ), ), if (count() != 0) Positioned( - right: 5, + right: 0, // top: 14, child: RoundButton( width: 17.w, @@ -591,6 +603,7 @@ class _StoreOrderPage extends State ), ), ], + key: _key, ), ], ), @@ -745,25 +758,42 @@ class _StoreOrderPage extends State queryShopCar().then((value) { this.shopCarGoods = value; dialogShowing = true; - SmartDialog.show( - widget: ShopCar( - shopCartKey, - this.shopCarGoods, - clearShopCar, - toDownOrder, - shopCartAdd, - shopCartReduce, - ), - onDismiss: () { - dialogShowing = false; - }, - alignmentTemp: Alignment.bottomCenter, - ); + //使用showModalBottomSheet加载弹窗才有效 + showModalBottomSheet( + backgroundColor: Colors.transparent, + context: context, + //点击背景弹窗是否关闭 + // isDismissible: true, + builder: (_) { + return ShopCar( + shopCartKey, + this.shopCarGoods, + clearShopCar, + toDownOrder, + shopCartAdd, + shopCartReduce, + ); + }); + // SmartDialog.show( + // widget: ShopCar( + // shopCartKey, + // this.shopCarGoods, + // clearShopCar, + // toDownOrder, + // shopCartAdd, + // shopCartReduce, + // ), + // onDismiss: () { + // dialogShowing = false; + // }, + // alignmentTemp: Alignment.bottomCenter, + // ); }); } ///清空购物车 clearShopCar() async { + // EasyLoading.show(status: S.current.zhengzaijiazai); BaseData baseData = await minService.clearShoppingCart(storeId); if (baseData.isSuccess) { shopCarGoods = null; @@ -773,8 +803,8 @@ class _StoreOrderPage extends State ///选规格 _queryMiNiDetail(String id, int count) async { - EasyLoading.show( - status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); + //加红点抛物线动画,故单规格加购时不显示加载中 + // EasyLoading.show(status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); if (count < 0) { shopCarGoods.shoppingCartSkuItemList.forEach((element) async { if (element.productId == id) { @@ -785,7 +815,7 @@ class _StoreOrderPage extends State return; } BaseData baseData = await minService.miNiDetail(id); - EasyLoading.dismiss(); + // EasyLoading.dismiss(); if (baseData != null && baseData.isSuccess) { miNiDetail = baseData.data; showStoreSelector(baseData.data, id, count); diff --git a/lib/store/store_view/red_dot_page.dart b/lib/store/store_view/red_dot_page.dart new file mode 100644 index 00000000..3b7162a2 --- /dev/null +++ b/lib/store/store_view/red_dot_page.dart @@ -0,0 +1,83 @@ +import 'dart:math'; + +import 'package:flutter/material.dart'; + +class RedDotPage extends StatefulWidget { + final Offset startPosition; + final Offset endPosition; + + const RedDotPage({Key key, this.startPosition, this.endPosition}) + : super(key: key); + + @override + _RedDotPageState createState() => _RedDotPageState(); +} + +class _RedDotPageState extends State + with SingleTickerProviderStateMixin { + AnimationController _controller; // 动画 controller + Animation _animation; // 动画 + double left; // 小圆点的left(动态计算) + double top; // 小圆点的right(动态计算) + + @override + void initState() { + super.initState(); + _controller = + AnimationController(duration: Duration(milliseconds: 800), vsync: this); + _animation = Tween(begin: 0.0, end: 1.0).animate(_controller); + + // 二阶贝塞尔曲线用值 + var x0 = widget.startPosition.dx; + var y0 = widget.startPosition.dy; + + var x1 = widget.startPosition.dx - 250; + var y1 = widget.startPosition.dy - 100; + + var x2 = widget.endPosition.dx; + var y2 = widget.endPosition.dy; + + _animation.addListener(() { + // t 动态变化的值 + var t = _animation.value; + if (mounted) + setState(() { + left = pow(1 - t, 2) * x0 + 2 * t * (1 - t) * x1 + pow(t, 2) * x2; + top = pow(1 - t, 2) * y0 + 2 * t * (1 - t) * y1 + pow(t, 2) * y2; + }); + }); + + // 初始化小圆点的位置 + left = widget.startPosition.dx; + top = widget.startPosition.dy; + + // 显示小圆点的时候动画就开始 + _controller.forward(); + } + + @override + Widget build(BuildContext context) { + // 用 Stack -> Positioned 来控制小圆点的位置 + return Stack( + children: [ + Positioned( + left: left, + top: top, + child: ClipOval( + child: Container( + width: 14, + height: 14, + color: Colors.red, + ), + ), + ) + ], + ); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } +} \ No newline at end of file diff --git a/lib/store/store_view/shop_car.dart b/lib/store/store_view/shop_car.dart index 4aba88e5..881e73c6 100644 --- a/lib/store/store_view/shop_car.dart +++ b/lib/store/store_view/shop_car.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart'; @@ -38,8 +39,9 @@ class _ShopCar extends State { Widget build(BuildContext context) { return WillPopScope( onWillPop: () async { - debugPrint("ssssasdadsasdadasd"); - SmartDialog.dismiss(); + // debugPrint("ssssasdadsasdadasd"); + // SmartDialog.dismiss(); + Navigator.of(context).pop(); return true; }, child: StatefulBuilder( @@ -79,12 +81,15 @@ class _ShopCar extends State { ), ), InkWell( - onTap: () { + onTap: () async{ if (widget.shopingCar.shoppingCartSkuItemList != null) { + EasyLoading.show(status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); widget.shopingCar.shoppingCartSkuItemList.clear(); } + await widget.clearShopCar(); + EasyLoading.dismiss(); + Navigator.of(context).pop(); state(() {}); - widget.clearShopCar(); }, child: Image.asset( "assets/image/delete.webp", @@ -117,10 +122,13 @@ class _ShopCar extends State { widget.shopingCar = await widget.shopCartAdd(cart); setState(() {}); - }, + }, (ShoppingCartSkuItemListBean cart) async { widget.shopingCar = await widget.shopCartReduce(cart); + if(widget.shopingCar?.shoppingCartSkuItemList == null){ + Navigator.of(context).pop(); + } setState(() {}); }, isShopCart: true, @@ -175,7 +183,8 @@ class _ShopCar extends State { Spacer(), GestureDetector( onTap: () { - SmartDialog.dismiss(); + // SmartDialog.dismiss(); + Navigator.of(context).pop(); widget.toDownOrder(); }, child: RoundButton( @@ -197,13 +206,14 @@ class _ShopCar extends State { children: [ InkWell( onTap: () { - // Navigator.of(context).pop(); - SmartDialog.dismiss(); + Navigator.of(context).pop(); + // SmartDialog.dismiss(); }, child: Image.asset( "assets/image/shopping_bag.webp", - width: 66, - height: 66, + width: 57.w, + height: 57.h, + fit: BoxFit.fitWidth, ), ), Positioned( diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index 0e0fadf6..4e8588c4 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -5,6 +5,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart'; +import 'package:huixiang/store/store_view/red_dot_page.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -30,6 +31,7 @@ class ShopGoods extends StatefulWidget { final ShoppingCartSkuItemListBean shoppingCartSkuItemListBean; final int count; final int tableId; + final Offset endOffset; final bool isShopCart; final StoreInfo storeInfo; @@ -40,6 +42,7 @@ class ShopGoods extends StatefulWidget { this.count = 0, this.isShopCart = false, this.tableId, + this.endOffset, this.queryShoppingCart, this.queryMiNiDetail, this.shoppingCartSkuItemListBean, @@ -114,8 +117,8 @@ class _ShopGoods extends State { : (widget.shoppingCartSkuItemListBean != null ? widget.shoppingCartSkuItemListBean.skuImg : ""), - width: 70.h, - height: 70.h, + width: 102.h, + height: 102.h, radius: BorderRadius.circular(4), fit: BoxFit.cover, errorSrc: "assets/image/default_1.webp", @@ -127,9 +130,9 @@ class _ShopGoods extends State { Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children:[ Padding( - padding: EdgeInsets.only(right: 16.w), + padding: EdgeInsets.only(right: 16.w,bottom:7.h), child: Row( children: [ Expanded( @@ -140,9 +143,9 @@ class _ShopGoods extends State { overflow: TextOverflow.ellipsis, maxLines: 1, style: TextStyle( - color: Colors.black, - fontSize: 13.sp, - fontWeight: MyFontWeight.medium, + color: Color(0xFF282828), + fontSize: 16.sp, + fontWeight:MyFontWeight.semi_bold, ), ), ), @@ -163,102 +166,106 @@ class _ShopGoods extends State { ], ), ), - SizedBox( - height: 2.h, - ), Padding( - padding: EdgeInsets.only(right: 16.w), - child: Row( - children: [ - Expanded( - child: Text( - (widget.productListBean != null - ? widget.productListBean.shortName - : widget.shoppingCartSkuItemListBean.skuName ?? - ""), - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - color: Color(0xFF4C4C4C), - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - ), + padding: EdgeInsets.only(right: 16.w,bottom:7.h), + child:Text( + (widget.productListBean != null + ? widget.productListBean.shortName + : widget.shoppingCartSkuItemListBean.skuName ?? + ""), + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: Color(0xFF4C4C4C), + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + ), + ),), + ((widget.productListBean?.minQty ?? 0).toInt() > 1)? + Row( + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal:4.w), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(2), + border: Border.all( + width: 1, + color: Color(0xFFF65720), + style: BorderStyle.solid, ), ), - SizedBox( - width: 10.w, - ), - ], - )), - SizedBox( - height: 7.h, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Text( - "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}", + alignment: Alignment.center, + child: Text( + "${widget.productListBean?.minQty ?? 0}份起购", style: TextStyle( - color: Color(0xFFFF4500), - fontSize: 16.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.medium, + color: Color(0xFFF65720), + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, ), ), - SizedBox( - width:5.w, - ), - // Container( - // width: 44.w, - // height: 18.h, - // decoration: BoxDecoration( - // color: Color(0xFFFF4500), - // borderRadius: BorderRadius.circular(2), - // ), - // alignment: Alignment.center, - // child: Text( - // "APP专享", - // style: TextStyle( - // color: Color(0xFFFFFFFF), - // fontSize: 10.sp, - // fontWeight: MyFontWeight.medium, - // ), - // ), - // ), - if((widget.productListBean?.minQty ?? 0).toInt() > 1) - Container( - padding: EdgeInsets.symmetric(horizontal:4.w), - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(2), - border: Border.all( - width: 1, - color: Color(0xFFF65720), - style: BorderStyle.solid, - ), - ), - alignment: Alignment.center, - child: Text( - "${widget.productListBean?.minQty ?? 0}份起购", - style: TextStyle( - color: Color(0xFFF65720), - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ), - ], - ), + ), + Spacer(), + ], + ):SizedBox(height:23.h), + Row( + children: [ + Expanded(child:Text( + "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}", + style: TextStyle( + color: Color(0xFFFF4500), + fontSize: 16.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, + ), + )), + // SizedBox( + // width:5.w, + // ), + // Container( + // width: 44.w, + // height: 18.h, + // decoration: BoxDecoration( + // color: Color(0xFFFF4500), + // borderRadius: BorderRadius.circular(2), + // ), + // alignment: Alignment.center, + // child: Text( + // "APP专享", + // style: TextStyle( + // color: Color(0xFFFFFFFF), + // fontSize: 10.sp, + // fontWeight: MyFontWeight.medium, + // ), + // ), + // ), + ///起购量 if((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count == 0 && (widget.productListBean?.attrStyle ?? 0) != 1) - GestureDetector( + Builder( + builder: (context) { + return GestureDetector( behavior: HitTestBehavior.opaque, onTap: () async { if (widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0) { showDeleteDialog(); } else { + /// 点击的时候获取当前 widget 的位置,传入 overlayEntry + var _overlayEntry = OverlayEntry(builder: (_) { + RenderBox box = context.findRenderObject(); + var offset = box.localToGlobal(Offset.zero); + return RedDotPage( + startPosition: offset, + endPosition: widget.endOffset, + ); + }); + // 显示Overlay + Overlay.of(context).insert(_overlayEntry); + // 等待动画结束 + Future.delayed(Duration(milliseconds: 800), () { + _overlayEntry.remove(); + _overlayEntry = null; + }); if (_jumpType == -1) queryMiNiDetail(widget.productListBean.id); else if (_jumpType == 0) @@ -276,7 +283,7 @@ class _ShopGoods extends State { }, child:Container( padding: EdgeInsets.only( - left:50.w, + // left:48.w, top: 4.h, bottom: 4.h, ), @@ -285,13 +292,14 @@ class _ShopGoods extends State { text:"${widget?.productListBean?.minQty ?? 0}份起购", textColor: Colors.white, fontWeight: MyFontWeight.medium, - radius: 3, + radius: 11, backgroup: Color(0xFF32A060), fontSize: 11.sp, padding: EdgeInsets.symmetric( - vertical: 5.h, horizontal: 3.w), + vertical:2.h, horizontal:6.w), ), - )), + ));},), + ///选规格 if (!widget.isShopCart && (widget.productListBean?.attrStyle ?? 0) == 1 && !(widget?.productListBean?.subscribeParam @@ -302,15 +310,15 @@ class _ShopGoods extends State { behavior: HitTestBehavior.opaque, onTap: () async { if (widget.storeInfo.posType.code == - "NORMALSTORE" && + "NORMALSTORE" && widget.tableId == 0) { showDeleteDialog(); } else { - widget.queryMiNiDetail( + await widget.queryMiNiDetail( widget.productListBean != null ? widget.productListBean.id : widget.shoppingCartSkuItemListBean - .productId, + .productId, 0); } }, @@ -318,7 +326,6 @@ class _ShopGoods extends State { children: [ Container( padding: EdgeInsets.only( - left: 35.w, top: 4.h, bottom: 4.h, ), @@ -327,11 +334,11 @@ class _ShopGoods extends State { text: S.of(context).xuanguige, textColor: Colors.white, fontWeight: MyFontWeight.medium, - radius: 3, + radius: 11, backgroup: Color(0xFF32A060), fontSize: 11.sp, padding: EdgeInsets.symmetric( - vertical: 5.h, horizontal: 3.w), + vertical:3.h, horizontal:6.w), ), ), Positioned( @@ -352,20 +359,14 @@ class _ShopGoods extends State { ), ], )), - if (widget.isShopCart || - (widget.productListBean?.attrStyle ?? 0) == 0 && - !(widget?.productListBean?.subscribeParam - ?.isEnableSubscribe ?? - false) && - !(widget?.productListBean?.isSetMeal ?? false)) - Spacer(), + ///数量- if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0) || (widget.productListBean?.minQty ?? 0).toInt() == 0) && !(widget?.productListBean?.subscribeParam ?.isEnableSubscribe ?? false) && - !(widget?.productListBean?.isSetMeal ?? false)) + !(widget?.productListBean?.isSetMeal ?? false) && widget.count != 0) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () async { @@ -380,18 +381,19 @@ class _ShopGoods extends State { padding: EdgeInsets.only(left: 15.w, right: 6.w), child: Image.asset( "assets/image/reduce.webp", - width: 22, + width: 22.h, height: 22.h, ), ), ), + ///数量显示 if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0) || (widget.productListBean?.minQty ?? 0).toInt() == 0) && !(widget?.productListBean?.subscribeParam ?.isEnableSubscribe ?? false) && - !(widget?.productListBean?.isSetMeal ?? false)) + !(widget?.productListBean?.isSetMeal ?? false) && widget.count != 0) Container( alignment: Alignment.center, child: Text( @@ -403,6 +405,7 @@ class _ShopGoods extends State { ), ), ), + ///数量+ if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0 &&(((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0) || (widget.productListBean?.minQty ?? 0).toInt() == 0) && @@ -410,45 +413,67 @@ class _ShopGoods extends State { ?.isEnableSubscribe ?? false) && !(widget?.productListBean?.isSetMeal ?? false)) - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () async { - if (widget.storeInfo.posType.code == "NORMALSTORE" && - widget.tableId == 0) { - showDeleteDialog(); - } else { - // if ((widget?.productListBean?.oversold ?? 0) == 0 && - // widget.count >= - // (widget?.shoppingCartSkuItemListBean - // ?.skuStock ?? - // 0)) { - // SmartDialog.showToast("库存不足", - // alignment: Alignment.center); - // } else - if (_jumpType == -1) - queryMiNiDetail(widget.productListBean.id); - else if (_jumpType == 0) - widget.add(widget.shoppingCartSkuItemListBean); - else if (_jumpType == 1) - await Navigator.of(context).pushNamed( - '/router/product_meals_sku', - arguments: { - "id": widget.productListBean.id, - "storeId": widget.productListBean.storeId, - "tableId": widget.tableId - }); - widget.queryShoppingCart(); - } + Builder( + builder: (context) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () async { + if (widget.storeInfo.posType.code == "NORMALSTORE" && + widget.tableId == 0) { + showDeleteDialog(); + } else { + // if ((widget?.productListBean?.oversold ?? 0) == 0 && + // widget.count >= + // (widget?.shoppingCartSkuItemListBean + // ?.skuStock ?? + // 0)) { + // SmartDialog.showToast("库存不足", + // alignment: Alignment.center); + // } else + /// 点击的时候获取当前 widget 的位置,传入 overlayEntry + var _overlayEntry = OverlayEntry(builder: (_) { + RenderBox box = context.findRenderObject(); + var offset = box.localToGlobal(Offset.zero); + return RedDotPage( + startPosition: offset, + endPosition: widget.endOffset, + ); + }); + // 显示Overlay + Overlay.of(context).insert(_overlayEntry); + // 等待动画结束 + Future.delayed(Duration(milliseconds: 800), () { + _overlayEntry.remove(); + _overlayEntry = null; + }); + if (_jumpType == -1) + queryMiNiDetail(widget.productListBean.id); + else if (_jumpType == 0) + widget.add(widget.shoppingCartSkuItemListBean); + else if (_jumpType == 1) + await Navigator.of(context).pushNamed( + '/router/product_meals_sku', + arguments: { + "id": widget.productListBean.id, + "storeId": widget.productListBean.storeId, + "tableId": widget.tableId + }); + widget.queryShoppingCart(); + } + // Navigator.of(context).pushNamed('/router/goods_list_page'); + }, + child: Container( + padding: EdgeInsets.only(left: 6.w, right: 5.5.w), + child: Image.asset( + "assets/image/add.webp", + width: 22.h, + height: 22.h, + ), + ), + ); }, - child: Container( - padding: EdgeInsets.only(left: 6.w, right: 5.5.w), - child: Image.asset( - "assets/image/add.webp", - width: 22, - height: 22.h, - ), - ), ), + ///立即预约 if ((widget.productListBean.subscribeParam .isEnableSubscribe ?? false) == @@ -474,7 +499,6 @@ class _ShopGoods extends State { }, child: Container( padding: EdgeInsets.only( - left: 35.w, top: 4.h, bottom: 4.h, ), @@ -483,13 +507,14 @@ class _ShopGoods extends State { text: S.of(context).lijiyuyue, textColor: Colors.white, fontWeight: MyFontWeight.medium, - radius: 3, + radius: 11, backgroup: Color(0xFF32A060), fontSize: 11.sp, padding: EdgeInsets.symmetric( - vertical: 5.h, horizontal: 3.w), + vertical:3.h, horizontal:6.w), ), )), + ///选套餐 if ((widget.productListBean.isSetMeal ?? false) == true) GestureDetector( behavior: HitTestBehavior.opaque, @@ -524,7 +549,6 @@ class _ShopGoods extends State { children: [ Container( padding: EdgeInsets.only( - left: 35.w, top: 4.h, bottom: 4.h, ), @@ -533,11 +557,11 @@ class _ShopGoods extends State { text: "选套餐", textColor: Colors.white, fontWeight: MyFontWeight.medium, - radius: 3, + radius: 11, backgroup: Color(0xFF32A060), fontSize: 11.sp, padding: EdgeInsets.symmetric( - vertical: 5.h, horizontal: 3.w), + vertical:3.h, horizontal:6.w), ), ), Positioned( @@ -563,7 +587,6 @@ class _ShopGoods extends State { SizedBox( height: 4.h, ), - ///VIP价格(暂时弃用) // if (widget.productListBean.vipPrice != null) // Row( diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index efe59f6c..5f9fec2c 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -27,6 +27,7 @@ class StoreOrderListPage extends StatefulWidget { final String minToken; final String tenant; final int tableId; + final Offset _endOffset; final Function(String id, int count) queryMiNiDetail; final Function queryShoppingCart; final ScrollPhysics scrollPhysics; @@ -42,6 +43,7 @@ class StoreOrderListPage extends StatefulWidget { this.minToken, this.tenant, this.tableId, + this._endOffset, this.queryMiNiDetail, this.queryShoppingCart, this.scrollPhysics); @@ -377,6 +379,7 @@ class _StoreOrderListPage extends State { count: count, isShopCart: false, tableId: widget.tableId, + endOffset: widget._endOffset, queryShoppingCart: widget.queryShoppingCart, queryMiNiDetail: widget.queryMiNiDetail, shoppingCartSkuItemListBean: shoppingCartSkuItemListBean, diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index ba2d2cc1..2d70861b 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -226,8 +226,8 @@ class _UnionList extends State with AutomaticKeepAliveClientMixin { Widget buildStoreItem(Store store, position) { return Container( - margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h), - padding: EdgeInsets.symmetric(horizontal:12.w,vertical: 12.h), + margin: EdgeInsets.fromLTRB(14.w, 16.h, 14.w, 12.h), + padding: EdgeInsets.symmetric(vertical: 12.h,horizontal: 12.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6)), @@ -240,136 +240,149 @@ class _UnionList extends State with AutomaticKeepAliveClientMixin { ) ]), width: double.infinity, - child: Row( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Stack( - children: [ - MImage( - store.facade, - width: 74.h, - height: 74.h, - fit: BoxFit.cover, - radius: BorderRadius.circular(6), - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - Container( - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(6), - bottomRight: Radius.circular(6), - topRight: Radius.circular(2), - bottomLeft: Radius.circular(2)), - ), - padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 2.h), - child: Text( - "品牌", - style: TextStyle( - color: Colors.white, - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ) - ], - ), - SizedBox( - width: 12.w, - ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, + Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - store?.storeName ?? "", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF0D0D0D), - fontSize: 14.sp, - fontWeight: MyFontWeight.bold, - ), - ), - SizedBox(height: 6.h), - Row( + Stack( children: [ - if(store.perCapitaConsumption != null && (store?.perCapitaConsumption ?? "0") != "0") - Padding(padding: EdgeInsets.only(right: 22.w),child:Text( - S.of(context).ren( - store?.perCapitaConsumption ?? "", - ), - style: TextStyle( - color: Color(0xFF4D4D4D), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ),), - if (store.distance != null) - Image.asset( - "assets/image/icon_union_location_black.webp", - fit: BoxFit.fill, - height: 12, - width: 12, + MImage( + store.facade, + width: 74.h, + height: 74.h, + fit: BoxFit.cover, + radius: BorderRadius.circular(6), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", ), - SizedBox(width: 4.w), - if (store.distance != null) - Text( - (store.distance ?? 0) > 1000 - ? S.of(context).gongli( - ((store.distance ?? 0) / 1000 * 100).toInt() / - 100.0) - : S - .of(context) - .mi(((store.distance ?? 0) * 100).toInt() / 100.0), - style: TextStyle( - color: Color(0xFF4D4D4D), - fontSize: 12.sp, + Container( + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(6), + bottomRight: Radius.circular(6), + topRight: Radius.circular(2), + bottomLeft: Radius.circular(2)), ), - ), + padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 2.h), + child: Text( + "品牌", + style: TextStyle( + color: Colors.white, + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ) ], ), - SizedBox(height: 10.h), - Row( - children: []..addAll( - itemServer(store != null ? store.businessService : "")), + SizedBox( + width: 11.w, ), - if (storeList[position].productShow != null) - SizedBox(height: store.businessService == "" ? 40.h : 23.h), - if (storeList[position].productShow != null) - Container( - height: 100.h, - child: ListView.builder( - padding: EdgeInsets.zero, - itemCount: - (storeList[position].productShow?.length ?? 0) > 3 - ? 3 - : storeList[position].productShow?.length ?? 0, - scrollDirection: Axis.horizontal, - shrinkWrap: true, - physics:BouncingScrollPhysics(), - itemBuilder: (context, index) { - return GestureDetector( - onTap: () {Navigator.of(context).pushNamed( - '/router/store_order', - arguments: { - "id": storeList[position].id, - "tenant": storeList[position].tenantCode, - "storeName": storeList[position].storeName, - "distance": storeList[position].distance - }, - );}, - child: unionGoodsItem( - storeList[position].productShow[index]), - ); - }, - ), - ), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + store?.storeName ?? "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ), + Padding(padding:EdgeInsets.only(left:2.w,top:8.h,bottom:10.h), + child: Row( + children: [ + if(store.perCapitaConsumption != null && (store?.perCapitaConsumption ?? "0") != "0") + Padding(padding: EdgeInsets.only(right: 22.w),child:Text( + S.of(context).ren( + store?.perCapitaConsumption ?? "", + ), + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ),), + if (store.distance != null) + Image.asset( + "assets/image/icon_union_location_black.webp", + fit: BoxFit.fill, + height: 12, + width: 12, + ), + SizedBox(width: 4.w), + if (store.distance != null) + Text( + (store.distance ?? 0) > 1000 + ? S.of(context).gongli( + ((store.distance ?? 0) / 1000 * 100).toInt() / + 100.0) + : S + .of(context) + .mi(((store.distance ?? 0) * 100).toInt() / 100.0), + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + ), + ), + ], + ),), + Row( + children: []..addAll( + itemServer(store != null ? store.businessService : "")), + ), + if (storeList[position].productShow != null) + SizedBox(height: store.businessService == "" ? 40.h : 23.h), + ], + )) ], - )) - ], - ), + ), + if (storeList[position].productShow != null) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: unionItem(position,0)), + SizedBox(width:16.w), + Expanded(child: unionItem(position,1)), + SizedBox(width:16.w), + Expanded(child: unionItem(position,2)), + ], + ) + // Container( + // height: 150.h, + // child: ListView.builder( + // padding: EdgeInsets.zero, + // itemCount: + // (storeList[position].productShow?.length ?? 0) > 3 + // ? 3 + // : storeList[position].productShow?.length ?? 0, + // scrollDirection: Axis.horizontal, + // shrinkWrap: true, + // physics:BouncingScrollPhysics(), + // itemBuilder: (context, index) { + // return GestureDetector( + // onTap: () {Navigator.of(context).pushNamed( + // '/router/store_order', + // arguments: { + // "id": storeList[position].id, + // "tenant": storeList[position].tenantCode, + // "storeName": storeList[position].storeName, + // "distance": storeList[position].distance + // }, + // );}, + // child: unionGoodsItem( + // storeList[position].productShow[index]), + // ); + // }, + // ), + // ), + ],), ); } @@ -394,38 +407,177 @@ class _UnionList extends State with AutomaticKeepAliveClientMixin { )) .toList(); } - - Widget unionGoodsItem(ProductShow productShow) { - return Container( - width: 74.h, - margin: EdgeInsets.only(right: 8.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - MImage( - productShow?.imgs[0] ?? "", - width: 74.h, - height: 74.h, - fit: BoxFit.cover, - radius: BorderRadius.circular(4), - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", + + Widget unionItem(int position,int unionIndex) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + MImage( + storeList[position].productShow[unionIndex]?.imgs[0] ?? "", + width:double.infinity, + height:97.w, + fit: BoxFit.cover, + radius: BorderRadius.circular(4), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + Padding( + padding: EdgeInsets.only(top: 8.h,bottom:6.h), + child: Text( + storeList[position].productShow[unionIndex]?.productName ?? "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), ), - Padding( - padding: EdgeInsets.only(top: 8.h), - child: Text( - productShow?.productName ?? "", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFFA29E9E), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding(padding:EdgeInsets.only(right:2.w), + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize:12.sp, + color: Color(0xFFF65720), + ), + ), + TextSpan( + text:"${(storeList[position].productShow[unionIndex]?.price ?? "").split(".")[0]}", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Color(0xFFF65720), + ), + ), + if(storeList[position].productShow[unionIndex].price.contains(".")) + TextSpan( + text:".", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Color(0xFFF65720), + ), + ), + if(storeList[position].productShow[unionIndex].price.contains(".")) + TextSpan( + text:(storeList[position].productShow[unionIndex]?.price ?? "").split(".")[1], + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize:12.sp, + color: Color(0xFFF65720), + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ),), + Text( + "¥${storeList[position].productShow[unionIndex]?.applyPrice ?? ""}", + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFFA29E9E), + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + decoration: TextDecoration.lineThrough, + decorationColor: Color(0xFFA29E9E), + ), ), + ]) + ], + ); + } + + Widget unionGoodsItem(ProductShow productShow) { + return Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + MImage( + productShow?.imgs[0] ?? "", + width: 97.h, + height: 97.h, + fit: BoxFit.cover, + radius: BorderRadius.circular(4), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + Padding( + padding: EdgeInsets.only(top: 8.h,bottom:6.h), + child: Text( + productShow?.productName ?? "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, ), ), - ], - ), + ), + Expanded(child:Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding(padding:EdgeInsets.only(right:2.w), + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize:12.sp, + color: Color(0xFFF65720), + ), + ), + TextSpan( + text:"${(productShow?.price ?? "").split(".")[0]}", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Color(0xFFF65720), + ), + ), + if(productShow.price.contains(".")) + TextSpan( + text:".", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Color(0xFFF65720), + ), + ), + if(productShow.price.contains(".")) + TextSpan( + text:(productShow?.price ?? "").split(".")[1], + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize:12.sp, + color: Color(0xFFF65720), + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ),), + Text( + "¥${productShow?.applyPrice ?? ""}", + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFFA29E9E), + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + decoration: TextDecoration.lineThrough, + decorationColor: Color(0xFFA29E9E), + ), + ), + ])) + ], ); } diff --git a/lib/view_widget/coupon_details_dialog.dart b/lib/view_widget/coupon_details_dialog.dart index 663ec786..fd5a96ad 100644 --- a/lib/view_widget/coupon_details_dialog.dart +++ b/lib/view_widget/coupon_details_dialog.dart @@ -41,13 +41,13 @@ class _CouponDetailsWidget extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Container( alignment: Alignment.center, - margin: EdgeInsets.symmetric(vertical: 12), + margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left:32.w), child: Text( S.of(context).shiyongxiangqing, style: TextStyle( diff --git a/lib/view_widget/my_appbar.dart b/lib/view_widget/my_appbar.dart index 36f55441..4cbb09fb 100644 --- a/lib/view_widget/my_appbar.dart +++ b/lib/view_widget/my_appbar.dart @@ -93,7 +93,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { }, child: Container( width: double.infinity, - margin: EdgeInsets.only(right:34.w), + margin: EdgeInsets.only(right:50.w), padding: EdgeInsets.all(10), alignment: Alignment.center, child: Text( diff --git a/lib/view_widget/recharge_details_dialog.dart b/lib/view_widget/recharge_details_dialog.dart index aa93077e..612a1edb 100644 --- a/lib/view_widget/recharge_details_dialog.dart +++ b/lib/view_widget/recharge_details_dialog.dart @@ -38,7 +38,7 @@ class _RechargeWidget extends State { children: [ Expanded(child: Container( - margin: EdgeInsets.symmetric(vertical: 12.h), + margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left: 32.w), alignment: Alignment.center, child: Text( "充值说明", diff --git a/lib/view_widget/selector_store_dialog.dart b/lib/view_widget/selector_store_dialog.dart index 8aefc7b0..97f52a7a 100644 --- a/lib/view_widget/selector_store_dialog.dart +++ b/lib/view_widget/selector_store_dialog.dart @@ -56,7 +56,7 @@ class _SelectorStoreWidget extends State { Expanded( child: Container( alignment: Alignment.center, - margin: EdgeInsets.symmetric(vertical: 12), + margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left: 32.w), child: Text( S.of(context).qingxuanzeshiyongmendian, style: TextStyle(