From 44e8bcf22f65c8a03bfd03315128fe1208f86ab4 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Fri, 29 Dec 2023 17:01:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E9=93=B6=E5=8F=B0ui=E8=B0=83=E6=95=B4?= =?UTF-8?q?,=E6=B5=81=E7=A8=8B=E8=B0=83=E6=95=B4=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/bus_cashier_switch.webp | Bin 0 -> 794 bytes assets/image/2x/bus_vip_cc.webp | Bin 0 -> 1372 bytes assets/image/3x/bus_cashier_switch.webp | Bin 0 -> 1028 bytes assets/image/3x/bus_vip_cc.webp | Bin 0 -> 2478 bytes assets/image/bus_cashier_switch.webp | Bin 0 -> 634 bytes assets/image/bus_vip_cc.webp | Bin 0 -> 870 bytes .../home/cashier/cashier_page.dart | 690 ++++++++++-------- 7 files changed, 399 insertions(+), 291 deletions(-) create mode 100644 assets/image/2x/bus_cashier_switch.webp create mode 100644 assets/image/2x/bus_vip_cc.webp create mode 100644 assets/image/3x/bus_cashier_switch.webp create mode 100644 assets/image/3x/bus_vip_cc.webp create mode 100644 assets/image/bus_cashier_switch.webp create mode 100644 assets/image/bus_vip_cc.webp diff --git a/assets/image/2x/bus_cashier_switch.webp b/assets/image/2x/bus_cashier_switch.webp new file mode 100644 index 0000000000000000000000000000000000000000..e24b924570051d1b90d1326796fc90aeb8036746 GIT binary patch literal 794 zcmWIYbaNA8W?%?+bqWXzu!!JdU|=u+Vp#?TMFs{>XXk(uj6f~};|UPS0+h$ zTO=LA)&Q}SAZ!~DyS${J1gIte#4ZX6at5+ffNYI)Bz6)KJGr0;q`n8J#wItX6l50& zfPBZ3nim=jq&a|ChM|}th{2t~3FLnu9|-anF)&zsWnf^QfDlWX$-uC^m4QLx7D7yA z0Rsbn3j@Qp^9V6Sm=q)yC4!A(0g_Bm$qafxmJu*g4H?XUG3=wv$iSd4>%bu}KT#of_7C&DZ_N$= ze?Gqp z;QZhkuL0Y-xeSxd-!cS0xHKumz!(NL>lUo@0H#DBc;NeUD#z}KZcqgCirjIG28@@5P<*hDHm{y@X zuc7kP)7=s72@}7~vS&EmbGvqlCG*>kr8Rx7U%5AwhW(3Ob8U9!gZ5kD2|^1#r^zg+ VW^QAwGB>;FQTprkoNQZ01^^sG%2WUV literal 0 HcmV?d00001 diff --git a/assets/image/2x/bus_vip_cc.webp b/assets/image/2x/bus_vip_cc.webp new file mode 100644 index 0000000000000000000000000000000000000000..7144c199e8d08f52f4c20938e19fd5f34859b81f GIT binary patch literal 1372 zcmWIYbaM+~Wnc(*bqWXzu!!JdU|=u+Vm&bObaoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4K&2Mmlr2nLDC#RU)+RuZV{+ck*V%eq)q;1}dfNi9wWD)|7!Dn&rcfo>83vPIG% zYz+`Q3BtAkvCB&eN`PttK=2?(*InG6iuTNxN6ZXv`}7BDdI zw=ghlJC6`Ugh@eSQ6ktl79h!#md3#FX*mM}ZzKbQ@C612u4u3vkig+K1)!7+&|UdJ zn9h*HkjkLI;K`83kPM7U1qLHvq#81q0b|%Fm6?G-U$22%p#G2fIO<%+}wECL+iTzp^v{1V1^1Q`4SD&OP?ppLv zaz(>_m$pY+Zb%+I)c2V`qsQq8#|b$lH^n58(@Rh4FbM_da0@Pu@NgD0$2pm2FC#P*6#`zY)th(!7taC% z1Oys(he+&K0)t1dEq42^ENbiMc#&bT`p2|M?HwI)t$&wX-~BK1!>@go)|R`CDzDhi zd*c!K%Qi1nWV+AmAJH2nS!Lc|n7HJ#S%=k+Bfs+}T_`-EC+}@!99Sf(HtEvDNSTv& zS5?~my0!VumM~$Pcft35&)Oxv=hd%u_aDh#xB4Kd8aMydvfn?cdR5*F9tBtS~OT(HQ>4q=9J=9xXIoHnSMn_kzK10t>w%UVFn_pP1sfZP} z+{fmV&-39_Qcw1U3oVadPZt$D!JXOIIDZmj`1g$~$|~c$AHQyYcW7V6$2<3$o~N3~ zS-AwOf7$t9=W6e3oDvPii&ixiCtkaAR9Pu*rpNya&PRmJ*X;DaS0;QxWmdJr=@)a= z=Sn1a$_SYLDQNohh@V|Z|H~wU3EdL%d!**?lxB7+;9X?PJexhw+&*r@3?7eKz0O&7 z53cHkC+&~zu)T0xSdgW7r_9#k*?!6U#ckVXP5HIj#f8OiQ9aXtCW9+ibS<{5;y+!& zyl%id4GtSB}MFz8EqdA@U>RXS^7*U|8uQAS4s z)|~okw)a!?oJTs6O#p$--!;klSBxVaf-`#!sxPMLkzKE|}@6@>& E0Qb`Exc~qF literal 0 HcmV?d00001 diff --git a/assets/image/3x/bus_cashier_switch.webp b/assets/image/3x/bus_cashier_switch.webp new file mode 100644 index 0000000000000000000000000000000000000000..6d393b6919f91e5015c1019c92463805714e4db7 GIT binary patch literal 1028 zcmWIYbaVT|%)k)t>J$(bU=hK^z`$St#5xQNh71gz&dvcR7=c^{#uFft1t^u9S5g$@ z?xYYA8KuDffPoPR!5}fYxB$Y!N&;1Vy9QBvSr@Ac{DPb*sl~}aB_DuTr3h#_&`lyh zwn#dJtpQ>uLD)7Rc6mub2~bS{h+PyCD76yiG=MiFvFeykZN(39n0wkHz(ij*%EoWfhjbvaDzQDl16%CdH5;)wZ0F;se zx+@0^I9-}4{- zbKbsr+e8_6{h2@G828v2CNVe&teL^c#o)rgBH*Y{p^$b);L*``X8R*7j9m##4Av|f z3<69dOdMh@K!&y$14F{~ZEIKE+;RJ$?Yk~#8_U8Qf45KG^ZBENsLPl5Mn%taGZJr{ zPLyMWd4hq#VM)QwP7we0qJqD_x4b@frR40{;^UqlizhvCzkl+Yd)xVHKb>CYoO@LT zn~Ia|+x@mxW&hYDUo2IT(sj#xwMTac3OI4FedGFGjRxmXRB%;Z>fT$IM&(H=o^bT< zpoqL`gY@|s5bGCf(`%T^J&zxzG-BP1>x9!qng;xvj9AaC4 zezIQN+U8e#UM_l*A^W2}?@IEbKbLeh`Wh~sy(OGp|Ea|$&qna>&du3BZrV-fZ+;+A zck{OG4XaO=(mR!pHrL{h$(-wR>jK}O6*;b|zWck+<%RE#?Bl)n idB^qox_bq-zJFO;C*Q68wfCR=jo!JZ4{bZh%>V#yiBdEG literal 0 HcmV?d00001 diff --git a/assets/image/3x/bus_vip_cc.webp b/assets/image/3x/bus_vip_cc.webp new file mode 100644 index 0000000000000000000000000000000000000000..76b1048c93ca62414958d4b92f49a67e270f3e8a GIT binary patch literal 2478 zcmaKqc|4R|8^=$UEH5Gnp=2*h$vUzVO_6Oz(?Vewj2U~@L4}$SC0iyL*=22JJoWID zrED41*rky|6lz4a;kni4{q+3tyzh1H>pI`-x_+PgoO7Ss5pHEw%m={fW9IhG_WCG( z0Kj3$t$sdm3k&=9ZBPofwQof(sD;Ca1UXup%c9PlmE{=&+o18&+&qE@%U;fa*06*XfWC0xDfd|ll=m>PFnm`x2VVggA061h7Cn9XebD$14 z&}lHAu9;!o5UlZix`2=-NdNJPyYwTac1VxgO2*P-4W(>FgIJ zY_4UGx@#PY2g%Y0a@ZPU_tqIoA!%{kA#r=9zaJrA&7)hnjnLG0k2>&}g0Zn)nd^qr z-@-pmhV--D+L~5qG{Z|H#*yQU)tb7i3%CmQo9>A+!V|Zlu*jqSsX~)RHUq6pi_f#o zZJVjNORu#?18DC*|G@emSy*KE)&DtTIBKb*e(e;VN-OMgrao!xneXZRV4O`w;g>hq z3*iXy261+!-HT#Ri<_IrqV!+!e0Y(BJSRJU|73&1dkuV8#js;Eru<$m%1d-0SAI4i z>&y^K=W8HSuR>ZzNV{=f^4qZ7v1$TmVo%6l-4^fzqEd0|XZv8M&21@sYK-jy27kVr z_9ie+RY;XcWw&{ZNgBg*CrQ>aExx0q(7lu+Yksf7KV8uiQ=E(`B_4Ude%5yKBiSJB z&h4h=q61m+?q~4W1c$)AvADJOw=^ltAN}7!~^EZ@tGu@c2TK2UH z#sF?eydf56Ip^NGlcc0^-b@-0IpfmqWt7T-<7lq1q7wqbeA_3h6okxCa2T%}5=-Ci zV5x|^B3uO+q~iiLH5?#K<)H${OH;g}h~;~J0Xbsx2|2J+BA@qGJ5+N(!4Ev#5afI; z7I(Q^<)P_o8r8#pv6nV7xN-GttZ!~DPKt^fp;hM7QhqchKPBXeGhyPwuVZ=eBl@?O zB6Aiq(X$a8|NS|)W^L+{K(fk(DAp=&X}xo!yU6TvUccbB-x6)(vUz>Y;L$TLBs`Ke zx57P_EY1Gz!6;_IRjLV;!%a%xou2a>R925v-{{y#*_zcC9}GUG7)&!Yu51K93?!y@(v!6=90pei9#}d_C_zTt={raT89l zv0F>RPVQ;6(|kBq@@nLDWWlN}c}=O~*<`xqQyY=q(9K{pMVeKqc_A~cNkgDe#z$i) z-(x9pshLLkGIcAaZ(%pgZdP#arE3=a=}bbXnw*ZPd-%0fg;0t_S%4BQGFR1^>f4ei z=rjA=pheGbum-`M8~Twlvu1Y;Hq8;@G6kCoQ`Qllv6&)WaE!crV%5Td0O|>-mMRVN zW!D`rU$&cgX7nqOi+(!&hhf8LYg-y3mC-BTl&I8hkJ?BiOi`H(Kc8&}Fl5ZtO#a zUCPn#*E;}b&Dj)B>pSCOFRN6^`HO+{mCRGCy*UYH z9BW+LF|}f=kevDhxw_m5*M3uxXHwaYm=|4B%<}J6p6_s`iKe(3)ir*Hm0U= zM=K|EP?vi+}a;fR~X;Mp})6qz*=)WIH+Avl7FC$fCr07?R}94 zMUb@U6&Bwv1jC^#>rl0@7`gpH<9;LYqRRUpmsM6>jSe-Wyzi2yqmzi~L~WArIC{66 zWMgUdZGCU~=);RhBVt#sHLkSPLTap&IQ&>!MySEm5JM#AX%+GUI---4wRB5a9F1l@-P!=?@D+K`yy>}RSu$Un>o{SBwyWxr?1!jdf+rCXu z5q%S%iCcP9t{PYz{{JtFyHuy!P1-S?KZf`OvK2$5{e_eht~9ZNm6jbBAA|eU9KnIGPbyQ^E{`Q@1&rgZ+nA7 z&#@a$b`%@&A4kydcrkS>LSNnd@!TpSRPVrG=8Uech0iJV-~taqkx(`48hTbz0`Vkb VGh^z@(qcNcOP<51Qb&jz{0$Y*9?k#& literal 0 HcmV?d00001 diff --git a/assets/image/bus_cashier_switch.webp b/assets/image/bus_cashier_switch.webp new file mode 100644 index 0000000000000000000000000000000000000000..50370e52256923068b8caa52b13a95457a907284 GIT binary patch literal 634 zcmWIYbaN|WVqge&bqWXzu!!JdU|=u+Vm<~20R{$7XXk(uj6f~};|UPS0+h$ zTO=LA)&Q}SAZ!~DyS${J1gIte#4ZX6at5+ffNYI)Bz6)KJGr0;q`n8J#wItX6l50& zfPBZ3nim=jq&a|ChM|}th{2t~3FLnu9|-anF)&zsWnf^QfDlWX$-uC^m4QLx7D7yA z0Rsbn3j@Qp^9V6Sm=q)yC4!A(0g_Bm$qafxmJu*g4H?XUG3?U}RH)C#z#@=u@c*;@|EyacMU$tm zKgF=F#z(%vo=2vQ|L`LL10EJG_pQ0sXP1`qOB`S}&Pib4=h@B9^MH|g$@eF#PX3is z`n7&ruC&|iw^z&=7(^8=1p2YwTK9Ta-?dJalO8U6SJnDYk!9%Njb2t`J9CSP)w{Lj Uk8MsXpUB)2+q=!^hd&bo04x`OdjJ3c literal 0 HcmV?d00001 diff --git a/assets/image/bus_vip_cc.webp b/assets/image/bus_vip_cc.webp new file mode 100644 index 0000000000000000000000000000000000000000..47a104f624d7c32e0113462ab8a865c4c98a6bf8 GIT binary patch literal 870 zcmWIYbaRViW?%?+bqWXzu!!JdU|=u+VsS9?baoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4K&2Mmlr2nLDC#RU)+RuZV{+ck*V%eq)q;1}dfNi9wWD)|7!Dn&rcfo>83vPIG% zYz+`Q3BtAkvCB&eN`PttK=2?(*InG6iuTNxN6ZXv`}7BDdI zw=ghlJC6`Ugh@eSQ6ktl79h!#md3#FX*mM}ZzKbQ@C612u4u3vkig+K1)!7+&|UdJ zn9h*HkjkLI;K`83kj$V5WElY?)sVpq7{fjVj0_C=;s;m-+!rcrn)>2!1pk|~$+z=l zqM99Vn>E$AzYzH+vv0yYM`h2hUq4#raBtz`pEN^a`@|&{7B;7AzU*RPIPi^~n_V>S zY+C;ummjrPKmA*i&GRX}%T4g*AK8`@<_Fa?MFY3VReaXzXHPkla`}5A&#wuAJ-bwy zuXIo3U`o2nBkyq_uIMh$;+9>K3>zn^xCY4`{%>d;zxBV|y|V9bW(i!ZXUn^77Igde z;j&L$3=L16C&?Kze42VKa+1paf;`b{Cra;>O+NYT9ameXuWIh5ZEKfg1{h4STf1m_ zzsV@mAR&YJ}=kI`J+50->X9>o| z{Mp&_pS36X?5yYa_r%@f{rYvSmC{$|6_Kk#-?ZNll)GPRJo8PSJ!`1B$=mH#-#6cw Ie|iZs09Eh(vH$=8 literal 0 HcmV?d00001 diff --git a/lib/business_system/home/cashier/cashier_page.dart b/lib/business_system/home/cashier/cashier_page.dart index a2403d22..af574575 100644 --- a/lib/business_system/home/cashier/cashier_page.dart +++ b/lib/business_system/home/cashier/cashier_page.dart @@ -15,6 +15,7 @@ import '../../../utils/business_instance.dart'; import '../../../utils/flutter_utils.dart'; import '../../../view_widget/border_text.dart'; import '../../../view_widget/classic_header.dart'; +import '../../../view_widget/custom_image.dart'; import '../../../view_widget/my_footer.dart'; import '../../../view_widget/round_button.dart'; import '../../../view_widget/settlement_tips_dialog.dart'; @@ -45,7 +46,6 @@ class _CashierPage extends State { List manualQueryInfo; bool isDisplayVipInfo = false; - ///离开页面记着销毁和清除 @override void dispose() { @@ -71,6 +71,8 @@ class _CashierPage extends State { } }); }); + if((widget?.arguments["phone"] ?? "")!= "") + queryMemberPhoneInfo(widget?.arguments["phone"] ?? ""); } ///根据手机号搜索用户信息 @@ -89,7 +91,7 @@ class _CashierPage extends State { } BaseData baseData = await businessService .queryMemberInfo( - {"phoneNum": phoneNum, "isNewUser": false}).catchError((error) { + {"phoneNum": phoneNum, "isNewUser": false}).catchError((error) { networkError = AppUtils.dioErrorTypeToString(error.type); networkStatus = -1; setState(() {}); @@ -99,6 +101,7 @@ class _CashierPage extends State { if (!mounted) return; if (baseData != null && baseData.isSuccess) { phoneQueryMemberInfo = baseData.data; + isDisplayVipInfo = true; refreshController.loadComplete(); refreshController.refreshCompleted(); networkStatus = 1; @@ -108,9 +111,8 @@ class _CashierPage extends State { refreshController.loadFailed(); } } finally { - if (isShow) - EasyLoading.dismiss(); - setState((){}); + if (isShow) EasyLoading.dismiss(); + setState(() {}); } } @@ -128,10 +130,10 @@ class _CashierPage extends State { storeId: widget.arguments["storeId"]); } BaseData baseData = await businessService.createOrder({ - "createOrderType": "DIRECT",// 创建订单类型 DIRECT 直接下单 ASSIGN 指定商品下单 + "createOrderType": "DIRECT", // 创建订单类型 DIRECT 直接下单 ASSIGN 指定商品下单 "orderAmount": _displayTotal.toStringAsFixed(2), - "virtualProductId":-2, - "mid":phoneQueryMemberInfo?.sid ?? "" + "virtualProductId": -2, + "mid": phoneQueryMemberInfo?.sid ?? "" }).catchError((error) { networkError = AppUtils.dioErrorTypeToString(error.type); networkStatus = -1; @@ -142,26 +144,25 @@ class _CashierPage extends State { if (!mounted) return; if (baseData != null && baseData.isSuccess) { cashierOrderId = baseData.data; - if(payChannel == 1|| payChannel == 2){ - Navigator.of(context).pushNamed( - '/router/scan_code_page', - arguments: { - "storeId": widget.arguments["storeId"], - "scanCodeType": "收银台支付", - "mid":phoneQueryMemberInfo?.sid ??"", - "orderId": cashierOrderId, - "payChannel":payChannel - }).then((value) { + if (payChannel == 1 || payChannel == 2) { + Navigator.of(context).pushNamed('/router/scan_code_page', arguments: { + "storeId": widget.arguments["storeId"], + "scanCodeType": "收银台支付", + "mid": phoneQueryMemberInfo?.sid ?? "", + "orderId": cashierOrderId, + "payChannel": payChannel + }).then((value) { if (value == 1) { _display = ""; _displayTotal = 0; - }else{ + } else { manualQueryInfo = value; showPayQueryDialog(manualQueryInfo[0], manualQueryInfo[1]); } }); - }else{ - await cashierPayOrder(cashierOrderId,payChannel,phoneQueryMemberInfo?.sid ?? ""); + } else { + await cashierPayOrder( + cashierOrderId, payChannel, phoneQueryMemberInfo?.sid ?? ""); } networkStatus = 1; setState(() {}); @@ -172,7 +173,7 @@ class _CashierPage extends State { } ///支付接口 - cashierPayOrder(orderId, payChannel,mid) async { + cashierPayOrder(orderId, payChannel, mid) async { try { if (businessService == null) { businessService = BusinessApiService(Dio(), @@ -184,8 +185,8 @@ class _CashierPage extends State { BaseData baseData = await businessService.prePayOrder({ "orderId": orderId, "payChannel": payChannel, - "mid":mid, - "authCode":(payChannel ==1 || payChannel == 2) ?"": null, + "mid": mid, + "authCode": (payChannel == 1 || payChannel == 2) ? "" : null, }).catchError((error) { networkError = AppUtils.dioErrorTypeToString(error.type); networkStatus = -1; @@ -197,25 +198,26 @@ class _CashierPage extends State { if (baseData != null && baseData.isSuccess) { _display = ""; _displayTotal = 0; - await queryMemberPhoneInfo(editingController?.text ?? "",isShow: false); + if (phoneQueryMemberInfo != null) + await queryMemberPhoneInfo(editingController?.text ?? "", + isShow: false); SmartDialog.show( widget: SettlementTips( - () {}, - text: baseData.data ??"", - color: Color(0xFF30415B), - )); + () {}, + text: baseData.data ?? "", + color: Color(0xFF30415B), + )); networkStatus = 1; setState(() {}); } else { SmartDialog.show( widget: SettlementTips( - () {}, - text: baseData.msg, - color: Color(0xFF30415B), - )); + () {}, + text: baseData.msg, + color: Color(0xFF30415B), + )); } - } finally { - } + } finally {} } ///手动查询充值订单状态 @@ -231,25 +233,27 @@ class _CashierPage extends State { tenant: BusinessInstance.instance.businessTenant, storeId: widget.arguments["storeId"]); } - BaseData baseData = await businessService.queryCashierOrder(cashierOrderId,true).catchError((error) {}); + BaseData baseData = await businessService + .queryCashierOrder(cashierOrderId, true) + .catchError((error) {}); if (baseData != null && baseData.isSuccess) { _display = ""; _displayTotal = 0; Navigator.of(context).pop(); SmartDialog.show( widget: SettlementTips( - () {}, - text: baseData.data ??"", - color: Color(0xFF30415B), - )); + () {}, + text: baseData.data ?? "", + color: Color(0xFF30415B), + )); } else { if (baseData.msg != "需要用户输入支付密码") Navigator.of(context).pop(); SmartDialog.show( widget: SettlementTips( - () {}, - text: baseData.msg, - color: Color(0xFF30415B), - )); + () {}, + text: baseData.msg, + color: Color(0xFF30415B), + )); } } finally { EasyLoading.dismiss(); @@ -271,8 +275,8 @@ class _CashierPage extends State { leadingColor: Colors.black, brightness: Brightness.dark, ), - body: Container( - child: SmartRefresher( + body:networkStatus == -1 + ? noNetwork() :SmartRefresher( enablePullDown: true, enablePullUp: false, header: MyHeader( @@ -285,9 +289,9 @@ class _CashierPage extends State { ), controller: refreshController, onRefresh: () { - if(editingController.text != "") - queryMemberPhoneInfo(editingController.text ?? "",isShow: false); - else{ + if (editingController.text != "") + queryMemberPhoneInfo(editingController.text ?? "", isShow: false); + else { refreshController.loadComplete(); refreshController.refreshCompleted(); } @@ -298,57 +302,58 @@ class _CashierPage extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: double.infinity, - padding: EdgeInsets.only(top: 19.h, bottom: 13.h), - decoration: BoxDecoration( - color: Colors.white, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 16.w), - child: Text( - "快速收银", - style: TextStyle( - fontSize: 15.sp, - fontWeight: MyFontWeight.bold, - color: Color(0xFF0D0D0D), + if (isDisplayVipInfo == false) + Container( + width: double.infinity, + padding: EdgeInsets.only(top: 19.h, bottom: 13.h), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 16.w), + child: Text( + "快速收银", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), ), ), - ), - Stack( - children: [ - Container( - width: double.infinity, - height: 2.h, - margin: EdgeInsets.only(top: 5.h), - color: Color(0xFFD8D8D8), - ), - Container( - width: 44.w, - height: 1.5.h, - margin: EdgeInsets.only(top: 5.h, left: 24.w), - color: Color(0xFF30415B), - ), - ], - ), - SizedBox( - height: 13.h, - ), - vipUserSearch(), - ], + Stack( + children: [ + Container( + width: double.infinity, + height: 2.h, + margin: EdgeInsets.only(top: 5.h), + color: Color(0xFFD8D8D8), + ), + Container( + width: 44.w, + height: 1.5.h, + margin: EdgeInsets.only(top: 5.h, left: 24.w), + color: Color(0xFF30415B), + ), + ], + ), + SizedBox( + height: 13.h, + ), + vipUserSearch(), + ], + ), ), - ), - phoneQueryMemberInfo != null? - vipPlate(): - SizedBox(height:103.h), + (phoneQueryMemberInfo != null && isDisplayVipInfo == true) + ? vipPlate() + : SizedBox(height: 103.h), calculator() ], ), ), - )), + ), ), ); } @@ -420,7 +425,7 @@ class _CashierPage extends State { children: [ Container( width: double.infinity, - padding: EdgeInsets.only(top: 13.h, left: 16.w, bottom: 33.h), + padding: EdgeInsets.only(left: 16.w, bottom: 33.h), margin: EdgeInsets.only(bottom: 10.h), decoration: BoxDecoration( color: Colors.white, @@ -428,7 +433,9 @@ class _CashierPage extends State { begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Color(0xFF30415B), Color(0xFF5171A4)]), - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.vertical( + top: Radius.circular(8), + ), ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -436,40 +443,84 @@ class _CashierPage extends State { Container( width: 52.h, height: 52.h, - margin: EdgeInsets.only(right: 15.w), + margin: EdgeInsets.only(right: 15.w, top: 13.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), ), - child: Image.asset( - "assets/image/bs_mine_heading.webp", + child:MImage( + (phoneQueryMemberInfo?.headimg ?? + ""), width: double.infinity, - height: double.infinity, - fit: BoxFit.fill, + height: double.infinity, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", ), ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(bottom: 8.h), - child: Text( - "会员名称:${phoneQueryMemberInfo?.nickName ?? ""}", + Expanded( + child: Container( + padding: EdgeInsets.only(top: 13.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 8.h), + child: Text( + "会员名称:${phoneQueryMemberInfo?.nickName ?? ""}", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + )), + Text( + "手机号:${phoneQueryMemberInfo?.phoneNum ?? ""}", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, color: Colors.white, ), - )), - Text( - "手机号:${phoneQueryMemberInfo?.phoneNum ?? ""}", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.white, - ), - ) - ], - ) + ) + ], + ), + ), + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + isDisplayVipInfo = false; + editingController.text = ""; + }); + }, + child: Container( + padding: + EdgeInsets.only(right: 19.w, top: 13.h, bottom: 13.h), + child: Column( + children: [ + Image.asset( + "assets/image/bus_cashier_switch.webp", + width: 17.w, + height: 15.h, + color: Colors.white, + fit: BoxFit.fill, + ), + Padding( + padding: EdgeInsets.only(top: 5.h), + child: Text( + "切换会员", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + )) + ], + )), + )) ], ), ), @@ -505,7 +556,7 @@ class _CashierPage extends State { ], )), Text( - "${double.tryParse(phoneQueryMemberInfo?.balance ?? 0)}", + "${double.tryParse(phoneQueryMemberInfo?.balance ?? 0)}", style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.medium, @@ -543,7 +594,8 @@ class _CashierPage extends State { ], )), Text( - (phoneQueryMemberInfo?.useableConponList?.length ?? 0).toString(), + (phoneQueryMemberInfo?.useableConponList?.length ?? 0) + .toString(), style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.medium, @@ -563,7 +615,7 @@ class _CashierPage extends State { Widget calculator() { return Container( color: Colors.white, - margin: EdgeInsets.only(top: 15.h), + margin: EdgeInsets.only(top: isDisplayVipInfo == false ? 15.h : 45.h), alignment: Alignment.bottomCenter, child: Column( crossAxisAlignment: CrossAxisAlignment.end, @@ -727,62 +779,55 @@ class _CashierPage extends State { ), ], ), - Row( - children: [ - Expanded( - flex: 2, - child: Container( - alignment: Alignment.center, - color: Color(0xFF5A7092), - padding: EdgeInsets.only(top: 32.h, bottom: 33.h), - child: Text( - "¥${_displayTotal.toStringAsFixed(2)}", - style: TextStyle( - fontSize: 24.sp, - fontWeight: MyFontWeight.bold, - color: Colors.white, + Container( + height: 100.h, + child: Row( + children: [ + Expanded( + flex: 2, + child: Container( + alignment: Alignment.center, + color: Color(0xFF5A7092), + padding: EdgeInsets.only(top: 10.h, bottom: 10.h), + child: Text( + "¥${_displayTotal.toStringAsFixed(2)}", + style: TextStyle( + fontSize: 24.sp, + fontWeight: MyFontWeight.bold, + color: Colors.white, + ), ), - ), - )), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - if(_displayTotal.toStringAsFixed(2) == "0.00"){ - SmartDialog.show( - widget: SettlementTips( - () {}, - text:"订单支付金额小于或等于0,无法进行支付操作", - color: Color(0xFF30415B), - )); - }else{ - if(phoneQueryMemberInfo != null){ - showPaySelectDialog(); - }else { + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if (_displayTotal.toStringAsFixed(2) == "0.00") { SmartDialog.show( widget: SettlementTips( - () {}, - text:"请输入会员手机号进行结账", - color: Color(0xFF30415B), - )); + () {}, + text: "订单支付金额小于或等于0,无法进行支付操作", + color: Color(0xFF30415B), + )); + } else { + showPaySelectDialog(); } - } - - }, - child: Container( - alignment: Alignment.center, - color: Color(0xFF30415B), - padding: EdgeInsets.only( - top: 22.h, bottom: 25.h, left: 45.w, right: 33.w), - child: Text( - "结账", - style: TextStyle( - fontSize: 36.sp, - fontWeight: MyFontWeight.bold, - color: Colors.white, + }, + child: Container( + alignment: Alignment.center, + color: Color(0xFF30415B), + padding: EdgeInsets.only( + top: 10.h, bottom: 10.h, left: 45.w, right: 33.w), + child: Text( + "结账", + style: TextStyle( + fontSize: 36.sp, + fontWeight: MyFontWeight.bold, + color: Colors.white, + ), ), - ), - )), - ], + )), + ], + ), ) ], ), @@ -865,7 +910,7 @@ class _CashierPage extends State { builder: (context) { return Container( width: double.infinity, - height: 280.h, + height: phoneQueryMemberInfo != null ? 280.h : 220.h, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( @@ -883,17 +928,18 @@ class _CashierPage extends State { children: [ Expanded( child: Container( - alignment: Alignment.center, - margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left: 41.w), - child: Text( - S.of(context).zhifufangshi, - style: TextStyle( - fontWeight: MyFontWeight.bold, - fontSize: 17.sp, - color: Color(0xFF1A1A1A), - ), - ), - )), + alignment: Alignment.center, + margin: + EdgeInsets.only(top: 12.h, bottom: 12.h, left: 41.w), + child: Text( + S.of(context).zhifufangshi, + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 17.sp, + color: Color(0xFF1A1A1A), + ), + ), + )), GestureDetector( onTap: () { setState(() { @@ -912,133 +958,146 @@ class _CashierPage extends State { ], ), Padding( - padding: EdgeInsets.only(left: 23.w,right: 9.w), - child:Column( + padding: EdgeInsets.only(left: 23.w, right: 9.w), + child: Column( children: [ GestureDetector( behavior: HitTestBehavior.opaque, - onTap:(){ + onTap: () { Navigator.of(context).pop(); - showPayAmountDialog(0,"现金"); + showPayAmountDialog(0, "现金"); }, - child: Padding(padding:EdgeInsets.only(left: 5.w), - child: Row( - children: [ - Image.asset( - "assets/image/bus_cashier_xj.webp", - width: 31.w, - height: 22.h, + child: Padding( + padding: EdgeInsets.only(left: 5.w), + child: Row( + children: [ + Image.asset( + "assets/image/bus_cashier_xj.webp", + width: 31.w, + height: 22.h, + ), + Padding( + padding: EdgeInsets.only(left: 14.w), + child: Text( + "现金支付", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )) + ], ), - Padding( - padding: EdgeInsets.only(left: 14.w), - child: Text( - "现金支付", - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - )) - ], - ),), + ), ), Container( width: double.infinity, height: 1.h, color: Color(0xFFEBEBEB), - margin: EdgeInsets.symmetric(vertical:13.h), + margin: EdgeInsets.symmetric(vertical: 13.h), ), GestureDetector( behavior: HitTestBehavior.opaque, - onTap:(){ + onTap: () { Navigator.of(context).pop(); - showPayAmountDialog(1,"微信");}, - child: Padding(padding:EdgeInsets.only(left: 5.w), - child: Row( - children: [ - Image.asset( - "assets/image/bus_vip_wx.webp", - width: 29.w, - height: 26.h, - ), - Padding( - padding: EdgeInsets.only(left: 14.w), - child: Text( - "微信", - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - )) - ], - ),)), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBEBEB), - margin: EdgeInsets.symmetric(vertical:13.h), - ), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap:(){ - Navigator.of(context).pop(); - showPayAmountDialog(2,"支付宝");}, - child: Padding(padding:EdgeInsets.only(left: 5.w), - child: Row( - children: [ - Image.asset( - "assets/image/bus_vip_alipay.webp", - width: 29.h, - height: 29.h, + showPayAmountDialog(1, "微信"); + }, + child: Padding( + padding: EdgeInsets.only(left: 5.w), + child: Row( + children: [ + Image.asset( + "assets/image/bus_vip_wx.webp", + width: 29.w, + height: 26.h, + ), + Padding( + padding: EdgeInsets.only(left: 14.w), + child: Text( + "微信", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )) + ], ), - Padding( - padding: EdgeInsets.only(left: 14.w), - child: Text( - "支付宝", - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - )) - ], - ),)), + )), Container( width: double.infinity, height: 1.h, color: Color(0xFFEBEBEB), - margin: EdgeInsets.symmetric(vertical:13.h), + margin: EdgeInsets.symmetric(vertical: 13.h), ), GestureDetector( behavior: HitTestBehavior.opaque, - onTap:(){ + onTap: () { Navigator.of(context).pop(); - showPayAmountDialog(3,"商户余额");}, - child: Padding(padding:EdgeInsets.only(left: 5.w), - child: Row( - children: [ - Image.asset( - "assets/image/bus_cashier_balance.webp", - width: 27.h, - height: 27.h, + showPayAmountDialog(2, "支付宝"); + }, + child: Padding( + padding: EdgeInsets.only(left: 5.w), + child: Row( + children: [ + Image.asset( + "assets/image/bus_vip_alipay.webp", + width: 29.h, + height: 29.h, + ), + Padding( + padding: EdgeInsets.only(left: 14.w), + child: Text( + "支付宝", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )) + ], ), - Padding( - padding: EdgeInsets.only(left: 14.w), - child: Text( - "商户余额", - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, + )), + if (phoneQueryMemberInfo != null) + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBEBEB), + margin: EdgeInsets.symmetric(vertical: 13.h), + ), + if (phoneQueryMemberInfo != null) + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pop(); + showPayAmountDialog(3, "商户余额"); + }, + child: Padding( + padding: EdgeInsets.only(left: 5.w), + child: Row( + children: [ + Image.asset( + "assets/image/bus_cashier_balance.webp", + width: 27.h, + height: 27.h, ), - )) - ], - ),)), + Padding( + padding: EdgeInsets.only(left: 14.w), + child: Text( + "商户余额", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )) + ], + ), + )), // Container( // width: double.infinity, // height: 1.h, @@ -1081,7 +1140,7 @@ class _CashierPage extends State { } ///确认支付金额提示 - showPayAmountDialog(index,payText) { + showPayAmountDialog(index, payText) { showDialog( context: context, builder: (context) { @@ -1113,7 +1172,7 @@ class _CashierPage extends State { ), ), SizedBox( - height:10.h, + height: 10.h, ), Text( "支付金额: ${_displayTotal.toStringAsFixed(2)}元", @@ -1163,7 +1222,7 @@ class _CashierPage extends State { onTap: () { setState(() { Navigator.of(context).pop(); - cashierCreateOrder(index); + cashierCreateOrder(index); }); }, ), @@ -1202,7 +1261,7 @@ class _CashierPage extends State { child: Container( alignment: Alignment.topRight, padding: - EdgeInsets.symmetric(horizontal: 5.w, vertical: 10.h), + EdgeInsets.symmetric(horizontal: 5.w, vertical: 10.h), child: Image.asset( "assets/image/cancel.webp", width: 24.h, @@ -1211,7 +1270,7 @@ class _CashierPage extends State { ), Padding( padding: - EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w), + EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w), child: Text( queryDialog, style: TextStyle( @@ -1223,7 +1282,7 @@ class _CashierPage extends State { ), Padding( padding: - EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w), + EdgeInsets.only(bottom: 20.h, left: 14.w, right: 14.w), child: Text.rich( TextSpan( children: [ @@ -1308,4 +1367,53 @@ class _CashierPage extends State { }, ); } + + ///网络错误 + Widget noNetwork() { + return Container( + color: Colors.white, + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + networkError.substring(0, networkError.indexOf(",")), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.h), + child: Text( + "请检查网络设置或稍后重试", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + queryMemberPhoneInfo(widget?.arguments["phoneNum"] ?? ""); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), + child: Text( + "重试", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular), + )), + ) + ], + ), + ); + } }