From cc04bdbc00bfb21ec0689e6834aad0462ff56d8c Mon Sep 17 00:00:00 2001 From: fmk Date: Thu, 19 Aug 2021 17:54:49 +0800 Subject: [PATCH] UI --- assets/image/2x/icon_like.png | Bin 652 -> 972 bytes assets/image/2x/icon_like_h.png | Bin 1338 -> 927 bytes assets/image/3x/icon_like.png | Bin 1151 -> 1726 bytes assets/image/3x/icon_like_h.png | Bin 2507 -> 1743 bytes assets/image/icon_like.png | Bin 349 -> 504 bytes assets/image/icon_like_h.png | Bin 529 -> 462 bytes lib/article/hot_article_item.dart | 7 +- lib/home/activity_list_page.dart | 5 +- lib/home/home_page.dart | 23 +- lib/home/huixiang_brand_page.dart | 12 +- lib/home/points_mall_page.dart | 24 +- lib/integral/integral_detailed_page.dart | 8 +- lib/integral/integral_page.dart | 10 +- .../integral_store_details_page.dart | 4 +- lib/login/login_page.dart | 2 +- lib/message/system_message.dart | 7 +- lib/mine/coupons_page.dart | 7 +- lib/mine/manage_address_page.dart | 6 +- lib/mine/mine_card_invalid_page.dart | 7 +- lib/mine/mine_page.dart | 10 +- lib/mine/mine_vip_level_page.dart | 6 +- lib/mine/mine_wallet_page.dart | 12 +- lib/mine/recharge_page.dart | 5 +- lib/mine/roll_center_page.dart | 8 +- lib/mine/user_info_page.dart | 4 +- lib/mine/vip_balance_page.dart | 7 +- lib/mine/vip_card_page.dart | 5 +- lib/mine/vip_detail_page.dart | 4 +- lib/order/exchange_history_page.dart | 8 +- lib/order/logistics_information_page.dart | 4 +- lib/order/order_detail_page.dart | 4 +- lib/order/order_history_page.dart | 8 +- lib/order/store_selector_page.dart | 12 +- lib/retrofit/data/article.dart | 21 +- lib/retrofit/data/base_data.dart | 36 +- lib/retrofit/data/logistics.dart | 2 +- lib/retrofit/data/member_comment_list.dart | 2 +- lib/retrofit/data/page.dart | 45 +- lib/retrofit/data/store_info.dart | 6 +- lib/retrofit/data/vip_card.dart | 2 +- lib/retrofit/retrofit_api.dart | 84 +- lib/retrofit/retrofit_api.g.dart | 939 ------------------ lib/union/store_details_page.dart | 244 +++-- lib/union/union_details_page.dart | 13 +- lib/union/union_page.dart | 7 +- pubspec.lock | 4 +- 46 files changed, 355 insertions(+), 1269 deletions(-) delete mode 100644 lib/retrofit/retrofit_api.g.dart diff --git a/assets/image/2x/icon_like.png b/assets/image/2x/icon_like.png index 307c0cd6a0c2be913cbb8a5f514c0d943ba5fcd4..b60f9bfcc7b2f0894ec1ad77e41fd0b9809f9434 100644 GIT binary patch literal 972 zcmV;-12g=IP)Px&hDk(0RA@u(nM-IBQ51&%Gc&eUT0x|W_@qr-RKbOhLT&7w)=d{GMWMJTx)V1d zE~>5s7oxZ*;>w+MRV*sHaiPg%Y<1&fAv8Xc+FBH8Q3R1bOlFQuQIIB?natco3e9%z z`TzgB=T7bkAuRF_E%N+W0{Gt@TZ3596o9HKiuc)pbi9UQd=LVJT z?5w8Q+3ifUnwjfV=1FMUMC0Sf6G1kkq$8A$#hOUdPJsC!16%S8nP-UTDFgkVfB`+3 z%sFdV2ra{Wl!%To&;p=lVJ!pW3UJ@H?HgO4JbB|6#uq@QrDYAOs;)5513>j7PQbWI zblS3Q1w?%eZ1z(Jzyi@NnwvWpdG>6|tHu)`qw71F`5u6cUSbQM6TtHwK!C4n<_V~3 zS2U4$<>u=OFsAFxIomcsl-Kf7VS=nD=4mL(zKCJGELL9>;9YzBda|tNM6@o5xvU!J z-B_WjyEeq*-wJ6K1xO3=0KfrRLBi+|^WBJP9`+6JR@e7x%tL|BZkVLSYgqyIG$xZT z3cP3eRqutkOF&n7vIJJW6HO+Mcmg;V4Q6J(0;mmaRfa+aerBhpR&PtCe*G(-_YS0m z5CDuaWC$-wB%+34x&mZ`aBj<+;oamb5O6$_O!j+q;4Fa4^6kSb5_50FG_SgMK-W(( z^R@7HWl&%~6E)2~uOrmWz(5)7!%Gr%M-Ah)`w{BsXo6*pgm;s#psMPQhIst7D}eJb zBg9z2aan#Q--^UM5i!lYiMHS8x!>nudnH_yU-RXlpwUqD!9Ql~}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GytLGAl!CX>{nH-m`bNmCa%*7 z8R8M)ce&X<(ui{V88f?E(qymDUf?4rVEcZ$uZ71i{C*1=2X1y65U5(Hzpcczw=b7Ql-lOnwpw_02GY&@WiQj RNRR*k002ovPDHLkV1iqFfU5ui diff --git a/assets/image/3x/icon_like.png b/assets/image/3x/icon_like.png index 4545e562b2538aeedcd2ca88a476b2d9477e74de..8810984a41c41dbd5c3b77a8fe06b4a6479e4b49 100644 GIT binary patch literal 1726 zcmV;v20{6WP)Px*cu7P-RCr$Pn`>+oRTRhnXJ&V{v|X_R@`!|%wn&PmCMb%fFs&8SXg`<;F)E_b z#KaJcAc`;AXsYsUbWBMcVCSA9IhnElnEe z?##Zoo4Fr%?(6*K{O`Tz+*yKCA`&2nPhI~3@y1EJ1`uit%09TON zr3gW!X#o<#uY^MWBEuMrrcXO{69(vLU0v?Po}O}2)q4f=U0|L;SN;6E~ov^XKOl!wf4KKiMr!fKQ(Df1q z)nss*!^7up?mkchT1(MP4Nt(|rojns=8(4SRRcM9e&8CVEF zjds8^)i((^L~i#B#e4U*M>7Z8faHSNQB_q&%zGJ_9?c*bQ8ofZ#AeTp!UkjDWs~07$~voY&<(y?xLkU1 zbMs%}?2G6@?NwFF0ek^wdCbqg!Ysp`7fbi=-w`z+)^%4Wb0ZV2lc(G4qcda?gJ@&P zSjveM$Hik9)+(Qpd8W7?;FfYwgI74R1@W!KQD`xKAErZ;fN?1Vcx_$=$85`Z5 z)qsE#4Ahny#<{2fon5@RD5xlH03@hvF6Z1rEG}$o>xv4H3`#@H#|X&FW;#UFLyB@= zaZAgYr~nPcUcj#jOJ`&%WugF^<~?)T+QtlE!>&Qsb3TUvOvzN+5;8BMe}bmDu&k|Z z%rrPu84?A+{6?u^Yzk*U zL_nvjsw!0G9{|W}m#ixU$UC_wiVfpHOn|ty*3&*P&_uw)Sx09$z&w!a^*%DAsi{9E zK(bLsb@hWRL~GWahlm0S^P|OvA$RJq#a5JlM%T9zuriyxh={fq@7wpZ)i(mR0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Q0U24*BukBy($$QYXWd!K;^W4h`@0IEkPz{>q|r?LB7zYb+T|zE&Es#;CyfIp1GUa*UAF#fWH%IboCjrKz^sh7ssa;^)9#8S zN#0tc#O%U|Ou9gCdn)x)Nq~&wJO9c%)2X^Eq~Xwv6zEWFUC%v_V(wsvFa4c#N!7*dY72jX>OW9a!LUQqv`ZuNq}5e z*GO2wV?kgc?uOKnsuBg zMZ8VjThoV)NE*Q5SSod{)Z+O)&KKwA5{cVf@&m6YuSq3D(n3BT)jI1J&kDeEvRDb= z1c3YfoL2H(M7|^NwBO1v$FK&t22o8pS<0rYJy5usRg+U0vZ)B58geREHWdQ|DyMbG zCJ=x?PN#LsCNO|Xo1VVe z7}Fe4ipH2Jx4!;-Y;f?3ZDO`|RRORK9)#UCKoF}~iI43HRI++O%-!-8_!l#?!$5qb RJBR=P002ovPDHLkV1lE~9A5wc diff --git a/assets/image/3x/icon_like_h.png b/assets/image/3x/icon_like_h.png index 2f7005abce3485198325d61923d053e4aedfd4fe..e110a8a50a0a780d538530a04b49295e586c1d1a 100644 GIT binary patch delta 1715 zcmV;k22A1u~Cw6!JFj24&e+Vj=h@xV5VRs=G zHWrGQnAnPefeMP4e=HOc#covWP9FG1Hk-T8%&eK&GaKfE&AIoSHEY&-*Y|$8_B48# z5`k$wK2sym1C*m7JwQD`)r?55LA?g`8dME|UW2OP*V~|$G=FFjz|R7}{J>wpPx1K# z_#F7B6np6IT?@xVMK7xf)* z18_C)5%6m~FMkM20|x=8kE1GqH~;D;2D zQUUUGuLL#$q>!Rbc`Z&&`e++eeJS93q{Yku(%J#+#(!Z)eEv`1%^16KjP>_!^of}F zrI^>T(p7+bzjPKTX}Alp`oMv?hR1<}0qtKYNdagT;96jVc++pdd%y+29RW&_MM%$$ zfRlmshfd$;)xsBnbAYEy&_u8V>A27;|F1j?><_$EWO3P;vH-0B+zzZ06R5VA0apND zlzH*M*nio9eSjl^e*Q@sNjL422aqCqyhDM*!s|K53&8fkXGJG01CTry9BHKp&f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xg*4(;8BBhO_#-K5Gs_FD5-6PwCXu)PH?6z>i7Zzyz?t?RFm+8yk}k z(KANc1QJA~j*gDM9y)ZWng=-_K_b5zbCS0XkuGKXvL{}V)C&3cM6bt6m2D)?IWaM@ zmw3iV%NP_%I%hZ8Tj4D`h|0z@49Ymk^ex~1r2H+B6=@lRB1zX`QaneA^LZmD9LkVY zamK_EGJhhFAR@K5x8F)Msl{ZhBMZtDadsN1%#qeHD3Y$Ou6YLT{S4f09_S(j(S0TB z;rfRele!sj7v6A6w_<#e!!GTSg%amcm&eK&o|e?EJXtc{#TFA!ce6se6(Zffl;Q{(o5iene|F=6We|>Mp*V>!kEe2EkqS%N z#TFy4g9)xhs9Ol-oZD0vgn6Cd4<#ifyAnAjO()AHkix~3zLrhw2F4fpFP$dIM3`QJ zy)NV(uB@yaN#Gx3Y;0_7Y;0_7Y;2Z-6)XM+irYCQJclrl00000NkvXXu0mjfJ)F!S diff --git a/assets/image/icon_like.png b/assets/image/icon_like.png index c3c1c68d2a25b4a565bfeb69f5f8f61d16574db5..ded7335f975532afa50a88e79b95c3195b2b61d9 100644 GIT binary patch literal 504 zcmVPx$vPnciR7gwB)x9r6Q5XjB=RKE!D2s&+tC4$fHi%J|=*eX^x9h<0RVwJV7M#lt}CkMWfI8D^k$Gt!YlCL^edEt;ok` z0EEC$evRZK$>pBY(}Sgpv2NWa{TjSZ#@BMcEwg-B9Fg5HypXu&Px$7fD1xR5(wq(>+eZKoAAs_a<&~gdkBM$8ZADMA4cOaR?9vZ~zK80Tk&G&>(S# zlwq8P26_TUq5#1OXaXJ-OSTBu#8KFCHSgP>*(K&2oHLIJVCdYc0DAzMAYTbwe40_n zO_((R#6q6De%rA=`X3i zr9kZ5j*+KT!dXpXw!0EVXDRRyh6ezSW&r>k2CBy?Fm!HR$lfe~B*}(981z!W0EwNu z2HC2J+%{EP1d_Z9ckT8<&GW86F8_rPhz(c^RG;%MWPxeO&+so`JW+-eg$scqq%2$t ve0yA7Bc(2~zu51;6y44Lex`~ooGAMOd=gy|evZ@s00000NkvXXu0mjf$~}tk diff --git a/assets/image/icon_like_h.png b/assets/image/icon_like_h.png index c03cbf29a84b0189d04b715bf3766076e59ac612..2755178578d3a88f284952ac75ccbf0c9109cf5d 100644 GIT binary patch delta 424 zcmV;Z0ayN!1kMAHFn?4cy5BT*nJs#qT=ZbpgAvyzhfXGJ}wIKPKxGFMqa(S6D~`9-#$~&j<)* z`i_}2U;<+pKYt@&C6;l()?_04E`yq5@krBiPF^Z!~om^h41(GYCbp}az5lBVxYJh6xsw!Rt zkOwIwUKCJ8RSTeq-l>@L5BLXL(M%b} SyfZEU0000v~z!v=vSf#b&d)Nq2%&r(|qHUCj*ab71{~RHu*GNXyU7EC=R(2PS17ny%<`6P>V=V=p2V$p2Nw(0k$D~ h0)Lm&Qzj)4_ynKQo)ynBTH^o!002ovPDHLkV1mTe;dKB2 diff --git a/lib/article/hot_article_item.dart b/lib/article/hot_article_item.dart index 89467346..eb3a502d 100644 --- a/lib/article/hot_article_item.dart +++ b/lib/article/hot_article_item.dart @@ -51,7 +51,7 @@ class _HotArticlePage extends State { List
articles = []; queryArticle() async { - BaseData baseData = await apiService.queryArticle({ + BaseData> baseData = await apiService.queryArticle({ "pageNum": pageNum, "pageSize": 10, "searchKey": "", @@ -62,14 +62,13 @@ class _HotArticlePage extends State { refreshController.loadFailed(); }); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); refreshController.refreshCompleted(); refreshController.loadComplete(); if(pageNum == 1) { articles.clear(); } - articles.addAll(pageInfo.list.map((e) => Article.fromJson(e)).toList()); - if (pageInfo.pageNum == pageInfo.pages) { + articles.addAll(baseData.data.list); + if (baseData.data.pageNum == baseData.data.pages) { refreshController.loadNoData(); } else { pageNum += 1; diff --git a/lib/home/activity_list_page.dart b/lib/home/activity_list_page.dart index da44a72b..50edc487 100644 --- a/lib/home/activity_list_page.dart +++ b/lib/home/activity_list_page.dart @@ -46,7 +46,7 @@ class _ActivityListPage extends State List activityList; queryActivity() async { - BaseData baseData = await apiService.informationList({ + BaseData> baseData = await apiService.informationList({ "pageNum": 1, "pageSize": 10, "searchKey": "", @@ -56,10 +56,9 @@ class _ActivityListPage extends State _refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); _refreshController.refreshCompleted(); setState(() { - activityList = pageInfo.list.map((e) => Activity.fromJson(e)).toList(); + activityList = baseData.data.list; }); } } diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 722fdbd5..fae84c68 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -87,25 +87,22 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { SmartDialog.showLoading( msg: S.of(context).zhengzaijiazai, animationDurationTemp: Duration(seconds: 1)); - BaseData baseData = await apiService.queryBanner({ + BaseData> baseData = await apiService.queryBanner({ "model": {"type": "HOME_PAGE"}, }).catchError((onError) { refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { bannerData.clear(); - bannerData.addAll((baseData.data["records"] as List) - .map((e) => BannerData.fromJson(e)) - .toList()); + bannerData.addAll(baseData.data.records); setState(() { - controller.move(0, animation: false); + if (bannerData.length > 0) + controller.move(0, animation: false); }); } BaseData brand = await apiService.queryHomeBrand().catchError((onError) { refreshController.refreshFailed(); - }).catchError((onError) { - refreshController.refreshFailed(); }); if (brand != null && brand.isSuccess) { brandData.clear(); @@ -115,7 +112,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { founder = Founder.fromJson(brand.data["founder"]); } - BaseData article = await apiService.queryArticle({ + BaseData> article = await apiService.queryArticle({ "pageNum": 1, "pageSize": 10, "searchKey": "", @@ -126,11 +123,10 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { }); articles.clear(); if (article != null && article.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(article.data); - articles.addAll(pageInfo.list.map((e) => Article.fromJson(e)).toList()); + articles.addAll(article.data.list); } - BaseData goodsData = await apiService.creditGoods({ + BaseData> goodsData = await apiService.creditGoods({ "orderDesc": true, "orderType": 1, "pageNum": 1, @@ -138,9 +134,8 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { "state": 1 }); if (goodsData != null && goodsData.isSuccess) { - PageInfo page = PageInfo.fromJson(goodsData.data); gooods.clear(); - gooods.addAll(page.list.map((e) => Goods.fromJson(e))); + gooods.addAll(goodsData.data.list); } SmartDialog.dismiss(); if (baseData != null && baseData.isSuccess) { @@ -678,7 +673,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { ), ); }, - itemCount: bannerData != null ? bannerData.length : 1, + itemCount: (bannerData != null && bannerData.length > 0) ? bannerData.length : 1, ), ), ); diff --git a/lib/home/huixiang_brand_page.dart b/lib/home/huixiang_brand_page.dart index 3a4134fc..ba53605e 100644 --- a/lib/home/huixiang_brand_page.dart +++ b/lib/home/huixiang_brand_page.dart @@ -12,6 +12,7 @@ import 'package:huixiang/retrofit/data/banner.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/brand.dart'; import 'package:huixiang/retrofit/data/brand_data.dart'; +import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/MyPainter.dart'; import 'package:huixiang/utils/event_type.dart'; @@ -43,18 +44,16 @@ class _BrandPage extends State var isShowMore = false; queryHome() async { - BaseData baseData = await apiService.queryHome().catchError((error) { + BaseData baseData = await apiService.queryHome().catchError((error) { refreshController.refreshFailed(); }); - BaseData banner = await apiService.queryBanner({ + BaseData> banner = await apiService.queryBanner({ "model": {"type": "BRAND_APP"}, }).catchError((error) { refreshController.refreshFailed(); }); bannerData.clear(); - bannerData.addAll((banner.data["records"] as List) - .map((e) => BannerData.fromJson(e)) - .toList()); + bannerData.addAll(banner.data.records); BaseData brand = await apiService.queryHomeBrand().catchError((onError) { refreshController.refreshFailed(); @@ -77,8 +76,7 @@ class _BrandPage extends State if (baseData != null && baseData.isSuccess) { refreshController.refreshCompleted(); - brandData = BrandData.fromJson(baseData.data); - // brandText = (brandData.contents as Map).keys.toList(); + brandData = baseData.data; setState(() {}); } else { refreshController.refreshFailed(); diff --git a/lib/home/points_mall_page.dart b/lib/home/points_mall_page.dart index ce4b4ad3..5b9c0e9b 100644 --- a/lib/home/points_mall_page.dart +++ b/lib/home/points_mall_page.dart @@ -90,28 +90,25 @@ class _PointsMallPage extends State //是否降序排列 bool orderDesc = true; - PageInfo page; List goods = []; List gooodsCategorys = []; UserInfo userinfo; List bannerData = []; queryUser() async { - BaseData banner = await client.queryBanner({ + BaseData> banner = await client.queryBanner({ "model": {"type": "CREDIT_INDEX"}, }); if (banner != null) { bannerData.clear(); - bannerData.addAll((banner.data["records"] as List) - .map((e) => BannerData.fromJson(e)) - .toList()); + bannerData.addAll(banner.data.records); setState(() {}); } - BaseData baseData = await client.queryInfo(); + BaseData baseData = await client.queryInfo(); if (baseData != null && baseData.isSuccess) { - userinfo = UserInfo.fromJson(baseData.data); + userinfo = baseData.data; SharedPreferences.getInstance().then((value) => { value.setString('user', jsonEncode(baseData.data)), }); @@ -120,7 +117,7 @@ class _PointsMallPage extends State } creditGoods(categoryId) async { - BaseData dataCategory = await client.goodsCategory({ + BaseData> dataCategory = await client.goodsCategory({ "current": 1, "map": {}, "model": {"pageNum": 1, "pageSize": 20, "searchKey": ""}, @@ -133,11 +130,9 @@ class _PointsMallPage extends State }); if (dataCategory != null && dataCategory.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(dataCategory.data); gooodsCategorys.clear(); gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu)); - gooodsCategorys.addAll( - pageInfo.records.map((e) => GoodsCategory.fromJson(e)).toList()); + gooodsCategorys.addAll(dataCategory.data.records); } var param = { @@ -148,21 +143,20 @@ class _PointsMallPage extends State "pageSize": 10, "state": 1 }; - BaseData baseData = await client.creditGoods(param).catchError((onError) { + BaseData> baseData = await client.creditGoods(param).catchError((onError) { _refreshController.loadFailed(); _refreshController.refreshFailed(); }); SmartDialog.dismiss(); if (baseData != null && baseData.isSuccess) { - page = PageInfo.fromJson(baseData.data); if (pageNum == 1) { goods.clear(); } - goods.addAll(page.list.map((e) => Goods.fromJson(e))); + goods.addAll(baseData.data.list); setState(() { _refreshController.refreshCompleted(); _refreshController.loadComplete(); - if (page.pageNum == page.pages) { + if (baseData.data.pageNum == baseData.data.pages) { _refreshController.loadNoData(); } else { pageNum += 1; diff --git a/lib/integral/integral_detailed_page.dart b/lib/integral/integral_detailed_page.dart index 0fb7a6cb..bc3d1847 100644 --- a/lib/integral/integral_detailed_page.dart +++ b/lib/integral/integral_detailed_page.dart @@ -72,7 +72,7 @@ class _IntegralDetailedPage extends State List userBill = []; queryDetail(category) async { - BaseData baseData = await apiService.queryBillInfo({ + BaseData> baseData = await apiService.queryBillInfo({ "current": current, "model": {"category": category, "title": "bill_title_point", "type": ""}, "order": "descending", @@ -84,12 +84,10 @@ class _IntegralDetailedPage extends State }); if (current == 1) userBill.clear(); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); - userBill - .addAll(pageInfo.records.map((e) => UserBill.fromJson(e)).toList()); + userBill.addAll(baseData.data.records); refreshController.loadComplete(); refreshController.refreshCompleted(); - if (current * 10 > int.tryParse(pageInfo.total)) { + if (current * 10 > int.tryParse(baseData.data.total)) { refreshController.loadNoData(); } else { current += 1; diff --git a/lib/integral/integral_page.dart b/lib/integral/integral_page.dart index 656a85b5..3731d73f 100644 --- a/lib/integral/integral_page.dart +++ b/lib/integral/integral_page.dart @@ -49,14 +49,12 @@ class _IntegralPage extends State { } querySignInfo() async { - BaseData baseData = await apiService.signInInfo(); + BaseData baseData = await apiService.signInInfo(); - BaseData rankData = await apiService.rankList(); + BaseData> rankData = await apiService.rankList(); if (rankData != null && rankData.isSuccess) { ranks.clear(); - ranks.addAll((rankData.data as List) - .map((e) => Rank.fromJson(e)) - .toList()); + ranks.addAll(rankData.data); } if (userinfo != null && @@ -69,7 +67,7 @@ class _IntegralPage extends State { } SmartDialog.dismiss(closeType: 3); if (baseData != null && baseData.isSuccess) { - signInfo = SignInfo.fromJson(baseData.data); + signInfo = baseData.data; setState(() {}); } } diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 927c67b2..2796c722 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -50,10 +50,10 @@ class _IntegralStoreDetailsPage extends State { Goods goods; queryGoodsById() async { - BaseData baseData = await apiService.creditGoodsById(arguments["goodsId"]); + BaseData baseData = await apiService.creditGoodsById(arguments["goodsId"]); if (baseData != null && baseData.isSuccess) { setState(() { - goods = Goods.fromJson(baseData.data); + goods = baseData.data; }); } } diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index e891ef0b..2ed589eb 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -274,7 +274,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { "capcha": code, "mobile": mobile, }; - SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai, animationDurationTemp: Duration(seconds: 1)); + SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai); BaseData value = await client.memberLogin(param).catchError((error) { print(error); SmartDialog.showToast("$error", alignment: Alignment.center); diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index f1aa7042..f880c5e0 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -44,7 +44,7 @@ class _SystemMessagePage extends State { } queryMessage() async { - BaseData baseData = await apiService.msgList({ + BaseData> baseData = await apiService.msgList({ "pageNum": pageNum, "pageSize": 10, "searchKey": "", @@ -56,15 +56,14 @@ class _SystemMessagePage extends State { }); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); if (pageNum == 1) { messages.clear(); } - messages.addAll(pageInfo.list.map((e) => Message.fromJson(e)).toList()); + messages.addAll(baseData.data.list); _refreshController.loadComplete(); _refreshController.refreshCompleted(); if (mounted) setState(() {}); - if (pageNum * 10 > int.tryParse(pageInfo.total)) { + if (pageNum * 10 > int.tryParse(baseData.data.total)) { _refreshController.loadNoData(); } else { pageNum += 1; diff --git a/lib/mine/coupons_page.dart b/lib/mine/coupons_page.dart index cf894551..1db1c705 100644 --- a/lib/mine/coupons_page.dart +++ b/lib/mine/coupons_page.dart @@ -54,7 +54,7 @@ class _CouponsPage extends State { } queryCard() async { - BaseData baseData = await apiService.queryCard({ + BaseData> baseData = await apiService.queryCard({ "centre": true, "pageNum": pageNum, "pageSize": 10, @@ -65,15 +65,14 @@ class _CouponsPage extends State { _refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); if (pageNum == 1) { coupons.clear(); } - coupons.addAll(pageInfo.list.map((e) => Coupon.fromJson(e))); + coupons.addAll(baseData.data.list); setState(() { _refreshController.refreshCompleted(); _refreshController.loadComplete(); - if (pageInfo.pageNum == pageInfo.pages) { + if (baseData.data.pageNum == baseData.data.pages) { _refreshController.loadNoData(); } else { pageNum += 1; diff --git a/lib/mine/manage_address_page.dart b/lib/mine/manage_address_page.dart index 56c52c6b..037fa6fb 100644 --- a/lib/mine/manage_address_page.dart +++ b/lib/mine/manage_address_page.dart @@ -41,12 +41,10 @@ class _ManageAddressPage extends State { List
addressList; queryMemberAddress() async { - BaseData baseData = await apiService.queryMemberAddress(); + BaseData> baseData = await apiService.queryMemberAddress(); if (baseData != null && baseData.isSuccess) { checkIndex = 0; - addressList = (baseData.data as List) - .map((e) => Address.fromJson(e)) - .toList(); + addressList = baseData.data; setState(() {}); } } diff --git a/lib/mine/mine_card_invalid_page.dart b/lib/mine/mine_card_invalid_page.dart index 396794ab..492237c0 100644 --- a/lib/mine/mine_card_invalid_page.dart +++ b/lib/mine/mine_card_invalid_page.dart @@ -52,7 +52,7 @@ class _MineCardInvalidPage extends State { } queryCard() async { - BaseData baseData = await apiService.queryCard({ + BaseData> baseData = await apiService.queryCard({ "centre": true, "pageNum": pageNum, "pageSize": 10, @@ -63,15 +63,14 @@ class _MineCardInvalidPage extends State { _refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); if (pageNum == 1) { coupons.clear(); } - coupons.addAll(pageInfo.list.map((e) => Coupon.fromJson(e))); + coupons.addAll(baseData.data.list); setState(() { _refreshController.refreshCompleted(); _refreshController.loadComplete(); - if (pageInfo.pageNum == pageInfo.pages) { + if (baseData.data.pageNum == baseData.data.pages) { _refreshController.loadNoData(); } else { pageNum += 1; diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 36380cac..c1baa23c 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -100,17 +100,15 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { queryUserInfo() async { SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai, animationDurationTemp: Duration(seconds: 1)); - BaseData rankData = await apiService.rankList(); + BaseData> rankData = await apiService.rankList(); if (rankData != null && rankData.isSuccess) { ranks.clear(); - ranks.addAll((rankData.data as List) - .map((e) => Rank.fromJson(e)) - .toList()); + ranks.addAll(rankData.data); } - BaseData baseDate = await apiService.queryInfo(); + BaseData baseDate = await apiService.queryInfo(); if (baseDate != null && baseDate.isSuccess) { - userinfo = UserInfo.fromJson(baseDate.data); + userinfo = baseDate.data; if (userinfo != null && userinfo.memberRankVo != null && ranks != null && diff --git a/lib/mine/mine_vip_level_page.dart b/lib/mine/mine_vip_level_page.dart index f6aa3a77..4732c5e5 100644 --- a/lib/mine/mine_vip_level_page.dart +++ b/lib/mine/mine_vip_level_page.dart @@ -41,12 +41,10 @@ class _MineVipLevelPage extends State { } queryVipLevel() async { - BaseData rankData = await apiService.rankList(); + BaseData> rankData = await apiService.rankList(); if (rankData != null && rankData.isSuccess) { ranks.clear(); - ranks.addAll((rankData.data as List) - .map((e) => Rank.fromJson(e)) - .toList()); + ranks.addAll(rankData.data); setState(() { controller.move((widget.arguments["rankLevel"] - 1), animation: false); }); diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 2b5a0798..9fd608d7 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -57,9 +57,9 @@ class _MineWalletPage extends State { } queryUserBalance() async { - BaseData baseData = await apiService.queryInfo(); + BaseData baseData = await apiService.queryInfo(); if (baseData != null && baseData.isSuccess) { - userInfo = UserInfo.fromJson(baseData.data); + userInfo = baseData.data; mBalance = double.tryParse(userInfo.money); if (mounted) setState(() {}); } @@ -67,7 +67,7 @@ class _MineWalletPage extends State { loadBillInfo() async { queryUserBalance(); - BaseData baseData = await apiService.queryBillInfo({ + BaseData> baseData = await apiService.queryBillInfo({ "current": current, "model": {"category": "", "title": "bill_title_balance", "type": ""}, "order": "descending", @@ -78,15 +78,13 @@ class _MineWalletPage extends State { refreshController.loadFailed(); }); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); if (current == 1) { userBills.clear(); } - userBills - .addAll(pageInfo.records.map((e) => UserBill.fromJson(e)).toList()); + userBills.addAll(baseData.data.records); refreshController.refreshCompleted(); refreshController.loadComplete(); - if (current * 10 > int.tryParse(pageInfo.total)) { + if (current * 10 > int.tryParse(baseData.data.total)) { refreshController.loadNoData(); } else { current += 1; diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 84f55143..25041acc 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -216,10 +216,9 @@ class _RechargePage extends State { await Min.initialize(); } - BaseData baseData = - await apiService.recharge({"amount": amount, "rechargeType": 2}); + BaseData baseData = await apiService.recharge({"amount": amount, "rechargeType": 2}); if (baseData != null && baseData.isSuccess) { - WxPay wxPay = WxPay.fromJson(baseData.data); + WxPay wxPay = baseData.data; await registerWxApi( appId: wxPay.appId, doOnAndroid: true, diff --git a/lib/mine/roll_center_page.dart b/lib/mine/roll_center_page.dart index a14e8acc..fb02707a 100644 --- a/lib/mine/roll_center_page.dart +++ b/lib/mine/roll_center_page.dart @@ -45,7 +45,7 @@ class _RollCenterPage extends State { List coupons = []; queryCoupon() async { - BaseData baseData = await apiService.queryCoupon({ + BaseData> baseData = await apiService.queryCoupon({ "centre": true, "pageNum": pageNum, "pageSize": 10, @@ -57,12 +57,10 @@ class _RollCenterPage extends State { }); if (pageNum == 1) coupons.clear(); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); - coupons.addAll(pageInfo.list.map((e) => Coupon.fromJson(e)).toList()); - + coupons.addAll(baseData.data.list); _refreshController.refreshCompleted(); _refreshController.loadComplete(); - if (pageInfo.pageNum == pageInfo.pages) { + if (baseData.data.pageNum == baseData.data.pages) { _refreshController.loadNoData(); } else { pageNum += 1; diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index 5d6d6a26..ceb0a162 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -340,9 +340,9 @@ class _UserInfoPage extends State { ///文件上传 fileUpload() async { if (filePath != null && filePath != "" && await File(filePath).exists()) { - BaseData baseData = await apiService.upload(File(filePath), 123123123); + BaseData baseData = await apiService.upload(File(filePath), 123123123); if (baseData != null && baseData.isSuccess) { - UploadResult uploadResult = UploadResult.fromJson(baseData.data); + UploadResult uploadResult = baseData.data; modifyInfo["headimg"] = uploadResult.url; modifyInfos(); } diff --git a/lib/mine/vip_balance_page.dart b/lib/mine/vip_balance_page.dart index 71763f15..24e90cc2 100644 --- a/lib/mine/vip_balance_page.dart +++ b/lib/mine/vip_balance_page.dart @@ -45,7 +45,7 @@ class _VipBalancePage extends State { List userBills = []; queryBillInfo() async { - BaseData baseData = await apiService.queryBillInfo({ + BaseData> baseData = await apiService.queryBillInfo({ "current": current, "model": { "category": "", @@ -61,15 +61,14 @@ class _VipBalancePage extends State { _refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); if (current == 1) { userBills.clear(); } - userBills.addAll(pageInfo.records.map((e) => UserBill.fromJson(e))); + userBills.addAll(baseData.data.records); setState(() { _refreshController.refreshCompleted(); _refreshController.loadComplete(); - if (pageInfo.pageNum == pageInfo.pages) { + if (baseData.data.pageNum == baseData.data.pages) { _refreshController.loadNoData(); } else { current += 1; diff --git a/lib/mine/vip_card_page.dart b/lib/mine/vip_card_page.dart index 4d4ed724..f0278885 100644 --- a/lib/mine/vip_card_page.dart +++ b/lib/mine/vip_card_page.dart @@ -39,13 +39,12 @@ class _VipCardPage extends State { List coupons = []; queryVipCard() async { - BaseData baseData = await apiService.vipList({}).catchError((error) { + BaseData> baseData = await apiService.vipList({}).catchError((error) { _refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { coupons.clear(); - coupons.addAll( - (baseData.data as List).map((e) => VipCard.fromMap(e))); + coupons.addAll(baseData.data); setState(() { _refreshController.refreshCompleted(); }); diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index ded12871..8b7bf0a8 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -65,13 +65,13 @@ class _VipDetailPage extends State { int current = 1; vipDetail(latitude, longitude) async { - BaseData baseData = await apiService.vipDetail({ + BaseData baseData = await apiService.vipDetail({ "id": widget.arguments["id"], "latitude": "$latitude", "longitude": "$longitude", }); if (baseData != null && baseData.isSuccess) { - vipCard = VipCard.fromMap(baseData.data); + vipCard = baseData.data; refreshController.loadComplete(); setState(() {}); } else { diff --git a/lib/order/exchange_history_page.dart b/lib/order/exchange_history_page.dart index bfa11fc6..b1fb7953 100644 --- a/lib/order/exchange_history_page.dart +++ b/lib/order/exchange_history_page.dart @@ -132,7 +132,6 @@ class _ExchangeHistoryList extends State { } int pageNum = 1; - PageInfo pageInfo; List orders = []; queryHistory() async { @@ -144,21 +143,20 @@ class _ExchangeHistoryList extends State { if (widget.orderStatus != 0) { map["state"] = widget.orderStatus; } - BaseData baseData = + BaseData> baseData = await apiService.creditOrderList(map).catchError((error) { _refreshController.loadFailed(); _refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { - pageInfo = PageInfo.fromJson(baseData.data); if (pageNum == 1) { orders.clear(); } - orders.addAll(pageInfo.list.map((e) => ExchangeOrder.fromJson(e))); + orders.addAll(baseData.data.list); setState(() { _refreshController.loadComplete(); _refreshController.refreshCompleted(); - if (pageInfo.pages == pageInfo.pageNum) { + if (baseData.data.pages == baseData.data.pageNum) { _refreshController.loadNoData(); } else { pageNum += 1; diff --git a/lib/order/logistics_information_page.dart b/lib/order/logistics_information_page.dart index fafbc5a0..68e004be 100644 --- a/lib/order/logistics_information_page.dart +++ b/lib/order/logistics_information_page.dart @@ -43,13 +43,13 @@ class _LogisticsInformationPage extends State { String shipStatus = ""; getShippingTrace(String shipperCode, String logisticCode) async { - BaseData baseData = await apiService + BaseData baseData = await apiService .shippingTrace(shipperCode, logisticCode) .catchError((error) { _refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { - Logistics lgs = Logistics.fromMap(baseData.data); + Logistics lgs = baseData.data; logistics.clear(); logistics.addAll(lgs.traces.reversed); setState(() { diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index bcd37942..3f3d3108 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -55,9 +55,9 @@ class _OrderDetailPage extends State { // String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE queryDetails() async { - BaseData baseData = await apiService.orderDetail(widget.arguments["id"]); + BaseData baseData = await apiService.orderDetail(widget.arguments["id"]); if (baseData != null && baseData.isSuccess) { - orderInfo = OrderInfo.fromJson(baseData.data); + orderInfo = baseData.data; payStatus = orderInfo.payStatus; orderStatus = orderInfo.orderStatus; sendStatus = orderInfo.sendStatus; diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 9a30b44d..00a2fc39 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -164,7 +164,7 @@ class _OrderHistoryList extends State List orderInfos = []; queryOrder() async { - BaseData baseData = await apiService.orderList({ + BaseData> baseData = await apiService.orderList({ "current": current, "model": {"status": widget.orderStatus}, "order": "descending", @@ -176,15 +176,13 @@ class _OrderHistoryList extends State }); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); if (current == 1) { orderInfos.clear(); } - orderInfos - .addAll(pageInfo.records.map((e) => OrderInfo.fromJson(e)).toList()); + orderInfos.addAll(baseData.data.records); refreshController.refreshCompleted(); refreshController.loadComplete(); - if (current * 10 > int.tryParse(pageInfo.total)) { + if (current * 10 > int.tryParse(baseData.data.total)) { refreshController.loadNoData(); } else { current += 1; diff --git a/lib/order/store_selector_page.dart b/lib/order/store_selector_page.dart index 5282beb3..7b7c5448 100644 --- a/lib/order/store_selector_page.dart +++ b/lib/order/store_selector_page.dart @@ -102,9 +102,9 @@ class _StoreSelectorPage extends State { SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("longitude", "${latLng.longitude}"); - await prefs.setString("province", province); - await prefs.setString("city", city); - await prefs.setString("district", district); + await prefs.setString("province", province ?? ""); + await prefs.setString("city", city ?? ""); + await prefs.setString("district", district ?? ""); } List storeList; @@ -210,7 +210,7 @@ class _StoreSelectorPage extends State { } queryStore(latitude, longitude, province, city, district) async { - BaseData baseData = await apiService.queryStore({ + BaseData> baseData = await apiService.queryStore({ "city": "", "district": "", "latitude": latitude, @@ -219,9 +219,7 @@ class _StoreSelectorPage extends State { "searchKey": "" }); if (baseData != null && baseData.isSuccess) { - storeList = (baseData.data as List) - .map((e) => Store.fromJson(e)) - .toList(); + storeList = baseData.data; if (mounted) setState(() {}); } } diff --git a/lib/retrofit/data/article.dart b/lib/retrofit/data/article.dart index ffd0ecb2..0085a6ed 100644 --- a/lib/retrofit/data/article.dart +++ b/lib/retrofit/data/article.dart @@ -2,23 +2,6 @@ import 'dart:convert'; import 'package:huixiang/retrofit/data/author.dart'; -/// id : "4" -/// createTime : "2021-07-05 14:20:43" -/// createUser : null -/// updateTime : "2021-07-05 14:23:47" -/// updateUser : null -/// storeId : "0" -/// mainTitle : "牡丹花的养护知识" -/// viceTitle : null -/// content : "阿斯顿发斯蒂芬" -/// coverImg : "https://pos.upload.gznl.top/MDAwMA==/2021/06/2a1060d8-08f6-4036-935a-0514aaade9d8.jpg" -/// author : "{\"name\":\"百花谷\",\"avatar\":\"https://pos.upload.gznl.top/MDAwMA==/2021/06/6a3586dc-a340-470f-b645-1e3155d5f558.jpg\"}" -/// type : 2 -/// startTime : "2021-07-05 14:25:10" -/// endTime : "2099-01-01 00:00:00" -/// state : 1 -/// isDelete : 0 -/// storeName : null class Article { String _id; @@ -69,6 +52,10 @@ class Article { _likes = value; } + set liked(bool value) { + _liked = value; + } + set viewers(int value) { _viewers = value; } diff --git a/lib/retrofit/data/base_data.dart b/lib/retrofit/data/base_data.dart index e536de2d..30954bd1 100644 --- a/lib/retrofit/data/base_data.dart +++ b/lib/retrofit/data/base_data.dart @@ -1,8 +1,16 @@ -class BaseData { + + + +import 'package:json_annotation/json_annotation.dart'; + +part 'base_data.g.dart'; + +@JsonSerializable(genericArgumentFactories: true) +class BaseData { BaseData(); int code; - dynamic data; + T data; dynamic extra; bool isError; bool isSuccess; @@ -10,24 +18,8 @@ class BaseData { String path; String timestamp; - factory BaseData.fromJson(Map json) => BaseData() - ..code = json['code'] as int - ..data = json['data'] - ..extra = json['extra'] - ..isError = json['isError'] as bool - ..isSuccess = json['isSuccess'] as bool - ..msg = json['msg'] as String - ..path = json['path'] as String - ..timestamp = json['timestamp'] as String; - - Map toJson() => { - 'code': this.code, - 'data': this.data, - 'extra': this.extra, - 'isError': this.isError, - 'isSuccess': this.isSuccess, - 'msg': this.msg, - 'path': this.path, - 'timestamp': this.timestamp, - }; + factory BaseData.fromJson(Map json, T Function(dynamic json) fromJsonT) => _$BaseDataFromJson(json, fromJsonT); + + Map toJson(Object Function(T value) toJsonT) => _$BaseDataToJson(this, toJsonT); + } diff --git a/lib/retrofit/data/logistics.dart b/lib/retrofit/data/logistics.dart index 60475bf0..73a18902 100644 --- a/lib/retrofit/data/logistics.dart +++ b/lib/retrofit/data/logistics.dart @@ -11,7 +11,7 @@ class Logistics { bool success; List traces; - static Logistics fromMap(Map map) { + static Logistics fromJson(Map map) { if (map == null) return null; Logistics logisticsBean = Logistics(); logisticsBean.logisticCode = map['logisticCode']; diff --git a/lib/retrofit/data/member_comment_list.dart b/lib/retrofit/data/member_comment_list.dart index 4ed89be5..193f7b82 100644 --- a/lib/retrofit/data/member_comment_list.dart +++ b/lib/retrofit/data/member_comment_list.dart @@ -41,7 +41,7 @@ class MemberCommentList { String username; bool liked; - static MemberCommentList fromMap(Map map) { + static MemberCommentList fromJson(Map map) { if (map == null) return null; MemberCommentList listBean = MemberCommentList(); listBean.content = map['content']; diff --git a/lib/retrofit/data/page.dart b/lib/retrofit/data/page.dart index b1290331..257ac7e0 100644 --- a/lib/retrofit/data/page.dart +++ b/lib/retrofit/data/page.dart @@ -1,5 +1,14 @@ -class PageInfo { + + + +import 'package:json_annotation/json_annotation.dart'; + +part 'page.g.dart'; + + +@JsonSerializable(genericArgumentFactories: true) +class PageInfo { PageInfo(); int pageNum; @@ -10,32 +19,10 @@ class PageInfo { bool hasPreviousPage; bool hasNextPage; String total; - List list; - List records; - - factory PageInfo.fromJson(Map json) => - PageInfo() - ..pageNum = json['pageNum'] as int - ..current = json['current'] - ..pageSize = json['pageSize'] as int - ..size = json['size'] - ..pages = json['pages'] - ..hasPreviousPage = json['hasPreviousPage'] as bool - ..hasNextPage = json['hasNextPage'] as bool - ..total = json['total'] as String - ..list = json['list'] as List - ..records = json['records'] as List; - - Map toJson() => { - 'pageNum': this.pageNum, - 'current': this.current, - 'pageSize': this.pageSize, - 'size': this.size, - 'pages': this.pages, - 'hasPreviousPage': this.hasPreviousPage, - 'hasNextPage': this.hasNextPage, - 'total': this.total, - 'list': this.list.map((e) => e.toString()).toList(), - 'records': this.records.map((e) => e.toString()).toList(), - }; + List list; + List records; + + factory PageInfo.fromJson(Map json, D Function(dynamic d) fromJsonD) => _$PageInfoFromJson(json, fromJsonD); + + Map toJson(Object Function(D value) toJsonD) => _$PageInfoToJson(this, toJsonD); } diff --git a/lib/retrofit/data/store_info.dart b/lib/retrofit/data/store_info.dart index b453e079..f2dae3a2 100644 --- a/lib/retrofit/data/store_info.dart +++ b/lib/retrofit/data/store_info.dart @@ -101,7 +101,9 @@ class StoreInfo { ..expireTime = json['expireTime'] as String ..vipFee = json['vipFee'] as String ..memberSource = json['memberSource'] != null ? MemberSource.fromJson(json['memberSource']) : null - ..informationVOPageVO = json['informationVOPageVO'] != null ? PageInfo.fromJson(json['informationVOPageVO']) : null; + ..informationVOPageVO = json['informationVOPageVO'] != null ? PageInfo.fromJson(json['informationVOPageVO'], (value){ + return value; + }) : null; Map toJson() => { 'address': this.address, @@ -142,7 +144,7 @@ class StoreInfo { 'expireTime': this.expireTime, 'vipFee': this.vipFee, 'memberSource': this.memberSource.toJson(), - 'informationVOPageVO': this.informationVOPageVO.toJson(), + 'informationVOPageVO': this.informationVOPageVO, }; } diff --git a/lib/retrofit/data/vip_card.dart b/lib/retrofit/data/vip_card.dart index 850fea0e..4142de74 100644 --- a/lib/retrofit/data/vip_card.dart +++ b/lib/retrofit/data/vip_card.dart @@ -60,7 +60,7 @@ class VipCard { String tenantLogo; List storeList; - static VipCard fromMap(Map map) { + static VipCard fromJson(Map map) { if (map == null) return null; VipCard vipCardBean = VipCard(); vipCardBean.id = map['id']; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 3e52c8ac..234a8d1f 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -7,11 +7,37 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/coupon.dart'; +import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/view_widget/login_tips.dart'; import 'package:retrofit/retrofit.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'data/address.dart'; +import 'data/banner.dart'; +import 'data/brand.dart'; +import 'data/brand_data.dart'; +import 'data/exchange_order.dart'; +import 'data/goods.dart'; +import 'data/goods_category.dart'; +import 'data/logistics.dart'; +import 'data/member_comment_list.dart'; +import 'data/message.dart'; +import 'data/page.dart'; +import 'data/rank.dart'; +import 'data/sign_info.dart'; +import 'data/store.dart'; +import 'data/store_info.dart'; +import 'data/upload_result.dart'; +import 'data/user_bill.dart'; +import 'data/user_entity.dart'; +import 'data/user_info.dart'; +import 'data/vip_card.dart'; +import 'data/wx_pay.dart'; + part 'retrofit_api.g.dart'; const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 @@ -131,7 +157,7 @@ abstract class ApiService { ///文件上传 @POST("/file/upload") @MultiPart() - Future upload( + Future> upload( @Part(name: "file") File data, @Part(name: "folderId") int folderId); /// 周边搜索 @@ -150,19 +176,19 @@ abstract class ApiService { ///积分商城商品列表 @POST("/creditGoods/list") - Future creditGoods(@Body() Map param); + Future>> creditGoods(@Body() Map param); ///积分商城商品分類列表 @POST("/creditGoodsCategory/page") - Future goodsCategory(@Body() Map param); + Future>> goodsCategory(@Body() Map param); ///积分商城商品详情 @GET("/creditGoods/{id}") - Future creditGoodsById(@Path("id") String id); + Future> creditGoodsById(@Path("id") String id); ///查询用户信息 @GET("/member/info") - Future queryInfo(); + Future> queryInfo(); ///编辑用户信息 @POST("/member/editMemberInfo") @@ -170,7 +196,7 @@ abstract class ApiService { ///用户签到信息 @GET("/member/signInInfo") - Future signInInfo(); + Future> signInInfo(); ///用户签到 @GET("/member/signIn") @@ -178,15 +204,15 @@ abstract class ApiService { ///会员充值 @POST("/wallet/recharge") - Future recharge(@Body() Map param); + Future> recharge(@Body() Map param); ///领取优惠券 @GET("/coupon/receive?couponId={couponId}") Future receiveCoupon(@Path("couponId") String couponId); - ///订单列表 + ///兑换订单列表 @POST("/creditOrder/list") - Future creditOrderList(@Body() Map param); + Future>> creditOrderList(@Body() Map param); ///创建积分订单 @POST("/creditOrder/create") @@ -206,7 +232,7 @@ abstract class ApiService { ///查询用户所有的收货地址 @GET("/address/queryMemberAddress") - Future queryMemberAddress(); + Future>> queryMemberAddress(); ///更新收货地址 @POST("/address/update") @@ -214,23 +240,27 @@ abstract class ApiService { ///查询领券列表 @POST("/coupon/centreList") - Future queryCoupon(@Body() Map param); + Future>> queryCoupon(@Body() Map param); ///查询卡包列表 @POST("/coupon/packageList") - Future queryCard(@Body() Map param); + Future>> queryCard(@Body() Map param); ///门店地址列表 @POST("/store/list") - Future queryStore(@Body() Map param); + Future>> queryStore(@Body() Map param); ///分页查看资讯列表 @POST("/information/list") - Future informationList(@Body() Map param); + Future>> informationList(@Body() Map param); ///查看资讯详情 @GET("/information/{id}") - Future informationInfo(@Path("id") String id); + Future> informationInfo(@Path("id") String id); + + ///查看活动详情 + @GET("/information/{id}") + Future> activityInfo(@Path("id") String id); ///积分订单兑换到券包 @GET("/creditOrder/receive/{id}") @@ -238,7 +268,7 @@ abstract class ApiService { ///首页数据 @GET("/home/home") - Future queryHome(); + Future> queryHome(); ///查询店铺商家详情 @GET("/store/{id}") @@ -246,11 +276,11 @@ abstract class ApiService { ///分页查看资讯列表 @POST("/information/list") - Future queryArticle(@Body() Map param); + Future>> queryArticle(@Body() Map param); ///banner查询 @POST("/banner/page") - Future queryBanner(@Body() Map param); + Future>> queryBanner(@Body() Map param); ///品牌信息 @GET("/home/brand") @@ -262,19 +292,19 @@ abstract class ApiService { /// @POST("/member/listBill") - Future queryBillInfo(@Body() Map param); + Future>> queryBillInfo(@Body() Map param); ///会员等级列表 @GET("/member/rankList") - Future rankList(); + Future>> rankList(); ///订单列表 @POST("/order/list") - Future orderList(@Body() Map param); + Future>> orderList(@Body() Map param); ///订单详情 @GET("/order/orderDetail?id={id}") - Future orderDetail(@Path("id") String id); + Future> orderDetail(@Path("id") String id); ///继续付款 @POST("/order/continuePay") @@ -286,15 +316,15 @@ abstract class ApiService { ///会员卡列表 @POST("/member/vipList") - Future vipList(@Body() Map param); + Future>> vipList(@Body() Map param); ///会员卡详情 @POST("/member/vipDetail") - Future vipDetail(@Body() Map param); + Future> vipDetail(@Body() Map param); ///分页查询App消息列表 @POST("/app-msg/list") - Future msgList(@Body() Map param); + Future>> msgList(@Body() Map param); ///App消息详情 @GET("/app-msg/{id}") @@ -310,7 +340,7 @@ abstract class ApiService { ///查询评论列表 @POST("/memberComment/list") - Future memberCommentList(@Body() Map param); + Future>> memberCommentList(@Body() Map param); ///评论点赞 @GET("/memberComment/likes/{id}") @@ -322,6 +352,6 @@ abstract class ApiService { ///查询物流轨迹 @GET("/order/getShippingTrace/{shipperCode}/{logisticCode}") - Future shippingTrace(@Path("shipperCode") String shipperCode, @Path("logisticCode") String logisticCode); + Future> shippingTrace(@Path("shipperCode") String shipperCode, @Path("logisticCode") String logisticCode); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart deleted file mode 100644 index 5cbe9cb6..00000000 --- a/lib/retrofit/retrofit_api.g.dart +++ /dev/null @@ -1,939 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'retrofit_api.dart'; - -// ************************************************************************** -// RetrofitGenerator -// ************************************************************************** - -class _ApiService implements ApiService { - _ApiService(this._dio, {this.baseUrl}) { - ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; - } - - final Dio _dio; - - String baseUrl; - - @override - Future upload(data, folderId) async { - ArgumentError.checkNotNull(data, 'data'); - ArgumentError.checkNotNull(folderId, 'folderId'); - const _extra = {}; - final queryParameters = {}; - final _data = FormData(); - _data.files.add(MapEntry( - 'file', - MultipartFile.fromFileSync(data.path, - filename: data.path.split(Platform.pathSeparator).last))); - if (folderId != null) { - _data.fields.add(MapEntry('folderId', folderId.toString())); - } - final _result = await _dio.request>('/file/upload', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future searchPoi(lat, lng, keywords, size, page) async { - ArgumentError.checkNotNull(lat, 'lat'); - ArgumentError.checkNotNull(lng, 'lng'); - ArgumentError.checkNotNull(keywords, 'keywords'); - ArgumentError.checkNotNull(size, 'size'); - ArgumentError.checkNotNull(page, 'page'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request( - 'https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=$lat,$lng&keywords=$keywords&offset={size}&page={page}&extensions=all', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = _result.data; - return value; - } - - @override - Future memberLogin(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/auth/platform/memberLogin', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future sendVerify(mobile) async { - ArgumentError.checkNotNull(mobile, 'mobile'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/auth/sendVerify/$mobile', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditGoods(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditGoods/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future goodsCategory(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditGoodsCategory/page', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditGoodsById(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/creditGoods/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryInfo() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/info', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future editInfo(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/member/editMemberInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future signInInfo() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/member/signInInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future signIn() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/signIn', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future recharge(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/wallet/recharge', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future receiveCoupon(couponId) async { - ArgumentError.checkNotNull(couponId, 'couponId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/coupon/receive?couponId=$couponId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditOrderList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditOrder/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditOrder(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditOrder/create', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future addAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/add', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future deleteAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/delete', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryAddress(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/address/detail/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryMemberAddress() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/address/queryMemberAddress', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future updateAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/update', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryCoupon(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/coupon/centreList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryCard(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/coupon/packageList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryStore(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/store/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future informationList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/information/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future informationInfo(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/information/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditOrderReceive(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/creditOrder/receive/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryHome() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/home/home', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryStoreInfo(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/store/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryArticle(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/information/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryBanner(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/banner/page', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryHomeBrand() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/home/brand', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future minLogin(storeId) async { - ArgumentError.checkNotNull(storeId, 'storeId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/auth/mini/login/$storeId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryBillInfo(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/member/listBill', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future rankList() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/rankList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future orderList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/order/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future orderDetail(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/order/orderDetail?id=$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future continuePay(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/order/continuePay', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future receiveToCard(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/creditOrder/receive/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future vipList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/member/vipList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future vipDetail(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/member/vipDetail', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future msgList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/app-msg/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryMsg(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/app-msg/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future informationLikes(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/information/likes/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future memberComment(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/memberComment', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future memberCommentList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/memberComment/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future commentLike(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/memberComment/likes/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future delComment(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/memberComment/delete/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future shippingTrace(shipperCode, logisticCode) async { - ArgumentError.checkNotNull(shipperCode, 'shipperCode'); - ArgumentError.checkNotNull(logisticCode, 'logisticCode'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/order/getShippingTrace/$shipperCode/$logisticCode', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } -} diff --git a/lib/union/store_details_page.dart b/lib/union/store_details_page.dart index edc54deb..ff7a4de5 100644 --- a/lib/union/store_details_page.dart +++ b/lib/union/store_details_page.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/image_render.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -49,7 +50,6 @@ class _StoreDetailsPage extends State with WidgetsBindingObserver { ApiService apiService; RefreshController _refreshController; - bool isLiked = false; int commentTotal = 0; var commentTextController = TextEditingController(); var commentFocus = FocusNode(); @@ -97,19 +97,25 @@ class _StoreDetailsPage extends State Activity activity; Article article; List memberList = []; + GlobalKey commentKey = GlobalKey(); + ScrollController scrollController = ScrollController(); - queryHtml() async { - BaseData baseData = await apiService.informationInfo( - widget.arguments["activityId"] ?? widget.arguments["articleId"]); - - if (baseData != null && baseData.isSuccess) { - setState(() { - if (widget.arguments.containsKey("activityId")) { - activity = Activity.fromJson(baseData.data); - } else if (widget.arguments.containsKey("articleId")) { - article = Article.fromJson(baseData.data); - } - }); + queryHtml() async { //activityInfo + if (widget.arguments["activityId"] != null) { + BaseData baseData = await apiService.activityInfo(widget.arguments["activityId"]); + if (baseData != null && baseData.isSuccess) { + setState(() { + activity = baseData.data; + }); + } + } + if (widget.arguments["articleId"] != null) { + BaseData
baseData = await apiService.informationInfo(widget.arguments["articleId"]); + if (baseData != null && baseData.isSuccess) { + setState(() { + article = baseData.data; + }); + } } } @@ -177,7 +183,7 @@ class _StoreDetailsPage extends State //评论列表 queryMemberCommentList() async { - BaseData baseData = await apiService.memberCommentList({ + BaseData> baseData = await apiService.memberCommentList({ "pageNum": 1, "pageSize": 100, "relationalId": @@ -187,12 +193,10 @@ class _StoreDetailsPage extends State _refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { - PageInfo pageInfo = PageInfo.fromJson(baseData.data); _refreshController.refreshCompleted(); setState(() { - commentTotal = pageInfo.size; - memberList = - pageInfo.list.map((e) => MemberCommentList.fromMap(e)).toList(); + commentTotal = baseData.data.size; + memberList = baseData.data.list; }); } } @@ -216,8 +220,7 @@ class _StoreDetailsPage extends State return; } - BaseData baseData = - await apiService.commentLike(id).catchError((onError) {}); + BaseData baseData = await apiService.commentLike(id).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { memberList.forEach((element) { @@ -233,31 +236,29 @@ class _StoreDetailsPage extends State }); }); } - /* else { - if (baseData.msg == "您已点过赞") { - setState(() { - memberList.forEach((element) { - if (element.id == id) { - element.liked = true; - } - }); - }); - } else SmartDialog.showToast(baseData.msg, alignment: Alignment.center); - }*/ } //给文章/活动点赞 queryInformationLikes() async { - BaseData baseData = await apiService - .informationLikes( - widget.arguments["activityId"] ?? widget.arguments["articleId"]) - .catchError((onError) {}); + BaseData baseData = await apiService.informationLikes( + widget.arguments["activityId"] ?? widget.arguments["articleId"]); if (baseData != null && baseData.isSuccess) { setState(() { - isLiked = true; - if (article != null) - article.likes += 1; - else if (activity != null) activity.likes += 1; + if (article != null) { + if (article.liked) { + article.likes -= 1; + } else { + article.likes += 1; + } + article.liked = !article.liked; + } else if (activity != null) { + if (activity.liked) { + activity.likes -= 1; + } else { + activity.likes += 1; + } + activity.liked = !activity.liked; + } }); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); @@ -321,6 +322,7 @@ class _StoreDetailsPage extends State parenId = "0"; }, child: SingleChildScrollView( + controller: scrollController, physics: BouncingScrollPhysics(), child: Column( children: [ @@ -460,7 +462,8 @@ class _StoreDetailsPage extends State mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( + Container( + key: commentKey, padding: EdgeInsets.all(16), child: Row( children: [ @@ -489,27 +492,42 @@ class _StoreDetailsPage extends State ], ), ), - ListView.builder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: - memberList != null ? memberList.length : 0, - scrollDirection: Axis.vertical, - itemBuilder: (context, position) { - return Material( - color: Colors.white, - child: InkWell( - onTap: () { - showPressMenu( - memberList[position].createUser, - memberList[position]); - }, - child: commentItem(memberList[position], - position, memberList.length), + if (memberList != null && memberList.length > 0) + ListView.builder( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemCount: + memberList != null ? memberList.length : 0, + scrollDirection: Axis.vertical, + itemBuilder: (context, position) { + return Material( + color: Colors.white, + child: InkWell( + onTap: () { + showPressMenu( + memberList[position].createUser, + memberList[position]); + }, + child: commentItem(memberList[position], + position, memberList.length), + ), + ); + }, + ) + else + Container( + width: double.infinity, + height: 80.h, + alignment: Alignment.center, + child: Text( + "暂无评论,快来评论吧", + style: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.bold, + color: Color(0xFFA0A0A0), ), - ); - }, - ), + ), + ), ], ), ), @@ -622,7 +640,7 @@ class _StoreDetailsPage extends State hintText: hintText, hintStyle: TextStyle( fontSize: 14.sp, - color: Color(0xffCDCCCC), + color: Color(0xFF868686), ), ), ), @@ -631,9 +649,8 @@ class _StoreDetailsPage extends State ), ), ), - Padding( - padding: EdgeInsets.only(left: 20.w, right: 20.w), - child: GestureDetector( + if (isKeyBoardShow) + GestureDetector( onTap: () { var commentText = commentTextController.text; if (commentText == "") { @@ -641,35 +658,93 @@ class _StoreDetailsPage extends State } queryMemberComment(commentText); }, - child: Text( - S.of(context).fasong, - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0XFF1A1A1A), + 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), + ), ), ), ), - ), - GestureDetector( - onTap: () { - if (isLiked) return; - queryInformationLikes(); - }, - child: Image.asset( - isLiked - ? "assets/image/icon_like.png" - : "assets/image/icon_like_h.png", - fit: BoxFit.fill, - width: 24, - height: 24, + if (!isKeyBoardShow) + InkWell( + onTap: toComment, + child: Container( + padding: EdgeInsets.only(left: 20, right: 10), + child: Image.asset( + "assets/image/icon_comment.png", + width: 24, + height: 24, + ), + ), + ), + if (!isKeyBoardShow) + 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.png", + width: 24, + height: 24, + ) + : Image.asset( + "assets/image/icon_like_h.png", + width: 24, + height: 24, + ); + }, + isLiked: (activity != null + ? activity.liked + : article != null + ? article.liked + : false), + onTap: (isLiked) async { + await queryInformationLikes(); + return (activity != null + ? activity.liked + : article != null + ? article.liked + : false); + }, + // likeCount: memberList.likes, + countBuilder: (int count, bool isLiked, String text) { + return Text( + text, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 12.sp, + ), + ); + }, ), - ) ], ), ); } + toComment() { + if (commentKey.currentContext == null) return; + RenderBox firstRenderBox = commentKey.currentContext.findRenderObject(); + Offset first = firstRenderBox.localToGlobal(Offset.zero); + scrollController.animateTo(first.dy + scrollController.offset - (kToolbarHeight + MediaQuery.of(context).padding.top), duration: Duration(milliseconds: 100), curve: Curves.easeIn); + } + VideoPlayerController videoPlayerController; ChewieController chewieAudioController; Chewie chewies; @@ -784,7 +859,6 @@ class _StoreDetailsPage extends State alignment: Alignment.topRight, child: LikeButton( padding: EdgeInsets.all(10), - size: 16, circleSize: 16, circleColor: CircleColor( start: Color(0xff00ddff), end: Color(0xff0099cc)), diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index fbd107dd..008e376b 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -63,8 +63,7 @@ class _UnionDetailsPage extends State { List activitys; queryStoreInfo() async { - BaseData baseData = await apiService - .queryStoreInfo(widget.arguments["id"]) + BaseData baseData = await apiService.queryStoreInfo(widget.arguments["id"]) .catchError((error) { refreshController.refreshFailed(); }); @@ -198,10 +197,8 @@ class _UnionDetailsPage extends State { ), ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, children: [ Expanded( child: Text( @@ -258,14 +255,14 @@ class _UnionDetailsPage extends State { width: 24.w, height: 24.h, ), - ) + ), ], ), ], ), ), flex: 1, - ) + ), ], ), ), diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 3d784eef..2ab441d8 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -190,7 +190,7 @@ class _UnionPage extends State List storeList; queryStore(latitude, longitude, province, city, district, searchKey) async { - BaseData baseData = await apiService.queryStore({ + BaseData> baseData = await apiService.queryStore({ // "city": city, // "district": district, // "province": province, @@ -202,10 +202,7 @@ class _UnionPage extends State }); SmartDialog.dismiss(); if (baseData != null && baseData.isSuccess) { - storeList = (baseData.data as List) - .map((e) => Store.fromJson(e)) - .toList(); - // buildMarker(); + storeList = baseData.data; refreshController.refreshCompleted(); if (mounted) setState(() {}); } else { diff --git a/pubspec.lock b/pubspec.lock index b7f09328..b8f9df2e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.5.0" + version: "2.6.1" barcode: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.19" + version: "0.3.0" timing: dependency: transitive description: