From 96295c50412cc7b6501b657868edba70becb5b9b Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 20 Jan 2022 01:16:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=83=A8=E5=88=86,=E7=A4=BE?= =?UTF-8?q?=E7=BE=A4=E5=A4=B4=E6=9D=A1=E6=9B=B4=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/activity_hot.png | Bin 0 -> 1742 bytes assets/image/3x/activity_hot.png | Bin 0 -> 3073 bytes assets/image/activity_hot.png | Bin 0 -> 812 bytes .../community_view/class_details.dart | 3 +- lib/community/community_view/home_class.dart | 5 +- .../headlines/activity_top_list.dart | 165 ++++++++++++++++++ lib/community/headlines/article_page.dart | 30 +++- .../headlines/headlines_column_details.dart | 3 +- lib/home/home_page.dart | 6 +- lib/message/system_details.dart | 19 +- lib/message/system_message.dart | 8 +- lib/retrofit/retrofit_api.dart | 8 +- lib/retrofit/retrofit_api.g.dart | 2 +- 13 files changed, 218 insertions(+), 31 deletions(-) create mode 100644 assets/image/2x/activity_hot.png create mode 100644 assets/image/3x/activity_hot.png create mode 100644 assets/image/activity_hot.png create mode 100644 lib/community/headlines/activity_top_list.dart diff --git a/assets/image/2x/activity_hot.png b/assets/image/2x/activity_hot.png new file mode 100644 index 0000000000000000000000000000000000000000..99d96f82621beedca392710158e76170fd72f74e GIT binary patch literal 1742 zcmV;<1~K`GP)Px*h)G02R9Hu~SZiz)RTTct?5lJOyVHSIfd~Q#2_^(=5F;oR*j-9QNx)zNhDW55 zhWNlL2)=?~1SI_fC19=C7%(;vE=f z&~_10qQEN*tOPJN%YfGfqMB$pyuYZasmCbSkiowe zEy}ls!|xFADu8^W;;C>1v@5_?$>G>b_4RQ*EnS1{^XETKf^dj|hxNp=od4crGQHqz zXt{#?{-wx&0tz0DfIm~M%zrQBQVDH?yV?t*0O$Kbas26P82J4I&Py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z)jviX#oSFM@BqG*PXI`WZP`}qm+@M)tFVME+!aLLk~g)s4iZ8XG0{U{ z{%y>RqIdicfQ>?k_m5UrpZde0LrGutNeSVuI?G2`^&fwn!@wO(l*7zU0@C>WGaebW z$)`N>c@8s6>&XWj@|}`=!yupWoMgajR+JsqJ$t@N(ZqGaq?~Y91?9O_KcYc?RlNf8 zp%#&ym@NXZr~p&@JEc|@;w-7^X)+p5X5V~sRk)x(Rm6LhaH^C{CC>i=MU|C#g?@m4 P00000NkvXXu0mjf!!^*; literal 0 HcmV?d00001 diff --git a/assets/image/activity_hot.png b/assets/image/activity_hot.png new file mode 100644 index 0000000000000000000000000000000000000000..c7eb44da2e42fb5fb4cb46f51dd0a7b9175ee90e GIT binary patch literal 812 zcmV+{1JnG8P)Px%=1D|BR5(wKmCH*TQ543%b0=2g`w{T5t9>ADT(p)_Td;(gEG!h%QmHg(u@-bE zw2Lm>ND*C#uVUyQU`q&8q=A}oq1J_u(n4JnMA3yCwMHWv&1+6cY|>;B#aYcg-*Srd0zd1HfS3Vqn2EJ^lNG(JTi;EY9e^TUfIfwz; zm*q7kDo^Ro%tV3R4rm%Y9UaiNw}C()*~+|Jq^fu5K$dTZh?bKaL;y3=8yb++-X4*C zv$F_oY``})1$Mg=TEcD;qMZK7awidu>Va3xW&~GPkvljDk)0ip+3$z8vxCs)CXRY~ zl2e94P2`s4cTDtFujY=9f^u>om6SxJ6NdxF#>O)+Gdyi=(6+V`+62&*5@@KZLT-P5 z#H@Kd;L}rhtX5=ocO$)~CQ?5h9){29)aU3Tx1w|~@IGEKTCFfPH=iZ5+Ywky&A~e`pr7tyk;`>A zvQqXemX~1u5bu!6%aLAJ2k*#8tSm}Pkx^d{ugwO8LJ2@-t~aUb=jhTC`-(Edz=H&r z!2kq<|4WjT1p4>YCrzsQID8-59FEN9VxJJ-Ky*Vtmy5>4{1eO%3#X?&3Bd4R+iWgQ z6XFvS)m{e5z!%Bye_k*%a}ay~`o{3u-cuASF~0#(WhyWMKLpU5?{YcxdeV*^Z`d=N qD}^LgbKDUi39*njHMMr$4E_SNOB}!gflKxP0000 with WidgetsBindingObserver { Row( children: [ Container( - height: 22.h, + // height: 22.h, padding:EdgeInsets.only(left:2,right:2), alignment: Alignment.center, decoration: BoxDecoration( @@ -216,6 +216,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { course.tags.length > 0) ? course.tags[0] : "", + overflow:TextOverflow.ellipsis, style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.medium, diff --git a/lib/community/community_view/home_class.dart b/lib/community/community_view/home_class.dart index 52acdfc8..78435916 100644 --- a/lib/community/community_view/home_class.dart +++ b/lib/community/community_view/home_class.dart @@ -220,7 +220,7 @@ class _HomeClass extends State { Container( margin: EdgeInsets.only(top: 8, right: 8), padding: EdgeInsets.only(left: 2, right: 2), - height: 16.h, + height: 20.h, alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(2), @@ -230,8 +230,9 @@ class _HomeClass extends State { (collect?.tags != null && collect.tags.length > 0) ? collect.tags[0] : "", + overflow:TextOverflow.ellipsis, style: TextStyle( - fontSize: 12.sp, + fontSize: 11.sp, fontWeight: MyFontWeight.medium, color: Color(0xFF634815), ), diff --git a/lib/community/headlines/activity_top_list.dart b/lib/community/headlines/activity_top_list.dart new file mode 100644 index 00000000..e744c6aa --- /dev/null +++ b/lib/community/headlines/activity_top_list.dart @@ -0,0 +1,165 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:huixiang/retrofit/data/collect_class_list.dart'; +import 'package:huixiang/retrofit/data/course_list.dart'; +import 'package:huixiang/retrofit/data/headlines_list.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/new_people_reward.dart'; + +class ActivityTopList extends StatefulWidget { + final List
articleTop; + + ActivityTopList(this.articleTop); + + @override + State createState() { + return _ActivityTopList(); + } +} + +class _ActivityTopList extends State { + ApiService apiService; + BMFCoordinate latLng; + + final TextEditingController editingController = TextEditingController(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + height: 220.h, + margin: EdgeInsets.only(top: 10), + child: ListView.builder( + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.symmetric(horizontal: 10), + itemCount: widget.articleTop == null ? 0 : widget.articleTop.length, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/headlines_column_details', + arguments: {"id": widget.articleTop[position].id}); + }, + child: headlinesCollectionItem(widget.articleTop[position], position), + ); + }, + ), + ); + } + + Widget headlinesCollectionItem(Article articles, index) { + return Container( + width: 320.w, + height: 220.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(10), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.black, + ), + margin: EdgeInsets.symmetric( + horizontal: 6, + ), + child: Stack( + alignment: Alignment.bottomLeft, + children: [ + Stack( + children: [ + ClipRRect( + child: Opacity( + opacity: 0.8, + child: MImage( + widget?.articleTop[index]?.coverImg ?? "", + width: 320.w, + height: 220.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), + ), + borderRadius: BorderRadius.vertical( + top: Radius.circular(4), + bottom: Radius.circular(4), + ), + ), + Container( + padding: EdgeInsets.only(left: 12.w, right: 12.w, top: 8), + alignment: Alignment.topLeft, + child: Row( + children: [ + Image.asset( + "assets/image/activity_hot.png", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + SizedBox( + width: 4.w, + ), + Expanded( + child: Text( + "精选好文", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ), + ], + )), + ], + ), + Positioned( + top:130, + left: 12, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget?.articleTop[index]?.mainTitle ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + Text( + widget?.articleTop[index]?.viceTitle ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ], + )) + + ], + ), + ); + } +} diff --git a/lib/community/headlines/article_page.dart b/lib/community/headlines/article_page.dart index 6c6f928d..25e7f92c 100644 --- a/lib/community/headlines/article_page.dart +++ b/lib/community/headlines/article_page.dart @@ -25,6 +25,7 @@ import 'package:huixiang/view_widget/store_title_tab.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'activity_top_list.dart'; import 'article_list.dart'; class ArticlePage extends StatefulWidget { @@ -44,6 +45,7 @@ class _ArticlePage extends State List brands = []; List bannerData = []; List
articles = []; + List
articleTop = []; List headlines = []; int pageNum = 1; @@ -57,7 +59,8 @@ class _ArticlePage extends State setState(() {}); } }); - queryArticleList(); + queryArticleList(false); + queryArticleList(true); queryHeadlinesBanner(); queryHeadlinesList(); } @@ -95,7 +98,7 @@ class _ArticlePage extends State } ///文章列表 - queryArticleList() async { + queryArticleList(bool isHot) async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); apiService = ApiService( @@ -109,7 +112,9 @@ class _ArticlePage extends State "pageSize": 10, "searchKey": "", "state": 1, - "type": 2 + "type": 2, + "storeId":"", + "isHot":isHot }).catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); @@ -118,9 +123,15 @@ class _ArticlePage extends State refreshController.refreshCompleted(); refreshController.loadComplete(); if (pageNum == 1) { + if(!isHot) articles.clear(); + else + articleTop.clear(); } + if(!isHot) articles.addAll(baseData.data.list); + else + articleTop.addAll(baseData.data.list); if (baseData.data.pageNum == baseData.data.pages) { refreshController.loadNoData(); } else { @@ -160,7 +171,8 @@ class _ArticlePage extends State _onRefresh() { queryHeadlinesBanner(); queryHeadlinesList(); //分类列表 - queryArticleList(); + queryArticleList(false); + queryArticleList(true); } @override @@ -182,7 +194,7 @@ class _ArticlePage extends State ), onRefresh: _onRefresh, onLoading: () { - queryArticleList(); + queryArticleList(false); }, physics: BouncingScrollPhysics(), scrollController: scrollController, @@ -227,9 +239,11 @@ class _ArticlePage extends State List classChildItem() { var widgets = [ ///文章banner - HeadlinesBanner( - bannerData, - ), + // HeadlinesBanner( + // bannerData, + // ), + + ActivityTopList(articleTop), SizedBox(height: 28), diff --git a/lib/community/headlines/headlines_column_details.dart b/lib/community/headlines/headlines_column_details.dart index ebf21fd3..0d8e875e 100644 --- a/lib/community/headlines/headlines_column_details.dart +++ b/lib/community/headlines/headlines_column_details.dart @@ -78,7 +78,8 @@ class _HeadlinesColumnDetails extends State "searchKey": "", "state": 1, "type": 2, - "categoryId": categoryId + "categoryId": categoryId, + "isHot":"", }).catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 3e436c43..4b3e26db 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -66,6 +66,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { setState(() {}); } }); + queryMsgStats(); if ((widget.invite ?? "") != "" || widget.interviewCouponList != null && @@ -259,12 +260,13 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { BaseData> baseData = await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { + totalMsg = 0; baseData.data.forEach((element) { totalMsg += element.number; }); }); - refreshController.loadComplete(); - refreshController.refreshCompleted(); + // refreshController.loadComplete(); + // refreshController.refreshCompleted(); } EasyLoading.dismiss(); } diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index d6efc02d..4c474773 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -37,13 +37,14 @@ class _SystemDetails extends State { int pageNum = 1; List messages = []; int msgType = 0; - String parenId = "0"; + // String parenId = "0"; var commentFocus = FocusNode(); String hintText = S.current.liuxianinjingcaidepinglunba; bool isKeyBoardShow = false; final GlobalKey commentKey = GlobalKey(); final GlobalKey inputKey = GlobalKey(); final TextEditingController commentTextController = TextEditingController(); + int indexMsg = 0; @override @@ -108,17 +109,18 @@ class _SystemDetails extends State { ///评论 回复 _reply(messageRelational) { - var messageRelational = jsonDecode(messages[0].relational), - parenId = messageRelational["mid"].toString(); + var messageRelational = jsonDecode(messages[indexMsg].relational); + messageRelational["mid"].toString(); hintText = S.of(context).huifu_("${messageRelational["nickname"]}"); } ///动态发布评论 _queryMemberComment(String content) async { + var messageRelational = jsonDecode(messages[indexMsg].relational); BaseData baseData = await apiService.memberComment({ "content": content, - "parentId": parenId, - "relationalId": messages[0].mid, + "parentId": messageRelational["mid"].toString(), + "relationalId":messageRelational["businessId"].toString(), "relationalType":4 }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { @@ -130,7 +132,7 @@ class _SystemDetails extends State { SmartDialog.showToast("发布成功", alignment: Alignment.center); } else{ - SmartDialog.showToast("发布失败", alignment: Alignment.center); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -627,14 +629,14 @@ class _SystemDetails extends State { }, ); }, - child: commentMessageItem(messages[position]), + child: commentMessageItem(messages[position],position), ); }), ], ) ); } - Widget commentMessageItem(Message message) { + Widget commentMessageItem(Message message,index) { var messageRelational = jsonDecode(message.relational); return Container( child: @@ -697,6 +699,7 @@ class _SystemDetails extends State { GestureDetector( onTap: (){ setState(() { + indexMsg = index; showDeleteDialog(); _reply(messageRelational); }); diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 9be81392..f8276451 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -28,7 +28,6 @@ class _SystemMessagePage extends State { ApiService apiService; int pageNum = 1; List messages = []; - List msgStats = []; Map msgNumber = { "1":0, "2":0, @@ -106,9 +105,10 @@ class _SystemMessagePage extends State { BaseData> baseData = await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { - msgStats.clear(); - msgStats = baseData.data; - msgStats.forEach((element) { + msgNumber.forEach((key, value) { + msgNumber[key] = 0; + }); + baseData.data.forEach((element) { if(msgNumber.containsKey(element.name)){ msgNumber[element.name] = element.number; } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 24fa7fba..b08fd3cd 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -54,14 +54,14 @@ import 'data/wx_pay.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.159:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.159:8766/app/"; ///费韬 diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 5735110a..71083690 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;