From 30c95ca07f07edf2169c81cc00e5dddaaa5ab237 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Tue, 15 Mar 2022 14:02:52 +0800 Subject: [PATCH 1/9] =?UTF-8?q?u=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main_page.dart b/lib/main_page.dart index b3367e5e..1bb8718a 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -308,7 +308,7 @@ class _MainPage extends State with WidgetsBindingObserver { // bottomNavigationBigItem(S.of(context).pinpai, 0), bottomNavigationItem(S.of(context).main_menu1, 0), bottomNavigationItem(S.of(context).main_menu2, 1), - bottomNavigationItem((Theme.of(context).platform == TargetPlatform.android) ? "订单" :S.of(context).main_menu3 , 2), + bottomNavigationItem(S.of(context).main_menu3 , 2), bottomNavigationItem(S.of(context).main_menu4, 3), ], ), From 3877ed531ccfc469ab826ccc4a8d0a5a18233c3a Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 17 Mar 2022 10:07:26 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E4=BA=BA,=E6=9B=B4=E6=94=B9=E5=AE=A1=E6=A0=B8=E9=9C=80?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/icon_mine_online_service.webp | Bin 616 -> 2039 bytes assets/image/3x/icon_mine_online_service.webp | Bin 1108 -> 3710 bytes assets/image/icon_mine_online_service.webp | Bin 318 -> 1029 bytes lib/main.dart | 42 +------------- lib/main_page.dart | 54 +++++++++++++++++- lib/mine/mine_view/mine_item.dart | 19 +++--- lib/retrofit/retrofit_api.dart | 10 ++-- lib/retrofit/retrofit_api.g.dart | 6 +- lib/setting/help_feedback_page.dart | 13 +++-- 9 files changed, 78 insertions(+), 66 deletions(-) diff --git a/assets/image/2x/icon_mine_online_service.webp b/assets/image/2x/icon_mine_online_service.webp index 71cc6ca283fd3e644a49b7ab084c0aa9b62d2b44..b2cd9aef69b42b6f03ccf3dd454c5fd35a617af8 100644 GIT binary patch literal 2039 zcmVPx+u}MThRCr$PT78UMRTcl8JNtoM5VqN91sXrtLQ2Eh^u7CLXG>*CDDCcSQ6WJ1 zqX|I*QHh#j8kCAjp$QGx$VX747-Eb;N+_lKVS$i^G&`Ml->YV8Bic%8+~{JhMPSx$ zJM#{?b!PJRvE99IX1kqa=lr)j=j;C7IrpA(?jrW_9ud6-U~dovFZjOy?{f*pIRn6P9GjUR0B{q4#tIj4nuvA-*zUTn zSD}s>#pWD*7QraWykvM?`66UOfXKzdd&B*quj@9zAKa${Cod24LmNm6tR%HNC>jYo@WI z9sFew1Ur1+|7#p)Ez7z>2(bykT>vhK$`aAOLZQ&-`~H99=>3?UYJ^j%)F<-!{A&R8 z*NV~*fcunE?^I($O8ErJP8*E92rMAQ=2&&-=W&(oW4Y^n%= z&d$!|g+k#E0Gdh`nRybx2G8?!O2nenV0tTcMj=Er#CIyCbh%q8QD=YpJ|Un(d?|qC02-!I_Uh%imfoGW z?JP(sUjT4xBo%Iq8-cL_kWvl4N7 zqz5-!mh~ASgbsOKM3v}GrBrtuKVku3+xAsN^ruMbY*kAAFpg1E-qpL;UdoM)yP08! zWbz0S*JL*Ad0R@k6+n3JU}j$KdETE*ZNvgVO8GE=EhXi8;}b$$=DO~2Q-g8&tUVjr znnb|`@cEJ~5j{WBJ8*~YG>K@8h?+xsA67~|WNIfa0Jq7 z3ADDfWx96$PfGbBfLlVpc}gj1q&UtgpiADy#zx(nCql|MDy4pHYOET*RDaK55Ve=1 zfT?e!Z(zW-?TtkAt58%1%)HpNL^h59$8pv$vmR8GNeHnto6U|@voKTH)KKr!2=L7i z|93L!!6%Z*q zG?O0up8i`(smtc@q{+A@F$O?NsW(5p36|*hN~u*9t)>E@&i?cbL|m>i8Tk7C^x&Df zfRxe)Q1*q0wz#gl&BTl`0Jd#!C!) zT6eTEW#%28=jmQ$Rx$=aO8Eo;-I0}ONGa7jtA%-BkWvmt+T|yeQr|W)T?fDfrDC2% zBR~Ool89QvI)Wew0E{#9n{zeNE*3nx{9Yo25Mg`FtT#X%nc=g4ULs&N>`noA=ER8; z4;(piM7PSZslC0uxwW};V>Sa#sRfg>hSuxiz+_Cz9aILzD7 z(6B6%$xJI>b9F!}m1@uD^TrE^f)ZE04nVC{f^olKJpv*K#09XP0`(M_hi=euoJW}X z!BDgw4uW8X@BhCi50m3Keax)i0+dMzvBdQ5Ael^lItYUCh}xT!Qd4y5-!02(6hi1a z;K~v|5p8o_w>-U`>FABq4(rDc&qtK$vp#z7uPZ@)T^@cVGOm=mG{);Ml2ZOdcYh&! zIcC<6ETTPy9+WPN_;tHdO5YsKO2zdH#h4-B<$3z1~fyQFH%zIIL#n8ctiHWX5hYo#c;!ufa#flXdE?Trm zUzuNHD#y%v7V%Zj^TKxsGm6IopacRD>6_VEBY~L*nEB312P4Hn$aDJ5kO2sK2y<_o z#h-~z1H~U>DW*f3h&q@#+KB~3G)_dXXR}#7t*x4p$)v^1H!!mXeMf#ehbjV~>J`-^fAthEA#a7Uq*_Am93&4_X+q83@ZR@UQ`^I@z zY`g#6xZEdBz9Rb1z-=Q%>Gc?L^a=LQmt1o-h^5o9!Lr$Z$2G>zRDec=N!j>LEd+qX zqE>QREVfc@kpQ-e?=g3BARt(GX^FTRKHy-3yS5QL6}O&?yOP4#%G&_KU5ZXOf`E;y zCnM}QXhOYh49z?oAd=M)dA@yky;KYl>~pjrB-fZ8H&ULiB!g~BSSQyQKuh1{?ELNS z=Kex5sK9Ta(n08$q;vgpb1%)heP~meqCxaAz1%!8#u}IswQ@q-#fZ7SyOB=jN(jV% zq=`8r=k4ZII&Og~O=^W2o%5SV>9`v9Xi@{@>73o%O2?J3OOuLWlMZ`+miDtDN^?r% zlySy_3{3~%IF`@sOLFK1fcQ+*6B1`}0Pr5tQO7Il)C*PU9QEW2*pD#N_L*t(op|5@tMfs^Pdy4 C@-O`W diff --git a/assets/image/3x/icon_mine_online_service.webp b/assets/image/3x/icon_mine_online_service.webp index 01fe923b18a566dc1a4c1280027ab173b70a941d..5e44161c7c2113cc209885a5ac93ba4822568fc4 100644 GIT binary patch literal 3710 zcmZ{nbyO2>7snqqT9Hi}1l*L6Mn~vi)R2&n7$G1f4N5Z*Wgs!)2NI$*4jH8=NGTx- z0+NyvQlmloCm|s3-v8hCkLS7Po^zi#-*fIg-%spq11%P2USTW=yBO)I zJLN@?A~n$X8EdJ7^4<$80Gw0Q!K#_!@2*=v@-`jjP+4l4)Yk@dDn?qz+GQM?KD$%S zY_HU4bR2GynK{XKa*Qe-2aJ~vQtTYda31Jh#j9p$11rr^5(%QVRS>ToxUU@OS~kPw zs!^RUO!^Xi@BLS zjSa`-f1Peiv-jA zB3oua84Df5YJ5 z!-vV*mu-l%+3su1ptMxr3^2b$Ns3)I;%=fvZMq5OJ9ULEASrF}IC>J9|`7QdY({JvD`iBI5Nk^sz1g zyuH#myK3hUgrKmH-O2?^V1Zar{N@e+!A$k9~dCCA# zFMe14<(l=zr=+ED?ePGac%lIm$TAAb+0_vz7i%M zY4O(&)Um?z424tkJSS=-ao$N1nBwAM(F{c&iVyI<0-t0CN;np*4x$yR&X|~XPVuD% zMxccm7@{$Gn;};gPQZ*{{v}%^B_8|ltrnTRvo0~$foki+*kuQx7z!+}U>k%o^e~hm z)psd!o+hs#)le6riG4OSP<&liq%$wZ==FGGOMX-BM)p!KAM*=nj^;VT{WnftK^6)U@& zLoRP9J?7_1N<)~zPZqGtFnV0g)=!bNs!>{sOdL~+rXzSOS|=M6<W(sMBS%m>T;il5PoI_^1aJR`9 zrEPW(!)Vh4GhU9?`HgsTf ze_H0e)lt(qrr#8AtGD(s_}_dUnL;^*|%OC5kVlK|uRTaQUfy?$FosEixNE zUjh^Hs`~mpbsHNS>sbGYC}Xdm@D`c7e(JLh`0g<0rk!tfy?){IhOu@CU`ZWrG;w?d zAq&2)?kT0EcL6Y@X-?)8n7m_V7U+EW{H&v))jT7}BugSmBD=0T)>>Na$f89(bR!Gq z+ScR&5Qc6l($o%)mabl}IAa@N$F^tS>{jE zVL3Tl<5Hj<27fSFWX0`2Hr4nrtirK9vAo~TQ=Fgrhh7o&vMs!0)ys@Ctryu?P7tZZ zUC!?<8GUq=1eTEDqz+Di!{J0S$lv&98bWM!U3QK`&&#{7G%UvVX`Ae;_!+FhYKjsu zv)R~%0_CxRZsFaaF`XM&PdY+IVDB|gnx{HVUIs? zCQkvv+>ux$;Q>Quiu=9A&pVoTiSX^&UymWp=EUNak5j2yV$q&7w@pm02|d$obgIZ3 zjVGEfe{3Ri7v5aW+Unvmpf#E8F||?2U<`{JQP}lyXN^)vV4CK&T^-WzQ~M!ra$sO5 zu;Ru9B)_y&>|Um`gq0%FH{$@(A|uaPHmd!I>+Yj|x{LGBhNP7-BI5q~xUIZOg`Lok z%fBHqCc585Ld}NRrxngVX)G44q*E1T&y*~j|C8f6ULe}pU?IUNty>2FTkJmBkb0Zk zON%&{_KS}#Ny1`Gy1l@S_Xnr)19)5|IUw48>t@w|&r`L`am(!CObPPa2rn&a<2P79d@?^?Jvq zU>M3=!BD%9CH_`CuCl7C3T3bGHOo-3s27b!KOwvQR!i)?JwaO{gl$4a{ytb;{ zSk+6Gv3(Gba8479DsKJ>ZEABxeQaU6<)kZQ4sBjB*jnqFyG=*nS}y!p?l=3|YXG$# zh@=Ehn~i!Eb`;YC_=nX)NAa(*A!2Nb@tJH^F5_XY+|f86Q#FFOKULU=#({0=hu*bDV-A9c(&|N1YhFjX(bS`GrSjAO^lY7HDwweih`MmhN@wWbLz=34^G0B~os7 z0|&U~Z!?X05l;VSn(1%G>rHB#`F>GtVQH?F<&d5CEM_3EoCYHK*J);GWR`j7^ws3) zW7z~2si~b8%>x$hMzp;&GcW1KxUNC4z)Tav&CSwwn6Vr`o)a= zQ#MS1t7r2kwVx`te!e#*!OpDz%=mBDs-dP)dE8frFusUH7HsQ!<(c=2JPOL3@!LX) zq>gk3stX;|A4Ey$?j2lof+D3-jqhNfWYM^%#yc(g*5mgBs;lZ78jfA-4SDqPFpt#D z&AGVx?lg{k!95B(gSewVSfzBV*6IjmLcmO<{ik}TV-%SrTAFiVjXieP?Wgj)baOABP(x8UV;;G>eb(-cJ83r!wMHNs%Jl8>=`F{0VNvB}xtrCs`FcP7NI2iu=>9wd47=y|Es~T; z1dL4*f}+5F62ce)h9t=_#uE%V6ge6wnx<(RY^o|kz?fhG27xgFLqK2<7-NhvMM4Hb z1c5LHAwfV82u4^SLJ$$bU_>NjNdkZf`bQ1`=->bh0|3C`01UtY0B`^m6b=Ar0sH`{ zFyIRYKw+q1s8J(_;u{KWnl`SgJ)GjO>qZa5McekP`|}V469@zkRkcc@Ri)eWXdrFd zwzW;(dFJl!KAgF`;B$8$+ESLghP%5v6=3c^FAYuJH#mHV=syIvjT}j(&5^r%*E4S* z|HI~BvNpYb+1mQ@b(3|)fqWNPT1L(rv?>kHYgAgp`8&@oMByCG?}m6tHalEkb|lJW zIy|a|kpA{S$FsS)XB`8#^bk^y9x)N6YP@B;r0U<7v%Ha+<=~K&xv`wHzh7m$a4U}} zkweu};dRs#bCuE})7*sZGqzVL@MltfUjtleS(OEL*wb&*mkwVtpm`w|ahZaOV4eeX0d zUPV~7^gy`xojg%+oTqPiL}H3qkuThNe}k}T?d2&PJ1CRn!3jls1ty3YuXQ-}a*Z(Q z(?y*AnkkbM9BVspuJNHxL};O1gNr)|iyS+F8{1@~Qj;RXykj`dJ;;R!E#CkhGg)(X zo`Cv29V|J-$4xkhE|#cpY8Rm|eIDqeeRbz3f8k=NNZA7nGWh5CXoP+@Juc1Pjf)q( zSgj7mI%?(C3pF0H_`8hq;amf4Z@Tmd>SpTyppAZOG_LBJ`gsg#&U5YfE5^{B~Ag`38R8Nf<ShodwDij#<`!j`ik3y98&f9gF%b3IZ+dEpZ?daV?79$aVuhv12 z?7ek4w)K0nU_QFJZ+2?UZ94F8<=BdNDI1e%v$LnLHV531W4j}5V=-oX3KO7}W7A68 zSicYe2DZPzqXkU%6lOrHfK5hsfH`|>NE>iR0h^58^3b(?vx=DJZ0n%{HW^8-$-=tL a#zs3*+Ya0Ig^i7N>~G^l+d)RQ|M~)5vH+|A diff --git a/assets/image/icon_mine_online_service.webp b/assets/image/icon_mine_online_service.webp index 79640cdee9628d8bbdb492330d778ebaecfea179..be33bb5455174d602a0b2199874c8a89ea75c7e0 100644 GIT binary patch literal 1029 zcmV+g1p51lP)Px&zez+vR9HvtmR)FEMHI*XXYSqBO=xwaR4G!hMjx_%W$zu6l_K$>VuGL57qLaK z_(4_j;)5?WE%@L=A0*hKq6M|Sh?bJJiHgvm;HH_mNpX#k77<07SYvI{(#>}F&XI|C zacy?9yLqq(85p?C$2q?_bI$(`;R-jp!v3)W@c)f~l=21uw%azXl$u^nJ~b49R4Uae zgm{*Sddi%a{7y6TATz%k1i|roVd?^CZ*O1kILzLUP(IIC3AfL~Flg(!Tv<{NVWJ^3A-$X=DGxMWFBmkUY z=7+S_qf0?736M&q?rlo~A6O0o8xeU%S%$^Ic|9Z5k*z_d;55Os7 z%w0hcT&x696~OoXT}0GpLm3&Es$}4vFYaGwitYdbZ2;ETHOzQFzjNv}*LBCEtJ|%$ z-c>h1I-QOe3Wd`|bPY3a*IMtdl}ug7y4>8w)lUjIdn1sS3VmnhiRe9MJ{OC{)@L%A z+~syEM!@&|$BF1u0KYXiH{UosJY1{=P@3;J+VhA24gr|@{jHNXC1w&o1Gt`vdjQmp;;c3Pi0&m^;IrGrdIg41j*6RBv4XQpzC!4*=*@O7%Ai z(0Qc$AQ3&r#GAst86Uu#06terb=M2BKSTb#2d_f zTx;Fg5I_Y-zgVTyTHEqk)O_D>w@L|M!{w991qcD0i;Oh^hy(auDRp}#04Ze_z-<6* zxs`;+s;IkMfESfg`>Zo5&?JH?Z5CpbFYXjI77D5Q|95c5>nVq+CYK+-aO^mDv2_asw zGS18kLPSJojWPC}xXAg!e5I58mt!jcD-rk$AhzK!ga6J{00000NkvXXu0mjfW3SuP literal 318 zcmV-E0m1%KNk&FC0RRA3MM6+kP&iB~0RR9m8^8t-hoLBvq^8LT!6U}`MH>p*HgbIT zi^%h*@t`JyMv@fOG5)J~{|1q10Dwv6xF&Z!fT&M!5yz57bqN4Kz%eh{MpIHrq_iSp z4G~WK*l>ji2ow-DayXFSA^;2#zW2T#DGcZ^LWCa}5F8gcrkJsf8Oh#v_y3Rn|Mw7K zoV_mnoLMSqMk9o9g8y4-UKDxqoZT#H z_xm=Q?Z$b_)z$<6bGur4Bh1Bojfd-QVan>>g7$hl9js|3awabH_v86;a6?B@HjtiA zXbQ=YiH with WidgetsBindingObserver { ..userInteractions = false ..dismissOnTap = false; + + initSdk(); + pushRoute(); String invite = ""; @@ -130,11 +138,53 @@ class _MainPage extends State with WidgetsBindingObserver { }); queryUserInfo(); + } + + initSdk() async { + ///ios 调用startXg前需要调用此方法 + xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com"); + xgFlutterPlugin.setEnableDebug(true); + + ///此处配置为iOS的appID信息,Android信息在build.gradle文件中 + xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22"); + + if (Platform.isAndroid) { + XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi(); + //小米 + androidApi.setMiPushAppId(appId: "2882303761520050452"); + androidApi.setMiPushAppKey(appKey: "5582005091452"); + + androidApi.enableOtherPush(); + androidApi.regPush(); + } + + ShareSDKRegister shareSDKRegister = ShareSDKRegister(); + shareSDKRegister.setupWechat( + "wx3b269e795ed23e5f", + "64020361b8ec4c99936c0e3999a9f249", + "https://hx.lotus-wallet.com/app/", + ); + shareSDKRegister.setupFacebook( + "523308712059457", + "d3a1b6377100871799d8973fbe84794a", + "一心回乡", + ); + SharesdkPlugin.regist(shareSDKRegister); + + if (Platform.isIOS) { + LocationFlutterPlugin.setApiKey("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); + BMFMapSDK.setApiKeyAndCoordType( + 'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR', + BMF_COORD_TYPE.COMMON, + ); + } else if (Platform.isAndroid) { + BMFMapSDK.setCoordType(BMF_COORD_TYPE.COMMON); + } if (Platform.isAndroid) { xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( MyNativeEventHandler( - (String title, String message, String customContent, int type) { + (String title, String message, String customContent, int type) { print("xgPushClickAction2: $customContent"); SharedPreferences.getInstance().then((value) { value.setString("pushData", customContent); @@ -151,7 +201,7 @@ class _MainPage extends State with WidgetsBindingObserver { if (Platform.isAndroid ? (event["actionType"] == 0) : (event["xg"]["msgtype"] == 1) && - event[Platform.isAndroid ? "customMessage" : "custom"] != null) { + event[Platform.isAndroid ? "customMessage" : "custom"] != null) { SharedPreferences.getInstance().then((value) { value.setString("pushData", event[Platform.isAndroid ? "customMessage" : "custom"]); diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 108ee702..c346c14c 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -157,16 +157,15 @@ class _MineItem extends State { ), ),), ///联系客服 - // Expanded(child: InkWell( - // onTap: () { - // showCallMobile(); - // }, - // child: mineItem( - // "联系客服", - // "assets/image/icon_mine_online_service.png", - // ), - // ),), - Expanded(child:Container()), + Expanded(child: InkWell( + onTap: () { + showCallMobile(); + }, + child: mineItem( + "联系客服", + "assets/image/icon_mine_online_service.webp", + ), + ),), Expanded(child:Container()), Expanded(child:Container()) ], diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index d50b5e95..a6e88c81 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -57,14 +57,14 @@ import 'data/vip_rule_details.dart'; part 'retrofit_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 -// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -// const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 +const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/"; @@ -382,7 +382,7 @@ abstract class ApiService { ///反馈 @POST("/other/report") - Future> report(@Body() Map map); + Future> report(@Body() Map map); ///取消订单 @GET("/order/cancel/{id}") diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 5706536a..78730b7d 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.236:8766/app/'; } final Dio _dio; @@ -1167,7 +1167,7 @@ class _ApiService implements ApiService { } @override - Future> report(map) async { + Future> report(map) async { ArgumentError.checkNotNull(map, 'map'); const _extra = {}; final queryParameters = {}; @@ -1181,7 +1181,7 @@ class _ApiService implements ApiService { extra: _extra, baseUrl: baseUrl), data: _data); - final value = BaseData.fromJson( + final value = BaseData.fromJson( _result.data, (json) => json as bool, ); diff --git a/lib/setting/help_feedback_page.dart b/lib/setting/help_feedback_page.dart index cf97d1d5..57d2d478 100644 --- a/lib/setting/help_feedback_page.dart +++ b/lib/setting/help_feedback_page.dart @@ -140,6 +140,10 @@ class _HelpFeedbackPage extends State { ), InkWell( onTap: () { + if(phoneController.text == ""){ + SmartDialog.showToast("请输入有效手机号码", alignment: Alignment.center); + return; + } report(); }, child: Container( @@ -162,17 +166,16 @@ class _HelpFeedbackPage extends State { } report() async { - var content = editingController.text; - var phone = phoneController.text; BaseData baseData = await apiService.report({ - "mobile": phone, - "reportContent": content, + "mobile": phoneController.text, + "reportContent": editingController.text, }).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("反馈成功"); Navigator.of(context).pop(); } else { - SmartDialog.showToast("反馈失败"); + SmartDialog.showToast("反馈成功"); + Navigator.of(context).pop(); } } From 885dbf1b8e1aa65d20b8394085c54b6c28349b14 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 17 Mar 2022 11:50:53 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E9=83=91=E5=AE=B6=E5=8A=A8=E6=80=81/?= =?UTF-8?q?=E6=8A=95=E8=AF=89=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/retrofit/retrofit_api.dart | 10 +++-- lib/retrofit/retrofit_api.g.dart | 64 +++++++++++++++++++---------- lib/setting/help_feedback_page.dart | 17 +++++--- 3 files changed, 62 insertions(+), 29 deletions(-) diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index a6e88c81..130c0cc8 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -380,9 +380,9 @@ abstract class ApiService { @Path("shipperCode") String shipperCode, @Path("logisticCode") String logisticCode); - ///反馈 - @POST("/other/report") - Future> report(@Body() Map map); + // ///反馈 + // @POST("/other/report") + // Future> report(@Body() Map map); ///取消订单 @GET("/order/cancel/{id}") @@ -512,4 +512,8 @@ abstract class ApiService { @GET("/member/deleteMine") Future deleteMine(); + ///投诉资讯/动态 + @POST("/information/complaint") + Future complaint(@Body() Map param); + } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 78730b7d..71baf8d6 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -1166,27 +1166,27 @@ class _ApiService implements ApiService { return value; } - @override - Future> report(map) async { - ArgumentError.checkNotNull(map, 'map'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(map ?? {}); - final _result = await _dio.request>('/other/report', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as bool, - ); - return value; - } + // @override + // Future> report(map) async { + // ArgumentError.checkNotNull(map, 'map'); + // const _extra = {}; + // final queryParameters = {}; + // final _data = {}; + // _data.addAll(map ?? {}); + // final _result = await _dio.request>('/other/report', + // queryParameters: queryParameters, + // options: RequestOptions( + // method: 'POST', + // headers: {}, + // extra: _extra, + // baseUrl: baseUrl), + // data: _data); + // final value = BaseData.fromJson( + // _result.data, + // (json) => json as bool, + // ); + // return value; + // } @override Future> orderCancel(id) async { @@ -1915,4 +1915,26 @@ class _ApiService implements ApiService { return value; } + @override + Future> complaint(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/information/complaint', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + } diff --git a/lib/setting/help_feedback_page.dart b/lib/setting/help_feedback_page.dart index 57d2d478..62128a1e 100644 --- a/lib/setting/help_feedback_page.dart +++ b/lib/setting/help_feedback_page.dart @@ -166,16 +166,23 @@ class _HelpFeedbackPage extends State { } report() async { - BaseData baseData = await apiService.report({ - "mobile": phoneController.text, - "reportContent": editingController.text, + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = await apiService.complaint({ + "content": phoneController.text, + "informationId":0, }).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("反馈成功"); Navigator.of(context).pop(); } else { - SmartDialog.showToast("反馈成功"); - Navigator.of(context).pop(); + SmartDialog.showToast(baseData.msg,alignment: Alignment.center); } } From 00e4664183bf24bb7ae1019a25291083b8e63412 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 17 Mar 2022 15:41:37 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=B8=BE=E6=8A=A5=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community_view/community_dynamic.dart | 122 +++---- lib/community/report/report_page.dart | 330 +++++++++++++----- 2 files changed, 306 insertions(+), 146 deletions(-) diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 103b526d..9ab21a31 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -410,25 +410,26 @@ class _CommunityDynamic extends State { ], ), ), - // Expanded( - // child: GestureDetector( - // behavior: HitTestBehavior.opaque, - // onTap: () { - // setState(() { - // choiceShowBottomSheet(); - // }); - // }, - // child: Container( - // alignment: Alignment.center, - // child: Text( - // "...", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.medium, - // color: Colors.black, - // ), - // ), - // ))), + if (widget?.article?.author != widget.userId ?? "") + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + choiceShowBottomSheet(); + }); + }, + child: Container( + alignment: Alignment.center, + child: Text( + "...", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.medium, + color: Colors.black, + ), + ), + ))), ], ), ], @@ -772,50 +773,53 @@ class _CommunityDynamic extends State { SizedBox( height: 10, ), - GestureDetector( - onTap: () { - setState(() { - Navigator.of(context).pop(); - share(); - }); - }, - child: Container( - child: Row( - children: [ - SizedBox( - width: 4, - ), - Image.asset( - "assets/image/icon_share.webp", - fit: BoxFit.cover, - width: 25, - height: 25, - color: Color(0xff515151), - ), - SizedBox( - width: 12, - ), - Text( - "分享", - style: TextStyle( - fontSize: 17.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF1A1A1A), - ), - ), - ], - ), - )), - Container( - margin: EdgeInsets.symmetric(vertical: 12), - height: 1.h, - color: Color(0xFFF7F7F7), - ), + // GestureDetector( + // onTap: () { + // setState(() { + // Navigator.of(context).pop(); + // share(); + // }); + // }, + // child: Container( + // child: Row( + // children: [ + // SizedBox( + // width: 4, + // ), + // Image.asset( + // "assets/image/icon_share.webp", + // fit: BoxFit.cover, + // width: 25, + // height: 25, + // color: Color(0xff515151), + // ), + // SizedBox( + // width: 12, + // ), + // Text( + // "分享", + // style: TextStyle( + // fontSize: 17.sp, + // fontWeight: MyFontWeight.medium, + // color: Color(0xFF1A1A1A), + // ), + // ), + // ], + // ), + // )), + // Container( + // margin: EdgeInsets.symmetric(vertical: 12), + // height: 1.h, + // color: Color(0xFFF7F7F7), + // ), GestureDetector( onTap: () { setState(() { Navigator.of(context) - .popAndPushNamed('/router/report_page'); + .popAndPushNamed('/router/report_page',arguments: { + "userName":widget?.article?.authorName ?? "", + "authorId":widget?.article?.author ?? "", + }); }); }, child: Row( diff --git a/lib/community/report/report_page.dart b/lib/community/report/report_page.dart index d857f279..47a6d92b 100644 --- a/lib/community/report/report_page.dart +++ b/lib/community/report/report_page.dart @@ -1,13 +1,16 @@ import 'dart:ui'; +import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:huixiang/generated/l10n.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shared_preferences/shared_preferences.dart'; class ReportPage extends StatefulWidget { final Map arguments; @@ -24,10 +27,37 @@ class _ReportPage extends State { ApiService apiService; int textLength = 0; final TextEditingController editingController = TextEditingController(); + String textContext; + String userName; + String authorId; @override void initState() { super.initState(); + userName = widget.arguments['userName']; + authorId = widget.arguments['authorId']; + } + + report() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = await apiService.complaint({ + "content": editingController.text, + "informationId":authorId, + }).catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + Navigator.of(context) + .pushNamed('/router/report_success'); + editingController.clear(); + } else { + SmartDialog.showToast(baseData.msg,alignment: Alignment.center); + } } @override @@ -67,7 +97,7 @@ class _ReportPage extends State { ), ), TextSpan( - text: "@百花谷", + text: "@${userName.toString()}", style: TextStyle( fontSize: 16.sp, fontWeight: MyFontWeight.medium, @@ -86,41 +116,41 @@ class _ReportPage extends State { ), ), ), - report(), + reportContent(), SizedBox(height: 12), + if(checkIndex == 9) Container( - width: double.infinity, - height: 186.h, - margin: EdgeInsets.only(right: 16,left:40,bottom:100), - decoration: new BoxDecoration( - color: Color(0xFFF7F7F7), - borderRadius: BorderRadius.circular(4.0), - ), - child: Container( - margin: EdgeInsets.fromLTRB(20.w, 5.h, 20.w, 0), - alignment: Alignment.topLeft, - child: TextField( - maxLines: 5, - controller: editingController, - onChanged: (value) { - setState(() { - textLength = value.length; - }); - }, - maxLength: 100, - decoration: InputDecoration( - border: InputBorder.none, - hintText: "请输入举报原因,以便我们更快定位问题,快速处理", - hintStyle: TextStyle( - fontSize: 12.sp, - height: 1.2, - fontWeight: MyFontWeight.regular, - color: Color(0xFF999999), + width: double.infinity, + height: 186.h, + margin: EdgeInsets.only(right: 16, left: 40, bottom: 100), + decoration: new BoxDecoration( + color: Color(0xFFF7F7F7), + borderRadius: BorderRadius.circular(4.0), + ), + child: Container( + margin: EdgeInsets.fromLTRB(20.w, 5.h, 20.w, 0), + alignment: Alignment.topLeft, + child: TextField( + maxLines: 5, + controller: editingController, + onChanged: (value) { + setState(() { + textLength = value.length; + }); + }, + maxLength: 100, + decoration: InputDecoration( + border: InputBorder.none, + hintText: "请输入举报原因,以便我们更快定位问题,快速处理", + hintStyle: TextStyle( + fontSize: 12.sp, + height: 1.2, + fontWeight: MyFontWeight.regular, + color: Color(0xFF999999), + ), ), ), - ), - ) - ) + )) ], ), ), @@ -128,7 +158,7 @@ class _ReportPage extends State { alignment: Alignment.bottomCenter, child: Container( width: double.infinity, - height:95, + height: 95, child: Column( children: [ GestureDetector( @@ -138,7 +168,7 @@ class _ReportPage extends State { }, child: Container( alignment: Alignment.bottomCenter, - margin: EdgeInsets.only(bottom:25), + margin: EdgeInsets.only(bottom: 25), child: Text( "投诉须知", style: TextStyle( @@ -148,15 +178,16 @@ class _ReportPage extends State { ), ), )), - Expanded(child: - GestureDetector( - onTap: (){ - Navigator.of(context) - .pushNamed('/router/report_success'); - }, - child: Container( + Expanded( + child: GestureDetector( + onTap: () { + report(); + }, + child: Opacity( + opacity: checkIndex == 0 ? 0.3 : 0.9, + child: Container( width: double.infinity, - height:double.infinity, + height: double.infinity, color: Color(0xFF319E5F), alignment: Alignment.center, child: Text( @@ -167,7 +198,9 @@ class _ReportPage extends State { color: Color(0xFFFFFFFF), ), ), - ),)) + ), + ), + )) ], ), )) @@ -177,55 +210,178 @@ class _ReportPage extends State { ); } - Widget report() { + Widget reportContent() { return Container( - padding: EdgeInsets.only(left: 16, right: 16), - child: - // (articles == null || articles.length == 0) - // ? NoDataView( - // src: "assets/image/dong_tai.webp", - // isShowBtn: false, - // text: "目前暂无发布动态,要把开心的事讲出来哦~", - // fontSize: 16.sp, - // margin: EdgeInsets.only(left: 60.w, right: 60.w), - // ) : - ListView.builder( - physics: BouncingScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, position) { - return GestureDetector( - onTap: () {}, - child: reportList(), - ); - }, - itemCount: 9, + width: double.infinity, + padding: EdgeInsets.only(left:16, right:16,top:20), + child: Column( + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 1; + }); + }, + child: + content( + "色情低俗", + 1 + ), + ), + SizedBox(height: 18,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 2; + }); + }, + child: + content( + "政治宗教", + 2 + ), + ), + SizedBox(height: 18,), + GestureDetector ( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 3; + }); + }, + child: + content( + "广告骚扰", + 3 + ), + ), + SizedBox(height: 18,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 4; + }); + }, + child: + content( + "虚假欺骗", + 4 + ), + ), + SizedBox(height: 18,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 5; + }); + }, + child: + content( + "侵权(诽谤、抄袭、冒用)", + 5 + ), + ), + SizedBox(height: 18,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 6; + }); + }, + child: + content( + "不良封面/标题", + 6 + ), + ), + SizedBox(height: 18,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 7; + }); + }, + child: + content( + "赌博诈骗", + 7 + ), + ), + SizedBox(height: 18,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 8; + }); + }, + child: + content( + editingController.text = "违禁内容(暴利恐怖、令人不适、宣言仇恨)", + 8 + ), + ), + SizedBox(height: 18,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 9; + }); + }, + child: + content( + "其他", + 9 + ), + ), + ], + )); + } + + var checkIndex = 0; + + Widget checkView(var index) { + return Container( + padding: EdgeInsets.only(right: 16.w,left: 5), + alignment: Alignment.center, + // color: Colors.red, + child: Image.asset( + checkIndex != index + ? "assets/image/icon_radio_unselected.webp" + : "assets/image/icon_radio_selected.webp", + width:20.w, + height:20.h, ), ); } - Widget reportList() { + Widget content(textContext,var index) { return Container( - padding: EdgeInsets.only(top: 18, bottom: 20), - color: Color(0xFFFFFFFF), - child: Row( - children: [ - Image.asset( - "assets/image/icon_radio_unselected.webp", - width: 16, - height: 16, + alignment: Alignment.center, + child:Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + checkView(index), + Container(), + Expanded(child: + Text( + textContext, + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF353535), + fontWeight: MyFontWeight.regular, ), - SizedBox( - width: 8, - ), - Expanded( - child: Text( - "色情低俗", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular), - )) - ], - )); + ),) + ], + ), + ); } } From d75c11de83a053e8d6afc587b3aeb28a1f44fd7f Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 17 Mar 2022 16:58:09 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 2 +- .../community_view/community_dynamic.dart | 40 +++++++++---------- lib/community/report/report_page.dart | 15 ++++--- lib/retrofit/data/coupon.dart | 3 ++ lib/view_widget/new_coupon_widget.dart | 3 +- 5 files changed, 33 insertions(+), 30 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 69a82c20..aa38b250 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -143,7 +143,7 @@ android { ndk { /// 选择要添加的对应.so 库。 - abiFilters 'armeabi-v7a' + abiFilters 'armeabi-v7a','arm64-v8a','x86' } } debug { diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 9ab21a31..fd256b4b 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -410,26 +410,26 @@ class _CommunityDynamic extends State { ], ), ), - if (widget?.article?.author != widget.userId ?? "") - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - choiceShowBottomSheet(); - }); - }, - child: Container( - alignment: Alignment.center, - child: Text( - "...", - style: TextStyle( - fontSize: 18.sp, - fontWeight: MyFontWeight.medium, - color: Colors.black, - ), - ), - ))), + // if (widget?.article?.author != widget.userId ?? "") + // Expanded( + // child: GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: () { + // setState(() { + // choiceShowBottomSheet(); + // }); + // }, + // child: Container( + // alignment: Alignment.center, + // child: Text( + // "...", + // style: TextStyle( + // fontSize: 18.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.black, + // ), + // ), + // ))), ], ), ], diff --git a/lib/community/report/report_page.dart b/lib/community/report/report_page.dart index 47a6d92b..b4527cf9 100644 --- a/lib/community/report/report_page.dart +++ b/lib/community/report/report_page.dart @@ -54,7 +54,6 @@ class _ReportPage extends State { if (baseData != null && baseData.isSuccess) { Navigator.of(context) .pushNamed('/router/report_success'); - editingController.clear(); } else { SmartDialog.showToast(baseData.msg,alignment: Alignment.center); } @@ -225,7 +224,7 @@ class _ReportPage extends State { }, child: content( - "色情低俗", + editingController.text = "色情低俗", 1 ), ), @@ -239,7 +238,7 @@ class _ReportPage extends State { }, child: content( - "政治宗教", + editingController.text = "政治宗教", 2 ), ), @@ -253,7 +252,7 @@ class _ReportPage extends State { }, child: content( - "广告骚扰", + editingController.text = "广告骚扰", 3 ), ), @@ -267,7 +266,7 @@ class _ReportPage extends State { }, child: content( - "虚假欺骗", + editingController.text = "虚假欺骗", 4 ), ), @@ -281,7 +280,7 @@ class _ReportPage extends State { }, child: content( - "侵权(诽谤、抄袭、冒用)", + editingController.text = "侵权(诽谤、抄袭、冒用)", 5 ), ), @@ -295,7 +294,7 @@ class _ReportPage extends State { }, child: content( - "不良封面/标题", + editingController.text ="不良封面/标题", 6 ), ), @@ -309,7 +308,7 @@ class _ReportPage extends State { }, child: content( - "赌博诈骗", + editingController.text = "赌博诈骗", 7 ), ), diff --git a/lib/retrofit/data/coupon.dart b/lib/retrofit/data/coupon.dart index b8aef9eb..8da93e46 100644 --- a/lib/retrofit/data/coupon.dart +++ b/lib/retrofit/data/coupon.dart @@ -21,6 +21,7 @@ class Coupon { String useEndTime; String promotionId; bool centreDisplay; + bool allProduct; String tenantCode; String tenantName; int isDelete; @@ -52,6 +53,7 @@ class Coupon { ..useEndTime = json['useEndTime'] as String ..promotionId = json['promotionId'] as String ..centreDisplay = json['centreDisplay'] as bool + ..allProduct = json['allProduct'] as bool ..tenantCode = json['tenantCode'] as String ..tenantName = json['tenantName'] as String ..isDelete = json['isDelete'] as int @@ -84,6 +86,7 @@ class Coupon { 'useEndTime': this.useEndTime, 'promotionId': this.promotionId, 'centreDisplay': this.centreDisplay, + 'allProduct' : this.allProduct, 'tenantCode': this.tenantCode, 'tenantName': this.tenantName, 'isDelete': this.isDelete, diff --git a/lib/view_widget/new_coupon_widget.dart b/lib/view_widget/new_coupon_widget.dart index afc6e94c..1f16bb3a 100644 --- a/lib/view_widget/new_coupon_widget.dart +++ b/lib/view_widget/new_coupon_widget.dart @@ -120,7 +120,8 @@ class NewCouponWidget extends StatelessWidget { children: [ Visibility( child: Text( - S.of(context).quanchangtongyong, + // S.of(context).quanchangtongyong, + (coupon?.allProduct ?? false) ? S.of(context).quanchangtongyong :"", style: TextStyle( color: Color(0xFF353535), fontSize: 12.sp, From 536a70093024da3d34794fe9204c3296f908bd8c Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 17 Mar 2022 17:15:27 +0800 Subject: [PATCH 6/9] =?UTF-8?q?j=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/report/report_page.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/community/report/report_page.dart b/lib/community/report/report_page.dart index b4527cf9..49b0a300 100644 --- a/lib/community/report/report_page.dart +++ b/lib/community/report/report_page.dart @@ -224,7 +224,7 @@ class _ReportPage extends State { }, child: content( - editingController.text = "色情低俗", + "色情低俗", 1 ), ), @@ -238,7 +238,7 @@ class _ReportPage extends State { }, child: content( - editingController.text = "政治宗教", + "政治宗教", 2 ), ), @@ -252,7 +252,7 @@ class _ReportPage extends State { }, child: content( - editingController.text = "广告骚扰", + "广告骚扰", 3 ), ), @@ -266,7 +266,7 @@ class _ReportPage extends State { }, child: content( - editingController.text = "虚假欺骗", + "虚假欺骗", 4 ), ), @@ -280,7 +280,7 @@ class _ReportPage extends State { }, child: content( - editingController.text = "侵权(诽谤、抄袭、冒用)", + "侵权(诽谤、抄袭、冒用)", 5 ), ), @@ -294,7 +294,7 @@ class _ReportPage extends State { }, child: content( - editingController.text ="不良封面/标题", + "不良封面/标题", 6 ), ), @@ -308,7 +308,7 @@ class _ReportPage extends State { }, child: content( - editingController.text = "赌博诈骗", + "赌博诈骗", 7 ), ), @@ -322,7 +322,7 @@ class _ReportPage extends State { }, child: content( - editingController.text = "违禁内容(暴利恐怖、令人不适、宣言仇恨)", + "违禁内容(暴利恐怖、令人不适、宣言仇恨)", 8 ), ), From 7db39ef7894a24ef7a0f00047fa8695ef668e042 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 18 Mar 2022 10:05:11 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=A4=BE=E7=BE=A4?= =?UTF-8?q?=E6=8A=AC=E5=A4=B4,=E4=B8=BE=E6=8A=A5,=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=87=80=E5=BC=BC=E5=95=86=E5=9F=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_page.dart | 18 +- .../community_view/community_dynamic.dart | 41 +-- lib/community/report/report_page.dart | 283 +++++++----------- lib/generated/intl/messages_en.dart | 2 +- lib/generated/intl/messages_zh_CN.dart | 2 +- lib/generated/intl/messages_zh_Hans_CN.dart | 2 +- lib/generated/intl/messages_zh_Hant_CN.dart | 2 +- lib/generated/intl/messages_zh_TW.dart | 2 +- lib/generated/l10n.dart | 4 +- lib/l10n/intl_en.arb | 2 +- lib/l10n/intl_zh_CN.arb | 2 +- lib/l10n/intl_zh_Hans_CN.arb | 2 +- lib/l10n/intl_zh_Hant_CN.arb | 2 +- lib/l10n/intl_zh_TW.arb | 2 +- lib/message/system_details.dart | 10 +- 15 files changed, 149 insertions(+), 227 deletions(-) diff --git a/lib/community/community_page.dart b/lib/community/community_page.dart index 61ea508c..421c89d0 100644 --- a/lib/community/community_page.dart +++ b/lib/community/community_page.dart @@ -24,10 +24,10 @@ class _CommunityPage extends State List lables = [ "关注", - "推荐", - "头条", - "课程", - "关于我们", + "分享健康", + "了解健康", + "学习健康", + "关于回乡", // "直播", ]; @@ -94,16 +94,16 @@ class _CommunityPage extends State child: TabBarView( physics: BouncingScrollPhysics(), children: lables.map((e) { - if (e == "关于我们") { + if (e == "关于回乡") { return BrandPage(); - }else if(e == "头条"){ + }else if(e == "了解健康"){ return ArticlePage(); - }else if(e == "课程"){ + }else if(e == "学习健康"){ return CommunityCourse(); } - else if(e == "推荐"){ + else if(e == "分享健康"){ if (tuijian == null){ - tuijian = CommunityChildPage("推荐"); + tuijian = CommunityChildPage("分享健康"); } return tuijian; }else if(e == "关注"){ diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index fd256b4b..7e081cec 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -410,26 +410,27 @@ class _CommunityDynamic extends State { ], ), ), - // if (widget?.article?.author != widget.userId ?? "") - // Expanded( - // child: GestureDetector( - // behavior: HitTestBehavior.opaque, - // onTap: () { - // setState(() { - // choiceShowBottomSheet(); - // }); - // }, - // child: Container( - // alignment: Alignment.center, - // child: Text( - // "...", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.medium, - // color: Colors.black, - // ), - // ), - // ))), + if (widget?.article?.author != widget.userId ?? "") + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + choiceShowBottomSheet(); + }); + }, + child: Container( + padding: EdgeInsets.only(top:3), + alignment: Alignment.center, + child: Text( + "...", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.medium, + color: Colors.black, + ), + ), + ))), ], ), ], diff --git a/lib/community/report/report_page.dart b/lib/community/report/report_page.dart index 49b0a300..0b10e0d9 100644 --- a/lib/community/report/report_page.dart +++ b/lib/community/report/report_page.dart @@ -27,7 +27,7 @@ class _ReportPage extends State { ApiService apiService; int textLength = 0; final TextEditingController editingController = TextEditingController(); - String textContext; + String textCon; String userName; String authorId; @@ -48,14 +48,13 @@ class _ReportPage extends State { ); } BaseData baseData = await apiService.complaint({ - "content": editingController.text, - "informationId":authorId, + "content": checkIndex == 9 ? editingController.text : textCon, + "informationId": authorId, }).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { - Navigator.of(context) - .pushNamed('/router/report_success'); + Navigator.of(context).popAndPushNamed('/router/report_success'); } else { - SmartDialog.showToast(baseData.msg,alignment: Alignment.center); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -117,39 +116,40 @@ class _ReportPage extends State { ), reportContent(), SizedBox(height: 12), - if(checkIndex == 9) - Container( - width: double.infinity, - height: 186.h, - margin: EdgeInsets.only(right: 16, left: 40, bottom: 100), - decoration: new BoxDecoration( - color: Color(0xFFF7F7F7), - borderRadius: BorderRadius.circular(4.0), - ), - child: Container( - margin: EdgeInsets.fromLTRB(20.w, 5.h, 20.w, 0), - alignment: Alignment.topLeft, - child: TextField( - maxLines: 5, - controller: editingController, - onChanged: (value) { - setState(() { - textLength = value.length; - }); - }, - maxLength: 100, - decoration: InputDecoration( - border: InputBorder.none, - hintText: "请输入举报原因,以便我们更快定位问题,快速处理", - hintStyle: TextStyle( - fontSize: 12.sp, - height: 1.2, - fontWeight: MyFontWeight.regular, - color: Color(0xFF999999), + if (checkIndex == 9) + Container( + width: double.infinity, + height: 186.h, + margin: + EdgeInsets.only(right: 16, left: 40, bottom: 100), + decoration: new BoxDecoration( + color: Color(0xFFF7F7F7), + borderRadius: BorderRadius.circular(4.0), + ), + child: Container( + margin: EdgeInsets.fromLTRB(20.w, 5.h, 20.w, 0), + alignment: Alignment.topLeft, + child: TextField( + maxLines: 5, + controller: editingController, + onChanged: (value) { + setState(() { + textLength = value.length; + }); + }, + maxLength: 100, + decoration: InputDecoration( + border: InputBorder.none, + hintText: "请输入举报原因,以便我们更快定位问题,快速处理", + hintStyle: TextStyle( + fontSize: 12.sp, + height: 1.2, + fontWeight: MyFontWeight.regular, + color: Color(0xFF999999), + ), ), ), - ), - )) + )) ], ), ), @@ -180,7 +180,11 @@ class _ReportPage extends State { Expanded( child: GestureDetector( onTap: () { - report(); + if(checkIndex == 9 && editingController.text == ""){ + SmartDialog.showToast("请输入举报原因", alignment: Alignment.center); + return; + } + report(); }, child: Opacity( opacity: checkIndex == 0 ? 0.3 : 0.9, @@ -211,135 +215,43 @@ class _ReportPage extends State { Widget reportContent() { return Container( - width: double.infinity, - padding: EdgeInsets.only(left:16, right:16,top:20), + width: double.infinity, + padding: EdgeInsets.only(left: 16, right: 16, top: 20), child: Column( children: [ - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - checkIndex = 1; - }); - }, - child: - content( - "色情低俗", - 1 - ), + content("色情低俗", 1), + SizedBox( + height: 18, ), - SizedBox(height: 18,), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - checkIndex = 2; - }); - }, - child: - content( - "政治宗教", - 2 - ), + content("政治宗教", 2), + SizedBox( + height: 18, ), - SizedBox(height: 18,), - GestureDetector ( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - checkIndex = 3; - }); - }, - child: - content( - "广告骚扰", - 3 - ), + content("广告骚扰", 3), + SizedBox( + height: 18, ), - SizedBox(height: 18,), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - checkIndex = 4; - }); - }, - child: - content( - "虚假欺骗", - 4 - ), + content("虚假欺骗", 4), + SizedBox( + height: 18, ), - SizedBox(height: 18,), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - checkIndex = 5; - }); - }, - child: - content( - "侵权(诽谤、抄袭、冒用)", - 5 - ), + content("侵权(诽谤、抄袭、冒用)", 5), + SizedBox( + height: 18, ), - SizedBox(height: 18,), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - checkIndex = 6; - }); - }, - child: - content( - "不良封面/标题", - 6 - ), - ), - SizedBox(height: 18,), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - checkIndex = 7; - }); - }, - child: - content( - "赌博诈骗", - 7 - ), + content("不良封面/标题", 6), + SizedBox( + height: 18, ), - SizedBox(height: 18,), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - checkIndex = 8; - }); - }, - child: - content( - "违禁内容(暴利恐怖、令人不适、宣言仇恨)", - 8 - ), + content("赌博诈骗", 7), + SizedBox( + height: 18, ), - SizedBox(height: 18,), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - checkIndex = 9; - }); - }, - child: - content( - "其他", - 9 - ), + content("违禁内容(暴利恐怖、令人不适、宣言仇恨)", 8), + SizedBox( + height: 18, ), + content("其他", 9), ], )); } @@ -348,39 +260,48 @@ class _ReportPage extends State { Widget checkView(var index) { return Container( - padding: EdgeInsets.only(right: 16.w,left: 5), + padding: EdgeInsets.only(right: 16.w, left: 5), alignment: Alignment.center, // color: Colors.red, child: Image.asset( checkIndex != index ? "assets/image/icon_radio_unselected.webp" : "assets/image/icon_radio_selected.webp", - width:20.w, - height:20.h, + width: 20.w, + height: 20.h, ), ); } - Widget content(textContext,var index) { - return Container( - alignment: Alignment.center, - child:Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - checkView(index), - Container(), - Expanded(child: - Text( - textContext, - style: TextStyle( - fontSize: 16.sp, - color: Color(0xFF353535), - fontWeight: MyFontWeight.regular, - ), - ),) - ], - ), - ); + Widget content(textContext, var index) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = index; + textCon = textContext; + }); + }, + child: Container( + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + checkView(index), + Container(), + Expanded( + child: Text( + textContext, + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF353535), + fontWeight: MyFontWeight.regular, + ), + ), + ) + ], + ), + )); } } diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 56650179..1a4a0838 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -290,7 +290,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"), - "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"), + "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("净弼积分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index e1d59ac9..2d94046a 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -288,7 +288,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"), - "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"), + "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("净弼积分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 63b3f40c..c441640b 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -288,7 +288,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"), - "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"), + "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("净弼积分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index c5161822..9306dfd3 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -288,7 +288,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("積分的計算説明"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("積分從低到高"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("積分從高到低"), - "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("積分商城"), + "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("淨弼積分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("積分詳情"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("淨弼聯盟會員店"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 2d174d30..026f8527 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -288,7 +288,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("積分的計算説明"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("積分從低到高"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("積分從高到低"), - "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("積分商城"), + "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("淨弼積分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("積分詳情"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("淨弼聯盟會員店"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 5976a619..c869c31d 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -225,10 +225,10 @@ class S { ); } - /// `积分商城` + /// `净弼积分商城` String get jifenshangcheng { return Intl.message( - '积分商城', + '净弼积分商城', name: 'jifenshangcheng', desc: '', args: [], diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 32b382df..96ed8aa6 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -18,7 +18,7 @@ "main_menu4": "我的", "shouye": "首页", "huodongliebiao": "活动列表", - "jifenshangcheng": "积分商城", + "jifenshangcheng": "净弼积分商城", "jinrihuiyuanrenwu": "今日会员任务", "renwuzhongxin": "任务中心", "qiandaolingqujinfen": "签到领取积分", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 0151ed71..71f61742 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -18,7 +18,7 @@ "main_menu4": "我的", "shouye": "首页", "huodongliebiao": "活动列表", - "jifenshangcheng": "积分商城", + "jifenshangcheng": "净弼积分商城", "jinrihuiyuanrenwu": "今日会员任务", "renwuzhongxin": "任务中心", "qiandaolingqujinfen": "签到领取积分", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 17bdfa3e..918ed547 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -18,7 +18,7 @@ "main_menu4": "我的", "shouye": "首页", "huodongliebiao": "活动列表", - "jifenshangcheng": "积分商城", + "jifenshangcheng": "净弼积分商城", "jinrihuiyuanrenwu": "今日会员任务", "renwuzhongxin": "任务中心", "qiandaolingqujinfen": "签到领取积分", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 4df95fbc..b1b3bfab 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -18,7 +18,7 @@ "main_menu4": "我的", "shouye": "首頁", "huodongliebiao": "活動列表", - "jifenshangcheng": "積分商城", + "jifenshangcheng": "淨弼積分商城", "jinrihuiyuanrenwu": "今日會員任務", "renwuzhongxin": "任務中心", "qiandaolingqujinfen": "簽到領取積分", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index cbcc9430..30c97cdb 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -18,7 +18,7 @@ "main_menu4": "我的", "shouye": "首頁", "huodongliebiao": "活動列表", - "jifenshangcheng": "積分商城", + "jifenshangcheng": "淨弼積分商城", "jinrihuiyuanrenwu": "今日會員任務", "renwuzhongxin": "任務中心", "qiandaolingqujinfen": "簽到領取積分", diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index c3593d90..c6c2a634 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -198,7 +198,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( - src: "assets/image/icon_empty.png", + src: "assets/image/icon_empty.webp", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -323,7 +323,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( - src:"assets/image/icon_empty.png", + src:"assets/image/icon_empty.webp", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -459,7 +459,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( - src:"assets/image/icon_empty.png", + src:"assets/image/icon_empty.webp", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -606,7 +606,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( - src:"assets/image/icon_empty.png", + src:"assets/image/icon_empty.webp", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -850,7 +850,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( - src:"assets/image/icon_empty.png", + src:"assets/image/icon_empty.webp", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, From a598480dbfa9409559b8c87dbf28e7a3f4eb8bce Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Mon, 21 Mar 2022 22:17:33 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/recharge.png | Bin 0 -> 646 bytes assets/image/3x/recharge.png | Bin 0 -> 1127 bytes assets/image/recharge.png | Bin 0 -> 316 bytes lib/mine/recharge_page.dart | 625 +++++++++++++++++++++-------------- 4 files changed, 376 insertions(+), 249 deletions(-) create mode 100644 assets/image/2x/recharge.png create mode 100644 assets/image/3x/recharge.png create mode 100644 assets/image/recharge.png diff --git a/assets/image/2x/recharge.png b/assets/image/2x/recharge.png new file mode 100644 index 0000000000000000000000000000000000000000..a353e7631a378789eb08e6a41c26a7314dd5069c GIT binary patch literal 646 zcmV;10(t$3P)Px%KuJVFR9HvN*k4G~Q53-O@5*wnH8tH*VF-pVkwp>IOF~o&!iON}Rq-K$@Szf` zCq<%%D5CBd&hj_>Cr(Tf4vg?r*#I{oeE8 zo_h}5<3i)LE!xuQ($#0;5Oiq?OySJS(+;>4rycNLoL0beIBkHLa9RNWhbuTR8?K;0 z8C=1Dvbcf(t>E$ww2I3sFc)0jfVtxG0n}@4ieg3%a9vBNukJ;aTP8=Ga4eM;~OJyhsCOaAve)TMyB?xrx5`6MA0VSp@8< z-OkxvM<`lRM9)Z!*!zL3IO!^u#hC}z`l`6G{}g^t*`E~N=3spzXLdFxQ`!CO7LR70 zOW~w|R&c4P!L3F9ZHhr$ef9F@jp1?GZFMXz2{K{(Vw&==ra zVxALEFZ24-q$M2iHRBt!gG(v=C1spzJj%t97!z|Jtm4ekTRbgL15cT(Zq*fHPaktbhRn g5gBWV#+TO1Z%FI;4-+3-w*UYD07*qoM6N<$f(yznGXMYp literal 0 HcmV?d00001 diff --git a/assets/image/3x/recharge.png b/assets/image/3x/recharge.png new file mode 100644 index 0000000000000000000000000000000000000000..0f3c3f3c508e4690d6f14c57771816a4b8fc16b0 GIT binary patch literal 1127 zcmV-t1ep7YP)Px(AxT6*RA@ux*?njecO1v@&-c!xF|o1MXKRgPPB-xZN6JdojaB?-;0FFNb+8Nt z#rcQKhazrLt79?|MNtq0H=PgYlsXuU&c8aatFDbYR$K8QmfC8yRcu;qn>P0w_rr{I zCiaqh$lW!674CZcUirTJ>n|-~h`i?f^ts2$93?aqyfSuJR4f5u^N;}hkFP3|n6w#y z$JXFj#uAgZ$4a&>I6h-}vbG1uXB@vz*>1v#GPW%^S;n>nC(GD&;K4Gs66GBzbx&x}n6);nXY&ba6 z85;^VL&k=J&5*GnU?VbiJ6xDKdMf&*C~mahL!ZKF8?kyBI9xHQCKtg6MX#E zLcHkf!MclkQ2(ScGhn?l9+~CA*M(o;!zu4V6hu7h?ZTRh?{W88i?LuMG9EpABua}` zVZr1%9QU+4j03@+@mr`G5|fMr>zy%yFg-UP8w*yzKjCc-d(hR6{k3ON*>n|A1z7oe zH2WFWJL4(d@!0kLTFl7xK_Eh7$3yI>I*NbVLSSHnPBwOfYH+$4%MX;+@p?=eF^1oFuj2u}{qq?9etcUoR1>h8jOAVSEB`XML?=!)Ttu+-<|~UA zNkCEFY-}p{4Ef%1e3I85-NL?_GiXq-BPV({R83e-#sw4K!QsUve8SD0kMUjgas2hL ze!v>%=gr2pqLmoy9tD7*x}^@gube=0XIsjXRW;#sGmc+nuFH#^3s&R3Ni!j5+Z29; z(o08B*A{|99EK0_=ke=K(E*7u)U-BWXVnjAef}hEY+9R^nvDOyQlEDMHWVz!!pU>_ zC3(^ZgXb~Uox=|m-YgG4JynD*uPeWz2u^QkOu&y4q0wDU_8-1Hd-Rm}4Q(rZ=-X zkDmMVT=c(#hYd59|Mbx$2x93QuJGv?mV<4UF$3W~5&Z(-bTH(rku#3p(a7o<6CunP tnn5IgpuRxNQJu{qEtM;e^(5N5{{<-~8byvY+Mxgd002ovPDHLkV1g-?9t;2g literal 0 HcmV?d00001 diff --git a/assets/image/recharge.png b/assets/image/recharge.png new file mode 100644 index 0000000000000000000000000000000000000000..15ead2f5971cca2209f12eac00fb519477fe8a29 GIT binary patch literal 316 zcmV-C0mJ@@P)Px#_DMuRR5(v#WS}B2T9{DJNG^?0a~I!Aw#cY}mUWpD+q56axu)(_B&;?6Qi3(-^+|{*I;O`~L}U zAR)tuDL4QBXIKX|kSc~T{D1$C@xKKl<%a$L^#4EOo_|dLDlf(_x&;8ni*@ { }); weChatResponseEventHandler.listen((event) async { print("payCallback: ${event.errCode}"); - if(event.errCode == 0){ + if (event.errCode == 0) { Navigator.of(context).pop(); SmartDialog.showToast("充值成功", alignment: Alignment.center); } @@ -59,19 +59,20 @@ class _RechargePage extends State { }); } - ///会员权益列表 queryBenefitList() async { - BaseData> baseData = await apiService.benefitList().catchError((onError) {}); + BaseData> baseData = + await apiService.benefitList().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { vipBenefitList.clear(); vipBenefitList.addAll(baseData.data); vipBenefitList.forEach((element) { - if(element.have && element.config != null && element.code == "RECHARGE"){ + if (element.have && + element.config != null && + element.code == "RECHARGE") { discount = double.parse(element.config); } - }); }); } @@ -81,7 +82,7 @@ class _RechargePage extends State { ///会员权益介绍/规则/说明/储值说明 queryRuleDetails() async { BaseData baseData = - await apiService.vipBenefit().catchError((onError) {}); + await apiService.vipBenefit().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { vipRuleDetails = baseData.data; @@ -100,266 +101,392 @@ class _RechargePage extends State { background: Color(0xFFFFFFFF), leadingColor: Colors.black, ), - body:Stack( - children: [ - SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - child: Column( - children: [ - Container( - child: Column(children: [ - ItemInputWidget( - S.of(context).qingshuruchongzhijine, - hintText: "", - controller: controller, - padding: EdgeInsets.all(20), - errorText: S.of(context).chongzhizuixiaojine(100), - titleColor: Color(0xFF727272), - errorTextColor: Color(0xFF32A060), - radius: 8, - discount: discount/10, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 27.sp, - color: color, - ), - inputLimit: 6, - textInputType: TextInputType.number, - textInputFormatter: FilteringTextInputFormatter.digitsOnly, - onChanged: (value) { - if (value != null && - value != "" && - double.tryParse(value) < 100) { - color = Colors.red; - } else { - color = Colors.black; - } - setState(() {}); - }, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - if (vipRuleDetails?.recharge != null && - vipRuleDetails.recharge != "") - Expanded(child:Container( - color: Colors.white, - padding: EdgeInsets.only(left: 8), - child: Html( - data: "注意:${vipRuleDetails?.recharge??""}", - customImageRenders: { - networkSourceMatcher(): networkImageRender( - loadingWidget: () { - return Container(); - }, - ), - }, - ), - ),) - ], - ), - ],), - ), - Container( - width: double.infinity, - margin: EdgeInsets.only( - left: 0.w, - right: 0.w, - top: 16.h, - bottom: 4.h, - ), - padding: EdgeInsets.only( - left: 20.w, - right: 16.w, - top: 20.h, - bottom: 20.h, - ), - decoration: BoxDecoration( - color: Colors.white, - // borderRadius: BorderRadius.circular(4), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + body: Container( + color: Color(0xFFFFFFFF), + child: Stack( + children: [ + SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 16, right: 16), + child: Column( + children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ + // ItemInputWidget( + // S.of(context).qingshuruchongzhijine, + // hintText: "", + // controller: controller, + // padding: EdgeInsets.all(20), + // errorText: S.of(context).chongzhizuixiaojine(100), + // titleColor: Color(0xFF727272), + // errorTextColor: Color(0xFF32A060), + // radius: 8, + // discount: discount / 10, + // style: TextStyle( + // fontWeight: FontWeight.bold, + // fontSize: 27.sp, + // color: color, + // ), + // inputLimit: 6, + // textInputType: TextInputType.number, + // textInputFormatter: + // FilteringTextInputFormatter.digitsOnly, + // onChanged: (value) { + // if (value != null && + // value != "" && + // double.tryParse(value) < 100) { + // color = Colors.red; + // } else { + // color = Colors.black; + // } + // setState(() {}); + // }, + // ), Padding( - padding: EdgeInsets.only(bottom: 16.h), + padding: EdgeInsets.only(top: 26, bottom: 28), child: Text( - S.of(context).zhifufangshi, + S.of(context).chongzhi, style: TextStyle( - fontSize: 16.sp, - color: Colors.black, - fontWeight: FontWeight.bold, - ), + fontSize: 28.sp, + color: Color(0xFF181818), + fontWeight: MyFontWeight.semi_bold), ), ), - GestureDetector( - onTap: () { - setState(() { - checkIndex = 1; - }); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset("assets/image/icon_we_chat.webp"), + Row( + children: [ + Expanded( + child: Text( + S.of(context).zhanghuyue, + style: TextStyle( + fontSize: 15.sp, + color: Color(0xFF181818), + fontWeight: MyFontWeight.semi_bold), + )), + Text.rich( + TextSpan(children: [ + TextSpan( + text: "0.00", + style: TextStyle( + fontSize: 26.sp, + color: Color(0xFF181818), + fontWeight: MyFontWeight.semi_bold), + ), + TextSpan( + text: "元", + style: TextStyle( + fontSize: 15.sp, + color: Color(0xFF181818), + fontWeight: MyFontWeight.semi_bold), + ), + ]), + ), + ], + ), + SizedBox(height: 28), + rechargeList(), + SizedBox(height:22), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + if (vipRuleDetails?.recharge != null && + vipRuleDetails.recharge != "") Expanded( - flex: 1, - child: Padding( - padding: EdgeInsets.only(left: 8.w), - child: Text( - S.of(context).weixinzhifu, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xff353535), - ), + child: Container( + color: Colors.white, + child: Html( + data: "注意:${vipRuleDetails?.recharge ?? ""}", + style:{ + "html":Style( + color: Color(0xFF000000), + fontWeight: MyFontWeight.medium, + ) + }, + customImageRenders: { + networkSourceMatcher(): networkImageRender( + loadingWidget: () { + return Container(); + }, + ), + }, ), ), - ), - checkView(1), - ], - ), - ), - ], - ), - ), - // InkWell( - // onTap: () { - // recharge(); - // }, - // child: Container( - // // margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 26.h), - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // RoundButton( - // width: double.infinity, - // height: 46.h, - // text: S.of(context).querenchongzhi, - // textColor: Colors.white, - // fontSize: 14.sp, - // backgroup: Color(0xff32A060), - // fontWeight: FontWeight.bold, - // ), - // ], - // ), - // ), - // ), - ], - ), - ), - ), - Align(alignment: Alignment.bottomCenter,child: - Container( - height: 56.h, - color: Colors.white, - child: Row( - children: [ - Expanded(child:Container( - padding:EdgeInsets.only(top: 7.h,left:16), - child:Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text( - S.of(context).heji, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, - ), - ), - Text( - controller.text, - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), - ), + ) + ], ), ], ), - if(controller.text != "") - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "充值", - style: TextStyle( - fontSize:12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFADADAD), - ), - ), - TextSpan( - text:"¥${controller.text}", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color:Color(0xff3541C9), - ), - ), - TextSpan( - text: "赠送", + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 16.h, + bottom: 4.h, + ), + padding: EdgeInsets.only( + top: 20.h, + bottom: 20.h, + ), + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.circular(4), + // ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 16.h), + child: Text( + S.of(context).zhifufangshi, style: TextStyle( - fontSize:12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFADADAD), + fontSize: 16.sp, + color: Colors.black, + fontWeight: FontWeight.bold, ), ), - TextSpan( - text:"¥${((double.tryParse(controller.text)??0) - ((double.tryParse(controller.text)??0) * (discount/100))).toStringAsFixed(2)}", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xff3541C9), - ), - ),TextSpan( - text: "元", - style: TextStyle( - fontSize:12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFADADAD), - ), + ), + GestureDetector( + onTap: () { + setState(() { + checkIndex = 1; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset("assets/image/icon_we_chat.webp"), + Expanded( + flex: 1, + child: Padding( + padding: EdgeInsets.only(left: 8.w), + child: Text( + S.of(context).weixinzhifu, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff353535), + ), + ), + ), + ), + checkView(1), + ], ), - ], - ), + ), + ], ), + ), ], - )) ), - GestureDetector( - onTap: () { - recharge(); - }, - child: RoundButton( - width: 103.w, - height: 54.h, - text: S.of(context).chongzhi, - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFF32A060), - radius: 0, - fontSize: 16.sp, - padding: EdgeInsets.symmetric(vertical: 5.h), + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: GestureDetector( + onTap: (){ + recharge(); + }, + child: Container( + height: 56.h, + width: double.infinity, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(27), + ), + margin: EdgeInsets.only(left: 16,right: 16,bottom: 21), + child: Text( + S.of(context).querenchongzhi, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), ), ), - ], - ), - )) - ], - ), + ), + // Container( + // height: 56.h, + // color: Colors.white, + // child: Row( + // children: [ + // Expanded(child:Container( + // padding:EdgeInsets.only(top: 7.h,left:16), + // child:Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Row( + // children: [ + // Text( + // S.of(context).heji, + // style: TextStyle( + // fontSize: 14.sp, + // fontWeight: MyFontWeight.regular, + // color: Colors.black, + // ), + // ), + // Text( + // controller.text, + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.medium, + // color: Color(0xFF32A060), + // ), + // ), + // ], + // ), + // if(controller.text != "") + // Text.rich( + // TextSpan( + // children: [ + // TextSpan( + // text: "充值", + // style: TextStyle( + // fontSize:12.sp, + // fontWeight: MyFontWeight.regular, + // color: Color(0xFFADADAD), + // ), + // ), + // TextSpan( + // text:"¥${controller.text}", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // color:Color(0xff3541C9), + // ), + // ), + // TextSpan( + // text: "赠送", + // style: TextStyle( + // fontSize:12.sp, + // fontWeight: MyFontWeight.regular, + // color: Color(0xFFADADAD), + // ), + // ), + // TextSpan( + // text:"¥${((double.tryParse(controller.text)??0) - ((double.tryParse(controller.text)??0) * (discount/100))).toStringAsFixed(2)}", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // color: Color(0xff3541C9), + // ), + // ),TextSpan( + // text: "元", + // style: TextStyle( + // fontSize:12.sp, + // fontWeight: MyFontWeight.regular, + // color: Color(0xFFADADAD), + // ), + // ), + // ], + // ), + // ), + // ], + // )) + // ), + // GestureDetector( + // onTap: () { + // recharge(); + // }, + // child: RoundButton( + // width: 103.w, + // height: 54.h, + // text: S.of(context).chongzhi, + // textColor: Colors.white, + // fontWeight: MyFontWeight.regular, + // backgroup: Color(0xFF32A060), + // radius: 0, + // fontSize: 16.sp, + // padding: EdgeInsets.symmetric(vertical: 5.h), + // ), + // ), + // ], + // ), + // ) + ) + ], + ), + ), ); } var checkIndex = 1; + Widget rechargeList() { + return GridView.builder( + itemCount: 6, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount: 3, + //水平子Widget之间间距 + crossAxisSpacing:11, + //垂直子Widget之间间距 + mainAxisSpacing: 0, + childAspectRatio: 1.5, + ), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () {}, + child: rechargeItem(), + ); + }, + ); + } + + Widget rechargeItem() { + return Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + alignment: Alignment.center, + height: 69.h, + decoration: BoxDecoration( + color: Color(0xFFFAFAFA), + // color: Color(0x2432A060), + borderRadius: BorderRadius.circular(4), + ), + // margin: EdgeInsets.only(right: 11,bottom: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "100元", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF868686), + fontWeight: MyFontWeight.medium, + fontSize: 21.sp, + ), + ), + SizedBox(height:2,), + Text( + "实际到账:120元", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF868686), + fontWeight: MyFontWeight.regular, + fontSize:12.sp, + ), + ), + ], + ), + ), + Image.asset( + "assets/image/recharge.png", + width: 20, + height:20, + ), + ], + ); + } + Widget checkView(var index) { return Container( padding: EdgeInsets.only(right: 16.w), @@ -389,16 +516,17 @@ class _RechargePage extends State { return; } - if(Platform.isAndroid){ - if (!(await Min.isInitialize())) { - // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, - // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, - // 故而在此初始化一下 - await Min.initialize(); - }} + if (Platform.isAndroid) { + if (!(await Min.isInitialize())) { + // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // 故而在此初始化一下 + await Min.initialize(); + } + } - BaseData baseData = - await apiService.recharge({"amount": amount, "rechargeType": 2}).catchError((error) {}); + BaseData baseData = await apiService.recharge( + {"amount": amount, "rechargeType": 2}).catchError((error) {}); if (baseData != null && baseData.isSuccess) { WxPay wxPay = WxPay.fromJson(baseData.data); await registerWxApi( @@ -415,8 +543,7 @@ class _RechargePage extends State { timeStamp: int.tryParse(wxPay.timeStamp), sign: wxPay.sign, ); - } - else{ + } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } From be9c1e8ce25259016fcbc0955d6dc9413907d46f Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 23 Mar 2022 16:13:25 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=9B=B4=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/message/system_details.dart | 6 +- lib/mine/mine_view/wallet_coupon_view.dart | 54 +------ lib/mine/recharge_page.dart | 159 +++++++++++++-------- lib/retrofit/data/recharge_list.dart | 78 ++++++++++ lib/retrofit/retrofit_api.dart | 9 +- lib/retrofit/retrofit_api.g.dart | 23 ++- lib/utils/flutter_utils.dart | 14 ++ 7 files changed, 223 insertions(+), 120 deletions(-) create mode 100644 lib/retrofit/data/recharge_list.dart diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index c6c2a634..0a14b538 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -365,10 +365,10 @@ class _SystemDetails extends State { children: [ Image.asset( (message.typed == 1) - ? "assets/image/icon_system_message.png" + ? "assets/image/icon_system_message.webp" : (message.typed == 2) - ? "assets/image/icon_system_message.png" - : "assets/image/c_z.png", + ? "assets/image/icon_system_message.webp" + : "assets/image/c_z.webp", width: 24.w, height: 24.h, ), diff --git a/lib/mine/mine_view/wallet_coupon_view.dart b/lib/mine/mine_view/wallet_coupon_view.dart index 5a76028e..70763885 100644 --- a/lib/mine/mine_view/wallet_coupon_view.dart +++ b/lib/mine/mine_view/wallet_coupon_view.dart @@ -31,59 +31,7 @@ class _WalletCoupon extends State { ), ], ), - child: (Theme.of(context).platform == TargetPlatform.android) - ? GestureDetector( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context).pushNamed('/router/roll_center_page'); - }); - }, - child: Row( - children: [ - Image.asset( - "assets/image/icon_mine_invoice_assistant.webp", - width: 48.h, - height: 48.h, - ), - SizedBox( - width: 12.w, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - S.of(context).lingquanzhongxin, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - height: 3, - ), - Text( - "联盟下单享不停、海量优惠券等你来领!", - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 12.sp, - color: Color(0xFF7B7B7B), - ), - ), - ], - ), - ) - ], - )) - : Row( + child: Row( children: [ Expanded( flex: 1, diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 166f7edf..1aa782a8 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -9,10 +9,13 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:fluwx/fluwx.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/recharge_list.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/vip_benefit_list.dart'; import 'package:huixiang/retrofit/data/vip_rule_details.dart'; import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/item_input_widget.dart'; @@ -35,6 +38,10 @@ class _RechargePage extends State { List vipBenefitList = []; Color color = Colors.black; double discount = 100; + List rechargeA; + int selectIndex = 0; + UserInfo userInfo; + dynamic mBalance; @override void initState() { @@ -45,11 +52,13 @@ class _RechargePage extends State { context: context, token: value.getString("token"), pay: true); queryBenefitList(); queryRuleDetails(); + queryRechargeList(); + queryUserBalance(); }); weChatResponseEventHandler.listen((event) async { print("payCallback: ${event.errCode}"); if (event.errCode == 0) { - Navigator.of(context).pop(); + queryUserBalance(); SmartDialog.showToast("充值成功", alignment: Alignment.center); } // else{ @@ -79,6 +88,16 @@ class _RechargePage extends State { EasyLoading.dismiss(); } + queryUserBalance() async { + BaseData baseData = + await apiService.queryInfo().catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + userInfo = baseData.data; + mBalance = double.tryParse(userInfo?.money ?? "0"); + if (mounted) setState(() {}); + } + } + ///会员权益介绍/规则/说明/储值说明 queryRuleDetails() async { BaseData baseData = @@ -91,6 +110,25 @@ class _RechargePage extends State { EasyLoading.dismiss(); } + ///充值列表 + queryRechargeList() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData> baseData = await apiService.rechargeAct().catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + setState(() { + rechargeA = baseData.data; + }); + } + EasyLoading.dismiss(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -168,7 +206,7 @@ class _RechargePage extends State { Text.rich( TextSpan(children: [ TextSpan( - text: "0.00", + text: "$mBalance", style: TextStyle( fontSize: 26.sp, color: Color(0xFF181818), @@ -199,12 +237,6 @@ class _RechargePage extends State { color: Colors.white, child: Html( data: "注意:${vipRuleDetails?.recharge ?? ""}", - style:{ - "html":Style( - color: Color(0xFF000000), - fontWeight: MyFontWeight.medium, - ) - }, customImageRenders: { networkSourceMatcher(): networkImageRender( loadingWidget: () { @@ -418,7 +450,7 @@ class _RechargePage extends State { Widget rechargeList() { return GridView.builder( - itemCount: 6, + itemCount: rechargeA == null ? 0 : rechargeA.length, shrinkWrap: true, physics: BouncingScrollPhysics(), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( @@ -432,59 +464,64 @@ class _RechargePage extends State { ), itemBuilder: (context, index) { return GestureDetector( - onTap: () {}, - child: rechargeItem(), + onTap: () { + setState(() { + selectIndex = index; + }); + }, + child: rechargeItem(rechargeA[index],index), ); }, ); } - Widget rechargeItem() { - return Stack( + Widget rechargeItem(RechargeList rechargeA,index) { + return Container( + child: Stack( alignment: Alignment.bottomRight, children: [ Container( - alignment: Alignment.center, - height: 69.h, - decoration: BoxDecoration( - color: Color(0xFFFAFAFA), - // color: Color(0x2432A060), - borderRadius: BorderRadius.circular(4), - ), - // margin: EdgeInsets.only(right: 11,bottom: 16), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - "100元", - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xFF868686), - fontWeight: MyFontWeight.medium, - fontSize: 21.sp, + alignment: Alignment.center, + height: 69.h, + decoration: BoxDecoration( + color: selectIndex == index ?Color(0x2432A060) : Color(0xFFFAFAFA), + borderRadius: BorderRadius.circular(4), + ), + // margin: EdgeInsets.only(right: 11,bottom: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "${AppUtils.calculateDouble(double.tryParse(rechargeA.rechargeMoney)??0)}元", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF868686), + fontWeight: MyFontWeight.medium, + fontSize:18.sp, + ), ), - ), - SizedBox(height:2,), - Text( - "实际到账:120元", - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xFF868686), - fontWeight: MyFontWeight.regular, - fontSize:12.sp, + SizedBox(height:2,), + Text( + "实际到账:${AppUtils.calculateDouble((double.tryParse(rechargeA.rechargeMoney)??0) + (double.tryParse(rechargeA.giftdMoney)??0) +((double.tryParse(rechargeA.rechargeMoney)??0) - ((double.tryParse(rechargeA.rechargeMoney)??0) * (discount/100))))}元", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF868686), + fontWeight: MyFontWeight.regular, + fontSize:10.sp, + ), ), - ), - ], + ], + ), ), - ), + if(selectIndex == index) Image.asset( - "assets/image/recharge.png", + "assets/image/recharge.png", width: 20, height:20, ), ], - ); + )); } Widget checkView(var index) { @@ -502,19 +539,19 @@ class _RechargePage extends State { } recharge() async { - String money = controller.text; - if (money == null || money == "") { - SmartDialog.showToast(S.of(context).qingshuruchongzhijine, - alignment: Alignment.center); - return; - } - int amount = int.tryParse(money); - if (checkIndex == 1) { - if (amount < 100) { - SmartDialog.showToast(S.of(context).chongzhizuixiaojine(100), - alignment: Alignment.center); - return; - } + // String money = controller.text; + // if (money == null || money == "") { + // SmartDialog.showToast(S.of(context).qingshuruchongzhijine, + // alignment: Alignment.center); + // return; + // } + // int amount = int.tryParse(money); + // if (checkIndex == 1) { + // if (amount < 100) { + // SmartDialog.showToast(S.of(context).chongzhizuixiaojine(100), + // alignment: Alignment.center); + // return; + // } if (Platform.isAndroid) { if (!(await Min.isInitialize())) { @@ -526,7 +563,7 @@ class _RechargePage extends State { } BaseData baseData = await apiService.recharge( - {"amount": amount, "rechargeType": 2}).catchError((error) {}); + {"amount": 0,"rechargeActId":rechargeA[selectIndex].id, "rechargeType": 2}).catchError((error) {}); if (baseData != null && baseData.isSuccess) { WxPay wxPay = WxPay.fromJson(baseData.data); await registerWxApi( @@ -547,5 +584,5 @@ class _RechargePage extends State { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } - } + // } } diff --git a/lib/retrofit/data/recharge_list.dart b/lib/retrofit/data/recharge_list.dart new file mode 100644 index 00000000..4e6c5d71 --- /dev/null +++ b/lib/retrofit/data/recharge_list.dart @@ -0,0 +1,78 @@ +/// id : "1494622230208839681" +/// rechargeMoney : "100.00" +/// giftdMoney : "0.00" +/// gitfdCouponId : null +/// tenantCode : "admin" +/// createTime : "2022-03-23 10:53:37" +/// isDeleted : 0 +/// rechargeType : 0 +/// remark : "充充充" + +class RechargeList { + RechargeList({ + String id, + String rechargeMoney, + String giftdMoney, + dynamic gitfdCouponId, + String tenantCode, + String createTime, + int isDeleted, + int rechargeType, + String remark,}){ + _id = id; + _rechargeMoney = rechargeMoney; + _giftdMoney = giftdMoney; + _gitfdCouponId = gitfdCouponId; + _tenantCode = tenantCode; + _createTime = createTime; + _isDeleted = isDeleted; + _rechargeType = rechargeType; + _remark = remark; +} + + RechargeList.fromJson(dynamic json) { + _id = json['id']; + _rechargeMoney = json['rechargeMoney']; + _giftdMoney = json['giftdMoney']; + _gitfdCouponId = json['gitfdCouponId']; + _tenantCode = json['tenantCode']; + _createTime = json['createTime']; + _isDeleted = json['isDeleted']; + _rechargeType = json['rechargeType']; + _remark = json['remark']; + } + String _id; + String _rechargeMoney; + String _giftdMoney; + dynamic _gitfdCouponId; + String _tenantCode; + String _createTime; + int _isDeleted; + int _rechargeType; + String _remark; + + String get id => _id; + String get rechargeMoney => _rechargeMoney; + String get giftdMoney => _giftdMoney; + dynamic get gitfdCouponId => _gitfdCouponId; + String get tenantCode => _tenantCode; + String get createTime => _createTime; + int get isDeleted => _isDeleted; + int get rechargeType => _rechargeType; + String get remark => _remark; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['rechargeMoney'] = _rechargeMoney; + map['giftdMoney'] = _giftdMoney; + map['gitfdCouponId'] = _gitfdCouponId; + map['tenantCode'] = _tenantCode; + map['createTime'] = _createTime; + map['isDeleted'] = _isDeleted; + map['rechargeType'] = _rechargeType; + map['remark'] = _remark; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 130c0cc8..3fe839b8 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -43,6 +43,7 @@ import 'data/message.dart'; import 'data/msg_stats.dart'; import 'data/page.dart'; import 'data/rank.dart'; +import 'data/recharge_list.dart'; import 'data/second_card_list.dart'; import 'data/sign_info.dart'; import 'data/social_info.dart'; @@ -63,8 +64,8 @@ part 'retrofit_api.g.dart'; // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 -const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 +const base_url = "http://192.168.10.236:8776/app/"; ///费韬 +const baseUrl = "http://192.168.10.236:8776/app/"; ///费韬 // const base_url = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/"; @@ -218,6 +219,10 @@ abstract class ApiService { @POST("/wallet/recharge") Future> recharge(@Body() Map param); + ///充值活动列表 + @GET("/wallet/rechargeAct") + Future>> rechargeAct(); + ///领取优惠券 @GET("/coupon/receive?couponId={couponId}") Future receiveCoupon(@Path("couponId") String couponId); diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 71baf8d6..33d0301a 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.236:8766/app/'; + baseUrl ??= 'http://192.168.10.236:8776/app/'; } final Dio _dio; @@ -298,6 +298,27 @@ class _ApiService implements ApiService { return value; } + @override + Future>> rechargeAct() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/wallet/rechargeAct', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map((i) => RechargeList.fromJson(i as Map)) + .toList()); + return value; + } + @override Future> receiveCoupon(couponId) async { ArgumentError.checkNotNull(couponId, 'couponId'); diff --git a/lib/utils/flutter_utils.dart b/lib/utils/flutter_utils.dart index d9b016bc..7e08db55 100644 --- a/lib/utils/flutter_utils.dart +++ b/lib/utils/flutter_utils.dart @@ -15,6 +15,20 @@ class AppUtils { return "${numberFormat.format(mi / 1000)}"; } + static String trimEnd(String resString,String char){ + while(resString.endsWith(char)){ + resString = resString.substring(0,resString.length - 1); + } + return resString; + } + + ///金额保留整数/后两位 + static String calculateDouble(double res){ + String resString = res.toStringAsFixed(2); + resString = trimEnd(resString, "0"); + resString = trimEnd(resString, "."); + return resString; + } static Future coordConvert(BMFCoordinate latLng) async { return BMFCalculateUtils.coordConvert(