From 1d3851e80b60bc2a411c278bb89dd2acd35f634c Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Mon, 6 Feb 2023 14:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E9=A1=B5VIP=E6=9D=83?= =?UTF-8?q?=E7=9B=8A=E6=94=B9=E6=88=90=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD?= =?UTF-8?q?=EF=BC=9B=20=E8=AE=A2=E5=8D=95=E7=BB=93=E7=AE=97=E5=90=8Eloadin?= =?UTF-8?q?g=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E7=A4=BE=E5=8C=BA=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0EmojiPicker=E8=A1=A8=E6=83=85=EF=BC=9B=20=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E8=A7=86=E9=A2=91=E5=9B=BA=E5=AE=9A=E5=AE=BD=E9=AB=98?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E5=85=A8=E5=B1=8F=EF=BC=9B=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BC=9A=E5=91=98=E4=BA=8C=E7=BB=B4=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E6=9D=A1=E5=BD=A2=E7=A0=81=EF=BC=9B=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E6=88=91=E7=9A=84=E9=A1=B5=E9=9D=A2ui=EF=BC=9B=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=89=AB=E7=A0=81=E8=B7=B3=E8=BD=AC=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/mine_order.webp | Bin 0 -> 866 bytes assets/image/2x/mine_vip_logo.webp | Bin 0 -> 1064 bytes assets/image/2x/set.webp | Bin 0 -> 1316 bytes assets/image/2x/vip_code.webp | Bin 0 -> 1212 bytes assets/image/2x/wallet.webp | Bin 0 -> 1066 bytes assets/image/3x/mine_order.webp | Bin 0 -> 1178 bytes assets/image/3x/mine_vip_logo.webp | Bin 0 -> 1652 bytes assets/image/3x/set.webp | Bin 0 -> 2904 bytes assets/image/3x/vip_code.webp | Bin 0 -> 1800 bytes assets/image/3x/wallet.webp | Bin 0 -> 1456 bytes assets/image/mine_order.webp | Bin 0 -> 642 bytes assets/image/mine_vip_logo.webp | Bin 0 -> 718 bytes assets/image/set.webp | Bin 0 -> 908 bytes assets/image/vip_code.webp | Bin 0 -> 720 bytes assets/image/wallet.webp | Bin 0 -> 710 bytes lib/community/community_child_page.dart | 2 + lib/community/community_details.dart | 113 +++- .../community_view/class_details.dart | 71 +- .../community_view/class_details_video.dart | 12 +- lib/community/new_community_details.dart | 64 ++ lib/home/welfare_exchange.dart | 4 +- lib/main.dart | 5 +- lib/message/system_message.dart | 13 +- lib/mine/mine_page.dart | 65 +- lib/mine/mine_view/community_follow.dart | 8 + lib/mine/mine_view/mine_item.dart | 2 +- lib/mine/mine_view/mine_navbar.dart | 301 +++++++++ lib/mine/mine_view/mine_view.dart | 137 ++-- lib/mine/personal_page.dart | 623 +++++++++--------- lib/mine/scan_web.dart | 43 +- lib/mine/vip_pay_code.dart | 253 +++++++ lib/order/exchange_order_page.dart | 2 +- lib/order/order_detail_page.dart | 2 +- lib/qr/qr_code_scan.dart | 86 ++- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/setting/logout_ing.dart | 6 +- lib/settlement/settlement.dart | 2 +- .../activity_coupon_remarks.dart | 4 +- .../settlement_order_commodity.dart | 2 +- lib/view_widget/mine_vip_entry.dart | 240 ++++--- lib/view_widget/update_dialog.dart | 5 - lib/vip/vip_view/vip_top.dart | 3 +- lib/web/web_page.dart | 65 +- lib/web/web_view/input_comment.dart | 295 +++++---- pubspec.yaml | 4 +- 46 files changed, 1761 insertions(+), 675 deletions(-) create mode 100644 assets/image/2x/mine_order.webp create mode 100644 assets/image/2x/mine_vip_logo.webp create mode 100644 assets/image/2x/set.webp create mode 100644 assets/image/2x/vip_code.webp create mode 100644 assets/image/2x/wallet.webp create mode 100644 assets/image/3x/mine_order.webp create mode 100644 assets/image/3x/mine_vip_logo.webp create mode 100644 assets/image/3x/set.webp create mode 100644 assets/image/3x/vip_code.webp create mode 100644 assets/image/3x/wallet.webp create mode 100644 assets/image/mine_order.webp create mode 100644 assets/image/mine_vip_logo.webp create mode 100644 assets/image/set.webp create mode 100644 assets/image/vip_code.webp create mode 100644 assets/image/wallet.webp create mode 100644 lib/mine/mine_view/mine_navbar.dart create mode 100644 lib/mine/vip_pay_code.dart diff --git a/assets/image/2x/mine_order.webp b/assets/image/2x/mine_order.webp new file mode 100644 index 0000000000000000000000000000000000000000..4d92bd9fcc85956b929461972c429edb66f3e2f5 GIT binary patch literal 866 zcmWIYbaRVhW?%?+bqWXzu!!JdU|=u+Vr?+;baoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4Jn7z`vP7Zxx$&AP0MMV^olXG&^uGEmV6AXX^?S`KuR2#_t34q@Pj%PiUKXd)vgrQ!m%%r#~}e+`(;CUc3A4>XWm#4w1M0EHICrWYz6(>x|7FsLzbqzfo{Oj7ZjsB$*5 zC-GTCPv8Ilg&RI?*|falpLWshZHf~fzj!BKc0Lpf(Et7W9X9ZLzwzIdGhf|5xPE5c zJlSVQAD%H&!URd&uwX->8_vGXPD2CFUcY^I_UxLd>-qE2D(Adm Sdv)Zxdop*={=E6Vj{yJ#X8ec% literal 0 HcmV?d00001 diff --git a/assets/image/2x/mine_vip_logo.webp b/assets/image/2x/mine_vip_logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..a971662e61c94f97aeb8a64db624998418e7ae05 GIT binary patch literal 1064 zcmWIYbaPW+VPFV%bqWXzu!!JdU|=u+Vo3%DQ3eK2XXk(uj6f~};|UPS0+h&0*?z2y*;?J{ZLa%l$atN)Q z_gqx4lS8HY{`E~d_mvKPw)wwnT_*?QmwoTWTpK%{yi-B6FU}i~Enb*zQt1NoAILw!tXYzQ}3=W=$(yk$%*N%P&RqT-Tbx-i9>qv}zcy`vx z0|xpn(~W#zL`pn&Xg15gG56v$zeUq-Oy%fv%47RlqC9Jwd`eb9@Y^k4qw6no&f8`7 znKw}=|Jj~w^(X$b^XDEZP=33={CX;r*Oe8U`5ymSe&wBx#VKF+1tqGNZXQ2dCC|bD E00mB7u>b%7 literal 0 HcmV?d00001 diff --git a/assets/image/2x/set.webp b/assets/image/2x/set.webp new file mode 100644 index 0000000000000000000000000000000000000000..8bdaa12c5607f3cabf6fccdf47bcf05ad15270da GIT binary patch literal 1316 zcmWIYbaRtoWnc(*bqWXzu!!JdU|=u+VqGxubaoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4Jn7z`vP7Zxx$&AJRUoMgb6l3JV$)b#;~Rf>R?1KlJ7WQ(Lj*cu>q z5`=97VwaZ`lmOKPfY?PLLC!#S3XrXlj>JwvVkZ|Afzzleds;wu9K^8|!g(o6=1?X3(961NayDhn7G_*)nlww*_a zA;P2}u_zH}J}{7hm?0!FGKgBdV}eRP=_81!`=xCQiCmv74rzk2JtT~RB$md^qv$Br{> zPE!x}m)|Uq@tm~y$sNV`9Sy-h@*A$r$~-C-l|+k06L?Kxcf^oPyt#h265+Rp8_zGm`q&vb3}%gbJT z{r~cReS~k-{D0@yT|RGAYWvFS>d_b1&T?G!dwYLv+2`qwvY-C>R;w;u_VfB*^=Sv$ zYda;+F5DaCByrZddA^{}UL%QJKD|d4Zt-}LwUMW(>ejAQ1xZr9Z^`?%;dV~!qyoUj%=w4w^wkmO*>%Z^6Ah5j)ZB`Hi)E5Y6+BCsGxB*(1uIB znJY_xWwPFchDM&I1OdekrwNV@3=5c z0foRxDVMkXy0tC$cGb79d(Q*uZCB-gC9OB#{H?~(<-hEXTxriX+vD??Ud=os4T-!7 z`@S9cTfYDQo}HB&xFJFx0!%$8sYE7D=y3Ji%%-KTIz97a<^MHnf>$a|HgZ38PvV@Z zy60K-?3x#gn$N46`215T{T~-U|G|R4^&!>Ij(^>|+rLJ^^V0KH|Ks1^?Ed;YXYS-T z(kehBJ%9bb^Yo5`^ofFN)Ar8YQY?MxUDT^6FZs-u@3^<^`fwynU%e(`-r9^ctFoeg zU1`tIDRNW&xm)d`uJ@l)`?W6lm>A8^csaexV#UuuwFW`f)aiF_%W_>RXbAcdt@3l8 zs`l&IcU~v8Ki$?*dC9P8>9g0o<+>!$FlTv`HrtY(thE($T2DmoEnGe6&f+Ims~#^~H0?*px1*n? z{b_oZy1usK*!u6%d**O%+F zt+&fnzW-mH-=BB0^7-wbS*b!tOxJv##j;=Rbu#lRiTOVR%VW-OoE6}#Svq-I>y&zC x{W()#R+yQ7G0>eFnq+YG`O-6yHijWyTIQ7pUf6v2@Ob)pdHFZ*KO`_Q004oH;B^21 literal 0 HcmV?d00001 diff --git a/assets/image/2x/vip_code.webp b/assets/image/2x/vip_code.webp new file mode 100644 index 0000000000000000000000000000000000000000..86e339cf433ada6155ee7baa8731b674839a1889 GIT binary patch literal 1212 zcmWIYbaUIn!oU#j>J$(bU=hK^z`$St#JXVQ>FgYEf)U7NU_1dLS%6Zxc_l?b?oJ93 zkx>dDF&IcpE-rwvvCu$MzFlJgn{^pzILUxBCAByisOtj|s}un(2f9fF$QDV5ur)yJ zBnaCE#4ax>C;_So0I`cgf}DZu6d+q89f_TU#7-_K0;%r-seK zg93vmLmopigC3A&1dLQe1~Xs``y69pV9?if;1&>ntTjm`a%GkJ{u>8W<31J`ryllI z@$8$jclrCf?jQe5+*`d!a!c+iddU;eXhZ`}NMMe^S-XV&_6m)6a_aia6Vsn0J)ich` zI(6#De6dVPZ(m;BO{OwZkDf+O4D8yh&>|HTY|GD~s_FcqqiETmX%`ZF_XYZTGIC}w z_Dj*|ezdhxl&j8FOQ>ZVQ@)e3mdd1MaTA3cmh!T8s%W_=OlFy&>p4luT`>&^rp}l- zbLEoVzy8m^PFY_nf-Zru2Wv*D_BdJ>F_iI-{z^mJ3iVhFIMc;U_?fbPe zFwiEW9Oz^&rK-%=DRimczQ20+^Nn-fzq4I7A;NURe!=5ac2{iLZxkopEiAF@{422g z+)~v(G4+kok96c`bR_ef*w1lq)5W_+9|evdcJco1X5{?;^pU-;C(l@=EpEA2mJ~B@ zl`OBnp<8sTvl0|+-al>ks`SHd&T)aTSSEr#@ZJ8)sa%Uk)2!~VICs}5@{#wJ^W7&3 z9+thTnKXOvsmiOrZ~xkKz>}x0QfRj1l0`Q?->3vlbbJ)G*LHTS-SZ&JlMU0KHa0d+ zy$b?YyJTi~nM-=?(O~yl|Hxxnbol8Cuj&dn*0Z`mU@Xrlv{f==*_Ru0tR~N6X}s3G zu;|y}H+73SGO|`GURWV$vTxSS*p0yvzZ2(oH*V`oIG8D8-Mq;^efi1Uz59R1&SqpQ zE91Wxta0AdSvIaA_{Ev2mHrQ(-~IYEv9hxAdFHvFU$*@Eyg+yNHS14ovv}|QXuflF ozJ%M{gR6{J{PnRk{BqZ2j@!0Bmrq=qJujrfIHu}LZ{9Bk03xHH0{{R3 literal 0 HcmV?d00001 diff --git a/assets/image/2x/wallet.webp b/assets/image/2x/wallet.webp new file mode 100644 index 0000000000000000000000000000000000000000..9b4d7b702cf97869c89613395d09cad16e0f8bbe GIT binary patch literal 1066 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 XxoL~^8arOGsO%h<8<)%RK!AS$9*c|V literal 0 HcmV?d00001 diff --git a/assets/image/3x/set.webp b/assets/image/3x/set.webp new file mode 100644 index 0000000000000000000000000000000000000000..394ccc268e4f7143104ec2b733bdc1b5538d4a20 GIT binary patch literal 2904 zcmah}cUV)|5C-_(b2+KV9r>w z0sznuX#;Q`00V7pOeYNb1hCG1eh@NwdHegC=xGUCT3HM4>;4&7M?c&@_$LyI@|6s} z#~PCTiT(enSe%^w93iI_h{S!N#i5+IAk5|ZHi2mJz?pRb z;E6wU*D?U8jRJsY{D)3F4}e3r0U-AM(EaEM4(p4B;zLb_=zxn00IS6SAglm5+z$Zj z)$cZl{g2#)Arn88mk;!~0#D!!gn+0)V_W_yvgw5P3|8 zb&nCB-N^os+CGO?bj^~pIj9(=a-=R2-BC%3Rq5fv@v$g3JETk#bm{S7$g*m5Yl&lMs(pI}O$9 z!po&-`Zbg)8!=9FOv;geamU?rg6M^J@q+mN8(5>}wcAT=_L|UVRsFV{HiUl#kpC3@ zGa20z-QAPu>N+YgM|kh;BW)zg6`_cv(nI+jt12+>~lW{%Z1ru)PwRI$t6S7Z>^g(Cx^ z^XS)=9x~#ziuh%!zHE9I+7wC9VRyEFb&lIdP+%}nusFUABRtG$pa~)$Ciz@xRh@}Z zN>%xSZWc9yJu^|{&EQ;j)QVLbYaRo2SKIuViJ#FM@9hKAwjRHJkW z;wL*}TY>zBu^6QQ9WIvI18)!o?+p_IU&G93MU)dDNK6>FS9h241C z<92UyK3zovx(jzt2)p~z@kPg1=S%UNm_pBc#|Qnu$%5`VPb2k7`Yhums(0)+UL2V> zUNHD#gV;R){!)t&hj+-CV`QM|5{B+~?MFliLXq`%+CVwOg@lwNFT27#&Tveo&YhN| zlw7i?7jQ@xUzF1`L{(V-MF^C7Q}2OVPH7r6VQXf|CzNwo8+W-h)YXQ$U9>+OSC*<0 z{xyivMIr6l6?jYq2inrwYI)dmN?o5 zz?Ewe)B7Na&*_4v5@t1#kAPOc?^fO-}tz%!ZY>j9%}a+xvx9j zF7AvzDdkz_ihlnAA8XiB2s^wo!Leq?|M_H*lzc(}Z_t`Hs$Zx=iQ+fglOB%{`otUZ zq9G68ATMx2+p1!)h_qQ0KbGW^6g2g_z$P)*e1UIW-?Ta9!t(UQuGSSMPy2i^`PCq9 zMvX)zSW!%cn8ms|XW)S%nlQ^&xOsYG2Cr;J`@vKiN4_x%W^2*2+;**QcP+v5*6}ct z1DN0py5LdaFfmEsJ|xuJ7GAkg(=_0Qy9)KK8h0>=Nkw^ngdg+>xuzjqn8v zkxC)+9?}+*kU+hBT7E7As@cqc=}WA6bz4`VeNt51krFr;(y)6s-0GD`3EX>XyU>^U z-J^lc)o|1MStF+8x5En3P3*r^9<${8G8R)8Kus^n(L6rVO+=&~^_{yP`X@M;XF9iT zY^z`w7m^=MF0+4S%TGu6U)^Bescqh)1e zo^PBwDOuo2OY6CvKsnw$RGP{YL5GeklokgKyu=Dpi&HNneK4yuX%;7n8!B3oX;wBE zW+9t)7%;iL#IGBR^ut@Pd#pu}StOAxX}UpGHt6NtHpwOqKTZeiNAZ3f;(#BCtku;4 zGoWU98ZCc%7`sqZtgCn15Db3g&P1^5NzjkW+woAz{4!K7%dQI=WUuqOA<-3qTa$6R z%DY)*{O5m7Fdy_|77BNX*RFC0KBTEV`+|wG+nJ74OZX{5I@gU2x?{`M4yjsn2KAto zkuWmH_*Y>_|EIyXL)MJp(YUv6@i@cqSZiL^%B{Zs;5v@q0&d#WZqIf~l{%La>ZTvF zs(yYVReot^Af83}M6^A(`=>;ygfixO6DMqrsI9~&HCVo;I6r{}$N*g?hdlTOmWEkq z;G!e3S2gclLsL8=HE|Wvdx$B^%+QfMt6U*G0y=SVOV|5>t^K=)fzP8ar>F2b!=(u$ zWt8||;oFQgA!{>B&qnrtH*yF4!(K`kiTc1jPD!~#`6&)?K?$g!YPBT9JGiq*emy-% zHL{C@osuQoXVi>m|GpGlru%oUIK^ra&WCplE@Lwg8`XtNQ?ZV=?G6kK+}t2=Iy>{j z_Haf_*&j8Dv_+riE_L6k>9h5P_5v1bf6X3pkqVeTtU|4uLGuu`w3l@1ZB z(C0SiCGFEwD#OZkLIC_>R{zYhVKrN3!m-K0#mI%yqf7>eYeEdSX7U!x&Gp-5dga_y zeQIveU$Usmy_n=Qm{NRKakZsp`Rd-*&M38sCVZ%E38>Y?-DoN6&DS0mZ0Pg){6&0& zp;PP~cvau@bx&W&7Pl~7=Y4L%=&6}yYMa}Lzo9bXX2e_NYD*7lp-}l7qwMMMs$&|Q kt4J(y@fQnln8Y{$=8=+%<-Q^CcU5rwh->?D4e|i^5AHI{5dZ)H literal 0 HcmV?d00001 diff --git a/assets/image/3x/vip_code.webp b/assets/image/3x/vip_code.webp new file mode 100644 index 0000000000000000000000000000000000000000..f7e16151b831dbad5ca18269c89989cbe261ce7c GIT binary patch literal 1800 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 literal 0 HcmV?d00001 diff --git a/assets/image/mine_order.webp b/assets/image/mine_order.webp new file mode 100644 index 0000000000000000000000000000000000000000..c53b1869f02ec3c4b00d533420bbae92cdb506ad GIT binary patch literal 642 zcmWIYbaSg>Vqge&bqWXzu!!JdU|=u+Vo@;ibaoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4Jn7z`vP7Zxx$&AP0MMV^olXG&^uGEmV6AXX^?S`KuR2#_t34q(yZgo+i%p OeeQq$|Di{mybJ)gAB8ml literal 0 HcmV?d00001 diff --git a/assets/image/mine_vip_logo.webp b/assets/image/mine_vip_logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..239b516f37d3e624dd0575ab9ece323a17685553 GIT binary patch literal 718 zcmWIYbaOk##J~{l>J$(bU=hK^z`$St#5@cPK&Gd&bHE8kAeVvh1c+n-O6BI26a~3E zDMUm@DS*UaAThbP0LI2b15NpMjR9=dWnC=tgoHR#Qj3#;iar3bN)ga{*b zTLZ*Sg0O8s?DCR=5}=v@5W6TO$Qj5^0kSpHk=RK{?Bs$Xkoq2=8k^jlQjlFB0CF); zYF=nCkmdkl8HQqpAO?2^Cxrj=7cnqcd}Ux@o`4Wbn#sVhy_JDM;ubNe+vV{ zw(|%vM3@vL79|4B2L>__Go__5Fnn6hz`z^Hz#x197#Y!EIUs?#e37J*FWwV zM`h0_Hd3-$8nWv<*V?a^&rOogxViYd%qy0YOlD>fV0ba7Imm0rcctetf`SYTf`Sh= z>=OT5BR26edUP1>iory=U8*_&#=bn n{}!BHk-YDU(M!4W^Qv^OSl#fME$VbK-Dr2!!+y8vz!VAqF$J#h literal 0 HcmV?d00001 diff --git a/assets/image/set.webp b/assets/image/set.webp new file mode 100644 index 0000000000000000000000000000000000000000..1c16f9b6f236d3c0927da45325c2befa63ed91a3 GIT binary patch literal 908 zcmWIYbaQKAW?%?+bqWXzu!!JdU|=u+VlgoCbaoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4Jn7z`vP7Zxx$&AP0MMV^olXG&^uGEmV6AXX^?S`KuR2#_t34q z-KPsnA8+|w`)${{x%Vc&{2_b$X~nME{Qmd3fBWlx?|m6rKlkz<|HbwDD-C~ruYaCx z_IGOE#Q)pt@A=vv>&Q~}x-+F~*>#Sq2kImCB^~>pbKzTp*xv9-)1Jkv1m!b6iII%M#6~g2u$BS^R}O6k!%4Z9uT^c!z5V|8{(PI_r}F3QI20HC=V4aJ zb^eycxR;56;Xv{B-8o`$z;F>&os@F(hEjB6t&cso$h9RaW(Nh#TWXf?pFSx>?fLWX zxnc|XC#iV8y%=8M5Oww8cGWs*uEyIYf<3+Kxw^L{YjS>RdACfZ@V!&0fWjYw?TSQgcp~g)dl|XCA7*%rm}bk=^S*H-25+enjI-rX=^0|Ka>? qCv4Z5Nxq!4|HJY#*OoTeF)qpqli0jeBfxO^wCXyGx9M5O7#RRB&Jbq+ literal 0 HcmV?d00001 diff --git a/assets/image/vip_code.webp b/assets/image/vip_code.webp new file mode 100644 index 0000000000000000000000000000000000000000..05bc301bc6c5dca7f1f705f1cb325b21cb3b50c2 GIT binary patch literal 720 zcmWIYbaOkw#J~{l>J$(bU=hK^z`$St#A0CN>FgYEf)U7NU_1dLS%6Zxc_l?b?oJ93 zkx>dDF&IcpE-rwvvCu$MzFlJgn{`fOr5g=P69m3WC zv6CQd8xXs^q@V<-CIG}P3JG!svQvO;jdUb-5)wPPpa`VC2dKs-H>VV27YKk{%#)fI z8Vsa4fLMm1m?4P4oxus=|NKP^3>IG*7?>v@#FAz*Fl=vSV34?l5K~#ez`)m$qafxmJu*g4H?XUG3;{_s8C<5fmL9C!-Cw~7E-;Hu(qd^-cZ4 z&s@LsylZ*a<6a(<^L1nF&($|tg@KL&fdJ$(bU=hK^z`$St#A0CN>FgYEf)U7NU_1dLS%6Zxc_l?b?oJ93 zkx>dDF&IcpE-rwvvCu$MzFlJgn{`fOr5g=P69m3WC zv6CQd8xXs^q@V<-CIG}P3JG!svQvO;jdUb-5)wPPpa`VC2dKs-H>VV27YKk{%#)fI z8Vsa4fLMm1m?4P4oxus=|NKP^3>IG*7?>v@#FAz*Fl=vSV34?l5K~#ez`)m$qafxmJu*g4H?XUG3*00j6q+lfmPu80*y&a(!Ry9uMv*YC;g>$NhJJ$q&CjX8fYTyT7=cm4aJ2-CA4zt_9O^LTDt zc*i)9;f_FwxJ+8&@%4*oq?pY0*cT-B>H4`1eSYRiVsWhJPrSRo-1@-c=f56RTdY1I mdtYw_U;EkWN56j+@4kKicI=Y;i~H}aQ?7e{(BAvkV+H^{Be5C) literal 0 HcmV?d00001 diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index 37018099..78734e3f 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -213,6 +213,8 @@ class CommunityChildPageState extends State setState(() {}); }); setState(() {}); + + // Navigator.of(context).pushNamed( '/router/eom'); }, ); }, diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index d68c1d52..30731e72 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; @@ -15,6 +17,8 @@ import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:huixiang/web/web_view/input_comment.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../web/web_view/input_comment_o.dart'; + class CommunityDetails extends StatefulWidget { final Map arguments; @@ -46,14 +50,23 @@ class _CommunityDetails extends State Article article; String businessId; - @override + final GlobalKey inputKey = GlobalKey(); + final TextEditingController commentTextController = TextEditingController(); + bool emojiShowing = false; + static double keyboard_height=300; + double keyboard = -1; + bool needShowSmiley = false; + bool needHideSmiley = false; + void didChangeMetrics() { WidgetsBinding.instance.addPostFrameCallback((_) { + // isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0; if (!mounted) return; if (MediaQuery.of(context).viewInsets.bottom == 0) { if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); if (mounted) + if(!emojiShowing) setState(() { hintText = S.current.liuxianinjingcaidepinglunba; isKeyBoardShow = false; @@ -66,6 +79,18 @@ class _CommunityDetails extends State }); } }); + if (needShowSmiley && window.viewInsets.bottom <= 0.1) { + needShowSmiley = false; + setState(() { + emojiShowing = true; + }); + } + if(needHideSmiley && window.viewInsets.bottom > 0.1) { + needHideSmiley = false; + setState(() { + emojiShowing = false; + }); + } } @override @@ -74,11 +99,45 @@ class _CommunityDetails extends State // comunity = widget.arguments["comment"]; businessId = widget.arguments["businessId"]; WidgetsBinding.instance.addObserver(this); + commentFocus.addListener(_focusNodeListener); _queryMemberCommentList(); queryDetails(businessId); } + void _focusNodeListener() { + /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ + setState(() { + smileyPadGone = true; + }); + }*/ + } + + _onTextFieldTap() { + if(emojiShowing) { + needHideSmiley = true; + } + } + + _onSmileyTap() { + if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) { + needShowSmiley = true; + commentFocus.unfocus(); + } else { + setState(() { + emojiShowing = !emojiShowing; + isKeyBoardShow = emojiShowing; + }); + } + } + + @override + void dispose(){ + WidgetsBinding.instance.removeObserver(this); + commentFocus.removeListener(_focusNodeListener); + super.dispose(); + } + ///详情接口 queryDetails(id) async { SharedPreferences value = await SharedPreferences.getInstance(); @@ -101,21 +160,31 @@ class _CommunityDetails extends State @override Widget build(BuildContext context) { - return Scaffold( - appBar: MyAppBar( - title: S.of(context).dongtaixiangqing, - titleColor: Colors.black, - titleSize: 18.sp, - background: Colors.white, - leading: true, - leadingColor: Colors.black, - ), - body: GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { + double h = MediaQuery.of(context).viewInsets.bottom; + if(h > 0 && keyboard <= 0) { + setState(() { + keyboard = h; + }); + } + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + setState(() { + emojiShowing = false; + isKeyBoardShow = emojiShowing; FocusScope.of(context).requestFocus(FocusNode()); - }, - child: Container( + }); + }, + child: Scaffold( + appBar: MyAppBar( + title: S.of(context).dongtaixiangqing, + titleColor: Colors.black, + titleSize: 18.sp, + background: Colors.white, + leading: true, + leadingColor: Colors.black, + ), + body: Container( child: Column( children: [ Expanded( @@ -184,17 +253,22 @@ class _CommunityDetails extends State inputKey, hintText, isKeyBoardShow, + keyboard_height, + keyboard, + emojiShowing, commentFocus, commentTextController, _toComment, + _onSmileyTap, + _onTextFieldTap, _queryMemberComment, _queryInformationLikes, isLike: article?.liked ?? false, ), ], ), - )), - ); + ), + )); } ///给文章/活动点赞 @@ -246,9 +320,6 @@ class _CommunityDetails extends State ); } - final GlobalKey inputKey = GlobalKey(); - final TextEditingController commentTextController = TextEditingController(); - contentHeight() { double contentHeight = MediaQuery.of(context).size.height - kToolbarHeight - @@ -290,7 +361,7 @@ class _CommunityDetails extends State Dio(), context: context, token: sharedPreferences.getString("token"), - showLoading: false, + showLoading: true, ); BaseData> baseData = await apiService.memberCommentList({ diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index d7058800..cc60e937 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:ui'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; @@ -53,11 +54,17 @@ class _ClassDetails extends State with WidgetsBindingObserver { int chapterIndex = 0; double height = 0; var isShowMore = false; + bool emojiShowing = false; + static double keyboard_height=300; + double keyboard = -1; + bool needShowSmiley = false; + bool needHideSmiley = false; @override void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); + commentFocus.addListener(_focusNodeListener); courseDetails(widget.arguments["id"]); queryChapterList(widget.arguments["id"]); } @@ -70,6 +77,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { Dio(), context: context, token: value.getString("token"), + showLoading: true ); } BaseData> baseData = @@ -114,6 +122,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); if (mounted) + if(!emojiShowing) setState(() { hintText = S.current.liuxianinjingcaidepinglunba; isKeyBoardShow = false; @@ -126,10 +135,61 @@ class _ClassDetails extends State with WidgetsBindingObserver { }); } }); + if (needShowSmiley && window.viewInsets.bottom <= 0.1) { + needShowSmiley = false; + setState(() { + emojiShowing = true; + }); + } + if(needHideSmiley && window.viewInsets.bottom > 0.1) { + needHideSmiley = false; + setState(() { + emojiShowing = false; + }); + } + } + + void _focusNodeListener() { + /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ + setState(() { + smileyPadGone = true; + }); + }*/ + } + + _onTextFieldTap() { + if(emojiShowing) { + needHideSmiley = true; + } + } + + _onSmileyTap() { + if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) { + needShowSmiley = true; + commentFocus.unfocus(); + } else { + setState(() { + emojiShowing = !emojiShowing; + isKeyBoardShow = emojiShowing; + }); + } + } + + @override + void dispose(){ + WidgetsBinding.instance.removeObserver(this); + commentFocus.removeListener(_focusNodeListener); + super.dispose(); } @override Widget build(BuildContext context) { + double h = MediaQuery.of(context).viewInsets.bottom; + if(h > 0 && keyboard <= 0) { + setState(() { + keyboard = h; + }); + } return AnnotatedRegion( value: SystemUiOverlayStyle.light, child: Material( @@ -137,7 +197,11 @@ class _ClassDetails extends State with WidgetsBindingObserver { body: GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { - FocusScope.of(context).requestFocus(FocusNode()); + setState(() { + emojiShowing = false; + isKeyBoardShow = emojiShowing; + FocusScope.of(context).requestFocus(FocusNode()); + }); }, child: Container( // margin: EdgeInsets.only(top:25), @@ -411,9 +475,14 @@ class _ClassDetails extends State with WidgetsBindingObserver { inputKey, hintText, isKeyBoardShow, + keyboard_height, + keyboard, + emojiShowing, commentFocus, commentTextController, _toComment, + _onSmileyTap, + _onTextFieldTap, _queryMemberComment, _queryCourseLikes, isLike: course?.selfLiked, diff --git a/lib/community/community_view/class_details_video.dart b/lib/community/community_view/class_details_video.dart index abbf7d71..995b5ff6 100644 --- a/lib/community/community_view/class_details_video.dart +++ b/lib/community/community_view/class_details_video.dart @@ -138,16 +138,16 @@ class ClassDetailsVideoState extends State { ? Container( color: Colors.black, width: width, - // height: width / 7 * 5, - height: height, + height:MediaQuery.of(context).size.width / 1.5, + margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), child: chewies = Chewie( controller: chewieAudioController, ), ) : Container( width: width, - // height:width / 7 * 5, - height: height, + height:MediaQuery.of(context).size.width / 1.5, + margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), )), if (widget.isShowImg) GestureDetector( @@ -160,8 +160,8 @@ class ClassDetailsVideoState extends State { }, child: Container( width: width, - // height: width / 7 * 5, - height: height, + height: MediaQuery.of(context).size.width / 1.5, + margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), color: Colors.black, child: Stack( children: [ diff --git a/lib/community/new_community_details.dart b/lib/community/new_community_details.dart index 62dafc65..f005b3e2 100644 --- a/lib/community/new_community_details.dart +++ b/lib/community/new_community_details.dart @@ -1,3 +1,4 @@ +import 'dart:ui'; import 'dart:convert'; import 'package:dio/dio.dart'; @@ -55,6 +56,11 @@ class _NewCommunityDetails extends State with WidgetsBindin Article article; String commentsId; String userId; + bool emojiShowing =false; + static double keyboard_height=300; + double keyboard = -1; + bool needShowSmiley = false; + bool needHideSmiley = false; @override void initState() { @@ -62,6 +68,7 @@ class _NewCommunityDetails extends State with WidgetsBindin commentsId = widget.arguments["commentsId"]; userId = widget.arguments["userId"]; WidgetsBinding.instance.addObserver(this); + commentFocus.addListener(_focusNodeListener); queryDetails(commentsId); } @@ -105,6 +112,7 @@ class _NewCommunityDetails extends State with WidgetsBindin if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); if (mounted) + if(!emojiShowing) setState(() { hintText = S.current.liuxianinjingcaidepinglunba; isKeyBoardShow = false; @@ -117,10 +125,61 @@ class _NewCommunityDetails extends State with WidgetsBindin }); } }); + if (needShowSmiley && window.viewInsets.bottom <= 0.1) { + needShowSmiley = false; + setState(() { + emojiShowing = true; + }); + } + if(needHideSmiley && window.viewInsets.bottom > 0.1) { + needHideSmiley = false; + setState(() { + emojiShowing = false; + }); + } + } + + void _focusNodeListener() { + /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ + setState(() { + smileyPadGone = true; + }); + }*/ + } + + _onTextFieldTap() { + if(emojiShowing) { + needHideSmiley = true; + } + } + + _onSmileyTap() { + if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) { + needShowSmiley = true; + commentFocus.unfocus(); + } else { + setState(() { + emojiShowing = !emojiShowing; + isKeyBoardShow = emojiShowing; + }); + } + } + + @override + void dispose(){ + WidgetsBinding.instance.removeObserver(this); + commentFocus.removeListener(_focusNodeListener); + super.dispose(); } @override Widget build(BuildContext context) { + double h = MediaQuery.of(context).viewInsets.bottom; + if(h > 0 && keyboard <= 0) { + setState(() { + keyboard = h; + }); + } return WillPopScope( onWillPop: () async { Navigator.of(context).pop(true); @@ -312,9 +371,14 @@ class _NewCommunityDetails extends State with WidgetsBindin inputKey, hintText, isKeyBoardShow, + keyboard_height, + keyboard, + emojiShowing, commentFocus, commentTextController, _toComment, + _onSmileyTap, + _onTextFieldTap, _queryMemberComment, _queryInformationLikes, isLike: article?.liked ?? false, diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index ae017223..b1ee3566 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -166,7 +166,7 @@ class _WelfareExchange extends State @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Colors.transparent, + backgroundColor: Colors.white, body: NestedScrollView( headerSliverBuilder: (context, inner) { return [ @@ -265,7 +265,7 @@ class _WelfareExchange extends State body: SmartRefresher( controller: refreshController, enablePullDown: true, - enablePullUp: false, + enablePullUp: true, physics: ClampingScrollPhysics(), header: MyHeader(), footer: CustomFooter( diff --git a/lib/main.dart b/lib/main.dart index 7d937077..49f8b9ed 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -111,6 +111,7 @@ import 'mine/mine_vip/legal_right_details.dart'; import 'mine/mine_vip/mine_attainment_page.dart'; import 'mine/mine_vip/mine_vip_core.dart'; import 'mine/scan_web.dart'; +import 'mine/vip_pay_code.dart'; import 'order/bargain_group_order.dart'; import 'mine/personal_page.dart'; import 'order/exchange_write_off_page.dart'; @@ -349,7 +350,7 @@ Map routers = { '/router/qr_share': (context, {arguments}) => QrSharePage(), '/router/main_page': (context, {arguments}) => MainPage(arguments: arguments), '/router/test_page': (context, {arguments}) => TestPage(), - '/router/communityFollow': (context, {arguments}) => CommunityFollow(), + '/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments), '/router/releasePage': (context, {arguments}) => ReleasePage(), '/router/activity_list': (context, {arguments}) => ActivityList(), '/router/class_details': (context, {arguments}) => @@ -420,4 +421,6 @@ Map routers = { HelpFarmersPage(), '/router/scan_web': (context, {arguments}) => ScanWeb(arguments:arguments), + '/router/vip_pay_code': (context, {arguments}) => + VipPayCode(), }; diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 46d07411..d4325106 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -124,12 +124,7 @@ class _SystemMessagePage extends State { @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () async { - Navigator.of(context).pop(true); - return false; - }, - child:Scaffold( + return Scaffold( appBar: MyAppBar( background: Colors.white, leadingColor: Colors.black, @@ -139,7 +134,7 @@ class _SystemMessagePage extends State { actions: [ Container( margin: EdgeInsets.only(right: 16.w), - alignment: Alignment.centerRight, + alignment: Alignment.centerRight, child: GestureDetector( onTap: () { setState(() { @@ -147,7 +142,7 @@ class _SystemMessagePage extends State { }); }, child: Text( - S.of(context).biaojiweiyidu, + S.of(context).biaoweiyidu, style: TextStyle( fontSize: 16.sp, fontWeight:MyFontWeight.semi_bold, @@ -192,7 +187,7 @@ class _SystemMessagePage extends State { ), ), - )); + ); } Widget newsSurvey(){ diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 1eb9a3dc..04157479 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -8,6 +8,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_view/mine_calendar.dart'; +import 'package:huixiang/mine/mine_view/mine_navbar.dart'; import 'package:huixiang/mine/mine_view/mine_order.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/examine_instance.dart'; @@ -26,6 +27,8 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:dio/dio.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../retrofit/data/coupon.dart'; +import '../retrofit/data/page.dart'; import '../utils/flutter_utils.dart'; import 'mine_view/mine_item.dart'; import 'mine_view/mine_view.dart'; @@ -46,6 +49,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { SocialInfo infoNumber; final RefreshController _refreshController = RefreshController(); int totalMsg = 0; + String couponNum; _toUserInfo() async { SharedPreferences shared = await SharedPreferences.getInstance(); @@ -74,6 +78,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { super.initState(); querySocialInfo(); queryMsgStats(); + // queryCard(); eventBus.on().listen((event) { print("EventType: ${event.type}"); @@ -113,6 +118,22 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ranks.addAll(rankData.data); } + BaseData> baseData = await apiService.queryCard({ + "centre": true, + "pageNum": 1, + "pageSize": 10, + "searchKey": "", + "state": 1 + }).catchError((error) { + _refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + couponNum = baseData.data.total; + _refreshController.refreshCompleted(); + } else { + _refreshController.refreshFailed(); + } + BaseData baseDate = await apiService.queryInfo().catchError((onError) { _refreshController.refreshFailed(); @@ -203,14 +224,13 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { child: SingleChildScrollView( child: Container( child: Stack( - // alignment: Alignment.centerRight, children: [ Container( - height: 502.h, + height: 306.h, decoration: BoxDecoration( // color: Color(0xFF32A060) image: DecorationImage( - fit: BoxFit.cover, + fit: BoxFit.fill, image: AssetImage("assets/image/settlement_bg.webp"), ), ), @@ -229,21 +249,34 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { setState(() { totalMsg = 0; }); - }, totalMsg, infoNumber), + }, totalMsg, + infoNumber, + ranks + ), - ///我的 VIP等级信息 - MineVipEntry( - tag: "vip", - ranks: ranks, - userInfo: userInfo, - rank: double.tryParse(userInfo?.expendAmount ?? "0") - .toInt(), - rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0, - createTime: userInfo?.createTime ?? "", + ///订单/钱包/会员码/设置 + MineNavbar( + couponNum, + userInfo, + infoNumber, + () { + toIntegralPage(); + }, ), + ///我的 VIP等级信息 + // MineVipEntry( + // tag: "vip", + // ranks: ranks, + // userInfo: userInfo, + // rank: double.tryParse(userInfo?.expendAmount ?? "0") + // .toInt(), + // rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0, + // createTime: userInfo?.createTime ?? "", + // ), + ///我的订单 - MineOrderView(), + // MineOrderView(), ///推广图 spreadImage(), @@ -287,7 +320,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ); }, child: Container( - margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 15.h), + margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 30.h), padding: EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h), width: double.infinity, @@ -389,7 +422,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ///推广图 Widget spreadImage() { return Container( - margin: EdgeInsets.only(right: 14.w, bottom: 15.h, left: 14.w), + margin: EdgeInsets.only(right: 14.w, bottom: 30.h, left: 14.w), child: GestureDetector( onTap: () { Navigator.of(context).pushNamed('/router/invite_friends'); diff --git a/lib/mine/mine_view/community_follow.dart b/lib/mine/mine_view/community_follow.dart index c5a15b18..b0f7acd6 100644 --- a/lib/mine/mine_view/community_follow.dart +++ b/lib/mine/mine_view/community_follow.dart @@ -14,6 +14,11 @@ import 'package:shared_preferences/shared_preferences.dart'; import '../fans_page.dart'; class CommunityFollow extends StatefulWidget { + + final Map arguments; + + CommunityFollow({this.arguments}); + @override State createState() { return _CommunityFollow(); @@ -24,11 +29,13 @@ class _CommunityFollow extends State with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { ApiService apiService; SocialInfo infoNumber; + int status; @override void initState() { super.initState(); querySocialInfo(); + status = widget.arguments["status"]; } ///个人社交信息(粉丝/关注数量/成就数量) @@ -51,6 +58,7 @@ class _CommunityFollow extends State Widget build(BuildContext context) { return DefaultTabController( length: 2, + initialIndex: status, child: Scaffold( appBar: MyAppBar( title: "", diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 2e897f8c..6a37dc05 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -20,7 +20,7 @@ class _MineItem extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.fromLTRB(16.w,0.h, 16.w, 15.h), + margin: EdgeInsets.fromLTRB(16.w,0.h, 16.w,30.h), // padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/mine/mine_view/mine_navbar.dart b/lib/mine/mine_view/mine_navbar.dart new file mode 100644 index 00000000..4ebd8359 --- /dev/null +++ b/lib/mine/mine_view/mine_navbar.dart @@ -0,0 +1,301 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/login_tips_dialog.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../retrofit/data/social_info.dart'; +import '../../retrofit/data/user_info.dart'; + +class MineNavbar extends StatefulWidget { + final String couponNum; + final UserInfo userInfo; + final SocialInfo infoNumber; + final GestureTapCallback toIntegralPage; + + MineNavbar(this.couponNum,this.userInfo,this.infoNumber,this.toIntegralPage); + + @override + State createState() { + return _MineNavbar(); + } +} + +class _MineNavbar extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.fromLTRB(13.5.w, 15.h, 13.5.w,30.h), + padding: EdgeInsets.only( + top: 26.h, + bottom: 24.h, + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + ///订单 + Expanded( + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed( + '/router/order_history_page', + arguments: {"status": 0}); + }); + }, + child: mineTopItem( + S.of(context).dingdan, + "assets/image/mine_order.webp", + ), + ), + ), + + ///钱包 + Expanded( + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/mine_wallet'); + }); + }, + child: mineTopItem( + "钱包", + "assets/image/wallet.webp", + ), + ), + ), + + ///会员码 + Expanded( + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/vip_pay_code'); + }); + }, + child: mineTopItem( + "会员码", + "assets/image/vip_code.webp", + ), + ), + ), + + ///设置 + Expanded( + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/setting_page'); + }); + }, + child: mineTopItem( + S.of(context).shezhi, + "assets/image/set.webp", + ), + ), + ), + ], + ), + Container( + width: double.infinity, + margin: EdgeInsets.only(top:17.h,left: 16.w,right: 16.w,bottom: 27.h), + child: Flex( + children: List.generate(120, (_) { + return SizedBox( + width: 1, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Color(0xFFEDEDED)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + Row( + children: [ + ///优惠券 + Expanded( + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/coupon_page'); + }); + }, + child: mineBottomItem( + widget?.couponNum ?? "0", + S.of(context).youhuiquan, + ), + ), + ), + ///积分 + Expanded( + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + widget.toIntegralPage(); + }); + }, + child: mineBottomItem( + widget?.userInfo?.points?? "0", + "积分", + ), + ), + ), + ///关注 + Expanded( + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/communityFollow',arguments: { + "status":0 + }); + });}, + child: mineBottomItem( + "${widget?.infoNumber?.follow ?? "0"}", + S.of(context).guanzhu, + ), + ), + ), + ///粉丝 + Expanded( + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/communityFollow',arguments: { + "status":1 + }); + }); + }, + child: mineBottomItem( + "${widget?.infoNumber?.fans ?? "0"}", + S.of(context).fensi, + ), + ), + ), + ], + ) + ], + ), + ); + } + + ///导航栏条目 + Widget mineTopItem(text, icon) { + return Container( + color: Colors.white, + margin: EdgeInsets.symmetric(vertical: 6.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + icon, + width: 23, + height: 23, + ), + SizedBox( + height: 5.h, + ), + Text( + text, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 12.sp, + color: Color(0xFF0D0D0D), + ), + ), + ], + ), + ); + } + + ///导航栏条目 + Widget mineBottomItem(textTop, text) { + return Container( + color: Colors.white, + margin: EdgeInsets.symmetric(vertical: 6.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + textTop, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 18.sp, + color: Color(0xFF000000), + ), + ), + SizedBox( + height:11.h, + ), + Text( + text, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 12.sp, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), + ); + } +} diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index 81f6fb5b..e0292ffe 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -3,12 +3,9 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; -import 'package:flutter_svg/svg.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; -import 'package:huixiang/retrofit/data/msg_stats.dart'; import 'package:huixiang/retrofit/data/social_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -21,7 +18,9 @@ import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:webview_flutter/webview_flutter.dart'; + +import '../../retrofit/data/rank.dart'; +import '../../view_widget/mine_vip_entry.dart'; // import 'package:qrscan/qrscan.dart' as scanner; class MineView extends StatefulWidget { @@ -31,9 +30,10 @@ class MineView extends StatefulWidget { final Function messageZero; final int totalMsg; final SocialInfo infoNumber; + final List ranks; MineView(this.userInfo, this.toUserInfo, this.toIntegralPage, - this.messageZero, this.totalMsg, this.infoNumber); + this.messageZero, this.totalMsg, this.infoNumber,this.ranks); @override State createState() { @@ -43,6 +43,7 @@ class MineView extends StatefulWidget { class _MineView extends State { ApiService apiService; + String levelText = "普通用户"; ///核销用户优惠券 queryWiped(memberCouponId) async { @@ -136,21 +137,21 @@ class _MineView extends State { ), ), ), - InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/setting_page'); - }, - child: Container( - padding: EdgeInsets.all(8.h), - margin: EdgeInsets.only(right: 12.w), - child: Image.asset( - "assets/image/icon_mine_setting.webp", - width: 32, - height: 32, - color: Colors.white, - ), - ), - ), + // InkWell( + // onTap: () { + // Navigator.of(context).pushNamed('/router/setting_page'); + // }, + // child: Container( + // padding: EdgeInsets.all(8.h), + // margin: EdgeInsets.only(right: 12.w), + // child: Image.asset( + // "assets/image/icon_mine_setting.webp", + // width: 32, + // height: 32, + // color: Colors.white, + // ), + // ), + // ), ], ), ), @@ -215,6 +216,7 @@ class _MineView extends State { ); return; } + String title = uri.queryParameters["title"]; if (result.toString().contains("http:") || result.toString().contains("https:")) { ///扫码跳转任意网页 @@ -222,6 +224,7 @@ class _MineView extends State { '/router/scan_web', arguments: { "result": result, + "title":title, }, ); } @@ -259,21 +262,21 @@ class _MineView extends State { MImage( widget.userInfo == null ? "" : widget.userInfo.headimg, isCircle: true, - width: 58, - height: 58, + width: 60, + height: 60, fit: BoxFit.cover, errorSrc: "assets/image/default_user.webp", fadeSrc: "assets/image/default_user.webp", ), - Positioned( - bottom: 0, - right: 2.w, - child: Image.asset( - "assets/image/icon_mine_edit.webp", - width: 17, - height: 17, - ), - ), + // Positioned( + // bottom: 0, + // right: 2.w, + // child: Image.asset( + // "assets/image/icon_mine_edit.webp", + // width: 17, + // height: 17, + // ), + // ), ], ), ), @@ -336,34 +339,35 @@ class _MineView extends State { color: Color(0xFFFFFFFF), ), ) - : Row( - children: [ - Text( - "${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - fontFamily: 'JDZhengHT', - color: Color(0xFFFFFFFF), - ), - ), - Container( - width: 1.w, - height: 12.h, - margin: EdgeInsets.symmetric(horizontal: 3.w), - color: Color(0xFFFFFFFF), - ), - Text( - "${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", - style: TextStyle( - fontSize: 12.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), - ), - ), - ], - ), + : mineVip(), + // Row( + // children: [ + // Text( + // "${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // fontFamily: 'JDZhengHT', + // color: Color(0xFFFFFFFF), + // ), + // ), + // Container( + // width: 1.w, + // height: 12.h, + // margin: EdgeInsets.symmetric(horizontal: 3.w), + // color: Color(0xFFFFFFFF), + // ), + // Text( + // "${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", + // style: TextStyle( + // fontSize: 12.sp, + // fontFamily: 'JDZhengHT', + // fontWeight: MyFontWeight.regular, + // color: Color(0xFFFFFFFF), + // ), + // ), + // ], + // ), ], ), ), @@ -421,4 +425,19 @@ class _MineView extends State { ), ); } + + Widget mineVip(){ + return Container( + child: MineVipEntry( + tag: "vip", + ranks: widget.ranks, + userInfo: widget.userInfo, + rank: double.tryParse(widget.userInfo?.expendAmount ?? "0") + .toInt(), + rankMax: widget.userInfo?.memberRankVo?.nextOrigin ?? 0, + createTime: widget.userInfo?.createTime ?? "", + ), + ); + + } } diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index bde4cf32..4d07ff91 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -320,330 +320,333 @@ class _PersonalPage extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { - return SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: true, - header: MyHeader(), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - onRefresh: _onRefresh, - onLoading: () { - isLoadMore = true; - setState(() { - _onRefresh(); - }); - }, - physics: BouncingScrollPhysics(), - scrollController: scrollController, - child: SingleChildScrollView( + return Scaffold( + backgroundColor: Colors.white, + body:SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: true, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: _onRefresh, + onLoading: () { + isLoadMore = true; + setState(() { + _onRefresh(); + }); + }, physics: BouncingScrollPhysics(), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 248.h, - color: Color(0xFFFFFFFF), - // color: Colors.red, - child: Stack( - // alignment: Alignment.bottomLeft, - children: [ - Positioned( - top: 0, - left: 0, - bottom: 36.h, - right: 0, - child: Stack( - alignment: Alignment.bottomRight, - children: [ - Container( - color: Colors.black, - child: Opacity( - opacity: 0.9, - child: MImage( - memberInfor?.background ?? "", - width: double.infinity, - height: 260.h, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ))), - Container( - margin: EdgeInsets.only( - top: 50.h, left: 16.w, right: 16.w), - alignment: Alignment.topLeft, - decoration: BoxDecoration( - color: Colors.transparent, - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - GestureDetector( - child: Image.asset( - "assets/image/integral_return.webp", - width: 24, - height: 24, - ), - onTap: () { - Navigator.of(context).pop(); - }, + scrollController: scrollController, + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 248.h, + color: Color(0xFFFFFFFF), + // color: Colors.red, + child: Stack( + // alignment: Alignment.bottomLeft, + children: [ + Positioned( + top: 0, + left: 0, + bottom: 36.h, + right: 0, + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + color: Colors.black, + child: Opacity( + opacity: 0.9, + child: MImage( + memberInfor?.background ?? "", + width: double.infinity, + height: 260.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ))), + Container( + margin: EdgeInsets.only( + top: 50.h, left: 16.w, right: 16.w), + alignment: Alignment.topLeft, + decoration: BoxDecoration( + color: Colors.transparent, ), - ], - ), - ), - if (memberId == "0") - Positioned( - bottom: 9.h, - right: 16.w, - child: GestureDetector( - onTap: () { - showImagePicker(); - }, - child: Container( - padding: EdgeInsets.only(left: 2, right: 2), - width: 59.w, - height: 23.h, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(2), - color: Color(0x80000000), - ), - child: Text( - S.of(context).genghuanbeijing, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Image.asset( + "assets/image/integral_return.webp", + width: 24, + height: 24, + ), + onTap: () { + Navigator.of(context).pop(); + }, ), - ), + ], ), ), - ), - ], - ), - ), - homeInfo(), - ], - ), - ), - Container( - color: Color(0xFFFFFFFF), - margin: EdgeInsets.only(bottom: 30.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: - EdgeInsets.only(left: 86.w, top: 12.h, right: 16.w), - child: GestureDetector( - onTap: () { - setState(() { - isShrink = !isShrink; - }); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - flex: 1, - child: Text( - memberId == "0" - ? ((memberInfor?.signature == "") - ? "还未编辑个性签名~" - : memberInfor?.signature ?? "") - : "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}", - overflow: isShrink - ? TextOverflow.visible - : TextOverflow.ellipsis, - maxLines: isShrink ? 10 : 2, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF868686), - fontWeight: MyFontWeight.regular, - height: 1.5.h), - )), - Icon( - (isShrink != null && !isShrink) - ? Icons.chevron_right - : Icons.keyboard_arrow_up, - color: Colors.black, - size: 18, - ), - ], - ), - )), - Container( - margin: EdgeInsets.only(left: 16.w, right: 16.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: Container( - color: Colors.transparent, - padding: EdgeInsets.all(16), - child: Column( - children: [ - Text( - memberInfor != null - ? memberInfor.follow.toString() - : "0", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - S.of(context).guanzhu, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - )), - ), - ), - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: Container( - color: Colors.transparent, - padding: EdgeInsets.all(16), - child: Column( - children: [ - Text( - memberInfor != null - ? memberInfor.fans.toString() - : "0", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - S.of(context).fensi, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - )), - ), - ), - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: Container( - color: Colors.transparent, - padding: EdgeInsets.all(16), - child: Column( - children: [ - Text( - (memberInfor?.trendTotal ?? 0) - .toString(), - style: TextStyle( - color: Color(0xFF353535), - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, - ), + if (memberId == "0") + Positioned( + bottom: 9.h, + right: 16.w, + child: GestureDetector( + onTap: () { + showImagePicker(); + }, + child: Container( + padding: EdgeInsets.only(left: 2, right: 2), + width: 59.w, + height: 23.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0x80000000), ), - SizedBox( - height: 4.h, - ), - Text( - S.of(context).dongtai, + child: Text( + S.of(context).genghuanbeijing, + overflow: TextOverflow.ellipsis, style: TextStyle( - color: Color(0xFF353535), fontSize: 12.sp, fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), ), ), - ], - )), - ), + ), + ), + ), + ], ), - Expanded( + ), + homeInfo(), + ], + ), + ), + Container( + color: Color(0xFFFFFFFF), + margin: EdgeInsets.only(bottom: 30.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 86.w, top: 12.h, right: 16.w), child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: Container( - color: Colors.transparent, - padding: EdgeInsets.all(16), - child: Column( - children: [ - Text( - (memberInfor?.gainLikeTotal ?? 0) - .toString(), - style: TextStyle( - color: Color(0xFF353535), - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - S.of(context).huozan, + onTap: () { + setState(() { + isShrink = !isShrink; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + flex: 1, + child: Text( + memberId == "0" + ? ((memberInfor?.signature == "") + ? "还未编辑个性签名~" + : memberInfor?.signature ?? "") + : "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}", + overflow: isShrink + ? TextOverflow.visible + : TextOverflow.ellipsis, + maxLines: isShrink ? 10 : 2, style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - )), - ), + fontSize: 12.sp, + color: Color(0xFF868686), + fontWeight: MyFontWeight.regular, + height: 1.5.h), + )), + Icon( + (isShrink != null && !isShrink) + ? Icons.chevron_right + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 18, + ), + ], + ), + )), + Container( + margin: EdgeInsets.only(left: 16.w, right: 16.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + memberInfor != null + ? memberInfor.follow.toString() + : "0", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4.h, + ), + Text( + S.of(context).guanzhu, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + memberInfor != null + ? memberInfor.fans.toString() + : "0", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4.h, + ), + Text( + S.of(context).fensi, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + (memberInfor?.trendTotal ?? 0) + .toString(), + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4.h, + ), + Text( + S.of(context).dongtai, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + (memberInfor?.gainLikeTotal ?? 0) + .toString(), + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4.h, + ), + Text( + S.of(context).huozan, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + ], ), - ], - ), - ), - Container( - margin: EdgeInsets.all(16), - height: 1.h, - color: Color(0xFFF7F7F7), + ), + Container( + margin: EdgeInsets.all(16), + height: 1.h, + color: Color(0xFFF7F7F7), + ), + Padding( + padding: EdgeInsets.only(left: 16.w), + child: Text( + memberId != "0" ? "TA的动态" : "我的动态", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + )), + dynamicList(), + ], ), - Padding( - padding: EdgeInsets.only(left: 16.w), - child: Text( - memberId != "0" ? "TA的动态" : "我的动态", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), - )), - dynamicList(), - ], - ), - ), - ], - )), + ), + ], + )), + ) ); } @@ -670,7 +673,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { builder: (context) => PhotoViewGalleryScreen( images: [ (memberInfor?.headimg ?? "").isEmpty - ? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg" + ? "https://i.postimg.cc/Pq6vjfnw/default-1.webp" : memberInfor?.headimg ], //传入图片list index: 0, //传入当前点击的图片的index @@ -749,7 +752,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { isShowBtn: false, text: "目前暂无发布动态,要把开心的事讲出来哦~", fontSize: 16.sp, - margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom: 75.h), + margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom:80.h), ) : ListView.builder( physics: NeverScrollableScrollPhysics(), diff --git a/lib/mine/scan_web.dart b/lib/mine/scan_web.dart index c54e6a66..b738be34 100644 --- a/lib/mine/scan_web.dart +++ b/lib/mine/scan_web.dart @@ -1,12 +1,8 @@ -import 'dart:io'; - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:webview_flutter/webview_flutter.dart'; class ScanWeb extends StatefulWidget { @@ -21,29 +17,42 @@ class ScanWeb extends StatefulWidget { class _ScanWeb extends State { var controller = new ScrollController(); + WebViewController webViewController; String result; + String title; @override void initState() { super.initState(); result = widget.arguments["result"]; + title = widget.arguments["title"]; EasyLoading.show(status: S.current.zhengzaijiazai); } @override Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(top:MediaQuery.of(context).padding.top), - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height, - alignment: Alignment.center, - child: - WebView( - initialUrl:result, - javascriptMode: JavascriptMode.unrestricted, - onPageFinished: (initialUrl){ - EasyLoading.dismiss(); - }, - )); + return Scaffold( + appBar: MyAppBar( + title:title ?? "", + titleColor: Colors.black, + background: Colors.transparent, + leadingColor: Colors.black, + ), + body: + WebView( + initialUrl:result, + javascriptMode: JavascriptMode.unrestricted, + onWebViewCreated: (WebViewController controller){ + webViewController =controller; + }, + onProgress: (int progress) async { + if(widget.arguments["title"] != null) + return; + title = await webViewController?.getTitle(); + setState((){}); + EasyLoading.dismiss(); + }, + ), + ); } } diff --git a/lib/mine/vip_pay_code.dart b/lib/mine/vip_pay_code.dart new file mode 100644 index 00000000..63f18fe4 --- /dev/null +++ b/lib/mine/vip_pay_code.dart @@ -0,0 +1,253 @@ +import 'dart:convert'; + +import 'package:barcode_widget/barcode_widget.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bmflocation/flutter_bmflocation.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/product.dart'; +import 'package:huixiang/retrofit/data/vip_card.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/store/scan.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/location.dart'; +import 'package:huixiang/utils/painter_bg.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:qr_flutter/qr_flutter.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../retrofit/data/user_info.dart'; +import '../view_widget/classic_header.dart'; + +class VipPayCode extends StatefulWidget { + @override + State createState() { + return _VipPayCode(); + } +} + +class _VipPayCode extends State { + ApiService apiService; + + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + Location.getInstance().stopLocation(); + } + + @override + void initState() { + super.initState(); + queryUser(); + } + + UserInfo userInfo; + final RefreshController refreshController = RefreshController(); + bool vipCodeText = false; + + ///查询用户信息 + queryUser() async { + try{ + SharedPreferences value = await SharedPreferences.getInstance(); + if (apiService == null) + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + BaseData baseData = + await apiService.queryInfo().catchError((onError) { + refreshController.refreshFailed();}); + if (baseData != null && baseData.isSuccess) { + userInfo = baseData.data; + setState(() {}); + SharedPreferences.getInstance().then((value) => { + value.setString('user', jsonEncode(baseData.data)), + }); + refreshController.refreshCompleted(); + }else{ + refreshController.refreshFailed(); + } + }finally{ + setState((){}); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: "会员码", + background: Colors.white, + titleColor: Colors.black, + brightness: Brightness.dark, + leadingColor: Colors.black, + ), + body: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + onRefresh: () { + queryUser(); + }, + child: SingleChildScrollView( + child: Container( + color: Colors.white, + padding: EdgeInsets.only(top: 45.h), + child: Stack( + alignment: Alignment.topCenter, + children: [ + Container( + padding: EdgeInsets.only(top: 50.h), + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 14.w), + padding: EdgeInsets.only(top: 68.h, bottom: 16.h), + decoration: BoxDecoration( + color: Color(0xFF32A060), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.circular(6), + ), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.circular(6), + ), + margin: EdgeInsets.symmetric(horizontal: 16.w), + padding: EdgeInsets.only( + top: 46.h, left:16.w, right: 15.w, bottom: 79.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: (){ + setState(() { + vipCodeText = !vipCodeText; + }); + }, + child: + vipCodeText ? Text( + userInfo != null + ? "${(userInfo?.vipNo ?? "").substring(0, 4)} " + "${(userInfo?.vipNo ?? "").substring(4, 8)} " + "${(userInfo?.vipNo ?? "").substring(8, 12)} " + "${(userInfo?.vipNo ?? "").substring(12, 16)} " + "${(userInfo?.vipNo ?? "").substring(16, (userInfo?.vipNo ?? "").length)}" + : "", + style: TextStyle( + fontSize: 14.sp, + wordSpacing: userInfo == null + ? 10 + : (MediaQuery.of(context).size.width - 64.w) / + ((((userInfo?.vipNo ?? "") + .length) * + 4)), + letterSpacing: userInfo == null + ? 8 + : (MediaQuery.of(context).size.width - 64.w) / + ((((userInfo?.vipNo ?? "") + .length) * + 4)), + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF353535), + ), + ) + :Text( + "轻触可查看会员码数字", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 13.sp, + color: Color(0xFFCACACA), + ), + ), + ), + SizedBox( + height: 12.h, + ), + BarcodeWidget( + barcode: Barcode.code128(useCode128C: true), + data: + userInfo != null ? userInfo?.vipNo : "", + height: 72.h, + color: Colors.black, + drawText: false, + ), + SizedBox( + height: 16.h, + ), + QrImage( + data: userInfo != null + ? (userInfo?.vipNo ?? "") + : "", + version: QrVersions.auto, + size: 200.w, + gapless: true, + ), + ], + ), + ), + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(56), + color: Colors.white, + border: Border.all( + color: Colors.white, + width: 8.w, + ), + ), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(56), + color: Colors.white, + border: Border.all( + color: Color(0xFF32A060), + width: 2.w, + ), + ), + child: MImage( + userInfo?.headimg ?? "", + width: 80, + height: 80, + radius: BorderRadius.circular(56), + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index d65341fa..2d348dba 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -878,7 +878,7 @@ class _ExchangeOrderPage extends State { width: 10, ), Text( - S.of(context).pingtaiyue, + S.of(context).huixiangqianbao, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 260099c0..eb37b90a 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -225,7 +225,7 @@ class _OrderDetailPage extends State { payResult(BaseData baseData) async{ await queryDetails(); - Future.delayed(Duration(milliseconds: 400), () { + Future.delayed(Duration(milliseconds: 800), () { EasyLoading.dismiss(); SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); }); diff --git a/lib/qr/qr_code_scan.dart b/lib/qr/qr_code_scan.dart index c575652d..9376b6a1 100644 --- a/lib/qr/qr_code_scan.dart +++ b/lib/qr/qr_code_scan.dart @@ -57,31 +57,81 @@ class _QrCodeScanPage extends State { right: 0, ), Positioned( - child: MyAppBar( - title: "扫码", - titleColor: Colors.white, - leadingColor: Colors.white, - brightness: Brightness.dark, - background: Colors.transparent, - action: Container( - alignment: Alignment.center, - margin: EdgeInsets.only(right: 16.w), - child: GestureDetector( - onTap: () { - pickImage(); - }, - child: Text( - S.of(context).xiangce, + child: Container( + margin: EdgeInsets.only(left:12.w,right: 16.w,top: 16.h), + child:Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pop(); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal:10.w), + alignment: Alignment.centerLeft, + child: Image.asset( + "assets/image/return_left.webp", + fit: BoxFit.fill, + color: Colors.white, + ), + ), + ), + Spacer(), + Expanded(child:Text( + S.of(context).saoma, style: TextStyle( - color: Colors.black, + color: Colors.white, fontSize: 18.sp, fontWeight: FontWeight.bold, ), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + pickImage(); + }, + child:Container( + padding: EdgeInsets.symmetric(horizontal:10.w), + child: Text( + S.of(context).xiangce, + style: TextStyle( + color: Colors.black, + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + ), + ), ), - ), + ], ), ), - top: 0, + // MyAppBar( + // title: "扫码", + // titleColor: Colors.white, + // leadingColor: Colors.white, + // brightness: Brightness.dark, + // background: Colors.transparent, + // action: Container( + // alignment: Alignment.center, + // margin: EdgeInsets.only(right: 16.w), + // child: GestureDetector( + // onTap: () { + // pickImage(); + // }, + // child: Text( + // S.of(context).xiangce, + // style: TextStyle( + // color: Colors.black, + // fontSize: 18.sp, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // ), + // ), + top:MediaQuery.of(context).padding.top, left: 0, right: 0, ), diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 1308a39d..f7e60731 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "https://pos.api.lotus-wallet.com/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index c1b9a541..06429ed5 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -64,7 +64,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 diff --git a/lib/setting/logout_ing.dart b/lib/setting/logout_ing.dart index 243f784d..f097aea4 100644 --- a/lib/setting/logout_ing.dart +++ b/lib/setting/logout_ing.dart @@ -422,7 +422,7 @@ class _LogoutIng extends State { Padding( padding: EdgeInsets.only(bottom: 13), child: Text( - (balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的平台余额及店铺余额未使用完!", + (balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的回乡钱包余额及门店余额未使用完!", textAlign: TextAlign.center, style: TextStyle( fontSize: 16.sp, @@ -434,7 +434,7 @@ class _LogoutIng extends State { ), if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00") Text( - "${S.of(context).pingtaiyue}:¥ $money", + "${S.of(context).huixiangqianbao}:¥ $money", textAlign: TextAlign.center, style: TextStyle( fontSize: 16.sp, @@ -444,7 +444,7 @@ class _LogoutIng extends State { ), if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00") Text( - "${S.of(context).dianpuyue}:¥ $balance", + "${S.of(context).mendianyue}:¥ $balance", textAlign: TextAlign.center, style: TextStyle( fontSize: 16.sp, diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 463b5186..830c108f 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -82,7 +82,7 @@ class _Settlement extends State { int count1 = 0; String productId; bool orderButton = false; - bool useVipPriceSelect = false; + bool useVipPriceSelect = true; bool showVipTips = false; bool isRaiseChannel = false; diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index ece002da..73a5caa6 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -47,7 +47,7 @@ class ActivityCouponRemarks extends StatefulWidget { } class _ActivityCouponRemarks extends State { - bool vipSelect = false; + bool vipSelect = true; @override Widget build(BuildContext context) { @@ -76,7 +76,7 @@ class _ActivityCouponRemarks extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ - if(!(widget?.settleOrderInfo?.isRaise ?? false)) + if(!(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false)) Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 552dbd9e..fa7a2ee1 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -105,7 +105,7 @@ class _SettlementOrderCommodity extends State { ); } - if(widget.useVipPriceSelect ){ + if(widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && (!widget.settleOrderInfo.isRaise) && (widget?.settleOrderInfo?.discountAmount!= "0")){ widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? "")); } diff --git a/lib/view_widget/mine_vip_entry.dart b/lib/view_widget/mine_vip_entry.dart index 88f3edd3..2c6ae5a0 100644 --- a/lib/view_widget/mine_vip_entry.dart +++ b/lib/view_widget/mine_vip_entry.dart @@ -32,6 +32,9 @@ class MineVipEntry extends StatelessWidget { String topLeft = ""; String levelText = "普通用户"; + Color logoColor = Color(0xFFCACACA); + Color levelTextColor = Color(0xFFCACACA); + Color levelTextBackdrop = Color(0xFFFFF8EC); @override Widget build(BuildContext context) { @@ -54,109 +57,184 @@ class MineVipEntry extends StatelessWidget { case 1: { levelText = "${S.of(context).yinkahuiyuan}"; + logoColor = Color(0xFFA0C4E7); + levelTextColor = Color(0xFF61ABF3); + levelTextBackdrop = Color(0xFFC1DBF4); break; } case 2: { levelText = "${S.of(context).jinkahuiyuan}"; + logoColor = Color(0xFFFBB43A); + levelTextColor = Color(0xFFFBB43A); + levelTextBackdrop = Color(0xFFFFECD2); break; } case 3: { levelText = "${S.of(context).gongchuanghuiyuan}"; + logoColor = Color(0xFF352822); + levelTextColor = Color(0xFF92755D); + levelTextBackdrop = Color(0xFFFFECD2); break; } } Widget widget = Container( - width: double.infinity, - padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w), - margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h), - decoration: BoxDecoration( - color: Color(0xFF3D3D5D), - borderRadius: BorderRadius.circular(6), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Image.asset( - "assets/image/vip_logo.webp", - width: 24, - height: 24, - ), - SizedBox( - width: 5.w, + child: Row( + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal:4.w,vertical: 3.h), + decoration: BoxDecoration( + color: logoColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(4), + bottomLeft: Radius.circular(4),), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, ), - Expanded( - child: Text( - levelText, - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFFFFEAD2)), - )), - Container( - padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), - decoration: BoxDecoration( - color: Color(0xFFFFECD2), - borderRadius: BorderRadius.circular(10), - ), - child: Text( - S.of(context).chakanquanyi, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF92755D), - ), - ), - ) ], ), - SizedBox( - height: 16.h, + child: Image.asset( + "assets/image/mine_vip_logo.webp", + fit: BoxFit.cover, + width: 13.w, + height: 11.h, ), - Container( - height: 4.h, - child: ClipRRect( - borderRadius: BorderRadius.circular(6.5), - child: LinearProgressIndicator( - value: rankMax > (rank ?? 0) - ? ((vipLevel < curLevel) - ? rankMax / rankMax - : (rank ?? 0) / rankMax) - : 0, - backgroundColor: Color(0xFF222233), - color: Color(0xFFFFECD2), + ), + Container( + padding: EdgeInsets.symmetric(horizontal:2.w,vertical:3.h), + decoration: BoxDecoration( + color: levelTextBackdrop, + borderRadius: BorderRadius.only( + topRight: Radius.circular(4), + bottomRight: Radius.circular(4),), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, ), - ), + ], ), - SizedBox( - height: 8.h, + child:Row( + children: [ + Text( + levelText, + textAlign: TextAlign.center, + style: TextStyle( + color: levelTextColor, + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + ), + ), + Image.asset( + "assets/image/icon_right.webp", + fit: BoxFit.cover, + width: 8.w, + height: 8.h, + color: levelTextColor, + ), + ], ), - Text( - rank > rankMax - ? S.of(context).dangqiandengji - : "消费金额¥${rank.toStringAsFixed(2).toString()} 距${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}", - style: TextStyle( - color: Color(0xFFFFEAD2), - fontWeight: MyFontWeight.light, - fontFamily: 'JDZhengHT', - fontSize: 14.sp, - ), - ) - ], - )); + ) + ], + ), + ); + // Container( + // width: double.infinity, + // padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w), + // margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h), + // decoration: BoxDecoration( + // color: Color(0xFF3D3D5D), + // borderRadius: BorderRadius.circular(6), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ) + // ], + // ), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Row( + // children: [ + // Image.asset( + // "assets/image/vip_logo.webp", + // width: 24, + // height: 24, + // ), + // SizedBox( + // width: 5.w, + // ), + // Expanded( + // child: Text( + // levelText, + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xFFFFEAD2)), + // )), + // Container( + // padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), + // decoration: BoxDecoration( + // color: Color(0xFFFFECD2), + // borderRadius: BorderRadius.circular(10), + // ), + // child: Text( + // S.of(context).chakanquanyi, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xFF92755D), + // ), + // ), + // ) + // ], + // ), + // SizedBox( + // height: 16.h, + // ), + // Container( + // height: 4.h, + // child: ClipRRect( + // borderRadius: BorderRadius.circular(6.5), + // child: LinearProgressIndicator( + // value: rankMax > (rank ?? 0) + // ? ((vipLevel < curLevel) + // ? rankMax / rankMax + // : (rank ?? 0) / rankMax) + // : 0, + // backgroundColor: Color(0xFF222233), + // color: Color(0xFFFFECD2), + // ), + // ), + // ), + // SizedBox( + // height: 8.h, + // ), + // Text( + // rank > rankMax + // ? S.of(context).dangqiandengji + // : "消费金额¥${rank.toStringAsFixed(2).toString()} 距${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}", + // style: TextStyle( + // color: Color(0xFFFFEAD2), + // fontWeight: MyFontWeight.light, + // fontFamily: 'JDZhengHT', + // fontSize: 14.sp, + // ), + // ) + // ], + // )); return GestureDetector( onTap: () { diff --git a/lib/view_widget/update_dialog.dart b/lib/view_widget/update_dialog.dart index 8c951cf1..2aaad41d 100644 --- a/lib/view_widget/update_dialog.dart +++ b/lib/view_widget/update_dialog.dart @@ -43,17 +43,12 @@ class _UpdateDialog extends State { alignment: Alignment.bottomCenter, children: [ Container( - // height: 100.h, decoration: BoxDecoration( color: Colors.white, border: Border.all( color: Colors.white, width: 0, style: BorderStyle.solid), - // borderRadius: BorderRadius.only( - // topLeft: Radius.circular(8.r), - // topRight: Radius.circular(8.r), - // ), ), ), Image.asset( diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index b7b05e97..74fd97ff 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -717,7 +717,8 @@ class _VipTop extends State { topLeft: const Radius.circular(8.0), topRight: const Radius.circular(8.0))), child: Container( - height: 230.h, + // height: 230.h, + height: 160.h, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index 9a6ef32b..aa53cb2a 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -51,11 +51,17 @@ class _WebPage extends State with WidgetsBindingObserver { final GlobalKey inputKey = GlobalKey(); final ScrollController scrollController = ScrollController(); final TextEditingController commentTextController = TextEditingController(); + bool emojiShowing = false; + static double keyboard_height=300; + double keyboard = -1; + bool needShowSmiley = false; + bool needHideSmiley = false; @override void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); + commentFocus.addListener(_focusNodeListener); if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); queryHtml(); @@ -69,6 +75,7 @@ class _WebPage extends State with WidgetsBindingObserver { if (MediaQuery.of(context).viewInsets.bottom == 0) { if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); + if(!emojiShowing) setState(() { hintText = S.current.liuxianinjingcaidepinglunba; isKeyBoardShow = false; @@ -80,11 +87,50 @@ class _WebPage extends State with WidgetsBindingObserver { }); } }); + if (needShowSmiley && window.viewInsets.bottom <= 0.1) { + needShowSmiley = false; + setState(() { + emojiShowing = true; + }); + } + if(needHideSmiley && window.viewInsets.bottom > 0.1) { + needHideSmiley = false; + setState(() { + emojiShowing = false; + }); + } + } + + void _focusNodeListener() { + /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ + setState(() { + smileyPadGone = true; + }); + }*/ + } + + _onTextFieldTap() { + if(emojiShowing) { + needHideSmiley = true; + } + } + + _onSmileyTap() { + if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) { + needShowSmiley = true; + commentFocus.unfocus(); + } else { + setState(() { + emojiShowing = !emojiShowing; + isKeyBoardShow = emojiShowing; + }); + } } @override - void dispose() { + void dispose(){ WidgetsBinding.instance.removeObserver(this); + commentFocus.removeListener(_focusNodeListener); super.dispose(); } @@ -218,10 +264,20 @@ class _WebPage extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { + double h = MediaQuery.of(context).viewInsets.bottom; + if(h > 0 && keyboard <= 0) { + setState(() { + keyboard = h; + }); + } return GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { - FocusScope.of(context).requestFocus(FocusNode()); + setState(() { + emojiShowing = false; + isKeyBoardShow = emojiShowing; + FocusScope.of(context).requestFocus(FocusNode()); + }); }, child:Scaffold( appBar: MyAppBar( @@ -307,9 +363,14 @@ class _WebPage extends State with WidgetsBindingObserver { inputKey, hintText, isKeyBoardShow, + keyboard_height, + keyboard, + emojiShowing, commentFocus, commentTextController, _toComment, + _onSmileyTap, + _onTextFieldTap, _queryMemberComment, _queryInformationLikes, activity: activity, diff --git a/lib/web/web_view/input_comment.dart b/lib/web/web_view/input_comment.dart index d89346f4..ad9d7513 100644 --- a/lib/web/web_view/input_comment.dart +++ b/lib/web/web_view/input_comment.dart @@ -4,33 +4,47 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:like_button/like_button.dart'; +import 'dart:io'; + +import 'package:emoji_picker_flutter/emoji_picker_flutter.dart'; class InputComment extends StatefulWidget { final String hintText; final Activity activity; final Article article; final bool isKeyBoardShow; + final double keyboard_height; + final double keyboard; + final bool emojiShowing; final FocusNode commentFocus; final Function toComment; + final Function onSmileyTap; + final Function onTextFieldTap; final Function(String text) queryMemberComment; final Function() queryInformationLikes; final TextEditingController commentTextController; final bool isLike; + final Function(bool emojiShow) emojiShowFunction; InputComment( Key key, this.hintText, this.isKeyBoardShow, + this.keyboard_height, + this.keyboard, + this.emojiShowing, this.commentFocus, this.commentTextController, this.toComment, + this.onSmileyTap, + this.onTextFieldTap, this.queryMemberComment, this.queryInformationLikes, { this.activity, this.article, - this.isLike - + this.isLike, + this.emojiShowFunction } ) : super(key: key); @@ -41,11 +55,12 @@ class InputComment extends StatefulWidget { } class _InputComment extends State { + bool emojiShowing = false; @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.all(16), + padding: EdgeInsets.only(top: 16.h,), decoration: BoxDecoration( color: Colors.white, boxShadow: [ @@ -60,134 +75,188 @@ class _InputComment extends State { top: Radius.circular(8), ), ), - child: Row( + child: Column( children: [ - Expanded( - flex: 1, - child: Container( - decoration: BoxDecoration( - color: Color(0xffF2F2F2), - borderRadius: BorderRadius.circular(2.0), + Row( + children: [ + IconButton( + onPressed: () { + widget.onSmileyTap(); + }, + icon: Icon( + Icons.emoji_emotions, + color: Color(0xFF868686), + ), ), - child: Container( - margin: EdgeInsets.symmetric(horizontal: 4.w), - alignment: Alignment.topLeft, - child: TextField( - textInputAction:TextInputAction.send, - onEditingComplete: () { + Expanded( + flex: 1, + child: Container( + decoration: BoxDecoration( + color: Color(0xffF2F2F2), + borderRadius: BorderRadius.circular(2.0), + ), + child: Container( + margin: EdgeInsets.symmetric(horizontal: 4.w), + alignment: Alignment.topLeft, + child: TextField( + textInputAction:TextInputAction.send, + onTap: (){ + widget.onTextFieldTap(); + }, + onEditingComplete: () { + var commentText = widget.commentTextController.text; + if (commentText.trim() == "") { + return; + } + widget.queryMemberComment(commentText); + }, + maxLines: 8, + minLines: 1, + focusNode: widget.commentFocus, + controller: widget.commentTextController, + decoration: InputDecoration( + border: InputBorder.none, + hintText: widget.hintText, + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFF868686), + ), + ), + ), + ), + ), + ), + if (widget.isKeyBoardShow) + GestureDetector( + onTap: () { var commentText = widget.commentTextController.text; if (commentText.trim() == "") { return; } widget.queryMemberComment(commentText); }, - maxLines: 8, - minLines: 1, - focusNode: widget.commentFocus, - controller: widget.commentTextController, - decoration: InputDecoration( - border: InputBorder.none, - hintText: widget.hintText, - hintStyle: TextStyle( - fontSize: 14.sp, - color: Color(0xFF868686), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 20.w), + child: Text( + S.of(context).fasong, + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0XFF1A1A1A), + ), ), ), ), - ), - ), - ), - if (widget.isKeyBoardShow) - GestureDetector( - onTap: () { - var commentText = widget.commentTextController.text; - if (commentText.trim() == "") { - return; - } - widget.queryMemberComment(commentText); - }, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 20.w), - child: Text( - S.of(context).fasong, - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0XFF1A1A1A), - ), - ), - ), - ), - if (!widget.isKeyBoardShow) - InkWell( - onTap: widget.toComment, - child: Tooltip( - message: S.of(context).daopinglunliebiaodingbu, - child: Container( - padding: EdgeInsets.only(left: 20.w, right: 10.w), - child: Image.asset( - "assets/image/icon_comment.webp", - width: 24, - height: 24, + if (!widget.isKeyBoardShow) + InkWell( + onTap: widget.toComment, + child: Tooltip( + message: S.of(context).daopinglunliebiaodingbu, + child: Container( + padding: EdgeInsets.only(left: 20.w, right: 10.w), + child: Image.asset( + "assets/image/icon_comment.webp", + width: 24, + height: 24, + ), + ), ), ), - ), - ), - if (!widget.isKeyBoardShow) - Tooltip( - message: S.of(context).dianzanxihuan_(widget.activity == null ? S.of(context).wenzhang : S.of(context).huodong), - child: LikeButton( - padding: EdgeInsets.all(10), - size: 24, - circleSize: 24, - circleColor: CircleColor( - start: Color(0xff00ddff), - end: Color(0xff0099cc), - ), - bubblesColor: BubblesColor( - dotPrimaryColor: Color(0xff33b5e5), - dotSecondaryColor: Color(0xff0099cc), - ), - bubblesSize: 24, - likeBuilder: (bool isLiked) { - return isLiked - ? Image.asset( - "assets/image/icon_like.webp", - width: 24, - height: 24, - ) - : Image.asset( - "assets/image/icon_like_h.webp", - width: 24, - height: 24, - ); - }, - isLiked: (widget.activity != null - ? widget.activity.liked - : widget.article != null + if (!widget.isKeyBoardShow) + Tooltip( + message: S.of(context).dianzanxihuan_(widget.activity == null ? S.of(context).wenzhang : S.of(context).huodong), + child: LikeButton( + padding: EdgeInsets.all(10), + size: 24, + circleSize: 24, + circleColor: CircleColor( + start: Color(0xff00ddff), + end: Color(0xff0099cc), + ), + bubblesColor: BubblesColor( + dotPrimaryColor: Color(0xff33b5e5), + dotSecondaryColor: Color(0xff0099cc), + ), + bubblesSize: 24, + likeBuilder: (bool isLiked) { + return isLiked + ? Image.asset( + "assets/image/icon_like.webp", + width: 24, + height: 24, + ) + : Image.asset( + "assets/image/icon_like_h.webp", + width: 24, + height: 24, + ); + }, + isLiked: (widget.activity != null + ? widget.activity.liked + : widget.article != null ? widget.article.liked : widget.isLike??false), - onTap: (isLiked) async { - await widget.queryInformationLikes(); - return (widget.activity != null - ? widget.activity.liked - : widget.article != null + onTap: (isLiked) async { + await widget.queryInformationLikes(); + return (widget.activity != null + ? widget.activity.liked + : widget.article != null ? widget.article.liked : widget.isLike??false); - }, - countBuilder: (int count, bool isLiked, String text) { - return Text( - text, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 12.sp, + }, + countBuilder: (int count, bool isLiked, String text) { + return Text( + text, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 12.sp, + ), + ); + }, + ), + ), + ], + ), + SizedBox(height: 16.h,), + Offstage( + offstage: !widget.emojiShowing, + child: SizedBox( + height: 250.h, + child: + EmojiPicker( + textEditingController: widget.commentTextController, + config: Config( + columns: 7, + emojiSizeMax: 32 * (Platform.isIOS ? 1.30 : 1.0), + verticalSpacing: 0, + horizontalSpacing: 0, + gridPadding: EdgeInsets.zero, + initCategory: Category.RECENT, + bgColor: const Color(0xFFF2F2F2), + // indicatorColor: Colors.blue, + iconColor: Colors.grey, + iconColorSelected: Colors.blue, + backspaceColor: Colors.blue, + skinToneDialogBgColor: Colors.white, + skinToneIndicatorColor: Colors.grey, + enableSkinTones: true, + showRecentsTab: true, + recentsLimit: 28, + replaceEmojiOnLimitExceed: false, + noRecents:Text( + "最近使用", + style: TextStyle(fontSize: 20, color: Colors.black26), + textAlign: TextAlign.center, ), - ); - }, - ), - ), + loadingIndicator: const SizedBox.shrink(), + tabIndicatorAnimDuration: kTabScrollDuration, + categoryIcons: const CategoryIcons(), + buttonMode: ButtonMode.MATERIAL, + checkPlatformCompatibility: true, + ), + )), + ), ], ), ); - } -} + }} diff --git a/pubspec.yaml b/pubspec.yaml index 0afefa75..95525547 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 3.1.9+39 +version: 3.2.0+41 environment: sdk: ">=2.7.0 <3.0.0" @@ -101,6 +101,8 @@ dependencies: flutter_slidable: ^1.3.0 + emoji_picker_flutter: ^1.4.1 + dev_dependencies: flutter_test: sdk: flutter